@SideOnly(Side.CLIENT) @SubscribeEvent public void rightClickEmpty(RightClickEmpty event) { // System.out.println("RightClickEmpty,HandType="+event.getHand()); if (event.getEntityPlayer().getEntityData().hasKey("renderViewCamera") && event.getSide().isClient() && event.getHand().equals(EnumHand.MAIN_HAND)) { System.out.println("delay=" + ((EntityTripod) Minecraft.getMinecraft().theWorld .getEntityByID(Minecraft.getMinecraft().thePlayer.getEntityData().getInteger("renderViewCamera"))) .getDelay()); System.out.println("RightClickEmpty,HandType=" + event.getHand()); ActiveTripod(Minecraft.getMinecraft().thePlayer.getName(), ((EntityTripod) event.getWorld() .getEntityByID(event.getEntityPlayer().getEntityData().getInteger("renderViewCamera"))) .getDelay()); } }
@HarshenEvent public void onRightClick(PlayerInteractEvent event) { if(event.getEntityPlayer().world.isRemote && HarshenUtils.toArray(RightClickBlock.class, RightClickEmpty.class).contains(event.getClass()) && event.getEntityPlayer().getHeldItemMainhand().isEmpty() && event.getEntityPlayer().isElytraFlying()) { HarshenNetwork.sendToServer(new MessagePacketSummonFirework()); Vec3d vec3d = event.getEntityPlayer().getLookVec(); event.getEntityPlayer().motionX += vec3d.x * 0.1D + (vec3d.x * 2.5D - event.getEntityPlayer().motionX) * 0.5D; event.getEntityPlayer().motionY += vec3d.y * 0.1D + (vec3d.y * 2.5D - event.getEntityPlayer().motionY) * 0.5D; event.getEntityPlayer().motionZ += vec3d.z * 0.1D + (vec3d.z * 2.5D - event.getEntityPlayer().motionZ) * 0.5D; } }
@SubscribeEvent public void interact(RightClickEmpty event) { // Cast hand spell }