Finish off the rendering for the upgrades.
This commit is contained in:
parent
e05c132c3a
commit
5487584f04
6 changed files with 23 additions and 4 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, -22, i * 22 + 5)
|
||||
this.parent.slots.add(new FilteredSlot(upgradeable.getUpgradeInvetory(), i, -19, i * 18 + 12, 1)
|
||||
.setFilter(stack -> stack.getItem() instanceof IUpgrade));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,11 +33,17 @@ import java.util.function.Predicate;
|
|||
public class FilteredSlot extends Slot {
|
||||
|
||||
private Predicate<ItemStack> filter;
|
||||
private int stackLimit = 64;
|
||||
|
||||
public FilteredSlot(final IInventory inventory, final int index, final int xPosition, final int yPosition) {
|
||||
super(inventory, index, xPosition, yPosition);
|
||||
}
|
||||
|
||||
public FilteredSlot(final IInventory inventory, final int index, final int xPosition, final int yPosition, int stackLimit) {
|
||||
super(inventory, index, xPosition, yPosition);
|
||||
this.stackLimit = stackLimit;
|
||||
}
|
||||
|
||||
public FilteredSlot setFilter(final Predicate<ItemStack> filter) {
|
||||
this.filter = filter;
|
||||
return this;
|
||||
|
@ -51,4 +57,9 @@ public class FilteredSlot extends Slot {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlotStackLimit() {
|
||||
return stackLimit;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue