// Path: src/main/java/brightspark/sparkshammers/SHConfig.java
// @Config(modid = Reference.MOD_ID, name = Reference.MOD_ID + "/config")
// @Config.LangKey(Reference.MOD_ID + ".title")
// public class SHConfig
// {
//     @Config.Comment("Set this to true to enable right clicking with tools to place torches from the player's inventory")
//     public static boolean rightClickPlacesTorches = false;
// 
//     @Config.Comment("The depth which the Nether Star Hammer will destroy")
//     @Config.RangeInt(min = 1)
//     public static int netherStarHammerDistance = 16;
// 
//     @Config.Comment("Powered Hammer configs")
//     public static final Powered POWERED = new Powered();
// 
//     @Config.Comment("Mjolnir configs")
//     public static final Mjolnir MJOLNIR = new Mjolnir();
// 
//     public static class Powered
//     {
//         @Config.Comment("The energy capacity of powered tools")
//         @Config.RequiresMcRestart
//         public int poweredEnergyCapacity = 100000;
// 
//         @Config.Comment("How much energy powered tools will use per block destroyed (Hitting entities will use x2 this amount)")
//         @Config.RequiresMcRestart
//         public int poweredEnergyUsePerBlock = 100;
// 
//         @Config.Comment("The rate at which you can fill the energy of powered tools, in energy per tick")
//         @Config.RequiresMcRestart
//         public int poweredEnergyInputRate = 10000;
//     }
// 
//     public static class Mjolnir
//     {
//         @Config.Comment("Whether shrine structures should be generated in the world to find Mjolnir in")
//         @Config.RequiresMcRestart
//         public boolean shouldGenerateMjolnirShrines = true;
// 
//         @Config.Comment("Chance of a shrine spawning (Higher is less chance)")
//         public int mjolnirShrineRarity = 50;
// 
//         @Config.Comment("Minimum Y coordinate value for the shrine to spawn at")
//         public int mjolnirShrineMinY = 125;
// 
//         @Config.Comment("When true, a log will be printed in the console every time a shrine is generated with it's coordinates")
//         public boolean mjolnirShrineDebug = false;
// 
//         @Config.Comment("Whether Mjolnir needs the player to have the \"end/kill_dragon\" advancement to be 'worthy'")
//         public boolean mjolnirPickupNeedsDragonAchieve = true;
//     }
// }
// 
// Path: src/main/java/brightspark/sparkshammers/init/SHBlocks.java
// public class SHBlocks
// {
//     public static List<Block> BLOCKS;
//     public static List<ItemBlock> ITEM_BLOCKS;
// 
//     public static BlockHammer blockHammer = new BlockHammer();
//     public static BlockHammerCraft blockHammerCraft = new BlockHammerCraft();
// 
//     public static void addBlock(Block block)
//     {
//         BLOCKS.add(block);
//         ITEM_BLOCKS.add((ItemBlock) new ItemBlock(block).setRegistryName(block.getRegistryName()));
//     }
// 
//     private static void init()
//     {
//         BLOCKS = new ArrayList<>();
//         ITEM_BLOCKS = new ArrayList<>();
// 
//         addBlock(blockHammer);
//         addBlock(blockHammerCraft);
//     }
// 
//     public static Block[] getBlocks()
//     {
//         if(BLOCKS == null) init();
//         return BLOCKS.toArray(new Block[0]);
//     }
// 
//     public static ItemBlock[] getItemBlocks()
//     {
//         if(ITEM_BLOCKS == null) init();
//         return ITEM_BLOCKS.toArray(new ItemBlock[0]);
//     }
// }
// 
// Path: src/main/java/brightspark/sparkshammers/util/LogHelper.java
// public class LogHelper
// {
//     public static void log(Level logLevel, Object object)
//     {
//         FMLLog.log(Reference.MOD_NAME, logLevel, Reference.MOD_NAME + ": " + String.valueOf(object));
//     }
// 
//     public static void all(Object object)
//     {
//         log(Level.ALL, object);
//     }
// 
//     public static void debug(Object object)
//     {
//         log(Level.DEBUG, object);
//     }
// 
//     public static void error(Object object)
//     {
//         log(Level.ERROR, object);
//     }
// 
//     public static void fatal(Object object)
//     {
//         log(Level.FATAL, object);
//     }
// 
//     public static void info(Object object)
//     {
//         log(Level.INFO, object);
//     }
// 
//     public static void off(Object object)
//     {
//         log(Level.OFF, object);
//     }
// 
//     public static void trace(Object object)
//     {
//         log(Level.TRACE, object);
//     }
// 
//     public static void warn(Object object)
//     {
//         log(Level.WARN, object);
//     }
// }


