Added support the Downgrade upgrade in the compacting drawer, closes #56
This commit is contained in:
parent
8a75d3ac38
commit
fdd090b34b
|
@ -48,6 +48,11 @@ public class CompactingDrawerTile extends ControllableDrawerTile<CompactingDrawe
|
|||
return CompactingDrawerTile.this.isVoid();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasDowngrade() {
|
||||
return CompactingDrawerTile.this.hasDowngrade();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLocked() {
|
||||
return CompactingDrawerTile.this.isLocked();
|
||||
|
|
|
@ -137,12 +137,16 @@ public abstract class CompactingInventoryHandler implements IItemHandler, INBTSe
|
|||
@Override
|
||||
public int getSlotLimit(int slot) {
|
||||
if (slot == 3) return Integer.MAX_VALUE;
|
||||
return (int) Math.min(Integer.MAX_VALUE, Math.floor((TOTAL_AMOUNT * getMultiplier()) / this.resultList.get(slot).getNeeded()));
|
||||
int total = TOTAL_AMOUNT;
|
||||
if (hasDowngrade()) total = 64 * 9 * 9;
|
||||
return (int) Math.min(Integer.MAX_VALUE, Math.floor((total * getMultiplier()) / this.resultList.get(slot).getNeeded()));
|
||||
}
|
||||
|
||||
public int getSlotLimitBase(int slot){
|
||||
public int getSlotLimitBase(int slot) {
|
||||
if (slot == 3) return Integer.MAX_VALUE;
|
||||
return (int) Math.min(Integer.MAX_VALUE, Math.floor(TOTAL_AMOUNT / this.resultList.get(slot).getNeeded()));
|
||||
int total = TOTAL_AMOUNT;
|
||||
if (hasDowngrade()) total = 64 * 9 * 9;
|
||||
return (int) Math.min(Integer.MAX_VALUE, Math.floor(total / this.resultList.get(slot).getNeeded()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -198,4 +202,6 @@ public abstract class CompactingInventoryHandler implements IItemHandler, INBTSe
|
|||
public ItemStack getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
public abstract boolean hasDowngrade();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user