mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-23 21:49:46 +00:00
1.18.x Omnibus (#8239)
This commit is contained in:
1 parent
4011c3fb07
commit
34291c1fb2
89 files changed
+1014
-1192
No files matched your search
@@ -51,7 +51,6 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class ForgeIngameGui extends Gui
|
||||
{
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -111,7 +110,7 @@ public class ForgeIngameGui extends Gui
|
||||
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
||||
}
|
||||
|
||||
public static final IIngameOverlay VIGNETTE_ELEMENT = OverlayRegistry.registerOverlayTop("Vignette", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay VIGNETTE_ELEMENT = OverlayRegistry.registerOverlayTop("Vignette", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (Minecraft.useFancyGraphics())
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
@@ -119,173 +118,173 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay SPYGLASS_ELEMENT = OverlayRegistry.registerOverlayTop("Spyglass", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay SPYGLASS_ELEMENT = OverlayRegistry.registerOverlayTop("Spyglass", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderSpyglassOverlay();
|
||||
});
|
||||
|
||||
public static final IIngameOverlay HELMET_ELEMENT = OverlayRegistry.registerOverlayTop("Helmet", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay HELMET_ELEMENT = OverlayRegistry.registerOverlayTop("Helmet", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderHelmet(partialTicks, mStack);
|
||||
gui.renderHelmet(partialTick, poseStack);
|
||||
});
|
||||
|
||||
public static final IIngameOverlay FROSTBITE_ELEMENT = OverlayRegistry.registerOverlayTop("Frostbite", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay FROSTBITE_ELEMENT = OverlayRegistry.registerOverlayTop("Frostbite", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderFrostbite(mStack);
|
||||
gui.renderFrostbite(poseStack);
|
||||
});
|
||||
|
||||
public static final IIngameOverlay PORTAL_ELEMENT = OverlayRegistry.registerOverlayTop("Portal", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay PORTAL_ELEMENT = OverlayRegistry.registerOverlayTop("Portal", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
|
||||
if (!gui.minecraft.player.hasEffect(MobEffects.CONFUSION))
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderPortalOverlay(partialTicks);
|
||||
gui.renderPortalOverlay(partialTick);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
public static final IIngameOverlay HOTBAR_ELEMENT = OverlayRegistry.registerOverlayTop("Hotbar", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay HOTBAR_ELEMENT = OverlayRegistry.registerOverlayTop("Hotbar", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui)
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
if (gui.minecraft.gameMode.getPlayerMode() == GameType.SPECTATOR)
|
||||
{
|
||||
gui.spectatorGui.renderHotbar(mStack);
|
||||
gui.spectatorGui.renderHotbar(poseStack);
|
||||
}
|
||||
else
|
||||
{
|
||||
gui.renderHotbar(partialTicks, mStack);
|
||||
gui.renderHotbar(partialTick, poseStack);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay CROSSHAIR_ELEMENT = OverlayRegistry.registerOverlayTop("Crosshair", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay CROSSHAIR_ELEMENT = OverlayRegistry.registerOverlayTop("Crosshair", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui)
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.setBlitOffset(-90);
|
||||
|
||||
gui.renderCrosshair(mStack);
|
||||
gui.renderCrosshair(poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay BOSS_HEALTH_ELEMENT = OverlayRegistry.registerOverlayTop("Boss Health", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay BOSS_HEALTH_ELEMENT = OverlayRegistry.registerOverlayTop("Boss Health", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui)
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.setBlitOffset(-90);
|
||||
|
||||
gui.renderBossHealth(mStack);
|
||||
gui.renderBossHealth(poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay PLAYER_HEALTH_ELEMENT = OverlayRegistry.registerOverlayTop("Player Health", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay PLAYER_HEALTH_ELEMENT = OverlayRegistry.registerOverlayTop("Player Health", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui && gui.shouldDrawSurvivalElements())
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderHealth(screenWidth, screenHeight, mStack);
|
||||
gui.renderHealth(screenWidth, screenHeight, poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay ARMOR_LEVEL_ELEMENT = OverlayRegistry.registerOverlayTop("Armor Level",(gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay ARMOR_LEVEL_ELEMENT = OverlayRegistry.registerOverlayTop("Armor Level",(gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui && gui.shouldDrawSurvivalElements())
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderArmor(mStack, screenWidth, screenHeight);
|
||||
gui.renderArmor(poseStack, screenWidth, screenHeight);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay FOOD_LEVEL_ELEMENT = OverlayRegistry.registerOverlayTop("Food Level", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay FOOD_LEVEL_ELEMENT = OverlayRegistry.registerOverlayTop("Food Level", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
boolean isMounted = gui.minecraft.player.getVehicle() instanceof LivingEntity;
|
||||
if (!isMounted && !gui.minecraft.options.hideGui && gui.shouldDrawSurvivalElements())
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderFood(screenWidth, screenHeight, mStack);
|
||||
gui.renderFood(screenWidth, screenHeight, poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay MOUNT_HEALTH_ELEMENT = OverlayRegistry.registerOverlayTop("Mount Health", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay MOUNT_HEALTH_ELEMENT = OverlayRegistry.registerOverlayTop("Mount Health", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui && gui.shouldDrawSurvivalElements())
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderHealthMount(screenWidth, screenHeight, mStack);
|
||||
gui.renderHealthMount(screenWidth, screenHeight, poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay AIR_LEVEL_ELEMENT = OverlayRegistry.registerOverlayTop("Air Level", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay AIR_LEVEL_ELEMENT = OverlayRegistry.registerOverlayTop("Air Level", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui && gui.shouldDrawSurvivalElements())
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderAir(screenWidth, screenHeight, mStack);
|
||||
gui.renderAir(screenWidth, screenHeight, poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay JUMP_BAR_ELEMENT = OverlayRegistry.registerOverlayTop("Jump Bar", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay JUMP_BAR_ELEMENT = OverlayRegistry.registerOverlayTop("Jump Bar", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (gui.minecraft.player.isRidingJumpable() && !gui.minecraft.options.hideGui)
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderJumpMeter(mStack, screenWidth / 2 - 91);
|
||||
gui.renderJumpMeter(poseStack, screenWidth / 2 - 91);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay EXPERIENCE_BAR_ELEMENT = OverlayRegistry.registerOverlayTop("Experience Bar", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay EXPERIENCE_BAR_ELEMENT = OverlayRegistry.registerOverlayTop("Experience Bar", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.player.isRidingJumpable() && !gui.minecraft.options.hideGui)
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderExperience(screenWidth / 2 - 91, mStack);
|
||||
gui.renderExperience(screenWidth / 2 - 91, poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay ITEM_NAME_ELEMENT = OverlayRegistry.registerOverlayTop("Item Name", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay ITEM_NAME_ELEMENT = OverlayRegistry.registerOverlayTop("Item Name", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui)
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
if (gui.minecraft.options.heldItemTooltips && gui.minecraft.gameMode.getPlayerMode() != GameType.SPECTATOR) {
|
||||
gui.renderSelectedItemName(mStack);
|
||||
gui.renderSelectedItemName(poseStack);
|
||||
} else if (gui.minecraft.player.isSpectator()) {
|
||||
gui.spectatorGui.renderTooltip(mStack);
|
||||
gui.spectatorGui.renderTooltip(poseStack);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay SLEEP_FADE_ELEMENT = OverlayRegistry.registerOverlayTop("Sleep Fade", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
gui.renderSleepFade(screenWidth, screenHeight, mStack);
|
||||
public static final IIngameOverlay SLEEP_FADE_ELEMENT = OverlayRegistry.registerOverlayTop("Sleep Fade", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
gui.renderSleepFade(screenWidth, screenHeight, poseStack);
|
||||
});
|
||||
|
||||
public static final IIngameOverlay HUD_TEXT_ELEMENT = OverlayRegistry.registerOverlayTop("Text Columns", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
gui.renderHUDText(screenWidth, screenHeight, mStack);
|
||||
public static final IIngameOverlay HUD_TEXT_ELEMENT = OverlayRegistry.registerOverlayTop("Text Columns", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
gui.renderHUDText(screenWidth, screenHeight, poseStack);
|
||||
});
|
||||
|
||||
public static final IIngameOverlay FPS_GRAPH_ELEMENT = OverlayRegistry.registerOverlayTop("FPS Graph", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
gui.renderFPSGraph(mStack);
|
||||
public static final IIngameOverlay FPS_GRAPH_ELEMENT = OverlayRegistry.registerOverlayTop("FPS Graph", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
gui.renderFPSGraph(poseStack);
|
||||
});
|
||||
|
||||
public static final IIngameOverlay POTION_ICONS_ELEMENT = OverlayRegistry.registerOverlayTop("Potion Icons", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
gui.renderEffects(mStack);
|
||||
public static final IIngameOverlay POTION_ICONS_ELEMENT = OverlayRegistry.registerOverlayTop("Potion Icons", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
gui.renderEffects(poseStack);
|
||||
});
|
||||
|
||||
public static final IIngameOverlay RECORD_OVERLAY_ELEMENT = OverlayRegistry.registerOverlayTop("Record", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay RECORD_OVERLAY_ELEMENT = OverlayRegistry.registerOverlayTop("Record", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui)
|
||||
{
|
||||
gui.renderRecordOverlay(screenWidth, screenHeight, partialTicks, mStack);
|
||||
gui.renderRecordOverlay(screenWidth, screenHeight, partialTick, poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay SUBTITLES_ELEMENT = OverlayRegistry.registerOverlayTop("Subtitles", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay SUBTITLES_ELEMENT = OverlayRegistry.registerOverlayTop("Subtitles", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui)
|
||||
{
|
||||
gui.renderSubtitles(mStack);
|
||||
gui.renderSubtitles(poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay TITLE_TEXT_ELEMENT = OverlayRegistry.registerOverlayTop("Title Text", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay TITLE_TEXT_ELEMENT = OverlayRegistry.registerOverlayTop("Title Text", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui)
|
||||
{
|
||||
gui.renderTitle(screenWidth, screenHeight, partialTicks, mStack);
|
||||
gui.renderTitle(screenWidth, screenHeight, partialTick, poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay SCOREBOARD_ELEMENT = OverlayRegistry.registerOverlayTop("Scoreboard", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay SCOREBOARD_ELEMENT = OverlayRegistry.registerOverlayTop("Scoreboard", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
|
||||
Scoreboard scoreboard = gui.minecraft.level.getScoreboard();
|
||||
Objective objective = null;
|
||||
@@ -298,24 +297,24 @@ public class ForgeIngameGui extends Gui
|
||||
Objective scoreobjective1 = objective != null ? objective : scoreboard.getDisplayObjective(1);
|
||||
if (scoreobjective1 != null)
|
||||
{
|
||||
gui.displayScoreboardSidebar(mStack, scoreobjective1);
|
||||
gui.displayScoreboardSidebar(poseStack, scoreobjective1);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay CHAT_PANEL_ELEMENT = OverlayRegistry.registerOverlayTop("Chat History", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay CHAT_PANEL_ELEMENT = OverlayRegistry.registerOverlayTop("Chat History", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||
|
||||
gui.renderChat(screenWidth, screenHeight, mStack);
|
||||
gui.renderChat(screenWidth, screenHeight, poseStack);
|
||||
});
|
||||
|
||||
public static final IIngameOverlay PLAYER_LIST_ELEMENT = OverlayRegistry.registerOverlayTop("Player List", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay PLAYER_LIST_ELEMENT = OverlayRegistry.registerOverlayTop("Player List", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||
|
||||
gui.renderPlayerList(screenWidth, screenHeight, mStack);
|
||||
gui.renderPlayerList(screenWidth, screenHeight, poseStack);
|
||||
});
|
||||
|
||||
public ForgeIngameGui(Minecraft mc)
|
||||
@@ -325,16 +324,16 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack pStack, float partialTicks)
|
||||
public void render(PoseStack poseStack, float partialTick)
|
||||
{
|
||||
this.screenWidth = this.minecraft.getWindow().getGuiScaledWidth();
|
||||
this.screenHeight = this.minecraft.getWindow().getGuiScaledHeight();
|
||||
eventParent = new RenderGameOverlayEvent(pStack, partialTicks, this.minecraft.getWindow());
|
||||
eventParent = new RenderGameOverlayEvent(poseStack, partialTick, this.minecraft.getWindow());
|
||||
|
||||
right_height = 39;
|
||||
left_height = 39;
|
||||
|
||||
if (pre(ALL, pStack)) return;
|
||||
if (pre(ALL, poseStack)) return;
|
||||
|
||||
font = minecraft.font;
|
||||
|
||||
@@ -345,9 +344,9 @@ public class ForgeIngameGui extends Gui
|
||||
{
|
||||
if (!entry.isEnabled()) return;
|
||||
IIngameOverlay overlay = entry.getOverlay();
|
||||
if (pre(overlay, pStack)) return;
|
||||
overlay.render(this, pStack, partialTicks, screenWidth, screenHeight);
|
||||
post(overlay, pStack);
|
||||
if (pre(overlay, poseStack)) return;
|
||||
overlay.render(this, poseStack, partialTick, screenWidth, screenHeight);
|
||||
post(overlay, poseStack);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
@@ -357,7 +356,7 @@ public class ForgeIngameGui extends Gui
|
||||
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
post(ALL, pStack);
|
||||
post(ALL, poseStack);
|
||||
}
|
||||
|
||||
public boolean shouldDrawSurvivalElements()
|
||||
@@ -365,17 +364,17 @@ public class ForgeIngameGui extends Gui
|
||||
return minecraft.gameMode.canHurtPlayer() && minecraft.getCameraEntity() instanceof Player;
|
||||
}
|
||||
|
||||
protected void renderSubtitles(PoseStack mStack)
|
||||
protected void renderSubtitles(PoseStack poseStack)
|
||||
{
|
||||
this.subtitleOverlay.render(mStack);
|
||||
this.subtitleOverlay.render(poseStack);
|
||||
}
|
||||
|
||||
protected void renderBossHealth(PoseStack mStack)
|
||||
protected void renderBossHealth(PoseStack poseStack)
|
||||
{
|
||||
bind(GuiComponent.GUI_ICONS_LOCATION);
|
||||
RenderSystem.defaultBlendFunc();
|
||||
minecraft.getProfiler().push("bossHealth");
|
||||
this.bossOverlay.render(mStack);
|
||||
this.bossOverlay.render(poseStack);
|
||||
minecraft.getProfiler().pop();
|
||||
}
|
||||
|
||||
@@ -395,7 +394,7 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
}
|
||||
|
||||
private void renderHelmet(float partialTicks, PoseStack mStack)
|
||||
private void renderHelmet(float partialTick, PoseStack poseStack)
|
||||
{
|
||||
ItemStack itemstack = this.minecraft.player.getInventory().getArmor(3);
|
||||
|
||||
@@ -408,7 +407,7 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
else
|
||||
{
|
||||
RenderProperties.get(item).renderHelmetOverlay(itemstack, minecraft.player, this.screenWidth, this.screenHeight, partialTicks);
|
||||
RenderProperties.get(item).renderHelmetOverlay(itemstack, minecraft.player, this.screenWidth, this.screenHeight, partialTick);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -420,7 +419,7 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
}
|
||||
|
||||
protected void renderArmor(PoseStack mStack, int width, int height)
|
||||
protected void renderArmor(PoseStack poseStack, int width, int height)
|
||||
{
|
||||
minecraft.getProfiler().push("armor");
|
||||
|
||||
@@ -433,15 +432,15 @@ public class ForgeIngameGui extends Gui
|
||||
{
|
||||
if (i < level)
|
||||
{
|
||||
blit(mStack, left, top, 34, 9, 9, 9);
|
||||
blit(poseStack, left, top, 34, 9, 9, 9);
|
||||
}
|
||||
else if (i == level)
|
||||
{
|
||||
blit(mStack, left, top, 25, 9, 9, 9);
|
||||
blit(poseStack, left, top, 25, 9, 9, 9);
|
||||
}
|
||||
else if (i > level)
|
||||
{
|
||||
blit(mStack, left, top, 16, 9, 9, 9);
|
||||
blit(poseStack, left, top, 16, 9, 9, 9);
|
||||
}
|
||||
left += 8;
|
||||
}
|
||||
@@ -452,9 +451,9 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderPortalOverlay(float partialTicks)
|
||||
protected void renderPortalOverlay(float partialTick)
|
||||
{
|
||||
float f1 = Mth.lerp(partialTicks, this.minecraft.player.oPortalTime, this.minecraft.player.portalTime);
|
||||
float f1 = Mth.lerp(partialTick, this.minecraft.player.oPortalTime, this.minecraft.player.portalTime);
|
||||
|
||||
if (f1 > 0.0F)
|
||||
{
|
||||
@@ -462,7 +461,7 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
}
|
||||
|
||||
protected void renderAir(int width, int height, PoseStack mStack)
|
||||
protected void renderAir(int width, int height, PoseStack poseStack)
|
||||
{
|
||||
minecraft.getProfiler().push("air");
|
||||
Player player = (Player)this.minecraft.getCameraEntity();
|
||||
@@ -478,7 +477,7 @@ public class ForgeIngameGui extends Gui
|
||||
|
||||
for (int i = 0; i < full + partial; ++i)
|
||||
{
|
||||
blit(mStack, left - i * 8 - 9, top, (i < full ? 16 : 25), 18, 9, 9);
|
||||
blit(poseStack, left - i * 8 - 9, top, (i < full ? 16 : 25), 18, 9, 9);
|
||||
}
|
||||
right_height += 10;
|
||||
}
|
||||
@@ -544,7 +543,7 @@ public class ForgeIngameGui extends Gui
|
||||
minecraft.getProfiler().pop();
|
||||
}
|
||||
|
||||
public void renderFood(int width, int height, PoseStack mStack)
|
||||
public void renderFood(int width, int height, PoseStack poseStack)
|
||||
{
|
||||
minecraft.getProfiler().push("food");
|
||||
|
||||
@@ -578,18 +577,18 @@ public class ForgeIngameGui extends Gui
|
||||
y = top + (random.nextInt(3) - 1);
|
||||
}
|
||||
|
||||
blit(mStack, x, y, 16 + background * 9, 27, 9, 9);
|
||||
blit(poseStack, x, y, 16 + background * 9, 27, 9, 9);
|
||||
|
||||
if (idx < level)
|
||||
blit(mStack, x, y, icon + 36, 27, 9, 9);
|
||||
blit(poseStack, x, y, icon + 36, 27, 9, 9);
|
||||
else if (idx == level)
|
||||
blit(mStack, x, y, icon + 45, 27, 9, 9);
|
||||
blit(poseStack, x, y, icon + 45, 27, 9, 9);
|
||||
}
|
||||
RenderSystem.disableBlend();
|
||||
minecraft.getProfiler().pop();
|
||||
}
|
||||
|
||||
protected void renderSleepFade(int width, int height, PoseStack mStack)
|
||||
protected void renderSleepFade(int width, int height, PoseStack poseStack)
|
||||
{
|
||||
if (minecraft.player.getSleepTimer() > 0)
|
||||
{
|
||||
@@ -605,14 +604,14 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
|
||||
int color = (int)(220.0F * opacity) << 24 | 1052704;
|
||||
fill(mStack, 0, 0, width, height, color);
|
||||
fill(poseStack, 0, 0, width, height, color);
|
||||
// RenderSystem.enableAlphaTest();
|
||||
RenderSystem.enableDepthTest();
|
||||
minecraft.getProfiler().pop();
|
||||
}
|
||||
}
|
||||
|
||||
protected void renderExperience(int x, PoseStack mStack)
|
||||
protected void renderExperience(int x, PoseStack poseStack)
|
||||
{
|
||||
bind(GUI_ICONS_LOCATION);
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
@@ -620,27 +619,27 @@ public class ForgeIngameGui extends Gui
|
||||
|
||||
if (minecraft.gameMode.hasExperience())
|
||||
{
|
||||
super.renderExperienceBar(mStack, x);
|
||||
super.renderExperienceBar(poseStack, x);
|
||||
}
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderJumpMeter(PoseStack mStack, int x)
|
||||
public void renderJumpMeter(PoseStack poseStack, int x)
|
||||
{
|
||||
bind(GUI_ICONS_LOCATION);
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.disableBlend();
|
||||
|
||||
super.renderJumpMeter(mStack, x);
|
||||
super.renderJumpMeter(poseStack, x);
|
||||
|
||||
RenderSystem.enableBlend();
|
||||
minecraft.getProfiler().pop();
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
protected void renderHUDText(int width, int height, PoseStack mStack)
|
||||
protected void renderHUDText(int width, int height, PoseStack poseStack)
|
||||
{
|
||||
minecraft.getProfiler().push("forgeHudText");
|
||||
RenderSystem.defaultBlendFunc();
|
||||
@@ -660,23 +659,23 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
}
|
||||
|
||||
if (this.minecraft.options.renderDebug && !pre(DEBUG, mStack))
|
||||
if (this.minecraft.options.renderDebug && !pre(DEBUG, poseStack))
|
||||
{
|
||||
debugOverlay.update();
|
||||
listL.addAll(debugOverlay.getLeft());
|
||||
listR.addAll(debugOverlay.getRight());
|
||||
post(DEBUG, mStack);
|
||||
post(DEBUG, poseStack);
|
||||
}
|
||||
|
||||
RenderGameOverlayEvent.Text event = new RenderGameOverlayEvent.Text(mStack, eventParent, listL, listR);
|
||||
RenderGameOverlayEvent.Text event = new RenderGameOverlayEvent.Text(poseStack, eventParent, listL, listR);
|
||||
if (!MinecraftForge.EVENT_BUS.post(event))
|
||||
{
|
||||
int top = 2;
|
||||
for (String msg : listL)
|
||||
{
|
||||
if (msg == null) continue;
|
||||
fill(mStack, 1, top - 1, 2 + font.width(msg) + 1, top + font.lineHeight - 1, -1873784752);
|
||||
font.draw(mStack, msg, 2, top, 14737632);
|
||||
fill(poseStack, 1, top - 1, 2 + font.width(msg) + 1, top + font.lineHeight - 1, -1873784752);
|
||||
font.draw(poseStack, msg, 2, top, 14737632);
|
||||
top += font.lineHeight;
|
||||
}
|
||||
|
||||
@@ -686,30 +685,30 @@ public class ForgeIngameGui extends Gui
|
||||
if (msg == null) continue;
|
||||
int w = font.width(msg);
|
||||
int left = width - 2 - w;
|
||||
fill(mStack, left - 1, top - 1, left + w + 1, top + font.lineHeight - 1, -1873784752);
|
||||
font.draw(mStack, msg, left, top, 14737632);
|
||||
fill(poseStack, left - 1, top - 1, left + w + 1, top + font.lineHeight - 1, -1873784752);
|
||||
font.draw(poseStack, msg, left, top, 14737632);
|
||||
top += font.lineHeight;
|
||||
}
|
||||
}
|
||||
|
||||
minecraft.getProfiler().pop();
|
||||
post(TEXT, mStack);
|
||||
post(TEXT, poseStack);
|
||||
}
|
||||
|
||||
protected void renderFPSGraph(PoseStack mStack)
|
||||
protected void renderFPSGraph(PoseStack poseStack)
|
||||
{
|
||||
if (this.minecraft.options.renderDebug && this.minecraft.options.renderFpsChart)
|
||||
{
|
||||
this.debugOverlay.render(mStack);
|
||||
this.debugOverlay.render(poseStack);
|
||||
}
|
||||
}
|
||||
|
||||
protected void renderRecordOverlay(int width, int height, float partialTicks, PoseStack pStack)
|
||||
protected void renderRecordOverlay(int width, int height, float partialTick, PoseStack pStack)
|
||||
{
|
||||
if (overlayMessageTime > 0)
|
||||
{
|
||||
minecraft.getProfiler().push("overlayMessage");
|
||||
float hue = (float)overlayMessageTime - partialTicks;
|
||||
float hue = (float)overlayMessageTime - partialTick;
|
||||
int opacity = (int)(hue * 255.0F / 20.0F);
|
||||
if (opacity > 255) opacity = 255;
|
||||
|
||||
@@ -730,12 +729,12 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
}
|
||||
|
||||
protected void renderTitle(int width, int height, float partialTicks, PoseStack pStack)
|
||||
protected void renderTitle(int width, int height, float partialTick, PoseStack pStack)
|
||||
{
|
||||
if (title != null && titleTime > 0)
|
||||
{
|
||||
minecraft.getProfiler().push("titleAndSubtitle");
|
||||
float age = (float)this.titleTime - partialTicks;
|
||||
float age = (float)this.titleTime - partialTick;
|
||||
int opacity = 255;
|
||||
|
||||
if (titleTime > titleFadeOutTime + titleStayTime)
|
||||
@@ -790,7 +789,7 @@ public class ForgeIngameGui extends Gui
|
||||
minecraft.getProfiler().pop();
|
||||
}
|
||||
|
||||
protected void renderPlayerList(int width, int height, PoseStack mStack)
|
||||
protected void renderPlayerList(int width, int height, PoseStack poseStack)
|
||||
{
|
||||
Objective scoreobjective = this.minecraft.level.getScoreboard().getDisplayObjective(0);
|
||||
ClientPacketListener handler = minecraft.player.connection;
|
||||
@@ -798,9 +797,9 @@ public class ForgeIngameGui extends Gui
|
||||
if (minecraft.options.keyPlayerList.isDown() && (!minecraft.isLocalServer() || handler.getOnlinePlayers().size() > 1 || scoreobjective != null))
|
||||
{
|
||||
this.tabList.setVisible(true);
|
||||
if (pre(PLAYER_LIST, mStack)) return;
|
||||
this.tabList.render(mStack, width, this.minecraft.level.getScoreboard(), scoreobjective);
|
||||
post(PLAYER_LIST, mStack);
|
||||
if (pre(PLAYER_LIST, poseStack)) return;
|
||||
this.tabList.render(poseStack, width, this.minecraft.level.getScoreboard(), scoreobjective);
|
||||
post(PLAYER_LIST, poseStack);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -808,7 +807,7 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
}
|
||||
|
||||
protected void renderHealthMount(int width, int height, PoseStack mStack)
|
||||
protected void renderHealthMount(int width, int height, PoseStack poseStack)
|
||||
{
|
||||
Player player = (Player)minecraft.getCameraEntity();
|
||||
Entity tmp = player.getVehicle();
|
||||
@@ -843,12 +842,12 @@ public class ForgeIngameGui extends Gui
|
||||
for (int i = 0; i < rowCount; ++i)
|
||||
{
|
||||
int x = left_align - i * 8 - 9;
|
||||
blit(mStack, x, top, BACKGROUND, 9, 9, 9);
|
||||
blit(poseStack, x, top, BACKGROUND, 9, 9, 9);
|
||||
|
||||
if (i * 2 + 1 + heart < health)
|
||||
blit(mStack, x, top, FULL, 9, 9, 9);
|
||||
blit(poseStack, x, top, FULL, 9, 9, 9);
|
||||
else if (i * 2 + 1 + heart == health)
|
||||
blit(mStack, x, top, HALF, 9, 9, 9);
|
||||
blit(poseStack, x, top, HALF, 9, 9, 9);
|
||||
}
|
||||
|
||||
right_height += 10;
|
||||
@@ -857,21 +856,21 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
|
||||
//Helper macros
|
||||
private boolean pre(ElementType type, PoseStack mStack)
|
||||
private boolean pre(ElementType type, PoseStack poseStack)
|
||||
{
|
||||
return MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Pre(mStack, eventParent, type));
|
||||
return MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Pre(poseStack, eventParent, type));
|
||||
}
|
||||
private void post(ElementType type, PoseStack mStack)
|
||||
private void post(ElementType type, PoseStack poseStack)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Post(mStack, eventParent, type));
|
||||
MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Post(poseStack, eventParent, type));
|
||||
}
|
||||
private boolean pre(IIngameOverlay overlay, PoseStack mStack)
|
||||
private boolean pre(IIngameOverlay overlay, PoseStack poseStack)
|
||||
{
|
||||
return MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.PreLayer(mStack, eventParent, overlay));
|
||||
return MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.PreLayer(poseStack, eventParent, overlay));
|
||||
}
|
||||
private void post(IIngameOverlay overlay, PoseStack mStack)
|
||||
private void post(IIngameOverlay overlay, PoseStack poseStack)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.PostLayer(mStack, eventParent, overlay));
|
||||
MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.PostLayer(poseStack, eventParent, overlay));
|
||||
}
|
||||
private void bind(ResourceLocation res)
|
||||
{
|
||||
@@ -892,8 +891,8 @@ public class ForgeIngameGui extends Gui
|
||||
this.block = entity.pick(rayTraceDistance, 0.0F, false);
|
||||
this.liquid = entity.pick(rayTraceDistance, 0.0F, true);
|
||||
}
|
||||
@Override protected void drawGameInformation(PoseStack mStack){}
|
||||
@Override protected void drawSystemInformation(PoseStack mStack){}
|
||||
@Override protected void drawGameInformation(PoseStack poseStack){}
|
||||
@Override protected void drawSystemInformation(PoseStack poseStack){}
|
||||
private List<String> getLeft()
|
||||
{
|
||||
List<String> ret = this.getGameInformation();
|
||||
|
||||
@@ -57,7 +57,7 @@ public class GuiUtils
|
||||
* and filler. It is assumed that the desired texture ResourceLocation object has been bound using
|
||||
* Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation).
|
||||
*
|
||||
* @param matrixStack the gui matrix stack
|
||||
* @param poseStack the gui pose stack
|
||||
* @param x x axis offset
|
||||
* @param y y axis offset
|
||||
* @param u bound resource location image x offset
|
||||
@@ -69,10 +69,10 @@ public class GuiUtils
|
||||
* @param borderSize the size of the box's borders
|
||||
* @param zLevel the zLevel to draw at
|
||||
*/
|
||||
public static void drawContinuousTexturedBox(PoseStack matrixStack, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight,
|
||||
public static void drawContinuousTexturedBox(PoseStack poseStack, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight,
|
||||
int borderSize, float zLevel)
|
||||
{
|
||||
drawContinuousTexturedBox(matrixStack, x, y, u, v, width, height, textureWidth, textureHeight, borderSize, borderSize, borderSize, borderSize, zLevel);
|
||||
drawContinuousTexturedBox(poseStack, x, y, u, v, width, height, textureWidth, textureHeight, borderSize, borderSize, borderSize, borderSize, zLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,7 +80,7 @@ public class GuiUtils
|
||||
* and filler. The provided ResourceLocation object will be bound using
|
||||
* Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation).
|
||||
*
|
||||
* @param matrixStack the gui matrix stack
|
||||
* @param poseStack the gui pose stack
|
||||
* @param res the ResourceLocation object that contains the desired image
|
||||
* @param x x axis offset
|
||||
* @param y y axis offset
|
||||
@@ -93,10 +93,10 @@ public class GuiUtils
|
||||
* @param borderSize the size of the box's borders
|
||||
* @param zLevel the zLevel to draw at
|
||||
*/
|
||||
public static void drawContinuousTexturedBox(PoseStack matrixStack, ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight,
|
||||
public static void drawContinuousTexturedBox(PoseStack poseStack, ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight,
|
||||
int borderSize, float zLevel)
|
||||
{
|
||||
drawContinuousTexturedBox(matrixStack, res, x, y, u, v, width, height, textureWidth, textureHeight, borderSize, borderSize, borderSize, borderSize, zLevel);
|
||||
drawContinuousTexturedBox(poseStack, res, x, y, u, v, width, height, textureWidth, textureHeight, borderSize, borderSize, borderSize, borderSize, zLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,7 +104,7 @@ public class GuiUtils
|
||||
* and filler. The provided ResourceLocation object will be bound using
|
||||
* Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation).
|
||||
*
|
||||
* @param matrixStack the gui matrix stack
|
||||
* @param poseStack the gui pose stack
|
||||
* @param res the ResourceLocation object that contains the desired image
|
||||
* @param x x axis offset
|
||||
* @param y y axis offset
|
||||
@@ -120,12 +120,12 @@ public class GuiUtils
|
||||
* @param rightBorder the size of the box's right border
|
||||
* @param zLevel the zLevel to draw at
|
||||
*/
|
||||
public static void drawContinuousTexturedBox(PoseStack matrixStack, ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight,
|
||||
public static void drawContinuousTexturedBox(PoseStack poseStack, ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight,
|
||||
int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel)
|
||||
{
|
||||
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
||||
RenderSystem.setShaderTexture(0, res);
|
||||
drawContinuousTexturedBox(matrixStack, x, y, u, v, width, height, textureWidth, textureHeight, topBorder, bottomBorder, leftBorder, rightBorder, zLevel);
|
||||
drawContinuousTexturedBox(poseStack, x, y, u, v, width, height, textureWidth, textureHeight, topBorder, bottomBorder, leftBorder, rightBorder, zLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -133,7 +133,7 @@ public class GuiUtils
|
||||
* and filler. It is assumed that the desired texture ResourceLocation object has been bound using
|
||||
* Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation).
|
||||
*
|
||||
* @param matrixStack the gui matrix stack
|
||||
* @param poseStack the gui pose stack
|
||||
* @param x x axis offset
|
||||
* @param y y axis offset
|
||||
* @param u bound resource location image x offset
|
||||
@@ -148,7 +148,7 @@ public class GuiUtils
|
||||
* @param rightBorder the size of the box's right border
|
||||
* @param zLevel the zLevel to draw at
|
||||
*/
|
||||
public static void drawContinuousTexturedBox(PoseStack matrixStack, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight,
|
||||
public static void drawContinuousTexturedBox(PoseStack poseStack, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight,
|
||||
int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel)
|
||||
{
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
@@ -166,37 +166,37 @@ public class GuiUtils
|
||||
|
||||
// Draw Border
|
||||
// Top Left
|
||||
drawTexturedModalRect(matrixStack, x, y, u, v, leftBorder, topBorder, zLevel);
|
||||
drawTexturedModalRect(poseStack, x, y, u, v, leftBorder, topBorder, zLevel);
|
||||
// Top Right
|
||||
drawTexturedModalRect(matrixStack, x + leftBorder + canvasWidth, y, u + leftBorder + fillerWidth, v, rightBorder, topBorder, zLevel);
|
||||
drawTexturedModalRect(poseStack, x + leftBorder + canvasWidth, y, u + leftBorder + fillerWidth, v, rightBorder, topBorder, zLevel);
|
||||
// Bottom Left
|
||||
drawTexturedModalRect(matrixStack, x, y + topBorder + canvasHeight, u, v + topBorder + fillerHeight, leftBorder, bottomBorder, zLevel);
|
||||
drawTexturedModalRect(poseStack, x, y + topBorder + canvasHeight, u, v + topBorder + fillerHeight, leftBorder, bottomBorder, zLevel);
|
||||
// Bottom Right
|
||||
drawTexturedModalRect(matrixStack, x + leftBorder + canvasWidth, y + topBorder + canvasHeight, u + leftBorder + fillerWidth, v + topBorder + fillerHeight, rightBorder, bottomBorder, zLevel);
|
||||
drawTexturedModalRect(poseStack, x + leftBorder + canvasWidth, y + topBorder + canvasHeight, u + leftBorder + fillerWidth, v + topBorder + fillerHeight, rightBorder, bottomBorder, zLevel);
|
||||
|
||||
for (int i = 0; i < xPasses + (remainderWidth > 0 ? 1 : 0); i++)
|
||||
{
|
||||
// Top Border
|
||||
drawTexturedModalRect(matrixStack, x + leftBorder + (i * fillerWidth), y, u + leftBorder, v, (i == xPasses ? remainderWidth : fillerWidth), topBorder, zLevel);
|
||||
drawTexturedModalRect(poseStack, x + leftBorder + (i * fillerWidth), y, u + leftBorder, v, (i == xPasses ? remainderWidth : fillerWidth), topBorder, zLevel);
|
||||
// Bottom Border
|
||||
drawTexturedModalRect(matrixStack, x + leftBorder + (i * fillerWidth), y + topBorder + canvasHeight, u + leftBorder, v + topBorder + fillerHeight, (i == xPasses ? remainderWidth : fillerWidth), bottomBorder, zLevel);
|
||||
drawTexturedModalRect(poseStack, x + leftBorder + (i * fillerWidth), y + topBorder + canvasHeight, u + leftBorder, v + topBorder + fillerHeight, (i == xPasses ? remainderWidth : fillerWidth), bottomBorder, zLevel);
|
||||
|
||||
// Throw in some filler for good measure
|
||||
for (int j = 0; j < yPasses + (remainderHeight > 0 ? 1 : 0); j++)
|
||||
drawTexturedModalRect(matrixStack, x + leftBorder + (i * fillerWidth), y + topBorder + (j * fillerHeight), u + leftBorder, v + topBorder, (i == xPasses ? remainderWidth : fillerWidth), (j == yPasses ? remainderHeight : fillerHeight), zLevel);
|
||||
drawTexturedModalRect(poseStack, x + leftBorder + (i * fillerWidth), y + topBorder + (j * fillerHeight), u + leftBorder, v + topBorder, (i == xPasses ? remainderWidth : fillerWidth), (j == yPasses ? remainderHeight : fillerHeight), zLevel);
|
||||
}
|
||||
|
||||
// Side Borders
|
||||
for (int j = 0; j < yPasses + (remainderHeight > 0 ? 1 : 0); j++)
|
||||
{
|
||||
// Left Border
|
||||
drawTexturedModalRect(matrixStack, x, y + topBorder + (j * fillerHeight), u, v + topBorder, leftBorder, (j == yPasses ? remainderHeight : fillerHeight), zLevel);
|
||||
drawTexturedModalRect(poseStack, x, y + topBorder + (j * fillerHeight), u, v + topBorder, leftBorder, (j == yPasses ? remainderHeight : fillerHeight), zLevel);
|
||||
// Right Border
|
||||
drawTexturedModalRect(matrixStack, x + leftBorder + canvasWidth, y + topBorder + (j * fillerHeight), u + leftBorder + fillerWidth, v + topBorder, rightBorder, (j == yPasses ? remainderHeight : fillerHeight), zLevel);
|
||||
drawTexturedModalRect(poseStack, x + leftBorder + canvasWidth, y + topBorder + (j * fillerHeight), u + leftBorder + fillerWidth, v + topBorder, rightBorder, (j == yPasses ? remainderHeight : fillerHeight), zLevel);
|
||||
}
|
||||
}
|
||||
|
||||
public static void drawTexturedModalRect(PoseStack matrixStack, int x, int y, int u, int v, int width, int height, float zLevel)
|
||||
public static void drawTexturedModalRect(PoseStack poseStack, int x, int y, int u, int v, int width, int height, float zLevel)
|
||||
{
|
||||
final float uScale = 1f / 0x100;
|
||||
final float vScale = 1f / 0x100;
|
||||
@@ -204,7 +204,7 @@ public class GuiUtils
|
||||
Tesselator tessellator = Tesselator.getInstance();
|
||||
BufferBuilder wr = tessellator.getBuilder();
|
||||
wr.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX);
|
||||
Matrix4f matrix = matrixStack.last().pose();
|
||||
Matrix4f matrix = poseStack.last().pose();
|
||||
wr.vertex(matrix, x , y + height, zLevel).uv( u * uScale, ((v + height) * vScale)).endVertex();
|
||||
wr.vertex(matrix, x + width, y + height, zLevel).uv((u + width) * uScale, ((v + height) * vScale)).endVertex();
|
||||
wr.vertex(matrix, x + width, y , zLevel).uv((u + width) * uScale, ( v * vScale)).endVertex();
|
||||
@@ -242,12 +242,12 @@ public class GuiUtils
|
||||
RenderSystem.enableTexture();
|
||||
}
|
||||
|
||||
public static void drawInscribedRect(PoseStack mStack, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight)
|
||||
public static void drawInscribedRect(PoseStack poseStack, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight)
|
||||
{
|
||||
drawInscribedRect(mStack, x, y, boundsWidth, boundsHeight, rectWidth, rectHeight, true, true);
|
||||
drawInscribedRect(poseStack, x, y, boundsWidth, boundsHeight, rectWidth, rectHeight, true, true);
|
||||
}
|
||||
|
||||
public static void drawInscribedRect(PoseStack mStack, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight, boolean centerX, boolean centerY)
|
||||
public static void drawInscribedRect(PoseStack poseStack, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight, boolean centerX, boolean centerY)
|
||||
{
|
||||
if (rectWidth * boundsHeight > rectHeight * boundsWidth) {
|
||||
int h = boundsHeight;
|
||||
@@ -259,6 +259,6 @@ public class GuiUtils
|
||||
if (centerX) x += (w - boundsWidth) / 2;
|
||||
}
|
||||
|
||||
GuiComponent.blit(mStack, x, y, boundsWidth, boundsHeight, 0.0f,0.0f, rectWidth, rectHeight, rectWidth, rectHeight);
|
||||
GuiComponent.blit(poseStack, x, y, boundsWidth, boundsHeight, 0.0f,0.0f, rectWidth, rectHeight, rectWidth, rectHeight);
|
||||
}
|
||||
}
|
||||
@@ -9,5 +9,5 @@ import com.mojang.blaze3d.vertex.PoseStack;
|
||||
|
||||
public interface IIngameOverlay
|
||||
{
|
||||
void render(ForgeIngameGui gui, PoseStack mStack, float partialTicks, int width, int height);
|
||||
void render(ForgeIngameGui gui, PoseStack poseStack, float partialTick, int width, int height);
|
||||
}
|
||||
@@ -80,17 +80,17 @@ public class LoadingErrorScreen extends ErrorScreen {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack mStack, int mouseX, int mouseY, float partialTicks)
|
||||
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTick)
|
||||
{
|
||||
this.renderBackground(mStack);
|
||||
this.entryList.render(mStack, mouseX, mouseY, partialTicks);
|
||||
drawMultiLineCenteredString(mStack, font, this.modLoadErrors.isEmpty() ? warningHeader : errorHeader, this.width / 2, 10);
|
||||
this.renderables.forEach(button -> button.render(mStack, mouseX, mouseY, partialTicks));
|
||||
this.renderBackground(poseStack);
|
||||
this.entryList.render(poseStack, mouseX, mouseY, partialTick);
|
||||
drawMultiLineCenteredString(poseStack, font, this.modLoadErrors.isEmpty() ? warningHeader : errorHeader, this.width / 2, 10);
|
||||
this.renderables.forEach(button -> button.render(poseStack, mouseX, mouseY, partialTick));
|
||||
}
|
||||
|
||||
private void drawMultiLineCenteredString(PoseStack mStack, Font fr, Component str, int x, int y) {
|
||||
private void drawMultiLineCenteredString(PoseStack poseStack, Font fr, Component str, int x, int y) {
|
||||
for (FormattedCharSequence s : fr.split(str, this.width)) {
|
||||
fr.drawShadow(mStack, s, (float) (x - fr.width(s) / 2.0), y, 0xFFFFFF);
|
||||
fr.drawShadow(poseStack, s, (float) (x - fr.width(s) / 2.0), y, 0xFFFFFF);
|
||||
y+=fr.lineHeight;
|
||||
}
|
||||
}
|
||||
@@ -140,15 +140,15 @@ public class LoadingErrorScreen extends ErrorScreen {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack pStack, int entryIdx, int top, int left, final int entryWidth, final int entryHeight, final int mouseX, final int mouseY, final boolean p_194999_5_, final float partialTicks) {
|
||||
public void render(PoseStack poseStack, int entryIdx, int top, int left, final int entryWidth, final int entryHeight, final int mouseX, final int mouseY, final boolean p_194999_5_, final float partialTick) {
|
||||
Font font = Minecraft.getInstance().font;
|
||||
final List<FormattedCharSequence> strings = font.split(message, LoadingEntryList.this.width);
|
||||
int y = top + 2;
|
||||
for (int i = 0; i < Math.min(strings.size(), 2); i++) {
|
||||
if (center)
|
||||
font.draw(pStack, strings.get(i), left + (width) - font.width(strings.get(i)) / 2F, y, 0xFFFFFF);
|
||||
font.draw(poseStack, strings.get(i), left + (width) - font.width(strings.get(i)) / 2F, y, 0xFFFFFF);
|
||||
else
|
||||
font.draw(pStack, strings.get(i), left + 5, y, 0xFFFFFF);
|
||||
font.draw(poseStack, strings.get(i), left + 5, y, 0xFFFFFF);
|
||||
y += font.lineHeight;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,9 +104,6 @@ public class ModListScreen extends Screen
|
||||
private boolean sorted = false;
|
||||
private SortType sortType = SortType.NORMAL;
|
||||
|
||||
/**
|
||||
* @param parentScreen
|
||||
*/
|
||||
public ModListScreen(Screen parentScreen)
|
||||
{
|
||||
super(new TranslatableComponent("fml.menu.mods.title"));
|
||||
@@ -177,7 +174,7 @@ public class ModListScreen extends Screen
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawPanel(PoseStack mStack, int entryRight, int relativeY, Tesselator tess, int mouseX, int mouseY)
|
||||
protected void drawPanel(PoseStack poseStack, int entryRight, int relativeY, Tesselator tess, int mouseX, int mouseY)
|
||||
{
|
||||
if (logoPath != null) {
|
||||
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
||||
@@ -186,7 +183,7 @@ public class ModListScreen extends Screen
|
||||
RenderSystem.setShaderTexture(0, logoPath);
|
||||
// Draw the logo image inscribed in a rectangle with width entryWidth (minus some padding) and height 50
|
||||
int headerHeight = 50;
|
||||
GuiUtils.drawInscribedRect(mStack, left + PADDING, relativeY, width - (PADDING * 2), headerHeight, logoDims.width, logoDims.height, false, true);
|
||||
GuiUtils.drawInscribedRect(poseStack, left + PADDING, relativeY, width - (PADDING * 2), headerHeight, logoDims.width, logoDims.height, false, true);
|
||||
relativeY += headerHeight + PADDING;
|
||||
}
|
||||
|
||||
@@ -195,7 +192,7 @@ public class ModListScreen extends Screen
|
||||
if (line != null)
|
||||
{
|
||||
RenderSystem.enableBlend();
|
||||
ModListScreen.this.font.drawShadow(mStack, line, left + PADDING, relativeY, 0xFFFFFF);
|
||||
ModListScreen.this.font.drawShadow(poseStack, line, left + PADDING, relativeY, 0xFFFFFF);
|
||||
RenderSystem.disableBlend();
|
||||
}
|
||||
relativeY += font.lineHeight;
|
||||
@@ -203,7 +200,7 @@ public class ModListScreen extends Screen
|
||||
|
||||
final Style component = findTextLine(mouseX, mouseY);
|
||||
if (component!=null) {
|
||||
ModListScreen.this.renderComponentHoverEffect(mStack, component, mouseX, mouseY);
|
||||
ModListScreen.this.renderComponentHoverEffect(poseStack, component, mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,17 +360,17 @@ public class ModListScreen extends Screen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack mStack, int mouseX, int mouseY, float partialTicks)
|
||||
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTick)
|
||||
{
|
||||
this.modList.render(mStack, mouseX, mouseY, partialTicks);
|
||||
this.modList.render(poseStack, mouseX, mouseY, partialTick);
|
||||
if (this.modInfo != null)
|
||||
this.modInfo.render(mStack, mouseX, mouseY, partialTicks);
|
||||
this.modInfo.render(poseStack, mouseX, mouseY, partialTick);
|
||||
|
||||
Component text = new TranslatableComponent("fml.menu.mods.search");
|
||||
int x = modList.getLeft() + ((modList.getRight() - modList.getLeft()) / 2) - (getFontRenderer().width(text) / 2);
|
||||
this.search.render(mStack, mouseX , mouseY, partialTicks);
|
||||
super.render(mStack, mouseX, mouseY, partialTicks);
|
||||
getFontRenderer().draw(mStack, text.getVisualOrderText(), x, search.y - getFontRenderer().lineHeight, 0xFFFFFF);
|
||||
this.search.render(poseStack, mouseX , mouseY, partialTick);
|
||||
super.render(poseStack, mouseX, mouseY, partialTick);
|
||||
getFontRenderer().draw(poseStack, text.getVisualOrderText(), x, search.y - getFontRenderer().lineHeight, 0xFFFFFF);
|
||||
}
|
||||
|
||||
public Minecraft getMinecraftInstance()
|
||||
|
||||
@@ -49,9 +49,8 @@ public class NotificationModUpdateScreen extends Screen
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void render(PoseStack mStack, int mouseX, int mouseY, float partialTicks)
|
||||
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTick)
|
||||
{
|
||||
if (showNotification == null || !showNotification.shouldDraw() || !FMLConfig.runVersionCheck())
|
||||
{
|
||||
@@ -65,7 +64,7 @@ public class NotificationModUpdateScreen extends Screen
|
||||
int w = modButton.getWidth();
|
||||
int h = modButton.getHeight();
|
||||
|
||||
blit(mStack, x + w - (h / 2 + 4), y + (h / 2 - 4), showNotification.getSheetOffset() * 8, (showNotification.isAnimated() && ((System.currentTimeMillis() / 800 & 1) == 1)) ? 8 : 0, 8, 8, 64, 16);
|
||||
blit(poseStack, x + w - (h / 2 + 4), y + (h / 2 - 4), showNotification.getSheetOffset() * 8, (showNotification.isAnimated() && ((System.currentTimeMillis() / 800 & 1) == 1)) ? 8 : 0, 8, 8, 64, 16);
|
||||
}
|
||||
|
||||
public static NotificationModUpdateScreen init(TitleScreen guiMainMenu, Button modButton)
|
||||
|
||||
@@ -159,7 +159,7 @@ public abstract class ScrollPanel extends AbstractContainerEventHandler implemen
|
||||
/**
|
||||
* Draws the background of the scroll panel. This runs AFTER Scissors are enabled.
|
||||
*/
|
||||
protected void drawBackground(PoseStack matrix, Tesselator tess, float partialTicks)
|
||||
protected void drawBackground(PoseStack matrix, Tesselator tess, float partialTick)
|
||||
{
|
||||
BufferBuilder worldr = tess.getBuilder();
|
||||
|
||||
@@ -185,7 +185,7 @@ public abstract class ScrollPanel extends AbstractContainerEventHandler implemen
|
||||
* Draw anything special on the screen. Scissor (RenderSystem.enableScissor) is enabled
|
||||
* for anything that is rendered outside the view box. Do not mess with Scissor unless you support this.
|
||||
*/
|
||||
protected abstract void drawPanel(PoseStack mStack, int entryRight, int relativeY, Tesselator tess, int mouseX, int mouseY);
|
||||
protected abstract void drawPanel(PoseStack poseStack, int entryRight, int relativeY, Tesselator tess, int mouseX, int mouseY);
|
||||
|
||||
protected boolean clickPanel(double mouseX, double mouseY, int button) { return false; }
|
||||
|
||||
@@ -294,7 +294,7 @@ public abstract class ScrollPanel extends AbstractContainerEventHandler implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack matrix, int mouseX, int mouseY, float partialTicks)
|
||||
public void render(PoseStack matrix, int mouseX, int mouseY, float partialTick)
|
||||
{
|
||||
Tesselator tess = Tesselator.getInstance();
|
||||
BufferBuilder worldr = tess.getBuilder();
|
||||
@@ -303,7 +303,7 @@ public abstract class ScrollPanel extends AbstractContainerEventHandler implemen
|
||||
RenderSystem.enableScissor((int)(left * scale), (int)(client.getWindow().getHeight() - (bottom * scale)),
|
||||
(int)(width * scale), (int)(height * scale));
|
||||
|
||||
this.drawBackground(matrix, tess, partialTicks);
|
||||
this.drawBackground(matrix, tess, partialTick);
|
||||
|
||||
int baseY = this.top + border - (int)this.scrollDistance;
|
||||
this.drawPanel(matrix, right, baseY, tess, mouseX, mouseY);
|
||||
@@ -365,9 +365,9 @@ public abstract class ScrollPanel extends AbstractContainerEventHandler implemen
|
||||
RenderSystem.disableScissor();
|
||||
}
|
||||
|
||||
protected void drawGradientRect(PoseStack mStack, int left, int top, int right, int bottom, int color1, int color2)
|
||||
protected void drawGradientRect(PoseStack poseStack, int left, int top, int right, int bottom, int color1, int color2)
|
||||
{
|
||||
GuiUtils.drawGradientRect(mStack.last().pose(), 0, left, top, right, bottom, color1, color2);
|
||||
GuiUtils.drawGradientRect(poseStack.last().pose(), 0, left, top, right, bottom, color1, color2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -33,12 +33,12 @@ public class ExtendedButton extends Button
|
||||
* Draws this button to the screen.
|
||||
*/
|
||||
@Override
|
||||
public void renderButton(PoseStack mStack, int mouseX, int mouseY, float partial)
|
||||
public void renderButton(PoseStack poseStack, int mouseX, int mouseY, float partialTick)
|
||||
{
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
int k = this.getYImage(this.isHovered);
|
||||
GuiUtils.drawContinuousTexturedBox(mStack, WIDGETS_LOCATION, this.x, this.y, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.getBlitOffset());
|
||||
this.renderBg(mStack, mc, mouseX, mouseY);
|
||||
GuiUtils.drawContinuousTexturedBox(poseStack, WIDGETS_LOCATION, this.x, this.y, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.getBlitOffset());
|
||||
this.renderBg(poseStack, mc, mouseX, mouseY);
|
||||
|
||||
Component buttonText = this.getMessage();
|
||||
int strWidth = mc.font.width(buttonText);
|
||||
@@ -48,6 +48,6 @@ public class ExtendedButton extends Button
|
||||
//TODO, srg names make it hard to figure out how to append to an ITextProperties from this trim operation, wraping this in StringTextComponent is kinda dirty.
|
||||
buttonText = new TextComponent(mc.font.substrByWidth(buttonText, width - 6 - ellipsisWidth).getString() + "...");
|
||||
|
||||
drawCenteredString(mStack, mc.font, buttonText, this.x + this.width / 2, this.y + (this.height - 8) / 2, getFGColor());
|
||||
drawCenteredString(poseStack, mc.font, buttonText, this.x + this.width / 2, this.y + (this.height - 8) / 2, getFGColor());
|
||||
}
|
||||
}
|
||||
@@ -57,9 +57,9 @@ public class ModListWidget extends ObjectSelectionList<ModListWidget.ModEntry>
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderBackground(PoseStack mStack)
|
||||
protected void renderBackground(PoseStack poseStack)
|
||||
{
|
||||
this.parent.renderBackground(mStack);
|
||||
this.parent.renderBackground(poseStack);
|
||||
}
|
||||
|
||||
public class ModEntry extends ObjectSelectionList.Entry<ModEntry> {
|
||||
@@ -77,22 +77,22 @@ public class ModListWidget extends ObjectSelectionList<ModListWidget.ModEntry>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack pStack, int entryIdx, int top, int left, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean p_194999_5_, float partialTicks)
|
||||
public void render(PoseStack poseStack, int entryIdx, int top, int left, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean p_194999_5_, float partialTick)
|
||||
{
|
||||
Component name = new TextComponent(stripControlCodes(modInfo.getDisplayName()));
|
||||
Component version = new TextComponent(stripControlCodes(MavenVersionStringHelper.artifactVersionToString(modInfo.getVersion())));
|
||||
VersionChecker.CheckResult vercheck = VersionChecker.getResult(modInfo);
|
||||
Font font = this.parent.getFontRenderer();
|
||||
font.draw(pStack, Language.getInstance().getVisualOrder(FormattedText.composite(font.substrByWidth(name, listWidth))), left + 3, top + 2, 0xFFFFFF);
|
||||
font.draw(pStack, Language.getInstance().getVisualOrder(FormattedText.composite(font.substrByWidth(version, listWidth))), left + 3, top + 2 + font.lineHeight, 0xCCCCCC);
|
||||
font.draw(poseStack, Language.getInstance().getVisualOrder(FormattedText.composite(font.substrByWidth(name, listWidth))), left + 3, top + 2, 0xFFFFFF);
|
||||
font.draw(poseStack, Language.getInstance().getVisualOrder(FormattedText.composite(font.substrByWidth(version, listWidth))), left + 3, top + 2 + font.lineHeight, 0xCCCCCC);
|
||||
if (vercheck.status().shouldDraw())
|
||||
{
|
||||
//TODO: Consider adding more icons for visualization
|
||||
RenderSystem.setShaderColor(1, 1, 1, 1);
|
||||
RenderSystem.setShaderTexture(0, VERSION_CHECK_ICONS);
|
||||
pStack.pushPose();
|
||||
GuiComponent.blit(pStack, getLeft() + width - 12, top + entryHeight / 4, vercheck.status().getSheetOffset() * 8, (vercheck.status().isAnimated() && ((System.currentTimeMillis() / 800 & 1)) == 1) ? 8 : 0, 8, 8, 64, 16);
|
||||
pStack.popPose();
|
||||
poseStack.pushPose();
|
||||
GuiComponent.blit(poseStack, getLeft() + width - 12, top + entryHeight / 4, vercheck.status().getSheetOffset() * 8, (vercheck.status().isAnimated() && ((System.currentTimeMillis() / 800 & 1)) == 1) ? 8 : 0, 8, 8, 64, 16);
|
||||
poseStack.popPose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ public class Slider extends ExtendedButton
|
||||
* Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e).
|
||||
*/
|
||||
@Override
|
||||
protected void renderBg(PoseStack mStack, Minecraft par1Minecraft, int par2, int par3)
|
||||
protected void renderBg(PoseStack poseStack, Minecraft minecraft, int par2, int par3)
|
||||
{
|
||||
if (this.visible)
|
||||
{
|
||||
@@ -104,7 +104,7 @@ public class Slider extends ExtendedButton
|
||||
updateSlider();
|
||||
}
|
||||
|
||||
GuiUtils.drawContinuousTexturedBox(mStack, WIDGETS_LOCATION, this.x + (int)(this.sliderValue * (float)(this.width - 8)), this.y, 0, 66, 8, this.height, 200, 20, 2, 3, 2, 2, this.getBlitOffset());
|
||||
GuiUtils.drawContinuousTexturedBox(poseStack, WIDGETS_LOCATION, this.x + (int)(this.sliderValue * (float)(this.width - 8)), this.y, 0, 66, 8, this.height, 200, 20, 2, 3, 2, 2, this.getBlitOffset());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,15 +30,15 @@ public class UnicodeGlyphButton extends ExtendedButton
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack mStack, int mouseX, int mouseY, float partial)
|
||||
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTick)
|
||||
{
|
||||
if (this.visible)
|
||||
{
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
this.isHovered = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height;
|
||||
int k = this.getYImage(this.isHovered);
|
||||
GuiUtils.drawContinuousTexturedBox(mStack, WIDGETS_LOCATION, this.x, this.y, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.getBlitOffset());
|
||||
this.renderBg(mStack, mc, mouseX, mouseY);
|
||||
GuiUtils.drawContinuousTexturedBox(poseStack, WIDGETS_LOCATION, this.x, this.y, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.getBlitOffset());
|
||||
this.renderBg(poseStack, mc, mouseX, mouseY);
|
||||
|
||||
Component buttonText = this.createNarrationMessage();
|
||||
int glyphWidth = (int) (mc.font.width(glyph) * glyphScale);
|
||||
@@ -52,14 +52,14 @@ public class UnicodeGlyphButton extends ExtendedButton
|
||||
strWidth = mc.font.width(buttonText);
|
||||
totalWidth = glyphWidth + strWidth;
|
||||
|
||||
mStack.pushPose();
|
||||
mStack.scale(glyphScale, glyphScale, 1.0F);
|
||||
this.drawCenteredString(mStack, mc.font, new TextComponent(glyph),
|
||||
poseStack.pushPose();
|
||||
poseStack.scale(glyphScale, glyphScale, 1.0F);
|
||||
this.drawCenteredString(poseStack, mc.font, new TextComponent(glyph),
|
||||
(int) (((this.x + (this.width / 2) - (strWidth / 2)) / glyphScale) - (glyphWidth / (2 * glyphScale)) + 2),
|
||||
(int) (((this.y + ((this.height - 8) / glyphScale) / 2) - 1) / glyphScale), getFGColor());
|
||||
mStack.popPose();
|
||||
poseStack.popPose();
|
||||
|
||||
this.drawCenteredString(mStack, mc.font, buttonText, (int) (this.x + (this.width / 2) + (glyphWidth / glyphScale)),
|
||||
this.drawCenteredString(poseStack, mc.font, buttonText, (int) (this.x + (this.width / 2) + (glyphWidth / glyphScale)),
|
||||
this.y + (this.height - 8) / 2, getFGColor());
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user