mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-03-04 06:44:40 +01:00
Fixed factory gauge interaction not working after manual movement
This commit is contained in:
parent
524d98871a
commit
1dc87ed543
2 changed files with 8 additions and 2 deletions
|
@ -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) {
|
||||
|
@ -268,6 +268,12 @@ public class FactoryPanelBehaviour extends FilteringBehaviour implements MenuPro
|
|||
player.level()
|
||||
.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() {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue