diff options
author | nea <romangraef@gmail.com> | 2022-02-26 13:40:36 +0100 |
---|---|---|
committer | nea <romangraef@gmail.com> | 2022-04-14 04:10:06 +0200 |
commit | eceeddd835fe148b67efbe33899a40ec499789cb (patch) | |
tree | 9960ca70dddcdd4b2dff3ff0c4d39c4ed75caac3 /src | |
parent | a36371958640755d54c11d8661b35d44e972c8ba (diff) | |
download | NotEnoughUpdates-eceeddd835fe148b67efbe33899a40ec499789cb.tar.gz NotEnoughUpdates-eceeddd835fe148b67efbe33899a40ec499789cb.tar.bz2 NotEnoughUpdates-eceeddd835fe148b67efbe33899a40ec499789cb.zip |
fix texture offsets and also parts:true
Diffstat (limited to 'src')
3 files changed, 16 insertions, 10 deletions
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<String, JsonElement> 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<String, JsonElement> 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; |