Fixed External Storage being in item and fluid mode at the same time, fixes #601

This commit is contained in:
Raoul Van den Berge
2016-11-09 16:50:04 +01:00
parent 21613fe9f7
commit b5240a7d68
2 changed files with 23 additions and 16 deletions

View File

@@ -5,6 +5,7 @@
- Mod search can now also take mod name instead of just id (raoulvdberge)
- Fixed bug where Disk Manipulator doesn't save disks (raoulvdberge)
- Fixed Disk Drive stored quantity GUI text hovering over other text (raoulvdberge)
- Fixed External Storage being in item and fluid mode at the same time (raoulvdberge)
### 1.2.3
- Fixed fluid cache updating wrongly (raoulvdberge)

View File

@@ -246,25 +246,27 @@ public class TileExternalStorage extends TileMultipartNode implements IItemStora
TileEntity facing = getFacingTile();
if (facing instanceof IDrawerGroup) {
IDrawerGroup group = (IDrawerGroup) facing;
if (type == IType.ITEMS) {
if (facing instanceof IDrawerGroup) {
IDrawerGroup group = (IDrawerGroup) facing;
for (int i = 0; i < group.getDrawerCount(); ++i) {
if (group.isDrawerEnabled(i)) {
itemStorages.add(new ItemStorageDrawer(this, group.getDrawer(i)));
for (int i = 0; i < group.getDrawerCount(); ++i) {
if (group.isDrawerEnabled(i)) {
itemStorages.add(new ItemStorageDrawer(this, group.getDrawer(i)));
}
}
} else if (facing instanceof IDrawer) {
itemStorages.add(new ItemStorageDrawer(this, (IDrawer) facing));
} else if (facing instanceof IDeepStorageUnit) {
itemStorages.add(new ItemStorageDSU(this, (IDeepStorageUnit) facing));
} else {
IItemHandler itemHandler = RSUtils.getItemHandler(facing, getDirection().getOpposite());
if (itemHandler != null) {
itemStorages.add(new ItemStorageItemHandler(this, itemHandler));
}
}
} else if (facing instanceof IDrawer) {
itemStorages.add(new ItemStorageDrawer(this, (IDrawer) facing));
} else if (facing instanceof IDeepStorageUnit) {
itemStorages.add(new ItemStorageDSU(this, (IDeepStorageUnit) facing));
} else {
IItemHandler itemHandler = RSUtils.getItemHandler(facing, getDirection().getOpposite());
if (itemHandler != null) {
itemStorages.add(new ItemStorageItemHandler(this, itemHandler));
}
} else if (type == IType.FLUIDS) {
IFluidHandler fluidHandler = RSUtils.getFluidHandler(facing, getDirection().getOpposite());
if (fluidHandler != null) {
@@ -370,6 +372,10 @@ public class TileExternalStorage extends TileMultipartNode implements IItemStora
this.type = type;
markDirty();
if (network != null) {
updateStorage(network);
}
}
@Override