Source:
<code>public void onPlayerInteract(PlayerInteractEvent event) { if (platform == null) { return; } if (!platform.isHookingEvents()) return; if ((event instanceof PlayerInteractEvent.LeftClickBlock && ((PlayerInteractEvent.LeftClickBlock) event) .getUseItem() == Result.DENY) || (event instanceof PlayerInteractEvent.RightClickBlock && ((PlayerInteractEvent.RightClickBlock) event) .getUseItem() == Result.DENY) || event.getEntity().worldObj.isRemote) <START> return; <END> WorldEdit we = WorldEdit.getInstance(); ForgePlayer player = wrap((EntityPlayerMP) event.getEntityPlayer()); ForgeWorld world = getWorld(event.getEntityPlayer().worldObj); if (event instanceof PlayerInteractEvent.LeftClickBlock) { @SuppressWarnings("deprecation") WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), event.getPos().getX(), event.getPos().getY(), event.getPos().getZ()); if (we.handleBlockLeftClick(player, pos)) { event.setCanceled(true); } if (we.handleArmSwing(player)) { event.setCanceled(true); } } else if (event instanceof PlayerInteractEvent.RightClickBlock) { @SuppressWarnings("deprecation") WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), event.getPos().getX(), event.getPos().getY(), event.getPos().getZ()); if (we.handleBlockRightClick(player, pos)) { event.setCanceled(true); } if (we.handleRightClick(player)) { event.setCanceled(true); } } else if (event instanceof PlayerInteractEvent.RightClickEmpty) { if (we.handleRightClick(player)) { event.setCanceled(true); } } }</code><technical_language>break this out condition booleans java boolean isLeftClickBlock = ...; boolean isLeftClickDenied = isLeftClickBlock && ...; boolean isRightClickBlock = ...; ... if statements nicer</technical_language>

Target:
public void onPlayerInteract(PlayerInteractEvent event) { if (platform == null) { return; } if (!platform.isHookingEvents()) return; boolean isLeftDeny = event instanceof PlayerInteractEvent.LeftClickBlock && ((PlayerInteractEvent.LeftClickBlock) event) .getUseItem() == Result.DENY; boolean isRightDeny = event instanceof PlayerInteractEvent.RightClickBlock && ((PlayerInteractEvent.RightClickBlock) event) .getUseItem() == Result.DENY; if (isLeftDeny || isRightDeny || event.getEntity().worldObj.isRemote) { return; } WorldEdit we = WorldEdit.getInstance(); ForgePlayer player = wrap((EntityPlayerMP) event.getEntityPlayer()); ForgeWorld world = getWorld(event.getEntityPlayer().worldObj); if (event instanceof PlayerInteractEvent.LeftClickBlock) { @SuppressWarnings("deprecation") WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), event.getPos().getX(), event.getPos().getY(), event.getPos().getZ()); if (we.handleBlockLeftClick(player, pos)) { event.setCanceled(true); } if (we.handleArmSwing(player)) { event.setCanceled(true); } } else if (event instanceof PlayerInteractEvent.RightClickBlock) { @SuppressWarnings("deprecation") WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), event.getPos().getX(), event.getPos().getY(), event.getPos().getZ()); if (we.handleBlockRightClick(player, pos)) { event.setCanceled(true); } if (we.handleRightClick(player)) { event.setCanceled(true); } } else if (event instanceof PlayerInteractEvent.RightClickEmpty) { if (we.handleRightClick(player)) { event.setCanceled(true); } } }