Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import java.util.Set;
import java.util.UUID;

import com.simibubi.create.content.redstone.displayLink.DisplayLinkBlockEntity;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.joml.Math;
Expand Down Expand Up @@ -215,11 +217,15 @@ public void moveTo(FactoryPanelPosition newPos, ServerPlayer player) {
return;

// Disconnect links
Map<BlockPos, FactoryPanelConnection> displayLinks = new HashMap<>();
for (BlockPos pos : targetedByLinks.keySet()) {
FactoryPanelSupportBehaviour at = linkAt(level, new FactoryPanelPosition(pos, slot));
if (at != null)
if (at != null) {
at.disconnect(this);
if(at.blockEntity instanceof DisplayLinkBlockEntity) displayLinks.put(pos, targetedByLinks.get(pos));
}
}
displayLinks.keySet().forEach(key -> targetedByLinks.remove(key));

SmartBlockEntity oldBE = blockEntity;
FactoryPanelPosition oldPos = getPanelPosition();
Expand Down Expand Up @@ -264,6 +270,7 @@ public void moveTo(FactoryPanelPosition newPos, ServerPlayer player) {
}

// Reconnect links
targetedByLinks.putAll(displayLinks);
for (BlockPos pos : targetedByLinks.keySet()) {
FactoryPanelSupportBehaviour at = linkAt(level, new FactoryPanelPosition(pos, slot));
if (at != null)
Expand Down