Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 1 addition & 4 deletions src/main/java/train/common/api/AbstractControlCar.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ public AbstractControlCar(World world)
}
}

public AbstractControlCar(World world, double d, double d1, double d2)
{
super(world);
}


@Override
protected void writeEntityToNBT(NBTTagCompound nbttagcompound)
Expand Down
19 changes: 16 additions & 3 deletions src/main/java/train/common/api/AbstractTrains.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,22 @@ public AbstractTrains(World world) {
}
}

public AbstractTrains(World world, double x, double y, double z) {
this(world);
this.setPosition(x, y, z);
/**
* Called to set up initial pos and motion
* ONLY CALLED BY SERVER SIDE
* @param x
* @param y
* @param z
*/
public void SetupRollingStockSpawn(double x, double y, double z)
{
setPosition(x, y + (double)yOffset, z);
motionX = 0.0D;
motionY = 0.0D;
motionZ = 0.0D;
prevPosX = x;
prevPosY = y;
prevPosZ = z;
}

@Override
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/train/common/api/AbstractWorkCart.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ public abstract class AbstractWorkCart extends EntityRollingStock{
public AbstractWorkCart(World world) {
super(world);
}
public AbstractWorkCart(World world, double d, double d1, double d2) {
super(world, d, d1, d2);
}
@Override
public void onUpdate() {
super.onUpdate();
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/train/common/api/DieselTrain.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ private DieselTrain(World world, FluidStack filter, String[] multiFilter) {
this.dataWatcher.addObject(27, 0);
this.dataWatcher.addObject(5, "");
}
public DieselTrain(World world, double d, double d1, double d2) {
super(world, d, d1, d2);
}

@Override
public int getSizeInventory() {
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/train/common/api/ElectricTrain.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ public ElectricTrain(World world) {
Ignite = false;
timeSinceIgnited = 0;
}
public ElectricTrain(World world, double x, double y, double z){
super(world,x,y,z);
}

@Override//todo:why was this so much?
public int getSizeInventory() {
Expand Down
23 changes: 8 additions & 15 deletions src/main/java/train/common/api/EntityRollingStock.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,25 +144,18 @@ public EntityRollingStock(World world) {
}

@Override
public GameProfile getOwner() {
return CartTools.getCartOwner(this);
}

public EntityRollingStock(World world, double d, double d1, double d2) {
super(world, d, d1, d2);
if(world==null){return;}
setPosition(d, d1, d2);
initRollingStock(world);
motionX = 0.0D;
motionY = 0.0D;
motionZ = 0.0D;
prevPosX = d;
prevPosY = d1;
prevPosZ = d2;
public void SetupRollingStockSpawn(double x, double y, double z)
{
super.SetupRollingStockSpawn(x, y, z);
consist = new ArrayList<AbstractTrains>();
consist.add(this);
}

@Override
public GameProfile getOwner() {
return CartTools.getCartOwner(this);
}

public void initRollingStock(World world) {
dataWatcher.addObject(20, 0);//heat
dataWatcher.addObject(14, 0);
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/train/common/api/Freight.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ public Freight(World world) {
dataWatcher.addObject(22, 0);
cargoItems = new ItemStack[getSizeInventory()];
}
public Freight(World world, double d, double d1, double d2) {
super(world, d, d1, d2);
cargoItems = new ItemStack[getSizeInventory()];
}

@Override
public boolean attackEntityFrom(DamageSource damagesource, float i) {
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/train/common/api/LiquidTank.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ private LiquidTank(@Nullable FluidStack liquid, World world) {
dataWatcher.addObject(22, "");

}
public LiquidTank(World world, double d, double d1, double d2) {
super(world, d, d1, d2);
}

public int getAmount() {
return (this.dataWatcher.getWatchableObjectInt(18));
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/train/common/api/Locomotive.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,6 @@ public Locomotive(World world) {
fuelTrain = 0;
}

public Locomotive(World world, double d, double d1, double d2) {
super(world, d, d1, d2);
fuelTrain = 0;
}

/**
* this is basically NBT for entity spawn, to keep data between client and server in sync because some data is not automatically shared.
*/
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/train/common/api/SteamTrain.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ public SteamTrain(World world, FluidStack filter) {
dataWatcher.addObject(4, 0);
this.dataWatcher.addObject(27, 0);
}
public SteamTrain(World world, double d, double d1, double d2) {
super(world, d, d1, d2);
}

@Override
public int getSizeInventory() {
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/train/common/api/Tender.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ public Tender(World world, Fluid fluid, int quantity) {
public Tender(World world){
super(world);
}
public Tender(World world, double x, double y, double z){
super(world,x,y,z);
}

public Tender(World world, Fluid fluid, int quantity, FluidStack filter) {
this(new FluidStack(fluid, quantity), world, filter);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/train/common/api/TrainRecord.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ public AbstractTrains getEntity(World world, double x, double y, double z) {
//if (world.isRemote) {
//entityClass.getConstructor(World.class).newInstance(world);
//} else {
return (AbstractTrains) entityClass.getConstructor(World.class, double.class, double.class, double.class).newInstance(world, x, y, z);
AbstractTrains abstractTrains = (AbstractTrains) entityClass.getConstructor(World.class).newInstance(world);
abstractTrains.SetupRollingStockSpawn(x, y, z);
return abstractTrains;
//}
} catch (IllegalArgumentException | SecurityException | InstantiationException |
IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ public class EntityPassengerCar1 extends EntityRollingStock implements IPassenge

public static final Item thisItem = new ItemRollingStock(new EntityPassengerCar1(null), Info.modID, Traincraft.tcTab);


public EntityPassengerCar1(World world, double d, double d1, double d2) {
super(world, d, d1, d2);
}
public EntityPassengerCar1(World world){
super(world);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@ public EntityCaboose(World world) {
super(world);
}

public EntityCaboose(World world, double d, double d1, double d2) {
this(world);
setPosition(d, d1 + (double) yOffset, d2);
motionX = 0.0D;
motionY = 0.0D;
motionZ = 0.0D;
prevPosX = d;
prevPosY = d1;
prevPosZ = d2;
}

@Override
public void setDead() {
super.setDead();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@ public EntityCaboose3(World world) {
super(world);
}

public EntityCaboose3(World world, double d, double d1, double d2) {
this(world);
setPosition(d, d1 + (double) yOffset, d2);
motionX = 0.0D;
motionY = 0.0D;
motionZ = 0.0D;
prevPosX = d;
prevPosY = d1;
prevPosZ = d2;
}

@Override
public void setDead() {
super.setDead();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@ public void initCabooseWorkCart() {
currentItemBurnTime = 0;
furnaceCookTime = 0;
}

public EntityCabooseLogging(World world, double d, double d1, double d2) {
this(world);
setPosition(d, d1 + yOffset, d2);
motionX = 0.0D;
motionY = 0.0D;
motionZ = 0.0D;
prevPosX = d;
prevPosY = d1;
prevPosZ = d2;
}

@Override
public void setDead() {
super.setDead();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@ public void initCabooseWorkCart() {
furnaceCookTime = 0;
}

public EntityCabooseLoggingPRR(World world, double d, double d1, double d2) {
this(world);
setPosition(d, d1 + yOffset, d2);
motionX = 0.0D;
motionY = 0.0D;
motionZ = 0.0D;
prevPosX = d;
prevPosY = d1;
prevPosZ = d2;
}

@Override
public void setDead() {
super.setDead();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@ public void initCabooseWorkCart() {
furnaceCookTime = 0;
}

public EntityCabooseWorkCart(World world, double d, double d1, double d2) {
this(world);
setPosition(d, d1 + yOffset, d2);
motionX = 0.0D;
motionY = 0.0D;
motionZ = 0.0D;
prevPosX = d;
prevPosY = d1;
prevPosZ = d2;
}

@Override
public void setDead() {
super.setDead();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@ public EntityGWRBrakeVan(World world) {
initWorkCart();
}

public EntityGWRBrakeVan(World world, double d, double d1, double d2) {
this(world);
setPosition(d, d1 + (double) yOffset, d2);
motionX = 0.0D;
motionY = 0.0D;
motionZ = 0.0D;
prevPosX = d;
prevPosY = d1;
prevPosZ = d2;
}

public void initWorkCart() {
furnaceItemStacks = new ItemStack[3];
furnaceBurnTime = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@ public EntityLocoDiesel44TonSwitcher(World world) {

}

public EntityLocoDiesel44TonSwitcher(World world, double d, double d1, double d2) {
this(world);
setPosition(d, d1 + yOffset, d2);
motionX = 0.0D;
motionY = 0.0D;
motionZ = 0.0D;
prevPosX = d;
prevPosY = d1;
prevPosZ = d2;
}


@Override
public void setDead() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@ public EntityLocoDieselBamboo(World world) {

}

public EntityLocoDieselBamboo(World world, double d, double d1, double d2) {
this(world);
setPosition(d, d1 + yOffset, d2);
motionX = 0.0D;
motionY = 0.0D;
motionZ = 0.0D;
prevPosX = d;
prevPosY = d1;
prevPosZ = d2;
}


@Override
public void setDead() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@ public EntityLocoDieselCD742(World world) {

}

public EntityLocoDieselCD742(World world, double d, double d1, double d2) {
this(world);
setPosition(d, d1 + yOffset, d2);
motionX = 0.0D;
motionY = 0.0D;
motionZ = 0.0D;
prevPosX = d;
prevPosY = d1;
prevPosZ = d2;
}


@Override
public void setDead() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@ public EntityLocoDieselChME3(World world) {

}

public EntityLocoDieselChME3(World world, double d, double d1, double d2) {
this(world);
setPosition(d, d1 + yOffset, d2);
motionX = 0.0D;
motionY = 0.0D;
motionZ = 0.0D;
prevPosX = d;
prevPosY = d1;
prevPosZ = d2;
}


@Override
public void setDead() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@ public EntityLocoDieselClass66(World world) {

}

public EntityLocoDieselClass66(World world, double d, double d1, double d2) {
this(world);
setPosition(d, d1 + yOffset, d2);
motionX = 0.0D;
motionY = 0.0D;
motionZ = 0.0D;
prevPosX = d;
prevPosY = d1;
prevPosZ = d2;
}


@Override
public void setDead() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@ public EntityLocoDieselDD35A(World world) {

}

public EntityLocoDieselDD35A(World world, double d, double d1, double d2) {
this(world);
setPosition(d, d1 + yOffset, d2);
motionX = 0.0D;
motionY = 0.0D;
motionZ = 0.0D;
prevPosX = d;
prevPosY = d1;
prevPosZ = d2;
}


@Override
public void setDead() {
Expand Down
Loading
Loading