<commit_before>package mod.uhcreloaded.rules;

import mod.uhcreloaded.util.ConfigHandler;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

public class EnforceNoGhastTear {

	private boolean isGhastTear;

	@SubscribeEvent(priority = EventPriority.HIGH)
	public void onGhastDropsTears(EntityItemPickupEvent Evt) {
		if (!ConfigHandler.allowGhastTear) {
			if (Evt.item.getEntityItem().getItem().equals(Items.ghast_tear)) {
				Evt.setCanceled(true);
				isGhastTear = true;
				Evt.item.setDead();
			} else {
				isGhastTear = false;
			}

			if (isGhastTear) {
				for (int a = 0; a < 1; a++) {
					EntityItem entityItem = Evt.entityPlayer
							.dropPlayerItemWithRandomChoice(new ItemStack(
									Items.gold_ingot,
									Evt.item.getEntityItem().stackSize), false);
					entityItem.setNoPickupDelay();
					entityItem.setOwner(Evt.entityPlayer.getName());
				}
			}
		}
	}
}<commit_msg>Algorithm?<commit_after>package mod.uhcreloaded.rules;

import mod.uhcreloaded.util.ConfigHandler;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

public class EnforceNoGhastTear {

	private boolean isGhastTear;
	private int tearAmount;

	@SubscribeEvent(priority = EventPriority.HIGH)
	public void onGhastDropsTears(EntityItemPickupEvent Evt) {
		if (!ConfigHandler.allowGhastTear) {
			if (Evt.item.getEntityItem().getItem().equals(Items.ghast_tear)) {
				Evt.setCanceled(true);
				isGhastTear = true;
				tearAmount = Evt.item.getEntityItem().stackSize;
				Evt.item.setDead();
			} else {
				isGhastTear = false;
			}

			if (isGhastTear) {
				for (int a = 0; a < 1; a++) {
					if (tearAmount > 0){
						EntityItem entityItem = Evt.entityPlayer.dropPlayerItemWithRandomChoice(new ItemStack(Items.gold_ingot, tearAmount), false);
						entityItem.setNoPickupDelay();
						entityItem.setOwner(Evt.entityPlayer.getName());
					}
				}
			}
		}
	}
}
{'fraction_non_alphanumeric': 0.11338912133891213, 'fraction_numerical': 0.0020920502092050207, 'mean_word_length': 4.421768707482993, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '5626945', 'n_tokens_mistral': 956, 'n_tokens_neox': 809, 'n_words': 122}