Minor fixes/enh for laser blocks
@@ -5,6 +5,7 @@ import java.util.Random;
import net.geforcemods.securitycraft.ConfigHandler;
import net.geforcemods.securitycraft.SCContent;
import net.geforcemods.securitycraft.api.CustomizableTileEntity;
+import net.geforcemods.securitycraft.api.Option.BooleanOption;
import net.geforcemods.securitycraft.tileentity.LaserBlockTileEntity;
import net.geforcemods.securitycraft.util.BlockUtils;
import net.minecraft.block.Block;
@@ -71,6 +72,8 @@ public class LaserBlock extends DisguisableBlock {
{
CustomizableTileEntity.link(thisTe, thatTe);
+ if (thisTe.getOptionByName("enabled") != null && thatTe.getOptionByName("enabled") != null && ((BooleanOption)thisTe.getOptionByName("enabled")).getValue() && ((BooleanOption)thatTe.getOptionByName("enabled")).getValue())
+ {
for(int j = 1; j < i; j++)
{
offsetPos = pos.offset(facing, j);
@@ -80,6 +83,8 @@ public class LaserBlock extends DisguisableBlock {
}
}
}
+ break inner;
+ }
}
}
}
@@ -112,6 +117,12 @@ public class LaserBlock extends DisguisableBlock {
}
}
+ @Override
+ public void neighborChanged(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean flag)
+ {
+ setLaser(world, pos);
+ }
+
@Override
public boolean canProvidePower(BlockState state){
return true;
