Skip to content

Commit

Permalink
Fixed wet substrate playing when walking on boats. Fixes #233
Browse files Browse the repository at this point in the history
  • Loading branch information
Sollace committed Oct 6, 2023
1 parent 67584a7 commit 5ef4b7a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/eu/ha3/presencefootsteps/world/PFSolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,13 @@ private Association findAssociation(World world, BlockPos pos, Box collider) {
// Try to see if the block above is a carpet...

String association = findForGolem(world, up, Lookup.CARPET_SUBSTRATE);
boolean wasGolem = false;
String wetAssociation = Emitter.NOT_EMITTER;

if (!Emitter.isEmitter(association)) {
association = isolator.getBlockMap().getAssociation(above, Lookup.CARPET_SUBSTRATE);
} else {
wasGolem = true;
}

if (Emitter.isEmitter(association)) {
Expand Down Expand Up @@ -231,6 +234,8 @@ private Association findAssociation(World world, BlockPos pos, Box collider) {

if (!Emitter.isEmitter(association)) {
association = isolator.getBlockMap().getAssociation(in, Lookup.EMPTY_SUBSTRATE);
} else {
wasGolem = true;
}
}

Expand All @@ -246,10 +251,7 @@ private Association findAssociation(World world, BlockPos pos, Box collider) {
}
}

if (Emitter.isEmitter(association) && (
world.hasRain(up)
|| in.getFluidState().isIn(FluidTags.WATER)
|| above.getFluidState().isIn(FluidTags.WATER))) {
if (Emitter.isEmitter(association) && (world.hasRain(up) || (!wasGolem && (in.getFluidState().isIn(FluidTags.WATER) || above.getFluidState().isIn(FluidTags.WATER))))) {
// Only if the block is open to the sky during rain
// or the block is submerged
// or the block is waterlogged
Expand Down

0 comments on commit 5ef4b7a

Please sign in to comment.