Some more work on the upgrades.
This commit is contained in:
parent
4f05367f52
commit
539c5d0091
2 changed files with 10 additions and 1 deletions
|
@ -119,7 +119,7 @@ public class ContainerTileInventoryBuilder {
|
|||
private ContainerTileInventoryBuilder upgradeSlots(IUpgradeable upgradeable){
|
||||
if(upgradeable.canBeUpgraded()){
|
||||
for (int i = 0; i < upgradeable.getUpgradeSlotCount(); i++) {
|
||||
this.parent.slots.add(new FilteredSlot(upgradeable.getUpgradeInvetory(), i, 0, i * 22)
|
||||
this.parent.slots.add(new FilteredSlot(upgradeable.getUpgradeInvetory(), i, -22, i * 22 + 5)
|
||||
.setFilter(stack -> stack.getItem() instanceof IUpgrade));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.api.tile.IUpgradeable;
|
||||
import techreborn.client.container.builder.BuiltContainer;
|
||||
import techreborn.client.gui.widget.GuiButtonPowerBar;
|
||||
|
||||
|
@ -96,6 +97,14 @@ public class GuiBase extends GuiContainer {
|
|||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
builder.drawDefaultBackground(this, guiLeft, guiTop, xSize, ySize);
|
||||
builder.drawPlayerSlots(this, guiLeft + xSize / 2, guiTop + 93, true);
|
||||
if(tile instanceof IUpgradeable){
|
||||
IUpgradeable upgradeable = (IUpgradeable) tile;
|
||||
if(upgradeable.canBeUpgraded()){
|
||||
for (int i = 0; i < upgradeable.getUpgradeSlotCount(); i++) {
|
||||
drawSlot(-22, i * 22 + 5, Layer.BACKGROUND);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
|
Loading…
Add table
Reference in a new issue