Ghaz-ranka

Untitled

May 16th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. public class EventBlockPlace {
  2.  
  3. @Listener
  4. public void onBlockPlaceByEntity(ChangeBlockEvent.Place event){
  5. Sponge.getServer().getBroadcastChannel().send(Text.of(event.getCause().root()));
  6. if (event.getCause().root() instanceof Player){
  7.  
  8. } else if(event.getCause().root() instanceof Piston){
  9.  
  10. } else {
  11. event.setCancelled(true);
  12. }
  13. }
  14.  
  15. @Listener
  16. public void onBlockPlaceByPlayer(ChangeBlockEvent.Place event, @Root Player player){
  17. if (event.getCause().root() instanceof Player){
  18. 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){
  19. if(player.hasPermission("Esinia.Server.Admin")){
  20.  
  21. } else
  22. event.setCancelled(true);
  23. }
  24. }
  25.  
  26. }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment