This commit is contained in:
Justin Parsell 2021-04-30 10:45:10 -04:00
parent 282da8d903
commit e12051bc8c
1 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,6 @@ import com.google.common.collect.Maps;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.ShapeContext;
import net.minecraft.block.enums.WireConnection;
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));
if(world.getBlockState(pos.offset(Direction.WEST)).isOf(this))
state = state.with(WIRE_CONNECTION_WEST, determineConnection(world, pos, Direction.WEST));
System.out.println(state.toString());
return state;
}
@ -145,6 +143,7 @@ public class GlowstoneWireBlock extends Block{
// Set to blank state
if(hasConnection(state)) {
world.setBlockState(pos, this.getDefaultState());
world.updateNeighborsAlways(pos, this);
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)
@Override
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)
state = state.with(DIRECTION_TO_WIRE_CONNECTION_PROPERTY.get(direction), determineConnection(world, pos, direction));
return state;