Skip to content

Commit

Permalink
fix fabric mixins
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed May 12, 2024
1 parent 43703da commit 542222f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Coerce;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

Expand All @@ -21,14 +22,14 @@ abstract class MinecraftMixin {
@Final
private ReloadableResourceManager resourceManager;

@Inject(method = "method_24040", at = @At("HEAD"))
private void flywheel$onEndInitialResourceReload(Optional<Throwable> error, CallbackInfo ci) {
@Inject(method = "method_53522", at = @At("HEAD"))
private void flywheel$onEndInitialResourceReload(@Coerce Object gameLoadCookie, Optional<Throwable> error, CallbackInfo ci) {
EndClientResourceReloadCallback.EVENT.invoker()
.onEndClientResourceReload((Minecraft) (Object) this, resourceManager, true, error);
}

@Inject(method = "method_24228", at = @At("HEAD"))
private void flywheel$onEndManualResourceReload(boolean recovery, CompletableFuture<Void> future,
private void flywheel$onEndManualResourceReload(boolean recovery, @Coerce Object gameLoadCookie, CompletableFuture<Void> future,
Optional<Throwable> error, CallbackInfo ci) {
EndClientResourceReloadCallback.EVENT.invoker()
.onEndClientResourceReload((Minecraft) (Object) this, resourceManager, false, error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ abstract class MinecraftMixin {
}
}

@Inject(method = "clearLevel(Lnet/minecraft/client/gui/screens/Screen;)V", at = @At("HEAD"))
@Inject(method = "clearClientLevel(Lnet/minecraft/client/gui/screens/Screen;)V", at = @At("HEAD"))
private void flywheel$onClearLevel(CallbackInfo ci) {
if (level != null) {
LevelAttached.invalidateLevel(level);
Expand Down

0 comments on commit 542222f

Please sign in to comment.