A bunch more null check \o/
This commit is contained in:
parent
97e5fcc032
commit
5dff31d937
19 changed files with 33 additions and 29 deletions
|
@ -4,6 +4,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.init.MobEffects;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
@ -18,7 +19,7 @@ public class TRTickHandler {
|
|||
@SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true)
|
||||
public void onPlayerTick(TickEvent.PlayerTickEvent e) {
|
||||
EntityPlayer player = e.player;
|
||||
Item chestslot = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST) != null
|
||||
Item chestslot = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST) != ItemStack.EMPTY
|
||||
? player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).getItem() : null;
|
||||
|
||||
if (previouslyWearing != chestslot && previouslyWearing == ModItems.cloakingDevice && player.isInvisible()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue