Skip to content

Commit

Permalink
chore: stop using deprecated onUsingTick, instead use onUseTick
Browse files Browse the repository at this point in the history
  • Loading branch information
klikli-dev committed May 3, 2023
1 parent 0a5e869 commit 52e1bdb
Showing 1 changed file with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,18 @@

public class DivinationRodItem extends Item {

//region Fields
public static final float NOT_FOUND = 7.0f;
public static final float SEARCHING = 8.0f;
//endregion Fields

//region Initialization
public DivinationRodItem(Properties properties) {
super(properties);
}
//endregion Initialization

//region Overrides

@Override
public void onUsingTick(ItemStack stack, LivingEntity entityLiving, int count) {
if (entityLiving.level.isClientSide && entityLiving instanceof Player) {
ScanManager.instance.updateScan((Player) entityLiving, false);
public void onUseTick(Level pLevel, LivingEntity pLivingEntity, ItemStack pStack, int pRemainingUseDuration) {
if (pLivingEntity.level.isClientSide && pLivingEntity instanceof Player player) {
ScanManager.instance.updateScan(player, false);
}
}

Expand Down Expand Up @@ -222,9 +218,7 @@ public void appendHoverText(ItemStack stack, @Nullable Level worldIn, List<Compo
}
super.appendHoverText(stack, worldIn, tooltip, flagIn);
}
//endregion Overrides

//region Methods
public Block getOtherBlock(BlockState state, boolean isCreative) {
//otherstone ore is linked to andesite.
if (state.getBlock() == Blocks.ANDESITE || state.getBlock() == OccultismBlocks.OTHERSTONE_NATURAL.get()
Expand Down Expand Up @@ -280,6 +274,5 @@ public float getDistance(Vec3 playerPosition, BlockPos result) {
return 5.0f;
return 6.0f;
}
//endregion Methods
}

0 comments on commit 52e1bdb

Please sign in to comment.