Files
TiedUp-/src/main/java/com/tiedup/remake/items/ItemToken.java
NotEvil fd60086322 feat(i18n): complete migration — items, entities, AI goals, GUI screens
119 new translation keys across 3 domains:
- Items/Blocks/Misc (46 keys): tooltips, action messages, trap states
- Entities/AI Goals (55 keys): NPC speech, maid/master/guard messages
- Client GUI (18 keys): widget labels, screen buttons, merchant display

Remaining 119 Component.literal() are all intentional:
- Debug/Admin/Command wands (47) — dev tools, not player-facing
- Entity display names (~25) — dynamic getNpcName() calls
- Empty string roots (~15) — .append() chain bases
- User-typed text (~10) — /me, /pm, /norp chat content
- Runtime data (~12) — StringBuilder, gag muffling, MCA compat
2026-04-16 12:33:13 +02:00

72 lines
2.0 KiB
Java

package com.tiedup.remake.items;
import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.Level;
/**
* ItemToken - Access pass for kidnapper camps.
*
* Slave Trader & Maid System
*
* Behavior:
* - Reusable (no durability, permanent)
* - Drop: 5% chance from killed kidnappers
* - Effect: Kidnappers won't target the holder
* - Effect: Allows peaceful interaction with SlaveTrader
*
* When a player has a token in their inventory:
* - EntityKidnapper.canTarget() returns false
* - EntitySlaveTrader opens trade menu instead of attacking
*/
public class ItemToken extends Item {
public ItemToken() {
super(new Item.Properties().stacksTo(1).rarity(Rarity.RARE));
}
@Override
public void appendHoverText(
ItemStack stack,
@Nullable Level level,
List<Component> tooltip,
TooltipFlag flag
) {
tooltip.add(
Component.translatable("item.tiedup.token.title").withStyle(
ChatFormatting.GOLD,
ChatFormatting.BOLD
)
);
tooltip.add(Component.literal(""));
tooltip.add(
Component.translatable("item.tiedup.token.effect_no_target").withStyle(
ChatFormatting.GREEN
)
);
tooltip.add(
Component.translatable("item.tiedup.token.effect_trading").withStyle(
ChatFormatting.GREEN
)
);
tooltip.add(Component.literal(""));
tooltip.add(
Component.translatable("item.tiedup.token.hint").withStyle(
ChatFormatting.GRAY,
ChatFormatting.ITALIC
)
);
}
@Override
public boolean isFoil(ItemStack stack) {
return true; // Always glowing to indicate special item
}
}