use of micdoodle8.mods.galacticraft.planets.venus.tile.TileEntityLaserTurret in project Galacticraft by micdoodle8.
the class PacketSimpleVenus method handleServerSide.
@Override
public void handleServerSide(EntityPlayer player) {
EntityPlayerMP playerBase = PlayerUtil.getPlayerBaseServerFromPlayer(player, false);
switch(this.type) {
case S_UPDATE_ADVANCED_GUI:
TileEntity tile0 = player.world.getTileEntity((BlockPos) this.data.get(1));
switch((Integer) this.data.get(0)) {
case 0:
if (tile0 instanceof TileEntityLaserTurret) {
TileEntityLaserTurret launchController = (TileEntityLaserTurret) tile0;
launchController.blacklistMode = ((Integer) this.data.get(2)) != 0;
}
break;
case 1:
if (tile0 instanceof TileEntityLaserTurret) {
TileEntityLaserTurret launchController = (TileEntityLaserTurret) tile0;
launchController.targetMeteors = ((Integer) this.data.get(2)) != 0;
}
break;
case 2:
if (tile0 instanceof TileEntityLaserTurret) {
TileEntityLaserTurret launchController = (TileEntityLaserTurret) tile0;
launchController.alwaysIgnoreSpaceRace = ((Integer) this.data.get(2)) != 0;
}
break;
case 3:
if (tile0 instanceof TileEntityLaserTurret) {
TileEntityLaserTurret launchController = (TileEntityLaserTurret) tile0;
launchController.priorityClosest = ((Integer) this.data.get(2));
}
break;
case 4:
if (tile0 instanceof TileEntityLaserTurret) {
TileEntityLaserTurret launchController = (TileEntityLaserTurret) tile0;
launchController.priorityLowestHealth = ((Integer) this.data.get(2));
}
break;
case 5:
if (tile0 instanceof TileEntityLaserTurret) {
TileEntityLaserTurret launchController = (TileEntityLaserTurret) tile0;
launchController.priorityHighestHealth = ((Integer) this.data.get(2));
}
break;
default:
break;
}
break;
case S_OPEN_LASER_TURRET_GUI:
BlockPos pos = (BlockPos) this.data.get(0);
player.openGui(GalacticraftPlanets.instance, GuiIdsPlanets.MACHINE_VENUS, player.world, pos.getX(), pos.getY(), pos.getZ());
break;
case S_MODIFY_LASER_TARGET:
TileEntity tile1 = player.world.getTileEntity((BlockPos) this.data.get(1));
switch((Integer) this.data.get(0)) {
case 0:
if (tile1 instanceof TileEntityLaserTurret) {
((TileEntityLaserTurret) tile1).addPlayer((String) this.data.get(2));
}
break;
case 1:
if (tile1 instanceof TileEntityLaserTurret) {
((TileEntityLaserTurret) tile1).addEntity(new ResourceLocation((String) this.data.get(2)));
}
break;
case 2:
if (tile1 instanceof TileEntityLaserTurret) {
((TileEntityLaserTurret) tile1).removePlayer((String) this.data.get(2));
}
break;
case 3:
if (tile1 instanceof TileEntityLaserTurret) {
((TileEntityLaserTurret) tile1).removeEntity(new ResourceLocation((String) this.data.get(2)));
}
break;
}
break;
default:
break;
}
}
Aggregations