AnyChest supports Shulker Boxes, silent makes sound but doesn't animate.

I'm done for the day, got a lot of stuff to do tomorrow. Hopefully I'll iron out all of the wrinkles by the end of the day.
This commit is contained in:
Jikoo
2016-11-18 01:51:11 -05:00
parent ff683d65d1
commit 9501d1c571
43 changed files with 178 additions and 93 deletions

View File

@@ -107,7 +107,7 @@ public class OpenInv extends JavaPlugin {
accessor = new InternalAccessor(this);
// Version check
if (!accessor.initialize(getServer())) {
getLogger().info("Your version of CraftBukkit is not supported.");
getLogger().info("Your version of CraftBukkit (" + accessor.getVersion() + ")is not supported.");
getLogger().info("Please look for an updated version of OpenInv.");
pm.disablePlugin(this);
return;

View File

@@ -56,13 +56,14 @@ public class OpenInvPlayerListener implements Listener {
if (event.getClickedBlock().getType() == org.bukkit.Material.ENDER_CHEST) {
if (OpenInv.hasPermission(player, Permissions.PERM_SILENT)
&& plugin.getPlayerSilentChestStatus(player)) {
// TODO: Bypasses blocks on top, anychest also does not work
event.setCancelled(true);
player.openInventory(player.getEnderChest());
}
return;
}
if (plugin.getAnySilentContainer().isAnySilentContainer(event.getClickedBlock())) {
if (plugin.getAnySilentContainer().isAnySilentContainer(event.getClickedBlock().getState())) {
boolean silentchest = OpenInv.hasPermission(player, Permissions.PERM_SILENT) && plugin.getPlayerSilentChestStatus(player);
boolean anychest = OpenInv.hasPermission(player, Permissions.PERM_ANYCHEST) && plugin.getPlayerAnyChestStatus(player);
@@ -79,6 +80,7 @@ public class OpenInvPlayerListener implements Listener {
} else if (silentchest && plugin.notifySilentChest()) {
player.sendMessage("You are opening a chest silently.");
} else if (anychest && plugin.notifyAnyChest()) {
// TODO fix anychest always claiming chest is blocked
player.sendMessage("You are opening a blocked chest.");
}
event.setCancelled(true);

View File

@@ -43,7 +43,7 @@ public class InternalAccessor {
version = packageName.substring(packageName.lastIndexOf('.') + 1);
try {
Class.forName("com.lishid.openinv.internal." + version + ".AnySilentChest");
Class.forName("com.lishid.openinv.internal." + version + ".AnySilentContainer");
return true;
}
catch (Exception e) {
@@ -51,6 +51,10 @@ public class InternalAccessor {
}
}
public String getVersion() {
return this.version != null ? this.version : "null";
}
private void printErrorMessage() {
plugin.getLogger().warning("OpenInv encountered an error with the CraftBukkit version \"" + version + "\". Please look for an updated version of OpenInv.");
}