This commit is contained in:
modmuss50 2016-11-05 10:39:13 +00:00
parent 73095ca198
commit 9af69638e2
No known key found for this signature in database
GPG key ID: 203A5ED4D3E48BEA
3 changed files with 27 additions and 70 deletions

View file

@ -132,11 +132,11 @@ public class GuiHandler implements IGuiHandler {
} else if (ID == vacuumFreezerID) {
return new ContainerVacuumFreezer((TileVacuumFreezer) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == grinderID) {
container = new ContainerGrinder();
container = new ContainerGrinder(player, (TileGrinder) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == generatorID) {
return new ContainerGenerator((TileGenerator) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == extractorID) {
container = new ContainerExtractor();
container = new ContainerExtractor(player, (TileExtractor) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == compressorID) {
return new ContainerCompressor((TileCompressor) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == electricFurnaceID) {

View file

@ -6,26 +6,22 @@ import reborncore.api.tile.IContainerLayout;
import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotInput;
import reborncore.client.gui.SlotOutput;
import reborncore.common.recipes.RecipeCrafter;
import techreborn.api.gui.SlotUpgrade;
import techreborn.tiles.teir1.TileExtractor;
import javax.annotation.Nullable;
import java.util.List;
public class ContainerExtractor extends ContainerCrafting implements IContainerLayout<TileExtractor> {
public class ContainerExtractor extends ContainerCrafting {
public int connectionStatus;
EntityPlayer player;
TileExtractor tileExtractor;
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return true;
}
@Override
public void addInventorySlots() {
public ContainerExtractor(EntityPlayer player, TileExtractor tileExtractor) {
super(tileExtractor.crafter);
this.player = player;
this.tileExtractor = tileExtractor;
// input
this.addSlotToContainer(new SlotInput(tileExtractor.inventory, 0, 56, 34));
this.addSlotToContainer(new SlotOutput(tileExtractor.inventory, 1, 116, 34));
@ -35,9 +31,15 @@ public class ContainerExtractor extends ContainerCrafting implements IContainerL
this.addSlotToContainer(new SlotUpgrade(tileExtractor.inventory, 3, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileExtractor.inventory, 4, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileExtractor.inventory, 5, 152, 62));
addPlayerSlots();
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return true;
}
public void addPlayerSlots() {
int i;
@ -52,31 +54,4 @@ public class ContainerExtractor extends ContainerCrafting implements IContainerL
}
}
@Override
public void setTile(TileExtractor tile) {
this.tileExtractor = tile;
setCrafter(tile.crafter);
}
@Override
public TileExtractor getTile() {
return tileExtractor;
}
@Override
public void setPlayer(EntityPlayer player) {
this.player = player;
}
@Override
public EntityPlayer getPlayer() {
return player;
}
@Nullable
@Override
public List<Integer> getSlotsForSide(EnumFacing facing) {
return null;
}
}

View file

@ -6,24 +6,32 @@ import reborncore.api.tile.IContainerLayout;
import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotInput;
import reborncore.client.gui.SlotOutput;
import reborncore.common.recipes.RecipeCrafter;
import techreborn.api.gui.SlotUpgrade;
import techreborn.tiles.teir1.TileGrinder;
import javax.annotation.Nullable;
import java.util.List;
public class ContainerGrinder extends ContainerCrafting implements IContainerLayout<TileGrinder> {
public class ContainerGrinder extends ContainerCrafting {
public int connectionStatus;
EntityPlayer player;
TileGrinder tile;
public ContainerGrinder(EntityPlayer player, TileGrinder tile) {
super(tile.crafter);
this.player = player;
this.tile = tile;
addInventorySlots();
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return true;
}
@Override
public void addInventorySlots() {
// input
this.addSlotToContainer(new SlotInput(tile.inventory, 0, 56, 34));
@ -34,9 +42,11 @@ public class ContainerGrinder extends ContainerCrafting implements IContainerLay
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 3, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 4, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 5, 152, 62));
addPlayerSlots();
}
@Override
public void addPlayerSlots() {
int i;
@ -51,32 +61,4 @@ public class ContainerGrinder extends ContainerCrafting implements IContainerLay
}
}
@Override
public void setTile(TileGrinder tile) {
this.tile = tile;
setCrafter(tile.crafter);
}
@Nullable
@Override
public TileGrinder getTile() {
return tile;
}
@Override
public void setPlayer(EntityPlayer player) {
this.player = player;
}
@Nullable
@Override
public EntityPlayer getPlayer() {
return player;
}
@Nullable
@Override
public List<Integer> getSlotsForSide(EnumFacing facing) {
return null;
}
}