// Path: src/main/java/com/team/kalstuff/KalStuff.java
// @Mod(modid = KalStuff.MODID,
// 	 name = KalStuff.NAME,
// 	 version = KalStuff.VERSION,
// 	 acceptedMinecraftVersions = "[1.12.2]",
// 	 useMetadata = true,
// 	 guiFactory = "com.team.kalstuff.config.KalStuffGuiFactory")
// public class KalStuff
// {
// 	public static final String MODID = "kalstuff";
// 	public static final String NAME = "KalStuff";
// 	public static final String VERSION = "1.0.0";
// 
// 	@SidedProxy(clientSide = "com.team.kalstuff.proxy.ClientProxy",
// 			serverSide = "com.team.kalstuff.proxy.ServerProxy")
// 	public static CommonProxy proxy;
// 
// 	// The instance of the mod that Forge uses.
// 	@Mod.Instance
// 	public static KalStuff instance;
// 
// 	public static Logger logger;
// 
// 	public static Configuration config;
// 
// 	@EventHandler
// 	public void preInit(FMLPreInitializationEvent e)
// 	{
// 		logger = e.getModLog();
// 		Config.initialize(e, e.getSuggestedConfigurationFile());
// 		config = Config.getConfig();
// 		proxy.preInit(e);
// 	}
// 
// 	@EventHandler
// 	public void init(FMLInitializationEvent e)
// 	{
// 		proxy.init(e);
// 	}
// 
// 	@EventHandler
// 	public void postInit(FMLPostInitializationEvent e)
// 	{
// 		if (config.hasChanged())
// 		{
// 			config.save();
// 		}
// 		proxy.postInit(e);
// 	}
// }
// 
// Path: src/main/java/com/team/kalstuff/config/Config.java
// public class Config
// {
// 	public static File configurationFile;
// 	public static Configuration config;
// 
// 	public static final String CATEGORY_GENERAL = "General";
// 
// 	public static int cottageRarity = 512;
// 	public static boolean bridgeTNT = false;
// 
// 	public static final void initialize(FMLPreInitializationEvent e, File file)
// 	{
// 		config = new Configuration(file, KalStuff.VERSION, true);
// 		MinecraftForge.EVENT_BUS.register(new EventHandler());
// 		config.load();
// 		config.setCategoryRequiresWorldRestart(CATEGORY_GENERAL, false);
// 		config.setCategoryRequiresMcRestart(CATEGORY_GENERAL, false);
// 		config.setCategoryComment(CATEGORY_GENERAL, "General configuration");
// 		refresh();
// 		config.save();
// 	}
// 
// 	public static final Configuration getConfig()
// 	{
// 		return config;
// 	}
// 
// 	private static final void refresh()
// 	{
// 		cottageRarity = config.getInt("Cottage Rarity", CATEGORY_GENERAL, cottageRarity, 0, 16384,
// 				"Rarity for cottage generation");
// 		bridgeTNT = config.getBoolean("Allow Bridge TNT", CATEGORY_GENERAL, bridgeTNT,
// 				"Restricts bridge blocks from placing TNT");
// 	}
// 
// 	public static void add(List<IConfigElement> list)
// 	{
// 		list.add(new ConfigElement(config.getCategory(CATEGORY_GENERAL)));
// 	}
// 
// 	public static class EventHandler
// 	{
// 		@SubscribeEvent
// 		public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event)
// 		{
// 			if (event.getModID().equals(KalStuff.MODID))
// 			{
// 				refresh();
// 				if (config.hasChanged())
// 				{
// 					config.save();
// 				}
// 			}
// 		}
// 	}
// }


