@SuppressWarnings("incomplete-switch") public void updateFromPacket(SPacketUpdateBossInfo packetIn) { switch (packetIn.getOperation()) { case UPDATE_NAME: this.setName(packetIn.getName()); break; case UPDATE_PCT: this.setPercent(packetIn.getPercent()); break; case UPDATE_STYLE: this.setColor(packetIn.getColor()); this.setOverlay(packetIn.getOverlay()); break; case UPDATE_PROPERTIES: this.setDarkenSky(packetIn.shouldDarkenSky()); this.setPlayEndBossMusic(packetIn.shouldPlayEndBossMusic()); } }
public BossInfoLerping(SPacketUpdateBossInfo packetIn) { super(packetIn.getUniqueId(), packetIn.getName(), packetIn.getColor(), packetIn.getOverlay()); this.rawPercent = packetIn.getPercent(); this.percent = packetIn.getPercent(); this.percentSetTime = Minecraft.getSystemTime(); this.setDarkenSky(packetIn.shouldDarkenSky()); this.setPlayEndBossMusic(packetIn.shouldPlayEndBossMusic()); this.setCreateFog(packetIn.shouldCreateFog()); }
public void setPercent(float percentIn) { if (percentIn != this.percent) { super.setPercent(percentIn); this.sendUpdate(SPacketUpdateBossInfo.Operation.UPDATE_PCT); } }
public void setColor(BossInfo.Color colorIn) { if (colorIn != this.color) { super.setColor(colorIn); this.sendUpdate(SPacketUpdateBossInfo.Operation.UPDATE_STYLE); } }
public void setOverlay(BossInfo.Overlay overlayIn) { if (overlayIn != this.overlay) { super.setOverlay(overlayIn); this.sendUpdate(SPacketUpdateBossInfo.Operation.UPDATE_STYLE); } }
public BossInfo setDarkenSky(boolean darkenSkyIn) { if (darkenSkyIn != this.darkenSky) { super.setDarkenSky(darkenSkyIn); this.sendUpdate(SPacketUpdateBossInfo.Operation.UPDATE_PROPERTIES); } return this; }
public BossInfo setPlayEndBossMusic(boolean playEndBossMusicIn) { if (playEndBossMusicIn != this.playEndBossMusic) { super.setPlayEndBossMusic(playEndBossMusicIn); this.sendUpdate(SPacketUpdateBossInfo.Operation.UPDATE_PROPERTIES); } return this; }
public BossInfo setCreateFog(boolean createFogIn) { if (createFogIn != this.createFog) { super.setCreateFog(createFogIn); this.sendUpdate(SPacketUpdateBossInfo.Operation.UPDATE_PROPERTIES); } return this; }
public void setName(ITextComponent nameIn) { if (!Objects.equal(nameIn, this.name)) { super.setName(nameIn); this.sendUpdate(SPacketUpdateBossInfo.Operation.UPDATE_NAME); } }
private void sendUpdate(SPacketUpdateBossInfo.Operation operationIn) { if (this.visible) { SPacketUpdateBossInfo spacketupdatebossinfo = new SPacketUpdateBossInfo(operationIn, this); for (EntityPlayerMP entityplayermp : this.players) { entityplayermp.connection.sendPacket(spacketupdatebossinfo); } } }
/** * Makes the boss visible to the given player. */ public void addPlayer(EntityPlayerMP player) { if (this.players.add(player) && this.visible) { player.connection.sendPacket(new SPacketUpdateBossInfo(SPacketUpdateBossInfo.Operation.ADD, this)); } }
/** * Makes the boss non-visible to the given player. */ public void removePlayer(EntityPlayerMP player) { if (this.players.remove(player) && this.visible) { player.connection.sendPacket(new SPacketUpdateBossInfo(SPacketUpdateBossInfo.Operation.REMOVE, this)); } }
public void setVisible(boolean visibleIn) { if (visibleIn != this.visible) { this.visible = visibleIn; for (EntityPlayerMP entityplayermp : this.players) { entityplayermp.connection.sendPacket(new SPacketUpdateBossInfo(visibleIn ? SPacketUpdateBossInfo.Operation.ADD : SPacketUpdateBossInfo.Operation.REMOVE, this)); } } }
public void read(SPacketUpdateBossInfo packetIn) { if (packetIn.getOperation() == SPacketUpdateBossInfo.Operation.ADD) { this.mapBossInfos.put(packetIn.getUniqueId(), new BossInfoLerping(packetIn)); } else if (packetIn.getOperation() == SPacketUpdateBossInfo.Operation.REMOVE) { this.mapBossInfos.remove(packetIn.getUniqueId()); } else { ((BossInfoLerping)this.mapBossInfos.get(packetIn.getUniqueId())).updateFromPacket(packetIn); } }
public void handleUpdateEntityNBT(SPacketUpdateBossInfo packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); this.gameController.ingameGUI.getBossOverlay().read(packetIn); }
void handleUpdateEntityNBT(SPacketUpdateBossInfo packetIn);