Files
dist
build_pack.py
Code
8 802
build_pack.py
import json
import shutil
import struct
import zlib
from pathlib import Path
from zipfile import ZIP_DEFLATED, ZipFile
ROOT = Path(__file__).resolve().parent
PACK_NAME = "clockwork_arsenal"
NAMESPACE = "clockwork"
OUT = ROOT / "dist" / PACK_NAME
ARCHIVE = ROOT / "dist" / f"{PACK_NAME}.zip"
WEAPONS = [
{
"id": "longbow",
"name": "Longbow",
"style": "bow",
"grip": "ntgl:two_handed",
"ammo": "minecraft:arrow",
"ammo_type": "ntgl:standard",
"projectile": "ntgl:bullet",
"damage_type": "ntgl:bullet",
"damage": 8.0,
"capacity": 1,
"rate": 18,
"reload": 18,
"fire_mode": ["ntgl:semi"],
"charge": 14,
"full_charge": True,
"recoil": 1.2,
"speed": 35.0,
"gravity": True,
"color": (137, 79, 42),
"accent": (191, 141, 62),
"sound": "minecraft:item.bow.shoot",
"reload_sound": "minecraft:item.armor.equip_leather",
"parts": [
("grip", [-1.2, 1, 3], [2.4, 7, 2.4], "body"),
("upper_limb", [-1, 8, 3.4], [2, 8, 1.5], "accent"),
("lower_limb", [-1, -7, 3.4], [2, 8, 1.5], "accent"),
("upper_tip", [-0.6, 15, 3.7], [1.2, 1.3, 1], "metal"),
("lower_tip", [-0.6, -8.3, 3.7], [1.2, 1.3, 1], "metal"),
("bowstring", [-0.12, -8, 2.6], [0.24, 24, 0.25], "string"),
],
"moving": "bowstring",
"recipe": [("minecraft:stick", 3), ("minecraft:string", 3), ("minecraft:copper_ingot", 1)],
},
{
"id": "crossbow",
"name": "Ironwood Crossbow",
"style": "crossbow",
"grip": "ntgl:two_handed",
"ammo": "minecraft:arrow",
"ammo_type": "ntgl:standard",
"projectile": "ntgl:bullet",
"damage_type": "ntgl:bullet",
"damage": 10.0,
"capacity": 1,
"rate": 22,
"reload": 28,
"fire_mode": ["ntgl:semi"],
"charge": 8,
"full_charge": True,
"recoil": 2.0,
"speed": 38.0,
"gravity": True,
"color": (91, 63, 42),
"accent": (196, 143, 65),
"sound": "minecraft:item.crossbow.shoot",
"reload_sound": "minecraft:item.crossbow.loading_end",
"parts": [
("stock", [-1.7, 0, 5], [3.4, 3.5, 11], "body"),
("rail", [-0.8, 2, -7], [1.6, 1.1, 13], "metal"),
("prod_left", [-8, 2.2, 2], [7, 1.5, 2], "accent"),
("prod_right", [1, 2.2, 2], [7, 1.5, 2], "accent"),
("string", [-8, 2.1, 1.5], [16, 0.25, 0.25], "string"),
("grip", [-1.4, -5, 6], [2.8, 5, 3], "accent"),
("trigger", [-0.3, -1, 4], [0.6, 2, 1], "metal"),
],
"moving": "string",
"recipe": [("minecraft:crossbow", 1), ("minecraft:iron_ingot", 2), ("minecraft:copper_ingot", 2)],
},
{
"id": "repeater_crossbow",
"name": "Repeater Crossbow",
"style": "repeater",
"grip": "ntgl:two_handed",
"ammo": "minecraft:arrow",
"ammo_type": "ntgl:standard",
"projectile": "ntgl:bullet",
"damage_type": "ntgl:bullet",
"damage": 6.0,
"capacity": 8,
"rate": 5,
"reload": 48,
"fire_mode": ["ntgl:auto"],
"charge": 0,
"full_charge": False,
"recoil": 1.4,
"speed": 36.0,
"gravity": True,
"color": (75, 76, 70),
"accent": (192, 139, 59),
"sound": "minecraft:item.crossbow.shoot",
"reload_sound": "minecraft:item.crossbow.loading_middle",
"parts": [
("stock", [-1.8, 0, 6], [3.6, 3.6, 10], "body"),
("barrel", [-1, 1.5, -10], [2, 2, 15], "metal"),
("magazine", [-2.4, -4, -2], [4.8, 5, 9], "accent"),
("magazine_band", [-2.6, -1.4, -2], [5.2, 1.2, 9], "metal"),
("prod_left", [-7, 2.5, 1], [6, 1.4, 2], "accent"),
("prod_right", [1, 2.5, 1], [6, 1.4, 2], "accent"),
("string", [-7, 2.4, 0.8], [14, 0.25, 0.25], "string"),
("grip", [-1.5, -5, 5], [3, 5, 3], "body"),
],
"moving": "magazine_band",
"recipe": [("minecraft:crossbow", 1), ("minecraft:iron_ingot", 4), ("minecraft:repeater", 1), ("minecraft:copper_ingot", 2)],
},
{
"id": "railgun",
"name": "Arc Railgun",
"style": "railgun",
"grip": "ntgl:two_handed",
"ammo": "minecraft:amethyst_shard",
"ammo_type": "ntgl:laser",
"projectile": "ntgl:laser",
"damage_type": "ntgl:energy",
"damage": 18.0,
"capacity": 4,
"rate": 24,
"reload": 40,
"fire_mode": ["ntgl:semi"],
"charge": 10,
"full_charge": True,
"recoil": 5.5,
"speed": 45.0,
"gravity": False,
"color": (55, 66, 78),
"accent": (79, 197, 206),
"sound": "minecraft:block.beacon.power_select",
"reload_sound": "minecraft:block.respawn_anchor.charge",
"parts": [
("receiver", [-2.4, 0, -3], [4.8, 5, 13], "body"),
("rail_left", [-3.4, 2.3, -12], [1, 1.2, 19], "metal"),
("rail_right", [2.4, 2.3, -12], [1, 1.2, 19], "metal"),
("coil_a", [-3.2, 1.3, -8], [6.4, 1, 2], "accent"),
("coil_b", [-3.2, 1.3, -3], [6.4, 1, 2], "accent"),
("coil_c", [-3.2, 1.3, 2], [6.4, 1, 2], "accent"),
("stock", [-2, -1, 8], [4, 4, 7], "body"),
("grip", [-1.5, -5, 4], [3, 5, 3], "accent"),
("cell", [-1.5, -4, -4], [3, 3, 5], "glow"),
],
"moving": "cell",
"recipe": [("minecraft:iron_ingot", 5), ("minecraft:amethyst_shard", 3), ("minecraft:redstone", 4), ("minecraft:lightning_rod", 1)],
},
{
"id": "twin_smg",
"name": "Twin Viper SMG",
"style": "twin_smg",
"grip": "ntgl:one_handed",
"ammo": "minecraft:iron_nugget",
"ammo_type": "ntgl:standard",
"projectile": "ntgl:bullet",
"damage_type": "ntgl:bullet",
"damage": 4.0,
"capacity": 24,
"rate": 2,
"reload": 34,
"fire_mode": ["ntgl:auto"],
"charge": 0,
"full_charge": False,
"recoil": 1.8,
"speed": 32.0,
"gravity": False,
"color": (68, 72, 66),
"accent": (191, 137, 56),
"sound": "minecraft:item.firecharge.use",
"reload_sound": "minecraft:item.armor.equip_chain",
"parts": [
("receiver", [-2, 0, -1], [4, 4, 10], "body"),
("barrel", [-1.2, 1, -10], [2.4, 2, 10], "metal"),
("muzzle", [-1.8, 0.6, -11], [3.6, 2.8, 2], "accent"),
("magazine", [-1.4, -5, 1], [2.8, 5, 4], "metal"),
("grip", [-1.5, -4, 5], [3, 4, 3], "body"),
("sight", [-0.7, 2.4, 2], [1.4, 1.2, 2], "accent"),
],
"moving": "magazine",
"recipe": [("minecraft:iron_ingot", 4), ("minecraft:copper_ingot", 3), ("minecraft:gold_nugget", 4), ("minecraft:crossbow", 1)],
},
{
"id": "field_smg",
"name": "Field SMG",
"style": "field_smg",
"grip": "ntgl:two_handed",
"ammo": "minecraft:iron_nugget",
"ammo_type": "ntgl:standard",
"projectile": "ntgl:bullet",