Fixed factory gauge interaction not working after manual movement

This commit is contained in:
simibubi 2025-02-12 14:35:04 +01:00
parent 524d98871a
commit 1dc87ed543
2 changed files with 8 additions and 2 deletions

View file

@ -214,7 +214,7 @@ public class FactoryPanelBehaviour extends FilteringBehaviour implements MenuPro
SmartBlockEntity oldBE = blockEntity;
FactoryPanelPosition oldPos = getPanelPosition();
slot = newPos.slot();
moveToSlot(newPos.slot());
// Add to new BE
if (level.getBlockEntity(newPos.pos()) instanceof FactoryPanelBlockEntity fpbe) {
@ -269,6 +269,12 @@ public class FactoryPanelBehaviour extends FilteringBehaviour implements MenuPro
.playSound(null, newPos.pos(), SoundEvents.COPPER_BREAK, SoundSource.BLOCKS, 1.0f, 1.0f);
}
private void moveToSlot(PanelSlot slot) {
this.slot = slot;
if (this.getSlotPositioning() instanceof FactoryPanelSlotPositioning fpsp)
fpsp.slot = slot;
}
@Override
public void initialize() {
super.initialize();

View file

@ -16,7 +16,7 @@ import net.minecraft.world.phys.Vec3;
class FactoryPanelSlotPositioning extends ValueBoxTransform {
private PanelSlot slot;
public PanelSlot slot;
public FactoryPanelSlotPositioning(PanelSlot slot) {
this.slot = slot;