Skip to content

Commit

Permalink
Merge branch '1.20.1' into 1.20.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Sollace committed Mar 16, 2024
2 parents 8867715 + 10dd4bc commit f24cff2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
14 changes: 8 additions & 6 deletions src/main/java/eu/ha3/presencefootsteps/PFConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class PFConfig extends JsonFile {

private int maxSteppingEntities = 50;

private boolean disabled;
private boolean disabled = false;
private boolean firstRun = true;
private boolean multiplayer = true;
private boolean global = true;
Expand All @@ -47,7 +47,7 @@ public boolean toggleMultiplayer() {
}

public EntitySelector cycleTargetSelector() {
targetEntities = EntitySelector.VALUES[(targetEntities.ordinal() + 1) % EntitySelector.VALUES.length];
targetEntities = EntitySelector.VALUES[(getEntitySelector().ordinal() + 1) % EntitySelector.VALUES.length];

save();

Expand Down Expand Up @@ -75,11 +75,11 @@ public void setNotFirstRun() {
}

public Locomotion getLocomotion() {
return stance;
return stance == null ? Locomotion.NONE : stance;
}

public EntitySelector getEntitySelector() {
return targetEntities;
return targetEntities == null ? EntitySelector.ALL : targetEntities;
}

public boolean getEnabledFootwear() {
Expand Down Expand Up @@ -154,8 +154,10 @@ public float setRunningVolumeIncrease(float volume) {
}

public void populateCrashReport(CrashReportSection section) {
section.add("PF Global Volume", volume);
section.add("PF User's Selected Stance", stance);
section.add("Disabled", getDisabled());
section.add("Global Volume", volume);
section.add("User's Selected Stance", getLocomotion());
section.add("Target Selector", getEntitySelector());
section.add("Enabled Global", global);
section.add("Enabled Multiplayer", multiplayer);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package eu.ha3.presencefootsteps.sound.generator;

import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.function.BiFunction;
Expand Down Expand Up @@ -30,7 +31,7 @@ public enum Locomotion {
private final BiFunction<LivingEntity, SoundEngine, Optional<StepSoundGenerator>> constructor;

private static final String AUTO_TRANSLATION_KEY = "menu.pf.stance.auto";
private final String translationKey = "menu.pf.stance." + name().toLowerCase();
private final String translationKey = "menu.pf.stance." + name().toLowerCase(Locale.ROOT);

Locomotion() {
constructor = (entity, engine) -> Optional.empty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ public void writeToReport(boolean full, JsonObjectWriter writer, Map<String, Blo
Identifier id = EntityType.getId(type);
if (full || !contains(id)) {
if (type.create(MinecraftClient.getInstance().world) instanceof LivingEntity) {
writer.field(id.toString(), values.get(id).name());
writer.field(id.toString(), values.getOrDefault(id, Locomotion.NONE).name());
}
}
});
}
}
}
4 changes: 2 additions & 2 deletions src/main/java/eu/ha3/presencefootsteps/world/PFSolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ private Association findAssociation(AssociationPool associations, LivingEntity e
pos.move(Direction.UP);
final boolean hasRain = entity.getWorld().hasRain(pos);
BlockState carpet = getBlockStateAt(entity, pos);
VoxelShape shape = carpet.getCollisionShape(entity.getWorld(), pos);
boolean isValidCarpet = !shape.isEmpty() && (shape.getMax(Axis.Y) < 0.2F && shape.getMax(Axis.Y) < collider.getMin(Axis.Y) + 0.1F);
VoxelShape shape = carpet.getOutlineShape(entity.getWorld(), pos);
boolean isValidCarpet = !shape.isEmpty() && shape.getMax(Axis.Y) < 0.3F;
SoundsKey association = SoundsKey.UNASSIGNED;
SoundsKey foliage = SoundsKey.UNASSIGNED;
SoundsKey wetAssociation = SoundsKey.UNASSIGNED;
Expand Down

0 comments on commit f24cff2

Please sign in to comment.