Codota Logo
PlayerInteractEvent$RightClickBlock.isCanceled
Code IndexAdd Codota to your IDE (free)

How to use
isCanceled
method
in
net.minecraftforge.event.entity.player.PlayerInteractEvent$RightClickBlock

Best Java code snippets using net.minecraftforge.event.entity.player.PlayerInteractEvent$RightClickBlock.isCanceled (Showing top 3 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: squeek502/VeganOption

@SubscribeEvent
public void onPlayerInteract(PlayerInteractEvent.RightClickBlock event)
  if (event.isCanceled() || event.getResult() != Event.Result.DEFAULT)
    return;
origin: OpenMods/OpenModsLib

if (event.isCanceled()) return EnumActionResult.PASS;
origin: Vazkii/Quark

@SubscribeEvent(priority = EventPriority.LOWEST)
public void onPlayerInteract(PlayerInteractEvent.RightClickBlock event) {
  if(event.getEntityPlayer().isSneaking() || event.isCanceled() || event.getResult() == Result.DENY)
    return;
  World world = event.getWorld();
  IBlockState state = world.getBlockState(event.getPos()).getActualState(world, event.getPos());
  Block block = state.getBlock();
  if(!(block instanceof BlockDoor))
    return;
  EnumFacing direction = state.getValue(BlockDoor.FACING);
  boolean isOpen = state.getValue(BlockDoor.OPEN);
  BlockDoor.EnumHingePosition isMirrored = state.getValue(BlockDoor.HINGE);
  BlockPos mirrorPos = event.getPos().offset(isMirrored == BlockDoor.EnumHingePosition.RIGHT ? direction.rotateYCCW() : direction.rotateY());
  BlockPos doorPos = state.getValue(BlockDoor.HALF) == BlockDoor.EnumDoorHalf.LOWER ? mirrorPos : mirrorPos.down();
  IBlockState other = world.getBlockState(doorPos).getActualState(world, doorPos);
  if(block.getMaterial(state) != Material.IRON && other.getBlock() == (BlockDoor) block && other.getValue(BlockDoor.FACING) == direction && other.getValue(BlockDoor.OPEN) == isOpen && other.getValue(BlockDoor.HINGE) != isMirrored) {
    IBlockState newState = other.cycleProperty(BlockDoor.OPEN);
    world.setBlockState(doorPos, newState, 10);
  }
}
net.minecraftforge.event.entity.playerPlayerInteractEvent$RightClickBlockisCanceled

Popular methods of PlayerInteractEvent$RightClickBlock

  • getEntityPlayer
  • getWorld
  • getPos
  • setCanceled
  • getItemStack
  • getHand
  • getFace
  • <init>
  • getUseBlock
  • getUseItem
  • setUseBlock
  • getResult
  • setUseBlock,
  • getResult,
  • setCancellationResult,
  • setUseItem,
  • getHitVec,
  • getEntity,
  • setResult,
  • getEntityLiving

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • findViewById (Activity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JFileChooser (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now