Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| eba6e3500d | |||
| d9302ed96a | |||
| c01d31a1b3 | |||
| 1e12c6c0ec | |||
| c465d771bb |
@@ -50,7 +50,7 @@ jq -n \
|
||||
projects: [
|
||||
{
|
||||
slug: "ascend",
|
||||
projectID: "1383429",
|
||||
projectID: 1383429,
|
||||
type: "optionalDependency"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -135,6 +135,34 @@ tracked per attacking player and ailment; their configured minimum is 60 ticks (
|
||||
|
||||
## Admin commands
|
||||
|
||||
`/ascendailments apply ...` supports all seven effects and `/ascendailments clear <target>` removes the library's
|
||||
`/ascendailments apply ...` supports all eight effects and `/ascendailments clear <target>` removes the library's
|
||||
effects and metadata. Permission level 2 is required. Durations are ticks; amplifier arguments use vanilla's
|
||||
zero-based convention.
|
||||
|
||||
## Creative test items
|
||||
|
||||
The Tools & Utilities creative tab contains one glowing debug stick for each of the eight ailments. A successful
|
||||
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.
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ mod_name=Ascend: Ailments
|
||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||
mod_license=All Rights Reserved
|
||||
# The mod version. See https://semver.org/
|
||||
mod_version=1.0.0
|
||||
mod_version=1.0.2
|
||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||
# This should match the base package used for the mod sources.
|
||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
|
||||
@@ -5,6 +5,8 @@ import net.fretux.ailments.command.AilmentCommands;
|
||||
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;
|
||||
@@ -23,6 +25,8 @@ public final class AscendAilments {
|
||||
public AscendAilments(FMLJavaModLoadingContext context) {
|
||||
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.
|
||||
@@ -33,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());
|
||||
});
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package net.fretux.ailments.item;
|
||||
|
||||
import net.fretux.ailments.api.AilmentApi;
|
||||
import net.fretux.ailments.api.AilmentApplication;
|
||||
import net.fretux.ailments.api.AilmentType;
|
||||
import net.fretux.ailments.config.AilmentsConfig;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
/** Creative-only test item that applies one ailment through the authoritative public API. */
|
||||
public final class DebugAilmentStickItem extends Item {
|
||||
private final AilmentType ailmentType;
|
||||
|
||||
public DebugAilmentStickItem(AilmentType ailmentType, Properties properties) {
|
||||
super(properties);
|
||||
this.ailmentType = ailmentType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hurtEnemy(ItemStack stack, LivingEntity target, LivingEntity attacker) {
|
||||
if (target.level().isClientSide || !(attacker instanceof Player player) || !player.isCreative()) return false;
|
||||
|
||||
return switch (ailmentType) {
|
||||
case SOUL_ROT, BLEED, FRACTURE ->
|
||||
AilmentApi.applyEffect(target, attacker, AilmentApplication.stack(ailmentType));
|
||||
case FEAR, CHARM, TAUNT, OVERCHARM, WINDED ->
|
||||
AilmentApi.applyEffect(target, attacker, ailmentType,
|
||||
AilmentsConfig.value(AilmentsConfig.TAGGED_WEAPON_EFFECT_DURATION), 0);
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFoil(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendHoverText(ItemStack stack, @Nullable Level level, List<Component> tooltip,
|
||||
TooltipFlag tooltipFlag) {
|
||||
tooltip.add(Component.translatable("item.ascend_ailments.debug_stick.tooltip")
|
||||
.withStyle(ChatFormatting.GRAY));
|
||||
super.appendHoverText(stack, level, tooltip, tooltipFlag);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package net.fretux.ailments.registry;
|
||||
|
||||
import net.fretux.ailments.AscendAilments;
|
||||
import net.fretux.ailments.api.AilmentType;
|
||||
import net.fretux.ailments.item.DebugAilmentStickItem;
|
||||
import net.minecraft.world.item.CreativeModeTabs;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.Rarity;
|
||||
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/** Item registration for development tools that are intentionally unavailable in survival progression. */
|
||||
public final class ModItems {
|
||||
public static final DeferredRegister<Item> ITEMS =
|
||||
DeferredRegister.create(ForgeRegistries.ITEMS, AscendAilments.MOD_ID);
|
||||
|
||||
public static final RegistryObject<Item> SOUL_ROT_DEBUG_STICK = debugStick("soul_rot", AilmentType.SOUL_ROT);
|
||||
public static final RegistryObject<Item> BLEED_DEBUG_STICK = debugStick("bleed", AilmentType.BLEED);
|
||||
public static final RegistryObject<Item> FRACTURE_DEBUG_STICK = debugStick("fracture", AilmentType.FRACTURE);
|
||||
public static final RegistryObject<Item> FEAR_DEBUG_STICK = debugStick("fear", AilmentType.FEAR);
|
||||
public static final RegistryObject<Item> CHARM_DEBUG_STICK = debugStick("charm", AilmentType.CHARM);
|
||||
public static final RegistryObject<Item> TAUNT_DEBUG_STICK = debugStick("taunt", AilmentType.TAUNT);
|
||||
public static final RegistryObject<Item> OVERCHARM_DEBUG_STICK = debugStick("overcharm", AilmentType.OVERCHARM);
|
||||
public static final RegistryObject<Item> WINDED_DEBUG_STICK = debugStick("winded", AilmentType.WINDED);
|
||||
|
||||
private static final List<RegistryObject<Item>> DEBUG_STICKS = List.of(
|
||||
SOUL_ROT_DEBUG_STICK,
|
||||
BLEED_DEBUG_STICK,
|
||||
FRACTURE_DEBUG_STICK,
|
||||
FEAR_DEBUG_STICK,
|
||||
CHARM_DEBUG_STICK,
|
||||
TAUNT_DEBUG_STICK,
|
||||
OVERCHARM_DEBUG_STICK,
|
||||
WINDED_DEBUG_STICK
|
||||
);
|
||||
|
||||
public static void register(IEventBus modBus) {
|
||||
ITEMS.register(modBus);
|
||||
modBus.addListener(ModItems::addCreativeItems);
|
||||
}
|
||||
|
||||
private static RegistryObject<Item> debugStick(String effectName, AilmentType ailmentType) {
|
||||
return ITEMS.register(effectName + "_debug_stick",
|
||||
() -> new DebugAilmentStickItem(ailmentType,
|
||||
new Item.Properties().stacksTo(1).rarity(Rarity.EPIC)));
|
||||
}
|
||||
|
||||
private static void addCreativeItems(BuildCreativeModeTabContentsEvent event) {
|
||||
if (event.getTabKey() == CreativeModeTabs.TOOLS_AND_UTILITIES)
|
||||
DEBUG_STICKS.forEach(event::accept);
|
||||
}
|
||||
|
||||
private ModItems() {}
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
@@ -7,6 +7,39 @@
|
||||
"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",
|
||||
"item.ascend_ailments.fear_debug_stick": "Fear Debug Stick",
|
||||
"item.ascend_ailments.charm_debug_stick": "Charm Debug Stick",
|
||||
"item.ascend_ailments.taunt_debug_stick": "Taunt Debug Stick",
|
||||
"item.ascend_ailments.overcharm_debug_stick": "Overcharm Debug Stick",
|
||||
"item.ascend_ailments.winded_debug_stick": "Winded Debug Stick",
|
||||
"item.ascend_ailments.debug_stick.tooltip": "Applies this ailment on hit; only works in Creative Mode.",
|
||||
"gui.ascend_ailments.hemorrhage": "Hemorrhage",
|
||||
"death.attack.bleed": "%1$s bled out",
|
||||
"death.attack.bleed.player": "%1$s bled out while fighting %2$s"
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/handheld",
|
||||
"textures": {
|
||||
"layer0": "minecraft:item/stick"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/handheld",
|
||||
"textures": {
|
||||
"layer0": "minecraft:item/stick"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/handheld",
|
||||
"textures": {
|
||||
"layer0": "minecraft:item/stick"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/handheld",
|
||||
"textures": {
|
||||
"layer0": "minecraft:item/stick"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/handheld",
|
||||
"textures": {
|
||||
"layer0": "minecraft:item/stick"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/handheld",
|
||||
"textures": {
|
||||
"layer0": "minecraft:item/stick"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/handheld",
|
||||
"textures": {
|
||||
"layer0": "minecraft:item/stick"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/handheld",
|
||||
"textures": {
|
||||
"layer0": "minecraft:item/stick"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:drowned",
|
||||
"minecraft:giant",
|
||||
"minecraft:husk",
|
||||
"minecraft:phantom",
|
||||
"minecraft:skeleton",
|
||||
"minecraft:skeleton_horse",
|
||||
"minecraft:stray",
|
||||
"minecraft:wither",
|
||||
"minecraft:wither_skeleton",
|
||||
"minecraft:zoglin",
|
||||
"minecraft:zombie",
|
||||
"minecraft:zombie_horse",
|
||||
"minecraft:zombie_villager",
|
||||
"minecraft:zombified_piglin"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:iron_golem"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user