diff --git a/src/generated/resources/assets/create/lang/en_ud.json b/src/generated/resources/assets/create/lang/en_ud.json index 6e7b2b2b4c..fe48884324 100644 --- a/src/generated/resources/assets/create/lang/en_ud.json +++ b/src/generated/resources/assets/create/lang/en_ud.json @@ -1319,7 +1319,8 @@ "create.gui.schematicannon.showOptions": "sbuıʇʇǝS ɹǝʇuıɹԀ ʍoɥS", "create.gui.schematicannon.slot.gunpowder": "uouuɐɔ ǝɥʇ ןǝnɟ oʇ ɹǝpʍodunb ppⱯ", "create.gui.schematicannon.slot.listPrinter": "ɔıʇɐɯǝɥɔS ɹnoʎ ɹoɟ ʇsıןʞɔǝɥƆ ɐ ʇuıɹd oʇ ǝɹǝɥ ʞooᗺ ɹo pɹɐoqdıןƆ ɐ ǝɔɐןԀ", - "create.gui.schematicannon.slot.schematic": "˙uoıʇɐɔoן ɔıɟıɔǝds ɐ ʇɐ pǝʎoןdǝp sı ʇı ǝɹns ǝʞɐW ˙ǝɹǝɥ ɔıʇɐɯǝɥɔS ɹnoʎ ppⱯ", + "create.gui.schematicannon.slot.schematicDisabled": "˙ʇoןs ɹǝɥʇo ǝɥʇ uo ɔıʇɐɯǝɥɔS ǝɥʇ ǝʌoɯǝᴚ ˙ɔıʇɐɯǝɥɔS ǝuo ʎןuo pןoɥ uɐɔ uouuɐɔ ǝɥ⟘", + "create.gui.schematicannon.slot.schematicEnabled": "˙uoıʇɐɔoן ɔıɟıɔǝds ɐ ʇɐ pǝʎoןdǝp sı ʇı ǝɹns ǝʞɐW ˙ǝɹǝɥ ɔıʇɐɯǝɥɔS ɹnoʎ ppⱯ", "create.gui.schematicannon.title": "uouuɐɔıʇɐɯǝɥɔS", "create.gui.scrollInput.defaultTitle": ":uoıʇdO uɐ ǝsooɥƆ", "create.gui.scrollInput.scrollToAdjustAmount": "ʇunoɯⱯ ʇsnظpⱯ oʇ ןןoɹɔS", diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index ba197d10dd..b04d88f58a 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -1319,7 +1319,8 @@ "create.gui.schematicannon.showOptions": "Show Printer Settings", "create.gui.schematicannon.slot.gunpowder": "Add gunpowder to fuel the cannon", "create.gui.schematicannon.slot.listPrinter": "Place a Clipboard or Book here to print a Checklist for your Schematic", - "create.gui.schematicannon.slot.schematic": "Add your Schematic here. Make sure it is deployed at a specific location.", + "create.gui.schematicannon.slot.schematicDisabled": "The cannon can hold only one Schematic. Remove the Schematic on the other slot.", + "create.gui.schematicannon.slot.schematicEnabled": "Add your Schematic here. Make sure it is deployed at a specific location.", "create.gui.schematicannon.title": "Schematicannon", "create.gui.scrollInput.defaultTitle": "Choose an Option:", "create.gui.scrollInput.scrollToAdjustAmount": "Scroll to Adjust Amount", diff --git a/src/main/java/com/simibubi/create/content/schematics/cannon/SchematicannonBlockEntity.java b/src/main/java/com/simibubi/create/content/schematics/cannon/SchematicannonBlockEntity.java index 16f0757dfb..95caec17b9 100644 --- a/src/main/java/com/simibubi/create/content/schematics/cannon/SchematicannonBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/schematics/cannon/SchematicannonBlockEntity.java @@ -446,6 +446,8 @@ protected void initializePrinter(ItemStack blueprint) { if (!blueprint.has(AllDataComponents.SCHEMATIC_ANCHOR)) { state = State.STOPPED; statusMsg = "schematicInvalid"; + inventory.setStackInSlot(1, inventory.getStackInSlot(0).copy()); + inventory.setStackInSlot(0, ItemStack.EMPTY); sendUpdate = true; return; } @@ -453,6 +455,8 @@ protected void initializePrinter(ItemStack blueprint) { if (!blueprint.getOrDefault(AllDataComponents.SCHEMATIC_DEPLOYED, false)) { state = State.STOPPED; statusMsg = "schematicNotPlaced"; + inventory.setStackInSlot(1, inventory.getStackInSlot(0).copy()); + inventory.setStackInSlot(0, ItemStack.EMPTY); sendUpdate = true; return; } @@ -463,8 +467,8 @@ protected void initializePrinter(ItemStack blueprint) { if (printer.isErrored()) { state = State.STOPPED; statusMsg = "schematicErrored"; - inventory.setStackInSlot(0, ItemStack.EMPTY); inventory.setStackInSlot(1, new ItemStack(AllItems.EMPTY_SCHEMATIC.get())); + inventory.setStackInSlot(0, ItemStack.EMPTY); printer.resetSchematic(); sendUpdate = true; return; @@ -473,8 +477,8 @@ protected void initializePrinter(ItemStack blueprint) { if (printer.isWorldEmpty()) { state = State.STOPPED; statusMsg = "schematicExpired"; - inventory.setStackInSlot(0, ItemStack.EMPTY); inventory.setStackInSlot(1, new ItemStack(AllItems.EMPTY_SCHEMATIC.get())); + inventory.setStackInSlot(0, ItemStack.EMPTY); printer.resetSchematic(); sendUpdate = true; return; @@ -484,6 +488,8 @@ protected void initializePrinter(ItemStack blueprint) { .closerThan(getBlockPos(), MAX_ANCHOR_DISTANCE)) { state = State.STOPPED; statusMsg = "targetOutsideRange"; + inventory.setStackInSlot(1, inventory.getStackInSlot(0).copy()); + inventory.setStackInSlot(0, ItemStack.EMPTY); printer.resetSchematic(); sendUpdate = true; return; @@ -579,9 +585,8 @@ protected boolean grabItemsFromAttachedInventories(ItemRequirement.StackRequirem public void finishedPrinting() { if (replaceMode == ConfigureSchematicannonPacket.Option.REPLACE_EMPTY.ordinal()) printer.sendBlockUpdates(level); + inventory.setStackInSlot(1, new ItemStack(AllItems.EMPTY_SCHEMATIC.get())); inventory.setStackInSlot(0, ItemStack.EMPTY); - inventory.setStackInSlot(1, new ItemStack(AllItems.EMPTY_SCHEMATIC.get(), inventory.getStackInSlot(1) - .getCount() + 1)); state = State.STOPPED; statusMsg = "finished"; resetPrinter(); diff --git a/src/main/java/com/simibubi/create/content/schematics/cannon/SchematicannonInventory.java b/src/main/java/com/simibubi/create/content/schematics/cannon/SchematicannonInventory.java index 554e056323..87eb540a0c 100644 --- a/src/main/java/com/simibubi/create/content/schematics/cannon/SchematicannonInventory.java +++ b/src/main/java/com/simibubi/create/content/schematics/cannon/SchematicannonInventory.java @@ -25,7 +25,7 @@ protected void onContentsChanged(int slot) { public boolean isItemValid(int slot, ItemStack stack) { switch (slot) { case 0: // Blueprint Slot - return AllItems.SCHEMATIC.isIn(stack); + return getStackInSlot(1).isEmpty() && AllItems.SCHEMATIC.isIn(stack); case 1: // Blueprint output return false; case 2: // Book input diff --git a/src/main/java/com/simibubi/create/content/schematics/cannon/SchematicannonScreen.java b/src/main/java/com/simibubi/create/content/schematics/cannon/SchematicannonScreen.java index f971455fe8..3f58b0ea94 100644 --- a/src/main/java/com/simibubi/create/content/schematics/cannon/SchematicannonScreen.java +++ b/src/main/java/com/simibubi/create/content/schematics/cannon/SchematicannonScreen.java @@ -45,7 +45,8 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen