For now always check if sit is occupied otherwise it can glitch like hell

This commit is contained in:
Shevchik 2013-09-03 21:25:46 +04:00
parent 3177a63ba2
commit 4d9ae43d0c
4 changed files with 10 additions and 15 deletions

View File

@ -30,7 +30,7 @@ public class Chairs extends JavaPlugin {
public List<ChairBlock> allowedBlocks; public List<ChairBlock> allowedBlocks;
public List<Material> validSigns; public List<Material> validSigns;
public boolean autoRotate, signCheck, permissions, notifyplayer, opsOverridePerms; public boolean autoRotate, signCheck, permissions, notifyplayer, opsOverridePerms;
public boolean invertedStairCheck, seatOccupiedCheck, invertedStepCheck, perItemPerms, ignoreIfBlockInHand; public boolean invertedStairCheck, invertedStepCheck, perItemPerms, ignoreIfBlockInHand;
public boolean sitEffectsEnabled; public boolean sitEffectsEnabled;
public boolean authmelogincorrection; public boolean authmelogincorrection;
public double sittingHeight, sittingHeightAdj, distance; public double sittingHeight, sittingHeightAdj, distance;
@ -177,7 +177,6 @@ public class Chairs extends JavaPlugin {
permissions = getConfig().getBoolean("permissions"); permissions = getConfig().getBoolean("permissions");
notifyplayer = getConfig().getBoolean("notify-player"); notifyplayer = getConfig().getBoolean("notify-player");
invertedStairCheck = getConfig().getBoolean("upside-down-check"); invertedStairCheck = getConfig().getBoolean("upside-down-check");
seatOccupiedCheck = getConfig().getBoolean("seat-occupied-check");
invertedStepCheck = getConfig().getBoolean("upper-step-check"); invertedStepCheck = getConfig().getBoolean("upper-step-check");
perItemPerms = getConfig().getBoolean("per-item-perms"); perItemPerms = getConfig().getBoolean("per-item-perms");
opsOverridePerms = getConfig().getBoolean("ops-override-perms"); opsOverridePerms = getConfig().getBoolean("ops-override-perms");

View File

@ -244,20 +244,17 @@ public class EventListener implements Listener {
} }
} }
// Sit-down process. //Sit occupied check
if (plugin.seatOccupiedCheck) { if (plugin.sitblock.containsKey(block))
if (!plugin.sit.isEmpty()) { {
if (plugin.sitblock.containsKey(block)) if (!plugin.msgOccupied.isEmpty()) {
{ player.sendMessage(plugin.msgOccupied.replaceAll("%PLAYER%", plugin.sitblock.get(block)));
if (!plugin.msgOccupied.isEmpty()) { }
player.sendMessage(plugin.msgOccupied.replaceAll("%PLAYER%", plugin.sitblock.get(block))); return false;
} }
return false;
}
}
}
} }
return true; return true;
} }
private Location getSitLocation(Block block, Float playerYaw) private Location getSitLocation(Block block, Float playerYaw)

View File

@ -41,7 +41,6 @@ sitting-height-adj: 1.0
permissions: true permissions: true
notify-player: true notify-player: true
upside-down-check: true upside-down-check: true
seat-occupied-check: true
upper-step-check: true upper-step-check: true
per-item-perms: true per-item-perms: true
ops-override-perms: false ops-override-perms: false

Binary file not shown.