import brightspark.sparkshammers.SHConfig;
import brightspark.sparkshammers.init.SHBlocks;
import brightspark.sparkshammers.util.LogHelper;
import net.minecraft.block.*;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.IChunkGenerator;
import net.minecraftforge.fml.common.IWorldGenerator;
import java.util.Random;
package brightspark.sparkshammers.worldgen;



public class WorldGenMjolnirShrine implements IWorldGenerator
{
    @Override
    public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)
    {
        //ID for the overworld == 0
        if(world.provider.getDimension() == 0)
        {
            //Get the surface position with a random coord in the given chunk
            BlockPos pos = world.getTopSolidOrLiquidBlock(new BlockPos(chunkX * 16 + random.nextInt(5), 1, chunkZ * 16 + random.nextInt(5)));
            int posY = isValidSpawn(world, pos);

            if(posY > 0 && random.nextInt(SHConfig.MJOLNIR.mjolnirShrineRarity) == 0)
            {
                //Clear the trees around the area if there are any
                clearTrees(world, pos.add(5, 0, 5), 10);

                //Generate the shrine
                generateShrine(world, pos);

                if(SHConfig.MJOLNIR.mjolnirShrineDebug)
// Path: src/main/java/brightspark/sparkshammers/SHConfig.java
// @Config(modid = Reference.MOD_ID, name = Reference.MOD_ID + "/config")
// @Config.LangKey(Reference.MOD_ID + ".title")
// public class SHConfig
// {
//     @Config.Comment("Set this to true to enable right clicking with tools to place torches from the player's inventory")
//     public static boolean rightClickPlacesTorches = false;
// 
//     @Config.Comment("The depth which the Nether Star Hammer will destroy")
//     @Config.RangeInt(min = 1)
//     public static int netherStarHammerDistance = 16;
// 
//     @Config.Comment("Powered Hammer configs")
//     public static final Powered POWERED = new Powered();
// 
//     @Config.Comment("Mjolnir configs")
//     public static final Mjolnir MJOLNIR = new Mjolnir();
// 
//     public static class Powered
//     {
//         @Config.Comment("The energy capacity of powered tools")
//         @Config.RequiresMcRestart
//         public int poweredEnergyCapacity = 100000;
// 
//         @Config.Comment("How much energy powered tools will use per block destroyed (Hitting entities will use x2 this amount)")
//         @Config.RequiresMcRestart
//         public int poweredEnergyUsePerBlock = 100;
// 
//         @Config.Comment("The rate at which you can fill the energy of powered tools, in energy per tick")
//         @Config.RequiresMcRestart
//         public int poweredEnergyInputRate = 10000;
//     }
// 
//     public static class Mjolnir
//     {
//         @Config.Comment("Whether shrine structures should be generated in the world to find Mjolnir in")
//         @Config.RequiresMcRestart
//         public boolean shouldGenerateMjolnirShrines = true;
// 
//         @Config.Comment("Chance of a shrine spawning (Higher is less chance)")
//         public int mjolnirShrineRarity = 50;
// 
//         @Config.Comment("Minimum Y coordinate value for the shrine to spawn at")
//         public int mjolnirShrineMinY = 125;
// 
//         @Config.Comment("When true, a log will be printed in the console every time a shrine is generated with it's coordinates")
//         public boolean mjolnirShrineDebug = false;
// 
//         @Config.Comment("Whether Mjolnir needs the player to have the \"end/kill_dragon\" advancement to be 'worthy'")
//         public boolean mjolnirPickupNeedsDragonAchieve = true;
//     }
// }
// 
// Path: src/main/java/brightspark/sparkshammers/init/SHBlocks.java
// public class SHBlocks
// {
//     public static List<Block> BLOCKS;
//     public static List<ItemBlock> ITEM_BLOCKS;
// 
//     public static BlockHammer blockHammer = new BlockHammer();
//     public static BlockHammerCraft blockHammerCraft = new BlockHammerCraft();
// 
//     public static void addBlock(Block block)
//     {
//         BLOCKS.add(block);
//         ITEM_BLOCKS.add((ItemBlock) new ItemBlock(block).setRegistryName(block.getRegistryName()));
//     }
// 
//     private static void init()
//     {
//         BLOCKS = new ArrayList<>();
//         ITEM_BLOCKS = new ArrayList<>();
// 
//         addBlock(blockHammer);
//         addBlock(blockHammerCraft);
//     }
// 
//     public static Block[] getBlocks()
//     {
//         if(BLOCKS == null) init();
//         return BLOCKS.toArray(new Block[0]);
//     }
// 
//     public static ItemBlock[] getItemBlocks()
//     {
//         if(ITEM_BLOCKS == null) init();
//         return ITEM_BLOCKS.toArray(new ItemBlock[0]);
//     }
// }
// 
// Path: src/main/java/brightspark/sparkshammers/util/LogHelper.java
// public class LogHelper
// {
//     public static void log(Level logLevel, Object object)
//     {
//         FMLLog.log(Reference.MOD_NAME, logLevel, Reference.MOD_NAME + ": " + String.valueOf(object));
//     }
// 
//     public static void all(Object object)
//     {
//         log(Level.ALL, object);
//     }
// 
//     public static void debug(Object object)
//     {
//         log(Level.DEBUG, object);
//     }
// 
//     public static void error(Object object)
//     {
//         log(Level.ERROR, object);
//     }
// 
//     public static void fatal(Object object)
//     {
//         log(Level.FATAL, object);
//     }
// 
//     public static void info(Object object)
//     {
//         log(Level.INFO, object);
//     }
// 
//     public static void off(Object object)
//     {
//         log(Level.OFF, object);
//     }
// 
//     public static void trace(Object object)
//     {
//         log(Level.TRACE, object);
//     }
// 
//     public static void warn(Object object)
//     {
//         log(Level.WARN, object);
//     }
// }


// Path: src/main/java/brightspark/sparkshammers/worldgen/WorldGenMjolnirShrine.java
import brightspark.sparkshammers.SHConfig;
import brightspark.sparkshammers.init.SHBlocks;
import brightspark.sparkshammers.util.LogHelper;
import net.minecraft.block.*;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.IChunkGenerator;
import net.minecraftforge.fml.common.IWorldGenerator;
import java.util.Random;

package brightspark.sparkshammers.worldgen;



public class WorldGenMjolnirShrine implements IWorldGenerator
{
    @Override
    public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)
    {
        //ID for the overworld == 0
        if(world.provider.getDimension() == 0)
        {
            //Get the surface position with a random coord in the given chunk
            BlockPos pos = world.getTopSolidOrLiquidBlock(new BlockPos(chunkX * 16 + random.nextInt(5), 1, chunkZ * 16 + random.nextInt(5)));
            int posY = isValidSpawn(world, pos);

            if(posY > 0 && random.nextInt(SHConfig.MJOLNIR.mjolnirShrineRarity) == 0)
            {
                //Clear the trees around the area if there are any
                clearTrees(world, pos.add(5, 0, 5), 10);

                //Generate the shrine
                generateShrine(world, pos);

                if(SHConfig.MJOLNIR.mjolnirShrineDebug)
                    LogHelper.info("Mjolnir Shrine generated at: " + pos.add(5, 0, 5).toString());