mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-19 15:09:15 +00:00
简化简单纹理模型
This commit is contained in:
@@ -3,13 +3,7 @@ items:
|
||||
material: nether_brick
|
||||
data:
|
||||
item-name: <!i><l10n:item.amethyst_torch>
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: minecraft:item/custom/amethyst_torch
|
||||
generation:
|
||||
parent: minecraft:item/generated
|
||||
textures:
|
||||
layer0: minecraft:block/custom/amethyst_torch
|
||||
texture: minecraft:block/custom/amethyst_torch
|
||||
behavior:
|
||||
- type: wall_block_item
|
||||
block: default:amethyst_wall_torch
|
||||
|
||||
@@ -16,7 +16,6 @@ items:
|
||||
settings:
|
||||
template:
|
||||
- default:sound/metal
|
||||
- default:pickaxe_power/level_1
|
||||
overrides:
|
||||
hardness: 3.0
|
||||
resistance: 4.5
|
||||
@@ -27,6 +26,8 @@ items:
|
||||
map-color: 15
|
||||
tags:
|
||||
- minecraft:mineable/pickaxe
|
||||
correct-tools:
|
||||
template: default:pickaxe_power/level_1
|
||||
behavior:
|
||||
type: lamp_block
|
||||
states:
|
||||
|
||||
@@ -3,10 +3,7 @@ items:
|
||||
material: nether_brick
|
||||
data:
|
||||
item-name: <!i><l10n:item.ender_pearl_flower_seeds>
|
||||
model:
|
||||
template: default:model/simplified_generated
|
||||
arguments:
|
||||
path: minecraft:item/custom/ender_pearl_flower_seeds
|
||||
texture: minecraft:item/custom/ender_pearl_flower_seeds
|
||||
behavior:
|
||||
type: block_item
|
||||
block: default:ender_pearl_flower
|
||||
|
||||
@@ -3,10 +3,7 @@ items:
|
||||
material: nether_brick
|
||||
data:
|
||||
item-name: <!i><l10n:item.fairy_flower>
|
||||
model:
|
||||
template: default:model/simplified_generated
|
||||
arguments:
|
||||
path: minecraft:item/custom/fairy_flower
|
||||
texture: minecraft:item/custom/fairy_flower
|
||||
behavior:
|
||||
type: block_item
|
||||
block:
|
||||
|
||||
@@ -3,10 +3,7 @@ items:
|
||||
material: nether_brick
|
||||
data:
|
||||
item-name: <!i><l10n:item.flame_cane>
|
||||
model:
|
||||
template: default:model/simplified_generated
|
||||
arguments:
|
||||
path: minecraft:item/custom/flame_cane
|
||||
texture: minecraft:item/custom/flame_cane
|
||||
behavior:
|
||||
type: block_item
|
||||
block:
|
||||
|
||||
@@ -51,13 +51,14 @@ items:
|
||||
settings:
|
||||
template:
|
||||
- default:sound/stone
|
||||
- default:pickaxe_power/level_1
|
||||
- default:settings/solid_1x1x1
|
||||
overrides:
|
||||
hardness: 1.8
|
||||
resistance: 1.8
|
||||
instrument: basedrum
|
||||
map-color: 45
|
||||
correct-tools:
|
||||
template: default:pickaxe_power/level_1
|
||||
state:
|
||||
auto-state: solid
|
||||
model:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
items:
|
||||
default:hami_melon_slice:
|
||||
material: melon_slice
|
||||
texture: minecraft:item/custom/hami_melon_slice
|
||||
data:
|
||||
item-name: <!i><l10n:item.hami_melon_slice>
|
||||
$$>=1.20.5:
|
||||
@@ -13,10 +14,6 @@ items:
|
||||
food:
|
||||
nutrition: 2
|
||||
saturation: 1.0
|
||||
model:
|
||||
template: default:model/simplified_generated
|
||||
arguments:
|
||||
path: minecraft:item/custom/hami_melon_slice
|
||||
default:hami_melon:
|
||||
material: nether_brick
|
||||
data:
|
||||
@@ -32,10 +29,7 @@ items:
|
||||
material: nether_brick
|
||||
data:
|
||||
item-name: <!i><l10n:item.hami_melon_seeds>
|
||||
model:
|
||||
template: default:model/simplified_generated
|
||||
arguments:
|
||||
path: minecraft:item/custom/hami_melon_seeds
|
||||
texture: minecraft:item/custom/hami_melon_seeds
|
||||
behavior:
|
||||
type: block_item
|
||||
block: default:hami_melon_stem
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
items:
|
||||
default:magma_fruit:
|
||||
material: carrot
|
||||
model:
|
||||
template: default:model/simplified_generated
|
||||
arguments:
|
||||
path: minecraft:item/custom/magma_fruit
|
||||
texture: minecraft:item/custom/magma_fruit
|
||||
data:
|
||||
item-name: <!i><white><l10n:item.magma_fruit>
|
||||
$$>=1.20.5:
|
||||
|
||||
@@ -30,11 +30,6 @@ items:
|
||||
- type: expression
|
||||
expression: '!<arg:player.is_sneaking>'
|
||||
settings:
|
||||
template:
|
||||
- default:pickaxe_power/level_4
|
||||
overrides:
|
||||
tags:
|
||||
- minecraft:mineable/pickaxe
|
||||
sounds:
|
||||
break: minecraft:block.anvil.break
|
||||
step: minecraft:block.anvil.step
|
||||
@@ -45,6 +40,9 @@ items:
|
||||
hardness: 10.0
|
||||
resistance: 1200
|
||||
push-reaction: block
|
||||
correct-tools:
|
||||
template: default:pickaxe_power/level_4
|
||||
tags: ["minecraft:mineable/pickaxe"]
|
||||
states:
|
||||
properties:
|
||||
facing_clockwise:
|
||||
|
||||
@@ -157,10 +157,6 @@ items:
|
||||
lore:
|
||||
- "<!i><gray>Requires the datapack tree configuration to function."
|
||||
- "<!i><gray>If not configured, an oak tree will grow by default."
|
||||
model:
|
||||
template: default:model/generated
|
||||
arguments:
|
||||
model: minecraft:item/custom/palm_sapling
|
||||
texture: minecraft:block/custom/palm_sapling
|
||||
behavior:
|
||||
type: block_item
|
||||
@@ -284,10 +280,7 @@ items:
|
||||
item-name: <!i><l10n:item.palm_door>
|
||||
settings:
|
||||
fuel-time: 200
|
||||
model:
|
||||
template: default:model/simplified_generated
|
||||
arguments:
|
||||
path: minecraft:item/custom/palm_door
|
||||
texture: minecraft:item/custom/palm_door
|
||||
behavior:
|
||||
type: double_high_block_item
|
||||
block:
|
||||
@@ -693,15 +686,15 @@ recipes:
|
||||
default:palm_planks:
|
||||
template: default:recipe/planks
|
||||
arguments:
|
||||
wood_type: palm
|
||||
wood_type: default:palm
|
||||
default:palm_wood:
|
||||
template: default:recipe/log_2_wood
|
||||
arguments:
|
||||
wood_type: palm
|
||||
wood_type: default:palm
|
||||
default:stripped_palm_wood:
|
||||
template: default:recipe/log_2_wood
|
||||
arguments:
|
||||
wood_type: stripped_palm
|
||||
wood_type: default:stripped_palm
|
||||
default:palm_trapdoor:
|
||||
type: shaped
|
||||
pattern:
|
||||
|
||||
@@ -3,10 +3,7 @@ items:
|
||||
material: nether_brick
|
||||
data:
|
||||
item-name: <!i><l10n:item.pebble>
|
||||
model:
|
||||
template: default:model/simplified_generated
|
||||
arguments:
|
||||
path: minecraft:item/custom/pebble
|
||||
texture: minecraft:item/custom/pebble
|
||||
behavior:
|
||||
- type: block_item
|
||||
block:
|
||||
|
||||
@@ -3,10 +3,7 @@ items:
|
||||
material: nether_brick
|
||||
data:
|
||||
item-name: <!i><l10n:item.reed>
|
||||
model:
|
||||
template: default:model/simplified_generated
|
||||
arguments:
|
||||
path: minecraft:item/custom/reed
|
||||
texture: minecraft:item/custom/reed
|
||||
behavior:
|
||||
type: liquid_collision_block_item
|
||||
block:
|
||||
|
||||
@@ -32,10 +32,7 @@ items:
|
||||
percent: 0.25
|
||||
data:
|
||||
item-name: <!i><#FF8C00><l10n:item.topaz>
|
||||
model:
|
||||
template: default:model/simplified_generated
|
||||
arguments:
|
||||
path: minecraft:item/custom/topaz
|
||||
texture: minecraft:item/custom/topaz
|
||||
blocks:
|
||||
default:topaz_ore:
|
||||
loot:
|
||||
@@ -75,26 +72,42 @@ blocks:
|
||||
path: minecraft:block/custom/deepslate_topaz_ore
|
||||
recipes:
|
||||
default:topaz_from_smelting_topaz_ore:
|
||||
template: default:recipe/smelting_ore
|
||||
arguments:
|
||||
exp: 1.0
|
||||
type: smelting
|
||||
experience: 1.0
|
||||
category: misc
|
||||
group: topaz
|
||||
time: 200
|
||||
ingredient: default:topaz_ore
|
||||
result: default:topaz
|
||||
result:
|
||||
id: default:topaz
|
||||
count: 1
|
||||
default:topaz_from_smelting_deepslate_topaz_ore:
|
||||
template: default:recipe/smelting_ore
|
||||
arguments:
|
||||
exp: 1.0
|
||||
type: smelting
|
||||
experience: 1.0
|
||||
category: misc
|
||||
group: topaz
|
||||
time: 200
|
||||
ingredient: default:deepslate_topaz_ore
|
||||
result: default:topaz
|
||||
result:
|
||||
id: default:topaz
|
||||
count: 1
|
||||
default:topaz_from_blasting_topaz_ore:
|
||||
template: default:recipe/blasting_ore
|
||||
arguments:
|
||||
exp: 1.0
|
||||
type: blasting
|
||||
experience: 1.0
|
||||
category: misc
|
||||
group: topaz
|
||||
time: 100
|
||||
ingredient: default:topaz_ore
|
||||
result: default:topaz
|
||||
result:
|
||||
id: default:topaz
|
||||
count: 1
|
||||
default:topaz_from_blasting_deepslate_topaz_ore:
|
||||
template: default:recipe/blasting_ore
|
||||
arguments:
|
||||
exp: 1.0
|
||||
type: blasting
|
||||
experience: 1.0
|
||||
category: misc
|
||||
group: topaz
|
||||
time: 100
|
||||
ingredient: default:deepslate_topaz_ore
|
||||
result: default:topaz
|
||||
result:
|
||||
id: default:topaz
|
||||
count: 1
|
||||
@@ -1,6 +1,6 @@
|
||||
templates:
|
||||
default:emoji/basic:
|
||||
content: <hover:show_text:'<l10n:emoji.tip>'><!shadow><white><arg:emoji></white></!shadow></hover>
|
||||
content: <hover:show_text:'<i18n:emoji.tip>'><!shadow><white><arg:emoji></white></!shadow></hover>
|
||||
emoji:
|
||||
default:emoji_smiley:
|
||||
template: default:emoji/basic
|
||||
|
||||
@@ -3,10 +3,7 @@ items:
|
||||
material: nether_brick
|
||||
data:
|
||||
item-name: <!i><l10n:item.flower_basket>
|
||||
model:
|
||||
template: default:model/simplified_generated
|
||||
arguments:
|
||||
path: minecraft:item/custom/flower_basket_2d
|
||||
texture: minecraft:item/custom/flower_basket_2d
|
||||
behavior:
|
||||
type: furniture_item
|
||||
furniture: default:flower_basket
|
||||
|
||||
@@ -3,9 +3,7 @@ items:
|
||||
material: nether_brick
|
||||
data:
|
||||
item-name: <!i><l10n:item.wooden_chair>
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: minecraft:item/custom/wooden_chair
|
||||
model: minecraft:item/custom/wooden_chair
|
||||
behavior:
|
||||
type: furniture_item
|
||||
furniture:
|
||||
|
||||
@@ -53,10 +53,7 @@ items:
|
||||
item-name: <!i><#FF8C00><l10n:item.topaz_pickaxe>
|
||||
tooltip-style: minecraft:topaz
|
||||
max-damage: 64
|
||||
model:
|
||||
template: default:model/simplified_handheld
|
||||
arguments:
|
||||
path: minecraft:item/custom/topaz_pickaxe
|
||||
texture: minecraft:item/custom/topaz_pickaxe
|
||||
default:topaz_axe:
|
||||
material: golden_axe
|
||||
settings:
|
||||
@@ -66,10 +63,7 @@ items:
|
||||
item-name: <!i><#FF8C00><l10n:item.topaz_axe>
|
||||
tooltip-style: minecraft:topaz
|
||||
max-damage: 64
|
||||
model:
|
||||
template: default:model/simplified_handheld
|
||||
arguments:
|
||||
path: minecraft:item/custom/topaz_axe
|
||||
texture: minecraft:item/custom/topaz_axe
|
||||
default:topaz_hoe:
|
||||
material: golden_hoe
|
||||
settings:
|
||||
@@ -79,36 +73,25 @@ items:
|
||||
item-name: <!i><#FF8C00><l10n:item.topaz_hoe>
|
||||
tooltip-style: minecraft:topaz
|
||||
max-damage: 64
|
||||
model:
|
||||
template: default:model/simplified_handheld
|
||||
arguments:
|
||||
path: minecraft:item/custom/topaz_hoe
|
||||
texture: minecraft:item/custom/topaz_hoe
|
||||
default:topaz_shovel:
|
||||
material: golden_shovel
|
||||
settings:
|
||||
tags:
|
||||
- default:topaz_tools
|
||||
tags: ["default:topaz_tools"]
|
||||
data:
|
||||
item-name: <!i><#FF8C00><l10n:item.topaz_shovel>
|
||||
tooltip-style: minecraft:topaz
|
||||
max-damage: 64
|
||||
model:
|
||||
template: default:model/simplified_handheld
|
||||
arguments:
|
||||
path: minecraft:item/custom/topaz_shovel
|
||||
texture: minecraft:item/custom/topaz_shovel
|
||||
default:topaz_sword:
|
||||
material: golden_sword
|
||||
settings:
|
||||
tags:
|
||||
- default:topaz_tools
|
||||
tags: ["default:topaz_tools"]
|
||||
data:
|
||||
item-name: <!i><#FF8C00><l10n:item.topaz_sword>
|
||||
tooltip-style: minecraft:topaz
|
||||
max-damage: 64
|
||||
model:
|
||||
template: default:model/simplified_handheld
|
||||
arguments:
|
||||
path: minecraft:item/custom/topaz_sword
|
||||
texture: minecraft:item/custom/topaz_sword
|
||||
$$>=1.21.4#topaz_trident:
|
||||
default:topaz_trident:
|
||||
material: trident
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
templates#settings:
|
||||
default:settings/solid_1x1x1:
|
||||
is-suffocating: true
|
||||
replaceable: false
|
||||
is-view-blocking: true
|
||||
is-redstone-conductor: true
|
||||
can-occlude: true
|
||||
default:settings/transparent_1x1x1:
|
||||
is-suffocating: false
|
||||
replaceable: false
|
||||
is-view-blocking: false
|
||||
is-redstone-conductor: false
|
||||
can-occlude: false
|
||||
default:settings/sapling:
|
||||
burnable: false
|
||||
template:
|
||||
- default:hardness/none
|
||||
- default:sound/grass
|
||||
overrides:
|
||||
push-reaction: destroy
|
||||
is-randomly-ticking: true
|
||||
tags:
|
||||
- minecraft:mineable/axe
|
||||
- minecraft:saplings
|
||||
- minecraft:sword_efficient
|
||||
default:settings/leaves:
|
||||
template:
|
||||
- default:sound/grass
|
||||
- default:burn_data/leaves
|
||||
- default:hardness/leaves
|
||||
- default:settings/transparent_1x1x1
|
||||
overrides:
|
||||
hardness: 0.2
|
||||
resistance: 0.2
|
||||
push-reaction: destroy
|
||||
instrument: harp
|
||||
tags:
|
||||
- minecraft:mineable/hoe
|
||||
- minecraft:sword_efficient
|
||||
- minecraft:leaves
|
||||
- minecraft:replaceable_by_trees
|
||||
default:settings/wood:
|
||||
template:
|
||||
- default:sound/wood
|
||||
- default:burn_data/wood
|
||||
- default:hardness/wood
|
||||
overrides:
|
||||
instrument: bass
|
||||
tags:
|
||||
- minecraft:mineable/axe
|
||||
- minecraft:logs_that_burn
|
||||
- minecraft:logs
|
||||
- minecraft:completes_find_tree_tutorial
|
||||
default:settings/planks:
|
||||
template:
|
||||
- default:sound/wood
|
||||
- default:burn_data/planks
|
||||
- default:hardness/planks
|
||||
- default:settings/solid_1x1x1
|
||||
overrides:
|
||||
instrument: bass
|
||||
tags: ["minecraft:mineable/axe"]
|
||||
default:settings/ore:
|
||||
template:
|
||||
- default:sound/stone
|
||||
- default:settings/solid_1x1x1
|
||||
overrides:
|
||||
hardness: 3.0
|
||||
resistance: 3.0
|
||||
instrument: basedrum
|
||||
map-color: 11
|
||||
tags: ["minecraft:mineable/pickaxe"]
|
||||
correct-tools::template: default:pickaxe_power/level_${break_power}
|
||||
default:settings/deepslate_ore:
|
||||
template:
|
||||
- default:sound/deepslate
|
||||
- default:settings/solid_1x1x1
|
||||
- default:hardness/deepslate
|
||||
overrides:
|
||||
hardness: 4.5
|
||||
resistance: 3.0
|
||||
instrument: basedrum
|
||||
map-color: 59
|
||||
tags: ["minecraft:mineable/pickaxe"]
|
||||
correct-tools::template: default:pickaxe_power/level_${break_power}
|
||||
|
||||
templates#hardness:
|
||||
default:hardness/none:
|
||||
hardness: 0
|
||||
resistance: 0
|
||||
default:hardness/leaves:
|
||||
hardness: 0.2
|
||||
resistance: 0.2
|
||||
default:hardness/glass:
|
||||
hardness: 0.3
|
||||
resistance: 0.3
|
||||
default:hardness/stone:
|
||||
hardness: 1.5
|
||||
resistance: 6.0
|
||||
default:hardness/deepslate:
|
||||
hardness: 3.0
|
||||
resistance: 6.0
|
||||
default:hardness/obsidian:
|
||||
hardness: 50.0
|
||||
resistance: 1200.0
|
||||
default:hardness/wool:
|
||||
hardness: 0.8
|
||||
resistance: 0.8
|
||||
default:hardness/wood:
|
||||
hardness: 2.0
|
||||
resistance: 2.0
|
||||
default:hardness/planks:
|
||||
hardness: 2.0
|
||||
resistance: 3.0
|
||||
default:hardness/button:
|
||||
hardness: 0.5
|
||||
resistance: 0.5
|
||||
default:hardness/melon:
|
||||
hardness: 1.0
|
||||
resistance: 1.0
|
||||
|
||||
templates#burn_data:
|
||||
default:burn_data/leaves:
|
||||
burnable: true
|
||||
burn-chance: 30
|
||||
fire-spread-chance: 60
|
||||
default:burn_data/wood:
|
||||
burnable: true
|
||||
burn-chance: 5
|
||||
fire-spread-chance: 5
|
||||
default:burn_data/planks:
|
||||
burnable: true
|
||||
burn-chance: 5
|
||||
fire-spread-chance: 20
|
||||
default:burn_data/wool:
|
||||
burnable: true
|
||||
burn-chance: 30
|
||||
fire-spread-chance: 60
|
||||
default:burn_data/vine:
|
||||
burnable: true
|
||||
burn-chance: 15
|
||||
fire-spread-chance: 100
|
||||
default:burn_data/carpet:
|
||||
burnable: true
|
||||
burn-chance: 60
|
||||
fire-spread-chance: 20
|
||||
default:burn_data/coal:
|
||||
burnable: true
|
||||
burn-chance: 5
|
||||
fire-spread-chance: 5
|
||||
default:burn_data/grass:
|
||||
burnable: true
|
||||
burn-chance: 60
|
||||
fire-spread-chance: 100
|
||||
|
||||
templates#sounds:
|
||||
default:sound/block_template:
|
||||
sounds:
|
||||
break: minecraft:block.${block_type}.break
|
||||
step: minecraft:block.${block_type}.step
|
||||
place: minecraft:block.${block_type}.place
|
||||
hit: minecraft:block.${block_type}.hit
|
||||
fall: minecraft:block.${block_type}.fall
|
||||
default:sound/crop:
|
||||
sounds:
|
||||
break: minecraft:block.crop.break
|
||||
step: minecraft:block.grass.step
|
||||
place: minecraft:item.crop.plant
|
||||
hit: minecraft:block.grass.hit
|
||||
fall: minecraft:block.grass.fall
|
||||
default:sound/stem_crop:
|
||||
sounds:
|
||||
break: minecraft:block.crop.break
|
||||
step: minecraft:block.wood.step
|
||||
place: minecraft:item.crop.plant
|
||||
hit: minecraft:block.wood.hit
|
||||
fall: minecraft:block.wood.fall
|
||||
default:sound/grass:
|
||||
template: default:sound/block_template
|
||||
arguments::block_type: grass
|
||||
default:sound/wood:
|
||||
template: default:sound/block_template
|
||||
arguments::block_type: wood
|
||||
default:sound/stone:
|
||||
template: default:sound/block_template
|
||||
arguments::block_type: stone
|
||||
default:sound/deepslate:
|
||||
template: default:sound/block_template
|
||||
arguments::block_type: deepslate
|
||||
default:sound/glass:
|
||||
template: default:sound/block_template
|
||||
arguments::block_type: glass
|
||||
default:sound/sand:
|
||||
template: default:sound/block_template
|
||||
arguments::block_type: sand
|
||||
default:sound/gravel:
|
||||
template: default:sound/block_template
|
||||
arguments::block_type: gravel
|
||||
default:sound/metal:
|
||||
template: default:sound/block_template
|
||||
arguments::block_type: metal
|
||||
default:sound/snow:
|
||||
template: default:sound/block_template
|
||||
arguments::block_type: snow
|
||||
default:sound/bamboo:
|
||||
template: default:sound/block_template
|
||||
arguments::block_type: bamboo
|
||||
default:sound/vine:
|
||||
template: default:sound/block_template
|
||||
arguments::block_type: vine
|
||||
default:sound/lantern:
|
||||
template: default:sound/block_template
|
||||
arguments::block_type: lantern
|
||||
default:sound/amethyst_block:
|
||||
template: default:sound/block_template
|
||||
arguments::block_type: amethyst_block
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,270 @@
|
||||
templates:
|
||||
|
||||
# Drop itself.
|
||||
# Suitable for the vast majority of loot items.
|
||||
# Only requires the template ID to be filled in during use, with no parameter requirements.
|
||||
|
||||
# template: default:loot_table/self
|
||||
default:loot_table/self:
|
||||
pools:
|
||||
- rolls: 1
|
||||
conditions:
|
||||
- type: survives_explosion
|
||||
entries:
|
||||
- type: item
|
||||
item: ${__NAMESPACE__}:${__ID__}
|
||||
|
||||
# Drop the original furniture item or a fallback item.
|
||||
|
||||
# template: default:loot_table/furniture
|
||||
# arguments:
|
||||
# item: the fallback item
|
||||
default:loot_table/furniture:
|
||||
pools:
|
||||
- rolls: 1
|
||||
entries:
|
||||
- type: furniture_item
|
||||
item: ${item}
|
||||
|
||||
# Drop one or more items.
|
||||
|
||||
# template: default:loot_table/basic
|
||||
# arguments:
|
||||
# item: the item
|
||||
# count: the amount of the item
|
||||
default:loot_table/basic:
|
||||
pools:
|
||||
- rolls: 1
|
||||
conditions:
|
||||
- type: survives_explosion
|
||||
entries:
|
||||
- type: item
|
||||
item: ${item}
|
||||
functions:
|
||||
- type: set_count
|
||||
add: false
|
||||
count: ${count:-1}
|
||||
|
||||
# Drop the door.
|
||||
# Since a door consists of two blocks, if both of them have drop items, it will cause duplication.
|
||||
|
||||
# template: default:loot_table/door
|
||||
default:loot_table/door:
|
||||
pools:
|
||||
- rolls: 1
|
||||
entries:
|
||||
- type: item
|
||||
item: ${__NAMESPACE__}:${__ID__}
|
||||
conditions:
|
||||
- type: match_block_property
|
||||
properties:
|
||||
half: lower
|
||||
|
||||
# Drop with silk touch
|
||||
# This template is used for loot that only drops when harvested with Silk Touch.
|
||||
|
||||
# template: default:loot_table/silk_touch
|
||||
# arguments:
|
||||
# item: the item
|
||||
# count: the amount of the item
|
||||
default:loot_table/silk_touch:
|
||||
pools:
|
||||
- rolls: 1
|
||||
conditions:
|
||||
- type: enchantment
|
||||
predicate: minecraft:silk_touch>=1
|
||||
entries:
|
||||
- type: item
|
||||
item: ${item}
|
||||
functions:
|
||||
- type: set_count
|
||||
add: false
|
||||
count: ${count:-1}
|
||||
|
||||
# Drop slabs
|
||||
# When two slabs are stacked, the loot table should be set to drop two items.
|
||||
|
||||
# template: default:loot_table/slab
|
||||
default:loot_table/slab:
|
||||
pools:
|
||||
- rolls: 1
|
||||
entries:
|
||||
- type: item
|
||||
item: ${__NAMESPACE__}:${__ID__}
|
||||
functions:
|
||||
- type: set_count
|
||||
count: 2
|
||||
add: false
|
||||
conditions:
|
||||
- type: match_block_property
|
||||
properties:
|
||||
type: double
|
||||
- type: explosion_decay
|
||||
|
||||
# This loot table is for crops that are grown from seeds. Example: wheat.
|
||||
|
||||
# template: default:loot_table/seed_crop
|
||||
# arguments:
|
||||
# crop_item: the mature crop item
|
||||
# crop_item_count: quantity of mature crop items
|
||||
# crop_seed: the seed item of the crop
|
||||
# extra_seed_count: additional seeds dropped when crop reaches maturity
|
||||
# ripe_age: the max age
|
||||
default:loot_table/seed_crop:
|
||||
pools:
|
||||
- rolls: 1
|
||||
entries:
|
||||
- type: alternatives
|
||||
children:
|
||||
- type: item
|
||||
item: ${crop_item}
|
||||
conditions:
|
||||
- type: match_block_property
|
||||
properties:
|
||||
age: ${ripe_age}
|
||||
functions:
|
||||
- type: set_count
|
||||
add: false
|
||||
count: ${crop_item_count:-1}
|
||||
- type: item
|
||||
item: ${crop_seed}
|
||||
- rolls: 1
|
||||
conditions:
|
||||
- type: match_block_property
|
||||
properties:
|
||||
age: ${ripe_age}
|
||||
entries:
|
||||
- type: item
|
||||
item: ${crop_seed}
|
||||
functions:
|
||||
- type: apply_bonus
|
||||
enchantment: minecraft:fortune
|
||||
formula:
|
||||
type: binomial_with_bonus_count
|
||||
extra: ${extra_seed_count:-3}
|
||||
probability: 0.5714286
|
||||
|
||||
# This loot table is for crops that are grown from themselves. Example: carrots.
|
||||
|
||||
# template: default:loot_table/crop
|
||||
# arguments:
|
||||
# crop_item: the crop item
|
||||
# extra_crop_count: additional crops dropped when crop reaches maturity
|
||||
# ripe_age: the max age
|
||||
default:loot_table/crop:
|
||||
pools:
|
||||
- rolls: 1
|
||||
entries:
|
||||
- type: item
|
||||
item: ${crop_item}
|
||||
- rolls: 1
|
||||
conditions:
|
||||
- type: match_block_property
|
||||
properties:
|
||||
age: ${ripe_age}
|
||||
entries:
|
||||
- type: item
|
||||
item: ${crop_item}
|
||||
functions:
|
||||
- type: apply_bonus
|
||||
enchantment: minecraft:fortune
|
||||
formula:
|
||||
type: binomial_with_bonus_count
|
||||
extra: ${extra_crop_count:-3}
|
||||
probability: 0.5714286
|
||||
|
||||
# When Silk Touch is used, it drops the ore block itself. When Fortune is used, it increases the drops of the materials.
|
||||
|
||||
# template: default:loot_table/ore
|
||||
# arguments:
|
||||
# ore_block: the ore block
|
||||
# ore_drop: the drops of the ore
|
||||
# ore_drop_count: the amount of the ore materials
|
||||
# exp: the exp to drop
|
||||
default:loot_table/ore:
|
||||
pools:
|
||||
- rolls: 1
|
||||
entries:
|
||||
- type: alternatives
|
||||
children:
|
||||
- type: item
|
||||
item: ${ore_block}
|
||||
conditions:
|
||||
- type: enchantment
|
||||
predicate: minecraft:silk_touch>=1
|
||||
- type: item
|
||||
item: ${ore_drop}
|
||||
functions:
|
||||
- type: set_count
|
||||
count: ${ore_drop_count:-1}
|
||||
add: false
|
||||
- type: apply_bonus
|
||||
enchantment: minecraft:fortune
|
||||
formula:
|
||||
type: ore_drops
|
||||
- type: explosion_decay
|
||||
- type: drop_exp
|
||||
count: ${exp:-2~4}
|
||||
|
||||
# Using Silk Touch or shears will cause the leaves block itself to drop.
|
||||
# Using Fortune, however, increases the drop rates of sticks and saplings.
|
||||
|
||||
# template: default:loot_table/leaves
|
||||
# arguments:
|
||||
# leaves: the leaves block
|
||||
# sapling: the sapling item
|
||||
default:loot_table/leaves:
|
||||
pools:
|
||||
- rolls: 1
|
||||
entries:
|
||||
- type: alternatives
|
||||
children:
|
||||
- type: item
|
||||
item: ${leaves}
|
||||
conditions:
|
||||
- type: any_of
|
||||
terms:
|
||||
- type: match_item
|
||||
id: minecraft:shears
|
||||
- type: enchantment
|
||||
predicate: minecraft:silk_touch>=1
|
||||
- type: item
|
||||
item: ${sapling}
|
||||
conditions:
|
||||
- type: survives_explosion
|
||||
- type: table_bonus
|
||||
enchantment: minecraft:fortune
|
||||
chances:
|
||||
- 0.05
|
||||
- 0.0625
|
||||
- 0.083333333
|
||||
- 0.1
|
||||
- rolls: 1
|
||||
conditions:
|
||||
- type: inverted
|
||||
term:
|
||||
type: any_of
|
||||
terms:
|
||||
- type: match_item
|
||||
id: minecraft:shears
|
||||
- type: enchantment
|
||||
predicate: minecraft:silk_touch>=1
|
||||
entries:
|
||||
- type: item
|
||||
item: minecraft:stick
|
||||
conditions:
|
||||
- type: table_bonus
|
||||
enchantment: minecraft:fortune
|
||||
chances:
|
||||
- 0.02
|
||||
- 0.022222222
|
||||
- 0.025
|
||||
- 0.033333333
|
||||
- 0.1
|
||||
functions:
|
||||
- type: set_count
|
||||
count:
|
||||
type: uniform
|
||||
min: 1
|
||||
max: 2
|
||||
- type: explosion_decay
|
||||
@@ -0,0 +1,559 @@
|
||||
# blocks
|
||||
templates#models#block:
|
||||
# template: default:model/cube_all
|
||||
# arguments:
|
||||
# model: model_path
|
||||
# texture: texture_path
|
||||
default:model/cube_all:
|
||||
path: ${model}
|
||||
generation:
|
||||
parent: minecraft:block/cube_all
|
||||
textures:
|
||||
all: ${texture}
|
||||
# template: default:model/simplified_cube_all
|
||||
# arguments:
|
||||
# path: [model/texture]_path
|
||||
default:model/simplified_cube_all:
|
||||
path: ${path}
|
||||
generation:
|
||||
parent: minecraft:block/cube_all
|
||||
textures:
|
||||
all: ${path}
|
||||
# template: default:model/cube_column
|
||||
# arguments:
|
||||
# model: model_path
|
||||
# end_texture: end_texture_path
|
||||
# side_texture: side_texture_path
|
||||
default:model/cube_column:
|
||||
path: ${model}
|
||||
generation:
|
||||
parent: minecraft:block/cube_column
|
||||
textures:
|
||||
end: ${end_texture}
|
||||
side: ${side_texture}
|
||||
# template: default:model/cube
|
||||
# arguments:
|
||||
# model: model_path
|
||||
# particle_texture: particle_texture_path
|
||||
# down_texture: down_texture_path
|
||||
# up_texture: up_texture_path
|
||||
# north_texture: north_texture_path
|
||||
# east_texture: east_texture_path
|
||||
# south_texture: south_texture_path
|
||||
# west_texture: west_texture_path
|
||||
default:model/cube:
|
||||
path: ${model}
|
||||
generation:
|
||||
parent: minecraft:block/cube_column
|
||||
textures:
|
||||
particle: ${particle_texture}
|
||||
down: ${down_texture}
|
||||
up: ${up_texture}
|
||||
north: ${north_texture}
|
||||
east: ${east_texture}
|
||||
south: ${south_texture}
|
||||
west: ${west_texture}
|
||||
|
||||
# 2D items
|
||||
templates#models#2d:
|
||||
# template: default:model/generated
|
||||
# arguments:
|
||||
# model: model_path
|
||||
# texture: texture_path
|
||||
default:model/generated:
|
||||
type: minecraft:model
|
||||
path: ${model}
|
||||
generation:
|
||||
parent: minecraft:item/generated
|
||||
textures:
|
||||
layer0: ${texture}
|
||||
# template: default:model/simplified_generated
|
||||
# arguments:
|
||||
# path: [model/texture]_path
|
||||
default:model/simplified_generated:
|
||||
type: minecraft:model
|
||||
path: ${path}
|
||||
generation:
|
||||
parent: minecraft:item/generated
|
||||
textures:
|
||||
layer0: ${path}
|
||||
# template: default:model/2_layer_generated
|
||||
# arguments:
|
||||
# model: model_path
|
||||
# layer0: texture_path
|
||||
# layer1: texture_path
|
||||
default:model/2_layer_generated:
|
||||
type: minecraft:model
|
||||
path: ${model}
|
||||
generation:
|
||||
parent: minecraft:item/generated
|
||||
textures:
|
||||
layer0: ${layer0}
|
||||
layer1: ${layer1}
|
||||
# template: default:model/handheld
|
||||
# arguments:
|
||||
# model: model_path
|
||||
# texture: texture_path
|
||||
default:model/handheld:
|
||||
type: minecraft:model
|
||||
path: ${model}
|
||||
generation:
|
||||
parent: minecraft:item/handheld
|
||||
textures:
|
||||
layer0: ${texture}
|
||||
# template: default:model/simplified_handheld
|
||||
# arguments:
|
||||
# path: [model/texture]_path
|
||||
default:model/simplified_handheld:
|
||||
type: minecraft:model
|
||||
path: ${path}
|
||||
generation:
|
||||
parent: minecraft:item/handheld
|
||||
textures:
|
||||
layer0: ${path}
|
||||
# template: default:model/elytra
|
||||
# arguments:
|
||||
# model: model_path
|
||||
# broken_model: broken_model_path
|
||||
# texture: texture_path
|
||||
# broken_texture: broken_texture_path
|
||||
default:model/elytra:
|
||||
type: minecraft:condition
|
||||
property: minecraft:broken
|
||||
on-false:
|
||||
path: ${model}
|
||||
generation:
|
||||
parent: minecraft:item/generated
|
||||
textures:
|
||||
layer0: ${texture}
|
||||
on-true:
|
||||
path: ${broken_model}
|
||||
generation:
|
||||
parent: minecraft:item/generated
|
||||
textures:
|
||||
layer0: ${broken_texture}
|
||||
# template: default:model/simplified_elytra
|
||||
# arguments:
|
||||
# path: [model/texture]_path
|
||||
# broken_path: broken_[model/texture]_path
|
||||
default:model/simplified_elytra:
|
||||
template: default:model/elytra
|
||||
arguments:
|
||||
model: ${path}
|
||||
texture: ${path}
|
||||
broken_model: ${broken_path}
|
||||
broken_texture: ${broken_path}
|
||||
# template: default:model/armor_trim
|
||||
# arguments:
|
||||
# material: armor material type
|
||||
# part: slot type
|
||||
default:model/armor_trim:
|
||||
type: minecraft:select
|
||||
property: minecraft:trim_material
|
||||
fallback:
|
||||
type: minecraft:model
|
||||
path: minecraft:item/custom/${material}_${part}
|
||||
generation:
|
||||
parent: minecraft:item/generated
|
||||
textures:
|
||||
layer0: minecraft:item/custom/${material}_${part}
|
||||
cases:
|
||||
- when: minecraft:quartz
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: minecraft:item/custom/${material}_${part}_quartz_trim
|
||||
generation:
|
||||
parent: minecraft:item/generated
|
||||
textures:
|
||||
layer0: minecraft:item/custom/${material}_${part}
|
||||
layer1: minecraft:trims/items/${part}_trim_quartz
|
||||
- when: minecraft:iron
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: minecraft:item/custom/${material}_${part}_iron_trim
|
||||
generation:
|
||||
parent: minecraft:item/generated
|
||||
textures:
|
||||
layer0: minecraft:item/custom/${material}_${part}
|
||||
layer1: minecraft:trims/items/${part}_trim_iron
|
||||
- when: minecraft:netherite
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: minecraft:item/custom/${material}_${part}_netherite_trim
|
||||
generation:
|
||||
parent: minecraft:item/generated
|
||||
textures:
|
||||
layer0: minecraft:item/custom/${material}_${part}
|
||||
layer1: minecraft:trims/items/${part}_trim_netherite
|
||||
- when: minecraft:redstone
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: minecraft:item/custom/${material}_${part}_redstone_trim
|
||||
generation:
|
||||
parent: minecraft:item/generated
|
||||
textures:
|
||||
layer0: minecraft:item/custom/${material}_${part}
|
||||
layer1: minecraft:trims/items/${part}_trim_redstone
|
||||
- when: minecraft:copper
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: minecraft:item/custom/${material}_${part}_copper_trim
|
||||
generation:
|
||||
parent: minecraft:item/generated
|
||||
textures:
|
||||
layer0: minecraft:item/custom/${material}_${part}
|
||||
layer1: minecraft:trims/items/${part}_trim_copper
|
||||
- when: minecraft:gold
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: minecraft:item/custom/${material}_${part}_gold_trim
|
||||
generation:
|
||||
parent: minecraft:item/generated
|
||||
textures:
|
||||
layer0: minecraft:item/custom/${material}_${part}
|
||||
layer1: minecraft:trims/items/${part}_trim_gold
|
||||
- when: minecraft:emerald
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: minecraft:item/custom/${material}_${part}_emerald_trim
|
||||
generation:
|
||||
parent: minecraft:item/generated
|
||||
textures:
|
||||
layer0: minecraft:item/custom/${material}_${part}
|
||||
layer1: minecraft:trims/items/${part}_trim_emerald
|
||||
- when: minecraft:diamond
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: minecraft:item/custom/${material}_${part}_diamond_trim
|
||||
generation:
|
||||
parent: minecraft:item/generated
|
||||
textures:
|
||||
layer0: minecraft:item/custom/${material}_${part}
|
||||
layer1: minecraft:trims/items/${part}_trim_diamond
|
||||
- when: minecraft:lapis
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: minecraft:item/custom/${material}_${part}_lapis_trim
|
||||
generation:
|
||||
parent: minecraft:item/generated
|
||||
textures:
|
||||
layer0: minecraft:item/custom/${material}_${part}
|
||||
layer1: minecraft:trims/items/${part}_trim_lapis
|
||||
- when: minecraft:amethyst
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: minecraft:item/custom/${material}_${part}_amethyst_trim
|
||||
generation:
|
||||
parent: minecraft:item/generated
|
||||
textures:
|
||||
layer0: minecraft:item/custom/${material}_${part}
|
||||
layer1: minecraft:trims/items/${part}_trim_amethyst
|
||||
- when: minecraft:resin
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: minecraft:item/custom/${material}_${part}_resin_trim
|
||||
generation:
|
||||
parent: minecraft:item/generated
|
||||
textures:
|
||||
layer0: minecraft:item/custom/${material}_${part}
|
||||
layer1: minecraft:trims/items/${part}_trim_resin
|
||||
|
||||
# shield
|
||||
templates#models#shield:
|
||||
# template: default:model/shield_3d
|
||||
# arguments:
|
||||
# model: shield_model_path
|
||||
# block_model: shield_block_model_path
|
||||
default:model/shield_3d:
|
||||
type: minecraft:condition
|
||||
property: minecraft:using_item
|
||||
on-false:
|
||||
type: minecraft:model
|
||||
path: ${model}
|
||||
on-true:
|
||||
type: minecraft:model
|
||||
path: ${block_model}
|
||||
|
||||
# fishing rods
|
||||
templates#models#fishing_rod:
|
||||
# template: default:model/fishing_rod_3d
|
||||
# arguments:
|
||||
# model: rod_model_path
|
||||
# cast_model: rod_cast_model_path
|
||||
default:model/fishing_rod_3d:
|
||||
type: minecraft:condition
|
||||
property: minecraft:fishing_rod/cast
|
||||
on-false:
|
||||
type: minecraft:model
|
||||
path: ${model}
|
||||
on-true:
|
||||
type: minecraft:model
|
||||
path: ${cast_model}
|
||||
# template: default:model/fishing_rod_2d
|
||||
# arguments:
|
||||
# model: rod_model_path
|
||||
# cast_model: rod_cast_model_path
|
||||
# texture: rod_texture_path
|
||||
# cast_texture: rod_cast_texture_path
|
||||
default:model/fishing_rod_2d:
|
||||
type: minecraft:condition
|
||||
property: minecraft:fishing_rod/cast
|
||||
on-false:
|
||||
type: minecraft:model
|
||||
path: ${model}
|
||||
generation:
|
||||
parent: minecraft:item/fishing_rod
|
||||
textures:
|
||||
layer0: ${texture}
|
||||
on-true:
|
||||
type: minecraft:model
|
||||
path: ${cast_model}
|
||||
generation:
|
||||
parent: minecraft:item/fishing_rod
|
||||
textures:
|
||||
layer0: ${cast_texture}
|
||||
# template: default:model/simplified_fishing_rod_2d
|
||||
# arguments:
|
||||
# path: rod_[model/texture]_path
|
||||
# cast_path: rod_cast_[model/texture]_path
|
||||
default:model/simplified_fishing_rod_2d:
|
||||
template: default:model/fishing_rod_2d
|
||||
arguments:
|
||||
texture: ${path}
|
||||
model: ${path}
|
||||
cast_texture: ${cast_path}
|
||||
cast_model: ${cast_path}
|
||||
|
||||
# bows
|
||||
templates#models#bow:
|
||||
# template: default:model/bow_3d
|
||||
# arguments:
|
||||
# model: bow_model_path
|
||||
# pulling_0_model: bow_pulling_0_model_path
|
||||
# pulling_1_model: bow_pulling_1_model_path
|
||||
# pulling_2_model: bow_pulling_2_model_path
|
||||
default:model/bow_3d:
|
||||
type: minecraft:condition
|
||||
property: minecraft:using_item
|
||||
on-false:
|
||||
type: minecraft:model
|
||||
path: ${model}
|
||||
on-true:
|
||||
type: minecraft:range_dispatch
|
||||
property: minecraft:use_duration
|
||||
scale: 0.05
|
||||
entries:
|
||||
- model:
|
||||
type: minecraft:model
|
||||
path: ${pulling_1_model}
|
||||
threshold: 0.65
|
||||
- model:
|
||||
type: minecraft:model
|
||||
path: ${pulling_2_model}
|
||||
threshold: 0.9
|
||||
fallback:
|
||||
type: minecraft:model
|
||||
path: ${pulling_0_model}
|
||||
# template: default:model/bow_2d
|
||||
# arguments:
|
||||
# model: bow_model_path
|
||||
# pulling_0_model: bow_pulling_0_model_path
|
||||
# pulling_1_model: bow_pulling_1_model_path
|
||||
# pulling_2_model: bow_pulling_2_model_path
|
||||
# texture: bow_texture_path
|
||||
# pulling_0_texture: bow_pulling_0_texture_path
|
||||
# pulling_1_texture: bow_pulling_1_texture_path
|
||||
# pulling_2_texture: bow_pulling_2_texture_path
|
||||
default:model/bow_2d:
|
||||
type: minecraft:condition
|
||||
property: minecraft:using_item
|
||||
on-false:
|
||||
type: minecraft:model
|
||||
path: ${model}
|
||||
generation:
|
||||
parent: minecraft:item/bow
|
||||
textures:
|
||||
layer0: ${texture}
|
||||
on-true:
|
||||
type: minecraft:range_dispatch
|
||||
property: minecraft:use_duration
|
||||
scale: 0.05
|
||||
entries:
|
||||
- model:
|
||||
type: minecraft:model
|
||||
path: ${pulling_1_model}
|
||||
generation:
|
||||
parent: minecraft:item/bow_pulling_1
|
||||
textures:
|
||||
layer0: ${pulling_1_texture}
|
||||
threshold: 0.65
|
||||
- model:
|
||||
type: minecraft:model
|
||||
path: ${pulling_2_model}
|
||||
generation:
|
||||
parent: minecraft:item/bow_pulling_2
|
||||
textures:
|
||||
layer0: ${pulling_2_texture}
|
||||
threshold: 0.9
|
||||
fallback:
|
||||
type: minecraft:model
|
||||
path: ${pulling_0_model}
|
||||
generation:
|
||||
parent: minecraft:item/bow_pulling_0
|
||||
textures:
|
||||
layer0: ${pulling_0_texture}
|
||||
# template: default:model/simplified_bow_2d
|
||||
# arguments:
|
||||
# path: bow_[model/texture]_path
|
||||
# pulling_0_path: bow_pulling_0_[model/texture]_path
|
||||
# pulling_1_path: bow_pulling_1_[model/texture]_path
|
||||
# pulling_2_path: bow_pulling_2_[model/texture]_path
|
||||
default:model/simplified_bow_2d:
|
||||
template: default:model/bow_2d
|
||||
arguments:
|
||||
model: ${path}
|
||||
pulling_0_model: ${pulling_0_path}
|
||||
pulling_1_model: ${pulling_1_path}
|
||||
pulling_2_model: ${pulling_2_path}
|
||||
texture: ${path}
|
||||
pulling_0_texture: ${pulling_0_path}
|
||||
pulling_1_texture: ${pulling_1_path}
|
||||
pulling_2_texture: ${pulling_2_path}
|
||||
|
||||
# crossbows
|
||||
templates#models#crossbow:
|
||||
# template: default:model/crossbow_3d
|
||||
# arguments:
|
||||
# model: crossbow_model_path
|
||||
# arrow_model: crossbow_arrow_model_path
|
||||
# firework_model: crossbow_firework_model_path
|
||||
# pulling_0_model: crossbow_pulling_0_model_path
|
||||
# pulling_1_model: crossbow_pulling_1_model_path
|
||||
# pulling_2_model: crossbow_pulling_2_model_path
|
||||
default:model/crossbow_3d:
|
||||
type: minecraft:condition
|
||||
property: minecraft:using_item
|
||||
on-false:
|
||||
type: minecraft:select
|
||||
property: minecraft:charge_type
|
||||
cases:
|
||||
- when: arrow
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: ${arrow_model}
|
||||
- when: rocket
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: ${firework_model}
|
||||
fallback:
|
||||
type: minecraft:model
|
||||
path: ${model}
|
||||
on-true:
|
||||
type: minecraft:range_dispatch
|
||||
property: minecraft:crossbow/pull
|
||||
entries:
|
||||
- model:
|
||||
type: minecraft:model
|
||||
path: ${pulling_1_model}
|
||||
threshold: 0.58
|
||||
- model:
|
||||
type: minecraft:model
|
||||
path: ${pulling_2_model}
|
||||
threshold: 1.0
|
||||
fallback:
|
||||
type: minecraft:model
|
||||
path: ${pulling_0_model}
|
||||
# template: default:model/crossbow_2d
|
||||
# arguments:
|
||||
# model: crossbow_model_path
|
||||
# texture: crossbow_texture_path
|
||||
# arrow_model: crossbow_arrow_model_path
|
||||
# arrow_texture: crossbow_arrow_texture_path
|
||||
# firework_model: crossbow_firework_model_path
|
||||
# firework_texture: crossbow_firework_texture_path
|
||||
# pulling_0_model: crossbow_pulling_0_model_path
|
||||
# pulling_0_texture: crossbow_pulling_0_texture_path
|
||||
# pulling_1_model: crossbow_pulling_1_model_path
|
||||
# pulling_1_texture: crossbow_pulling_1_texture_path
|
||||
# pulling_2_model: crossbow_pulling_2_model_path
|
||||
# pulling_2_texture: crossbow_pulling_2_texture_path
|
||||
default:model/crossbow_2d:
|
||||
type: minecraft:condition
|
||||
property: minecraft:using_item
|
||||
on-false:
|
||||
type: minecraft:select
|
||||
property: minecraft:charge_type
|
||||
cases:
|
||||
- when: arrow
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: ${arrow_model}
|
||||
generation:
|
||||
parent: minecraft:item/crossbow_arrow
|
||||
textures:
|
||||
layer0: ${arrow_texture}
|
||||
- when: rocket
|
||||
model:
|
||||
type: minecraft:model
|
||||
path: ${firework_model}
|
||||
generation:
|
||||
parent: minecraft:item/crossbow_firework
|
||||
textures:
|
||||
layer0: ${firework_texture}
|
||||
fallback:
|
||||
type: minecraft:model
|
||||
path: ${model}
|
||||
generation:
|
||||
parent: minecraft:item/crossbow
|
||||
textures:
|
||||
layer0: ${texture}
|
||||
on-true:
|
||||
type: minecraft:range_dispatch
|
||||
property: minecraft:crossbow/pull
|
||||
entries:
|
||||
- model:
|
||||
type: minecraft:model
|
||||
path: ${pulling_1_model}
|
||||
generation:
|
||||
parent: minecraft:item/crossbow_pulling_1
|
||||
textures:
|
||||
layer0: ${pulling_1_texture}
|
||||
threshold: 0.58
|
||||
- model:
|
||||
type: minecraft:model
|
||||
path: ${pulling_2_model}
|
||||
generation:
|
||||
parent: minecraft:item/crossbow_pulling_2
|
||||
textures:
|
||||
layer0: ${pulling_2_texture}
|
||||
threshold: 1.0
|
||||
fallback:
|
||||
type: minecraft:model
|
||||
path: ${pulling_0_model}
|
||||
generation:
|
||||
parent: minecraft:item/crossbow_pulling_0
|
||||
textures:
|
||||
layer0: ${pulling_0_texture}
|
||||
# template: default:model/simplified_crossbow_2d
|
||||
# arguments:
|
||||
# path: crossbow_[model/texture]_path
|
||||
# arrow_path: crossbow_arrow_[model/texture]_path
|
||||
# firework_path: crossbow_firework_[model/texture]_path
|
||||
# pulling_0_path: crossbow_pulling_0_[model/texture]_path
|
||||
# pulling_1_path: crossbow_pulling_1_[model/texture]_path
|
||||
# pulling_2_path: crossbow_pulling_2_[model/texture]_path
|
||||
default:model/simplified_crossbow_2d:
|
||||
template: default:model/crossbow_2d
|
||||
arguments:
|
||||
model: ${path}
|
||||
texture: ${path}
|
||||
arrow_model: ${arrow_path}
|
||||
arrow_texture: ${arrow_path}
|
||||
firework_model: ${firework_path}
|
||||
firework_texture: ${firework_path}
|
||||
pulling_0_model: ${pulling_0_path}
|
||||
pulling_0_texture: ${pulling_0_path}
|
||||
pulling_1_model: ${pulling_1_path}
|
||||
pulling_1_texture: ${pulling_1_path}
|
||||
pulling_2_model: ${pulling_2_path}
|
||||
pulling_2_texture: ${pulling_2_path}
|
||||
@@ -0,0 +1,28 @@
|
||||
templates:
|
||||
# template: default:recipe/planks
|
||||
# arguments:
|
||||
# wood_type: the wood type, for instance 'default:palm'
|
||||
default:recipe/planks:
|
||||
type: shapeless
|
||||
category: building
|
||||
group: planks
|
||||
ingredients:
|
||||
- '#${wood_type}_logs'
|
||||
result:
|
||||
id: ${wood_type}_planks
|
||||
count: 4
|
||||
# template: default:recipe/log_2_wood
|
||||
# arguments:
|
||||
# wood_type: the wood type, for instance 'default:palm'
|
||||
default:recipe/log_2_wood:
|
||||
type: shaped
|
||||
category: building
|
||||
group: bark
|
||||
pattern:
|
||||
- AA
|
||||
- AA
|
||||
ingredients:
|
||||
A: ${wood_type}_log
|
||||
result:
|
||||
id: ${wood_type}_wood
|
||||
count: 3
|
||||
@@ -0,0 +1,25 @@
|
||||
templates:
|
||||
default:pickaxe_power/level_1:
|
||||
- minecraft:wooden_pickaxe
|
||||
- minecraft:stone_pickaxe
|
||||
- minecraft:iron_pickaxe
|
||||
- minecraft:golden_pickaxe
|
||||
- minecraft:diamond_pickaxe
|
||||
- minecraft:netherite_pickaxe
|
||||
- default:topaz_pickaxe
|
||||
default:pickaxe_power/level_2:
|
||||
- minecraft:stone_pickaxe
|
||||
- minecraft:iron_pickaxe
|
||||
- minecraft:golden_pickaxe
|
||||
- minecraft:diamond_pickaxe
|
||||
- minecraft:netherite_pickaxe
|
||||
- default:topaz_pickaxe
|
||||
default:pickaxe_power/level_3:
|
||||
- minecraft:iron_pickaxe
|
||||
- minecraft:golden_pickaxe
|
||||
- minecraft:diamond_pickaxe
|
||||
- minecraft:netherite_pickaxe
|
||||
- default:topaz_pickaxe
|
||||
default:pickaxe_power/level_4:
|
||||
- minecraft:diamond_pickaxe
|
||||
- minecraft:netherite_pickaxe
|
||||
@@ -10,16 +10,14 @@ import net.momirealms.craftengine.core.item.updater.ItemUpdateConfig;
|
||||
import net.momirealms.craftengine.core.item.updater.ItemUpdateResult;
|
||||
import net.momirealms.craftengine.core.item.updater.ItemUpdater;
|
||||
import net.momirealms.craftengine.core.item.updater.ItemUpdaters;
|
||||
import net.momirealms.craftengine.core.pack.AbstractPackManager;
|
||||
import net.momirealms.craftengine.core.pack.LoadingSequence;
|
||||
import net.momirealms.craftengine.core.pack.Pack;
|
||||
import net.momirealms.craftengine.core.pack.ResourceLocation;
|
||||
import net.momirealms.craftengine.core.pack.*;
|
||||
import net.momirealms.craftengine.core.pack.allocator.IdAllocator;
|
||||
import net.momirealms.craftengine.core.pack.model.*;
|
||||
import net.momirealms.craftengine.core.pack.model.generation.AbstractModelGenerator;
|
||||
import net.momirealms.craftengine.core.pack.model.generation.ModelGeneration;
|
||||
import net.momirealms.craftengine.core.pack.model.select.ChargeTypeSelectProperty;
|
||||
import net.momirealms.craftengine.core.pack.model.select.TrimMaterialSelectProperty;
|
||||
import net.momirealms.craftengine.core.pack.model.simplified.SimplifiedModelReader;
|
||||
import net.momirealms.craftengine.core.plugin.CraftEngine;
|
||||
import net.momirealms.craftengine.core.plugin.config.Config;
|
||||
import net.momirealms.craftengine.core.plugin.config.ConfigParser;
|
||||
@@ -518,18 +516,56 @@ public abstract class AbstractItemManager<I> extends AbstractModelGenerator impl
|
||||
|
||||
CustomItem.Builder<I> itemBuilder = createPlatformItemBuilder(uniqueId, material, clientBoundMaterial);
|
||||
|
||||
// 模型配置区域,如果这里被配置了,那么用户必须要配置custom-model-data或item-model
|
||||
// 模型配置区域,如果这里被配置了,那么用户可以配置custom-model-data或item-model
|
||||
// model可以是一个string也可以是一个区域
|
||||
Object modelSection = section.get("model");
|
||||
Map<String, Object> legacyModelSection = MiscUtils.castToMap(section.get("legacy-model"), true);
|
||||
boolean hasModelSection = modelSection != null || legacyModelSection != null;
|
||||
// model可以是一个map,也可以是一个string或list
|
||||
boolean hasModelSection = modelSection instanceof Map<?,?> || legacyModelSection != null;
|
||||
if (!hasModelSection) {
|
||||
Object texture = ResourceConfigUtils.get(section, "textures", "texture");
|
||||
// 如果使用的是textures,那么model指的是
|
||||
if (texture != null) {
|
||||
// 获取textures列表
|
||||
List<String> textures = texture instanceof List<?> ? MiscUtils.getAsStringList(texture) : List.of(texture.toString());
|
||||
if (!textures.isEmpty()) {
|
||||
// 获取可选的模型列表,此时的model不可能是map了
|
||||
List<String> modelPath = modelSection != null ? MiscUtils.getAsStringList(modelSection) : List.of();
|
||||
// 根据父item model选择处理方案
|
||||
Key templateModel = itemModel != null && AbstractPackManager.PRESET_MODERN_MODELS_ITEM.containsKey(itemModel) ? itemModel : clientBoundMaterial;
|
||||
SimplifiedModelReader simplifiedModelReader = AbstractPackManager.SIMPLIFIED_MODEL_READERS.get(templateModel);
|
||||
if (simplifiedModelReader != null) {
|
||||
modelSection = simplifiedModelReader.convert(textures, modelPath, id);
|
||||
if (modelSection != null) {
|
||||
hasModelSection = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 如果没有配贴图,且model为string或list,直接生成相应类型的模型
|
||||
else if (modelSection != null) {
|
||||
if (modelSection instanceof String singleModel) {
|
||||
modelSection = Map.of(
|
||||
"type", "model",
|
||||
"path", singleModel
|
||||
);
|
||||
hasModelSection = true;
|
||||
} else if (modelSection instanceof List<?>) {
|
||||
modelSection = List.of(
|
||||
"type", "composite",
|
||||
"models", MiscUtils.getAsStringList(modelSection)
|
||||
);
|
||||
hasModelSection = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (customModelData > 0 && (hasModelSection || forceCustomModelData)) {
|
||||
if (clientBoundModel) itemBuilder.clientBoundDataModifier(new CustomModelDataModifier<>(customModelData));
|
||||
if (clientBoundModel) itemBuilder.clientBoundDataModifier(new OverwritableCustomModelDataModifier<>(customModelData));
|
||||
else itemBuilder.dataModifier(new CustomModelDataModifier<>(customModelData));
|
||||
}
|
||||
if (itemModel != null && (hasModelSection || forceItemModel)) {
|
||||
if (clientBoundModel) itemBuilder.clientBoundDataModifier(new ItemModelModifier<>(itemModel));
|
||||
if (clientBoundModel) itemBuilder.clientBoundDataModifier(new OverwritableItemModelModifier<>(itemModel));
|
||||
else itemBuilder.dataModifier(new ItemModelModifier<>(itemModel));
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ public final class ItemDataModifiers {
|
||||
private ItemDataModifiers() {}
|
||||
|
||||
public static final Key ITEM_MODEL = Key.of("craftengine:item-model");
|
||||
public static final Key OVERWRITABLE_ITEM_MODEL = Key.of("craftengine:overwritable-item-model");
|
||||
public static final Key ID = Key.of("craftengine:id");
|
||||
public static final Key HIDE_TOOLTIP = Key.of("craftengine:hide-tooltip");
|
||||
public static final Key FOOD = Key.of("craftengine:food");
|
||||
@@ -27,6 +28,7 @@ public final class ItemDataModifiers {
|
||||
public static final Key DISPLAY_NAME = Key.of("craftengine:display-name");
|
||||
public static final Key CUSTOM_NAME = Key.of("craftengine:custom-name");
|
||||
public static final Key CUSTOM_MODEL_DATA = Key.of("craftengine:custom-model-data");
|
||||
public static final Key OVERWRITABLE_CUSTOM_MODEL_DATA = Key.of("craftengine:overwritable-custom-model-data");
|
||||
public static final Key COMPONENTS = Key.of("craftengine:components");
|
||||
public static final Key COMPONENT = Key.of("craftengine:component");
|
||||
public static final Key ATTRIBUTE_MODIFIERS = Key.of("craftengine:attribute-modifiers");
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package net.momirealms.craftengine.core.item.modifier;
|
||||
|
||||
import net.momirealms.craftengine.core.item.DataComponentKeys;
|
||||
import net.momirealms.craftengine.core.item.Item;
|
||||
import net.momirealms.craftengine.core.item.ItemBuildContext;
|
||||
import net.momirealms.craftengine.core.item.ItemDataModifierFactory;
|
||||
import net.momirealms.craftengine.core.util.Key;
|
||||
import net.momirealms.craftengine.core.util.ResourceConfigUtils;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class OverwritableCustomModelDataModifier<I> implements SimpleNetworkItemDataModifier<I> {
|
||||
public static final Factory<?> FACTORY = new Factory<>();
|
||||
private final int argument;
|
||||
|
||||
public OverwritableCustomModelDataModifier(int argument) {
|
||||
this.argument = argument;
|
||||
}
|
||||
|
||||
public int customModelData() {
|
||||
return this.argument;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Key type() {
|
||||
return ItemDataModifiers.OVERWRITABLE_CUSTOM_MODEL_DATA;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item<I> apply(Item<I> item, ItemBuildContext context) {
|
||||
if (item.customModelData().isPresent()) return item;
|
||||
item.customModelData(this.argument);
|
||||
return item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Key componentType(Item<I> item, ItemBuildContext context) {
|
||||
return DataComponentKeys.CUSTOM_MODEL_DATA;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Object[] nbtPath(Item<I> item, ItemBuildContext context) {
|
||||
return new Object[]{"CustomModelData"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String nbtPathString(Item<I> item, ItemBuildContext context) {
|
||||
return "CustomModelData";
|
||||
}
|
||||
|
||||
public static class Factory<I> implements ItemDataModifierFactory<I> {
|
||||
|
||||
@Override
|
||||
public ItemDataModifier<I> create(Object arg) {
|
||||
int customModelData = ResourceConfigUtils.getAsInt(arg, "custom-model-data");
|
||||
return new OverwritableCustomModelDataModifier<>(customModelData);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package net.momirealms.craftengine.core.item.modifier;
|
||||
|
||||
import net.momirealms.craftengine.core.item.DataComponentKeys;
|
||||
import net.momirealms.craftengine.core.item.Item;
|
||||
import net.momirealms.craftengine.core.item.ItemBuildContext;
|
||||
import net.momirealms.craftengine.core.item.ItemDataModifierFactory;
|
||||
import net.momirealms.craftengine.core.util.Key;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class OverwritableItemModelModifier<I> implements SimpleNetworkItemDataModifier<I> {
|
||||
public static final Factory<?> FACTORY = new Factory<>();
|
||||
private final Key data;
|
||||
|
||||
public OverwritableItemModelModifier(Key data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public Key data() {
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Key type() {
|
||||
return ItemDataModifiers.OVERWRITABLE_CUSTOM_MODEL_DATA;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item<I> apply(Item<I> item, ItemBuildContext context) {
|
||||
if (item.hasNonDefaultComponent(DataComponentKeys.ITEM_MODEL)) return item;
|
||||
return item.itemModel(this.data.asString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Key componentType(Item<I> item, ItemBuildContext context) {
|
||||
return DataComponentKeys.ITEM_MODEL;
|
||||
}
|
||||
|
||||
public static class Factory<I> implements ItemDataModifierFactory<I> {
|
||||
|
||||
@Override
|
||||
public ItemDataModifier<I> create(Object arg) {
|
||||
String id = arg.toString();
|
||||
return new OverwritableItemModelModifier<>(Key.of(id));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public class CustomBlastingRecipe<T> extends CustomCookingRecipe<T> {
|
||||
parseResult(arguments), arguments.containsKey("group") ? arguments.get("group").toString() : null, cookingRecipeCategory(arguments),
|
||||
singleInputIngredient(arguments),
|
||||
ResourceConfigUtils.getAsInt(arguments.getOrDefault("time", 80), "time"),
|
||||
ResourceConfigUtils.getAsFloat(arguments.getOrDefault("experience", 0.0f), "experience")
|
||||
ResourceConfigUtils.getAsFloat(ResourceConfigUtils.get(arguments, "exp", "experience"), "experience")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public class CustomCampfireRecipe<T> extends CustomCookingRecipe<T> {
|
||||
parseResult(arguments), arguments.containsKey("group") ? arguments.get("group").toString() : null, cookingRecipeCategory(arguments),
|
||||
singleInputIngredient(arguments),
|
||||
ResourceConfigUtils.getAsInt(arguments.getOrDefault("time", 80), "time"),
|
||||
ResourceConfigUtils.getAsFloat(arguments.getOrDefault("experience", 0.0f), "experience")
|
||||
ResourceConfigUtils.getAsFloat(ResourceConfigUtils.get(arguments, "exp", "experience"), "experience")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public class CustomSmeltingRecipe<T> extends CustomCookingRecipe<T> {
|
||||
parseResult(arguments), arguments.containsKey("group") ? arguments.get("group").toString() : null, cookingRecipeCategory(arguments),
|
||||
singleInputIngredient(arguments),
|
||||
ResourceConfigUtils.getAsInt(arguments.getOrDefault("time", 80), "time"),
|
||||
ResourceConfigUtils.getAsFloat(arguments.getOrDefault("experience", 0.0f), "experience")
|
||||
ResourceConfigUtils.getAsFloat(ResourceConfigUtils.get(arguments, "exp", "experience"), "experience")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public class CustomSmokingRecipe<T> extends CustomCookingRecipe<T> {
|
||||
parseResult(arguments), arguments.containsKey("group") ? arguments.get("group").toString() : null, cookingRecipeCategory(arguments),
|
||||
singleInputIngredient(arguments),
|
||||
ResourceConfigUtils.getAsInt(arguments.getOrDefault("time", 80), "time"),
|
||||
ResourceConfigUtils.getAsFloat(arguments.getOrDefault("experience", 0.0f), "experience")
|
||||
ResourceConfigUtils.getAsFloat(ResourceConfigUtils.get(arguments, "exp", "experience"), "experience")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,9 @@ package net.momirealms.craftengine.core.loot.function;
|
||||
import net.momirealms.craftengine.core.item.Item;
|
||||
import net.momirealms.craftengine.core.item.ItemBuildContext;
|
||||
import net.momirealms.craftengine.core.item.modifier.ItemDataModifier;
|
||||
import net.momirealms.craftengine.core.item.recipe.result.ApplyItemDataPostProcessor;
|
||||
import net.momirealms.craftengine.core.loot.LootConditions;
|
||||
import net.momirealms.craftengine.core.loot.LootContext;
|
||||
import net.momirealms.craftengine.core.plugin.context.Condition;
|
||||
import net.momirealms.craftengine.core.plugin.context.number.NumberProvider;
|
||||
import net.momirealms.craftengine.core.plugin.context.number.NumberProviders;
|
||||
import net.momirealms.craftengine.core.registry.BuiltInRegistries;
|
||||
import net.momirealms.craftengine.core.util.Key;
|
||||
import net.momirealms.craftengine.core.util.ResourceConfigUtils;
|
||||
|
||||
@@ -22,6 +22,9 @@ import net.momirealms.craftengine.core.pack.model.RangeDispatchItemModel;
|
||||
import net.momirealms.craftengine.core.pack.model.generation.ModelGeneration;
|
||||
import net.momirealms.craftengine.core.pack.model.generation.ModelGenerator;
|
||||
import net.momirealms.craftengine.core.pack.model.rangedisptach.CustomModelDataRangeDispatchProperty;
|
||||
import net.momirealms.craftengine.core.pack.model.simplified.GeneratedModelReader;
|
||||
import net.momirealms.craftengine.core.pack.model.simplified.HandheldModelReader;
|
||||
import net.momirealms.craftengine.core.pack.model.simplified.SimplifiedModelReader;
|
||||
import net.momirealms.craftengine.core.pack.revision.Revision;
|
||||
import net.momirealms.craftengine.core.pack.revision.Revisions;
|
||||
import net.momirealms.craftengine.core.plugin.CraftEngine;
|
||||
@@ -67,16 +70,28 @@ import static net.momirealms.craftengine.core.util.MiscUtils.castToMap;
|
||||
|
||||
@SuppressWarnings("DuplicatedCode")
|
||||
public abstract class AbstractPackManager implements PackManager {
|
||||
// 1.21.4+物品模型
|
||||
public static final Map<Key, JsonObject> PRESET_MODERN_MODELS_ITEM = new HashMap<>();
|
||||
// 旧版本的物品模型
|
||||
public static final Map<Key, JsonObject> PRESET_LEGACY_MODELS_ITEM = new HashMap<>();
|
||||
// 全版本的方块模型
|
||||
public static final Map<Key, JsonObject> PRESET_MODELS_BLOCK = new HashMap<>();
|
||||
// 1.21.4+物品模型定义
|
||||
public static final Map<Key, ModernItemModel> PRESET_ITEMS = new HashMap<>();
|
||||
|
||||
// 原版资产id
|
||||
public static final Set<Key> VANILLA_TEXTURES = new HashSet<>();
|
||||
public static final Set<Key> VANILLA_MODELS = new HashSet<>();
|
||||
public static final Set<Key> VANILLA_SOUNDS = new HashSet<>();
|
||||
|
||||
// 简化的model读取器
|
||||
public static final Map<Key, SimplifiedModelReader> SIMPLIFIED_MODEL_READERS = new HashMap<>();
|
||||
|
||||
public static final String NEW_TRIM_MATERIAL = "custom";
|
||||
|
||||
public static final Set<String> ALLOWED_VANILLA_EQUIPMENT = Set.of("chainmail", "diamond", "gold", "iron", "netherite");
|
||||
public static final Set<String> ALLOWED_MODEL_TAGS = Set.of("parent", "ambientocclusion", "display", "textures", "elements", "gui_light", "overrides");
|
||||
|
||||
private static final byte[] EMPTY_1X1_IMAGE;
|
||||
private static final byte[] EMPTY_EQUIPMENT_IMAGE;
|
||||
private static final byte[] EMPTY_16X16_IMAGE;
|
||||
@@ -166,6 +181,15 @@ public abstract class AbstractPackManager implements PackManager {
|
||||
loadInternalData("internal/models/item/_all.json", ((key, jsonObject) -> {
|
||||
PRESET_MODERN_MODELS_ITEM.put(key, jsonObject);
|
||||
VANILLA_MODELS.add(Key.of(key.namespace(), "item/" + key.value()));
|
||||
JsonElement parent = jsonObject.get("parent");
|
||||
if (parent instanceof JsonPrimitive primitive) {
|
||||
String parentModel = primitive.getAsString();
|
||||
if (parentModel.equals("minecraft:item/handheld")) {
|
||||
SIMPLIFIED_MODEL_READERS.put(key, HandheldModelReader.INSTANCE);
|
||||
} else {
|
||||
SIMPLIFIED_MODEL_READERS.put(key, GeneratedModelReader.INSTANCE);
|
||||
}
|
||||
}
|
||||
}));
|
||||
loadInternalData("internal/models/block/_all.json", ((key, jsonObject) -> {
|
||||
PRESET_MODELS_BLOCK.put(key, jsonObject);
|
||||
@@ -428,7 +452,12 @@ public abstract class AbstractPackManager implements PackManager {
|
||||
plugin.saveResource("resources/default/resourcepack/pack.mcmeta");
|
||||
plugin.saveResource("resources/default/resourcepack/pack.png");
|
||||
// configs
|
||||
plugin.saveResource("resources/default/configuration/templates.yml");
|
||||
plugin.saveResource("resources/default/configuration/templates/block_settings.yml");
|
||||
plugin.saveResource("resources/default/configuration/templates/block_states.yml");
|
||||
plugin.saveResource("resources/default/configuration/templates/models.yml");
|
||||
plugin.saveResource("resources/default/configuration/templates/loot_tables.yml");
|
||||
plugin.saveResource("resources/default/configuration/templates/recipes.yml");
|
||||
plugin.saveResource("resources/default/configuration/templates/tool_levels.yml");
|
||||
plugin.saveResource("resources/default/configuration/categories.yml");
|
||||
plugin.saveResource("resources/default/configuration/emoji.yml");
|
||||
plugin.saveResource("resources/default/configuration/translations.yml");
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package net.momirealms.craftengine.core.pack.model.simplified;
|
||||
|
||||
import net.momirealms.craftengine.core.util.Key;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class GeneratedModelReader implements SimplifiedModelReader {
|
||||
public static final GeneratedModelReader INSTANCE = new GeneratedModelReader();
|
||||
|
||||
@Override
|
||||
public Map<String, Object> convert(List<String> textures, List<String> optionalModelPaths, Key id) {
|
||||
boolean autoModelPath = optionalModelPaths.size() != 1;
|
||||
Map<String, String> texturesProperty;
|
||||
switch (textures.size()) {
|
||||
case 1 -> texturesProperty = Map.of("layer0", textures.getFirst());
|
||||
case 2 -> texturesProperty = Map.of(
|
||||
"layer0", textures.get(0),
|
||||
"layer1", textures.get(1)
|
||||
);
|
||||
default -> {
|
||||
texturesProperty = new HashMap<>();
|
||||
for (int i = 0; i < textures.size(); i++) {
|
||||
texturesProperty.put("layer" + i, textures.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
return Map.of(
|
||||
"type", "model",
|
||||
"path", autoModelPath ? id.namespace() + ":item/" + id.value() : optionalModelPaths.getFirst(),
|
||||
"generation", Map.of(
|
||||
"parent", "item/generated",
|
||||
"textures", texturesProperty
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package net.momirealms.craftengine.core.pack.model.simplified;
|
||||
|
||||
import net.momirealms.craftengine.core.util.Key;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class HandheldModelReader implements SimplifiedModelReader {
|
||||
public static final HandheldModelReader INSTANCE = new HandheldModelReader();
|
||||
|
||||
@Override
|
||||
public Map<String, Object> convert(List<String> textures, List<String> optionalModelPaths, Key id) {
|
||||
boolean autoModelPath = optionalModelPaths.size() != 1;
|
||||
Map<String, String> texturesProperty;
|
||||
switch (textures.size()) {
|
||||
case 1 -> texturesProperty = Map.of("layer0", textures.getFirst());
|
||||
case 2 -> texturesProperty = Map.of(
|
||||
"layer0", textures.get(0),
|
||||
"layer1", textures.get(1)
|
||||
);
|
||||
default -> {
|
||||
texturesProperty = new HashMap<>();
|
||||
for (int i = 0; i < textures.size(); i++) {
|
||||
texturesProperty.put("layer" + i, textures.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
return Map.of(
|
||||
"type", "model",
|
||||
"path", autoModelPath ? id.namespace() + ":item/" + id.value() : optionalModelPaths.getFirst(),
|
||||
"generation", Map.of(
|
||||
"parent", "item/handheld",
|
||||
"textures", texturesProperty
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package net.momirealms.craftengine.core.pack.model.simplified;
|
||||
|
||||
import net.momirealms.craftengine.core.util.Key;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface SimplifiedModelReader {
|
||||
|
||||
@Nullable
|
||||
Map<String, Object> convert(List<String> textures, List<String> optionalModelPaths, Key id);
|
||||
}
|
||||
@@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx1G
|
||||
|
||||
# Project settings
|
||||
# Rule: [major update].[feature update].[bug fix]
|
||||
project_version=0.0.65.6
|
||||
project_version=0.0.65.7
|
||||
config_version=54
|
||||
lang_version=38
|
||||
project_group=net.momirealms
|
||||
@@ -49,7 +49,7 @@ byte_buddy_version=1.17.8
|
||||
ahocorasick_version=0.6.3
|
||||
snake_yaml_version=2.5
|
||||
anti_grief_version=1.0.4
|
||||
nms_helper_version=1.0.129
|
||||
nms_helper_version=1.0.128
|
||||
evalex_version=3.5.0
|
||||
reactive_streams_version=1.0.4
|
||||
amazon_awssdk_version=2.34.5
|
||||
|
||||
Reference in New Issue
Block a user