2 Commits

Author SHA1 Message Date
Fretux 1e12c6c0ec update version number 2026-08-27 15:05:08 +02:00
Fretux c465d771bb add debug items 2026-08-27 15:03:44 +02:00
16 changed files with 205 additions and 2 deletions
+8 -1
View File
@@ -135,6 +135,13 @@ tracked per attacking player and ailment; their configured minimum is 60 ticks (
## Admin commands ## 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 effects and metadata. Permission level 2 is required. Durations are ticks; amplifier arguments use vanilla's
zero-based convention. 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.
+1 -1
View File
@@ -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. # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=All Rights Reserved mod_license=All Rights Reserved
# The mod version. See https://semver.org/ # The mod version. See https://semver.org/
mod_version=1.0.0 mod_version=1.0.1
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # 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. # This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html # See https://maven.apache.org/guides/mini/guide-naming-conventions.html
@@ -5,6 +5,7 @@ import net.fretux.ailments.command.AilmentCommands;
import net.fretux.ailments.compat.AscendCompat; import net.fretux.ailments.compat.AscendCompat;
import net.fretux.ailments.config.AilmentsConfig; import net.fretux.ailments.config.AilmentsConfig;
import net.fretux.ailments.registry.ModEffects; import net.fretux.ailments.registry.ModEffects;
import net.fretux.ailments.registry.ModItems;
import net.fretux.ailments.network.AilmentNetwork; import net.fretux.ailments.network.AilmentNetwork;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegisterCommandsEvent; import net.minecraftforge.event.RegisterCommandsEvent;
@@ -23,6 +24,7 @@ public final class AscendAilments {
public AscendAilments(FMLJavaModLoadingContext context) { public AscendAilments(FMLJavaModLoadingContext context) {
IEventBus modBus = context.getModEventBus(); IEventBus modBus = context.getModEventBus();
ModEffects.register(modBus); ModEffects.register(modBus);
ModItems.register(modBus);
AilmentNetwork.register(); AilmentNetwork.register();
modBus.addListener(this::commonSetup); modBus.addListener(this::commonSetup);
// Gameplay settings belong to the server and are synchronized to multiplayer clients by Forge. // Gameplay settings belong to the server and are synchronized to multiplayer clients by Forge.
@@ -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() {}
}
@@ -7,6 +7,15 @@
"effect.ascend_ailments.taunt": "Taunt", "effect.ascend_ailments.taunt": "Taunt",
"effect.ascend_ailments.overcharm": "Overcharm", "effect.ascend_ailments.overcharm": "Overcharm",
"effect.ascend_ailments.winded": "Winded", "effect.ascend_ailments.winded": "Winded",
"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", "gui.ascend_ailments.hemorrhage": "Hemorrhage",
"death.attack.bleed": "%1$s bled out", "death.attack.bleed": "%1$s bled out",
"death.attack.bleed.player": "%1$s bled out while fighting %2$s" "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"
]
}