Skip to content

Commit

Permalink
Added CD754
Browse files Browse the repository at this point in the history
Added CD754; had to fix some of the parts and texture
Its rendering a bit small but that can be fixed soon
All recent additions in NotAddedContent are now marked as DONE
Also updated HLE to have slightly thicker pantograph
  • Loading branch information
chazi898 committed Aug 11, 2023
1 parent 393f737 commit 878993a
Show file tree
Hide file tree
Showing 87 changed files with 2,656 additions and 1,737 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
Binary file added NotAddedContent-Open/cd754 - DONE/cd754.mtb
Binary file not shown.
Binary file added NotAddedContent-Open/cd754 - DONE/cd754_Red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed NotAddedContent-Open/cd754/cd754_Red.png
Diff not rendered.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
5 changes: 5 additions & 0 deletions src/main/java/train/client/render/RenderEnum.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ public enum RenderEnum {
add(new double[] { 1.25D, 1.15D, 0.0D });
}
}, "", null, 0, false),
locoCD754(EntityLocoDieselCD754.class, new ModelCD754(), "cd754_", true, new float[] { -2.2F, 0.05F, 0.0F }, new float[] { 180F, 0F, 0F }, new float[] { 0.8F, 0.8F, 0.8F }, "smoke", 5, new ArrayList<double[]>() {
{
add(new double[] { 1.25D, 1.15D, 0.0D });
}
}, "", null, 0, false),
locoChME3(EntityLocoDieselChME3.class, new ModelChME3(), "chme3", false, new float[] { -0.5F, -0.47F, 0.0F }, null, null, "smoke", 4, new ArrayList<double[]>() {
{
add(new double[] { 0.6D, 1.55D, 0.0D });
Expand Down
743 changes: 743 additions & 0 deletions src/main/java/train/client/render/models/ModelCD754.java

Large diffs are not rendered by default.

3,468 changes: 1,734 additions & 1,734 deletions src/main/java/train/client/render/models/ModelNMBS_HLE_18.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
package train.common.entity.rollingStock;

import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants;
import train.common.Traincraft;
import train.common.api.DieselTrain;
import train.common.api.LiquidManager;
import train.common.library.EnumTrains;
import train.common.library.GuiIDs;

public class EntityLocoDieselCD754 extends DieselTrain {
public EntityLocoDieselCD754(World world) {
super(world, EnumTrains.locoDieselCD754.getTankCapacity(), LiquidManager.dieselFilter());
initLoco();
}

public void initLoco() {
fuelTrain = 0;
locoInvent = new ItemStack[inventorySize];
}

public EntityLocoDieselCD754(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 updateRiderPosition() {
if(riddenByEntity==null){return;}
double pitchRads = this.anglePitchClient * Math.PI / 180.0D;
double distance = 2.7;
double yOffset = -0.1;
float rotationCos1 = (float) Math.cos(Math.toRadians(this.renderYaw + 90));
float rotationSin1 = (float) Math.sin(Math.toRadians((this.renderYaw + 90)));
if(side.isServer()){
rotationCos1 = (float) Math.cos(Math.toRadians(this.serverRealRotation + 90));
rotationSin1 = (float) Math.sin(Math.toRadians((this.serverRealRotation + 90)));
anglePitchClient = serverRealPitch*60;
}
float pitch = (float) (posY + ((Math.tan(pitchRads) * distance) + getMountedYOffset())
+ riddenByEntity.getYOffset() + yOffset);
float pitch1 = (float) (posY + getMountedYOffset() + riddenByEntity.getYOffset() + yOffset);
double bogieX1 = (this.posX + (rotationCos1 * distance));
double bogieZ1 = (this.posZ + (rotationSin1* distance));
// System.out.println(rotationCos1+" "+rotationSin1);
if(anglePitchClient>20 && rotationCos1 == 1){
bogieX1 -= pitchRads * 2;
pitch-=pitchRads*1.2;
}
if(anglePitchClient>20 && rotationSin1 == 1){
bogieZ1 -= pitchRads * 2;
pitch-=pitchRads*1.2;
}
if (pitchRads == 0.0) {
riddenByEntity.setPosition(bogieX1, pitch1, bogieZ1);
}
if (pitchRads > -1.01 && pitchRads < 1.01) {
riddenByEntity.setPosition(bogieX1, pitch, bogieZ1);
}
}

@Override
public void setDead() {
super.setDead();
isDead = true;
}

@Override
public void pressKey(int i) {
if (i == 7 && riddenByEntity != null && riddenByEntity instanceof EntityPlayer) {
((EntityPlayer) riddenByEntity).openGui(Traincraft.instance, GuiIDs.LOCO, worldObj, (int) this.posX, (int) this.posY, (int) this.posZ);
}
}

@Override
public void onUpdate() {
super.onUpdate();
if (worldObj.isRemote) {
return;
}
checkInvent(locoInvent[0]);
}

@Override
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
super.writeEntityToNBT(nbttagcompound);

nbttagcompound.setShort("fuelTrain", (short) fuelTrain);
NBTTagList nbttaglist = new NBTTagList();
for (int i = 0; i < locoInvent.length; i++) {
if (locoInvent[i] != null) {
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
nbttagcompound1.setByte("Slot", (byte) i);
locoInvent[i].writeToNBT(nbttagcompound1);
nbttaglist.appendTag(nbttagcompound1);
}
}
nbttagcompound.setTag("Items", nbttaglist);
}

@Override
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
super.readEntityFromNBT(nbttagcompound);

fuelTrain = nbttagcompound.getShort("fuelTrain");
NBTTagList nbttaglist = nbttagcompound.getTagList("Items", Constants.NBT.TAG_COMPOUND);
locoInvent = new ItemStack[getSizeInventory()];
for (int i = 0; i < nbttaglist.tagCount(); i++) {
NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
int j = nbttagcompound1.getByte("Slot") & 0xff;
if (j >= 0 && j < locoInvent.length) {
locoInvent[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
}
}
}

@Override
public int getSizeInventory() {
return inventorySize;
}

@Override
public String getInventoryName() {
return "CD742";
}

@Override
public boolean interactFirst(EntityPlayer entityplayer) {
playerEntity = entityplayer;
if ((super.interactFirst(entityplayer))) {
return false;
}
if (!worldObj.isRemote) {
if (riddenByEntity != null && (riddenByEntity instanceof EntityPlayer) && riddenByEntity != entityplayer) {
return true;
}
entityplayer.mountEntity(this);
}
return true;
}

@Override
public float getOptimalDistance(EntityMinecart cart) {
return (0.8F);
}

@Override
public boolean canBeAdjusted(EntityMinecart cart) {
return canBeAdjusted;
}

@Override
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
return true;
}
}
4 changes: 2 additions & 2 deletions src/main/java/train/common/library/EnumSounds.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public enum EnumSounds {
nmbs_hle_18(EntityLocoElectricNMBS_HLE_18.class, "mg_horn", 1F, "vl10_idle", 0.8F, 10, "vl10_idle", 0.6F, 50, false),
locoClass85(EntityLocoElectricClass85.class, "mg_horn", 1F, "vl10_idle", 0.8F, 10, "vl10_idle", 0.6F, 50, false),
locoBNLRV_A(EntityLocoElectricBNLRV_A.class, "tram_horn", 0.8F, "chme3_idle", 0.65F, 40, "chme3_idle", 0.65F, 40, false),
locoCD742(EntityLocoDieselCD742.class, "742_horn", 0.8F, "742_motor_slow", 0.65F, 40, "742_motor", 0.65F, 40,
false),
locoCD742(EntityLocoDieselCD742.class, "742_horn", 0.8F, "742_motor_slow", 0.65F, 40, "742_motor", 0.65F, 40, false),
locoCD754(EntityLocoDieselCD754.class, "742_horn", 0.8F, "742_motor_slow", 0.65F, 40, "742_motor", 0.65F, 40, false),
locoChME3(EntityLocoDieselChME3.class, "chme3_horn", 0.8F, "chme3_idle", 0.65F, 40, "chme3_idle", 0.65F, 40, false),
locoGP7Red(EntityLocoDieselGP7Red.class, "gp_horn", 0.8F, "chme3_idle", 0.65F, 40, "chme3_idle", 0.65F, 40, false),
locoBP4(EntityLocoElectricBP4.class, "nathan_k5La_3", 0.8F, "chme3_idle", 0.65F, 40, "chme3_idle", 0.65F, 40, false),
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/train/common/library/EnumTrains.java
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ public enum EnumTrains {
Class143Front("Class143front", EntityLocoDieselClass143.class, ItemIDs.minecartClass143Front.item, "diesel", 225, 121, 0, 5, 0, 100, 0.9, 0.9, 7500,TraincraftUtil.getBytesFromColors(new String[] {"Black", "Blue", "Cyan", "Green", "Grey", "LightBlue", "LightGrey", "Lime", "Magenta", "Orange", "Pink", "Purple", "Red", "White", "Yellow"}), 18, -2,"Pack: B.I.P."),
Class143Rear("Class143rear", EntityPassengerClass143.class, ItemIDs.minecartClass143Rear.item, "passenger", 3, TraincraftUtil.getBytesFromColors(new String[] {"Black", "Blue", "Cyan", "Green", "Grey", "LightBlue", "LightGrey", "Lime", "Magenta", "Orange", "Pink", "Purple", "Red", "White", "Yellow"}), 18, 0,"Pack: B.I.P."),
Class143Middle("Class143middle", EntityPassengerClass143M.class, ItemIDs.minecartClass143Middle.item, "passenger", 2.5, TraincraftUtil.getBytesFromColors(new String[] {"Blue", "Grey", "Magenta", "Pink", "Purple", "White", "Yellow"}), 18, 0,"Pack: B.I.P."),

locoDieselCD754("Loco Diesel CD754", EntityLocoDieselCD754.class, ItemIDs.minecartCD754.item,"diesel", 1974, 101, 0, 60, 0, 170, 0.66, 0.96, 5000, TraincraftUtil.getBytesFromColors(new String[]{"Red"}), 13, -2.8),
;

//String trainType,int MHP,int maxSpeed, double mass, int fuelConsumption, int waterConsumption, int heatingTime, double accelerationRate, double brakeRate, int tankCapacity, String[] colors,
Expand Down
1 change: 1 addition & 0 deletions src/main/java/train/common/library/ItemIDs.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ public enum ItemIDs {
minecartPassengerBlue("ItemRollingStock", "train_passenger_3", 2),
minecartGP7Red("ItemRollingStock", "train_gp7", 10),
minecartCD742("ItemRollingStock", "train_cd742", 10),
minecartCD754("ItemRollingStock", "CD754_Icon", 10),
minecartFlatCartSU("ItemRollingStock", "train_flat_su", 1),
minecartFlatCartUS("ItemRollingStock", "train_flat_us", 1),
minecartBoxCartUS("ItemRollingStock", "train_box_us", 4),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ public static void recipes() {

for (ItemStack dye : dyeRed) {
cm.addRecipe(2, new ItemStack(ItemIDs.controls.item, 2), new ItemStack(ItemIDs.bogie.item, 3), new ItemStack(ItemIDs.steelframe.item, 2), new ItemStack(itemSteel, 2, itemDamageSteel), new ItemStack(ItemIDs.steelchimney.item, 1), new ItemStack(ItemIDs.steelcab.item, 1), new ItemStack(ItemIDs.electmotor.item, 4), new ItemStack(ItemIDs.dieselengine.item, 4), new ItemStack(ItemIDs.generator.item, 2), dye, new ItemStack(ItemIDs.minecartCD742.item, 1), 1);
cm.addRecipe(2, new ItemStack(ItemIDs.controls.item, 2), new ItemStack(ItemIDs.bogie.item, 3), new ItemStack(ItemIDs.steelframe.item, 2), new ItemStack(itemSteel, 2, itemDamageSteel), new ItemStack(ItemIDs.steelchimney.item, 1), new ItemStack(ItemIDs.steelcab.item, 1), new ItemStack(ItemIDs.electmotor.item, 4), new ItemStack(ItemIDs.dieselengine.item, 4), new ItemStack(ItemIDs.generator.item, 3), dye, new ItemStack(ItemIDs.minecartCD754.item, 1), 1);
cm.addRecipe(2, new ItemStack(ItemIDs.controls.item, 2), new ItemStack(ItemIDs.bogie.item, 3), new ItemStack(ItemIDs.steelframe.item, 2), new ItemStack(itemSteel, 2, itemDamageSteel), new ItemStack(ItemIDs.steelchimney.item, 1), new ItemStack(ItemIDs.steelcab.item, 1), new ItemStack(ItemIDs.electmotor.item, 4), new ItemStack(ItemIDs.dieselengine.item, 4), new ItemStack(ItemIDs.generator.item, 3), dye, new ItemStack(ItemIDs.minecartGP7Red.item, 1), 1);
cm.addRecipe(2, new ItemStack(ItemIDs.controls.item, 2), new ItemStack(ItemIDs.bogie.item, 2), new ItemStack(ItemIDs.steelframe.item, 2), new ItemStack(itemSteel, 2, itemDamageSteel), new ItemStack(ItemIDs.steelchimney.item, 1), new ItemStack(ItemIDs.steelcab.item, 1), new ItemStack(ItemIDs.electmotor.item, 4), new ItemStack(ItemIDs.dieselengine.item, 2), new ItemStack(ItemIDs.generator.item, 2), dye, new ItemStack(ItemIDs.minecartLocoSW8.item, 1), 1);
cm.addRecipe(2, new ItemStack(ItemIDs.controls.item, 2), new ItemStack(ItemIDs.bogie.item, 6), new ItemStack(ItemIDs.steelframe.item, 4), new ItemStack(itemSteel, 3, itemDamageSteel), new ItemStack(ItemIDs.steelchimney.item, 1), new ItemStack(ItemIDs.steelcab.item, 1), new ItemStack(ItemIDs.electmotor.item, 4), new ItemStack(ItemIDs.dieselengine.item, 3), new ItemStack(ItemIDs.generator.item, 3), dye, new ItemStack(ItemIDs.minecartAlcoPA1.item, 1), 1);
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/tc/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ item.tc:minecartPassengerBlue.name=Passenger Car
item.tc:minecartPassengerDBOriental.name=Passenger Orient Express
item.tc:minecartGP7Red.name=GP7 (US)
item.tc:minecartCD742.name=CD 742
item.tc:minecartCD754.name=CD 754
item.tc:minecartFlatCartSU.name=Flat car (SU)
item.tc:minecartFlatCartUS.name=Flat car (US)
item.tc:minecartBoxCartUS.name=Box Car (US)
Expand Down Expand Up @@ -870,6 +871,7 @@ entity.tc.Loco Diesel SD40.name=SD40-2 (US)
entity.tc.Loco Diesel GP7.name=GP7 (US)
entity.tc.Loco Diesel ChME3.name=ChME3 (SU)
entity.tc.Loco Diesel CD742.name=CD 742
entity.tc.Loco Diesel CD754.name=CD 754
entity.tc.Loco Diesel KOF DB.name=Kof II (DB)
entity.tc.Tender C62Class.name=C62 Class Tender (JNR)
entity.tc.Tender D51.name=D51 Tender (JNR)
Expand Down
Binary file modified src/main/resources/assets/tc/textures/trains/hle19_Grey.png
Binary file modified src/main/resources/assets/tc/textures/trains/hle19_White.png

0 comments on commit 878993a

Please sign in to comment.