Fix MatterySlot#onTake didn't call MatteryContainer#setChanged(...)
This commit is contained in:
parent
1f23903ff2
commit
1b7cb1d298
@ -1,6 +1,7 @@
|
|||||||
package ru.dbotthepony.mc.otm.menu.slot;
|
package ru.dbotthepony.mc.otm.menu.slot;
|
||||||
|
|
||||||
import net.minecraft.world.Container;
|
import net.minecraft.world.Container;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.inventory.Slot;
|
import net.minecraft.world.inventory.Slot;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import ru.dbotthepony.mc.otm.container.MatteryContainer;
|
import ru.dbotthepony.mc.otm.container.MatteryContainer;
|
||||||
@ -49,4 +50,15 @@ public class MatterySlot extends Slot {
|
|||||||
super.set(p_40240_);
|
super.set(p_40240_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTake(Player p_150645_, ItemStack p_150646_) {
|
||||||
|
if (container instanceof MatteryContainer container1) {
|
||||||
|
ItemStack old = last_stack.copy();
|
||||||
|
container1.setChanged(getSlotIndex(), p_150646_.copy(), old);
|
||||||
|
last_stack = ItemStack.EMPTY;
|
||||||
|
} else {
|
||||||
|
super.onTake(p_150645_, p_150646_);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user