diff --git a/game/client/src/main/java/net/minecraft/client/gui/ScreenHudEditor.java b/game/client/src/main/java/net/minecraft/client/gui/ScreenHudEditor.java index b3132923d..39e559808 100644 --- a/game/client/src/main/java/net/minecraft/client/gui/ScreenHudEditor.java +++ b/game/client/src/main/java/net/minecraft/client/gui/ScreenHudEditor.java @@ -340,7 +340,7 @@ public class ScreenHudEditor extends Screen { if (component.getRawOptions() != null) { for (Option option : component.getRawOptions()) { hasContent = true; - String optionName = I18n.getInstance().translateKey(option.getDisplayStringName()); + String optionName = option.getDisplayStringName(); int textWidth = this.fontRenderer.stringWidth(optionName); if (textWidth > maxTextWidth) { maxTextWidth = textWidth; @@ -352,7 +352,7 @@ public class ScreenHudEditor extends Screen { for (KeyBinding keyBinding : component.getRawKeyBindings()) { hasContent = true; controlWidth += 50; - String keyName = I18n.getInstance().translateKey(keyBinding.getKeyName()); + String keyName = keyBinding.getKeyName(); int textWidth = this.fontRenderer.stringWidth(keyName); if (textWidth > maxTextWidth) { maxTextWidth = textWidth; diff --git a/game/client/src/main/java/net/minecraft/client/gui/guidebook/crafting/displays/DisplayAdapterMapDuplication.java b/game/client/src/main/java/net/minecraft/client/gui/guidebook/crafting/displays/DisplayAdapterMapDuplication.java index 8c1353073..7b5e6951f 100644 --- a/game/client/src/main/java/net/minecraft/client/gui/guidebook/crafting/displays/DisplayAdapterMapDuplication.java +++ b/game/client/src/main/java/net/minecraft/client/gui/guidebook/crafting/displays/DisplayAdapterMapDuplication.java @@ -18,7 +18,7 @@ public class DisplayAdapterMapDuplication implements RecipeDisplayAdapter spaces = new ObjectArrayList<>(); spaces.add(new Space(0, 0, atlasWidth, atlasHeight)); List packed = new ObjectArrayList<>(); @@ -218,7 +218,7 @@ public class AtlasStitcher { } } - public BufferedImage getImage(@NotNull String layer, @NotNull IconCoordinate coordinate) { + public @Nullable BufferedImage getImage(@NotNull String layer, @NotNull IconCoordinate coordinate) { String source = getSourceImageId(coordinate.namespaceId); String postfix = this.layerPostfixMap.getOrDefault(layer, ""); String path; @@ -227,16 +227,18 @@ public class AtlasStitcher { } else { path = source + "." + postfix + ".png"; } - BufferedImage image = CustomAtlasHandler.getTextureOverride(Minecraft.getMinecraft().texturePackList, source + "png"); + BufferedImage image = CustomAtlasHandler.getTextureOverride(Minecraft.getMinecraft().texturePackList, path + ".png"); if(image == null) { - TexturePack pack = Minecraft.getMinecraft().texturePackList.getHighestPriorityTexturePackWithFile(source + ".png"); + TexturePack pack = Minecraft.getMinecraft().texturePackList.getHighestPriorityTexturePackWithFile(path + ".png"); if (pack != null) { for (int attempt = 0; attempt < 3; attempt++) { - try { - image = Textures.readImageUnhandled(pack.getResourceAsStream(path)); - if (image != null) break; + try (InputStream stream = pack.getResourceAsStream(path)) { + if (stream != null) { + image = Textures.readImageUnhandled(stream); + if (image != null) break; + } } catch (Exception e) { - LOGGER.error("", e); + LOGGER.error("Failed to read image {}", path, e); } } } diff --git a/game/core/src/main/java/net/minecraft/core/data/registry/recipe/entry/RecipeEntryMapDuplication.java b/game/core/src/main/java/net/minecraft/core/data/registry/recipe/entry/RecipeEntryMapDuplication.java index 1962f2bbe..a40a68646 100644 --- a/game/core/src/main/java/net/minecraft/core/data/registry/recipe/entry/RecipeEntryMapDuplication.java +++ b/game/core/src/main/java/net/minecraft/core/data/registry/recipe/entry/RecipeEntryMapDuplication.java @@ -35,7 +35,7 @@ public class RecipeEntryMapDuplication extends RecipeEntryCraftingDynamic{ } assert map != null; ItemStack output = map.copy(); - output.stackSize += paperAmount; + output.stackSize = paperAmount + 1; return output; } @@ -46,10 +46,18 @@ public class RecipeEntryMapDuplication extends RecipeEntryCraftingDynamic{ @Override public ItemStack[] onCraftResult(ContainerCrafting containerCrafting) { + ItemStack[] returnStack = new ItemStack[9]; for (int i = 0; i < containerCrafting.getContainerSize(); i++) { - containerCrafting.setItem(i, null); + ItemStack itemstack1 = containerCrafting.getItem(i); + if (itemstack1 == null) { + continue; + } + containerCrafting.removeItem(i, 1); + if (/*!consumeContainerItem && */itemstack1.getItem().hasContainerItem()) { + containerCrafting.setItem(i, new ItemStack(itemstack1.getItem().getContainerItem())); + } } - return new ItemStack[0]; + return returnStack; } @Override