Skip to content

Commit

Permalink
Added the j50
Browse files Browse the repository at this point in the history
We will miss you Eternal.
Added the J50
Changed something that said 5 plank to mineral wagon in the entity class file for the mineral wagon
  • Loading branch information
squidman888 committed Aug 5, 2023
1 parent 07f8bd6 commit d8b1e38
Show file tree
Hide file tree
Showing 25 changed files with 2,810 additions and 2 deletions.
Binary file added NotAddedContent-Open/j50/j50 mk2.mtb
Binary file not shown.
Binary file removed NotAddedContent-Open/j50/j50.mtb
Binary file not shown.
10 changes: 10 additions & 0 deletions src/main/java/train/client/render/RenderEnum.java
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,16 @@ public enum RenderEnum {
}
}, 2, true),

locoJ50(EntityLocoSteamJ50.class, new ModelJ50(), "J50_", true, new float[] {-1.25f, 0.17f, 0 }, new float[] {0,180,180}, null, "largesmoke", 3, new ArrayList<double[]>() {
{
add(new double[] { 2.7D, 1.5D, 0D });
}
}, "explode", new ArrayList<double[]>() {
{
add(new double[] { 2.8D, 0.05D, 0.65D });
}
}, 2, true),

locoC41_080(EntityLocoSteamC41_080.class, new ModelC41_080(), "locoC41_080", false, new float[] { -3.5F, -0.5F, 0.0F }, new float[] { 0, 180, 180 }, null, "largesmoke", 3, new ArrayList<double[]>() {
{
add(new double[] { 3.55D, 1.65D, 0D });
Expand Down
2,629 changes: 2,629 additions & 0 deletions src/main/java/train/client/render/models/ModelJ50.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
}
@Override
public String getInventoryName() {
return "5 Plank";
return "Mineral Wagon";
}

@Override
Expand Down
163 changes: 163 additions & 0 deletions src/main/java/train/common/entity/rollingStock/EntityLocoSteamJ50.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
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.LiquidManager;
import train.common.api.SteamTrain;
import train.common.library.EnumTrains;
import train.common.library.GuiIDs;

public class EntityLocoSteamJ50 extends SteamTrain {
public EntityLocoSteamJ50(World world) {
super(world, EnumTrains.locosteamHallClass.getTankCapacity(), LiquidManager.WATER_FILTER);
initLocoSteam();
}

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

public EntityLocoSteamJ50(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 = 0.05;
double yOffset = 0.2;
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 + 1;
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 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], locoInvent[1], this);
}

@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 "J50";
}

@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 1.025F;
}


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

