Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-247422

World border rounds to block positions for entity collisions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.18.1
    • Confirmed
    • (Unassigned)

      Steps to recreate:
      1. Create a superflat world
      2. Run /worldborder set 31
      3. Run against world border and notice that you do not collide with it directly

      Code Analysis: (Yarn 1.18.1)
      net.minecraft.world.border.WorldBorder$StaticArea

      private void recalculateBounds() {
         ...
         this.shape = VoxelShapes.combineAndSimplify(
            VoxelShapes.UNBOUNDED,
            VoxelShapes.cuboid(
               Math.floor(this.getBoundWest()),
               Double.NEGATIVE_INFINITY,
               Math.floor(this.getBoundNorth()),
               Math.ceil(this.getBoundEast()),
               Double.POSITIVE_INFINITY,
               Math.ceil(this.getBoundSouth())
            ),
            BooleanBiFunction.ONLY_FIRST
         );
      } 

      Basically the world border is being rounded using Math.floor() & Math.ceil()
      Although entity collisions work perfectly fine without the rounding. The voxelShape bounds are only used for entity collisions

      The fix is simply to remove Math.floor() & Math.ceil()

            Unassigned Unassigned
            PR0CESS FX - PR0CESS
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: