Skip to content

Commit

Permalink
Merge branch 'AE2' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-159 committed Oct 2, 2022
2 parents 46c850a + fc5a01d commit 6a4ee16
Show file tree
Hide file tree
Showing 92 changed files with 1,578 additions and 40 deletions.
7 changes: 7 additions & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,11 @@ dependencies {
// GregTech Addons
compile(name:"bartworks[1.7.10]-[c9836c6]-0.5.20-dev", ext:"jar")
compile(name:"TecTech-1.7.10-4.10.4-023479da", ext:"jar")

compile("gtmega:ae2-mc1.7.10:rv3-beta.58-gtmega:dev") {
transitive = false
}
compile("curse.maven:cofh-core-69162:2388751") {
transitive = false
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.github.thebrochacho.dws.mixin.mixins.client.appliedenergistics2;

import appeng.client.gui.AEBaseGui;
import com.github.thebrochacho.dws.interfaces.IDWSGui;
import org.spongepowered.asm.mixin.Mixin;

@Mixin(AEBaseGui.class)
public abstract class AEBaseGuiMixin implements IDWSGui {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.github.thebrochacho.dws.mixin.mixins.client.appliedenergistics2;

import appeng.client.gui.implementations.GuiCellWorkbench;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(GuiCellWorkbench.class)
public abstract class GuiCellWorkbenchMixin {
@ModifyConstant(method = "drawBG",
constant = { @Constant(intValue = 177),
@Constant(intValue = 178) },
remap = false,
require = 23)
private int modifyGuiXSize(int constant) {
return constant + 162;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.github.thebrochacho.dws.mixin.mixins.client.appliedenergistics2;

import appeng.client.gui.AEBaseGui;
import appeng.client.gui.implementations.GuiChest;
import appeng.client.gui.widgets.GuiTabButton;
import net.minecraft.inventory.Container;
import org.spongepowered.asm.lib.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(GuiChest.class)
public abstract class GuiChestMixin extends AEBaseGui {
@Shadow(remap = false)
private GuiTabButton priority;

public GuiChestMixin(Container container) {
super(container);
}

@Redirect(method = "initGui",
at = @At(value = "FIELD",
target = "Lappeng/client/gui/implementations/GuiChest;priority:Lappeng/client/gui/widgets/GuiTabButton;",
opcode = Opcodes.PUTFIELD),
require = 1)
private void redirectPriorityButtonInstantiation(GuiChest instance, GuiTabButton value) {
value.xPosition = this.guiLeft + this.xSize - 22;
this.priority = value;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.github.thebrochacho.dws.mixin.mixins.client.appliedenergistics2;

import appeng.client.gui.implementations.GuiCondenser;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(GuiCondenser.class)
public abstract class GuiCondenserMixin {
@ModifyConstant(method = "initGui",
constant = { @Constant(intValue = 120),
@Constant(intValue = 128) },
require = 1)
private int modifyButtonXOffset(int constant) {
return constant + 81;
}

@ModifyConstant(method = "initGui",
constant = @Constant(intValue = 178),
require = 1)
private int modifyProgressBarUVXOffset(int constant) {
return 340;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.github.thebrochacho.dws.mixin.mixins.client.appliedenergistics2;

import appeng.client.gui.AEBaseGui;
import appeng.client.gui.implementations.GuiCraftAmount;
import appeng.client.gui.widgets.GuiNumberBox;
import appeng.client.gui.widgets.GuiTabButton;
import net.minecraft.inventory.Container;
import org.spongepowered.asm.lib.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArgs;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;

@Mixin(GuiCraftAmount.class)
public abstract class GuiCraftAmountMixin extends AEBaseGui {
@Shadow(remap = false)
private GuiTabButton originalGuiBtn;

@Shadow(remap = false)
private GuiNumberBox amountToCraft;

public GuiCraftAmountMixin(Container container) {
super(container);
}

@ModifyArgs(method = "initGui",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/gui/GuiButton;<init>(IIIIILjava/lang/String;)V"),
require = 9)
private void modifyGuiButtonArgs(Args args) {
args.set(1, (int) args.get(1) + 78);
args.set(2, (int) args.get(2) - 8);
}

@Redirect(method = "initGui",
at = @At(value = "FIELD",
target = "Lappeng/client/gui/implementations/GuiCraftAmount;originalGuiBtn:Lappeng/client/gui/widgets/GuiTabButton;",
opcode = Opcodes.PUTFIELD),
require = 1)
private void redirectOriginalGuiBtnInstantiation(GuiCraftAmount instance, GuiTabButton value) {
value.xPosition = this.guiLeft + this.xSize - 22;
this.originalGuiBtn = value;
}

@Redirect(method = "initGui",
at = @At(value = "FIELD",
target = "Lappeng/client/gui/implementations/GuiCraftAmount;amountToCraft:Lappeng/client/gui/widgets/GuiNumberBox;",
opcode = Opcodes.PUTFIELD),
require = 1)
private void redirectNewTextboxPosition(GuiCraftAmount instance, GuiNumberBox value) {
value.xPosition += 78;
value.yPosition -= 8;
this.amountToCraft = value;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.github.thebrochacho.dws.mixin.mixins.client.appliedenergistics2;

import appeng.client.gui.implementations.GuiCraftingTerm;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(GuiCraftingTerm.class)
public abstract class GuiCraftingTermMixin {
@ModifyConstant(method = "initGui",
constant = @Constant(intValue = 92),
require = 1)
private int modifyButtonXOffset(int constant) {
return constant + 81;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.github.thebrochacho.dws.mixin.mixins.client.appliedenergistics2;

import appeng.client.gui.AEBaseGui;
import appeng.client.gui.implementations.GuiDrive;
import appeng.client.gui.widgets.GuiTabButton;
import net.minecraft.inventory.Container;
import org.spongepowered.asm.lib.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(GuiDrive.class)
public abstract class GuiDriveMixin extends AEBaseGui {
@Shadow(remap = false)
private GuiTabButton priority;

public GuiDriveMixin(Container container) {
super(container);
}

@Redirect(method = "initGui",
at = @At(value = "FIELD",
target = "Lappeng/client/gui/implementations/GuiDrive;priority:Lappeng/client/gui/widgets/GuiTabButton;",
opcode = Opcodes.PUTFIELD),
require = 1)
private void redirectPriorityLocation(GuiDrive instance, GuiTabButton value) {
value.xPosition = this.guiLeft + this.xSize - 22;
this.priority = value;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.github.thebrochacho.dws.mixin.mixins.client.appliedenergistics2;

import appeng.api.implementations.IUpgradeableHost;
import appeng.client.gui.implementations.GuiFormationPlane;
import appeng.client.gui.implementations.GuiUpgradeable;
import appeng.client.gui.widgets.GuiTabButton;
import net.minecraft.entity.player.InventoryPlayer;
import org.spongepowered.asm.lib.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(GuiFormationPlane.class)
public abstract class GuiFormationPlaneMixin extends GuiUpgradeable {

@Shadow(remap = false)
private GuiTabButton priority;

public GuiFormationPlaneMixin(InventoryPlayer inventoryPlayer, IUpgradeableHost te) {
super(inventoryPlayer, te);
}

@Redirect(method = "addButtons",
at = @At(value = "FIELD",
target = "Lappeng/client/gui/implementations/GuiFormationPlane;priority:Lappeng/client/gui/widgets/GuiTabButton;",
opcode = Opcodes.PUTFIELD),
remap = false,
require = 1)
private void redirectPriorityLocation(GuiFormationPlane instance, GuiTabButton value) {
value.xPosition = this.guiLeft + this.xSize - 22 - (35 * (this.hasToolbox() ? 2 : 1));
this.priority = value;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.github.thebrochacho.dws.mixin.mixins.client.appliedenergistics2;

import appeng.client.gui.implementations.GuiIOPort;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(GuiIOPort.class)
public abstract class GuiIOPortMixin {
@ModifyConstant(method = "drawBG",
constant = { @Constant(intValue = 66),
@Constant(intValue = 94), },
remap = false,
require = 2)
private int modifyItemHintXOffset(int constant) {
return constant + 81;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.github.thebrochacho.dws.mixin.mixins.client.appliedenergistics2;

import appeng.client.gui.implementations.GuiInscriber;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(GuiInscriber.class)
public abstract class GuiInscriberMixin {
@ModifyConstant(method = { "<init>",
"drawBG" },
constant = { @Constant(intValue = 177),
@Constant(intValue = 178),
@Constant(intValue = 211),
@Constant(intValue = 246) },
remap = false,
require = 7)
private int modifyGuiXSize(int constant) {
return constant + 162;
}

@ModifyConstant(method = "initGui",
constant = @Constant(intValue = 135),
require = 2)
private int modifyProgressBarXOffset(int constant) {
return constant + 81;
}

@ModifyConstant(method = "drawBG",
constant = @Constant(intValue = 135),
remap = false,
require = 1)
private int modifyProgressBarUVXOffset(int constant) {
return constant + 81;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.github.thebrochacho.dws.mixin.mixins.client.appliedenergistics2;

import appeng.api.implementations.IUpgradeableHost;
import appeng.client.gui.implementations.GuiInterface;
import appeng.client.gui.implementations.GuiUpgradeable;
import appeng.client.gui.widgets.GuiTabButton;
import net.minecraft.entity.player.InventoryPlayer;
import org.spongepowered.asm.lib.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(GuiInterface.class)
public abstract class GuiInterfaceMixin extends GuiUpgradeable {
@Shadow(remap = false)
private GuiTabButton priority;

public GuiInterfaceMixin(InventoryPlayer inventoryPlayer, IUpgradeableHost te) {
super(inventoryPlayer, te);
}

@Redirect(method = "addButtons",
at = @At(value = "FIELD",
target = "Lappeng/client/gui/implementations/GuiInterface;priority:Lappeng/client/gui/widgets/GuiTabButton;",
opcode = Opcodes.PUTFIELD),
remap = false,
require = 1)
private void redirectPriorityButtonAssignment(GuiInterface instance, GuiTabButton value) {
value.xPosition = this.guiLeft + this.xSize - 22 - (35 * (this.hasToolbox() ? 2 : 1));
this.priority = value;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.github.thebrochacho.dws.mixin.mixins.client.appliedenergistics2;

import appeng.client.gui.AEBaseGui;
import appeng.client.gui.implementations.GuiInterfaceTerminal;
import net.minecraft.inventory.Container;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(GuiInterfaceTerminal.class)
public abstract class GuiInterfaceTerminalMixin extends AEBaseGui {
public GuiInterfaceTerminalMixin(Container container) {
super(container);
}

@ModifyConstant(method = "<init>",
constant = @Constant(intValue = 195),
remap = false,
require = 1)
private int modifyXSize(int constant) {
return constant + 143;
}

@ModifyConstant(method = "initGui",
constant = @Constant(intValue = 175),
require = 1)
private int modifyScrollbarXOffset(int constant) {
return constant + 81;
}

@ModifyConstant(method = { "drawFG",
"drawBG" },
constant = { @Constant(intValue = 7,
ordinal = 0),
@Constant(intValue = 8,
ordinal = 2),
@Constant(intValue = 10) },
remap = false,
require = 3)
private int modifySlotXOffset(int constant) {
return constant + 81;
}

@ModifyConstant(method = "initGui",
constant = @Constant(intValue = 104),
require = 1)
private int modifySearchBarXOffset(int constant) {
return 128;
}

@ModifyConstant(method = "initGui",
constant = @Constant(intValue = 65),
require = 1)
private int modifySearchBarWidth(int constant) {
return 122;
}
}
Loading

0 comments on commit 6a4ee16

Please sign in to comment.