From 9b5707cba63029964c653b959eb7c6f734f70e01 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Tue, 13 Oct 2020 19:56:12 +0200 Subject: [PATCH 1/2] ForgeCraft Playtesting, Part I - Fixed various rendering in JEI and UIs - Fixed oxidized blocks not allowing to be harvested - Fixed missing titles and tooltips in JEI and other UIs --- .../java/com/simibubi/create/AllKeys.java | 3 +- .../create/compat/jei/DoubleItemIcon.java | 10 +++--- .../jei/category/CreateRecipeCategory.java | 2 +- .../category/MechanicalCraftingCategory.java | 30 +++++----------- .../jei/category/PolishingCategory.java | 4 +-- .../category/animations/AnimatedCrafter.java | 20 ++++++----- .../jei/category/animations/AnimatedSaw.java | 2 +- .../sequencer/SequencedGearshiftScreen.java | 6 ++-- .../symmetry/SymmetryWandScreen.java | 7 ++-- .../inventories/AdjustableCrateScreen.java | 2 +- .../block/redstone/StockpileSwitchScreen.java | 34 +------------------ .../item/filter/AbstractFilterScreen.java | 27 +++++++++------ .../block/SchematicTableScreen.java | 2 +- .../block/SchematicannonScreen.java | 2 +- .../client/SchematicEditScreen.java | 6 ++-- .../client/SchematicPromptScreen.java | 5 ++- .../create/foundation/gui/GuiGameElement.java | 31 ++++++++++------- .../foundation/gui/ToolSelectionScreen.java | 31 +++++++++++------ .../foundation/worldgen/OxidizingBlock.java | 7 ---- 19 files changed, 98 insertions(+), 133 deletions(-) diff --git a/src/main/java/com/simibubi/create/AllKeys.java b/src/main/java/com/simibubi/create/AllKeys.java index 400ff4319..e3fedc25f 100644 --- a/src/main/java/com/simibubi/create/AllKeys.java +++ b/src/main/java/com/simibubi/create/AllKeys.java @@ -45,9 +45,8 @@ public enum AllKeys { return keybind.isKeyDown(); } - // TODO this should return ITextComponent public String getBoundKey() { - return keybind.getBoundKeyLocalizedText().getUnformattedComponentText().toUpperCase(); + return keybind.getBoundKeyLocalizedText().getString().toUpperCase(); } public int getBoundCode() { diff --git a/src/main/java/com/simibubi/create/compat/jei/DoubleItemIcon.java b/src/main/java/com/simibubi/create/compat/jei/DoubleItemIcon.java index 468b956a5..7d5bb125c 100644 --- a/src/main/java/com/simibubi/create/compat/jei/DoubleItemIcon.java +++ b/src/main/java/com/simibubi/create/compat/jei/DoubleItemIcon.java @@ -46,16 +46,14 @@ public class DoubleItemIcon implements IDrawable { matrixStack.translate(xOffset, yOffset, 0); matrixStack.push(); - matrixStack.translate(1, 1, 0); - GuiGameElement.GuiItemRenderBuilder.renderItemIntoGUI(matrixStack, primaryStack); - // Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(primaryStack, 0, 0); + matrixStack.translate(1, 17, 0); + GuiGameElement.of(primaryStack).render(matrixStack); matrixStack.pop(); matrixStack.push(); - matrixStack.translate(10, 10, 100); + matrixStack.translate(10, 19, 100); matrixStack.scale(.5f, .5f, .5f); - GuiGameElement.GuiItemRenderBuilder.renderItemIntoGUI(matrixStack, secondaryStack); - // Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(secondaryStack, 0, 0); + GuiGameElement.of(secondaryStack).render(matrixStack); matrixStack.pop(); matrixStack.pop(); diff --git a/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java index 7c9753311..4ccb2be3e 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java @@ -46,7 +46,7 @@ public abstract class CreateRecipeCategory> implements IRec @Override public String getTitle() { - return Lang.translate("recipe." + name).getUnformattedComponentText(); + return Lang.translate("recipe." + name).getString(); } @Override diff --git a/src/main/java/com/simibubi/create/compat/jei/category/MechanicalCraftingCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/MechanicalCraftingCategory.java index dbdbd4cbe..ca833f65b 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/MechanicalCraftingCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/MechanicalCraftingCategory.java @@ -22,12 +22,12 @@ import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; -import net.minecraft.item.Rarity; import net.minecraft.item.crafting.Ingredient; import net.minecraft.item.crafting.ShapedRecipe; import net.minecraft.util.NonNullList; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextFormatting; +import net.minecraft.util.text.TranslationTextComponent; public class MechanicalCraftingCategory extends CreateRecipeCategory { @@ -47,6 +47,8 @@ public class MechanicalCraftingCategory extends CreateRecipeCategory getTooltip(ItemStack ingredient, ITooltipFlag tooltipFlag) { Minecraft minecraft = Minecraft.getInstance(); PlayerEntity player = minecraft.player; - List list; try { - list = ingredient.getTooltip(player, tooltipFlag); + return ingredient.getTooltip(player, tooltipFlag); } catch (RuntimeException | LinkageError e) { - return new ArrayList<>(); + List list = new ArrayList<>(); + TranslationTextComponent crash = new TranslationTextComponent("jei.tooltip.error.crash"); + list.add(crash.formatted(TextFormatting.RED)); + return list; } - - Rarity rarity; - try { - rarity = ingredient.getRarity(); - } catch (RuntimeException | LinkageError e) { - rarity = Rarity.COMMON; - } - - for (int k = 0; k < list.size(); ++k) { - if (k == 0) { - list.set(k, list.get(k).copy().formatted(rarity.color)); - } else { - list.set(k, list.get(k).copy().formatted(TextFormatting.GRAY)); - } - } - - return list; } } diff --git a/src/main/java/com/simibubi/create/compat/jei/category/PolishingCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/PolishingCategory.java index c69434183..423a6e162 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/PolishingCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/PolishingCategory.java @@ -71,10 +71,10 @@ public class PolishingCategory extends CreateRecipeCategory { - offBelowLabel.text = new StringTextComponent(state + "%"); - lastModification = 0; - if (onAbove.getState() - 4 <= state) { - onAbove.setState(state + 5); - onAbove.onChanged(); - } - }) - .setState((int) (te.offWhenBelow * 100)); - - onAboveLabel = new Label(guiLeft + 116, guiTop + 55, "").colored(0xD3CBBE) - .withShadow(); - onAbove = new ScrollInput(guiLeft + 113, guiTop + 52, 33, 14).withRange(5, 101) - .titled(upperLimit) - .calling(state -> { - onAboveLabel.text = new StringTextComponent(state + "%"); - lastModification = 0; - if (offBelow.getState() + 4 >= state) { - offBelow.setState(state - 5); - offBelow.onChanged(); - } - }) - .setState((int) (te.onWhenAbove * 100)); -=======*/ cursor = LerpedFloat.linear() .startWithValue(te.getLevelForDisplay()); @@ -158,7 +126,7 @@ public class StockpileSwitchScreen extends AbstractSimiScreen { matrixStack.push(); GuiGameElement.of(renderedItem) - .at(guiLeft + STOCKSWITCH.width + 15, guiTop + 20) + .at(guiLeft + STOCKSWITCH.width + 15, guiTop + 120) .scale(5) .render(matrixStack); matrixStack.pop(); diff --git a/src/main/java/com/simibubi/create/content/logistics/item/filter/AbstractFilterScreen.java b/src/main/java/com/simibubi/create/content/logistics/item/filter/AbstractFilterScreen.java index cc0b74a45..9f38b81eb 100644 --- a/src/main/java/com/simibubi/create/content/logistics/item/filter/AbstractFilterScreen.java +++ b/src/main/java/com/simibubi/create/content/logistics/item/filter/AbstractFilterScreen.java @@ -43,8 +43,10 @@ public abstract class AbstractFilterScreen ex super.init(); widgets.clear(); - resetButton = new IconButton(guiLeft + background.width - 62, guiTop + background.height - 24, AllIcons.I_TRASH); - confirmButton = new IconButton(guiLeft + background.width - 33, guiTop + background.height - 24, AllIcons.I_CONFIRM); + resetButton = + new IconButton(guiLeft + background.width - 62, guiTop + background.height - 24, AllIcons.I_TRASH); + confirmButton = + new IconButton(guiLeft + background.width - 33, guiTop + background.height - 24, AllIcons.I_CONFIRM); widgets.add(resetButton); widgets.add(confirmButton); @@ -63,9 +65,9 @@ public abstract class AbstractFilterScreen ex textRenderer.draw(ms, I18n.format(container.filterItem.getTranslationKey()), x + 15, y + 3, 0xdedede); GuiGameElement.of(container.filterItem) - .at(guiLeft + background.width, guiTop +background.height -60) - .scale(5) - .render(ms); + .at(guiLeft + background.width, guiTop + background.height + 25) + .scale(5) + .render(ms); } @@ -75,7 +77,8 @@ public abstract class AbstractFilterScreen ex super.tick(); handleIndicators(); - if (!container.player.getHeldItemMainhand().equals(container.filterItem, false)) + if (!container.player.getHeldItemMainhand() + .equals(container.filterItem, false)) client.player.closeScreen(); } @@ -96,9 +99,12 @@ public abstract class AbstractFilterScreen ex List tooltipButtons = getTooltipButtons(); for (IconButton button : tooltipButtons) { - if (!button.getToolTip().isEmpty()) { - button.setToolTip(button.getToolTip().get(0)); - button.getToolTip().add(TooltipHelper.holdShift(Palette.Yellow, hasShiftDown())); + if (!button.getToolTip() + .isEmpty()) { + button.setToolTip(button.getToolTip() + .get(0)); + button.getToolTip() + .add(TooltipHelper.holdShift(Palette.Yellow, hasShiftDown())); } } @@ -144,8 +150,7 @@ public abstract class AbstractFilterScreen ex return mouseClicked; } - protected void contentsCleared() { - } + protected void contentsCleared() {} protected void sendOptionUpdate(Option option) { AllPackets.channel.sendToServer(new FilterScreenPacket(option)); diff --git a/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableScreen.java b/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableScreen.java index 18ff9f986..c3e628625 100644 --- a/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableScreen.java +++ b/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableScreen.java @@ -116,7 +116,7 @@ public class SchematicTableScreen extends AbstractSimiContainerScreen tools; @@ -63,7 +64,6 @@ public class ToolSelectionScreen extends Screen { if (!initialized) init(mc, mainWindow.getScaledWidth(), mainWindow.getScaledHeight()); - int x = (mainWindow.getScaledWidth() - w) / 2 + 15; int y = mainWindow.getScaledHeight() - h - 75; @@ -74,11 +74,14 @@ public class ToolSelectionScreen extends Screen { RenderSystem.enableBlend(); RenderSystem.color4f(1, 1, 1, focused ? 7 / 8f : 1 / 2f); - Minecraft.getInstance().getTextureManager().bindTexture(gray.location); + Minecraft.getInstance() + .getTextureManager() + .bindTexture(gray.location); drawTexture(matrixStack, x - 15, y, gray.startX, gray.startY, w, h, gray.width, gray.height); float toolTipAlpha = yOffset / 10; - List toolTip = tools.get(selection).getDescription(); + List toolTip = tools.get(selection) + .getDescription(); int stringAlphaComponent = ((int) (toolTipAlpha * 0xFF)) << 24; if (toolTipAlpha > 0.25f) { @@ -99,10 +102,11 @@ public class ToolSelectionScreen extends Screen { RenderSystem.color4f(1, 1, 1, 1); if (tools.size() > 1) { String keyName = AllKeys.TOOL_MENU.getBoundKey(); - int width = client.getWindow().getScaledWidth(); + int width = client.getWindow() + .getScaledWidth(); if (!focused) - drawCenteredString(matrixStack, client.fontRenderer, Lang.translate(holdToFocus, keyName).getUnformattedComponentText(), width / 2, y - 10, - 0xCCDDFF); + drawCenteredText(matrixStack, client.fontRenderer, Lang.translate(holdToFocus, keyName), width / 2, + y - 10, 0xCCDDFF); else drawCenteredString(matrixStack, client.fontRenderer, scrollToCycle, width / 2, y - 10, 0xCCDDFF); } else { @@ -115,14 +119,19 @@ public class ToolSelectionScreen extends Screen { float alpha = focused ? 1 : .2f; if (i == selection) { matrixStack.translate(0, -10, 0); - drawCenteredString(matrixStack, client.fontRenderer, tools.get(i).getDisplayName().getUnformattedComponentText(), x + i * 50 + 24, y + 28, - 0xCCDDFF); + drawCenteredString(matrixStack, client.fontRenderer, tools.get(i) + .getDisplayName() + .getString(), x + i * 50 + 24, y + 28, 0xCCDDFF); alpha = 1; } RenderSystem.color4f(0, 0, 0, alpha); - tools.get(i).getIcon().draw(matrixStack, this, x + i * 50 + 16, y + 12); + tools.get(i) + .getIcon() + .draw(matrixStack, this, x + i * 50 + 16, y + 12); RenderSystem.color4f(1, 1, 1, alpha); - tools.get(i).getIcon().draw(matrixStack, this, x + i * 50 + 16, y + 11); + tools.get(i) + .getIcon() + .draw(matrixStack, this, x + i * 50 + 16, y + 11); matrixStack.pop(); } diff --git a/src/main/java/com/simibubi/create/foundation/worldgen/OxidizingBlock.java b/src/main/java/com/simibubi/create/foundation/worldgen/OxidizingBlock.java index 83bc447ab..df0a4dc2a 100644 --- a/src/main/java/com/simibubi/create/foundation/worldgen/OxidizingBlock.java +++ b/src/main/java/com/simibubi/create/foundation/worldgen/OxidizingBlock.java @@ -71,13 +71,6 @@ public class OxidizingBlock extends Block { } } - @Override - public float getPlayerRelativeBlockHardness(BlockState blockState, PlayerEntity player, IBlockReader worldIn, - BlockPos pos) { - return super.getPlayerRelativeBlockHardness(blockState, player, worldIn, pos) - - 0.2f * blockState.get(OXIDIZATION); - } - @Override public ActionResultType onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult blockRayTraceResult) { From d973e9bcdd187afe0841220578e1505a4d124b08 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Tue, 13 Oct 2020 20:39:44 +0200 Subject: [PATCH 2/2] JEI fixes - Fluids in JEI now display the exact amount required - Fixed short background of custom compacting JEI - Fixed localization of sawing recipe category - Fixed blocks waterlogged by a pump not scheduling a fluid update --- src/generated/resources/.cache/cache | 20 ++++++------ .../resources/assets/create/lang/en_us.json | 4 ++- .../assets/create/lang/unfinished/de_de.json | 6 ++-- .../assets/create/lang/unfinished/fr_fr.json | 6 ++-- .../assets/create/lang/unfinished/it_it.json | 6 ++-- .../assets/create/lang/unfinished/ja_jp.json | 6 ++-- .../assets/create/lang/unfinished/ko_kr.json | 6 ++-- .../assets/create/lang/unfinished/nl_nl.json | 6 ++-- .../assets/create/lang/unfinished/pt_br.json | 6 ++-- .../assets/create/lang/unfinished/ru_ru.json | 6 ++-- .../assets/create/lang/unfinished/zh_cn.json | 6 ++-- .../compat/jei/category/BasinCategory.java | 6 +++- .../jei/category/CreateRecipeCategory.java | 31 ++++++++++++++++--- .../compat/jei/category/PackingCategory.java | 16 +++++----- .../contraptions/fluids/OpenEndedPipe.java | 2 ++ .../assets/create/lang/default/messages.json | 4 ++- 16 files changed, 94 insertions(+), 43 deletions(-) diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index cba0c628b..4c9737a9a 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -368,16 +368,16 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j 7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json 82524600ca83a766522129634a44b47a277a4b71 assets/create/lang/en_ud.json -c39a5082dd2b24a98e1f6c66884a855a72cd52f1 assets/create/lang/en_us.json -38515a29696ded8afad721e1d7e5825179ae358c assets/create/lang/unfinished/de_de.json -8376325bea8c0234b7634b6852b7016df9c8814f assets/create/lang/unfinished/fr_fr.json -ea8e85c8d7d5354429f420667537a7b62ab12a1c assets/create/lang/unfinished/it_it.json -12a7c0d56e705004deb23b2cc16eb84a419ce38b assets/create/lang/unfinished/ja_jp.json -6672691add00fdace20218ecbb6d6a46273aa765 assets/create/lang/unfinished/ko_kr.json -3e33fd417af5812b028834666de6983c78cbe05f assets/create/lang/unfinished/nl_nl.json -6f0a8d1ef696e514f40b3d5204d21e1391ed5686 assets/create/lang/unfinished/pt_br.json -f65718ac2d3d40a44f266fd7143e9a3b1067ffae assets/create/lang/unfinished/ru_ru.json -67e3f92bb97e5c441f8efe375a35662af0d805f4 assets/create/lang/unfinished/zh_cn.json +281575a7e3a9366ec0387cac521b0cfa2f8e4f3c assets/create/lang/en_us.json +f9a41ae797e8c22f754dd41afbda3aecdf93e46d assets/create/lang/unfinished/de_de.json +d8e3bbe36dee5c4a32e7ef380d24b503cba9e2ee assets/create/lang/unfinished/fr_fr.json +21682e4b2ce3c0979782bf5a039e6b9415c92d8b assets/create/lang/unfinished/it_it.json +04a9ea4a31ec349b250c0def154372786b912bac assets/create/lang/unfinished/ja_jp.json +dd78403b3c6d34bd7d2e3a6fc00df147f0d2481a assets/create/lang/unfinished/ko_kr.json +105ff3f47b16a93f491cf0af6a3ac6cb2690d90e assets/create/lang/unfinished/nl_nl.json +103c349cebf7911ec0a69289bd10dee60af1ae9f assets/create/lang/unfinished/pt_br.json +a64570d2ad77515f24128a426ddba51c7201910f assets/create/lang/unfinished/ru_ru.json +9740448b9801fb79c8004de155aafd0afe77a183 assets/create/lang/unfinished/zh_cn.json 846200eb548d3bfa2e77b41039de159b4b6cfb45 assets/create/models/block/acacia_window.json 1930fa3a3c98d53dd19e4ee7f55bc27fd47aa281 assets/create/models/block/acacia_window_pane_noside.json 1763ea2c9b981d187f5031ba608f3d5d3be3986a assets/create/models/block/acacia_window_pane_noside_alt.json diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index 2fa1e2ca6..0316e5aff 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -548,7 +548,7 @@ "create.recipe.pressing": "Pressing", "create.recipe.mixing": "Mixing", "create.recipe.packing": "Compacting", - "create.recipe.mechanical_sawing": "Sawing", + "create.recipe.sawing": "Sawing", "create.recipe.mechanical_crafting": "Mechanical Crafting", "create.recipe.block_cutting": "Block Cutting", "create.recipe.blockzapper_upgrade": "Handheld Blockzapper", @@ -571,6 +571,8 @@ "create.generic.unit.rpm": "RPM", "create.generic.unit.stress": "su", "create.generic.unit.degrees": "°", + "create.generic.unit.bucket": "1 Bucket", + "create.generic.unit.millibuckets": "%1$smB", "create.action.scroll": "Scroll", "create.action.confirm": "Confirm", diff --git a/src/generated/resources/assets/create/lang/unfinished/de_de.json b/src/generated/resources/assets/create/lang/unfinished/de_de.json index b661efce5..9d6b769e0 100644 --- a/src/generated/resources/assets/create/lang/unfinished/de_de.json +++ b/src/generated/resources/assets/create/lang/unfinished/de_de.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 859", + "_": "Missing Localizations: 861", "_": "->------------------------] Game Elements [------------------------<-", @@ -549,7 +549,7 @@ "create.recipe.pressing": "Mechanische Presse", "create.recipe.mixing": "UNLOCALIZED: Mixing", "create.recipe.packing": "UNLOCALIZED: Compacting", - "create.recipe.mechanical_sawing": "UNLOCALIZED: Sawing", + "create.recipe.sawing": "UNLOCALIZED: Sawing", "create.recipe.mechanical_crafting": "UNLOCALIZED: Mechanical Crafting", "create.recipe.block_cutting": "UNLOCALIZED: Block Cutting", "create.recipe.blockzapper_upgrade": "Blockpistole", @@ -572,6 +572,8 @@ "create.generic.unit.rpm": "UNLOCALIZED: RPM", "create.generic.unit.stress": "UNLOCALIZED: su", "create.generic.unit.degrees": "UNLOCALIZED: °", + "create.generic.unit.bucket": "UNLOCALIZED: 1 Bucket", + "create.generic.unit.millibuckets": "UNLOCALIZED: %1$smB", "create.action.scroll": "Wechseln", "create.action.confirm": "Bestätigen", diff --git a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json index f4c6759f9..87f8c63f2 100644 --- a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json +++ b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 483", + "_": "Missing Localizations: 486", "_": "->------------------------] Game Elements [------------------------<-", @@ -549,7 +549,7 @@ "create.recipe.pressing": "Pressage", "create.recipe.mixing": "Mixage", "create.recipe.packing": "Compactage", - "create.recipe.mechanical_sawing": "Sciage", + "create.recipe.sawing": "UNLOCALIZED: Sawing", "create.recipe.mechanical_crafting": "Fabrication mécanique", "create.recipe.block_cutting": "Coupe de bloc", "create.recipe.blockzapper_upgrade": "Blockzappeur portable", @@ -572,6 +572,8 @@ "create.generic.unit.rpm": "tr/min", "create.generic.unit.stress": "us", "create.generic.unit.degrees": "°", + "create.generic.unit.bucket": "UNLOCALIZED: 1 Bucket", + "create.generic.unit.millibuckets": "UNLOCALIZED: %1$smB", "create.action.scroll": "Faire défiler", "create.action.confirm": "Confirmer", diff --git a/src/generated/resources/assets/create/lang/unfinished/it_it.json b/src/generated/resources/assets/create/lang/unfinished/it_it.json index fe0aaf916..b48f549be 100644 --- a/src/generated/resources/assets/create/lang/unfinished/it_it.json +++ b/src/generated/resources/assets/create/lang/unfinished/it_it.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 467", + "_": "Missing Localizations: 470", "_": "->------------------------] Game Elements [------------------------<-", @@ -549,7 +549,7 @@ "create.recipe.pressing": "Pressatura", "create.recipe.mixing": "Mescolamento", "create.recipe.packing": "Compattazione", - "create.recipe.mechanical_sawing": "Segagione", + "create.recipe.sawing": "UNLOCALIZED: Sawing", "create.recipe.mechanical_crafting": "Creazione Meccanico", "create.recipe.block_cutting": "Taglio Blocco", "create.recipe.blockzapper_upgrade": "UNLOCALIZED: Handheld Blockzapper", @@ -572,6 +572,8 @@ "create.generic.unit.rpm": "RPM", "create.generic.unit.stress": "su", "create.generic.unit.degrees": "°", + "create.generic.unit.bucket": "UNLOCALIZED: 1 Bucket", + "create.generic.unit.millibuckets": "UNLOCALIZED: %1$smB", "create.action.scroll": "Scorri", "create.action.confirm": "Conferma", diff --git a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json index 9bd15ff78..d61034437 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json +++ b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 462", + "_": "Missing Localizations: 465", "_": "->------------------------] Game Elements [------------------------<-", @@ -549,7 +549,7 @@ "create.recipe.pressing": "押しつぶし", "create.recipe.mixing": "混合", "create.recipe.packing": "圧縮", - "create.recipe.mechanical_sawing": "製材", + "create.recipe.sawing": "UNLOCALIZED: Sawing", "create.recipe.mechanical_crafting": "メカニカルクラフト", "create.recipe.block_cutting": "ブロックカット", "create.recipe.blockzapper_upgrade": "携帯型ブロックザッパー", @@ -572,6 +572,8 @@ "create.generic.unit.rpm": "RPM", "create.generic.unit.stress": "su", "create.generic.unit.degrees": "°", + "create.generic.unit.bucket": "UNLOCALIZED: 1 Bucket", + "create.generic.unit.millibuckets": "UNLOCALIZED: %1$smB", "create.action.scroll": "スクロール", "create.action.confirm": "確認", diff --git a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json index 6974626a3..4092f308b 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json +++ b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 467", + "_": "Missing Localizations: 470", "_": "->------------------------] Game Elements [------------------------<-", @@ -549,7 +549,7 @@ "create.recipe.pressing": "압착", "create.recipe.mixing": "혼합", "create.recipe.packing": "압축", - "create.recipe.mechanical_sawing": "제재", + "create.recipe.sawing": "UNLOCALIZED: Sawing", "create.recipe.mechanical_crafting": "기계 조합", "create.recipe.block_cutting": "블럭 절단", "create.recipe.blockzapper_upgrade": "UNLOCALIZED: Handheld Blockzapper", @@ -572,6 +572,8 @@ "create.generic.unit.rpm": "RPM", "create.generic.unit.stress": "su", "create.generic.unit.degrees": "°", + "create.generic.unit.bucket": "UNLOCALIZED: 1 Bucket", + "create.generic.unit.millibuckets": "UNLOCALIZED: %1$smB", "create.action.scroll": "스크롤하세요", "create.action.confirm": "확인", diff --git a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json index f6c0015f9..84c31538f 100644 --- a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json +++ b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 797", + "_": "Missing Localizations: 800", "_": "->------------------------] Game Elements [------------------------<-", @@ -549,7 +549,7 @@ "create.recipe.pressing": "Persen", "create.recipe.mixing": "Mengen", "create.recipe.packing": "Compressen", - "create.recipe.mechanical_sawing": "Zagen", + "create.recipe.sawing": "UNLOCALIZED: Sawing", "create.recipe.mechanical_crafting": "UNLOCALIZED: Mechanical Crafting", "create.recipe.block_cutting": "Blok Zagen", "create.recipe.blockzapper_upgrade": "Blokzapper", @@ -572,6 +572,8 @@ "create.generic.unit.rpm": "UNLOCALIZED: RPM", "create.generic.unit.stress": "UNLOCALIZED: su", "create.generic.unit.degrees": "UNLOCALIZED: °", + "create.generic.unit.bucket": "UNLOCALIZED: 1 Bucket", + "create.generic.unit.millibuckets": "UNLOCALIZED: %1$smB", "create.action.scroll": "Scroll", "create.action.confirm": "Bevestigen", diff --git a/src/generated/resources/assets/create/lang/unfinished/pt_br.json b/src/generated/resources/assets/create/lang/unfinished/pt_br.json index 9a40bd444..acaa6ac0c 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pt_br.json +++ b/src/generated/resources/assets/create/lang/unfinished/pt_br.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 866", + "_": "Missing Localizations: 868", "_": "->------------------------] Game Elements [------------------------<-", @@ -549,7 +549,7 @@ "create.recipe.pressing": "Prensa Mecânica", "create.recipe.mixing": "UNLOCALIZED: Mixing", "create.recipe.packing": "UNLOCALIZED: Compacting", - "create.recipe.mechanical_sawing": "UNLOCALIZED: Sawing", + "create.recipe.sawing": "UNLOCALIZED: Sawing", "create.recipe.mechanical_crafting": "UNLOCALIZED: Mechanical Crafting", "create.recipe.block_cutting": "UNLOCALIZED: Block Cutting", "create.recipe.blockzapper_upgrade": "Blockzapper Portátil", @@ -572,6 +572,8 @@ "create.generic.unit.rpm": "UNLOCALIZED: RPM", "create.generic.unit.stress": "UNLOCALIZED: su", "create.generic.unit.degrees": "UNLOCALIZED: °", + "create.generic.unit.bucket": "UNLOCALIZED: 1 Bucket", + "create.generic.unit.millibuckets": "UNLOCALIZED: %1$smB", "create.action.scroll": "Rolar", "create.action.confirm": "Confirmar", diff --git a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json index 87490ca75..250d9e26c 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json +++ b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 860", + "_": "Missing Localizations: 862", "_": "->------------------------] Game Elements [------------------------<-", @@ -549,7 +549,7 @@ "create.recipe.pressing": "Механический пресс", "create.recipe.mixing": "UNLOCALIZED: Mixing", "create.recipe.packing": "UNLOCALIZED: Compacting", - "create.recipe.mechanical_sawing": "UNLOCALIZED: Sawing", + "create.recipe.sawing": "UNLOCALIZED: Sawing", "create.recipe.mechanical_crafting": "UNLOCALIZED: Mechanical Crafting", "create.recipe.block_cutting": "UNLOCALIZED: Block Cutting", "create.recipe.blockzapper_upgrade": "Портативный размещатель блоков", @@ -572,6 +572,8 @@ "create.generic.unit.rpm": "UNLOCALIZED: RPM", "create.generic.unit.stress": "UNLOCALIZED: su", "create.generic.unit.degrees": "UNLOCALIZED: °", + "create.generic.unit.bucket": "UNLOCALIZED: 1 Bucket", + "create.generic.unit.millibuckets": "UNLOCALIZED: %1$smB", "create.action.scroll": "КолМыши", "create.action.confirm": "Подтвердить", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json index 18fc9dbaa..7b0efd44d 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 147", + "_": "Missing Localizations: 150", "_": "->------------------------] Game Elements [------------------------<-", @@ -549,7 +549,7 @@ "create.recipe.pressing": "金属压片", "create.recipe.mixing": "混合搅拌", "create.recipe.packing": "压块塑形", - "create.recipe.mechanical_sawing": "木材切割", + "create.recipe.sawing": "UNLOCALIZED: Sawing", "create.recipe.mechanical_crafting": "自动合成", "create.recipe.block_cutting": "方块切割", "create.recipe.blockzapper_upgrade": "UNLOCALIZED: Handheld Blockzapper", @@ -572,6 +572,8 @@ "create.generic.unit.rpm": "RPM", "create.generic.unit.stress": "su", "create.generic.unit.degrees": "°", + "create.generic.unit.bucket": "UNLOCALIZED: 1 Bucket", + "create.generic.unit.millibuckets": "UNLOCALIZED: %1$smB", "create.action.scroll": "滚轮", "create.action.confirm": "确认", diff --git a/src/main/java/com/simibubi/create/compat/jei/category/BasinCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/BasinCategory.java index 997ccaa1e..4dd186a61 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/BasinCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/BasinCategory.java @@ -6,6 +6,7 @@ import java.util.stream.Collectors; import org.apache.commons.lang3.mutable.MutableInt; +import com.google.common.collect.ImmutableList; import com.simibubi.create.content.contraptions.processing.BasinRecipe; import com.simibubi.create.content.contraptions.processing.HeatCondition; import com.simibubi.create.foundation.fluid.FluidIngredient; @@ -108,6 +109,8 @@ public class BasinCategory extends CreateRecipeCategory { fluidStacks.init(j, false, 142, 51 + yOffset); fluidStacks.set(j, fluidOutput); } + + addFluidTooltip(fluidStacks, fluidIngredients, ImmutableList.of(fluidOutput)); } @Override @@ -118,6 +121,7 @@ public class BasinCategory extends CreateRecipeCategory { int xOffset = size < 3 ? (3 - size) * 19 / 2 : 0; HeatCondition requiredHeat = recipe.getRequiredHeat(); int yOffset = requiredHeat != HeatCondition.NONE ? 30 : 10; + for (int i = 0; i < size; i++) AllGuiTextures.JEI_SLOT.draw(16 + xOffset + (i % 3) * 19, 50 - (i / 3) * 19 + yOffset); @@ -125,5 +129,5 @@ public class BasinCategory extends CreateRecipeCategory { AllGuiTextures.JEI_DOWN_ARROW.draw(136, 32 + yOffset); AllGuiTextures.JEI_SHADOW.draw(81, 57 + yOffset); } - + } diff --git a/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java index 59e5a866d..7ae9784f8 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java @@ -1,5 +1,6 @@ package com.simibubi.create.compat.jei.category; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -8,10 +9,12 @@ import com.simibubi.create.compat.jei.DoubleItemIcon; import com.simibubi.create.compat.jei.EmptyBackground; import com.simibubi.create.content.contraptions.processing.ProcessingOutput; import com.simibubi.create.content.contraptions.processing.ProcessingRecipe; +import com.simibubi.create.foundation.fluid.FluidIngredient; import com.simibubi.create.foundation.gui.AllGuiTextures; import com.simibubi.create.foundation.utility.Lang; import mezz.jei.api.gui.drawable.IDrawable; +import mezz.jei.api.gui.ingredient.IGuiFluidStackGroup; import mezz.jei.api.gui.ingredient.IGuiItemStackGroup; import mezz.jei.api.recipe.category.IRecipeCategory; import net.minecraft.item.ItemStack; @@ -19,6 +22,7 @@ import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.IItemProvider; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fluids.FluidStack; public abstract class CreateRecipeCategory> implements IRecipeCategory { @@ -62,7 +66,9 @@ public abstract class CreateRecipeCategory> implements IRec List rollableResults = processingRecipe.getRollableResults(); if (rollableResults.size() <= index) return jeiSlot; - if (processingRecipe.getRollableResults().get(index).getChance() == 1) + if (processingRecipe.getRollableResults() + .get(index) + .getChance() == 1) return jeiSlot; return AllGuiTextures.JEI_CHANCE_SLOT; } @@ -85,8 +91,25 @@ public abstract class CreateRecipeCategory> implements IRec return; ProcessingOutput output = results.get(slotIndex - 1); if (output.getChance() != 1) - tooltip.add(1, TextFormatting.GOLD - + Lang.translate("recipe.processing.chance", (int) (output.getChance() * 100))); + tooltip.add(1, + TextFormatting.GOLD + Lang.translate("recipe.processing.chance", (int) (output.getChance() * 100))); + }); + } + + protected static void addFluidTooltip(IGuiFluidStackGroup fluidStacks, List inputs, + List outputs) { + List amounts = new ArrayList<>(); + inputs.forEach(f -> amounts.add(f.getRequiredAmount())); + outputs.forEach(f -> amounts.add(f.getAmount())); + + fluidStacks.addTooltipCallback((slotIndex, input, ingredient, tooltip) -> { + int amount = amounts.get(slotIndex); + String text = TextFormatting.GOLD + (amount == 1000 ? Lang.translate("generic.unit.bucket") + : Lang.translate("generic.unit.millibuckets", amount)); + if (tooltip.isEmpty()) + tooltip.add(0, text); + else + tooltip.set(0, tooltip.get(0) + " " + text); }); } @@ -99,7 +122,7 @@ public abstract class CreateRecipeCategory> implements IRec Float chance = catalystIndices.get(slotIndex); tooltip.add(1, TextFormatting.YELLOW + Lang.translate("recipe.processing.catalyst")); tooltip.add(2, TextFormatting.GOLD - + Lang.translate("recipe.processing.chanceToReturn", (int) (chance.floatValue() * 100))); + + Lang.translate("recipe.processing.chanceToReturn", (int) (chance.floatValue() * 100))); }); } diff --git a/src/main/java/com/simibubi/create/compat/jei/category/PackingCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/PackingCategory.java index b554fea4f..785eba40c 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/PackingCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/PackingCategory.java @@ -19,7 +19,7 @@ public class PackingCategory extends BasinCategory { public PackingCategory() { super("packing", doubleItemIcon(AllBlocks.MECHANICAL_PRESS.get(), AllBlocks.BASIN.get()), - emptyBackground(177, 70)); + emptyBackground(177, 110)); } @Override @@ -37,12 +37,12 @@ public class PackingCategory extends BasinCategory { int rows = size == 4 ? 2 : 3; while (i < size) { Ingredient ingredient = ingredients2.get(i); - itemStacks.init(i, true, (rows == 2 ? 26 : 17) + (i % rows) * 19, 50 - (i / rows) * 19); + itemStacks.init(i, true, (rows == 2 ? 26 : 17) + (i % rows) * 19, 60 - (i / rows) * 19); itemStacks.set(i, Arrays.asList(ingredient.getMatchingStacks())); i++; } - itemStacks.init(i, false, 141, 50); + itemStacks.init(i, false, 141, 60); itemStacks.set(i, recipe.getRecipeOutput()); } @@ -56,13 +56,13 @@ public class PackingCategory extends BasinCategory { int size = ingredients2.size(); int rows = size == 4 ? 2 : 3; for (int i = 0; i < size; i++) - AllGuiTextures.JEI_SLOT.draw((rows == 2 ? 26 : 17) + (i % rows) * 19, 50 - (i / rows) * 19); - AllGuiTextures.JEI_SLOT.draw(141, 50); - AllGuiTextures.JEI_DOWN_ARROW.draw(136, 32); - AllGuiTextures.JEI_SHADOW.draw(81, 57); + AllGuiTextures.JEI_SLOT.draw((rows == 2 ? 26 : 17) + (i % rows) * 19, 60 - (i / rows) * 19); + AllGuiTextures.JEI_SLOT.draw(141, 60); + AllGuiTextures.JEI_DOWN_ARROW.draw(136, 42); + AllGuiTextures.JEI_SHADOW.draw(81, 67); } - press.draw(getBackground().getWidth() / 2 + 6, 30); + press.draw(getBackground().getWidth() / 2 + 6, 40); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/OpenEndedPipe.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/OpenEndedPipe.java index 29e89f1f9..bca6ec22e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/OpenEndedPipe.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/OpenEndedPipe.java @@ -59,6 +59,7 @@ public class OpenEndedPipe { return; if (waterlog) { world.setBlockState(outputPos, state.with(BlockStateProperties.WATERLOGGED, false), 3); + world.getPendingFluidTicks().scheduleTick(outputPos, Fluids.WATER, 1); return; } world.setBlockState(outputPos, fluidState.getBlockState() @@ -79,6 +80,7 @@ public class OpenEndedPipe { if (providedFluid.getFluid() != Fluids.WATER) return; world.setBlockState(outputPos, state.with(BlockStateProperties.WATERLOGGED, true), 3); + world.getPendingFluidTicks().scheduleTick(outputPos, Fluids.WATER, 1); return; } world.setBlockState(outputPos, providedFluid.getDefaultState() diff --git a/src/main/resources/assets/create/lang/default/messages.json b/src/main/resources/assets/create/lang/default/messages.json index 75fb0cb01..be00c5acc 100644 --- a/src/main/resources/assets/create/lang/default/messages.json +++ b/src/main/resources/assets/create/lang/default/messages.json @@ -23,7 +23,7 @@ "create.recipe.pressing": "Pressing", "create.recipe.mixing": "Mixing", "create.recipe.packing": "Compacting", - "create.recipe.mechanical_sawing": "Sawing", + "create.recipe.sawing": "Sawing", "create.recipe.mechanical_crafting": "Mechanical Crafting", "create.recipe.block_cutting": "Block Cutting", "create.recipe.blockzapper_upgrade": "Handheld Blockzapper", @@ -46,6 +46,8 @@ "create.generic.unit.rpm": "RPM", "create.generic.unit.stress": "su", "create.generic.unit.degrees": "\u00B0", + "create.generic.unit.bucket": "1 Bucket", + "create.generic.unit.millibuckets": "%1$smB", "create.action.scroll": "Scroll", "create.action.confirm": "Confirm",