Skip to content

Commit

Permalink
🐛 Exclude builtin models when referencing
Browse files Browse the repository at this point in the history
  • Loading branch information
misode committed Nov 22, 2024
1 parent 63c9b80 commit aff26f7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
4 changes: 3 additions & 1 deletion java/assets/block_state_definition.mcdoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use ::java::assets::model::ModelRef

type BlockStateDefinition = (
struct BlockStateDefinitionVariant {
variants: struct BlockStateDefinitionVariantMap {
Expand All @@ -23,7 +25,7 @@ type ModelVariant = (
)

struct ModelVariantBase {
model: #[id="model"] string,
model: ModelRef,
x?: (0 | 90 | 180 | 270),
y?: (0 | 90 | 180 | 270),
/// If set to `true`, the textures are not rotated with the block.
Expand Down
5 changes: 3 additions & 2 deletions java/assets/item_definition.mcdoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use ::java::assets::model::ModelRef
use ::java::server::util::color::RGB
use ::java::server::util::color::ColorString
use ::java::server::util::direction::Direction
Expand Down Expand Up @@ -41,7 +42,7 @@ dispatch minecraft:item_model[condition] to struct Condition {
}

dispatch minecraft:item_model[model] to struct Model {
model: #[id="model"] string,
model: ModelRef,
tints?: [ModelTint],
}

Expand Down Expand Up @@ -78,7 +79,7 @@ dispatch minecraft:item_model[special] to struct Special {
...minecraft:special_item_model[[type]],
},
/// Base model, providing transformations, particle texture and GUI light.
base: #[id="model"] string,
base: ModelRef,
}


Expand Down
4 changes: 3 additions & 1 deletion java/assets/model.mcdoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use ::java::server::util::direction::Direction

type ModelRef = #[id(registry="model",exclude=["builtin/generated","builtin/entity"])] string

dispatch minecraft:resource[model] to struct Model {
parent?: #[id="model"] string,
ambientocclusion?: boolean,
Expand All @@ -21,7 +23,7 @@ dispatch minecraft:resource[model] to struct Model {
predicate: struct ModelOverridePredicates {
[Predicates]: float,
},
model: #[id="model"] string,
model: ModelRef,
}],
}

Expand Down
2 changes: 1 addition & 1 deletion java/server/util/particle.mcdoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use ::java::server::world::item::SingleItem

struct Particle {
type: #[id="particle_type"] string,
...(minecraft:particle[[type]]),
...minecraft:particle[[type]],
}

type ParticleSettings<S> = (
Expand Down
2 changes: 1 addition & 1 deletion java/server/world/entity/area_effect_cloud.mcdoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dispatch minecraft:entity[area_effect_cloud] to struct AreaEffectCloud {
/// Particle the area effect cloud displays.
Particle?: (
#[until="1.20.5"] string |
#[since="1.20.5"] Particle
#[since="1.20.5"] Particle |
),
/// Default potion effect.
#[until="1.20.5"]
Expand Down
2 changes: 1 addition & 1 deletion java/server/world/item/mod.mcdoc
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ dispatch minecraft:data_component[equippable] to struct Equippable {
/// The equipment model to use when equipped.
/// Falls back to rendering as the item itself when in the head slot (or no rendering if not applicable).
#[until="1.21.4"]
model?: #[id="model"] string,
model?: #[id="equipment"] string,
#[since="1.21.4"]
asset_id?: #[id="equipment"] string,
/// The overlay texture that should render in first person when equipped.
Expand Down

0 comments on commit aff26f7

Please sign in to comment.