mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
you forgot beam cutting ya ding dong
This commit is contained in:
parent
88a90aada7
commit
a95079826c
@ -1,7 +1,6 @@
|
|||||||
package com.hbm.blocks.machine;
|
package com.hbm.blocks.machine;
|
||||||
|
|
||||||
import com.hbm.blocks.ModBlocks;
|
import com.hbm.blocks.ModBlocks;
|
||||||
import com.hbm.main.MainRegistry;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
@ -75,15 +74,12 @@ public class Spotlight extends Block {
|
|||||||
Block block = world.getBlock(x, y, z);
|
Block block = world.getBlock(x, y, z);
|
||||||
if (!block.isAir(world, x, y, z)) return;
|
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)) {
|
if (!(block instanceof SpotlightBeam)) {
|
||||||
world.setBlock(x, y, z, ModBlocks.spotlight_beam);
|
world.setBlock(x, y, z, ModBlocks.spotlight_beam);
|
||||||
}
|
}
|
||||||
|
|
||||||
int meta = SpotlightBeam.setDirection(world, x, y, z, dir, true);
|
// If we encounter an existing beam, add a new INCOMING direction to the metadata
|
||||||
|
SpotlightBeam.setDirection(world, x, y, z, dir, true);
|
||||||
MainRegistry.logger.info("block meta set to: " + meta + " - should be at least: " + dir.flag);
|
|
||||||
|
|
||||||
propagateBeam(world, x, y, z, dir, distance);
|
propagateBeam(world, x, y, z, dir, distance);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,12 +29,13 @@ public class SpotlightBeam extends BlockContainer {
|
|||||||
// If a block is placed onto the beam, handle the new cutoff
|
// If a block is placed onto the beam, handle the new cutoff
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int metadata) {
|
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) {
|
||||||
if (world.isRemote) return;
|
for (ForgeDirection dir : getDirections(world, x, y, z)) {
|
||||||
|
Spotlight.unpropagateBeam(world, x, y, z, dir);
|
||||||
for (ForgeDirection dir : getDirections(metadata)) {
|
}
|
||||||
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
|
// If a block in the beam path is removed, repropagate beam
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user