Skip to content

Commit ccc21d7

Browse files
committed
Merge 1.20 into 1.20.2
2 parents bfdd1f9 + 46127b5 commit ccc21d7

File tree

1 file changed

+3
-1
lines changed
  • common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/reduce_blockstate_cache_rebuilds

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import net.minecraft.world.level.block.Blocks;
44
import net.minecraft.world.level.block.state.BlockState;
55
import org.embeddedt.modernfix.blockstate.BlockStateCacheHandler;
6+
import org.embeddedt.modernfix.duck.IBlockState;
67
import org.spongepowered.asm.mixin.Mixin;
78
import org.spongepowered.asm.mixin.injection.At;
89
import org.spongepowered.asm.mixin.injection.ModifyArg;
@@ -21,6 +22,7 @@ private static Consumer getEmptyConsumer(Consumer original) {
2122
// require = 0 due to Forge removing the BLOCK_STATE_REGISTRY init here
2223
@Redirect(method = "<clinit>", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;initCache()V"), require = 0)
2324
private static void skipCacheInit(BlockState state) {
24-
/* no-op, our dynamic logic handles everything properly (including the 1.19.4+ fluidState, etc. caching) */
25+
// Mark the cache as invalid
26+
((IBlockState)state).clearCache();
2527
}
2628
}

0 commit comments

Comments
 (0)