fix placing minecart contraptions

This commit is contained in:
TropheusJ 2025-01-30 21:28:26 -05:00
parent aa5378179f
commit c3bccb9aa4

View file

@ -87,7 +87,12 @@ public class MountedStorageManager {
public void initialize() {
if (this.isInitialized()) {
throw new IllegalStateException("Mounted storage has already been initialized");
// originally this threw an exception to try to catch mistakes.
// however, in the case where a Contraption is deserialized before its Entity, that would also throw,
// since both the deserialization and the onEntityCreated callback initialize the storage.
// this case occurs when placing a picked up minecart contraption.
// the reverse case is fine since deserialization also resets the manager first.
return;
}
this.allItemStorages = ImmutableMap.copyOf(this.itemsBuilder);