@@ -44,13 +44,15 @@ public void displayCustomGUI(IInventory inventory, ItemStack stack) {
44
44
this .getNextWindowId ();
45
45
MpGuiEntry entry = Catalyst .GUIS .getItem (inventory .getInvName ());
46
46
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 );
51
55
}
52
- this .craftingInventory .windowId = this .currentWindowId ;
53
- this .craftingInventory .onContainerInit (thisAs );
54
56
55
57
}
56
58
@@ -59,12 +61,14 @@ public void displayCustomGUI(TileEntity tileEntity, String id) {
59
61
this .getNextWindowId ();
60
62
MpGuiEntry entry = Catalyst .GUIS .getItem (id );
61
63
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 );
66
72
}
67
- this .craftingInventory .windowId = this .currentWindowId ;
68
- this .craftingInventory .onContainerInit (thisAs );
69
73
}
70
74
}
0 commit comments