Skip to content

Commit

Permalink
Mineral wagon and class 34 textures
Browse files Browse the repository at this point in the history
Added the new bip mineral wagon
Added Black, Pink, Purple and lime texture to the class 34
Added the cattle van and 10 ton brake van to raw models
  • Loading branch information
squidman888 committed Jul 21, 2023
1 parent 5ce4cfc commit 07f8bd6
Show file tree
Hide file tree
Showing 20 changed files with 788 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions src/main/java/train/client/render/RenderEnum.java
Original file line number Diff line number Diff line change
Expand Up @@ -1291,6 +1291,7 @@ public enum RenderEnum {
Class230Middle(EntityClass230Middle.class, new ModelClass230Middle(), "Class_230_",true,new float[] {0F, 0.16F, 0F}, new float[] { 0F, 180F, 180F }, null, "", 0, null, "", null, 0, false),
DuewagGT6ERLoco(EntityElectricDuewagGT6ERLoco.class, new ModelDuewagGT6ERLoco(), "Duewag_GT6ER_", true,new float[] {-0.85F, 0.2F, 0F}, new float[] { 0F, 180F, 180F }, null, "", 0, null, "", null, 0, false),
DuewagGT6ERTail(EntityPassengerDuewagGT6ERTail.class, new ModelDuewagGT6ERTail(), "Duewag_GT6ER_", true,new float[] {-0.85F, 0.2F, 0F}, new float[] { 0F, 180F, 180F }, null, "", 0, null, "", null, 0, false),
Mineralwagon(EntityFreightMineralwagon.class, new ModelMineralwagon(), "Mineral_wagon_", true, new float[] {0f, 0.15f, 0f}, new float[] {0f, 180f, 180f}, null, "", 0, null, "", null, 0, false ),
;

private Class<? extends AbstractTrains> entityClass;
Expand Down
674 changes: 674 additions & 0 deletions src/main/java/train/client/render/models/ModelMineralwagon.java

Large diffs are not rendered by default.

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

import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
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.Freight;
import train.common.library.GuiIDs;

public class EntityFreightMineralwagon extends Freight implements IInventory {
public int freightInventorySize;
public int numFreightSlots;
public EntityFreightMineralwagon(World world) {
super(world);
initFreightCart();
}

public void initFreightCart() {
numFreightSlots = 45;
if(trainSpec!=null)freightInventorySize = trainSpec.getCargoCapacity();
cargoItems = new ItemStack[freightInventorySize];
}

public EntityFreightMineralwagon(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();
isDead = true;
}

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

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

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

NBTTagList nbttaglist = nbttagcompound.getTagList("Items", Constants.NBT.TAG_COMPOUND);
cargoItems = 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 < cargoItems.length) {
cargoItems[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
}
}
}
@Override
public String getInventoryName() {
return "5 Plank";
}

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

@Override
public boolean interactFirst(EntityPlayer entityplayer) {
playerEntity = entityplayer;
if ((super.interactFirst(entityplayer))) {
return false;
}
entityplayer.openGui(Traincraft.instance, GuiIDs.FREIGHT, worldObj, this.getEntityId(), -1, (int) this.posZ);
return true;
}
@Override
public float getOptimalDistance(EntityMinecart cart) {
return 1.5F;
}

@Override
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
return true;
}
}
5 changes: 3 additions & 2 deletions src/main/java/train/common/library/EnumTrains.java
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ public enum EnumTrains {
Class162Engine("Class162Engine", EntityElectricClass162.class, ItemIDs.minecartClass162Engine.item, "electric", 800, 160, 0,50, 0, 100, 0.7, 0.8, 1000, TraincraftUtil.getBytesFromColors(new String[] {"Blue", "Grey", "LightBlue", "Yellow", "Green", "Red"}), 18, -4,"Pack: B.I.P."),
Class162CoachB("Class162CoachB", EntityPassengerClass162CoachB.class, ItemIDs.minecartClass162CoachB.item, "passenger", 0, 0, 0,0, 0, 0, 0, 0, 0, TraincraftUtil.getBytesFromColors(new String[] {"Blue", "Grey", "LightBlue", "Yellow", "Green", "Red"}), 18, 0,"Pack: B.I.P."),
Class162CoachA("Class162CoachA", EntityPassengerClass162CoachA.class, ItemIDs.minecartClass162CoachA.item, "passenger", 0, 0, 0,0, 0, 0, 0, 0, 0, TraincraftUtil.getBytesFromColors(new String[] {"Blue", "Grey", "LightBlue", "Yellow", "Green", "Red"}), 18, 0,"Pack: B.I.P."),
Class34("Class34", EntityLocoDieselClass34.class, ItemIDs.minecartClass34.item, "diesel", 2000, 146, 0, 10, 0, 100, 0.75, 0.9, 6000, TraincraftUtil.getBytesFromColors(new String[]{"Blue","Green","Grey","Orange","Red","White","LightGrey", "Yellow"}), 18, -3, "Pack: B.I.P." ),
Class34("Class34", EntityLocoDieselClass34.class, ItemIDs.minecartClass34.item, "diesel", 2000, 146, 0, 10, 0, 100, 0.75, 0.9, 6000, TraincraftUtil.getBytesFromColors(new String[]{"Black" ,"Blue","Green","Grey","Lime" ,"Orange", "Pink", "Purple","Red","White","LightGrey", "Yellow"}), 18, -3, "Pack: B.I.P." ),
tankTankerUK("TankerUK", EntityTankerUK.class, ItemIDs.minecartTanker_UK.item, "tank", 2, TraincraftUtil.getBytesFromColors(new String[] {"Black", "Red", "Green", "Yellow", "White"}), 18, 36, "Pack: B.I.P." ),
MetalTram("MetalTram", EntityLocoElectricMetalTram.class, ItemIDs.minecartMetalTram.item, "electric", 500, 50, 0, 10, 0, 100, 0.7, 0.8, 1000,TraincraftUtil.getBytesFromColors(new String[]{"Green","Brown","Yellow"}) , 18, -2, "Modeller: Lord Squid"),
MetalTramCoach("MetalTramCoach",EntityPassengerMetalTramCoach.class, ItemIDs.minecartMetalTramCoach.item, "passenger", 0, 0, 2, 0, 0, 0, 0, 0, 0,TraincraftUtil.getBytesFromColors(new String[]{"Green", "Brown", "Yellow"}), 0, 0, "Modeller: Lord Squid" ),
Expand All @@ -532,7 +532,7 @@ public enum EnumTrains {
Class117("Class117", EntityLocoDieselClass117.class, ItemIDs.minecartClass117.item, "diesel", 500, 120, 0, 10,0,100,0.7,0.9,8000,TraincraftUtil.getBytesFromColors(new String[] {"Red", "LightBlue", "Lime", "Green", "Grey", "Blue", "Cyan", "White"}), 18, -4.1,"Pack: B.I.P."),
Class117Middle("Class117Middle", EntityPassengerClass117Middle.class, ItemIDs.minecartClass117Middle.item, "passenger", 0, 0, 0.8, 0,0,0,0,0,0,TraincraftUtil.getBytesFromColors(new String[] { "Red", "LightBlue", "Lime", "Green", "Grey", "Blue", "Cyan", "White"}), 0, 0,"Pack: B.I.P."),
TipperUK("TipperUK", EntityFreightTipperUK.class, ItemIDs.minecartTipperUK.item, "freight", 1.5, TraincraftUtil.getBytesFromColors(new String[] {"Grey", "Red","Brown","Black"}), 18, 36, "Pack: B.I.P." ),
ShuntingTenderUK("ShuntingTenderUK", EntityTenderShuntingTenderUK.class, ItemIDs.minecartShuntingTenderUK.item, "tender", 1, TraincraftUtil.getBytesFromColors(new String[] {"Black", "Blue"}), 18, 36, "Pack: B.I.P." ),
ShuntingTenderUK("ShuntingTenderUK", EntityTenderShuntingTenderUK.class, ItemIDs.minecartShuntingTenderUK.item, "tender", 0.8, TraincraftUtil.getBytesFromColors(new String[] {"Black", "Blue"}), 18, 36, "Pack: B.I.P." ),
BRBrakeVan("BRBrakeVan", EntityCabooseBRBrakeVan.class, ItemIDs.minecartBRBrakeVan.item, "passenger", 1.5, TraincraftUtil.getBytesFromColors(new String[] {"Grey","Blue","Brown", "Yellow","Red","LightBlue","LightGrey","Pink"}), 18, 36, "Pack: B.I.P." ),

/** TCCE 7 */
Expand All @@ -554,6 +554,7 @@ public enum EnumTrains {
Class230Middle("Class 230 Middle", EntityClass230Middle.class, ItemIDs.minecartClass230Middle.item, "passenger", 0, 0, 2, 0, 0, 0, 0, 0, 0, TraincraftUtil.getBytesFromColors(new String[]{"Red", "Green"}), 10, 0, "Pack: B.I.P."),
DuewagGT6ERLoco("DuewagGT6ERLoco", EntityElectricDuewagGT6ERLoco.class, ItemIDs.minecartDuewagGT6ERLoco.item, "electric", 250, 70, 0,20, 0, 100, 0.7, 0.8, 1000, TraincraftUtil.getBytesFromColors(new String[] {"Magenta","Green","Blue","White","Grey","Orange","Red","Yellow","Purple"}), 18, -1.95, "Pack: Trams In Motion"),
DuewagGT6ERTail("DuewagGT6ERTail", EntityPassengerDuewagGT6ERTail.class, ItemIDs.minecartDuewagGT6ERTail.item, "passenger", 0, 0, 1,0, 0, 0, 0, 0, 0, TraincraftUtil.getBytesFromColors(new String[] {"Magenta","Green","Blue","White","Grey","Orange","Red","Yellow","Purple"}), 18, -1.35, "Pack: Trams In Motion"),
Mineralwagon("Mineralwagon", EntityFreightMineralwagon.class, ItemIDs.minecartMineralwagon.item, "freight", 1.5, TraincraftUtil.getBytesFromColors(new String[] {"Black", "Blue", "Grey", "Lightgrey", "Orange", "Yellow"}), 18, 45, "Pack: B.I.P.")
;

//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 @@ -682,6 +682,7 @@ public enum ItemIDs {
minecartClass230Middle("ItemRollingStock","Class_230_Middle_Icon", 1),
minecartDuewagGT6ERLoco("ItemRollingStock","Duewag_GT6ER_Loco_icon",2),
minecartDuewagGT6ERTail("ItemRollingStock","Duewag_GT6ER_Tail_icon",2),
minecartMineralwagon("ItemRollingStock", "Mineral_wagon_Icon", 6),


//signalSpanish("ItemsignalSpanish","signalSpanish", 1),
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/train/common/recipes/AssemblyTableRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ public static void recipes() {
cm.addRecipe(2, new ItemStack(ItemIDs.controls.item, 0), 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.minecartGP7b.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, 4, itemDamageSteel), new ItemStack(ItemIDs.steelchimney.item, 2), new ItemStack(ItemIDs.steelcab.item, 1), new ItemStack(ItemIDs.electmotor.item, 6), new ItemStack(ItemIDs.dieselengine.item, 4), new ItemStack(ItemIDs.generator.item, 3), dye, new ItemStack(ItemIDs.minecartH24_66L.item, 1), 1);
cm.addRecipe(2, new ItemStack(ItemIDs.controls.item, 2), new ItemStack(ItemIDs.bogie.item, 6), new ItemStack(ItemIDs.steelframe.item, 3), new ItemStack(itemSteel, 3, itemDamageSteel), new ItemStack(ItemIDs.steelchimney.item, 2), new ItemStack(ItemIDs.steelcab.item, 1), new ItemStack(ItemIDs.electmotor.item, 6), new ItemStack(ItemIDs.dieselengine.item, 3), new ItemStack(ItemIDs.generator.item, 3), dye, new ItemStack(ItemIDs.minecartH16_66.item, 1), 1);

}
for (ItemStack dye : dyeLightBlue) {
cm.addRecipe(3,null, new ItemStack(ItemIDs.bogie.item,2),new ItemStack(ItemIDs.steelframe.item,1), null,null, new ItemStack(ItemIDs.steelcab.item,1),null, null,new ItemStack(ItemIDs.seats.item,1), dye,new ItemStack(ItemIDs.minecartGS4_Passenger.item,1), 1);
Expand Down Expand Up @@ -564,6 +565,8 @@ null, null, new ItemStack(c.getItem(), 1), null,
cm.addRecipe(3, new ItemStack(ItemIDs.controls.item, 1), new ItemStack(ItemIDs.bogie.item, 2), new ItemStack(ItemIDs.steelframe.item, 2), new ItemStack(itemSteel, 2, itemDamageSteel), null, new ItemStack(ItemIDs.steelcab.item, 1), new ItemStack(ItemIDs.electmotor.item, 1), new ItemStack(ItemIDs.seats.item, 4), new ItemStack(rs.getItem(), 4), dye, new ItemStack(ItemIDs.minecartFGV4300Motor.item, 1), 1);
cm.addRecipe(3, null, new ItemStack(ItemIDs.bogie.item, 2), new ItemStack(ItemIDs.steelframe.item, 2), new ItemStack(itemSteel, 2, itemDamageSteel), null, new ItemStack(ItemIDs.steelcab.item, 1), null, new ItemStack(ItemIDs.seats.item, 4), new ItemStack(rs.getItem(), 4), dye, new ItemStack(ItemIDs.minecartFGV4300Tail.item, 1), 1);
cm.addRecipe(3, new ItemStack(itemSteel, 2, itemDamageSteel), new ItemStack(ItemIDs.bogie.item, 2), new ItemStack(ItemIDs.steelframe.item, 2), new ItemStack(itemSteel, 2, itemDamageSteel), null,null, null, new ItemStack(ItemIDs.seats.item, 4), new ItemStack(rs.getItem(), 4), dye, new ItemStack(ItemIDs.minecartFGV4300Coach.item, 1), 1);
cm.addRecipe(2, new ItemStack(itemSteel, 6, itemDamageSteel), new ItemStack(ItemIDs.bogie.item, 2), new ItemStack(ItemIDs.ironFrame.item, 2), new ItemStack(Items.iron_ingot, 2), null, null, null, null, new ItemStack(Blocks.chest, 1), null, new ItemStack(ItemIDs.minecartMineralwagon.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 @@ -735,6 +735,7 @@ item.tc:minecartClass230Engine.name=Class 230 Engine
item.tc:minecartClass230Middle.name=Class 230 Middle
item.tc:minecartDuewagGT6ERLoco.name=Duewag GT6ER Loco
item.tc:minecartDuewagGT6ERTail.name=Duewag GT6ER Tail
item.tc:minecartMineralwagon.name=Mineral wagon (UK)


<!-- ## Achievements ## -->
Expand Down Expand Up @@ -1320,6 +1321,7 @@ entity.tc.Class230Engine.name=Class 230 Engine
entity.tc.Class230Middle.name=Class 230 Middle
entity.tc.DuewagGT6ERLoco.name=Duewag GT6ER Loco
entity.tc.DuewagGT6ERTail.name=Duewag GT6ER Tail
entity.tc.Mineralwagon.name=Mineral Wagon


description.villager.profession.tc.station_chief=Station Master
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 07f8bd6

Please sign in to comment.