Skip to content

Commit

Permalink
bring into line with 1.13.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadiboo committed Jun 4, 2019
1 parent 9c4ca77 commit fefea43
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,9 @@ private static void renderShortGrass(
final IBlockState grassPlantState = StateHolder.GRASS_PLANT_DEFAULT;

pooledMutableBlockPos.setPos(texturePos).move(EnumFacing.UP);
// if (!blockAccess.isBlockLoaded(pooledMutableBlockPos)) {
// return;
// }
final IBlockState blockStateUp = blockAccess.getBlockState(pooledMutableBlockPos);
if (blockStateUp == grassPlantState) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class StolenReposeCode {

static void addCollisionBoxToList(IBlockState stateIn, World worldIn, BlockPos posIn, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean isActualState) {

final AxisAlignedBB collisionBoundingBox = getCollisionBoundingBox(stateIn, worldIn, posIn);
final AxisAlignedBB collisionBoundingBox = getStateCollisionBoundingBox(stateIn, worldIn, posIn);
if (collisionBoundingBox == null) { // optimization
return;
}
Expand Down Expand Up @@ -86,9 +86,9 @@ private static boolean canSlope(final IBlockState state) {
}

private static boolean canSlopeAt(final IBlockState state, World worldIn, final BlockPos pos, final AxisAlignedBB collisionBoundingBox) {
final AxisAlignedBB box = getCollisionBoundingBox(state, worldIn, pos);
final AxisAlignedBB box = getStateCollisionBoundingBox(state, worldIn, pos);
final BlockPos posUp = pos.up();
return canSlope(state) && (box == null || (box.maxY > 0.5 && getCollisionBoundingBox(worldIn.getBlockState(posUp), worldIn, posUp) == null));
return canSlope(state) && (box == null || (box.maxY > 0.5 && getStateCollisionBoundingBox(worldIn.getBlockState(posUp), worldIn, posUp) == null));
}

private static void addSlopingCollisionBoxes(final IBlockState state, World world, final BlockPos pos, final List<AxisAlignedBB> collidingBoxes, final Predicate<AxisAlignedBB> predicate) {
Expand Down Expand Up @@ -139,12 +139,12 @@ private static boolean stepHigh(final BlockPos offsetPos, final double stepHeigh
}

private static double blockHeight(final BlockPos pos, World world, final IBlockState blockState) {
final AxisAlignedBB box = getCollisionBoundingBox(blockState, world, pos);
final AxisAlignedBB box = getStateCollisionBoundingBox(blockState, world, pos);
return box == null ? 0 : box.maxY;
}

@Nullable
private static AxisAlignedBB getCollisionBoundingBox(final IBlockState state, final IBlockAccess world, final BlockPos pos) {
private static AxisAlignedBB getStateCollisionBoundingBox(final IBlockState state, final IBlockAccess world, final BlockPos pos) {
if (state == StateHolder.SNOW_LAYER_DEFAULT) {
return null; // Stop snow having a collisions AABB with no height that still blocks movement
} else {
Expand Down

0 comments on commit fefea43

Please sign in to comment.