@@ -70,14 +70,26 @@ public void loadFromNBT(CallbackInfo ci) {
7070 return false ;
7171 }
7272
73- @ Redirect (method = "loadFromNBT" , at = @ At (value = "INVOKE" , target = "Lappeng/tile/inventory/AppEngInternalInventory;readFromNBT(Lnet/minecraft/nbt/NBTTagCompound;)V" ), allow = 1 )
74- public void loadViewCell (AppEngInternalInventory instance , NBTTagCompound data ) {
75- instance .readFromNBT (data , "viewCell" );
73+ @ Redirect (method = "loadFromNBT" , at = @ At (value = "INVOKE" , target = "Lappeng/tile/inventory/AppEngInternalInventory;readFromNBT(Lnet/minecraft/nbt/NBTTagCompound;)V" ), require = 1 , allow = 1 )
74+ private void loadViewCell (AppEngInternalInventory instance , NBTTagCompound data ) {
75+ if (data == null ) return ;
76+
77+ if (data .hasKey ("viewCell" )) {
78+ instance .readFromNBT (data , "viewCell" );
79+ } else {
80+ instance .readFromNBT (data );
81+ }
7682 }
7783
78- @ Redirect (method = "loadFromNBT" , at = @ At (value = "INVOKE" , target = "Lappeng/parts/automation/UpgradeInventory;readFromNBT(Lnet/minecraft/nbt/NBTTagCompound;)V" ), allow = 1 )
79- public void loadUpgrade (UpgradeInventory instance , NBTTagCompound data ) {
80- instance .readFromNBT (data , "upgrades" );
84+ @ Redirect (method = "loadFromNBT" , at = @ At (value = "INVOKE" , target = "Lappeng/parts/automation/UpgradeInventory;readFromNBT(Lnet/minecraft/nbt/NBTTagCompound;)V" ), require = 1 , allow = 1 )
85+ private void loadUpgrade (UpgradeInventory instance , NBTTagCompound data ) {
86+ if (data == null ) return ;
87+
88+ if (data .hasKey ("upgrades" )) {
89+ instance .readFromNBT (data , "upgrades" );
90+ } else {
91+ instance .readFromNBT (data );
92+ }
8193 }
8294
8395 @ Inject (method = "loadFromNBT" , at = @ At ("TAIL" ))
0 commit comments