package com.teamwizardry.refraction.common.tile;

import net.minecraft.block.state.IBlockState;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.Vec3d;
import com.teamwizardry.librarianlib.common.base.block.TileMod;
import com.teamwizardry.refraction.api.ICableHandler;
import com.teamwizardry.refraction.api.PosUtils;
import com.teamwizardry.refraction.common.block.BlockTranslocator;
import com.teamwizardry.refraction.common.light.Beam;
import com.teamwizardry.refraction.common.light.IBeamHandler;
import com.teamwizardry.refraction.init.ModBlocks;

public class TileTranslocator extends TileMod implements IBeamHandler, ICableHandler
{
	@Override
	public void handle(Beam... beams)
	{}

	@Override
	public void handle(Beam beam)
	{
		IBlockState state = worldObj.getBlockState(pos);
		if (state.getBlock() != ModBlocks.TRANSLOCATOR)
			beam.spawn();
		EnumFacing dir = state.getValue(BlockTranslocator.DIRECTION);
		if (!worldObj.isAirBlock(pos.offset(dir)))
		{
			Vec3d slope = beam.slope.normalize().scale(15.0/16.0);
			beam.createSimilarBeam(PosUtils.getSideCenter(pos, dir).add(slope), PosUtils.getVecFromFacing(dir)).spawn();
		}
		else beam.createSimilarBeam(PosUtils.getSideCenter(pos, dir), PosUtils.getVecFromFacing(dir)).spawn();
	}
}

@@ -47,130 +47,8 @@
 e;%0A%0A
-import net.minecraft.block.state.IBlockState;%0Aimport net.minecraft.util.EnumFacing;%0Aimport net.minecraft.util.math.Vec3d;%0A
 impo
@@ -107,16 +107,16 @@
 ileMod;%0A
+
 import c
@@ -443,16 +443,138 @@
 dBlocks;
+%0Aimport net.minecraft.block.state.IBlockState;%0Aimport net.minecraft.util.EnumFacing;%0Aimport net.minecraft.util.math.Vec3d;
 %0A%0Apublic
@@ -868,16 +868,16 @@
 pawn();%0A
-
 %09%09EnumFa
@@ -932,16 +932,85 @@
 CTION);%0A
+%09%09if (!beam.slope.equals(PosUtils.getVecFromFacing(dir)))%0A%09%09%09return;%0A
 %09%09if (!w

fix translocators accepting from any direction