diff --git a/gradle.properties b/gradle.properties index 35b39fd5a..ca453462b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ org.gradle.jvmargs = -Xmx3G org.gradle.daemon = false # mod version info -mod_version = 0.5.0.h +mod_version = 0.5.0.i artifact_minecraft_version = 1.18.2 minecraft_version = 1.18.2 diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index b5f97f4e9..446f8e950 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -559,7 +559,7 @@ bf2b0310500213ff853c748c236eb5d01f61658e assets/create/blockstates/yellow_toolbo 7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json f85edc574ee6de0de7693ffb031266643db6724a assets/create/lang/en_ud.json -c219c77242e645f32704201dd80e279b3759b794 assets/create/lang/en_us.json +7e9712249a13bd4760d58e041473487ada1326ba assets/create/lang/en_us.json 487a511a01b2a4531fb672f917922312db78f958 assets/create/models/block/acacia_window.json b48060cba1a382f373a05bf0039054053eccf076 assets/create/models/block/acacia_window_pane_noside.json 3066db1bf03cffa1a9c7fbacf47ae586632f4eb3 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 f29227a7a..e096e7fe6 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -1119,6 +1119,7 @@ "create.schematicAndQuill.saved": "Saved as %1$s", "create.schematic.invalid": "[!] Invalid Item - Use the Schematic Table instead", + "create.schematic.error": "Schematic failed to Load - Check Game Logs", "create.schematic.position": "Position", "create.schematic.rotation": "Rotation", "create.schematic.rotation.none": "None", @@ -1212,6 +1213,8 @@ "create.schematicannon.status.schematicInvalid": "Schematic Invalid", "create.schematicannon.status.schematicNotPlaced": "Schematic not Positioned", "create.schematicannon.status.schematicExpired": "Schematic File Expired", + "create.schematicannon.status.schematicErrored": "Incompatible Blocks", + "create.schematicannon.status.schematicErroredCheckLogs": "Check Server Logs", "create.materialChecklist": "Material Checklist", "create.materialChecklist.blocksNotLoaded": "* Disclaimer *\n\nMaterial List may be inaccurate due to relevant chunks not being loaded.", diff --git a/src/main/java/com/simibubi/create/Create.java b/src/main/java/com/simibubi/create/Create.java index a5ee44809..9aac192be 100644 --- a/src/main/java/com/simibubi/create/Create.java +++ b/src/main/java/com/simibubi/create/Create.java @@ -67,7 +67,7 @@ public class Create { public static final String ID = "create"; public static final String NAME = "Create"; - public static final String VERSION = "0.5h"; + public static final String VERSION = "0.5i"; public static final Logger LOGGER = LogUtils.getLogger(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java index bb1459491..abb17176e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java @@ -169,6 +169,8 @@ public class BeltTileEntity extends KineticTileEntity { protected void initializeItemHandler() { if (level.isClientSide || itemHandler.isPresent()) return; + if (beltLength == 0 || controller == null) + return; if (!level.isLoaded(controller)) return; BlockEntity te = level.getBlockEntity(controller); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/ItemHandlerBeltSegment.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/ItemHandlerBeltSegment.java index b356d04eb..5cd73adb7 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/ItemHandlerBeltSegment.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/ItemHandlerBeltSegment.java @@ -52,6 +52,8 @@ public class ItemHandlerBeltSegment implements IItemHandler { amount = Math.min(amount, transported.stack.getCount()); ItemStack extracted = simulate ? transported.stack.copy().split(amount) : transported.stack.split(amount); if (!simulate) { + if (transported.stack.isEmpty()) + this.beltInventory.toRemove.add(transported); this.beltInventory.belt.setChanged(); this.beltInventory.belt.sendData(); } diff --git a/src/main/java/com/simibubi/create/content/schematics/SchematicPrinter.java b/src/main/java/com/simibubi/create/content/schematics/SchematicPrinter.java index 528e67b2b..4b0042239 100644 --- a/src/main/java/com/simibubi/create/content/schematics/SchematicPrinter.java +++ b/src/main/java/com/simibubi/create/content/schematics/SchematicPrinter.java @@ -5,6 +5,7 @@ import java.util.List; import java.util.stream.Collectors; import com.simibubi.create.AllBlocks; +import com.simibubi.create.Create; import com.simibubi.create.content.contraptions.components.structureMovement.BlockMovementChecks; import com.simibubi.create.content.contraptions.components.structureMovement.StructureTransform; import com.simibubi.create.content.schematics.item.SchematicItem; @@ -37,6 +38,7 @@ public class SchematicPrinter { } private boolean schematicLoaded; + private boolean isErrored; private SchematicWorld blockReader; private BlockPos schematicAnchor; @@ -93,7 +95,16 @@ public class SchematicPrinter { schematicAnchor = NbtUtils.readBlockPos(blueprint.getTag() .getCompound("Anchor")); blockReader = new SchematicWorld(schematicAnchor, originalWorld); - activeTemplate.placeInWorld(blockReader, schematicAnchor, schematicAnchor, settings, blockReader.getRandom(), Block.UPDATE_CLIENTS); + + try { + activeTemplate.placeInWorld(blockReader, schematicAnchor, schematicAnchor, settings, + blockReader.getRandom(), Block.UPDATE_CLIENTS); + } catch (Exception e) { + Create.LOGGER.error("Failed to load Schematic for Printing", e); + schematicLoaded = true; + isErrored = true; + return; + } BlockPos extraBounds = StructureTemplate.calculateRelativePosition(settings, new BlockPos(activeTemplate.getSize()) .offset(-1, -1, -1)); @@ -115,6 +126,7 @@ public class SchematicPrinter { public void resetSchematic() { schematicLoaded = false; schematicAnchor = null; + isErrored = false; currentPos = null; blockReader = null; printingEntityIndex = -1; @@ -125,9 +137,13 @@ public class SchematicPrinter { public boolean isLoaded() { return schematicLoaded; } + + public boolean isErrored() { + return isErrored; + } public BlockPos getCurrentTarget() { - if (!isLoaded()) + if (!isLoaded() || isErrored()) return null; return schematicAnchor.offset(currentPos); } diff --git a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonScreen.java b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonScreen.java index 08d759717..1bc16501c 100644 --- a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonScreen.java +++ b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonScreen.java @@ -310,6 +310,10 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen cap : attachedInventories) { diff --git a/src/main/java/com/simibubi/create/content/schematics/client/SchematicHandler.java b/src/main/java/com/simibubi/create/content/schematics/client/SchematicHandler.java index b12481874..85d93d52a 100644 --- a/src/main/java/com/simibubi/create/content/schematics/client/SchematicHandler.java +++ b/src/main/java/com/simibubi/create/content/schematics/client/SchematicHandler.java @@ -8,6 +8,7 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllItems; import com.simibubi.create.AllKeys; +import com.simibubi.create.Create; import com.simibubi.create.content.contraptions.components.structureMovement.StructureTransform; import com.simibubi.create.content.schematics.SchematicWorld; import com.simibubi.create.content.schematics.client.tools.Tools; @@ -18,6 +19,7 @@ import com.simibubi.create.content.schematics.packet.SchematicSyncPacket; import com.simibubi.create.foundation.networking.AllPackets; import com.simibubi.create.foundation.render.SuperRenderTypeBuffer; import com.simibubi.create.foundation.utility.AnimationTickHolder; +import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.foundation.utility.NBTHelper; import com.simibubi.create.foundation.utility.outliner.AABBOutline; @@ -157,7 +159,15 @@ public class SchematicHandler { BlockPos pos; pos = BlockPos.ZERO; - schematic.placeInWorld(w, pos, pos, placementSettings, w.getRandom(), Block.UPDATE_CLIENTS); + + try { + schematic.placeInWorld(w, pos, pos, placementSettings, w.getRandom(), Block.UPDATE_CLIENTS); + } catch (Exception e) { + Minecraft.getInstance().player.displayClientMessage(Lang.translate("schematic.error") + .component(), false); + Create.LOGGER.error("Failed to load Schematic for Previewing", e); + return; + } placementSettings.setMirror(Mirror.FRONT_BACK); pos = BlockPos.ZERO.east(size.getX() - 1); diff --git a/src/main/java/com/simibubi/create/content/schematics/packet/SchematicPlacePacket.java b/src/main/java/com/simibubi/create/content/schematics/packet/SchematicPlacePacket.java index 2dc60cdb7..70577c188 100644 --- a/src/main/java/com/simibubi/create/content/schematics/packet/SchematicPlacePacket.java +++ b/src/main/java/com/simibubi/create/content/schematics/packet/SchematicPlacePacket.java @@ -39,7 +39,7 @@ public class SchematicPlacePacket extends SimplePacketBase { Level world = player.getLevel(); SchematicPrinter printer = new SchematicPrinter(); printer.loadSchematic(stack, world, !player.canUseGameMasterBlocks()); - if (!printer.isLoaded()) + if (!printer.isLoaded() || printer.isErrored()) return; boolean includeAir = AllConfigs.SERVER.schematics.creativePrintIncludesAir.get(); diff --git a/src/main/resources/assets/create/lang/default/interface.json b/src/main/resources/assets/create/lang/default/interface.json index 2c861151e..af6879a3a 100644 --- a/src/main/resources/assets/create/lang/default/interface.json +++ b/src/main/resources/assets/create/lang/default/interface.json @@ -271,6 +271,7 @@ "create.schematicAndQuill.saved": "Saved as %1$s", "create.schematic.invalid": "[!] Invalid Item - Use the Schematic Table instead", + "create.schematic.error": "Schematic failed to Load - Check Game Logs", "create.schematic.position": "Position", "create.schematic.rotation": "Rotation", "create.schematic.rotation.none": "None", @@ -369,6 +370,8 @@ "create.schematicannon.status.schematicInvalid": "Schematic Invalid", "create.schematicannon.status.schematicNotPlaced": "Schematic not Positioned", "create.schematicannon.status.schematicExpired": "Schematic File Expired", + "create.schematicannon.status.schematicErrored": "Incompatible Blocks", + "create.schematicannon.status.schematicErroredCheckLogs": "Check Server Logs", "create.materialChecklist": "Material Checklist", "create.materialChecklist.blocksNotLoaded": "* Disclaimer *\n\nMaterial List may be inaccurate due to relevant chunks not being loaded.",