Skip to content

Commit f633d9b

Browse files
committed
Merge remote-tracking branch 'origin/1.18' into 1.19.2
2 parents 8ee9859 + 4fa0602 commit f633d9b

File tree

1 file changed

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

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
import org.embeddedt.modernfix.blockstate.BlockStateCacheHandler;
55
import org.spongepowered.asm.mixin.Mixin;
66
import org.spongepowered.asm.mixin.injection.At;
7-
import org.spongepowered.asm.mixin.injection.Inject;
8-
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
7+
import org.spongepowered.asm.mixin.injection.ModifyArg;
98

10-
@Mixin(Blocks.class)
9+
import java.util.function.Consumer;
10+
11+
@Mixin(value = Blocks.class, priority = 1100)
1112
public class BlocksMixin {
12-
@Inject(method = "rebuildCache", at = @At("HEAD"), cancellable = true)
13-
private static void rebuildParallel(CallbackInfo ci) {
14-
ci.cancel();
13+
@ModifyArg(method = "rebuildCache", at = @At(value = "INVOKE", target = "Lnet/minecraft/core/IdMapper;forEach(Ljava/util/function/Consumer;)V"), index = 0)
14+
private static Consumer getEmptyConsumer(Consumer original) {
1515
BlockStateCacheHandler.rebuildParallel(true);
16+
return o -> {};
1617
}
1718
}

0 commit comments

Comments
 (0)