@Override @SideOnly( Side.CLIENT ) public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player ) { final double d0 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); final double d1 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); final double d2 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); AppEng.proxy.spawnEffect( EffectType.Assembler, player.getEntityWorld(), this.x + d0, this.y + d1, this.z + d2, this ); } }
p.openGui( AppEng.instance(), type.ordinal() << 4, p.getEntityWorld(), p.inventory.currentItem, 0, 0 ); p.openGui( AppEng.instance(), type.ordinal() << 4 | ( 1 << 3 ), p.getEntityWorld(), x, y, z );
public static RayTraceResult rayTrace( final EntityPlayer p, final boolean hitBlocks, final boolean hitEntities ) final World w = p.getEntityWorld();
@Override public boolean doExtraFunction(@Nonnull ItemStack stack, @Nonnull EntityPlayer player, EnumHand hand) { if (!player.getEntityWorld().isRemote) { player.openGui(PECore.instance, Constants.PHILOS_STONE_GUI, player.getEntityWorld(), hand == EnumHand.MAIN_HAND ? 0 : 1, -1, -1); } return true; }
@Override public boolean doExtraFunction(@Nonnull ItemStack stack, @Nonnull EntityPlayer player, EnumHand hand) { player.openGui(PECore.instance, Constants.MERCURIAL_GUI, player.getEntityWorld(), hand == EnumHand.MAIN_HAND ? 0 : 1, -1, -1); return true; }
@Override public boolean updateInAlchBag(@Nonnull IItemHandler inv, @Nonnull EntityPlayer player, @Nonnull ItemStack stack) { return !player.getEntityWorld().isRemote && condense(stack, inv); } }
public static void swingItem(EntityPlayer player, EnumHand hand) { if (player.getEntityWorld() instanceof WorldServer) { ((WorldServer) player.getEntityWorld()).getEntityTracker().sendToTrackingAndSelf(player, new SPacketAnimation(player, hand == EnumHand.MAIN_HAND ? 0 : 3)); } }
@Override public boolean shootProjectile(@Nonnull EntityPlayer player, @Nonnull ItemStack stack, EnumHand hand) { World world = player.getEntityWorld(); if(world.isRemote) return false; EntityFireProjectile fire = new EntityFireProjectile(world, player); fire.shoot(player, player.rotationPitch, player.rotationYaw, 0, 1.5F, 1); world.spawnEntity(fire); return true; }
@Override public void onContainerClosed(EntityPlayer entityPlayer) { super.onContainerClosed(entityPlayer); if (!entityPlayer.getEntityWorld().isRemote) { saveInventory(entityPlayer); } }
@Override public void detectAndSendChanges() { super.detectAndSendChanges(); if (!player.getEntityWorld().isRemote) { saveInventory(player); } }
public static void setPlayerSpeedFromServer(EntityPlayer player, double motionX, double motionY, double motionZ) { if (!player.getEntityWorld().isRemote && player instanceof EntityPlayerMP) { BloodMagicPacketHandler.sendTo(new PlayerVelocityPacketProcessor(motionX, motionY, motionZ), (EntityPlayerMP) player); } }
public static BlockPos getBlockLookingAt(EntityPlayer player, double maxDistance) { Pair<Vec3d, Vec3d> vecs = getLookVec(player, maxDistance); RayTraceResult mop = player.getEntityWorld().rayTraceBlocks(vecs.getLeft(), vecs.getRight()); if (mop != null && mop.typeOfHit == RayTraceResult.Type.BLOCK) { return mop.getBlockPos(); } return null; }
public boolean hasPermissions( final TileEntity te, final int x, final int y, final int z, final AEPartLocation side, final EntityPlayer player ) final World w = player.getEntityWorld(); final BlockPos pos = new BlockPos( x, y, z );
@Override public boolean shootProjectile(@Nonnull EntityPlayer player, @Nonnull ItemStack stack, EnumHand hand) { World world = player.getEntityWorld(); world.playSound(null, player.posX, player.posY, player.posZ, PESounds.TRANSMUTE, SoundCategory.PLAYERS, 1, 1); EntityMobRandomizer ent = new EntityMobRandomizer(world, player); ent.shoot(player, player.rotationPitch, player.rotationYaw, 0, 1.5F, 1); world.spawnEntity(ent); return true; }
private static void syncBreedingTrackers(EntityPlayer player) { IAlleleRegistry alleleRegistry = AlleleManager.alleleRegistry; Collection<ISpeciesRoot> speciesRoots = alleleRegistry.getSpeciesRoot().values(); for (ISpeciesRoot speciesRoot : speciesRoots) { IBreedingTracker breedingTracker = speciesRoot.getBreedingTracker(player.getEntityWorld(), player.getGameProfile()); breedingTracker.synchToPlayer(player); } }
public void doZap(EntityPlayer player) { if (ProjectEConfig.difficulty.offensiveAbilities) { BlockPos strikePos = PlayerHelper.getBlockLookingAt(player, 120.0F); if (strikePos != null) { player.getEntityWorld().addWeatherEffect(new EntityLightningBolt(player.getEntityWorld(), strikePos.getX(), strikePos.getY(), strikePos.getZ(), false)); } } } }
private boolean jumpedRecently(EntityPlayer player) { return lastJumpTracker.containsKey(player.getEntityId()) && player.getEntityWorld().getTotalWorldTime() - lastJumpTracker.get(player.getEntityId()) < 5; }
public void removeEmc(double value) { provider.setEmc(provider.getEmc() - value); if (provider.getEmc() < 0) { provider.setEmc(0); } if (!player.getEntityWorld().isRemote) { PlayerHelper.updateScore((EntityPlayerMP) player, PlayerHelper.SCOREBOARD_EMC, MathHelper.floor(provider.getEmc())); } }
public void addEmc(double value) { provider.setEmc(provider.getEmc() + value); if (provider.getEmc() >= Constants.TILE_MAX_EMC || provider.getEmc() < 0) { provider.setEmc(Constants.TILE_MAX_EMC); } if (!player.getEntityWorld().isRemote) { PlayerHelper.updateScore((EntityPlayerMP) player, PlayerHelper.SCOREBOARD_EMC, MathHelper.floor(provider.getEmc())); } }
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); } } }