Create data.js
This commit is contained in:
parent
50d9b7a0d1
commit
f8aa4a1e38
1 changed files with 40 additions and 0 deletions
40
kubejs/server_scripts/computer_craft/data.js
Normal file
40
kubejs/server_scripts/computer_craft/data.js
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
// priority: 0
|
||||
|
||||
const registerComputerCraftData = (event) => {
|
||||
const TURTLE_TOOL_TYPES = [ GTToolType.SWORD, GTToolType.PICKAXE, GTToolType.AXE, GTToolType.SHOVEL, GTToolType.HOE ]
|
||||
|
||||
GTRegistries.MATERIALS.forEach(material => {
|
||||
TURTLE_TOOL_TYPES.forEach(type => {
|
||||
let toolStack = $ToolHelper.get(type, material)
|
||||
|
||||
if (!toolStack.isEmpty()) {
|
||||
|
||||
let json = {
|
||||
type: "computercraft:tool",
|
||||
item: toolStack.getId(),
|
||||
adjective: `upgrade.minecraft.diamond_${type.name}.adjective`,
|
||||
allowEnchantments: true,
|
||||
consumeDurability: "always"
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case GTToolType.SWORD:
|
||||
json["breakable"] = "computercraft:turtle_sword_harvestable"
|
||||
break;
|
||||
|
||||
case GTToolType.SHOVEL:
|
||||
json["breakable"] = "computercraft:turtle_shovel_harvestable"
|
||||
break;
|
||||
|
||||
|
||||
case GTToolType.HOE:
|
||||
json["breakable"] = "computercraft:turtle_hoe_harvestable"
|
||||
break;
|
||||
}
|
||||
|
||||
event.addJson(`computercraft:computercraft/turtle_upgrades/${material}_${type.name}`, json)
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue