Format source
This commit is contained in:
parent
e838c79941
commit
9f9eca6fae
@ -24,8 +24,7 @@ public class ChairsIgnoreList implements Serializable{
|
||||
private static final String IGNORE_FILE = "plugins/Chairs/ignores.ser";
|
||||
|
||||
private Chairs plugin;
|
||||
public ChairsIgnoreList(Chairs plugin)
|
||||
{
|
||||
public ChairsIgnoreList(Chairs plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@ -66,12 +65,10 @@ public class ChairsIgnoreList implements Serializable{
|
||||
if (ignoreList.contains(s)) {
|
||||
return;
|
||||
}
|
||||
//Chairs.get().logInfo("Adding " + s + " to ignore list.");
|
||||
ignoreList.add(s);
|
||||
}
|
||||
|
||||
public void removePlayer(String s) {
|
||||
//Chairs.get().logInfo("Removing " + s + " from ignore list.");
|
||||
ignoreList.remove(s);
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@ import com.cnaude.chairs.sitaddons.CommandRestrict;
|
||||
import com.cnaude.chairs.vehiclearrow.NMSAccess;
|
||||
|
||||
public class Chairs extends JavaPlugin {
|
||||
|
||||
public ChairEffects chairEffects;
|
||||
public List<ChairBlock> allowedBlocks;
|
||||
public List<Material> validSigns;
|
||||
@ -45,7 +46,6 @@ public class Chairs extends JavaPlugin {
|
||||
public String msgSitting, msgStanding, msgOccupied, msgNoPerm, msgReloaded, msgDisabled, msgEnabled, msgCommandRestricted;
|
||||
|
||||
|
||||
|
||||
private PlayerSitData psitdata;
|
||||
public PlayerSitData getPlayerSitData() {
|
||||
return psitdata;
|
||||
|
@ -16,25 +16,19 @@ public class CommandRestrict implements Listener {
|
||||
}
|
||||
|
||||
@EventHandler(priority=EventPriority.LOWEST)
|
||||
public void onPlayerCommand(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
public void onPlayerCommand(PlayerCommandPreprocessEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
String playercommand = event.getMessage().toLowerCase();
|
||||
if (plugin.getPlayerSitData().isSitting(player))
|
||||
{
|
||||
if (plugin.sitDisableAllCommands)
|
||||
{
|
||||
if (plugin.getPlayerSitData().isSitting(player)) {
|
||||
if (plugin.sitDisableAllCommands) {
|
||||
event.setCancelled(true);
|
||||
player.sendMessage(plugin.msgCommandRestricted);
|
||||
return;
|
||||
}
|
||||
for (String disabledCommand : plugin.sitDisabledCommands)
|
||||
{
|
||||
if (disabledCommand.startsWith(playercommand))
|
||||
{
|
||||
for (String disabledCommand : plugin.sitDisabledCommands) {
|
||||
if (disabledCommand.startsWith(playercommand)) {
|
||||
String therest = playercommand.replace(disabledCommand, "");
|
||||
if (therest.isEmpty() || therest.startsWith(" "))
|
||||
{
|
||||
if (therest.isEmpty() || therest.startsWith(" ")) {
|
||||
event.setCancelled(true);
|
||||
player.sendMessage(plugin.msgCommandRestricted);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user