Skip to content

Commit

Permalink
Fix sneaking using the protection item, closes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
ACGaming committed Dec 25, 2021
1 parent a6f45ee commit 765d314
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/com/buuz135/hotornot/item/HotItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
import javax.annotation.Nullable;

import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

import com.buuz135.hotornot.HotOrNot;
Expand Down Expand Up @@ -35,6 +38,12 @@ public void addInformation(ItemStack stack, @Nullable World worldIn, List<String
tooltip.add(new TextComponentTranslation("item.hotornot.hot_item.tooltip").getUnformattedComponentText());
}

@Override
public boolean doesSneakBypassUse(ItemStack stack, IBlockAccess world, BlockPos pos, EntityPlayer player)
{
return true;
}

@Override
public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged)
{
Expand Down

0 comments on commit 765d314

Please sign in to comment.