commit 08d74bc706ab44a6b4028ab55b9bfdf149e93879 Author: Ella Paws <> Date: Sat Feb 5 04:14:38 2022 +0100 initial commit diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..dd13ca8 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,431 @@ +THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS +COOPERATIVE NON-VIOLENT PUBLIC LICENSE (\"LICENSE\"). THE WORK IS +PROTECTED BY COPYRIGHT AND ALL OTHER APPLICABLE LAWS. ANY USE OF THE +WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS +PROHIBITED. BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED IN THIS +LICENSE, YOU AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE.TO THE +EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR +GRANTS YOU THE RIGHTS CONTAINED HERE IN AS CONSIDERATION FOR ACCEPTING +THE TERMS AND CONDITIONS OF THIS LICENSE AND FOR AGREEING TO BE BOUND BY +THE TERMS AND CONDITIONS OF THIS LICENSE. + +# Definitions + +An Act of War is any action of one country against any group either with +an intention to provoke a conflict or an action that occurs during a +declared war or during armed conflict between military forces of any +origin. This includes but is not limited to enforcing sanctions or +sieges, supplying armed forces, or profiting from the manufacture of +tools or weaponry used in military conflict. + +An Adaptation is a work based upon the Work, or upon the Work and other +pre-existing works, such as a translation, adaptation, derivative work, +arrangement of music or other alterations of a literary or artistic +work, or phonogram or performance and includes cinematographic +adaptations or any other form in which the Work may be recast, +transformed, or adapted including in any form recognizably derived from +the original, except that a work that constitutes a Collection will not +be considered an Adaptation for the purpose of this License. For the +avoidance of doubt, where the Work is a musical work, performance or +phonogram, the synchronization of the Work in timed-relation with a +moving image (\"synching\") will be considered an Adaptation for the +purpose of this License. In addition, where the Work is designed to +output a neural network the output of the neural network will be +considered an Adaptation for the purpose of this license. + +Bodily Harm is any physical hurt or injury to a person that interferes +with the health or comfort of the person and that is more than merely +transient or trifling in nature. + +Distribute is to make available to the public the original and copies of +the Work or Adaptation, as appropriate, through sale, gift or any other +transfer of possession or ownership. + +Incarceration is Confinement in a jail, prison, or any other place where +individuals of any kind are held against either their will or (if their +will cannot be determined) the will of their legal guardian or +guardians. In the case of a conflict between the will of the individual +and the will of their legal guardian or guardians, the will of the +individual will take precedence. + +Licensor is The individual, individuals, entity, or entities that +offer(s) the Work under the terms of this License + +Original Author is in the case of a literary or artistic work, the +individual, individuals, entity or entities who created the Work or if +no individual or entity can be identified, the publisher; and in +addition + +- in the case of a performance the actors, singers, musicians, + dancers, and other persons who act, sing, deliver, declaim, play in, + interpret or otherwise perform literary or artistic works or + expressions of folklore; + +- in the case of a phonogram the producer being the person or legal + entity who first fixes the sounds of a performance or other sounds; + and, + +- in the case of broadcasts, the organization that transmits the + broadcast. + +Work is the literary and/or artistic work offered under the terms of +this License including without limitation any production in the +literary, scientific and artistic domain, whatever may be the mode or +form of its expression including digital form, such as a book, pamphlet +and other writing; a lecture, address, sermon or other work of the same +nature; a dramatic or dramatico-musical work; a choreographic work or +entertainment in dumb show; a musical composition with or without words; +a cinematographic work to which are assimilated works expressed by a +process analogous to cinematography; a work of drawing, painting, +architecture, sculpture, engraving or lithography; a photographic work +to which are assimilated works expressed by a process analogous to +photography; a work of applied art; an illustration, map, plan, sketch +or three-dimensional work relative to geography, topography, +architecture or science; a performance; a broadcast; a phonogram; a +compilation of data to the extent it is protected as a copyrightable +work; or a work performed by a variety or circus performer to the extent +it is not otherwise considered a literary or artistic work. + +You means an individual or entity exercising rights under this License +who has not previously violated the terms of this License with respect +to the Work, or who has received express permission from the Licensor to +exercise rights under this License despite a previous violation. + +Publicly Perform means to perform public recitations of the Work and to +communicate to the public those public recitations, by any means or +process, including by wire or wireless means or public digital +performances; to make available to the public Works in such a way that +members of the public may access these Works from a place and at a place +individually chosen by them; to perform the Work to the public by any +means or process and the communication to the public of the performances +of the Work, including by public digital performance; to broadcast and +rebroadcast the Work by any means including signs, sounds or images. + +Reproduce is to make copies of the Work by any means including without +limitation by sound or visual recordings and the right of fixation and +reproducing fixations of the Work, including storage of a protected +performance or phonogram in digital form or other electronic medium. + +Software is any digital Work which, through use of a third-party piece +of Software or through the direct usage of itself on a computer system, +the memory of the computer is modified dynamically or semi-dynamically. +\"Software\", secondly, processes or interprets information. + +Source Code is Any digital Work which, through use of a third-party +piece of Software or through the direct usage of itself on a computer +system, the memory of the computer is modified dynamically or +semi-dynamically. \"Software\", secondly, processes or interprets +information. + +Surveilling is the use of the Work to either overtly or covertly observe +and record persons and or their activities. + +A Network Service is the use of a piece of Software to interpret or +modify information that is subsequently and directly served to users +over the Internet. + +To Discriminate is the use of a piece of Software to interpret or modify +information that is subsequently and directly served to users over the +Internet. + +Hate Speech is Communication or any form of expression which is solely +for the purpose of expressing hatred for some group or advocating a form +of Discrimination between humans. + +Coercion is leveraging of the threat of force or use of force to +intimidate a person in order to gain compliance, or to offer large +incentives which aim to entice a person to act against their will. + +# Fair Dealing Rights + +Nothing in this License is intended to reduce, limit, or restrict any +uses free from copyright or rights arising from limitations or +exceptions that are provided for in connection with the copyright +protection under copyright law or other applicable laws. + +# License Grant + +Subject to the terms and conditions of this License, Licensor hereby +grants You a worldwide, royalty-free, non-exclusive, perpetual (for the +duration of the applicable copyright) license to exercise the rights in +the Work as stated below: + +To Reproduce the Work, to incorporate the Work into one or more +Collections, and to Reproduce the Work as incorporated in the +Collections + +To create and Reproduce Adaptations provided that any such Adaptation, +including any translation in any medium, takes reasonable steps to +clearly label, demarcate or otherwise identify that changes were made to +the original Work. For example, a translation could be marked \"The +original work was translated from English to Spanish,\" or a +modification could indicate \"The original work has been modified.\" + +To Distribute and Publicly Perform the Work including as incorporated in +Collections. + +To Distribute and Publicly Perform Adaptations. The above rights may be +exercised in all media and formats whether now known or hereafter +devised. The above rights include the right to make such modifications +as are technically necessary to exercise the rights in other media and +formats. This License constitutes the entire agreement between the +parties with respect to the Work licensed here. There are no +understandings, agreements or representations with respect to the Work +not specified here. Licensor shall not be bound by any additional +provisions that may appear in any communication from You. This License +may not be modified without the mutual written agreement of the Licensor +and You. All rights not expressly granted by Licensor are hereby +reserved, including but not limited to the rights set forth in +Non-waivable Compulsory License Schemes, Waivable Compulsory License +Schemes, and Voluntary License Schemes in the restrictions. + +# Restrictions + +The license granted in the license grant above is expressly made subject +to and limited by the following restrictions: + +You may Distribute or Publicly Perform the Work only under the terms of +this License. You must include a copy of, or the Uniform Resource +Identifier (URI) for, this License with every copy of the Work You +Distribute or Publicly Perform. You may not offer or impose any terms on +the Work that restrict the terms of this License or the ability of the +recipient of the Work to exercise the rights granted to that recipient +under the terms of the License. You may not sublicense the Work. You +must keep intact all notices that refer to this License and to the +disclaimer of warranties with every copy of the Work You Distribute or +Publicly Perform. When You Distribute or Publicly Perform the Work, You +may not impose any effective technological measures on the Work that +restrict the ability of a recipient of the Work from You to exercise the +rights granted to that recipient under the terms of the License. This +Section applies to the Work as incorporated in a Collection, but this +does not require the Collection apart from the Work itself to be made +subject to the terms of this License. If You create a Collection, upon +notice from any Licensor You must, to the extent practicable, remove +from the Collection any credit as requested. If You create an +Adaptation, upon notice from any Licensor You must, to the extent +practicable, remove from the Adaptation any credit as requested. + +If the Work meets the definition of Software, You may exercise the +rights granted in the license grant only if You provide a copy of the +corresponding Source Code from which the Work was derived in digital +form, or You provide a URI for the corresponding Source Code of the +Work, to any recipients upon request. + +If the Work is used as or for a Network Service, You may exercise the +rights granted in the license grant only if You provide a copy of the +corresponding Source Code from which the Work was derived in digital +form, or You provide a URI for the corresponding Source Code to the +Work, to any recipients of the data served or modified by the Web +Service. + +## + +You may exercise the rights granted in the license grant for any +purposes only if: + +i. You do not use the Work for the purpose of inflicting Bodily Harm on + human beings (subject to criminal prosecution or otherwise) outside + of providing medical aid or undergoing a voluntary procedure under + no form of Coercion. + +ii. You do not use the Work for the purpose of Surveilling or tracking + individuals for financial gain. + +iii. You do not use the Work in an Act of War. + +iv. You do not use the Work for the purpose of supporting or profiting + from an Act of War. + +v. You do not use the Work for the purpose of Incarceration. + +vi. You do not use the Work for the purpose of extracting, processing, + or refining, oil, gas, or coal. Or to in any other way to + deliberately pollute the environment as a byproduct of manufacturing + or irresponsible disposal of hazardous materials. + +vii. You do not use the Work for the purpose of expediting, + coordinating, or facilitating paid work undertaken by individuals + under the age of 12 years. + +viii. You do not use the Work to either Discriminate or spread Hate + Speech on the basis of sex, sexual orientation, gender identity, + race, age, disability, color, national origin, religion, caste, or + lower economic status. + +## + +If You Distribute, or Publicly Perform the Work or any Adaptations or +Collections, You must, unless a request has been made by any Licensor to +remove credit from a Collection or Adaptation, keep intact all copyright +notices for the Work and provide, reasonable to the medium or means You +are utilizing: + +i. the name of the Original Author (or pseudonym, if applicable) if + supplied, and/or if the Original Author and/or Licensor designate + another party or parties (e.g., a sponsor institute, publishing + entity, journal) for attribution (\"Attribution Parties\") in + Licensor\'s copyright notice, terms of service or by other + reasonable means, the name of such party or parties; + +ii. the title of the Work if supplied; + +iii. to the extent reasonably practicable, the URI, if any, that + Licensor to be associated with the Work, unless such URI does not + refer to the copyright notice or licensing information for the + Work; and, + +iv. in the case of an Adaptation, a credit identifying the use of the + Work in the Adaptation (e.g., \"French translation of the Work by + Original Author,\" or \"Screenplay based on original Work by + Original Author\"). + +If any Licensor has sent notice to request removing credit, You must, to +the extent practicable, remove any credit as requested. The credit +required by this Section may be implemented in any reasonable manner; +provided, however, that in the case of an Adaptation or Collection, at a +minimum such credit will appear, if a credit for all contributing +authors of the Adaptation or Collection appears, then as part of these +credits and in a manner at least as prominent as the credits for the +other contributing authors. For the avoidance of doubt, You may only use +the credit required by this Section for the purpose of attribution in +the manner set out above and, by exercising Your rights under this +License, You may not implicitly or explicitly assert or imply any +connection with, sponsorship or endorsement by the Original Author, +Licensor and/or Attribution Parties, as appropriate, of You or Your use +of the Work, without the separate, express prior written permission of +the Original Author, Licensor and/or Attribution Parties. + +Except as otherwise agreed in writing by the Licensor or as may be +otherwise permitted by applicable law, if You Reproduce, Distribute or +Publicly Perform the Work either by itself or as part of any Adaptations +or Collections, You must not distort, mutilate, modify or take other +derogatory action in relation to the Work which would be prejudicial to +the Original Author\'s honor or reputation. Licensor agrees that in +those jurisdictions (e.g. Japan), in which any exercise of the right +granted in the license grant of this License (the right to make +Adaptations) would be deemed to be a distortion, mutilation, +modification or other derogatory action prejudicial to the Original +Author\'s honor and reputation, the Licensor will waive or not assert, +as appropriate, this Section, to the fullest extent permitted by the +applicable national law, to enable You to reasonably exercise Your right +under the license grant of this License (right to make Adaptations) but +not otherwise. + +Do not make any legal claim against anyone accusing the Work, with or +without changes, alone or with other works, of infringing any patent +claim. + +# Representations Warranties and Disclaimer + +UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR +OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY +KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, +INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, +FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF +LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, +WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE +EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. + +# Limitation on Liability + +EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL +LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, +INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF +THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED +OF THE POSSIBILITY OF SUCH DAMAGES. + +# Termination + +This License and the rights granted hereunder will terminate +automatically upon any breach by You of the terms of this License. +Individuals or entities who have received Adaptations or Collections +from You under this License, however, will not have their licenses +terminated provided such individuals or entities remain in full +compliance with those licenses. The Sections on definitions, fair +dealing rights, representations, warranties, and disclaimer, limitation +on liability, termination, and revised license versions will survive any +termination of this License. + +Subject to the above terms and conditions, the license granted here is +perpetual (for the duration of the applicable copyright in the Work). +Notwithstanding the above, Licensor reserves the right to release the +Work under different license terms or to stop distributing the Work at +any time; provided, however that any such election will not serve to +withdraw this License (or any other license that has been, or is +required to be, granted under the terms of this License), and this +License will continue in full force and effect unless terminated as +stated above. + +# Revised License Versions + +This License may receive future revisions in the original spirit of the +license intended to strengthen This License. Each version of This +License has an incrementing version number. + +Unless otherwise specified like in the below subsection The Licensor has +only granted this current version of This License for The Work. In this +case future revisions do not apply. + +The Licensor may specify that the latest available revision of This +License be used for The Work by either explicitly writing so or by +suffixing the License URI with a \"+\" symbol. + +The Licensor may specify that The Work is also available under the terms +of This License\'s current revision as well as specific future +revisions. The Licensor may do this by writing it explicitly or +suffixing the License URI with any additional version numbers each +separated by a comma. + +# Miscellaneous + +Each time You Distribute or Publicly Perform the Work or a Collection, +the Licensor offers to the recipient a license to the Work on the same +terms and conditions as the license granted to You under this License. + +Each time You Distribute or Publicly Perform an Adaptation, Licensor +offers to the recipient a license to the original Work on the same terms +and conditions as the license granted to You under this License. + +If the Work is classified as Software, each time You Distribute or +Publicly Perform an Adaptation, Licensor offers to the recipient a copy +and/or URI of the corresponding Source Code on the same terms and +conditions as the license granted to You under this License. + +If the Work is used as a Network Service, each time You Distribute or +Publicly Perform an Adaptation, or serve data derived from the Software, +the Licensor offers to any recipients of the data a copy and/or URI of +the corresponding Source Code on the same terms and conditions as the +license granted to You under this License. + +If any provision of this License is invalid or unenforceable under +applicable law, it shall not affect the validity or enforceability of +the remainder of the terms of this License, and without further action +by the parties to this agreement, such provision shall be reformed to +the minimum extent necessary to make such provision valid and +enforceable. + +No term or provision of this License shall be deemed waived and no +breach consented to unless such waiver or consent shall be in writing +and signed by the party to be charged with such waiver or consent. + +This License constitutes the entire agreement between the parties with +respect to the Work licensed here. There are no understandings, +agreements or representations with respect to the Work not specified +here. Licensor shall not be bound by any additional provisions that may +appear in any communication from You. This License may not be modified +without the mutual written agreement of the Licensor and You. + +The rights granted under, and the subject matter referenced, in this +License were drafted utilizing the terminology of the Berne Convention +for the Protection of Literary and Artistic Works (as amended on +September 28, 1979), the Rome Convention of 1961, the WIPO Copyright +Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and +the Universal Copyright Convention (as revised on July 24, 1971). These +rights and subject matter take effect in the relevant jurisdiction in +which the License terms are sought to be enforced according to the +corresponding provisions of the implementation of those treaty +provisions in the applicable national law. If the standard suite of +rights granted under applicable copyright law includes additional rights +not granted under this License, such additional rights are deemed to be +included in the License; this License is not intended to restrict the +license of any rights under applicable law. diff --git a/README.md b/README.md new file mode 100644 index 0000000..fac09a1 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# this project might not be actively maintained +but i may change my mind and contributions are welcome + +## how to use +install [wren-cli](https://wren.io/cli/) from [here](https://github.com/wren-lang/wren-cli/releases) +run `wren-cli generator.wren help` to print this: +``` +Usage: (script call) \[options\] \ \ namespace \ +Example: wren_cli generate.wren wood /path/to/mod_files_base/ namespace firstwood secondwood + +Options: + -v --verbose Print the written files + -w --warn Print warnings when files or directories don't exist + +Types: +- wood The vanilla wood family as well as platform and tile variants +- woodvanilla Hardcoded to generate extensions for the vanilla wood types +- variants Block, stairs, slab and platform +- stone Like variants but with wall and stonecutting as well as adding an s to the full block +- single A single block +``` +happy generating! + +## info +- i made this script for own use and thus it is not complete, but additions are very welcome! +- the code is messy and too copy-pastey. i might change this, or if i don't, do it before i do and share the change with me! diff --git a/generator.wren b/generator.wren new file mode 100644 index 0000000..3d97a51 --- /dev/null +++ b/generator.wren @@ -0,0 +1,4057 @@ +import "io" for File, Directory +import "os" for Process + +class Generator { + // path needs to end with a / + static woodType(namespace, name, path, warn, verbose){ + if(!path.endsWith("/")) path = path + "/" + var bspath = path + "assets/" + namespace + "/blockstates/" + var bmpath = path + "assets/" + namespace + "/models/block/" + var impath = path + "assets/" + namespace + "/models/item/" + var lootpath = path + "data/" + namespace + "/loot_tables/blocks/" + var recipepath = path + "data/" + namespace + "/recipes/" + var advpath = path + "data/" + namespace + "/advancements/recipes/" + var btagpath = path + "data/" + namespace + "/tags/blocks/" + var itagpath = path + "data/" + namespace + "/tags/items/" + namespace = namespace + ":" + var nsblock = namespace + "block/" + name + var nsitem = namespace + "item/" + name + var nsid = namespace + name + var pth + if(Directory.exists(bspath)){ + pth = bspath + name + "_button.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = nsblock + "_button" + file.writeBytes("{\"variants\":{\"face=floor,facing=east,powered=false\":{\"model\":\"" + r + "\",\"y\":90},\"face=floor,facing=west,powered=false\":{\"model\":\"" + r + "\",\"y\":270},\"face=floor,facing=south,powered=false\":{\"model\":\"" + r + "\",\"y\":180},\"face=floor,facing=north,powered=false\":{\"model\":\"" + r + "\"},\"face=wall,facing=east,powered=false\":{\"model\":\"" + r + "\",\"uvlock\":true,\"x\":90,\"y\":90},\"face=wall,facing=west,powered=false\":{\"model\":\"" + r + "\",\"uvlock\":true,\"x\":90,\"y\":270},\"face=wall,facing=south,powered=false\":{\"model\":\"" + r + "\",\"uvlock\":true,\"x\":90,\"y\":180},\"face=wall,facing=north,powered=false\":{\"model\":\"" + r + "\",\"uvlock\":true,\"x\":90},\"face=ceiling,facing=east,powered=false\":{\"model\":\"" + r + "\",\"x\":180,\"y\":270},\"face=ceiling,facing=west,powered=false\":{\"model\":\"" + r + "\",\"x\":180,\"y\":90},\"face=ceiling,facing=south,powered=false\":{\"model\":\"" + r + "\",\"x\":180},\"face=ceiling,facing=north,powered=false\":{\"model\":\"" + r + "\",\"x\":180,\"y\":180},\"face=floor,facing=east,powered=true\":{\"model\":\"" + r + "_pressed\",\"y\":90},\"face=floor,facing=west,powered=true\":{\"model\":\"" + r + "_pressed\",\"y\":270},\"face=floor,facing=south,powered=true\":{\"model\":\"" + r + "_pressed\",\"y\":180},\"face=floor,facing=north,powered=true\":{\"model\":\"" + r + "_pressed\"},\"face=wall,facing=east,powered=true\":{\"model\":\"" + r + "_pressed\",\"uvlock\":true,\"x\":90,\"y\":90},\"face=wall,facing=west,powered=true\":{\"model\":\"" + r + "_pressed\",\"uvlock\":true,\"x\":90,\"y\":270},\"face=wall,facing=south,powered=true\":{\"model\":\"" + r + "_pressed\",\"uvlock\":true,\"x\":90,\"y\":180},\"face=wall,facing=north,powered=true\":{\"model\":\"" + r + "_pressed\",\"uvlock\":true,\"x\":90},\"face=ceiling,facing=east,powered=true\":{\"model\":\"" + r + "_pressed\",\"x\":180,\"y\":270},\"face=ceiling,facing=west,powered=true\":{\"model\":\"" + r + "_pressed\",\"x\":180,\"y\":90},\"face=ceiling,facing=south,powered=true\":{\"model\":\"" + r + "_pressed\",\"x\":180},\"face=ceiling,facing=north,powered=true\":{\"model\":\"" + r + "_pressed\",\"x\":180,\"y\":180}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_door.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = nsblock + "_door" + file.writeBytes("{\"variants\":{\"facing=east,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\"},\"facing=south,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\",\"y\":90},\"facing=west,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\",\"y\":180},\"facing=north,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\",\"y\":270},\"facing=east,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\"},\"facing=south,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":90},\"facing=west,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":180},\"facing=north,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":270},\"facing=east,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":90},\"facing=south,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":180},\"facing=west,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":270},\"facing=north,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\"},\"facing=east,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\",\"y\":270},\"facing=south,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\"},\"facing=west,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\",\"y\":90},\"facing=north,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\",\"y\":180},\"facing=east,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\"},\"facing=south,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\",\"y\":90},\"facing=west,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\",\"y\":180},\"facing=north,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\",\"y\":270},\"facing=east,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\"},\"facing=south,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\",\"y\":90},\"facing=west,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\",\"y\":180},\"facing=north,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\",\"y\":270},\"facing=east,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\",\"y\":90},\"facing=south,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\",\"y\":180},\"facing=west,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\",\"y\":270},\"facing=north,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\"},\"facing=east,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\",\"y\":270},\"facing=south,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\"},\"facing=west,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\",\"y\":90},\"facing=north,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\",\"y\":180}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_fence.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = nsblock + "_fence" + file.writeBytes("{\"multipart\":[{\"apply\":{\"model\":\"" + r + "_post\"}},{\"when\":{\"north\":\"true\"},\"apply\":{\"model\":\"" + r + "_side\",\"uvlock\":true}},{\"when\":{\"east\":\"true\"},\"apply\":{\"model\":\"" + r + "_side\",\"y\":90,\"uvlock\":true}},{\"when\":{\"south\":\"true\"},\"apply\":{\"model\":\"" + r + "_side\",\"y\":180,\"uvlock\":true}},{\"when\":{\"west\":\"true\"},\"apply\":{\"model\":\"" + r + "_side\",\"y\":270,\"uvlock\":true}}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_fence_gate.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = nsblock + "_fence_gate" + file.writeBytes("{\"variants\":{\"facing=south,in_wall=false,open=false\":{\"model\":\"" + r + "\",\"uvlock\":true},\"facing=west,in_wall=false,open=false\":{\"model\":\"" + r + "\",\"uvlock\":true,\"y\":90},\"facing=north,in_wall=false,open=false\":{\"model\":\"" + r + "\",\"uvlock\":true,\"y\":180},\"facing=east,in_wall=false,open=false\":{\"model\":\"" + r + "\",\"uvlock\":true,\"y\":270},\"facing=south,in_wall=false,open=true\":{\"model\":\"" + r + "_open\",\"uvlock\":true},\"facing=west,in_wall=false,open=true\":{\"model\":\"" + r + "_open\",\"uvlock\":true,\"y\":90},\"facing=north,in_wall=false,open=true\":{\"model\":\"" + r + "_open\",\"uvlock\":true,\"y\":180},\"facing=east,in_wall=false,open=true\":{\"model\":\"" + r + "_open\",\"uvlock\":true,\"y\":270},\"facing=south,in_wall=true,open=false\":{\"model\":\"" + r + "_wall\",\"uvlock\":true},\"facing=west,in_wall=true,open=false\":{\"model\":\"" + r + "_wall\",\"uvlock\":true,\"y\":90},\"facing=north,in_wall=true,open=false\":{\"model\":\"" + r + "_wall\",\"uvlock\":true,\"y\":180},\"facing=east,in_wall=true,open=false\":{\"model\":\"" + r + "_wall\",\"uvlock\":true,\"y\":270},\"facing=south,in_wall=true,open=true\":{\"model\":\"" + r + "_wall_open\",\"uvlock\":true},\"facing=west,in_wall=true,open=true\":{\"model\":\"" + r + "_wall_open\",\"uvlock\":true,\"y\":90},\"facing=north,in_wall=true,open=true\":{\"model\":\"" + r + "_wall_open\",\"uvlock\":true,\"y\":180},\"facing=east,in_wall=true,open=true\":{\"model\":\"" + r + "_wall_open\",\"uvlock\":true,\"y\":270}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_leaves.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "_leaves\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_log.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = nsblock + "_log" + file.writeBytes("{\"variants\":{\"axis=x\":{\"model\":\"" + r + "\",\"x\":90,\"y\":90},\"axis=y\":{\"model\":\"" + r + "\"},\"axis=z\":{\"model\":\"" + r + "\",\"x\":90}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_planks.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "_planks\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "_platform\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_pressure_plate.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = nsblock + "_pressure_plate" + file.writeBytes("{\"variants\":{\"powered=false\":{\"model\":\"" + r + "\"},\"powered=true\":{\"model\":\"" + r + "_down\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_sapling.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "_sapling\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_sign.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "_sign\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"type=bottom\":{\"model\":\"" + nsblock + "_slab\"},\"type=top\":{\"model\":\"" + nsblock + "_slab_top\"},\"type=double\":{\"model\":\"" + nsblock + "_planks\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = nsblock + "_stairs" + file.writeBytes("{\"variants\":{\"facing=east,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\"},\"facing=east,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\"},\"facing=east,half=bottom,shape=straight\":{\"model\":\"" + r + "\"},\"facing=east,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=south,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\"},\"facing=south,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\"},\"facing=south,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":180,\"uvlock\":true}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_trapdoor.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = nsblock + "_trapdoor" + file.writeBytes("{\"variants\":{\"facing=east,half=bottom,open=false\":{\"model\":\"" + r + "\",\"y\":90},\"facing=east,half=bottom,open=true\":{\"model\":\"" + r + "\",\"x\":270,\"y\":270},\"facing=east,half=top,open=false\":{\"model\":\"" + r + "\",\"x\":180,\"y\":270},\"facing=east,half=top,open=true\":{\"model\":\"" + r + "\",\"x\":90,\"y\":90},\"facing=north,half=bottom,open=false\":{\"model\":\"" + r + "\"},\"facing=north,half=bottom,open=true\":{\"model\":\"" + r + "\",\"x\":270,\"y\":180},\"facing=north,half=top,open=false\":{\"model\":\"" + r + "\",\"x\":180,\"y\":180},\"facing=north,half=top,open=true\":{\"model\":\"" + r + "\",\"x\":90},\"facing=south,half=bottom,open=false\":{\"model\":\"" + r + "\",\"y\":180},\"facing=south,half=bottom,open=true\":{\"model\":\"" + r + "\",\"x\":270},\"facing=south,half=top,open=false\":{\"model\":\"" + r + "\",\"x\":180},\"facing=south,half=top,open=true\":{\"model\":\"" + r + "\",\"x\":90,\"y\":180},\"facing=west,half=bottom,open=false\":{\"model\":\"" + r + "\",\"y\":270},\"facing=west,half=bottom,open=true\":{\"model\":\"" + r + "\",\"x\":270,\"y\":90},\"facing=west,half=top,open=false\":{\"model\":\"" + r + "\",\"x\":180,\"y\":90},\"facing=west,half=top,open=true\":{\"model\":\"" + r + "\",\"x\":90,\"y\":270}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_wall_fence.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = nsblock + "_wall_fence" + file.writeBytes("{\"variants\":{\"north=false,east=false,south=false,west=false\":{\"model\":\"minecraft:block/air\"},\"north=true,east=false,south=false,west=false\":{\"model\":\"" + r + "\"},\"north=false,east=true,south=false,west=false\":{\"model\":\"" + r + "\",\"y\":90},\"north=false,east=false,south=true,west=false\":{\"model\":\"" + r + "\",\"y\":180},\"north=false,east=false,south=false,west=true\":{\"model\":\"" + r + "\",\"y\":270},\"north=true,east=false,south=false,west=true\":{\"model\":\"" + r + "_corner\"},\"north=true,east=true,south=false,west=false\":{\"model\":\"" + r + "_corner\",\"y\":90},\"north=false,east=true,south=true,west=false\":{\"model\":\"" + r + "_corner\",\"y\":180},\"north=false,east=false,south=true,west=true\":{\"model\":\"" + r + "_corner\",\"y\":270},\"north=true,east=false,south=true,west=false\":{\"model\":\"" + r + "_opposite\"},\"north=false,east=true,south=false,west=true\":{\"model\":\"" + r + "_opposite\",\"y\":90},\"north=true,east=true,south=false,west=true\":{\"model\":\"" + r + "_three\"},\"north=true,east=true,south=true,west=false\":{\"model\":\"" + r + "_three\",\"y\":90},\"north=false,east=true,south=true,west=true\":{\"model\":\"" + r + "_three\",\"y\":180},\"north=true,east=false,south=true,west=true\":{\"model\":\"" + r + "_three\",\"y\":270},\"north=true,east=true,south=true,west=true\":{\"model\":\"" + r + "_four\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_wall_hedge.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = nsblock + "_wall_hedge" + file.writeBytes("{\"variants\":{\"north=false,east=false,south=false,west=false\":{\"model\":\"minecraft:block/air\"},\"north=true,east=false,south=false,west=false\":{\"model\":\"" + r + "\"},\"north=false,east=true,south=false,west=false\":{\"model\":\"" + r + "\",\"y\":90,\"uvlock\":true},\"north=false,east=false,south=true,west=false\":{\"model\":\"" + r + "\",\"y\":180,\"uvlock\":true},\"north=false,east=false,south=false,west=true\":{\"model\":\"" + r + "\",\"y\":270,\"uvlock\":true},\"north=true,east=false,south=false,west=true\":{\"model\":\"" + r + "_corner\"},\"north=true,east=true,south=false,west=false\":{\"model\":\"" + r + "_corner\",\"y\":90,\"uvlock\":true},\"north=false,east=true,south=true,west=false\":{\"model\":\"" + r + "_corner\",\"y\":180,\"uvlock\":true},\"north=false,east=false,south=true,west=true\":{\"model\":\"" + r + "_corner\",\"y\":270,\"uvlock\":true},\"north=true,east=false,south=true,west=false\":{\"model\":\"" + r + "_opposite\"},\"north=false,east=true,south=false,west=true\":{\"model\":\"" + r + "_opposite\",\"y\":90,\"uvlock\":true},\"north=true,east=true,south=false,west=true\":{\"model\":\"" + r + "_three\"},\"north=true,east=true,south=true,west=false\":{\"model\":\"" + r + "_three\",\"y\":90,\"uvlock\":true},\"north=false,east=true,south=true,west=true\":{\"model\":\"" + r + "_three\",\"y\":180,\"uvlock\":true},\"north=true,east=false,south=true,west=true\":{\"model\":\"" + r + "_three\",\"y\":270,\"uvlock\":true},\"north=true,east=true,south=true,west=true\":{\"model\":\"" + r + "_four\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_wall_sign.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "_sign\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_wood.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = nsblock + "_wood" + file.writeBytes("{\"variants\":{\"axis=x\":{\"model\":\"" + r + "\",\"x\":90,\"y\":90},\"axis=y\":{\"model\":\"" + r + "\"},\"axis=z\":{\"model\":\"" + r + "\",\"x\":90}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "large_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + namespace + "block/large_" + name + "_tile_platform" + "\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "large_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/large_" + name + "_tile" + file.writeBytes("{\"variants\":{\"type=bottom\":{\"model\":\"" + r + "_slab\"},\"type=top\":{\"model\":\"" + r + "_slab_top\"},\"type=double\":{\"model\":\"" + r + "s\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "large_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/large_" + name + "_tile_stairs" + file.writeBytes("{\"variants\":{\"facing=east,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\"},\"facing=east,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\"},\"facing=east,half=bottom,shape=straight\":{\"model\":\"" + r + "\"},\"facing=east,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=south,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\"},\"facing=south,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\"},\"facing=south,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":180,\"uvlock\":true}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "large_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + namespace + "block/large_" + name + "_tiles" + "\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "potted_" + name + "_sapling.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + namespace + "block/potted_" + name + "_sapling\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "small_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + namespace + "block/small_" + name + "_tile_platform" + "\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "small_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/small_" + name + "_tile" + file.writeBytes("{\"variants\":{\"type=bottom\":{\"model\":\"" + r + "_slab\"},\"type=top\":{\"model\":\"" + r + "_slab_top\"},\"type=double\":{\"model\":\"" + r + "s\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "small_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/small_" + name + "_tile_stairs" + file.writeBytes("{\"variants\":{\"facing=east,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\"},\"facing=east,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\"},\"facing=east,half=bottom,shape=straight\":{\"model\":\"" + r + "\"},\"facing=east,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=south,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\"},\"facing=south,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\"},\"facing=south,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":180,\"uvlock\":true}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "small_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + namespace + "block/small_" + name + "_tiles" + "\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "stripped_" + name + "_log.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/stripped_" + name + "_log" + file.writeBytes("{\"variants\":{\"axis=x\":{\"model\":\"" + r + "\",\"x\":90,\"y\":90},\"axis=y\":{\"model\":\"" + r + "\"},\"axis=z\":{\"model\":\"" + r + "\",\"x\":90}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "stripped_" + name + "_wood.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/stripped_" + name + "_wood" + file.writeBytes("{\"variants\":{\"axis=x\":{\"model\":\"" + r + "\",\"x\":90,\"y\":90},\"axis=y\":{\"model\":\"" + r + "\"},\"axis=z\":{\"model\":\"" + r + "\",\"x\":90}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "windowed_" + name + "_door.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/windowed_" + name + "_door" + file.writeBytes("{\"variants\":{\"facing=east,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\"},\"facing=south,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\",\"y\":90},\"facing=west,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\",\"y\":180},\"facing=north,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\",\"y\":270},\"facing=east,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\"},\"facing=south,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":90},\"facing=west,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":180},\"facing=north,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":270},\"facing=east,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":90},\"facing=south,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":180},\"facing=west,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":270},\"facing=north,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\"},\"facing=east,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\",\"y\":270},\"facing=south,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\"},\"facing=west,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\",\"y\":90},\"facing=north,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\",\"y\":180},\"facing=east,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\"},\"facing=south,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\",\"y\":90},\"facing=west,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\",\"y\":180},\"facing=north,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\",\"y\":270},\"facing=east,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\"},\"facing=south,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\",\"y\":90},\"facing=west,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\",\"y\":180},\"facing=north,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\",\"y\":270},\"facing=east,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\",\"y\":90},\"facing=south,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\",\"y\":180},\"facing=west,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\",\"y\":270},\"facing=north,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\"},\"facing=east,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\",\"y\":270},\"facing=south,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\"},\"facing=west,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\",\"y\":90},\"facing=north,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\",\"y\":180}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(bspath)\"! No block state files will be written.") + if(Directory.exists(bmpath)){ + pth = bmpath + name + "_button.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/button\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_button_pressed.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/button_pressed\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_door_bottom.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/door_bottom\",\"textures\":{\"top\":\"" + nsblock + "_door_top\",\"bottom\":\"" + nsblock + "_door_bottom\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_door_bottom_hinge.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/door_bottom_rh\",\"textures\":{\"top\":\"" + nsblock + "_door_top\",\"bottom\":\"" + nsblock + "_door_bottom\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_door_top.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/door_top\",\"textures\":{\"top\":\"" + nsblock + "_door_top\",\"bottom\":\"" + nsblock + "_door_bottom\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_door_top_hinge.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/door_top_rh\",\"textures\":{\"top\":\"" + nsblock + "_door_top\",\"bottom\":\"" + nsblock + "_door_bottom\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_fence_gate.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/template_fence_gate\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_fence_gate_open.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/template_fence_gate_open\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_fence_gate_wall.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/template_fence_gate_wall\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_fence_gate_wall_open.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/template_fence_gate_wall_open\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_fence_post.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/fence_post\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_fence_side.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/fence_side\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_leaves.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + nsblock + "_leaves\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_log.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/cube_column\",\"textures\":{\"end\":\"" + nsblock + "_log_top\",\"side\":\"" + nsblock + "_log\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_planks.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + nsblock + "_planks\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/platform\",\"textures\":{\"particle\":\"" + nsblock + "_planks\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_pressure_plate.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/pressure_plate_up\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_pressure_plate_down.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/pressure_plate_down\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_sapling.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/cross\",\"textures\":{\"cross\":\"" + nsblock + "_sapling\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_sign.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"textures\":{\"particle\":\"" + namespace + "entity/signs/" + name + "\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/slab\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "_planks\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_slab_top.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/slab_top\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "_planks\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "_planks\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_stairs_inner.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/inner_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "_planks\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_stairs_outer.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/outer_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "_planks\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_trapdoor.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/template_orientable_trapdoor_bottom\",\"textures\":{\"texture\":\"" + nsblock + "_trapdoor\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_fence.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_fence_corner.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence_corner\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_fence_four.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence_four\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_fence_opposite.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence_opposite\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_fence_three.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence_three\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_hedge.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/untinted_wall_hedge\",\"textures\":{\"particle\":\"" + nsblock + "_leaves\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_hedge_corner.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/untinted_wall_hedge_corner\",\"textures\":{\"particle\":\"" + nsblock + "_leaves\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_hedge_four.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/untinted_wall_hedge_four\",\"textures\":{\"particle\":\"" + nsblock + "_leaves\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_hedge_opposite.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/untinted_wall_hedge_opposite\",\"textures\":{\"particle\":\"" + nsblock + "_leaves\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_hedge_three.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/untinted_wall_hedge_three\",\"textures\":{\"particle\":\"" + nsblock + "_leaves\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wood.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + nsblock + "_wood\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "large_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/platform\",\"textures\":{\"particle\":\"" + namespace + "block/large_" + name + "_tiles\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "large_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/slab\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "large_" + name + "_tile_slab_top.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/slab_top\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "large_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "large_" + name + "_tile_stairs_inner.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/inner_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "large_" + name + "_tile_stairs_outer.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/outer_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "large_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + namespace + "block/large_" + name + "_tiles" + "\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "potted_" + name + "_sapling.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/flower_pot_cross\",\"textures\":{\"plant\":\"" + namespace + "block/" + name + "_sapling\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "small_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"particle\":\"" + namespace + "block/small_" + name + "_tiles" + "\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "small_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/slab\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "small_" + name + "_tile_slab_top.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/slab_top\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "small_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "small_" + name + "_tile_stairs_inner.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/inner_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "small_" + name + "_tile_stairs_outer.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/outer_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "small_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + namespace + "block/small_" + name + "_tiles\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "stripped_" + name + "_log.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/stripped_" + name + "_log" + file.writeBytes("{\"parent\":\"minecraft:block/cube_column\",\"textures\":{\"end\":\"" + r + "_top\",\"side\":\"" + r + "\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "stripped_" + name + "_wood.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + namespace + "block/stripped_" + name + "_log\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "windowed_" + name + "_door_bottom.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/windowed_" + name + file.writeBytes("{\"parent\":\"minecraft:block/door_bottom\",\"textures\":{\"top\":\"" + r + "_door_top\",\"bottom\":\"" + r + "_door_bottom\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "windowed_" + name + "_door_bottom_hinge.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/windowed_" + name + file.writeBytes("{\"parent\":\"minecraft:block/door_bottom_rh\",\"textures\":{\"top\":\"" + r + "_door_top\",\"bottom\":\"" + r + "_door_bottom\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "windowed_" + name + "_door_top.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/windowed_" + name + file.writeBytes("{\"parent\":\"minecraft:block/door_top\",\"textures\":{\"top\":\"" + r + "_door_top\",\"bottom\":\"" + r + "_door_bottom\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "windowed_" + name + "_door_top_hinge.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/windowed_" + name + file.writeBytes("{\"parent\":\"minecraft:block/door_top_rh\",\"textures\":{\"top\":\"" + r + "_door_top\",\"bottom\":\"" + r + "_door_bottom\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(bmpath)\"! No block model files will be written.") + if(Directory.exists(impath)){ + pth = impath + name + "_boat.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:item/generated\",\"textures\":{\"layer0\":\"" + nsitem + "_boat\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_button.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/button_inventory\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_door.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:item/generated\",\"textures\":{\"layer0\":\"" + nsitem + "_door\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_fence.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/fence_inventory\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_fence_gate.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_fence_gate\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_leaves.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_leaves\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_log.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_log\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_planks.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_planks\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_platform\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_pressure_plate.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_pressure_plate\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_sapling.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:item/generated\",\"textures\":{\"layer0\":\"" + nsblock + "_sapling\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_sign.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:item/generated\",\"textures\":{\"layer0\":\"" + nsitem + "_sign\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_slab\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_stairs\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_trapdoor.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_trapdoor\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_wall_fence.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_wall_fence\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_wall_hedge.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_wall_hedge\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_wood.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_wood\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "large_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + namespace + "block/large_" + name + "_tile_platform\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "large_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + namespace + "block/large_" + name + "_tile_slab\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "large_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + namespace + "block/large_" + name + "_tile_stairs\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "large_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + namespace + "block/large_" + name + "_tiles\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "small_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + namespace + "block/small_" + name + "_tile_platform\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "small_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + namespace + "block/small_" + name + "_tile_slab\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "small_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + namespace + "block/small_" + name + "_tile_stairs\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "small_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + namespace + "block/small_" + name + "_tiles\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "stripped_" + name + "_log.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + namespace + "block/stripped_" + name + "_log\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "stripped_" + name + "_wood.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + namespace + "block/stripped_" + name + "_wood\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "windowed_" + name + "_door.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:item/generated\",\"textures\":{\"layer0\":\"" + namespace + "item/windowed_" + name + "_door\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(impath)\"! No item model files will be written.") + if(Directory.exists(recipepath)){ + pth = recipepath + name + "_boat.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"boat\",\"pattern\":[\"# #\",\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"}},\"result\":{\"item\":\"" + nsid + "_boat\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_button.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shapeless\",\"group\":\"wooden_button\",\"ingredients\":[{\"item\":\"" + nsid + "_planks\"}],\"result\":{\"item\":\"" + nsid + "_button\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_door.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wooden_door\",\"pattern\":[\"##\",\"##\",\"##\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"}},\"result\":{\"item\":\"" + nsid + "_door\",\"count\":3}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_fence.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wooden_fence\",\"pattern\":[\"#/#\",\"#/#\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"},\"/\":{\"item\":\"minecraft:stick\"}},\"result\":{\"item\":\"" + nsid + "_fence\",\"count\":3}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_fence_gate.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wooden_fence\",\"pattern\":[\"/#/\",\"/#/\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"},\"/\":{\"item\":\"minecraft:stick\"}},\"result\":{\"item\":\"" + nsid + "_fence_gate\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_planks.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shapeless\",\"group\":\"planks\",\"ingredients\":[{\"tag\":\"" + nsid + "_logs\"}],\"result\":{\"item\":\"" + nsid + "_planks\",\"count\":4}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"platform\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_slab\"}},\"result\":{\"item\":\"" + nsid + "_platform\",\"count\":12}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_pressure_plate.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wooden_pressure_plate\",\"pattern\":[\"##\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"}},\"result\":{\"item\":\"" + nsid + "_pressure_plate\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_sign.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"pattern\":[\"###\",\"###\",\" / \"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"},\"/\":{\"item\":\"minecraft:stick\"}},\"result\":{\"item\":\"" + nsid + "_sign\",\"count\":3}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wooden_slab\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"}},\"result\":{\"item\":\"" + nsid + "_slab\",\"count\":6}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wooden_stairs\",\"pattern\":[\"# \",\"## \",\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"}},\"result\":{\"item\":\"" + nsid + "_stairs\",\"count\":4}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_trapdoor.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wooden_trapdoor\",\"pattern\":[\"###\",\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"}},\"result\":{\"item\":\"" + nsid + "_trapdoor\",\"count\":2}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_wall_fence.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wall_fence\",\"pattern\":[\"#/#\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"},\"/\":{\"item\":\"minecraft:stick\"}},\"result\":{\"item\":\"" + nsid + "_wall_fence\",\"count\":6}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_wall_hedge.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wall_hedge\",\"pattern\":[\"# #\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_leaves\"}},\"result\":{\"item\":\"" + nsid + "_wall_hedge\",\"count\":6}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_wood.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"bark\",\"pattern\":[\"##\",\"##\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_log\"}},\"result\":{\"item\":\"" + nsid + "_wood\",\"count\":3}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "large_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tiles\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tiles\",\"count\":4}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "large_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_platform\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "large_" + name + "_tile_slab\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_platform\",\"count\":12}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "large_" + name + "_tile_platform_from_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_platform_from_platform\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_platform\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_platform\",\"count\":4}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "large_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_slab\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "large_" + name + "_tiles\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_slab\",\"count\":6}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "large_" + name + "_tile_slab_from_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_slab_from_slab\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_slab\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_slab\",\"count\":4}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "large_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_stairs\",\"pattern\":[\"# \",\"## \",\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "large_" + name + "_tiles\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_stairs\",\"count\":4}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "large_" + name + "_tile_stairs_from_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_stairs_from_stairs\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_stairs\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_stairs\",\"count\":4}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "small_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"small_wooden_tiles\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"}},\"result\":{\"item\":\"" + namespace + "small_" + name + "_tiles\",\"count\":4}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "small_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"small_wooden_tile_platform\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "small_" + name + "_tile_slab\"}},\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_platform\",\"count\":12}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "small_" + name + "_tile_platform_from_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shapeless\",\"group\":\"small_wooden_tile_platform_from_platform\",\"ingredients\":[{\"item\":\"" + namespace + "large_" + name + "_tile_platform\"}],\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_platform\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "small_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"small_wooden_tile_slab\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "small_" + name + "_tiles\"}},\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_slab\",\"count\":6}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "small_" + name + "_tile_slab_from_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shapeless\",\"group\":\"small_wooden_tile_slab_from_slab\",\"ingredients\":[{\"item\":\"" + namespace + "large_" + name + "_tile_slab\"}],\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_slab\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "small_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"small_wooden_tile_stairs\",\"pattern\":[\"# \",\"## \",\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "small_" + name + "_tiles\"}},\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_stairs\",\"count\":4}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "small_" + name + "_tile_stairs_from_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shapeless\",\"group\":\"small_wooden_tile_slab_from_slab\",\"ingredients\":[{\"item\":\"" + namespace + "large_" + name + "_tile_stairs\"}],\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_stairs\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "stripped_" + name + "_wood.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"bark\",\"pattern\":[\"##\",\"##\"],\"key\":{\"#\":{\"item\":\"" + namespace + "stripped_" + name + "_log\"}},\"result\":{\"item\":\"" + namespace + "stripped_" + name + "_wood\",\"count\":3}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(recipepath)\"! No recipe files will be written.") + if(Directory.exists(lootpath)){ + pth = lootpath + name + "_button.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_button\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_door.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1.0,\"bonus_rolls\":0.0,\"entries\":[{\"type\":\"minecraft:item\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_door\",\"properties\":{\"half\":\"lower\"}}],\"name\":\"" + nsid + "_door\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_fence.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_fence\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_fence_gate.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_fence_gate\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_leaves.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:alternatives\",\"children\":[{\"type\":\"minecraft:item\",\"conditions\":[{\"condition\":\"minecraft:alternative\",\"terms\":[{\"condition\":\"minecraft:match_tool\",\"predicate\":{\"items\":[\"minecraft:shears\"]}},{\"condition\":\"minecraft:match_tool\",\"predicate\":{\"enchantments\":[{\"enchantment\":\"minecraft:silk_touch\",\"levels\":{\"min\":1}}]}}]}],\"name\":\"" + nsid + "_leaves\"},{\"type\":\"minecraft:item\",\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"},{\"condition\":\"minecraft:table_bonus\",\"enchantment\":\"minecraft:fortune\",\"chances\":[0.05,0.0625,0.083333336,0.1]}],\"name\":\"" + nsid + "_sapling\"}]}]},{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"conditions\":[{\"condition\":\"minecraft:table_bonus\",\"enchantment\":\"minecraft:fortune\",\"chances\":[0.02,0.022222223,0.025,0.033333335,0.1]}],\"functions\":[{\"function\":\"minecraft:set_count\",\"count\":{\"type\":\"minecraft:uniform\",\"min\":1,\"max\":2},\"add\":false},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"minecraft:stick\"}],\"conditions\":[{\"condition\":\"minecraft:inverted\",\"term\":{\"condition\":\"minecraft:alternative\",\"terms\":[{\"condition\":\"minecraft:match_tool\",\"predicate\":{\"items\":[\"minecraft:shears\"]}},{\"condition\":\"minecraft:match_tool\",\"predicate\":{\"enchantments\":[{\"enchantment\":\"minecraft:silk_touch\",\"levels\":{\"min\":1}}]}}]}}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_log.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_log\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_planks.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_planks\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_platform\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_pressure_plate.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_pressure_plate\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_sapling.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_sapling\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_sign.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_sign\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_slab\",\"properties\":{\"type\":\"double\"}}],\"count\":2},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + nsid + "_slab\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_stairs\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_trapdoor.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_trapdoor\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_wall_fence.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_fence\",\"properties\":{\"east\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_fence\",\"properties\":{\"west\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_fence\",\"properties\":{\"north\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_fence\",\"properties\":{\"south\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"count\":-1,\"add\":true},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + nsid + "_wall_fence\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_wall_hedge.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_hedge\",\"properties\":{\"east\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_hedge\",\"properties\":{\"west\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_hedge\",\"properties\":{\"north\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_hedge\",\"properties\":{\"south\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"count\":-1,\"add\":true},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + nsid + "_wall_hedge\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_wood.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_wood\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "large_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "large_" + name + "_tile_platform\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "large_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + namespace + "large_" + name + "_tile_slab\",\"properties\":{\"type\":\"double\"}}],\"count\":2},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + namespace + "large_" + name + "_tile_slab\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "large_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "large_" + name + "_tile_stairs\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "large_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "large_" + name + "_tiles\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "potted_" + name + "_sapling.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_sapling\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]},{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"minecraft:flower_pot\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "small_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "small_" + name + "_tile_platform\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "small_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + namespace + "small_" + name + "_tile_slab\",\"properties\":{\"type\":\"double\"}}],\"count\":2},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + namespace + "small_" + name + "_tile_slab\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "small_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "small_" + name + "_tile_stairs\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "small_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "small_" + name + "_tiles\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "stripped_" + name + "_log.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "stripped_" + name + "_log\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "stripped_" + name + "_wood.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "stripped_" + name + "_wood\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "windowed_" + name + "_door.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1.0,\"bonus_rolls\":0.0,\"entries\":[{\"type\":\"minecraft:item\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + namespace + "windowed_" + name + "_door\",\"properties\":{\"half\":\"lower\"}}],\"name\":\"" + namespace + "windowed_" + name + "_door\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(lootpath)\"! No loot table files will be written.") + if(Directory.exists(advpath)){ + pth = advpath + name + "_boat.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_boat\"]},\"criteria\":{\"in_water\":{\"trigger\":\"minecraft:enter_block\",\"conditions\":{\"block\":\"minecraft:water\"}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_boat\"}}},\"requirements\":[[\"in_water\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_button.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_button\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_button\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_door.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_door\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_door\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_fence.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_fence\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_fence\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_fence_gate.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_fence_gate\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_fence_gate\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_planks.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_planks\"]},\"criteria\":{\"has_log\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"tag\":\"" + nsid + "_logs\"}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_planks\"}}},\"requirements\":[[\"has_log\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_platform\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[\"" + nsid + "_slab\"]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_platform\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_pressure_plate.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_pressure_plate\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_pressure_plate\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_sign.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_sign\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_sign\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_slab\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_slab\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_stairs\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_stairs\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_trapdoor.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_trapdoor\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_trapdoor\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_wall_fence.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_wall_fence\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"" + nsid + "_planks\"}]}},\"has_stick\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"minecraft:stick\"}]}},\"has_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_wall_fence\"}}},\"requirements\":[[\"has_planks\",\"has_recipe\"],[\"has_stick\",\"has_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_wall_hedge.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_wall_hedge\"]},\"criteria\":{\"has_item\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"" + nsid + "_leaves\"}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_wall_hedge\"}}},\"requirements\":[[\"has_item\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_wood.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_wood\"]},\"criteria\":{\"has_log\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_log\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_wood\"}}},\"requirements\":[[\"has_log\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "large_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_platform\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tile_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_platform\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "large_" + name + "_tile_platform_from_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_platform_from_platform\"]},\"criteria\":{\"has_platform\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_platform\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_platform_from_platform\"}}},\"requirements\":[[\"has_platform\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "large_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_slab\"]},\"criteria\":{\"has_tiles\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tiles\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_slab\"}}},\"requirements\":[[\"has_tiles\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "large_" + name + "_tile_slab_from_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_slab_from_slab\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_slab_from_slab\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "large_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_stairs\"]},\"criteria\":{\"has_tiles\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tiles\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_stairs\"}}},\"requirements\":[[\"has_tiles\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "large_" + name + "_tile_stairs_from_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_stairs_from_stairs\"]},\"criteria\":{\"has_stairs\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_stairs\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_stairs_from_stairs\"}}},\"requirements\":[[\"has_stairs\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "large_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tiles\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tiles\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "small_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_platform\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "small_" + name + "_tile_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_platform\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "small_" + name + "_tile_platform_from_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_platform_from_platform\"]},\"criteria\":{\"has_platform\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tile_platform\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_platform_from_platform\"}}},\"requirements\":[[\"has_platform\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "small_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_slab\"]},\"criteria\":{\"has_tiles\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "small_" + name + "_tiles\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_slab\"}}},\"requirements\":[[\"has_tiles\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "small_" + name + "_tile_slab_from_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_slab_from_slab\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tile_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_slab_from_slab\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "small_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_stairs\"]},\"criteria\":{\"has_tiles\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "small_" + name + "_tiles\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_stairs\"}}},\"requirements\":[[\"has_tiles\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "small_" + name + "_tile_stairs_from_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_stairs_from_stairs\"]},\"criteria\":{\"has_stairs\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tile_stairs\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_stairs_from_stairs\"}}},\"requirements\":[[\"has_stairs\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "small_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tiles\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tiles\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "stripped_" + name + "_wood.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "stripped_" + name + "_wood\"]},\"criteria\":{\"has_log\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "stripped_" + name + "_log\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "stripped_" + name + "_wood\"}}},\"requirements\":[[\"has_log\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "windowed_" + name + "_door.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "windowed_" + name + "_door\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"" + nsid + "_planks\"}]}},\"has_glass_pane\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"minecraft:glass_pane\"}]}},\"has_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "windowed_" + name + "_door\"}}},\"requirements\":[[\"has_planks\",\"has_recipe\"],[\"has_glass_pane\",\"has_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(advpath)\"! No recipe advancement files will be written.") + if(Directory.exists(btagpath)){ + pth = advpath + name + "_logs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"replace\":false,\"values\":[\"" + nsid + "_log\",\"" + nsid + "_wood\",\"" + namespace + "stripped_" + name + "_log\",\"" + namespace + "stripped_" + name + "_wood\"]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(btagpath)\"! No recipe advancement files will be written.") + if(Directory.exists(itagpath)){ + pth = advpath + name + "_logs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"replace\":false,\"values\":[\"" + nsid + "_log\",\"" + nsid + "_wood\",\"" + namespace + "stripped_" + name + "_log\",\"" + namespace + "stripped_" + name + "_wood\"]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(itagpath)\"! No recipe advancement files will be written.") + } + static woodVanillaAdditions(namespace, path, warn, verbose){ + if(!path.endsWith("/")) path = path + "/" + var bspath = path + "assets/" + namespace + "/blockstates/" + var bmpath = path + "assets/" + namespace + "/models/block/" + var impath = path + "assets/" + namespace + "/models/item/" + var lootpath = path + "data/" + namespace + "/loot_tables/blocks/" + var recipepath = path + "data/" + namespace + "/recipes/" + var advpath = path + "data/" + namespace + "/advancements/recipes/" + namespace = namespace + ":" + var nsblock = namespace + "block/" + name + var nsitem = namespace + "item/" + name + var nsid = namespace + name + var pth + for(name in ["acacia", "birch", "dark_oak", "jungle", "oak", "spruce"]){ + if(Directory.exists(bspath)){ + pth = bspath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "_platform\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_wall_fence.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = nsblock + "_wall_fence" + file.writeBytes("{\"variants\":{\"north=true,east=false,south=false,west=false\":{\"model\":\"" + r + "\"},\"north=false,east=true,south=false,west=false\":{\"model\":\"" + r + "\",\"y\":90},\"north=false,east=false,south=true,west=false\":{\"model\":\"" + r + "\",\"y\":180},\"north=false,east=false,south=false,west=true\":{\"model\":\"" + r + "\",\"y\":270},\"north=true,east=false,south=false,west=true\":{\"model\":\"" + r + "_corner\"},\"north=true,east=true,south=false,west=false\":{\"model\":\"" + r + "_corner\",\"y\":90},\"north=false,east=true,south=true,west=false\":{\"model\":\"" + r + "_corner\",\"y\":180},\"north=false,east=false,south=true,west=true\":{\"model\":\"" + r + "_corner\",\"y\":270},\"north=true,east=false,south=true,west=false\":{\"model\":\"" + r + "_opposite\"},\"north=false,east=true,south=false,west=true\":{\"model\":\"" + r + "_opposite\",\"y\":90},\"north=true,east=true,south=false,west=true\":{\"model\":\"" + r + "_three\"},\"north=true,east=true,south=true,west=false\":{\"model\":\"" + r + "_three\",\"y\":90},\"north=false,east=true,south=true,west=true\":{\"model\":\"" + r + "_three\",\"y\":180},\"north=true,east=false,south=true,west=true\":{\"model\":\"" + r + "_three\",\"y\":270},\"north=true,east=true,south=true,west=true\":{\"model\":\"" + r + "_four\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_wall_hedge.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = nsblock + "_wall_hedge" + file.writeBytes("{\"variants\":{\"north=true,east=false,south=false,west=false\":{\"model\":\"" + r + "\"},\"north=false,east=true,south=false,west=false\":{\"model\":\"" + r + "\",\"y\":90,\"uvlock\":true},\"north=false,east=false,south=true,west=false\":{\"model\":\"" + r + "\",\"y\":180,\"uvlock\":true},\"north=false,east=false,south=false,west=true\":{\"model\":\"" + r + "\",\"y\":270,\"uvlock\":true},\"north=true,east=false,south=false,west=true\":{\"model\":\"" + r + "_corner\"},\"north=true,east=true,south=false,west=false\":{\"model\":\"" + r + "_corner\",\"y\":90,\"uvlock\":true},\"north=false,east=true,south=true,west=false\":{\"model\":\"" + r + "_corner\",\"y\":180,\"uvlock\":true},\"north=false,east=false,south=true,west=true\":{\"model\":\"" + r + "_corner\",\"y\":270,\"uvlock\":true},\"north=true,east=false,south=true,west=false\":{\"model\":\"" + r + "_opposite\"},\"north=false,east=true,south=false,west=true\":{\"model\":\"" + r + "_opposite\",\"y\":90,\"uvlock\":true},\"north=true,east=true,south=false,west=true\":{\"model\":\"" + r + "_three\"},\"north=true,east=true,south=true,west=false\":{\"model\":\"" + r + "_three\",\"y\":90,\"uvlock\":true},\"north=false,east=true,south=true,west=true\":{\"model\":\"" + r + "_three\",\"y\":180,\"uvlock\":true},\"north=true,east=false,south=true,west=true\":{\"model\":\"" + r + "_three\",\"y\":270,\"uvlock\":true},\"north=true,east=true,south=true,west=true\":{\"model\":\"" + r + "_four\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "large_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + namespace + "block/large_" + name + "_tile_platform" + "\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "large_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/large_" + name + "_tile" + file.writeBytes("{\"variants\":{\"type=bottom\":{\"model\":\"" + r + "_slab\"},\"type=top\":{\"model\":\"" + r + "_slab_top\"},\"type=double\":{\"model\":\"" + r + "s\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "large_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/large_" + name + "_tile_stairs" + file.writeBytes("{\"variants\":{\"facing=east,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\"},\"facing=east,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\"},\"facing=east,half=bottom,shape=straight\":{\"model\":\"" + r + "\"},\"facing=east,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=south,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\"},\"facing=south,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\"},\"facing=south,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":180,\"uvlock\":true}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "large_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + namespace + "block/large_" + name + "_tiles" + "\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "small_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + namespace + "block/small_" + name + "_tile_platform" + "\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "small_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/small_" + name + "_tile" + file.writeBytes("{\"variants\":{\"type=bottom\":{\"model\":\"" + r + "_slab\"},\"type=top\":{\"model\":\"" + r + "_slab_top\"},\"type=double\":{\"model\":\"" + r + "s\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "small_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/small_" + name + "_tile_stairs" + file.writeBytes("{\"variants\":{\"facing=east,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\"},\"facing=east,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\"},\"facing=east,half=bottom,shape=straight\":{\"model\":\"" + r + "\"},\"facing=east,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=south,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\"},\"facing=south,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\"},\"facing=south,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":180,\"uvlock\":true}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "small_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + namespace + "block/small_" + name + "_tiles" + "\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + "windowed_" + name + "_door.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/windowed_" + name + "_door" + file.writeBytes("{\"variants\":{\"facing=east,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\"},\"facing=south,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\",\"y\":90},\"facing=west,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\",\"y\":180},\"facing=north,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\",\"y\":270},\"facing=east,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\"},\"facing=south,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":90},\"facing=west,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":180},\"facing=north,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":270},\"facing=east,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":90},\"facing=south,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":180},\"facing=west,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":270},\"facing=north,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\"},\"facing=east,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\",\"y\":270},\"facing=south,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\"},\"facing=west,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\",\"y\":90},\"facing=north,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\",\"y\":180},\"facing=east,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\"},\"facing=south,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\",\"y\":90},\"facing=west,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\",\"y\":180},\"facing=north,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\",\"y\":270},\"facing=east,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\"},\"facing=south,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\",\"y\":90},\"facing=west,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\",\"y\":180},\"facing=north,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\",\"y\":270},\"facing=east,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\",\"y\":90},\"facing=south,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\",\"y\":180},\"facing=west,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\",\"y\":270},\"facing=north,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\"},\"facing=east,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\",\"y\":270},\"facing=south,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\"},\"facing=west,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\",\"y\":90},\"facing=north,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\",\"y\":180}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(bspath)\"! No block state files will be written.") + if(Directory.exists(bmpath)){ + pth = bmpath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/platform\",\"textures\":{\"particle\":\"minecraft:block/" + name + "_planks\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_fence.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_fence_corner.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence_corner\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_fence_four.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence_four\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_fence_opposite.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence_opposite\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_fence_three.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence_three\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_hedge.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/wall_hedge\",\"textures\":{\"particle\":\"minecraft:block/" + name + "_leaves\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_hedge_corner.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/wall_hedge_corner\",\"textures\":{\"particle\":\"minecraft:block/" + name + "_leaves\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_hedge_four.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/wall_hedge_four\",\"textures\":{\"particle\":\"minecraft:block/" + name + "_leaves\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_hedge_opposite.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/wall_hedge_opposite\",\"textures\":{\"particle\":\"minecraft:block/" + name + "_leaves\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_hedge_three.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/wall_hedge_three\",\"textures\":{\"particle\":\"minecraft:block/" + name + "_leaves\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "large_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/platform\",\"textures\":{\"particle\":\"" + namespace + "block/large_" + name + "_tiles\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "large_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/slab\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "large_" + name + "_tile_slab_top.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/slab_top\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "large_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "large_" + name + "_tile_stairs_inner.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/inner_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "large_" + name + "_tile_stairs_outer.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/outer_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "large_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + namespace + "block/large_" + name + "_tiles" + "\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "small_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"particle\":\"" + namespace + "block/small_" + name + "_tiles" + "\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "small_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/slab\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "small_" + name + "_tile_slab_top.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/slab_top\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "small_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "small_" + name + "_tile_stairs_inner.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/inner_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "small_" + name + "_tile_stairs_outer.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/outer_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "small_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + namespace + "block/small_" + name + "_tiles\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "windowed_" + name + "_door_bottom.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/windowed_" + name + file.writeBytes("{\"parent\":\"minecraft:block/door_bottom\",\"textures\":{\"top\":\"" + r + "_door_top\",\"bottom\":\"" + r + "_door_bottom\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "windowed_" + name + "_door_bottom_hinge.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/windowed_" + name + file.writeBytes("{\"parent\":\"minecraft:block/door_bottom_rh\",\"textures\":{\"top\":\"" + r + "door_top\",\"bottom\":\"" + r + "_door_bottom\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "windowed_" + name + "_door_top.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/windowed_" + name + file.writeBytes("{\"parent\":\"minecraft:block/door_top\",\"textures\":{\"top\":\"" + r + "door_top\",\"bottom\":\"" + r + "_door_bottom\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + "windowed_" + name + "_door_top_hinge.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = namespace + "block/windowed_" + name + file.writeBytes("{\"parent\":\"minecraft:block/door_top_rh\",\"textures\":{\"top\":\"" + r + "door_top\",\"bottom\":\"" + r + "_door_bottom\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(bmpath)\"! No block model files will be written.") + if(Directory.exists(impath)){ + pth = impath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_platform\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_wall_fence.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_wall_fence\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_wall_hedge.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_wall_hedge\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "large_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + namespace + "block/large_" + name + "_tile_platform\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "large_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + namespace + "block/large_" + name + "_tile_slab\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "large_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + namespace + "block/large_" + name + "_tile_stairs\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "large_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + namespace + "block/large_" + name + "_tiles\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "small_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + namespace + "block/small_" + name + "_tile_platform\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "small_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + namespace + "block/small_" + name + "_tile_slab\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "small_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + namespace + "block/small_" + name + "_tile_stairs\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "small_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + namespace + "block/small_" + name + "_tiles\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + "windowed_" + name + "_door.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:item/generated\",\"textures\":{\"layer0\":\"" + namespace + "item/windowed_" + name + "_door\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(impath)\"! No item model files will be written.") + if(Directory.exists(recipepath)){ + pth = recipepath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"platform\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"minecraft:" + name + "_slab\"}},\"result\":{\"item\":\"" + nsid + "_platform\",\"count\":12}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_wall_fence.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wall_fence\",\"pattern\":[\"#/#\"],\"key\":{\"#\":{\"item\":\"minecraft:" + name + "_planks\"},\"/\":{\"item\":\"minecraft:stick\"}},\"result\":{\"item\":\"" + nsid + "_wall_fence\",\"count\":6}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_wall_hedge.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wall_hedge\",\"pattern\":[\"# #\"],\"key\":{\"#\":{\"item\":\"minecraft:" + name + "_leaves\"}},\"result\":{\"item\":\"" + nsid + "_wall_hedge\",\"count\":6}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "large_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tiles\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"minecraft:" + name + "_planks\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tiles\",\"count\":4}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "large_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_platform\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "large_" + name + "_tile_slab\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_platform\",\"count\":12}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "large_" + name + "_tile_platform_from_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_platform_from_platform\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_platform\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_platform\",\"count\":4}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "large_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_slab\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "large_" + name + "_tiles\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_slab\",\"count\":6}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "large_" + name + "_tile_slab_from_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_slab_from_slab\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"minecraft:" + name + "_slab\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_slab\",\"count\":4}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "large_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_stairs\",\"pattern\":[\"# \",\"## \",\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "large_" + name + "_tiles\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_stairs\",\"count\":4}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "large_" + name + "_tile_stairs_from_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_stairs_from_stairs\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"minecraft:" + name + "_stairs\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_stairs\",\"count\":4}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "small_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"small_wooden_tiles\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"minecraft:" + name + "_planks\"}},\"result\":{\"item\":\"" + namespace + "small_" + name + "_tiles\",\"count\":4}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "small_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"small_wooden_tile_platform\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "small_" + name + "_tile_slab\"}},\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_platform\",\"count\":12}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "small_" + name + "_tile_platform_from_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shapeless\",\"group\":\"small_wooden_tile_platform_from_platform\",\"ingredients\":[{\"item\":\"" + namespace + "large_" + name + "_tile_platform\"}],\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_platform\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "small_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"small_wooden_tile_slab\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "small_" + name + "_tiles\"}},\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_slab\",\"count\":6}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "small_" + name + "_tile_slab_from_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shapeless\",\"group\":\"small_wooden_tile_slab_from_slab\",\"ingredients\":[{\"item\":\"" + namespace + "large_" + name + "_tile_slab\"}],\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_slab\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "small_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"small_wooden_tile_stairs\",\"pattern\":[\"# \",\"## \",\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "small_" + name + "_tiles\"}},\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_stairs\",\"count\":4}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + "small_" + name + "_tile_stairs_from_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shapeless\",\"group\":\"small_wooden_tile_slab_from_slab\",\"ingredients\":[{\"item\":\"" + namespace + "large_" + name + "_tile_stairs\"}],\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_stairs\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(recipepath)\"! No recipe files will be written.") + if(Directory.exists(lootpath)){ + pth = lootpath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_platform\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_wall_fence.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_fence\",\"properties\":{\"east\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_fence\",\"properties\":{\"west\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_fence\",\"properties\":{\"north\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_fence\",\"properties\":{\"south\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"count\":-1,\"add\":true},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + nsid + "_wall_fence\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_wall_hedge.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_hedge\",\"properties\":{\"east\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_hedge\",\"properties\":{\"west\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_hedge\",\"properties\":{\"north\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_hedge\",\"properties\":{\"south\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"count\":-1,\"add\":true},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + nsid + "_wall_hedge\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "large_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "large_" + name + "_tile_platform\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "large_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + namespace + "large_" + name + "_slab\",\"properties\":{\"type\":\"double\"}}],\"count\":2},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + namespace + "large_" + name + "_slab\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "large_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "large_" + name + "_tile_stairs\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "large_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "large_" + name + "_tile\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "small_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "small_" + name + "_tile_platform\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "small_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + namespace + "small_" + name + "_slab\",\"properties\":{\"type\":\"double\"}}],\"count\":2},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + namespace + "small_" + name + "_slab\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "small_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "small_" + name + "_tile_stairs\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "small_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "small_" + name + "_tile\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + "windowed_" + name + "_door.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1.0,\"bonus_rolls\":0.0,\"entries\":[{\"type\":\"minecraft:item\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + namespace + "windowed_" + name + "_door\",\"properties\":{\"half\":\"lower\"}}],\"name\":\"" + namespace + "windowed_" + name + "_door\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(lootpath)\"! No loot table files will be written.") + if(Directory.exists(advpath)){ + pth = advpath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_platform\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[\"minecraft:" + name + "_slab\"]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_platform\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_wall_fence.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_wall_fence\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"minecraft:" + name + "_planks\"}]}},\"has_stick\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"minecraft:stick\"}]}},\"has_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_wall_fence\"}}},\"requirements\":[[\"has_planks\",\"has_recipe\"],[\"has_stick\",\"has_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_wall_hedge.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_wall_hedge\"]},\"criteria\":{\"has_item\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"minecraft:" + name + "_leaves\"}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_wall_hedge\"}}},\"requirements\":[[\"has_item\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "large_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_platform\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tile_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_platform\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "large_" + name + "_tile_platform_from_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_platform_from_platform\"]},\"criteria\":{\"has_platform\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_platform\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_platform_from_platform\"}}},\"requirements\":[[\"has_platform\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "large_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_slab\"]},\"criteria\":{\"has_tiles\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tiles\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_slab\"}}},\"requirements\":[[\"has_tiles\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "large_" + name + "_tile_slab_from_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_slab_from_slab\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"minecraft:" + name + "_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_slab_from_slab\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "large_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_stairs\"]},\"criteria\":{\"has_tiles\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tiles\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_stairs\"}}},\"requirements\":[[\"has_tiles\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "large_" + name + "_tile_stairs_from_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_stairs_from_stairs\"]},\"criteria\":{\"has_stairs\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"minecraft:" + name + "_stairs\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_stairs_from_stairs\"}}},\"requirements\":[[\"has_stairs\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "large_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tiles\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"minecraft:" + name + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tiles\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "small_" + name + "_tile_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_platform\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "small_" + name + "_tile_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_platform\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "small_" + name + "_tile_platform_from_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_platform_from_platform\"]},\"criteria\":{\"has_platform\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tile_platform\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_platform_from_platform\"}}},\"requirements\":[[\"has_platform\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "small_" + name + "_tile_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_slab\"]},\"criteria\":{\"has_tiles\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "small_" + name + "_tiles\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_slab\"}}},\"requirements\":[[\"has_tiles\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "small_" + name + "_tile_slab_from_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_slab_from_slab\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tile_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_slab_from_slab\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "small_" + name + "_tile_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_stairs\"]},\"criteria\":{\"has_tiles\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "small_" + name + "_tiles\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_stairs\"}}},\"requirements\":[[\"has_tiles\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "small_" + name + "_tile_stairs_from_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_stairs_from_stairs\"]},\"criteria\":{\"has_stairs\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tile_stairs\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_stairs_from_stairs\"}}},\"requirements\":[[\"has_stairs\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "small_" + name + "_tiles.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tiles\"]},\"criteria\":{\"has_tiles\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tiles\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tiles\"}}},\"requirements\":[[\"has_tiles\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + "windowed_" + name + "_door.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "windowed_" + name + "_door\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"" + nsid + "_planks\"}]}},\"has_glass_pane\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"minecraft:glass_pane\"}]}},\"has_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "windowed_" + name + "_door\"}}},\"requirements\":[[\"has_planks\",\"has_recipe\"],[\"has_glass_pane\",\"has_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(advpath)\"! No recipe advancement files will be written.") + } + } + static woodTags(namespace, names, path, warn, verbose){ + if(!path.endsWith("/")) path = path + "/" + var btagpath = path + "data/minecraft/tags/blocks/" + var itagpath = path + "data/minecraft/tags/items/" + var embtagpath = path + "data/ellas_mod/tags/blocks/" + var emitagpath = path + "data/ellas_mod/tags/items/" + var start = "{\"replace\":false,\"values\":[\"" + var end = "\"]}" + var ids = [] + var pth + for(name in names){ + if(name.contains(":")){ + ids.add(name) + } else { + ids.add(namespace + ":" + name) + } + } + if(Directory.exists(btagpath)){ + pth = btagpath + "fence_gates.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_fence_gate\",\"") + "_fence_gate" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = btagpath + "flower_pots.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var notfirst = false + var result = start + for(name in names){ + if(notfirst) result = result + ",\"" + notfirst = true + result = result + namespace + ":potted_" + name + "_sapling\"" + } + var file = File.create(pth) + file.writeBytes(result + "]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = btagpath + "leaves.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_leaves\",\"") + "_leaves" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = btagpath + "logs_that_burn.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + "#" + ids.join("_logs\",\"#") + "_logs" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = btagpath + "planks.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_planks\",\"") + "_planks" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = btagpath + "saplings.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_sapling\",\"") + "_sapling" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = btagpath + "standing_signs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_sign\",\"") + "_sign" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = btagpath + "wall_signs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_wall_sign\",\"") + "_wall_sign" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = btagpath + "wooden_buttons.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_button\",\"") + "_button" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = btagpath + "wooden_doors.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var result = start + ids.join("_door\",\"") + "_door\"" + names.each {|name| + result = result + ",\"" + namespace + ":windowed_" + name + "_door\"" + } + var file = File.create(pth) + file.writeBytes(result + "]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = btagpath + "wooden_fences.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_fence\",\"") + "_fence" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = btagpath + "wooden_pressure_plates.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_pressure_plate\",\"") + "_pressure_plate" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = btagpath + "wooden_slabs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_slab\",\"") + "_slab" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = btagpath + "wooden_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_stairs\",\"") + "_stairs" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = btagpath + "wooden_trapdoors.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_trapdoor\",\"") + "_trapdoor" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(btagpath)\"! No recipe advancement files will be written.") + if(Directory.exists(itagpath)){ + pth = itagpath + "boats.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_boat\",\"") + "_boat" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + /*pth = btagpath + "fence_gates.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_fence_gate\",\"") + "_fence_gate" + end) + file.close() + if(verbose) System.print("Writing " + pth) + }*/ + pth = itagpath + "leaves.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_leaves\",\"") + "_leaves" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = itagpath + "logs_that_burn.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_log\",\"") + "_log" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = itagpath + "planks.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_planks\",\"") + "_planks" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = itagpath + "saplings.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_sapling\",\"") + "_sapling" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = itagpath + "signs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_sign\",\"") + "_sign" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = itagpath + "wooden_buttons.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_button\",\"") + "_button" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = itagpath + "wooden_doors.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var result = start + ids.join("_door\",\"") + "_door\"" + names.each {|name| + result = result + ",\"" + namespace + ":windowed_" + name + "_door\"" + } + var file = File.create(pth) + file.writeBytes(result + "]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = itagpath + "wooden_fences.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_fence\",\"") + "_fence" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = itagpath + "wooden_pressure_plates.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_pressure_plate\",\"") + "_pressure_plate" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = itagpath + "wooden_slabs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_slab\",\"") + "_slab" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = itagpath + "wooden_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_stairs\",\"") + "_stairs" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = itagpath + "wooden_trapdoors.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_trapdoor\",\"") + "_trapdoor" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(itagpath)\"! No recipe advancement files will be written.") + if(Directory.exists(embtagpath)){ + pth = embtagpath + "wooden_platforms.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_platform\",\"") + "_platform" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = embtagpath + "wall_fences.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_wall_fence\",\"") + "_wall_fence" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = embtagpath + "wall_hedges.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_wall_hedge\",\"") + "_wall_hedge" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(embtagpath)\"! No recipe advancement files will be written.") + if(Directory.exists(emitagpath)){ + pth = emitagpath + "wooden_platforms.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_platform\",\"") + "_platform" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = emitagpath + "wall_fences.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_wall_fence\",\"") + "_wall_fence" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = emitagpath + "wall_hedges.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes(start + ids.join("_wall_hedge\",\"") + "_wall_hedge" + end) + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(emitagpath)\"! No recipe advancement files will be written.") + } + static blockWithBasicVariants(namespace, name, path, warn, verbose){ + if(!path.endsWith("/")) path = path + "/" + var bspath = path + "assets/" + namespace + "/blockstates/" + var bmpath = path + "assets/" + namespace + "/models/block/" + var impath = path + "assets/" + namespace + "/models/item/" + var lootpath = path + "data/" + namespace + "/loot_tables/blocks/" + var recipepath = path + "data/" + namespace + "/recipes/" + var advpath = path + "data/" + namespace + "/advancements/recipes/" + namespace = namespace + ":" + var nsblock = namespace + "block/" + name + var nsitem = namespace + "item/" + name + var nsid = namespace + name + var pth + if(Directory.exists(bspath)){ + pth = bspath + name + ".json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "_platform\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"type=bottom\":{\"model\":\"" + nsblock + "_slab\"},\"type=top\":{\"model\":\"" + nsblock + "_slab_top\"},\"type=double\":{\"model\":\"" + nsblock + "\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = nsblock + "_stairs" + file.writeBytes("{\"variants\":{\"facing=east,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\"},\"facing=east,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\"},\"facing=east,half=bottom,shape=straight\":{\"model\":\"" + r + "\"},\"facing=east,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=south,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\"},\"facing=south,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\"},\"facing=south,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":180,\"uvlock\":true}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(bspath)\"! No block state files will be written.") + if(Directory.exists(bmpath)){ + pth = bmpath + name + ".json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + nsblock + "\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/platform\",\"textures\":{\"particle\":\"" + nsblock + "\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/slab\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_slab_top.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/slab_top\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_stairs_inner.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/inner_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_stairs_outer.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/outer_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(bmpath)\"! No block model files will be written.") + if(Directory.exists(impath)){ + pth = impath + name + ".json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_platform\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_slab\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_stairs\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(impath)\"! No item model files will be written.") + if(Directory.exists(recipepath)){ + pth = recipepath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_slab\"}},\"result\":{\"item\":\"" + nsid + "_platform\",\"count\":12}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "\"}},\"result\":{\"item\":\"" + nsid + "_slab\",\"count\":6}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"pattern\":[\"# \",\"## \",\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "\"}},\"result\":{\"item\":\"" + nsid + "_stairs\",\"count\":4}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(recipepath)\"! No recipe files will be written.") + if(Directory.exists(lootpath)){ + pth = lootpath + name + ".json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_platform\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_slab\",\"properties\":{\"type\":\"double\"}}],\"count\":2},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + nsid + "_slab\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_stairs\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(lootpath)\"! No loot table files will be written.") + if(Directory.exists(advpath)){ + pth = advpath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_platform\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_platform\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_slab\"]},\"criteria\":{\"has_block\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_slab\"}}},\"requirements\":[[\"has_block\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_stairs\"]},\"criteria\":{\"has_block\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_stairs\"}}},\"requirements\":[[\"has_block\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(advpath)\"! No recipe advancement files will be written.") + } + static stoneWithBasicVariantsS(namespace, name, path, warn, verbose){ + if(!path.endsWith("/")) path = path + "/" + var bspath = path + "assets/" + namespace + "/blockstates/" + var bmpath = path + "assets/" + namespace + "/models/block/" + var impath = path + "assets/" + namespace + "/models/item/" + var lootpath = path + "data/" + namespace + "/loot_tables/blocks/" + var recipepath = path + "data/" + namespace + "/recipes/" + var advpath = path + "data/" + namespace + "/advancements/recipes/" + namespace = namespace + ":" + var nsblock = namespace + "block/" + name + var nsitem = namespace + "item/" + name + var nsid = namespace + name + var pth + if(Directory.exists(bspath)){ + pth = bspath + name + "s.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "s\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "_platform\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"type=bottom\":{\"model\":\"" + nsblock + "_slab\"},\"type=top\":{\"model\":\"" + nsblock + "_slab_top\"},\"type=double\":{\"model\":\"" + nsblock + "s\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + var r = nsblock + "_stairs" + file.writeBytes("{\"variants\":{\"facing=east,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\"},\"facing=east,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\"},\"facing=east,half=bottom,shape=straight\":{\"model\":\"" + r + "\"},\"facing=east,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=south,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\"},\"facing=south,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\"},\"facing=south,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":180,\"uvlock\":true}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bspath + name + "_wall.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"multipart\":[{\"when\":{\"up\":\"true\"},\"apply\":{\"model\":\"" + nsblock + "_wall_post\"}},{\"when\":{\"north\":\"low\"},\"apply\":{\"model\":\"" + nsblock + "_wall_side\",\"uvlock\":true}},{\"when\":{\"east\":\"low\"},\"apply\":{\"model\":\"" + nsblock + "_wall_side\",\"y\":90,\"uvlock\":true}},{\"when\":{\"south\":\"low\"},\"apply\":{\"model\":\"" + nsblock + "_wall_side\",\"y\":180,\"uvlock\":true}},{\"when\":{\"west\":\"low\"},\"apply\":{\"model\":\"" + nsblock + "_wall_side\",\"y\":270,\"uvlock\":true}},{\"when\":{\"north\":\"tall\"},\"apply\":{\"model\":\"" + nsblock + "_wall_side_tall\",\"uvlock\":true}},{\"when\":{\"east\":\"tall\"},\"apply\":{\"model\":\"" + nsblock + "_wall_side_tall\",\"y\":90,\"uvlock\":true}},{\"when\":{\"south\":\"tall\"},\"apply\":{\"model\":\"" + nsblock + "_wall_side_tall\",\"y\":180,\"uvlock\":true}},{\"when\":{\"west\":\"tall\"},\"apply\":{\"model\":\"" + nsblock + "_wall_side_tall\",\"y\":270,\"uvlock\":true}}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(bspath)\"! No block state files will be written.") + if(Directory.exists(bmpath)){ + pth = bmpath + name + "s.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + nsblock + "s\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"ellas_mod:block/platform\",\"textures\":{\"particle\":\"" + nsblock + "s\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/slab\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "s\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_slab_top.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/slab_top\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "s\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "s\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_stairs_inner.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/inner_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "s\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_stairs_outer.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/outer_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "s\",\"side\":\"#top\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_post.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/template_wall_post\",\"textures\":{\"wall\":\"" + nsblock + "s\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_side.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/template_wall_side\",\"textures\":{\"wall\":\"" + nsblock + "s\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = bmpath + name + "_wall_side_tall.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/template_wall_side_tall\",\"textures\":{\"wall\":\"" + nsblock + "s\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(bmpath)\"! No block model files will be written.") + if(Directory.exists(impath)){ + pth = impath + name + "s.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "s\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_platform\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_slab\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "_stairs\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = impath + name + "_wall.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/wall_inventory\",\"textures\":{\"wall\":\"" + nsblock + "s\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(impath)\"! No item model files will be written.") + if(Directory.exists(recipepath)){ + pth = recipepath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_slab\"}},\"result\":{\"item\":\"" + nsid + "_platform\",\"count\":12}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_platform_from_block_stonecutting.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:stonecutting\",\"ingredient\":{\"item\":\"" + nsid + "s\"},\"result\":\"" + nsid + "_platform\",\"count\":8}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_platform_from_slab_stonecutting.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:stonecutting\",\"ingredient\":{\"item\":\"" + nsid + "_slab\"},\"result\":\"" + nsid + "_platform\",\"count\":4}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "s\"}},\"result\":{\"item\":\"" + nsid + "_slab\",\"count\":6}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_slab_stonecutting.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:stonecutting\",\"ingredient\":{\"item\":\"" + nsid + "s\"},\"result\":\"" + nsid + "_slab\",\"count\":2}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"pattern\":[\"# \",\"## \",\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "s\"}},\"result\":{\"item\":\"" + nsid + "_stairs\",\"count\":4}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_stairs_stonecutting.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:stonecutting\",\"ingredient\":{\"item\":\"" + nsid + "s\"},\"result\":\"" + nsid + "_stairs\",\"count\":1}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_wall.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"pattern\":[\"###\",\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "s\"}},\"result\":{\"item\":\"" + nsid + "_wall\",\"count\":6}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = recipepath + name + "_wall_stonecutting.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:stonecutting\",\"ingredient\":{\"item\":\"" + nsid + "s\"},\"result\":\"" + nsid + "_wall\",\"count\":1}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(recipepath)\"! No recipe files will be written.") + if(Directory.exists(lootpath)){ + pth = lootpath + name + "s.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "s\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_platform\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_slab\",\"properties\":{\"type\":\"double\"}}],\"count\":2},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + nsid + "_slab\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_stairs\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = lootpath + name + "_wall.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_wall\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(lootpath)\"! No loot table files will be written.") + if(Directory.exists(advpath)){ + pth = advpath + name + "_platform.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_platform\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_platform\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_platform_from_block_stonecutting.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_platform_from_block_stonecutting\"]},\"criteria\":{\"has_block\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "s\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_platform_from_block_stonecutting\"}}},\"requirements\":[[\"has_block\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_platform_from_slab_stonecutting.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_platform_from_slab_stonecutting\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_platform_from_slab_stonecutting\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_slab.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_slab\"]},\"criteria\":{\"has_block\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "s\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_slab\"}}},\"requirements\":[[\"has_block\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_slab_stonecutting.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_slab_stonecutting\"]},\"criteria\":{\"has_block\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "s\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_slab_stonecutting\"}}},\"requirements\":[[\"has_block\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_stairs.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_stairs\"]},\"criteria\":{\"has_block\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "s\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_stairs\"}}},\"requirements\":[[\"has_block\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_stairs_stonecutting.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_stairs_stonecutting\"]},\"criteria\":{\"has_block\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "s\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_stairs_stonecutting\"}}},\"requirements\":[[\"has_block\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_wall.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_wall\"]},\"criteria\":{\"has_block\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "s\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_wall\"}}},\"requirements\":[[\"has_block\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + pth = advpath + name + "_wall_stonecutting.json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_wall_stonecutting\"]},\"criteria\":{\"has_block\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "s\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_wall_stonecutting\"}}},\"requirements\":[[\"has_block\",\"has_the_recipe\"]]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(advpath)\"! No recipe advancement files will be written.") + } + static singleBlock(namespace, name, path, warn, verbose){ + if(!path.endsWith("/")) path = path + "/" + var bspath = path + "assets/" + namespace + "/blockstates/" + var bmpath = path + "assets/" + namespace + "/models/block/" + var impath = path + "assets/" + namespace + "/models/item/" + var lootpath = path + "data/" + namespace + "/loot_tables/blocks/" + namespace = namespace + ":" + var nsblock = namespace + "block/" + name + var pth + if(Directory.exists(bspath)){ + pth = bspath + name + ".json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "\"}}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(bspath)\"! No block state file will be written.") + if(Directory.exists(bmpath)){ + pth = bmpath + name + ".json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + nsblock + "\"}}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(bmpath)\"! No block model file will be written.") + if(Directory.exists(impath)){ + pth = impath + name + ".json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"parent\":\"" + nsblock + "\"}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(impath)\"! No item model file will be written.") + if(Directory.exists(lootpath)){ + pth = lootpath + name + ".json" + if(File.exists(pth)){ + if(warn) System.print(pth + " exists, skipping") + } else { + var file = File.create(pth) + file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + name + "\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") + file.close() + if(verbose) System.print("Writing " + pth) + } + } else if(warn) System.print("Missing \"%(lootpath)\"! No loot table file will be written.") + } +} + +if(Process.arguments.count == 0){ + //System.print("Doing nothing.") +} else { + var shift = 0 + var verbose = false + var warn = false + for(arg in Process.arguments){ + if(arg == "-v" || arg == "--verbose"){ + shift = shift + 1 + verbose = true + } else if(arg == "-w" || arg == "--warn"){ + shift = shift + 1 + warn = true + } else if(arg.startsWith("-")){ + Fiber.abort("Unknown option \"%(arg)\"") + } else break + } + if(Process.arguments[shift] == "help"){ + System.print("Usage: (script call) [options] namespace \nExample: wren_cli generate.wren wood /path/to/mod_files_base/ namespace firstwood secondwood\n\nOptions:\n -v --verbose Print the written files\n -w --warn Print warnings when files or directories don't exist\n\nTypes:\n- wood The vanilla wood family as well as platform and tile variants\n- woodvanilla Hardcoded to generate extensions for the vanilla wood types\n- variants Block, stairs, slab and platform\n- stone Like variants but with wall and stonecutting as well as adding an s to the full block\n- single A single block") + } else if(Process.arguments[shift] == "wood"){ + if(Process.arguments.count == shift + 1){ + System.print("No base path specified.") + } else if(Process.arguments.count == shift + 2){ + System.print("No namespace specified.") + } else if(Process.arguments.count == shift + 3){ + System.print("No wood types specified.") + } else { + for(type in Process.arguments[shift + 3..-1]){ + System.print("Generating wood type " + type) + Generator.woodType(Process.arguments[shift + 2], type, Process.arguments[shift + 1], warn, verbose) + } + System.print("Now make sure there are textures, translations and tags (see generation type \"woodtags\") for the new wood types.") + } + } else if(Process.arguments[shift] == "woodvanilla"){ + if(Process.arguments.count == shift + 1){ + System.print("No base path specified.") + } else if(Process.arguments.count == shift + 2){ + System.print("No namespace specified.") + } else { + System.print("Generating vanilla wood additions") + Generator.woodVanillaAdditions(Process.arguments[shift + 2], Process.arguments[shift + 1], warn, verbose) + } + } else if(Process.arguments[shift] == "woodtags"){ + if(Process.arguments.count == shift + 1){ + System.print("No base path specified.") + } else if(Process.arguments.count == shift + 2){ + System.print("No namespace specified.") + } else if(Process.arguments.count == shift + 3){ + System.print("No wood types specified.") + } else { + //System.print("Generating wood type " + type) + Generator.woodTags(Process.arguments[shift + 2], Process.arguments[shift + 3..-1], Process.arguments[shift + 1], warn, verbose) + } + } else if(Process.arguments[shift] == "variants"){ + if(Process.arguments.count == shift + 1){ + System.print("No base path specified.") + } else if(Process.arguments.count == shift + 2){ + System.print("No namespace specified.") + } else if(Process.arguments.count == shift + 3){ + System.print("No block types specified.") + } else { + for(type in Process.arguments[shift + 3..-1]){ + System.print("Generating block type " + type) + Generator.blockWithBasicVariants(Process.arguments[shift + 2], type, Process.arguments[shift + 1], warn, verbose) + } + System.print("Now make sure there are textures, translations and perhaps tags for the new block types.") + } + } else if(Process.arguments[shift] == "stone"){ + if(Process.arguments.count == shift + 1){ + System.print("No base path specified.") + } else if(Process.arguments.count == shift + 2){ + System.print("No namespace specified.") + } else if(Process.arguments.count == shift + 3){ + System.print("No block types specified.") + } else { + for(type in Process.arguments[shift + 3..-1]){ + System.print("Generating block type " + type) + Generator.stoneWithBasicVariantsS(Process.arguments[shift + 2], type, Process.arguments[shift + 1], warn, verbose) + } + System.print("Now make sure there are textures, translations and perhaps tags for the new block types.") + } + } else if(Process.arguments[shift] == "single"){ + if(Process.arguments.count == shift + 1){ + System.print("No base path specified.") + } else if(Process.arguments.count == shift + 2){ + System.print("No namespace specified.") + } else if(Process.arguments.count == shift + 3){ + System.print("No block specified.") + } else { + for(type in Process.arguments[shift + 3..-1]){ + System.print("Generating block " + type) + Generator.singleBlock(Process.arguments[shift + 2], type, Process.arguments[shift + 1], warn, verbose) + } + System.print("Now make sure there is a texture and a translation for the new block(s).") + } + } else { + System.print("Unknown action \"%(Process.arguments[shift])\"") + } +} \ No newline at end of file