From eba6e3500de22b4b34e65d36c4775d7e14892863 Mon Sep 17 00:00:00 2001 From: fretuks Date: Thu, 27 Aug 2026 17:04:03 +0200 Subject: [PATCH] added potions of all effects --- README.md | 21 ++++++++++++++++ .../net/fretux/ailments/AscendAilments.java | 3 +++ .../ailments/util/EffectSourceUtil.java | 8 +++++-- .../assets/ascend_ailments/lang/en_us.json | 24 +++++++++++++++++++ 4 files changed, 54 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a91f5c3..2e3af1d 100644 --- a/README.md +++ b/README.md @@ -145,3 +145,24 @@ The Tools & Utilities creative tab contains one glowing debug stick for each of direct hit applies the named effect through the normal source-aware API. Soul Rot, Bleed, and Fracture add their configured stacks; the other effects use `taggedWeaponEffectDurationTicks`. The sticks have no recipes and only apply effects when wielded by a player in Creative Mode, including on multiplayer and dedicated servers. + +## Potions + +Each ailment has a drinkable potion brewed from an Awkward Potion. Add Gunpowder for its splash variant (and Dragon's +Breath afterward for the standard lingering variant). + +| Ailment | Awkward Potion ingredient | +| --- | --- | +| Soul Rot | Soul Sand | +| Bleed | Rotten Flesh | +| Fracture | Bone | +| Fear | Fermented Spider Eye | +| Charm | Honey Bottle | +| Taunt | Fire Charge | +| Overcharm | Golden Apple | +| Winded | Feather | + +Fear, Charm, and Taunt retain a source. A drinkable bottle targets its drinker with the player who took the finished +bottle from the brewing stand as its brewer; drinking your own control potion has no effect. Splash potions use the +thrower as their source and likewise do not control the thrower. Drinkable control potions created without a recorded +brewer do nothing safely. diff --git a/src/main/java/net/fretux/ailments/AscendAilments.java b/src/main/java/net/fretux/ailments/AscendAilments.java index bf2c66d..c66a2a7 100644 --- a/src/main/java/net/fretux/ailments/AscendAilments.java +++ b/src/main/java/net/fretux/ailments/AscendAilments.java @@ -6,6 +6,7 @@ import net.fretux.ailments.compat.AscendCompat; import net.fretux.ailments.config.AilmentsConfig; import net.fretux.ailments.registry.ModEffects; import net.fretux.ailments.registry.ModItems; +import net.fretux.ailments.registry.ModPotions; import net.fretux.ailments.network.AilmentNetwork; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.RegisterCommandsEvent; @@ -25,6 +26,7 @@ public final class AscendAilments { IEventBus modBus = context.getModEventBus(); ModEffects.register(modBus); ModItems.register(modBus); + ModPotions.register(modBus); AilmentNetwork.register(); modBus.addListener(this::commonSetup); // Gameplay settings belong to the server and are synchronized to multiplayer clients by Forge. @@ -35,6 +37,7 @@ public final class AscendAilments { private void commonSetup(FMLCommonSetupEvent event) { event.enqueueWork(() -> { + ModPotions.registerBrewingRecipes(); if (AscendCompat.isAscendLoaded()) LOGGER.info("Ascend Arcane integration API available: {}", AscendCompat.validateIntegration()); }); diff --git a/src/main/java/net/fretux/ailments/util/EffectSourceUtil.java b/src/main/java/net/fretux/ailments/util/EffectSourceUtil.java index 10f7816..fabb3e6 100644 --- a/src/main/java/net/fretux/ailments/util/EffectSourceUtil.java +++ b/src/main/java/net/fretux/ailments/util/EffectSourceUtil.java @@ -19,9 +19,13 @@ public final class EffectSourceUtil { public static final String OVERCHARM = "ascend_ailments.overcharm"; public static void setSource(LivingEntity target, String ailment, @Nullable LivingEntity source) { + setSourceUuid(target, ailment, source == null ? null : source.getUUID()); + } + + public static void setSourceUuid(LivingEntity target, String ailment, @Nullable UUID sourceId) { CompoundTag data = target.getPersistentData(); - if (source == null) data.remove(sourceKey(ailment)); - else data.putUUID(sourceKey(ailment), source.getUUID()); + if (sourceId == null) data.remove(sourceKey(ailment)); + else data.putUUID(sourceKey(ailment), sourceId); } @Nullable public static UUID getSourceUuid(LivingEntity target, String ailment) { diff --git a/src/main/resources/assets/ascend_ailments/lang/en_us.json b/src/main/resources/assets/ascend_ailments/lang/en_us.json index 2764d89..b55c70d 100644 --- a/src/main/resources/assets/ascend_ailments/lang/en_us.json +++ b/src/main/resources/assets/ascend_ailments/lang/en_us.json @@ -7,6 +7,30 @@ "effect.ascend_ailments.taunt": "Taunt", "effect.ascend_ailments.overcharm": "Overcharm", "effect.ascend_ailments.winded": "Winded", + "item.minecraft.potion.effect.ascend_ailments.soul_rot": "Potion of Soul Rot", + "item.minecraft.potion.effect.ascend_ailments.bleed": "Potion of Bleeding", + "item.minecraft.potion.effect.ascend_ailments.fracture": "Potion of Fracture", + "item.minecraft.potion.effect.ascend_ailments.fear": "Potion of Fear", + "item.minecraft.potion.effect.ascend_ailments.charm": "Potion of Charm", + "item.minecraft.potion.effect.ascend_ailments.taunt": "Potion of Taunting", + "item.minecraft.potion.effect.ascend_ailments.overcharm": "Potion of Overcharm", + "item.minecraft.potion.effect.ascend_ailments.winded": "Potion of Windedness", + "item.minecraft.splash_potion.effect.ascend_ailments.soul_rot": "Splash Potion of Soul Rot", + "item.minecraft.splash_potion.effect.ascend_ailments.bleed": "Splash Potion of Bleeding", + "item.minecraft.splash_potion.effect.ascend_ailments.fracture": "Splash Potion of Fracture", + "item.minecraft.splash_potion.effect.ascend_ailments.fear": "Splash Potion of Fear", + "item.minecraft.splash_potion.effect.ascend_ailments.charm": "Splash Potion of Charm", + "item.minecraft.splash_potion.effect.ascend_ailments.taunt": "Splash Potion of Taunting", + "item.minecraft.splash_potion.effect.ascend_ailments.overcharm": "Splash Potion of Overcharm", + "item.minecraft.splash_potion.effect.ascend_ailments.winded": "Splash Potion of Windedness", + "item.minecraft.lingering_potion.effect.ascend_ailments.soul_rot": "Lingering Potion of Soul Rot", + "item.minecraft.lingering_potion.effect.ascend_ailments.bleed": "Lingering Potion of Bleeding", + "item.minecraft.lingering_potion.effect.ascend_ailments.fracture": "Lingering Potion of Fracture", + "item.minecraft.lingering_potion.effect.ascend_ailments.fear": "Lingering Potion of Fear", + "item.minecraft.lingering_potion.effect.ascend_ailments.charm": "Lingering Potion of Charm", + "item.minecraft.lingering_potion.effect.ascend_ailments.taunt": "Lingering Potion of Taunting", + "item.minecraft.lingering_potion.effect.ascend_ailments.overcharm": "Lingering Potion of Overcharm", + "item.minecraft.lingering_potion.effect.ascend_ailments.winded": "Lingering Potion of Windedness", "item.ascend_ailments.soul_rot_debug_stick": "Soul Rot Debug Stick", "item.ascend_ailments.bleed_debug_stick": "Bleed Debug Stick", "item.ascend_ailments.fracture_debug_stick": "Fracture Debug Stick",