添加C4配方

This commit is contained in:
17146 2025-03-21 16:44:20 +08:00
parent 0b7ee9b5d1
commit 52af5ad762
6 changed files with 42 additions and 11 deletions

View file

@ -58,5 +58,10 @@ public class SbwJEIPlugin implements IModPlugin {
return stringBuilder.toString();
});
registration.registerSubtypeInterpreter(ModItems.C4_BOMB.get(), ((ingredient, context) -> {
if (ingredient.getTag() == null) return IIngredientSubtypeInterpreter.NONE;
return String.valueOf(ingredient.getTag().getBoolean("Control"));
}));
}
}

View file

@ -1,9 +1,9 @@
package com.atsuishio.superbwarfare.item;
import com.atsuishio.superbwarfare.client.TooltipTool;
import com.atsuishio.superbwarfare.entity.projectile.C4Entity;
import com.atsuishio.superbwarfare.init.ModItems;
import com.atsuishio.superbwarfare.init.ModSounds;
import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.sounds.SoundSource;
@ -56,9 +56,10 @@ public class C4Bomb extends Item {
@Override
public void appendHoverText(ItemStack pStack, @Nullable Level pLevel, List<Component> pTooltipComponents, TooltipFlag pIsAdvanced) {
TooltipTool.addDevelopingText(pTooltipComponents);
if (pStack.getOrCreateTag().getBoolean(TAG_CONTROL)) {
pTooltipComponents.add(Component.literal("Control"));
pTooltipComponents.add(Component.translatable("des.superbwarfare.c4_bomb.control").withStyle(ChatFormatting.GRAY));
} else {
pTooltipComponents.add(Component.translatable("des.superbwarfare.c4_bomb.time").withStyle(ChatFormatting.GRAY));
}
}

View file

@ -181,6 +181,8 @@
"item.superbwarfare.mortar_deployer": "Mortar",
"item.superbwarfare.claymore_mine": "Claymore",
"item.superbwarfare.c4_bomb": "C4",
"des.superbwarfare.c4_bomb.time": "Time Bomb",
"des.superbwarfare.c4_bomb.control": "RC Bomb",
"item.superbwarfare.seeker": "Seeker",
"item.superbwarfare.missile_engine": "Missile Engine",
"item.superbwarfare.fusee": "Fusee",

View file

@ -181,6 +181,8 @@
"item.superbwarfare.mortar_deployer": "迫击炮",
"item.superbwarfare.claymore_mine": "阔剑地雷",
"item.superbwarfare.c4_bomb": "C4炸药",
"des.superbwarfare.c4_bomb.time": "定时",
"des.superbwarfare.c4_bomb.control": "遥控",
"item.superbwarfare.seeker": "导引头",
"item.superbwarfare.missile_engine": "导弹发动机",
"item.superbwarfare.fusee": "引信",

View file

@ -2,19 +2,16 @@
"type": "minecraft:crafting_shaped",
"category": "equipment",
"pattern": [
"dbd",
"ddd",
"dcd",
"d d"
"ddd"
],
"key": {
"b": {
"item": "minecraft:iron_ingot"
},
"c": {
"d": {
"item": "superbwarfare:high_energy_explosives"
},
"d": {
"item": "minecraft:string"
"c": {
"item": "minecraft:clock"
}
},
"result": {

View file

@ -0,0 +1,24 @@
{
"type": "minecraft:crafting_shaped",
"category": "equipment",
"pattern": [
"ddd",
"dcd",
"ddd"
],
"key": {
"d": {
"item": "superbwarfare:high_energy_explosives"
},
"c": {
"item": "minecraft:redstone_torch"
}
},
"result": {
"item": "superbwarfare:c4_bomb",
"count": 1,
"nbt": {
"Control": true
}
}
}