<commit_before>package com.minespaceships.mod.events;

import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.event.world.BlockEvent.BreakEvent;
import net.minecraftforge.event.world.BlockEvent.MultiPlaceEvent;
import net.minecraftforge.event.world.BlockEvent.PlaceEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

import com.minespaceships.mod.spaceship.Shipyard;

// http://www.minecraftforge.net/wiki/Event_Reference#BlockEvent
public class BlockEvent {
	// http://www.minecraftforge.net/wiki/Event_Reference#BlockEvent

	// HarvestDropsEvent
	// http://www.minecraftforge.net/wiki/Event_Reference#HarvestDropsEvent
	//@SubscribeEvent
	//public void onHarvestDropsEvent(HarvestDropsEvent event) {
	//	
	//}
	// Minecraft.getMinecraft().player.sendMessage
	// BreakEvent
	// http://www.minecraftforge.net/wiki/Event_Reference#BreakEvent
	@SubscribeEvent
	public void onBreakEvent(final BreakEvent event) {
		if (event.isCanceled()) return;
		World world = event.world;
		BlockPos pos = event.pos;
		
		Shipyard.getShipyard().blockBroken(pos, world);
	}
	
	@SubscribeEvent
	public void onPlaceEvent(final PlaceEvent event) {
		if (event.isCanceled()) return;	
		World world = event.world;
		BlockPos pos = event.pos;
		
		Shipyard.getShipyard().blockPlaced(pos, world);
	}
	
	// see http://www.minecraftforge.net/forum/index.php?topic=24376.0
	@SubscribeEvent
	public void onMultiPlaceEvent(final MultiPlaceEvent event) {
		if (event.isCanceled()) return;
		World world = event.world;
		BlockPos pos = event.pos;

		Shipyard.getShipyard().blockPlaced(pos, world);
	}
}
<commit_msg>onExplosionEvent handling, comments for BlockEvent<commit_after>package com.minespaceships.mod.events;

import java.util.List;

import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.event.world.ExplosionEvent;
import net.minecraftforge.event.world.BlockEvent.BreakEvent;
import net.minecraftforge.event.world.BlockEvent.MultiPlaceEvent;
import net.minecraftforge.event.world.BlockEvent.PlaceEvent;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.eventhandler.Event.HasResult;

import com.minespaceships.mod.spaceship.Shipyard;

// http://www.minecraftforge.net/wiki/Event_Reference#BlockEvent
public class BlockEvent {
	// http://www.minecraftforge.net/wiki/Event_Reference#BlockEvent

	// HarvestDropsEvent
	// http://www.minecraftforge.net/wiki/Event_Reference#HarvestDropsEvent
	//@SubscribeEvent
	//public void onHarvestDropsEvent(HarvestDropsEvent event) {
	//	
	//}
	// Minecraft.getMinecraft().player.sendMessage
	// BreakEvent
	// http://www.minecraftforge.net/wiki/Event_Reference#BreakEvent
	
	/*
	 * Calls blockBroken for placed block,
	 * to remove the block from ships block list if member of a ship
	 */
	@SubscribeEvent
	public void onBreakEvent(final BreakEvent event) {
		if (event.isCanceled()) return;
		World world = event.world;
		BlockPos pos = event.pos;
		
		Shipyard.getShipyard().blockBroken(pos, world);
	}
	
	/*
	 * Calls blockPlaced to add block to ships block list if placed
	 * block is next to a ship
	 */
	@SubscribeEvent
	public void onPlaceEvent(final PlaceEvent event) {
		if (event.isCanceled()) return;	
		World world = event.world;
		BlockPos pos = event.pos;
		
		Shipyard.getShipyard().blockPlaced(pos, world);
	}
	
	 /*
	  * Calls blockPlaced to add block to ships block list if placed
	  * block is next to a ship
	  * see http://www.minecraftforge.net/forum/index.php?topic=24376.0
	  */
	@SubscribeEvent
	public void onMultiPlaceEvent(final MultiPlaceEvent event) {
		if (event.isCanceled()) return;
		World world = event.world;
		BlockPos pos = event.pos;

		Shipyard.getShipyard().blockPlaced(pos, world);
	}
	
	/*
	 * Calls blockBroken for each block affected by explosion,
	 * to remove the blocks from ships block list if member of a ship
	 */
	@SubscribeEvent
	public void onExplosionEvent(final ExplosionEvent.Detonate event) {
		if (event.isCanceled()) return;
		World world = event.world;
		List<BlockPos> posList = event.getAffectedBlocks();
		for(BlockPos pos: posList) {
			Shipyard.getShipyard().blockBroken(pos, world);
		}
	}
}

{'fraction_non_alphanumeric': 0.11131811830461108, 'fraction_numerical': 0.0027945971122496508, 'mean_word_length': 4.607049608355092, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 10, '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': '2012370', 'n_tokens_mistral': 1474, 'n_tokens_neox': 1386, 'n_words': 273}