diff --git a/src/main/java/com/minecolonies/core/entity/ai/workers/production/EntityAIWorkNether.java b/src/main/java/com/minecolonies/core/entity/ai/workers/production/EntityAIWorkNether.java index 8a75bf78edc..748edb97318 100644 --- a/src/main/java/com/minecolonies/core/entity/ai/workers/production/EntityAIWorkNether.java +++ b/src/main/java/com/minecolonies/core/entity/ai/workers/production/EntityAIWorkNether.java @@ -875,7 +875,6 @@ protected void attemptToEat() { final IDeliverable edible = new StackList(getEdiblesList(), "Edible Food", 1); final int slot = InventoryUtils.findFirstSlotInProviderNotEmptyWith(worker, edible::matches); - final ICitizenData citizenData = worker.getCitizenData(); if (slot > -1) { final ItemStack stack = worker.getInventoryCitizen().getStackInSlot(slot); diff --git a/src/main/java/com/minecolonies/core/entity/citizen/EntityCitizen.java b/src/main/java/com/minecolonies/core/entity/citizen/EntityCitizen.java index 716708e6a91..1306c05bd1a 100755 --- a/src/main/java/com/minecolonies/core/entity/citizen/EntityCitizen.java +++ b/src/main/java/com/minecolonies/core/entity/citizen/EntityCitizen.java @@ -592,18 +592,12 @@ private void childFoodInteraction(final ItemStack usedStack, final Player player if (!level.isClientSide()) { - ItemStackUtils.consumeFood(usedStack, this, player.getInventory()); addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SPEED, 300)); playSound(SoundEvents.GENERIC_EAT, 1.5f, (float) SoundUtils.getRandomPitch(getRandom())); - Network.getNetwork() - .sendToTrackingEntity(new ItemParticleEffectMessage(usedStack, - getX(), - getY(), - getZ(), - getXRot(), - getYRot(), - getEyeHeight()), this); + Network.getNetwork().sendToTrackingEntity(new ItemParticleEffectMessage(usedStack, getX(), getY(), getZ(), getXRot(), getYRot(), getEyeHeight()), this); + ItemStackUtils.consumeFood(usedStack, this, player.getInventory()); + } } else @@ -631,18 +625,10 @@ private void eatFoodInteraction(final ItemStack usedStack, final Player player, { if (!level.isClientSide()) { - ItemStackUtils.consumeFood(usedStack, this, player.getInventory()); - playSound(SoundEvents.GENERIC_EAT, 1.5f, (float) SoundUtils.getRandomPitch(getRandom())); // Position needs to be centered on citizen, Eat AI wrong too? - Network.getNetwork() - .sendToTrackingEntity(new ItemParticleEffectMessage(usedStack, - getX(), - getY(), - getZ(), - getXRot(), - getYRot(), - getEyeHeight()), this); + Network.getNetwork().sendToTrackingEntity(new ItemParticleEffectMessage(usedStack, getX(), getY(), getZ(), getXRot(), getYRot(), getEyeHeight()), this); + ItemStackUtils.consumeFood(usedStack, this, player.getInventory()); } interactionCooldown = 100; diff --git a/src/main/java/com/minecolonies/core/entity/visitor/VisitorCitizen.java b/src/main/java/com/minecolonies/core/entity/visitor/VisitorCitizen.java index 8a0c3e8631d..53a4c65be2a 100644 --- a/src/main/java/com/minecolonies/core/entity/visitor/VisitorCitizen.java +++ b/src/main/java/com/minecolonies/core/entity/visitor/VisitorCitizen.java @@ -516,17 +516,9 @@ private InteractionResult directPlayerInteraction(final Player player, final Int { if (!level.isClientSide()) { - ItemStackUtils.consumeFood(usedStack, this, player.getInventory()); playSound(SoundEvents.GENERIC_EAT, 1.5f, (float) SoundUtils.getRandomPitch(getRandom())); - Network.getNetwork() - .sendToTrackingEntity(new ItemParticleEffectMessage(usedStack, - getX(), - getY(), - getZ(), - getXRot(), - getYRot(), - getEyeHeight()), this); - + Network.getNetwork().sendToTrackingEntity(new ItemParticleEffectMessage(usedStack, getX(), getY(), getZ(), getXRot(), getYRot(), getEyeHeight()), this); + ItemStackUtils.consumeFood(usedStack, this, player.getInventory()); MessageUtils.forCitizen(this, MESSAGE_INTERACTION_VISITOR_FOOD).sendTo(player); } return InteractionResult.CONSUME;