Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Commit

Permalink
Allow treats to be put in the treat bag & make dogs beg when held
Browse files Browse the repository at this point in the history
Closes #360
  • Loading branch information
DashieDev authored and percivalalb committed Nov 13, 2021
1 parent 990e5fc commit 4df2116
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/main/java/doggytalents/common/entity/ai/DogBegGoal.java
Expand Up @@ -71,6 +71,10 @@ private boolean hasTemptationItemInHand(PlayerEntity player) {
return true;
}

if (itemstack.getItem().is(DoggyTags.TREATS)) {
return true;
}

if (FoodHandler.isFood(itemstack).isPresent()) {
return true;
}
Expand Down
Expand Up @@ -2,6 +2,7 @@

import javax.annotation.Nonnull;

import doggytalents.DoggyTags;
import doggytalents.api.feature.FoodHandler;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
Expand All @@ -28,6 +29,6 @@ protected void onContentsChanged(int slot) {

@Override
public boolean isItemValid(int slot, @Nonnull ItemStack stack) {
return FoodHandler.isFood(stack).isPresent();
return stack.getItem().is(DoggyTags.TREATS) || FoodHandler.isFood(stack).isPresent();
}
}

0 comments on commit 4df2116

Please sign in to comment.