Add back chairs on/off command
This commit is contained in:
parent
cd44f2f5b1
commit
9f5efa2e6e
@ -38,6 +38,16 @@ public class ChairsCommand implements CommandExecutor {
|
|||||||
sender.sendMessage(plugin.msgNoPerm);
|
sender.sendMessage(plugin.msgNoPerm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
Player player = (Player) sender;
|
||||||
|
if (args[0].equalsIgnoreCase("off")) {
|
||||||
|
plugin.sitDisabled.add(player.getName());
|
||||||
|
player.sendMessage("Disabled sitting");
|
||||||
|
} else if (args[0].equalsIgnoreCase("on")) {
|
||||||
|
plugin.sitDisabled.remove(player.getName());
|
||||||
|
player.sendMessage("Enabled sitting");
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ import com.cnaude.chairs.vehiclearrow.NMSAccess;
|
|||||||
|
|
||||||
public class Chairs extends JavaPlugin {
|
public class Chairs extends JavaPlugin {
|
||||||
|
|
||||||
|
public HashSet<String> sitDisabled = new HashSet<String>();
|
||||||
public ChairEffects chairEffects;
|
public ChairEffects chairEffects;
|
||||||
public List<ChairBlock> allowedBlocks;
|
public List<ChairBlock> allowedBlocks;
|
||||||
public List<Material> validSigns;
|
public List<Material> validSigns;
|
||||||
|
@ -42,6 +42,12 @@ public class TrySitEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean sitAllowed(Player player, Block block) {
|
private boolean sitAllowed(Player player, Block block) {
|
||||||
|
|
||||||
|
// Check for sitting disabled
|
||||||
|
if (plugin.sitDisabled.contains(player.getName())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Check for permissions
|
// Check for permissions
|
||||||
if (!player.hasPermission("chairs.sit")) {
|
if (!player.hasPermission("chairs.sit")) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user