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:
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -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.");
|
||||
}
|
||||
|
Reference in New Issue
Block a user