forked from squeek502/AppleCore
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update deps * Remove unnecessary call to `ObfuscationReflectionHelper.remapFieldNames` * Rework `GuiScreenMixin` * Apply spotless
- Loading branch information
1 parent
6b2dc5e
commit cd8a951
Showing
3 changed files
with
21 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// Add your dependencies here | ||
|
||
dependencies { | ||
compileOnly("com.github.GTNewHorizons:CodeChickenCore:1.3.7:dev") | ||
compileOnly("com.github.GTNewHorizons:Natura:2.7.1:dev") { transitive = false } | ||
compileOnly("com.github.GTNewHorizons:CodeChickenCore:1.3.9:dev") | ||
compileOnly("com.github.GTNewHorizons:Natura:2.7.4:dev") { transitive = false } | ||
compileOnly(deobfCurse("pams-harvestcraft-221857:2270206")) | ||
|
||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.6.34-GTNH:dev") | ||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.6.42-GTNH:dev") | ||
} |
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
35 changes: 16 additions & 19 deletions
35
src/main/java/squeek/applecore/mixins/early/minecraft/GuiScreenMixin.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 |
---|---|---|
@@ -1,37 +1,34 @@ | ||
package squeek.applecore.mixins.early.minecraft; | ||
|
||
import java.util.Iterator; | ||
import java.util.List; | ||
|
||
import net.minecraft.client.gui.FontRenderer; | ||
import net.minecraft.client.gui.GuiScreen; | ||
|
||
import org.spongepowered.asm.lib.Opcodes; | ||
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.Slice; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture; | ||
|
||
import com.llamalad7.mixinextras.sugar.Local; | ||
|
||
import squeek.applecore.client.TooltipOverlayHandler; | ||
|
||
@Mixin(GuiScreen.class) | ||
public class GuiScreenMixin { | ||
|
||
@Inject( | ||
at = @At( | ||
opcode = Opcodes.PUTFIELD, | ||
ordinal = 0, | ||
remap = true, | ||
target = "Lnet/minecraft/client/gui/GuiScreen;zLevel:F", | ||
value = "FIELD"), | ||
method = "drawHoveringText", | ||
at = @At(value = "INVOKE", target = "Ljava/util/List;size()I", shift = At.Shift.BEFORE), | ||
slice = @Slice( | ||
from = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/client/gui/GuiScreen;drawGradientRect(IIIIII)V", | ||
ordinal = 0)), | ||
locals = LocalCapture.CAPTURE_FAILHARD) | ||
private void onDrawHoveringText(List<String> textLines, int x, int y, FontRenderer font, CallbackInfo ci, int k, | ||
Iterator<String> iterator, int j2, int k2, int i1, int j1, int k1, int l1, int i2) { | ||
TooltipOverlayHandler.toolTipX = j2; | ||
TooltipOverlayHandler.toolTipY = k2; | ||
TooltipOverlayHandler.toolTipW = k; | ||
TooltipOverlayHandler.toolTipH = i1; | ||
remap = false) | ||
private void onDrawHoveringText(CallbackInfo ci, @Local(ordinal = 3) int x, @Local(ordinal = 4) int y, | ||
@Local(ordinal = 2) int w, @Local(ordinal = 5) int h) { | ||
TooltipOverlayHandler.toolTipX = x; | ||
TooltipOverlayHandler.toolTipY = y; | ||
TooltipOverlayHandler.toolTipW = w; | ||
TooltipOverlayHandler.toolTipH = h; | ||
} | ||
} |