forked from EternalBlueFlame/Traincraft-5
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
87 changed files
with
2,656 additions
and
1,737 deletions.
There are no files selected for viewing
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.
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
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
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
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
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
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
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
File renamed without changes
File renamed without changes
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
743 changes: 743 additions & 0 deletions
743
src/main/java/train/client/render/models/ModelCD754.java
Large diffs are not rendered by default.
Oops, something went wrong.
3,468 changes: 1,734 additions & 1,734 deletions
3,468
src/main/java/train/client/render/models/ModelNMBS_HLE_18.java
Large diffs are not rendered by default.
Oops, something went wrong.
167 changes: 167 additions & 0 deletions
167
src/main/java/train/common/entity/rollingStock/EntityLocoDieselCD754.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
-23 Bytes
(100%)
src/main/resources/assets/tc/textures/trains/hle19_Grey.png
Oops, something went wrong.
Binary file modified
BIN
-26 Bytes
(100%)
src/main/resources/assets/tc/textures/trains/hle19_White.png
Oops, something went wrong.