Cherry pick: * Use Tag.REPLACEABLE instead of manual material listing

This commit is contained in:
Len 2024-07-20 17:09:21 +02:00
parent 40152b5dd9
commit 0acbfa316f

View File

@ -2066,10 +2066,7 @@ class PlayerEventHandler implements Listener
{ {
result = iterator.next(); result = iterator.next();
Material type = result.getType(); Material type = result.getType();
if (type != Material.AIR && if (!Tag.REPLACEABLE.isTagged(type) || (!passThroughWater && type == Material.WATER)) return result;
(!passThroughWater || type != Material.WATER) &&
type != Material.SHORT_GRASS &&
type != Material.SNOW) return result;
} }
return result; return result;