sandstone 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/index.d.ts +7 -15
- package/dist/_internal/index.d.ts.map +1 -1
- package/dist/_internal/index.js +43 -41
- package/dist/_internal/index.js.map +1 -1
- package/dist/_internal/types/arguments/coords.d.ts +6 -8
- package/dist/_internal/types/arguments/coords.d.ts.map +1 -1
- package/dist/_internal/types/arguments/generated/resources.d.ts +2 -2
- package/dist/_internal/types/arguments/generated/resources.d.ts.map +1 -1
- package/dist/_internal/types/commands/implementations/block/fill.d.ts +3 -2
- package/dist/_internal/types/commands/implementations/block/fill.d.ts.map +1 -1
- package/dist/_internal/types/commands/implementations/block/place.d.ts +1 -1
- package/dist/_internal/types/commands/implementations/block/place.d.ts.map +1 -1
- package/dist/_internal/types/commands/implementations/block/setblock.d.ts +34 -30
- package/dist/_internal/types/commands/implementations/block/setblock.d.ts.map +1 -1
- package/dist/_internal/types/commands/implementations/entity/execute.d.ts +3 -3
- package/dist/_internal/types/commands/implementations/entity/execute.d.ts.map +1 -1
- package/dist/_internal/types/commands/implementations/entity/summon.d.ts +2 -1
- package/dist/_internal/types/commands/implementations/entity/summon.d.ts.map +1 -1
- package/dist/_internal/types/commands/implementations/server/schedule.d.ts +1 -1
- package/dist/_internal/types/core/resources/index.d.ts +1 -1
- package/dist/_internal/types/core/resources/resourcepack/blockstate.d.ts +13 -13
- package/dist/_internal/types/core/resources/resourcepack/blockstate.d.ts.map +1 -1
- package/dist/_internal/types/flow/Flow.d.ts +11 -11
- package/dist/_internal/types/flow/loop.d.ts +1 -1
- package/dist/_internal/types/pack/index.d.ts +1 -1
- package/dist/_internal/types/pack/pack.d.ts +7 -7
- package/dist/_internal/types/pack/pack.d.ts.map +1 -1
- package/dist/_internal/types/utils.d.ts +1 -0
- package/dist/_internal/types/utils.d.ts.map +1 -1
- package/dist/_internal/types/variables/Data.d.ts +1 -1
- package/dist/_internal/types/variables/DataSets.d.ts +4 -4
- package/dist/_internal/types/variables/DataSets.d.ts.map +1 -1
- package/dist/_internal/types/variables/ResolveNBT.d.ts +2 -2
- package/dist/browser/sandstone.esm.js +43 -41
- package/dist/browser/sandstone.esm.js.map +1 -1
- package/dist/exports/core/index.d.ts +1 -1
- package/dist/exports/core/index.js +1 -1
- package/dist/exports/index.d.ts +1 -1
- package/dist/exports/index.js +1 -1
- package/dist/exports/variables/index.d.ts +1 -1
- package/dist/exports/variables/index.js +1 -1
- package/package.json +1 -1
- package/src/arguments/coords.ts +6 -12
- package/src/arguments/generated/resources.ts +2 -2
- package/src/commands/implementations/block/fill.ts +7 -3
- package/src/commands/implementations/block/place.ts +1 -1
- package/src/commands/implementations/block/setblock.ts +39 -32
- package/src/commands/implementations/entity/execute.ts +6 -4
- package/src/commands/implementations/entity/summon.ts +2 -1
- package/src/core/resources/datapack/itemModifier.ts +2 -2
- package/src/core/resources/resourcepack/blockstate.ts +32 -32
- package/src/pack/pack.ts +17 -37
- package/src/sandstone.ts +4 -20
- package/src/utils.ts +3 -1
- package/src/variables/DataSets.ts +4 -4
- package/src/core/resources/datapack/decoratedPotPattern.ts.disable +0 -47
- package/src/core/resources/datapack/slotSource.ts.disable +0 -47
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AdvancementClassArguments, AdvancementNode, AtlasClassArguments, AtlasNode, AudibleVariantType, AwaitNode, BannerPatternClassArguments, BannerPatternNode,
|
|
1
|
+
export { AdvancementClassArguments, AdvancementNode, AtlasClassArguments, AtlasNode, AudibleVariantType, AwaitNode, BannerPatternClassArguments, BannerPatternNode, BlockStateDefinitionArguments, BlockStateDefinitionJSON, BlockStateDefinitionNode, BlockStateDefinitionType, CallableResourceClass, ChatTypeClassArguments, ChatTypeNode, CommandNode, ConditionalDataPointPickClass, ContainerCommandNode, ContainerNode, CustomResourceClass, CustomResourceClassArguments, CustomResourceNode, DamageTypeClassArguments, DamageTypeNode, DataPointPickClass, DialogClassArguments, DialogNode, EnchantmentClassArguments, EnchantmentNode, EnchantmentProviderClassArguments, EnchantmentProviderNode, EquipmentClassArguments, EquipmentNode, FontArguments, FontNode, HintedTagStringType, InstrumentClassArguments, InstrumentNode, ItemModelBuilder, ItemModelDefinitionClassArguments, ItemModelDefinitionInput, ItemModelDefinitionNode, ItemModifierClassArguments, ItemModifierNode, JukeboxSongClassArguments, JukeboxSongNode, LanguageArguments, LanguageNode, ListResource, LootTableClassArguments, LootTableNode, MCFunctionClassArguments, MCFunctionNode, MacroArgument, MacroLiteral, Macroable, ModelClassArguments, ModelNode, Node, ParticleClassArguments, ParticleNode, PlainTextArguments, PlainTextClass, PlainTextNode, PostEffectClassArguments, PostEffectNode, PredicateClassArguments, PredicateNode, RecipeClassArguments, RecipeNode, ResourceClass, ResourceClassArguments, ResourceNode, ResourceNodeConstructor, ResourceNodesMap, SandstoneCore, ShaderClass, ShaderClassArguments, ShaderNode, SoundEventArguments, SoundEventNode, SoundsIndexArguments, SoundsIndexNode, StructureClassArguments, StructureNode, SulfurCubeArchetypeClassArguments, SulfurCubeArchetypeNode, TagClassArguments, TagNode, TagSingleValue, TagValuesJSON, TestEnvironmentClassArguments, TestEnvironmentNode, TestInstanceClassArguments, TestInstanceNode, TextureArguments, TextureNode, TimelineClassArguments, TimelineNode, TradeSetClassArguments, TradeSetNode, TrialSpawnerClassArguments, TrialSpawnerNode, TrimMaterialClassArguments, TrimMaterialNode, TrimPatternClassArguments, TrimPatternNode, VariantClassArguments, VariantNode, VariantType, VillagerTradeClassArguments, VillagerTradeNode, WaypointStyleClassArguments, WaypointStyleNode, WorldClockClassArguments, WorldClockNode, _RawMCFunctionClass, isMacroArgument, jsonStringify } from '../../_internal/index.js'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AdvancementNode, AtlasNode, AwaitNode, BannerPatternNode,
|
|
1
|
+
export { AdvancementNode, AtlasNode, AwaitNode, BannerPatternNode, BlockStateDefinitionNode, CallableResourceClass, ChatTypeNode, CommandNode, ConditionalDataPointPickClass, ContainerCommandNode, ContainerNode, CustomResourceClass, CustomResourceNode, DamageTypeNode, DataPointPickClass, DialogNode, EnchantmentNode, EnchantmentProviderNode, EquipmentNode, FontNode, InstrumentNode, ItemModelBuilder, ItemModelDefinitionNode, ItemModifierNode, JukeboxSongNode, LanguageNode, ListResource, LootTableNode, MCFunctionNode, MacroArgument, MacroLiteral, ModelNode, Node, ParticleNode, PlainTextClass, PlainTextNode, PostEffectNode, PredicateNode, RecipeNode, ResourceClass, ResourceNodesMap, SandstoneCore, ShaderClass, ShaderNode, SoundEventNode, SoundsIndexNode, StructureNode, SulfurCubeArchetypeNode, TagNode, TestEnvironmentNode, TestInstanceNode, TextureNode, TimelineNode, TradeSetNode, TrialSpawnerNode, TrimMaterialNode, TrimPatternNode, VariantNode, VillagerTradeNode, WaypointStyleNode, WorldClockNode, _RawMCFunctionClass, isMacroArgument, jsonStringify } from '../../_internal/index.js'
|
package/dist/exports/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Advancement, AdvancementClass, Atlas, AtlasClass, BannerPattern, BannerPatternClass,
|
|
1
|
+
export { Advancement, AdvancementClass, Atlas, AtlasClass, BannerPattern, BannerPatternClass, BlockStateDefinition, BlockStateDefinitionClass, ChatType, ChatTypeClass, Condition, ContentStrategyKind, DamageType, DamageTypeClass, Data, DataArray, DataIndexMap, DataPointClass, DataVariable, DatapackConfig, Dialog, DialogClass, Enchantment, EnchantmentClass, EnchantmentProvider, EnchantmentProviderClass, Equipment, EquipmentClass, Font, FontClass, HandlerFile, Instrument, InstrumentClass, ItemModelDefinition, ItemModelDefinitionClass, ItemModifier, ItemModifierClass, ItemPredicate, JukeboxSong, JukeboxSongClass, Label, LabelClass, Language, LanguageClass, LiteralUnion, LootTable, LootTableClass, MCFunction, MCFunctionClass, Macro, Model, ModelClass, NBT, NBTAllArrays, NBTAllNumberClasses, NBTAllNumbers, NBTAllPrimitives, NBTAllValues, NBTAnyValue, NBTByte, NBTByteArray, NBTClass, NBTDouble, NBTFloat, NBTInt, NBTIntArray, NBTList, NBTLong, NBTLongArray, NBTPrimitive, NBTRange, NBTShort, NBTSimpleClasses, NBTString, NBTTypedArray, NamespacedLiteralUnion, NotNBT, Objective, ObjectiveClass, ParticleClass, ParticleResource, PlainText, PostEffect, PostEffectClass, Predicate, PredicateClass, RawResource, Recipe, RecipeClass, ResolveNBT, ResolveNBTPart, ResolvedNBT, ResourcePackConfig, SandstoneConfig, SandstoneContext, SandstonePack, Score, Selector, SelectorClass, Set, SetType, Shader, SoundEvent, SoundEventClass, SoundsIndex, SoundsIndexClass, StructureClass, SulfurCubeArchetype, SulfurCubeArchetypeClass, Tag, TagClass, TestEnvironment, TestEnvironmentClass, TestInstance, TestInstanceClass, Texture, TextureClass, Timeline, TimelineClass, TradeSet, TradeSetClass, TrialSpawner, TrialSpawnerClass, Trigger, TrimMaterial, TrimMaterialClass, TrimPattern, TrimPatternClass, UUID, UUIDClass, Variable, Variant, VariantClass, VillagerTrade, VillagerTradeClass, WaypointStyle, WaypointStyleClass, WorldClock, WorldClockClass, _, abs, absolute, advancement, attribute, bossbar, clear, clone, comment, createSandstonePack, damage, data, datapack, debug, defaultNamespace, defaultgamemode, depend, dialog, difficulty, effect, enchant, execute, experience, fill, fillbiome, flowVariable, forceload, functionCmd, gamemode, gamerule, getExistingResource, getSandstoneContext, getTempStorage, getVanillaResource, give, hasContext, help, item, jfr, kill, list, loadTags, loc, local, locate, loot, makeCustomResource, mcMetaCache, me, msg, nbtResolver, particle, perf, place, playsound, random, randomUUID, raw, recipe, rel, relative, reload, resetContext, resetSandstonePack, returnCmd, ride, rotate, sandstonePack, say, schedule, scoreboard, seed, setSandstoneContext, setblock, setidletimeout, setworldspawn, sleep, spawnpoint, spectate, spreadplayers, stopsound, stopwatch, summon, swing, tag, team, teammsg, teleport, tell, tellraw, test, time, title, tm, tp, transfer, trigger, version, w, waypoint, weather, worldborder, xp } from '../_internal/index.js'
|
package/dist/exports/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Advancement, AdvancementClass, Atlas, AtlasClass, BannerPattern, BannerPatternClass,
|
|
1
|
+
export { Advancement, AdvancementClass, Atlas, AtlasClass, BannerPattern, BannerPatternClass, BlockStateDefinition, BlockStateDefinitionClass, ChatType, ChatTypeClass, DamageType, DamageTypeClass, Data, DataArray, DataIndexMap, DataPointClass, DataVariable, Dialog, DialogClass, Enchantment, EnchantmentClass, EnchantmentProvider, EnchantmentProviderClass, Equipment, EquipmentClass, Font, FontClass, Instrument, InstrumentClass, ItemModelDefinition, ItemModelDefinitionClass, ItemModifier, ItemModifierClass, ItemPredicate, JukeboxSong, JukeboxSongClass, Label, LabelClass, Language, LanguageClass, LootTable, LootTableClass, MCFunction, MCFunctionClass, Macro, Model, ModelClass, NBT, NBTAnyValue, NBTByte, NBTByteArray, NBTClass, NBTDouble, NBTFloat, NBTInt, NBTIntArray, NBTLong, NBTLongArray, NBTPrimitive, NBTShort, NBTString, NBTTypedArray, NotNBT, Objective, ObjectiveClass, ParticleClass, ParticleResource, PlainText, PostEffect, PostEffectClass, Predicate, PredicateClass, RawResource, Recipe, RecipeClass, ResolveNBT, ResolveNBTPart, ResolvedNBT, SandstonePack, Score, Selector, SelectorClass, Set, Shader, SoundEvent, SoundEventClass, SoundsIndex, SoundsIndexClass, StructureClass, SulfurCubeArchetype, SulfurCubeArchetypeClass, Tag, TagClass, TestEnvironment, TestEnvironmentClass, TestInstance, TestInstanceClass, Texture, TextureClass, Timeline, TimelineClass, TradeSet, TradeSetClass, TrialSpawner, TrialSpawnerClass, Trigger, TrimMaterial, TrimMaterialClass, TrimPattern, TrimPatternClass, UUID, UUIDClass, Variable, Variant, VariantClass, VillagerTrade, VillagerTradeClass, WaypointStyle, WaypointStyleClass, WorldClock, WorldClockClass, _, abs, absolute, advancement, attribute, bossbar, clear, clone, comment, createSandstonePack, damage, data, datapack, debug, defaultNamespace, defaultgamemode, depend, dialog, difficulty, effect, enchant, execute, experience, fill, fillbiome, flowVariable, forceload, functionCmd, gamemode, gamerule, getExistingResource, getSandstoneContext, getTempStorage, getVanillaResource, give, hasContext, help, item, jfr, kill, list, loadTags, loc, local, locate, loot, makeCustomResource, mcMetaCache, me, msg, nbtResolver, particle, perf, place, playsound, random, randomUUID, raw, recipe, rel, relative, reload, resetContext, resetSandstonePack, returnCmd, ride, rotate, sandstonePack, say, schedule, scoreboard, seed, setSandstoneContext, setblock, setidletimeout, setworldspawn, sleep, spawnpoint, spectate, spreadplayers, stopsound, stopwatch, summon, swing, tag, team, teammsg, teleport, tell, tellraw, test, time, title, tm, tp, transfer, trigger, version, w, waypoint, weather, worldborder, xp } from '../_internal/index.js'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ConditionClass, ConditionTextComponentClass, DATA_PATH, DATA_TARGET, DATA_TYPES, DataArrayClass, DataArrayInitial, DataClass, DataIndexMapClass, DataIndexMapInitial, EntityLabel, ItemPredicateClass, ItemPredicateItem, IterableDataClass, JSONTextComponentClass, LoopArgument, NBTpathToString, ResolveEntityValues, ResolveNBTClass, ResolveNBTPartClass, ScoreDisplay, SelectorEntityType, SelectorPickClass, SelectorProperties, SleepClass, StringDataPointClass, StructureMirror, StructureRotation, TargetFor, TargetlessDataClass, TargetlessDataPointClass, TextComponentClass, TriggerClass, TriggerHandler, UUIDOptions, UUIDSource, UUIDinNumber, UUIDinScore, VectorClass, _RawLabelClass, _RawObjectiveClass, coordinatesParser, parseJSONText, parseNBT, rangeParser, rotationParser, sanitizeValue, structureMirrorParser, structureRotationParser, targetParser } from '../../_internal/index.js'
|
|
1
|
+
export { ConditionClass, ConditionTextComponentClass, DATA_PATH, DATA_TARGET, DATA_TYPES, DataArrayClass, DataArrayInitial, DataArrayInternal, DataArrayType, DataClass, DataIndexMapClass, DataIndexMapInitial, DataIndexMapInternal, DataIndexMapType, EntityLabel, ItemPredicateClass, ItemPredicateItem, IterableDataClass, JSONTextComponentClass, LoopArgument, NBTpathToString, ResolveEntityValues, ResolveNBTClass, ResolveNBTPartClass, ScoreDisplay, SelectorEntityType, SelectorPickClass, SelectorProperties, SleepClass, StringDataPointClass, StructureMirror, StructureRotation, TargetFor, TargetlessDataClass, TargetlessDataPointClass, TextComponentClass, TriggerClass, TriggerHandler, UUIDOptions, UUIDSource, UUIDinNumber, UUIDinScore, VectorClass, _RawLabelClass, _RawObjectiveClass, coordinatesParser, parseJSONText, parseNBT, rangeParser, rotationParser, sanitizeValue, structureMirrorParser, structureRotationParser, targetParser } from '../../_internal/index.js'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ConditionClass, ConditionTextComponentClass, DataArrayClass, DataClass, DataIndexMapClass, EntityLabel, ItemPredicateClass, IterableDataClass, JSONTextComponentClass, LoopArgument, NBTpathToString, ResolveNBTClass, ResolveNBTPartClass, SelectorPickClass, SleepClass, StringDataPointClass, TargetlessDataClass, TargetlessDataPointClass, TextComponentClass, TriggerClass, VectorClass, _RawLabelClass, _RawObjectiveClass, coordinatesParser, parseJSONText, parseNBT, rangeParser, rotationParser, sanitizeValue, structureMirrorParser, structureRotationParser, targetParser } from '../../_internal/index.js'
|
|
1
|
+
export { ConditionClass, ConditionTextComponentClass, DataArrayClass, DataArrayInternal, DataClass, DataIndexMapClass, DataIndexMapInternal, EntityLabel, ItemPredicateClass, IterableDataClass, JSONTextComponentClass, LoopArgument, NBTpathToString, ResolveNBTClass, ResolveNBTPartClass, SelectorPickClass, SleepClass, StringDataPointClass, TargetlessDataClass, TargetlessDataPointClass, TextComponentClass, TriggerClass, VectorClass, _RawLabelClass, _RawObjectiveClass, coordinatesParser, parseJSONText, parseNBT, rangeParser, rotationParser, sanitizeValue, structureMirrorParser, structureRotationParser, targetParser } from '../../_internal/index.js'
|
package/package.json
CHANGED
package/src/arguments/coords.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Macroable } from 'sandstone/core'
|
|
2
|
+
import type { AllowConst } from 'sandstone/utils'
|
|
2
3
|
import type { VectorClass } from 'sandstone/variables'
|
|
3
4
|
|
|
4
5
|
type AbsoluteFloat<MACRO extends boolean = false> = Macroable<`${number}` | number, MACRO>
|
|
@@ -19,31 +20,24 @@ type LocalVec2<MACRO extends boolean = false> = Macroable<`${LocalFloat} ${Local
|
|
|
19
20
|
type VectorArrayComponent<MACRO extends boolean = false> = Macroable<AbsoluteOrRelativeFloat<MACRO> | LocalFloat<MACRO> | number, MACRO>
|
|
20
21
|
|
|
21
22
|
export type AbsoluteCoordinates<MACRO extends boolean = false> =
|
|
22
|
-
| [x: AbsoluteFloat<MACRO>, y: AbsoluteFloat<MACRO>, z: AbsoluteFloat<MACRO>]
|
|
23
|
-
| readonly [x: AbsoluteFloat<MACRO>, y: AbsoluteFloat<MACRO>, z: AbsoluteFloat<MACRO>]
|
|
23
|
+
| AllowConst<[x: AbsoluteFloat<MACRO>, y: AbsoluteFloat<MACRO>, z: AbsoluteFloat<MACRO>]>
|
|
24
24
|
| VectorClass<[string, string, string]>
|
|
25
25
|
| AbsoluteVec3<MACRO>
|
|
26
26
|
|
|
27
27
|
export type Coordinates<MACRO extends boolean = false> =
|
|
28
|
-
| [x: VectorArrayComponent<MACRO>, y: VectorArrayComponent<MACRO>, z: VectorArrayComponent<MACRO>]
|
|
29
|
-
| readonly [x: VectorArrayComponent<MACRO>, y: VectorArrayComponent<MACRO>, z: VectorArrayComponent<MACRO>]
|
|
28
|
+
| AllowConst<[x: VectorArrayComponent<MACRO>, y: VectorArrayComponent<MACRO>, z: VectorArrayComponent<MACRO>]>
|
|
30
29
|
| VectorClass<[string, string, string]>
|
|
31
30
|
| AbsoluteOrRelativeVec3<MACRO>
|
|
32
31
|
| LocalVec3<MACRO>
|
|
33
32
|
export type Rotation<MACRO extends boolean = false> =
|
|
34
|
-
| [
|
|
33
|
+
| AllowConst<[
|
|
35
34
|
horizontal: Macroable<AbsoluteOrRelativeFloat<MACRO> | number, MACRO>,
|
|
36
35
|
vertical: Macroable<AbsoluteOrRelativeFloat<MACRO> | number, MACRO>,
|
|
37
|
-
]
|
|
38
|
-
| readonly [
|
|
39
|
-
horizontal: Macroable<AbsoluteOrRelativeFloat<MACRO> | number, MACRO>,
|
|
40
|
-
vertical: Macroable<AbsoluteOrRelativeFloat<MACRO> | number, MACRO>,
|
|
41
|
-
]
|
|
36
|
+
]>
|
|
42
37
|
| VectorClass<[string, string]>
|
|
43
38
|
| AbsoluteOrRelativeVec2<MACRO>
|
|
44
39
|
export type ColumnCoordinates<MACRO extends boolean = false> =
|
|
45
|
-
| [x: VectorArrayComponent<MACRO>, z: VectorArrayComponent<MACRO>]
|
|
46
|
-
| readonly [x: VectorArrayComponent<MACRO>, z: VectorArrayComponent<MACRO>]
|
|
40
|
+
| AllowConst<[x: VectorArrayComponent<MACRO>, z: VectorArrayComponent<MACRO>]>
|
|
47
41
|
| VectorClass<[string, string]>
|
|
48
42
|
| AbsoluteOrRelativeVec2<MACRO>
|
|
49
43
|
| LocalVec2<MACRO>
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
VillagerTradeClass,
|
|
26
26
|
WorldClockClass,
|
|
27
27
|
AtlasClass,
|
|
28
|
-
|
|
28
|
+
BlockStateDefinitionClass,
|
|
29
29
|
EquipmentClass,
|
|
30
30
|
FontClass,
|
|
31
31
|
ItemModelDefinitionClass,
|
|
@@ -66,7 +66,7 @@ export const RESOURCE_CLASS_TYPES = [
|
|
|
66
66
|
[VillagerTradeClass, 'villager_trade'],
|
|
67
67
|
[WorldClockClass, 'world_clock'],
|
|
68
68
|
[AtlasClass, 'atlas'],
|
|
69
|
-
[
|
|
69
|
+
[BlockStateDefinitionClass, 'block_definition'],
|
|
70
70
|
[EquipmentClass, 'equipment'],
|
|
71
71
|
[FontClass, 'font'],
|
|
72
72
|
[ItemModelDefinitionClass, 'item_definition'],
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { Coordinates,
|
|
1
|
+
import type { Coordinates, RootNBT, SymbolBlock, SymbolMcdocBlockStates } from 'sandstone/arguments'
|
|
2
2
|
import type { Macroable, TagClass } from 'sandstone/core'
|
|
3
3
|
import { CommandNode } from 'sandstone/core/nodes'
|
|
4
4
|
import { coordinatesParser, nbtResolver } from 'sandstone/variables'
|
|
5
5
|
import { CommandArguments, type FinalCommandOutput } from '../../helpers'
|
|
6
6
|
import type { Registry } from 'sandstone/arguments/generated/registry'
|
|
7
7
|
import { blockStateStringifier, type BlockEntity, type BlockStatic, type ParseBlockState } from './setblock'
|
|
8
|
+
import type { AllowConst } from 'sandstone/utils'
|
|
8
9
|
|
|
9
10
|
export class FillCommandNode extends CommandNode {
|
|
10
11
|
command = 'fill' as const
|
|
@@ -71,7 +72,10 @@ export class FillCommand<MACRO extends boolean> extends CommandArguments {
|
|
|
71
72
|
to: Macroable<Coordinates<MACRO>, MACRO>,
|
|
72
73
|
block: BLOCK,
|
|
73
74
|
state?: Macroable<BLOCK extends keyof SymbolMcdocBlockStates ? ParseBlockState<NonNullable<SymbolMcdocBlockStates[BLOCK]>> : Record<string, string | boolean | number>, MACRO>,
|
|
74
|
-
nbt?: Macroable<BLOCK extends keyof SymbolBlock
|
|
75
|
+
nbt?: Macroable<BLOCK extends keyof SymbolBlock
|
|
76
|
+
? NonNullable<AllowConst<SymbolBlock[Extract<BLOCK, keyof SymbolBlock>]>>
|
|
77
|
+
: AllowConst<RootNBT>,
|
|
78
|
+
MACRO>,
|
|
75
79
|
): FillArgumentsCommand<MACRO>
|
|
76
80
|
|
|
77
81
|
fill(
|
|
@@ -79,7 +83,7 @@ export class FillCommand<MACRO extends boolean> extends CommandArguments {
|
|
|
79
83
|
to: Macroable<Coordinates<MACRO>, MACRO>,
|
|
80
84
|
block: Macroable<Registry['minecraft:block'], MACRO>,
|
|
81
85
|
state?: Record<string, string | boolean | number>,
|
|
82
|
-
nbt?:
|
|
86
|
+
nbt?: AllowConst<RootNBT>,
|
|
83
87
|
): FillArgumentsCommand<MACRO> {
|
|
84
88
|
const stateStr = state && Object.keys(state).length > 0 ? blockStateStringifier(state) : ''
|
|
85
89
|
const nbtStr = nbt ? nbtResolver(nbt).toString() : ''
|
|
@@ -26,7 +26,7 @@ export class PlaceCommand<MACRO extends boolean> extends CommandArguments {
|
|
|
26
26
|
* @param pos Optional. Where the placement should be tried.
|
|
27
27
|
*/
|
|
28
28
|
feature = (
|
|
29
|
-
feature: Macroable<Registry['minecraft:worldgen/
|
|
29
|
+
feature: Macroable<Registry['minecraft:worldgen/feature'], MACRO>,
|
|
30
30
|
pos: Macroable<Coordinates<MACRO>, MACRO> = '~ ~ ~' as Coordinates<MACRO>,
|
|
31
31
|
) => this.finalCommand(['feature', feature, coordinatesParser(pos)])
|
|
32
32
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Coordinates,
|
|
1
|
+
import type { Coordinates, RootNBT, SymbolBlock, SymbolMcdocBlockStates } from 'sandstone/arguments'
|
|
2
2
|
import type { Macroable } from 'sandstone/core'
|
|
3
3
|
import { CommandNode } from 'sandstone/core/nodes'
|
|
4
4
|
import { coordinatesParser, nbtResolver } from 'sandstone/variables'
|
|
5
5
|
import type { FinalCommandOutput } from '../../helpers'
|
|
6
6
|
import { CommandArguments } from '../../helpers'
|
|
7
7
|
import type { Registry } from 'sandstone/arguments/generated/registry'
|
|
8
|
-
import type { NamespacedLiteralUnion } from 'sandstone/utils'
|
|
8
|
+
import type { AllowConst, NamespacedLiteralUnion } from 'sandstone/utils'
|
|
9
9
|
|
|
10
10
|
/** Converts stringified boolean/numeric literals to actual booleans/numbers */
|
|
11
11
|
export type ParseLiteral<T> = (
|
|
@@ -21,7 +21,7 @@ export type ParseBlockState<T> = {
|
|
|
21
21
|
|
|
22
22
|
export type BlockEntity = NamespacedLiteralUnion<keyof SymbolBlock>
|
|
23
23
|
|
|
24
|
-
export type BlockStatic = NamespacedLiteralUnion<Exclude<keyof SymbolMcdocBlockStates, keyof SymbolBlock>>
|
|
24
|
+
export type BlockStatic = NamespacedLiteralUnion<Exclude<keyof SymbolMcdocBlockStates, keyof SymbolBlock>> | 'air' | 'minecraft:air'
|
|
25
25
|
|
|
26
26
|
export class SetBlockCommandNode extends CommandNode {
|
|
27
27
|
command = 'setblock' as const
|
|
@@ -37,24 +37,24 @@ export class SetBlockCommand<MACRO extends boolean> extends CommandArguments {
|
|
|
37
37
|
* This is the basic form for simple block placement without NBT data.
|
|
38
38
|
*
|
|
39
39
|
* @param pos The coordinates where to place the block. Supports:
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
40
|
+
* - Absolute: `abs(100, 64, 200)` - exact world coordinates
|
|
41
|
+
* - Relative: `['~5', '~1', '~-3']` - relative to command position
|
|
42
|
+
* - Local: `['^2', '^', '^-1']` - relative to facing direction
|
|
43
|
+
* - Mixed: `[100, '~5', '^2']` - combination of systems
|
|
44
44
|
*
|
|
45
45
|
* @param block The block type to place (e.g., `'minecraft:stone'`, `'oak_log'`).
|
|
46
46
|
*
|
|
47
47
|
* @param state Optional block state properties as an object. The available
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
48
|
+
* properties are type-checked based on the block type:
|
|
49
|
+
* - Oak log: `{ axis: 'x' | 'y' | 'z' }`
|
|
50
|
+
* - Redstone wire: `{ power: 0-15, north: 'none' | 'side' | 'up', ... }`
|
|
51
|
+
* - Stairs: `{ facing: 'north' | 'south' | 'east' | 'west', half: 'top' | 'bottom', ... }`
|
|
52
52
|
*
|
|
53
|
-
* @param
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
53
|
+
* @param flag How to handle the placement. Options:
|
|
54
|
+
* - `'replace'` (default): Silently replace any existing block
|
|
55
|
+
* - `'destroy'`: Break existing block, dropping items and playing sound
|
|
56
|
+
* - `'keep'`: Only place if the target location is air
|
|
57
|
+
* - `'strict'`: Replace without issuing block updates
|
|
58
58
|
*
|
|
59
59
|
* @example
|
|
60
60
|
* ```ts
|
|
@@ -82,7 +82,7 @@ export class SetBlockCommand<MACRO extends boolean> extends CommandArguments {
|
|
|
82
82
|
pos: Macroable<Coordinates<MACRO>, MACRO>,
|
|
83
83
|
block: BLOCK,
|
|
84
84
|
state?: Macroable<BLOCK extends keyof SymbolMcdocBlockStates ? ParseBlockState<NonNullable<SymbolMcdocBlockStates[Extract<BLOCK, keyof SymbolMcdocBlockStates>]>> : Record<string, string | boolean | number>, MACRO>,
|
|
85
|
-
|
|
85
|
+
flag?: 'destroy' | 'keep' | 'replace' | 'strict',
|
|
86
86
|
): FinalCommandOutput
|
|
87
87
|
|
|
88
88
|
/**
|
|
@@ -95,23 +95,27 @@ export class SetBlockCommand<MACRO extends boolean> extends CommandArguments {
|
|
|
95
95
|
* @param pos The coordinates where to place the block. Same format as basic variant.
|
|
96
96
|
*
|
|
97
97
|
* @param block The block type to place. Must be a block that supports NBT data:
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
98
|
+
* - `'minecraft:chest'` - for containers
|
|
99
|
+
* - `'minecraft:command_block'` - for command storage
|
|
100
|
+
* - `'minecraft:sign'` - for text display
|
|
101
|
+
* - `'minecraft:spawner'` - for mob spawning
|
|
102
102
|
*
|
|
103
103
|
* @param state Optional block state properties as an object. Type-checked based on block:
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
104
|
+
* - Chest: `{ facing: 'north' | 'south' | 'east' | 'west', type: 'single' | 'left' | 'right', ... }`
|
|
105
|
+
* - Command block: `{ facing: 'north' | 'south' | 'east' | 'west' | 'up' | 'down', conditional: true | false }`
|
|
106
|
+
* - Sign: `{ rotation: 0-15 }` or `{ facing: ... }` for wall signs
|
|
107
107
|
*
|
|
108
108
|
* @param nbt The NBT data object defining the block's properties:
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
109
|
+
* - For chests: `{ Items: [{ Slot: 0, id: 'diamond', Count: 1 }] }`
|
|
110
|
+
* - For signs: `{ front_text: { messages: [...] } }`
|
|
111
|
+
* - For command blocks: `{ Command: 'say Hello' }`
|
|
112
|
+
* - For spawners: `{ SpawnData: { id: 'minecraft:zombie' } }`
|
|
113
113
|
*
|
|
114
|
-
* @param
|
|
114
|
+
* @param flag How to handle the placement. Options:
|
|
115
|
+
* - `'replace'` (default): Silently replace any existing block
|
|
116
|
+
* - `'destroy'`: Break existing block, dropping items and playing sound
|
|
117
|
+
* - `'keep'`: Only place if the target location is air
|
|
118
|
+
* - `'strict'`: Replace without issuing block updates
|
|
115
119
|
*
|
|
116
120
|
* @example
|
|
117
121
|
* ```ts
|
|
@@ -139,8 +143,11 @@ export class SetBlockCommand<MACRO extends boolean> extends CommandArguments {
|
|
|
139
143
|
pos: Macroable<Coordinates<MACRO>, MACRO>,
|
|
140
144
|
block: BLOCK,
|
|
141
145
|
state?: Macroable<BLOCK extends keyof SymbolMcdocBlockStates ? ParseBlockState<NonNullable<SymbolMcdocBlockStates[Extract<BLOCK, keyof SymbolMcdocBlockStates>]>> : Record<string, string | boolean | number>, MACRO>,
|
|
142
|
-
nbt?: Macroable<BLOCK extends keyof SymbolBlock
|
|
143
|
-
|
|
146
|
+
nbt?: Macroable<BLOCK extends keyof SymbolBlock
|
|
147
|
+
? NonNullable<AllowConst<SymbolBlock[Extract<BLOCK, keyof SymbolBlock>]>>
|
|
148
|
+
: AllowConst<RootNBT>,
|
|
149
|
+
MACRO>,
|
|
150
|
+
flag?: 'destroy' | 'keep' | 'replace' | 'strict',
|
|
144
151
|
): FinalCommandOutput
|
|
145
152
|
|
|
146
153
|
setblock(
|
|
@@ -158,7 +165,7 @@ export class SetBlockCommand<MACRO extends boolean> extends CommandArguments {
|
|
|
158
165
|
: blockStateStringifier(arg3 as any as Record<string, string | number | boolean>)
|
|
159
166
|
const nbt = typeof arg4 === 'string' || arg4 === undefined ?
|
|
160
167
|
''
|
|
161
|
-
: nbtResolver(arg4 as any as
|
|
168
|
+
: nbtResolver(arg4 as any as RootNBT).toString()
|
|
162
169
|
const setblockType = typeof arg4 === 'string' ? arg4 : arg5
|
|
163
170
|
|
|
164
171
|
return this.finalCommand([coordinatesParser(pos), `${block}${state}${nbt}`, setblockType])
|
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
SingleEntityArgumentOf,
|
|
15
15
|
SymbolBlock,
|
|
16
16
|
SymbolMcdocBlockStates,
|
|
17
|
+
RootNBT,
|
|
17
18
|
} from 'sandstone/arguments'
|
|
18
19
|
import { blockStateStringifier } from '../block/setblock'
|
|
19
20
|
import type { SandstoneCommands } from 'sandstone/commands'
|
|
@@ -28,7 +29,7 @@ import type { Node } from 'sandstone/core/nodes'
|
|
|
28
29
|
import { ContainerCommandNode } from 'sandstone/core/nodes'
|
|
29
30
|
import type { _RawMCFunctionClass } from 'sandstone/core/resources/datapack/mcfunction'
|
|
30
31
|
import type { SandstonePack } from 'sandstone/pack'
|
|
31
|
-
import { makeCallable, type NamespacedLiteralUnion } from 'sandstone/utils'
|
|
32
|
+
import { type AllowConst, makeCallable, type NamespacedLiteralUnion } from 'sandstone/utils'
|
|
32
33
|
import type { DataPointClass } from 'sandstone/variables/Data'
|
|
33
34
|
import type { ObjectiveClass } from 'sandstone/variables/Objective'
|
|
34
35
|
import type { ItemPredicateClass } from 'sandstone/variables/ItemPredicate'
|
|
@@ -561,15 +562,16 @@ export class ExecuteIfUnlessCommand<MACRO extends boolean> extends ExecuteComman
|
|
|
561
562
|
? ParseBlockState<NonNullable<SymbolMcdocBlockStates[Extract<BLOCK, keyof SymbolMcdocBlockStates>]>>
|
|
562
563
|
: Record<string, string | boolean | number> | undefined, MACRO>,
|
|
563
564
|
nbt: Macroable<BLOCK extends keyof SymbolBlock
|
|
564
|
-
? NonNullable<SymbolBlock[Extract<BLOCK, keyof SymbolBlock>]
|
|
565
|
-
:
|
|
565
|
+
? NonNullable<AllowConst<SymbolBlock[Extract<BLOCK, keyof SymbolBlock>]>>
|
|
566
|
+
: AllowConst<RootNBT>,
|
|
567
|
+
MACRO>,
|
|
566
568
|
): ExecuteCommand<MACRO>
|
|
567
569
|
|
|
568
570
|
block(
|
|
569
571
|
pos: Macroable<Coordinates<MACRO>, MACRO>,
|
|
570
572
|
block: Macroable<Registry['minecraft:block'], MACRO>,
|
|
571
573
|
state?: Macroable<Record<string, string | boolean | number>, MACRO>,
|
|
572
|
-
nbt?: Macroable<
|
|
574
|
+
nbt?: Macroable<AllowConst<RootNBT>, MACRO>,
|
|
573
575
|
) {
|
|
574
576
|
const stateStr = state && typeof state === 'object' && Object.keys(state).length > 0
|
|
575
577
|
? blockStateStringifier(state as Record<string, string | number | boolean>)
|
|
@@ -5,6 +5,7 @@ import { NBT, nbtResolver } from 'sandstone/variables/nbt/NBTs'
|
|
|
5
5
|
import { coordinatesParser } from 'sandstone/variables/parsers'
|
|
6
6
|
import { CommandArguments } from '../../helpers'
|
|
7
7
|
import type { Registry } from 'sandstone/arguments/generated/registry'
|
|
8
|
+
import { AllowConst } from 'sandstone/utils'
|
|
8
9
|
|
|
9
10
|
export class SummonCommandNode extends CommandNode {
|
|
10
11
|
command = 'summon' as const
|
|
@@ -50,7 +51,7 @@ export class SummonCommand<MACRO extends boolean> extends CommandArguments {
|
|
|
50
51
|
summon<ENTITY extends Macroable<Registry['minecraft:entity_type'], MACRO>>(
|
|
51
52
|
entity: ENTITY,
|
|
52
53
|
pos?: Macroable<Coordinates<MACRO>, MACRO>,
|
|
53
|
-
nbt?: Macroable<ENTITY extends keyof SymbolEntity ? NonNullable<SymbolEntity[ENTITY]> : RootNBT
|
|
54
|
+
nbt?: Macroable<AllowConst<ENTITY extends keyof SymbolEntity ? NonNullable<SymbolEntity[ENTITY]> : RootNBT>, MACRO>,
|
|
54
55
|
) {
|
|
55
56
|
const args: unknown[] = [entity]
|
|
56
57
|
if (pos !== undefined) {
|
|
@@ -63,7 +63,7 @@ export class ItemModifierClass extends ResourceClass<ItemModifierNode> implement
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
for (const modifier of modifiers) {
|
|
66
|
-
let modifierJSON:
|
|
66
|
+
let modifierJSON: any
|
|
67
67
|
if (modifier instanceof ItemModifierClass) {
|
|
68
68
|
modifierJSON = modifier.itemModifierJSON
|
|
69
69
|
} else {
|
|
@@ -83,7 +83,7 @@ export class ItemModifierClass extends ResourceClass<ItemModifierNode> implement
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
for (const modifier of modifiers) {
|
|
86
|
-
let modifierJSON:
|
|
86
|
+
let modifierJSON: any
|
|
87
87
|
if (modifier instanceof ItemModifierClass) {
|
|
88
88
|
modifierJSON = modifier.itemModifierJSON
|
|
89
89
|
} else {
|
|
@@ -6,115 +6,115 @@ import type { ListResource, ResourceClassArguments, ResourceNode } from '../reso
|
|
|
6
6
|
import { ResourceClass, jsonStringify } from '../resource'
|
|
7
7
|
import type { AllKeys } from 'sandstone/utils'
|
|
8
8
|
|
|
9
|
-
export type
|
|
10
|
-
export type
|
|
9
|
+
export type BlockStateDefinitionJSON = NonNullable<MCDocToJSON<SymbolResource['block_definition']>>
|
|
10
|
+
export type BlockStateDefinitionType = AllKeys<BlockStateDefinitionJSON>
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* A node representing a Minecraft block state.
|
|
13
|
+
* A node representing a Minecraft block state definition.
|
|
14
14
|
*/
|
|
15
|
-
export class
|
|
15
|
+
export class BlockStateDefinitionNode<JSON extends BlockStateDefinitionJSON>
|
|
16
16
|
extends ContainerNode
|
|
17
|
-
implements ResourceNode<
|
|
17
|
+
implements ResourceNode<BlockStateDefinitionClass<JSON>> {
|
|
18
18
|
constructor(
|
|
19
19
|
sandstoneCore: SandstoneCore,
|
|
20
|
-
public resource:
|
|
20
|
+
public resource: BlockStateDefinitionClass<JSON>,
|
|
21
21
|
) {
|
|
22
22
|
super(sandstoneCore)
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
getValue = () => jsonStringify(this.resource.
|
|
25
|
+
getValue = () => jsonStringify(this.resource.blockStateDefinitionJSON, this.resource._resourceType as keyof typeof RESOURCE_PATHS)
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
export type
|
|
28
|
+
export type BlockStateDefinitionArguments<JSON extends BlockStateDefinitionJSON> = {
|
|
29
29
|
/**
|
|
30
|
-
* The block state's JSON.
|
|
30
|
+
* The block state definition's JSON.
|
|
31
31
|
*/
|
|
32
32
|
json: JSON
|
|
33
33
|
} & ResourceClassArguments<'list'>
|
|
34
34
|
|
|
35
|
-
export class
|
|
36
|
-
extends ResourceClass<
|
|
35
|
+
export class BlockStateDefinitionClass<JSON extends BlockStateDefinitionJSON, Type = Extract<AllKeys<JSON>, BlockStateDefinitionType>>
|
|
36
|
+
extends ResourceClass<BlockStateDefinitionNode<JSON>>
|
|
37
37
|
implements ListResource {
|
|
38
38
|
static readonly resourceType = 'block_definition'
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
blockStateDefinitionJSON: JSON
|
|
41
41
|
|
|
42
42
|
type: Type
|
|
43
43
|
|
|
44
44
|
constructor(
|
|
45
45
|
core: SandstoneCore,
|
|
46
46
|
name: string,
|
|
47
|
-
args:
|
|
47
|
+
args: BlockStateDefinitionArguments<JSON>,
|
|
48
48
|
) {
|
|
49
49
|
super(
|
|
50
50
|
core,
|
|
51
51
|
{ packType: core.pack.resourcePack() },
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
core.pack.resourceToPath(name, RESOURCE_PATHS[
|
|
52
|
+
BlockStateDefinitionNode,
|
|
53
|
+
BlockStateDefinitionClass.resourceType,
|
|
54
|
+
core.pack.resourceToPath(name, RESOURCE_PATHS[BlockStateDefinitionClass.resourceType].path),
|
|
55
55
|
args,
|
|
56
56
|
)
|
|
57
57
|
|
|
58
|
-
this.
|
|
58
|
+
this.blockStateDefinitionJSON = args.json
|
|
59
59
|
|
|
60
|
-
this.type = Object.keys(this.
|
|
60
|
+
this.type = Object.keys(this.blockStateDefinitionJSON)[0] as Type
|
|
61
61
|
|
|
62
62
|
this.handleConflicts()
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
push(...states:
|
|
65
|
+
push(...states: BlockStateDefinitionClass<any, Type>[] | BlockStateDefinitionJSON[]) {
|
|
66
66
|
if (this.type === 'variants') {
|
|
67
|
-
if (states[0] instanceof
|
|
67
|
+
if (states[0] instanceof BlockStateDefinitionClass) {
|
|
68
68
|
for (const state of states) {
|
|
69
69
|
/** @ts-ignore */
|
|
70
|
-
this.
|
|
70
|
+
this.blockStateDefinitionJSON.variants = { ...this.blockStateDefinitionJSON.variants, ...state.blockStateDefinitionJSON.variants }
|
|
71
71
|
}
|
|
72
72
|
} else {
|
|
73
73
|
for (const state of states) {
|
|
74
74
|
/** @ts-ignore */
|
|
75
|
-
this.
|
|
75
|
+
this.blockStateDefinitionJSON.variants = { ...this.blockStateDefinitionJSON.variants, ...state.variants }
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
if (this.type === 'multipart') {
|
|
80
|
-
if (states[0] instanceof
|
|
80
|
+
if (states[0] instanceof BlockStateDefinitionClass) {
|
|
81
81
|
for (const state of states) {
|
|
82
82
|
/** @ts-ignore */
|
|
83
|
-
this.
|
|
83
|
+
this.blockStateDefinitionJSON.multipart.push(...state.blockStateDefinitionJSON.multipart)
|
|
84
84
|
}
|
|
85
85
|
} else {
|
|
86
86
|
for (const state of states) {
|
|
87
87
|
/** @ts-ignore */
|
|
88
|
-
this.
|
|
88
|
+
this.blockStateDefinitionJSON.multipart.push(...state.multipart)
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
unshift(...states:
|
|
94
|
+
unshift(...states: BlockStateDefinitionClass<any, Type>[] | BlockStateDefinitionJSON[]) {
|
|
95
95
|
if (this.type === 'variants') {
|
|
96
|
-
if (states[0] instanceof
|
|
96
|
+
if (states[0] instanceof BlockStateDefinitionClass) {
|
|
97
97
|
for (const state of states) {
|
|
98
98
|
/** @ts-ignore */
|
|
99
|
-
this.
|
|
99
|
+
this.blockStateDefinitionJSON.variants = { ...state.blockStateDefinitionJSON.variants, ...this.blockStateDefinitionJSON.variants }
|
|
100
100
|
}
|
|
101
101
|
} else {
|
|
102
102
|
for (const state of states) {
|
|
103
103
|
/** @ts-ignore */
|
|
104
|
-
this.
|
|
104
|
+
this.blockStateDefinitionJSON.variants = { ...state.variants, ...this.blockStateDefinitionJSON.variants }
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
if (this.type === 'multipart') {
|
|
109
|
-
if (states[0] instanceof
|
|
109
|
+
if (states[0] instanceof BlockStateDefinitionClass) {
|
|
110
110
|
for (const state of states) {
|
|
111
111
|
/** @ts-ignore */
|
|
112
|
-
this.
|
|
112
|
+
this.blockStateDefinitionJSON.multipart.unshift(...state.blockStateDefinitionJSON.multipart)
|
|
113
113
|
}
|
|
114
114
|
} else {
|
|
115
115
|
for (const state of states) {
|
|
116
116
|
/** @ts-ignore */
|
|
117
|
-
this.
|
|
117
|
+
this.blockStateDefinitionJSON.multipart.unshift(...state.multipart)
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
}
|