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

Block Slipperiness Detection

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Duplicate
    • Affects Version/s: Minecraft 1.5.1
    • Fix Version/s: None
    • Labels:
    • Environment:
      Windos 7, Java 6
    • Confirmation Status:
      Unconfirmed
    • Game Mode:
      Survival

      Description

      When the game goes to determine how slippery a block is in order to cause items to slide across the surface, it incorrectly grabs blocks for anything less than a full block, i.e. half slabs, cake, light sensors, and fractional blocks added by other mods (RedPower's fractional blocks is a notable example).

      This is why half slabs (cake, etc.) on top of ice are slippery.

      This line:
      (Line 130 of EntityItem, 113 of EntityAIControledByPlayer, 1454 of EntityLiving)

      int var9 = this.thisEntity.worldObj.getBlockId(MathHelper.floor_float((float)var4), MathHelper.floor_float((float)var5) - 1, MathHelper.floor_float((float)var6));

      Should be:

      int var9 = this.thisEntity.worldObj.getBlockId(MathHelper.floor_float((float)var4), MathHelper.floor_float((float)var5 - 0.0625), MathHelper.floor_float((float)var6));

      var5 is the Y value of the Entity being moved. By flooring it first, we determine which block space the item (or mob) is in, but for half-slabs this is the same block as the block that should be looked at.

      So we need to subtract a value from the float first (the thickness of the thinnest possible block--I have used 1/16th) prior to flooring.

      In so doing, if the item is at 71.0000 (resting on top of a full block) we get 70 as the block to look at (correct). If the item is at 71.5000 (resting on top of a half-slab) then we get 71 (the half-slab).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                draco18s Draco Silverwing
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: