public void handleEffect(SPacketEffect packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); if (packetIn.isSoundServerwide()) { this.gameController.world.playBroadcastSound(packetIn.getSoundType(), packetIn.getSoundPos(), packetIn.getSoundData()); } else { this.gameController.world.playEvent(packetIn.getSoundType(), packetIn.getSoundPos(), packetIn.getSoundData()); } }
public void handleEffect(SPacketEffect packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); if (packetIn.isSoundServerwide()) { this.gameController.theWorld.playBroadcastSound(packetIn.getSoundType(), packetIn.getSoundPos(), packetIn.getSoundData()); } else { this.gameController.theWorld.playEvent(packetIn.getSoundType(), packetIn.getSoundPos(), packetIn.getSoundData()); } }
@Nullable public Entity changeDimension(int dimensionIn) { this.invulnerableDimensionChange = true; if (this.dimension == 1 && dimensionIn == 1) { this.world.removeEntity(this); if (!this.playerConqueredTheEnd) { this.playerConqueredTheEnd = true; if (this.hasAchievement(AchievementList.THE_END2)) { this.connection.sendPacket(new SPacketChangeGameState(4, 0.0F)); } else { this.addStat(AchievementList.THE_END2); this.connection.sendPacket(new SPacketChangeGameState(4, 1.0F)); } } return this; } else { if (this.dimension == 0 && dimensionIn == 1) { this.addStat(AchievementList.THE_END); dimensionIn = 1; } else { this.addStat(AchievementList.PORTAL); } this.mcServer.getPlayerList().changePlayerDimension(this, dimensionIn); this.connection.sendPacket(new SPacketEffect(1032, BlockPos.ORIGIN, 0, false)); this.lastExperience = -1; this.lastHealth = -1.0F; this.lastFoodLevel = -1; return this; } }
public void playEvent(EntityPlayer player, int type, BlockPos blockPosIn, int data) { this.mcServer.getPlayerList().sendToAllNearExcept(player, (double)blockPosIn.getX(), (double)blockPosIn.getY(), (double)blockPosIn.getZ(), 64.0D, this.theWorldServer.provider.getDimensionType().getId(), new SPacketEffect(type, blockPosIn, data, false)); }
public void broadcastSound(int soundID, BlockPos pos, int data) { this.mcServer.getPlayerList().sendPacketToAllPlayers(new SPacketEffect(soundID, pos, data, true)); }
public void playEvent(EntityPlayer player, int type, BlockPos blockPosIn, int data) { this.mcServer.getPlayerList().sendToAllNearExcept(player, (double)blockPosIn.getX(), (double)blockPosIn.getY(), (double)blockPosIn.getZ(), 64.0D, this.theWorldServer.provider.getDimension(), new SPacketEffect(type, blockPosIn, data, false)); }
@Nullable public Entity changeDimension(int dimensionIn) { if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, dimensionIn)) return this; this.invulnerableDimensionChange = true; if (this.dimension == 1 && dimensionIn == 1) { this.worldObj.removeEntity(this); if (!this.playerConqueredTheEnd) { this.playerConqueredTheEnd = true; if (this.hasAchievement(AchievementList.THE_END2)) { this.connection.sendPacket(new SPacketChangeGameState(4, 0.0F)); } else { this.addStat(AchievementList.THE_END2); this.connection.sendPacket(new SPacketChangeGameState(4, 1.0F)); } } return this; } else { if (this.dimension == 0 && dimensionIn == 1) { this.addStat(AchievementList.THE_END); dimensionIn = 1; } else { this.addStat(AchievementList.PORTAL); } this.mcServer.getPlayerList().changePlayerDimension(this, dimensionIn); this.connection.sendPacket(new SPacketEffect(1032, BlockPos.ORIGIN, 0, false)); this.lastExperience = -1; this.lastHealth = -1.0F; this.lastFoodLevel = -1; return this; } }
void handleEffect(SPacketEffect packetIn);