50
This commit is contained in:
parent
51d07ac8f5
commit
fe9d41ac76
25 changed files with 1076 additions and 556 deletions
|
@ -8,6 +8,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import powercrystals.minefactoryreloaded.api.IDeepStorageUnit;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.common.util.Inventory;
|
||||
|
@ -26,7 +27,7 @@ public class TileQuantumChest extends TileMachineBase implements IInventory,
|
|||
//TODO use long so we can have 9,223,372,036,854,775,807 items instead of 2,147,483,647
|
||||
int storage = (int) Double.MAX_VALUE;
|
||||
|
||||
public Inventory inventory = new Inventory(3, "TileQuantumChest", storage);
|
||||
public Inventory inventory = new Inventory(3, "TileQuantumChest", storage, this);
|
||||
|
||||
public ItemStack storedItem;
|
||||
|
||||
|
@ -95,14 +96,13 @@ public class TileQuantumChest extends TileMachineBase implements IInventory,
|
|||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbtTag = new NBTTagCompound();
|
||||
writeToNBT(nbtTag);
|
||||
return new S35PacketUpdateTileEntity(this.getPos().getX(), this.getPos().getY(),
|
||||
this.getPos().getZ(), 1, nbtTag);
|
||||
return new S35PacketUpdateTileEntity(this.getPos(), 1, nbtTag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) {
|
||||
worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(), getPos().getY(), getPos().getZ());
|
||||
readFromNBT(packet.func_148857_g());
|
||||
readFromNBT(packet.getNbtCompound());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -167,15 +167,50 @@ public class TileQuantumChest extends TileMachineBase implements IInventory,
|
|||
public void setInventorySlotContents(int slot, ItemStack stack) {
|
||||
inventory.setInventorySlotContents(slot, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return inventory.getInventoryName();
|
||||
public void openInventory(EntityPlayer player) {
|
||||
inventory.openInventory(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return inventory.hasCustomInventoryName();
|
||||
public void closeInventory(EntityPlayer player) {
|
||||
inventory.closeInventory(player);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getField(int id) {
|
||||
return inventory.getField(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setField(int id, int value) {
|
||||
inventory.setField(id, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFieldCount() {
|
||||
return inventory.getFieldCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
inventory.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandSenderName() {
|
||||
return inventory.getCommandSenderName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomName() {
|
||||
return inventory.hasCustomName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IChatComponent getDisplayName() {
|
||||
return inventory.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -188,16 +223,6 @@ public class TileQuantumChest extends TileMachineBase implements IInventory,
|
|||
return inventory.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
inventory.openInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
inventory.closeInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack stack) {
|
||||
return inventory.isItemValidForSlot(slot, stack);
|
||||
|
@ -240,7 +265,7 @@ public class TileQuantumChest extends TileMachineBase implements IInventory,
|
|||
ItemStack dropStack = new ItemStack(ModBlocks.quantumChest, 1);
|
||||
writeToNBTWithoutCoords(tileEntity);
|
||||
dropStack.setTagCompound(new NBTTagCompound());
|
||||
dropStack.stackTagCompound.setTag("tileEntity", tileEntity);
|
||||
dropStack.getTagCompound().setTag("tileEntity", tileEntity);
|
||||
return dropStack;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue