From eceeddd835fe148b67efbe33899a40ec499789cb Mon Sep 17 00:00:00 2001 From: nea Date: Sat, 26 Feb 2022 13:40:36 +0100 Subject: fix texture offsets and also parts:true --- .../miscfeatures/entityviewer/SkinModifier.java | 19 ++++++++++++------- .../notenoughupdates/miscgui/GuiItemRecipe.java | 3 ++- .../notenoughupdates/recipes/VillagerTradeRecipe.java | 4 ++-- 3 files changed, 16 insertions(+), 10 deletions(-) (limited to 'src/main') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/entityviewer/SkinModifier.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/entityviewer/SkinModifier.java index 1bdd54fa..55e8a432 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/entityviewer/SkinModifier.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/entityviewer/SkinModifier.java @@ -23,14 +23,19 @@ public class SkinModifier extends EntityViewerModifier { player.overrideIsSlim = info.get("slim").getAsBoolean(); } if (info.has("parts")) { - JsonObject parts = info.getAsJsonObject("parts"); + JsonElement parts = info.get("parts"); byte partBitField = player.getDataWatcher().getWatchableObjectByte(10); - for (Map.Entry part : parts.entrySet()) { - EnumPlayerModelParts modelPart = EnumPlayerModelParts.valueOf(part.getKey()); - if (part.getValue().getAsBoolean()) { - partBitField |= modelPart.getPartMask(); - } else { - partBitField &= ~modelPart.getPartMask(); + if (parts.isJsonPrimitive() && parts.getAsJsonPrimitive().isBoolean()) { + partBitField = parts.getAsBoolean() ? (byte) -1 : 0; + } else { + JsonObject obj = parts.getAsJsonObject(); + for (Map.Entry part : obj.entrySet()) { + EnumPlayerModelParts modelPart = EnumPlayerModelParts.valueOf(part.getKey()); + if (part.getValue().getAsBoolean()) { + partBitField |= modelPart.getPartMask(); + } else { + partBitField &= ~modelPart.getPartMask(); + } } } player.getDataWatcher().updateObject(10, partBitField); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java index 09fe06f7..469a91f3 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java @@ -153,6 +153,7 @@ public class GuiItemRecipe extends GuiScreen { "" + EnumChatFormatting.RESET + EnumChatFormatting.GRAY + craftingRecipes.get(type).size() + " Recipes" ), mouseX, mouseY, width, height, -1, Minecraft.getMinecraft().fontRendererObj); + return; } } } @@ -170,7 +171,7 @@ public class GuiItemRecipe extends GuiScreen { drawTexturedModalRect( tabPosX, tabPosY, 0, textureOffset, - TAB_TEXTURE_SIZE_X, TAB_SIZE_X + TAB_TEXTURE_SIZE_X, TAB_SIZE_Y ); Minecraft.getMinecraft().getTextureManager().bindTexture(recipeType.getIcon()); drawTexturedModalRect(tabPosX + 7, tabPosY + 7, 6, 0, 16, 16); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/recipes/VillagerTradeRecipe.java b/src/main/java/io/github/moulberry/notenoughupdates/recipes/VillagerTradeRecipe.java index 555ec74b..d09c23a9 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/recipes/VillagerTradeRecipe.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/recipes/VillagerTradeRecipe.java @@ -21,8 +21,8 @@ import java.util.*; public class VillagerTradeRecipe implements NeuRecipe { - public static final int COST_SLOT_X = 53; - public static final int COST_SLOT_Y = 67; + public static final int COST_SLOT_X = 52; + public static final int COST_SLOT_Y = 66; public static final int RESULT_SLOT_Y = 66; public static final int RESULT_SLOT_X = 124; -- cgit