Skip to content

Commit c5f73c5

Browse files
committed
Merge 1.18 into 1.19.2
2 parents f469d59 + 022367c commit c5f73c5

File tree

2 files changed

+19
-1
lines changed
  • common/src/main/java/org/embeddedt/modernfix/common/mixin/feature/measure_time
  • forge/src/main/java/org/embeddedt/modernfix/forge/mixin/perf/resource_key_equality

2 files changed

+19
-1
lines changed

common/src/main/java/org/embeddedt/modernfix/common/mixin/feature/measure_time/MinecraftMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class MinecraftMixin {
2020

2121
@Inject(method = "tick", at = @At("HEAD"))
2222
private void onClientTick(CallbackInfo ci) {
23-
if(this.overlay == null) {
23+
if(this.overlay == null && ModernFixClient.INSTANCE != null) {
2424
ModernFixClient.INSTANCE.onGameLaunchFinish();
2525
}
2626
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package org.embeddedt.modernfix.forge.mixin.perf.resource_key_equality;
2+
3+
import net.minecraft.resources.ResourceKey;
4+
import org.spongepowered.asm.mixin.Mixin;
5+
import org.spongepowered.asm.mixin.Overwrite;
6+
7+
@Mixin(ResourceKey.class)
8+
public class ResourceKeyMixin {
9+
/**
10+
* @author embeddedt
11+
* @reason ResourceKeys are interned, so there is no reason to waste time doing any deeper comparison. This override
12+
* is patched in by Forge, it doesn't exist in vanilla
13+
*/
14+
@Overwrite(remap = false)
15+
public boolean equals(Object o) {
16+
return o == this;
17+
}
18+
}

0 commit comments

Comments
 (0)