Some more work on the upgrades.

This commit is contained in:
modmuss50 2017-04-11 14:59:59 +01:00
parent 4f05367f52
commit 539c5d0091
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
2 changed files with 10 additions and 1 deletions

View file

@ -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));
}
}

View file

@ -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)