Skip to content

Commit

Permalink
should have copied back in from the Fabric version
Browse files Browse the repository at this point in the history
  • Loading branch information
yurisuika committed Jul 7, 2023
1 parent f84c9ba commit 1f25135
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/main/java/dev/yurisuika/raised/mixin/mods/CreateMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import com.simibubi.create.content.schematics.client.SchematicHotbarSlotOverlay;
import com.simibubi.create.content.schematics.client.ToolSelectionScreen;
import dev.yurisuika.raised.Raised;
import net.minecraft.client.util.Window;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import org.spongepowered.asm.mixin.injection.*;

public class CreateMixin {

Expand All @@ -18,7 +18,7 @@ public class CreateMixin {
public static class RemainingAirOverlayMixin {

@ModifyVariable(method = "render", at = @At("HEAD"), ordinal = 1, argsOnly = true)
private int modifyRender(int value) {
private static int modifyRender(int value) {
return value - Raised.getHud();
}

Expand All @@ -28,9 +28,9 @@ private int modifyRender(int value) {
@Mixin(SchematicHotbarSlotOverlay.class)
public static class SchematicHotbarSlotOverlayMixin {

@ModifyVariable(method = "renderOn", at = @At("STORE"), ordinal = 2)
private int modifyRenderOn(int value) {
return value - Raised.getHud();
@Redirect(method = "renderOn", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/Window;getScaledHeight()I"))
private int redirectRenderOn(Window instance) {
return instance.getScaledHeight() - Raised.getHud();
}

}
Expand All @@ -39,9 +39,9 @@ private int modifyRenderOn(int value) {
@Mixin(ToolboxHandlerClient.class)
public static class ToolboxHandlerClientMixin {

@ModifyVariable(method = "renderOverlay", at = @At("HEAD"), ordinal = 1, argsOnly = true)
private static int modifyRenderOverlay(int value) {
return value - Raised.getHud();
@Redirect(method = "renderOverlay", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/Window;getScaledHeight()I"))
private static int redirectRenderOverlay(Window instance) {
return instance.getScaledHeight() - Raised.getHud();
}

}
Expand All @@ -50,9 +50,9 @@ private static int modifyRenderOverlay(int value) {
@Mixin(ToolSelectionScreen.class)
public static class ToolSelectionScreenMixin {

@ModifyVariable(method = "draw", at = @At("STORE"), ordinal = 1)
private int modifyDraw(int value) {
return value - Raised.getHud();
@Redirect(method = "draw", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/Window;getScaledHeight()I"))
private int redirectDraw(Window instance) {
return instance.getScaledHeight() - Raised.getHud();
}

}
Expand All @@ -61,9 +61,9 @@ private int modifyDraw(int value) {
@Mixin(TrainHUD.class)
public static class TrainHUDMixin {

@ModifyVariable(method = "renderOverlay", at = @At("HEAD"), ordinal = 1, argsOnly = true)
private static int modifyRenderOverlay(int value) {
return value - Raised.getHud();
@Redirect(method = "renderOverlay", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/Window;getScaledHeight()I"))
private static int redirectRenderOverlay(Window instance) {
return instance.getScaledHeight() - Raised.getHud();
}

}
Expand Down

0 comments on commit 1f25135

Please sign in to comment.