<commit_before>package techreborn.events;

import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.entity.player.EntityPlayer;
import techreborn.api.TechRebornItems;
import techreborn.init.ModItems;
import techreborn.items.tools.ItemCloakingDevice;

public class TRTickHandler extends TickEvent {
	public TRTickHandler(Type type, Side side, Phase phase) {
		super(type, side, phase);
		
	}
	
	@SubscribeEvent(priority=EventPriority.NORMAL, receiveCanceled=true)
	public void onPlayerTick(TickEvent.PlayerTickEvent e) {
		EntityPlayer player = e.player;
		
		if(player.getEquipmentInSlot(3)== null) {
			player.setInvisible(false);
		
		}			
		else if(player.getEquipmentInSlot(3).getItem() != ModItems.cloakingDevice) {
			player.setInvisible(false);
		}
			
		
			
	}

	
}
<commit_msg>Fix invisibility potions and cloaking device<commit_after>package techreborn.events;

import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import tconstruct.armor.ArmorTickHandler;
import techreborn.api.TechRebornItems;
import techreborn.init.ModItems;
import techreborn.items.tools.ItemCloakingDevice;

public class TRTickHandler extends TickEvent {
	public TRTickHandler(Type type, Side side, Phase phase) {
		super(type, side, phase);
		
	}
	public Item previouslyWearing;
	@SubscribeEvent(priority=EventPriority.NORMAL, receiveCanceled=true)
	public void onPlayerTick(TickEvent.PlayerTickEvent e) {
		EntityPlayer player = e.player;
		Item chestslot = player.getEquipmentInSlot(3) != null ? player.getEquipmentInSlot(3).getItem() : null;
		
		if(previouslyWearing != chestslot && previouslyWearing == ModItems.cloakingDevice && player.isInvisible())
			player.setInvisible(false);
		previouslyWearing = chestslot;
	}

	
}

{'fraction_non_alphanumeric': 0.10292134831460674, 'fraction_numerical': 0.0017977528089887641, 'mean_word_length': 5.745454545454545, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4258121', 'n_tokens_mistral': 782, 'n_tokens_neox': 734, 'n_words': 121}