Code cleanup

This commit is contained in:
LemADEC 2016-02-08 03:40:03 +01:00
parent edfc9bdf0c
commit 386bfd704b
2 changed files with 48 additions and 54 deletions
src/main/java/cr0s/warpdrive

View file

@ -342,11 +342,11 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
WarpDrive.logger.info(this + " messageToAllPlayersOnShip: " + msg);
for (Object object : list) {
if (object == null || !(object instanceof EntityPlayer)) {
if (!(object instanceof EntityPlayer)) {
continue;
}
WarpDrive.addChatMessage((EntityPlayer) object, "[" + (!shipName.isEmpty() ? shipName : "WarpCore") + "] " + msg);
WarpDrive.addChatMessage((EntityPlayer) object, "[" + (!shipName.isEmpty() ? shipName : "ShipCore") + "] " + msg);
}
}

View file

@ -3,24 +3,21 @@ package cr0s.warpdrive.data;
import net.minecraft.util.AxisAlignedBB;
import cr0s.warpdrive.world.JumpgateGenerator;
public class Jumpgate
{
public class Jumpgate {
public String name;
public int xCoord, yCoord, zCoord;
public Jumpgate(String name, int x, int y, int z)
{
public Jumpgate(final String name, final int x, final int y, final int z) {
this.name = name;
this.xCoord = x;
this.yCoord = y;
this.zCoord = z;
}
public Jumpgate(String line)
{
public Jumpgate(final String line) {
String[] params = line.split(":");
if (params.length < 4)
{
if (params.length < 4) {
return;
}
@ -30,8 +27,7 @@ public class Jumpgate
zCoord = Integer.parseInt(params[3]);
}
public AxisAlignedBB getGateAABB()
{
public AxisAlignedBB getGateAABB() {
int xmin, ymin, zmin;
int xmax, ymax, zmax;
xmin = xCoord - (JumpgateGenerator.GATE_LENGTH_HALF * 2);
@ -44,13 +40,11 @@ public class Jumpgate
}
@Override
public String toString()
{
public String toString() {
return name + ":" + xCoord + ":" + yCoord + ":" + zCoord;
}
public String toNiceString()
{
return name + " (" + xCoord + "; " + yCoord + "; " + zCoord + ")";
public String toNiceString() {
return name + " (" + xCoord + ", " + yCoord + ", " + zCoord + ")";
}
}