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

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

Best Java code snippets using net.minecraftforge.event.entity.player.PlayerInteractEvent$RightClickBlock.getResult (Showing top 6 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: SleepyTrousers/EnderIO

boolean ret = false;
RightClickBlock e = new RightClickBlock(player, hand, pos, side, new Vec3d(hitX, hitY, hitZ));
if (MinecraftForge.EVENT_BUS.post(e) || e.getResult() == Result.DENY || e.getUseBlock() == Result.DENY || e.getUseItem() == Result.DENY) {
 return EnumActionResult.PASS;
origin: squeek502/VeganOption

@SubscribeEvent
public void onPlayerInteract(PlayerInteractEvent.RightClickBlock event)
  if (event.isCanceled() || event.getResult() != Event.Result.DEFAULT)
    return;
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);
  }
}
origin: CoFH/ThermalFoundation

@Override
public EnumActionResult onItemUseFirst(EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) {
  IBlockState state = world.getBlockState(pos);
  Block block = state.getBlock();
  if (world.isAirBlock(pos)) {
    return EnumActionResult.PASS;
  }
  PlayerInteractEvent.RightClickBlock event = new PlayerInteractEvent.RightClickBlock(player, hand, pos, side, new Vec3d(hitX, hitY, hitZ));
  if (MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Result.DENY || event.getUseBlock() == Result.DENY || event.getUseItem() == Result.DENY) {
    return EnumActionResult.PASS;
  }
  if (ServerHelper.isServerWorld(world) && player.isSneaking() && block instanceof IDismantleable && ((IDismantleable) block).canDismantle(world, pos, state, player)) {
    ((IDismantleable) block).dismantleBlock(world, pos, state, player, false);
    return EnumActionResult.SUCCESS;
  }
  if (BlockHelper.canRotate(block)) {
    world.setBlockState(pos, BlockHelper.rotateVanillaBlock(world, state, pos), 3);
    player.swingArm(hand);
    return ServerHelper.isServerWorld(world) ? EnumActionResult.SUCCESS : EnumActionResult.PASS;
  } else if (!player.isSneaking() && block.rotateBlock(world, pos, side)) {
    player.swingArm(hand);
    return ServerHelper.isServerWorld(world) ? EnumActionResult.SUCCESS : EnumActionResult.PASS;
  }
  return EnumActionResult.PASS;
}
origin: CoFH/RedstoneArsenal

if (MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Result.DENY || event.getUseBlock() == Result.DENY || event.getUseItem() == Result.DENY) {
  return EnumActionResult.PASS;
origin: CoFH/RedstoneArsenal

if (MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Result.DENY || event.getUseItem() == Result.DENY || event.getUseBlock() == Result.DENY) {
  return EnumActionResult.PASS;
net.minecraftforge.event.entity.playerPlayerInteractEvent$RightClickBlockgetResult

Popular methods of PlayerInteractEvent$RightClickBlock

  • getEntityPlayer
  • getWorld
  • getPos
  • setCanceled
  • getItemStack
  • getHand
  • getFace
  • <init>
  • getUseBlock
  • getUseItem
  • setUseBlock
  • setCancellationResult
  • setUseBlock,
  • setCancellationResult,
  • setUseItem,
  • getHitVec,
  • isCanceled,
  • 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