Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class EventBlockBreak {
- @Listener
- public void onBlockBreakByEntity(ChangeBlockEvent.Break event){
- Sponge.getServer().getBroadcastChannel().send(Text.of(event.getCause().root()));
- if (event.getCause().root() instanceof Player){
- } else {
- event.setCancelled(true);
- }
- }
- @Listener
- public void onBlockBreakByPlayer(ChangeBlockEvent.Break event, @Root Player player){
- if (event.getCause().root() instanceof Player){
- if (event.getTransactions().get(0).getOriginal().getLocation().get().getBlockX() >= -1342 && event.getTransactions().get(0).getOriginal().getLocation().get().getBlockX() <= 1046 && event.getTransactions().get(0).getOriginal().getLocation().get().getBlockZ() >= -1254 && event.getTransactions().get(0).getOriginal().getLocation().get().getBlockY() <= 1198){
- if(player.hasPermission("Esinia.Server.Admin")){
- } else
- event.setCancelled(true);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment