diff --git a/PALAMOD_CDC.md b/PALAMOD_CDC.md index 8d27ce9..ae01d30 100644 --- a/PALAMOD_CDC.md +++ b/PALAMOD_CDC.md @@ -731,6 +731,11 @@ avant M4 (TODO:crafts-machines). silencieuse). Menage : 3 DynamiteGunItem legacy supprimes (fireball non-wiki, conflit id "dynamite"). ECART : chiffres degats, portes/trappes+hardened TODO, sans craft. VERIFIE : build SUCCESSFUL, boot Done, 0 erreur. UNVERIFIED en jeu. +- M-faction-4 LIVRE 2026-10-19 ~07:35 : /f map (carte ASCII 9x9 claims, permission + wiki "Voir les territoires", +help). Lecon : compter opens/closes PAR LIGNE au + script (jamais a l'oeil) ; le compteur cumule est biaise par les apostrophes + (strip quotes apres comments) ; javac = arbitre final. 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 ed98451..718afd2 100644 --- a/mods/pala/src/main/java/fr/surviepote/pala/PalaCommands.java +++ b/mods/pala/src/main/java/fr/surviepote/pala/PalaCommands.java @@ -235,7 +235,9 @@ public final class PalaCommands { .then(Commands.literal("home") .executes(command -> fHome(command.getSource()))) .then(Commands.literal("top") - .executes(command -> fTop(command.getSource())))); + .executes(command -> fTop(command.getSource()))) + .then(Commands.literal("map") + .executes(command -> fMap(command.getSource())))); dispatcher.register(Commands.literal("fc") .then(Commands.argument("texte", com.mojang.brigadier.arguments.StringArgumentType.greedyString()) @@ -647,7 +649,7 @@ public final class PalaCommands { private static int fHelp(CommandSourceStack source) { source.sendSuccess(() -> Component.literal("§6[Faction] §7/f create|info|invite|join|" + "leave|disband|kick|transfer|desc|help|claim|unclaim|list|sethome|home|" - + "promote|demote|top"), false); + + "promote|demote|top|map"), false); return Command.SINGLE_SUCCESS; } @@ -1043,6 +1045,41 @@ public final class PalaCommands { } } + // M-faction-4 (wiki grades, permission "Voir les territoires") : carte ASCII 9x9 + // des claims autour du joueur (. = libre, initiale faction, vert = la sienne). + private static int fMap(CommandSourceStack source) { + try { + ServerPlayer player = source.getPlayerOrException(); + fr.surviepote.pala.core.PalaFactions fa = + fr.surviepote.pala.core.PalaFactions.get(); + fr.surviepote.pala.core.PalaFactions.Faction mine = + fa.byMember(player.getUUID().toString()); + String dim = player.level().dimension().identifier().toString(); + int baseX = (player.blockPosition().getX() >> 4) - 4; + int baseZ = (player.blockPosition().getZ() >> 4) - 4; + StringBuilder out = new StringBuilder("§6[Carte]"); + for (int dz = 0; dz < 9; dz++) { + out.append("\n§7"); + for (int dx = 0; dx < 9; dx++) { + String key = dim + ":" + (baseX + dx) + ":" + (baseZ + dz); + fr.surviepote.pala.core.PalaFactions.Faction owner = fa.byClaim(key); + if (owner == null) { + out.append("§8."); + } else if (mine != null && owner.name.equals(mine.name)) { + out.append("§a").append(Character.toUpperCase(owner.name.charAt(0))); + } else { + out.append("§c").append(Character.toUpperCase(owner.name.charAt(0))); + } + } + } + out.append("\n§7. = libre, §ainitiale verte = vous§7, §crouge = autres"); + source.sendSuccess(() -> Component.literal(out.toString()), false); + return Command.SINGLE_SUCCESS; + } catch (com.mojang.brigadier.exceptions.CommandSyntaxException e) { + return 0; + } + } + 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 e53809f..caeccb7 100644 Binary files a/server/mods/pala-0.2.1.jar and b/server/mods/pala-0.2.1.jar differ