Code cleanup

This commit is contained in:
LemADEC 2015-08-27 04:19:01 +02:00
parent aaa621137c
commit 1925594177
4 changed files with 14 additions and 28 deletions

View file

@ -95,14 +95,14 @@ public class TileEntityLift extends TileEntityAbstractEnergy {
if (yCoord - firstUncoveredY >= 2) {
if (mode == MODE_UP) {
PacketHandler.sendBeamPacket(worldObj, new Vector3(
xCoord + 0.5D, firstUncoveredY, zCoord + 0.5D),
PacketHandler.sendBeamPacket(worldObj,
new Vector3(xCoord + 0.5D, firstUncoveredY, zCoord + 0.5D),
new Vector3(xCoord + 0.5D, yCoord, zCoord + 0.5D),
0f, 1f, 0f, 40, 0, 100);
} else if (mode == MODE_DOWN) {
PacketHandler.sendBeamPacket(worldObj, new Vector3(
xCoord + 0.5D, yCoord, zCoord + 0.5D), new Vector3(
xCoord + 0.5D, firstUncoveredY, zCoord + 0.5D), 0f,
PacketHandler.sendBeamPacket(worldObj,
new Vector3(xCoord + 0.5D, yCoord, zCoord + 0.5D),
new Vector3(xCoord + 0.5D, firstUncoveredY, zCoord + 0.5D), 0f,
0f, 1f, 40, 0, 100);
}
@ -142,7 +142,8 @@ public class TileEntityLift extends TileEntityAbstractEnergy {
((EntityLivingBase) o).setPositionAndUpdate(xCoord + 0.5D, yCoord + 1.0D, zCoord + 0.5D);
PacketHandler.sendBeamPacket(worldObj,
new Vector3(xCoord + 0.5D, firstUncoveredY, zCoord + 0.5D),
new Vector3(xCoord + 0.5D, yCoord, zCoord + 0.5D), 1F, 1F, 0F, 40, 0, 100);
new Vector3(xCoord + 0.5D, yCoord, zCoord + 0.5D),
1F, 1F, 0F, 40, 0, 100);
worldObj.playSoundEffect(xCoord + 0.5D, yCoord, zCoord + 0.5D, "warpdrive:hilaser", 4F, 1F);
consumeEnergy(WarpDriveConfig.LIFT_ENERGY_PER_ENTITY, false);
}

View file

@ -575,13 +575,15 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
continue;
}
TileEntity te = worldObj.getTileEntity(MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY) - 1,
TileEntity tileEntity = worldObj.getTileEntity(
MathHelper.floor_double(player.posX),
MathHelper.floor_double(player.posY) - 1,
MathHelper.floor_double(player.posZ));
if (te != null && (te instanceof TileEntityShipController)) {
if (((TileEntityShipController) te).getBeaconFrequency().equals(freq)) {
beaconX = te.xCoord;
beaconZ = te.zCoord;
if (tileEntity != null && (tileEntity instanceof TileEntityShipController)) {
if (((TileEntityShipController) tileEntity).getBeaconFrequency().equals(freq)) {
beaconX = tileEntity.xCoord;
beaconZ = tileEntity.zCoord;
isBeaconFound = true;
break;
}

View file

@ -14,7 +14,6 @@ import cr0s.warpdrive.block.TileEntityLaser;
import cr0s.warpdrive.block.detection.TileEntityCamera;
import cr0s.warpdrive.block.detection.TileEntityMonitor;
import cr0s.warpdrive.config.WarpDriveConfig;
import cr0s.warpdrive.data.Vector3;
public class MessageFrequency implements IMessage, IMessageHandler<MessageFrequency, IMessage> {
@ -27,13 +26,6 @@ public class MessageFrequency implements IMessage, IMessageHandler<MessageFreque
// required on receiving side
}
public MessageFrequency(final Vector3 target, final int frequency) {
this.x = target.intX();
this.y = target.intY();
this.z = target.intZ();
this.frequency = frequency;
}
public MessageFrequency(final int x, final int y, final int z, final int frequency) {
this.x = x;
this.y = y;

View file

@ -9,7 +9,6 @@ import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import cr0s.warpdrive.WarpDrive;
import cr0s.warpdrive.block.TileEntityLaser;
import cr0s.warpdrive.config.WarpDriveConfig;
import cr0s.warpdrive.data.Vector3;
public class MessageTargeting implements IMessage, IMessageHandler<MessageTargeting, IMessage> {
@ -23,14 +22,6 @@ public class MessageTargeting implements IMessage, IMessageHandler<MessageTarget
// required on receiving side
}
public MessageTargeting(final Vector3 target, final float yaw, final float pitch) {
this.x = target.intX();
this.y = target.intY();
this.z = target.intZ();
this.yaw = yaw;
this.pitch = pitch;
}
public MessageTargeting(final int x, final int y, final int z, final float yaw, final float pitch) {
this.x = x;
this.y = y;