-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #616 from WaitingIdly/modular-magic-ingredient
Fix Null Ingredient for Modular Magic
- Loading branch information
Showing
12 changed files
with
118 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
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
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
24 changes: 24 additions & 0 deletions
24
...cgaming/universaltweaks/mods/modularmagic/nullingredient/mixin/UTAspectRendererMixin.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,24 @@ | ||
package mod.acgaming.universaltweaks.mods.modularmagic.nullingredient.mixin; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
import net.minecraft.client.Minecraft; | ||
|
||
import fr.frinn.modularmagic.common.integration.jei.render.AspectRenderer; | ||
import mod.acgaming.universaltweaks.config.UTConfigMods; | ||
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 thaumcraft.api.aspects.AspectList; | ||
|
||
// Courtesy of WaitingIdly | ||
@Mixin(value = AspectRenderer.class, remap = false) | ||
public abstract class UTAspectRendererMixin | ||
{ | ||
@Inject(method = "render(Lnet/minecraft/client/Minecraft;IILthaumcraft/api/aspects/AspectList;)V", at = @At("HEAD"), cancellable = true) | ||
private void utCheckIngredientNotNull(Minecraft minecraft, int xPosition, int yPosition, @Nullable AspectList ingredient, CallbackInfo ci) | ||
{ | ||
if (UTConfigMods.MODULAR_MAGIC.utEnsureIngredientNotNull && ingredient == null) ci.cancel(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
.../acgaming/universaltweaks/mods/modularmagic/nullingredient/mixin/UTAuraRendererMixin.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 mod.acgaming.universaltweaks.mods.modularmagic.nullingredient.mixin; | ||
|
||
import net.minecraft.client.Minecraft; | ||
|
||
import fr.frinn.modularmagic.common.integration.jei.ingredient.Aura; | ||
import fr.frinn.modularmagic.common.integration.jei.render.AuraRenderer; | ||
import mod.acgaming.universaltweaks.config.UTConfigMods; | ||
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; | ||
|
||
// Courtesy of WaitingIdly | ||
@Mixin(value = AuraRenderer.class, remap = false) | ||
public abstract class UTAuraRendererMixin | ||
{ | ||
@Inject(method = "render(Lnet/minecraft/client/Minecraft;IILfr/frinn/modularmagic/common/integration/jei/ingredient/Aura;)V", at = @At("HEAD"), cancellable = true) | ||
private void utCheckIngredientNotNull(Minecraft minecraft, int xPosition, int yPosition, Aura ingredient, CallbackInfo ci) | ||
{ | ||
if (UTConfigMods.MODULAR_MAGIC.utEnsureIngredientNotNull && ingredient == null) ci.cancel(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
.../universaltweaks/mods/modularmagic/nullingredient/mixin/UTConstellationRendererMixin.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 mod.acgaming.universaltweaks.mods.modularmagic.nullingredient.mixin; | ||
|
||
import net.minecraft.client.Minecraft; | ||
|
||
import fr.frinn.modularmagic.common.integration.jei.ingredient.Constellation; | ||
import fr.frinn.modularmagic.common.integration.jei.render.ConstellationRenderer; | ||
import mod.acgaming.universaltweaks.config.UTConfigMods; | ||
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; | ||
|
||
// Courtesy of WaitingIdly | ||
@Mixin(value = ConstellationRenderer.class, remap = false) | ||
public abstract class UTConstellationRendererMixin | ||
{ | ||
@Inject(method = "render(Lnet/minecraft/client/Minecraft;IILfr/frinn/modularmagic/common/integration/jei/ingredient/Constellation;)V", at = @At("HEAD"), cancellable = true) | ||
private void utCheckIngredientNotNull(Minecraft minecraft, int xPosition, int yPosition, Constellation ingredient, CallbackInfo ci) | ||
{ | ||
if (UTConfigMods.MODULAR_MAGIC.utEnsureIngredientNotNull && ingredient == null) ci.cancel(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...ming/universaltweaks/mods/modularmagic/nullingredient/mixin/UTDemonWillRendererMixin.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,23 @@ | ||
package mod.acgaming.universaltweaks.mods.modularmagic.nullingredient.mixin; | ||
|
||
import net.minecraft.client.Minecraft; | ||
|
||
import fr.frinn.modularmagic.common.integration.jei.ingredient.DemonWill; | ||
import fr.frinn.modularmagic.common.integration.jei.render.DemonWillRenderer; | ||
import mod.acgaming.universaltweaks.config.UTConfigMods; | ||
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; | ||
|
||
// Courtesy of WaitingIdly | ||
@Mixin(value = DemonWillRenderer.class, remap = false) | ||
public abstract class UTDemonWillRendererMixin | ||
{ | ||
// This method actually has a null check, the issue is that it makes changes to the GLState prior to that null check. | ||
@Inject(method = "render(Lnet/minecraft/client/Minecraft;IILfr/frinn/modularmagic/common/integration/jei/ingredient/DemonWill;)V", at = @At("HEAD"), cancellable = true) | ||
private void utCheckIngredientNotNull(Minecraft minecraft, int xPosition, int yPosition, DemonWill ingredient, CallbackInfo ci) | ||
{ | ||
if (UTConfigMods.MODULAR_MAGIC.utEnsureIngredientNotNull && ingredient == null) ci.cancel(); | ||
} | ||
} |
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
7 changes: 7 additions & 0 deletions
7
src/main/resources/mixins.mods.modularmagic.nullingredient.json
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,7 @@ | ||
{ | ||
"package": "mod.acgaming.universaltweaks.mods.modularmagic.nullingredient.mixin", | ||
"refmap": "universaltweaks.refmap.json", | ||
"minVersion": "0.8", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": ["UTAspectRendererMixin", "UTAuraRendererMixin", "UTConstellationRendererMixin", "UTDemonWillRendererMixin"] | ||
} |