@@ -80,7 +80,7 @@ public Association findAssociation(AssociationPool associations, LivingEntity pl
80
80
81
81
// we discard the normal block association, and mark the foliage as detected
82
82
if (foliage .isEmitter () && engine .getIsolator ().blocks ().getAssociation (above , Substrates .MESSY ) == SoundsKey .MESSY_GROUND ) {
83
- return Association .of (above , pos , ply , SoundsKey .NON_EMITTER , SoundsKey .NON_EMITTER , foliage );
83
+ return Association .of (above , pos , ply , false , SoundsKey .NON_EMITTER , SoundsKey .NON_EMITTER , foliage );
84
84
}
85
85
86
86
return Association .NOT_EMITTER ;
@@ -211,9 +211,9 @@ private Association findAssociation(AssociationPool associations, LivingEntity p
211
211
212
212
if (state .isLiquid ()) {
213
213
if (state .getFluidState ().isIn (FluidTags .LAVA )) {
214
- return Association .of (state , pos .down (), player , SoundsKey .LAVAFINE , SoundsKey .NON_EMITTER , SoundsKey .NON_EMITTER );
214
+ return Association .of (state , pos .down (), player , false , SoundsKey .LAVAFINE , SoundsKey .NON_EMITTER , SoundsKey .NON_EMITTER );
215
215
}
216
- return Association .of (state , pos .down (), player , SoundsKey .WATERFINE , SoundsKey .NON_EMITTER , SoundsKey .NON_EMITTER );
216
+ return Association .of (state , pos .down (), player , false , SoundsKey .WATERFINE , SoundsKey .NON_EMITTER , SoundsKey .NON_EMITTER );
217
217
}
218
218
219
219
return association ;
@@ -237,30 +237,26 @@ private Association findAssociation(AssociationPool associations, LivingEntity e
237
237
target = carpet ;
238
238
// reference frame moved up by 1
239
239
} else {
240
- association = SoundsKey .UNASSIGNED ;
241
- pos .move (Direction .DOWN );
242
240
// This condition implies that if the carpet is NOT_EMITTER, solving will
243
241
// CONTINUE with the actual block surface the player is walking on
244
- if (target .isAir ()) {
242
+ pos .move (Direction .DOWN );
243
+ association = associations .get (pos , target , Substrates .DEFAULT );
244
+
245
+ // If the block surface we're on is not an emitter, check for fences below us
246
+ if (!association .isEmitter () || !association .isResult ()) {
245
247
pos .move (Direction .DOWN );
246
248
BlockState fence = getBlockStateAt (entity , pos );
247
249
248
250
// Only check fences if we're actually touching them
249
- if (checkCollision (entity .getWorld (), fence , pos , collider )) {
250
- if ((association = associations .get (pos , fence , Substrates .FENCE )).isResult ()) {
251
- carpet = target ;
252
- target = fence ;
253
- // reference frame moved down by 1
254
- } else {
255
- pos .move (Direction .UP );
256
- }
251
+ if (checkCollision (entity .getWorld (), fence , pos , collider ) && (association = associations .get (pos , fence , Substrates .FENCE )).isResult ()) {
252
+ carpet = target ;
253
+ target = fence ;
254
+ // reference frame moved down by 1
255
+ } else {
256
+ pos .move (Direction .UP );
257
257
}
258
258
}
259
259
260
- if (!association .isResult ()) {
261
- association = associations .get (pos , target , Substrates .DEFAULT );
262
- }
263
-
264
260
if (engine .getConfig ().foliageSoundsVolume .get () > 0 ) {
265
261
if (entity .getEquippedStack (EquipmentSlot .FEET ).isEmpty () || entity .isSprinting ()) {
266
262
if (association .isEmitter () && carpet .getCollisionShape (entity .getWorld (), pos ).isEmpty ()) {
@@ -291,6 +287,6 @@ private Association findAssociation(AssociationPool associations, LivingEntity e
291
287
wetAssociation = associations .get (pos , target , Substrates .WET );
292
288
}
293
289
294
- return Association .of (target , pos , entity , association , wetAssociation , foliage );
290
+ return Association .of (target , pos , entity , associations . wasLastMatchGolem () && entity . isOnGround (), association , wetAssociation , foliage );
295
291
}
296
292
}
0 commit comments