Exemplo n.º 1
0
 @SubscribeEvent(priority = EventPriority.HIGHEST)
 public void buildWorktables(PlayerPlaceBlockEvent evt) {
   if (evt.block == Blocks.crafting_table
       || evt.block instanceof BlockWorkbench
       || TinkerToolHandler.getInstance().isWorkbench(evt.block)) {
     this.checkAndBuildWorktable(evt.world, evt.x, evt.y, evt.z);
   }
 }
Exemplo n.º 2
0
 @SubscribeEvent(priority = EventPriority.HIGHEST)
 public void buildWorktables(PlayerInteractEvent evt) {
   if (evt.action == Action.RIGHT_CLICK_BLOCK) {
     Block b = evt.world.getBlock(evt.x, evt.y, evt.z);
     if (b == Blocks.crafting_table
         || b instanceof BlockWorkbench
         || TinkerToolHandler.getInstance().isWorkbench(b)) {
       if (this.checkAndBuildWorktable(evt.world, evt.x, evt.y, evt.z)) evt.setCanceled(true);
     }
   }
 }