Code cleanup
This commit is contained in:
parent
edfc9bdf0c
commit
386bfd704b
2 changed files with 48 additions and 54 deletions
src/main/java/cr0s/warpdrive
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,54 +3,48 @@ package cr0s.warpdrive.data;
|
|||
import net.minecraft.util.AxisAlignedBB;
|
||||
import cr0s.warpdrive.world.JumpgateGenerator;
|
||||
|
||||
public class Jumpgate
|
||||
{
|
||||
public String name;
|
||||
public int xCoord, yCoord, zCoord;
|
||||
public class Jumpgate {
|
||||
public String name;
|
||||
public int xCoord, yCoord, zCoord;
|
||||
|
||||
public Jumpgate(String name, int x, int y, int z)
|
||||
{
|
||||
this.name = name;
|
||||
this.xCoord = x;
|
||||
this.yCoord = y;
|
||||
this.zCoord = z;
|
||||
}
|
||||
public Jumpgate(String line)
|
||||
{
|
||||
String[] params = line.split(":");
|
||||
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;
|
||||
}
|
||||
|
||||
if (params.length < 4)
|
||||
{
|
||||
return;
|
||||
}
|
||||
public Jumpgate(final String line) {
|
||||
String[] params = line.split(":");
|
||||
|
||||
name = params[0];
|
||||
xCoord = Integer.parseInt(params[1]);
|
||||
yCoord = Integer.parseInt(params[2]);
|
||||
zCoord = Integer.parseInt(params[3]);
|
||||
}
|
||||
if (params.length < 4) {
|
||||
return;
|
||||
}
|
||||
|
||||
public AxisAlignedBB getGateAABB()
|
||||
{
|
||||
int xmin, ymin, zmin;
|
||||
int xmax, ymax, zmax;
|
||||
xmin = xCoord - (JumpgateGenerator.GATE_LENGTH_HALF * 2);
|
||||
xmax = xCoord + (JumpgateGenerator.GATE_LENGTH_HALF * 2);
|
||||
ymin = yCoord - (JumpgateGenerator.GATE_SIZE_HALF);
|
||||
ymax = yCoord + (JumpgateGenerator.GATE_SIZE_HALF);
|
||||
zmin = zCoord - (JumpgateGenerator.GATE_SIZE_HALF);
|
||||
zmax = zCoord + (JumpgateGenerator.GATE_SIZE_HALF);
|
||||
return AxisAlignedBB.getBoundingBox(xmin, ymin, zmin, xmax, ymax, zmax);
|
||||
}
|
||||
name = params[0];
|
||||
xCoord = Integer.parseInt(params[1]);
|
||||
yCoord = Integer.parseInt(params[2]);
|
||||
zCoord = Integer.parseInt(params[3]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return name + ":" + xCoord + ":" + yCoord + ":" + zCoord;
|
||||
}
|
||||
public AxisAlignedBB getGateAABB() {
|
||||
int xmin, ymin, zmin;
|
||||
int xmax, ymax, zmax;
|
||||
xmin = xCoord - (JumpgateGenerator.GATE_LENGTH_HALF * 2);
|
||||
xmax = xCoord + (JumpgateGenerator.GATE_LENGTH_HALF * 2);
|
||||
ymin = yCoord - (JumpgateGenerator.GATE_SIZE_HALF);
|
||||
ymax = yCoord + (JumpgateGenerator.GATE_SIZE_HALF);
|
||||
zmin = zCoord - (JumpgateGenerator.GATE_SIZE_HALF);
|
||||
zmax = zCoord + (JumpgateGenerator.GATE_SIZE_HALF);
|
||||
return AxisAlignedBB.getBoundingBox(xmin, ymin, zmin, xmax, ymax, zmax);
|
||||
}
|
||||
|
||||
public String toNiceString()
|
||||
{
|
||||
return name + " (" + xCoord + "; " + yCoord + "; " + zCoord + ")";
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return name + ":" + xCoord + ":" + yCoord + ":" + zCoord;
|
||||
}
|
||||
|
||||
public String toNiceString() {
|
||||
return name + " (" + xCoord + ", " + yCoord + ", " + zCoord + ")";
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue