Fixed Block.doesSideBlockRendering, closes #2564.

This commit is contained in:
RainWarrior 2016-03-19 07:20:25 +03:00
parent 3f3989f6ac
commit f37a80b302
3 changed files with 11 additions and 13 deletions

View File

@ -196,7 +196,7 @@
public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_)
{
return new ItemStack(Item.func_150898_a(this), 1, this.func_180651_a(p_185473_3_));
@@ -844,6 +865,1166 @@
@@ -844,6 +865,1167 @@
return "Block{" + field_149771_c.func_177774_c(this) + "}";
}
@ -255,9 +255,10 @@
+ * Faces which are fully opaque should return true, faces with transparency
+ * or faces which do not span the full size of the block should return false.
+ *
+ * @param state The current block state
+ * @param world The current world
+ * @param pos Block position in world
+ * @param side The side to check
+ * @param face The side to check
+ * @return True if the block is opaque on the specified side.
+ */
+ public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face)

View File

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/block/BlockSlab.java
+++ ../src-work/minecraft/net/minecraft/block/BlockSlab.java
@@ -50,6 +50,17 @@
@@ -50,6 +50,16 @@
return this.func_176552_j();
}
@ -10,15 +10,14 @@
+ if ( state.func_185914_p() )
+ return true;
+
+ // face is on the block being rendered, not this block.
+ EnumBlockHalf side = world.func_180495_p(pos).func_177229_b(field_176554_a);
+ return (side == EnumBlockHalf.TOP && face == EnumFacing.DOWN) || (side == EnumBlockHalf.BOTTOM && face == EnumFacing.UP);
+ EnumBlockHalf side = state.func_177229_b(field_176554_a);
+ return (side == EnumBlockHalf.TOP && face == EnumFacing.UP) || (side == EnumBlockHalf.BOTTOM && face == EnumFacing.DOWN);
+ }
+
public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_)
{
IBlockState iblockstate = super.func_180642_a(p_180642_1_, p_180642_2_, p_180642_3_, p_180642_4_, p_180642_5_, p_180642_6_, p_180642_7_, p_180642_8_).func_177226_a(field_176554_a, BlockSlab.EnumBlockHalf.BOTTOM);
@@ -77,13 +88,14 @@
@@ -77,13 +87,14 @@
{
return false;
}

View File

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/block/BlockStairs.java
+++ ../src-work/minecraft/net/minecraft/block/BlockStairs.java
@@ -443,6 +443,19 @@
@@ -443,6 +443,17 @@
return new BlockStateContainer(this, new IProperty[] {field_176309_a, field_176308_b, field_176310_M});
}
@ -10,11 +10,9 @@
+ if ( state.func_185914_p() )
+ return true;
+
+ // face is on the block being rendered, not this block.
+ IBlockState iblockstate = world.func_180495_p(pos);
+ EnumHalf half = iblockstate.func_177229_b(field_176308_b);
+ EnumFacing side = iblockstate.func_177229_b(field_176309_a);
+ return side == face.func_176734_d() || (half == EnumHalf.TOP && face == EnumFacing.DOWN) || (half == EnumHalf.BOTTOM && face == EnumFacing.UP);
+ 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);
+ }
+
public static enum EnumHalf implements IStringSerializable