Fix desync of FilteringBehaviour

This commit is contained in:
Snownee 2021-01-26 18:00:47 +08:00
parent 8f7945ff4e
commit b958be0712

View File

@ -75,12 +75,12 @@ public class FilteringHandler {
if (event.getSide() != LogicalSide.CLIENT) { if (event.getSide() != LogicalSide.CLIENT) {
if (!player.isCreative()) { if (!player.isCreative()) {
if (behaviour.getFilter()
.getItem() instanceof FilterItem)
player.inventory.placeItemBackInInventory(world, behaviour.getFilter());
if (toApply.getItem() instanceof FilterItem) if (toApply.getItem() instanceof FilterItem)
player.getHeldItem(hand) player.getHeldItem(hand)
.shrink(1); .shrink(1);
if (behaviour.getFilter()
.getItem() instanceof FilterItem)
player.inventory.placeItemBackInInventory(world, behaviour.getFilter());
} }
if (toApply.getItem() instanceof FilterItem) if (toApply.getItem() instanceof FilterItem)
toApply.setCount(1); toApply.setCount(1);