mojira.dev
MC-12834

Block Slipperiness Detection

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).

Related issues

Comments

migrated

Duplicate of MC-1127, please use the search function to see if your bug has already been submitted. Currently over 55% of tickets are being closed as duplicate.

migrated

May be a duplicate, but it has more useful information on resolving this issue than any other report.

migrated

seconded. this post is more useful

migrated

(Unassigned)

Unconfirmed

friction

Minecraft 1.5.1

Retrieved