-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
5 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
...main/java/com/github/matt159/dws/mixin/mixins/client/thaumcraft/GuiThaumatoriumMixin.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,78 @@ | ||
package com.github.matt159.dws.mixin.mixins.client.thaumcraft; | ||
|
||
import com.github.matt159.dws.interfaces.IDWSGui; | ||
import com.github.matt159.dws.util.Constants; | ||
import lombok.val; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.Constant; | ||
import org.spongepowered.asm.mixin.injection.ModifyConstant; | ||
import thaumcraft.client.gui.GuiThaumatorium; | ||
|
||
import net.minecraft.client.gui.inventory.GuiContainer; | ||
import net.minecraft.inventory.Container; | ||
|
||
@Mixin(GuiThaumatorium.class) | ||
public abstract class GuiThaumatoriumMixin extends GuiContainer implements IDWSGui { | ||
public GuiThaumatoriumMixin(Container container) { | ||
super(container); | ||
} | ||
|
||
@ModifyConstant(method = "drawGuiContainerBackgroundLayer", | ||
constant = { @Constant(intValue = 176), | ||
@Constant(intValue = 192), | ||
@Constant(intValue = 184), | ||
@Constant(intValue = 200) }, | ||
require = 10) | ||
private int modifyTextureUVXOffset2(int constant) { | ||
val offset = constant - 176; | ||
|
||
return offset + Constants.GENERAL_DWS_GUI_WIDTH; | ||
} | ||
|
||
@ModifyConstant(method = "drawAspects", | ||
constant = @Constant(intValue = 176), | ||
remap = false, | ||
require = 2) | ||
private int modifyTextureUVXOffset(int constant) { | ||
return Constants.GENERAL_DWS_GUI_WIDTH; | ||
} | ||
|
||
@ModifyConstant(method = "drawGuiContainerBackgroundLayer", | ||
constant = { @Constant(intValue = 32), | ||
@Constant(intValue = 88), | ||
@Constant(intValue = 104), | ||
@Constant(intValue = 128), | ||
@Constant(intValue = 136) }, | ||
require = 15) | ||
private int modifyTextureDrawXOffsets(int constant) { | ||
return constant + Constants.GENERAL_X_OFFSET; | ||
} | ||
|
||
@ModifyConstant(method = "drawAspects", | ||
constant = { @Constant(intValue = 40, ordinal = 0), | ||
@Constant(intValue = 41), | ||
@Constant(intValue = 42) }, | ||
remap = false, | ||
require = 3) | ||
private int modifyAspectXOffset(int constant) { | ||
return constant + Constants.GENERAL_X_OFFSET; | ||
} | ||
|
||
@ModifyConstant(method = "drawOutput", | ||
constant = { @Constant(intValue = 112) }, | ||
remap = false, | ||
require = 3) | ||
private int modifyOutputXOffset(int constant) { | ||
return constant + Constants.GENERAL_X_OFFSET; | ||
} | ||
|
||
@ModifyConstant(method = "mouseClicked", | ||
constant = { @Constant(intValue = 112), | ||
@Constant(intValue = 128), | ||
@Constant(intValue = 32), | ||
@Constant(intValue = 136) }, | ||
require = 5) | ||
private int modifyMouseClickRegionXOffset(int constant) { | ||
return constant + Constants.GENERAL_X_OFFSET; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...ava/com/github/matt159/dws/mixin/mixins/common/thaumcraft/ContainerThaumatoriumMixin.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,35 @@ | ||
package com.github.matt159.dws.mixin.mixins.common.thaumcraft; | ||
|
||
import com.github.matt159.dws.interfaces.IDWSContainer; | ||
import com.github.matt159.dws.util.Constants; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.Constant; | ||
import org.spongepowered.asm.mixin.injection.ModifyConstant; | ||
import thaumcraft.common.container.ContainerThaumatorium; | ||
|
||
import net.minecraft.inventory.Container; | ||
|
||
@Mixin(ContainerThaumatorium.class) | ||
public abstract class ContainerThaumatoriumMixin extends Container implements IDWSContainer { | ||
@ModifyConstant(method = "<init>", | ||
constant = @Constant(intValue = 9), | ||
require = 4) | ||
private int modifyInventorySize(int constant) { | ||
return 18; | ||
} | ||
|
||
@ModifyConstant(method = "<init>", | ||
constant = @Constant(intValue = 48), | ||
require = 1) | ||
private int modifyInputSlotXOffset(int constant) { | ||
return constant + Constants.GENERAL_X_OFFSET; | ||
} | ||
|
||
@ModifyConstant(method = "transferStackInSlot", | ||
constant = { @Constant(intValue = 28), | ||
@Constant(intValue = 37) }, | ||
require = 7) | ||
private int modifyInventoryBounds(int constant) { | ||
return constant + 27; | ||
} | ||
} |
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
Binary file added
BIN
+19.1 KB
src/main/resources/assets/dws/textures/thaumcraft/gui/gui_thaumatorium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.