pala M-gadget-2: grappin (raycast 32, dura 255)

This commit is contained in:
Anaïs Saraiva
2026-10-19 05:30:09 +02:00
parent efc7267306
commit d9f1f2af1d
9 changed files with 56 additions and 0 deletions
+4
View File
@@ -642,6 +642,10 @@ avant M4 (TODO:crafts-machines).
texture legacy, scan 16x16 top 10 + total, sans craft ECART). Lecon : patch
chevauchant la fin d'une methode mange sa signature — verifier la queue du fichier.
VERIFIE : build SUCCESSFUL, boot Done, 0 erreur. UNVERIFIED en jeu.
- M-gadget-2 LIVRE 2026-10-19 ~05:25 : grappin (ID 4979, dura 255, raycast 32,
teleport TeleportTransition, cooldown 20t, texture legacy, sans craft ECART).
Lecon : teleportTo 6-args n'existe plus en 26.3 -> pattern maison TeleportTransition.
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
@@ -64,6 +64,9 @@ public final class PalaItems {
// M-gadget-1 (wiki items lucky) : analyseur de chunk, durabilite 5, sans craft
// (obtention lucky/admin, ECART documente).
public static final Item CHUNK_ANALYSER = register("chunk_analyser", id -> new Item(new Item.Properties().setId(id).stacksTo(1).durability(5)));
// M-gadget-2 (wiki items lucky) : grappin, durabilite 255, sans craft (ECART lucky).
// ECART : tirage instantane (pas de projectile/entite crochet visible cote serveur).
public static final Item GRAPPIN = register("grappin", id -> new Item(new Item.Properties().setId(id).stacksTo(1).durability(255)));
// M-candy (wiki metiers, VERIFIE partiel) : bonbons 50 000 XP. Vert = fermier,
// jaune = mineur, rainbow = tous (pages Evolution) ; bleu/rose = mapping non publie
// (items seuls, TODO:mapping-bonbons) ; candy/job_candy = nature inconnue (items seuls).
@@ -70,6 +70,7 @@ public final class PalaTabs {
output.accept(PalaItems.TRIXIUM_GEM);
output.accept(PalaItems.XP_BERRIES);
output.accept(PalaItems.CHUNK_ANALYSER);
output.accept(PalaItems.GRAPPIN);
output.accept(PalaItems.CANDY);
output.accept(PalaItems.CANDY_BLUE);
output.accept(PalaItems.CANDY_GREEN);
@@ -142,6 +142,41 @@ public final class PalaItemUseEvents {
effect(sp, MobEffects.RESISTANCE, 1, 5);
return InteractionResult.PASS;
}
// M-gadget-2 (wiki items lucky) : grappin — clic droit air, raycast 32 blocs,
// tirage instantane vers le point d'impact (ECART : pas de crochet visible).
if (item == PalaItems.GRAPPIN) {
if (sp.getCooldowns().isOnCooldown(stack)) {
return InteractionResult.PASS;
}
net.minecraft.world.phys.Vec3 start = sp.getEyePosition();
net.minecraft.world.phys.Vec3 look = sp.getLookAngle();
net.minecraft.world.phys.Vec3 end = start.add(look.x * 32.0, look.y * 32.0, look.z * 32.0);
net.minecraft.world.level.ClipContext ctx =
new net.minecraft.world.level.ClipContext(start, end,
net.minecraft.world.level.ClipContext.Block.OUTLINE,
net.minecraft.world.level.ClipContext.Fluid.NONE, sp);
net.minecraft.world.phys.BlockHitResult hit = sl.clip(ctx);
if (hit.getType()
!= net.minecraft.world.phys.HitResult.Type.BLOCK) {
return InteractionResult.PASS;
}
BlockPos target = hit.getBlockPos().relative(hit.getDirection());
if (!sl.getBlockState(target).isAir() && !sl.getBlockState(target.above()).isAir()) {
sp.sendSystemMessage(net.minecraft.network.chat.Component.literal(
"§cPas de place pour s'accrocher."));
return InteractionResult.PASS;
}
sp.getCooldowns().addCooldown(stack, 20);
stack.hurtAndBreak(1, sp, hand);
net.minecraft.world.phys.Vec3 dest = new net.minecraft.world.phys.Vec3(
target.getX() + 0.5, target.getY(), target.getZ() + 0.5);
sp.teleport(new net.minecraft.world.level.portal.TeleportTransition(sl, dest,
net.minecraft.world.phys.Vec3.ZERO, sp.getYRot(), sp.getXRot(),
net.minecraft.world.level.portal.TeleportTransition.DO_NOTHING));
sl.playSound(null, target.getX(), target.getY(), target.getZ(),
SoundEvents.ENDER_DRAGON_AMBIENT, SoundSource.NEUTRAL, 1.0F, 1.0F);
return InteractionResult.SUCCESS;
}
return InteractionResult.PASS;
}
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "pala:item/grappin"
}
}
@@ -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.grappin": "Grappin",
"item.pala.chunk_analyser": "Chunk Analyser",
"item.pala.compressed_paladium": "Compressed Paladium",
"item.pala.compressed_titane": "Compressed Titane",
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "pala:item/grappin"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.