From 775dd28508cd498aa728ee830913da013d535ef7 Mon Sep 17 00:00:00 2001 From: Davide Albiero Date: Thu, 31 Oct 2024 19:14:27 +0100 Subject: [PATCH] Fix #258 --- .../block/manipulator/CartDispenserBlock.java | 2 +- .../block/manipulator/ManipulatorBlock.java | 17 ----------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/main/java/mods/railcraft/world/level/block/manipulator/CartDispenserBlock.java b/src/main/java/mods/railcraft/world/level/block/manipulator/CartDispenserBlock.java index d9884fde0..31497a605 100644 --- a/src/main/java/mods/railcraft/world/level/block/manipulator/CartDispenserBlock.java +++ b/src/main/java/mods/railcraft/world/level/block/manipulator/CartDispenserBlock.java @@ -72,7 +72,7 @@ public void neighborChanged(BlockState state, Level level, BlockPos pos, Block b BlockPos fromPos, boolean isMoving) { boolean flag = level.hasNeighborSignal(pos) || level.hasNeighborSignal(pos.above()); - level.setBlock(pos, state.setValue(POWERED, flag), 4); + level.setBlock(pos, state.setValue(POWERED, flag), Block.UPDATE_ALL); if (level.isClientSide()) { return; diff --git a/src/main/java/mods/railcraft/world/level/block/manipulator/ManipulatorBlock.java b/src/main/java/mods/railcraft/world/level/block/manipulator/ManipulatorBlock.java index a9358b24d..7758b1227 100644 --- a/src/main/java/mods/railcraft/world/level/block/manipulator/ManipulatorBlock.java +++ b/src/main/java/mods/railcraft/world/level/block/manipulator/ManipulatorBlock.java @@ -8,18 +8,14 @@ import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.BaseEntityBlock; -import net.minecraft.world.level.block.BaseRailBlock; import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.RenderShape; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BooleanProperty; -import net.minecraft.world.level.redstone.Redstone; import net.minecraft.world.phys.BlockHitResult; import net.minecraftforge.network.NetworkHooks; @@ -60,19 +56,6 @@ public InteractionResult use(BlockState blockState, Level level, public abstract Direction getFacing(BlockState blockState); - @Override - public int getSignal(BlockState blockState, BlockGetter level, BlockPos blockPos, - Direction direction) { - boolean emit = false; - if (isPowered(blockState)) { - var neighborBlockState = level.getBlockState(blockPos.relative(direction.getOpposite())); - emit = BaseRailBlock.isRail(neighborBlockState) - || neighborBlockState.is(Blocks.REDSTONE_WIRE) - || neighborBlockState.is(Blocks.REPEATER); - } - return emit ? Redstone.SIGNAL_MAX : Redstone.SIGNAL_NONE; - } - @SuppressWarnings("deprecation") @Override public void onRemove(BlockState state, Level level, BlockPos pos, BlockState newState,