Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Zgoly authored Feb 8, 2022
1 parent 06eebd5 commit 995a3b3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
11 changes: 8 additions & 3 deletions src/main/java/me/zgoly/griefmex/GriefMeX.java
Original file line number Diff line number Diff line change
@@ -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<Block> iterator = e.blockList().iterator();
while(iterator.hasNext()) {
String m = iterator.next().getType().name();
if (!m.endsWith("CHEST") && !m.endsWith("SHULKER_BOX")) iterator.remove();
}
}
}
}
9 changes: 3 additions & 6 deletions src/main/java/me/zgoly/griefmex/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
4 changes: 1 addition & 3 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]

0 comments on commit 995a3b3

Please sign in to comment.