-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
transfer gt++ asm fix for COFH's OreDictionaryArbiter to mixins
- Loading branch information
1 parent
aad62c6
commit 610820f
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
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
22 changes: 22 additions & 0 deletions
22
src/main/java/com/mitchej123/hodgepodge/mixins/early/cofhcore/MixinOreDictionaryArbiter.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,22 @@ | ||
package com.mitchej123.hodgepodge.mixins.early.cofhcore; | ||
|
||
import net.minecraft.item.ItemStack; | ||
|
||
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.CallbackInfo; | ||
|
||
import cofh.core.util.oredict.OreDictionaryArbiter; | ||
|
||
@Mixin(OreDictionaryArbiter.class) | ||
public class MixinOreDictionaryArbiter { | ||
|
||
@Inject(method = "registerOreDictionaryEntry", at = @At("HEAD"), cancellable = true, remap = false) | ||
private static void hodgepodge$fixNPE(ItemStack stack, String s, CallbackInfo ci) { | ||
if (stack == null) { | ||
ci.cancel(); | ||
} | ||
} | ||
|
||
} |