Skip to content

Commit

Permalink
Undo modify
Browse files Browse the repository at this point in the history
  • Loading branch information
H2Sxxa authored Oct 19, 2023
1 parent b2cd9d9 commit 1c4d9d0
Showing 1 changed file with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,18 @@ public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player
player.setActiveHand(hand);
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
}

@Override
public void onPlayerStoppedUsing(ItemStack stack, World world, EntityLivingBase entityLiving, int timeLeft) {
if(entityLiving instanceof EntityPlayer) {
EntityPlayer player = ((EntityPlayer) entityLiving);
int timeUsed = getMaxItemUseDuration(stack) - timeLeft;
if(timeUsed > 500) {
timeUsed = 500;
}
addJewels(stack, (short) timeUsed);
public void onUsingTick(ItemStack stack, EntityLivingBase player, int count) {
if(JEWELS.get(stack) < 500 && player instanceof EntityPlayer) {
player.addPotionEffect(new PotionEffect(MobEffects.LUCK, 10, 5));
player.playSound(SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, 0.1F, 1F);
if(JEWELS.get(stack) > 500){
JEWELS.set((short) 500, stack);
if(count % 4 == 0) {
player.playSound(SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, 0.1F, 1F);
}
addJewels(stack, (short) 1);
}
}

@Override
public void onPlayerStoppedUsing(ItemStack stack, World world, EntityLivingBase entityLiving, int timeLeft) {
if(entityLiving instanceof EntityPlayer) {
Expand Down

0 comments on commit 1c4d9d0

Please sign in to comment.