Added a brief cooldown for throwing potions
1.5 seconds for splash, 2.25 for lingering
This commit is contained in:
parent
95b1aa991b
commit
2bbd63e049
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -3,12 +3,14 @@
|
|||
"package": "xyz.nearmisses.patience.mc_rebalance.mixin",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"mixins": [
|
||||
"mob.BlazeAIRework",
|
||||
"mob.BlazeRework",
|
||||
"PlayerTweaks",
|
||||
"mob.CreakingRework",
|
||||
"ExperienceOrbRework",
|
||||
"GrowRateTweak",
|
||||
"LingeringCooldownTweak",
|
||||
"PlayerTweaks",
|
||||
"SplashCooldownTweak",
|
||||
"mob.BlazeAIRework",
|
||||
"mob.BlazeRework",
|
||||
"mob.CreakingRework",
|
||||
"mob.HappyGhastTweak",
|
||||
"mob.WardenRework",
|
||||
"mob.WitherSkeletonRework"
|
||||
|
|
|
|||
Loading…
Reference in a new issue