mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-29 08:27:03 +01:00
Merge pull request #2499 from git-async/mc1.18/dev
- Fixed Stockpile Switch prioritizing item inventories over fluid inventories
This commit is contained in:
commit
96c5480dee
1 changed files with 25 additions and 25 deletions
|
@ -78,6 +78,8 @@ public class StockpileSwitchTileEntity extends SmartTileEntity {
|
||||||
float totalSpace = 0;
|
float totalSpace = 0;
|
||||||
|
|
||||||
observedInventory.findNewCapability();
|
observedInventory.findNewCapability();
|
||||||
|
observedTank.findNewCapability();
|
||||||
|
if (observedInventory.hasInventory() || observedTank.hasInventory()) {
|
||||||
if (observedInventory.hasInventory()) {
|
if (observedInventory.hasInventory()) {
|
||||||
// Item inventory
|
// Item inventory
|
||||||
IItemHandler inv = observedInventory.getInventory();
|
IItemHandler inv = observedInventory.getInventory();
|
||||||
|
@ -92,9 +94,8 @@ public class StockpileSwitchTileEntity extends SmartTileEntity {
|
||||||
if (filtering.test(stackInSlot))
|
if (filtering.test(stackInSlot))
|
||||||
occupied += count * (1f / space);
|
occupied += count * (1f / space);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
observedTank.findNewCapability();
|
|
||||||
if (observedTank.hasInventory()) {
|
if (observedTank.hasInventory()) {
|
||||||
// Fluid inventory
|
// Fluid inventory
|
||||||
IFluidHandler tank = observedTank.getInventory();
|
IFluidHandler tank = observedTank.getInventory();
|
||||||
|
@ -109,7 +110,7 @@ public class StockpileSwitchTileEntity extends SmartTileEntity {
|
||||||
if (filtering.test(stackInSlot))
|
if (filtering.test(stackInSlot))
|
||||||
occupied += count * (1f / space);
|
occupied += count * (1f / space);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// No compatible inventories found
|
// No compatible inventories found
|
||||||
if (currentLevel == -1)
|
if (currentLevel == -1)
|
||||||
|
@ -121,7 +122,6 @@ public class StockpileSwitchTileEntity extends SmartTileEntity {
|
||||||
scheduleBlockTick();
|
scheduleBlockTick();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
float stockLevel = occupied / totalSpace;
|
float stockLevel = occupied / totalSpace;
|
||||||
if (currentLevel != stockLevel)
|
if (currentLevel != stockLevel)
|
||||||
|
|
Loading…
Reference in a new issue