// Path: src/java/cd4017be/kineng/Main.java
// @Mod(modid = Main.ID, useMetadata = true)
// public class Main {
// 
// 	public static final String ID = "kineng";
// 
// 	@Instance(ID)
// 	public static Main instance;
// 
// 	public static Logger LOG;
// 
// 	@SidedProxy(clientSide = "cd4017be." + ID + ".ClientProxy", serverSide = "cd4017be." + ID + ".CommonProxy")
// 	public static CommonProxy proxy;
// 
// 	public Main() {
// 		RecipeScriptContext.scriptRegistry.add(new Version("kinetic", "/assets/" + ID + "/config/recipes.rcp"));
// 	}
// 
// 	@Mod.EventHandler
// 	public void preInit(FMLPreInitializationEvent event) {
// 		LOG = event.getModLog();
// 		proxy.preInit();
// 		StructureLocations.register();
// 		RecipeScriptContext.instance.run("kinetic.PRE_INIT");
// 	}
// 
// 	@Mod.EventHandler
// 	public void load(FMLInitializationEvent event) {
// 		Objects.init();
// 		proxy.init(new ConfigConstants(RecipeScriptContext.instance.modules.get("kinetic")));
// 	}
// 
// 	@Mod.EventHandler
// 	public void postInit(FMLPostInitializationEvent event) {
// 		Ticking.init();
// 	}
// 
// 	@Mod.EventHandler
// 	public void onShutdown(FMLServerStoppingEvent event) {
// 		Ticking.clear();
// 	}
// 
// }


import java.util.*;
import cd4017be.kineng.Main;
import net.minecraft.nbt.*;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.capabilities.*;
import net.minecraftforge.common.util.INBTSerializable;
import net.minecraftforge.event.AttachCapabilitiesEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

		}
	}

	public class Entry implements Iterator<Entry>, Iterable<Entry> {

		private final BlockPos pos;
		private final int k;
		private int i = 0, c, p0, s;

		private Entry(BlockPos pos, int id) {
			this.pos = pos;
			this.k = 0x4020100 | id << 27
				| (pos.getX() & 0xff)
				| (pos.getY() & 0xff) << 9
				| (pos.getZ() & 0xff) << 18;
		}

		@Override
		public boolean hasNext() {
			int[] str = structures;
			int i = this.i, n = count;
			for (int k = this.k;
				i < n && ((k - str[i+1] | 0x4020100) - str[i+2] & 0xfc020100) != 0;
			i+=3);
			return (this.i = i) < n;
		}

		@Override
		public Entry next() {
			int[] str = structures;

// Path: src/java/cd4017be/kineng/Main.java
// @Mod(modid = Main.ID, useMetadata = true)
// public class Main {
// 
// 	public static final String ID = "kineng";
// 
// 	@Instance(ID)
// 	public static Main instance;
// 
// 	public static Logger LOG;
// 
// 	@SidedProxy(clientSide = "cd4017be." + ID + ".ClientProxy", serverSide = "cd4017be." + ID + ".CommonProxy")
// 	public static CommonProxy proxy;
// 
// 	public Main() {
// 		RecipeScriptContext.scriptRegistry.add(new Version("kinetic", "/assets/" + ID + "/config/recipes.rcp"));
// 	}
// 
// 	@Mod.EventHandler
// 	public void preInit(FMLPreInitializationEvent event) {
// 		LOG = event.getModLog();
// 		proxy.preInit();
// 		StructureLocations.register();
// 		RecipeScriptContext.instance.run("kinetic.PRE_INIT");
// 	}
// 
// 	@Mod.EventHandler
// 	public void load(FMLInitializationEvent event) {
// 		Objects.init();
// 		proxy.init(new ConfigConstants(RecipeScriptContext.instance.modules.get("kinetic")));
// 	}
// 
// 	@Mod.EventHandler
// 	public void postInit(FMLPostInitializationEvent event) {
// 		Ticking.init();
// 	}
// 
// 	@Mod.EventHandler
// 	public void onShutdown(FMLServerStoppingEvent event) {
// 		Ticking.clear();
// 	}
// 
// }


// Path: src/java/cd4017be/kineng/capability/StructureLocations.java
import java.util.*;
import cd4017be.kineng.Main;
import net.minecraft.nbt.*;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.capabilities.*;
import net.minecraftforge.common.util.INBTSerializable;
import net.minecraftforge.event.AttachCapabilitiesEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

		}
	}

	public class Entry implements Iterator<Entry>, Iterable<Entry> {

		private final BlockPos pos;
		private final int k;
		private int i = 0, c, p0, s;

		private Entry(BlockPos pos, int id) {
			this.pos = pos;
			this.k = 0x4020100 | id << 27
				| (pos.getX() & 0xff)
				| (pos.getY() & 0xff) << 9
				| (pos.getZ() & 0xff) << 18;
		}

		@Override
		public boolean hasNext() {
			int[] str = structures;
			int i = this.i, n = count;
			for (int k = this.k;
				i < n && ((k - str[i+1] | 0x4020100) - str[i+2] & 0xfc020100) != 0;
			i+=3);
			return (this.i = i) < n;
		}

		@Override
		public Entry next() {
			int[] str = structures;

			int i = this.i;
