mirror of
https://github.com/CivMC/Civ.git
synced 2026-07-18 00:20:44 +00:00
Fixed BedsCommand.
This commit is contained in:
@@ -2,12 +2,10 @@ package me.Josvth.RandomSpawn.Commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import me.Josvth.RandomSpawn.RandomSpawnCommandExecutor;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class BedsCommand extends RandomSpawnCommandExecutor{
|
||||
public class BedsCommand extends AbstractCommand{
|
||||
|
||||
public BedsCommand(){
|
||||
name = "usebeds";
|
||||
@@ -23,11 +21,13 @@ public class BedsCommand extends RandomSpawnCommandExecutor{
|
||||
if (args.size() == 0){
|
||||
if (randomSpawnFlags.contains("bedrespawn")){
|
||||
randomSpawnFlags.remove("bedrespawn");
|
||||
plugin.yamlHandler.worlds.set(worldName + ".randomspawnon", randomSpawnFlags);
|
||||
plugin.playerInfo((Player)sender, "Beds are now disabled.");
|
||||
plugin.yamlHandler.saveWorlds();
|
||||
return true;
|
||||
}else{
|
||||
randomSpawnFlags.add("bedspawn");
|
||||
randomSpawnFlags.add("bedrespawn");
|
||||
plugin.yamlHandler.worlds.set(worldName + ".randomspawnon", randomSpawnFlags);
|
||||
plugin.playerInfo((Player)sender, "Beds will now work like normal.");
|
||||
plugin.yamlHandler.saveWorlds();
|
||||
return true;
|
||||
@@ -36,13 +36,15 @@ public class BedsCommand extends RandomSpawnCommandExecutor{
|
||||
|
||||
if (args.size() == 1){
|
||||
if (args.get(0).matches("true")){
|
||||
randomSpawnFlags.add("bedspawn");
|
||||
randomSpawnFlags.add("bedrespawn");
|
||||
plugin.yamlHandler.worlds.set(worldName + ".randomspawnon", randomSpawnFlags);
|
||||
plugin.playerInfo((Player)sender, "Beds will now work like normal.");
|
||||
plugin.yamlHandler.saveWorlds();
|
||||
return true;
|
||||
}
|
||||
if (args.get(0).matches("false")){
|
||||
randomSpawnFlags.remove("bedrespawn");
|
||||
plugin.yamlHandler.worlds.set(worldName + ".randomspawnon", randomSpawnFlags);
|
||||
plugin.playerInfo((Player)sender, "Beds are now disabled.");
|
||||
plugin.yamlHandler.saveWorlds();
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user