diff --git a/PALAMOD_CDC.md b/PALAMOD_CDC.md index 9b7d408..b199695 100644 --- a/PALAMOD_CDC.md +++ b/PALAMOD_CDC.md @@ -722,6 +722,10 @@ avant M4 (TODO:crafts-machines). tenu en main, sans degats/craft/durabilite ECART). Lecons : setDeltaMovement + hurtMarked absents en 26.3 (-> push) ; EntityType.WITHER -> EntityTypes.WITHER. VERIFIE : build SUCCESSFUL, boot Done, 0 erreur. UNVERIFIED en jeu (wither). +- M-spawner-1 LIVRE 2026-10-19 ~07:15 : chercheur de spawners (ID 4795, scan 9 chunks + autour du joueur + coords, gate chasseur 10, dura 140 ECART, cooldown 5 s, texture + legacy). Lecon : onUseItem (clic air) n'a pas de pos -> sp.blockPosition(). + 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/PalaItems.java b/mods/pala/src/main/java/fr/surviepote/pala/PalaItems.java index c7a71dc..e8cd5ce 100644 --- a/mods/pala/src/main/java/fr/surviepote/pala/PalaItems.java +++ b/mods/pala/src/main/java/fr/surviepote/pala/PalaItems.java @@ -139,6 +139,10 @@ public final class PalaItems { // knockback amplifie (sans degats propres, ECART chiffres). Sans craft/durabilite // (wiki muet, ECART). public static final Item INFERNAL_KNOCKER = register("infernal_knocker", id -> new Item(new Item.Properties().setId(id).stacksTo(1))); + // M-spawner-1 (wiki pillage ID 4795) : chercheur de spawners — scan 9 chunks, + // message presence + coords du plus proche, gate chasseur 10. Durabilite 140 + // minutes wiki => 140 usages (1/scan, ECART). Sans craft (image non OCR, ECART). + public static final Item SPAWNER_FINDER = register("spawner_finder", id -> new Item(new Item.Properties().setId(id).stacksTo(1).durability(140))); // M-gadget-8 (wiki ID 5023/5029) : cagoule (cosmetique, UNBREAKABLE) + masque de // garde (stats fer). Sans craft (ECART lucky). public static final Item BALACLAVA = register("balaclava", id -> new Item(new Item.Properties().setId(id).durability(1).humanoidArmor(PalaArmorMaterials.BALACLAVA, ArmorType.HELMET).component(DataComponents.UNBREAKABLE, Unit.INSTANCE))); diff --git a/mods/pala/src/main/java/fr/surviepote/pala/PalaTabs.java b/mods/pala/src/main/java/fr/surviepote/pala/PalaTabs.java index ba85165..97f8cc0 100644 --- a/mods/pala/src/main/java/fr/surviepote/pala/PalaTabs.java +++ b/mods/pala/src/main/java/fr/surviepote/pala/PalaTabs.java @@ -83,6 +83,7 @@ public final class PalaTabs { output.accept(PalaItems.MAGMA_AMULET); output.accept(PalaItems.CAVE_HAMMER); output.accept(PalaItems.INFERNAL_KNOCKER); + output.accept(PalaItems.SPAWNER_FINDER); output.accept(PalaItems.CANDY); output.accept(PalaItems.CANDY_BLUE); output.accept(PalaItems.CANDY_GREEN); diff --git a/mods/pala/src/main/java/fr/surviepote/pala/events/PalaItemUseEvents.java b/mods/pala/src/main/java/fr/surviepote/pala/events/PalaItemUseEvents.java index 18dedfd..ab58432 100644 --- a/mods/pala/src/main/java/fr/surviepote/pala/events/PalaItemUseEvents.java +++ b/mods/pala/src/main/java/fr/surviepote/pala/events/PalaItemUseEvents.java @@ -157,6 +157,22 @@ public final class PalaItemUseEvents { } return InteractionResult.PASS; } + // M-spawner-1 (wiki ID 4795) : scan 9 chunks autour du joueur, gate + // chasseur 10, 1 usage/scan + cooldown 5 s (scan lourd ~900k blocs). + if (item == PalaItems.SPAWNER_FINDER) { + if (fr.surviepote.pala.core.PalaJobs.levelOf(sp, "chasseur") < 10) { + sp.sendSystemMessage(net.minecraft.network.chat.Component.literal( + "§cChasseur niveau 10 requis.")); + return InteractionResult.PASS; + } + if (sp.getCooldowns().isOnCooldown(stack)) { + return InteractionResult.PASS; + } + scanSpawners(sp, sl, sp.blockPosition()); + sp.getCooldowns().addCooldown(stack, 100); + stack.hurtAndBreak(1, sp, hand); + return InteractionResult.SUCCESS; + } // M-enchants-3 (wiki ID 4849) : incrustation amulette — amulette en main + // plastron pala/endium en seconde main => CUSTOM_DATA "amulet" (1 slot v1). if (item == PalaItems.MAGMA_AMULET) { @@ -333,6 +349,47 @@ public final class PalaItemUseEvents { return InteractionResult.PASS; } + // M-spawner-1 : scan 3x3 chunks (9) autour du bloc vise, spawners vanilla + // (minecraft:spawner). Message presence + coords du plus proche. + static void scanSpawners(ServerPlayer player, ServerLevel level, BlockPos pos) { + java.util.List found = new java.util.ArrayList<>(); + int baseChunkX = (pos.getX() >> 4) - 1; + int baseChunkZ = (pos.getZ() >> 4) - 1; + for (int cx = 0; cx < 3; cx++) { + for (int cz = 0; cz < 3; cz++) { + int baseX = (baseChunkX + cx) << 4; + int baseZ = (baseChunkZ + cz) << 4; + for (int x = 0; x < 16; x++) { + for (int z = 0; z < 16; z++) { + for (int y = level.getMinY(); y < level.getMaxY(); y++) { + BlockPos cursor = new BlockPos(baseX + x, y, baseZ + z); + if (level.getBlockState(cursor).is(net.minecraft.world.level.block.Blocks.SPAWNER)) { + found.add(cursor.immutable()); + } + } + } + } + } + } + if (found.isEmpty()) { + player.sendSystemMessage(net.minecraft.network.chat.Component.literal( + "§6[Finder] §7Aucun spawner dans les 9 chunks.")); + return; + } + BlockPos nearest = found.get(0); + double best = nearest.distSqr(pos); + for (BlockPos candidate : found) { + double d = candidate.distSqr(pos); + if (d < best) { + best = d; + nearest = candidate; + } + } + player.sendSystemMessage(net.minecraft.network.chat.Component.literal("§6[Finder] §7" + + found.size() + " spawner(s), plus proche en " + nearest.getX() + ", " + + nearest.getY() + ", " + nearest.getZ() + ".")); + } + // M-gadget-1 : scan du chunk (16x16 sur toute la hauteur), top 10 + total. static void analyseChunk(ServerPlayer player, ServerLevel level, BlockPos pos) { java.util.Map counts = new java.util.HashMap<>(); diff --git a/mods/pala/src/main/resources/assets/pala/items/spawner_finder.json b/mods/pala/src/main/resources/assets/pala/items/spawner_finder.json new file mode 100644 index 0000000..5d9fe95 --- /dev/null +++ b/mods/pala/src/main/resources/assets/pala/items/spawner_finder.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "pala:item/spawner_finder" + } +} \ No newline at end of file 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 8666025..cf636c8 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 @@ -4,6 +4,7 @@ "item.pala.amethyst_mixed_coal": "Amethyst Mixed Coal", "item.pala.amethyst_stick": "Amethyst Stick", "item.pala.compressed_amethyst": "Compressed Amethyst", + "item.pala.spawner_finder": "Chercheur de spawners", "item.pala.infernal_knocker": "Infernal Knocker", "item.pala.cave_hammer": "Marteau des cavernes", "item.pala.magma_amulet": "Amulette de feu", diff --git a/mods/pala/src/main/resources/assets/pala/models/item/spawner_finder.json b/mods/pala/src/main/resources/assets/pala/models/item/spawner_finder.json new file mode 100644 index 0000000..4cf63aa --- /dev/null +++ b/mods/pala/src/main/resources/assets/pala/models/item/spawner_finder.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "pala:item/spawner_finder" + } +} \ No newline at end of file diff --git a/mods/pala/src/main/resources/assets/pala/textures/item/spawner_finder.png b/mods/pala/src/main/resources/assets/pala/textures/item/spawner_finder.png new file mode 100644 index 0000000..2d409a6 Binary files /dev/null and b/mods/pala/src/main/resources/assets/pala/textures/item/spawner_finder.png differ diff --git a/server/mods/pala-0.2.1.jar b/server/mods/pala-0.2.1.jar index d374554..d9a6ca6 100644 Binary files a/server/mods/pala-0.2.1.jar and b/server/mods/pala-0.2.1.jar differ