-
Notifications
You must be signed in to change notification settings - Fork 15
fix(ci): Use Java 11 in CI workflow for ForgeGradle compatibility #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: forge/1.12.2
Are you sure you want to change the base?
Changes from all commits
6d7a2d6
e2f8107
56f1774
e2bbe4b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| package dev.httxrafa.modflared.mixin.client; | ||
|
|
||
| import dev.httxrafa.modflared.Modflared; | ||
| import dev.httxrafa.modflared.interfaces.mixin.IServerData; | ||
| import dev.httxrafa.modflared.tunnel.TunnelStatus; | ||
| import net.minecraft.client.Minecraft; | ||
| import net.minecraft.client.gui.Gui; | ||
| import net.minecraft.client.gui.GuiMultiplayer; | ||
| import net.minecraft.client.gui.ServerListEntryNormal; | ||
| import net.minecraft.client.multiplayer.ServerData; | ||
| import net.minecraft.client.renderer.GlStateManager; | ||
| import net.minecraft.client.resources.I18n; | ||
| import net.minecraft.util.ResourceLocation; | ||
| import org.spongepowered.asm.mixin.Final; | ||
| import org.spongepowered.asm.mixin.Mixin; | ||
| import org.spongepowered.asm.mixin.Shadow; | ||
| import org.spongepowered.asm.mixin.Unique; | ||
| import org.spongepowered.asm.mixin.injection.At; | ||
| import org.spongepowered.asm.mixin.injection.Inject; | ||
| import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
|
||
| @Mixin(ServerListEntryNormal.class) | ||
| public abstract class ServerListEntryNormalMixin { | ||
|
|
||
| @Shadow | ||
| @Final | ||
| private GuiMultiplayer owner; | ||
|
|
||
| @Shadow | ||
| @Final | ||
| private ServerData server; | ||
|
|
||
| @Unique | ||
| private static final ResourceLocation MODFLARED_INDICATOR_TEXTURE = new ResourceLocation( | ||
| Modflared.MOD_ID, | ||
| "textures/gui/sprites/icon/indicator.png" | ||
| ); | ||
|
|
||
| @Unique | ||
| private static final int MODFLARED_INDICATOR_SIZE = 10; | ||
|
|
||
| @Unique | ||
| private static final int MODFLARED_INDICATOR_RIGHT_OFFSET = 28; | ||
|
|
||
| @Unique | ||
| private static final String MODFLARED_INDICATOR_TOOLTIP_KEY = "gui.multiplayer.tunnel.status.0"; | ||
|
|
||
| @Unique | ||
| private static final String MODFLARED_INDICATOR_TOOLTIP_FALLBACK = "Modflared in use"; | ||
|
|
||
| @Inject(method = "drawEntry", at = @At("TAIL")) | ||
| private void modflared$drawTunnelIndicator(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected, float partialTicks, CallbackInfo callbackInfo) { | ||
| TunnelStatus tunnelStatus = ((IServerData) this.server).getTunnelStatus(); | ||
| if (tunnelStatus == null || tunnelStatus.getState() != TunnelStatus.State.USE) { | ||
| return; | ||
| } | ||
|
|
||
| int indicatorX = x + listWidth - MODFLARED_INDICATOR_RIGHT_OFFSET; | ||
| int indicatorY = y + 11; | ||
|
|
||
| GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); | ||
| Minecraft.getMinecraft().getTextureManager().bindTexture(MODFLARED_INDICATOR_TEXTURE); | ||
| Gui.drawModalRectWithCustomSizedTexture( | ||
| indicatorX, | ||
| indicatorY, | ||
| 0.0F, | ||
| 0.0F, | ||
| MODFLARED_INDICATOR_SIZE, | ||
| MODFLARED_INDICATOR_SIZE, | ||
| MODFLARED_INDICATOR_SIZE, | ||
| MODFLARED_INDICATOR_SIZE | ||
| ); | ||
|
|
||
| if (mouseX >= indicatorX && mouseX <= indicatorX + MODFLARED_INDICATOR_SIZE && mouseY >= indicatorY && mouseY <= indicatorY + MODFLARED_INDICATOR_SIZE) { | ||
| this.owner.setHoveringText(modflared$translate(MODFLARED_INDICATOR_TOOLTIP_KEY, MODFLARED_INDICATOR_TOOLTIP_FALLBACK)); | ||
| } | ||
| } | ||
|
|
||
| @Unique | ||
| private static String modflared$translate(String key, String fallback) { | ||
| String translated = I18n.format(key); | ||
| if (translated == null || translated.equals(key)) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| return fallback; | ||
| } | ||
| return translated; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| "client.GuiConnectingMixin", | ||
| "client.GuiConnectingThreadMixin", | ||
| "client.ServerDataMixin", | ||
| "client.ServerListEntryNormalMixin", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This mixin targets |
||
| "client.ServerPingerMixin" | ||
| ], | ||
| "client": [], | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version has been updated to
1.12.2-1here, but theModflared.javafile (line 25) still contains the old version string1.12.2-legacy.1. Since the@Modannotation inModflared.javarelies on that constant, the mod will still report the old version to Forge. Please ensure both are synchronized.