/// <summary> /// Intializes a new <see cref="SmeltRecipe"/>. Inherite from this constructor. /// </summary> /// <param name="packNamespace">The namespace the recipe is in</param> /// <param name="fileName">The name of the recipe file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="group">The name of the recipe group the recipe is in. Leave null for no group.</param> /// <param name="recipeType">The type of smelting recipe</param> /// <param name="ingredients">The different types of items which can be used in the recipe</param> /// <param name="result">The result from the recipe</param> /// <param name="experience">The amount of experience to get for smelting the item</param> /// <param name="cookingTime">The amount of time it takes to cook the item</param> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> protected SmeltRecipe(bool _, BasePackNamespace packNamespace, string?fileName, SmeltType recipeType, IItemType[] ingredients, ID.Item result, double experience, NoneNegativeTime <int>?cookingTime = null, string?group = null, WriteSetting writeSetting = WriteSetting.LockedAuto) : base(packNamespace, fileName, group, writeSetting, "minecraft:" + recipeType.ToString()) { Ingredients = ingredients; Result = result; Experience = experience; CookingTime = cookingTime; }
/// <summary> /// Intializes a new <see cref="Function"/> with the given values. Inherite from this constructor. /// </summary> /// <param name="space">The namespace the function is in</param> /// <param name="fileName">The name of the function</param> /// <param name="writeSetting">The setting for writing the file</param> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> protected Function(bool _, BasePackNamespace space, string?fileName, WriteSetting writeSetting = WriteSetting.LockedAuto) : base(space, fileName, writeSetting, "function") { if (IsAuto()) { StreamWriter = GetStream(); } Block = new FunctionWriters.BlockCommands(this); Entity = new FunctionWriters.EntityCommands(this); Execute = new FunctionWriters.ExecuteCommands(this); World = new FunctionWriters.WorldCommands(this); Player = new FunctionWriters.PlayerCommands(this); Custom = new FunctionWriters.CustomCommands(this); Commands = new List <ICommand>(); }
/// <summary> /// Intializes a new <see cref="BaseFile"/> with the given values /// </summary> /// <param name="packNamespace">The namespace this file is for</param> /// <param name="fileName">The name of the file</param> /// <param name="writeSetting">The setting for the file</param> /// <param name="fileType">The type of file</param> protected BaseFile(BasePackNamespace packNamespace, string?fileName, WriteSetting writeSetting, string fileType) { PackNamespace = packNamespace; if (packNamespace.IsSettingSet(NamespaceSettings.GetSettings().ForceDisposeWriteFiles())) { if (writeSetting == WriteSetting.Auto) { Setting = WriteSetting.OnDispose; } else if (writeSetting == WriteSetting.LockedAuto) { Setting = WriteSetting.LockedOnDispose; } else { Setting = writeSetting; } } else { Setting = writeSetting; } FileType = fileType; string useName = fileName !; if (string.IsNullOrWhiteSpace(useName)) { useName = PackNamespace.GetID(this); } FileId = useName; if (PackNamespace.IsSettingSet(NamespaceSettings.GetSettings().GenerateNames()) && useName == fileName) { WritePath = PackNamespace.GetID(this); } else { WritePath = useName; } }
/// <summary> /// Intializes a new <see cref="LootTable"/> with the given parameters. Inherite from this constructor. /// </summary> /// <param name="packNamespace">The namespace the loot table is in</param> /// <param name="fileName">The name of the loot table file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="pools">The loot pools in the loot table</param> /// <param name="type">The type of loot table</param> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> protected LootTable(bool _, BasePackNamespace packNamespace, string?fileName, LootPool[] pools, TableType?type = null, WriteSetting writeSetting = WriteSetting.OnDispose) : base(packNamespace, fileName, writeSetting, "loot_table") { Type = type; Pools = pools.ToList(); }
/// <summary> /// Intializes a new <see cref="InvalidAdvancement"/>. Inherite from this constructor. /// </summary> /// <param name="packNamespace">The namespace the advancement is in</param> /// <param name="fileName">The name of the advancement file</param> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> protected InvalidAdvancement(bool _, BasePackNamespace packNamespace, string fileName) : base(packNamespace, fileName, new Requirement[0], null, WriteSetting.LockedAuto) { }
/// <summary> /// Intializes a new <see cref="HiddenAdvancement"/>. Inherite from this constructor. /// </summary> /// <param name="packNamespace">The namespace the advancement is in</param> /// <param name="fileName">The name of the advancement file</param> /// <param name="writeSetting">The setting for writing the file</param> /// <param name="requirements">The requirements for getting the advancement</param> /// <param name="reward">The rewards to get for getting the advancement</param> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> protected HiddenAdvancement(bool _, BasePackNamespace packNamespace, string?fileName, Requirement[] requirements, Reward?reward, WriteSetting writeSetting = WriteSetting.LockedAuto) : base(packNamespace, fileName, requirements, reward, writeSetting) { }
/// <summary> /// Intializes a new <see cref="DimensionType"/>. Inherite from this constructor. /// </summary> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> /// <param name="packNamespace">The namespace the type is in</param> /// <param name="fileName">The name of the dimension type file</param> /// <param name="dimensionTypeObject">The information about the type</param> /// <param name="writeSetting">The settings for how to write this file</param> protected DimensionType(bool _, BasePackNamespace packNamespace, string?fileName, DimensionTypeObject dimensionTypeObject, WriteSetting writeSetting = WriteSetting.LockedAuto) : base(packNamespace, fileName, writeSetting, "dimension_type") { DimensionTypeObject = dimensionTypeObject; }
/// <summary> /// Intializes a new Group with the given parameters. Inherite from this constructor. /// </summary> /// <param name="packNamespace">The namespace the group is in</param> /// <param name="fileName">The name of the group file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="items">The items in this group</param> /// <param name="appendGroup">If this group should append other groups of the same type and same name from other datapacks</param> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> protected BlockGroup(bool _, BasePackNamespace packNamespace, string?fileName, List <IBlockType> items, bool appendGroup, WriteSetting writeSetting) : base(packNamespace, fileName, items, appendGroup, writeSetting, "block") { }
/// <summary> /// Intializes a new <see cref="Structure"/> /// </summary> /// <param name="packNamespace">The namespace the predicate is in</param> /// <param name="fileName">The name of the predicate file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="blockPalettes">The pallete used for the structure</param> /// <param name="blocksInStructure">The blocks in the structure</param> /// <param name="entities">Entities in the structure</param> public Structure(BasePackNamespace packNamespace, string?fileName, SharpCraft.Block[][] blockPalettes, Block[] blocksInStructure, Entities.BasicEntity[] entities, WriteSetting writeSetting = WriteSetting.LockedAuto) : this(true, packNamespace, fileName, blockPalettes, blocksInStructure, entities, writeSetting) { FinishedConstructing(); }
/// <summary> /// Intializes a new <see cref="Predicate"/> /// </summary> /// <param name="packNamespace">The namespace the predicate is in</param> /// <param name="fileName">The name of the predicate file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="condition">The predicate to test for</param> public Predicate(BasePackNamespace packNamespace, string?fileName, BaseCondition condition, WriteSetting writeSetting = WriteSetting.LockedAuto) : this(true, packNamespace, fileName, condition, writeSetting) { FinishedConstructing(); }
/// <summary> /// Intializes a new <see cref="SpecialRecipe"/> /// </summary> /// <param name="packNamespace">The namespace the recipe is in</param>. Inherite from this constructor. /// <param name="fileName">The name of the recipe file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="group">The name of the recipe group the recipe is in. Leave null for no group.</param> /// <param name="recipeType">The type of special recipe</param> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> protected SpecialRecipe(bool _, BasePackNamespace packNamespace, string?fileName, SpecialType recipeType, string?group = null, WriteSetting writeSetting = WriteSetting.LockedAuto) : base(packNamespace, fileName, group, writeSetting, "minecraft:crafting_special_" + recipeType.ToString()) { }
/// <summary> /// Intializes a new <see cref="InvalidRecipe"/> /// </summary> /// <param name="packNamespace">The namespace the recipe is in</param> /// <param name="fileName">The name of the recipe file to invalidate</param> public InvalidRecipe(BasePackNamespace packNamespace, string?fileName) : this(true, packNamespace, fileName) { FinishedConstructing(); }
/// <summary> /// Intializes a new <see cref="InvalidRecipe"/>. Inherite from this constructor. /// </summary> /// <param name="packNamespace">The namespace the recipe is in</param> /// <param name="fileName">The name of the recipe file to invalidate</param> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> protected InvalidRecipe(bool _, BasePackNamespace packNamespace, string?fileName) : base(packNamespace, fileName, null, WriteSetting.LockedAuto, "minecraft:invalid") { }
/// <summary> /// Intializes a new <see cref="ShapelessRecipe"/> /// </summary> /// <param name="packNamespace">The namespace the recipe is in</param> /// <param name="fileName">The name of the recipe file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="group">The name of the recipe group the recipe is in. Leave null for no group.</param> /// <param name="ingredients">The items used in the recipe</param> /// <param name="count">The amount of the result item the recipe should output</param> /// <param name="result">The item to craft</param> public ShapelessRecipe(BasePackNamespace packNamespace, string?fileName, IItemType[] ingredients, ID.Item result, int count = 1, string?group = null, WriteSetting writeSetting = WriteSetting.LockedAuto) : this(true, packNamespace, fileName, ingredients, result, count, group, writeSetting) { FinishedConstructing(); }
/// <summary> /// Intializes a new <see cref="ShapelessRecipe"/>. Inherite from this constructor. /// </summary> /// <param name="packNamespace">The namespace the recipe is in</param> /// <param name="fileName">The name of the recipe file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="group">The name of the recipe group the recipe is in. Leave null for no group.</param> /// <param name="ingredients">The items used in the recipe</param> /// <param name="count">The amount of the result item the recipe should output</param> /// <param name="result">The item to craft</param> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> protected ShapelessRecipe(bool _, BasePackNamespace packNamespace, string?fileName, IItemType[] ingredients, ID.Item result, int count = 1, string?group = null, WriteSetting writeSetting = WriteSetting.LockedAuto) : base(packNamespace, fileName, group, writeSetting, "minecraft:crafting_shapeless") { Ingredients = ingredients; Result = result; Count = count; }
/// <summary> /// Intializes a new Group with the given parameters. Inherite from this constructor. /// </summary> /// <param name="packNamespace">The namespace the group is in</param> /// <param name="fileName">The name of the group file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="items">The items in this group</param> /// <param name="appendGroup">If this group should append other groups of the same type and same name from other datapacks</param> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> protected EntityGroup(bool _, BasePackNamespace packNamespace, string?fileName, List <IEntityType> items, bool appendGroup, WriteSetting writeSetting) : base(packNamespace, fileName, items, appendGroup, writeSetting, "entity") { }
/// <summary> /// Intializes a new <see cref="InvalidAdvancement"/> /// </summary> /// <param name="packNamespace">The namespace the advancement is in</param> /// <param name="fileName">The name of the advancement file</param> public InvalidAdvancement(BasePackNamespace packNamespace, string fileName) : this(true, packNamespace, fileName) { FinishedConstructing(); }
/// <summary> /// Intializes a new <see cref="LootTable"/> with the given parameters /// </summary> /// <param name="packNamespace">The namespace the loot table is in</param> /// <param name="fileName">The name of the loot table file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="pools">The loot pools in the loot table</param> /// <param name="type">The type of loot table</param> public LootTable(BasePackNamespace packNamespace, string?fileName, LootPool[] pools, TableType?type = null, WriteSetting writeSetting = WriteSetting.OnDispose) : this(true, packNamespace, fileName, pools, type, writeSetting) { FinishedConstructing(); }
/// <summary> /// Intializes a new <see cref="Predicate"/>. Inherite from this constructor. /// </summary> /// <param name="packNamespace">The namespace the predicate is in</param> /// <param name="fileName">The name of the predicate file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="condition">The predicate to test for</param> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> protected Predicate(bool _, BasePackNamespace packNamespace, string?fileName, BaseCondition condition, WriteSetting writeSetting = WriteSetting.LockedAuto) : base(packNamespace, fileName, writeSetting, "predicate") { Condition = condition; }
/// <summary> /// Intializes a new <see cref="SpecialRecipe"/> /// </summary> /// <param name="packNamespace">The namespace the recipe is in</param> /// <param name="fileName">The name of the recipe file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="group">The name of the recipe group the recipe is in. Leave null for no group.</param> /// <param name="recipeType">The type of special recipe</param> public SpecialRecipe(BasePackNamespace packNamespace, string?fileName, SpecialType recipeType, string?group = null, WriteSetting writeSetting = WriteSetting.LockedAuto) : this(true, packNamespace, fileName, recipeType, group, writeSetting) { FinishedConstructing(); }
/// <summary> /// Intializes a new <see cref="Structure"/>. Inherite from this constructor. /// </summary> /// <param name="packNamespace">The namespace the predicate is in</param> /// <param name="fileName">The name of the predicate file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="blockPalettes">The pallete used for the structure</param> /// <param name="blocksInStructure">The blocks in the structure</param> /// <param name="entities">Entities in the structure</param> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> protected Structure(bool _, BasePackNamespace packNamespace, string?fileName, SharpCraft.Block[][] blockPalettes, Block[] blocksInStructure, Entities.BasicEntity[] entities, WriteSetting writeSetting = WriteSetting.LockedAuto) : base(packNamespace, fileName, writeSetting, "structure") { BlockPalettes = blockPalettes; BlocksInStructure = blocksInStructure; Entities = entities; }
/// <summary> /// Intializes a new Group with the given parameters. Inherite from this constructor. /// </summary> /// <param name="packNamespace">The namespace the group is in</param> /// <param name="fileName">The name of the group file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="items">The items in this group</param> /// <param name="appendGroup">If this group should append other groups of the same type and same name from other datapacks</param> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> protected ItemGroup(bool _, BasePackNamespace packNamespace, string?fileName, List <IItemType> items, bool appendGroup, WriteSetting writeSetting) : base(packNamespace, fileName, items, appendGroup, writeSetting, "item") { }
/// <summary> /// Intializes a new <see cref="ParentAdvancement"/> /// </summary> /// <param name="packNamespace">The namespace the advancement is in</param> /// <param name="fileName">The name of the advancement file</param> /// <param name="writeSetting">The setting for writing the file</param> /// <param name="requirements">The requirements for getting the advancement</param> /// <param name="reward">The rewards to get for getting the advancement</param> /// <param name="announceInChat">True if when the advancement is unlocked it will be announced in chat. False if not</param> /// <param name="description">The description on the advancement</param> /// <param name="frame">The frame around the icon</param> /// <param name="hidden">True if the advancement can't be seen unless it has been unlocked</param> /// <param name="icon">The icon on the advancement</param> /// <param name="name">The shown advancement name</param> /// <param name="showToast">True if when the advancement is unlocked it will display a toast in the top right corner. False if not</param> /// <param name="background">The background in the advancement gui. Example: minecraft:textures/gui/advancements/backgrounds/end.png.</param> public ParentAdvancement(BasePackNamespace packNamespace, string?fileName, Requirement[] requirements, Reward?reward, BaseJsonText name, BaseJsonText description, Item icon, string background, ID.AdvancementFrame frame = ID.AdvancementFrame.task, bool announceInChat = false, bool showToast = true, bool hidden = false, WriteSetting writeSetting = WriteSetting.LockedAuto) : this(true, packNamespace, fileName, requirements, reward, name, description, icon, background, frame, announceInChat, showToast, hidden, writeSetting) { FinishedConstructing(); }
/// <summary> /// Intializes a new <see cref="Storage"/> /// </summary> /// <param name="packNamespace">The namespace for the storage</param> /// <param name="name">The name of the storage</param> public Storage(BasePackNamespace packNamespace, string name) { PackNamespace = packNamespace; Name = name; }
/// <summary> /// Intializes a new Group with the given parameters /// </summary> /// <param name="packNamespace">The namespace the group is in</param> /// <param name="fileName">The name of the group file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="items">The items in this group</param> /// <param name="appendGroup">If this group should append other groups of the same type and same name from other datapacks</param> public BlockGroup(BasePackNamespace packNamespace, string?fileName, List <IBlockType> items, bool appendGroup, WriteSetting writeSetting) : this(true, packNamespace, fileName, items, appendGroup, writeSetting) { FinishedConstructing(); }
/// <summary> /// Intializes a new <see cref="CraftingRecipe"/>. Inherite from this constructor. /// </summary> /// <param name="packNamespace">The namespace the recipe is in</param> /// <param name="fileName">The name of the recipe file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="group">The name of the recipe group the recipe is in. Leave null for no group.</param> /// <param name="recipe">The recipe for crafting the item. Use <see cref="ID.Item.air"/> or null for empty slots</param> /// <param name="count">The amount of the result item the recipe should output</param> /// <param name="result">The item to craft</param> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> protected CraftingRecipe(bool _, BasePackNamespace packNamespace, string?fileName, IItemType?[,] recipe, ID.Item result, int count = 1, string?group = null, WriteSetting writeSetting = WriteSetting.LockedAuto) : base(packNamespace, fileName, group, writeSetting, "minecraft:crafting_shaped") { Recipe = recipe; Result = result; Count = count; }
/// <summary> /// Intializes a new <see cref="DimensionType"/> /// </summary> /// <param name="packNamespace">The namespace the type is in</param> /// <param name="fileName">The name of the dimensiotn type file</param> /// <param name="dimensionTypeObject">The information about the type</param> /// <param name="writeSetting">The settings for how to write this file</param> public DimensionType(BasePackNamespace packNamespace, string?fileName, DimensionTypeObject dimensionTypeObject, WriteSetting writeSetting = WriteSetting.LockedAuto) : this(true, packNamespace, fileName, dimensionTypeObject, writeSetting) { FinishedConstructing(); }
/// <summary> /// Intializes a new <see cref="Function"/> with the given values /// </summary> /// <param name="space">The namespace the function is in</param> /// <param name="fileName">The name of the function</param> /// <param name="writeSetting">The setting for writing the file</param> public Function(BasePackNamespace space, string?fileName, WriteSetting writeSetting = WriteSetting.LockedAuto) : this(true, space, fileName, writeSetting) { FinishedConstructing(); }
/// <summary> /// Intializes a new <see cref="HiddenAdvancement"/> /// </summary> /// <param name="packNamespace">The namespace the advancement is in</param> /// <param name="fileName">The name of the advancement file</param> /// <param name="writeSetting">The setting for writing the file</param> /// <param name="requirements">The requirements for getting the advancement</param> /// <param name="reward">The rewards to get for getting the advancement</param> public HiddenAdvancement(BasePackNamespace packNamespace, string?fileName, Requirement[] requirements, Reward?reward, WriteSetting writeSetting = WriteSetting.LockedAuto) : this(true, packNamespace, fileName, requirements, reward, writeSetting) { FinishedConstructing(); }
/// <summary> /// Intializes a new <see cref="CraftingRecipe"/> /// </summary> /// <param name="packNamespace">The namespace the recipe is in</param> /// <param name="fileName">The name of the recipe file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="group">The name of the recipe group the recipe is in. Leave null for no group.</param> /// <param name="recipe">The recipe for crafting the item. Use <see cref="ID.Item.air"/> or null for empty slots</param> /// <param name="count">The amount of the result item the recipe should output</param> /// <param name="result">The item to craft</param> public CraftingRecipe(BasePackNamespace packNamespace, string?fileName, IItemType?[,] recipe, ID.Item result, int count = 1, string?group = null, WriteSetting writeSetting = WriteSetting.LockedAuto) : this(true, packNamespace, fileName, recipe, result, count, group, writeSetting) { FinishedConstructing(); }