Resorted plates to see if they match on lookup

This commit is contained in:
SvenjaReißaus 2019-03-19 00:53:05 -05:00
parent 29640925eb
commit ba5ee1ae48
No known key found for this signature in database
GPG Key ID: E5494A03FA36D54B
2 changed files with 4 additions and 9 deletions

View File

@ -919,6 +919,10 @@ public class FactionsPlayerListener implements Listener {
return GetPermissionFromUsableBlock(block.getType());
}
private static PermissableAction GetPermissionFromUsableBlock(Material material) {
// Check for doors that might have diff material name in old version.
if (material.name().contains("DOOR"))
return PermissableAction.DOOR;
if (material.name().toUpperCase().contains("BUTTON") || material.name().toUpperCase().contains("PRESSURE")) return PermissableAction.BUTTON;
if (SavageFactions.plugin.mc113) {
switch (material) {
case LEVER:
@ -993,10 +997,6 @@ public class FactionsPlayerListener implements Listener {
case DAMAGED_ANVIL:
return PermissableAction.CONTAINER;
default:
// Check for doors that might have diff material name in old version.
if (material.name().contains("DOOR"))
return PermissableAction.DOOR;
if (material.name().toUpperCase().contains("BUTTON") || material.name().toUpperCase().contains("PRESSURE")) return PermissableAction.BUTTON;
return null;
}
} else {
@ -1029,11 +1029,6 @@ public class FactionsPlayerListener implements Listener {
case BREWING_STAND:
return PermissableAction.CONTAINER;
default:
// Check for doors that might have diff material name in old version.
if (material.name().contains("DOOR"))
return PermissableAction.DOOR;
if (material.toString().toUpperCase().contains("BUTTON") || material.toString().toUpperCase().contains("PRESSURE"))
return PermissableAction.BUTTON;
return null;
}
}