Make stair culling use actual state, and be more robust. Closes #3170

This commit is contained in:
LexManos 2016-08-08 17:32:32 -07:00
parent bc6b008364
commit ef28edb526
1 changed files with 10 additions and 2 deletions

View File

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/block/BlockStairs.java
+++ ../src-work/minecraft/net/minecraft/block/BlockStairs.java
@@ -445,6 +445,20 @@
@@ -445,6 +445,28 @@
return new BlockStateContainer(this, new IProperty[] {field_176309_a, field_176308_b, field_176310_M});
}
@ -13,9 +13,17 @@
+ if ( state.func_185914_p() )
+ return true;
+
+ state = this.func_176221_a(state, world, pos);
+
+ EnumHalf half = state.func_177229_b(field_176308_b);
+ EnumFacing side = state.func_177229_b(field_176309_a);
+ return side == face || (half == EnumHalf.TOP && face == EnumFacing.UP) || (half == EnumHalf.BOTTOM && face == EnumFacing.DOWN);
+ EnumShape shape = state.func_177229_b(field_176310_M);
+ if ((half == EnumHalf.TOP && face == EnumFacing.UP) || (half == EnumHalf.BOTTOM && face == EnumFacing.DOWN)) return true;
+ if (shape == EnumShape.OUTER_LEFT || shape == EnumShape.OUTER_RIGHT) return false;
+ if (face == side) return true;
+ if (shape == EnumShape.INNER_LEFT && face.func_176735_f() == side) return true;
+ if (shape == EnumShape.INNER_RIGHT && face.func_176746_e() == side) return true;
+ return false;
+ }
+
public static enum EnumHalf implements IStringSerializable