Skip to content

Commit

Permalink
Fix #96
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Nov 5, 2024
1 parent 4a7effc commit ae1bc12
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.github.fabricators_of_create.porting_lib.mixin.common;

import net.minecraft.client.gui.components.AbstractButton;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;

@Mixin(AbstractButton.class)
public interface AbstractButtonAccessor {
@Invoker("getTextureY")
int port_lib$getTextureY();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.fabricators_of_create.porting_lib.util.client;

import io.github.fabricators_of_create.porting_lib.mixin.common.AbstractButtonAccessor;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
Expand Down Expand Up @@ -30,7 +31,7 @@ public ExtendedButton(int xPos, int yPos, int width, int height, Component displ
@Override
public void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) {
Minecraft mc = Minecraft.getInstance();
int k = this.getTextureY();
int k = ((AbstractButtonAccessor) this).port_lib$getTextureY();
ScreenUtils.drawContinuousTexturedBox(guiGraphics, WIDGETS_LOCATION, this.getX(), this.getY(), 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, 0);

Component buttonText = this.getMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ transitive-accessible class net/minecraft/world/level/entity/PersistentEntitySec
transitive-accessible class net/minecraft/world/level/entity/TransientEntitySectionManager$Callback
transitive-accessible class net/minecraft/world/level/lighting/BlockLightSectionStorage$BlockDataLayerStorageMap

transitive-accessible method net/minecraft/client/gui/components/AbstractButton getTextureY ()I
transitive-accessible method net/minecraft/client/gui/screens/MenuScreens getConstructor (Lnet/minecraft/world/inventory/MenuType;)Lnet/minecraft/client/gui/screens/MenuScreens$ScreenConstructor;
transitive-accessible method net/minecraft/commands/synchronization/ArgumentTypeInfos register (Lnet/minecraft/core/Registry;Ljava/lang/String;Ljava/lang/Class;Lnet/minecraft/commands/synchronization/ArgumentTypeInfo;)Lnet/minecraft/commands/synchronization/ArgumentTypeInfo;

Expand Down
3 changes: 2 additions & 1 deletion modules/base/src/main/resources/porting_lib_base.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@
"client.RenderTargetMixin",
"client.SkullBlockRendererMixin",
"client.TextureAtlasMixin",
"client.frex.EntityBlockRenderContextMixin"
"client.frex.EntityBlockRenderContextMixin",
"common.AbstractButtonAccessor"
],
"injectors": {
"defaultRequire": 1,
Expand Down

0 comments on commit ae1bc12

Please sign in to comment.