From 1cc58756e675d66f2c875bb502f3518a04bd9fb6 Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Fri, 21 Mar 2025 16:57:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4C4=E9=80=BB=E8=BE=91=E5=92=8C?= =?UTF-8?q?=E9=85=8D=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../atsuishio/superbwarfare/entity/projectile/C4Entity.java | 6 +++++- .../data/superbwarfare/recipes/c4_bomb_crafting.json | 2 +- .../data/superbwarfare/recipes/c4_bomb_rc_crafting.json | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/C4Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/C4Entity.java index 9d0f5045a..1b3f8331b 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/C4Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/C4Entity.java @@ -112,7 +112,11 @@ public class C4Entity extends Projectile implements GeoEntity { } if (!player.getAbilities().instabuild) { - ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(ModItems.C4_BOMB.get())); + ItemStack stack = new ItemStack(ModItems.C4_BOMB.get()); + if (this.getEntityData().get(IS_CONTROLLABLE)) { + stack.getOrCreateTag().putBoolean("Control", true); + } + ItemHandlerHelper.giveItemToPlayer(player, stack); } } diff --git a/src/main/resources/data/superbwarfare/recipes/c4_bomb_crafting.json b/src/main/resources/data/superbwarfare/recipes/c4_bomb_crafting.json index 07ce64dfb..747409fdf 100644 --- a/src/main/resources/data/superbwarfare/recipes/c4_bomb_crafting.json +++ b/src/main/resources/data/superbwarfare/recipes/c4_bomb_crafting.json @@ -16,6 +16,6 @@ }, "result": { "item": "superbwarfare:c4_bomb", - "count": 1 + "count": 2 } } \ No newline at end of file diff --git a/src/main/resources/data/superbwarfare/recipes/c4_bomb_rc_crafting.json b/src/main/resources/data/superbwarfare/recipes/c4_bomb_rc_crafting.json index 9d34f9856..1276171fb 100644 --- a/src/main/resources/data/superbwarfare/recipes/c4_bomb_rc_crafting.json +++ b/src/main/resources/data/superbwarfare/recipes/c4_bomb_rc_crafting.json @@ -11,12 +11,12 @@ "item": "superbwarfare:high_energy_explosives" }, "c": { - "item": "minecraft:redstone_torch" + "item": "minecraft:comparator" } }, "result": { "item": "superbwarfare:c4_bomb", - "count": 1, + "count": 2, "nbt": { "Control": true }