Fix vines and scaffolding not being climbable.

Fix powered rails not spreading power correctly. Closes: #5854
This commit is contained in:
LexManos 2019-06-24 20:05:50 -07:00
parent c90d42973d
commit f4598a97f7
4 changed files with 31 additions and 5 deletions

View file

@ -18,12 +18,20 @@
}
protected boolean func_176566_a(World p_176566_1_, BlockPos p_176566_2_, BlockState p_176566_3_, boolean p_176566_4_, int p_176566_5_) {
@@ -105,7 +111,7 @@
RailShape railshape = blockstate.func_177229_b(field_176568_b);
@@ -99,13 +105,13 @@
protected boolean func_208071_a(World p_208071_1_, BlockPos p_208071_2_, boolean p_208071_3_, int p_208071_4_, RailShape p_208071_5_) {
BlockState blockstate = p_208071_1_.func_180495_p(p_208071_2_);
- if (blockstate.func_177230_c() != this) {
+ if (!(blockstate.func_177230_c() instanceof PoweredRailBlock)) {
return false;
} else {
- RailShape railshape = blockstate.func_177229_b(field_176568_b);
+ RailShape railshape = getRailDirection(blockstate, p_208071_1_, p_208071_2_, null);
if (p_208071_5_ != RailShape.EAST_WEST || railshape != RailShape.NORTH_SOUTH && railshape != RailShape.ASCENDING_NORTH && railshape != RailShape.ASCENDING_SOUTH) {
if (p_208071_5_ != RailShape.NORTH_SOUTH || railshape != RailShape.EAST_WEST && railshape != RailShape.ASCENDING_EAST && railshape != RailShape.ASCENDING_WEST) {
- if (blockstate.func_177229_b(field_176569_M)) {
+ if (!(blockstate.func_177230_c() instanceof PoweredRailBlock) || isActivator != ((PoweredRailBlock)blockstate.func_177230_c()).isActivator) {
+ if (isActivator == ((PoweredRailBlock)blockstate.func_177230_c()).isActivator) {
return p_208071_1_.func_175640_z(p_208071_2_) ? true : this.func_176566_a(p_208071_1_, p_208071_2_, blockstate, p_208071_3_, p_208071_4_ + 1);
} else {
return false;

View file

@ -0,0 +1,11 @@
--- a/net/minecraft/block/ScaffoldingBlock.java
+++ b/net/minecraft/block/ScaffoldingBlock.java
@@ -142,6 +142,8 @@
return i;
}
+ @Override public boolean isLadder(BlockState state, IWorldReader world, BlockPos pos, net.minecraft.entity.LivingEntity entity) { return true; }
+
static {
VoxelShape voxelshape = Block.func_208617_a(0.0D, 14.0D, 0.0D, 16.0D, 16.0D, 16.0D);
VoxelShape voxelshape1 = Block.func_208617_a(0.0D, 0.0D, 0.0D, 2.0D, 16.0D, 2.0D);

View file

@ -18,3 +18,10 @@
Direction direction = Direction.func_176741_a(p_196267_4_);
BlockPos blockpos = p_196267_3_.func_177984_a();
if (direction.func_176740_k().func_176722_c() && !p_196267_1_.func_177229_b(func_176267_a(direction))) {
@@ -329,4 +329,6 @@
public static BooleanProperty func_176267_a(Direction p_176267_0_) {
return field_196546_A.get(p_176267_0_);
}
+
+ @Override public boolean isLadder(BlockState state, IWorldReader world, BlockPos pos, net.minecraft.entity.LivingEntity entity) { return true; }
}

View file

@ -384,7 +384,7 @@ public class ForgeHooks
if (isSpectator) return false;
if (!ForgeConfig.SERVER.fullBoundingBoxLadders.get())
{
return state.getBlock().isLadder(state, world, pos, entity);
return state.isLadder(world, pos, entity);
}
else
{
@ -400,7 +400,7 @@ public class ForgeHooks
{
BlockPos tmp = new BlockPos(x2, y2, z2);
state = world.getBlockState(tmp);
if (state.getBlock().isLadder(state, world, tmp, entity))
if (state.isLadder(world, tmp, entity))
{
return true;
}