Skip to content

Commit

Permalink
fix #97
Browse files Browse the repository at this point in the history
  • Loading branch information
yurisuika committed Oct 21, 2024
1 parent 8a95e62 commit 14bebaa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.yurisuika.raised.client.gui.screens;

import com.mojang.authlib.GameProfile;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.serialization.Codec;
import dev.yurisuika.raised.client.RaisedOptions;
Expand Down Expand Up @@ -28,11 +27,9 @@
import net.minecraft.util.CommonColors;
import net.minecraft.util.Mth;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.player.PlayerModelPart;
import net.minecraft.world.item.Items;

import java.util.Arrays;
import java.util.UUID;

public class RaisedScreen extends Screen {

Expand Down Expand Up @@ -287,17 +284,12 @@ public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partia
guiGraphics.setColor(1.0F, 1.0F, 1.0F, 1.0F);
}
case PLAYERS -> {
UUID uuidPlayer = minecraft.getGameProfile().getId();
UUID uuidNotch = UUID.fromString("069a79f4-44e9-4726-a5be-fca90e38aaf5");
GameProfile profilePlayer = minecraft.getMinecraftSessionService().fetchProfile(uuidPlayer, false).profile();
GameProfile profileNotch = minecraft.getMinecraftSessionService().fetchProfile(uuidNotch, false).profile();

guiGraphics.fill(-91 + 1, offset - 1 - 10 - 9, -91 + 1 + 144, offset - 1, Integer.MIN_VALUE);
guiGraphics.fill(-91 + 1 + 1, offset - 1 - 9 - 9, -91 + 1 + 144, offset - 1 - 1 - 9, minecraft.options.getBackgroundColor(553648127));
guiGraphics.fill(-91 + 1 + 1, offset - 1 - 9, -91 + 1 + 144, offset - 1 - 1, minecraft.options.getBackgroundColor(553648127));

PlayerFaceRenderer.draw(guiGraphics, minecraft.getSkinManager().getInsecureSkin(profilePlayer).texture(), -91 + 1 + 1, offset - 1 - 9 - 9, 8, minecraft.level.getPlayerByUUID(uuidPlayer).isModelPartShown(PlayerModelPart.HAT), "Dinnerbone".equals(profilePlayer.getName()) || "Grumm".equals(profilePlayer.getName()));
PlayerFaceRenderer.draw(guiGraphics, minecraft.getSkinManager().getInsecureSkin(profileNotch).texture(), -91 + 1 + 1, offset - 1 - 9, 8, true, false);
PlayerFaceRenderer.draw(guiGraphics, ResourceLocation.tryParse("textures/entity/player/wide/steve.png"), -91 + 1 + 1, offset - 1 - 9 - 9, 8, true, false);
PlayerFaceRenderer.draw(guiGraphics, ResourceLocation.tryParse("textures/entity/player/slim/alex.png"), -91 + 1 + 1, offset - 1 - 9, 8, true, false);

guiGraphics.drawString(font, translatableX, -91 + 1 + 10, offset - 1 - 9 - 9, CommonColors.WHITE);
guiGraphics.drawString(font, translatableY, -91 + 1 + 10, offset - 1 - 9, CommonColors.WHITE);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/dev/yurisuika/raised/util/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import java.io.File;
import java.io.FileWriter;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;

public class Config {
Expand All @@ -25,7 +26,7 @@ public static void setOptions(Options options) {

public static void saveConfig() {
try {
FileWriter fileWriter = new FileWriter(file);
FileWriter fileWriter = new FileWriter(file, StandardCharsets.UTF_8);
fileWriter.write(gson.toJson(getOptions()));
fileWriter.close();
} catch (Exception e) {
Expand Down

0 comments on commit 14bebaa

Please sign in to comment.