Bringing Null-Checks back

This commit is contained in:
rjnasers authored and Martin Robertz committed 2023-11-10 14:00:22 +01:00
1 parent 3af22fd6ee
commit c36b774211
1 file changed
+10 -5
@@ -103,13 +103,18 @@ public class GuiStorageBus extends GuiUpgradeable {
this.ySize - 96 + 3,
GuiColors.StorageBusInventory.getColor());
if (this.cvb instanceof ContainerStorageBus csb) {
this.storageFilter.set(csb.getStorageFilter());
this.rwMode.set(csb.getReadWriteMode());
this.fuzzyMode.set(csb.getFuzzyMode());
if (this.cvb instanceof ContainerStorageBus) {
if (this.fuzzyMode != null) {
this.fuzzyMode.set(this.cvb.getFuzzyMode());
}
if (this.storageFilter != null) {
this.storageFilter.set(((ContainerStorageBus) this.cvb).getStorageFilter());
}
if (this.rwMode != null) {
this.rwMode.set(((ContainerStorageBus) this.cvb).getReadWriteMode());
}
}
}
@Override
protected String getBackground() {
return "guis/storagebus.png";