Added a brief cooldown for throwing potions

1.5 seconds for splash, 2.25 for lingering
This commit is contained in:
patience 2026-03-10 13:40:39 +00:00
parent 95b1aa991b
commit 2bbd63e049
No known key found for this signature in database
3 changed files with 47 additions and 4 deletions

View file

@ -0,0 +1,21 @@
package xyz.nearmisses.patience.mc_rebalance.mixin;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.LingeringPotionItem;
import net.minecraft.world.level.Level;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
// Clone of SplashPotionTweak.
@Mixin(LingeringPotionItem.class)
public class LingeringCooldownTweak {
@Inject(method="use", at=@At("HEAD"))
void use(Level level, Player player, InteractionHand interactionHand, CallbackInfoReturnable<InteractionResultHolder<ItemStack>> cir){
player.getCooldowns().addCooldown(player.getItemInHand(interactionHand).getItem(), 45);
}
}

View file

@ -0,0 +1,20 @@
package xyz.nearmisses.patience.mc_rebalance.mixin;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.SplashPotionItem;
import net.minecraft.world.level.Level;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(SplashPotionItem.class)
public class SplashCooldownTweak {
@Inject(method="use", at=@At("HEAD"))
void use(Level level, Player player, InteractionHand interactionHand, CallbackInfoReturnable<InteractionResultHolder<ItemStack>> cir){
player.getCooldowns().addCooldown(player.getItemInHand(interactionHand).getItem(), 30);
}
}

View file

@ -3,12 +3,14 @@
"package": "xyz.nearmisses.patience.mc_rebalance.mixin", "package": "xyz.nearmisses.patience.mc_rebalance.mixin",
"compatibilityLevel": "JAVA_21", "compatibilityLevel": "JAVA_21",
"mixins": [ "mixins": [
"mob.BlazeAIRework",
"mob.BlazeRework",
"PlayerTweaks",
"mob.CreakingRework",
"ExperienceOrbRework", "ExperienceOrbRework",
"GrowRateTweak", "GrowRateTweak",
"LingeringCooldownTweak",
"PlayerTweaks",
"SplashCooldownTweak",
"mob.BlazeAIRework",
"mob.BlazeRework",
"mob.CreakingRework",
"mob.HappyGhastTweak", "mob.HappyGhastTweak",
"mob.WardenRework", "mob.WardenRework",
"mob.WitherSkeletonRework" "mob.WitherSkeletonRework"