pala M-pillage-1: dynamites controlees (4640-4642, menage guns)
This commit is contained in:
@@ -726,6 +726,11 @@ avant M4 (TODO:crafts-machines).
|
||||
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-pillage-1 LIVRE 2026-10-19 ~07:25 : dynamites (ID 4640/4641/4642, explosion
|
||||
controlee raycast 32, exclusions obsidiennes+enclumes+claims, annulee eau, ninja
|
||||
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-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
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package fr.surviepote.pala;
|
||||
|
||||
import fr.surviepote.pala.item.DynamiteGunItem;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.component.DataComponents;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
@@ -143,6 +142,13 @@ public final class PalaItems {
|
||||
// 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-pillage-1 (wiki ID 4640/4641/4642) : dynamites jetables (clic droit, raycast 32,
|
||||
// diametres 3/3 silencieuse/5, exclusions obsidiennes+enclumes, annulee dans l'eau,
|
||||
// consommee a l'usage). ECART : chiffres degats, portes/trappes obsidienne +
|
||||
// hardened non portes (TODO), sans craft (images non OCR).
|
||||
public static final Item DYNAMITE = register("dynamite", id -> new Item(new Item.Properties().setId(id)));
|
||||
public static final Item NINJA_DYNAMITE = register("ninja_dynamite", id -> new Item(new Item.Properties().setId(id)));
|
||||
public static final Item BIG_DYNAMITE = register("big_dynamite", id -> new Item(new Item.Properties().setId(id)));
|
||||
// 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)));
|
||||
@@ -208,9 +214,6 @@ public final class PalaItems {
|
||||
public static final Item TITANE_LEGGINGS = register("titane_leggings", id -> new Item(new Item.Properties().setId(id).durability(18).humanoidArmor(PalaArmorMaterials.TITANE, ArmorType.LEGGINGS)));
|
||||
public static final Item TITANE_BOOTS = register("titane_boots", id -> new Item(new Item.Properties().setId(id).durability(18).humanoidArmor(PalaArmorMaterials.TITANE, ArmorType.BOOTS)));
|
||||
public static final Item WEIGHTED_BOOTS = register("weighted_boots", id -> new Item(new Item.Properties().setId(id).durability(16).humanoidArmor(PalaArmorMaterials.WEIGHTED_BOOTS, ArmorType.BOOTS)));
|
||||
public static final Item DYNAMITE = register("dynamite", id -> new DynamiteGunItem(id, 1.5F));
|
||||
public static final Item DYNAMITE_NINJA = register("dynamite_ninja", id -> new DynamiteGunItem(id, 1.5F));
|
||||
public static final Item ENDIUM_DYNAMITE = register("endium_dynamite", id -> new DynamiteGunItem(id, 1.8F));
|
||||
|
||||
public static void register() {
|
||||
}
|
||||
|
||||
@@ -84,6 +84,9 @@ public final class PalaTabs {
|
||||
output.accept(PalaItems.CAVE_HAMMER);
|
||||
output.accept(PalaItems.INFERNAL_KNOCKER);
|
||||
output.accept(PalaItems.SPAWNER_FINDER);
|
||||
output.accept(PalaItems.DYNAMITE);
|
||||
output.accept(PalaItems.NINJA_DYNAMITE);
|
||||
output.accept(PalaItems.BIG_DYNAMITE);
|
||||
output.accept(PalaItems.CANDY);
|
||||
output.accept(PalaItems.CANDY_BLUE);
|
||||
output.accept(PalaItems.CANDY_GREEN);
|
||||
@@ -155,8 +158,6 @@ public final class PalaTabs {
|
||||
output.accept(PalaItems.TITANE_SHOVEL);
|
||||
output.accept(PalaItems.TITANE_SWORD);
|
||||
output.accept(PalaItems.DYNAMITE);
|
||||
output.accept(PalaItems.DYNAMITE_NINJA);
|
||||
output.accept(PalaItems.ENDIUM_DYNAMITE);
|
||||
output.accept(PalaFluids.ANGELIC_WATER_BUCKET);
|
||||
output.accept(PalaFluids.FAKE_WATER_BUCKET);
|
||||
output.accept(PalaItems.AMETHYST_HELMET);
|
||||
|
||||
@@ -173,6 +173,36 @@ public final class PalaItemUseEvents {
|
||||
stack.hurtAndBreak(1, sp, hand);
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
// M-pillage-1 (wiki ID 4640/4641/4642) : dynamites — clic droit air, explosion
|
||||
// au point vise (raycast 32). Ninja = sans son.
|
||||
if (item == PalaItems.DYNAMITE || item == PalaItems.NINJA_DYNAMITE
|
||||
|| item == PalaItems.BIG_DYNAMITE) {
|
||||
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.phys.BlockHitResult hit = sl.clip(
|
||||
new net.minecraft.world.level.ClipContext(start, end,
|
||||
net.minecraft.world.level.ClipContext.Block.OUTLINE,
|
||||
net.minecraft.world.level.ClipContext.Fluid.NONE, sp));
|
||||
if (hit.getType() != net.minecraft.world.phys.HitResult.Type.BLOCK) {
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
BlockPos target = hit.getBlockPos();
|
||||
if (!sl.getFluidState(target).isEmpty()) {
|
||||
sp.sendSystemMessage(net.minecraft.network.chat.Component.literal(
|
||||
"§cLa dynamite ne fonctionne pas dans l'eau."));
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
float radius = item == PalaItems.BIG_DYNAMITE ? 2.5F : 1.5F;
|
||||
boolean silent = item == PalaItems.NINJA_DYNAMITE;
|
||||
explodeDynamite(sp, sl, target, radius, silent);
|
||||
sp.getCooldowns().addCooldown(stack, 20);
|
||||
stack.shrink(1);
|
||||
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) {
|
||||
@@ -349,6 +379,55 @@ public final class PalaItemUseEvents {
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
|
||||
// M-pillage-1 : explosion controlee (exclusions wiki : obsidiennes + enclumes ;
|
||||
// portes/trappes obsidienne + hardened non portes, TODO). Degats ECART chiffres.
|
||||
static void explodeDynamite(ServerPlayer player, ServerLevel level, BlockPos center,
|
||||
float radius, boolean silent) {
|
||||
int r = (int) Math.ceil(radius);
|
||||
for (int x = -r; x <= r; x++) {
|
||||
for (int y = -r; y <= r; y++) {
|
||||
for (int z = -r; z <= r; z++) {
|
||||
if ((double) (x * x + y * y + z * z) > (double) (radius * radius)) {
|
||||
continue;
|
||||
}
|
||||
BlockPos cursor = center.offset(x, y, z);
|
||||
BlockState state = level.getBlockState(cursor);
|
||||
if (state.isAir() || !level.getFluidState(cursor).isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
Block block = state.getBlock();
|
||||
if (block == Blocks.OBSIDIAN || block == Blocks.CRYING_OBSIDIAN
|
||||
|| block == Blocks.ANVIL || block == Blocks.CHIPPED_ANVIL
|
||||
|| block == Blocks.DAMAGED_ANVIL
|
||||
|| block == Blocks.ENCHANTING_TABLE) {
|
||||
continue;
|
||||
}
|
||||
if (!fr.surviepote.pala.events.PalaFactionProtect.canAct(player, level, cursor)) {
|
||||
continue;
|
||||
}
|
||||
level.destroyBlock(cursor, true, player, 512);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (net.minecraft.world.entity.LivingEntity living : level.getEntitiesOfClass(
|
||||
net.minecraft.world.entity.LivingEntity.class,
|
||||
new net.minecraft.world.phys.AABB(center).inflate(radius))) {
|
||||
double d = Math.sqrt(living.blockPosition().distSqr(center));
|
||||
float dmg = (float) ((1.0 - d / (radius + 1.0)) * (radius > 2.0F ? 24.0F : 12.0F));
|
||||
if (dmg > 0.0F) {
|
||||
living.hurtServer(level,
|
||||
living.damageSources().explosion(null, player), dmg);
|
||||
}
|
||||
}
|
||||
if (!silent) {
|
||||
level.playSound(null, center.getX(), center.getY(), center.getZ(),
|
||||
SoundEvents.GENERIC_EXPLODE, SoundSource.BLOCKS, 1.0F, 1.0F);
|
||||
}
|
||||
level.sendParticles(net.minecraft.core.particles.ParticleTypes.EXPLOSION,
|
||||
center.getX() + 0.5, center.getY() + 0.5, center.getZ() + 0.5,
|
||||
1, 0.0, 0.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
// 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) {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "pala:item/endium_dynamite"
|
||||
"model": "pala:item/big_dynamite"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "pala:item/ninja_dynamite"
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,9 @@
|
||||
"item.pala.amethyst_mixed_coal": "Amethyst Mixed Coal",
|
||||
"item.pala.amethyst_stick": "Amethyst Stick",
|
||||
"item.pala.compressed_amethyst": "Compressed Amethyst",
|
||||
"item.pala.dynamite": "Dynamite",
|
||||
"item.pala.ninja_dynamite": "Ninja Dynamite",
|
||||
"item.pala.big_dynamite": "Big Dynamite",
|
||||
"item.pala.spawner_finder": "Chercheur de spawners",
|
||||
"item.pala.infernal_knocker": "Infernal Knocker",
|
||||
"item.pala.cave_hammer": "Marteau des cavernes",
|
||||
@@ -179,8 +182,6 @@
|
||||
"block.pala.trixium_ore_block": "Trixium Block",
|
||||
"block.pala.xp_bush": "Xp Bush",
|
||||
"item.pala.dynamite": "Dynamite",
|
||||
"item.pala.dynamite_ninja": "Ninja Dynamite",
|
||||
"item.pala.endium_dynamite": "Endium Dynamite",
|
||||
"item.pala.angelic_water": "AngelicWater",
|
||||
"item.pala.fake_water": "FakeWater",
|
||||
"item.pala.angelic_water_bucket": "Angelic Water Bucket",
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "pala:item/big_dynamite"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{"parent": "minecraft:item/generated", "textures": {"layer0": "pala:item/dynamite_endium"}}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "pala:item/ninja_dynamite"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 211 B |
Binary file not shown.
|
Before Width: | Height: | Size: 174 B |
Binary file not shown.
|
After Width: | Height: | Size: 155 B |
Binary file not shown.
Reference in New Issue
Block a user