-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
97435ae
commit bc55414
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/main/java/com/github/tartaricacid/i18nupdatemod/mixin/MixinBookContents.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.