diff --git a/src/main/java/eu/ha3/presencefootsteps/world/AssociationPool.java b/src/main/java/eu/ha3/presencefootsteps/world/AssociationPool.java index 3fc69c99..c0da0eb0 100644 --- a/src/main/java/eu/ha3/presencefootsteps/world/AssociationPool.java +++ b/src/main/java/eu/ha3/presencefootsteps/world/AssociationPool.java @@ -78,10 +78,10 @@ public SoundsKey get(BlockPos pos, BlockState state, String substrate) { getForState(state, substrate) || (!baseState.isAir() && ( getForState(baseState, substrate) - || (!Substrates.DEFAULT.equals(substrate) && getForState(baseState, Substrates.DEFAULT)) - || getForPrimitive(baseState) + || (!Substrates.isDefault(substrate) && getForState(baseState, Substrates.DEFAULT)) + || (getForPrimitive(baseState, substrate)) )) - || getForPrimitive(state) + || getForPrimitive(state, substrate) )) { return association; } @@ -93,7 +93,10 @@ private boolean getForState(BlockState state, String substrate) { return (association = engine.getIsolator().blocks().getAssociation(state, substrate)).isResult(); } - private boolean getForPrimitive(BlockState state) { + private boolean getForPrimitive(BlockState state, String substrate) { + if (Substrates.isSupplimentary(substrate)) { + return false; + } BlockSoundGroup sounds = state.getSoundGroup(); return (association = engine.getIsolator().primitives().getAssociation(sounds.getStepSound(), PrimitiveLookup.getSubstrate(sounds))).isResult(); } diff --git a/src/main/java/eu/ha3/presencefootsteps/world/PFSolver.java b/src/main/java/eu/ha3/presencefootsteps/world/PFSolver.java index 7d05d4ec..ed19ffda 100644 --- a/src/main/java/eu/ha3/presencefootsteps/world/PFSolver.java +++ b/src/main/java/eu/ha3/presencefootsteps/world/PFSolver.java @@ -18,12 +18,8 @@ import net.minecraft.util.math.Vec3d; import net.minecraft.util.shape.VoxelShape; import net.minecraft.world.World; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; public class PFSolver implements Solver { - private static final Logger LOGGER = LogManager.getLogger("PFSolver"); - private static final double TRAP_DOOR_OFFSET = 0.1; private final SoundEngine engine; @@ -217,7 +213,6 @@ private Association findAssociation(AssociationPool associations, LivingEntity e SoundsKey wetAssociation = SoundsKey.UNASSIGNED; if (isValidCarpet && (association = associations.get(pos, carpet, Substrates.CARPET)).isEmitter()) { - LOGGER.debug("Carpet detected: " + association); target = carpet; // reference frame moved up by 1 } else { diff --git a/src/main/java/eu/ha3/presencefootsteps/world/Substrates.java b/src/main/java/eu/ha3/presencefootsteps/world/Substrates.java index 765c6430..a049107e 100644 --- a/src/main/java/eu/ha3/presencefootsteps/world/Substrates.java +++ b/src/main/java/eu/ha3/presencefootsteps/world/Substrates.java @@ -1,5 +1,7 @@ package eu.ha3.presencefootsteps.world; +import java.util.Set; + public interface Substrates { String DEFAULT = ""; String CARPET = "carpet"; @@ -7,4 +9,14 @@ public interface Substrates { String FENCE = "bigger"; String FOLIAGE = "foliage"; String MESSY = "messy"; + + Set SUPPLIMENTART_SUBSTRATES = Set.of(WET, FOLIAGE, MESSY); + + static boolean isDefault(String substrate) { + return Substrates.DEFAULT.equals(substrate); + } + + static boolean isSupplimentary(String substrate) { + return SUPPLIMENTART_SUBSTRATES.contains(substrate); + } }