diff --git a/PALAMOD_CDC.md b/PALAMOD_CDC.md index 7751e19..b8bab99 100644 --- a/PALAMOD_CDC.md +++ b/PALAMOD_CDC.md @@ -610,6 +610,8 @@ avant M4 (TODO:crafts-machines). pouvait pas partir). Lecon : compter les parentheses d'un chainage brigadier au python (le patch fuzzy fusionne les lignes). VERIFIE : build SUCCESSFUL, boot Done, 0 erreur. UNVERIFIED en jeu. +- M-faction-1c LIVRE 2026-10-19 ~04:20 : /f desc (chef, 140 car., sans speciaux — wiki) + + /f help. VERIFIE : build SUCCESSFUL, boot Done, 0 erreur. UNVERIFIED en jeu. - M-palaforge LIVRE 2026-10-19 ~03:55 : bloc + BE partagee (3e mode) + gate mineur 14 + table fonte wiki §3.2 (31 items, ratio floor usure) + fuels bois (+buche/planches/baton, lave exclue : seau non rendu) + craft (1 findium + 4 furnaces + 4 briques, positions diff --git a/mods/pala/src/main/java/fr/surviepote/pala/PalaCommands.java b/mods/pala/src/main/java/fr/surviepote/pala/PalaCommands.java index abb44b8..1a90ec2 100644 --- a/mods/pala/src/main/java/fr/surviepote/pala/PalaCommands.java +++ b/mods/pala/src/main/java/fr/surviepote/pala/PalaCommands.java @@ -180,7 +180,16 @@ public final class PalaCommands { .then(Commands.literal("transfer") .then(Commands.argument("cible", EntityArgument.player()) .executes(command -> fTransfer(command.getSource(), - EntityArgument.getPlayer(command, "cible")))))); + EntityArgument.getPlayer(command, "cible"))))) + + .then(Commands.literal("desc") + .then(Commands.argument("texte", + com.mojang.brigadier.arguments.StringArgumentType.greedyString()) + .executes(command -> fDesc(command.getSource(), + com.mojang.brigadier.arguments.StringArgumentType + .getString(command, "texte"))))) + .then(Commands.literal("help") + .executes(command -> fHelp(command.getSource())))); net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents.END_SERVER_TICK .register(PalaCommands::tickSpawnQueue); net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents.END_SERVER_TICK @@ -554,6 +563,37 @@ public final class PalaCommands { } } + // M-faction-1c : description (chef, 140 caracteres max, sans format) + aide. + private static int fDesc(CommandSourceStack source, String texte) { + try { + ServerPlayer player = source.getPlayerOrException(); + fr.surviepote.pala.core.PalaFactions.Faction faction = + fr.surviepote.pala.core.PalaFactions.get() + .byMember(player.getUUID().toString()); + if (faction == null || !faction.owner.equals(player.getUUID().toString())) { + source.sendFailure(Component.literal("§cSeul le chef peut decrire.")); + return 0; + } + if (texte.length() > 140 || !texte.matches("[A-Za-z0-9 _.,!?'()-]+")) { + source.sendFailure(Component.literal("§c140 caracteres max, sans caracteres speciaux.")); + return 0; + } + faction.description = texte; + fr.surviepote.pala.core.PalaFactions.get().markDirty(); + source.sendSuccess(() -> Component.literal( + "§6[Faction] §7Description : " + texte), false); + return Command.SINGLE_SUCCESS; + } catch (com.mojang.brigadier.exceptions.CommandSyntaxException e) { + return 0; + } + } + + private static int fHelp(CommandSourceStack source) { + source.sendSuccess(() -> Component.literal("§6[Faction] §7/f create|info|invite|join|" + + "leave|disband|kick|transfer|desc|help"), false); + return Command.SINGLE_SUCCESS; + } + private static int fDisband(CommandSourceStack source) { try { ServerPlayer player = source.getPlayerOrException(); diff --git a/server/mods/pala-0.2.1.jar b/server/mods/pala-0.2.1.jar index 34fa107..069fb7b 100644 Binary files a/server/mods/pala-0.2.1.jar and b/server/mods/pala-0.2.1.jar differ