diff --git a/src/generated/resources/assets/create/lang/en_ud.json b/src/generated/resources/assets/create/lang/en_ud.json index 410fc4a6c0..d057eb5e3f 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 6bbad25ffa..9dbe7e2ea9 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 78f7667a1f..3696c9f696 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 @@ -437,6 +437,8 @@ protected void initializePrinter(ItemStack blueprint) { if (!blueprint.hasTag()) { state = State.STOPPED; statusMsg = "schematicInvalid"; + inventory.setStackInSlot(1, inventory.getStackInSlot(0).copy()); + inventory.setStackInSlot(0, ItemStack.EMPTY); sendUpdate = true; return; } @@ -445,6 +447,8 @@ protected void initializePrinter(ItemStack blueprint) { .getBoolean("Deployed")) { state = State.STOPPED; statusMsg = "schematicNotPlaced"; + inventory.setStackInSlot(1, inventory.getStackInSlot(0).copy()); + inventory.setStackInSlot(0, ItemStack.EMPTY); sendUpdate = true; return; } @@ -455,8 +459,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; @@ -465,8 +469,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; @@ -476,6 +480,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; @@ -568,9 +574,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 4f6f5f5780..48ed0cd758 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 95dbf0d114..7c1af77a11 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 @@ -46,7 +46,8 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen