Minecraft
  1. Minecraft
  2. MC-108673

Fences and cobble walls moved by pistons don't move entities in the upper part of their collision box

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: Minecraft 1.10.2, Minecraft 16w40a, Minecraft 16w41a, Minecraft 16w43a, Minecraft 16w44a, Minecraft 1.11 Pre-Release 1, Minecraft 1.11
    • Fix Version/s: Minecraft 16w50a
    • Security Level: Minecraft - Public (Viewable by everyone)
    • Labels:
      None
    • Confirmation Status:
      Confirmed

      Description

      When moving a 1.5 high block such as fences, walls or fence gates they will not move entities in the upper 0.5 part of the collision box.

      For the not moving entities part of the issue this is a good test setup:

      Video: https://youtu.be/0tT4VgPSdkM

      Cause/Fix

      When pistons move entities they do a "rough check" with a 1x1x1 bounding box first and only match the real bounding boxes against the entities that are within this box.
      The easiest way to fix this is to soften up the first check a bit to a 1x1.5x1 box.

      TileEntityPiston.java
         private void moveCollidedEntities(float p_184322_1_) {
            EnumFacing enumfacing = this.extending?this.pistonFacing:this.pistonFacing.getOpposite();
            double d0 = (double)(p_184322_1_ - this.progress);
            List<AxisAlignedBB> list = Lists.<AxisAlignedBB>newArrayList();
            this.func_190606_j().addCollisionBoxToList(this.world, BlockPos.ORIGIN /*Cause of MC-110244*/, new AxisAlignedBB(BlockPos.ORIGIN), list, (Entity)null);
            if(!((List)list).isEmpty()) {
               AxisAlignedBB axisalignedbb = this.func_190607_a(new AxisAlignedBB(BlockPos.ORIGIN).setMaxY(1.5)); // Added ".setMaxY(1.5)" to support 1.5 high blocks. (MC-108673)
               List<Entity> list1 = this.world.getEntitiesWithinAABBExcludingEntity((Entity)null, this.func_190610_a(axisalignedbb, enumfacing, d0).union(axisalignedbb));
               if(!list1.isEmpty()) {
                  boolean flag = this.pistonState.getBlock() == Blocks.SLIME_BLOCK;
                  // ...
               }
            }
         }
      

      I noticed that I mixed two issues up in this report and split it up now. Second report: MC-110094

        Issue Links

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              [Mojang] Grum (Erik Broes)
              Reporter:
              Panda
            • Votes:
              9 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                CHK: