mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-26 15:13:09 +00:00
Implement metal blocks and clean up some unloc names
This commit is contained in:
1 parent
42237f0be8
commit
9a05bc03a9
12 files changed
+986
-849
No files matched your search
@@ -5,6 +5,9 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -165,6 +168,18 @@ public class TileEntityPresent extends TileEntity implements IInventory {
|
||||
}
|
||||
autoSearch = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
writeToNBT(tag);
|
||||
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) {
|
||||
readFromNBT(packet.func_148857_g());
|
||||
}
|
||||
|
||||
/* IInventory */
|
||||
|
||||
@@ -188,6 +203,7 @@ public class TileEntityPresent extends TileEntity implements IInventory {
|
||||
ItemStack[] inv = inventory;
|
||||
if (isConnected() && slot >= inventory.length) {
|
||||
inv = connection.inventory;
|
||||
slot %= inventory.length;
|
||||
}
|
||||
|
||||
if (inv[slot] != null)
|
||||
|
||||
Reference in new issue
Block a user