pala M-gadget-4: bottes lestees (explosion atterrissage, legacy)

This commit is contained in:
Anaïs Saraiva
2026-10-19 05:41:01 +02:00
parent 32c4e4069a
commit 6900627536
5 changed files with 47 additions and 0 deletions
+5
View File
@@ -649,6 +649,11 @@ avant M4 (TODO:crafts-machines).
- M-gadget-3 LIVRE 2026-10-19 ~05:30 : bocal a poissons (ID 3100, slot casque =
cecite, texture fish legacy, sans craft ECART). ECART : poisson a l'ecran infaisable
sans mod client. VERIFIE : build SUCCESSFUL, boot Done, 0 erreur. UNVERIFIED en jeu.
- M-gadget-4 LIVRE 2026-10-19 ~05:35 : bottes lestees (ID 4977, legacy VERIFIE :
explosion BREAK |vel_y| + 0.25, "EXPLOSION !!!!", usure 1, dura 16, ArmorItem existant
reutilise). ECART : puissance approximee h/8 + 1, annulee en claim d'autrui.
Lecons : ExplosionInteraction.BREAK n'existe plus en 26.3 -> TNT ; fallDistance est
double. 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
@@ -72,6 +72,7 @@ public final class PalaTabs {
output.accept(PalaItems.CHUNK_ANALYSER);
output.accept(PalaItems.GRAPPIN);
output.accept(PalaItems.FISHBOWL);
output.accept(PalaItems.WEIGHTED_BOOTS);
output.accept(PalaItems.CANDY);
output.accept(PalaItems.CANDY_BLUE);
output.accept(PalaItems.CANDY_GREEN);
@@ -1,6 +1,8 @@
package fr.surviepote.pala.events;
import net.minecraft.core.Holder;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffectInstance;
@@ -36,6 +38,29 @@ public final class PalaArmorEvents {
entity.addEffect(new MobEffectInstance(effect, duration, amplifier, false, false));
}
private static final java.util.Map<java.util.UUID, Double> LAST_FALL =
new java.util.HashMap<>();
// M-gadget-4 : explosion BREAK legacy (|vel_y| + 0.25 approxime par h/8 + 1,
// plafonnee a 4, UNVERIFIED). Annulee en territoire d'autrui.
static void weightedBoom(ServerPlayer player, double fell) {
ServerLevel level = player.level();
BlockPos pos = player.blockPosition();
if (!fr.surviepote.pala.events.PalaFactionProtect.canAct(player, level, pos)) {
player.sendSystemMessage(net.minecraft.network.chat.Component.literal(
"§cTerritoire de faction protege."));
return;
}
float power = (float) Math.min(1.0 + fell / 8.0, 4.0);
ItemStack boots = player.getItemBySlot(EquipmentSlot.FEET);
if (!boots.isEmpty()) {
boots.hurtAndBreak(1, player, EquipmentSlot.FEET);
}
player.sendSystemMessage(net.minecraft.network.chat.Component.literal("§l§cEXPLOSION !!!!"));
level.explode(player, pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5, power,
net.minecraft.world.level.Level.ExplosionInteraction.TNT);
}
private static boolean wearing(ServerPlayer player, EquipmentSlot slot, net.minecraft.world.item.Item item) {
ItemStack stack = player.getItemBySlot(slot);
return !stack.isEmpty() && stack.getItem() == item;
@@ -47,6 +72,21 @@ public final class PalaArmorEvents {
effect(player, net.minecraft.world.effect.MobEffects.BLINDNESS, 60, 0);
}
// --- Bottes lestees (M-gadget-4, legacy VERIFIE) : memorise la chute, explosion
// a l'atterrissage si > 3 blocs. Annulee en claim d'autrui (anti-grief, ECART).
if (wearing(player, EquipmentSlot.FEET, PalaItems.WEIGHTED_BOOTS)) {
if (!player.onGround()) {
LAST_FALL.put(player.getUUID(), player.fallDistance);
} else {
Double fell = LAST_FALL.remove(player.getUUID());
if (fell != null && fell > 3.0F) {
weightedBoom(player, fell);
}
}
} else {
LAST_FALL.remove(player.getUUID());
}
// --- Armure Paladium (1 procedure par piece dans le legacy) ---
if (wearing(player, EquipmentSlot.HEAD, PalaItems.PALADIUM_HELMET)) {
effect(player, net.minecraft.world.effect.MobEffects.NIGHT_VISION, 860, 1);
@@ -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.weighted_boots": "Boom Boots",
"item.pala.fishbowl": "Bocal a poissons",
"item.pala.grappin": "Grappin",
"item.pala.chunk_analyser": "Chunk Analyser",
Binary file not shown.