Skip to content

Commit d9d65e7

Browse files
committed
Allow entries with null containers.
1 parent 288c713 commit d9d65e7

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ loader_version=0.15.6-babric.6-bta
88
mod_menu_version=2.0.6
99

1010
# HalpLibe
11-
halplibe_version=4.0.6
11+
halplibe_version=4.0.8
1212

1313
# Mod
1414
core_mod_version=1.4.3

src/main/java/sunsetsatellite/catalyst/core/mixin/EntityPlayerMPMixin.java

+16-12
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,15 @@ public void displayCustomGUI(IInventory inventory, ItemStack stack) {
4444
this.getNextWindowId();
4545
MpGuiEntry entry = Catalyst.GUIS.getItem(inventory.getInvName());
4646
this.playerNetServerHandler.sendPacket(new PacketOpenGui(this.currentWindowId, inventory.getInvName(),stack));
47-
try {
48-
this.craftingInventory = (Container)entry.containerClass.getDeclaredConstructors()[0].newInstance(thisAs.inventory, inventory);
49-
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
50-
throw new RuntimeException(e);
47+
if(entry.containerClass != null) {
48+
try {
49+
this.craftingInventory = (Container) entry.containerClass.getDeclaredConstructors()[0].newInstance(thisAs.inventory, inventory);
50+
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
51+
throw new RuntimeException(e);
52+
}
53+
this.craftingInventory.windowId = this.currentWindowId;
54+
this.craftingInventory.onContainerInit(thisAs);
5155
}
52-
this.craftingInventory.windowId = this.currentWindowId;
53-
this.craftingInventory.onContainerInit(thisAs);
5456

5557
}
5658

@@ -59,12 +61,14 @@ public void displayCustomGUI(TileEntity tileEntity, String id) {
5961
this.getNextWindowId();
6062
MpGuiEntry entry = Catalyst.GUIS.getItem(id);
6163
this.playerNetServerHandler.sendPacket(new PacketOpenGui(this.currentWindowId, id, tileEntity.x, tileEntity.y, tileEntity.z));
62-
try {
63-
this.craftingInventory = (Container)entry.containerClass.getDeclaredConstructors()[0].newInstance(thisAs.inventory, tileEntity);
64-
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
65-
throw new RuntimeException(e);
64+
if(entry.containerClass != null){
65+
try {
66+
this.craftingInventory = (Container)entry.containerClass.getDeclaredConstructors()[0].newInstance(thisAs.inventory, tileEntity);
67+
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
68+
throw new RuntimeException(e);
69+
}
70+
this.craftingInventory.windowId = this.currentWindowId;
71+
this.craftingInventory.onContainerInit(thisAs);
6672
}
67-
this.craftingInventory.windowId = this.currentWindowId;
68-
this.craftingInventory.onContainerInit(thisAs);
6973
}
7074
}

0 commit comments

Comments
 (0)