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 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
1 parent
5ce4cfc
commit 07f8bd6
Showing
20 changed files
with
788 additions
and
2 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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
674 changes: 674 additions & 0 deletions
674
src/main/java/train/client/render/models/ModelMineralwagon.java
Large diffs are not rendered by default.
Oops, something went wrong.
104 changes: 104 additions & 0 deletions
104
src/main/java/train/common/entity/rollingStock/EntityFreightMineralwagon.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,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; | ||
} | ||
} |
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
Binary file added
BIN
+217 Bytes
src/main/resources/assets/tc/textures/items/trains/Mineral_wagon_Icon.png
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.
Binary file added
BIN
+8.27 KB
src/main/resources/assets/tc/textures/trains/Mineral_wagon_Lightgrey.png
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.
Binary file added
BIN
+8.29 KB
src/main/resources/assets/tc/textures/trains/Mineral_wagon_Yellow.png
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.