diff --git a/PALAMOD_CDC.md b/PALAMOD_CDC.md index 12d55d7..f2fe1b9 100644 --- a/PALAMOD_CDC.md +++ b/PALAMOD_CDC.md @@ -456,9 +456,10 @@ avant M4 (TODO:crafts-machines). - Features wiki couvertes (entree CDC) : ~210 (§1.14). Portage existant : ~120 (assets+registres). Logique specifiee restant a implementer : ~90. Couverture spec : 100 % des pages FR Java ingestionnees. -- TODO explicites : 16 nommes (grep : ocr-fiable, worldgen-couches, broadsword, +- TODO explicites : 15 nommes (pog-os CLOS par M2-complement : OS 11/21/26/31 implemente ; + grep : ocr-fiable, worldgen-couches, broadsword, crafts-machines, chervil, commandes-exactes, ghost, luckperms, runclient, mcp-ocular, shebang, - java-home, pog-os, craft-xp, smelt-xp, crusher-xp) + java-home, craft-xp, smelt-xp, crusher-xp) + 4 points UNVERIFIED (seuils XP 6-100, durees sticks, valeurs armures wiki vs MCreator, patterns machines images). - Methode : WAVES (crawl 137 articles → stub JS isoles → re-crawl navigateur → verifie) + ETERNAL CODE @@ -512,10 +513,12 @@ avant M4 (TODO:crafts-machines). - M5a LIVRE 2026-10-19 ~00:30 : XP chasseur (AFTER_DEATH verifie au javap : passifs 14@0, poulpe 10@0, creeper 40, wither 1000, gates niveau) + fermier (ble 1.5@0, patate 2@2, carotte 2.5@2, pasteque 4@3, citrouille 5@6, eggplant 10@8, okami 20@12, kiwano 50@16 ; maturite age=max). - Config auto-complete les vieilles pala.json (save si cles null — code pret, persistance - a confirmer au prochain boot). VERIFIE : build SUCCESSFUL, boot Done, 0 erreur. - UNVERIFIED : boot+jeu (boot en cours au commit). TODO:craft-xp, TODO:smelt-xp (aucun event - serveur dans fabric-api, mixin requis), TODO:crusher-xp (attribution : stocker UUID poseur, M5b). + Config auto-complete les vieilles pala.json (detection par cles, pas par null : Gson + utilise le constructeur no-args donc les champs absents gardent leurs defauts — VERIFIE + au boot : 13 cles persistees). VERIFIE : build SUCCESSFUL, boot Done, 0 erreur. + UNVERIFIED en jeu : gains XP avec joueur (pas de joueur connecte). + TODO:craft-xp, TODO:smelt-xp (aucun event serveur dans fabric-api, mixin requis), + TODO:crusher-xp (attribution : stocker UUID poseur, M5b). - M4a LIVRE (meme vague) : recettes machines data-driven (crusherResults/Fuels, furnaceSmelts/Fuels en config, /pala reload live, ids invalides ignores). VERIFIE : build SUCCESSFUL. - Client/mod : boucle visuelle OPERATIONNELLE 2026-10-19 (Xvfb :99 + runClient SDL x11 + diff --git a/mods/pala/src/main/java/fr/surviepote/pala/core/PalaConfig.java b/mods/pala/src/main/java/fr/surviepote/pala/core/PalaConfig.java index 5caa561..f710158 100644 --- a/mods/pala/src/main/java/fr/surviepote/pala/core/PalaConfig.java +++ b/mods/pala/src/main/java/fr/surviepote/pala/core/PalaConfig.java @@ -166,13 +166,33 @@ public final class PalaConfig { if (loaded.furnaceFuels != null && !loaded.furnaceFuels.isEmpty()) { instance.furnaceFuels = loaded.furnaceFuels; } - // M5a : un vieux pala.json (M0) n'a pas les nouvelles cles (null) : les - // defauts code sont en memoire, on re-sauvegarde pour les materialiser. - // Une table explicitement videe (non-null vide) est respecte tel quel. - if (loaded.hunterKills == null || loaded.farmerHarvest == null - || loaded.crusherResults == null || loaded.crusherFuels == null - || loaded.crusherInfiniteFuels == null || loaded.furnaceSmelts == null - || loaded.furnaceFuels == null) { + // M5a : un vieux pala.json (M0) n'a pas les nouvelles cles : les defauts + // code sont en memoire (Gson utilise le constructeur no-args, les champs + // absents gardent leurs valeurs par defaut, jamais null), on re-sauvegarde + // pour les materialiser si une cle attendue manque. Une table explicitement + // videe (cle presente, tableau vide) est respectee telle quelle. + java.util.Set expected = java.util.Set.of("minerXp", "xpBase", + "xpExponent", "netherMinerLevel", "stickCooldowns", "rankNodes", + "hunterKills", "farmerHarvest", "crusherResults", "crusherFuels", + "crusherInfiniteFuels", "furnaceSmelts", "furnaceFuels"); + boolean complete = true; + try (Reader keysReader = Files.newBufferedReader(path)) { + com.google.gson.JsonObject obj = + GSON.fromJson(keysReader, com.google.gson.JsonObject.class); + if (obj == null) { + complete = false; + } else { + for (String key : expected) { + if (!obj.has(key)) { + complete = false; + break; + } + } + } + } catch (IOException | com.google.gson.JsonParseException e) { + complete = false; + } + if (!complete) { save(); } } diff --git a/mods/pala/src/main/java/fr/surviepote/pala/events/PalaToolEvents.java b/mods/pala/src/main/java/fr/surviepote/pala/events/PalaToolEvents.java index c2317e7..ea18d1e 100644 --- a/mods/pala/src/main/java/fr/surviepote/pala/events/PalaToolEvents.java +++ b/mods/pala/src/main/java/fr/surviepote/pala/events/PalaToolEvents.java @@ -10,6 +10,7 @@ import net.minecraft.core.component.DataComponents; import net.minecraft.network.chat.Component; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; +import net.minecraft.tags.BlockTags; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; @@ -97,6 +98,43 @@ public final class PalaToolEvents { public static void register() { PlayerBlockBreakEvents.AFTER.register(PalaToolEvents::afterBreak); + PlayerBlockBreakEvents.BEFORE.register(PalaToolEvents::beforeBreak); + } + + // M2-complement — one-shot wiki (paliers 11/21/26/31, page POG VERIFIEE) : la POG casse + // instantanement les blocs des paliers atteints. Comportement : destroyBlock direct + + // annulation de la casse normale. ECART documente : un bloc OS ne donne ni XP POG ni XP + // mineur (l'event AFTER ne se declenche pas sur casse annulee). + private static boolean beforeBreak(Level level, Player player, BlockPos pos, BlockState state, + BlockEntity blockEntity) { + if (level.isClientSide() || !(level instanceof ServerLevel sl) + || !(player instanceof ServerPlayer sp)) { + return true; + } + ItemStack hand = sp.getMainHandItem(); + if (hand.isEmpty() || !GOD_PICKAXES.contains(hand.getItem())) { + return true; + } + int godLevel = GOD_NUMBERS.getOrDefault(hand.getItem(), 0); + Block block = state.getBlock(); + boolean oneShot = false; + if (godLevel >= 11 && (block == Blocks.SNOW || block == Blocks.SNOW_BLOCK + || state.is(BlockTags.LEAVES))) { + oneShot = true; + } else if (godLevel >= 21 && (block == Blocks.NETHERRACK || block == Blocks.CACTUS)) { + oneShot = true; + } else if (godLevel >= 26 && (block == Blocks.DIRT || block == Blocks.SAND + || block == Blocks.SOUL_SAND || block == Blocks.RED_SAND || block == Blocks.GRAVEL + || block == Blocks.ICE)) { + oneShot = true; + } else if (godLevel >= 31 && state.is(BlockTags.WOOL)) { + oneShot = true; + } + if (oneShot) { + sl.destroyBlock(pos, true, sp, 512); + return false; + } + return true; } private static void afterBreak(Level level, Player player, BlockPos pos, BlockState state, diff --git a/mods/pala/src/main/resources/assets/pala/lang/en_us.json b/mods/pala/src/main/resources/assets/pala/lang/en_us.json index 408e54b..b0fe13c 100644 --- a/mods/pala/src/main/resources/assets/pala/lang/en_us.json +++ b/mods/pala/src/main/resources/assets/pala/lang/en_us.json @@ -165,5 +165,44 @@ "block.pala.fake_water": "FakeWater", "block.pala.paladium_furnace": "Paladium Furnace", "container.pala.paladium_crusher": "Paladium Crusher", - "container.pala.paladium_furnace": "PaladiumFurnace" -} \ No newline at end of file + "container.pala.paladium_furnace": "PaladiumFurnace", + "item.pala.amethyst_ore": "Amethyst Ore", + "item.pala.amethyst_ore_block": "Block of Amethyst", + "item.pala.amethyst_spike": "Amethyst Spike", + "item.pala.cave_block": "Cave Block", + "item.pala.fikutsi_stage0": "Fikutsi Stage0", + "item.pala.fikutsi_stage1": "Fikutsi Stage1", + "item.pala.fikutsi_stage2": "Fikutsi Stage2", + "item.pala.fikutsi_stage3": "Fikutsi Stage3", + "item.pala.findium_ore": "Findium Ore", + "item.pala.findium_ore_block": "Block of Findium", + "item.pala.kisakay_ore": "Kisakay Ore", + "item.pala.kisakay_ore_block": "Block of Kisakay", + "item.pala.kiwano_stage0": "Kiwano Stage0", + "item.pala.kiwano_stage1": "Kiwano Stage1", + "item.pala.kiwano_stage2": "Kiwano Stage2", + "item.pala.kiwano_stage3": "Kiwano Stage3", + "item.pala.kiwano_stage4": "Kiwano Stage4", + "item.pala.okami_stage0": "Okami Stage0", + "item.pala.okami_stage1": "Okami Stage1", + "item.pala.okami_stage2": "Okami Stage2", + "item.pala.okami_stage3": "Okami Stage3", + "item.pala.orange_blue_stage0": "OrangeBlue Tree Stage0", + "item.pala.orange_blue_stage1": "OrangeBlue Tree Stage1", + "item.pala.orange_blue_stage2": "OrangeBlue Tree Stage2", + "item.pala.orange_blue_stage3": "OrangeBlue Tree Stage3", + "item.pala.orange_blue_stage4": "OrangeBlue Tree Stage4", + "item.pala.paladium_crusher": "Paladium Crusher", + "item.pala.paladium_green_ore": "Green Paladium Ore", + "item.pala.paladium_green_ore_block": "Green Paladium Block", + "item.pala.paladium_ore": "Paladium Ore", + "item.pala.paladium_ore_block": "Block of Paladium", + "item.pala.slime_pad": "Slime Ejector", + "item.pala.titane_ore": "Titane Ore", + "item.pala.titane_ore_block": "Block of Titane", + "item.pala.tranny": "Tranny", + "item.pala.trixium_ore": "Trixium Ore", + "item.pala.trixium_ore_block": "Trixium Block", + "item.pala.xp_bush": "Xp Bush", + "item.pala.paladium_furnace": "Paladium Furnace" +} diff --git a/server/mods/pala-0.2.1.jar b/server/mods/pala-0.2.1.jar index b993991..0a66530 100644 Binary files a/server/mods/pala-0.2.1.jar and b/server/mods/pala-0.2.1.jar differ