Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Redstone Upgrade #1066

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ protected ItemStack getMainDrop (BlockState state, BlockEntityDrawers tile) {
@Override
@SuppressWarnings("deprecation")
public boolean isSignalSource (@NotNull BlockState state) {
return true;
return false;
}

@Override
Expand All @@ -459,6 +459,32 @@ public int getDirectSignal (@NotNull BlockState state, @NotNull BlockGetter worl
return (side == Direction.UP) ? getSignal(state, worldIn, pos, side) : 0;
}

@SuppressWarnings("deprecation")
@Override
public void onRemove(BlockState p_51538_, Level p_51539_, BlockPos p_51540_, BlockState p_51541_, boolean p_51542_) {
if (!p_51538_.is(p_51541_.getBlock())) {
p_51539_.updateNeighbourForOutputSignal(p_51540_, this);
super.onRemove(p_51538_, p_51539_, p_51540_, p_51541_, p_51542_);
}
}

@Override
public boolean hasAnalogOutputSignal(BlockState p_51520_) {
return true;
}

@Override
public int getAnalogOutputSignal(BlockState state, Level blockAccess, BlockPos pos) {
if (!hasAnalogOutputSignal(state))
return 0;

BlockEntityDrawers blockEntity = WorldUtils.getBlockEntity(blockAccess, pos, BlockEntityDrawers.class);
if (blockEntity == null || !blockEntity.isRedstone())
return 0;

return blockEntity.getRedstoneLevel();
}

@Override
public boolean useShapeForLightOcclusion(@NotNull BlockState state) {
return true;
Expand Down