Fix paths and farmland not being solid (#4915)

Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>
This commit is contained in:
Josh Roy 2022-06-18 15:31:54 -04:00 committed by GitHub
parent 96c6c951e8
commit 8d856dd6db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -31,6 +31,11 @@ public final class LocationUtil {
"FLOWING_LAVA", "LAVA", "STATIONARY_LAVA");
private static final Material PORTAL = EnumUtil.getMaterial("NETHER_PORTAL", "PORTAL");
private static final Material LIGHT = EnumUtil.getMaterial("LIGHT");
private static final Material PATH = EnumUtil.getMaterial("GRASS_PATH");
private static final Material FARMLAND = EnumUtil.getMaterial("FARMLAND");
// The player can stand inside these materials
private static final Set<Material> HOLLOW_MATERIALS = EnumSet.noneOf(Material.class);
private static final Set<Material> TRANSPARENT_MATERIALS = EnumSet.noneOf(Material.class);
@ -49,6 +54,10 @@ public final class LocationUtil {
// Barrier is transparent, but solid
HOLLOW_MATERIALS.remove(Material.BARRIER);
// Path and farmland are transparent, but solid
HOLLOW_MATERIALS.remove(PATH);
HOLLOW_MATERIALS.remove(FARMLAND);
// Light blocks can be passed through and are not considered transparent for some reason
if (LIGHT != null) {
HOLLOW_MATERIALS.add(LIGHT);