Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/main/java/main/java/me/dniym/listeners/fListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -842,21 +842,21 @@ public void onDispenserDispense(BlockDispenseEvent e) {

}
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) {
e.setCancelled(true);
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()));

}
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/main/java/me/dniym/util/TrackedProjectile.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ public static void manage() {
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);

}
}
Expand Down