Skip to content

Commit

Permalink
fixed glint for staff again!
Browse files Browse the repository at this point in the history
  • Loading branch information
NewJumper committed Apr 2, 2024
1 parent ddb6bf5 commit 048321f
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -23,7 +23,6 @@
@SuppressWarnings("NullableProblems")
public class SonorousStaffItem extends Item {
public double dropOffFactor = 1/3.0;
private boolean charged;

public SonorousStaffItem(Properties pProperties) {
super(pProperties);
Expand Down Expand Up @@ -75,12 +74,14 @@ public InteractionResultHolder<ItemStack> use(Level pLevel, Player pPlayer, Inte

@Override
public void inventoryTick(ItemStack pStack, Level pLevel, Entity pEntity, int pSlotId, boolean pIsSelected) {
if(pEntity instanceof Player player) charged = player.getUseItem() == pStack && pStack.getUseDuration() - player.getUseItemRemainingTicks() >= 668;
if(pEntity instanceof Player player) {
pStack.getOrCreateTag().putBoolean("charged", player.getUseItem() == pStack && pStack.getUseDuration() - player.getUseItemRemainingTicks() >= 668);
}
}

@Override
public boolean isFoil(ItemStack pStack) {
return super.isFoil(pStack) || charged;
return super.isFoil(pStack) || (pStack.hasTag() && pStack.getTag().getBoolean("charged"));
}

@Override
Expand Down

0 comments on commit 048321f

Please sign in to comment.