mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-10-26 14:24:22 +00:00
Popped a null check in onEquipped() to ensure player isn't null, hopefully helps with Issue #1757
This commit is contained in:
1 parent
adc06dc6ce
commit
275729d54e
1 file changed
+8
-6
@@ -129,14 +129,16 @@ public abstract class ItemBauble extends ItemMod implements IBauble, ICosmeticAt
|
||||
|
||||
@Override
|
||||
public void onEquipped(ItemStack stack, EntityLivingBase player) {
|
||||
if(!player.worldObj.isRemote)
|
||||
player.worldObj.playSoundAtEntity(player, "botania:equipBauble", 0.1F, 1.3F);
|
||||
if(player != null) {
|
||||
if(!player.worldObj.isRemote)
|
||||
player.worldObj.playSoundAtEntity(player, "botania:equipBauble", 0.1F, 1.3F);
|
||||
|
||||
if(player instanceof EntityPlayer)
|
||||
((EntityPlayer) player).addStat(ModAchievements.baubleWear, 1);
|
||||
if(player instanceof EntityPlayer)
|
||||
((EntityPlayer) player).addStat(ModAchievements.baubleWear, 1);
|
||||
|
||||
onEquippedOrLoadedIntoWorld(stack, player);
|
||||
setLastPlayerHashcode(stack, player.hashCode());
|
||||
onEquippedOrLoadedIntoWorld(stack, player);
|
||||
setLastPlayerHashcode(stack, player.hashCode());
|
||||
}
|
||||
}
|
||||
|
||||
public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) {
|
||||
|
||||
Reference in new issue
Block a user