diff --git a/src/main/java/me/zgoly/griefmex/GriefMeX.java b/src/main/java/me/zgoly/griefmex/GriefMeX.java index 214e343..464a781 100644 --- a/src/main/java/me/zgoly/griefmex/GriefMeX.java +++ b/src/main/java/me/zgoly/griefmex/GriefMeX.java @@ -1,13 +1,18 @@ package me.zgoly.griefmex; -import org.bukkit.Material; +import org.bukkit.block.Block; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityExplodeEvent; +import java.util.Iterator; public class GriefMeX implements Listener { @EventHandler public void onDestroy(EntityExplodeEvent e) { - e.blockList().removeIf(b -> b.getType() != Material.CHEST || b.getType() != Material.SHULKER_BOX); + Iterator iterator = e.blockList().iterator(); + while(iterator.hasNext()) { + String m = iterator.next().getType().name(); + if (!m.endsWith("CHEST") && !m.endsWith("SHULKER_BOX")) iterator.remove(); + } } -} +} \ No newline at end of file diff --git a/src/main/java/me/zgoly/griefmex/Main.java b/src/main/java/me/zgoly/griefmex/Main.java index 741a4e0..0d6214d 100644 --- a/src/main/java/me/zgoly/griefmex/Main.java +++ b/src/main/java/me/zgoly/griefmex/Main.java @@ -3,22 +3,19 @@ import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; - - - public final class Main extends JavaPlugin { + public static String R = "\u001B[0m"; public static String Y = "\u001B[33m"; public static String C = "\u001B[36m"; - public static String R = "\u001B[0m"; @Override public void onEnable() { // Plugin startup logic - System.out.println(C +"-----------------\nGriefMeX started!\n-----------------" + R); + System.out.println(C +"-----------------" + R + "\n" + C + "GriefMeX started!" + R + "\n" + C + "-----------------" + R); getServer().getPluginManager().registerEvents((Listener) new GriefMeX(), this); } @Override public void onDisable() { // Plugin shutdown logic - System.out.println(Y +"-----------------\nGriefMeX stopped!\n-----------------" + R); + System.out.println(Y +"-----------------" + R + "\n" + Y + "GriefMeX stopped!" + R + "\n" + Y + "-----------------" + R); } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index addaa21..40d435f 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -2,6 +2,4 @@ name: GriefMeX version: '${project.version}' main: me.zgoly.griefmex.Main api-version: 1.18 -authors: [ Zgoly ] -description: Set -website: no +authors: [ Zgoly ] \ No newline at end of file