diff --git a/src/main/java/com/hbm/blocks/machine/Spotlight.java b/src/main/java/com/hbm/blocks/machine/Spotlight.java index 03e6b4244..12f12a57e 100644 --- a/src/main/java/com/hbm/blocks/machine/Spotlight.java +++ b/src/main/java/com/hbm/blocks/machine/Spotlight.java @@ -1,7 +1,6 @@ package com.hbm.blocks.machine; import com.hbm.blocks.ModBlocks; -import com.hbm.main.MainRegistry; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -75,15 +74,12 @@ public class Spotlight extends Block { Block block = world.getBlock(x, y, z); if (!block.isAir(world, x, y, z)) return; - // If we encounter a beam, add a new INCOMING direction to the metadata - // Otherwise, spawn a new beam if (!(block instanceof SpotlightBeam)) { world.setBlock(x, y, z, ModBlocks.spotlight_beam); } - int meta = SpotlightBeam.setDirection(world, x, y, z, dir, true); - - MainRegistry.logger.info("block meta set to: " + meta + " - should be at least: " + dir.flag); + // If we encounter an existing beam, add a new INCOMING direction to the metadata + SpotlightBeam.setDirection(world, x, y, z, dir, true); propagateBeam(world, x, y, z, dir, distance); } diff --git a/src/main/java/com/hbm/blocks/machine/SpotlightBeam.java b/src/main/java/com/hbm/blocks/machine/SpotlightBeam.java index a1a9d1569..479159779 100644 --- a/src/main/java/com/hbm/blocks/machine/SpotlightBeam.java +++ b/src/main/java/com/hbm/blocks/machine/SpotlightBeam.java @@ -29,12 +29,13 @@ public class SpotlightBeam extends BlockContainer { // If a block is placed onto the beam, handle the new cutoff @Override public void breakBlock(World world, int x, int y, int z, Block block, int metadata) { - super.breakBlock(world, x, y, z, block, metadata); - if (world.isRemote) return; - - for (ForgeDirection dir : getDirections(metadata)) { - Spotlight.unpropagateBeam(world, x, y, z, dir); + if (!world.isRemote) { + for (ForgeDirection dir : getDirections(world, x, y, z)) { + Spotlight.unpropagateBeam(world, x, y, z, dir); + } } + super.breakBlock(world, x, y, z, block, metadata); + } // If a block in the beam path is removed, repropagate beam