1.20 -> 1.19.4

This commit is contained in:
Sollace 2023-07-25 13:31:29 +01:00
parent be474aa579
commit fe1fc94127
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
3 changed files with 26 additions and 24 deletions

View file

@ -3,10 +3,10 @@ org.gradle.daemon=false
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/develop # check these on https://fabricmc.net/develop
minecraft_version=1.20.1 minecraft_version=1.19.4
yarn_mappings=1.20.1+build.9 yarn_mappings=1.19.4+build.1
loader_version=0.14.21 loader_version=0.14.17
fabric_version=0.85.0+1.20.1 fabric_version=0.76.0+1.19.4
# Mod Properties # Mod Properties
group=com.minelittlepony group=com.minelittlepony
@ -15,12 +15,12 @@ org.gradle.daemon=false
description=Mine Little Pony turns players and mobs into ponies. Press F9 ingame to access settings. description=Mine Little Pony turns players and mobs into ponies. Press F9 ingame to access settings.
# Publishing # Publishing
minecraft_version_range=>=1.20.0 minecraft_version_range=1.19.4
modrinth_loader_type=fabric modrinth_loader_type=fabric
modrinth_project_id=JBjInUXM modrinth_project_id=JBjInUXM
# Dependencies # Dependencies
modmenu_version=7.1.0 modmenu_version=6.1.0-rc.4
kirin_version=1.15.2 kirin_version=1.15.2+1.19.4
hd_skins_version=6.10.0+1.20 hd_skins_version=6.10.1+1.19.4
mson_version=1.8.1 mson_version=1.8.1

View file

@ -1,8 +1,8 @@
package com.minelittlepony.client; package com.minelittlepony.client;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.*; import net.minecraft.text.*;
import com.minelittlepony.client.render.MobRenderers; import com.minelittlepony.client.render.MobRenderers;
@ -189,10 +189,10 @@ public class GuiPonySettings extends GameGui {
} }
@Override @Override
public void render(DrawContext context, int mouseX, int mouseY, float partialTicks) { public void render(MatrixStack matrices, int mouseX, int mouseY, float partialTicks) {
renderBackground(context); renderBackground(matrices);
super.render(context, mouseX, mouseY, partialTicks); super.render(matrices, mouseX, mouseY, partialTicks);
content.render(context, mouseX, mouseY, partialTicks); content.render(matrices, mouseX, mouseY, partialTicks);
} }
@Override @Override

View file

@ -1,7 +1,8 @@
package com.minelittlepony.client.hdskins; package com.minelittlepony.client.hdskins;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.DrawableHelper;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import com.minelittlepony.api.pony.*; import com.minelittlepony.api.pony.*;
@ -23,30 +24,30 @@ class LegendOverlayWidget implements Carousel.Element, ITextContext {
} }
@Override @Override
public void render(DummyPlayer player, DrawContext context, int mouseX, int mouseY) { public void render(DummyPlayer player, MatrixStack matrices, int mouseX, int mouseY) {
IPonyData data = IPony.getManager().getPony(player).metadata(); IPonyData data = IPony.getManager().getPony(player).metadata();
int[] index = new int[1]; int[] index = new int[1];
data.getTriggerPixels().forEach((key, value) -> { data.getTriggerPixels().forEach((key, value) -> {
context.getMatrices().push(); matrices.push();
int i = index[0]++; int i = index[0]++;
int x = frame.left; int x = frame.left;
int y = frame.top + (i * 10 + 20); int y = frame.top + (i * 10 + 20);
context.getMatrices().translate(x, y, 1); matrices.translate(x, y, 1);
drawLegendBlock(context, 0, 0, 0, mouseX - x, mouseY - y, key, value); drawLegendBlock(matrices, 0, 0, 0, mouseX - x, mouseY - y, key, value);
context.getMatrices().pop(); matrices.pop();
}); });
} }
private void drawLegendBlock(DrawContext context, int index, int x, int y, int mouseX, int mouseY, String key, TriggerPixelType<?> value) { private void drawLegendBlock(MatrixStack matrices, int index, int x, int y, int mouseX, int mouseY, String key, TriggerPixelType<?> value) {
context.fill(0, 0, LEGEND_BLOCK_BOUNDS.width, LEGEND_BLOCK_BOUNDS.height, 0xFF003333); DrawableHelper.fill(matrices, 0, 0, LEGEND_BLOCK_BOUNDS.width, LEGEND_BLOCK_BOUNDS.height, 0xFF003333);
context.fill(1, 1, LEGEND_BLOCK_BOUNDS.width - 1, LEGEND_BLOCK_BOUNDS.height - 1, value.getColorCode() | 0xFF000000); DrawableHelper.fill(matrices, 1, 1, LEGEND_BLOCK_BOUNDS.width - 1, LEGEND_BLOCK_BOUNDS.height - 1, value.getColorCode() | 0xFF000000);
char symbol = value.name().charAt(0); char symbol = value.name().charAt(0);
if (symbol == '[') { if (symbol == '[') {
symbol = key.charAt(0); symbol = key.charAt(0);
} }
context.drawTextWithShadow(getFont(), Text.literal(String.valueOf(symbol).toUpperCase()), 2, 1, 0xFFFFFFFF); DrawableHelper.drawTextWithShadow(matrices, getFont(), Text.literal(String.valueOf(symbol).toUpperCase()), 2, 1, 0xFFFFFFFF);
if (LEGEND_BLOCK_BOUNDS.contains(mouseX, mouseY)) { if (LEGEND_BLOCK_BOUNDS.contains(mouseX, mouseY)) {
List<Text> lines = value.getOptions().stream().map(option -> { List<Text> lines = value.getOptions().stream().map(option -> {
@ -64,7 +65,8 @@ class LegendOverlayWidget implements Carousel.Element, ITextContext {
return color == 0 ? s : s.withColor(value.getColorCode()); return color == 0 ? s : s.withColor(value.getColorCode());
})); }));
} }
context.drawTooltip(getFont(), lines, 2, 10);
MinecraftClient.getInstance().currentScreen.renderTooltip(matrices, lines, 2, 10);
} }
} }
} }