Update fListener.java

This commit is contained in:
ILikePtatoes authored and GitHub committed 2025-02-04 22:13:32 +11:00
1 parent b6822e84f7
commit 5ef150838b
1 file changed
+1 -9
@@ -842,7 +842,7 @@ public class fListener implements Listener {
}
if (Protections.PreventEndPortalDestruction.isEnabled()) {
if (Material.matchMaterial("END_PORTAL") != null) {
if (Material.getType().getName().contains("END_PORTAL")) {
if (e.getBlock().getState().getBlockData() instanceof Directional) {
Directional d = (Directional) e.getBlock().getState().getBlockData();
if (e.getBlock().getRelative(d.getFacing()).getType() == Material.END_PORTAL) {
@@ -850,14 +850,6 @@ public class fListener implements Listener {
getLog().append2(Msg.StaffEndPortalProtected.getValue(e.getBlock().getLocation().toString()));
}
}
} else { //1.12 and below don't have directional data have to do this another way.
for (BlockFace face : BlockFace.values()) {
if (e.getBlock().getRelative(face).getType() == endPortal) {
e.setCancelled(true);
getLog().append2(Msg.StaffEndPortalProtected.getValue(e.getBlock().getLocation().toString()));
}
}
}
}
}