import java.util.Random;
import com.team.kalstuff.KalStuff;
import com.team.kalstuff.config.Config;
import net.minecraft.block.Block;
import net.minecraft.block.BlockDirectional;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
		}
		catch (Exception e)
		{
			return true;
		}
		if (block == null)
			return true;

		// if the block cannot be picked up by endermen, is not a bridge block, and in
		// the case of TNT is not allowed in the config, return with a chat message
		if ((!EntityEnderman.getCarriable(block) && block != KalStuffBlocks.BRIDGE)
				|| (!Config.bridgeTNT && block == Blocks.TNT))
		{
			player.sendMessage(new TextComponentTranslation("The bridge is unable to send this"));
			return true;
		}

		// get next position that the bridge block is pointing towards
		BlockPos aPos = this.getNextBlock(pos, state, world);
		int dist = (int) aPos.getDistance(pos.getX(), pos.getY(), pos.getZ());

		// check for unbreakable or very hard blocks - should only catch unbreakable
		// blocks (e.g. bedrock), obsidian, and water by default (we explicitly allow
		// lava)
		if (world.getBlockState(aPos).getBlockHardness(world, aPos) == -1.0F
				|| (world.getBlockState(aPos).getBlockHardness(world, aPos) >= 50.0F
						&& world.getBlockState(aPos).getBlock() != Blocks.LAVA
						&& world.getBlockState(aPos).getBlock() != Blocks.FLOWING_LAVA))
		{
			player.sendMessage(new TextComponentTranslation("Something is blocking the bridge"));
// Path: src/main/java/com/team/kalstuff/KalStuff.java
// @Mod(modid = KalStuff.MODID,
// 	 name = KalStuff.NAME,
// 	 version = KalStuff.VERSION,
// 	 acceptedMinecraftVersions = "[1.12.2]",
// 	 useMetadata = true,
// 	 guiFactory = "com.team.kalstuff.config.KalStuffGuiFactory")
// public class KalStuff
// {
// 	public static final String MODID = "kalstuff";
// 	public static final String NAME = "KalStuff";
// 	public static final String VERSION = "1.0.0";
// 
// 	@SidedProxy(clientSide = "com.team.kalstuff.proxy.ClientProxy",
// 			serverSide = "com.team.kalstuff.proxy.ServerProxy")
// 	public static CommonProxy proxy;
// 
// 	// The instance of the mod that Forge uses.
// 	@Mod.Instance
// 	public static KalStuff instance;
// 
// 	public static Logger logger;
// 
// 	public static Configuration config;
// 
// 	@EventHandler
// 	public void preInit(FMLPreInitializationEvent e)
// 	{
// 		logger = e.getModLog();
// 		Config.initialize(e, e.getSuggestedConfigurationFile());
// 		config = Config.getConfig();
// 		proxy.preInit(e);
// 	}
// 
// 	@EventHandler
// 	public void init(FMLInitializationEvent e)
// 	{
// 		proxy.init(e);
// 	}
// 
// 	@EventHandler
// 	public void postInit(FMLPostInitializationEvent e)
// 	{
// 		if (config.hasChanged())
// 		{
// 			config.save();
// 		}
// 		proxy.postInit(e);
// 	}
// }
// 
// Path: src/main/java/com/team/kalstuff/config/Config.java
// public class Config
// {
// 	public static File configurationFile;
// 	public static Configuration config;
// 
// 	public static final String CATEGORY_GENERAL = "General";
// 
// 	public static int cottageRarity = 512;
// 	public static boolean bridgeTNT = false;
// 
// 	public static final void initialize(FMLPreInitializationEvent e, File file)
// 	{
// 		config = new Configuration(file, KalStuff.VERSION, true);
// 		MinecraftForge.EVENT_BUS.register(new EventHandler());
// 		config.load();
// 		config.setCategoryRequiresWorldRestart(CATEGORY_GENERAL, false);
// 		config.setCategoryRequiresMcRestart(CATEGORY_GENERAL, false);
// 		config.setCategoryComment(CATEGORY_GENERAL, "General configuration");
// 		refresh();
// 		config.save();
// 	}
// 
// 	public static final Configuration getConfig()
// 	{
// 		return config;
// 	}
// 
// 	private static final void refresh()
// 	{
// 		cottageRarity = config.getInt("Cottage Rarity", CATEGORY_GENERAL, cottageRarity, 0, 16384,
// 				"Rarity for cottage generation");
// 		bridgeTNT = config.getBoolean("Allow Bridge TNT", CATEGORY_GENERAL, bridgeTNT,
// 				"Restricts bridge blocks from placing TNT");
// 	}
// 
// 	public static void add(List<IConfigElement> list)
// 	{
// 		list.add(new ConfigElement(config.getCategory(CATEGORY_GENERAL)));
// 	}
// 
// 	public static class EventHandler
// 	{
// 		@SubscribeEvent
// 		public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event)
// 		{
// 			if (event.getModID().equals(KalStuff.MODID))
// 			{
// 				refresh();
// 				if (config.hasChanged())
// 				{
// 					config.save();
// 				}
// 			}
// 		}
// 	}
// }


// Path: src/main/java/com/team/kalstuff/block/BlockBridge.java
import java.util.Random;
import com.team.kalstuff.KalStuff;
import com.team.kalstuff.config.Config;
import net.minecraft.block.Block;
import net.minecraft.block.BlockDirectional;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

		}
		catch (Exception e)
		{
			return true;
		}
		if (block == null)
			return true;

		// if the block cannot be picked up by endermen, is not a bridge block, and in
		// the case of TNT is not allowed in the config, return with a chat message
		if ((!EntityEnderman.getCarriable(block) && block != KalStuffBlocks.BRIDGE)
				|| (!Config.bridgeTNT && block == Blocks.TNT))
		{
			player.sendMessage(new TextComponentTranslation("The bridge is unable to send this"));
			return true;
		}

		// get next position that the bridge block is pointing towards
		BlockPos aPos = this.getNextBlock(pos, state, world);
		int dist = (int) aPos.getDistance(pos.getX(), pos.getY(), pos.getZ());

		// check for unbreakable or very hard blocks - should only catch unbreakable
		// blocks (e.g. bedrock), obsidian, and water by default (we explicitly allow
		// lava)
		if (world.getBlockState(aPos).getBlockHardness(world, aPos) == -1.0F
				|| (world.getBlockState(aPos).getBlockHardness(world, aPos) >= 50.0F
						&& world.getBlockState(aPos).getBlock() != Blocks.LAVA
						&& world.getBlockState(aPos).getBlock() != Blocks.FLOWING_LAVA))
		{
			player.sendMessage(new TextComponentTranslation("Something is blocking the bridge"));
			KalStuff.logger.info(world.getBlockState(aPos).getBlock());