Fixed a lot of NPE's and few duplication glitches

(cherry-pick from other fork)
This commit is contained in:
Arseny Spiridonov committed 2020-09-22 23:52:53 +07:00
1 parent cae72b2db6
commit 6bd68f13b1
12 files changed
+292 -162

No files matched your search

@@ -1,6 +1,7 @@
package tconstruct.armor.player;
import java.lang.ref.WeakReference;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@@ -73,15 +74,17 @@ public class TPlayerStats implements IExtendedEntityProperties, IPlayerExtendedI
public void loadNBTData (NBTTagCompound compound)
{
NBTTagCompound properties = (NBTTagCompound) compound.getTag(PROP_NAME);
this.armor.readFromNBT(properties);
this.knapsack.readFromNBT(properties);
this.beginnerManual = properties.getBoolean("beginnerManual");
this.materialManual = properties.getBoolean("materialManual");
this.smelteryManual = properties.getBoolean("smelteryManual");
this.weaponryManual = properties.getBoolean("weaponryManual");
this.battlesignBonus = properties.getBoolean("battlesignBonus");
this.derpLevel = properties.getInteger("derpLevel");
if (properties != null)
{
this.armor.readFromNBT(properties);
this.knapsack.readFromNBT(properties);
this.beginnerManual = properties.getBoolean("beginnerManual");
this.materialManual = properties.getBoolean("materialManual");
this.smelteryManual = properties.getBoolean("smelteryManual");
this.weaponryManual = properties.getBoolean("weaponryManual");
this.battlesignBonus = properties.getBoolean("battlesignBonus");
this.derpLevel = properties.getInteger("derpLevel");
}
}
@Override