Fixed Output of extractor (#679)
* Add CraftTweaker support for the Compressor * Fix Extractor insertion and extraction * Oops
This commit is contained in:
parent
48cbda6453
commit
166f9a924f
5 changed files with 69 additions and 70 deletions
|
@ -168,7 +168,7 @@ public class GuiHandler implements IGuiHandler
|
|||
return new ContainerGenerator((TileGenerator) world.getTileEntity(new BlockPos(x, y, z)), player);
|
||||
} else if (ID == extractorID)
|
||||
{
|
||||
return new ContainerExtractor((TileExtractor) world.getTileEntity(new BlockPos(x, y, z)), player);
|
||||
container = new ContainerExtractor();
|
||||
} else if (ID == compressorID)
|
||||
{
|
||||
return new ContainerCompressor((TileCompressor) world.getTileEntity(new BlockPos(x, y, z)), player);
|
||||
|
|
|
@ -1,34 +1,48 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import reborncore.api.tile.IContainerLayout;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.client.gui.SlotInput;
|
||||
import reborncore.client.gui.SlotOutput;
|
||||
import techreborn.api.gui.SlotUpgrade;
|
||||
import techreborn.tiles.teir1.TileExtractor;
|
||||
|
||||
public class ContainerExtractor extends ContainerCrafting
|
||||
public class ContainerExtractor extends ContainerCrafting implements IContainerLayout<TileExtractor>
|
||||
{
|
||||
|
||||
public int connectionStatus;
|
||||
EntityPlayer player;
|
||||
TileExtractor tile;
|
||||
TileExtractor tileExtractor;
|
||||
|
||||
public ContainerExtractor(TileExtractor tileGrinder, EntityPlayer player)
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_)
|
||||
{
|
||||
super(tileGrinder.crafter);
|
||||
tile = tileGrinder;
|
||||
this.player = player;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInventorySlots() {
|
||||
|
||||
// input
|
||||
this.addSlotToContainer(new BaseSlot(tileGrinder.inventory, 0, 56, 34));
|
||||
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
|
||||
this.addSlotToContainer(new SlotInput(tileExtractor.inventory, 0, 56, 34));
|
||||
this.addSlotToContainer(new SlotOutput(tileExtractor.inventory, 1, 116, 34));
|
||||
|
||||
// upgrades
|
||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileExtractor.inventory, 2, 152, 8));
|
||||
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));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPlayerSlots() {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
|
@ -46,35 +60,30 @@ public class ContainerExtractor extends ContainerCrafting
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_)
|
||||
{
|
||||
return true;
|
||||
public void setTile(TileExtractor tile) {
|
||||
this.tileExtractor = tile;
|
||||
setCrafter(tile.crafter);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void addListener(IContainerListener crafting) {
|
||||
// super.addListener(crafting);
|
||||
// crafting.sendProgressBarUpdate(this, 0, (int) tile.getProgressScaled(0));
|
||||
// crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
||||
// }
|
||||
//
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// @Override
|
||||
// public void updateProgressBar(int id, int value) {
|
||||
// if (id == 0) {
|
||||
// this.progress = value;
|
||||
// }
|
||||
// else if (id == 2) {
|
||||
// this.energy = value;
|
||||
// }
|
||||
// this.tile.setEnergy(energy);
|
||||
// }
|
||||
@Override
|
||||
public TileExtractor getTile() {
|
||||
return tileExtractor;
|
||||
}
|
||||
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// @Override
|
||||
// public void updateProgressBar(int id, int value) {
|
||||
// if (id == 10) {
|
||||
// this.connectionStatus = value;
|
||||
// }
|
||||
// }
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.client.container.ContainerExtractor;
|
||||
import techreborn.tiles.teir1.TileExtractor;
|
||||
|
||||
|
@ -14,15 +15,15 @@ public class GuiExtractor extends GuiContainer
|
|||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png");
|
||||
|
||||
TileExtractor extractor;
|
||||
ContainerExtractor containerGrinder;
|
||||
ContainerExtractor containerExtractor;
|
||||
|
||||
public GuiExtractor(EntityPlayer player, TileExtractor tilegrinder)
|
||||
public GuiExtractor(EntityPlayer player, TileExtractor tileExtractor)
|
||||
{
|
||||
super(new ContainerExtractor(tilegrinder, player));
|
||||
super(RebornContainer.createContainer(ContainerExtractor.class, tileExtractor, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
extractor = tilegrinder;
|
||||
containerGrinder = (ContainerExtractor) this.inventorySlots;
|
||||
this.extractor = tileExtractor;
|
||||
containerExtractor = (ContainerExtractor) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,7 +22,7 @@ public class GuiGrinder extends GuiContainer
|
|||
super(RebornContainer.createContainer(ContainerGrinder.class, tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
grinder = tilegrinder;
|
||||
this.grinder = tilegrinder;
|
||||
containerGrinder = (ContainerGrinder) this.inventorySlots;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue