// Path: src/main/java/xilef11/mc/runesofwizardry_classics/Refs.java
// public final class Refs {
// 	private Refs(){}
// 	public static final String MODID = "runesofwizardry_classics";
// 	public static final String VERSION = "@VERSION@";
// 	public static final String NAME="Runes of Wizardry - Classic Dusts Pack";
// 	public static final String GUI_FACTORY="xilef11.mc.runesofwizardry_classics.client.gui.GuiFactory";
// 	public static final String CLIENT_PROXY = "xilef11.mc.runesofwizardry_classics.proxy.ClientProxy",
// 							   SERVER_PROXY="xilef11.mc.runesofwizardry_classics.proxy.ServerProxy";
// 	public static final String PATTERN_PATH=MODID+":patterns/";
// 	public static final String TEXTURE_PATH=MODID+":";
// 	public static final int TICKS_PER_DAY=24000;
// 	public static final int TPS=20;
// 	public static final class Lang{
// 		private Lang(){}
// 		public static final String RUNE=MODID+".rune";
// 		public static final String CONFIG=MODID+".configuration";
// 		public static final String DEC=RUNE+".decorative";
// 		
// 		public static final class Jei{
// 			private Jei(){}
// 			public static final String JEI=MODID+".jei";
// 			public static final String SPIRIT_SWORD=JEI+".spirit_sword";
// 			public static final String SPIRIT_PICKAXE=JEI+".spirit_pickaxe";
// 		}
// 	}
// }
// 
// Path: src/main/java/xilef11/mc/runesofwizardry_classics/runes/entity/RuneEntityTrapCage.java
// public class RuneEntityTrapCage extends RuneEntity {
// 	private String user="";
// 	public RuneEntityTrapCage(ItemStack[][] actualPattern, EnumFacing facing,
// 			Set<BlockPos> dusts, TileEntityDustActive entity, IRune creator) {
// 		super(actualPattern, facing, dusts, entity, creator);
// 	}
// 	@Override
// 	public void onRuneActivatedbyPlayer(EntityPlayer player,
// 			ItemStack[] sacrifice, boolean negated) {
// 		//nothing here
// 		if(!player.world.isRemote)user=player.getName();
// 	}
// 	private static final int RADIUS=3;
// 	@Override
// 	public void update() {
// 		World world = entity.getWorld();
// 		if(!world.isRemote){
// 			if(entity.ticksExisted()==5*Refs.TPS)this.renderActive=false;
// 			List<EntityLivingBase> ents = world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(getPos().add(-RADIUS,-1,-RADIUS), getPos().add(RADIUS,1,RADIUS)));
// 			if(!ents.isEmpty()){
// 				boolean broken=false;
// 				for(EntityLivingBase e:ents){
// 					if(e instanceof EntityPlayer){
// 						if(((EntityPlayer)e).getName().equals(user))continue;
// 					}
// 					if(!broken){
// 						this.onPatternBroken();
// 						broken=true;
// 					}
// 					BlockPos pos = e.getPosition();
// 					for(int x=-1;x<=1;x++){
// 						for(int z=-1;z<=1;z++){
// 							for(int y=-1;y<=1;y++){
// 								BlockPos p = pos.add(x, y, z);
// 								Block b = world.getBlockState(p).getBlock();
// 								if((b.isReplaceable(world, p)||b==WizardryRegistry.dust_placed)&&!(x==0&&z==0)){
// 									world.setBlockState(p, Blocks.IRON_BARS.getDefaultState());
// 								}
// 							}
// 						}
// 					}
// 				}
// 			}
// 		}
// 	}
// 	/* (non-Javadoc)
// 	 * @see com.zpig333.runesofwizardry.api.RuneEntity#readFromNBT(net.minecraft.nbt.NBTTagCompound)
// 	 */
// 	@Override
// 	public void readFromNBT(NBTTagCompound compound) {
// 		super.readFromNBT(compound);
// 		user=compound.getString("username");
// 	}
// 	/* (non-Javadoc)
// 	 * @see com.zpig333.runesofwizardry.api.RuneEntity#writeToNBT(net.minecraft.nbt.NBTTagCompound)
// 	 */
// 	@Override
// 	public void writeToNBT(NBTTagCompound compound) {
// 		super.writeToNBT(compound);
// 		compound.setString("username", user);
// 	}
// }


import java.io.IOException;
import java.util.Set;
import com.zpig333.runesofwizardry.api.RuneEntity;
import com.zpig333.runesofwizardry.core.rune.PatternUtils;
import com.zpig333.runesofwizardry.tileentity.TileEntityDustActive;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3i;
import xilef11.mc.runesofwizardry_classics.Refs;
import xilef11.mc.runesofwizardry_classics.runes.entity.RuneEntityTrapCage;
package xilef11.mc.runesofwizardry_classics.runes;


public class RuneTrapCage extends ClassicRune {
	@Override
	protected ItemStack[][] setupPattern() throws IOException {
		return PatternUtils.importFromJson(Refs.PATTERN_PATH+"runeentrapment.json");
	}
	@Override
	public String getID() {
		return "runeEntrapment";
	}
	@Override
	protected Vec3i setupEntityPos() {
		return new Vec3i(1,1,0);
	}
// Path: src/main/java/xilef11/mc/runesofwizardry_classics/Refs.java
// public final class Refs {
// 	private Refs(){}
// 	public static final String MODID = "runesofwizardry_classics";
// 	public static final String VERSION = "@VERSION@";
// 	public static final String NAME="Runes of Wizardry - Classic Dusts Pack";
// 	public static final String GUI_FACTORY="xilef11.mc.runesofwizardry_classics.client.gui.GuiFactory";
// 	public static final String CLIENT_PROXY = "xilef11.mc.runesofwizardry_classics.proxy.ClientProxy",
// 							   SERVER_PROXY="xilef11.mc.runesofwizardry_classics.proxy.ServerProxy";
// 	public static final String PATTERN_PATH=MODID+":patterns/";
// 	public static final String TEXTURE_PATH=MODID+":";
// 	public static final int TICKS_PER_DAY=24000;
// 	public static final int TPS=20;
// 	public static final class Lang{
// 		private Lang(){}
// 		public static final String RUNE=MODID+".rune";
// 		public static final String CONFIG=MODID+".configuration";
// 		public static final String DEC=RUNE+".decorative";
// 		
// 		public static final class Jei{
// 			private Jei(){}
// 			public static final String JEI=MODID+".jei";
// 			public static final String SPIRIT_SWORD=JEI+".spirit_sword";
// 			public static final String SPIRIT_PICKAXE=JEI+".spirit_pickaxe";
// 		}
// 	}
// }
// 
// Path: src/main/java/xilef11/mc/runesofwizardry_classics/runes/entity/RuneEntityTrapCage.java
// public class RuneEntityTrapCage extends RuneEntity {
// 	private String user="";
// 	public RuneEntityTrapCage(ItemStack[][] actualPattern, EnumFacing facing,
// 			Set<BlockPos> dusts, TileEntityDustActive entity, IRune creator) {
// 		super(actualPattern, facing, dusts, entity, creator);
// 	}
// 	@Override
// 	public void onRuneActivatedbyPlayer(EntityPlayer player,
// 			ItemStack[] sacrifice, boolean negated) {
// 		//nothing here
// 		if(!player.world.isRemote)user=player.getName();
// 	}
// 	private static final int RADIUS=3;
// 	@Override
// 	public void update() {
// 		World world = entity.getWorld();
// 		if(!world.isRemote){
// 			if(entity.ticksExisted()==5*Refs.TPS)this.renderActive=false;
// 			List<EntityLivingBase> ents = world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(getPos().add(-RADIUS,-1,-RADIUS), getPos().add(RADIUS,1,RADIUS)));
// 			if(!ents.isEmpty()){
// 				boolean broken=false;
// 				for(EntityLivingBase e:ents){
// 					if(e instanceof EntityPlayer){
// 						if(((EntityPlayer)e).getName().equals(user))continue;
// 					}
// 					if(!broken){
// 						this.onPatternBroken();
// 						broken=true;
// 					}
// 					BlockPos pos = e.getPosition();
// 					for(int x=-1;x<=1;x++){
// 						for(int z=-1;z<=1;z++){
// 							for(int y=-1;y<=1;y++){
// 								BlockPos p = pos.add(x, y, z);
// 								Block b = world.getBlockState(p).getBlock();
// 								if((b.isReplaceable(world, p)||b==WizardryRegistry.dust_placed)&&!(x==0&&z==0)){
// 									world.setBlockState(p, Blocks.IRON_BARS.getDefaultState());
// 								}
// 							}
// 						}
// 					}
// 				}
// 			}
// 		}
// 	}
// 	/* (non-Javadoc)
// 	 * @see com.zpig333.runesofwizardry.api.RuneEntity#readFromNBT(net.minecraft.nbt.NBTTagCompound)
// 	 */
// 	@Override
// 	public void readFromNBT(NBTTagCompound compound) {
// 		super.readFromNBT(compound);
// 		user=compound.getString("username");
// 	}
// 	/* (non-Javadoc)
// 	 * @see com.zpig333.runesofwizardry.api.RuneEntity#writeToNBT(net.minecraft.nbt.NBTTagCompound)
// 	 */
// 	@Override
// 	public void writeToNBT(NBTTagCompound compound) {
// 		super.writeToNBT(compound);
// 		compound.setString("username", user);
// 	}
// }


// Path: src/main/java/xilef11/mc/runesofwizardry_classics/runes/RuneTrapCage.java
import java.io.IOException;
import java.util.Set;
import com.zpig333.runesofwizardry.api.RuneEntity;
import com.zpig333.runesofwizardry.core.rune.PatternUtils;
import com.zpig333.runesofwizardry.tileentity.TileEntityDustActive;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3i;
import xilef11.mc.runesofwizardry_classics.Refs;
import xilef11.mc.runesofwizardry_classics.runes.entity.RuneEntityTrapCage;

package xilef11.mc.runesofwizardry_classics.runes;


public class RuneTrapCage extends ClassicRune {
	@Override
	protected ItemStack[][] setupPattern() throws IOException {
		return PatternUtils.importFromJson(Refs.PATTERN_PATH+"runeentrapment.json");
	}
	@Override
	public String getID() {
		return "runeEntrapment";
	}
	@Override
	protected Vec3i setupEntityPos() {
		return new Vec3i(1,1,0);
	}
	@Override