From a8bdbaa1873b96c581237b470013d1944ff76df3 Mon Sep 17 00:00:00 2001 From: patience Date: Thu, 30 Jul 2026 20:26:22 +0100 Subject: [PATCH] Edit potion splash Thrown potions now leave a trail of particles and create a ring around them reflecting the true scale of their AoE Slightly shortened cooldown on splash potions Potions throw further (temporary, will be replaced with charging soon) Let me know if it has trouble in multiplayer, there's a little weirdness in the client/server sync --- .../mc_rebalance/mixin/PotionThrowRework.java | 12 ++++ .../mixin/PotionVisualsRework.java | 64 +++++++++++++++++++ .../mixin/SplashCooldownTweak.java | 2 +- src/main/resources/mc_rebalance.mixins.json | 2 + 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 src/main/java/xyz/nearmisses/patience/mc_rebalance/mixin/PotionThrowRework.java create mode 100644 src/main/java/xyz/nearmisses/patience/mc_rebalance/mixin/PotionVisualsRework.java diff --git a/src/main/java/xyz/nearmisses/patience/mc_rebalance/mixin/PotionThrowRework.java b/src/main/java/xyz/nearmisses/patience/mc_rebalance/mixin/PotionThrowRework.java new file mode 100644 index 0000000..e1c0ca8 --- /dev/null +++ b/src/main/java/xyz/nearmisses/patience/mc_rebalance/mixin/PotionThrowRework.java @@ -0,0 +1,12 @@ +package xyz.nearmisses.patience.mc_rebalance.mixin; + +import net.minecraft.world.item.ThrowablePotionItem; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(ThrowablePotionItem.class) +public class PotionThrowRework { + @ModifyConstant(method="use", constant = @Constant(floatValue = 0.5F)) + private float teachSteveToThrow(float constant){return constant*1.8F;} +} diff --git a/src/main/java/xyz/nearmisses/patience/mc_rebalance/mixin/PotionVisualsRework.java b/src/main/java/xyz/nearmisses/patience/mc_rebalance/mixin/PotionVisualsRework.java new file mode 100644 index 0000000..43a094b --- /dev/null +++ b/src/main/java/xyz/nearmisses/patience/mc_rebalance/mixin/PotionVisualsRework.java @@ -0,0 +1,64 @@ +package xyz.nearmisses.patience.mc_rebalance.mixin; + +import net.minecraft.core.component.DataComponents; +import net.minecraft.core.particles.ColorParticleOption; +import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.util.FastColor; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.projectile.ItemSupplier; +import net.minecraft.world.entity.projectile.ThrowableItemProjectile; +import net.minecraft.world.entity.projectile.ThrownPotion; +import net.minecraft.world.item.alchemy.PotionContents; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.HitResult; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + + +@Mixin(ThrownPotion.class) +public abstract class PotionVisualsRework extends ThrowableItemProjectile implements ItemSupplier { + + public PotionVisualsRework(EntityType entityType, Level level) { + super(entityType, level); + } + + @Unique + private int trailTimer=4; + + @Inject(method="onHit", at=@At("HEAD")) + private void MarkRadiusWithParticles(HitResult hitResult, CallbackInfo ci){ + PotionContents potionContents = this.getItem().getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY); + + if(!this.level().isClientSide()){ + int ringScale = 4; + int ringDensity = 30; + for(int i = 0; i> cir){ - player.getCooldowns().addCooldown(player.getItemInHand(interactionHand).getItem(), 30); + player.getCooldowns().addCooldown(player.getItemInHand(interactionHand).getItem(), 24); } } diff --git a/src/main/resources/mc_rebalance.mixins.json b/src/main/resources/mc_rebalance.mixins.json index 4b02f63..7671258 100644 --- a/src/main/resources/mc_rebalance.mixins.json +++ b/src/main/resources/mc_rebalance.mixins.json @@ -7,6 +7,8 @@ "GrowRateTweak", "LingeringCooldownTweak", "PlayerTweaks", + "PotionThrowRework", + "PotionVisualsRework", "SplashCooldownTweak", "mob.BlazeAIRework", "mob.BlazeRework",