change
This commit is contained in:
parent
282da8d903
commit
e12051bc8c
|
@ -7,7 +7,6 @@ import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.Blocks;
|
|
||||||
import net.minecraft.block.ShapeContext;
|
import net.minecraft.block.ShapeContext;
|
||||||
import net.minecraft.block.enums.WireConnection;
|
import net.minecraft.block.enums.WireConnection;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
@ -87,7 +86,6 @@ public class GlowstoneWireBlock extends Block{
|
||||||
state = state.with(WIRE_CONNECTION_EAST, determineConnection(world, pos, Direction.EAST));
|
state = state.with(WIRE_CONNECTION_EAST, determineConnection(world, pos, Direction.EAST));
|
||||||
if(world.getBlockState(pos.offset(Direction.WEST)).isOf(this))
|
if(world.getBlockState(pos.offset(Direction.WEST)).isOf(this))
|
||||||
state = state.with(WIRE_CONNECTION_WEST, determineConnection(world, pos, Direction.WEST));
|
state = state.with(WIRE_CONNECTION_WEST, determineConnection(world, pos, Direction.WEST));
|
||||||
System.out.println(state.toString());
|
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,6 +143,7 @@ public class GlowstoneWireBlock extends Block{
|
||||||
// Set to blank state
|
// Set to blank state
|
||||||
if(hasConnection(state)) {
|
if(hasConnection(state)) {
|
||||||
world.setBlockState(pos, this.getDefaultState());
|
world.setBlockState(pos, this.getDefaultState());
|
||||||
|
world.updateNeighborsAlways(pos, this);
|
||||||
return ActionResult.SUCCESS;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,6 +160,7 @@ public class GlowstoneWireBlock extends Block{
|
||||||
// This decides what I should look like whens something around me happens (use this for wire connection)
|
// This decides what I should look like whens something around me happens (use this for wire connection)
|
||||||
@Override
|
@Override
|
||||||
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom) {
|
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom) {
|
||||||
|
System.out.println(world.getBlockState(posFrom).toString());
|
||||||
if (direction != Direction.DOWN && direction != Direction.UP)
|
if (direction != Direction.DOWN && direction != Direction.UP)
|
||||||
state = state.with(DIRECTION_TO_WIRE_CONNECTION_PROPERTY.get(direction), determineConnection(world, pos, direction));
|
state = state.with(DIRECTION_TO_WIRE_CONNECTION_PROPERTY.get(direction), determineConnection(world, pos, direction));
|
||||||
return state;
|
return state;
|
||||||
|
|
Loading…
Reference in New Issue