diff --git a/README.md b/README.md
index 987cb9d1a..e8ac2558f 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
-
+
diff --git a/gradle.properties b/gradle.properties
index 340771ddd..be9c57960 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -4,11 +4,11 @@ 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.19.2
minecraft_version = 1.19.2
-forge_version = 43.1.52
+forge_version = 43.2.4
# build dependency versions
forgegradle_version = 5.1.53
diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json
index 8daeca21e..566bc6fca 100644
--- a/src/generated/resources/assets/create/lang/en_us.json
+++ b/src/generated/resources/assets/create/lang/en_us.json
@@ -1121,6 +1121,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",
@@ -1214,6 +1215,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.",
@@ -1750,6 +1753,9 @@
"create.contraption.minecart_contraption_too_big": "This Cart Contraption seems too big to pick up",
"create.contraption.minecart_contraption_illegal_pickup": "A mystical force is binding this Cart Contraption to the world",
+ "enchantment.create.capacity.desc": "Increases Backtank air capacity.",
+ "enchantment.create.potato_recovery.desc": "Potato Cannon projectiles have a chance to be reused.",
+
"_": "->------------------------] Subtitles [------------------------<-",
diff --git a/src/main/java/com/simibubi/create/Create.java b/src/main/java/com/simibubi/create/Create.java
index 03c1b517c..5cfc75a42 100644
--- a/src/main/java/com/simibubi/create/Create.java
+++ b/src/main/java/com/simibubi/create/Create.java
@@ -65,7 +65,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 ed95b784f..563712d99 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
@@ -168,6 +168,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/logistics/trains/TrackGraphSync.java b/src/main/java/com/simibubi/create/content/logistics/trains/TrackGraphSync.java
index 2c52fe585..dfd5d0e36 100644
--- a/src/main/java/com/simibubi/create/content/logistics/trains/TrackGraphSync.java
+++ b/src/main/java/com/simibubi/create/content/logistics/trains/TrackGraphSync.java
@@ -54,22 +54,26 @@ public class TrackGraphSync {
public void nodeAdded(TrackGraph graph, TrackNode node) {
flushGraphPacket(graph);
currentGraphSyncPacket.addedNodes.put(node.getNetId(), Pair.of(node.getLocation(), node.getNormal()));
+ currentPayload++;
}
public void edgeAdded(TrackGraph graph, TrackNode node1, TrackNode node2, TrackEdge edge) {
flushGraphPacket(graph);
currentGraphSyncPacket.addedEdges
.add(Pair.of(Couple.create(node1.getNetId(), node2.getNetId()), edge.getTurn()));
+ currentPayload++;
}
public void pointAdded(TrackGraph graph, TrackEdgePoint point) {
flushGraphPacket(graph);
currentGraphSyncPacket.addedEdgePoints.add(point);
+ currentPayload++;
}
public void pointRemoved(TrackGraph graph, TrackEdgePoint point) {
flushGraphPacket(graph);
currentGraphSyncPacket.removedEdgePoints.add(point.getId());
+ currentPayload++;
}
public void nodeRemoved(TrackGraph graph, TrackNode node) {
@@ -120,12 +124,14 @@ public class TrackGraphSync {
public void edgeDataChanged(TrackGraph graph, TrackNode node1, TrackNode node2, TrackEdge edge) {
flushGraphPacket(graph);
currentGraphSyncPacket.syncEdgeData(node1, node2, edge);
+ currentPayload++;
}
public void edgeDataChanged(TrackGraph graph, TrackNode node1, TrackNode node2, TrackEdge edge, TrackEdge edge2) {
flushGraphPacket(graph);
currentGraphSyncPacket.syncEdgeData(node1, node2, edge);
currentGraphSyncPacket.syncEdgeData(node2, node1, edge2);
+ currentPayload++;
}
public void sendFullGraphTo(TrackGraph graph, ServerPlayer player) {
@@ -190,6 +196,7 @@ public class TrackGraphSync {
//
private TrackGraphSyncPacket currentGraphSyncPacket;
+ private int currentPayload;
private void flushGraphPacket() {
flushGraphPacket(null, 0);
@@ -201,14 +208,17 @@ public class TrackGraphSync {
private void flushGraphPacket(@Nullable UUID graphId, int netId) {
if (currentGraphSyncPacket != null) {
- if (currentGraphSyncPacket.graphId.equals(graphId))
+ if (currentGraphSyncPacket.graphId.equals(graphId) && currentPayload < 1000)
return;
queuedPackets.add(currentGraphSyncPacket);
currentGraphSyncPacket = null;
+ currentPayload = 0;
}
- if (graphId != null)
+ if (graphId != null) {
currentGraphSyncPacket = new TrackGraphSyncPacket(graphId, netId);
+ currentPayload = 0;
+ }
}
}
diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/entity/Carriage.java b/src/main/java/com/simibubi/create/content/logistics/trains/entity/Carriage.java
index 6b4b71e51..d4e530695 100644
--- a/src/main/java/com/simibubi/create/content/logistics/trains/entity/Carriage.java
+++ b/src/main/java/com/simibubi/create/content/logistics/trains/entity/Carriage.java
@@ -16,6 +16,8 @@ import java.util.function.Function;
import javax.annotation.Nullable;
+import net.minecraft.server.MinecraftServer;
+
import org.apache.commons.lang3.mutable.MutableDouble;
import com.simibubi.create.content.contraptions.components.structureMovement.Contraption;
@@ -129,7 +131,7 @@ public class Carriage {
boolean onTwoBogeys = isOnTwoBogeys();
double stress = train.derailed ? 0 : onTwoBogeys ? bogeySpacing - getAnchorDiff() : 0;
blocked = false;
-
+
MutableDouble distanceMoved = new MutableDouble(distance);
boolean iterateFromBack = distance < 0;
@@ -141,7 +143,7 @@ public class Carriage {
CarriageBogey bogey = bogeys.get(actuallyFirstBogey);
double bogeyCorrection = stress * (actuallyFirstBogey ? 0.5d : -0.5d);
double bogeyStress = bogey.getStress();
-
+
for (boolean firstWheel : Iterate.trueAndFalse) {
boolean actuallyFirstWheel = firstWheel ^ iterateFromBack;
TravellingPoint point = bogey.points.get(actuallyFirstWheel);
@@ -249,8 +251,11 @@ public class Carriage {
boolean discard =
!currentlyTraversedDimensions.isEmpty() && !currentlyTraversedDimensions.contains(entry.getKey());
- ServerLevel currentLevel = level.getServer()
- .getLevel(entry.getKey());
+
+ MinecraftServer server = level.getServer();
+ if (server == null)
+ continue;
+ ServerLevel currentLevel = server.getLevel(entry.getKey());
if (currentLevel == null)
continue;
@@ -848,7 +853,7 @@ public class Carriage {
train.carriageWaitingForChunks = id;
return;
}
-
+
if (entity.getPassengers()
.stream()
.anyMatch(p -> p instanceof Player)
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 9fe72d003..b8c92fad8 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/java/com/simibubi/create/events/CommonEvents.java b/src/main/java/com/simibubi/create/events/CommonEvents.java
index f917ccfc3..de476b1db 100644
--- a/src/main/java/com/simibubi/create/events/CommonEvents.java
+++ b/src/main/java/com/simibubi/create/events/CommonEvents.java
@@ -48,6 +48,7 @@ import net.minecraftforge.event.level.ChunkEvent;
import net.minecraftforge.event.level.LevelEvent;
import net.minecraftforge.event.server.ServerStoppingEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
+import net.minecraftforge.fml.LogicalSide;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.forgespi.language.IModFileInfo;
@@ -85,9 +86,11 @@ public class CommonEvents {
}
@SubscribeEvent
- public static void onWorldTick(LevelTickEvent event) {
+ public static void onServerWorldTick(LevelTickEvent event) {
if (event.phase == Phase.START)
return;
+ if (event.side == LogicalSide.CLIENT)
+ return;
Level world = event.level;
ContraptionHandler.tick(world);
CapabilityMinecartController.tick(world);
diff --git a/src/main/java/com/simibubi/create/foundation/data/LangMerger.java b/src/main/java/com/simibubi/create/foundation/data/LangMerger.java
index 2a8d1d8c7..5619f3663 100644
--- a/src/main/java/com/simibubi/create/foundation/data/LangMerger.java
+++ b/src/main/java/com/simibubi/create/foundation/data/LangMerger.java
@@ -3,35 +3,26 @@ package com.simibubi.create.foundation.data;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
import java.util.Set;
import org.apache.commons.lang3.mutable.MutableBoolean;
-import org.apache.commons.lang3.mutable.MutableInt;
import org.apache.commons.lang3.mutable.MutableObject;
-import org.apache.commons.lang3.tuple.Pair;
import com.google.common.hash.Hashing;
import com.google.common.hash.HashingOutputStream;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
-import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.simibubi.create.Create;
import com.simibubi.create.foundation.ponder.PonderScene;
-import com.simibubi.create.foundation.utility.FilesHelper;
import net.minecraft.data.CachedOutput;
import net.minecraft.data.DataGenerator;
@@ -51,10 +42,6 @@ public class LangMerger implements DataProvider {
private final LangPartial[] langPartials;
private List