mirror of
https://github.com/exituser/Brewery.git
synced 2026-09-17 07:49:03 +00:00
Refractor Barrel
This commit is contained in:
@@ -76,7 +76,7 @@ public class IntegrationListener implements Listener {
|
||||
|
||||
// If the Clicked Block was the Sign, LWC already knows and we dont need to do anything here
|
||||
if (!LegacyUtil.isSign(event.getClickedBlock().getType())) {
|
||||
Block sign = event.getBarrel().getSignOfSpigot();
|
||||
Block sign = event.getBarrel().getBody().getSignOfSpigot();
|
||||
// If the Barrel does not have a Sign, it cannot be locked
|
||||
if (!sign.equals(event.getClickedBlock())) {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
@@ -24,7 +24,7 @@ public class LWCBarrel {
|
||||
|
||||
public static boolean denyDestroy(Player player, Barrel barrel) {
|
||||
LWC lwc = LWC.getInstance();
|
||||
Block sign = barrel.getSignOfSpigot();
|
||||
Block sign = barrel.getBody().getSignOfSpigot();
|
||||
//if (!Boolean.parseBoolean(lwc.resolveProtectionConfiguration(sign, "ignoreBlockDestruction"))) {
|
||||
Protection protection = lwc.findProtection(sign);
|
||||
if (protection != null) {
|
||||
@@ -82,7 +82,7 @@ public class LWCBarrel {
|
||||
|
||||
// If a Barrel is destroyed without player
|
||||
public static void remove(Barrel barrel) {
|
||||
Protection protection = LWC.getInstance().findProtection(barrel.getSignOfSpigot());
|
||||
Protection protection = LWC.getInstance().findProtection(barrel.getBody().getSignOfSpigot());
|
||||
if (protection != null) {
|
||||
protection.remove();
|
||||
}
|
||||
@@ -90,13 +90,13 @@ public class LWCBarrel {
|
||||
|
||||
// Returns true if the block that exploded should not be removed
|
||||
public static boolean denyExplosion(Barrel barrel) {
|
||||
Protection protection = LWC.getInstance().findProtection(barrel.getSignOfSpigot());
|
||||
Protection protection = LWC.getInstance().findProtection(barrel.getBody().getSignOfSpigot());
|
||||
|
||||
return protection != null && !protection.hasFlag(Flag.Type.ALLOWEXPLOSIONS);
|
||||
}
|
||||
|
||||
// Returns true if the block that was destroyed should not be removed
|
||||
public static boolean denyDestroyOther(Barrel barrel) {
|
||||
return LWC.getInstance().findProtection(barrel.getSignOfSpigot()) != null;
|
||||
return LWC.getInstance().findProtection(barrel.getBody().getSignOfSpigot()) != null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user