@Override public IBakedModel handleItemState( IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity ) { if( world != null && entity instanceof EntityPlayerSP ) { EntityPlayer player = (EntityPlayer) entity; float offRads = (float) ( player.rotationYaw / 180.0f * (float) Math.PI + Math.PI ); SkyCompassBakedModel.this.fallbackRotation = offRads + getAnimatedRotation( player.getPosition(), true ); } else { SkyCompassBakedModel.this.fallbackRotation = getAnimatedRotation( null, false ); } return originalModel; } };
@Nonnull @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, @Nonnull EnumHand hand) { ItemStack stack = playerIn.getHeldItem(hand); if(playerIn.isSneaking()) { int size = getSize(stack); int newSize = size == 11 ? 3 : size + 2; setSize(stack, newSize); ItemsRemainingRenderHandler.set(stack, newSize + "x" + newSize); worldIn.playSound(playerIn, playerIn.getPosition(), SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, SoundCategory.PLAYERS, 0.5F, 1F); return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } return ActionResult.newResult(EnumActionResult.PASS, stack); }
@Override public String modifyObjective(QuestStack questStack, EntityPlayer entityPlayer, String objective, int objectiveIndex) { BlockPos pos = MOQuestHelper.getPosition(questStack); if (pos != null) { double distance = Math.sqrt(entityPlayer.getPosition().distanceSq(pos)); objective = objective.replace("$distance", Integer.toString((int) distance)); } //objective = objective.replace("$containerName",containerName); return objective; }
@Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { Genetics.proxy.openGui(GeneticsGUI.REGISTRY, playerIn, playerIn.getPosition()); return super.onItemRightClick(worldIn, playerIn, handIn); }
@Override public void onSigilUpdate(ItemStack stack, World world, EntityPlayer player, int itemSlot, boolean isSelected) { if (PlayerHelper.isFakePlayer(player)) return; EnchantmentFrostWalker.freezeNearby(player, world, player.getPosition(), 1); } }
@Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { if (!Binnie.GENETICS.getActiveSystems().isEmpty()) { Genetics.proxy.openGui(GeneticsGUI.MASTER_REGISTRY, playerIn, playerIn.getPosition()); } return super.onItemRightClick(worldIn, playerIn, handIn); }
@Override @Nonnull public ActionResult<ItemStack> onItemRightClick(@Nonnull World world, @Nonnull EntityPlayer player, @Nonnull EnumHand hand) { if (!world.isRemote && player.isSneaking()) { ModObject.itemPowerItemFilter.openGui(world, player.getPosition(), player, null, hand.ordinal()); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, player.getHeldItem(hand)); } return super.onItemRightClick(world, player, hand); }
@Override @Nonnull public ActionResult<ItemStack> onItemRightClick(@Nonnull World world, @Nonnull EntityPlayer player, @Nonnull EnumHand hand) { if (!world.isRemote && player.isSneaking()) { ModObject.itemBasicItemFilter.openGui(world, player.getPosition(), player, null, hand.ordinal()); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, player.getHeldItem(hand)); } return super.onItemRightClick(world, player, hand); }
@Override @Nonnull public ActionResult<ItemStack> onItemRightClick(@Nonnull World world, @Nonnull EntityPlayer player, @Nonnull EnumHand hand) { if (!world.isRemote && player.isSneaking()) { ModObject.itemModItemFilter.openGui(world, player.getPosition(), player, null, hand.ordinal()); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, player.getHeldItem(hand)); } return super.onItemRightClick(world, player, hand); }
@Override @Nonnull public ActionResult<ItemStack> onItemRightClick(@Nonnull World worldIn, @Nonnull EntityPlayer playerIn, @Nonnull EnumHand handIn) { if (!worldIn.isRemote && playerIn.isSneaking()) { ModObject.itemExistingItemFilter.openGui(worldIn, playerIn.getPosition(), playerIn, null, handIn.ordinal()); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, playerIn.getHeldItem(handIn)); } return super.onItemRightClick(worldIn, playerIn, handIn); }
@Override @Nonnull public ActionResult<ItemStack> onItemRightClick(@Nonnull World world, @Nonnull EntityPlayer player, @Nonnull EnumHand hand) { if (!world.isRemote && player.isSneaking()) { ModObject.itemFluidFilter.openGui(world, player.getPosition(), player, null, hand.ordinal()); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, player.getHeldItem(hand)); } return super.onItemRightClick(world, player, hand); }
@Override @Nonnull public ActionResult<ItemStack> onItemRightClick(@Nonnull World world, @Nonnull EntityPlayer player, @Nonnull EnumHand hand) { if (!world.isRemote && player.isSneaking()) { ForestryIntegrationObject.itemSpeciesItemFilter.openGui(world, player.getPosition(), player, null, hand.ordinal()); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, player.getHeldItem(hand)); } return super.onItemRightClick(world, player, hand); }
@Override @Nonnull public ActionResult<ItemStack> onItemRightClick(@Nonnull World world, @Nonnull EntityPlayer player, @Nonnull EnumHand hand) { if (!world.isRemote && player.isSneaking()) { ModObjectRegistry.getModObjectNN(this).openGui(world, player.getPosition(), player, null, hand.ordinal()); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, player.getHeldItem(hand)); } return super.onItemRightClick(world, player, hand); }
@Override @Nonnull public ActionResult<ItemStack> onItemRightClick(@Nonnull World world, @Nonnull EntityPlayer player, @Nonnull EnumHand hand) { if (!world.isRemote && player.isSneaking()) { ModObjectRegistry.getModObjectNN(this).openGui(world, player.getPosition(), player, null, hand.ordinal()); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, player.getHeldItem(hand)); } return super.onItemRightClick(world, player, hand); }
@Override @Nonnull public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) { ItemStack stack = player.getHeldItem(hand); if (!world.isRemote && !player.isSneaking() && stack.getCount() >= 1) { TFCGuiHandler.openGui(world, player.getPosition(), player, TFCGuiHandler.Type.KNAPPING_STONE); } return new ActionResult<>(EnumActionResult.SUCCESS, stack); } }
@Override @Nonnull public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) { ItemStack stack = player.getHeldItem(hand); if (!world.isRemote && !player.isSneaking() && stack.getCount() >= 1 && Helpers.playerHasItemMatchingOre(player.inventory, "knife")) { TFCGuiHandler.openGui(world, player.getPosition(), player, TFCGuiHandler.Type.KNAPPING_LEATHER); } return new ActionResult<>(EnumActionResult.SUCCESS, stack); } }
public void doThrow(World world, EntityPlayer player, EnumHand hand, EntityThrowable thing, float velocity) { if (!world.isRemote) { // func_184538_a //zero pitch offset, meaning match the players existing. 1.0 at end ins inn //was setHeadingFromThrower thing.shoot(player, player.rotationPitch, player.rotationYaw, PITCHOFFSET, velocity, INACCURACY_DEFAULT); world.spawnEntity(thing); } player.swingArm(hand); BlockPos pos = player.getPosition(); UtilSound.playSound(player, pos, getSound(), SoundCategory.PLAYERS, 0.5F); }
@Override public float getChance(final IMutation mutation, final EntityPlayer player, final IAlleleSpecies firstSpecies, final IAlleleSpecies secondSpecies) { ISpeciesRoot speciesRoot = this.getSpeciesRoot(); final ITreeGenome genome0 = (ITreeGenome) speciesRoot.templateAsGenome(speciesRoot.getTemplate(firstSpecies)); final ITreeGenome genome2 = (ITreeGenome) speciesRoot.templateAsGenome(speciesRoot.getTemplate(secondSpecies)); return ((ITreeMutation) mutation).getChance(player.world, player.getPosition(), (IAlleleTreeSpecies) firstSpecies, (IAlleleTreeSpecies) secondSpecies, genome0, genome2); }
@Override public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) { counter++; if (world.canSeeSky(player.getPosition()) || world.provider.isDaytime()) { if (counter % regenCooldown[this.level] == 0 && player.getHealth() < player.getMaxHealth()) { player.heal(1); } if (fireResistTime[this.level] != 0 && counter % fireResistCooldown[this.level] == 0) { player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, fireResistTime[this.level], 0, false, false)); } } }
public static void sendPlayerDemonWillAura(EntityPlayer player) { if (player instanceof EntityPlayerMP) { BlockPos pos = player.getPosition(); DemonWillHolder holder = WorldDemonWillHandler.getWillHolder(player.getEntityWorld().provider.getDimension(), pos.getX() >> 4, pos.getZ() >> 4); if (holder != null) { BloodMagicPacketHandler.sendTo(new DemonAuraPacketProcessor(holder), (EntityPlayerMP) player); } else { BloodMagicPacketHandler.sendTo(new DemonAuraPacketProcessor(new DemonWillHolder()), (EntityPlayerMP) player); } } }