Skip to content

Commit

Permalink
Workaround for standing on the block below a cactus (simplistic).
Browse files Browse the repository at this point in the history
  • Loading branch information
asofold committed Feb 15, 2013
1 parent 0fff534 commit cbe0b5c
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -1415,9 +1415,9 @@ else if ((flags & F_GROUND) != 0 && (flags & ignoreFlags) == 0){
// TODO: further exclude simple full shape blocks, or confine to itchy block types
// TODO: make flags for it.
// Simplistic hot fix attempt for same type + same shape.
double[] bounds = access.getBounds(x, y, z);
final double[] bounds = access.getBounds(x, y, z);
if (bounds == null) return true;
double[] aboveBounds = access.getBounds(x, y + 1, z);
final double[] aboveBounds = access.getBounds(x, y + 1, z);
if (aboveBounds == null) return true;
boolean fullBounds = false;
for (int i = 0; i < 3; i++){
Expand All @@ -1438,6 +1438,12 @@ else if ((flags & F_GROUND) != 0 && (flags & ignoreFlags) == 0){
}
}
}
// Workarounds.
if (aboveId == Material.CACTUS.getId() && aboveId != id){
// TODO: This is a rough estimate, assumes sand underneath, further relies on passable.
// TODO: General workaround for slightly inset blocks which have full bounds for passable.
return true;
}
// Not regarded as ground.
continue;
}
Expand Down

0 comments on commit cbe0b5c

Please sign in to comment.