Skip to content

Commit

Permalink
Hotfix for Pistons
Browse files Browse the repository at this point in the history
Also: Fixed modded slime block stuff I think?
  • Loading branch information
JoshieGemFinder committed Apr 5, 2024
1 parent 4c79be8 commit a1beca4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ public static boolean canPush(IBlockState blockStateIn, World worldIn, BlockPos

if(
worldIn.getWorldBorder().contains(pos) &&
!(pos.getY() >= 0 && (pushDir != EnumFacing.DOWN || pos.getY() != 0)) &&
!(pos.getY() <= worldIn.getHeight() - 1 && (pushDir != EnumFacing.UP || pos.getY() != worldIn.getHeight() - 1))
(pos.getY() >= 0 && (pushDir != EnumFacing.DOWN || pos.getY() != 0)) &&
(pos.getY() <= worldIn.getHeight() - 1 && (pushDir != EnumFacing.UP || pos.getY() != worldIn.getHeight() - 1))
)
{
if (block == ModBlocks.SCABYST_PISTON || block == ModBlocks.SCABYST_STICKY_PISTON)
Expand All @@ -166,6 +166,7 @@ public static boolean canPush(IBlockState blockStateIn, World worldIn, BlockPos
{
return false;
}
return !block.hasTileEntity(blockStateIn);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,18 @@ private void reorderListAtCollision(int p_177255_1_, int p_177255_2_)
this.toMove.addAll(list2);
}

private boolean isVanillaStickyBlock(IBlockState state) {
return !(state.getBlock() instanceof BlockStickyBase) && state.getBlock().isStickyBlock(state);
}

private boolean addBranchingBlocks(BlockPos fromPos, IBlockState branchBlockState)
{
for (EnumFacing enumfacing : EnumFacing.values())
{
BlockPos pos = fromPos.offset(enumfacing);
IBlockState state = this.world.getBlockState(pos);
//we want it so if something attaches to slime blocks, it'll still attach if the config option is off
boolean slimeBlock = !BLRedstoneConfig.GENERAL.slimeBlocksWorkOnScabystPistons && (state.getBlock() == Blocks.SLIME_BLOCK || branchBlockState.getBlock() == Blocks.SLIME_BLOCK);
boolean slimeBlock = !BLRedstoneConfig.GENERAL.slimeBlocksWorkOnScabystPistons && (isVanillaStickyBlock(state) || isVanillaStickyBlock(branchBlockState));
//sticky block check moment
boolean stickyBlock = branchBlockState.getBlock() instanceof BlockStickyBase || state.getBlock() instanceof BlockStickyBase;
if((slimeBlock || stickyBlock) && !BlockStickyBase.shouldBlocksStick(branchBlockState, state)) {
Expand Down

0 comments on commit a1beca4

Please sign in to comment.