-
Notifications
You must be signed in to change notification settings - Fork 16
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
5d9fc69
commit 7ca02b6
Showing
6 changed files
with
126 additions
and
11 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
50 changes: 50 additions & 0 deletions
50
src/main/java/com/nomiceu/nomilabs/mixin/ae2/AEBaseGuiMixin.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,50 @@ | ||
package com.nomiceu.nomilabs.mixin.ae2; | ||
|
||
import net.minecraft.client.gui.inventory.GuiContainer; | ||
import net.minecraft.inventory.Container; | ||
import net.minecraft.inventory.Slot; | ||
|
||
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 appeng.client.gui.AEBaseGui; | ||
|
||
/** | ||
* Fixes Mouse Tweaks Interactions in Terminals, for AE2 v0.56.5. | ||
*/ | ||
@Mixin(value = AEBaseGui.class, remap = false) | ||
public abstract class AEBaseGuiMixin extends GuiContainer { | ||
|
||
/** | ||
* Mandatory Ignored Constructor | ||
*/ | ||
public AEBaseGuiMixin(Container inventorySlotsIn) { | ||
super(inventorySlotsIn); | ||
} | ||
|
||
@Inject(method = "MT_isMouseTweaksDisabled", at = @At("HEAD"), cancellable = true) | ||
public void setMouseTweaksEnabled(CallbackInfoReturnable<Boolean> cir) { | ||
cir.setReturnValue(false); | ||
} | ||
|
||
@Inject(method = "MT_isIgnored", at = @At("HEAD"), cancellable = true) | ||
public void setMouseTweaksNotIgnored(Slot slot, CallbackInfoReturnable<Boolean> cir) { | ||
cir.setReturnValue(false); | ||
} | ||
|
||
@Inject(method = "MT_disableRMBDraggingFunctionality", at = @At("HEAD"), cancellable = true) | ||
public void newRMBDraggingFunctionality(CallbackInfoReturnable<Boolean> cir) { | ||
if (dragSplitting && dragSplittingButton == 1) { | ||
dragSplitting = false; | ||
if (getSlotUnderMouse() != null && | ||
getSlotUnderMouse().isItemValid(mc.player.inventory.getItemStack())) | ||
ignoreMouseUp = true; | ||
|
||
cir.setReturnValue(true); | ||
} | ||
|
||
cir.setReturnValue(false); | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
src/main/java/com/nomiceu/nomilabs/mixin/ae2/InscriberRecipeMixin.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,47 @@ | ||
package com.nomiceu.nomilabs.mixin.ae2; | ||
|
||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
import net.minecraft.item.ItemStack; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Mutable; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import appeng.api.features.InscriberProcessType; | ||
import appeng.core.features.registries.inscriber.InscriberRecipe; | ||
|
||
/** | ||
* Fixes Inscriber Recipes, In GroovyScript, for AE2 v0.56.5. | ||
*/ | ||
@Mixin(value = InscriberRecipe.class, remap = false) | ||
public class InscriberRecipeMixin { | ||
|
||
@Mutable | ||
@Shadow | ||
@Final | ||
@Nonnull | ||
private List<ItemStack> maybeTop; | ||
|
||
@Mutable | ||
@Shadow | ||
@Final | ||
@Nonnull | ||
private List<ItemStack> maybeBot; | ||
|
||
@Inject(method = "<init>", at = @At("RETURN")) | ||
public void setMaybeTopBottomProperly(Collection<ItemStack> inputs, ItemStack output, @Nullable List<ItemStack> top, | ||
@Nullable List<ItemStack> bot, InscriberProcessType type, CallbackInfo ci) { | ||
maybeTop = top == null || top.isEmpty() ? Collections.emptyList() : top; | ||
maybeBot = bot == null || bot.isEmpty() ? Collections.emptyList() : bot; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/resources/mixins.nomilabs.appliedenergistics2.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,14 @@ | ||
{ | ||
"package": "com.nomiceu.nomilabs.mixin.ae2", | ||
"refmap": "mixins.nomilabs.refmap.json", | ||
"target": "@env(DEFAULT)", | ||
"minVersion": "0.8", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": [ | ||
"InscriberRecipeMixin" | ||
], | ||
"client": [ | ||
"AEBaseGuiMixin" | ||
], | ||
"server": [] | ||
} |