Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
baka-gourd committed Apr 10, 2021
1 parent 97435ae commit bc55414
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.github.tartaricacid.i18nupdatemod.mixin;

import java.io.IOException;
import java.io.InputStream;

import com.github.tartaricacid.i18nupdatemod.I18nUpdateMod;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import vazkii.patchouli.client.book.BookContents;



@Mixin(BookContents.class)
public class MixinBookContents {
@Inject(at = @At("HEAD"), method = "loadJson", cancellable = true, remap = false)
private void loadJson(ResourceLocation resloc, ResourceLocation fallback, CallbackInfoReturnable<InputStream> callback) {
I18nUpdateMod.LOGGER.debug("loading json from {}.",resloc);
try {
callback.setReturnValue(Minecraft.getInstance().getResourceManager().getResource(resloc).getInputStream());
} catch (IOException e) {
//no-op
}
}
}
Empty file.

0 comments on commit bc55414

Please sign in to comment.