Advertisement
sander_blaadjes

Fence glitch bug fix

May 31st, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1.     // Easy fix for the fence glitch
  2.     // Just paste this code into your main class and done!
  3.     // code by @mattibijnens
  4.     @SuppressWarnings("deprecation")
  5.     @EventHandler
  6.     public void interactd(PlayerInteractEvent e){
  7.         if(e.getAction() == Action.RIGHT_CLICK_BLOCK){
  8.         if(e.getClickedBlock().getType() == Material.FENCE){
  9.             if((e.getPlayer().getItemInHand().getType().isEdible()) || e.getPlayer().getItemInHand().getTypeId() == 373){
  10.                 e.setCancelled(true);
  11.         }
  12.         }
  13.         }
  14.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement