From cd3cbc2a959a87b6cc825b83c759f24a79374b7e Mon Sep 17 00:00:00 2001 From: Barbatosishere <584146143@qq.com> Date: Fri, 3 Jul 2026 14:16:42 +0800 Subject: [PATCH 1/7] Fix critical bugs: pack.mcmeta format, NPE on block placement, and registry order --- .../loot_tables/blocks/energy_pylon_flux.json | 19 +++++++++++++++++++ .../blocks/flux_accessor_flux.json | 19 +++++++++++++++++++ .../blocks/induction_port_flux.json | 19 +++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 versions/1.21.1/src/main/resources/data/more_flux_storage/loot_tables/blocks/energy_pylon_flux.json create mode 100644 versions/1.21.1/src/main/resources/data/more_flux_storage/loot_tables/blocks/flux_accessor_flux.json create mode 100644 versions/1.21.1/src/main/resources/data/more_flux_storage/loot_tables/blocks/induction_port_flux.json diff --git a/versions/1.21.1/src/main/resources/data/more_flux_storage/loot_tables/blocks/energy_pylon_flux.json b/versions/1.21.1/src/main/resources/data/more_flux_storage/loot_tables/blocks/energy_pylon_flux.json new file mode 100644 index 0000000..7d5196a --- /dev/null +++ b/versions/1.21.1/src/main/resources/data/more_flux_storage/loot_tables/blocks/energy_pylon_flux.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "more_flux_storage:energy_pylon_flux" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/versions/1.21.1/src/main/resources/data/more_flux_storage/loot_tables/blocks/flux_accessor_flux.json b/versions/1.21.1/src/main/resources/data/more_flux_storage/loot_tables/blocks/flux_accessor_flux.json new file mode 100644 index 0000000..9070174 --- /dev/null +++ b/versions/1.21.1/src/main/resources/data/more_flux_storage/loot_tables/blocks/flux_accessor_flux.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "more_flux_storage:flux_accessor_flux" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/versions/1.21.1/src/main/resources/data/more_flux_storage/loot_tables/blocks/induction_port_flux.json b/versions/1.21.1/src/main/resources/data/more_flux_storage/loot_tables/blocks/induction_port_flux.json new file mode 100644 index 0000000..b4f2488 --- /dev/null +++ b/versions/1.21.1/src/main/resources/data/more_flux_storage/loot_tables/blocks/induction_port_flux.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "more_flux_storage:induction_port_flux" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file From 097e735ec4b499039da31ea4e88c69a3c4ef7117 Mon Sep 17 00:00:00 2001 From: Barbatosishere <584146143@qq.com> Date: Fri, 3 Jul 2026 22:20:12 +0800 Subject: [PATCH 2/7] Fix client crash when Flux Accessor placed next to ME controller --- .../more_flux_storage/blockentity/TileFluxAccessorFlux.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java b/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java index b673af5..7201b4a 100644 --- a/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java +++ b/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java @@ -195,6 +195,10 @@ private void syncTransferStateForTagWrite() { private final class FluxAccessorTransferHandler extends AbstractFluxTransferHandler { private void syncBufferFromStorage() { + // Only sync on server side to avoid client crashes + if (level == null || level.isClientSide) { + return; + } IStorageService storage = getStorageService(); setBuffer(storage == null ? 0L : storage.getCachedInventory().get(FluxKey.of(EnergyType.FE))); } From 3f4639913bd5029b4479d21fc0ec8054e2f5b3d4 Mon Sep 17 00:00:00 2001 From: Barbatosishere <584146143@qq.com> Date: Fri, 3 Jul 2026 22:29:09 +0800 Subject: [PATCH 3/7] Fix pack.mcmeta format for all versions --- versions/1.12.2/src/main/resources/pack.mcmeta | 6 ++---- versions/1.20.1/src/main/resources/pack.mcmeta | 6 ++---- versions/1.21.1/src/main/resources/pack.mcmeta | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/versions/1.12.2/src/main/resources/pack.mcmeta b/versions/1.12.2/src/main/resources/pack.mcmeta index 531a377..da04c20 100644 --- a/versions/1.12.2/src/main/resources/pack.mcmeta +++ b/versions/1.12.2/src/main/resources/pack.mcmeta @@ -1,8 +1,6 @@ { "pack": { "description": "${mod_name} Resources", - "pack_format": ${ - resource_pack_format -} -} + "pack_format": ${resource_pack_format} + } } \ No newline at end of file diff --git a/versions/1.20.1/src/main/resources/pack.mcmeta b/versions/1.20.1/src/main/resources/pack.mcmeta index 531a377..da04c20 100644 --- a/versions/1.20.1/src/main/resources/pack.mcmeta +++ b/versions/1.20.1/src/main/resources/pack.mcmeta @@ -1,8 +1,6 @@ { "pack": { "description": "${mod_name} Resources", - "pack_format": ${ - resource_pack_format -} -} + "pack_format": ${resource_pack_format} + } } \ No newline at end of file diff --git a/versions/1.21.1/src/main/resources/pack.mcmeta b/versions/1.21.1/src/main/resources/pack.mcmeta index b95bcce..da04c20 100644 --- a/versions/1.21.1/src/main/resources/pack.mcmeta +++ b/versions/1.21.1/src/main/resources/pack.mcmeta @@ -1,6 +1,6 @@ { "pack": { "description": "${mod_name} Resources", - "pack_format": " ${resource_pack_format}" + "pack_format": ${resource_pack_format} } } \ No newline at end of file From 6cca9471261ddea7d1a7afd4180394a1f3bfb42b Mon Sep 17 00:00:00 2001 From: Barbatosishere <584146143@qq.com> Date: Fri, 3 Jul 2026 23:20:09 +0800 Subject: [PATCH 4/7] Fix NPE crash when placing Flux blocks --- .../blockentity/TileEnergyPylonFlux.java | 15 ++++++++++++++- .../blockentity/TileFluxAccessorFlux.java | 15 ++++++++++++++- .../blockentity/TileInductionPortFlux.java | 15 ++++++++++++++- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileEnergyPylonFlux.java b/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileEnergyPylonFlux.java index d9edef8..c8d7258 100644 --- a/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileEnergyPylonFlux.java +++ b/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileEnergyPylonFlux.java @@ -28,6 +28,8 @@ public class TileEnergyPylonFlux extends TileEnergyPylon implements IFluxProxyHo private final EnergyPylonTransferHandler transferHandler = new EnergyPylonTransferHandler(); private ProxyFluxDevice fluxProxyDevice; + private CompoundTag pendingFluxTag; + private byte pendingFluxTagType; private int fluxTick; public TileEnergyPylonFlux(BlockPos pos, BlockState state) { @@ -53,6 +55,11 @@ public void tick() { @Override public void onLoad() { getOrCreateFluxProxyDevice().syncLevel(); + // Process any pending flux tag data that was received before level was initialized + if (pendingFluxTag != null) { + getOrCreateFluxProxyDevice().readCustomTag(pendingFluxTag, pendingFluxTagType); + pendingFluxTag = null; + } super.onLoad(); } @@ -139,7 +146,13 @@ public void writeFluxTag(CompoundTag tag, byte type) { @Override public void readFluxTag(CompoundTag tag, byte type) { - getOrCreateFluxProxyDevice().readCustomTag(tag, type); + // Defer reading if level is not yet initialized to avoid NPE in FluxNetworks + if (level == null) { + pendingFluxTag = tag.copy(); + pendingFluxTagType = type; + } else { + getOrCreateFluxProxyDevice().readCustomTag(tag, type); + } } @Override diff --git a/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java b/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java index 7201b4a..56fe612 100644 --- a/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java +++ b/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java @@ -33,6 +33,8 @@ public class TileFluxAccessorFlux extends AENetworkedBlockEntity implements IFlu private final FluxAccessorTransferHandler transferHandler = new FluxAccessorTransferHandler(); private ProxyFluxDevice fluxProxyDevice; + private CompoundTag pendingFluxTag; + private byte pendingFluxTagType; public TileFluxAccessorFlux(BlockPos pos, BlockState state) { super(Objects.requireNonNull(MoreFluxStorageContent.getFluxAccessorFluxBlockEntityType(), "Flux accessor block entity type is not registered"), pos, state); @@ -54,6 +56,11 @@ public void tick() { @Override public void onReady() { getOrCreateFluxProxyDevice().syncLevel(); + // Process any pending flux tag data that was received before level was initialized + if (pendingFluxTag != null) { + getOrCreateFluxProxyDevice().readCustomTag(pendingFluxTag, pendingFluxTagType); + pendingFluxTag = null; + } super.onReady(); } @@ -137,7 +144,13 @@ public void writeFluxTag(CompoundTag tag, byte type) { @Override public void readFluxTag(CompoundTag tag, byte type) { - getOrCreateFluxProxyDevice().readCustomTag(tag, type); + // Defer reading if level is not yet initialized to avoid NPE in FluxNetworks + if (level == null) { + pendingFluxTag = tag.copy(); + pendingFluxTagType = type; + } else { + getOrCreateFluxProxyDevice().readCustomTag(tag, type); + } } @Override diff --git a/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileInductionPortFlux.java b/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileInductionPortFlux.java index 43e2da3..6c49ff3 100644 --- a/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileInductionPortFlux.java +++ b/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileInductionPortFlux.java @@ -34,6 +34,8 @@ public class TileInductionPortFlux extends TileEntityInductionPort implements IF private final InductionPortTransferHandler transferHandler = new InductionPortTransferHandler(); private ProxyFluxDevice fluxProxyDevice; + private CompoundTag pendingFluxTag; + private byte pendingFluxTagType; public TileInductionPortFlux(BlockPos pos, BlockState state) { super(Utils.trigger(pos), state); @@ -79,6 +81,11 @@ public void loadAdditional(@NotNull CompoundTag tag, @NotNull HolderLookup.Provi @Override public void onLoad() { getOrCreateFluxProxyDevice().syncLevel(); + // Process any pending flux tag data that was received before level was initialized + if (pendingFluxTag != null) { + getOrCreateFluxProxyDevice().readCustomTag(pendingFluxTag, pendingFluxTagType); + pendingFluxTag = null; + } super.onLoad(); } @@ -150,7 +157,13 @@ public void writeFluxTag(CompoundTag tag, byte type) { @Override public void readFluxTag(CompoundTag tag, byte type) { - getOrCreateFluxProxyDevice().readCustomTag(tag, type); + // Defer reading if level is not yet initialized to avoid NPE in FluxNetworks + if (level == null) { + pendingFluxTag = tag.copy(); + pendingFluxTagType = type; + } else { + getOrCreateFluxProxyDevice().readCustomTag(tag, type); + } } public InteractionResult onSneakRightClick(Player player) { From 92f3f592965db3f1e46cdd89ad71ce5f249b44d7 Mon Sep 17 00:00:00 2001 From: Barbatosishere <584146143@qq.com> Date: Sat, 4 Jul 2026 11:12:47 +0800 Subject: [PATCH 5/7] fix: correct NPE in readFluxTag - sync ProxyFluxDevice level before reading --- .../blockentity/TileEnergyPylonFlux.java | 9 ++++++--- .../blockentity/TileFluxAccessorFlux.java | 9 ++++++--- .../blockentity/TileInductionPortFlux.java | 9 ++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileEnergyPylonFlux.java b/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileEnergyPylonFlux.java index c8d7258..3b03d12 100644 --- a/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileEnergyPylonFlux.java +++ b/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileEnergyPylonFlux.java @@ -146,12 +146,15 @@ public void writeFluxTag(CompoundTag tag, byte type) { @Override public void readFluxTag(CompoundTag tag, byte type) { - // Defer reading if level is not yet initialized to avoid NPE in FluxNetworks - if (level == null) { + // FIX: Sync level on the proxy device before reading, as ProxyFluxDevice has its own + // level field that must be explicitly synced from the host BlockEntity + ProxyFluxDevice device = getOrCreateFluxProxyDevice(); + device.syncLevel(); + if (device.getLevel() == null) { pendingFluxTag = tag.copy(); pendingFluxTagType = type; } else { - getOrCreateFluxProxyDevice().readCustomTag(tag, type); + device.readCustomTag(tag, type); } } diff --git a/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java b/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java index 56fe612..4578c04 100644 --- a/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java +++ b/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java @@ -144,12 +144,15 @@ public void writeFluxTag(CompoundTag tag, byte type) { @Override public void readFluxTag(CompoundTag tag, byte type) { - // Defer reading if level is not yet initialized to avoid NPE in FluxNetworks - if (level == null) { + // FIX: Sync level on the proxy device before reading, as ProxyFluxDevice has its own + // level field that must be explicitly synced from the host BlockEntity + ProxyFluxDevice device = getOrCreateFluxProxyDevice(); + device.syncLevel(); + if (device.getLevel() == null) { pendingFluxTag = tag.copy(); pendingFluxTagType = type; } else { - getOrCreateFluxProxyDevice().readCustomTag(tag, type); + device.readCustomTag(tag, type); } } diff --git a/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileInductionPortFlux.java b/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileInductionPortFlux.java index 6c49ff3..e560ed8 100644 --- a/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileInductionPortFlux.java +++ b/versions/1.21.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileInductionPortFlux.java @@ -157,12 +157,15 @@ public void writeFluxTag(CompoundTag tag, byte type) { @Override public void readFluxTag(CompoundTag tag, byte type) { - // Defer reading if level is not yet initialized to avoid NPE in FluxNetworks - if (level == null) { + // FIX: Sync level on the proxy device before reading, as ProxyFluxDevice has its own + // level field that must be explicitly synced from the host BlockEntity + ProxyFluxDevice device = getOrCreateFluxProxyDevice(); + device.syncLevel(); + if (device.getLevel() == null) { pendingFluxTag = tag.copy(); pendingFluxTagType = type; } else { - getOrCreateFluxProxyDevice().readCustomTag(tag, type); + device.readCustomTag(tag, type); } } From b100fbf121204d72438d83f14a30485661f37a27 Mon Sep 17 00:00:00 2001 From: Barbatosishere <584146143@qq.com> Date: Sat, 4 Jul 2026 11:37:25 +0800 Subject: [PATCH 6/7] fix: apply NPE fix in syncLevel before readCustomTag for 1.20.1 --- .../blockentity/TileEnergyPylonFlux.java | 16 +++++++++++++++- .../blockentity/TileFluxAccessorFlux.java | 16 +++++++++++++++- .../blockentity/TileInductionPortFlux.java | 16 +++++++++++++++- .../more_flux_storage/util/ProxyFluxDevice.java | 6 +++--- 4 files changed, 48 insertions(+), 6 deletions(-) diff --git a/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileEnergyPylonFlux.java b/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileEnergyPylonFlux.java index 11edcfd..38852b9 100644 --- a/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileEnergyPylonFlux.java +++ b/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileEnergyPylonFlux.java @@ -28,6 +28,8 @@ public class TileEnergyPylonFlux extends TileEnergyPylon implements IFluxProxyHo private final EnergyPylonTransferHandler transferHandler = new EnergyPylonTransferHandler(); private ProxyFluxDevice fluxProxyDevice; + private CompoundTag pendingFluxTag; + private byte pendingFluxTagType; private int fluxTick; public TileEnergyPylonFlux(BlockPos pos, BlockState state) { @@ -53,6 +55,11 @@ public void tick() { @Override public void onLoad() { getOrCreateFluxProxyDevice().setLevel(); + // Process any pending flux tag data that was received before level was initialized + if (pendingFluxTag != null) { + getOrCreateFluxProxyDevice().readCustomTag(pendingFluxTag, pendingFluxTagType); + pendingFluxTag = null; + } super.onLoad(); } @@ -138,7 +145,14 @@ public void writeFluxTag(CompoundTag tag, byte type) { @Override public void readFluxTag(CompoundTag tag, byte type) { - getOrCreateFluxProxyDevice().readCustomTag(tag, type); + ProxyFluxDevice device = getOrCreateFluxProxyDevice(); + device.setLevel(); + if (device.getLevel() == null) { + pendingFluxTag = tag.copy(); + pendingFluxTagType = type; + } else { + device.readCustomTag(tag, type); + } } @NotNull diff --git a/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java b/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java index fd77ab9..83bc75c 100644 --- a/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java +++ b/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java @@ -32,6 +32,8 @@ public class TileFluxAccessorFlux extends AENetworkBlockEntity implements IFluxP private final FluxAccessorTransferHandler transferHandler = new FluxAccessorTransferHandler(); private ProxyFluxDevice fluxProxyDevice; + private CompoundTag pendingFluxTag; + private byte pendingFluxTagType; public TileFluxAccessorFlux(BlockPos pos, BlockState state) { super(Objects.requireNonNull(MoreFluxStorageContent.getFluxAccessorFluxBlockEntityType(), "Flux accessor block entity type is not registered"), pos, state); @@ -53,6 +55,11 @@ public void tick() { @Override public void onLoad() { getOrCreateFluxProxyDevice().setLevel(); + // Process any pending flux tag data that was received before level was initialized + if (pendingFluxTag != null) { + getOrCreateFluxProxyDevice().readCustomTag(pendingFluxTag, pendingFluxTagType); + pendingFluxTag = null; + } super.onLoad(); } @@ -135,7 +142,14 @@ public void writeFluxTag(CompoundTag tag, byte type) { @Override public void readFluxTag(CompoundTag tag, byte type) { - getOrCreateFluxProxyDevice().readCustomTag(tag, type); + ProxyFluxDevice device = getOrCreateFluxProxyDevice(); + device.setLevel(); + if (device.getLevel() == null) { + pendingFluxTag = tag.copy(); + pendingFluxTagType = type; + } else { + device.readCustomTag(tag, type); + } } @Override diff --git a/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileInductionPortFlux.java b/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileInductionPortFlux.java index f48eb94..c8b5e65 100644 --- a/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileInductionPortFlux.java +++ b/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileInductionPortFlux.java @@ -35,6 +35,8 @@ public class TileInductionPortFlux extends TileEntityInductionPort implements IF private final InductionPortTransferHandler transferHandler = new InductionPortTransferHandler(); private ProxyFluxDevice fluxProxyDevice; + private CompoundTag pendingFluxTag; + private byte pendingFluxTagType; public TileInductionPortFlux(BlockPos pos, BlockState state) { super(Utils.trigger(pos), state); @@ -80,6 +82,11 @@ public void load(@NotNull CompoundTag tag) { @Override public void onLoad() { getOrCreateFluxProxyDevice().setLevel(); + // Process any pending flux tag data that was received before level was initialized + if (pendingFluxTag != null) { + getOrCreateFluxProxyDevice().readCustomTag(pendingFluxTag, pendingFluxTagType); + pendingFluxTag = null; + } super.onLoad(); } @@ -151,7 +158,14 @@ public void writeFluxTag(CompoundTag tag, byte type) { @Override public void readFluxTag(CompoundTag tag, byte type) { - getOrCreateFluxProxyDevice().readCustomTag(tag, type); + ProxyFluxDevice device = getOrCreateFluxProxyDevice(); + device.setLevel(); + if (device.getLevel() == null) { + pendingFluxTag = tag.copy(); + pendingFluxTagType = type; + } else { + device.readCustomTag(tag, type); + } } public InteractionResult onSneakRightClick(Player player) { diff --git a/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/util/ProxyFluxDevice.java b/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/util/ProxyFluxDevice.java index b205177..230dba3 100644 --- a/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/util/ProxyFluxDevice.java +++ b/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/util/ProxyFluxDevice.java @@ -23,9 +23,9 @@ public ProxyFluxDevice(Host host, BlockEntityType type, BlockPos pos, BlockSt } public void markChunkUnsaved() { - assert this.host.getTE().getLevel() != null; - - this.host.getTE().getLevel().getChunkAt(this.worldPosition).setUnsaved(true); + if (this.host.getTE().getLevel() != null) { + this.host.getTE().getLevel().getChunkAt(this.worldPosition).setUnsaved(true); + } } public void setLevel() { From af890c58810529e5a77e5132edb33a0d729cb1f5 Mon Sep 17 00:00:00 2001 From: Barbatosishere <584146143@qq.com> Date: Sun, 5 Jul 2026 12:03:38 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=201.20.1=20=E7=89=88?= =?UTF-8?q?=E6=9C=AC=20ProxyFluxDevice=20=E7=BC=BA=E5=B0=91=20setLevel()?= =?UTF-8?q?=20=E8=B0=83=E7=94=A8=E7=9A=84=20NPE=20=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../more_flux_storage/blockentity/TileEnergyPylonFlux.java | 2 ++ .../more_flux_storage/blockentity/TileFluxAccessorFlux.java | 1 + .../more_flux_storage/blockentity/TileInductionPortFlux.java | 1 + 3 files changed, 4 insertions(+) diff --git a/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileEnergyPylonFlux.java b/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileEnergyPylonFlux.java index 38852b9..f612605 100644 --- a/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileEnergyPylonFlux.java +++ b/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileEnergyPylonFlux.java @@ -86,6 +86,7 @@ public void writeExtraNBT(CompoundTag tag) { @Override public void readExtraNBT(CompoundTag tag) { super.readExtraNBT(tag); + getOrCreateFluxProxyDevice().setLevel(); getOrCreateFluxProxyDevice().readCustomTag(tag, FluxConstants.NBT_SAVE_ALL); } @@ -106,6 +107,7 @@ public ClientboundBlockEntityDataPacket getUpdatePacket() { @Override public void handleUpdateTag(@NotNull CompoundTag tag) { super.handleUpdateTag(tag); + getOrCreateFluxProxyDevice().setLevel(); getOrCreateFluxProxyDevice().readCustomTag(tag, FluxConstants.NBT_TILE_UPDATE); } diff --git a/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java b/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java index 83bc75c..382b642 100644 --- a/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java +++ b/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileFluxAccessorFlux.java @@ -105,6 +105,7 @@ public ClientboundBlockEntityDataPacket getUpdatePacket() { @Override public void handleUpdateTag(@NotNull CompoundTag tag) { super.handleUpdateTag(tag); + getOrCreateFluxProxyDevice().setLevel(); getOrCreateFluxProxyDevice().readCustomTag(tag, FluxConstants.NBT_TILE_UPDATE); } diff --git a/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileInductionPortFlux.java b/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileInductionPortFlux.java index c8b5e65..3d41ebe 100644 --- a/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileInductionPortFlux.java +++ b/versions/1.20.1/src/main/java/com/circulation/more_flux_storage/blockentity/TileInductionPortFlux.java @@ -119,6 +119,7 @@ public ClientboundBlockEntityDataPacket getUpdatePacket() { @Override public void handleUpdateTag(@NotNull CompoundTag tag) { super.handleUpdateTag(tag); + getOrCreateFluxProxyDevice().setLevel(); getOrCreateFluxProxyDevice().readCustomTag(tag, FluxConstants.NBT_TILE_UPDATE); }