Merge commit '5e40f2d' into fix/legacy-material-dispense

Legacy material dispenser fix
This commit is contained in:
NotAlexNoyle committed 2025-06-27 12:30:32 -04:00
commit 98c0202017
2 files changed
+11 -9

No files matched your search

@@ -842,7 +842,7 @@ public class fListener implements Listener {
}
if (Protections.PreventEndPortalDestruction.isEnabled()) {
if (Material.matchMaterial("END_PORTAL") != null) {
if (e.getItem().getType().name().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,13 +850,13 @@ 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()));
}
} else {
for (BlockFace face : BlockFace.values()) {
if (e.getBlock().getRelative(face).getType().name().contains("END_PORTAL")) {
e.setCancelled(true);
getLog().append2(Msg.StaffEndPortalProtected.getValue(e.getBlock().getLocation().toString()));
}
}
}
}
@@ -53,8 +53,10 @@ public class TrackedProjectile {
if(System.currentTimeMillis() > tp.despawnTimestamp) {
//projectile has expired remove it.
if(tp.entity != null) {
removed.add(tp);
tp.entity.remove();
tp.entity.getScheduler().run(IllegalStack.getPlugin(), task -> {
removed.add(tp);
tp.entity.remove();
}, null);
}
}