mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Fixed items with meta not working + mass storage support
This commit is contained in:
parent
d4e9a5d010
commit
7f666ecaff
@ -10,27 +10,21 @@ import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerMassStorage extends Container {
|
||||
public class ContainerMassStorage extends ContainerBase {
|
||||
|
||||
private TileEntityMassStorage storage;
|
||||
|
||||
public ContainerMassStorage(InventoryPlayer invPlayer, TileEntityMassStorage te) {
|
||||
super(invPlayer,te);
|
||||
|
||||
this.storage = te;
|
||||
this.storage.openInventory();
|
||||
|
||||
this.addSlotToContainer(new Slot(storage, 0, 61, 17));
|
||||
this.addSlotToContainer(new SlotPattern(storage, 1, 61, 53));
|
||||
this.addSlotToContainer(new SlotTakeOnly(storage, 2, 61, 89));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 139 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 197));
|
||||
}
|
||||
playerInv(invPlayer,8,139,197);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -351,7 +351,7 @@ public class TileEntityMachineAutocrafter extends TileEntityMachineBase implemen
|
||||
int slot = nbt.getInteger("slot");
|
||||
setInventorySlotContents(
|
||||
slot,
|
||||
new ItemStack(Item.getItemById(nbt.getInteger("id")), nbt.getInteger("meta")));
|
||||
new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta")));
|
||||
nextMode(slot);
|
||||
markChanged();
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.container.ContainerMassStorage;
|
||||
import com.hbm.inventory.gui.GUIMassStorage;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.IFilterable;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -11,12 +12,13 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityMassStorage extends TileEntityCrateBase implements INBTPacketReceiver, IControlReceiver {
|
||||
public class TileEntityMassStorage extends TileEntityCrateBase implements INBTPacketReceiver, IFilterable {
|
||||
|
||||
private int stack = 0;
|
||||
public boolean output = false;
|
||||
@ -156,6 +158,11 @@ public class TileEntityMassStorage extends TileEntityCrateBase implements INBTPa
|
||||
nbt.setByte("redstone", (byte) redstone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void nextMode(int i) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveControl(NBTTagCompound data) {
|
||||
if(data.hasKey("provide") && slots[1] != null) {
|
||||
@ -185,6 +192,19 @@ public class TileEntityMassStorage extends TileEntityCrateBase implements INBTPa
|
||||
if(data.hasKey("toggle")) {
|
||||
this.output = !output;
|
||||
}
|
||||
if(data.hasKey("slot")){
|
||||
setFilterContents(data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFilterContents(NBTTagCompound nbt) {
|
||||
int slot = nbt.getInteger("slot");
|
||||
setInventorySlotContents(
|
||||
slot,
|
||||
new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta")));
|
||||
nextMode(slot);
|
||||
markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -262,7 +262,7 @@ public class TileEntityCraneExtractor extends TileEntityCraneBase implements IGU
|
||||
int slot = nbt.getInteger("slot");
|
||||
setInventorySlotContents(
|
||||
slot,
|
||||
new ItemStack(Item.getItemById(nbt.getInteger("id")), nbt.getInteger("meta")));
|
||||
new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta")));
|
||||
nextMode(slot);
|
||||
markChanged();
|
||||
}
|
||||
|
||||
@ -206,7 +206,7 @@ public class TileEntityCraneGrabber extends TileEntityCraneBase implements IGUIP
|
||||
int slot = nbt.getInteger("slot");
|
||||
setInventorySlotContents(
|
||||
slot,
|
||||
new ItemStack(Item.getItemById(nbt.getInteger("id")), nbt.getInteger("meta")));
|
||||
new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta")));
|
||||
nextMode(slot);
|
||||
markChanged();
|
||||
}
|
||||
|
||||
@ -140,7 +140,7 @@ public class TileEntityCraneRouter extends TileEntityMachineBase implements IGUI
|
||||
int slot = nbt.getInteger("slot");
|
||||
setInventorySlotContents(
|
||||
slot,
|
||||
new ItemStack(Item.getItemById(nbt.getInteger("id")), nbt.getInteger("meta")));
|
||||
new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta")));
|
||||
nextMode(slot);
|
||||
markChanged();
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ public class TileEntityDroneRequester extends TileEntityRequestNetworkContainer
|
||||
int slot = nbt.getInteger("slot");
|
||||
setInventorySlotContents(
|
||||
slot,
|
||||
new ItemStack(Item.getItemById(nbt.getInteger("id")), nbt.getInteger("meta")));
|
||||
new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta")));
|
||||
nextMode(slot);
|
||||
markChanged();
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ public class TileEntityRadioTorchCounter extends TileEntityMachineBase implement
|
||||
int slot = nbt.getInteger("slot");
|
||||
setInventorySlotContents(
|
||||
slot,
|
||||
new ItemStack(Item.getItemById(nbt.getInteger("id")), nbt.getInteger("meta")));
|
||||
new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta")));
|
||||
nextMode(slot);
|
||||
markChanged();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user