@Override
public boolean isItemValidForSlot(int i, ItemStack itemstack) { return true; }
}
1 change: 1 addition & 0 deletions src/main/java/train/common/library/EnumSounds.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ public enum EnumSounds {
DB420Loco(EntityElectricDB420Loco.class, "mg_horn", 1F, "mg_run", 0.6F, 8, "mg_idle", 0.4F, 50, false),
Class401Loco(EntityLocoElectricClass401.class, "mg_horn", 1F, "mg_run", 0.6F, 50, "vl10_idle", 0.6F, 50, false),
DuewagGT6ERLoco(EntityElectricDuewagGT6ERLoco.class, "tram_bell", 1F, "vl10_idle", 0.6F, 50, "vl10_idle", 0.6F, 50, false),
J50loco(EntityLocoSteamJ50.class, "a4_whistle", 1.25f, "steam_run", 0.5f, 25, "adler_run", 1, 40, true),

//American Stuff
Diesel3GS21B(EntityLocoDieselBapNRE3gs21b.class, "nathan_k3ha", 2.5F, "QSK19C_Notch8", 0.65F, 40, "QSK19C_Idle", 0.65F, 50, true),
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/train/common/library/EnumTrains.java
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,8 @@ 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.")
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."),
J50loco("J50loco", EntityLocoSteamJ50.class, ItemIDs.minecartJ50.item, "steam", 618, 80, 0, 5, 7, 100, 0.8, 0.8, 7000, TraincraftUtil.getBytesFromColors(new String[] {"Black", "Blue", "Brown", "Cyan", "Lime", "Green", "Grey", "LightBlue", "LightGrey", "Orange", "Pink", "Red", "Yellow"}), 18, 2.45f, "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 @@ -683,6 +683,7 @@ public enum ItemIDs {
minecartDuewagGT6ERLoco("ItemRollingStock","Duewag_GT6ER_Loco_icon",2),
minecartDuewagGT6ERTail("ItemRollingStock","Duewag_GT6ER_Tail_icon",2),
minecartMineralwagon("ItemRollingStock", "Mineral_wagon_Icon", 6),
minecartJ50("ItemRollingStock", "J50_icon", 5),


//signalSpanish("ItemsignalSpanish","signalSpanish", 1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public static void recipes() {
cm.addRecipe(1, null, new ItemStack(ItemIDs.ironBogie.item, 3), new ItemStack(ItemIDs.ironFrame.item, 2), new ItemStack(iron.getItem(), 2), new ItemStack(ItemIDs.ironChimney.item, 1), new ItemStack(ItemIDs.ironCab.item, 1), new ItemStack(ItemIDs.ironBoiler.item, 2), new ItemStack(ItemIDs.ironFirebox.item, 1), new ItemStack(c.getItem(), 1), null, new ItemStack(ItemIDs.minecartBR_Black_5.item, 1), 1);
cm.addRecipe(1, null, new ItemStack(ItemIDs.ironBogie.item, 3), new ItemStack(ItemIDs.ironFrame.item, 2), new ItemStack(iron.getItem(), 2), new ItemStack(ItemIDs.ironChimney.item, 1), new ItemStack(ItemIDs.ironCab.item, 1), new ItemStack(ItemIDs.ironBoiler.item, 2), new ItemStack(ItemIDs.ironFirebox.item, 1), new ItemStack(c.getItem(), 1), null, new ItemStack(ItemIDs.minecartBRBritanniaClass.item, 1), 1);
cm.addRecipe(1, null, new ItemStack(ItemIDs.ironBogie.item, 3), new ItemStack(ItemIDs.ironFrame.item, 2), new ItemStack(iron.getItem(), 2), new ItemStack(ItemIDs.ironChimney.item, 1), new ItemStack(ItemIDs.ironCab.item, 1), new ItemStack(ItemIDs.ironBoiler.item, 2), new ItemStack(ItemIDs.ironFirebox.item, 1), new ItemStack(c.getItem(), 1), null, new ItemStack(ItemIDs.minecartRWType3.item, 1), 1);
cm.addRecipe(1, null, new ItemStack(ItemIDs.ironBogie.item, 3), new ItemStack(ItemIDs.ironFrame.item, 2), new ItemStack(iron.getItem(), 2), new ItemStack(ItemIDs.ironChimney.item, 1), new ItemStack(ItemIDs.ironCab.item, 1), new ItemStack(ItemIDs.ironBoiler.item, 2), new ItemStack(ItemIDs.ironFirebox.item, 1), new ItemStack(c.getItem(), 1), null, new ItemStack(ItemIDs.minecartJ50.item, 1), 1);
cm.addRecipe(1, null, new ItemStack(ItemIDs.ironBogie.item, 3), new ItemStack(ItemIDs.ironFrame.item, 2), new ItemStack(iron.getItem(), 2), new ItemStack(ItemIDs.ironChimney.item, 1), new ItemStack(ItemIDs.ironCab.item, 1), new ItemStack(ItemIDs.ironBoiler.item, 2), new ItemStack(ItemIDs.ironFirebox.item, 1), new ItemStack(c.getItem(), 1), null, new ItemStack(ItemIDs.minecartRWType2.item, 1), 1);
cm.addRecipe(1, null, new ItemStack(ItemIDs.ironBogie.item, 3), new ItemStack(ItemIDs.ironFrame.item, 2), new ItemStack(iron.getItem(), 2), new ItemStack(ItemIDs.ironChimney.item, 1), new ItemStack(ItemIDs.ironCab.item, 1), new ItemStack(ItemIDs.ironBoiler.item, 2), new ItemStack(ItemIDs.ironFirebox.item, 1), new ItemStack(c.getItem(), 1), null, new ItemStack(ItemIDs.minecartGWR101Class.item, 1), 1);
cm.addRecipe(1, null, new ItemStack(ItemIDs.ironBogie.item, 3), new ItemStack(ItemIDs.ironFrame.item, 2), new ItemStack(iron.getItem(), 2), new ItemStack(ItemIDs.ironChimney.item, 1), new ItemStack(ItemIDs.ironCab.item, 1), new ItemStack(ItemIDs.ironBoiler.item, 2), new ItemStack(ItemIDs.ironFirebox.item, 1), new ItemStack(c.getItem(), 1), null, new ItemStack(ItemIDs.minecartGWR42xx.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 @@ -736,6 +736,7 @@ 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)
item.tc:minecartJ50.name=J50


<!-- ## Achievements ## -->
Expand Down Expand Up @@ -1322,6 +1323,7 @@ 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
entity.tc.J50loco.name=J50


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.
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 d8b1e38

Please sign in to comment.