<commit_before>package com.lothrazar.samsfragiletorches;

import net.minecraft.init.Blocks;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;

@Mod(modid = ModFragileTorches.MODID, version = ModFragileTorches.VERSION)
public class ModFragileTorches
{
    public static final String MODID = "samsfragiletorches";
    public static final String VERSION = "1.0";
    
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
		// some example code
        System.out.println("DIRT BLOCK >> "+Blocks.dirt.getUnlocalizedName());
    }
}
<commit_msg>fragile torches mod: extracted feature from mobchanges<commit_after>package com.lothrazar.samsfragiletorches;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

@Mod(modid = ModFragileTorches.MODID, version = ModFragileTorches.VERSION)
public class ModFragileTorches
{
    public static final String MODID = "samsfragiletorches";
    public static final String VERSION = "1.0";
	@Instance(value = ModFragileTorches.MODID)
	public static ModFragileTorches instance;
	
   	@EventHandler
   	public void onPreInit(FMLPreInitializationEvent event)
   	{ 
   		//cfg = new ConfigRegistry(new Configuration(event.getSuggestedConfigurationFile()));
    
   		FMLCommonHandler.instance().bus().register(instance); 
   		MinecraftForge.EVENT_BUS.register(instance); 
   	}
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
    }
    
	@SubscribeEvent
	public void onEntityUpdate(LivingUpdateEvent event) 
	{  
		if(event.entityLiving.worldObj.getBlockState(event.entityLiving.getPosition()).getBlock() == Blocks.torch) 
		{ 
			float oddsWillBreak = 0.01F;//TODO: in config or something? or make this 1/100
			boolean playerCancelled = false;
			if(event.entityLiving instanceof EntityPlayer)
			{
				EntityPlayer p = (EntityPlayer)event.entityLiving;
				if(p.isSneaking())
				{
					playerCancelled = true;//torches are safe from breaking
				}
			}
			
			if(playerCancelled == false //if its a player, then the player is not sneaking
					&& event.entityLiving.worldObj.rand.nextDouble() < oddsWillBreak
					&& event.entityLiving.worldObj.isRemote == false)
			{ 
				event.entityLiving.worldObj.destroyBlock(event.entityLiving.getPosition(), true);  
			}
		}
	}

}

{'fraction_non_alphanumeric': 0.09742216270505524, 'fraction_numerical': 0.0036826247070639436, 'mean_word_length': 4.637735849056604, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, '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': '6347094', 'n_tokens_mistral': 1009, 'n_tokens_neox': 941, 'n_words': 165}