Skip to content

Commit dfb0c52

Browse files
committed
Merge 1.20 into 1.20.2
2 parents 02fa2be + 8fd8efb commit dfb0c52

File tree

4 files changed

+148
-10
lines changed

4 files changed

+148
-10
lines changed

common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/reduce_blockstate_cache_rebuilds/BlockStateBaseMixin.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ protected BlockStateBaseMixin(Block object, ImmutableMap<Property<?>, Comparable
3030
@Shadow private BlockBehaviour.BlockStateBase.Cache cache;
3131
@Shadow private FluidState fluidState;
3232
@Shadow private boolean isRandomlyTicking;
33+
@Shadow @Deprecated private boolean legacySolid;
3334

3435
@Shadow protected abstract BlockState asState();
3536

@@ -114,4 +115,15 @@ private boolean genCacheBeforeGettingTicking(BlockBehaviour.BlockStateBase base)
114115
return this.owner.isRandomlyTicking(this.asState());
115116
return this.isRandomlyTicking;
116117
}
118+
119+
@Redirect(method = "*", at = @At(
120+
value = "FIELD",
121+
opcode = Opcodes.GETFIELD,
122+
target = "Lnet/minecraft/world/level/block/state/BlockBehaviour$BlockStateBase;legacySolid:Z",
123+
ordinal = 0
124+
))
125+
private boolean genCacheBeforeCheckingSolid(BlockBehaviour.BlockStateBase base) {
126+
mfix$generateCache();
127+
return this.legacySolid;
128+
}
117129
}

0 commit comments

Comments
 (0)