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: Class 374 Front Class 374 Premier Panto Class 374 Standard Panto Class 374 Buffet Horn and ICE skin probably to come later
- Loading branch information
Showing
31 changed files
with
7,382 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
1,455 changes: 1,455 additions & 0 deletions
1,455
src/main/java/train/client/render/models/ModelClass374Buffet.java
Large diffs are not rendered by default.
Oops, something went wrong.
1,843 changes: 1,843 additions & 0 deletions
1,843
src/main/java/train/client/render/models/ModelClass374Front.java
Large diffs are not rendered by default.
Oops, something went wrong.
1,815 changes: 1,815 additions & 0 deletions
1,815
src/main/java/train/client/render/models/ModelClass374PremierPanto.java
Large diffs are not rendered by default.
Oops, something went wrong.
1,855 changes: 1,855 additions & 0 deletions
1,855
src/main/java/train/client/render/models/ModelClass374StandardPanto.java
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
|
||
package train.client.render.models; | ||
|
||
|
||
import tmt.ModelConverter; | ||
import tmt.ModelRendererTurbo; | ||
|
||
|
152 changes: 152 additions & 0 deletions
152
src/main/java/train/common/entity/rollingStock/EntityElectricClass374.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,152 @@ | ||
package train.common.entity.rollingStock; | ||
|
||
//import com.jcirmodelsquad.tcjcir.features.TiltingHandler; | ||
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.ElectricTrain; | ||
import train.common.library.GuiIDs; | ||
|
||
public class EntityElectricClass374 extends ElectricTrain { | ||
//public TiltingHandler tiltingHandler = new TiltingHandler(7); | ||
|
||
public EntityElectricClass374(World world) { | ||
super(world); | ||
|
||
} | ||
|
||
public EntityElectricClass374(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 updateRiderPosition() { | ||
if (riddenByEntity == null) {return;} | ||
double pitchRads = this.anglePitchClient * Math.PI / 180.0D; | ||
double distance = 5.24; | ||
double yOffset = -0.28; | ||
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 != null && riddenByEntity instanceof EntityPlayer) { | ||
((EntityPlayer) riddenByEntity).openGui(Traincraft.instance, GuiIDs.LOCO, worldObj, (int) this.posX + 2, (int) this.posY, (int) this.posZ); | ||
} | ||
} | ||
|
||
@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 "Class 374 Eurostar Front"; | ||
} | ||
|
||
@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.85F; | ||
} | ||
|
||
@Override | ||
public boolean canBeAdjusted(EntityMinecart cart) { | ||
return canBeAdjusted; | ||
} | ||
@Override | ||
public boolean isItemValidForSlot(int i, ItemStack itemstack) { | ||
return true; | ||
} | ||
} |
79 changes: 79 additions & 0 deletions
79
src/main/java/train/common/entity/rollingStock/EntityPassengerClass374Buffet.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,79 @@ | ||
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.world.World; | ||
import train.common.api.EntityRollingStock; | ||
import train.common.api.IPassenger; | ||
|
||
public class EntityPassengerClass374Buffet extends EntityRollingStock implements IPassenger { | ||
//public TiltingHandler tiltingHandler = new TiltingHandler(7); | ||
|
||
public EntityPassengerClass374Buffet(World world) { | ||
super(world); | ||
} | ||
|
||
public EntityPassengerClass374Buffet(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) { | ||
riddenByEntity.setPosition(posX, posY + getMountedYOffset() + riddenByEntity.getYOffset() - 0.3, posZ ); | ||
}//ew yucky rider position code, good thing its a passenger car so it doesnt matter! Wheeze.png | ||
} | ||
|
||
@Override | ||
public void setDead() { | ||
super.setDead(); | ||
isDead = true; | ||
} | ||
|
||
@Override | ||
public boolean interactFirst(EntityPlayer entityplayer) { | ||
playerEntity = entityplayer; | ||
if ((super.interactFirst(entityplayer))) { | ||
return false; | ||
} | ||
if (!worldObj.isRemote) { | ||
ItemStack itemstack = entityplayer.inventory.getCurrentItem(); | ||
if(lockThisCart(itemstack, entityplayer))return true; | ||
if (riddenByEntity != null && (riddenByEntity instanceof EntityPlayer) && riddenByEntity != entityplayer) { | ||
return true; | ||
} | ||
if (!worldObj.isRemote) { | ||
entityplayer.mountEntity(this); | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean canBeRidden() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean isStorageCart() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean isPoweredCart() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public float getOptimalDistance(EntityMinecart cart) { | ||
return 3.45F; | ||
} | ||
} |
79 changes: 79 additions & 0 deletions
79
src/main/java/train/common/entity/rollingStock/EntityPassengerClass374PremierPanto.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,79 @@ | ||
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.world.World; | ||
import train.common.api.EntityRollingStock; | ||
import train.common.api.IPassenger; | ||
|
||
public class EntityPassengerClass374PremierPanto extends EntityRollingStock implements IPassenger { | ||
//public TiltingHandler tiltingHandler = new TiltingHandler(7); | ||
|
||
public EntityPassengerClass374PremierPanto(World world) { | ||
super(world); | ||
} | ||
|
||
public EntityPassengerClass374PremierPanto(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) { | ||
riddenByEntity.setPosition(posX, posY + getMountedYOffset() + riddenByEntity.getYOffset() - 0.2, posZ); | ||
}//ew yucky rider position code, good thing its a passenger car so it doesnt matter! Wheeze.png | ||
} | ||
|
||
@Override | ||
public void setDead() { | ||
super.setDead(); | ||
isDead = true; | ||
} | ||
|
||
@Override | ||
public boolean interactFirst(EntityPlayer entityplayer) { | ||
playerEntity = entityplayer; | ||
if ((super.interactFirst(entityplayer))) { | ||
return false; | ||
} | ||
if (!worldObj.isRemote) { | ||
ItemStack itemstack = entityplayer.inventory.getCurrentItem(); | ||
if(lockThisCart(itemstack, entityplayer))return true; | ||
if (riddenByEntity != null && (riddenByEntity instanceof EntityPlayer) && riddenByEntity != entityplayer) { | ||
return true; | ||
} | ||
if (!worldObj.isRemote) { | ||
entityplayer.mountEntity(this); | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean canBeRidden() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean isStorageCart() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean isPoweredCart() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public float getOptimalDistance(EntityMinecart cart) { | ||
return 3.45F; | ||
} | ||
} |
Oops, something went wrong.