diff --git a/forge-1.10.2-12.18.3.2422-mdk/.gitignore b/forge-1.10.2-12.18.3.2422-mdk/.gitignore new file mode 100644 index 00000000..2c770e09 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/.gitignore @@ -0,0 +1,22 @@ +# eclipse +bin +*.launch +.settings +.metadata +.classpath +.project + +# idea +out +*.ipr +*.iws +*.iml +.idea + +# gradle +build +.gradle + +# other +eclipse +run diff --git a/forge-1.10.2-12.18.3.2422-mdk/LICENSE-new.txt b/forge-1.10.2-12.18.3.2422-mdk/LICENSE-new.txt new file mode 100644 index 00000000..be2c9e66 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/LICENSE-new.txt @@ -0,0 +1,483 @@ +Minecraft Forge is licensed under the terms of the LGPL 2.1 found +here http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt and copied +below. + +A note on authorship: +All source artifacts are property of their original author, with +the exclusion of the contents of the patches directory and others +copied from it from time to time. Authorship of the contents of +the patches directory is retained by the Minecraft Forge project. +This is because the patches are partially machine generated +artifacts, and are changed heavily due to the way forge works. +Individual attribution within them is impossible. + +Consent: +All contributions to Forge must consent to the release of any +patch content to the Forge project. + +A note on infectivity: +The LGPL is chosen specifically so that projects may depend on Forge +features without being infected with its license. That is the +purpose of the LGPL. Mods and others using this code via ordinary +Java mechanics for referencing libraries are specifically not bound +by Forge's license for the Mod code. + + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/forge-1.10.2-12.18.3.2422-mdk/README.txt b/forge-1.10.2-12.18.3.2422-mdk/README.txt new file mode 100644 index 00000000..b45931f4 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/README.txt @@ -0,0 +1,59 @@ +------------------------------------------- +Source installation information for modders +------------------------------------------- +This code follows the Minecraft Forge installation methodology. It will apply +some small patches to the vanilla MCP source code, giving you and it access +to some of the data and functions you need to build a successful mod. + +Note also that the patches are built against "unrenamed" MCP source code (aka +srgnames) - this means that you will not be able to read them directly against +normal code. + +Source pack installation information: + +Standalone source installation +============================== + +Step 1: Open your command-line and browse to the folder where you extracted the zip file. + +Step 2: Once you have a command window up in the folder that the downloaded material was placed, type: + +Windows: "gradlew setupDecompWorkspace" +Linux/Mac OS: "./gradlew setupDecompWorkspace" + +Step 3: After all that finished, you're left with a choice. +For eclipse, run "gradlew eclipse" (./gradlew eclipse if you are on Mac/Linux) + +If you preffer to use IntelliJ, steps are a little different. +1. Open IDEA, and import project. +2. Select your build.gradle file and have it import. +3. Once it's finished you must close IntelliJ and run the following command: + +"gradlew genIntellijRuns" (./gradlew genIntellijRuns if you are on Mac/Linux) + +Step 4: The final step is to open Eclipse and switch your workspace to /eclipse/ (if you use IDEA, it should automatically start on your project) + +If at any point you are missing libraries in your IDE, or you've run into problems you can run "gradlew --refresh-dependencies" to refresh the local cache. "gradlew clean" to reset everything {this does not effect your code} and then start the processs again. + +Should it still not work, +Refer to #ForgeGradle on EsperNet for more information about the gradle environment. + +Tip: +If you do not care about seeing Minecraft's source code you can replace "setupDecompWorkspace" with one of the following: +"setupDevWorkspace": Will patch, deobfusicated, and gather required assets to run minecraft, but will not generated human readable source code. +"setupCIWorkspace": Same as Dev but will not download any assets. This is useful in build servers as it is the fastest because it does the least work. + +Tip: +When using Decomp workspace, the Minecraft source code is NOT added to your workspace in a editable way. Minecraft is treated like a normal Library. Sources are there for documentation and research purposes and usually can be accessed under the 'referenced libraries' section of your IDE. + +Forge source installation +========================= +MinecraftForge ships with this code and installs it as part of the forge +installation process, no further action is required on your part. + +LexManos' Install Video +======================= +https://www.youtube.com/watch?v=8VEdtQLuLO0&feature=youtu.be + +For more details update more often refer to the Forge Forums: +http://www.minecraftforge.net/forum/index.php/topic,14048.0.html diff --git a/forge-1.10.2-12.18.3.2422-mdk/build.gradle b/forge-1.10.2-12.18.3.2422-mdk/build.gradle new file mode 100644 index 00000000..e2a7937e --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/build.gradle @@ -0,0 +1,93 @@ +buildscript { + repositories { + jcenter() + maven { url = "http://files.minecraftforge.net/maven" } + } + dependencies { + classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' + } +} +apply plugin: 'net.minecraftforge.gradle.forge' +//Only edit below this line, the above code adds and enables the nessasary things for Forge to be setup. + + +version = "1.10.2-1.0" +group= "com.github.glitchfiend.biomesoplenty" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +archivesBaseName = "ToughAsNails" + +sourceCompatibility = targetCompatibility = "1.8" // Need this here so eclipse task generates correctly. +compileJava { + sourceCompatibility = targetCompatibility = "1.8" +} + +minecraft { + version = "1.10.2-12.18.3.2422" + runDir = "run" + + // the mappings can be changed at any time, and must be in the following format. + // snapshot_YYYYMMDD snapshot are built nightly. + // stable_# stables are built at the discretion of the MCP team. + // Use non-default mappings at your own risk. they may not allways work. + // simply re-run your setup task after changing the mappings to update your workspace. + mappings = "snapshot_20161111" + // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. +} + +def commonManifest = { + attributes ( + "FMLCorePlugin": 'toughasnails.asm.TANLoadingPlugin', + "FMLCorePluginContainsFMLMod": 'true', + "ForceLoadAsMod": 'true', + "FMLAT": 'toughasnails_at.cfg' + ) +} + +jar { + manifest commonManifest + classifier = 'universal' +} + + +dependencies { + // you may put jars on which you depend on in ./libs + // or you may define them like so.. + //compile "some.group:artifact:version:classifier" + //compile "some.group:artifact:version" + + // real examples + //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env + //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env + + // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. + //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' + + // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided, + // except that these dependencies get remapped to your current MCP mappings + //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev' + //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev' + + // for more info... + // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html + // http://www.gradle.org/docs/current/userguide/dependency_management.html + +} + +processResources +{ + // this will ensure that this task is redone when the versions change. + inputs.property "version", project.version + inputs.property "mcversion", project.minecraft.version + + // replace stuff in mcmod.info, nothing else + from(sourceSets.main.resources.srcDirs) { + include 'mcmod.info' + + // replace version and mcversion + expand 'version':project.version, 'mcversion':project.minecraft.version + } + + // copy everything else, thats not the mcmod.info + from(sourceSets.main.resources.srcDirs) { + exclude 'mcmod.info' + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/gradle.properties b/forge-1.10.2-12.18.3.2422-mdk/gradle.properties new file mode 100644 index 00000000..e9b9fd5a --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/gradle.properties @@ -0,0 +1,3 @@ +# Sets default memory used for gradle commands. Can be overridden by user or command line properties. +# This is required to provide enough memory for the Minecraft decompilation process. +org.gradle.jvmargs=-Xmx3G diff --git a/forge-1.10.2-12.18.3.2422-mdk/gradle/wrapper/gradle-wrapper.jar b/forge-1.10.2-12.18.3.2422-mdk/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..30d399d8 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/gradle/wrapper/gradle-wrapper.jar differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/gradle/wrapper/gradle-wrapper.properties b/forge-1.10.2-12.18.3.2422-mdk/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..e18cba72 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Mon Sep 14 12:28:28 PDT 2015 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip diff --git a/forge-1.10.2-12.18.3.2422-mdk/gradlew.bat b/forge-1.10.2-12.18.3.2422-mdk/gradlew.bat new file mode 100644 index 00000000..8a0b282a --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/HealthHelper.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/HealthHelper.java new file mode 100644 index 00000000..b69ecb4b --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/HealthHelper.java @@ -0,0 +1,63 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api; + +import java.util.UUID; + +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; + +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; + +public class HealthHelper { + public static final UUID STARTING_HEALTH_MODIFIER_ID = UUID.fromString("050F240E-868F-4164-A67E-374084DACA71"); + public static final UUID LIFEBLOOD_HEALTH_MODIFIER_ID = UUID.fromString("B04DB09D-ED8A-4B82-B1EF-ADB425174925"); + + public static int getActiveHearts(EntityPlayer player) { + return Math.min((int) (player.getMaxHealth() / 2), 10); + } + + public static int getInactiveHearts(EntityPlayer player) { + return Math.max(10 - (int) (player.getMaxHealth() / 2), 0); + } + + public static int getLifebloodHearts(EntityPlayer player) { + IAttributeInstance maxHealthInstance = player.getAttributeMap() + .getAttributeInstance(SharedMonsterAttributes.MAX_HEALTH); + AttributeModifier modifier = maxHealthInstance.getModifier(HealthHelper.LIFEBLOOD_HEALTH_MODIFIER_ID); + + if (modifier != null) { + return (int) (modifier.getAmount() / 2.0D); + } + + return 0; + } + + /** Returns true if successful */ + public static boolean addActiveHearts(EntityPlayer player, int hearts) { + IAttributeInstance maxHealthInstance = player.getAttributeMap() + .getAttributeInstance(SharedMonsterAttributes.MAX_HEALTH); + AttributeModifier modifier = maxHealthInstance.getModifier(HealthHelper.LIFEBLOOD_HEALTH_MODIFIER_ID); + float newHealth = player.getMaxHealth() + (hearts * 2); + double existingHearts = modifier != null ? modifier.getAmount() : 0.0D; + + if (newHealth <= 20.0F && newHealth > 0.0F) { + Multimap multimap = HashMultimap. create(); + modifier = new AttributeModifier(HealthHelper.LIFEBLOOD_HEALTH_MODIFIER_ID, "Lifeblood Health Modifier", + existingHearts + hearts * 2, 0); + multimap.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), modifier); + player.getAttributeMap().applyAttributeModifiers(multimap); + return true; + } + + return false; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/ITANBlock.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/ITANBlock.java new file mode 100644 index 00000000..9ad0ec6b --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/ITANBlock.java @@ -0,0 +1,19 @@ +package toughasnails.api; + +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.ItemBlock; + +public interface ITANBlock { + + public Class getItemClass(); + + @SuppressWarnings("rawtypes") + public IProperty[] getPresetProperties(); + + @SuppressWarnings("rawtypes") + public IProperty[] getNonRenderingProperties(); + + public String getStateName(IBlockState state); + +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/TANBlocks.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/TANBlocks.java new file mode 100644 index 00000000..191d9dad --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/TANBlocks.java @@ -0,0 +1,16 @@ +package toughasnails.api; + +import net.minecraft.block.Block; + +public class TANBlocks +{ + public static Block campfire; + public static Block gas; + public static Block temperature_coil; + public static Block rain_collector; + public static Block torch_new; + public static Block glowstone_torch; + public static Block dead_crops; + + public static Block[] season_sensors = new Block[4]; +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/TANCapabilities.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/TANCapabilities.java new file mode 100644 index 00000000..4da4d077 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/TANCapabilities.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api; + +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.CapabilityInject; +import toughasnails.api.stat.capability.ITemperature; +import toughasnails.api.stat.capability.IThirst; + +public class TANCapabilities +{ + @CapabilityInject(ITemperature.class) + public static final Capability TEMPERATURE = null; + @CapabilityInject(IThirst.class) + public static final Capability THIRST = null; +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/TANPotions.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/TANPotions.java new file mode 100644 index 00000000..505b4ed4 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/TANPotions.java @@ -0,0 +1,18 @@ +package toughasnails.api; + +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionType; + +public class TANPotions +{ + public static Potion hypothermia; + public static Potion hyperthermia; + public static Potion thirst; + public static Potion cold_resistance; + public static Potion heat_resistance; + + public static PotionType cold_resistance_type; + public static PotionType long_cold_resistance_type; + public static PotionType heat_resistance_type; + public static PotionType long_heat_resistance_type; +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/achievement/TANAchievements.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/achievement/TANAchievements.java new file mode 100644 index 00000000..6c6505da --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/achievement/TANAchievements.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api.achievement; + +import net.minecraft.stats.Achievement; + +public class TANAchievements +{ + public static Achievement thirst_quencher; + public static Achievement campfire_song; + public static Achievement life_or_death; + public static Achievement thirst_ender; + public static Achievement hot_or_cold; + public static Achievement that_time_of_year; + public static Achievement into_ice; + public static Achievement year_one; +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/config/GameplayOption.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/config/GameplayOption.java new file mode 100644 index 00000000..224d6289 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/config/GameplayOption.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api.config; + +public enum GameplayOption implements ISyncedOption { + ENABLE_LOWERED_STARTING_HEALTH("Enable Lowered Starting Health"), // + ENABLE_THIRST("Enable Thirst"), // + ENABLE_TEMPERATURE("Enable Body Temperature"), // + ENABLE_SEASONS("Enable Seasons"), // + DRINKS("Drinks"), // + OVERRIDE_THERMOMETER_LIMITS("Override Thermometer Limits"), // + THERMOMETER_LOWER_BOUND("Thermometer Lower Bound"), // + THERMOMETER_UPPER_BOUND("Thermometer Upper Bound"), // + RAIN_CHILL("Enable Rain Chill on World Blocks"), // + BIOME_TEMP_MODIFIER("Biome Temperature Modification Scaling"), // + ALTITUDE_TEMP_MODIFIER("Altitude Temperature Modification Scaling"), // + WET_TEMP_MODIFIER("Temperature Modifier for being Wet"), // + SNOW_TEMP_MODIFIER("Temperature Modifier for Snow"), // + TIME_TEMP_MODIFIER("Time of Day Temperature Modification Scaling"), // + TIME_EXTREMITY_MODIFIER("Temperature Scaling for Time of Day Extremities"), // + EARLY_AUTUMN_MODIFIER("Temperature Modifier for the EARLY_AUTUMN Season"), // + MID_AUTUMN_MODIFIER("Temperature Modifier for the MID_AUTUMN Season"), // + LATE_AUTUMN_MODIFIER("Temperature Modifier for the LATE_AUTUMN Season"), // + EARLY_WINTER_MODIFIER("Temperature Modifier for the EARLY_WINTER Season"), // + MID_WINTER_MODIFIER("Temperature Modifier for the MID_WINTER Season"), // + LATE_WINTER_MODIFIER("Temperature Modifier for the LATE_WINTER Season"), // + EARLY_SPRING_MODIFIER("Temperature Modifier for the EARLY_SPRING Season"), // + MID_SPRING_MODIFIER("Temperature Modifier for the MID_SPRING Season"), // + LATE_SPRING_MODIFIER("Temperature Modifier for the LATE_SPRING Season"), // + EARLY_SUMMER_MODIFIER("Temperature Modifier for the EARLY_SUMMER Season"), // + MID_SUMMER_MODIFIER("Temperature Modifier for the MID_SUMMER Season"), // + LATE_SUMMER_MODIFIER("Temperature Modifier for the LATE_SUMMER Season"), // + TEMPERATURE_WITHERING("Crops Wither by Temperature"), // + HIBERNATING("Crops which Hibernate and don't Decay"), // + CROPS("Crops"); + + private final String optionName; + + private GameplayOption(String name) { + this.optionName = name; + } + + @Override + public String getOptionName() { + return this.optionName; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/config/ISyncedOption.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/config/ISyncedOption.java new file mode 100644 index 00000000..99e6d94c --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/config/ISyncedOption.java @@ -0,0 +1,13 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api.config; + +public interface ISyncedOption +{ + String getOptionName(); +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/config/SyncedConfig.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/config/SyncedConfig.java new file mode 100644 index 00000000..e5f25a32 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/config/SyncedConfig.java @@ -0,0 +1,55 @@ +package toughasnails.api.config; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import com.google.common.collect.Maps; + +public class SyncedConfig { + public static Map optionsToSync = Maps + .newHashMap(); + + public static void addOption(ISyncedOption option, String defaultValue) { + optionsToSync.put(option.getOptionName(), + new SyncedConfigEntry(defaultValue)); + } + + public static boolean getBooleanValue(ISyncedOption option) { + return Boolean.valueOf(optionsToSync.get(option.getOptionName()).value); + } + + public static int getIntegerValue(ISyncedOption option) { + return Integer.valueOf(optionsToSync.get(option.getOptionName()).value); + } + + public static float getFloatValue(ISyncedOption option) { + return Float.valueOf(optionsToSync.get(option.getOptionName()).value); + } + + public static List getListValue(ISyncedOption option) { + SyncedConfigEntry value = optionsToSync.get(option.getOptionName()); + String rawList = value.value; + List result = new ArrayList(); + for (String drinkEntry : rawList.split(",")) { + result.add(drinkEntry); + } + return result; + } + + public static void restoreDefaults() { + for (SyncedConfigEntry entry : optionsToSync.values()) { + entry.value = entry.defaultValue; + } + } + + public static class SyncedConfigEntry { + public String value; + public final String defaultValue; + + public SyncedConfigEntry(String defaultValue) { + this.defaultValue = defaultValue; + this.value = defaultValue; + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/item/IColoredItem.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/item/IColoredItem.java new file mode 100644 index 00000000..9388b848 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/item/IColoredItem.java @@ -0,0 +1,18 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api.item; + +import net.minecraft.client.renderer.color.IItemColor; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +public interface IColoredItem +{ + @SideOnly(Side.CLIENT) + public IItemColor getItemColor(); +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/item/ItemDrink.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/item/ItemDrink.java new file mode 100644 index 00000000..4f95644d --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/item/ItemDrink.java @@ -0,0 +1,92 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api.item; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.world.World; +import toughasnails.api.TANPotions; +import toughasnails.api.config.GameplayOption; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.stat.capability.IThirst; +import toughasnails.api.thirst.IDrink; +import toughasnails.api.thirst.ThirstHelper; +import toughasnails.thirst.ThirstHandler; + +public abstract class ItemDrink & IDrink> extends Item { + + public ItemDrink() { + this.setMaxStackSize(1); + this.setHasSubtypes(true); + this.setMaxDamage(0); + } + + @Override + public ActionResult onItemRightClick(ItemStack stack, + World world, EntityPlayer player, EnumHand hand) { + ThirstHandler thirstHandler = (ThirstHandler) ThirstHelper + .getThirstData(player); + + if (thirstHandler.isThirsty()) { + player.setActiveHand(hand); + } + + return new ActionResult(EnumActionResult.SUCCESS, stack); + } + + @Override + public ItemStack onItemUseFinish(ItemStack stack, World world, + EntityLivingBase entity) { + if (!world.isRemote && entity instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) entity; + IThirst thirst = ThirstHelper.getThirstData(player); + T type = getTypeFromMeta(stack.getMetadata()); + + thirst.addStats(type.getThirst(), type.getHydration()); + addEffects(player, type); + + return new ItemStack(Items.GLASS_BOTTLE); + } + + return stack; + } + + public void addEffects(EntityPlayer player, T type) { + if (player.getEntityWorld().rand.nextFloat() < type.getPoisonChance() + && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_THIRST)) { + player.addPotionEffect(new PotionEffect(TANPotions.thirst, 600)); + } + } + + public abstract T getTypeFromMeta(int meta); + + @Override + public int getMaxItemUseDuration(ItemStack stack) { + return 32; + } + + @Override + public EnumAction getItemUseAction(ItemStack stack) { + return EnumAction.DRINK; + } + + // default behavior in Item is to return 0, but the meta value is important + // here because it determines which dart type to use + @Override + public int getMetadata(int metadata) { + return metadata; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/item/TANItems.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/item/TANItems.java new file mode 100644 index 00000000..e9b1b1e3 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/item/TANItems.java @@ -0,0 +1,45 @@ +package toughasnails.api.item; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor.ArmorMaterial; + +public class TANItems +{ + public static Item tan_icon; + + public static Item canteen; + public static Item fruit_juice; + public static Item water_bottle; + public static Item thermometer; + + //public static Item bottle_of_gas; + + //public static Item respirator; + + public static Item wool_helmet; + public static Item wool_chestplate; + public static Item wool_leggings; + public static Item wool_boots; + public static Item jelled_slime_helmet; + public static Item jelled_slime_chestplate; + public static Item jelled_slime_leggings; + public static Item jelled_slime_boots; + + public static Item jelled_slime; + public static Item freeze_rod; + public static Item freeze_powder; + public static Item ice_cube; + public static Item ice_charge; + public static Item charcoal_filter; + //public static Item air_filter; + + public static Item lifeblood_crystal; + + public static Item season_clock; + + public static Item spawn_egg; + + public static ArmorMaterial wool_armor_material; + public static ArmorMaterial jelled_slime_armor_material; + public static ArmorMaterial respirator_material; +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/season/IDecayableCrop.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/season/IDecayableCrop.java new file mode 100644 index 00000000..b2ce0a94 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/season/IDecayableCrop.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api.season; + +/** + * A marker interface which should be implemented by crops which decay in the + * winter in the absence of proper heating. + * + * Please note that due to how Java bytecode works, you must explicitly + * implement this interface if your class overrides updateTick. + */ +public interface IDecayableCrop { + + // Crop will only decay in winter if this returns true + boolean shouldDecay(); +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/season/IHibernatingCrop.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/season/IHibernatingCrop.java new file mode 100644 index 00000000..95cda4ac --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/season/IHibernatingCrop.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package toughasnails.api.season; + +/** + * An interface which should be implemented by crops which become inactive in + * the winter in the absence of proper heating. + * + * Crops using this interface in 1.10 should make sure they use Forge's crop + * growth events and appropriately cancel the crop growth when the event result + * is set to DENY. (See net.minecraftforge.event.BlockEvent$CropGrowEvent or + * alternatively net.minecraftforge.common.ForgeHooks.onCropsGrowPre) + * + * Please note that due to how Java bytecode works, you must explicitly + * implement this interface if your class overrides updateTick. + */ +public interface IHibernatingCrop { + + // Crop will only hibernate in winter if this returns true + boolean shouldHibernate(); +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/season/ISeasonData.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/season/ISeasonData.java new file mode 100644 index 00000000..33b76735 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/season/ISeasonData.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api.season; + +import toughasnails.api.season.Season.SubSeason; + +public interface ISeasonData +{ + /** + * The elapsed time in ticks for the current season cycle. + * Cycles are split into seasons rather than sub seasons + * i.e. Summer, Autumn, Winter and Spring. + * + * @return The time in ticks + */ + int getSeasonCycleTicks(); + + + SubSeason getSubSeason(); +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/season/Season.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/season/Season.java new file mode 100644 index 00000000..fb71cd97 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/season/Season.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api.season; + +public enum Season +{ + SPRING, SUMMER, AUTUMN, WINTER; + + public static enum SubSeason + { + EARLY_SPRING(SPRING, 0x778087, 0.85F, 0x6F818F, 0.85F), + MID_SPRING(SPRING, 0x6F818F, 0x5F849F), + LATE_SPRING(SPRING, 0x678297, 0x3F89BF), + EARLY_SUMMER(SUMMER, 0x73808B, 0x5F849F), + MID_SUMMER(SUMMER, 0xFFFFFF, 0xFFFFFF), + LATE_SUMMER(SUMMER, 0x877777, 0x9F5F5F), + EARLY_AUTUMN(AUTUMN, 0x8F6F6F, 0xB74747), + MID_AUTUMN(AUTUMN, 0x9F5F5F, 0xCF2F2F), + LATE_AUTUMN(AUTUMN, 0xAF4F4F, 0.85F, 0xBF3F3F, 0.85F), + EARLY_WINTER(WINTER, 0x9F5F5F, 0.60F, 0xA75757, 0.60F), + MID_WINTER(WINTER, 0x8F6F6F, 0.45F, 0x9F5F5F, 0.45F), + LATE_WINTER(WINTER, 0xFFFFFF, 0.60F, 0x8F6F6F, 0.60F); + + private Season season; + private int grassOverlay; + private float grassSaturationMultiplier; + private int foliageOverlay; + private float foliageSaturationMultiplier; + + private SubSeason(Season season, int grassColour, float grassSaturation, int foliageColour, float foliageSaturation) + { + this.season = season; + this.grassOverlay = grassColour; + this.grassSaturationMultiplier = grassSaturation; + this.foliageOverlay = foliageColour; + this.foliageSaturationMultiplier = foliageSaturation; + } + + private SubSeason(Season season, int grassColour, int foliageColour) + { + this(season, grassColour, -1, foliageColour, -1); + } + + public Season getSeason() + { + return this.season; + } + + public int getGrassOverlay() + { + return this.grassOverlay; + } + + public float getGrassSaturationMultiplier() + { + return this.grassSaturationMultiplier; + } + + public int getFoliageOverlay() + { + return this.foliageOverlay; + } + + public float getFoliageSaturationMultiplier() + { + return this.foliageSaturationMultiplier; + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/season/SeasonHelper.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/season/SeasonHelper.java new file mode 100644 index 00000000..392a0cf8 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/season/SeasonHelper.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api.season; + +import net.minecraft.world.World; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.config.GameplayOption; + +public class SeasonHelper +{ + /** + * Obtains data about the state of the season cycle in the world. This works both on + * the client and the server. + */ + public static ISeasonData getSeasonData(World world) + { + ISeasonData data; + + try + { + if (!world.isRemote) + { + data = (ISeasonData)Class.forName("toughasnails.handler.season.SeasonHandler").getMethod("getServerSeasonData", World.class).invoke(null, world); + } + else + { + data = (ISeasonData)Class.forName("toughasnails.handler.season.SeasonHandler").getMethod("getClientSeasonData").invoke(null); + } + } + catch (Exception e) + { + throw new RuntimeException("An error occurred obtaining season data", e); + } + + return data; + } + + /** + * Checks if the season provided allows snow to fall at a certain + * biome temperature. + * + * @param season The season to check + * @param temperature The biome temperature to check + * @return True if suitable, otherwise false + */ + public static boolean canSnowAtTempInSeason(Season season, float temperature) + { + //If we're in winter, the temperature can be anything equal to or below 0.7 + return temperature < 0.15F || (season == Season.WINTER && temperature <= 0.7F && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_SEASONS)); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/season/WorldHooks.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/season/WorldHooks.java new file mode 100644 index 00000000..6c490ca9 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/season/WorldHooks.java @@ -0,0 +1,52 @@ +package toughasnails.api.season; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +public class WorldHooks +{ + /** + * An override of {@link World#canSnowAt(BlockPos, boolean)} + */ + public static boolean canSnowAtInSeason(World world, BlockPos pos, boolean checkLight, Season season) + { + try + { + return (Boolean)Class.forName("toughasnails.season.SeasonASMHelper").getMethod("canSnowAtInSeason", World.class, BlockPos.class, Boolean.class, Season.class).invoke(null, world, pos, checkLight, season); + } + catch (Exception e) + { + throw new RuntimeException("An error occurred calling canSnowAtInSeason", e); + } + } + + /** + * An override of {@link World#canBlockFreeze(BlockPos, boolean)} + */ + public static boolean canBlockFreezeInSeason(World world, BlockPos pos, boolean noWaterAdj, Season season) + { + try + { + return (Boolean)Class.forName("toughasnails.season.SeasonASMHelper").getMethod("canBlockFreezeInSeason", World.class, BlockPos.class, Boolean.class, Season.class).invoke(null, world, pos, noWaterAdj, season); + } + catch (Exception e) + { + throw new RuntimeException("An error occurred calling canBlockFreezeInSeason", e); + } + } + + /** + * An override of {@link World#isRainingAt(BlockPos)} + */ + public static boolean isRainingAtInSeason(World world, BlockPos pos, Season season) + { + try + { + return (Boolean)Class.forName("toughasnails.season.SeasonASMHelper").getMethod("isRainingAtInSeason", World.class, BlockPos.class, Season.class).invoke(null, world, pos, season); + } + catch (Exception e) + { + throw new RuntimeException("An error occurred calling isRainingAtInSeason", e); + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/stat/IPlayerStat.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/stat/IPlayerStat.java new file mode 100644 index 00000000..d4e45652 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/stat/IPlayerStat.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api.stat; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; + +public interface IPlayerStat +{ + public void update(EntityPlayer player, World world, Phase phase); + + public boolean hasChanged(); + public void onSendClientUpdate(); + + public IMessage createUpdateMessage(); +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/stat/PlayerStatRegistry.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/stat/PlayerStatRegistry.java new file mode 100644 index 00000000..a4df947e --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/stat/PlayerStatRegistry.java @@ -0,0 +1,53 @@ +package toughasnails.api.stat; + +import java.util.HashMap; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Maps; + +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.Capability.IStorage; +import net.minecraftforge.common.capabilities.CapabilityManager; +import toughasnails.api.stat.capability.CapabilityProvider; + +public class PlayerStatRegistry { + private static HashMap> playerStats = Maps.newHashMap(); + private static HashMap> statCapabilities = Maps.newHashMap(); + + @SuppressWarnings("unchecked") + public static void addStat(Class capabilityClass, IStorage storage, + Class implementationClass) { + String identifier = capabilityClass.getName().intern(); + + if (identifier == null) { + throw new RuntimeException("Stat identifier cannot be null!"); + } else if (playerStats.containsKey(identifier)) { + throw new RuntimeException("Stat with identifier " + identifier + " already exists!"); + } + + try { + CapabilityManager.INSTANCE.register(capabilityClass, storage, (Class) implementationClass); + } catch (ClassCastException e) { + throw new IllegalArgumentException("Player stat must implement capability class!"); + } + + playerStats.put(identifier, implementationClass); + } + + public static void registerCapability(Capability capability) { + statCapabilities.put(capability.getName(), capability); + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + public static CapabilityProvider createCapabilityProvider(String identifier) { + return new CapabilityProvider(statCapabilities.get(identifier)); + } + + public static Capability getCapability(String identifier) { + return statCapabilities.get(identifier); + } + + public static ImmutableMap> getCapabilityMap() { + return ImmutableMap.copyOf(statCapabilities); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/stat/StatHandlerBase.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/stat/StatHandlerBase.java new file mode 100644 index 00000000..cf782e4f --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/stat/StatHandlerBase.java @@ -0,0 +1,14 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api.stat; + +public abstract class StatHandlerBase implements IPlayerStat +{ + @Override + public void onSendClientUpdate() {} +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/stat/capability/CapabilityProvider.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/stat/capability/CapabilityProvider.java new file mode 100644 index 00000000..5ea465cb --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/stat/capability/CapabilityProvider.java @@ -0,0 +1,28 @@ +package toughasnails.api.stat.capability; + +import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.ICapabilityProvider; + +/** Provides instances of our capability when requested where suitable */ +public class CapabilityProvider implements ICapabilityProvider { + /** The capability this is for */ + private final Capability capability; + private final C instance; + + public CapabilityProvider(Capability capability) { + this.capability = capability; + this.instance = capability.getDefaultInstance(); + } + + @Override + public boolean hasCapability(Capability capability, EnumFacing facing) { + return capability != null && capability == this.capability; + } + + @SuppressWarnings("unchecked") + @Override + public T getCapability(Capability capability, EnumFacing facing) { + return capability != null && capability == this.capability ? (T) this.instance : null; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/stat/capability/ITemperature.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/stat/capability/ITemperature.java new file mode 100644 index 00000000..b38945dc --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/stat/capability/ITemperature.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api.stat.capability; + +import java.util.Map; + +import com.google.common.collect.ImmutableMap; + +import toughasnails.api.stat.IPlayerStat; +import toughasnails.api.temperature.Temperature; +import toughasnails.temperature.modifier.TemperatureModifier.ExternalModifier; + +//TODO: Switch over to using capabilities entirely. In some places it is still assumed that +//this is always implemented by TemperatureStats +public interface ITemperature extends IPlayerStat +{ + public void setTemperature(Temperature temperature); + public void addTemperature(Temperature difference); + public void applyModifier(String name, int amount, int rate, int duration); + public boolean hasModifier(String name); + public Temperature getTemperature(); + + public void setChangeTime(int ticks); + public int getChangeTime(); + + public ImmutableMap getExternalModifiers(); + public void setExternalModifiers(Map externalModifiers); +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/stat/capability/IThirst.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/stat/capability/IThirst.java new file mode 100644 index 00000000..dd12b8fd --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/stat/capability/IThirst.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api.stat.capability; + +import toughasnails.api.stat.IPlayerStat; + +//TODO: Switch over to using capabilities entirely. In some places it is still assumed that +//this is always implemented by TemperatureStats +public interface IThirst extends IPlayerStat +{ + public void setThirst(int thirst); + public void setHydration(float hydration); + public void setExhaustion(float exhaustion); + public void addStats(int thirst, float hydration); + + public int getThirst(); + public float getHydration(); + public float getExhaustion(); + + public void setChangeTime(int ticks); + public int getChangeTime(); +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/temperature/ITemperatureRegulator.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/temperature/ITemperatureRegulator.java new file mode 100644 index 00000000..109b2e9f --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/temperature/ITemperatureRegulator.java @@ -0,0 +1,16 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api.temperature; + +import net.minecraft.util.math.BlockPos; + +public interface ITemperatureRegulator +{ + public Temperature getRegulatedTemperature(); + public boolean isPosRegulated(BlockPos pos); +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/temperature/Temperature.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/temperature/Temperature.java new file mode 100644 index 00000000..d55c5f67 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/temperature/Temperature.java @@ -0,0 +1,48 @@ +package toughasnails.api.temperature; + +import toughasnails.api.temperature.TemperatureScale.TemperatureRange; + +public class Temperature +{ + private int rawValue; + private TemperatureRange temperatureRange; + + private int rangeIndex; + private float rangeDelta; + + public Temperature(int scalePos) + { + this.rawValue = scalePos; + this.temperatureRange = TemperatureScale.getTemperatureRange(getRawValue()); + this.rangeIndex = -1; + this.rangeDelta = -1F; + } + + /** The raw value of this temperature on a scale*/ + public int getRawValue() + { + return rawValue; + } + + /** The range in which this temperature belongs */ + public TemperatureRange getRange() + { + return temperatureRange; + } + + public int getRangeIndex(boolean reverseEnd) + { + if (rangeIndex == -1) + return TemperatureScale.getRangeIndex(getRawValue(), reverseEnd); + + return rangeIndex; + } + + public float getRangeDelta(boolean reverseEnd) + { + if (rangeDelta == -1F) + rangeDelta = TemperatureScale.getRangeDelta(getRawValue(), reverseEnd); + + return rangeDelta; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/temperature/TemperatureHelper.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/temperature/TemperatureHelper.java new file mode 100644 index 00000000..a7cc1c12 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/temperature/TemperatureHelper.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api.temperature; + +import java.util.List; + +import com.google.common.collect.Lists; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import toughasnails.api.TANCapabilities; +import toughasnails.api.stat.capability.ITemperature; + +public class TemperatureHelper +{ + public static ITemperature getTemperatureData(EntityPlayer player) + { + return player.getCapability(TANCapabilities.TEMPERATURE, null); + } + + public static List getTemperatureRegulators(World world) + { + List list = Lists.newArrayList(); + + for (TileEntity tileEntity : world.tickableTileEntities) + { + if (tileEntity instanceof ITemperatureRegulator) list.add((ITemperatureRegulator)tileEntity); + } + + return list; + } + + public static boolean isPosClimatisedForTemp(World world, BlockPos pos, Temperature temperature) + { + for (ITemperatureRegulator regulator : getTemperatureRegulators(world)) + { + if (regulator.getRegulatedTemperature().getRawValue() >= temperature.getRawValue() && regulator.isPosRegulated(pos)) + { + return true; + } + } + + return false; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/temperature/TemperatureScale.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/temperature/TemperatureScale.java new file mode 100644 index 00000000..126aca78 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/temperature/TemperatureScale.java @@ -0,0 +1,116 @@ +package toughasnails.api.temperature; + +public class TemperatureScale +{ + private static int scaleTotal = generateTotalScale(); + private static int[] rangeStarts = generateRangeStarts(); + + /**Get the temperature range this position in the overall temperature scale is + * located within*/ + public static TemperatureRange getTemperatureRange(int scalePos) + { + //Ensure the scale position is within the allowed values + if (scalePos < 0 || scalePos > scaleTotal) + { + return null; + } + + for (TemperatureRange range : TemperatureRange.values()) + { + if (scalePos <= rangeStarts[range.ordinal()] + range.rangeSize - 1) + { + return range; + } + } + + throw new RuntimeException("Could not find range for value " + scalePos + ". This should never happen!"); + } + + /**Returns an index within a range, given a position in the overall temperature scale. + * When reversed, 1.0 values are when the input position is closer to 0 in the overall temperature scale*/ + public static int getRangeIndex(int scalePos, boolean reverseEnd) + { + TemperatureRange temperatureRange = getTemperatureRange(scalePos); + + return Math.abs((reverseEnd ? (temperatureRange.getRangeSize() - 1) : 0) - (scalePos - rangeStarts[temperatureRange.ordinal()])); + } + + /**Returns on a scale of 0.0F to 1.0F the location of a temperature within the current range + * When reversed, 1.0 values are when the input position is closer to 0 in the overall temperature scale*/ + public static float getRangeDelta(int scalePos, boolean reverseEnd) + { + return (float)(getRangeIndex(scalePos, reverseEnd) + 1) / (float)getTemperatureRange(scalePos).getRangeSize(); + } + + public static boolean isScalePosInRange(int scalePos, TemperatureRange startRange, TemperatureRange endRange) + { + return scalePos >= rangeStarts[startRange.ordinal()] && scalePos <= (rangeStarts[endRange.ordinal()] + endRange.rangeSize - 1); + } + + public static boolean isScalePosInRange(int scalePos, TemperatureRange range) + { + return isScalePosInRange(scalePos, range, range); + } + + /**Returns the position in the overall temperature scale of this range*/ + public static int getRangeStart(TemperatureRange range) + { + return rangeStarts[range.ordinal()]; + } + + public static int getScaleTotal() + { + return scaleTotal; + } + + private static int generateTotalScale() + { + int totalRange = 0; + + for (TemperatureRange range : TemperatureRange.values()) + { + totalRange += range.getRangeSize(); + } + + return totalRange - 1; + } + + private static int[] generateRangeStarts() + { + int[] generatedStarts = new int[TemperatureRange.values().length]; + + for (int index = 0; index < TemperatureRange.values().length; index++) + { + if (index > 0) + { + TemperatureRange previousRange = TemperatureRange.values()[index - 1]; + + generatedStarts[index] = generatedStarts[previousRange.ordinal()] + previousRange.rangeSize; + } + else generatedStarts[index] = 0; + } + + return generatedStarts; + } + + public static enum TemperatureRange + { + ICY(6), + COOL(5), + MILD(4), + WARM(5), + HOT(6); + + private int rangeSize; + + private TemperatureRange(int rangeSize) + { + this.rangeSize = rangeSize; + } + + public int getRangeSize() + { + return this.rangeSize; + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/thirst/IDrink.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/thirst/IDrink.java new file mode 100644 index 00000000..31c00f32 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/thirst/IDrink.java @@ -0,0 +1,15 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api.thirst; + +public interface IDrink +{ + public int getThirst(); + public float getHydration(); + public float getPoisonChance(); +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/thirst/ThirstHelper.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/thirst/ThirstHelper.java new file mode 100644 index 00000000..2a93381e --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/thirst/ThirstHelper.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api.thirst; + +import net.minecraft.entity.player.EntityPlayer; +import toughasnails.api.TANCapabilities; +import toughasnails.api.stat.capability.IThirst; + +public class ThirstHelper +{ + public static IThirst getThirstData(EntityPlayer player) + { + return player.getCapability(TANCapabilities.THIRST, null); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/thirst/WaterType.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/thirst/WaterType.java new file mode 100644 index 00000000..97764d4e --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/api/thirst/WaterType.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.api.thirst; + +public enum WaterType +{ + DIRTY("Dirty Water", 3, 0.1F, 0.8F), + FILTERED("Filtered Water", 5, 0.25F, 0.4F), + CLEAN("Clean Water", 7, 0.5F, 0.0F); + + private String description; + private int thirst; + private float hydration; + private float poisonChance; + + private WaterType(String description, int thirst, float hydration, float poisonChance) + { + this.description = description; + this.thirst = thirst; + this.hydration = hydration; + this.poisonChance = poisonChance; + } + + public String getDescription() + { + return this.description; + } + + public int getThirst() + { + return this.thirst; + } + + public float getHydration() + { + return this.hydration; + } + + public float getPoisonChance() + { + return this.poisonChance; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/ASMHelper.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/ASMHelper.java new file mode 100644 index 00000000..aa99683b --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/ASMHelper.java @@ -0,0 +1,112 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.asm; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; +import org.objectweb.asm.util.Printer; +import org.objectweb.asm.util.Textifier; +import org.objectweb.asm.util.TraceMethodVisitor; + +import com.google.common.collect.Lists; + +public class ASMHelper { + public static final Logger LOGGER = LogManager.getLogger("ToughAsNails Transformer"); + + public static boolean methodEquals(MethodNode methodNode, String[] names, String desc) { + boolean nameMatches = false; + + for (String name : names) { + if (methodNode.name.equals(name)) { + nameMatches = true; + break; + } + } + + return nameMatches && methodNode.desc.equals(desc); + } + + public static void clearNextInstructions(MethodNode methodNode, AbstractInsnNode insnNode) { + Iterator iterator = methodNode.instructions + .iterator(methodNode.instructions.indexOf(insnNode)); + + while (iterator.hasNext()) { + iterator.next(); + iterator.remove(); + } + } + + public static MethodInsnNode getUniqueMethodInsnNode(MethodNode methodNode, int opcode, String owner, + String[] names, String desc) { + List matchedMethodNodes = matchMethodInsnNodes(methodNode, opcode, owner, names, desc); + + if (matchedMethodNodes.isEmpty()) + throw new RuntimeException( + "No method instruction node found matching " + owner + " " + names[0] + " " + desc); + if (matchedMethodNodes.size() > 1) + LOGGER.warn("Too many matched instructions were found in " + methodNode.name + " for " + owner + " " + + names[0] + " " + desc + ". Crashes or bugs may occur!"); + + return matchedMethodNodes.get(matchedMethodNodes.size() - 1); + } + + public static List matchMethodInsnNodes(MethodNode methodNode, int opcode, String owner, + String[] names, String desc) { + ArrayList matches = Lists.newArrayList(); + ArrayList validMethodNames = Lists.newArrayList(names); + + for (AbstractInsnNode insnNode : methodNode.instructions.toArray()) { + if (insnNode instanceof MethodInsnNode && insnNode.getOpcode() == opcode) { + MethodInsnNode methodInsnNode = (MethodInsnNode) insnNode; + + if (methodInsnNode.owner.equals(owner) & validMethodNames.contains(methodInsnNode.name) + && methodInsnNode.desc.equals(desc)) { + matches.add(methodInsnNode); + } + } + } + + return matches; + } + + public static void verifyClassHash(String className, byte[] bytes, String... expectedHashes) { + String currentHash = DigestUtils.md5Hex(bytes); + + if (!Lists.newArrayList(expectedHashes).contains(currentHash)) { + String error = String.format("Unexpected hash %s detected for class %s. Crashes or bugs may occur!", + currentHash, className); + LOGGER.error(error); + } else { + LOGGER.info(String.format("Valid hash %s found for class %s.", currentHash, className)); + } + } + + private static Printer printer = new Textifier(); + private static TraceMethodVisitor methodVisitor = new TraceMethodVisitor(printer); + + public static void printMethod(MethodNode methodNode) { + for (AbstractInsnNode insnNode : methodNode.instructions.toArray()) { + insnNode.accept(methodVisitor); + StringWriter stringWriter = new StringWriter(); + printer.print(new PrintWriter(stringWriter)); + printer.getText().clear(); + + LOGGER.info(stringWriter.toString().replace("\n", "")); + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/ObfHelper.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/ObfHelper.java new file mode 100644 index 00000000..8c0aaca6 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/ObfHelper.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.asm; + +import net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper; + +public class ObfHelper { + public static String createMethodDescriptor(boolean obfuscated, String returnType, String... types) { + String result = "("; + + for (String type : types) { + if (type.length() == 1) + result += type; + else { + result += "L" + (obfuscated ? FMLDeobfuscatingRemapper.INSTANCE.unmap(type) : type) + ";"; + } + } + + if (returnType.length() > 1) { + returnType = "L" + unmapType(obfuscated, returnType) + ";"; + } + + result += ")" + returnType; + + return result; + } + + public static String unmapType(boolean obfuscated, String type) { + return obfuscated ? FMLDeobfuscatingRemapper.INSTANCE.unmap(type) : type; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/TANLoadingPlugin.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/TANLoadingPlugin.java new file mode 100644 index 00000000..808d7eff --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/TANLoadingPlugin.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.asm; + +import java.util.Map; + +import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; + +public class TANLoadingPlugin implements IFMLLoadingPlugin { + @Override + public String[] getASMTransformerClass() { + return new String[] { + "toughasnails.asm.transformer.CropDecayTransformer", + "toughasnails.asm.transformer.EntityRendererTransformer", + "toughasnails.asm.transformer.WorldTransformer" }; + } + + @Override + public String getModContainerClass() { + return null; + } + + @Override + public String getSetupClass() { + return null; + } + + @Override + public void injectData(Map data) { + } + + @Override + public String getAccessTransformerClass() { + return null; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/transformer/CropDecayTransformer.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/transformer/CropDecayTransformer.java new file mode 100644 index 00000000..65b88928 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/transformer/CropDecayTransformer.java @@ -0,0 +1,135 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.asm.transformer; + +import java.io.PrintWriter; +import java.util.List; + +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.InsnList; +import org.objectweb.asm.tree.InsnNode; +import org.objectweb.asm.tree.LdcInsnNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; +import org.objectweb.asm.tree.VarInsnNode; +import org.objectweb.asm.util.TraceClassVisitor; + +import com.google.common.collect.Lists; + +import net.minecraft.launchwrapper.IClassTransformer; +import toughasnails.asm.ASMHelper; +import toughasnails.asm.ObfHelper; + +public class CropDecayTransformer implements IClassTransformer { + private static final String[] VALID_HASHES = new String[] { + // BlockCrops + "3d74307bb515539176e7a84967b10a28", "b835f0bbb24031fee6ad804d8c48d2dc", + // BlockStem + "6a28b8cb3a448cb0b9fa7f5c5d7df8d9" }; + + private static final String[] UPDATE_TICK_NAMES = new String[] { "updateTick", "func_180650_b", "b" }; + + @Override + public byte[] transform(String name, String transformedName, byte[] basicClass) { + if (transformedName.equals("net.minecraft.block.BlockCrops") + || transformedName.equals("net.minecraft.block.BlockStem")) { + + // This is a vanilla crop; let's implement the interface and inject + // the crop decay hook + return transformToDecay(basicClass, !transformedName.equals(name), transformedName, true); + } else { + // Check if some crop implements the interface, and if it does then + // inject the crop decay hook + ClassReader classReader = new ClassReader(basicClass); + InterfaceCheckVisitor visitor = new InterfaceCheckVisitor("toughasnails/api/season/IDecayableCrop"); + classReader.accept(visitor, ClassReader.SKIP_CODE); + if (visitor.isInterfaceFound) { + return transformToDecay(basicClass, !transformedName.equals(name), transformedName, false); + } + } + + return basicClass; + } + + private byte[] transformToDecay(byte[] bytes, boolean obfuscatedClass, String name, boolean isVanilla) { + System.out.println("Executing transform-to-decay"); + + // Decode the class from bytes + ClassNode classNode = new ClassNode(); + ClassReader classReader = new ClassReader(bytes); + System.out.println("Class reader debug output:"); + classReader.accept(classNode, 0); + classReader.accept(new TraceClassVisitor(new PrintWriter(System.out)), 0); + + if (isVanilla) { + // Check this class is unmodified + ASMHelper.verifyClassHash(name, bytes, VALID_HASHES); + // Vanilla crops need the interface added + classNode.interfaces.add("toughasnails/api/season/IDecayableCrop"); + + } + + List successfulTransformations = Lists.newArrayList(); + + // Iterate over the methods in the class + System.out.println("Iterating transform methodNodes"); + for (MethodNode methodNode : classNode.methods) { + if (ASMHelper.methodEquals(methodNode, UPDATE_TICK_NAMES, + ObfHelper.createMethodDescriptor(obfuscatedClass, "V", "net/minecraft/world/World", + "net/minecraft/util/math/BlockPos", "net/minecraft/block/state/IBlockState", + "java/util/Random"))) { + InsnList insnList = new InsnList(); + + // Get the current season + insnList.add(new VarInsnNode(Opcodes.ALOAD, 0)); + insnList.add(new VarInsnNode(Opcodes.ALOAD, 1)); + insnList.add(new VarInsnNode(Opcodes.ALOAD, 2)); + insnList.add( + new MethodInsnNode(Opcodes.INVOKESTATIC, "toughasnails/season/SeasonASMHelper", "onUpdateTick", + ObfHelper.createMethodDescriptor(obfuscatedClass, "V", "net/minecraft/block/Block", + "net/minecraft/world/World", "net/minecraft/util/math/BlockPos"), + false)); + + // Insert our new instructions before returning + methodNode.instructions.insertBefore(methodNode.instructions + .get(methodNode.instructions.indexOf(methodNode.instructions.getLast()) - 1), insnList); + + successfulTransformations.add(methodNode.name + " " + methodNode.desc); + } + } + + if (isVanilla) { + System.out.println("Is vanilla!"); + + // The vanilla method does not exist? What is this sorcery?!? + if (successfulTransformations.size() != 1) { + throw new RuntimeException("An error occurred transforming " + name + ". Applied transformations: " + + successfulTransformations.toString()); + } + + // Implement shouldDecay() method, which simply returns true. The + // method allows subclasses to override behavior. + MethodNode decayMethod = new MethodNode(Opcodes.ACC_PUBLIC, "shouldDecay", "()Z", null, null); + InsnList decayInsns = new InsnList(); + decayInsns.add(new LdcInsnNode(new Integer(1))); + decayInsns.add(new InsnNode(Opcodes.IRETURN)); + decayMethod.instructions.add(decayInsns); + classNode.methods.add(decayMethod); + } + + // Encode the altered class back into bytes + ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS); + classNode.accept(writer); + bytes = writer.toByteArray(); + + return bytes; + } +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/transformer/EntityRendererTransformer.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/transformer/EntityRendererTransformer.java new file mode 100644 index 00000000..40f6b2f7 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/transformer/EntityRendererTransformer.java @@ -0,0 +1,99 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.asm.transformer; + +import java.util.List; + +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; + +import com.google.common.collect.Lists; + +import net.minecraft.launchwrapper.IClassTransformer; +import toughasnails.asm.ASMHelper; +import toughasnails.asm.ObfHelper; + +public class EntityRendererTransformer implements IClassTransformer { + private static final String[] VALID_HASHES = new String[] { "7039efd63c08f2d8fa9f000a4a194d5c", + "48321722b6b3220fc8d2b5dd4a703476" }; + + private static final String[] RENDER_RAIN_SNOW_NAMES = new String[] { "renderRainSnow", "func_78474_d", "c" }; + private static final String[] ADD_RAIN_PARTICLES_NAMES = new String[] { "addRainParticles", "func_78484_h", "p" }; + + private static final String[] GET_FLOAT_TEMPERATURE_NAMES = new String[] { "getFloatTemperature", "func_180626_a", + "a" }; + + @Override + public byte[] transform(String name, String transformedName, byte[] basicClass) { + if (transformedName.equals("net.minecraft.client.renderer.EntityRenderer")) { + return transformEntityRenderer(basicClass, !transformedName.equals(name)); + } + + return basicClass; + } + + private byte[] transformEntityRenderer(byte[] bytes, boolean obfuscatedClass) { + // Decode the class from bytes + ClassNode classNode = new ClassNode(); + ClassReader classReader = new ClassReader(bytes); + classReader.accept(classNode, 0); + + // Check this class is unmodified + ASMHelper.verifyClassHash("EntityRenderer", bytes, VALID_HASHES); + + List successfulTransformations = Lists.newArrayList(); + + // Iterate over the methods in the class + for (MethodNode methodNode : classNode.methods) { + if (ASMHelper.methodEquals(methodNode, RENDER_RAIN_SNOW_NAMES, "(F)V")) { + MethodInsnNode targetMethodInsnNode = ASMHelper.getUniqueMethodInsnNode(methodNode, + Opcodes.INVOKEVIRTUAL, ObfHelper.unmapType(obfuscatedClass, "net/minecraft/world/biome/Biome"), + GET_FLOAT_TEMPERATURE_NAMES, + ObfHelper.createMethodDescriptor(obfuscatedClass, "F", "net/minecraft/util/math/BlockPos")); + + // Redirect the call to our own version of getFloatTemperature + targetMethodInsnNode.setOpcode(Opcodes.INVOKESTATIC); + targetMethodInsnNode.owner = "toughasnails/season/SeasonASMHelper"; + targetMethodInsnNode.name = "getFloatTemperature"; + targetMethodInsnNode.desc = ObfHelper.createMethodDescriptor(obfuscatedClass, "F", + "net/minecraft/world/biome/Biome", "net/minecraft/util/math/BlockPos"); + + successfulTransformations.add(methodNode.name + " " + methodNode.desc); + } else if (ASMHelper.methodEquals(methodNode, ADD_RAIN_PARTICLES_NAMES, "()V")) { + MethodInsnNode targetMethodInsnNode = ASMHelper.getUniqueMethodInsnNode(methodNode, + Opcodes.INVOKEVIRTUAL, ObfHelper.unmapType(obfuscatedClass, "net/minecraft/world/biome/Biome"), + GET_FLOAT_TEMPERATURE_NAMES, + ObfHelper.createMethodDescriptor(obfuscatedClass, "F", "net/minecraft/util/math/BlockPos")); + + // Redirect the call to our own version of getFloatTemperature + targetMethodInsnNode.setOpcode(Opcodes.INVOKESTATIC); + targetMethodInsnNode.owner = "toughasnails/season/SeasonASMHelper"; + targetMethodInsnNode.name = "getFloatTemperature"; + targetMethodInsnNode.desc = ObfHelper.createMethodDescriptor(obfuscatedClass, "F", + "net/minecraft/world/biome/Biome", "net/minecraft/util/math/BlockPos"); + + successfulTransformations.add(methodNode.name + " " + methodNode.desc); + } + } + + if (successfulTransformations.size() != 2) + throw new RuntimeException("An error occurred transforming EntityRenderer. Applied transformations: " + + successfulTransformations.toString()); + + // Encode the altered class back into bytes + ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS); + classNode.accept(writer); + bytes = writer.toByteArray(); + + return bytes; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/transformer/InterfaceCheckVisitor.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/transformer/InterfaceCheckVisitor.java new file mode 100644 index 00000000..0dfef6fc --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/transformer/InterfaceCheckVisitor.java @@ -0,0 +1,26 @@ +package toughasnails.asm.transformer; + +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.Opcodes; + +public class InterfaceCheckVisitor extends ClassVisitor { + public boolean isInterfaceFound; + public String searchInterface; + + public InterfaceCheckVisitor(String searchInterface) { + super(Opcodes.ASM5); + this.isInterfaceFound = false; + this.searchInterface = searchInterface; + } + + @Override + public void visit(int version, int access, String name, String signature, + String superName, String[] interfaces) { + for (String iface : interfaces) { + if (iface.equals(searchInterface)) { + isInterfaceFound = true; + return; + } + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/transformer/WorldTransformer.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/transformer/WorldTransformer.java new file mode 100644 index 00000000..0cbf86c0 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/asm/transformer/WorldTransformer.java @@ -0,0 +1,225 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.asm.transformer; + +import java.util.List; + +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.InsnList; +import org.objectweb.asm.tree.InsnNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; +import org.objectweb.asm.tree.VarInsnNode; + +import com.google.common.collect.Lists; + +import net.minecraft.launchwrapper.IClassTransformer; +import toughasnails.asm.ASMHelper; +import toughasnails.asm.ObfHelper; + +public class WorldTransformer implements IClassTransformer { + private static final String[] VALID_HASHES = new String[] { + "547d356661b3b86facf7043fb930bcfb", + "a812fff5e65c73ca82f3f2c9ddd2fb03" }; + + private static final String[] CAN_SNOW_AT_NAMES = new String[] { + "canSnowAt", "func_175708_f", "f" }; + private static final String[] CAN_BLOCK_FREEZE_NAMES = new String[] { + "canBlockFreeze", "func_175670_e", "e" }; + private static final String[] IS_RAINING_AT_NAMES = new String[] { + "isRainingAt", "func_175727_C", "B" }; + private static final String[] GET_BIOME_GEN_FOR_COORDS_NAMES = new String[] { + "getBiome", "func_180494_b", "b" }; + + @Override + public byte[] transform(String name, String transformedName, + byte[] basicClass) { + if (transformedName.equals("net.minecraft.world.World")) { + return transformWorld(basicClass, !transformedName.equals(name)); + } + + return basicClass; + } + + private byte[] transformWorld(byte[] bytes, boolean obfuscatedClass) { + // Decode the class from bytes + ClassNode classNode = new ClassNode(); + ClassReader classReader = new ClassReader(bytes); + classReader.accept(classNode, 0); + + // Check this class is unmodified + ASMHelper.verifyClassHash("World", bytes, VALID_HASHES); + + List successfulTransformations = Lists.newArrayList(); + + // Iterate over the methods in the class + for (MethodNode methodNode : classNode.methods) { + if (ASMHelper.methodEquals(methodNode, CAN_SNOW_AT_NAMES, + ObfHelper.createMethodDescriptor(obfuscatedClass, "Z", + "net/minecraft/util/math/BlockPos", "Z"))) { + InsnList insnList = new InsnList(); + + // Get the current season + insnList.add(new VarInsnNode(Opcodes.ALOAD, 0)); + insnList.add(new MethodInsnNode(Opcodes.INVOKESTATIC, + "toughasnails/api/season/SeasonHelper", "getSeasonData", + ObfHelper.createMethodDescriptor(obfuscatedClass, + "toughasnails/api/season/ISeasonData", + "net/minecraft/world/World"), + false)); + insnList.add(new MethodInsnNode(Opcodes.INVOKEINTERFACE, + "toughasnails/api/season/ISeasonData", "getSubSeason", + "()Ltoughasnails/api/season/Season$SubSeason;", true)); + insnList.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, + "toughasnails/api/season/Season$SubSeason", "getSeason", + "()Ltoughasnails/api/season/Season;", false)); + insnList.add(new VarInsnNode(Opcodes.ASTORE, 3)); + + // Invoke our replacement method + insnList.add(new VarInsnNode(Opcodes.ALOAD, 0)); + insnList.add(new VarInsnNode(Opcodes.ALOAD, 1)); + insnList.add(new VarInsnNode(Opcodes.ILOAD, 2)); + insnList.add(new VarInsnNode(Opcodes.ALOAD, 3)); + insnList.add(new MethodInsnNode(Opcodes.INVOKESTATIC, + "toughasnails/season/SeasonASMHelper", + "canSnowAtInSeason", + ObfHelper.createMethodDescriptor(obfuscatedClass, "Z", + "net/minecraft/world/World", + "net/minecraft/util/math/BlockPos", "Z", + "toughasnails/api/season/Season"), + false)); + insnList.add(new InsnNode(Opcodes.IRETURN)); + + // Substitute existing instructions with our new ones + methodNode.instructions.clear(); + methodNode.instructions.insert(insnList); + + successfulTransformations + .add(methodNode.name + " " + methodNode.desc); + } else + if (ASMHelper.methodEquals(methodNode, CAN_BLOCK_FREEZE_NAMES, + ObfHelper.createMethodDescriptor(obfuscatedClass, "Z", + "net/minecraft/util/math/BlockPos", "Z"))) { + InsnList insnList = new InsnList(); + + // Get the current season + insnList.add(new VarInsnNode(Opcodes.ALOAD, 0)); + insnList.add(new MethodInsnNode(Opcodes.INVOKESTATIC, + "toughasnails/api/season/SeasonHelper", "getSeasonData", + ObfHelper.createMethodDescriptor(obfuscatedClass, + "toughasnails/api/season/ISeasonData", + "net/minecraft/world/World"), + false)); + insnList.add(new MethodInsnNode(Opcodes.INVOKEINTERFACE, + "toughasnails/api/season/ISeasonData", "getSubSeason", + "()Ltoughasnails/api/season/Season$SubSeason;", true)); + insnList.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, + "toughasnails/api/season/Season$SubSeason", "getSeason", + "()Ltoughasnails/api/season/Season;", false)); + insnList.add(new VarInsnNode(Opcodes.ASTORE, 3)); + + // Invoke our replacement method + insnList.add(new VarInsnNode(Opcodes.ALOAD, 0)); + insnList.add(new VarInsnNode(Opcodes.ALOAD, 1)); + insnList.add(new VarInsnNode(Opcodes.ILOAD, 2)); + insnList.add(new VarInsnNode(Opcodes.ALOAD, 3)); + insnList.add(new MethodInsnNode(Opcodes.INVOKESTATIC, + "toughasnails/season/SeasonASMHelper", + "canBlockFreezeInSeason", + ObfHelper.createMethodDescriptor(obfuscatedClass, "Z", + "net/minecraft/world/World", + "net/minecraft/util/math/BlockPos", "Z", + "toughasnails/api/season/Season"), + false)); + insnList.add(new InsnNode(Opcodes.IRETURN)); + + // Substitute existing instructions with our new ones + methodNode.instructions.clear(); + methodNode.instructions.insert(insnList); + + successfulTransformations + .add(methodNode.name + " " + methodNode.desc); + } else if (ASMHelper.methodEquals(methodNode, IS_RAINING_AT_NAMES, + ObfHelper.createMethodDescriptor(obfuscatedClass, "Z", + "net/minecraft/util/math/BlockPos"))) { + InsnList insnList = new InsnList(); + + // Get the current season + insnList.add(new VarInsnNode(Opcodes.ALOAD, 0)); + insnList.add(new MethodInsnNode(Opcodes.INVOKESTATIC, + "toughasnails/api/season/SeasonHelper", "getSeasonData", + ObfHelper.createMethodDescriptor(obfuscatedClass, + "toughasnails/api/season/ISeasonData", + "net/minecraft/world/World"), + false)); + insnList.add(new MethodInsnNode(Opcodes.INVOKEINTERFACE, + "toughasnails/api/season/ISeasonData", "getSubSeason", + "()Ltoughasnails/api/season/Season$SubSeason;", true)); + insnList.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, + "toughasnails/api/season/Season$SubSeason", "getSeason", + "()Ltoughasnails/api/season/Season;", false)); + insnList.add(new VarInsnNode(Opcodes.ASTORE, 2)); + + // Invoke our replacement method + insnList.add(new VarInsnNode(Opcodes.ALOAD, 0)); + insnList.add(new VarInsnNode(Opcodes.ALOAD, 1)); + insnList.add(new VarInsnNode(Opcodes.ALOAD, 2)); + insnList.add(new MethodInsnNode(Opcodes.INVOKESTATIC, + "toughasnails/season/SeasonASMHelper", + "isRainingAtInSeason", + ObfHelper.createMethodDescriptor(obfuscatedClass, "Z", + "net/minecraft/world/World", + "net/minecraft/util/math/BlockPos", + "toughasnails/api/season/Season"), + false)); + insnList.add(new InsnNode(Opcodes.ICONST_0)); // Necessary for + // compatibility + // with + // RandomThingsCore + insnList.add(new InsnNode(Opcodes.IRETURN)); + + MethodInsnNode invokeMethodNode = ASMHelper + .getUniqueMethodInsnNode(methodNode, + Opcodes.INVOKEVIRTUAL, + ObfHelper.unmapType(obfuscatedClass, + "net/minecraft/world/World"), + GET_BIOME_GEN_FOR_COORDS_NAMES, + ObfHelper.createMethodDescriptor( + obfuscatedClass, + "net/minecraft/world/biome/Biome", + "net/minecraft/util/math/BlockPos")); + AbstractInsnNode insertionPoint = methodNode.instructions.get( + methodNode.instructions.indexOf(invokeMethodNode) - 2); + + // Insert our new instructions before the insertion point + methodNode.instructions.insertBefore(insertionPoint, insnList); + + ASMHelper.clearNextInstructions(methodNode, insertionPoint); + + successfulTransformations + .add(methodNode.name + " " + methodNode.desc); + } + } + + if (successfulTransformations.size() != 3) + throw new RuntimeException( + "An error occurred transforming World. Applied transformations: " + + successfulTransformations.toString()); + + // Encode the altered class back into bytes + ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS); + classNode.accept(writer); + bytes = writer.toByteArray(); + + return bytes; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockGlowstoneTorch.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockGlowstoneTorch.java new file mode 100644 index 00000000..fb0feda2 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockGlowstoneTorch.java @@ -0,0 +1,297 @@ +package toughasnails.block; + +import javax.annotation.Nullable; + +import com.google.common.base.Predicate; + +import net.minecraft.block.Block; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.Mirror; +import net.minecraft.util.Rotation; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.ITANBlock; +import toughasnails.item.ItemTANBlock; + +public class BlockGlowstoneTorch extends Block implements ITANBlock { + public static final PropertyDirection FACING = PropertyDirection.create("facing", new Predicate() { + public boolean apply(@Nullable EnumFacing p_apply_1_) { + return p_apply_1_ != EnumFacing.DOWN; + } + }); + + // implement ITANBlock + @Override + public Class getItemClass() { + return ItemTANBlock.class; + } + + @SuppressWarnings("rawtypes") + @Override + public IProperty[] getPresetProperties() { + return new IProperty[] {}; + } + + @SuppressWarnings("rawtypes") + @Override + public IProperty[] getNonRenderingProperties() { + return null; + } + + @Override + public String getStateName(IBlockState state) { + return ""; + } + + protected static final AxisAlignedBB STANDING_AABB = new AxisAlignedBB(0.4000000059604645D, 0.0D, + 0.4000000059604645D, 0.6000000238418579D, 0.6000000238418579D, 0.6000000238418579D); + protected static final AxisAlignedBB TORCH_NORTH_AABB = new AxisAlignedBB(0.3499999940395355D, 0.20000000298023224D, + 0.699999988079071D, 0.6499999761581421D, 0.800000011920929D, 1.0D); + protected static final AxisAlignedBB TORCH_SOUTH_AABB = new AxisAlignedBB(0.3499999940395355D, 0.20000000298023224D, + 0.0D, 0.6499999761581421D, 0.800000011920929D, 0.30000001192092896D); + protected static final AxisAlignedBB TORCH_WEST_AABB = new AxisAlignedBB(0.699999988079071D, 0.20000000298023224D, + 0.3499999940395355D, 1.0D, 0.800000011920929D, 0.6499999761581421D); + protected static final AxisAlignedBB TORCH_EAST_AABB = new AxisAlignedBB(0.0D, 0.20000000298023224D, + 0.3499999940395355D, 0.30000001192092896D, 0.800000011920929D, 0.6499999761581421D); + + public BlockGlowstoneTorch() { + super(Material.CIRCUITS); + this.setHardness(0.0F); + this.setSoundType(SoundType.WOOD); + this.setLightLevel(1.0F); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.UP)); + this.setTickRandomly(true); + } + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + switch ((EnumFacing) state.getValue(FACING)) { + case EAST: + return TORCH_EAST_AABB; + case WEST: + return TORCH_WEST_AABB; + case SOUTH: + return TORCH_SOUTH_AABB; + case NORTH: + return TORCH_NORTH_AABB; + default: + return STANDING_AABB; + } + } + + @Nullable + @Override + public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos) { + return NULL_AABB; + } + + @Override + public boolean isOpaqueCube(IBlockState state) { + return false; + } + + @Override + public boolean isFullCube(IBlockState state) { + return false; + } + + private boolean canPlaceOn(World worldIn, BlockPos pos) { + IBlockState state = worldIn.getBlockState(pos); + if (state.isSideSolid(worldIn, pos, EnumFacing.UP)) { + return true; + } else { + return state.getBlock().canPlaceTorchOnTop(state, worldIn, pos); + } + } + + @Override + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) { + for (EnumFacing enumfacing : FACING.getAllowedValues()) { + if (this.canPlaceAt(worldIn, pos, enumfacing)) { + return true; + } + } + + return false; + } + + private boolean canPlaceAt(World worldIn, BlockPos pos, EnumFacing facing) { + BlockPos blockpos = pos.offset(facing.getOpposite()); + boolean flag = facing.getAxis().isHorizontal(); + return flag && worldIn.isSideSolid(blockpos, facing, true) + || facing.equals(EnumFacing.UP) && this.canPlaceOn(worldIn, blockpos); + } + + @Override + public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, + float hitZ, int meta, EntityLivingBase placer, ItemStack stack) { + if (this.canPlaceAt(world, pos, facing)) { + return this.getDefaultState().withProperty(FACING, facing); + } else { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + if (world.isSideSolid(pos.offset(enumfacing.getOpposite()), enumfacing, true)) { + return this.getDefaultState().withProperty(FACING, enumfacing); + } + } + + return this.getDefaultState(); + } + } + + @Override + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { + this.checkForDrop(worldIn, pos, state); + } + + @Override + public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn) { + this.onNeighborChangeInternal(worldIn, pos, state); + } + + protected boolean onNeighborChangeInternal(World worldIn, BlockPos pos, IBlockState state) { + if (!this.checkForDrop(worldIn, pos, state)) { + return true; + } else { + EnumFacing enumfacing = (EnumFacing) state.getValue(FACING); + EnumFacing.Axis enumfacing$axis = enumfacing.getAxis(); + EnumFacing enumfacing1 = enumfacing.getOpposite(); + boolean flag = false; + + if (enumfacing$axis.isHorizontal() && !worldIn.isSideSolid(pos.offset(enumfacing1), enumfacing, true)) { + flag = true; + } else if (enumfacing$axis.isVertical() && !this.canPlaceOn(worldIn, pos.offset(enumfacing1))) { + flag = true; + } + + if (flag) { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + return true; + } else { + return false; + } + } + } + + protected boolean checkForDrop(World worldIn, BlockPos pos, IBlockState state) { + if (state.getBlock() == this && this.canPlaceAt(worldIn, pos, (EnumFacing) state.getValue(FACING))) { + return true; + } else { + if (worldIn.getBlockState(pos).getBlock() == this) { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + + return false; + } + } + + /* + * @SideOnly(Side.CLIENT) + * + * @Override public void randomDisplayTick(IBlockState stateIn, World + * worldIn, BlockPos pos, Random rand) { EnumFacing enumfacing = + * (EnumFacing)stateIn.getValue(FACING); double d0 = (double)pos.getX() + + * 0.5D; double d1 = (double)pos.getY() + 0.7D; double d2 = + * (double)pos.getZ() + 0.5D; double d3 = 0.22D; double d4 = 0.27D; + * + * if (enumfacing.getAxis().isHorizontal()) { EnumFacing enumfacing1 = + * enumfacing.getOpposite(); + * worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4 * + * (double)enumfacing1.getFrontOffsetX(), d1 + d3, d2 + d4 * + * (double)enumfacing1.getFrontOffsetZ(), 0.0D, 0.0D, 0.0D, new int[0]); + * worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4 * + * (double)enumfacing1.getFrontOffsetX(), d1 + d3, d2 + d4 * + * (double)enumfacing1.getFrontOffsetZ(), 0.0D, 0.0D, 0.0D, new int[0]); } + * else { worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, + * 0.0D, 0.0D, 0.0D, new int[0]); + * worldIn.spawnParticle(EnumParticleTypes.FLAME, d0, d1, d2, 0.0D, 0.0D, + * 0.0D, new int[0]); } } + */ + + @Override + public IBlockState getStateFromMeta(int meta) { + IBlockState iblockstate = this.getDefaultState(); + + switch (meta) { + case 1: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.EAST); + break; + case 2: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.WEST); + break; + case 3: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.SOUTH); + break; + case 4: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.NORTH); + break; + case 5: + default: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.UP); + } + + return iblockstate; + } + + @SideOnly(Side.CLIENT) + @Override + public BlockRenderLayer getBlockLayer() { + return BlockRenderLayer.CUTOUT; + } + + @Override + public int getMetaFromState(IBlockState state) { + int i = 0; + + switch ((EnumFacing) state.getValue(FACING)) { + case EAST: + i = i | 1; + break; + case WEST: + i = i | 2; + break; + case SOUTH: + i = i | 3; + break; + case NORTH: + i = i | 4; + break; + case DOWN: + case UP: + default: + i = i | 5; + } + + return i; + } + + @Override + public IBlockState withRotation(IBlockState state, Rotation rot) { + return state.withProperty(FACING, rot.rotate((EnumFacing) state.getValue(FACING))); + } + + @Override + public IBlockState withMirror(IBlockState state, Mirror mirrorIn) { + return state.withRotation(mirrorIn.toRotation((EnumFacing) state.getValue(FACING))); + } + + @Override + protected BlockStateContainer createBlockState() { + return new BlockStateContainer(this, new IProperty[] { FACING }); + } +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockRainCollector.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockRainCollector.java new file mode 100644 index 00000000..19012880 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockRainCollector.java @@ -0,0 +1,185 @@ +package toughasnails.block; + +import javax.annotation.Nullable; + +import net.minecraft.block.Block; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Items; +import net.minecraft.init.PotionTypes; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionUtils; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.ITANBlock; +import toughasnails.api.item.TANItems; +import toughasnails.item.ItemTANBlock; + +public class BlockRainCollector extends Block implements ITANBlock { + public static final PropertyInteger LEVEL = PropertyInteger.create("level", 0, 3); + + // implement ITANBlock + @Override + public Class getItemClass() { + return ItemTANBlock.class; + } + + @SuppressWarnings("rawtypes") + @Override + public IProperty[] getPresetProperties() { + return new IProperty[] {}; + } + + @SuppressWarnings("rawtypes") + @Override + public IProperty[] getNonRenderingProperties() { + return null; + } + + @Override + public String getStateName(IBlockState state) { + return ""; + } + + public BlockRainCollector() { + super(Material.IRON, MapColor.STONE); + this.setHardness(2.0F); + this.setDefaultState(this.blockState.getBaseState().withProperty(LEVEL, Integer.valueOf(0))); + } + + @Override + public boolean isOpaqueCube(IBlockState state) { + return false; + } + + @Override + public boolean isFullCube(IBlockState state) { + return false; + } + + @SideOnly(Side.CLIENT) + @Override + public BlockRenderLayer getBlockLayer() { + return BlockRenderLayer.CUTOUT; + } + + @Override + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, + EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { + if (heldItem == null) { + return true; + } else { + int i = ((Integer) state.getValue(LEVEL)).intValue(); + Item item = heldItem.getItem(); + + if (item == Items.BUCKET) { + if (i == 3 && !worldIn.isRemote) { + if (!playerIn.capabilities.isCreativeMode) { + --heldItem.stackSize; + + if (heldItem.stackSize == 0) { + playerIn.setHeldItem(hand, new ItemStack(Items.WATER_BUCKET)); + } else if (!playerIn.inventory.addItemStackToInventory(new ItemStack(Items.WATER_BUCKET))) { + playerIn.dropItem(new ItemStack(Items.WATER_BUCKET), false); + } + } + + // playerIn.addStat(StatList.CAULDRON_USED); + this.setWaterLevel(worldIn, pos, state, 0); + } + + return true; + } else if (item == Items.GLASS_BOTTLE) { + if (i > 0 && !worldIn.isRemote) { + if (!playerIn.capabilities.isCreativeMode) { + ItemStack itemstack1 = PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), + PotionTypes.WATER); + + if (--heldItem.stackSize == 0) { + playerIn.setHeldItem(hand, itemstack1); + } else if (!playerIn.inventory.addItemStackToInventory(itemstack1)) { + playerIn.dropItem(itemstack1, false); + } else if (playerIn instanceof EntityPlayerMP) { + ((EntityPlayerMP) playerIn).sendContainerToPlayer(playerIn.inventoryContainer); + } + } + + this.setWaterLevel(worldIn, pos, state, i - 1); + } + + return true; + } else if (item == TANItems.canteen) { + if (i > 0 && !worldIn.isRemote) { + if (!playerIn.capabilities.isCreativeMode) { + heldItem.setItemDamage(3); + } + + this.setWaterLevel(worldIn, pos, state, i - 1); + } + + return true; + } else { + return false; + } + } + } + + public void setWaterLevel(World worldIn, BlockPos pos, IBlockState state, int level) { + worldIn.setBlockState(pos, state.withProperty(LEVEL, Integer.valueOf(MathHelper.clamp_int(level, 0, 3))), 2); + worldIn.updateComparatorOutputLevel(pos, this); + } + + @Override + public void fillWithRain(World worldIn, BlockPos pos) { + if (worldIn.rand.nextInt(4) == 1) { + float f = worldIn.getBiome(pos).getFloatTemperature(pos); + + if (worldIn.getBiomeProvider().getTemperatureAtHeight(f, pos.getY()) >= 0.15F) { + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (((Integer) iblockstate.getValue(LEVEL)).intValue() < 3) { + worldIn.setBlockState(pos, iblockstate.cycleProperty(LEVEL), 2); + } + } + } + } + + @Override + public boolean hasComparatorInputOverride(IBlockState state) { + return true; + } + + @Override + public int getComparatorInputOverride(IBlockState blockState, World worldIn, BlockPos pos) { + return ((Integer) blockState.getValue(LEVEL)).intValue(); + } + + @Override + public IBlockState getStateFromMeta(int meta) { + return this.getDefaultState().withProperty(LEVEL, Integer.valueOf(meta)); + } + + @Override + public int getMetaFromState(IBlockState state) { + return ((Integer) state.getValue(LEVEL)).intValue(); + } + + @Override + protected BlockStateContainer createBlockState() { + return new BlockStateContainer(this, new IProperty[] { LEVEL }); + } +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockSeasonSensor.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockSeasonSensor.java new file mode 100644 index 00000000..181dc576 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockSeasonSensor.java @@ -0,0 +1,189 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.block; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import toughasnails.api.ITANBlock; +import toughasnails.api.TANBlocks; +import toughasnails.api.season.SeasonHelper; +import toughasnails.item.ItemTANBlock; +import toughasnails.season.SeasonTime; +import toughasnails.tileentity.TileEntitySeasonSensor; + +public class BlockSeasonSensor extends BlockContainer implements ITANBlock { + public static final PropertyInteger POWER = PropertyInteger.create("power", 0, 15); + public static final AxisAlignedBB BOUNDING_BOX = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.375D, 1.0D); + + // implement ITANBlock + @Override + public Class getItemClass() { + return ItemTANBlock.class; + } + + @SuppressWarnings("rawtypes") + @Override + public IProperty[] getPresetProperties() { + return new IProperty[] {}; + } + + @SuppressWarnings("rawtypes") + @Override + public IProperty[] getNonRenderingProperties() { + return new IProperty[] { POWER }; + } + + @Override + public String getStateName(IBlockState state) { + return type.getName(); + } + + private final DetectorType type; + + public BlockSeasonSensor(DetectorType type) { + super(Material.WOOD); + this.type = type; + this.setHardness(0.2F); + this.setSoundType(SoundType.WOOD); + this.setDefaultState(this.blockState.getBaseState().withProperty(POWER, Integer.valueOf(0))); + } + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + return BOUNDING_BOX; + } + + @Override + public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { + return ((Integer) blockState.getValue(POWER)).intValue(); + } + + public void updatePower(World world, BlockPos pos) { + // Seasons currently only work in the overworld + if (world.provider.getDimension() == 0) { + IBlockState currentState = world.getBlockState(pos); + + int power = 0; + int startTicks = this.type.ordinal() * SeasonTime.SEASON_TICKS; + int endTicks = (this.type.ordinal() + 1) * SeasonTime.SEASON_TICKS; + int currentTicks = SeasonHelper.getSeasonData(world).getSeasonCycleTicks(); + + if (currentTicks >= startTicks && currentTicks <= endTicks) { + float delta = (float) (currentTicks - startTicks) / (float) SeasonTime.SEASON_TICKS; + // Delta adjusted so that it peaks at 0.5 (the middle of the + // month) + float peak = 2.0F * (-Math.abs(delta - 0.5F) + 0.5F); + // Add one so at the start of the season it is powered at least + // a little + power = (int) Math.min(peak * 15.0F + 1.0F, 15.0F); + } + + // Only update the state if the power level has actually changed + if (((Integer) currentState.getValue(POWER)).intValue() != power) { + world.setBlockState(pos, currentState.withProperty(POWER, Integer.valueOf(power)), 3); + } + } + } + + @Override + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, + ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { + if (player.isAllowEdit()) { + if (world.isRemote) { + return true; + } else { + Block nextBlock = TANBlocks.season_sensors[(this.type.ordinal() + 1) % DetectorType.values().length]; + world.setBlockState(pos, nextBlock.getDefaultState().withProperty(POWER, state.getValue(POWER)), 4); + ((BlockSeasonSensor) nextBlock).updatePower(world, pos); + return true; + } + } else { + return super.onBlockActivated(world, pos, state, player, hand, heldItem, side, hitX, hitY, hitZ); + } + } + + @Override + public Item getItemDropped(IBlockState state, Random rand, int fortune) { + return Item.getItemFromBlock(TANBlocks.season_sensors[0]); + } + + @Override + public boolean isFullCube(IBlockState state) { + return false; + } + + @Override + public boolean isOpaqueCube(IBlockState state) { + return false; + } + + @Override + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.MODEL; + } + + @Override + public boolean canProvidePower(IBlockState state) { + return true; + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) { + return new TileEntitySeasonSensor(); + } + + // map from state to meta and vice verca + @Override + public IBlockState getStateFromMeta(int meta) { + return this.getDefaultState().withProperty(POWER, meta); + } + + @Override + public int getMetaFromState(IBlockState state) { + return state.getValue(POWER); + } + + @Override + protected BlockStateContainer createBlockState() { + return new BlockStateContainer(this, new IProperty[] { POWER }); + } + + public static enum DetectorType implements IStringSerializable { + SPRING, SUMMER, AUTUMN, WINTER; + @Override + public String getName() { + return this.name().toLowerCase(); + } + + @Override + public String toString() { + return this.getName(); + } + }; +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockTANCampfire.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockTANCampfire.java new file mode 100644 index 00000000..381a0866 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockTANCampfire.java @@ -0,0 +1,279 @@ +package toughasnails.block; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.init.SoundEvents; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.ITANBlock; +import toughasnails.api.TANBlocks; +import toughasnails.api.achievement.TANAchievements; +import toughasnails.item.ItemTANBlock; + +public class BlockTANCampfire extends Block implements ITANBlock { + protected static final AxisAlignedBB SELECTION_BOX = new AxisAlignedBB(0.1D, 0.0D, 0.1D, 0.9D, 0.6D, 0.9D); + + public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 7); + public static final PropertyBool BURNING = PropertyBool.create("burning"); + + // implement IBOPBlock + @Override + public Class getItemClass() { + return ItemTANBlock.class; + } + + @SuppressWarnings("rawtypes") + @Override + public IProperty[] getPresetProperties() { + return new IProperty[] {}; + } + + @SuppressWarnings("rawtypes") + @Override + public IProperty[] getNonRenderingProperties() { + return null; + } + + @Override + public String getStateName(IBlockState state) { + return ""; + } + + public BlockTANCampfire() { + // use rock as default material + this(Material.ROCK); + } + + public BlockTANCampfire(Material material) { + super(material); + // set some defaults + this.setTickRandomly(true); + this.setHardness(0.7F); + this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0)).withProperty(BURNING, + Boolean.valueOf(false))); + this.setSoundType(SoundType.STONE); + } + + @Override + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { + super.updateTick(worldIn, pos, state, rand); + + int age = ((Integer) state.getValue(AGE)).intValue(); + + if (state.getValue(BURNING) == true) { + if (worldIn.isRainingAt(pos)) { + worldIn.setBlockState(pos, state.withProperty(BURNING, false).withProperty(AGE, 15), 2); + worldIn.playSound((EntityPlayer) null, pos, SoundEvents.BLOCK_LAVA_EXTINGUISH, SoundCategory.BLOCKS, + 0.5F, 2.6F + (worldIn.rand.nextFloat() - worldIn.rand.nextFloat()) * 0.8F); + for (int i = 0; i < 8; ++i) { + worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, + (double) ((float) pos.getX() + 0.75F - (rand.nextFloat() / 2.0F)), + (double) ((float) pos.getY() + 0.9F), + (double) ((float) pos.getZ() + 0.75F - (rand.nextFloat() / 2.0F)), 0.0D, 0.0D, 0.0D, + new int[] { Block.getStateId(state) }); + } + } + if (age < 7) { + if (rand.nextInt(8) == 0) { + worldIn.setBlockState(pos, state.withProperty(AGE, Integer.valueOf(age + 1)), 2); + } + } + if (age == 7) { + if (rand.nextInt(8) == 0) { + worldIn.setBlockState(pos, state.withProperty(BURNING, false), 2); + } + } + } + } + + @Override + public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) { + if (state.getValue(BURNING) == true) { + return 15; + } else { + return 0; + } + } + + @Override + public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World world, BlockPos pos) { + return SELECTION_BOX; + } + + // no collision box - you can walk straight through them + @Override + public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World world, BlockPos pos) { + return NULL_AABB; + } + + @Override + public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) { + if (state.getValue(BURNING) == true) { + if (entity instanceof EntityLivingBase) { + entity.setFire(1); + } + } + } + + @Override + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, + EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { + if (playerIn.getHeldItem(hand) != null) { + Item item = playerIn.getHeldItem(hand).getItem(); + int age = ((Integer) state.getValue(AGE)).intValue(); + + if (age == 0) { + if (state.getValue(BURNING) == false) { + if (!worldIn.isRainingAt(pos)) { + if (item == Items.STICK) { + if (worldIn.rand.nextInt(12) == 0) { + worldIn.setBlockState(pos, + TANBlocks.campfire.getDefaultState().withProperty(BURNING, true)); + playerIn.addStat(TANAchievements.campfire_song); + } + + if (item == Items.STICK) { + --playerIn.getHeldItem(hand).stackSize; + } + + return true; + } + + if (item == Items.FLINT_AND_STEEL) { + worldIn.playSound(playerIn, pos, SoundEvents.ITEM_FLINTANDSTEEL_USE, SoundCategory.BLOCKS, + 1.0F, worldIn.rand.nextFloat() * 0.4F + 0.8F); + worldIn.setBlockState(pos, + TANBlocks.campfire.getDefaultState().withProperty(BURNING, true)); + playerIn.addStat(TANAchievements.campfire_song); + + if (item == Items.FLINT_AND_STEEL) { + playerIn.getHeldItem(hand).damageItem(1, playerIn); + } + + return true; + } + } + } + } + } + + return super.onBlockActivated(worldIn, pos, state, playerIn, hand, heldItem, side, hitX, hitY, hitZ); + } + + @Override + @SideOnly(Side.CLIENT) + public void randomDisplayTick(IBlockState state, World worldIn, BlockPos pos, Random rand) { + // randomly throw up some particles so it looks like the flesh is + // bubbling + super.randomDisplayTick(state, worldIn, pos, rand); + + if (state.getValue(BURNING) == true) { + if (rand.nextInt(24) == 0) { + worldIn.playSound((double) ((float) pos.getX() + 0.5F), (double) ((float) pos.getY() + 0.5F), + (double) ((float) pos.getZ() + 0.5F), SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.BLOCKS, + 1.0F + rand.nextFloat(), rand.nextFloat() * 0.7F + 0.3F, false); + } + + worldIn.spawnParticle(EnumParticleTypes.FLAME, + (double) ((float) pos.getX() + 0.75F - (rand.nextFloat() / 2.0F)), + (double) ((float) pos.getY() + 0.25F + (rand.nextFloat() / 2.0F)), + (double) ((float) pos.getZ() + 0.75F - (rand.nextFloat() / 2.0F)), 0.0D, 0.0D, 0.0D, + new int[] { Block.getStateId(state) }); + worldIn.spawnParticle(EnumParticleTypes.FLAME, + (double) ((float) pos.getX() + 0.75F - (rand.nextFloat() / 2.0F)), + (double) ((float) pos.getY() + 0.25F + (rand.nextFloat() / 2.0F)), + (double) ((float) pos.getZ() + 0.75F - (rand.nextFloat() / 2.0F)), 0.0D, 0.0D, 0.0D, + new int[] { Block.getStateId(state) }); + worldIn.spawnParticle(EnumParticleTypes.FLAME, + (double) ((float) pos.getX() + 0.75F - (rand.nextFloat() / 2.0F)), + (double) ((float) pos.getY() + 0.25F + (rand.nextFloat() / 2.0F)), + (double) ((float) pos.getZ() + 0.75F - (rand.nextFloat() / 2.0F)), 0.0D, 0.0D, 0.0D, + new int[] { Block.getStateId(state) }); + + worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, + (double) ((float) pos.getX() + 0.75F - (rand.nextFloat() / 2.0F)), + (double) ((float) pos.getY() + 0.9F), + (double) ((float) pos.getZ() + 0.75F - (rand.nextFloat() / 2.0F)), 0.0D, 0.0D, 0.0D, + new int[] { Block.getStateId(state) }); + + if (rand.nextInt(2) == 0) { + worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, + (double) ((float) pos.getX() + 0.75F - (rand.nextFloat() / 2.0F)), + (double) ((float) pos.getY() + 0.9F), + (double) ((float) pos.getZ() + 0.75F - (rand.nextFloat() / 2.0F)), 0.0D, 0.0D, 0.0D, + new int[] { Block.getStateId(state) }); + } + } + } + + @Override + public int quantityDropped(Random random) { + return 0; // Campfires shouldn't drop anything when mined + } + + // not opaque + @Override + public boolean isOpaqueCube(IBlockState state) { + return false; + } + + // not full cube + @Override + public boolean isFullCube(IBlockState state) { + return false; + } + + @Override + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) { + return worldIn.getBlockState(pos).getBlock().isReplaceable(worldIn, pos) + && worldIn.getBlockState(pos.down()).isSideSolid(worldIn, pos, EnumFacing.UP); + } + + @SideOnly(Side.CLIENT) + @Override + public BlockRenderLayer getBlockLayer() { + return BlockRenderLayer.CUTOUT; + } + + @Override + public IBlockState getStateFromMeta(int meta) { + return this.getDefaultState().withProperty(AGE, meta >> 1).withProperty(BURNING, + Boolean.valueOf((meta & 1) > 0)); + } + + @Override + public int getMetaFromState(IBlockState state) { + int meta = state.getValue(AGE) << 1; + return ((Boolean) state.getValue(BURNING)).booleanValue() ? meta | 1 : meta; + } + + @Override + protected BlockStateContainer createBlockState() { + return new BlockStateContainer(this, new IProperty[] { AGE, BURNING }); + } + +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockTANDeadCrops.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockTANDeadCrops.java new file mode 100644 index 00000000..9a20017e --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockTANDeadCrops.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.block; + +import java.util.Random; + +import net.minecraft.block.BlockBush; +import net.minecraft.block.SoundType; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; + +public class BlockTANDeadCrops extends BlockBush +{ + private static final AxisAlignedBB BOUNDING_BOX = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.125D, 1.0D); + + public BlockTANDeadCrops() + { + this.setHardness(0.0F); + this.setSoundType(SoundType.PLANT); + this.disableStats(); + } + + @Override + protected boolean canSustainBush(IBlockState state) + { + return state.getBlock() == Blocks.FARMLAND; + } + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) + { + return BOUNDING_BOX; + } + + @Override + public int quantityDropped(Random random) + { + return 0; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockTANGas.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockTANGas.java new file mode 100644 index 00000000..9b4b8694 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockTANGas.java @@ -0,0 +1,269 @@ +package toughasnails.block; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.MobEffects; +import net.minecraft.item.ItemBlock; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.Explosion; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.ITANBlock; +import toughasnails.item.ItemTANBlock; + +public class BlockTANGas extends Block implements ITANBlock { + + // add properties + public static enum GasType implements IStringSerializable { + BLACKDAMP, WHITEDAMP, FIREDAMP, STINKDAMP; + @Override + public String getName() { + return this.name().toLowerCase(); + } + + @Override + public String toString() { + return this.getName(); + } + }; + + @SuppressWarnings("rawtypes") + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", GasType.class); + + @Override + protected BlockStateContainer createBlockState() { + return new BlockStateContainer(this, new IProperty[] { VARIANT }); + } + + // implement IBOPBlock + @Override + public Class getItemClass() { + return ItemTANBlock.class; + } + + @SuppressWarnings("rawtypes") + @Override + public IProperty[] getPresetProperties() { + return new IProperty[] { VARIANT }; + } + + @SuppressWarnings("rawtypes") + @Override + public IProperty[] getNonRenderingProperties() { + return null; + } + + @SuppressWarnings("unchecked") + @Override + public String getStateName(IBlockState state) { + return ((GasType) state.getValue(VARIANT)).getName() + "_block"; + } + + @SuppressWarnings("unchecked") + public BlockTANGas() { + super(Material.AIR); + // set some defaults + this.setHardness(0.0F); + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, GasType.BLACKDAMP)); + } + + @SuppressWarnings("unchecked") + @Override + public IBlockState getStateFromMeta(int meta) { + return this.getDefaultState().withProperty(VARIANT, GasType.values()[meta]); + } + + @SuppressWarnings("unchecked") + @Override + public int getMetaFromState(IBlockState state) { + return ((GasType) state.getValue(VARIANT)).ordinal(); + } + + @SuppressWarnings("unchecked") + @Override + @SideOnly(Side.CLIENT) + public void randomDisplayTick(IBlockState state, World worldIn, BlockPos pos, Random rand) { + // randomly throw up some particles so it looks like the flesh is + // bubbling + super.randomDisplayTick(state, worldIn, pos, rand); + + switch ((GasType) state.getValue(VARIANT)) { + case WHITEDAMP: + if (rand.nextInt(12) == 0) { + worldIn.spawnParticle(EnumParticleTypes.SPELL_MOB, + (double) ((float) pos.getX() + 0.75F - (rand.nextFloat() / 2.0F)), + (double) ((float) pos.getY() + 0.9F), + (double) ((float) pos.getZ() + 0.75F - (rand.nextFloat() / 2.0F)), 0.0D, 0.0D, 0.0D, + new int[] { Block.getStateId(state) }); + } + + case STINKDAMP: + if (rand.nextInt(12) == 0) { + worldIn.spawnParticle(EnumParticleTypes.SPELL_MOB, + (double) ((float) pos.getX() + 0.75F - (rand.nextFloat() / 2.0F)), + (double) ((float) pos.getY() + 0.9F), + (double) ((float) pos.getZ() + 0.75F - (rand.nextFloat() / 2.0F)), 0.0D, 0.0D, 0.0D, + new int[] { Block.getStateId(state) }); + } + + case FIREDAMP: + if (rand.nextInt(12) == 0) { + worldIn.spawnParticle(EnumParticleTypes.SPELL_MOB, + (double) ((float) pos.getX() + 0.75F - (rand.nextFloat() / 2.0F)), + (double) ((float) pos.getY() + 0.9F), + (double) ((float) pos.getZ() + 0.75F - (rand.nextFloat() / 2.0F)), 0.0D, 0.0D, 0.0D, + new int[] { Block.getStateId(state) }); + } + + case BLACKDAMP: + default: + if (rand.nextInt(12) == 0) { + worldIn.spawnParticle(EnumParticleTypes.SPELL_MOB, + (double) ((float) pos.getX() + 0.75F - (rand.nextFloat() / 2.0F)), + (double) ((float) pos.getY() + 0.9F), + (double) ((float) pos.getZ() + 0.75F - (rand.nextFloat() / 2.0F)), 0.0D, 0.0D, 0.0D, + new int[] { Block.getStateId(state) }); + } + } + } + + @Override + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.INVISIBLE; + } + + // no collision box - you can walk straight through them + @Override + public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World world, BlockPos pos) { + return NULL_AABB; + } + + @Override + public boolean isOpaqueCube(IBlockState state) { + return false; + } + + @Override + public boolean canDropFromExplosion(Explosion explosionIn) { + return false; + } + + @Override + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) { + } + + @Override + public boolean isReplaceable(IBlockAccess worldIn, BlockPos pos) { + return true; + } + + @SuppressWarnings("unchecked") + @Override + public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face) { + IBlockState state = world.getBlockState(pos); + + switch ((GasType) state.getValue(VARIANT)) { + case FIREDAMP: + case STINKDAMP: + return 2000; + + case BLACKDAMP: + case WHITEDAMP: + default: + return 0; + } + } + + @SuppressWarnings("unchecked") + @Override + public int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face) { + IBlockState state = world.getBlockState(pos); + + switch ((GasType) state.getValue(VARIANT)) { + case FIREDAMP: + case STINKDAMP: + return 2000; + + case BLACKDAMP: + case WHITEDAMP: + default: + return 0; + } + } + + @SuppressWarnings("unchecked") + @Override + public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) { + IBlockState state = worldIn.getBlockState(pos); + + switch ((GasType) state.getValue(VARIANT)) { + case STINKDAMP: + if (!worldIn.isRemote) { + this.explode(worldIn, pos, state); + } + break; + + default: + break; + } + } + + @SuppressWarnings("unchecked") + @Override + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { + switch ((GasType) state.getValue(VARIANT)) { + // suffer wither effect if you walk on deathbloom + case WHITEDAMP: + if (entityIn instanceof EntityLivingBase) { + ((EntityLivingBase) entityIn).addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, 500)); + ((EntityLivingBase) entityIn).addPotionEffect(new PotionEffect(MobEffects.HUNGER, 500)); + ((EntityLivingBase) entityIn).addPotionEffect(new PotionEffect(MobEffects.MINING_FATIGUE, 500)); + ((EntityLivingBase) entityIn).addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 500)); + } + break; + case STINKDAMP: + if (!worldIn.isRemote && entityIn instanceof EntityArrow) { + EntityArrow entityarrow = (EntityArrow) entityIn; + + if (entityarrow.isBurning()) { + this.explode(worldIn, pos, state); + } + } + break; + + default: + break; + } + } + + public void explode(World worldIn, BlockPos pos, IBlockState state) { + if (!worldIn.isRemote) { + EntityFallingBlock explosion = new EntityFallingBlock(worldIn, (double) pos.getX(), (double) pos.getY(), + (double) pos.getZ(), state); + worldIn.spawnEntityInWorld(explosion); + + float f = 2.0F; + worldIn.createExplosion(explosion, pos.getX(), pos.getY(), pos.getZ(), f, true); + + worldIn.setBlockToAir(pos); + } + } +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockTANGeneric.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockTANGeneric.java new file mode 100644 index 00000000..87bbf3c0 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockTANGeneric.java @@ -0,0 +1,49 @@ +package toughasnails.block; + +import net.minecraft.block.Block; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.ItemBlock; +import toughasnails.api.ITANBlock; +import toughasnails.item.ItemTANBlock; + +public class BlockTANGeneric extends Block implements ITANBlock { + + // implement IBOPBlock + @Override + public Class getItemClass() { + return ItemTANBlock.class; + } + + @SuppressWarnings("rawtypes") + @Override + public IProperty[] getPresetProperties() { + return new IProperty[] {}; + } + + @SuppressWarnings("rawtypes") + @Override + public IProperty[] getNonRenderingProperties() { + return null; + } + + @Override + public String getStateName(IBlockState state) { + return ""; + } + + public BlockTANGeneric() { + // use rock as default material + this(Material.ROCK); + } + + public BlockTANGeneric(Material material) { + super(material); + // set some defaults + this.setHardness(1.0F); + this.setSoundType(SoundType.STONE); + } + +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockTANTemperatureCoil.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockTANTemperatureCoil.java new file mode 100644 index 00000000..d6cd2794 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockTANTemperatureCoil.java @@ -0,0 +1,213 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.block; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.ItemBlock; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.ITANBlock; +import toughasnails.core.ToughAsNails; +import toughasnails.item.ItemTANBlock; +import toughasnails.particle.TANParticleTypes; +import toughasnails.tileentity.TileEntityTemperatureSpread; + +public class BlockTANTemperatureCoil extends BlockContainer implements ITANBlock { + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", CoilType.class); + public static final PropertyBool POWERED = PropertyBool.create("powered"); + protected static final AxisAlignedBB BOUNDING_BOX = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.75D, 1.0D); + + // implement ITANBlock + @Override + public Class getItemClass() { + return ItemTANBlock.class; + } + + @SuppressWarnings("rawtypes") + @Override + public IProperty[] getPresetProperties() { + return new IProperty[] { VARIANT }; + } + + @SuppressWarnings("rawtypes") + @Override + public IProperty[] getNonRenderingProperties() { + return null; + } + + @Override + public String getStateName(IBlockState state) { + return ((CoilType) state.getValue(VARIANT)).getName() + "_coil"; + } + + public BlockTANTemperatureCoil() { + super(Material.IRON); + this.setHardness(1.0F); + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, CoilType.COOLING) + .withProperty(POWERED, Boolean.valueOf(false))); + } + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + return BOUNDING_BOX; + } + + @Override + public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World world, BlockPos pos) { + return BOUNDING_BOX; + } + + @Override + public IBlockState getStateFromMeta(int meta) { + return this.getDefaultState().withProperty(VARIANT, CoilType.values()[meta & 1]).withProperty(POWERED, + Boolean.valueOf((meta & 8) > 0)); + } + + @Override + @SideOnly(Side.CLIENT) + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) { + if (state.getValue(POWERED) == true) { + if (state.getValue(VARIANT) == CoilType.HEATING) { + double d0 = (double) ((float) pos.getX() + 0.4F + rand.nextFloat() * 0.2F); + double d1 = (double) ((float) pos.getY() + 0.7F + rand.nextFloat() * 0.3F); + double d2 = (double) ((float) pos.getZ() + 0.4F + rand.nextFloat() * 0.2F); + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + } + if (state.getValue(VARIANT) == CoilType.COOLING) { + double d0 = (double) ((float) pos.getX() + 0.4F + rand.nextFloat() * 0.2F); + double d1 = (double) ((float) pos.getY() + 0.7F + rand.nextFloat() * 0.3F); + double d2 = (double) ((float) pos.getZ() + 0.4F + rand.nextFloat() * 0.2F); + ToughAsNails.proxy.spawnParticle(TANParticleTypes.SNOWFLAKE, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + } + + @Override + public int damageDropped(IBlockState state) { + return ((CoilType) state.getValue(VARIANT)).ordinal(); // Always drop + // the unpowered + // version + } + + @Override + public int getMetaFromState(IBlockState state) { + int baseMeta = ((CoilType) state.getValue(VARIANT)).ordinal(); + return baseMeta | (state.getValue(POWERED) ? 8 : 0); + } + + @Override + public int getLightValue(IBlockState state) { + return (Boolean) state.getValue(POWERED) ? 7 : 0; + } + + @Override + public TileEntity createNewTileEntity(World worldIn, int meta) { + IBlockState state = this.getStateFromMeta(meta); + switch (state.getValue(VARIANT)) { + case COOLING: + return new TileEntityTemperatureSpread(-10); + + case HEATING: + return new TileEntityTemperatureSpread(10); + } + + return null; + } + + @Override + public void breakBlock(World world, BlockPos pos, IBlockState state) { + if (TileEntityTemperatureSpread.ENABLE_DEBUG) { + TileEntity te = world.getTileEntity(pos); + + if (!world.isRemote && te != null) { + TileEntityTemperatureSpread tempFill = (TileEntityTemperatureSpread) te; + + tempFill.reset(); + } + } + + super.breakBlock(world, pos, state); + } + + @Override + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighborBlock) { + updatePowered(world, pos, state); + } + + @Override + public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) { + updatePowered(world, pos, state); + } + + private void updatePowered(World world, BlockPos pos, IBlockState state) { + boolean powered = world.isBlockPowered(pos) || world.isBlockPowered(pos.up()); + TileEntity te = world.getTileEntity(pos); + + if (!world.isRemote && te != null && powered != (Boolean) world.getBlockState(pos).getValue(POWERED)) { + TileEntityTemperatureSpread tempFill = (TileEntityTemperatureSpread) te; + + if (powered) { + tempFill.fill(); + world.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true))); + } else { + tempFill.reset(); + world.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false))); + } + } + } + + @Override + public boolean isOpaqueCube(IBlockState state) { + return false; + } + + @Override + public boolean isFullCube(IBlockState state) { + return false; + } + + @Override + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.MODEL; + } + + @Override + protected BlockStateContainer createBlockState() { + return new BlockStateContainer(this, new IProperty[] { VARIANT, POWERED }); + } + + public static enum CoilType implements IStringSerializable { + COOLING, HEATING; + @Override + public String getName() { + return this.name().toLowerCase(); + } + + @Override + public String toString() { + return this.getName(); + } + }; +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockTANTorchNew.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockTANTorchNew.java new file mode 100644 index 00000000..0ea674df --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/block/BlockTANTorchNew.java @@ -0,0 +1,375 @@ +package toughasnails.block; + +import java.util.Random; + +import javax.annotation.Nullable; + +import com.google.common.base.Predicate; + +import net.minecraft.block.Block; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.init.SoundEvents; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.Mirror; +import net.minecraft.util.Rotation; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.ITANBlock; +import toughasnails.api.TANBlocks; +import toughasnails.item.ItemTANBlock; + +public class BlockTANTorchNew extends Block implements ITANBlock { + public static final PropertyDirection FACING = PropertyDirection.create("facing", new Predicate() { + public boolean apply(@Nullable EnumFacing p_apply_1_) { + return p_apply_1_ != EnumFacing.DOWN; + } + }); + + public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15); + public static final PropertyBool BURNING = PropertyBool.create("burning"); + + // implement ITANBlock + @Override + public Class getItemClass() { + return ItemTANBlock.class; + } + + @SuppressWarnings("rawtypes") + @Override + public IProperty[] getPresetProperties() { + return new IProperty[] {}; + } + + @SuppressWarnings("rawtypes") + @Override + public IProperty[] getNonRenderingProperties() { + return null; + } + + @Override + public String getStateName(IBlockState state) { + return ""; + } + + protected static final AxisAlignedBB STANDING_AABB = new AxisAlignedBB(0.4000000059604645D, 0.0D, + 0.4000000059604645D, 0.6000000238418579D, 0.6000000238418579D, 0.6000000238418579D); + protected static final AxisAlignedBB TORCH_NORTH_AABB = new AxisAlignedBB(0.3499999940395355D, 0.20000000298023224D, + 0.699999988079071D, 0.6499999761581421D, 0.800000011920929D, 1.0D); + protected static final AxisAlignedBB TORCH_SOUTH_AABB = new AxisAlignedBB(0.3499999940395355D, 0.20000000298023224D, + 0.0D, 0.6499999761581421D, 0.800000011920929D, 0.30000001192092896D); + protected static final AxisAlignedBB TORCH_WEST_AABB = new AxisAlignedBB(0.699999988079071D, 0.20000000298023224D, + 0.3499999940395355D, 1.0D, 0.800000011920929D, 0.6499999761581421D); + protected static final AxisAlignedBB TORCH_EAST_AABB = new AxisAlignedBB(0.0D, 0.20000000298023224D, + 0.3499999940395355D, 0.30000001192092896D, 0.800000011920929D, 0.6499999761581421D); + + public BlockTANTorchNew() { + super(Material.CIRCUITS); + this.setHardness(0.0F); + this.setSoundType(SoundType.WOOD); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.UP) + .withProperty(AGE, Integer.valueOf(0)).withProperty(BURNING, Boolean.valueOf(true))); + this.setTickRandomly(true); + } + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + switch ((EnumFacing) state.getValue(FACING)) { + case EAST: + return TORCH_EAST_AABB; + case WEST: + return TORCH_WEST_AABB; + case SOUTH: + return TORCH_SOUTH_AABB; + case NORTH: + return TORCH_NORTH_AABB; + default: + return STANDING_AABB; + } + } + + @Nullable + @Override + public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos) { + return NULL_AABB; + } + + @Override + public boolean isOpaqueCube(IBlockState state) { + return false; + } + + @Override + public boolean isFullCube(IBlockState state) { + return false; + } + + @Override + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { + super.updateTick(worldIn, pos, state, rand); + + int age = ((Integer) state.getValue(AGE)).intValue(); + + if (state.getValue(BURNING) == true) { + if (worldIn.isRainingAt(pos)) { + worldIn.setBlockState(pos, state.withProperty(BURNING, false).withProperty(AGE, 15), 2); + worldIn.playSound((EntityPlayer) null, pos, SoundEvents.BLOCK_LAVA_EXTINGUISH, SoundCategory.BLOCKS, + 0.5F, 2.6F + (worldIn.rand.nextFloat() - worldIn.rand.nextFloat()) * 0.8F); + } + if (age < 15) { + if (rand.nextInt(8) == 0) { + worldIn.setBlockState(pos, state.withProperty(AGE, Integer.valueOf(age + 1)), 2); + } + } + if (age == 15) { + if (rand.nextInt(8) == 0) { + worldIn.setBlockState(pos, state.withProperty(BURNING, false), 2); + } + } + } + } + + @Override + public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) { + if (state.getValue(BURNING) == true) { + return (int) (15.0F * 0.9375F); + } else { + return 0; + } + } + + @Override + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, + EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { + if (playerIn.getHeldItem(hand) != null) { + Item item = playerIn.getHeldItem(hand).getItem(); + int age = ((Integer) state.getValue(AGE)).intValue(); + + if (age == 0) { + if (state.getValue(BURNING) == false) { + if (!worldIn.isRainingAt(pos)) { + if (item == Items.FLINT_AND_STEEL) { + worldIn.playSound(playerIn, pos, SoundEvents.ITEM_FLINTANDSTEEL_USE, SoundCategory.BLOCKS, + 1.0F, worldIn.rand.nextFloat() * 0.4F + 0.8F); + worldIn.setBlockState(pos, TANBlocks.torch_new.getDefaultState() + .withProperty(FACING, state.getValue(FACING)).withProperty(BURNING, true)); + + if (item == Items.FLINT_AND_STEEL) { + playerIn.getHeldItem(hand).damageItem(1, playerIn); + } + + return true; + } + } + } + } + } + + return super.onBlockActivated(worldIn, pos, state, playerIn, hand, heldItem, side, hitX, hitY, hitZ); + } + + private boolean canPlaceOn(World worldIn, BlockPos pos) { + IBlockState state = worldIn.getBlockState(pos); + if (state.isSideSolid(worldIn, pos, EnumFacing.UP)) { + return true; + } else { + return state.getBlock().canPlaceTorchOnTop(state, worldIn, pos); + } + } + + @Override + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) { + for (EnumFacing enumfacing : FACING.getAllowedValues()) { + if (this.canPlaceAt(worldIn, pos, enumfacing)) { + return true; + } + } + + return false; + } + + private boolean canPlaceAt(World worldIn, BlockPos pos, EnumFacing facing) { + BlockPos blockpos = pos.offset(facing.getOpposite()); + boolean flag = facing.getAxis().isHorizontal(); + return flag && worldIn.isSideSolid(blockpos, facing, true) + || facing.equals(EnumFacing.UP) && this.canPlaceOn(worldIn, blockpos); + } + + @Override + public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, + float hitZ, int meta, EntityLivingBase placer, ItemStack stack) { + if (this.canPlaceAt(world, pos, facing)) { + return this.getDefaultState().withProperty(FACING, facing); + } else { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { + if (world.isSideSolid(pos.offset(enumfacing.getOpposite()), enumfacing, true)) { + return this.getDefaultState().withProperty(FACING, enumfacing); + } + } + + return this.getDefaultState(); + } + } + + @Override + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { + this.checkForDrop(worldIn, pos, state); + } + + @Override + public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn) { + this.onNeighborChangeInternal(worldIn, pos, state); + } + + protected boolean onNeighborChangeInternal(World worldIn, BlockPos pos, IBlockState state) { + if (!this.checkForDrop(worldIn, pos, state)) { + return true; + } else { + EnumFacing enumfacing = (EnumFacing) state.getValue(FACING); + EnumFacing.Axis enumfacing$axis = enumfacing.getAxis(); + EnumFacing enumfacing1 = enumfacing.getOpposite(); + boolean flag = false; + + if (enumfacing$axis.isHorizontal() && !worldIn.isSideSolid(pos.offset(enumfacing1), enumfacing, true)) { + flag = true; + } else if (enumfacing$axis.isVertical() && !this.canPlaceOn(worldIn, pos.offset(enumfacing1))) { + flag = true; + } + + if (flag) { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + return true; + } else { + return false; + } + } + } + + protected boolean checkForDrop(World worldIn, BlockPos pos, IBlockState state) { + if (state.getBlock() == this && this.canPlaceAt(worldIn, pos, (EnumFacing) state.getValue(FACING))) { + return true; + } else { + if (worldIn.getBlockState(pos).getBlock() == this) { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + + return false; + } + } + + @SideOnly(Side.CLIENT) + @Override + public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand) { + EnumFacing enumfacing = (EnumFacing) stateIn.getValue(FACING); + double d0 = (double) pos.getX() + 0.5D; + double d1 = (double) pos.getY() + 0.7D; + double d2 = (double) pos.getZ() + 0.5D; + double d3 = 0.22D; + double d4 = 0.27D; + + if (enumfacing.getAxis().isHorizontal()) { + EnumFacing enumfacing1 = enumfacing.getOpposite(); + worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4 * (double) enumfacing1.getFrontOffsetX(), + d1 + d3, d2 + d4 * (double) enumfacing1.getFrontOffsetZ(), 0.0D, 0.0D, 0.0D, new int[0]); + worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4 * (double) enumfacing1.getFrontOffsetX(), d1 + d3, + d2 + d4 * (double) enumfacing1.getFrontOffsetZ(), 0.0D, 0.0D, 0.0D, new int[0]); + } else { + worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + worldIn.spawnParticle(EnumParticleTypes.FLAME, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + @Override + public IBlockState getStateFromMeta(int meta) { + IBlockState iblockstate = this.getDefaultState(); + + switch (meta) { + case 1: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.EAST); + break; + case 2: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.WEST); + break; + case 3: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.SOUTH); + break; + case 4: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.NORTH); + break; + case 5: + default: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.UP); + } + + return iblockstate; + } + + @SideOnly(Side.CLIENT) + @Override + public BlockRenderLayer getBlockLayer() { + return BlockRenderLayer.CUTOUT; + } + + @Override + public int getMetaFromState(IBlockState state) { + int i = 0; + + switch ((EnumFacing) state.getValue(FACING)) { + case EAST: + i = i | 1; + break; + case WEST: + i = i | 2; + break; + case SOUTH: + i = i | 3; + break; + case NORTH: + i = i | 4; + break; + case DOWN: + case UP: + default: + i = i | 5; + } + + return i; + } + + @Override + public IBlockState withRotation(IBlockState state, Rotation rot) { + return state.withProperty(FACING, rot.rotate((EnumFacing) state.getValue(FACING))); + } + + @Override + public IBlockState withMirror(IBlockState state, Mirror mirrorIn) { + return state.withRotation(mirrorIn.toRotation((EnumFacing) state.getValue(FACING))); + } + + @Override + protected BlockStateContainer createBlockState() { + return new BlockStateContainer(this, new IProperty[] { FACING, AGE, BURNING }); + } +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/client/gui/GuiFactory.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/client/gui/GuiFactory.java new file mode 100644 index 00000000..9eeda961 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/client/gui/GuiFactory.java @@ -0,0 +1,30 @@ +package toughasnails.client.gui; + +import java.util.Set; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraftforge.fml.client.IModGuiFactory; + +public class GuiFactory implements IModGuiFactory { + + @Override + public void initialize(Minecraft minecraftInstance) { + } + + @Override + public Class mainConfigGuiClass() { + return GuiTANConfig.class; + } + + @Override + public Set runtimeGuiCategories() { + return null; + } + + @SuppressWarnings("deprecation") + @Override + public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) { + return null; + } +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/client/gui/GuiTANConfig.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/client/gui/GuiTANConfig.java new file mode 100644 index 00000000..d212986a --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/client/gui/GuiTANConfig.java @@ -0,0 +1,41 @@ +package toughasnails.client.gui; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.util.text.translation.I18n; +import net.minecraftforge.common.config.ConfigElement; +import net.minecraftforge.fml.client.config.DummyConfigElement; +import net.minecraftforge.fml.client.config.GuiConfig; +import net.minecraftforge.fml.client.config.IConfigElement; +import toughasnails.config.GameplayConfigurationHandler; +import toughasnails.core.ToughAsNails; + +@SuppressWarnings("deprecation") +public class GuiTANConfig extends GuiConfig { + public GuiTANConfig(GuiScreen parentScreen) { + super(parentScreen, GuiTANConfig.getConfigElements(), ToughAsNails.MOD_ID, false, false, "/toughasnails"); + } + + private static List getConfigElements() { + List list = new ArrayList(); + + List SURVIVAL_SETTINGS = new ConfigElement(GameplayConfigurationHandler.config + .getCategory(GameplayConfigurationHandler.SURVIVAL_SETTINGS.toLowerCase())).getChildElements(); + + List DRINK_SETTINGS = new ConfigElement( + GameplayConfigurationHandler.config.getCategory(GameplayConfigurationHandler.DRINKS.toLowerCase())) + .getChildElements(); + + list.add(new DummyConfigElement.DummyCategoryElement( + I18n.translateToLocal("config.category.survivalSettings.title"), "config.category.arrowSettings", + SURVIVAL_SETTINGS)); + + list.add(new DummyConfigElement.DummyCategoryElement( + I18n.translateToLocal("config.category.drinkSettings.title"), "config.category.arrowSettings", + DRINK_SETTINGS)); + + return list; + } +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/command/TANCommand.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/command/TANCommand.java new file mode 100644 index 00000000..792cd650 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/command/TANCommand.java @@ -0,0 +1,306 @@ +package toughasnails.command; + +import java.util.List; + +import com.google.common.collect.Lists; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraftforge.fml.common.FMLCommonHandler; +import toughasnails.api.TANCapabilities; +import toughasnails.api.TANPotions; +import toughasnails.api.config.GameplayOption; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.season.Season.SubSeason; +import toughasnails.api.temperature.Temperature; +import toughasnails.api.temperature.TemperatureScale; +import toughasnails.api.thirst.ThirstHelper; +import toughasnails.handler.health.MaxHealthHandler; +import toughasnails.handler.season.SeasonHandler; +import toughasnails.season.SeasonSavedData; +import toughasnails.season.SeasonTime; +import toughasnails.temperature.TemperatureDebugger; +import toughasnails.temperature.TemperatureHandler; +import toughasnails.thirst.ThirstHandler; + +public class TANCommand extends CommandBase { + + @Override + public String getCommandName() { + return "toughasnails"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "commands.toughasnails.usage"; + } + + @Override + public List getCommandAliases() { + return Lists.newArrayList("tan"); + } + + @Override + public int getRequiredPermissionLevel() { + return 2; + } + + @Override + public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { + if (args.length < 1) { + throw new WrongUsageException("commands.toughasnails.usage"); + } else if ("tempinfo".equals(args[0])) { + displayTemperatureInfo(sender, args); + } else if ("tempat".equals(args[0])) { + if (args.length < 5 || args.length > 6) { + throw new WrongUsageException("commands.toughasnails.usage"); + } else { + retrieveTemperatureAt(sender, args); + } + } else if ("settemp".equals(args[0])) { + setTemperature(sender, args); + } else if ("setseason".equals(args[0])) { + if (args.length < 3 || args.length > 4) { + throw new WrongUsageException("commands.toughasnails.usage"); + } else { + setSeason(sender, args); + } + } else if ("setthirst".equals(args[0])) { + if (args.length != 3) { + throw new WrongUsageException("commands.toughasnails.usage"); + } else { + setThirst(sender, args); + } + } else if ("sethealth".equals(args[0])) { + if (args.length != 3) { + throw new WrongUsageException("commands.toughasnails.usage"); + } else { + setHealth(sender, args); + } + } + } + + private void displayTemperatureInfo(ICommandSender sender, String[] args) throws CommandException { + EntityPlayerMP player = getCommandSenderAsPlayer(sender); + TemperatureHandler temperatureStats = (TemperatureHandler) player.getCapability(TANCapabilities.TEMPERATURE, + null); + TemperatureDebugger debugger = temperatureStats.debugger; + + if (SyncedConfig.getBooleanValue(GameplayOption.ENABLE_TEMPERATURE)) { + debugger.setGuiVisible(!debugger.isGuiVisible(), player); + } else { + sender.addChatMessage(new TextComponentTranslation("commands.toughasnails.settemp.disabled")); + } + } + + // tan tempat + private void retrieveTemperatureAt(ICommandSender sender, String[] args) throws CommandException { + int dimensionID = 0; + int x = 0; + int y = 0; + int z = 0; + boolean printOutput = true; + try { + dimensionID = Integer.parseInt(args[1]); + x = Integer.parseInt(args[2]); + y = Integer.parseInt(args[3]); + z = Integer.parseInt(args[4]); + if (args.length >= 6) { + printOutput = Boolean.parseBoolean(args[5]); + } + } catch (NumberFormatException e) { + throw new WrongUsageException("commands.toughasnails.usage"); + } + + if (SyncedConfig.getBooleanValue(GameplayOption.ENABLE_TEMPERATURE)) { + World world = null; + WorldServer[] worldServers = FMLCommonHandler.instance().getMinecraftServerInstance().worldServers; + WorldServer candidate = FMLCommonHandler.instance().getMinecraftServerInstance() + .worldServerForDimension(dimensionID); + if (candidate == null) { + throw new WrongUsageException("commands.toughasnails.usage"); + } + + for (int i = 0; i < worldServers.length; i++) { + WorldServer target = worldServers[i]; + if (candidate.equals(target)) { + world = target; + break; + } + } + + if (world == null) { + throw new WrongUsageException("commands.toughasnails.usage"); + } + BlockPos position = new BlockPos(x, y, z); + + int finalTemperature = TemperatureHandler.getTargetTemperatureAt(world, position); + if (printOutput) { + sender.addChatMessage(new TextComponentTranslation("commands.toughasnails.tempat.success", dimensionID, + x, y, z, finalTemperature)); + } + sender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, finalTemperature); + } else { + sender.addChatMessage(new TextComponentTranslation("commands.toughasnails.tempat.disabled")); + } + } + + private void setTemperature(ICommandSender sender, String[] args) throws CommandException { + EntityPlayerMP player = getCommandSenderAsPlayer(sender); + TemperatureHandler temperatureStats = (TemperatureHandler) player.getCapability(TANCapabilities.TEMPERATURE, + null); + int newTemp = parseInt(args[1], 0, TemperatureScale.getScaleTotal()); + // Temperature playerTemp = temperatureStats.getTemperature(); + + if (SyncedConfig.getBooleanValue(GameplayOption.ENABLE_TEMPERATURE)) { + // Remove any existing potion effects for hypo/hyperthermia + player.removePotionEffect(TANPotions.hypothermia); + player.removePotionEffect(TANPotions.hyperthermia); + + // Reset the change timer to 0 + temperatureStats.setChangeTime(0); + // Set to the new temperature + temperatureStats.setTemperature(new Temperature(newTemp)); + + sender.addChatMessage(new TextComponentTranslation("commands.toughasnails.settemp.success", newTemp)); + } else { + sender.addChatMessage(new TextComponentTranslation("commands.toughasnails.settemp.disabled")); + } + } + + private void setSeason(ICommandSender sender, String[] args) throws CommandException { + int dimensionID = 0; + boolean printOutput = true; + try { + dimensionID = Integer.parseInt(args[2]); + if (args.length >= 4) { + printOutput = Boolean.parseBoolean(args[3]); + } + } catch (NumberFormatException e) { + throw new WrongUsageException("commands.toughasnails.usage"); + } + SubSeason newSeason = null; + + for (SubSeason season : SubSeason.values()) { + if (season.toString().toLowerCase().equals(args[1].toLowerCase())) { + newSeason = season; + break; + } + } + + if (SyncedConfig.getBooleanValue(GameplayOption.ENABLE_SEASONS)) { + if (newSeason != null) { + World world = null; + WorldServer[] worldServers = FMLCommonHandler.instance().getMinecraftServerInstance().worldServers; + WorldServer candidate = FMLCommonHandler.instance().getMinecraftServerInstance() + .worldServerForDimension(dimensionID); + if (candidate == null) { + throw new WrongUsageException("commands.toughasnails.usage"); + } + + for (int i = 0; i < worldServers.length; i++) { + WorldServer target = worldServers[i]; + if (candidate.equals(target)) { + world = target; + break; + } + } + + if (world == null) { + throw new WrongUsageException("commands.toughasnails.usage"); + } + + SeasonSavedData seasonData = SeasonHandler.getSeasonSavedData(world); + seasonData.seasonCycleTicks = SeasonTime.DAY_TICKS * SeasonTime.SUB_SEASON_DURATION + * newSeason.ordinal(); + seasonData.markDirty(); + SeasonHandler.sendSeasonUpdate(world); + if (printOutput) { + sender.addChatMessage( + new TextComponentTranslation("commands.toughasnails.setseason.success", args[1])); + } + } else { + sender.addChatMessage(new TextComponentTranslation("commands.toughasnails.setseason.fail", args[1])); + } + } else { + sender.addChatMessage(new TextComponentTranslation("commands.toughasnails.setseason.disabled")); + } + } + + private void setHealth(ICommandSender sender, String[] args) throws CommandException { + String playerName = args[1]; + EntityPlayerMP player = FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList() + .getPlayerByUsername(playerName); + if (player == null) { + throw new WrongUsageException("commands.toughasnails.usage"); + } + + int newHealth = 0; + try { + newHealth = Integer.parseInt(args[2]); + } catch (NumberFormatException e) { + throw new WrongUsageException("commands.toughasnails.usage"); + } + + // If health is enabled + if (SyncedConfig.getBooleanValue(GameplayOption.ENABLE_LOWERED_STARTING_HEALTH)) { + + // Set the new health + MaxHealthHandler.overrideMaximumHealth(player.getUniqueID(), newHealth); + + sender.addChatMessage(new TextComponentTranslation("commands.toughasnails.sethealth.success", newHealth)); + } else { + sender.addChatMessage(new TextComponentTranslation("commands.toughasnails.sethealth.disabled")); + } + } + + private void setThirst(ICommandSender sender, String[] args) throws CommandException { + String playerName = args[1]; + EntityPlayerMP player = FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList() + .getPlayerByUsername(playerName); + if (player == null) { + throw new WrongUsageException("commands.toughasnails.usage"); + } + + int thirstLevel = 0; + try { + thirstLevel = Integer.parseInt(args[2]); + } catch (NumberFormatException e) { + throw new WrongUsageException("commands.toughasnails.usage"); + } + + // If thirst is enabled + if (SyncedConfig.getBooleanValue(GameplayOption.ENABLE_THIRST)) { + + // Remove any existing potion effects for thirst + player.removePotionEffect(TANPotions.thirst); + + // Set the new thirst + ThirstHandler thirstHandler = (ThirstHandler) ThirstHelper.getThirstData(player); + thirstHandler.setThirst(thirstLevel); + + sender.addChatMessage(new TextComponentTranslation("commands.toughasnails.setthirst.success", thirstLevel)); + } else { + sender.addChatMessage(new TextComponentTranslation("commands.toughasnails.setthirst.disabled")); + } + } + + @Override + public List getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args, + BlockPos pos) { + if (args.length == 1) { + return getListOfStringsMatchingLastWord(args, "settemp", "tempinfo", "setseason", "sethealth", "setthirst"); + } + + return null; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/config/CropGrowConfigEntry.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/config/CropGrowConfigEntry.java new file mode 100644 index 00000000..f3fa9e0c --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/config/CropGrowConfigEntry.java @@ -0,0 +1,38 @@ +package toughasnails.config; + +public class CropGrowConfigEntry { + private int minLiving; + private int minOptimal; + private int maxOptimal; + private int maxLiving; + private float nonOptimalChance; + + public CropGrowConfigEntry(int minLiving, int minOptimal, int maxOptimal, + int maxLiving, float nonOptimalChance) { + this.minLiving = minLiving; + this.minOptimal = minOptimal; + this.maxOptimal = maxOptimal; + this.maxLiving = maxLiving; + this.nonOptimalChance = nonOptimalChance; + } + + public int getMinLiving() { + return this.minLiving; + } + + public int getMinOptimal() { + return this.minOptimal; + } + + public int getMaxOptimal() { + return this.maxOptimal; + } + + public int getMaxLiving() { + return this.maxLiving; + } + + public float getNonOptimalChance() { + return this.nonOptimalChance; + } +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/config/GameplayConfigurationHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/config/GameplayConfigurationHandler.java new file mode 100644 index 00000000..0dfc2580 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/config/GameplayConfigurationHandler.java @@ -0,0 +1,332 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.config; + +import java.io.File; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.fml.client.event.ConfigChangedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import toughasnails.api.config.GameplayOption; +import toughasnails.api.config.SyncedConfig; +import toughasnails.core.ToughAsNails; + +public class GameplayConfigurationHandler { + public static final String SURVIVAL_SETTINGS = "Survival Settings"; + public static final String DRINKS = "Drink Configuration"; + public static final String TEMPERATURE_TWEAKS = "Temperature Tweaks"; + public static final String CROP_TWEAKS = "Crop Tweaks"; + + public static Configuration config; + + public static final Map EXTERNAL_DECAYING_CROPS = new HashMap(); + public static final Map EXTERNAL_HIBERNATING_CROPS = new HashMap(); + + private static void parseExternalDecayingCrops() { + List crops = SyncedConfig.getListValue(GameplayOption.CROPS); + for (String cropEntry : crops) { + String[] cropData = cropEntry.split(";"); + if (cropData.length == 6) { + String cropName = cropData[0]; + System.out.println("Parsing crop: " + cropName); + int minLiving = 0; + int minOptimal = 0; + int maxOptimal = 0; + int maxLiving = 0; + float nonOptimalChance = 0; + try { + minLiving = Integer.parseInt(cropData[1]); + minOptimal = Integer.parseInt(cropData[2]); + maxOptimal = Integer.parseInt(cropData[3]); + maxLiving = Integer.parseInt(cropData[4]); + nonOptimalChance = Float.parseFloat(cropData[5]); + CropGrowConfigEntry cropGrowData = new CropGrowConfigEntry(minLiving, minOptimal, maxOptimal, + maxLiving, nonOptimalChance); + EXTERNAL_DECAYING_CROPS.put(cropName, cropGrowData); + } catch (NumberFormatException e) { + ToughAsNails.logger.error("Tried to process misconfigured crop! " + cropData.toString()); + } + } + } + } + + private static void parseExternalHibernatingCrops() { + List hibernating = SyncedConfig.getListValue(GameplayOption.HIBERNATING); + for (String cropEntry : hibernating) { + String[] cropData = cropEntry.split(";"); + if (cropData.length == 6) { + String cropName = cropData[0]; + System.out.println("Parsing hibernating crop: " + cropName); + int minWaking = 0; + int minOptimal = 0; + int maxOptimal = 0; + int maxWaking = 0; + float nonOptimalChance = 0; + try { + minWaking = Integer.parseInt(cropData[1]); + minOptimal = Integer.parseInt(cropData[2]); + maxOptimal = Integer.parseInt(cropData[3]); + maxWaking = Integer.parseInt(cropData[4]); + nonOptimalChance = Float.parseFloat(cropData[5]); + CropGrowConfigEntry cropGrowData = new CropGrowConfigEntry(minWaking, minOptimal, maxOptimal, + maxWaking, nonOptimalChance); + EXTERNAL_HIBERNATING_CROPS.put(cropName, cropGrowData); + } catch (NumberFormatException e) { + ToughAsNails.logger + .error("Tried to process misconfigured hibernating crop! " + cropData.toString()); + } + } + } + } + + public static void init(File configFile) { + if (config == null) { + config = new Configuration(configFile); + loadConfiguration(); + } + + // Parse the external decaying crops list into memory for greater + // efficiency. + if (EXTERNAL_DECAYING_CROPS.isEmpty()) { + parseExternalDecayingCrops(); + } + + // Parse the external hibernating crops list into memory for greater + // efficiency. + if (EXTERNAL_HIBERNATING_CROPS.isEmpty()) { + parseExternalHibernatingCrops(); + } + } + + private static void loadConfiguration() { + try { + // Major features + addSyncedBool(GameplayOption.ENABLE_LOWERED_STARTING_HEALTH, true, SURVIVAL_SETTINGS, + "Players begin with a lowered maximum health."); + addSyncedBool(GameplayOption.ENABLE_SEASONS, true, SURVIVAL_SETTINGS, "Seasons progress as days increase"); + addSyncedBool(GameplayOption.ENABLE_TEMPERATURE, true, SURVIVAL_SETTINGS, + "Players are affected by temperature"); + addSyncedBool(GameplayOption.ENABLE_THIRST, true, SURVIVAL_SETTINGS, "Players are affected by thirst"); + + // Drink list + String[] drinkDefault = { "minecraft:milk_bucket;*;6;0.4;0.0", "biomesoplenty:ambrosia;*;20;1.0;0.0", + "harvestcraft:blackberryItem;*;1;0.2;0.0", "harvestcraft:blueberryItem;*;1;0.2;0.0", + "harvestcraft:candleberryItem;*;1;0.2;0.0", "harvestcraft:raspberryItem;*;1;0.2;0.0", + "harvestcraft:strawberryItem;*;1;0.2;0.0", "harvestcraft:cactusfruitItem;*;3;0.5;0.0", + "harvestcraft:cantaloupeItem;*;1;0.3;0.0", "harvestcraft:cucumberItem;*;1;0.2;0.0", + "harvestcraft:tomatoItem;*;1;0.2;0.0", "harvestcraft:pineappleItem;*;2;0.4;0.0", + "harvestcraft:grapeItem;*;2;0.2;0.0", "harvestcraft:kiwiItem;*;2;0.2;0.0", + "harvestcraft:cranberryItem;*;1;0.1;0.0", "harvestcraft:cherryItem;*;1;0.1;0.0", + "harvestcraft:dragonfruitItem;*;1;0.2;0.0", "harvestcraft:lemonItem;*;1;0.2;0.0", + "harvestcraft:pearItem;*;1;0.1;0.0", "harvestcraft:grapefruitItem;*;2;0.2;0.0", + "harvestcraft:pomegranateItem;*;2;0.2;0.0", "harvestcraft:mangoItem;*;3;0.2;0.0", + "harvestcraft:coconutItem;*;6;0.4;0.0", "harvestcraft:orangeItem;*;3;0.3;0.0", + "harvestcraft:peachItem;*;2;0.2;0.0", "harvestcraft:raspberryjuiceItem;*;4;0.4;0.0", + "harvestcraft:freshmilkItem;*;6;0.1;0.0", "harvestcraft:teaItem;*;3;0.4;0.0", + "harvestcraft:coffeeItem;*;3;0.4;0.0", "harvestcraft:applejuiceItem;*;4;0.4;0.0", + "harvestcraft:melonjuiceItem;*;4;0.4;0.0", "harvestcraft:carrotjuiceItem;*;4;0.4;0.0", + "harvestcraft:strawberryjuiceItem;*;4;0.4;0.0", "harvestcraft:grapejuiceItem;*;4;0.4;0.0", + "harvestcraft:blueberryjuiceItem;*;4;0.4;0.0", "harvestcraft:cherryjuiceItem;*;4;0.4;0.0", + "harvestcraft:papayajuiceItem;*;4;0.4;0.0", "harvestcraft:starfruitjuiceItem;*;4;0.4;0.0", + "harvestcraft:orangejuiceItem;*;4;0.4;0.0", "harvestcraft:peachjuiceItem;*;4;0.4;0.0", + "harvestcraft:limejuiceItem;*;4;0.4;0.0", "harvestcraft:mangojuiceItem;*;4;0.4;0.0", + "harvestcraft:pomegranatejuiceItem;*;4;0.4;0.0", "harvestcraft:blackberryjuiceItem;*;4;0.4;0.0", + "harvestcraft:raspberryjuiceItem;*;4;0.4;0.0", "harvestcraft:kiwijuiceItem;*;4;0.4;0.0", + "harvestcraft:cranberryjuiceItem;*;4;0.4;0.0", "harvestcraft:cactusfruitjuiceItem;*;4;0.4;0.0", + "harvestcraft:plumjuiceItem;*;4;0.4;0.0", "harvestcraft:pearjuiceItem;*;4;0.4;0.0", + "harvestcraft:apricotjuiceItem;*;4;0.4;0.0", "harvestcraft:figjuiceItem;*;4;0.4;0.0", + "harvestcraft:grapefruitjuiceItem;*;4;0.4;0.0", "harvestcraft:persimmonjuiceItem;*;4;0.4;0.0", + "harvestcraft:pumkinsoupItem;*;4;0.4;0.0", "harvestcraft:melonsmoothieItem;*;5;0.4;0.0", + "harvestcraft:carrotsoupItem;*;4;0.4;0.0", "harvestcraft:strawberrysmoothieItem;*;4;0.4;0.0", + "harvestcraft:lemonadeItem;*;5;0.4;0.0", "harvestcraft:lemonsmoothieItem;*;5;0.4;0.0", + "harvestcraft:blueberrysmoothieItem;*;4;0.4;0.0", "harvestcraft:cherrysmoothieItem;*;4;0.4;0.0", + "harvestcraft:raspberryicedteaItem;*;4;0.5;0.0", "harvestcraft:chaiteaItem;*;5;0.4;0.0", + "harvestcraft:espressoItem;*;4;0.4;0.0", "harvestcraft:coffeeconlecheItem;*;4;0.4;0.0", + "harvestcraft:bananasmoothieItem;*;4;0.4;0.0", "harvestcraft:coconutmilkItem;*;6;0.1;0.0", + "harvestcraft:orangesmoothieItem;*;5;0.4;0.0", "harvestcraft:peachsmoothieItem;*;4;0.4;0.0", + "harvestcraft:pomegranatesmoothieItem;*;4;0.4;0.0", "harvestcraft:papayasmoothieItem;*;5;0.4;0.0", + "harvestcraft:mangosmoothieItem;*;5;0.4;0.0", "harvestcraft:blackberrysmoothieItem;*;4;0.4;0.0", + "harvestcraft:raspberrysmoothieItem;*;4;0.4;0.0", "harvestcraft:chocolatemilk;*;4;0.2;0.0", + "harvestcraft:pinacoladaItem;*;5;0.4;0.0", "harvestcraft:fruitpunchItem;*;5;0.4;0.0", + "harvestcraft:bubblywaterItem;*;1;0.1;0.0", "harvestcraft:cherrysodaItem;*;5;0.4;0.0", + "harvestcraft:colasodaItem;*;5;0.4;0.0", "harvestcraft:gingersodaItem;*;5;0.4;0.0", + "harvestcraft:grapesodaItem;*;5;0.4;0.0", "harvestcraft:lemonlimesodaItem;*;5;0.4;0.0", + "harvestcraft:orangesodaItem;*;5;0.4;0.0", "harvestcraft:rootbeersodaItem;*;5;0.4;0.0", + "harvestcraft:strawberrysodaItem;*;5;0.4;0.0", "harvestcraft:energydrinkItem;*;4;0.4;0.0", + "harvestcraft:appleciderItem;*;5;0.4;0.0", "harvestcraft:strawberrymilkshakeItem;*;4;0.4;0.0", + "harvestcraft:chocolatemilkshakeItem;*;4;0.4;0.0", "harvestcraft:bananamilkshakeItem;*;4;0.4;0.0", + "harvestcraft:applesmoothieItem;*;4;0.4;0.0", "harvestcraft:plumsmoothieItem;*;4;0.4;0.0", + "harvestcraft:coconutsmoothieItem;*;4;0.4;0.0", "harvestcraft:pearsmoothieItem;*;4;0.4;0.0", + "harvestcraft:grapesmoothieItem;*;4;0.4;0.0", "potioncore:custom_potion;*;2;0.0;0.1" }; + addSyncedList(GameplayOption.DRINKS, drinkDefault, DRINKS, + "List of additional drinks with configurable damage (* = any), thirst, " + + "hydration, and poison chance values. ;-delimited"); + + // Temperature tweaks + // Thermometer override + addSyncedBool(GameplayOption.OVERRIDE_THERMOMETER_LIMITS, false, TEMPERATURE_TWEAKS, + "Override the default TAN thermometer to have upper and lower bounds at the specified limits."); + addSyncedInt(GameplayOption.THERMOMETER_LOWER_BOUND, -25, TEMPERATURE_TWEAKS, + "The lower bound of the thermometer."); + addSyncedInt(GameplayOption.THERMOMETER_UPPER_BOUND, 25, TEMPERATURE_TWEAKS, + "The upper bound of the thermometer."); + + // Rain-chill + addSyncedBool(GameplayOption.RAIN_CHILL, true, TEMPERATURE_TWEAKS, + "Should rain reduce the temperature of a block in the world, or only snow?"); + + // Temperature modifiers + addSyncedInt(GameplayOption.BIOME_TEMP_MODIFIER, 10, TEMPERATURE_TWEAKS, + "Scale how significantly biome influences temperature."); + addSyncedInt(GameplayOption.ALTITUDE_TEMP_MODIFIER, 3, TEMPERATURE_TWEAKS, + "Scale how significantly altitude influences temperature."); + addSyncedInt(GameplayOption.WET_TEMP_MODIFIER, -7, TEMPERATURE_TWEAKS, + "Scale how significantly being wet influences temperature."); + addSyncedInt(GameplayOption.SNOW_TEMP_MODIFIER, -10, TEMPERATURE_TWEAKS, + "Scale how significantly snow influences temperature."); + addSyncedInt(GameplayOption.TIME_TEMP_MODIFIER, 7, TEMPERATURE_TWEAKS, + "Scale how significantly time of day influences temperature."); + addSyncedFloat(GameplayOption.TIME_EXTREMITY_MODIFIER, 1.25f, TEMPERATURE_TWEAKS, + "Scale how significantly the extreme times of day change the temperature."); + addSyncedInt(GameplayOption.EARLY_AUTUMN_MODIFIER, 2, TEMPERATURE_TWEAKS, + "Set how the temperature is modified in the EARLY_AUTUMN season."); + addSyncedInt(GameplayOption.MID_AUTUMN_MODIFIER, 0, TEMPERATURE_TWEAKS, + "Set how the temperature is modified in the MID_AUTUMN season."); + addSyncedInt(GameplayOption.LATE_AUTUMN_MODIFIER, -2, TEMPERATURE_TWEAKS, + "Set how the temperature is modified in the LATE_AUTUMN season."); + addSyncedInt(GameplayOption.EARLY_WINTER_MODIFIER, -4, TEMPERATURE_TWEAKS, + "Set how the temperature is modified in the EARLY_WINTER season."); + addSyncedInt(GameplayOption.MID_WINTER_MODIFIER, -6, TEMPERATURE_TWEAKS, + "Set how the temperature is modified in the MID_WINTER season."); + addSyncedInt(GameplayOption.LATE_WINTER_MODIFIER, -6, TEMPERATURE_TWEAKS, + "Set how the temperature is modified in the LATE_WINTER season."); + addSyncedInt(GameplayOption.EARLY_SPRING_MODIFIER, -4, TEMPERATURE_TWEAKS, + "Set how the temperature is modified in the EARLY_SPRING season."); + addSyncedInt(GameplayOption.MID_SPRING_MODIFIER, -2, TEMPERATURE_TWEAKS, + "Set how the temperature is modified in the MID_SPRING season."); + addSyncedInt(GameplayOption.LATE_SPRING_MODIFIER, 0, TEMPERATURE_TWEAKS, + "Set how the temperature is modified in the LATE_SPRING season."); + addSyncedInt(GameplayOption.EARLY_SUMMER_MODIFIER, 0, TEMPERATURE_TWEAKS, + "Set how the temperature is modified in the EARLY_SUMMER season."); + addSyncedInt(GameplayOption.MID_SUMMER_MODIFIER, 2, TEMPERATURE_TWEAKS, + "Set how the temperature is modified in the MID_SUMMER season."); + addSyncedInt(GameplayOption.LATE_SUMMER_MODIFIER, 4, TEMPERATURE_TWEAKS, + "Set how the temperature is modified in the LATE_SUMMER season."); + + // Crop tweaks + addSyncedBool(GameplayOption.TEMPERATURE_WITHERING, false, CROP_TWEAKS, + "Should crop withering be based on actual plant temperature or just the season?"); + + String[] cropDefault = { "minecraft:wheat;5;10;15;25;0.5", "minecraft:carrots;5;10;15;25;0.5", + "minecraft:potatoes;5;10;15;25;0.5", "minecraft:beetroots;5;10;15;25;0.5", + "minecraft:pumpkin_stem;5;10;15;25;0.5", "minecraft:melon_stem;5;10;15;25;0.5", + "harvestcraft:pamblackberryCrop;5;10;15;25;0.5", "harvestcraft:pamblueberryCrop;5;10;15;25;0.5", + "harvestcraft:pamcandleberryCrop;5;10;15;25;0.5", "harvestcraft:pamraspberryCrop;5;10;15;25;0.5", + "harvestcraft:pamstrawberryCrop;5;10;15;25;0.5", "harvestcraft:pamcactusfruitCrop;5;10;15;25;0.5", + "harvestcraft:pamasparagusCrop;5;10;15;25;0.5", "harvestcraft:pambarleyCrop;5;10;15;25;0.5", + "harvestcraft:pamoatsCrop;5;10;15;25;0.5", "harvestcraft:pamryeCrop;5;10;15;25;0.5", + "harvestcraft:pamcornCrop;5;10;15;25;0.5", "harvestcraft:pambambooshootCrop;5;10;15;25;0.5", + "harvestcraft:pamcantaloupeCrop;5;10;15;25;0.5", "harvestcraft:pamcucumberCrop;5;10;15;25;0.5", + "harvestcraft:pamwintersquashCrop;5;10;15;25;0.5", "harvestcraft:pamzucchiniCrop;5;10;15;25;0.5", + "harvestcraft:pambeetCrop;5;10;15;25;0.5", "harvestcraft:pamonionCrop;5;10;15;25;0.5", + "harvestcraft:pamparsnipCrop;5;10;15;25;0.5", "harvestcraft:pampeanutCrop;5;10;15;25;0.5", + "harvestcraft:pamradishCrop;5;10;15;25;0.5", "harvestcraft:pamrutabagaCrop;5;10;15;25;0.5", + "harvestcraft:pamsweetpotatoCrop;5;10;15;25;0.5", "harvestcraft:pamturnipCrop;5;10;15;25;0.5", + "harvestcraft:pamrhubarbCrop;5;10;15;25;0.5", "harvestcraft:pamceleryCrop;5;10;15;25;0.5", + "harvestcraft:pamgarlicCrop;5;10;15;25;0.5", "harvestcraft:pamgingerCrop;5;10;15;25;0.5", + "harvestcraft:pamspiceleafCrop;5;10;15;25;0.5", "harvestcraft:pamtealeafCrop;5;10;15;25;0.5", + "harvestcraft:pamcoffeebeanCrop;5;10;15;25;0.5", "harvestcraft:pammustardseedsCrop;5;10;15;25;0.5", + "harvestcraft:pambroccoliCrop;5;10;15;25;0.5", "harvestcraft:pamcauliflowerCrop;5;10;15;25;0.5", + "harvestcraft:pamleekCrop;5;10;15;25;0.5", "harvestcraft:pamlettuceCrop;5;10;15;25;0.5", + "harvestcraft:pamscallionCrop;5;10;15;25;0.5", "harvestcraft:pamartichokeCrop;5;10;15;25;0.5", + "harvestcraft:pambrusselsproutCrop;5;10;15;25;0.5", "harvestcraft:pamcabbageCrop;5;10;15;25;0.5", + "harvestcraft:pamspinachCrop;5;10;15;25;0.5", "harvestcraft:pamwhitemushroomCrop;5;10;15;25;0.5", + "harvestcraft:pambeanCrop;5;10;15;25;0.5", "harvestcraft:pamsoybeanCrop;5;10;15;25;0.5", + "harvestcraft:pambellpepperCrop;5;10;15;25;0.5", "harvestcraft:pamchilipepperCrop;5;10;15;25;0.5", + "harvestcraft:pameggplantCrop;5;10;15;25;0.5", "harvestcraft:pamokraCrop;5;10;15;25;0.5", + "harvestcraft:pampeasCrop;5;10;15;25;0.5", "harvestcraft:pamtomatoCrop;5;10;15;25;0.5", + "harvestcraft:pamcottonCrop;5;10;15;25;0.5", "harvestcraft:pampineappleCrop;5;10;15;25;0.5", + "harvestcraft:pamgrapeCrop;5;10;15;25;0.5", "harvestcraft:pamkiwiCrop;5;10;15;25;0.5", + "harvestcraft:pamcranberryCrop;5;10;15;25;0.5", "harvestcraft:pamriceCrop;5;10;15;25;0.5", + "harvestcraft:pamseaweedCrop;5;10;15;25;0.5", "harvestcraft:pamcurryleafCrop;5;10;15;25;0.5", + "harvestcraft:pamsesameseedsCrop;5;10;15;25;0.5", + "harvestcraft:pamwaterchestnutCrop;5;10;15;25;0.5" }; + addSyncedList(GameplayOption.CROPS, cropDefault, CROP_TWEAKS, + "List of crops with configurable min living, " + "min optimal, max optimal, max living temps, " + + "and the chance of skipping a growth tick outside " + + "of the optimal temperature range. ;-delimited"); + + String[] hibernateDefault = { "harvestcraft:pamAlmond;5;10;15;20;0.5", + "harvestcraft:pamApple;5;10;15;20;0.5", "harvestcraft:pamApricot;5;10;15;20;0.5", + "harvestcraft:pamAvocado;5;10;15;20;0.5", "harvestcraft:pamBanana;5;10;15;20;0.5", + "harvestcraft:pamCashew;5;10;15;20;0.5", "harvestcraft:pamCherry;5;10;15;20;0.5", + "harvestcraft:pamChestnut;5;10;15;20;0.5", "harvestcraft:pamCinnamon;5;10;15;20;0.5", + "harvestcraft:pamCoconut;5;10;15;20;0.5", "harvestcraft:pamDate;5;10;15;20;0.5", + "harvestcraft:pamDragonfruit;5;10;15;20;0.5", "harvestcraft:pamDurian;5;10;15;20;0.5", + "harvestcraft:pamFig;5;10;15;20;0.5", "harvestcraft:pamGooseberry;5;10;15;20;0.5", + "harvestcraft:pamGrapefruit;5;10;15;20;0.5", "harvestcraft:pamLemon;5;10;15;20;0.5", + "harvestcraft:pamLime;5;10;15;20;0.5", "harvestcraft:pamMango;5;10;15;20;0.5", + "harvestcraft:pamMaple;5;10;15;20;0.5", "harvestcraft:pamNutmeg;5;10;15;20;0.5", + "harvestcraft:pamOlive;5;10;15;20;0.5", "harvestcraft:pamOrange;5;10;15;20;0.5", + "harvestcraft:pamPapaya;5;10;15;20;0.5", "harvestcraft:pamPaperbark;5;10;15;20;0.5", + "harvestcraft:pamPeach;5;10;15;20;0.5", "harvestcraft:pamPear;5;10;15;20;0.5", + "harvestcraft:pamPecan;5;10;15;20;0.5", "harvestcraft:pamPeppercorn;5;10;15;20;0.5", + "harvestcraft:pamPersimmon;5;10;15;20;0.5", "harvestcraft:pamPistachio;5;10;15;20;0.5", + "harvestcraft:pamPlum;5;10;15;20;0.5", "harvestcraft:pamPomegranate;5;10;15;20;0.5", + "harvestcraft:pamStarfruit;5;10;15;20;0.5", "harvestcraft:pamVanillabean;5;10;15;20;0.5", + "harvestcraft:pamWalnut;5;10;15;20;0.5" }; + addSyncedList(GameplayOption.HIBERNATING, hibernateDefault, CROP_TWEAKS, + "List of hibernating crops with configurable min waking, " + + "min optimal, max optimal, max waking temps, " + + "and the chance of skipping a growth tick outside " + + "of the optimal temperature range. ;-delimited"); + } catch (Exception e) { + ToughAsNails.logger.error("Tough As Nails has encountered a problem loading gameplay.cfg", e); + } finally { + if (config.hasChanged()) { + config.save(); + } + } + } + + private static void addSyncedBool(GameplayOption option, boolean defaultValue, String category, String comment) { + boolean value = config.getBoolean(option.getOptionName(), category, defaultValue, comment); + SyncedConfig.addOption(option, "" + value); + } + + private static void addSyncedInt(GameplayOption option, int defaultValue, String category, String comment) { + int value = config.getInt(option.getOptionName(), category, defaultValue, Integer.MIN_VALUE, Integer.MAX_VALUE, + comment); + SyncedConfig.addOption(option, "" + value); + } + + private static void addSyncedFloat(GameplayOption option, float defaultValue, String category, String comment) { + float value = config.getFloat(option.getOptionName(), category, defaultValue, Float.MIN_VALUE, Float.MAX_VALUE, + comment); + SyncedConfig.addOption(option, "" + value); + } + + private static void addSyncedList(GameplayOption option, String[] defaultValue, String category, String comment) { + String[] drinkEntries = config.getStringList(option.getOptionName(), category, defaultValue, comment); + String drinkString = ""; + for (String drinkEntry : drinkEntries) { + drinkString += (drinkEntry + ","); + } + SyncedConfig.addOption(option, drinkString); + } + + @SubscribeEvent + public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event) { + if (event.getModID().equalsIgnoreCase(ToughAsNails.MOD_ID)) { + loadConfiguration(); + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/config/SyncedConfigHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/config/SyncedConfigHandler.java new file mode 100644 index 00000000..7322b898 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/config/SyncedConfigHandler.java @@ -0,0 +1,58 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.config; + +import java.util.Map.Entry; + +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.config.SyncedConfig; +import toughasnails.core.ToughAsNails; +import toughasnails.handler.PacketHandler; +import toughasnails.network.message.MessageSyncConfigs; + +public class SyncedConfigHandler { + + @SubscribeEvent + public void onPlayerLogin(PlayerLoggedInEvent event) { + EntityPlayer player = event.player; + World world = player.getEntityWorld(); + + if (!world.isRemote) { + NBTTagCompound nbtOptions = new NBTTagCompound(); + + for (Entry entry : SyncedConfig.optionsToSync + .entrySet()) { + nbtOptions.setString(entry.getKey(), entry.getValue().value); + } + + IMessage message = new MessageSyncConfigs(nbtOptions); + PacketHandler.instance.sendTo(message, (EntityPlayerMP) player); + } + } + + @SideOnly(Side.CLIENT) + @SubscribeEvent + public void onWorldUnload(WorldEvent.Unload event) { + if (event.getWorld().isRemote && !Minecraft.getMinecraft() + .getConnection().getNetworkManager().isChannelOpen()) { + SyncedConfig.restoreDefaults(); + ToughAsNails.logger + .info("TAN configuration restored to local values"); + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/config/TANConfig.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/config/TANConfig.java new file mode 100644 index 00000000..89f6f6f0 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/config/TANConfig.java @@ -0,0 +1,366 @@ +/******************************************************************************* + * Copyright 2014-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package toughasnails.config; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +import org.apache.commons.io.FileUtils; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + +import net.minecraft.block.Block; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import toughasnails.api.TANBlocks; +import toughasnails.block.BlockTANCampfire; +import toughasnails.block.BlockTANTemperatureCoil; +import toughasnails.block.BlockTANTemperatureCoil.CoilType; +import toughasnails.core.ToughAsNails; +import toughasnails.temperature.BlockTemperatureData; +import toughasnails.temperature.MaterialTemperatureData; +import toughasnails.util.BlockStateUtils; + +public class TANConfig { + + public static Gson serializer = new GsonBuilder().setPrettyPrinting().create(); + public static JsonParser parser = new JsonParser(); + + public static HashMap> blockTemperatureData; + + public static MaterialTemperatureData materialTemperatureData; + + public static void init(File configDir) { + + // Block temperature config: + blockTemperatureData = new HashMap>(); + + File blockTemperatureConfigFile = new File(configDir, "block_temperature.json"); + + // No config file, so create default config: + if (!blockTemperatureConfigFile.exists()) { + try { + BlockTemperatureData[] defaultBlockTemperatureData = { + new BlockTemperatureData( + TANBlocks.campfire.getDefaultState().withProperty(BlockTANCampfire.BURNING, true), + new String[] { BlockTANCampfire.BURNING.getName() }, 12.0F), + new BlockTemperatureData(Blocks.LIT_FURNACE.getDefaultState(), new String[0], + 12.0F), + new BlockTemperatureData(Blocks.LAVA.getDefaultState(), new String[0], + 1.5F), + new BlockTemperatureData(Blocks.FLOWING_LAVA.getDefaultState(), new String[0], 1.5F), + new BlockTemperatureData( + TANBlocks.temperature_coil.getDefaultState() + .withProperty(BlockTANTemperatureCoil.VARIANT, CoilType.HEATING) + .withProperty(BlockTANTemperatureCoil.POWERED, true), + new String[] { "heating_coil" }, 15.0f), + new BlockTemperatureData( + TANBlocks.temperature_coil.getDefaultState() + .withProperty(BlockTANTemperatureCoil.VARIANT, CoilType.COOLING) + .withProperty(BlockTANTemperatureCoil.POWERED, true), + new String[] { "cooling_coil" }, -15.0f) }; + + // Need to do this manually as there is some issue with getting + // Gson to serialise an IBlockState directly due to duplicated + // keys + JsonArray tempAry = new JsonArray(); + + for (BlockTemperatureData tempData : defaultBlockTemperatureData) { + tempAry.add(asJsonObject(tempData)); + } + + writeFile(blockTemperatureConfigFile, tempAry); + } catch (Exception e) { + ToughAsNails.logger.error("Error creating default block temperature config file: " + + blockTemperatureConfigFile.toString(), e); + } + } + + try { + String blockJsonString = FileUtils.readFileToString(blockTemperatureConfigFile); + + JsonElement blockAry = parser.parse(blockJsonString); + + if (blockAry == null) { + ToughAsNails.logger.error("Error parsing block temperature config from json file: " + + blockTemperatureConfigFile.toString() + " temperature information array does not exist."); + } + + if (blockAry.isJsonArray()) { + for (JsonElement ele : blockAry.getAsJsonArray()) { + BlockTemperatureData tempData = asBlockTemperatureData(ele, + "Error parsing block temperature state configuration " + ele.toString()); + + String blockName = tempData.state.getBlock().getRegistryName().toString(); + + if (!blockTemperatureData.containsKey(blockName)) { + blockTemperatureData.put(blockName, new ArrayList()); + } + + blockTemperatureData.get(blockName).add(tempData); + } + } + } catch (Exception e) { + ToughAsNails.logger.error( + "Error parsing block temperature config from json: " + blockTemperatureConfigFile.toString(), e); + } + + // Material temperature config: + materialTemperatureData = new MaterialTemperatureData(); + + File materialTemperatureConfigFile = new File(configDir, "material_temperature.json"); + + try { + if (!materialTemperatureConfigFile.exists()) { + writeFile(materialTemperatureConfigFile, materialTemperatureData); + } + } catch (Exception e) { + ToughAsNails.logger.error("Error creating default material temperature config file: " + + materialTemperatureConfigFile.toString(), e); + } + + try { + String materialJsonString = FileUtils.readFileToString(materialTemperatureConfigFile); + + Gson gson = new Gson(); + + materialTemperatureData = gson.fromJson(materialJsonString, MaterialTemperatureData.class); + } catch (Exception e) { + ToughAsNails.logger.error( + "Error parsing material temperature config from json: " + materialTemperatureConfigFile.toString(), + e); + } + + } + + protected static boolean writeFile(File outputFile, Object obj) { + try { + FileUtils.write(outputFile, serializer.toJson(obj)); + return true; + } catch (Exception e) { + ToughAsNails.logger + .error("Error writing config file " + outputFile.getAbsolutePath() + ": " + e.getMessage()); + return false; + } + } + + protected static Map parse(String jsonString) { + Map members; + + members = new HashMap(); + if (jsonString == null) { + return members; + } + + JsonElement rootElement = null; + try { + rootElement = parser.parse(jsonString); + if (rootElement != null) { + if (rootElement.isJsonObject()) { + for (Entry entry : rootElement.getAsJsonObject().entrySet()) { + members.put(entry.getKey(), entry.getValue()); + } + } else { + ToughAsNails.logger.error("Error parsing config: not a JSON object"); + } + } + } catch (Exception e) { + ToughAsNails.logger.error("Error parsing config: " + e.getMessage()); + } + + return members; + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + protected static ReadBlockState asBlockState(JsonElement ele, String extraPrefix) { + + try { + + JsonObject obj = ele.getAsJsonObject(); + + // attempt to load the specified block + if (!obj.has("block")) { + ToughAsNails.logger.error(extraPrefix + " Block name missing"); + return null; + } + JsonElement blockName = obj.get("block"); + if (!blockName.isJsonPrimitive()) { + ToughAsNails.logger.error(extraPrefix + " Invalid block name - must be a string"); + return null; + } + Block block = Block.getBlockFromName(blockName.getAsString()); + if (block == null) { + ToughAsNails.logger.error(extraPrefix + " Unrecognised block name " + blockName.getAsString()); + return null; + } + + IBlockState state = block.getDefaultState(); + + ArrayList usedProperties = new ArrayList(); + + // attempt to add properties + if (obj.has("properties")) { + JsonElement properties = obj.get("properties"); + if (!properties.isJsonObject()) { + ToughAsNails.logger.error(extraPrefix + " Invalid properties list - must be a JSON object"); + return null; + } + + for (Entry entry : properties.getAsJsonObject().entrySet()) { + String propRawName = entry.getKey(); + + IProperty property = BlockStateUtils.getPropertyByName(state, propRawName); + if (property != null) { + String propRawValue = entry.getValue().getAsString(); + + if (!propRawValue.equals("*")) { + Comparable propertyValue = BlockStateUtils.getPropertyValueByName(state, property, + propRawValue); + if (propertyValue != null) { + state = state.withProperty(property, propertyValue); + usedProperties.add(propRawName); + } else { + ToughAsNails.logger.error(extraPrefix + " Invalid value " + propRawValue + + " for property " + propRawName); + } + } + } else { + ToughAsNails.logger.error(extraPrefix + " Invalid property name: " + propRawName); + } + } + } + + return new ReadBlockState(state, usedProperties.toArray(new String[0])); + } catch (Exception e) { + ToughAsNails.logger.error(extraPrefix + " Error fetching blockstate: " + e.getMessage()); + return null; + } + + } + + protected static JsonObject asJsonObject(IBlockState state, String[] useProperties) { + try { + JsonObject obj = new JsonObject(); + + obj.addProperty("block", state.getBlock().getRegistryName().toString()); + + JsonObject props = new JsonObject(); + + for (IProperty blockProperty : state.getProperties().keySet()) { + String propName = blockProperty.getName(); + String propValue = state.getValue(blockProperty).toString(); + + if (useProperties != null) { + boolean foundProp = false; + for (String useName : useProperties) { + if (useName.equalsIgnoreCase(propName)) { + foundProp = true; + break; + } + } + + if (!foundProp) { + // If a property is unused, set the value to a special + // wildcard * to indicate that any value matches + propValue = "*"; + } + } + + props.addProperty(propName, propValue); + } + + obj.add("properties", props); + + return obj; + } catch (Exception e) { + ToughAsNails.logger.error("Error converting blockstate to Json: " + e.getMessage()); + return null; + } + } + + protected static JsonObject asJsonObject(IBlockState state) { + try { + return asJsonObject(state, null); + } catch (Exception e) { + ToughAsNails.logger.error("Error converting blockstate to Json: " + e.getMessage()); + return null; + } + } + + protected static JsonObject asJsonObject(BlockTemperatureData blockTemperatureData) { + JsonObject blockTempJson = new JsonObject(); + + JsonObject stateObject = asJsonObject(blockTemperatureData.state, blockTemperatureData.useProperties); + + blockTempJson.add("state", stateObject); + blockTempJson.addProperty("temperature", blockTemperatureData.blockTemperature); + + return blockTempJson; + } + + protected static BlockTemperatureData asBlockTemperatureData(JsonElement ele, String extraPrefix) { + try { + JsonObject obj = ele.getAsJsonObject(); + + // attempt to load the state + if (!obj.has("state")) { + ToughAsNails.logger.error(extraPrefix + " Block state missing"); + return null; + } + JsonElement blockState = obj.get("state"); + if (!blockState.isJsonObject()) { + ToughAsNails.logger.error(extraPrefix + " Invalid block state - must be an object"); + return null; + } + + ReadBlockState readState = asBlockState(blockState, extraPrefix); + + IBlockState state = readState.state; + String[] use_properties = readState.usedProperties; + + // attempt to get the temperature value + if (!obj.has("temperature")) { + ToughAsNails.logger.error(extraPrefix + " block temperature missing"); + return null; + } + JsonElement blockTemperature = obj.get("temperature"); + if (!blockTemperature.isJsonPrimitive()) { + ToughAsNails.logger.error(extraPrefix + " Invalid block temperature - must be a float"); + } + + float temperature = blockTemperature.getAsFloat(); + + return new BlockTemperatureData(state, use_properties, temperature); + } catch (Exception e) { + ToughAsNails.logger.error(extraPrefix + " Error fetching block temperature data: " + e.getMessage()); + return null; + } + + } + +} + +final class ReadBlockState { + IBlockState state; + String[] usedProperties; + + public ReadBlockState(IBlockState state, String[] usedProperties) { + this.state = state; + this.usedProperties = usedProperties; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/core/ClientProxy.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/core/ClientProxy.java new file mode 100644 index 00000000..b4c37a28 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/core/ClientProxy.java @@ -0,0 +1,129 @@ +package toughasnails.core; + +import net.minecraft.block.Block; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.Particle; +import net.minecraft.client.renderer.block.model.ModelBakery; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.block.statemap.IStateMapper; +import net.minecraft.client.renderer.block.statemap.StateMap; +import net.minecraft.client.renderer.block.statemap.StateMapperBase; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.MathHelper; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.client.registry.IRenderFactory; +import net.minecraftforge.fml.client.registry.RenderingRegistry; +import toughasnails.api.ITANBlock; +import toughasnails.entities.EntityFreeze; +import toughasnails.entities.RenderFreeze; +import toughasnails.entities.projectile.EntityIceball; +import toughasnails.entities.projectile.RenderIceball; +import toughasnails.particle.EntitySnowflakeFX; +import toughasnails.particle.TANParticleTypes; + +public class ClientProxy extends CommonProxy { + public static ResourceLocation particleTexturesLocation = new ResourceLocation( + "toughasnails:textures/particles/particles.png"); + + @Override + public void registerRenderers() { + // Entity rendering and other stuff will go here in future + registerEntityRenderer(EntityIceball.class, RenderIceball.class); + registerEntityRenderer(EntityFreeze.class, RenderFreeze.class); + } + + @Override + public void registerItemVariantModel(Item item, String name, int metadata) { + if (item != null) { + ModelBakery.registerItemVariants(item, new ResourceLocation("toughasnails:" + name)); + ModelLoader.setCustomModelResourceLocation(item, metadata, + new ModelResourceLocation(ToughAsNails.MOD_ID + ":" + name, "inventory")); + } + } + + @SuppressWarnings("rawtypes") + @Override + public void registerNonRenderingProperties(Block block) { + if (block instanceof ITANBlock) { + ITANBlock bopBlock = (ITANBlock) block; + IProperty[] nonRenderingProperties = bopBlock.getNonRenderingProperties(); + + if (nonRenderingProperties != null) { + // use a custom state mapper which will ignore the properties + // specified in the block as being non-rendering + IStateMapper custom_mapper = (new StateMap.Builder()).ignore(nonRenderingProperties).build(); + ModelLoader.setCustomStateMapper(block, custom_mapper); + } + } + } + + @Override + public void registerFluidBlockRendering(Block block, String name) { + final ModelResourceLocation fluidLocation = new ModelResourceLocation( + ToughAsNails.MOD_ID.toLowerCase() + ":fluids", name); + + // use a custom state mapper which will ignore the LEVEL property + ModelLoader.setCustomStateMapper(block, new StateMapperBase() { + @Override + protected ModelResourceLocation getModelResourceLocation(IBlockState state) { + return fluidLocation; + } + }); + } + + @Override + public void spawnParticle(TANParticleTypes type, double x, double y, double z, Object... info) { + Minecraft minecraft = Minecraft.getMinecraft(); + Particle entityFx = null; + switch (type) { + case SNOWFLAKE: + entityFx = new EntitySnowflakeFX(minecraft.theWorld, x, y, z, + MathHelper.getRandomDoubleInRange(minecraft.theWorld.rand, -0.03, 0.03), -0.02D, + MathHelper.getRandomDoubleInRange(minecraft.theWorld.rand, -0.03, 0.03)); + break; + default: + break; + } + + if (entityFx != null) { + minecraft.effectRenderer.addEffect(entityFx); + } + } + + // + // The below method and class is used as part of Forge 1668+'s workaround + // for render manager being null during preinit + // + + private static void registerEntityRenderer(Class entityClass, + Class> renderClass) { + RenderingRegistry.registerEntityRenderingHandler(entityClass, new EntityRenderFactory(renderClass)); + } + + private static class EntityRenderFactory implements IRenderFactory { + private Class> renderClass; + + private EntityRenderFactory(Class> renderClass) { + this.renderClass = renderClass; + } + + @Override + public Render createRenderFor(RenderManager manager) { + Render renderer = null; + + try { + renderer = renderClass.getConstructor(RenderManager.class).newInstance(manager); + } catch (Exception e) { + e.printStackTrace(); + } + + return renderer; + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/core/CommonProxy.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/core/CommonProxy.java new file mode 100644 index 00000000..8d3aeaeb --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/core/CommonProxy.java @@ -0,0 +1,14 @@ +package toughasnails.core; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import toughasnails.particle.TANParticleTypes; + +public class CommonProxy +{ + public void registerRenderers() {} + public void registerItemVariantModel(Item item, String name, int metadata) {} + public void registerNonRenderingProperties(Block block) {} + public void registerFluidBlockRendering(Block block, String name) {} + public void spawnParticle(TANParticleTypes type, double x, double y, double z, Object... info) {} +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/core/ToughAsNails.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/core/ToughAsNails.java new file mode 100644 index 00000000..8a7b2c9b --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/core/ToughAsNails.java @@ -0,0 +1,83 @@ +package toughasnails.core; + +import java.io.File; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.Mod.EventHandler; +import net.minecraftforge.fml.common.Mod.Instance; +import net.minecraftforge.fml.common.SidedProxy; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import net.minecraftforge.fml.common.event.FMLServerStartingEvent; +import toughasnails.command.TANCommand; +import toughasnails.config.TANConfig; +import toughasnails.handler.BlockHarvestEventHandler; +import toughasnails.handler.LootTableEventHandler; +import toughasnails.init.ModAchievements; +import toughasnails.init.ModBlocks; +import toughasnails.init.ModConfig; +import toughasnails.init.ModCrafting; +import toughasnails.init.ModEntities; +import toughasnails.init.ModHandlers; +import toughasnails.init.ModItems; +import toughasnails.init.ModPotions; +import toughasnails.init.ModStats; +import toughasnails.init.ModVanillaCompat; + +@Mod(modid = ToughAsNails.MOD_ID, version = ToughAsNails.MOD_VERSION, name = ToughAsNails.MOD_NAME, guiFactory = ToughAsNails.GUI_FACTORY) +public class ToughAsNails +{ + public static final String MOD_NAME = "Tough As Nails"; + public static final String MOD_ID = "ToughAsNails"; + public static final String MOD_VERSION = "@MOD_VERSION@"; + public static final String GUI_FACTORY = "toughasnails.client.gui.GuiFactory"; + + @Instance(MOD_ID) + public static ToughAsNails instance; + + @SidedProxy(clientSide = "toughasnails.core.ClientProxy", serverSide = "toughasnails.core.CommonProxy") + public static CommonProxy proxy; + + public static Logger logger = LogManager.getLogger(MOD_ID); + public static File configDirectory; + + @EventHandler + public void preInit(FMLPreInitializationEvent event) + { + configDirectory = new File(event.getModConfigurationDirectory(), "toughasnails"); + + ModConfig.init(configDirectory); + + ModBlocks.init(); + ModEntities.init(); + ModItems.init(); + ModStats.init(); + ModPotions.init(); + ModVanillaCompat.init(); + ModHandlers.init(); + + ModCrafting.init(); + ModAchievements.init(); + + MinecraftForge.EVENT_BUS.register(new LootTableEventHandler()); + MinecraftForge.EVENT_BUS.register(new BlockHarvestEventHandler()); + + proxy.registerRenderers(); + } + + @EventHandler + public void init(FMLInitializationEvent event) + { + TANConfig.init(configDirectory); + } + + @EventHandler + public void serverStarting(FMLServerStartingEvent event) + { + event.registerServerCommand(new TANCommand()); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/entities/EntityFreeze.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/entities/EntityFreeze.java new file mode 100644 index 00000000..ebe38d56 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/entities/EntityFreeze.java @@ -0,0 +1,227 @@ +package toughasnails.entities; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.util.DamageSource; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.item.TANItems; +import toughasnails.core.ToughAsNails; +import toughasnails.entities.projectile.EntityIceball; +import toughasnails.particle.TANParticleTypes; + +public class EntityFreeze extends EntityMob implements IMob { + private float heightOffset = 0.5F; + private int heightOffsetUpdateTime; + + @SuppressWarnings({ "rawtypes", "unchecked" }) + public EntityFreeze(World worldIn) { + super(worldIn); + this.experienceValue = 10; + this.tasks.addTask(4, new EntityFreeze.AIFireballAttack(this)); + this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[0])); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + } + + @Override + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(3.0D); + this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.23000000417232513D); + this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(48.0D); + } + + @Override + protected void entityInit() { + super.entityInit(); + } + + /* + * protected String getLivingSound() { return "mob.freeze.breathe"; } + * + * protected String getHurtSound() { return "mob.freeze.hit"; } + * + * protected String getDeathSound() { return "mob.freeze.death"; } + */ + + @Override + @SideOnly(Side.CLIENT) + public int getBrightnessForRender(float partialTicks) { + return 15728880; + } + + @Override + public float getBrightness(float partialTicks) { + return 1.0F; + } + + @Override + public void onLivingUpdate() { + if (!this.onGround && this.motionY < 0.0D) { + this.motionY *= 0.6D; + } + + if (this.getEntityWorld().isRemote) { + /* + * if (this.rand.nextInt(24) == 0 && !this.isSilent()) { + * this.worldObj.playSound(this.posX + 0.5D, this.posY + 0.5D, + * this.posZ + 0.5D, "fire.fire", 1.0F + this.rand.nextFloat(), + * this.rand.nextFloat() * 0.7F + 0.3F, false); } + */ + + for (int i = 0; i < 2; ++i) { + ToughAsNails.proxy.spawnParticle(TANParticleTypes.SNOWFLAKE, + this.posX + (this.rand.nextDouble() - 0.5D) * (double) this.width, + this.posY + this.rand.nextDouble() * (double) this.height, + this.posZ + (this.rand.nextDouble() - 0.5D) * (double) this.width, 0.0D, 0.0D, 0.0D, + new int[0]); + } + } + + super.onLivingUpdate(); + } + + @Override + protected void updateAITasks() { + if (this.isBurning()) { + this.attackEntityFrom(DamageSource.inFire, 1.0F); + } + + --this.heightOffsetUpdateTime; + + if (this.heightOffsetUpdateTime <= 0) { + this.heightOffsetUpdateTime = 100; + this.heightOffset = 0.5F + (float) this.rand.nextGaussian() * 3.0F; + } + + EntityLivingBase entitylivingbase = this.getAttackTarget(); + + if (entitylivingbase != null && entitylivingbase.posY + (double) entitylivingbase.getEyeHeight() > this.posY + + (double) this.getEyeHeight() + (double) this.heightOffset) { + this.motionY += (0.30000001192092896D - this.motionY) * 0.30000001192092896D; + this.isAirBorne = true; + } + + super.updateAITasks(); + } + + @Override + public void fall(float distance, float damageMultiplier) { + } + + @Override + protected Item getDropItem() { + return TANItems.freeze_rod; + } + + @Override + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { + if (p_70628_1_) { + int i = this.rand.nextInt(2 + p_70628_2_); + + for (int j = 0; j < i; ++j) { + this.dropItem(TANItems.freeze_rod, 1); + } + } + } + + @Override + protected boolean isValidLightLevel() { + return true; + } + + static class AIFireballAttack extends EntityAIBase { + private EntityFreeze freeze; + private int field_179467_b; + private int field_179468_c; + + public AIFireballAttack(EntityFreeze p_i45846_1_) { + this.freeze = p_i45846_1_; + this.setMutexBits(3); + } + + public boolean shouldExecute() { + EntityLivingBase entitylivingbase = this.freeze.getAttackTarget(); + return entitylivingbase != null && entitylivingbase.isEntityAlive(); + } + + public void startExecuting() { + this.field_179467_b = 0; + } + + public void updateTask() { + --this.field_179468_c; + EntityLivingBase entitylivingbase = this.freeze.getAttackTarget(); + double d0 = this.freeze.getDistanceSqToEntity(entitylivingbase); + + if (d0 < 4.0D) { + if (this.field_179468_c <= 0) { + this.field_179468_c = 20; + this.freeze.attackEntityAsMob(entitylivingbase); + } + + this.freeze.getMoveHelper().setMoveTo(entitylivingbase.posX, entitylivingbase.posY, + entitylivingbase.posZ, 1.0D); + } else if (d0 < 256.0D) { + double d1 = entitylivingbase.posX - this.freeze.posX; + double d2 = entitylivingbase.getEntityBoundingBox().minY + (double) (entitylivingbase.height / 2.0F) + - (this.freeze.posY + (double) (this.freeze.height / 2.0F)); + double d3 = entitylivingbase.posZ - this.freeze.posZ; + + if (this.field_179468_c <= 0) { + ++this.field_179467_b; + + if (this.field_179467_b == 1) { + this.field_179468_c = 60; + } else if (this.field_179467_b <= 4) { + this.field_179468_c = 6; + } else { + this.field_179468_c = 100; + this.field_179467_b = 0; + } + + if (this.field_179467_b > 1) { + float f = MathHelper.sqrt_double(MathHelper.sqrt_double(d0)) * 0.5F; + this.freeze.getEntityWorld().playEvent((EntityPlayer) null, 1009, + new BlockPos((int) this.freeze.posX, (int) this.freeze.posY, (int) this.freeze.posZ), + 0); + + for (int i = 0; i < 1; ++i) { + EntityIceball entityiceball = new EntityIceball(this.freeze.getEntityWorld(), this.freeze, + d1 + this.freeze.getRNG().nextGaussian() * (double) f, d2, + d3 + this.freeze.getRNG().nextGaussian() * (double) f); + entityiceball.posY = this.freeze.posY + (double) (this.freeze.height / 2.0F) + 0.5D; + this.freeze.getEntityWorld().spawnEntityInWorld(entityiceball); + } + } + } + + this.freeze.getLookHelper().setLookPositionWithEntity(entitylivingbase, 10.0F, 10.0F); + } else { + this.freeze.getNavigator().clearPathEntity(); + this.freeze.getMoveHelper().setMoveTo(entitylivingbase.posX, entitylivingbase.posY, + entitylivingbase.posZ, 1.0D); + } + + super.updateTask(); + } + } +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/entities/ModelFreeze.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/entities/ModelFreeze.java new file mode 100644 index 00000000..a73ce9f0 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/entities/ModelFreeze.java @@ -0,0 +1,76 @@ +package toughasnails.entities; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.math.MathHelper; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelFreeze extends ModelBase +{ + private ModelRenderer[] freezeSticks = new ModelRenderer[12]; + private ModelRenderer freezeHead; + + public ModelFreeze() + { + for (int i = 0; i < this.freezeSticks.length; ++i) + { + this.freezeSticks[i] = new ModelRenderer(this, 0, 16); + this.freezeSticks[i].addBox(0.0F, 0.0F, 0.0F, 2, 8, 2); + } + + this.freezeHead = new ModelRenderer(this, 0, 0); + this.freezeHead.addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); + } + + @Override + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + this.freezeHead.render(scale); + + for (int i = 0; i < this.freezeSticks.length; ++i) + { + this.freezeSticks[i].render(scale); + } + } + + @Override + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity entityIn) + { + float f = p_78087_3_ * (float)Math.PI * -0.1F; + + for (int i = 0; i < 4; ++i) + { + this.freezeSticks[i].rotationPointY = -2.0F + MathHelper.cos(((float)(i * 2) + p_78087_3_) * 0.25F); + this.freezeSticks[i].rotationPointX = MathHelper.cos(f) * 9.0F; + this.freezeSticks[i].rotationPointZ = MathHelper.sin(f) * 9.0F; + ++f; + } + + f = ((float)Math.PI / 4F) + p_78087_3_ * (float)Math.PI * 0.03F; + + for (int j = 4; j < 8; ++j) + { + this.freezeSticks[j].rotationPointY = 2.0F + MathHelper.cos(((float)(j * 2) + p_78087_3_) * 0.25F); + this.freezeSticks[j].rotationPointX = MathHelper.cos(f) * 7.0F; + this.freezeSticks[j].rotationPointZ = MathHelper.sin(f) * 7.0F; + ++f; + } + + f = 0.47123894F + p_78087_3_ * (float)Math.PI * -0.05F; + + for (int k = 8; k < 12; ++k) + { + this.freezeSticks[k].rotationPointY = 11.0F + MathHelper.cos(((float)k * 1.5F + p_78087_3_) * 0.5F); + this.freezeSticks[k].rotationPointX = MathHelper.cos(f) * 5.0F; + this.freezeSticks[k].rotationPointZ = MathHelper.sin(f) * 5.0F; + ++f; + } + + this.freezeHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.freezeHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + } +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/entities/RenderFreeze.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/entities/RenderFreeze.java new file mode 100644 index 00000000..b6ff4884 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/entities/RenderFreeze.java @@ -0,0 +1,24 @@ +package toughasnails.entities; + +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class RenderFreeze extends RenderLiving +{ + private static final ResourceLocation freezeTextures = new ResourceLocation("toughasnails:textures/entity/freeze.png"); + + public RenderFreeze(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelFreeze(), 0.5F); + } + + @Override + protected ResourceLocation getEntityTexture(EntityFreeze entity) + { + return freezeTextures; + } +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/entities/projectile/EntityIceball.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/entities/projectile/EntityIceball.java new file mode 100644 index 00000000..ecb1961d --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/entities/projectile/EntityIceball.java @@ -0,0 +1,336 @@ +package toughasnails.entities.projectile; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IProjectile; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.core.ToughAsNails; +import toughasnails.particle.TANParticleTypes; + +public class EntityIceball extends Entity implements IProjectile { + private int xTile = -1; + private int yTile = -1; + private int zTile = -1; + private Block inTile; + private boolean inGround; + public EntityLivingBase shootingEntity; + private int ticksAlive; + private int ticksInAir; + public double accelerationX; + public double accelerationY; + public double accelerationZ; + + public EntityIceball(World worldIn) { + super(worldIn); + this.setSize(0.3125F, 0.3125F); + } + + @Override + protected void entityInit() { + } + + @Override + @SideOnly(Side.CLIENT) + public boolean isInRangeToRenderDist(double distance) { + double d0 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D; + + if (Double.isNaN(d0)) { + d0 = 4.0D; + } + + d0 = d0 * 64.0D; + return distance < d0 * d0; + } + + public EntityIceball(World worldIn, double x, double y, double z, double accelX, double accelY, double accelZ) { + super(worldIn); + this.setSize(1.0F, 1.0F); + this.setLocationAndAngles(x, y, z, this.rotationYaw, this.rotationPitch); + this.setPosition(x, y, z); + double d0 = (double) MathHelper.sqrt_double(accelX * accelX + accelY * accelY + accelZ * accelZ); + this.accelerationX = accelX / d0 * 0.1D; + this.accelerationY = accelY / d0 * 0.1D; + this.accelerationZ = accelZ / d0 * 0.1D; + } + + public EntityIceball(World worldIn, EntityLivingBase shooter, double accelX, double accelY, double accelZ) { + super(worldIn); + this.shootingEntity = shooter; + this.setSize(1.0F, 1.0F); + this.setLocationAndAngles(shooter.posX, shooter.posY, shooter.posZ, shooter.rotationYaw, shooter.rotationPitch); + this.setPosition(this.posX, this.posY, this.posZ); + this.motionX = this.motionY = this.motionZ = 0.0D; + accelX = accelX + this.rand.nextGaussian() * 0.4D; + accelY = accelY + this.rand.nextGaussian() * 0.4D; + accelZ = accelZ + this.rand.nextGaussian() * 0.4D; + double d0 = (double) MathHelper.sqrt_double(accelX * accelX + accelY * accelY + accelZ * accelZ); + this.accelerationX = accelX / d0 * 0.1D; + this.accelerationY = accelY / d0 * 0.1D; + this.accelerationZ = accelZ / d0 * 0.1D; + } + + @Override + public void onUpdate() { + if (this.getEntityWorld().isRemote || (this.shootingEntity == null || !this.shootingEntity.isDead) + && this.getEntityWorld().isBlockLoaded(new BlockPos(this))) { + super.onUpdate(); + + if (this.inGround) { + if (this.getEntityWorld().getBlockState(new BlockPos(this.xTile, this.yTile, this.zTile)) + .getBlock() == this.inTile) { + ++this.ticksAlive; + + if (this.ticksAlive == 600) { + this.setDead(); + } + + return; + } + + this.inGround = false; + this.motionX *= (double) (this.rand.nextFloat() * 0.2F); + this.motionY *= (double) (this.rand.nextFloat() * 0.2F); + this.motionZ *= (double) (this.rand.nextFloat() * 0.2F); + this.ticksAlive = 0; + this.ticksInAir = 0; + } else { + ++this.ticksInAir; + } + + Vec3d vec3 = new Vec3d(this.posX, this.posY, this.posZ); + Vec3d vec31 = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + RayTraceResult movingobjectposition = this.getEntityWorld().rayTraceBlocks(vec3, vec31); + vec3 = new Vec3d(this.posX, this.posY, this.posZ); + vec31 = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (movingobjectposition != null) { + vec31 = new Vec3d(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, + movingobjectposition.hitVec.zCoord); + } + + Entity entity = null; + List list = this.getEntityWorld().getEntitiesWithinAABBExcludingEntity(this, + this.getEntityBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, + 1.0D)); + double d0 = 0.0D; + + for (int i = 0; i < list.size(); ++i) { + Entity entity1 = (Entity) list.get(i); + + if (entity1.canBeCollidedWith() + && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) { + float f = 0.3F; + AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expand((double) f, (double) f, + (double) f); + RayTraceResult movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31); + + if (movingobjectposition1 != null) { + double d1 = vec3.squareDistanceTo(movingobjectposition1.hitVec); + + if (d1 < d0 || d0 == 0.0D) { + entity = entity1; + d0 = d1; + } + } + } + } + + if (entity != null) { + movingobjectposition = new RayTraceResult(entity); + } + + if (movingobjectposition != null) { + this.onImpact(movingobjectposition); + } + + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float) (MathHelper.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; + + for (this.rotationPitch = (float) (MathHelper.atan2((double) f1, this.motionY) * 180.0D / Math.PI) + - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float f2 = this.getMotionFactor(); + + if (this.isInWater()) { + for (int j = 0; j < 4; ++j) { + float f3 = 0.25F; + this.getEntityWorld().spawnParticle(EnumParticleTypes.WATER_BUBBLE, + this.posX - this.motionX * (double) f3, this.posY - this.motionY * (double) f3, + this.posZ - this.motionZ * (double) f3, this.motionX, this.motionY, this.motionZ, + new int[0]); + } + + f2 = 0.8F; + } + + this.motionX += this.accelerationX; + this.motionY += this.accelerationY; + this.motionZ += this.accelerationZ; + this.motionX *= (double) f2; + this.motionY *= (double) f2; + this.motionZ *= (double) f2; + ToughAsNails.proxy.spawnParticle(TANParticleTypes.SNOWFLAKE, this.posX, this.posY + 0.5D, this.posZ, 0.0D, + 0.0D, 0.0D, new int[0]); + this.setPosition(this.posX, this.posY, this.posZ); + } else { + this.setDead(); + } + } + + protected float getMotionFactor() { + return 0.95F; + } + + protected void onImpact(RayTraceResult movingObject) { + if (!this.getEntityWorld().isRemote) { + if (movingObject.entityHit != null) { + boolean flag = movingObject.entityHit.attackEntityFrom(DamageSource.generic, 5.0F); + + if (flag) { + this.applyEnchantments(this.shootingEntity, movingObject.entityHit); + + /* + * if (!movingObject.entityHit.isImmuneToFire()) { + * movingObject.entityHit.setFire(5); } + */ + } + } else { + boolean flag1 = true; + + if (this.shootingEntity != null && this.shootingEntity instanceof EntityLiving) { + flag1 = this.getEntityWorld().getGameRules().getBoolean("mobGriefing"); + } + + if (flag1) { + // BlockPos blockpos = movingObject.getBlockPos() + // .offset(movingObject.sideHit); + + /* + * if (this.worldObj.isAirBlock(blockpos)) { + * this.worldObj.setBlockState(blockpos, + * Blocks.snow_layer.getDefaultState()); } + */ + } + } + + this.setDead(); + } + } + + @Override + public void writeEntityToNBT(NBTTagCompound tagCompound) { + tagCompound.setShort("xTile", (short) this.xTile); + tagCompound.setShort("yTile", (short) this.yTile); + tagCompound.setShort("zTile", (short) this.zTile); + ResourceLocation resourcelocation = (ResourceLocation) Block.REGISTRY.getNameForObject(this.inTile); + tagCompound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString()); + tagCompound.setByte("inGround", (byte) (this.inGround ? 1 : 0)); + tagCompound.setTag("direction", + this.newDoubleNBTList(new double[] { this.motionX, this.motionY, this.motionZ })); + } + + @Override + public void readEntityFromNBT(NBTTagCompound tagCompund) { + this.xTile = tagCompund.getShort("xTile"); + this.yTile = tagCompund.getShort("yTile"); + this.zTile = tagCompund.getShort("zTile"); + + if (tagCompund.hasKey("inTile", 8)) { + this.inTile = Block.getBlockFromName(tagCompund.getString("inTile")); + } else { + this.inTile = Block.getBlockById(tagCompund.getByte("inTile") & 255); + } + + this.inGround = tagCompund.getByte("inGround") == 1; + + if (tagCompund.hasKey("direction", 9)) { + NBTTagList nbttaglist = tagCompund.getTagList("direction", 6); + this.motionX = nbttaglist.getDoubleAt(0); + this.motionY = nbttaglist.getDoubleAt(1); + this.motionZ = nbttaglist.getDoubleAt(2); + } else { + this.setDead(); + } + } + + @Override + public boolean canBeCollidedWith() { + return true; + } + + @Override + public float getCollisionBorderSize() { + return 0.5F; + } + + @Override + public boolean attackEntityFrom(DamageSource source, float amount) { + if (this.isEntityInvulnerable(source)) { + return false; + } else { + this.setBeenAttacked(); + + if (source.getEntity() != null) { + Vec3d vec3 = source.getEntity().getLookVec(); + + if (vec3 != null) { + this.motionX = vec3.xCoord; + this.motionY = vec3.yCoord; + this.motionZ = vec3.zCoord; + this.accelerationX = this.motionX * 0.1D; + this.accelerationY = this.motionY * 0.1D; + this.accelerationZ = this.motionZ * 0.1D; + } + + if (source.getEntity() instanceof EntityLivingBase) { + this.shootingEntity = (EntityLivingBase) source.getEntity(); + } + + return true; + } else { + return false; + } + } + } + + @Override + public void setThrowableHeading(double x, double y, double z, float velocity, float inaccuracy) { + // TODO Auto-generated method stub + + } +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/entities/projectile/RenderIceball.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/entities/projectile/RenderIceball.java new file mode 100644 index 00000000..ded9ac67 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/entities/projectile/RenderIceball.java @@ -0,0 +1,53 @@ +package toughasnails.entities.projectile; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderItem; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.item.TANItems; + +@SideOnly(Side.CLIENT) +public class RenderIceball extends Render +{ + private final RenderItem renderItem; + + public RenderIceball(RenderManager renderManagerIn) + { + super(renderManagerIn); + this.renderItem = Minecraft.getMinecraft().getRenderItem(); + } + + @Override + public void doRender(EntityIceball entity, double x, double y, double z, float entityYaw, float partialTicks) + { + GlStateManager.pushMatrix(); + GlStateManager.translate((float)x, (float)y, (float)z); + GlStateManager.enableRescaleNormal(); + GlStateManager.scale(0.5F, 0.5F, 0.5F); + GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + this.renderItem.renderItem(this.getItemStack(entity), ItemCameraTransforms.TransformType.GROUND); + GlStateManager.disableRescaleNormal(); + GlStateManager.popMatrix(); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + public ItemStack getItemStack(EntityIceball entity) + { + return new ItemStack(TANItems.ice_charge, 1, 0); + } + + @Override + protected ResourceLocation getEntityTexture(EntityIceball entity) + { + return TextureMap.LOCATION_BLOCKS_TEXTURE; + } +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/AchievementEventHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/AchievementEventHandler.java new file mode 100644 index 00000000..778d4411 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/AchievementEventHandler.java @@ -0,0 +1,98 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.handler; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.event.entity.living.LivingEntityUseItemEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.PlayerEvent; +import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; +import toughasnails.api.achievement.TANAchievements; +import toughasnails.api.item.TANItems; + +public class AchievementEventHandler { + @SubscribeEvent + public void onItemPickup(PlayerEvent.ItemPickupEvent event) { + ItemStack stack = event.pickedUp.getEntityItem(); + Item item = stack.getItem(); + EntityPlayer player = event.player; + + if (item != null && item == TANItems.freeze_rod) { + player.addStat(TANAchievements.into_ice); + } + } + + @SubscribeEvent + public void onItemUsed(PlayerInteractEvent event) { + /* + * TODO: 1.9 if (event.action != Action.LEFT_CLICK_BLOCK) { ItemStack + * stack = event.entityPlayer.getHeldItem(); Item item = stack != null ? + * stack.getItem() : null; EntityPlayer player = event.entityPlayer; + * + * //Gone Home if (item == BOPItems.enderporter) { + * player.addStat(BOPAchievements.use_enderporter); } } + */ + } + + @SubscribeEvent + public void onItemUsed(LivingEntityUseItemEvent.Finish event) { + ItemStack stack = event.getItem(); + Item item = stack.getItem(); + + if (event.getEntity() instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) event.getEntityLiving(); + + // Life or Death + if (item == TANItems.lifeblood_crystal) { + player.addStat(TANAchievements.life_or_death); + } + } + } + + @SubscribeEvent + public void onItemCrafted(ItemCraftedEvent event) { + Item item = event.crafting.getItem(); + EntityPlayer player = event.player; + + // Thirst Quencher Achievement + if (item != null && item == TANItems.canteen) { + player.addStat(TANAchievements.thirst_quencher); + } + + // Thirst Ender Achievement + if (item != null && item == TANItems.fruit_juice) { + player.addStat(TANAchievements.thirst_ender); + } + + // Hot or Cold Achievement + if (item != null && item == TANItems.thermometer) { + player.addStat(TANAchievements.hot_or_cold); + } + + // That Time Of Year + if (item != null && item == TANItems.season_clock) { + player.addStat(TANAchievements.that_time_of_year); + } + } + + /* + * @SubscribeEvent public void onPlayerUpdate(LivingUpdateEvent event) { if + * (!event.getEntity().worldObj.isRemote && event.getEntity() instanceof + * EntityPlayer) { EntityPlayerMP player = + * (EntityPlayerMP)event.getEntity(); + * + * if (player.ticksExisted % 20 * 5 == 0) { if + * (!player.getStatFile().hasAchievementUnlocked(TANAchievements.year_one)) + * { + * + * } } } } + */ +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/BlockHarvestEventHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/BlockHarvestEventHandler.java new file mode 100644 index 00000000..bdc1832e --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/BlockHarvestEventHandler.java @@ -0,0 +1,27 @@ +package toughasnails.handler; + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import toughasnails.api.item.TANItems; + +public class BlockHarvestEventHandler { + @SubscribeEvent + public void onBlockBreak(HarvestDropsEvent event) { + IBlockState state = event.getState(); + // int fortune = event.getFortuneLevel(); + + if (event.getHarvester() == null || event.isSilkTouching()) + return; + + if (state.getBlock() == Blocks.ICE && event.getHarvester() != null) { + event.getDrops().clear(); + event.getDrops().add( + new ItemStack(TANItems.ice_cube, new Random().nextInt(2))); + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/ExtendedStatHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/ExtendedStatHandler.java new file mode 100644 index 00000000..1af43ad7 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/ExtendedStatHandler.java @@ -0,0 +1,75 @@ +package toughasnails.handler; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.event.AttachCapabilitiesEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; +import net.minecraftforge.fml.common.gameevent.TickEvent.PlayerTickEvent; +import toughasnails.api.stat.IPlayerStat; +import toughasnails.api.stat.PlayerStatRegistry; +import toughasnails.api.stat.StatHandlerBase; +import toughasnails.core.ToughAsNails; + +public class ExtendedStatHandler { + @SuppressWarnings("deprecation") + @SubscribeEvent + public void onAttachCapabilities(AttachCapabilitiesEvent.Entity event) { + if (event.getEntity() instanceof EntityPlayer) { + for (String identifier : PlayerStatRegistry.getCapabilityMap().keySet()) { + ResourceLocation loc = new ResourceLocation(ToughAsNails.MOD_ID, identifier); + + // Each player should have their own instance for each stat, as + // associated values may vary + if (!event.getCapabilities().containsKey(loc)) + event.addCapability(loc, PlayerStatRegistry.createCapabilityProvider(identifier)); + } + } + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @SubscribeEvent + public void onPlayerLogin(PlayerLoggedInEvent event) { + EntityPlayer player = event.player; + World world = player.getEntityWorld(); + + if (!world.isRemote) { + for (Capability capability : PlayerStatRegistry.getCapabilityMap().values()) { + StatHandlerBase stat = (StatHandlerBase) player.getCapability(capability, null); + + capability.getStorage().readNBT(capability, stat, null, + player.getEntityData().getCompoundTag(capability.getName())); + stat.onSendClientUpdate(); + PacketHandler.instance.sendTo(stat.createUpdateMessage(), (EntityPlayerMP) player); + } + } + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @SubscribeEvent + public void onPlayerTick(PlayerTickEvent event) { + EntityPlayer player = event.player; + World world = player.getEntityWorld(); + + if (!world.isRemote) { + for (Capability capability : PlayerStatRegistry.getCapabilityMap().values()) { + IPlayerStat stat = (IPlayerStat) player.getCapability(capability, null); + + stat.update(player, world, event.phase); + + if (event.phase == Phase.START) { + if (stat.hasChanged()) { + player.getEntityData().setTag(capability.getName(), + capability.getStorage().writeNBT(capability, stat, null)); + stat.onSendClientUpdate(); + PacketHandler.instance.sendTo(stat.createUpdateMessage(), (EntityPlayerMP) player); + } + } + } + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/LootTableEventHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/LootTableEventHandler.java new file mode 100644 index 00000000..016899f3 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/LootTableEventHandler.java @@ -0,0 +1,44 @@ +package toughasnails.handler; + +import net.minecraft.world.storage.loot.LootEntryItem; +import net.minecraft.world.storage.loot.LootPool; +import net.minecraft.world.storage.loot.LootTableList; +import net.minecraft.world.storage.loot.conditions.LootCondition; +import net.minecraft.world.storage.loot.functions.LootFunction; +import net.minecraftforge.event.LootTableLoadEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import toughasnails.api.item.TANItems; + +public class LootTableEventHandler +{ + @SubscribeEvent + public void onLootTableLoad(LootTableLoadEvent event) + { + if (event.getName().equals(LootTableList.CHESTS_NETHER_BRIDGE)) + { + LootPool main = event.getTable().getPool("main"); + if (main != null) + { + main.addEntry(new LootEntryItem(TANItems.lifeblood_crystal, 1, 0, new LootFunction[0], new LootCondition[0], "toughasnails:lifeblood_crystal")); + } + } + if (event.getName().equals(LootTableList.CHESTS_SPAWN_BONUS_CHEST)) + { + LootPool main = event.getTable().getPool("main"); + if (main != null) + { + main.addEntry(new LootEntryItem(TANItems.canteen, 10, 0, new LootFunction[0], new LootCondition[0], "toughasnails:canteen")); + } + } + if (event.getName().equals(LootTableList.CHESTS_IGLOO_CHEST)) + { + LootPool main = event.getTable().getPool("main"); + if (main != null) + { + main.addEntry(new LootEntryItem(TANItems.ice_cube, 8, 5, new LootFunction[0], new LootCondition[0], "toughasnails:ice_cube")); + main.addEntry(new LootEntryItem(TANItems.freeze_powder, 4, 3, new LootFunction[0], new LootCondition[0], "toughasnails:freeze_powder")); + main.addEntry(new LootEntryItem(TANItems.freeze_rod, 2, 1, new LootFunction[0], new LootCondition[0], "toughasnails:freeze_rod")); + } + } + } +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/PacketHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/PacketHandler.java new file mode 100644 index 00000000..27d1f5c2 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/PacketHandler.java @@ -0,0 +1,25 @@ +package toughasnails.handler; + +import net.minecraftforge.fml.common.network.NetworkRegistry; +import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; +import net.minecraftforge.fml.relauncher.Side; +import toughasnails.core.ToughAsNails; +import toughasnails.network.message.MessageSyncConfigs; +import toughasnails.network.message.MessageSyncSeasonCycle; +import toughasnails.network.message.MessageTemperatureClient; +import toughasnails.network.message.MessageToggleUI; +import toughasnails.network.message.MessageUpdateStat; + +public class PacketHandler +{ + public static final SimpleNetworkWrapper instance = NetworkRegistry.INSTANCE.newSimpleChannel(ToughAsNails.MOD_ID); + + public static void init() + { + instance.registerMessage(MessageUpdateStat.class, MessageUpdateStat.class, 0, Side.CLIENT); + instance.registerMessage(MessageTemperatureClient.class, MessageTemperatureClient.class, 1, Side.CLIENT); + instance.registerMessage(MessageToggleUI.class, MessageToggleUI.class, 2, Side.CLIENT); + instance.registerMessage(MessageSyncSeasonCycle.class, MessageSyncSeasonCycle.class, 3, Side.CLIENT); + instance.registerMessage(MessageSyncConfigs.class, MessageSyncConfigs.class, 4, Side.CLIENT); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/health/HealthOverlayHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/health/HealthOverlayHandler.java new file mode 100644 index 00000000..682edee8 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/health/HealthOverlayHandler.java @@ -0,0 +1,59 @@ +package toughasnails.handler.health; + +import static toughasnails.util.RenderUtils.drawTexturedModalRect; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.event.RenderGameOverlayEvent; +import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import toughasnails.api.HealthHelper; +import toughasnails.api.config.GameplayOption; +import toughasnails.api.config.SyncedConfig; + +public class HealthOverlayHandler { + public static final ResourceLocation OVERLAY = new ResourceLocation("toughasnails:textures/gui/overlay.png"); + + // private final Random random = new Random(); + private final Minecraft minecraft = Minecraft.getMinecraft(); + + @SubscribeEvent + public void onPostRenderOverlay(RenderGameOverlayEvent.Pre event) { + ScaledResolution resolution = event.getResolution(); + int width = resolution.getScaledWidth(); + int height = resolution.getScaledHeight(); + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + + if (event.getType() == ElementType.HEALTH + && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_LOWERED_STARTING_HEALTH)) { + minecraft.getTextureManager().bindTexture(OVERLAY); + + if (minecraft.playerController.gameIsSurvivalOrAdventure()) { + drawInactiveHearts(width, height, HealthHelper.getInactiveHearts(player)); + } + } + } + + private void drawInactiveHearts(int width, int height, int inactiveHearts) { + GlStateManager.disableDepth(); + GlStateManager.enableBlend(); + int left = width / 2 - 91; + int top = height - 39; + + for (int i = 0; i < inactiveHearts; i++) { + int activeOffset = 8 * (10 - inactiveHearts); + int startX = left + i * 8 + activeOffset; + int startY = top; + + drawTexturedModalRect(startX, startY, 0, 43, 9, 9); + } + + minecraft.getTextureManager().bindTexture(Gui.ICONS); + GlStateManager.disableBlend(); + GlStateManager.enableDepth(); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/health/MaxHealthHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/health/MaxHealthHandler.java new file mode 100644 index 00000000..8b3f9182 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/health/MaxHealthHandler.java @@ -0,0 +1,238 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.handler.health; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; + +import net.minecraft.client.Minecraft; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.integrated.IntegratedServer; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; +import net.minecraft.world.storage.WorldInfo; +import net.minecraftforge.event.entity.player.PlayerEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.HealthHelper; +import toughasnails.api.config.GameplayOption; +import toughasnails.api.config.SyncedConfig; + +public class MaxHealthHandler { + // TODO: If the health config option is changed and the current health is + // lower increase it to that new default + @SubscribeEvent + public void onPlayerLogin(TickEvent.PlayerTickEvent event) { + EntityPlayer player = event.player; + World world = player.getEntityWorld(); + + if (!world.isRemote) { + updateStartingHealthModifier(world.getDifficulty(), player); + } + } + + @SubscribeEvent + public void onPlayerClone(PlayerEvent.Clone event) { + IAttributeInstance oldMaxHealthInstance = event.getOriginal().getAttributeMap() + .getAttributeInstance(SharedMonsterAttributes.MAX_HEALTH); + AttributeModifier modifier = oldMaxHealthInstance.getModifier(HealthHelper.LIFEBLOOD_HEALTH_MODIFIER_ID); + + // Copy the lifeblood modifier from the 'old' player + if (SyncedConfig.getBooleanValue(GameplayOption.ENABLE_LOWERED_STARTING_HEALTH) && modifier != null) { + Multimap multimap = HashMultimap. create(); + multimap.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), modifier); + event.getEntityPlayer().getAttributeMap().applyAttributeModifiers(multimap); + } + } + + @SideOnly(Side.CLIENT) + @SubscribeEvent + public void onServerTick(TickEvent.ServerTickEvent event) { + Minecraft minecraft = Minecraft.getMinecraft(); + IntegratedServer integratedServer = minecraft.getIntegratedServer(); + + if (SyncedConfig.getBooleanValue(GameplayOption.ENABLE_LOWERED_STARTING_HEALTH) && event.phase == Phase.END + && integratedServer != null) { + boolean gamePaused = Minecraft.getMinecraft().getConnection() != null && minecraft.isGamePaused(); + + if (!gamePaused && minecraft.theWorld != null) { + WorldInfo serverWorldInfo = integratedServer.worldServers[0].getWorldInfo(); + WorldInfo localWorldInfo = minecraft.theWorld.getWorldInfo(); + + // This is checked before the difficulty is actually changed to + // make the two match in IntegratedServer's tick() + if (localWorldInfo.getDifficulty() != serverWorldInfo.getDifficulty()) { + List players = integratedServer.getPlayerList().getPlayerList(); + + // Update the modifiers of all the connected players + for (EntityPlayerMP player : players) { + updateStartingHealthModifier(localWorldInfo.getDifficulty(), player); + } + } + } + } + } + + private static Map maxHealth = new HashMap(); + + public static void overrideMaximumHealth(UUID player, int newMaximumHealth) { + if (newMaximumHealth > 0 && newMaximumHealth <= 20) { + maxHealth.put(player, newMaximumHealth); + File f = new File("player_health_overrides.txt"); + List lines = new ArrayList(); + try { + if (!f.exists()) { + f.createNewFile(); + } + + BufferedReader br = new BufferedReader(new FileReader(f)); + String line; + while ((line = br.readLine()) != null) { + String[] split = line.split("\\|"); + String idString = split[0]; + if (!player.toString().equals(idString)) { + lines.add(line); + } + } + br.close(); + + f.delete(); + f.createNewFile(); + PrintWriter writer = new PrintWriter(new FileWriter("player_health_overrides.txt")); + for (String outLine : lines) { + writer.println(outLine); + } + writer.println(player.toString() + "|" + newMaximumHealth); + writer.close(); + } catch (FileNotFoundException e1) { + e1.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + private void updateStartingHealthModifier(EnumDifficulty difficulty, EntityPlayer player) { + UUID id = player.getUniqueID(); + IAttributeInstance maxHealthInstance = player.getAttributeMap() + .getAttributeInstance(SharedMonsterAttributes.MAX_HEALTH); + AttributeModifier modifier = maxHealthInstance.getModifier(HealthHelper.STARTING_HEALTH_MODIFIER_ID); + + // Don't update if the lowered starting health config option is disabled + if (!SyncedConfig.getBooleanValue(GameplayOption.ENABLE_LOWERED_STARTING_HEALTH)) { + if (modifier != null) { + maxHealthInstance.removeModifier(HealthHelper.STARTING_HEALTH_MODIFIER_ID); + } + + return; + } + + double difficultyHealthDecrement = 0; + boolean initialized = false; + if (!maxHealth.containsKey(id)) { + File f = new File("player_health_overrides.txt"); + try { + if (!f.exists()) { + f.createNewFile(); + } + + BufferedReader br = new BufferedReader(new FileReader(f)); + String line; + while ((line = br.readLine()) != null) { + String split[] = line.split("\\|"); + String idString = split[0]; + String maxHealthString = split[1]; + if (id.toString().equals(idString)) { + maxHealth.put(id, Integer.parseInt(maxHealthString)); + initialized = true; + break; + } + } + br.close(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } else { + difficultyHealthDecrement = -(20 - maxHealth.get(id)); + initialized = true; + } + + if (!initialized) { + switch (difficulty) { + case EASY: + difficultyHealthDecrement = -6.0D; + maxHealth.put(id, 14); + break; + + case NORMAL: + difficultyHealthDecrement = -10.0D; + maxHealth.put(id, 10); + break; + + case HARD: + difficultyHealthDecrement = -14.0D; + maxHealth.put(id, 6); + break; + + default: + difficultyHealthDecrement = -0.0D; + maxHealth.put(id, 20); + break; + } + } + + double lifebloodHearts = HealthHelper.getLifebloodHearts(player) * 2; + double overallHealthDecrement = difficultyHealthDecrement + lifebloodHearts; + + // Ensure that the total hearts is never above 20 when the difficulty is + // changed + if (overallHealthDecrement > 0.0D) { + difficultyHealthDecrement -= overallHealthDecrement; + } + + // If the player doesn't have a modifier for a lowered starting health, + // add one + // Or alternatively, if the player already has the attribute, update it + // only if it is less than the current difficulty + // When the difficulty is changed locally in the options menu, it should + // always change (forceUpdate) + if (modifier == null || modifier.getAmount() != difficultyHealthDecrement) { + Multimap multimap = HashMultimap. create(); + modifier = new AttributeModifier(HealthHelper.STARTING_HEALTH_MODIFIER_ID, "Starting Health Modifier", + difficultyHealthDecrement, 0); + multimap.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), modifier); + player.getAttributeMap().applyAttributeModifiers(multimap); + + if (player.getHealth() > player.getMaxHealth()) { + player.setHealth(player.getMaxHealth()); + } + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/season/ProviderIceHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/season/ProviderIceHandler.java new file mode 100644 index 00000000..76afb97e --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/season/ProviderIceHandler.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.handler.season; + +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.event.terraingen.PopulateChunkEvent; +import net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType; +import net.minecraftforge.fml.common.eventhandler.Event.Result; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import toughasnails.season.SeasonASMHelper; + +public class ProviderIceHandler +{ + /**Handle our own ice generation to ignore winter*/ + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onPopulateChunkEvent(PopulateChunkEvent.Populate event) + { + World world = event.getWorld(); + BlockPos pos = new BlockPos(event.getChunkX() * 16, 0, event.getChunkZ() * 16).add(8, 0, 8); + + if (event.getType() == EventType.ICE) + { + for (int k2 = 0; k2 < 16; ++k2) + { + for (int j3 = 0; j3 < 16; ++j3) + { + BlockPos blockpos1 = world.getPrecipitationHeight(pos.add(k2, 0, j3)); + BlockPos blockpos2 = blockpos1.down(); + + if (SeasonASMHelper.canBlockFreezeInSeason(world, blockpos2, false, null)) + { + world.setBlockState(blockpos2, Blocks.ICE.getDefaultState(), 2); + } + + if (SeasonASMHelper.canSnowAtInSeason(world, blockpos1, true, null)) + { + world.setBlockState(blockpos1, Blocks.SNOW_LAYER.getDefaultState(), 2); + } + } + } + + event.setResult(Result.DENY); + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/season/RandomUpdateHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/season/RandomUpdateHandler.java new file mode 100644 index 00000000..4bdc6155 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/season/RandomUpdateHandler.java @@ -0,0 +1,100 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.handler.season; + +import java.util.Iterator; +import java.util.Random; + +import net.minecraft.block.BlockIce; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.WorldServer; +import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; +import net.minecraftforge.fml.relauncher.Side; +import toughasnails.api.config.GameplayOption; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.season.Season; +import toughasnails.api.season.Season.SubSeason; +import toughasnails.api.season.SeasonHelper; + +public class RandomUpdateHandler { + + Random random = new Random(); + + // Randomly melt ice and snow when it isn't winter + @SubscribeEvent + public void onWorldTick(TickEvent.WorldTickEvent event) { + if (event.phase == Phase.END && event.side == Side.SERVER) { + WorldServer world = (WorldServer) event.world; + Season season = SeasonHelper.getSeasonData(world).getSubSeason().getSeason(); + SubSeason subSeason = SeasonHelper.getSeasonData(world).getSubSeason(); + + if (!(SyncedConfig.getBooleanValue(GameplayOption.ENABLE_SEASONS))) { + season = Season.SUMMER; + subSeason = SubSeason.MID_SUMMER; + } + + // Only melt when it isn't winter + if (subSeason != SubSeason.EARLY_WINTER && subSeason != SubSeason.MID_WINTER + && subSeason != SubSeason.LATE_WINTER) { + for (Iterator iterator = world + .getPersistentChunkIterable(world.getPlayerChunkMap().getChunkIterator()); iterator + .hasNext();) { + Chunk chunk = (Chunk) iterator.next(); + int x = chunk.xPosition * 16; + int z = chunk.zPosition * 16; + + int rand; + switch (subSeason) { + case EARLY_SPRING: + rand = 16; + break; + case MID_SPRING: + rand = 12; + break; + case LATE_SPRING: + rand = 8; + break; + default: + rand = 4; + break; + } + + if (world.rand.nextInt(rand) == 0) { + int randOffset = (random.nextInt() * 3 + 1013904223) >> 2; + BlockPos topPos = world.getPrecipitationHeight( + new BlockPos(x + (randOffset & 15), 0, z + (randOffset >> 8 & 15))); + BlockPos groundPos = topPos.down(); + + if (world.getBlockState(groundPos).getBlock() == Blocks.ICE + && !SeasonHelper.canSnowAtTempInSeason(season, + world.getBiome(groundPos).getFloatTemperature(groundPos))) { + + if (world.provider.doesWaterVaporize()) { + world.setBlockToAir(groundPos); + } else { + ((BlockIce) Blocks.ICE).dropBlockAsItem(world, groundPos, + world.getBlockState(groundPos), 0); + world.setBlockState(groundPos, Blocks.WATER.getDefaultState()); + world.notifyBlockOfStateChange(groundPos, Blocks.WATER); + } + } + + if (world.getBlockState(topPos).getBlock() == Blocks.SNOW_LAYER && !SeasonHelper + .canSnowAtTempInSeason(season, world.getBiome(topPos).getFloatTemperature(topPos))) { + world.setBlockToAir(topPos); + } + } + } + } + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/season/SeasonHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/season/SeasonHandler.java new file mode 100644 index 00000000..4fa9c809 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/season/SeasonHandler.java @@ -0,0 +1,244 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.handler.season; + +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.storage.MapStorage; +import net.minecraftforge.event.world.BlockEvent; +import net.minecraftforge.fml.common.eventhandler.Event; +import net.minecraftforge.fml.common.eventhandler.Event.Result; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import toughasnails.api.config.GameplayOption; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.season.IDecayableCrop; +import toughasnails.api.season.IHibernatingCrop; +import toughasnails.api.season.ISeasonData; +import toughasnails.api.season.Season; +import toughasnails.api.season.Season.SubSeason; +import toughasnails.api.season.SeasonHelper; +import toughasnails.api.temperature.Temperature; +import toughasnails.api.temperature.TemperatureHelper; +import toughasnails.config.CropGrowConfigEntry; +import toughasnails.config.GameplayConfigurationHandler; +import toughasnails.handler.PacketHandler; +import toughasnails.network.message.MessageSyncSeasonCycle; +import toughasnails.season.SeasonSavedData; +import toughasnails.season.SeasonTime; +import toughasnails.temperature.TemperatureHandler; + +public class SeasonHandler { + + @SubscribeEvent + public void onWorldTick(TickEvent.WorldTickEvent event) { + World world = event.world; + + if (event.phase == TickEvent.Phase.END && !world.isRemote && world.provider.getDimension() == 0 + && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_SEASONS)) { + SeasonSavedData savedData = getSeasonSavedData(world); + + if (savedData.seasonCycleTicks++ > SeasonTime.TOTAL_CYCLE_TICKS) { + savedData.seasonCycleTicks = 0; + } + + if (savedData.seasonCycleTicks % 20 == 0) { + sendSeasonUpdate(world); + } + + savedData.markDirty(); + } + } + + @SubscribeEvent + public void onPlayerLogin(PlayerLoggedInEvent event) { + EntityPlayer player = event.player; + World world = player.getEntityWorld(); + + sendSeasonUpdate(world); + } + + private SubSeason lastSeason = null; + public static int clientSeasonCycleTicks = 0; + + @SubscribeEvent + public void onClientTick(TickEvent.ClientTickEvent event) { + // Only do this when in the world + if (Minecraft.getMinecraft().thePlayer == null) + return; + + int dimension = Minecraft.getMinecraft().thePlayer.dimension; + + if (event.phase == TickEvent.Phase.END && dimension == 0 + && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_SEASONS)) { + // Keep ticking as we're synchronized with the server only every + // second + if (clientSeasonCycleTicks++ > SeasonTime.TOTAL_CYCLE_TICKS) { + clientSeasonCycleTicks = 0; + } + + SeasonTime calendar = new SeasonTime(clientSeasonCycleTicks); + + if (calendar.getSubSeason() != lastSeason) { + Minecraft.getMinecraft().renderGlobal.loadRenderers(); + lastSeason = calendar.getSubSeason(); + } + } + } + + public static void sendSeasonUpdate(World world) { + if (!world.isRemote && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_SEASONS)) { + SeasonSavedData savedData = getSeasonSavedData(world); + PacketHandler.instance.sendToAll(new MessageSyncSeasonCycle(savedData.seasonCycleTicks)); + } + } + + public static SeasonSavedData getSeasonSavedData(World world) { + MapStorage mapStorage = world.getPerWorldStorage(); + SeasonSavedData savedData = (SeasonSavedData) mapStorage.getOrLoadData(SeasonSavedData.class, + SeasonSavedData.DATA_IDENTIFIER); + + // If the saved data file hasn't been created before, create it + if (savedData == null) { + savedData = new SeasonSavedData(SeasonSavedData.DATA_IDENTIFIER); + mapStorage.setData(SeasonSavedData.DATA_IDENTIFIER, savedData); + savedData.markDirty(); // Mark for saving + } + + return savedData; + } + + /* + * Check for hibernating crops attempting to grow in the cold or heat, and + * block them. + */ + @SubscribeEvent + public void onCropGrowPre(BlockEvent.CropGrowEvent.Pre event) { + if (!event.getWorld().isRemote) { + Block block = event.getState().getBlock(); + String blockName = block.getRegistryName().toString(); + BlockPos pos = event.getPos(); + World world = event.getWorld(); + boolean temperatureWithering = SyncedConfig.getBooleanValue(GameplayOption.TEMPERATURE_WITHERING); + if (temperatureWithering) { + int minHibernate = 0; + int minOptimal = 0; + int maxOptimal = 0; + int maxHibernate = 0; + float nonOptimalChance = 0; + // Assign crop hibernation details from config file. + if (GameplayConfigurationHandler.EXTERNAL_HIBERNATING_CROPS.containsKey(blockName)) { + CropGrowConfigEntry cropData = GameplayConfigurationHandler.EXTERNAL_HIBERNATING_CROPS + .get(blockName); + minHibernate = cropData.getMinLiving(); + minOptimal = cropData.getMinOptimal(); + maxOptimal = cropData.getMaxOptimal(); + maxHibernate = cropData.getMaxLiving(); + nonOptimalChance = cropData.getNonOptimalChance(); + + // Otherwise, assign defaults. + } else if (block instanceof IHibernatingCrop && ((IHibernatingCrop) block).shouldHibernate()) { + minHibernate = 5; + minOptimal = 10; + maxOptimal = 15; + maxHibernate = 20; + nonOptimalChance = 0.5f; + } else { + event.setResult(Event.Result.ALLOW); + return; + } + + // Alive but not optimal, slow growth + int targetTemperature = TemperatureHandler.getTargetTemperatureAt(world, pos); + if ((targetTemperature > maxOptimal && targetTemperature <= maxHibernate) + || (targetTemperature < minOptimal && targetTemperature >= minHibernate) + && (Math.random() < nonOptimalChance)) { + event.setResult(Result.DENY); + } else if (targetTemperature < minHibernate || targetTemperature > maxHibernate) { + event.setResult(Result.DENY); + } + } else { + Season season = SeasonHelper.getSeasonData(world).getSubSeason().getSeason(); + if (season == Season.WINTER + && (block instanceof IHibernatingCrop && ((IHibernatingCrop) block).shouldHibernate()) + && !TemperatureHelper.isPosClimatisedForTemp(world, pos, new Temperature(1)) + && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_SEASONS)) { + event.setResult(Event.Result.DENY); + } + } + } + } + + /* + * Detect crop grow events and check for the optimal growth condition. + */ + @SubscribeEvent + public void onCropGrowEvent(BlockEvent.CropGrowEvent event) { + if (!event.getWorld().isRemote) { + // This type of growth only applies when temperature decay is + // enabled. + Block block = event.getState().getBlock(); + World world = event.getWorld(); + BlockPos pos = event.getPos(); + String blockName = block.getRegistryName().toString(); + boolean temperatureWithering = SyncedConfig.getBooleanValue(GameplayOption.TEMPERATURE_WITHERING); + if (temperatureWithering) { + int minLiving = 0; + int minOptimal = 0; + int maxOptimal = 0; + int maxLiving = 0; + float nonOptimalChance = 0; + + // Assign crop life details from config file. + if (GameplayConfigurationHandler.EXTERNAL_DECAYING_CROPS.containsKey(blockName)) { + CropGrowConfigEntry cropData = GameplayConfigurationHandler.EXTERNAL_DECAYING_CROPS.get(blockName); + minLiving = cropData.getMinLiving(); + minOptimal = cropData.getMinOptimal(); + maxOptimal = cropData.getMaxOptimal(); + maxLiving = cropData.getMaxLiving(); + nonOptimalChance = cropData.getNonOptimalChance(); + + // Otherwise, assign defaults. + } else if (block instanceof IDecayableCrop && ((IDecayableCrop) block).shouldDecay()) { + minLiving = 5; + minOptimal = 10; + maxOptimal = 15; + maxLiving = 20; + nonOptimalChance = 0.5f; + } else { + event.setResult(Event.Result.ALLOW); + return; + } + + // Alive but not optimal, slow growth + int targetTemperature = TemperatureHandler.getTargetTemperatureAt(world, pos); + if ((targetTemperature > maxOptimal && targetTemperature <= maxLiving) + || (targetTemperature < minOptimal && targetTemperature >= minLiving) + && (Math.random() < nonOptimalChance)) { + event.setResult(Result.DENY); + } + } + } + } + + // + // Used to implement getSeasonData in the API + // + public static ISeasonData getServerSeasonData(World world) { + SeasonSavedData savedData = getSeasonSavedData(world); + return new SeasonTime(savedData.seasonCycleTicks); + } + + public static ISeasonData getClientSeasonData() { + return new SeasonTime(clientSeasonCycleTicks); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/season/SeasonSleepHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/season/SeasonSleepHandler.java new file mode 100644 index 00000000..def392cf --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/season/SeasonSleepHandler.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.handler.season; + +import net.minecraft.world.WorldServer; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; +import net.minecraftforge.fml.relauncher.Side; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.config.GameplayOption; +import toughasnails.season.SeasonSavedData; + +public class SeasonSleepHandler { + @SubscribeEvent + public void onWorldTick(TickEvent.WorldTickEvent event) { + if (event.phase == Phase.START && event.side == Side.SERVER + && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_SEASONS)) { + WorldServer world = (WorldServer) event.world; + + // Called before all players are awoken for the next day + if (world.areAllPlayersAsleep()) { + SeasonSavedData seasonData = SeasonHandler.getSeasonSavedData(world); + long timeDiff = 24000L - ((world.getWorldInfo().getWorldTime() + 24000L) % 24000L); + seasonData.seasonCycleTicks += timeDiff; + seasonData.markDirty(); + SeasonHandler.sendSeasonUpdate(world); + } + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/season/StopSpawnHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/season/StopSpawnHandler.java new file mode 100644 index 00000000..1fd30694 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/season/StopSpawnHandler.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.handler.season; + +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingSpawnEvent; +import net.minecraftforge.event.terraingen.PopulateChunkEvent; +import net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType; +import net.minecraftforge.fml.common.eventhandler.Event.Result; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.season.Season; +import toughasnails.api.season.SeasonHelper; +import toughasnails.api.config.GameplayOption; + +public class StopSpawnHandler +{ + //Animals shouldn't spawn during winter + @SubscribeEvent + public void onCheckEntitySpawn(LivingSpawnEvent.CheckSpawn event) + { + Season season = SeasonHelper.getSeasonData(event.getWorld()).getSubSeason().getSeason(); + + if (season == Season.WINTER && event.getEntity() instanceof EntityAnimal && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_SEASONS)) + { + event.setResult(Result.DENY); + } + } + + @SubscribeEvent + public void onChunkPopulate(PopulateChunkEvent.Populate event) + { + World world = event.getWorld(); + Season season = SeasonHelper.getSeasonData(world).getSubSeason().getSeason(); + + //Prevent animals from spawning in new chunks during the winter + if (event.getType() == EventType.ANIMALS && season == Season.WINTER && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_SEASONS)) + { + event.setResult(Result.DENY); + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/season/WeatherFrequencyHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/season/WeatherFrequencyHandler.java new file mode 100644 index 00000000..1c7c4fdc --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/season/WeatherFrequencyHandler.java @@ -0,0 +1,61 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.handler.season; + +import net.minecraft.world.World; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; +import net.minecraftforge.fml.common.gameevent.TickEvent.WorldTickEvent; +import net.minecraftforge.fml.relauncher.Side; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.season.Season; +import toughasnails.api.season.SeasonHelper; +import toughasnails.api.config.GameplayOption; + +public class WeatherFrequencyHandler +{ + @SubscribeEvent + public void onWorldTick(WorldTickEvent event) + { + if (event.phase == Phase.END && event.side == Side.SERVER && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_SEASONS)) + { + World world = event.world; + Season season = SeasonHelper.getSeasonData(world).getSubSeason().getSeason(); + + //During winter, the absolute maximum delay between rain/thunder should be 30 mins, unlike + //the standard 160 minutes. We only wish to modify the time between rain/thunder occurring, not + //their duration. + + if (season == Season.SPRING) + { + if (!world.getWorldInfo().isRaining() && world.getWorldInfo().getRainTime() > 96000) + { + world.getWorldInfo().setRainTime(world.rand.nextInt(84000) + 12000); + } + } + else if (season == Season.SUMMER) + { + if (!world.getWorldInfo().isThundering() && world.getWorldInfo().getThunderTime() > 36000) + { + world.getWorldInfo().setThunderTime(world.rand.nextInt(24000) + 12000); + } + } + else if (season == Season.WINTER) + { + if (world.getWorldInfo().isThundering()) + { + world.getWorldInfo().setThundering(false);; + } + if (!world.getWorldInfo().isRaining() && world.getWorldInfo().getRainTime() > 36000) + { + world.getWorldInfo().setRainTime(world.rand.nextInt(24000) + 12000); + } + } + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/temperature/TemperatureDebugOverlayHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/temperature/TemperatureDebugOverlayHandler.java new file mode 100644 index 00000000..be88d815 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/temperature/TemperatureDebugOverlayHandler.java @@ -0,0 +1,137 @@ +package toughasnails.handler.temperature; + +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.client.event.RenderGameOverlayEvent; +import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.TANCapabilities; +import toughasnails.api.temperature.Temperature; +import toughasnails.api.temperature.TemperatureScale; +import toughasnails.temperature.TemperatureDebugger; +import toughasnails.temperature.TemperatureDebugger.Modifier; +import toughasnails.temperature.TemperatureHandler; + +public class TemperatureDebugOverlayHandler { + + @SubscribeEvent + public void onPostRenderOverlay(RenderGameOverlayEvent.Post event) { + ScaledResolution resolution = event.getResolution(); + int width = resolution.getScaledWidth(); + int height = resolution.getScaledHeight(); + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + + TemperatureHandler temperatureStats = (TemperatureHandler) player.getCapability(TANCapabilities.TEMPERATURE, + null); + TemperatureDebugger debugger = temperatureStats.debugger; + + if (event.getType() == ElementType.ALL && debugger.isGuiVisible()) { + drawModifierTable(width, height, temperatureStats.getTemperature(), debugger); + } + } + + private void drawModifierTable(int width, int height, Temperature temperature, TemperatureDebugger debugger) { + Map rateModifiers = debugger.modifiers[0]; + Map targetModifiers = debugger.modifiers[1]; + + if (targetModifiers != null && rateModifiers != null) { + // FontRenderer fontRenderer = Minecraft + // .getMinecraft().fontRendererObj; + + int targetTableHeight = getTableHeight(targetModifiers); + int totalTableHeight = targetTableHeight + getTableHeight(rateModifiers) + 2; + int startY = height / 2 - totalTableHeight / 2; + + String targetProgress = "" + TextFormatting.RED + temperature.getRawValue() + "/" + + debugger.targetTemperature + getCappedText(debugger.targetTemperature); + String rateProgress = "" + TextFormatting.RED + debugger.temperatureTimer + "/" + debugger.changeTicks; + + drawTable("Target " + targetProgress, 1, startY, targetModifiers); + drawTable("Rate " + rateProgress, 1, startY + targetTableHeight + 2, rateModifiers); + } + } + + @SideOnly(Side.CLIENT) + private static void drawTable(String title, int x, int y, Map contents) { + FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj; + + int lineWidth = getLineWidth(title, contents); + int textStart = x + 2; + int textEnd = textStart + lineWidth; + + Iterator> contentsIterator = contents.entrySet().iterator(); + + for (int i = 0; i < contents.size() + 1; i++) { + int rowTopY = y + i * fontRenderer.FONT_HEIGHT + 1; + int rowBottomY = rowTopY + fontRenderer.FONT_HEIGHT; + + if (i == 0) { + Gui.drawRect(x, rowBottomY - 1, textEnd, y, 1610612736); + Gui.drawRect(x, rowBottomY, textEnd, rowBottomY - 1, 1342177280); + fontRenderer.drawString(title, textStart + lineWidth / 2 - fontRenderer.getStringWidth(title) / 2, + y + 1, 553648127); + } else { + Entry entry = contentsIterator.next(); + String string = entry.getKey().name; + int value = entry.getValue(); + String formattedValue = getFormattedInt(value); + + Gui.drawRect(x, rowBottomY, textEnd, rowTopY, 1342177280); + fontRenderer.drawString(string, textStart, rowTopY, 553648127); + fontRenderer.drawString(formattedValue, textEnd - fontRenderer.getStringWidth(formattedValue), rowTopY, + 553648127); + } + } + } + + @SideOnly(Side.CLIENT) + private static int getTableHeight(Map contents) { + FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj; + + return (contents.size() + 1) * fontRenderer.FONT_HEIGHT + 1; + } + + @SideOnly(Side.CLIENT) + private static int getLineWidth(String title, Map elements) { + FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj; + int lineWidth = 0; + + for (Entry entry : elements.entrySet()) { + int i = entry.getValue(); + String string = entry.getKey().name + ": " + getFormattedInt(i); + + lineWidth = Math.max(fontRenderer.getStringWidth(string), lineWidth); + } + + lineWidth = Math.max(fontRenderer.getStringWidth(title), lineWidth); + + return lineWidth; + } + + private static String getCappedText(int targetTemperature) { + return TextFormatting.BLUE + " " + + (targetTemperature < 0 ? "(0)" + : targetTemperature > TemperatureScale.getScaleTotal() + ? "(" + TemperatureScale.getScaleTotal() + ")" : ""); + } + + private static String getFormattedInt(int i) { + TextFormatting format = i > 0 ? TextFormatting.RED : i < 0 ? TextFormatting.BLUE : TextFormatting.RESET; + + return "" + format + getNumberSign(i) + i; + } + + private static char getNumberSign(int i) { + return i > 0 ? '+' : ' '; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/temperature/TemperatureOverlayHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/temperature/TemperatureOverlayHandler.java new file mode 100644 index 00000000..77781fb4 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/temperature/TemperatureOverlayHandler.java @@ -0,0 +1,252 @@ +package toughasnails.handler.temperature; + +import static toughasnails.util.RenderUtils.drawTexturedModalRect; + +import java.util.Random; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.VertexBuffer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.event.RenderGameOverlayEvent; +import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.TANCapabilities; +import toughasnails.api.config.GameplayOption; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.temperature.Temperature; +import toughasnails.api.temperature.TemperatureScale; +import toughasnails.api.temperature.TemperatureScale.TemperatureRange; +import toughasnails.temperature.TemperatureHandler; + +@SideOnly(Side.CLIENT) +public class TemperatureOverlayHandler { + public static final ResourceLocation OVERLAY = new ResourceLocation("toughasnails:textures/gui/overlay.png"); + public static final ResourceLocation ICE_VIGNETTE = new ResourceLocation( + "toughasnails:textures/gui/ice_vignette.png"); + public static final ResourceLocation FIRE_VIGNETTE = new ResourceLocation( + "toughasnails:textures/gui/fire_vignette.png"); + + private final Random random = new Random(); + private final Minecraft minecraft = Minecraft.getMinecraft(); + + private int updateCounter; + private FlashType flashType = FlashType.INCREASE; + private int flashCounter = -1; + private int prevTemperatureLevel = -1; + + @SubscribeEvent + public void onClientTick(TickEvent.ClientTickEvent event) { + if (event.phase == Phase.END && !minecraft.isGamePaused()) { + updateCounter++; + } + } + + @SubscribeEvent + public void onPostRenderOverlay(RenderGameOverlayEvent.Post event) { + ScaledResolution resolution = event.getResolution(); + int width = resolution.getScaledWidth(); + int height = resolution.getScaledHeight(); + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + + TemperatureHandler temperatureStats = (TemperatureHandler) player.getCapability(TANCapabilities.TEMPERATURE, + null); + Temperature temperature = temperatureStats.getTemperature(); + + // When the update counter isn't incrementing, ensure the same numbers + // are produced (freezes moving gui elements) + random.setSeed((long) (updateCounter * 312871)); + + if (event.getType() == ElementType.PORTAL && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_TEMPERATURE)) { + if (!player.capabilities.isCreativeMode) + drawTemperatureVignettes(width, height, temperature); + } else if (event.getType() == ElementType.EXPERIENCE + && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_TEMPERATURE)) { + minecraft.getTextureManager().bindTexture(OVERLAY); + + if (minecraft.playerController.gameIsSurvivalOrAdventure()) { + drawTemperature(width, height, temperature); + } + } + } + + private void drawTemperature(int width, int height, Temperature temperature) { + int left = width / 2 - 8; + int top = height - 52; + + TemperatureRange temperatureRange = temperature.getRange(); + + if (temperatureRange == TemperatureRange.ICY || temperatureRange == TemperatureRange.HOT) { + float shakeDelta = temperatureRange == TemperatureRange.ICY ? temperature.getRangeDelta(true) + : temperature.getRangeDelta(false); + + if ((updateCounter % 1) == 0) { + top += (int) ((random.nextInt(3) - 1) * Math.min(shakeDelta * 3F, 1.0)); + left += (int) ((random.nextInt(3) - 1) * Math.min(shakeDelta * 1.5F, 1.0)); + } + } + + int temperatureLevel = temperature.getRawValue(); + + if (prevTemperatureLevel == -1) + prevTemperatureLevel = temperatureLevel; + + if (temperatureLevel > prevTemperatureLevel) { + flashCounter = updateCounter + 16; + flashType = FlashType.INCREASE; + } else if (temperatureLevel < prevTemperatureLevel) { + flashCounter = updateCounter + 16; + flashType = FlashType.DECREASE; + } + + prevTemperatureLevel = temperatureLevel; + + TemperatureIcon temperatureIcon = getTemperatureIcon(temperatureLevel); + int updateDelta = flashCounter - updateCounter; + + drawTexturedModalRect(left, top, 16 * (temperatureIcon.backgroundIndex), 0, 16, 16); + drawTexturedModalRect(left, top, 16 * (temperatureIcon.foregroundIndex), 0, 16, 16); + + if (temperatureIcon == TemperatureIcon.BALL) { + renderColouredBall(left, top, temperature, 0); + } + + if (flashCounter > (long) updateCounter) { + if (updateDelta > 6 && updateDelta / 3L % 2L == 1L) { + drawTexturedModalRect(left, top, 16 * (temperatureIcon.backgroundIndex + flashType.backgroundShift), 0, + 16, 16); + drawTexturedModalRect(left, top, 16 * (temperatureIcon.foregroundIndex + flashType.foregroundShift), 0, + 16, 16); + + if (temperatureIcon == TemperatureIcon.BALL) { + renderColouredBall(left, top, temperature, 2); + } + } + + GlStateManager.pushMatrix(); + + if (flashType == FlashType.INCREASE) { + GL11.glTranslatef(left + 16F, top + 16F, 0F); + GL11.glRotatef(180F, 0F, 0F, 1F); + } else { + GL11.glTranslatef(left, top, 0F); + } + + drawTexturedModalRect(0, 0, 16 * (16 - updateDelta), 16 * 15, 16, 16); + GlStateManager.popMatrix(); + } + } + + private void renderColouredBall(int x, int y, Temperature temperature, int textureShift) { + TemperatureRange temperatureRange = temperature.getRange(); + float changeDelta = temperatureRange == TemperatureRange.COOL ? temperature.getRangeDelta(true) + : temperature.getRangeDelta(false); + + if (temperatureRange != TemperatureRange.MILD) { + GlStateManager.pushMatrix(); + GlStateManager.color(1.0F, 1.0F, 1.0F, changeDelta); + drawTexturedModalRect(x, y, 16 * ((temperatureRange == TemperatureRange.COOL ? 8 : 9) + textureShift), + 16 * 1, 16, 16); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.popMatrix(); + } + } + + private void drawTemperatureVignettes(int width, int height, Temperature temperature) { + TemperatureRange temperatureRange = temperature.getRange(); + float opacityDelta = temperature.getRangeDelta(false); + + ResourceLocation vignetteLocation = null; + + if (temperatureRange == TemperatureRange.ICY) { + opacityDelta = 1.0F - temperature.getRangeDelta(true); + vignetteLocation = ICE_VIGNETTE; + } else if (temperatureRange == TemperatureRange.HOT) { + vignetteLocation = FIRE_VIGNETTE; + } + + if (vignetteLocation != null) { + minecraft.getTextureManager().bindTexture(vignetteLocation); + + GlStateManager.disableDepth(); + GlStateManager.depthMask(false); + GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + GlStateManager.color(1.0F, 1.0F, 1.0F, opacityDelta); + GlStateManager.disableAlpha(); + Tessellator tessellator = Tessellator.getInstance(); + VertexBuffer renderer = tessellator.getBuffer(); + renderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + renderer.pos(0.0D, height, -90.0D).tex(0.0D, 1.0D).endVertex(); + renderer.pos(width, height, -90.0D).tex(1.0D, 1.0D).endVertex(); + renderer.pos(width, 0.0D, -90.0D).tex(1.0D, 0.0D).endVertex(); + renderer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).endVertex(); + tessellator.draw(); + GlStateManager.depthMask(true); + GlStateManager.enableDepth(); + GlStateManager.enableAlpha(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + } + } + + private static TemperatureIcon getTemperatureIcon(int scalePos) { + if (scalePos < 0 || scalePos > TemperatureScale.getScaleTotal()) { + return null; + } + + TemperatureIcon temperatureIcon = null; + + for (int index = 0; index < TemperatureIcon.values().length; index++) { + temperatureIcon = TemperatureIcon.values()[index]; + + if (TemperatureScale.isScalePosInRange(scalePos, temperatureIcon.startRange, temperatureIcon.endRange)) { + break; + } + } + + return temperatureIcon; + } + + private static enum TemperatureIcon { + SNOWFLAKE(0, 9, TemperatureRange.ICY), BALL(1, 10, TemperatureRange.COOL, TemperatureRange.WARM), FIRE(2, 11, + TemperatureRange.HOT); + + public final int backgroundIndex; + public final int foregroundIndex; + public final TemperatureRange startRange; + public final TemperatureRange endRange; + + private TemperatureIcon(int backgroundIndex, int foregroundIndex, TemperatureRange startRange, + TemperatureRange endRange) { + this.backgroundIndex = backgroundIndex; + this.foregroundIndex = foregroundIndex; + this.startRange = startRange; + this.endRange = endRange; + } + + private TemperatureIcon(int backgroundIndex, int foregroundIndex, TemperatureRange range) { + this(backgroundIndex, foregroundIndex, range, range); + } + } + + private static enum FlashType { + INCREASE(3, 3), DECREASE(3, 3); + + public final int backgroundShift; + public final int foregroundShift; + + private FlashType(int backgroundShift, int foregroundShift) { + this.backgroundShift = backgroundShift; + this.foregroundShift = foregroundShift; + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/thirst/FillBottleHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/thirst/FillBottleHandler.java new file mode 100644 index 00000000..e8a65107 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/thirst/FillBottleHandler.java @@ -0,0 +1,118 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.handler.thirst; + +import net.minecraft.block.BlockCauldron; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import toughasnails.api.config.GameplayOption; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.item.TANItems; + +public class FillBottleHandler { + /** + * Substitutes normal filled water bottles for dirty water bottles + */ + @SubscribeEvent + public void onPlayerRightClickWater( + PlayerInteractEvent.RightClickItem event) throws Exception { + EntityPlayer player = event.getEntityPlayer(); + ItemStack stack = player.getHeldItem(event.getHand()); + + if (stack != null && stack.getItem().equals(Items.GLASS_BOTTLE) + && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_THIRST)) { + + ActionResult actionResult = stack.getItem() + .onItemRightClick(new ItemStack(stack.getItem(), 0), + event.getWorld(), player, event.getHand()); + ItemStack resultStack = ((ItemStack) actionResult.getResult()); + + // NOTES FROM 1.9.4 testing. ResultStack is item.potion only when + // used on water. Dragon's breath is different. + // Don't compare tags directly, the water bottle in resultStack + // doesn't have Potion tag. + if (actionResult.getType().equals(EnumActionResult.SUCCESS) + && resultStack != null && ItemStack.areItemsEqual( + resultStack, new ItemStack(Items.POTIONITEM))) { + + --stack.stackSize; // Restore original amount of bottles + player.addStat(StatList.getObjectUseStats(stack.getItem())); + ItemStack bottleStack = new ItemStack(TANItems.water_bottle); + + if (!player.inventory.addItemStackToInventory(bottleStack)) { + player.dropItem(bottleStack, false); + } + event.setCanceled(true); + + // Prevent onItemRightClick from being fired a second time for + // bottles right clicked on water + + } + + } + } + + /** + * Produce dirty water bottles when filling empty bottles from the cauldron + */ + @SubscribeEvent + public void onRightClickCauldron( + PlayerInteractEvent.RightClickBlock event) { + World world = event.getWorld(); + EntityPlayer player = event.getEntityPlayer(); + IBlockState state = world.getBlockState(event.getPos()); + ItemStack heldStack = player.getHeldItem(event.getHand()); + Item heldItem; + if (heldStack == null || state == null + || (heldItem = heldStack.getItem()) == null) { + return; + } + + if (state.getBlock() instanceof BlockCauldron + && heldItem == Items.GLASS_BOTTLE + && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_THIRST)) { + BlockCauldron cauldron = (BlockCauldron) state.getBlock(); + int level = ((Integer) state.getValue(BlockCauldron.LEVEL)); + + // Only fill when the cauldron has water in it + if (level > 0 && !world.isRemote) { + if (!player.capabilities.isCreativeMode) { + ItemStack waterBottle = new ItemStack( + TANItems.water_bottle); + player.addStat(StatList.CAULDRON_USED); + + if (--player.getHeldItem(event.getHand()).stackSize == 0) + + { + player.setHeldItem(event.getHand(), waterBottle); + } else if (!player.inventory + .addItemStackToInventory(waterBottle)) { + player.dropItem(waterBottle, false); + } else if (player instanceof EntityPlayerMP) { + ((EntityPlayerMP) player).sendContainerToPlayer( + player.inventoryContainer); + } + } + + cauldron.setWaterLevel(world, event.getPos(), state, level - 1); + // Prevent from producing a Vanilla water bottle + event.setCanceled(true); + } + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/thirst/ThirstOverlayHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/thirst/ThirstOverlayHandler.java new file mode 100644 index 00000000..9924c437 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/thirst/ThirstOverlayHandler.java @@ -0,0 +1,103 @@ +package toughasnails.handler.thirst; + +import static toughasnails.util.RenderUtils.drawTexturedModalRect; + +import java.util.Random; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.event.RenderGameOverlayEvent; +import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; +import toughasnails.api.TANCapabilities; +import toughasnails.api.TANPotions; +import toughasnails.api.config.GameplayOption; +import toughasnails.api.config.SyncedConfig; +import toughasnails.thirst.ThirstHandler; + +public class ThirstOverlayHandler { + public static final ResourceLocation OVERLAY = new ResourceLocation("toughasnails:textures/gui/overlay.png"); + + private final Random random = new Random(); + private final Minecraft minecraft = Minecraft.getMinecraft(); + + private int updateCounter; + + @SubscribeEvent + public void onClientTick(TickEvent.ClientTickEvent event) { + if (event.phase == Phase.END && !minecraft.isGamePaused()) { + updateCounter++; + } + } + + @SubscribeEvent + public void onPreRenderOverlay(RenderGameOverlayEvent.Pre event) { + if (event.getType() == ElementType.AIR && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_THIRST)) { + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, -10.0F, 0.0F); + } + } + + @SubscribeEvent + public void onPostRenderOverlay(RenderGameOverlayEvent.Post event) { + ScaledResolution resolution = event.getResolution(); + int width = resolution.getScaledWidth(); + int height = resolution.getScaledHeight(); + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + + ThirstHandler thirstStats = (ThirstHandler) player.getCapability(TANCapabilities.THIRST, null); + int thirstLevel = thirstStats.getThirst(); + float thirstHydrationLevel = thirstStats.getHydration(); + + // When the update counter isn't incrementing, ensure the same numbers + // are produced (freezes moving gui elements) + random.setSeed((long) (updateCounter * 312871)); + + if (event.getType() == ElementType.AIR && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_THIRST)) { + GlStateManager.popMatrix(); + } else if (event.getType() == ElementType.EXPERIENCE + && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_THIRST)) { + minecraft.getTextureManager().bindTexture(OVERLAY); + + if (minecraft.playerController.gameIsSurvivalOrAdventure()) { + drawThirst(width, height, thirstLevel, thirstHydrationLevel); + } + } + } + + private void drawThirst(int width, int height, int thirstLevel, float thirstHydrationLevel) { + int left = width / 2 + 91; + int top = height - 49; + + for (int i = 0; i < 10; i++) { + int dropletHalf = i * 2 + 1; + int iconIndex = 0; + int backgroundOffset = 0; + int startX = left - i * 8 - 9; + int startY = top; + + if (minecraft.thePlayer.isPotionActive(TANPotions.thirst)) { + iconIndex += 4; + backgroundOffset += 117; + } + + if (thirstHydrationLevel <= 0.0F && updateCounter % (thirstLevel * 3 + 1) == 0) { + startY = top + (random.nextInt(3) - 1); + } + + drawTexturedModalRect(startX, startY, backgroundOffset, 16, 9, 9); + + if (thirstLevel > dropletHalf) { + drawTexturedModalRect(startX, startY, (iconIndex + 4) * 9, 16, 9, 9); + } + if (thirstLevel == dropletHalf) { + drawTexturedModalRect(startX, startY, (iconIndex + 5) * 9, 16, 9, 9); + } + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/thirst/ThirstStatHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/thirst/ThirstStatHandler.java new file mode 100644 index 00000000..1505f8bc --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/thirst/ThirstStatHandler.java @@ -0,0 +1,128 @@ +package toughasnails.handler.thirst; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.AttackEntityEvent; +import net.minecraftforge.event.world.BlockEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import toughasnails.api.TANCapabilities; +import toughasnails.thirst.ThirstHandler; + +public class ThirstStatHandler { + @SubscribeEvent + public void onPlayerJump(LivingJumpEvent event) { + World world = event.getEntity().getEntityWorld(); + + if (!world.isRemote) { + if (event.getEntity() instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) event.getEntity(); + ThirstHandler thirstStats = (ThirstHandler) player + .getCapability(TANCapabilities.THIRST, null); + + if (player.isSprinting()) { + thirstStats.addExhaustion(0.8F); + } else { + thirstStats.addExhaustion(0.2F); + } + } + } + } + + @SubscribeEvent + public void onPlayerHurt(LivingHurtEvent event) { + World world = event.getEntity().getEntityWorld(); + + if (!world.isRemote && event.getAmount() != 0.0F) { + if (event.getEntity() instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) event.getEntity(); + ThirstHandler thirstStats = (ThirstHandler) player + .getCapability(TANCapabilities.THIRST, null); + + // Uses hunger values for now, may change in the future + thirstStats.addExhaustion(event.getSource().getHungerDamage()); + } + } + } + + @SubscribeEvent + public void onPlayerAttackEntity(AttackEntityEvent event) { + World world = event.getEntity().getEntityWorld(); + Entity target = event.getTarget(); + + if (!world.isRemote) { + EntityPlayer player = event.getEntityPlayer(); + + if (target.canBeAttackedWithItem()) { + if (!target.hitByEntity(player)) { + float attackDamage = (float) player + .getEntityAttribute( + SharedMonsterAttributes.ATTACK_DAMAGE) + .getAttributeValue(); + float weaponAttackDamage = 0.0F; + + if (target instanceof EntityLivingBase) { + weaponAttackDamage = EnchantmentHelper + .getModifierForCreature( + player.getHeldItem(EnumHand.MAIN_HAND), + ((EntityLivingBase) target) + .getCreatureAttribute()); + } else { + weaponAttackDamage = EnchantmentHelper + .getModifierForCreature( + player.getHeldItem(EnumHand.MAIN_HAND), + EnumCreatureAttribute.UNDEFINED); + } + + if (attackDamage > 0.0F || weaponAttackDamage > 0.0F) { + boolean canAttack = target.attackEntityFrom( + DamageSource.causePlayerDamage(player), 0.0F); + + if (canAttack) { + // The only part of this method that is new - the + // rest is recreating the surrounding circumstances + // in attackTargetEntityWithCurrentItem + ThirstHandler thirstStats = (ThirstHandler) player + .getCapability(TANCapabilities.THIRST, + null); + + thirstStats.addExhaustion(0.3F); + } + } + } + } + } + } + + @SubscribeEvent + public void onBlockBreak(BlockEvent.BreakEvent event) { + World world = event.getWorld(); + EntityPlayer player = event.getPlayer(); + BlockPos pos = event.getPos(); + IBlockState state = event.getState(); + + if (!world.isRemote && !player.capabilities.isCreativeMode) { + boolean canHarvestBlock = state.getBlock().canHarvestBlock(world, + pos, player); + + if (canHarvestBlock) { + // The only part of this method that is new - the rest is + // recreating the surrounding circumstances in func_180237_b + ThirstHandler thirstStats = (ThirstHandler) player + .getCapability(TANCapabilities.THIRST, null); + + thirstStats.addExhaustion(0.025F); + } + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/thirst/VanillaDrinkHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/thirst/VanillaDrinkHandler.java new file mode 100644 index 00000000..454b01cd --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/handler/thirst/VanillaDrinkHandler.java @@ -0,0 +1,105 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.handler.thirst; + +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.PotionUtils; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.event.entity.living.LivingEntityUseItemEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.registry.ForgeRegistries; +import toughasnails.api.TANPotions; +import toughasnails.api.config.GameplayOption; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.thirst.ThirstHelper; +import toughasnails.core.ToughAsNails; +import toughasnails.thirst.ThirstHandler; + +public class VanillaDrinkHandler { + + @SubscribeEvent + public void onItemUseFinish(LivingEntityUseItemEvent.Finish event) { + if (event.getEntityLiving() instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) event.getEntityLiving(); + ItemStack stack = player.getHeldItem(player.getActiveHand()); + ThirstHandler thirstHandler = (ThirstHandler) ThirstHelper + .getThirstData(player); + + if (thirstHandler.isThirsty()) { + // For some reason the stack size can be zero for water bottles, + // which breaks everything. As a workaround, we temporarily set + // it to 1 + boolean zeroStack = false; + if (stack.stackSize <= 0) { + stack.stackSize = 1; + zeroStack = true; + } + if (stack.getItem().equals(Items.POTIONITEM)) { + if (PotionUtils.getFullEffectsFromItem(stack).isEmpty()) { + thirstHandler.addStats(7, 0.5F); + } else { + // Still fill thirst for other potions, but less than + // water + thirstHandler.addStats(4, 0.3F); + } + } + if (zeroStack) { + stack.stackSize = 0; + } + + // Check for any additional configured drinks. + ResourceLocation resLoc = ForgeRegistries.ITEMS + .getKey(stack.getItem()); + String itemName = resLoc.toString(); + + List drinks = SyncedConfig + .getListValue(GameplayOption.DRINKS); + + for (String drinkEntry : drinks) { + String[] drinkData = drinkEntry.split(";"); + if (drinkData.length == 5) { + String stackDamageString = "" + stack.getItemDamage(); + String drinkDamage = drinkData[1]; + boolean isProperDamage = (drinkDamage.equals("*") + || drinkDamage.equals(stackDamageString)); + if (itemName.equals(drinkData[0]) && isProperDamage) { + int thirstLevel = 0; + float hydration = 0f; + float poisonChance = 0f; + try { + thirstLevel = Integer.parseInt(drinkData[2]); + hydration = Float.parseFloat(drinkData[3]); + poisonChance = Float.parseFloat(drinkData[4]); + thirstHandler.addStats(thirstLevel, hydration); + + // Roll for poison + if (player.getEntityWorld().rand + .nextFloat() < poisonChance + && SyncedConfig.getBooleanValue( + GameplayOption.ENABLE_THIRST)) { + player.addPotionEffect(new PotionEffect( + TANPotions.thirst, 600)); + } + } catch (NumberFormatException e) { + ToughAsNails.logger + .error("Tried to drink misconfigured " + + itemName); + } + break; + } + } + } + } + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModAchievements.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModAchievements.java new file mode 100644 index 00000000..c0263ad2 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModAchievements.java @@ -0,0 +1,63 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.init; + +import static toughasnails.api.achievement.TANAchievements.campfire_song; +import static toughasnails.api.achievement.TANAchievements.hot_or_cold; +import static toughasnails.api.achievement.TANAchievements.into_ice; +import static toughasnails.api.achievement.TANAchievements.life_or_death; +import static toughasnails.api.achievement.TANAchievements.that_time_of_year; +import static toughasnails.api.achievement.TANAchievements.thirst_ender; +import static toughasnails.api.achievement.TANAchievements.thirst_quencher; +import static toughasnails.api.achievement.TANAchievements.year_one; + +import net.minecraft.item.ItemStack; +import net.minecraft.stats.Achievement; +import net.minecraftforge.common.AchievementPage; +import toughasnails.api.TANBlocks; +import toughasnails.api.item.TANItems; + +public class ModAchievements { + public static final AchievementPage achievementPage = new AchievementPage("Tough As Nails"); + + public static void init() { + AchievementPage.registerAchievementPage(achievementPage); + + addAchievements(); + } + + private static void addAchievements() { + thirst_quencher = addAchievement("achievement.thirst_quencher", "thirst_quencher", 0, 0, + new ItemStack(TANItems.canteen), null); + thirst_ender = addAchievement("achievement.thirst_ender", "thirst_ender", -2, -2, + new ItemStack(TANItems.fruit_juice), thirst_quencher); + + campfire_song = addAchievement("achievement.campfire_song", "campfire_song", -1, 2, + new ItemStack(TANBlocks.campfire), thirst_quencher); + life_or_death = addAchievement("achievement.life_or_death", "life_or_death", 1, 3, + new ItemStack(TANItems.lifeblood_crystal), campfire_song); + + into_ice = addAchievement("achievement.into_ice", "into_ice", -3, 1, new ItemStack(TANItems.freeze_rod), + campfire_song); + hot_or_cold = addAchievement("achievement.hot_or_cold", "hot_or_cold", -4, -1, + new ItemStack(TANItems.thermometer), into_ice); + + that_time_of_year = addAchievement("achievement.that_time_of_year", "that_time_of_year", 3, -1, + new ItemStack(TANItems.season_clock), thirst_quencher); + year_one = addAchievement("achievement.year_one", "year_one", 0, -4, new ItemStack(TANItems.tan_icon), + that_time_of_year).setSpecial(); + } + + private static Achievement addAchievement(String unlocalizedName, String identifier, int column, int row, + ItemStack iconStack, Achievement parent) { + Achievement achievement = new Achievement(unlocalizedName, identifier, column, row, iconStack, parent); + achievement.registerStat(); + achievementPage.getAchievements().add(achievement); + return achievement; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModBlocks.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModBlocks.java new file mode 100644 index 00000000..09f942ad --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModBlocks.java @@ -0,0 +1,135 @@ +package toughasnails.init; + +import static toughasnails.api.TANBlocks.campfire; +import static toughasnails.api.TANBlocks.dead_crops; +import static toughasnails.api.TANBlocks.glowstone_torch; +import static toughasnails.api.TANBlocks.rain_collector; +import static toughasnails.api.TANBlocks.season_sensors; +import static toughasnails.api.TANBlocks.temperature_coil; +import static toughasnails.api.TANBlocks.torch_new; + +import com.google.common.collect.ImmutableSet; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.common.registry.GameRegistry; +import toughasnails.api.ITANBlock; +import toughasnails.block.BlockGlowstoneTorch; +import toughasnails.block.BlockRainCollector; +import toughasnails.block.BlockSeasonSensor; +import toughasnails.block.BlockSeasonSensor.DetectorType; +import toughasnails.block.BlockTANCampfire; +import toughasnails.block.BlockTANDeadCrops; +import toughasnails.block.BlockTANTemperatureCoil; +import toughasnails.block.BlockTANTorchNew; +import toughasnails.core.ToughAsNails; +import toughasnails.tileentity.TileEntitySeasonSensor; +import toughasnails.tileentity.TileEntityTemperatureSpread; +import toughasnails.util.BlockStateUtils; +import toughasnails.util.inventory.CreativeTabTAN; + +public class ModBlocks +{ + + public static void init() + { + season_sensors[0] = registerBlock( new BlockSeasonSensor(DetectorType.SPRING), "season_sensor_spring" ); + season_sensors[1] = registerBlock( new BlockSeasonSensor(DetectorType.SUMMER), "season_sensor_summer" ).setCreativeTab(null); + season_sensors[2] = registerBlock( new BlockSeasonSensor(DetectorType.AUTUMN), "season_sensor_autumn" ).setCreativeTab(null); + season_sensors[3] = registerBlock( new BlockSeasonSensor(DetectorType.WINTER), "season_sensor_winter" ).setCreativeTab(null); + campfire = registerBlock( new BlockTANCampfire(), "campfire" ); + rain_collector = registerBlock( new BlockRainCollector(), "rain_collector" ); + //gas = registerBlock( new BlockTANGas(), "gas" ); + //gas.setCreativeTab(null); + temperature_coil = registerBlock(new BlockTANTemperatureCoil(), "temperature_coil"); + torch_new = registerBlock( new BlockTANTorchNew(), "torch_new" ); + glowstone_torch = registerBlock( new BlockGlowstoneTorch(), "glowstone_torch" ); + dead_crops = registerBlock(new BlockTANDeadCrops(), "dead_crops").setCreativeTab(null); + + GameRegistry.registerTileEntity(TileEntityTemperatureSpread.class, "temperature_spread"); + GameRegistry.registerTileEntity(TileEntitySeasonSensor.class, "season_sensor"); + } + + + public static void registerBlockVariant(Block block, String stateName, int stateMeta) + { + Item item = Item.getItemFromBlock(block); + ToughAsNails.proxy.registerItemVariantModel(item, stateName, stateMeta); + } + + public static Block registerBlock(Block block, String blockName) + { + // by default, set the creative tab for all blocks added in TAN to CreativeTabTAN.instance + return registerBlock(block, blockName, CreativeTabTAN.instance); + } + + public static Block registerBlock(Block block, String blockName, CreativeTabs tab) + { + + block.setUnlocalizedName(blockName); + block.setCreativeTab(tab); + + if (block instanceof ITANBlock) + { + // if this block supports the IBOPBlock interface then we can determine the item block class, and sub-blocks automatically + ITANBlock bopBlock = (ITANBlock)block; + registerBlockWithItem(block, blockName, bopBlock.getItemClass()); + + ToughAsNails.proxy.registerNonRenderingProperties(block); + + // check for missing default states + IBlockState defaultState = block.getDefaultState(); + if (defaultState == null) + { + defaultState = block.getBlockState().getBaseState(); + ToughAsNails.logger.error("missing default state for " + block.getUnlocalizedName()); + } + + // get the preset blocks variants + ImmutableSet presets = BlockStateUtils.getBlockPresets(block); + if (presets.isEmpty()) + { + // block has no sub-blocks to register + registerBlockVariant(block, blockName, 0); + } + else + { + // register all the sub-blocks + for (IBlockState state : presets) + { + String stateName = bopBlock.getStateName(state); + int stateMeta = block.getMetaFromState(state); + registerBlockVariant(block, stateName, stateMeta); + } + } + } + else + { + // for vanilla blocks, just register a single variant with meta=0 and assume ItemBlock for the item class + registerBlockWithItem(block, blockName, ItemBlock.class); + registerBlockVariant(block, blockName, 0); + } + + return block; + } + + private static void registerBlockWithItem(Block block, String blockName, Class clazz) + { + try + { + Item itemBlock = clazz != null ? (Item)clazz.getConstructor(Block.class).newInstance(block) : null; + ResourceLocation location = new ResourceLocation(ToughAsNails.MOD_ID, blockName); + + GameRegistry.register(block, location); + if (itemBlock != null) GameRegistry.register(itemBlock, location); + } + catch (Exception e) + { + throw new RuntimeException("An error occurred associating an item block during registration..."); + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModConfig.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModConfig.java new file mode 100644 index 00000000..2dab8bbb --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModConfig.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.init; + +import java.io.File; + +import net.minecraftforge.common.MinecraftForge; +import toughasnails.config.GameplayConfigurationHandler; + +public class ModConfig +{ + public static void init(File configDirectory) + { + GameplayConfigurationHandler.init(new File(configDirectory, "gameplay.cfg")); + MinecraftForge.EVENT_BUS.register(new GameplayConfigurationHandler()); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModCrafting.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModCrafting.java new file mode 100644 index 00000000..c715aa6a --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModCrafting.java @@ -0,0 +1,191 @@ +package toughasnails.init; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.init.PotionTypes; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionType; +import net.minecraft.potion.PotionUtils; +import net.minecraftforge.common.brewing.BrewingRecipeRegistry; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.oredict.ShapedOreRecipe; +import toughasnails.api.TANBlocks; +import toughasnails.api.TANPotions; +import toughasnails.api.item.TANItems; +import toughasnails.block.BlockTANTemperatureCoil; +import toughasnails.item.ItemFruitJuice; +import toughasnails.item.ItemTANWaterBottle; +import toughasnails.util.PotionBrewingRecipe; + +public class ModCrafting +{ + public static void init() + { + addOreRegistration(); + addCraftingRecipies(); + addSmeltingRecipes(); + //removeCraftingRecipes(); + } + + private static void addCraftingRecipies() + { + // Register crafting recipes + + //Brewing + //Base + addBrewingRecipe(PotionTypes.AWKWARD, new ItemStack(Items.FIRE_CHARGE), TANPotions.heat_resistance_type); + addBrewingRecipe(PotionTypes.AWKWARD, new ItemStack(TANItems.ice_charge), TANPotions.cold_resistance_type); + + //Extended + addBrewingRecipe(TANPotions.heat_resistance_type, new ItemStack(Items.REDSTONE), TANPotions.long_heat_resistance_type); + addBrewingRecipe(TANPotions.cold_resistance_type, new ItemStack(Items.REDSTONE), TANPotions.long_cold_resistance_type); + + //Splash and lingering + addPotionTransforms(TANPotions.heat_resistance_type); + addPotionTransforms(TANPotions.cold_resistance_type); + addPotionTransforms(TANPotions.long_heat_resistance_type); + addPotionTransforms(TANPotions.long_cold_resistance_type); + + // Armor + GameRegistry.addShapedRecipe(new ItemStack(TANItems.wool_helmet), new Object [] {"###", "# #", '#', Blocks.WOOL}); + GameRegistry.addShapedRecipe(new ItemStack(TANItems.wool_chestplate), new Object [] {"# #", "###", "###", '#', Blocks.WOOL}); + GameRegistry.addShapedRecipe(new ItemStack(TANItems.wool_leggings), new Object [] {"###", "# #", "# #", '#', Blocks.WOOL}); + GameRegistry.addShapedRecipe(new ItemStack(TANItems.wool_boots), new Object [] {"# #", "# #", '#', Blocks.WOOL}); + GameRegistry.addShapedRecipe(new ItemStack(TANItems.jelled_slime_helmet), new Object [] {"###", "# #", '#', TANItems.jelled_slime}); + GameRegistry.addShapedRecipe(new ItemStack(TANItems.jelled_slime_chestplate), new Object [] {"# #", "###", "###", '#', TANItems.jelled_slime}); + GameRegistry.addShapedRecipe(new ItemStack(TANItems.jelled_slime_leggings), new Object [] {"###", "# #", "# #", '#', TANItems.jelled_slime}); + GameRegistry.addShapedRecipe(new ItemStack(TANItems.jelled_slime_boots), new Object [] {"# #", "# #", '#', TANItems.jelled_slime}); + + // Campfire + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TANBlocks.campfire), new Object [] {" L ", "LLL", "CCC", 'C', Blocks.COBBLESTONE, 'L', "logWood"})); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TANBlocks.campfire), new Object [] {" L ", "LLL", "CCC", 'C', "chunkStone", 'L', "splitWood"})); + + // Rain Collector + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TANBlocks.rain_collector), new Object [] {"IBI", "C C", "CCC", 'C', Blocks.COBBLESTONE, 'I', "ingotIron", 'B', Blocks.IRON_BARS})); + + // Heating Coil + GameRegistry.addShapedRecipe(new ItemStack(TANBlocks.temperature_coil, 1, BlockTANTemperatureCoil.CoilType.HEATING.ordinal()), new Object[] {"BBB", "BBB", "CCC", 'B', Items.BLAZE_ROD, 'C', Blocks.COBBLESTONE}); + + // Cooling Coil + GameRegistry.addShapedRecipe(new ItemStack(TANBlocks.temperature_coil, 1, BlockTANTemperatureCoil.CoilType.COOLING.ordinal()), new Object[] {"FFF", "FFF", "CCC", 'F', TANItems.freeze_rod, 'C', Blocks.COBBLESTONE}); + + // Canteen + GameRegistry.addShapedRecipe(new ItemStack(TANItems.canteen, 1), new Object[] {" L ", "L L", "LLL", 'L', Items.LEATHER}); + + // Filtered Canteen + GameRegistry.addShapelessRecipe(new ItemStack(TANItems.canteen, 1, 2), TANItems.charcoal_filter, new ItemStack(TANItems.canteen, 1, 1)); + + // Filtered Water Bottle + GameRegistry.addShapelessRecipe(new ItemStack(TANItems.water_bottle, 1, ItemTANWaterBottle.WaterBottleType.FILTERED.ordinal()), new Object[] {new ItemStack(TANItems.water_bottle, 1, ItemTANWaterBottle.WaterBottleType.DIRTY.ordinal()), TANItems.charcoal_filter}); + + // Fruit Juices + GameRegistry.addShapelessRecipe(new ItemStack(TANItems.fruit_juice, 1, ItemFruitJuice.JuiceType.APPLE.ordinal()), new Object[] {PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER), Items.SUGAR, Items.APPLE}); + GameRegistry.addShapelessRecipe(new ItemStack(TANItems.fruit_juice, 1, ItemFruitJuice.JuiceType.BEETROOT.ordinal()), new Object[] {PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER), Items.SUGAR, Items.BEETROOT}); + GameRegistry.addShapelessRecipe(new ItemStack(TANItems.fruit_juice, 1, ItemFruitJuice.JuiceType.CACTUS.ordinal()), new Object[] {PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER), Items.SUGAR, Blocks.CACTUS}); + GameRegistry.addShapelessRecipe(new ItemStack(TANItems.fruit_juice, 1, ItemFruitJuice.JuiceType.CARROT.ordinal()), new Object[] {PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER), Items.SUGAR, Items.CARROT}); + GameRegistry.addShapelessRecipe(new ItemStack(TANItems.fruit_juice, 1, ItemFruitJuice.JuiceType.CHORUS_FRUIT.ordinal()), new Object[] {PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER), Items.SUGAR, Items.CHORUS_FRUIT}); + GameRegistry.addShapelessRecipe(new ItemStack(TANItems.fruit_juice, 1, ItemFruitJuice.JuiceType.GLISTERING_MELON.ordinal()), new Object[] {PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER), Items.SUGAR, Items.SPECKLED_MELON}); + GameRegistry.addShapelessRecipe(new ItemStack(TANItems.fruit_juice, 1, ItemFruitJuice.JuiceType.GOLDEN_APPLE.ordinal()), new Object[] {PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER), Items.SUGAR, Items.GOLDEN_APPLE}); + GameRegistry.addShapelessRecipe(new ItemStack(TANItems.fruit_juice, 1, ItemFruitJuice.JuiceType.GOLDEN_CARROT.ordinal()), new Object[] {PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER), Items.SUGAR, Items.GOLDEN_CARROT}); + GameRegistry.addShapelessRecipe(new ItemStack(TANItems.fruit_juice, 1, ItemFruitJuice.JuiceType.MELON.ordinal()), new Object[] {PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER), Items.SUGAR, Items.MELON}); + GameRegistry.addShapelessRecipe(new ItemStack(TANItems.fruit_juice, 1, ItemFruitJuice.JuiceType.PUMPKIN.ordinal()), new Object[] {PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER), Items.SUGAR, Blocks.PUMPKIN}); + + // Freeze Powder + GameRegistry.addShapelessRecipe(new ItemStack(TANItems.freeze_powder, 2), new Object[] {TANItems.freeze_rod}); + + // Ice Charge + GameRegistry.addShapelessRecipe(new ItemStack(TANItems.ice_charge, 3), new Object[] {TANItems.ice_cube, Items.GUNPOWDER, TANItems.freeze_powder}); + + // Jelled Slime + GameRegistry.addShapedRecipe(new ItemStack(TANItems.jelled_slime, 3), new Object[] {"III", "ISI", "III", 'I', TANItems.ice_cube, 'S', Items.SLIME_BALL}); + + //Charcoal Filter + GameRegistry.addShapedRecipe(new ItemStack(TANItems.charcoal_filter, 3), new Object[] {"PPP", "CCC", "PPP", 'P', Items.PAPER, 'C', new ItemStack(Items.COAL, 1, 1)}); + + // Air Filter + //GameRegistry.addShapedRecipe(new ItemStack(TANItems.air_filter, 1), new Object[] {"LLL", "LCL", "LLL", 'L', Items.LEATHER, 'C', TANItems.charcoal_filter}); + + // Season Clock + GameRegistry.addShapedRecipe(new ItemStack(TANItems.season_clock, 1), new Object[] {" Q ", "QRQ", " Q ", 'Q', Items.QUARTZ, 'R', Items.REDSTONE}); + + // Season Sensor + GameRegistry.addShapedRecipe(new ItemStack(TANBlocks.season_sensors[0], 1), new Object[] {"GGG", "QSQ", "CCC", 'G', Blocks.GLASS, 'Q', Items.QUARTZ, 'S', TANItems.season_clock, 'C', new ItemStack(Blocks.STONE_SLAB, 1, 3)}); + + // Thermometer + GameRegistry.addShapedRecipe(new ItemStack(TANItems.thermometer, 1), new Object[] {" D ", "DQD", " D ", 'D', Items.DIAMOND, 'Q', Items.QUARTZ}); + + // Respirator + //GameRegistry.addShapedRecipe(new ItemStack(TANItems.respirator, 1), new Object[] {"SSS", "III", "AIA", 'S', Items.STRING, 'I', Items.IRON_INGOT, 'A', TANItems.air_filter}); + } + + public static void addSmeltingRecipes() + { + // Register smelting recipes + + // Clean Water Bottle + GameRegistry.addSmelting(new ItemStack(TANItems.water_bottle, 1, ItemTANWaterBottle.WaterBottleType.FILTERED.ordinal()), PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER), 0F); + } + + private static void addOreRegistration() + { + //Registration in Ore Dictionary + } + + /*private static void removeCraftingRecipes() + { + List recipes = CraftingManager.getInstance().getRecipeList(); + + Iterator remover = recipes.iterator(); + + while (remover.hasNext()) + { + ItemStack itemstack = remover.next().getRecipeOutput(); + if (itemstack != null && Block.getBlockFromItem(itemstack.getItem()) == Blocks.torch) + { + remover.remove(); + } + } + }*/ + + /** + * Adds a brewing recipe for each bottle to the specified potion type transformation + * @param input Input potion + * @param ingredient Transformation ingredient + * @param output Output potion + */ + private static void addBrewingRecipe(PotionType input, ItemStack ingredient, PotionType output) + { + addBrewingRecipe(new ItemStack(Items.POTIONITEM), input, ingredient, new ItemStack(Items.POTIONITEM), output); + addBrewingRecipe(new ItemStack(Items.SPLASH_POTION), input, ingredient, new ItemStack(Items.SPLASH_POTION), output); + addBrewingRecipe(new ItemStack(Items.LINGERING_POTION), input, ingredient, new ItemStack(Items.LINGERING_POTION), output); + } + + /** + * Adds recipes to transform potions into splash and lingering variants + * @param potion Potion type to add transformations + */ + private static void addPotionTransforms(PotionType potion) + { + // splash + addBrewingRecipe(new ItemStack(Items.POTIONITEM), potion, new ItemStack(Items.GUNPOWDER), new ItemStack(Items.SPLASH_POTION), potion); + addBrewingRecipe(new ItemStack(Items.LINGERING_POTION), potion, new ItemStack(Items.GUNPOWDER), new ItemStack(Items.SPLASH_POTION), potion); + + // lingering + addBrewingRecipe(new ItemStack(Items.POTIONITEM), potion, new ItemStack(Items.DRAGON_BREATH), new ItemStack(Items.LINGERING_POTION), potion); + addBrewingRecipe(new ItemStack(Items.SPLASH_POTION), potion, new ItemStack(Items.DRAGON_BREATH), new ItemStack(Items.LINGERING_POTION), potion); + + } + + /** + * Adds a general brewing recipe. Basically just a wrapper to remove the ugly PotionUtils calls and to use the NBT sensitive PotionBrewingRecipe + * @param inBottle Input bottle + * @param input Input potion + * @param ingredient Input ingredient + * @param outBottle Output bottle + * @param output Output potion + */ + private static void addBrewingRecipe(ItemStack inBottle, PotionType input, ItemStack ingredient, ItemStack outBottle, PotionType output) + { + BrewingRecipeRegistry.addRecipe(new PotionBrewingRecipe(PotionUtils.addPotionToItemStack(inBottle, input), ingredient, PotionUtils.addPotionToItemStack(outBottle, output))); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModEntities.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModEntities.java new file mode 100644 index 00000000..f80151d2 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModEntities.java @@ -0,0 +1,86 @@ +package toughasnails.init; + +import java.util.Map; + +import com.google.common.collect.Maps; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityList.EntityEggInfo; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Biomes; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.common.ModContainer; +import net.minecraftforge.fml.common.registry.EntityRegistry; +import net.minecraftforge.fml.common.registry.EntityRegistry.EntityRegistration; +import toughasnails.core.ToughAsNails; +import toughasnails.entities.EntityFreeze; +import toughasnails.entities.projectile.EntityIceball; + +public class ModEntities +{ + public static final Map entityEggs = Maps.newLinkedHashMap(); + public static final Map idToTANEntityName = Maps.newLinkedHashMap(); + + private static int nextTANEntityId = 1; + + public static void init() + { + // projectiles + registerTANEntity(EntityIceball.class, "iceball", 80, 3, true); + + // mobs + registerTANEntityWithSpawnEgg(EntityFreeze.class, "freeze", 80, 3, true, 0xECFAF4, 0x439FC3, Biomes.ICE_PLAINS, Biomes.ICE_MOUNTAINS); + } + + // register an entity + public static int registerTANEntity(Class entityClass, String entityName, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates) + { + int tanEntityId = nextTANEntityId; + nextTANEntityId++; + EntityRegistry.registerModEntity(entityClass, entityName, tanEntityId, ToughAsNails.instance, trackingRange, updateFrequency, sendsVelocityUpdates); + idToTANEntityName.put(tanEntityId, entityName); + return tanEntityId; + } + + // register an entity and in addition create a spawn egg for it + public static int registerTANEntityWithSpawnEgg(Class entityClass, String entityName, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates, int eggBackgroundColor, int eggForegroundColor, Biome... entityBiomes) + { + int tanEntityId = registerTANEntity(entityClass, entityName, trackingRange, updateFrequency, sendsVelocityUpdates); + entityEggs.put(Integer.valueOf(tanEntityId), new EntityList.EntityEggInfo(entityName, eggBackgroundColor, eggForegroundColor)); + EntityRegistry.addSpawn(entityClass, 3, 1, 3, EnumCreatureType.MONSTER, entityBiomes); + return tanEntityId; + } + + public static Entity createEntityByID(int tanEntityId, World worldIn) + { + Entity entity = null; + ModContainer mc = FMLCommonHandler.instance().findContainerFor(ToughAsNails.instance); + EntityRegistration er = EntityRegistry.instance().lookupModSpawn(mc, tanEntityId); + if (er != null) + { + Class clazz = er.getEntityClass(); + try + { + if (clazz != null) + { + entity = (Entity)clazz.getConstructor(new Class[] {World.class}).newInstance(new Object[] {worldIn}); + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + if (entity == null) + { + ToughAsNails.logger.warn("Skipping TAN Entity with id " + tanEntityId); + } + return entity; + } + + +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModHandlers.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModHandlers.java new file mode 100644 index 00000000..154309c5 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModHandlers.java @@ -0,0 +1,85 @@ +package toughasnails.init; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.config.SyncedConfigHandler; +import toughasnails.handler.AchievementEventHandler; +import toughasnails.handler.ExtendedStatHandler; +import toughasnails.handler.PacketHandler; +import toughasnails.handler.health.HealthOverlayHandler; +import toughasnails.handler.health.MaxHealthHandler; +import toughasnails.handler.season.ProviderIceHandler; +import toughasnails.handler.season.RandomUpdateHandler; +import toughasnails.handler.season.SeasonHandler; +import toughasnails.handler.season.SeasonSleepHandler; +import toughasnails.handler.season.StopSpawnHandler; +import toughasnails.handler.season.WeatherFrequencyHandler; +import toughasnails.handler.temperature.TemperatureDebugOverlayHandler; +import toughasnails.handler.temperature.TemperatureOverlayHandler; +import toughasnails.handler.thirst.FillBottleHandler; +import toughasnails.handler.thirst.ThirstOverlayHandler; +import toughasnails.handler.thirst.ThirstStatHandler; +import toughasnails.handler.thirst.VanillaDrinkHandler; + +public class ModHandlers { + public static void init() { + PacketHandler.init(); + + MinecraftForge.EVENT_BUS.register(new ExtendedStatHandler()); + MinecraftForge.EVENT_BUS.register(new SyncedConfigHandler()); + + MinecraftForge.EVENT_BUS.register(new ThirstStatHandler()); + MinecraftForge.EVENT_BUS.register(new VanillaDrinkHandler()); + MinecraftForge.EVENT_BUS.register(new FillBottleHandler()); + MinecraftForge.EVENT_BUS.register(new MaxHealthHandler()); + + // Handlers for functionality related to seasons + MinecraftForge.EVENT_BUS.register(new SeasonHandler()); + MinecraftForge.EVENT_BUS.register(new RandomUpdateHandler()); + MinecraftForge.TERRAIN_GEN_BUS.register(new ProviderIceHandler()); + MinecraftForge.EVENT_BUS.register(new SeasonSleepHandler()); + StopSpawnHandler stopSpawnHandler = new StopSpawnHandler(); + MinecraftForge.EVENT_BUS.register(stopSpawnHandler); + MinecraftForge.TERRAIN_GEN_BUS.register(stopSpawnHandler); + MinecraftForge.EVENT_BUS.register(new WeatherFrequencyHandler()); + MinecraftForge.EVENT_BUS.register(new AchievementEventHandler()); + + if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) { + MinecraftForge.EVENT_BUS.register(new TemperatureOverlayHandler()); + MinecraftForge.EVENT_BUS.register(new TemperatureDebugOverlayHandler()); + MinecraftForge.EVENT_BUS.register(new ThirstOverlayHandler()); + MinecraftForge.EVENT_BUS.register(new HealthOverlayHandler()); + + registerSeasonColourHandlers(); + } + } + + @SideOnly(Side.CLIENT) + private static void registerSeasonColourHandlers() { + // TODO: restore color modifications. + // BiomeColorHelper.GRASS_COLOR = new BiomeColorHelper.ColorResolver() { + // @Override + // public int getColorAtPos(Biome biome, BlockPos blockPosition) { + // SeasonTime calendar = new + // SeasonTime(SeasonHandler.clientSeasonCycleTicks); + // return + // SeasonColourUtil.applySeasonalGrassColouring(calendar.getSubSeason(), + // biome.getGrassColorAtPos(blockPosition)); + // } + // }; + // + // BiomeColorHelper.FOLIAGE_COLOR = new BiomeColorHelper.ColorResolver() + // { + // @Override + // public int getColorAtPos(Biome biome, BlockPos blockPosition) { + // SeasonTime calendar = new + // SeasonTime(SeasonHandler.clientSeasonCycleTicks); + // return + // SeasonColourUtil.applySeasonalFoliageColouring(calendar.getSubSeason(), + // biome.getFoliageColorAtPos(blockPosition)); + // } + // }; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModItems.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModItems.java new file mode 100644 index 00000000..98c5d977 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModItems.java @@ -0,0 +1,153 @@ +package toughasnails.init; + +import static toughasnails.api.item.TANItems.canteen; +import static toughasnails.api.item.TANItems.charcoal_filter; +import static toughasnails.api.item.TANItems.freeze_powder; +import static toughasnails.api.item.TANItems.freeze_rod; +import static toughasnails.api.item.TANItems.fruit_juice; +import static toughasnails.api.item.TANItems.ice_charge; +import static toughasnails.api.item.TANItems.ice_cube; +import static toughasnails.api.item.TANItems.jelled_slime; +import static toughasnails.api.item.TANItems.jelled_slime_armor_material; +import static toughasnails.api.item.TANItems.jelled_slime_boots; +import static toughasnails.api.item.TANItems.jelled_slime_chestplate; +import static toughasnails.api.item.TANItems.jelled_slime_helmet; +import static toughasnails.api.item.TANItems.jelled_slime_leggings; +import static toughasnails.api.item.TANItems.lifeblood_crystal; +import static toughasnails.api.item.TANItems.respirator_material; +import static toughasnails.api.item.TANItems.season_clock; +import static toughasnails.api.item.TANItems.spawn_egg; +import static toughasnails.api.item.TANItems.tan_icon; +import static toughasnails.api.item.TANItems.thermometer; +import static toughasnails.api.item.TANItems.water_bottle; +import static toughasnails.api.item.TANItems.wool_armor_material; +import static toughasnails.api.item.TANItems.wool_boots; +import static toughasnails.api.item.TANItems.wool_chestplate; +import static toughasnails.api.item.TANItems.wool_helmet; +import static toughasnails.api.item.TANItems.wool_leggings; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.renderer.block.model.ModelBakery; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.init.SoundEvents; +import net.minecraft.inventory.EntityEquipmentSlot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.common.util.EnumHelper; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import toughasnails.api.item.TANItems; +import toughasnails.core.ToughAsNails; +import toughasnails.item.ItemCanteen; +import toughasnails.item.ItemFruitJuice; +import toughasnails.item.ItemIceCharge; +import toughasnails.item.ItemLifebloodCrystal; +import toughasnails.item.ItemSeasonClock; +import toughasnails.item.ItemTANSpawnEgg; +import toughasnails.item.ItemTANWaterBottle; +import toughasnails.item.ItemThermometer; +import toughasnails.util.inventory.CreativeTabTAN; + +public class ModItems +{ + public static void init() + { + registerItems(); + //setupModels(); + } + + public static void registerItems() + { + // TAN Creative Tab Icon + tan_icon = registerItem(new Item(), "tan_icon"); + tan_icon.setCreativeTab(null); + + // Armor Materials + wool_armor_material = EnumHelper.addArmorMaterial("WOOL", "toughasnails:wool_armor", 3, new int[]{2, 2, 2, 1}, 5, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F); + wool_armor_material.customCraftingMaterial = Item.getItemFromBlock(Blocks.WOOL); + jelled_slime_armor_material = EnumHelper.addArmorMaterial("JELLED_SLIME", "toughasnails:jelled_slime_armor", 9, new int[]{2, 5, 3, 2}, 11, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F); + jelled_slime_armor_material.customCraftingMaterial = TANItems.jelled_slime; + respirator_material = EnumHelper.addArmorMaterial("RESPIRATOR", "toughasnails:respirator", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F); + + // Main Items + thermometer = registerItem(new ItemThermometer(), "thermometer"); + season_clock = registerItem(new ItemSeasonClock(), "season_clock"); + lifeblood_crystal = registerItem(new ItemLifebloodCrystal(), "lifeblood_crystal"); + canteen = registerItem(new ItemCanteen(), "canteen"); + water_bottle = registerItem(new ItemTANWaterBottle(), "water_bottle"); + fruit_juice = registerItem(new ItemFruitJuice(), "fruit_juice"); + + // Materials + ice_cube = registerItem(new Item(), "ice_cube"); + freeze_rod = registerItem(new Item(), "freeze_rod"); + freeze_powder = registerItem(new Item(), "freeze_powder"); + ice_charge = registerItem(new ItemIceCharge(), "ice_charge"); + jelled_slime = registerItem(new Item(), "jelled_slime"); + charcoal_filter = registerItem(new Item(), "charcoal_filter"); + //bottle_of_gas = registerItem(new ItemBottleOfGas(), "bottle_of_gas", null); + + // Respirators + //air_filter = registerItem(new Item(), "air_filter", null); + //respirator = registerItem(new ItemRespirator(respirator_material, 0), "respirator", null); + + // Armor + wool_helmet = registerItem(new ItemArmor(wool_armor_material, 0, EntityEquipmentSlot.HEAD), "wool_helmet"); + wool_chestplate = registerItem(new ItemArmor(wool_armor_material, 0, EntityEquipmentSlot.CHEST), "wool_chestplate"); + wool_leggings = registerItem(new ItemArmor(wool_armor_material, 0, EntityEquipmentSlot.LEGS), "wool_leggings"); + wool_boots = registerItem(new ItemArmor(wool_armor_material, 0, EntityEquipmentSlot.FEET), "wool_boots"); + jelled_slime_helmet = registerItem(new ItemArmor(jelled_slime_armor_material, 0, EntityEquipmentSlot.HEAD), "jelled_slime_helmet"); + jelled_slime_chestplate = registerItem(new ItemArmor(jelled_slime_armor_material, 0, EntityEquipmentSlot.CHEST), "jelled_slime_chestplate"); + jelled_slime_leggings = registerItem(new ItemArmor(jelled_slime_armor_material, 0, EntityEquipmentSlot.LEGS), "jelled_slime_leggings"); + jelled_slime_boots = registerItem(new ItemArmor(jelled_slime_armor_material, 0, EntityEquipmentSlot.FEET), "jelled_slime_boots"); + + spawn_egg = registerItem(new ItemTANSpawnEgg(), "spawn_egg"); + } + + public static Item registerItem(Item item, String name) + { + return registerItem(item, name, CreativeTabTAN.instance); + } + + public static Item registerItem(Item item, String name, CreativeTabs tab) + { + item.setUnlocalizedName(name); + if (tab != null) + { + item.setCreativeTab(CreativeTabTAN.instance); + } + GameRegistry.register(item, new ResourceLocation(ToughAsNails.MOD_ID, name)); + //TANCommand.itemCount++; + + // register sub types if there are any + if (FMLCommonHandler.instance().getSide() == Side.CLIENT) + { + if (item.getHasSubtypes()) + { + List subItems = new ArrayList(); + item.getSubItems(item, CreativeTabTAN.instance, subItems); + for (ItemStack subItem : subItems) + { + String subItemName = item.getUnlocalizedName(subItem); + subItemName = subItemName.substring(subItemName.indexOf(".") + 1); // remove 'item.' from the front + + ModelBakery.registerItemVariants(item, new ResourceLocation(ToughAsNails.MOD_ID, subItemName)); + ModelLoader.setCustomModelResourceLocation(item, subItem.getMetadata(), new ModelResourceLocation(ToughAsNails.MOD_ID + ":" + subItemName, "inventory")); + } + } + else + { + ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(ToughAsNails.MOD_ID + ":" + name, "inventory")); + } + } + + return item; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModPotions.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModPotions.java new file mode 100644 index 00000000..8e92f413 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModPotions.java @@ -0,0 +1,53 @@ +package toughasnails.init; + +import static toughasnails.api.TANPotions.cold_resistance; +import static toughasnails.api.TANPotions.cold_resistance_type; +import static toughasnails.api.TANPotions.long_cold_resistance_type; +import static toughasnails.api.TANPotions.heat_resistance; +import static toughasnails.api.TANPotions.heat_resistance_type; +import static toughasnails.api.TANPotions.long_heat_resistance_type; +import static toughasnails.api.TANPotions.hyperthermia; +import static toughasnails.api.TANPotions.hypothermia; +import static toughasnails.api.TANPotions.thirst; + +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.PotionType; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.common.registry.GameRegistry; +import toughasnails.api.TANPotions; +import toughasnails.core.ToughAsNails; +import toughasnails.potion.PotionColdResistance; +import toughasnails.potion.PotionHeatResistance; +import toughasnails.potion.PotionHyperthermia; +import toughasnails.potion.PotionHypothermia; +import toughasnails.potion.PotionThirst; + +public class ModPotions +{ + public static void init() + { + hypothermia = registerPotion("hypothermia", new PotionHypothermia(24).setPotionName("potion.hypothermia")); + hyperthermia = registerPotion("hyperthermia", new PotionHyperthermia(25).setPotionName("potion.hyperthermia")); + thirst = registerPotion("thirst", new PotionThirst(26).setPotionName("potion.thirst")); + cold_resistance = registerPotion("cold_resistance", new PotionColdResistance(27).setPotionName("potion.cold_resistance").setBeneficial()); + heat_resistance = registerPotion("heat_resistance", new PotionHeatResistance(28).setPotionName("potion.heat_resistance").setBeneficial()); + + cold_resistance_type = registerPotionType("cold_resistance_type", new PotionType(new PotionEffect[] {new PotionEffect(TANPotions.cold_resistance, 1200)})); + long_cold_resistance_type = registerPotionType("long_cold_resistance_type", new PotionType(new PotionEffect[] {new PotionEffect(TANPotions.cold_resistance, 2400)})); + heat_resistance_type = registerPotionType("heat_resistance_type", new PotionType(new PotionEffect[] {new PotionEffect(TANPotions.heat_resistance, 1200)})); + long_heat_resistance_type = registerPotionType("long_heat_resistance_type", new PotionType(new PotionEffect[] {new PotionEffect(TANPotions.heat_resistance, 2400)})); + } + + public static Potion registerPotion(String name, Potion potion) + { + GameRegistry.register(potion, new ResourceLocation(ToughAsNails.MOD_ID, name)); + return potion; + } + + public static PotionType registerPotionType(String name, PotionType potionType) + { + GameRegistry.register(potionType, new ResourceLocation(ToughAsNails.MOD_ID, name)); + return potionType; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModStats.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModStats.java new file mode 100644 index 00000000..fd55f7b3 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModStats.java @@ -0,0 +1,23 @@ +package toughasnails.init; + +import toughasnails.api.TANCapabilities; +import toughasnails.api.stat.PlayerStatRegistry; +import toughasnails.api.stat.capability.ITemperature; +import toughasnails.api.stat.capability.IThirst; +import toughasnails.temperature.TemperatureHandler; +import toughasnails.temperature.TemperatureStorage; +import toughasnails.thirst.ThirstHandler; +import toughasnails.thirst.ThirstStorage; + +public class ModStats +{ + public static void init() + { + PlayerStatRegistry.addStat(ITemperature.class, new TemperatureStorage(), TemperatureHandler.class); + PlayerStatRegistry.addStat(IThirst.class, new ThirstStorage(), ThirstHandler.class); + + //These MUST be registered after stats are added, as only then will ours capabilities be non-null + PlayerStatRegistry.registerCapability(TANCapabilities.TEMPERATURE); + PlayerStatRegistry.registerCapability(TANCapabilities.THIRST); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModVanillaCompat.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModVanillaCompat.java new file mode 100644 index 00000000..29c379cb --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/init/ModVanillaCompat.java @@ -0,0 +1,37 @@ +package toughasnails.init; + +public class ModVanillaCompat +{ + public static void init() + { + addDungeonLoot(); + } + + private static void addDungeonLoot() + { + //Requires loot hooks which haven't yet been added + /*TODO: 1.9 ChestGenHooks desertTemple = ChestGenHooks.getInfo(ChestGenHooks.PYRAMID_DESERT_CHEST); + ChestGenHooks dungeon = ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST); + ChestGenHooks jungleTemple = ChestGenHooks.getInfo(ChestGenHooks.PYRAMID_JUNGLE_CHEST); + ChestGenHooks mineshaft = ChestGenHooks.getInfo(ChestGenHooks.MINESHAFT_CORRIDOR); + ChestGenHooks strongholdCorridor = ChestGenHooks.getInfo(ChestGenHooks.STRONGHOLD_CORRIDOR); + ChestGenHooks strongholdCrossing = ChestGenHooks.getInfo(ChestGenHooks.STRONGHOLD_CROSSING); + ChestGenHooks strongholdLibrary = ChestGenHooks.getInfo(ChestGenHooks.STRONGHOLD_LIBRARY); + ChestGenHooks village = ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH); + ChestGenHooks bonusChest = ChestGenHooks.getInfo(ChestGenHooks.BONUS_CHEST); + + bonusChest.addItem(new WeightedRandomChestContent(new ItemStack(TANItems.canteen), 1, 1, 15)); + + mineshaft.addItem(new WeightedRandomChestContent(new ItemStack(TANItems.jelled_slime_boots), 1, 1, 5)); + mineshaft.addItem(new WeightedRandomChestContent(new ItemStack(TANItems.jelled_slime_chestplate), 1, 1, 5)); + mineshaft.addItem(new WeightedRandomChestContent(new ItemStack(TANItems.jelled_slime_helmet), 1, 1, 5)); + mineshaft.addItem(new WeightedRandomChestContent(new ItemStack(TANItems.jelled_slime_leggings), 1, 1, 5)); + mineshaft.addItem(new WeightedRandomChestContent(new ItemStack(TANItems.respirator), 1, 1, 1)); + mineshaft.addItem(new WeightedRandomChestContent(new ItemStack(TANItems.air_filter), 2, 4, 5)); + + village.addItem(new WeightedRandomChestContent(new ItemStack(TANItems.wool_boots), 1, 1, 5)); + village.addItem(new WeightedRandomChestContent(new ItemStack(TANItems.wool_helmet), 1, 1, 5)); + village.addItem(new WeightedRandomChestContent(new ItemStack(TANItems.wool_chestplate), 1, 1, 5)); + village.addItem(new WeightedRandomChestContent(new ItemStack(TANItems.wool_leggings), 1, 1, 5));*/ + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemBottleOfGas.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemBottleOfGas.java new file mode 100644 index 00000000..e5d2edc6 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemBottleOfGas.java @@ -0,0 +1,124 @@ +package toughasnails.item; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockSnow; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.TANBlocks; + +public class ItemBottleOfGas extends Item { + private Block block; + + public enum BottleContents implements IStringSerializable { + BLACKDAMP, WHITEDAMP, FIREDAMP, STINKDAMP; + + @Override + public String getName() { + return this.name().toLowerCase(); + } + + @Override + public String toString() { + return this.getName(); + } + } + + public ItemBottleOfGas() { + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setMaxStackSize(1); + + this.block = TANBlocks.gas; + } + + // add all the contents types as separate items in the creative tab + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) { + for (BottleContents contents : BottleContents.values()) { + subItems.add(new ItemStack(itemIn, 1, contents.ordinal())); + } + } + + // default behavior in Item is to return 0, but the meta value is important + // here because it determines the jar contents + @Override + public int getMetadata(int metadata) { + return metadata; + } + + public BottleContents getContentsType(ItemStack stack) { + int meta = stack.getMetadata(); + try { + return BottleContents.values()[meta]; + } catch (Exception e) { + // if metadata is out of bounds return blackdamp as a default + // (should never happen) + return BottleContents.BLACKDAMP; + } + } + + // get the correct name for this item by looking up the meta value in the + // JarContents enum + @Override + public String getUnlocalizedName(ItemStack stack) { + return "item.bottle_of_" + this.getContentsType(stack).getName(); + } + + @SuppressWarnings("deprecation") + @Override + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, + EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { + IBlockState iblockstate = worldIn.getBlockState(pos); + Block block = iblockstate.getBlock(); + + if (block == Blocks.SNOW_LAYER && ((Integer) iblockstate.getValue(BlockSnow.LAYERS)).intValue() < 1) { + side = EnumFacing.UP; + } else if (!block.isReplaceable(worldIn, pos)) { + pos = pos.offset(side); + } + + if (!playerIn.canPlayerEdit(pos, side, stack)) { + return EnumActionResult.PASS; + } else if (stack.stackSize == 0) { + return EnumActionResult.PASS; + } else { + if (worldIn.canBlockBePlaced(this.block, pos, false, side, (Entity) null, stack)) { + IBlockState iblockstate1 = this.block.getStateForPlacement(worldIn, pos, side, hitX, hitY, hitZ, + this.getMetadata(stack), playerIn, stack); + + if (worldIn.setBlockState(pos, iblockstate1, 3)) { + iblockstate1 = worldIn.getBlockState(pos); + + if (iblockstate1.getBlock() == this.block) { + ItemBlock.setTileEntityNBT(worldIn, playerIn, pos, stack); + iblockstate1.getBlock().onBlockPlacedBy(worldIn, pos, iblockstate1, playerIn, stack); + } + + stack.setItem(Items.GLASS_BOTTLE); + stack.setItemDamage(0); + return EnumActionResult.SUCCESS; + } + } + + return EnumActionResult.PASS; + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemCanteen.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemCanteen.java new file mode 100644 index 00000000..eb79cfc9 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemCanteen.java @@ -0,0 +1,186 @@ +package toughasnails.item; + +import net.minecraft.block.BlockCauldron; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.IItemPropertyGetter; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.stats.StatList; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.world.World; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.TANCapabilities; +import toughasnails.api.TANPotions; +import toughasnails.api.thirst.WaterType; +import toughasnails.api.config.GameplayOption; +import toughasnails.thirst.ThirstHandler; + +public class ItemCanteen extends Item { + public ItemCanteen() { + this.addPropertyOverride(new ResourceLocation("filled"), + new IItemPropertyGetter() { + @Override + @SideOnly(Side.CLIENT) + public float apply(ItemStack stack, World world, + EntityLivingBase entity) { + WaterType waterType = getWaterType(stack); + + if (waterType == null) + return 0.0F; + else + return 1.0F; + } + }); + + this.maxStackSize = 1; + this.setMaxDamage(3); + this.setNoRepair(); + } + + @SuppressWarnings("deprecation") + @Override + public ItemStack onItemUseFinish(ItemStack stack, World world, + EntityLivingBase entity) { + WaterType waterType = getWaterType(stack); + + if (entity instanceof EntityPlayer && waterType != null) { + EntityPlayer player = (EntityPlayer) entity; + + if (!player.capabilities.isCreativeMode) { + int damage = (stack.getItemDamage() >> 2) + 1; + int typeIndex = (waterType.ordinal() + 1); + + // Reset the canteen to its empty state + if (damage == this.getMaxDamage()) { + damage = 0; + typeIndex = 0; + } + + this.setDamage(stack, typeIndex | (damage << 2)); + } + + ThirstHandler thirstStats = (ThirstHandler) player + .getCapability(TANCapabilities.THIRST, null); + thirstStats.addStats(waterType.getThirst(), + waterType.getHydration()); + + if (!world.isRemote + && world.rand.nextFloat() < waterType.getPoisonChance() + && SyncedConfig + .getBooleanValue(GameplayOption.ENABLE_THIRST)) { + player.addPotionEffect( + new PotionEffect(TANPotions.thirst, 600)); + } + } + + return stack; + } + + @Override + public ActionResult onItemRightClick(ItemStack stack, + World world, EntityPlayer player, EnumHand hand) { + ThirstHandler thirstStats = (ThirstHandler) player + .getCapability(TANCapabilities.THIRST, null); + WaterType waterType = getWaterType(stack); + + if (!attemptCanteenFill(player, stack) && waterType != null + && getTimesUsed(stack) < 3 && thirstStats.isThirsty()) { + player.setActiveHand(hand); + } + + return new ActionResult(EnumActionResult.SUCCESS, stack); + } + + @Override + public double getDurabilityForDisplay(ItemStack stack) { + return (stack.getItemDamage() >> 2) / (double) stack.getMaxDamage(); + } + + /** + * Attempt to fill the provided canteen stack with water. + * + * @param player + * The player holding the canteen. + * @param stack + * The canteen item stack. + * @return true if successful, otherwise false. + */ + private boolean attemptCanteenFill(EntityPlayer player, ItemStack stack) { + World world = player.getEntityWorld(); + RayTraceResult movingObjectPos = this.rayTrace(world, player, true); + + if (movingObjectPos != null + && movingObjectPos.typeOfHit == RayTraceResult.Type.BLOCK) { + BlockPos pos = movingObjectPos.getBlockPos(); + IBlockState state = world.getBlockState(pos); + Fluid fluid = FluidRegistry.lookupFluidForBlock(state.getBlock()); + + if (fluid != null && fluid == FluidRegistry.WATER) // Temporary, + // until a + // registry is + // created + { + stack.setItemDamage(1); + return true; + } else if (state.getBlock() instanceof BlockCauldron) { + BlockCauldron cauldron = (BlockCauldron) state.getBlock(); + int level = ((Integer) state.getValue(BlockCauldron.LEVEL)); + + if (level > 0 && !world.isRemote) { + if (!player.capabilities.isCreativeMode) { + player.addStat(StatList.CAULDRON_USED); + stack.setItemDamage(1); + return true; + } + + cauldron.setWaterLevel(world, pos, state, level - 1); + } + } + } + + return false; + } + + private WaterType getWaterType(ItemStack stack) { + int type = stack.getMetadata() & 3; + return type > 0 ? WaterType.values()[type - 1] : null; + } + + private int getTimesUsed(ItemStack stack) { + return stack.getItemDamage() >> 2; + } + + @Override + public int getMaxItemUseDuration(ItemStack stack) { + return 32; + } + + @Override + public EnumAction getItemUseAction(ItemStack stack) { + return EnumAction.DRINK; + } + + @Override + public String getUnlocalizedName(ItemStack stack) { + WaterType type = getWaterType(stack); + + if (type != null) { + return "item." + type.toString().toLowerCase() + "_water_canteen"; + } else { + return "item.empty_canteen"; + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemFruitJuice.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemFruitJuice.java new file mode 100644 index 00000000..cf4fc161 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemFruitJuice.java @@ -0,0 +1,96 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.item; + +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IStringSerializable; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.item.ItemDrink; +import toughasnails.api.thirst.IDrink; +import toughasnails.item.ItemFruitJuice.JuiceType; + +public class ItemFruitJuice extends ItemDrink { + @Override + public JuiceType getTypeFromMeta(int meta) { + return JuiceType.values()[meta % JuiceType.values().length]; + } + + // get the correct name for this item by looking up the meta value in the + // DartType enum + @Override + public String getUnlocalizedName(ItemStack stack) { + return "item.juice_" + getTypeFromMeta(stack.getMetadata()).toString(); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs tab, + List subItems) { + for (JuiceType juiceType : JuiceType.values()) { + subItems.add(new ItemStack(item, 1, juiceType.ordinal())); + } + } + + public static enum JuiceType implements IDrink,IStringSerializable { + APPLE(8, 0.8F), BEETROOT(10, 0.8F), CACTUS(9, 0.2F), CARROT(8, + 0.6F), CHORUS_FRUIT(12, 0.6F), GLISTERING_MELON(16, + 1.0F), GOLDEN_APPLE(20, 1.2F), GOLDEN_CARROT(14, + 1.0F), MELON(8, 0.5F), PUMPKIN(7, 0.7F); + + private int thirst; + private float hydration; + + private JuiceType(int thirst, float hydration) { + this.thirst = thirst; + this.hydration = hydration; + } + + @Override + public int getThirst() { + return this.thirst; + } + + @Override + public float getHydration() { + return this.hydration; + } + + @Override + public float getPoisonChance() { + return 0.0F; + } + + @Override + public String getName() { + return this.name().toLowerCase(); + } + + @Override + public String toString() { + return this.getName(); + } + } + + @Override + public boolean hasEffect(ItemStack stack) { + switch (getTypeFromMeta(stack.getMetadata())) { + case GLISTERING_MELON: + case GOLDEN_APPLE: + case GOLDEN_CARROT: + return true; + default: + return super.hasEffect(stack); + } + } + +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemIceCharge.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemIceCharge.java new file mode 100644 index 00000000..5a5143db --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemIceCharge.java @@ -0,0 +1,78 @@ +package toughasnails.item; + +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.world.World; + +public class ItemIceCharge extends Item +{ + + public ItemIceCharge() + { + this.setHasSubtypes(true); + } + + @SuppressWarnings("deprecation") + @Override + public ActionResult onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) + { + RayTraceResult movingobjectposition = this.rayTrace(worldIn, playerIn, true); + + if (movingobjectposition == null) + { + return new ActionResult(EnumActionResult.PASS, itemStackIn); + } + else + { + if (movingobjectposition.typeOfHit == RayTraceResult.Type.BLOCK) + { + BlockPos blockpos = movingobjectposition.getBlockPos(); + + if (!worldIn.isBlockModifiable(playerIn, blockpos)) + { + return new ActionResult(EnumActionResult.PASS, itemStackIn); + } + + if (!playerIn.canPlayerEdit(blockpos.offset(movingobjectposition.sideHit), movingobjectposition.sideHit, itemStackIn)) + { + return new ActionResult(EnumActionResult.PASS, itemStackIn); + } + + BlockPos blockpos1 = blockpos.up(); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + + if (iblockstate.getMaterial() == Material.WATER && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0 && worldIn.isAirBlock(blockpos1)) + { + net.minecraftforge.common.util.BlockSnapshot blocksnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(worldIn, blockpos1); + + worldIn.setBlockState(blockpos, Blocks.ICE.getDefaultState()); + if (net.minecraftforge.event.ForgeEventFactory.onPlayerBlockPlace(playerIn, blocksnapshot, net.minecraft.util.EnumFacing.UP).isCanceled()) + { + blocksnapshot.restore(true, false); + return new ActionResult(EnumActionResult.PASS, itemStackIn); + } + + if (!playerIn.capabilities.isCreativeMode) + { + --itemStackIn.stackSize; + } + + playerIn.addStat(StatList.getObjectUseStats(this)); + } + } + + return new ActionResult(EnumActionResult.SUCCESS, itemStackIn); + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemLifebloodCrystal.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemLifebloodCrystal.java new file mode 100644 index 00000000..dcdd410c --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemLifebloodCrystal.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.SoundEvents; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.SoundCategory; +import net.minecraft.world.World; +import toughasnails.api.HealthHelper; + +public class ItemLifebloodCrystal extends Item +{ + @Override + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) + { + if (HealthHelper.addActiveHearts(player, 1)) + { + for (int i = 0; i < 8; i++) + { + double d0 = world.rand.nextGaussian() * 0.02D; + double d1 = world.rand.nextGaussian() * 0.02D; + double d2 = world.rand.nextGaussian() * 0.02D; + world.spawnParticle(EnumParticleTypes.HEART, player.posX + (double)(world.rand.nextFloat() * player.width * 2.0F) - (double)player.width, player.posY + 0.5D + (double)(world.rand.nextFloat() * player.height), player.posZ + (double)(world.rand.nextFloat() * player.width * 2.0F) - (double)player.width, d0, d1, d2, new int[0]); + } + world.playSound(player, player.getPosition(), SoundEvents.ENTITY_PLAYER_LEVELUP, SoundCategory.PLAYERS, 0.75F, 1.0F); + stack.stackSize--; + return new ActionResult(EnumActionResult.SUCCESS, stack); + } + else + { + return new ActionResult(EnumActionResult.FAIL, stack); + } + } + + @Override + public boolean hasEffect(ItemStack stack) + { + return true; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemRespirator.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemRespirator.java new file mode 100644 index 00000000..7083cf2a --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemRespirator.java @@ -0,0 +1,15 @@ +package toughasnails.item; + +import net.minecraft.inventory.EntityEquipmentSlot; +import net.minecraft.item.ItemArmor; + +public class ItemRespirator extends ItemArmor +{ + public ItemRespirator(ItemArmor.ArmorMaterial material, int renderIndex) + { + // respirators are always on your head - armorType = 0 + super(material, renderIndex, EntityEquipmentSlot.HEAD); + + this.setCreativeTab(null); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemSeasonClock.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemSeasonClock.java new file mode 100644 index 00000000..08ee0e17 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemSeasonClock.java @@ -0,0 +1,84 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.item; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.IItemPropertyGetter; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.season.SeasonHelper; +import toughasnails.season.SeasonTime; + +public class ItemSeasonClock extends Item { + public ItemSeasonClock() { + this.addPropertyOverride(new ResourceLocation("time"), + new IItemPropertyGetter() { + @SideOnly(Side.CLIENT) + double field_185088_a; + @SideOnly(Side.CLIENT) + double field_185089_b; + @SideOnly(Side.CLIENT) + int ticks; + + @Override + @SideOnly(Side.CLIENT) + public float apply(ItemStack stack, World world, + EntityLivingBase entity) { + Entity holder = (Entity) (entity != null ? entity + : stack.getItemFrame()); + + if (world == null && holder != null) { + world = holder.getEntityWorld(); + } + + if (world == null) { + return 0.0F; + } else { + double d0; + + if (world.provider.isSurfaceWorld()) { + int seasonCycleTicks = SeasonHelper + .getSeasonData(world) + .getSeasonCycleTicks(); + d0 = (double) ((float) seasonCycleTicks + / (float) SeasonTime.TOTAL_CYCLE_TICKS); + } else { + d0 = Math.random(); + } + + d0 = this.actualFrame(world, d0); + return MathHelper.positiveModulo((float) d0, 1.0F); + } + } + + @SideOnly(Side.CLIENT) + private double actualFrame(World world, double frame) { + if (world.getTotalWorldTime() != this.ticks) { + this.ticks = (int) world.getTotalWorldTime(); + double newFrame = frame - this.field_185088_a; + + if (newFrame < -0.5D) { + ++newFrame; + } + + this.field_185089_b += newFrame * 0.1D; + this.field_185089_b *= 0.9D; + this.field_185088_a += this.field_185089_b; + } + + return this.field_185088_a; + } + }); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemTANBlock.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemTANBlock.java new file mode 100644 index 00000000..35876f11 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemTANBlock.java @@ -0,0 +1,80 @@ +package toughasnails.item; + +import java.util.List; + +import com.google.common.collect.ImmutableSet; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.ITANBlock; +import toughasnails.util.BlockStateUtils; + +public class ItemTANBlock extends ItemBlock +{ + + public ITANBlock tanBlock; + + public ItemTANBlock(Block block) + { + super(block); + if (block instanceof ITANBlock) + { + this.tanBlock = (ITANBlock)block; + } + else + { + throw new IllegalArgumentException("ItemBOPBlock must be created with a block implementing IBOPBlock"); + } + this.setHasSubtypes(true); + } + + // define the items which will appear in the creative tab (called by ItemBlock class) + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) + { + ImmutableSet presets = BlockStateUtils.getBlockPresets(this.block); + if (presets.isEmpty()) + { + subItems.add(new ItemStack(this.block, 1, 0)); + } + else + { + for (IBlockState state : presets) + { + subItems.add(new ItemStack(this.block, 1, this.block.getMetaFromState(state))); + } + } + } + + @Override + public int getMetadata(int metadata) + { + return metadata; + } + + @SuppressWarnings("deprecation") + @Override + public String getUnlocalizedName(ItemStack stack) + { + ImmutableSet presets = BlockStateUtils.getBlockPresets(this.block); + if (presets.isEmpty()) + { + return super.getUnlocalizedName(); + } + else + { + int meta = stack.getMetadata(); + IBlockState oldState = block.getStateFromMeta(meta); + IBlockState newState = BlockStateUtils.getPresetState(oldState); + + return super.getUnlocalizedName() + "." + tanBlock.getStateName(newState); + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemTANSpawnEgg.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemTANSpawnEgg.java new file mode 100644 index 00000000..16f9b697 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemTANSpawnEgg.java @@ -0,0 +1,194 @@ +/******************************************************************************* + * Copyright 2014-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package toughasnails.item; + +import java.util.List; +import java.util.Map.Entry; + +import net.minecraft.block.BlockFence; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.color.IItemColor; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.MobSpawnerBaseLogic; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.item.IColoredItem; +import toughasnails.init.ModEntities; + +public class ItemTANSpawnEgg extends Item implements IColoredItem { + + public ItemTANSpawnEgg() { + this.setHasSubtypes(true); + this.setMaxDamage(0); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) { + for (Entry entry : ModEntities.entityEggs.entrySet()) { + subItems.add(new ItemStack(itemIn, 1, entry.getKey())); + } + } + + public static Entity spawnTANCreature(World worldIn, int entityID, double x, double y, double z) { + Entity entity = ModEntities.createEntityByID(entityID, worldIn); + + if (entity instanceof EntityLivingBase) { + EntityLiving entityliving = (EntityLiving) entity; + entity.setLocationAndAngles(x, y, z, MathHelper.wrapDegrees(worldIn.rand.nextFloat() * 360.0F), 0.0F); + entityliving.rotationYawHead = entityliving.rotationYaw; + entityliving.renderYawOffset = entityliving.rotationYaw; + entityliving.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityliving)), + (IEntityLivingData) null); + worldIn.spawnEntityInWorld(entity); + entityliving.playLivingSound(); + } + + return entity; + } + + @Override + public String getUnlocalizedName(ItemStack stack) { + int bopEntityId = stack.getMetadata(); + String entityName = ModEntities.idToTANEntityName.get(bopEntityId); + return super.getUnlocalizedName(stack) + "_" + entityName; + } + + @Override + @SideOnly(Side.CLIENT) + public IItemColor getItemColor() { + return new IItemColor() { + @Override + public int getColorFromItemstack(ItemStack stack, int tintIndex) { + EntityList.EntityEggInfo entityegginfo = ModEntities.entityEggs + .get(Integer.valueOf(stack.getMetadata())); + return entityegginfo != null + ? (tintIndex == 0 ? entityegginfo.primaryColor : entityegginfo.secondaryColor) : 16777215; + } + }; + } + + @Override + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, + EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + if (worldIn.isRemote) { + return EnumActionResult.SUCCESS; + } else if (!playerIn.canPlayerEdit(pos.offset(facing), facing, stack)) { + return EnumActionResult.FAIL; + } else { + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (iblockstate.getBlock() == Blocks.MOB_SPAWNER) { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityMobSpawner) { + MobSpawnerBaseLogic mobspawnerbaselogic = ((TileEntityMobSpawner) tileentity).getSpawnerBaseLogic(); + mobspawnerbaselogic.setEntityName( + EntityList.CLASS_TO_NAME.get(EntityList.getClassFromID(stack.getMetadata()))); + tileentity.markDirty(); + worldIn.notifyBlockUpdate(pos, iblockstate, iblockstate, 3); + + if (!playerIn.capabilities.isCreativeMode) { + --stack.stackSize; + } + + return EnumActionResult.SUCCESS; + } + } + + pos = pos.offset(facing); + double d0 = 0.0D; + + if (facing == EnumFacing.UP && iblockstate instanceof BlockFence) { + d0 = 0.5D; + } + + Entity entity = spawnTANCreature(worldIn, stack.getMetadata(), (double) pos.getX() + 0.5D, + (double) pos.getY() + d0, (double) pos.getZ() + 0.5D); + + if (entity != null) { + if (entity instanceof EntityLivingBase && stack.hasDisplayName()) { + entity.setCustomNameTag(stack.getDisplayName()); + } + + if (!playerIn.capabilities.isCreativeMode) { + --stack.stackSize; + } + } + + return EnumActionResult.SUCCESS; + } + } + + @Override + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) { + if (world.isRemote) { + return new ActionResult(EnumActionResult.FAIL, stack); + } else { + RayTraceResult movingobjectposition = this.rayTrace(world, player, true); + + if (movingobjectposition == null) { + return new ActionResult(EnumActionResult.FAIL, stack); + } else { + if (movingobjectposition.typeOfHit == RayTraceResult.Type.BLOCK) { + BlockPos blockpos = movingobjectposition.getBlockPos(); + + if (!world.isBlockModifiable(player, blockpos)) { + return new ActionResult(EnumActionResult.FAIL, stack); + } + + if (!player.canPlayerEdit(blockpos, movingobjectposition.sideHit, stack)) { + return new ActionResult(EnumActionResult.FAIL, stack); + } + + if (world.getBlockState(blockpos).getBlock() instanceof BlockLiquid) { + Entity entity = spawnTANCreature(world, stack.getMetadata(), (double) blockpos.getX() + 0.5D, + (double) blockpos.getY() + 0.5D, (double) blockpos.getZ() + 0.5D); + + if (entity != null) { + if (entity instanceof EntityLivingBase && stack.hasDisplayName()) { + ((EntityLiving) entity).setCustomNameTag(stack.getDisplayName()); + } + + if (!player.capabilities.isCreativeMode) { + --stack.stackSize; + } + + // TODO: 1.9 + // playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + } + } + } + + return new ActionResult(EnumActionResult.SUCCESS, stack); + } + } + } + +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemTANWaterBottle.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemTANWaterBottle.java new file mode 100644 index 00000000..41f86bb4 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemTANWaterBottle.java @@ -0,0 +1,90 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.item; + +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IStringSerializable; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.item.ItemDrink; +import toughasnails.api.thirst.IDrink; +import toughasnails.api.thirst.WaterType; +import toughasnails.item.ItemTANWaterBottle.WaterBottleType; + +public class ItemTANWaterBottle extends ItemDrink +{ + @Override + public WaterBottleType getTypeFromMeta(int meta) + { + return WaterBottleType.values()[meta % WaterBottleType.values().length]; + } + + // get the correct name for this item by looking up the meta value in the DartType enum + @Override + public String getUnlocalizedName(ItemStack stack) + { + return "item." + getTypeFromMeta(stack.getMetadata()).toString() + "_water_bottle"; + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs tab, List subItems) + { + for (WaterBottleType waterBottleType : WaterBottleType.values()) + { + subItems.add(new ItemStack(item, 1, waterBottleType.ordinal())); + } + } + + public static enum WaterBottleType implements IDrink, IStringSerializable + { + DIRTY(WaterType.DIRTY), + FILTERED(WaterType.FILTERED); + + private WaterType type; + + private WaterBottleType(WaterType type) + { + this.type = type; + } + + @Override + public int getThirst() + { + return type.getThirst(); + } + + @Override + public float getHydration() + { + return type.getHydration(); + } + + @Override + public float getPoisonChance() + { + return type.getPoisonChance(); + } + + @Override + public String getName() + { + return this.name().toLowerCase(); + } + + @Override + public String toString() + { + return this.getName(); + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemThermometer.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemThermometer.java new file mode 100644 index 00000000..e15f619a --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/item/ItemThermometer.java @@ -0,0 +1,113 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.item; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.IItemPropertyGetter; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import toughasnails.api.config.GameplayOption; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.temperature.TemperatureHelper; +import toughasnails.api.temperature.TemperatureScale; +import toughasnails.temperature.TemperatureHandler; + +public class ItemThermometer extends Item { + public ItemThermometer() { + this.addPropertyOverride(new ResourceLocation("temperature"), new IItemPropertyGetter() { + @SideOnly(Side.CLIENT) + double field_185088_a; + @SideOnly(Side.CLIENT) + double field_185089_b; + @SideOnly(Side.CLIENT) + int ticks; + + @Override + @SideOnly(Side.CLIENT) + public float apply(ItemStack stack, World world, EntityLivingBase entity) { + boolean overrideThermometerLimits = SyncedConfig + .getBooleanValue(GameplayOption.OVERRIDE_THERMOMETER_LIMITS); + int lowerBound = SyncedConfig.getIntegerValue(GameplayOption.THERMOMETER_LOWER_BOUND); + int upperBound = SyncedConfig.getIntegerValue(GameplayOption.THERMOMETER_UPPER_BOUND); + + if (entity == null || !(entity instanceof EntityPlayer)) { + Entity frame = stack.getItemFrame(); + if (frame != null) { + BlockPos framePosition = frame.getPosition(); + World frameWorld = frame.getEntityWorld(); + int finalTemperature = TemperatureHandler.getTargetTemperatureAt(frameWorld, framePosition); + + if (overrideThermometerLimits) { + float clampedTemp = (float) MathHelper.clamp_float(finalTemperature, lowerBound, + upperBound); + float shiftedTemp = (clampedTemp - lowerBound); + float needlePosition = shiftedTemp / ((float) (upperBound - lowerBound)); + return needlePosition; + } else { + return (float) MathHelper.clamp_float(finalTemperature, 0, TemperatureScale.getScaleTotal()) + / (float) TemperatureScale.getScaleTotal(); + } + } else { + return 0.0f; + } + } + + EntityPlayer player = (EntityPlayer) entity; + + if (world == null) + world = entity.getEntityWorld(); + + TemperatureHandler tempHandler = (TemperatureHandler) TemperatureHelper.getTemperatureData(player); + int finalTemperature = tempHandler.debugger.targetTemperature; + if (overrideThermometerLimits) { + float clampedTemp = (float) MathHelper.clamp_float(finalTemperature, lowerBound, upperBound); + float shiftedTemp = (clampedTemp - lowerBound); + return shiftedTemp / ((float) (upperBound - lowerBound)); + } else { + return (float) MathHelper.clamp_float(finalTemperature, 0, TemperatureScale.getScaleTotal()) + / (float) TemperatureScale.getScaleTotal(); + } + } + }); + } + + Map messageDebounce = new HashMap(); + + @Override + public ActionResult onItemRightClick(ItemStack itemStackIn, World world, EntityPlayer player, + EnumHand hand) { + if (!world.isRemote) { + // Get the temperature of the world at the player's location. + if (!messageDebounce.containsKey(player.getUniqueID()) + || (System.currentTimeMillis() - messageDebounce.get(player.getUniqueID()) > 2000)) { + BlockPos playerPosition = player.getPosition(); + int finalTemperature = TemperatureHandler.getTargetTemperatureAt(world, playerPosition); + + player.addChatMessage(new TextComponentTranslation("item.thermometer.read", finalTemperature)); + messageDebounce.put(player.getUniqueID(), System.currentTimeMillis()); + } + } + return new ActionResult(EnumActionResult.PASS, itemStackIn); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/network/message/MessageSyncConfigs.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/network/message/MessageSyncConfigs.java new file mode 100644 index 00000000..e20e5339 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/network/message/MessageSyncConfigs.java @@ -0,0 +1,62 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.network.message; + +import io.netty.buffer.ByteBuf; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fml.common.network.ByteBufUtils; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; +import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; +import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; +import net.minecraftforge.fml.relauncher.Side; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.config.SyncedConfig.SyncedConfigEntry; +import toughasnails.core.ToughAsNails; + +public class MessageSyncConfigs implements IMessage, IMessageHandler +{ + public NBTTagCompound nbtOptions; + + public MessageSyncConfigs() {} + + public MessageSyncConfigs(NBTTagCompound nbtOptions) + { + this.nbtOptions = nbtOptions; + } + + @Override + public void fromBytes(ByteBuf buf) + { + this.nbtOptions = ByteBufUtils.readTag(buf); + } + + @Override + public void toBytes(ByteBuf buf) + { + ByteBufUtils.writeTag(buf, nbtOptions); + } + + @Override + public IMessage onMessage(MessageSyncConfigs message, MessageContext ctx) + { + if (ctx.side == Side.CLIENT) + { + for (String key : message.nbtOptions.getKeySet()) + { + SyncedConfigEntry entry = SyncedConfig.optionsToSync.get(key); + + if (entry == null) ToughAsNails.logger.error("Option " + key + " does not exist locally!"); + + entry.value = message.nbtOptions.getString(key); + ToughAsNails.logger.info("TAN configuration synchronized with the server"); + } + } + + return null; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/network/message/MessageSyncSeasonCycle.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/network/message/MessageSyncSeasonCycle.java new file mode 100644 index 00000000..dc1e9cda --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/network/message/MessageSyncSeasonCycle.java @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.network.message; + +import io.netty.buffer.ByteBuf; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; +import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; +import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; +import net.minecraftforge.fml.relauncher.Side; +import toughasnails.handler.season.SeasonHandler; + +public class MessageSyncSeasonCycle implements IMessage, IMessageHandler +{ + public int seasonCycleTicks; + + public MessageSyncSeasonCycle() {} + + public MessageSyncSeasonCycle(int seasonCycleTicks) + { + this.seasonCycleTicks = seasonCycleTicks; + } + + @Override + public void fromBytes(ByteBuf buf) + { + this.seasonCycleTicks = buf.readInt(); + } + + @Override + public void toBytes(ByteBuf buf) + { + buf.writeInt(this.seasonCycleTicks); + } + + @Override + public IMessage onMessage(MessageSyncSeasonCycle message, MessageContext ctx) + { + if (ctx.side == Side.CLIENT) + { + SeasonHandler.clientSeasonCycleTicks = message.seasonCycleTicks; + } + + return null; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/network/message/MessageTemperatureClient.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/network/message/MessageTemperatureClient.java new file mode 100644 index 00000000..1f25e741 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/network/message/MessageTemperatureClient.java @@ -0,0 +1,101 @@ +package toughasnails.network.message; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Map.Entry; + +import io.netty.buffer.ByteBuf; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.network.PacketBuffer; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; +import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; +import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; +import net.minecraftforge.fml.relauncher.Side; +import toughasnails.api.TANCapabilities; +import toughasnails.temperature.TemperatureDebugger; +import toughasnails.temperature.TemperatureDebugger.Modifier; +import toughasnails.temperature.TemperatureDebugger.ModifierType; +import toughasnails.temperature.TemperatureHandler; + +public class MessageTemperatureClient implements IMessage, IMessageHandler { + public int temperatureTimer; + public int changeTicks; + public int targetTemperature; + + @SuppressWarnings("unchecked") + public Map[] modifiers = new LinkedHashMap[ModifierType.values().length]; + + @SuppressWarnings({ "unchecked", "rawtypes" }) + public MessageTemperatureClient() { + for (int i = 0; i < ModifierType.values().length; i++) { + modifiers[i] = new LinkedHashMap(); + } + } + + public MessageTemperatureClient(int temperatureTimer, int changeTicks, int targetTemperature, + Map[] modifiers) { + this.temperatureTimer = temperatureTimer; + this.changeTicks = changeTicks; + this.targetTemperature = targetTemperature; + this.modifiers = modifiers; + } + + @Override + public void fromBytes(ByteBuf buf) { + PacketBuffer packetBuffer = new PacketBuffer(buf); + + this.temperatureTimer = packetBuffer.readInt(); + this.changeTicks = packetBuffer.readInt(); + this.targetTemperature = packetBuffer.readInt(); + + for (int mapIdx = 0; mapIdx < modifiers.length; mapIdx++) { + int size = packetBuffer.readInt(); + + for (int i = 0; i < size; i++) { + Modifier modifier = (Modifier) packetBuffer.readEnumValue(Modifier.class); + int value = packetBuffer.readInt(); + + modifiers[mapIdx].put(modifier, value); + } + } + } + + @Override + public void toBytes(ByteBuf buf) { + PacketBuffer packetBuffer = new PacketBuffer(buf); + + packetBuffer.writeInt(this.temperatureTimer); + packetBuffer.writeInt(this.changeTicks); + packetBuffer.writeInt(this.targetTemperature); + + for (Map modifier : modifiers) { + packetBuffer.writeInt(modifier.size()); + + for (Entry entry : modifier.entrySet()) { + packetBuffer.writeEnumValue(entry.getKey()); + packetBuffer.writeInt(entry.getValue()); + } + } + } + + @Override + public IMessage onMessage(MessageTemperatureClient message, MessageContext ctx) { + if (ctx.side == Side.CLIENT) { + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + + if (player != null) { + TemperatureHandler temperatureStats = (TemperatureHandler) player + .getCapability(TANCapabilities.TEMPERATURE, null); + TemperatureDebugger debugger = temperatureStats.debugger; + + debugger.temperatureTimer = message.temperatureTimer; + debugger.changeTicks = message.changeTicks; + debugger.targetTemperature = message.targetTemperature; + debugger.modifiers = message.modifiers; + } + } + + return null; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/network/message/MessageToggleUI.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/network/message/MessageToggleUI.java new file mode 100644 index 00000000..8b7ecbbb --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/network/message/MessageToggleUI.java @@ -0,0 +1,50 @@ +package toughasnails.network.message; + +import io.netty.buffer.ByteBuf; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; +import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; +import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; +import net.minecraftforge.fml.relauncher.Side; +import toughasnails.api.TANCapabilities; +import toughasnails.temperature.TemperatureDebugger; +import toughasnails.temperature.TemperatureHandler; + +public class MessageToggleUI implements IMessage, IMessageHandler { + public boolean showDebugGUI; + + public MessageToggleUI() { + } + + public MessageToggleUI(boolean showDebugGUI) { + this.showDebugGUI = showDebugGUI; + } + + @Override + public void fromBytes(ByteBuf buf) { + this.showDebugGUI = buf.readBoolean(); + } + + @Override + public void toBytes(ByteBuf buf) { + buf.writeBoolean(this.showDebugGUI); + } + + @Override + public IMessage onMessage(MessageToggleUI message, MessageContext ctx) { + if (ctx.side == Side.CLIENT) { + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + + if (player != null) { + TemperatureHandler temperatureStats = (TemperatureHandler) player + .getCapability(TANCapabilities.TEMPERATURE, null); + TemperatureDebugger debugger = temperatureStats.debugger; + + debugger.setGuiVisible(message.showDebugGUI); + } + } + + return null; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/network/message/MessageUpdateStat.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/network/message/MessageUpdateStat.java new file mode 100644 index 00000000..b8e8492c --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/network/message/MessageUpdateStat.java @@ -0,0 +1,58 @@ +package toughasnails.network.message; + +import io.netty.buffer.ByteBuf; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.fml.common.network.ByteBufUtils; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; +import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; +import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; +import toughasnails.api.stat.IPlayerStat; +import toughasnails.api.stat.PlayerStatRegistry; +import toughasnails.api.stat.StatHandlerBase; + +public class MessageUpdateStat implements IMessage, IMessageHandler { + public String identifier; + public NBTTagCompound data; + + public MessageUpdateStat() { + } + + public MessageUpdateStat(Capability capability, NBTTagCompound data) { + if (data == null) + throw new IllegalArgumentException("Data cannot be null!"); + + this.identifier = capability.getName(); + this.data = data; + } + + @Override + public void fromBytes(ByteBuf buf) { + this.identifier = ByteBufUtils.readUTF8String(buf); + this.data = ByteBufUtils.readTag(buf); + } + + @Override + public void toBytes(ByteBuf buf) { + ByteBufUtils.writeUTF8String(buf, this.identifier); + ByteBufUtils.writeTag(buf, this.data); + } + + @SuppressWarnings("unchecked") + @Override + public IMessage onMessage(MessageUpdateStat message, MessageContext ctx) { + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + + if (player != null) { + Capability capability = (Capability) PlayerStatRegistry + .getCapability(message.identifier); + StatHandlerBase stat = (StatHandlerBase) player.getCapability(capability, null); + + capability.getStorage().readNBT(capability, stat, null, message.data); + } + + return null; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/particle/EntitySnowflakeFX.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/particle/EntitySnowflakeFX.java new file mode 100644 index 00000000..a78144c5 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/particle/EntitySnowflakeFX.java @@ -0,0 +1,97 @@ +package toughasnails.particle; + +import net.minecraft.client.particle.Particle; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.VertexBuffer; +import net.minecraft.entity.Entity; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.fml.client.FMLClientHandler; +import toughasnails.core.ClientProxy; + +public class EntitySnowflakeFX extends Particle { + + public EntitySnowflakeFX(World world, double xCoordIn, double yCoordIn, double zCoordIn, double motionXIn, + double motionYIn, double motionZIn) { + this(world, xCoordIn, yCoordIn, zCoordIn, motionXIn, motionYIn, motionZIn, 1.0F); + } + + public EntitySnowflakeFX(World world, double xCoordIn, double yCoordIn, double zCoordIn, double motionXIn, + double motionYIn, double motionZIn, float par14) { + super(world, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); + + this.particleTextureIndexX = 7; + this.particleTextureIndexY = 0; + + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += motionXIn; + this.motionY += motionYIn; + this.motionZ += motionZIn; + this.particleScale *= 0.75F; + this.particleScale *= par14; + this.particleMaxAge = (int) ((8.0D / (Math.random() * 0.8D + 0.2D)) * 8); + this.particleMaxAge = (int) ((float) this.particleMaxAge * par14); + this.particleAge = world.rand.nextInt(2); + this.particleAlpha = 1.0F; + this.particleGravity = 0.02F; + } + + @Override + public int getFXLayer() { + return 2; + } + + @Override + public void renderParticle(VertexBuffer renderer, Entity entity, float partialTicks, float rotX, float rotXZ, + float rotZ, float rotYZ, float rotXY) { + + // EffectRenderer will by default bind the vanilla particles texture, + // override with our own + FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particleTexturesLocation); + + float scaleMultiplier = ((float) this.particleAge + partialTicks) / (float) this.particleMaxAge * 32.0F; + scaleMultiplier = MathHelper.clamp_float(scaleMultiplier, 0.0F, 1.0F); + this.particleScale = this.particleScale * scaleMultiplier; + + GlStateManager.depthMask(false); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 1); + + super.renderParticle(renderer, entity, partialTicks, rotX, rotXZ, rotZ, rotYZ, rotXY); + + GlStateManager.disableBlend(); + GlStateManager.depthMask(true); + + } + + @Override + public void onUpdate() { + prevPosX = posX; + prevPosY = posY; + prevPosZ = posZ; + + if (particleAge++ >= particleMaxAge) { + this.setExpired(); + } + + this.particleTextureIndexX = 7 - particleAge * 8 / particleMaxAge; + this.moveEntity(motionX, motionY, motionZ); + + if (posY == prevPosY) { + motionX *= 1.1D; + motionZ *= 1.1D; + } + + motionX *= 0.9599999785423279D; + motionY *= 0.9599999785423279D; + motionZ *= 0.9599999785423279D; + + if (isCollided) { + motionX *= 0.699999988079071D; + motionZ *= 0.699999988079071D; + } + } + +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/particle/TANParticleTypes.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/particle/TANParticleTypes.java new file mode 100644 index 00000000..a83d4210 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/particle/TANParticleTypes.java @@ -0,0 +1,6 @@ +package toughasnails.particle; + +public enum TANParticleTypes +{ + SNOWFLAKE; +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/potion/PotionColdResistance.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/potion/PotionColdResistance.java new file mode 100644 index 00000000..d705f364 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/potion/PotionColdResistance.java @@ -0,0 +1,21 @@ +package toughasnails.potion; + +import net.minecraft.entity.EntityLivingBase; +import toughasnails.api.TANPotions; + +public class PotionColdResistance extends TANPotion { + public PotionColdResistance(int id) { + super(true, 0x77A9FF, 2, 1); + } + + @Override + public void performEffect(EntityLivingBase entity, int amplifier) { + entity.removePotionEffect(TANPotions.hypothermia); + } + + @Override + public boolean isReady(int duration, int amplifier) { + int time = 50 >> amplifier; + return time > 0 ? duration % time == 0 : true; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/potion/PotionHeatResistance.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/potion/PotionHeatResistance.java new file mode 100644 index 00000000..54196e3a --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/potion/PotionHeatResistance.java @@ -0,0 +1,25 @@ +package toughasnails.potion; + +import net.minecraft.entity.EntityLivingBase; +import toughasnails.api.TANPotions; + +public class PotionHeatResistance extends TANPotion +{ + public PotionHeatResistance(int id) + { + super(true, 0xE54720, 1, 1); + } + + @Override + public void performEffect(EntityLivingBase entity, int amplifier) + { + entity.removePotionEffect(TANPotions.hyperthermia); + } + + @Override + public boolean isReady(int duration, int amplifier) + { + int time = 50 >> amplifier; + return time > 0 ? duration % time == 0 : true; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/potion/PotionHyperthermia.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/potion/PotionHyperthermia.java new file mode 100644 index 00000000..0486fa81 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/potion/PotionHyperthermia.java @@ -0,0 +1,27 @@ +package toughasnails.potion; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.DamageSource; + +public class PotionHyperthermia extends TANPotion +{ + public PotionHyperthermia(int id) + { + super(true, 0xFFA300, 3, 0); + + this.setIconIndex(3, 0); + } + + @Override + public void performEffect(EntityLivingBase entity, int amplifier) + { + entity.attackEntityFrom(DamageSource.generic, 0.5F); + } + + @Override + public boolean isReady(int duration, int amplifier) + { + int time = 50 >> amplifier; + return time > 0 ? duration % time == 0 : true; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/potion/PotionHypothermia.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/potion/PotionHypothermia.java new file mode 100644 index 00000000..a0542f34 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/potion/PotionHypothermia.java @@ -0,0 +1,27 @@ +package toughasnails.potion; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.DamageSource; + +public class PotionHypothermia extends TANPotion +{ + public PotionHypothermia(int id) + { + super(true, 0xA8CFFF, 2, 0); + + this.setIconIndex(2, 0); + } + + @Override + public void performEffect(EntityLivingBase entity, int amplifier) + { + entity.attackEntityFrom(DamageSource.generic, 0.5F); + } + + @Override + public boolean isReady(int duration, int amplifier) + { + int time = 50 >> amplifier; + return time > 0 ? duration % time == 0 : true; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/potion/PotionThirst.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/potion/PotionThirst.java new file mode 100644 index 00000000..41890da1 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/potion/PotionThirst.java @@ -0,0 +1,33 @@ +package toughasnails.potion; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import toughasnails.api.thirst.ThirstHelper; +import toughasnails.thirst.ThirstHandler; + +public class PotionThirst extends TANPotion +{ + public PotionThirst(int id) + { + super(true, 0x61D51A, 0, 0); + } + + @Override + public void performEffect(EntityLivingBase entity, int amplifier) + { + if (entity instanceof EntityPlayer) + { + EntityPlayer player = (EntityPlayer)entity; + ThirstHandler handler = (ThirstHandler)ThirstHelper.getThirstData(player); + + handler.addExhaustion(0.025F * (float)(amplifier + 1)); + } + } + + @Override + public boolean isReady(int duration, int amplifier) + { + int time = 50 >> amplifier; + return time > 0 ? duration % time == 0 : true; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/potion/TANPotion.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/potion/TANPotion.java new file mode 100644 index 00000000..ff8c9aa1 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/potion/TANPotion.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.potion; + +import net.minecraft.client.Minecraft; +import net.minecraft.potion.Potion; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +public abstract class TANPotion extends Potion { + private static final ResourceLocation POTIONS_LOCATION = new ResourceLocation( + "toughasnails:textures/potions/tanpotionfx.png"); + + protected TANPotion(boolean isBadEffectIn, int liquidColorIn, int x, int y) { + super(isBadEffectIn, liquidColorIn); + this.setIconIndex(x, y); + } + + @Override + @SideOnly(Side.CLIENT) + public boolean hasStatusIcon() { + Minecraft.getMinecraft().getTextureManager().bindTexture(POTIONS_LOCATION); + return super.hasStatusIcon(); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/season/ISeasonedWorld.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/season/ISeasonedWorld.java new file mode 100644 index 00000000..4d2db42b --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/season/ISeasonedWorld.java @@ -0,0 +1,18 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.season; + +import net.minecraft.util.math.BlockPos; +import toughasnails.api.season.Season; + +/** Now with extra seasoning*/ +public interface ISeasonedWorld +{ + boolean canSnowAtInSeason(BlockPos pos, boolean checkLight, Season season); + boolean canBlockFreezeInSeason(BlockPos pos, boolean noWaterAdj, Season season); +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/season/SeasonASMHelper.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/season/SeasonASMHelper.java new file mode 100644 index 00000000..8277aa5b --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/season/SeasonASMHelper.java @@ -0,0 +1,170 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.season; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import toughasnails.api.TANBlocks; +import toughasnails.api.config.GameplayOption; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.season.IDecayableCrop; +import toughasnails.api.season.Season; +import toughasnails.api.season.SeasonHelper; +import toughasnails.api.temperature.Temperature; +import toughasnails.api.temperature.TemperatureHelper; +import toughasnails.config.CropGrowConfigEntry; +import toughasnails.config.GameplayConfigurationHandler; +import toughasnails.handler.season.SeasonHandler; +import toughasnails.temperature.TemperatureHandler; + +public class SeasonASMHelper { + /////////////////// + // World methods // + /////////////////// + + public static boolean canSnowAtInSeason(World world, BlockPos pos, boolean checkLight, Season season) { + Biome biome = world.getBiome(pos); + float temperature = biome.getFloatTemperature(pos); + + // If we're in winter, the temperature can be anything equal to or below + // 0.7 + if (!SeasonHelper.canSnowAtTempInSeason(season, temperature)) { + return false; + } else if (biome == Biomes.RIVER || biome == Biomes.OCEAN || biome == Biomes.DEEP_OCEAN) { + return false; + } else if (checkLight) { + if (pos.getY() >= 0 && pos.getY() < 256 && world.getLightFor(EnumSkyBlock.BLOCK, pos) < 10) { + IBlockState state = world.getBlockState(pos); + + if (state.getBlock().isAir(state, world, pos) && Blocks.SNOW_LAYER.canPlaceBlockAt(world, pos)) { + return true; + } + } + + return false; + } + + return true; + } + + public static boolean canBlockFreezeInSeason(World world, BlockPos pos, boolean noWaterAdj, Season season) { + Biome Biome = world.getBiome(pos); + float temperature = Biome.getFloatTemperature(pos); + + // If we're in winter, the temperature can be anything equal to or below + // 0.7 + if (!SeasonHelper.canSnowAtTempInSeason(season, temperature)) { + return false; + } else if (Biome == Biomes.RIVER || Biome == Biomes.OCEAN || Biome == Biomes.DEEP_OCEAN) { + return false; + } else { + if (pos.getY() >= 0 && pos.getY() < 256 && world.getLightFor(EnumSkyBlock.BLOCK, pos) < 10) { + IBlockState iblockstate = world.getBlockState(pos); + Block block = iblockstate.getBlock(); + + if ((block == Blocks.WATER || block == Blocks.FLOWING_WATER) + && ((Integer) iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0) { + if (!noWaterAdj) { + return true; + } + + boolean west = (world.getBlockState(pos.west()).getMaterial() == Material.WATER); + boolean east = (world.getBlockState(pos.east()).getMaterial() == Material.WATER); + boolean north = (world.getBlockState(pos.north()).getMaterial() == Material.WATER); + boolean south = (world.getBlockState(pos.south()).getMaterial() == Material.WATER); + + boolean flag = west && east && north && south; + + if (!flag) { + return true; + } + } + } + + return false; + } + } + + public static boolean isRainingAtInSeason(World world, BlockPos pos, Season season) { + Biome biome = world.getBiome(pos); + return biome.getEnableSnow() && season != Season.WINTER ? false + : (world.canSnowAt(pos, false) ? false : biome.canRain()); + } + + /////////////////// + // Biome methods // + /////////////////// + + public static float getFloatTemperature(Biome biome, BlockPos pos) { + Season season = new SeasonTime(SeasonHandler.clientSeasonCycleTicks).getSubSeason().getSeason(); + + if (biome.getTemperature() <= 0.7F && season == Season.WINTER + && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_SEASONS)) { + return 0.0F; + } else { + return biome.getFloatTemperature(pos); + } + } + + //////////////////////// + // BlockCrops methods // + //////////////////////// + + public static void onUpdateTick(Block block, World world, BlockPos pos) { + + // Should withering be based on the season, or on temperature? + String blockName = block.getRegistryName().toString(); + boolean temperatureWithering = SyncedConfig.getBooleanValue(GameplayOption.TEMPERATURE_WITHERING); + if (!temperatureWithering) { + Season season = SeasonHelper.getSeasonData(world).getSubSeason().getSeason(); + + if (season == Season.WINTER && !TemperatureHelper.isPosClimatisedForTemp(world, pos, new Temperature(1)) + && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_SEASONS)) { + + // Kill those crops which implement the decaying API or + // externally-specified. + if (block instanceof IDecayableCrop && ((IDecayableCrop) block).shouldDecay()) { + world.setBlockState(pos, TANBlocks.dead_crops.getDefaultState()); + } else if (GameplayConfigurationHandler.EXTERNAL_DECAYING_CROPS.containsKey(blockName)) { + world.setBlockState(pos, TANBlocks.dead_crops.getDefaultState()); + } + } + } else { + int minLiving = 0; + int maxLiving = 0; + + // Assign crop life details from config file. + if (GameplayConfigurationHandler.EXTERNAL_DECAYING_CROPS.containsKey(blockName)) { + CropGrowConfigEntry cropData = GameplayConfigurationHandler.EXTERNAL_DECAYING_CROPS.get(blockName); + minLiving = cropData.getMinLiving(); + maxLiving = cropData.getMaxLiving(); + + // Otherwise, assign defaults. + } else if (block instanceof IDecayableCrop && ((IDecayableCrop) block).shouldDecay()) { + minLiving = 5; + maxLiving = 20; + } else { + return; + } + + // Kill the crop if it exceeds temperature bounds. + int targetTemperature = TemperatureHandler.getTargetTemperatureAt(world, pos); + if (targetTemperature > maxLiving || targetTemperature < minLiving) { + world.setBlockState(pos, TANBlocks.dead_crops.getDefaultState()); + } + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/season/SeasonSavedData.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/season/SeasonSavedData.java new file mode 100644 index 00000000..c139b669 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/season/SeasonSavedData.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.season; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.WorldSavedData; + +public class SeasonSavedData extends WorldSavedData +{ + public static final String DATA_IDENTIFIER = "seasons"; + + public int seasonCycleTicks; + + public SeasonSavedData() + { + this(DATA_IDENTIFIER); + } + + //This specific constructor is required for saving to occur + public SeasonSavedData(String identifier) + { + super(identifier); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) + { + this.seasonCycleTicks = nbt.getInteger("SeasonCycleTicks"); + } + + @Override + public NBTTagCompound writeToNBT(NBTTagCompound nbt) + { + nbt.setInteger("SeasonCycleTicks", this.seasonCycleTicks); + + return nbt; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/season/SeasonTime.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/season/SeasonTime.java new file mode 100644 index 00000000..f0f5b0d5 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/season/SeasonTime.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.season; + +import toughasnails.api.season.ISeasonData; +import toughasnails.api.season.Season; +import toughasnails.api.season.Season.SubSeason; + +public final class SeasonTime implements ISeasonData +{ + /** Not configurable, the duration of a single day*/ + public static final int DAY_TICKS = 24000; + /** The duration of a sub season in days*/ + public static final int SUB_SEASON_DURATION = 5; + public static final int SEASON_TICKS = DAY_TICKS * SUB_SEASON_DURATION * 3; + public static final int TOTAL_CYCLE_TICKS = (DAY_TICKS * SUB_SEASON_DURATION) * SubSeason.values().length; + + public final int time; + + public SeasonTime(int time) + { + this.time = time; + } + + public int getDay() + { + return (int)(this.time / DAY_TICKS); + } + + @Override + public int getSeasonCycleTicks() + { + return this.time; + } + + @Override + public SubSeason getSubSeason() + { + int index = (getDay() / SUB_SEASON_DURATION) % SubSeason.values().length; + return SubSeason.values()[index]; + } + + public Season getSeason() + { + return this.getSubSeason().getSeason(); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/BlockTemperatureData.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/BlockTemperatureData.java new file mode 100644 index 00000000..3c5b9aba --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/BlockTemperatureData.java @@ -0,0 +1,17 @@ +package toughasnails.temperature; + +import net.minecraft.block.state.IBlockState; + +public class BlockTemperatureData { + + public IBlockState state; + public float blockTemperature; + public String[] useProperties; + + public BlockTemperatureData(IBlockState state, String[] useProperties, float blockTemperature) { + this.state = state; + this.useProperties = useProperties; + this.blockTemperature = blockTemperature; + } + +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/MaterialTemperatureData.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/MaterialTemperatureData.java new file mode 100644 index 00000000..a07a8fce --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/MaterialTemperatureData.java @@ -0,0 +1,7 @@ +package toughasnails.temperature; + +public class MaterialTemperatureData { + + public float fire = 1.0F; + +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/TemperatureDebugger.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/TemperatureDebugger.java new file mode 100644 index 00000000..492959f9 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/TemperatureDebugger.java @@ -0,0 +1,141 @@ +package toughasnails.temperature; + +import java.util.LinkedHashMap; +import java.util.Map; + +import net.minecraft.entity.player.EntityPlayerMP; +import toughasnails.handler.PacketHandler; +import toughasnails.network.message.MessageTemperatureClient; +import toughasnails.network.message.MessageToggleUI; +import toughasnails.util.MapUtils; + +public class TemperatureDebugger { + @SuppressWarnings("unchecked") + public Map[] modifiers = new LinkedHashMap[ModifierType.values().length]; + + private boolean showGui = false; + public int debugTimer; + + public int temperatureTimer; + public int changeTicks; + public int targetTemperature; + + private boolean currentlyMeasuring = false; + private Modifier currentModifier; + private int currentLevel = -1; + + public TemperatureDebugger() { + for (int i = 0; i < ModifierType.values().length; i++) { + modifiers[i] = new LinkedHashMap(); + } + } + + public void start(Modifier modifier, int startLevel) { + if (!currentlyMeasuring) { + this.currentModifier = modifier; + this.currentLevel = startLevel; + this.currentlyMeasuring = true; + } else { + throw new RuntimeException("Already measuring!"); + } + } + + public void end(int endLevel) { + if (currentlyMeasuring) { + int difference = -(currentLevel - endLevel); + + if (difference != 0) { + modifiers[currentModifier.modifierType.ordinal()].put(currentModifier, difference); + } + + currentlyMeasuring = false; + } else { + throw new RuntimeException("No measurement has been started!"); + } + } + + /** + * Sorts the modifier maps and sends them to the client + */ + public void finalize(EntityPlayerMP player) { + this.debugTimer = 0; + + if (this.showGui) { + sortModifiers(); + } + + PacketHandler.instance.sendTo( + new MessageTemperatureClient(temperatureTimer, changeTicks, targetTemperature, modifiers), player); + clearModifiers(); + } + + private void sortModifiers() { + for (int i = 0; i < modifiers.length; i++) { + modifiers[i] = MapUtils.sortMapByValue(modifiers[i]); + } + } + + public void clearModifiers() { + for (int i = 0; i < modifiers.length; i++) { + modifiers[i].clear(); + } + } + + public void setGuiVisible(boolean state, EntityPlayerMP updatePlayer) { + this.showGui = state; + this.debugTimer = 0; + + if (updatePlayer != null) { + PacketHandler.instance.sendTo(new MessageToggleUI(state), updatePlayer); + } + } + + public void setGuiVisible(boolean state) { + setGuiVisible(state, null); + } + + public boolean isGuiVisible() { + return this.showGui; + } + + public static enum ModifierType { + RATE, TARGET; + } + + public static enum Modifier { + EQUILIBRIUM_TARGET("Equilibrium", ModifierType.TARGET), BIOME_HUMIDITY_RATE("Biome Humidity", + ModifierType.RATE), BIOME_TEMPERATURE_TARGET("Biome Temperature", + ModifierType.TARGET), NEARBY_BLOCKS_RATE("Nearby Blocks", + ModifierType.RATE), NEARBY_BLOCKS_TARGET("Nearby Blocks", + ModifierType.TARGET), SPRINTING_RATE("Sprinting", + ModifierType.RATE), HEALTH_RATE("Health", + ModifierType.RATE), ALTITUDE_TARGET("Altitude", + ModifierType.TARGET), ARMOR_TARGET("Armor", + ModifierType.TARGET), ARMOR_RATE("Armor", + ModifierType.RATE), SPRINTING_TARGET( + "Sprinting", + ModifierType.TARGET), TIME_TARGET( + "Time", + ModifierType.TARGET), WET_RATE( + "Wet", + ModifierType.RATE), WET_TARGET( + "Wet", + ModifierType.TARGET), SNOW_TARGET( + "Snow", + ModifierType.TARGET), CLIMATISATION_TARGET( + "Climatisation", + ModifierType.TARGET), CLIMATISATION_RATE( + "Climatisation", + ModifierType.RATE), SEASON_TARGET( + "Season", + ModifierType.TARGET); + + public final String name; + public final ModifierType modifierType; + + private Modifier(String name, ModifierType modifierType) { + this.name = name; + this.modifierType = modifierType; + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/TemperatureHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/TemperatureHandler.java new file mode 100644 index 00000000..c811437c --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/TemperatureHandler.java @@ -0,0 +1,293 @@ +package toughasnails.temperature; + +import java.util.Map; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Maps; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; +import toughasnails.api.TANCapabilities; +import toughasnails.api.TANPotions; +import toughasnails.api.config.GameplayOption; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.stat.StatHandlerBase; +import toughasnails.api.stat.capability.ITemperature; +import toughasnails.api.temperature.Temperature; +import toughasnails.api.temperature.TemperatureScale; +import toughasnails.api.temperature.TemperatureScale.TemperatureRange; +import toughasnails.network.message.MessageUpdateStat; +import toughasnails.temperature.TemperatureDebugger.Modifier; +import toughasnails.temperature.modifier.AltitudeModifier; +import toughasnails.temperature.modifier.ArmorModifier; +import toughasnails.temperature.modifier.BiomeModifier; +import toughasnails.temperature.modifier.ObjectProximityModifier; +import toughasnails.temperature.modifier.PlayerStateModifier; +import toughasnails.temperature.modifier.SeasonModifier; +import toughasnails.temperature.modifier.TemperatureModifier; +import toughasnails.temperature.modifier.TemperatureModifier.ExternalModifier; +import toughasnails.temperature.modifier.TimeModifier; +import toughasnails.temperature.modifier.WeatherModifier; + +public class TemperatureHandler extends StatHandlerBase implements ITemperature { + public static final int TEMPERATURE_SCALE_MIDPOINT = TemperatureScale.getScaleTotal() / 2; + public static final int BASE_TEMPERATURE_CHANGE_TICKS = 1200; + + private int temperatureLevel; + private int prevTemperatureLevel; + private int temperatureTimer; + + private TemperatureModifier altitudeModifier; + private TemperatureModifier armorModifier; + private TemperatureModifier biomeModifier; + private TemperatureModifier playerStateModifier; + private TemperatureModifier objectProximityModifier; + private TemperatureModifier weatherModifier; + private TemperatureModifier timeModifier; + private TemperatureModifier seasonModifier; + + private Map externalModifiers; + + public final TemperatureDebugger debugger = new TemperatureDebugger(); + + public TemperatureHandler() { + this.temperatureLevel = TemperatureScale.getScaleTotal() / 2; + this.prevTemperatureLevel = this.temperatureLevel; + + this.altitudeModifier = new AltitudeModifier(debugger); + this.armorModifier = new ArmorModifier(debugger); + this.biomeModifier = new BiomeModifier(debugger); + this.playerStateModifier = new PlayerStateModifier(debugger); + this.objectProximityModifier = new ObjectProximityModifier(debugger); + this.weatherModifier = new WeatherModifier(debugger); + this.timeModifier = new TimeModifier(debugger); + this.seasonModifier = new SeasonModifier(debugger); + + this.externalModifiers = Maps.newHashMap(); + } + + @Override + public void update(EntityPlayer player, World world, Phase phase) { + if (phase == Phase.END && !world.isRemote) { + int newTempChangeTicks = BASE_TEMPERATURE_CHANGE_TICKS; + + TemperatureTrend trend; + + if (debugger.targetTemperature == this.temperatureLevel) + trend = TemperatureTrend.STILL; + else + trend = debugger.targetTemperature > this.temperatureLevel ? TemperatureTrend.INCREASING + : TemperatureTrend.DECREASING; + + newTempChangeTicks = altitudeModifier.modifyChangeRate(world, player, newTempChangeTicks, trend); + newTempChangeTicks = armorModifier.modifyChangeRate(world, player, newTempChangeTicks, trend); + newTempChangeTicks = biomeModifier.modifyChangeRate(world, player, newTempChangeTicks, trend); + newTempChangeTicks = playerStateModifier.modifyChangeRate(world, player, newTempChangeTicks, trend); + newTempChangeTicks = objectProximityModifier.modifyChangeRate(world, player, newTempChangeTicks, trend); + newTempChangeTicks = weatherModifier.modifyChangeRate(world, player, newTempChangeTicks, trend); + newTempChangeTicks = timeModifier.modifyChangeRate(world, player, newTempChangeTicks, trend); + + java.util.Iterator iterator = this.externalModifiers.values() + .iterator(); + + debugger.start(Modifier.CLIMATISATION_RATE, newTempChangeTicks); + while (iterator.hasNext()) { + TemperatureModifier.ExternalModifier modifier = iterator.next(); + + if (this.temperatureTimer > modifier.getEndTime()) { + iterator.remove(); + } else { + if (SyncedConfig.getBooleanValue(GameplayOption.ENABLE_TEMPERATURE)) { + newTempChangeTicks += modifier.getRate(); + } + } + } + debugger.end(newTempChangeTicks); + + newTempChangeTicks = Math.max(20, newTempChangeTicks); + + boolean incrementTemperature = ++temperatureTimer >= newTempChangeTicks; + boolean updateClient = ++debugger.debugTimer % 5 == 0; + + debugger.temperatureTimer = temperatureTimer; + debugger.changeTicks = newTempChangeTicks; + + if (incrementTemperature && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_TEMPERATURE)) { + for (ExternalModifier modifier : this.externalModifiers.values()) { + modifier.setEndTime(modifier.getEndTime() - this.temperatureTimer); + } + } + + if ((incrementTemperature || updateClient) + && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_TEMPERATURE)) { + debugger.start(Modifier.EQUILIBRIUM_TARGET, 0); + debugger.end(TemperatureScale.getScaleTotal() / 2); + + Temperature targetTemperature = biomeModifier.modifyTarget(world, player, + new Temperature(TEMPERATURE_SCALE_MIDPOINT)); + targetTemperature = altitudeModifier.modifyTarget(world, player, targetTemperature); + targetTemperature = armorModifier.modifyTarget(world, player, targetTemperature); + targetTemperature = playerStateModifier.modifyTarget(world, player, targetTemperature); + targetTemperature = objectProximityModifier.modifyTarget(world, player, targetTemperature); + targetTemperature = weatherModifier.modifyTarget(world, player, targetTemperature); + targetTemperature = timeModifier.modifyTarget(world, player, targetTemperature); + targetTemperature = seasonModifier.modifyTarget(world, player, targetTemperature); + + debugger.start(Modifier.CLIMATISATION_TARGET, targetTemperature.getRawValue()); + for (TemperatureModifier.ExternalModifier modifier : this.externalModifiers.values()) { + targetTemperature = new Temperature(targetTemperature.getRawValue() + modifier.getAmount()); + } + debugger.end(targetTemperature.getRawValue()); + + debugger.targetTemperature = targetTemperature.getRawValue(); + + targetTemperature = new Temperature( + MathHelper.clamp_int(targetTemperature.getRawValue(), 0, TemperatureScale.getScaleTotal())); + + if (incrementTemperature) { + this.addTemperature(new Temperature( + (int) Math.signum(targetTemperature.getRawValue() - this.temperatureLevel))); + this.temperatureTimer = 0; + } + } + + addPotionEffects(player); + + if (updateClient) { + // This works because update is only called if !world.isRemote + debugger.finalize((EntityPlayerMP) player); + } + } + } + + private void addPotionEffects(EntityPlayer player) { + // TemperatureRange range = TemperatureScale + // .getTemperatureRange(this.temperatureLevel); + float multiplier = 1.0F; + + // The point from 0 to 1 at which potion effects begin in an extremity + // range + float extremityDelta = (3.0F / 6.0F); + + // Start the hypo/hyperthermia slightly after the real ranges start + int hypoRangeSize = (int) (TemperatureRange.ICY.getRangeSize() * extremityDelta); + int hypoRangeStart = hypoRangeSize - 1; + int hyperRangeSize = (int) (TemperatureRange.HOT.getRangeSize() * extremityDelta); + int hyperRangeStart = (TemperatureScale.getScaleTotal() + 1) - hyperRangeSize; + + // Don't apply any negative effects whilst in creative mode + if (!player.capabilities.isCreativeMode && (SyncedConfig.getBooleanValue(GameplayOption.ENABLE_TEMPERATURE))) { + if (this.temperatureLevel <= hypoRangeStart && (!player.isPotionActive(TANPotions.cold_resistance)) + && (temperatureLevel < prevTemperatureLevel || !player.isPotionActive(TANPotions.hypothermia))) { + multiplier = 1.0F - ((float) (this.temperatureLevel + 1) / (float) hypoRangeSize); + player.removePotionEffect(TANPotions.hypothermia); + player.addPotionEffect(new PotionEffect(TANPotions.hypothermia, (int) (1800 * multiplier) + 600, + (int) (3 * multiplier + extremityDelta))); + } else if (this.temperatureLevel >= hyperRangeStart && (!player.isPotionActive(TANPotions.heat_resistance)) + && (temperatureLevel > prevTemperatureLevel || !player.isPotionActive(TANPotions.hyperthermia))) { + multiplier = (float) (this.temperatureLevel - hyperRangeStart) / hyperRangeSize; + player.removePotionEffect(TANPotions.hyperthermia); + player.addPotionEffect(new PotionEffect(TANPotions.hyperthermia, (int) (1800 * multiplier) + 600, + (int) (3 * multiplier))); + } + } + } + + @Override + public boolean hasChanged() { + return this.prevTemperatureLevel != this.temperatureLevel; + } + + @Override + public void onSendClientUpdate() { + this.prevTemperatureLevel = this.temperatureLevel; + } + + @Override + public IMessage createUpdateMessage() { + NBTTagCompound data = (NBTTagCompound) TANCapabilities.TEMPERATURE.getStorage() + .writeNBT(TANCapabilities.TEMPERATURE, this, null); + return new MessageUpdateStat(TANCapabilities.TEMPERATURE, data); + } + + @Override + public void setChangeTime(int ticks) { + this.temperatureTimer = ticks; + } + + @Override + public int getChangeTime() { + return this.temperatureTimer; + } + + @Override + public void setTemperature(Temperature temperature) { + this.temperatureLevel = temperature.getRawValue(); + } + + @Override + public void addTemperature(Temperature difference) { + this.temperatureLevel = Math + .max(Math.min(TemperatureScale.getScaleTotal(), this.temperatureLevel + difference.getRawValue()), 0); + } + + @Override + public void applyModifier(String name, int amount, int rate, int duration) { + if (this.externalModifiers.containsKey(name)) { + ExternalModifier modifier = this.externalModifiers.get(name); + modifier.setEndTime(this.temperatureTimer + duration); + } else { + TemperatureModifier.ExternalModifier modifier = new TemperatureModifier.ExternalModifier(name, amount, rate, + this.temperatureTimer + duration); + this.externalModifiers.put(name, modifier); + } + } + + @Override + public boolean hasModifier(String name) { + return this.externalModifiers.containsKey(name); + } + + @Override + public ImmutableMap getExternalModifiers() { + return ImmutableMap.copyOf(this.externalModifiers); + } + + @Override + public void setExternalModifiers(Map externalModifiers) { + this.externalModifiers = externalModifiers; + } + + @Override + public Temperature getTemperature() { + return new Temperature(this.temperatureLevel); + } + + public static int getTargetTemperatureAt(World world, BlockPos position) { + final TemperatureDebugger debugger = new TemperatureDebugger(); + AltitudeModifier altitudeModifier = new AltitudeModifier(debugger); + BiomeModifier biomeModifier = new BiomeModifier(debugger); + ObjectProximityModifier objectProximityModifier = new ObjectProximityModifier(debugger); + WeatherModifier weatherModifier = new WeatherModifier(debugger); + TimeModifier timeModifier = new TimeModifier(debugger); + SeasonModifier seasonModifier = new SeasonModifier(debugger); + + Temperature baseTemperature = new Temperature(TemperatureHandler.TEMPERATURE_SCALE_MIDPOINT); + Temperature targetTemperature = biomeModifier.modifyTarget(world, position, baseTemperature); + targetTemperature = altitudeModifier.modifyTarget(world, position, targetTemperature); + targetTemperature = objectProximityModifier.modifyTarget(world, position, targetTemperature); + targetTemperature = weatherModifier.modifyTarget(world, position, targetTemperature); + targetTemperature = timeModifier.modifyTarget(world, position, targetTemperature); + targetTemperature = seasonModifier.modifyTarget(world, position, targetTemperature); + + int finalTemperature = targetTemperature.getRawValue(); + return finalTemperature; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/TemperatureStorage.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/TemperatureStorage.java new file mode 100644 index 00000000..fc1cd77b --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/TemperatureStorage.java @@ -0,0 +1,70 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.temperature; + +import java.util.Map; + +import com.google.common.collect.Maps; + +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.Capability.IStorage; +import net.minecraftforge.common.util.Constants; +import toughasnails.api.stat.capability.ITemperature; +import toughasnails.api.temperature.Temperature; +import toughasnails.temperature.modifier.TemperatureModifier.ExternalModifier; + +public class TemperatureStorage implements IStorage +{ + @Override + public NBTBase writeNBT(Capability capability, ITemperature instance, EnumFacing side) + { + NBTTagCompound compound = new NBTTagCompound(); + + compound.setInteger("temperatureLevel", instance.getTemperature().getRawValue()); + compound.setInteger("temperatureTimer", instance.getChangeTime()); + + NBTTagList externalModifierList = new NBTTagList(); + for (ExternalModifier modifier : instance.getExternalModifiers().values()) + { + externalModifierList.appendTag(modifier.serializeNBT()); + } + compound.setTag("ExternalModifiers", externalModifierList); + + return compound; + } + + @Override + public void readNBT(Capability capability, ITemperature instance, EnumFacing side, NBTBase nbt) + { + if (!(nbt instanceof NBTTagCompound)) throw new IllegalArgumentException("Temperature must be read from an NBTTagCompound!"); + + NBTTagCompound compound = (NBTTagCompound)nbt; + + if (compound.hasKey("temperatureLevel")) + { + instance.setTemperature(new Temperature(compound.getInteger("temperatureLevel"))); + instance.setChangeTime(compound.getInteger("temperatureTimer")); + + NBTTagList externalModifierTagList = compound.getTagList("ExternalModifiers", Constants.NBT.TAG_COMPOUND); + Map externalModifierList = Maps.newHashMap(); + for (int i = 0; i < externalModifierTagList.tagCount(); i++) + { + NBTTagCompound externalModifierCompound = externalModifierTagList.getCompoundTagAt(i); + ExternalModifier modifier = new ExternalModifier(); + modifier.deserializeNBT(externalModifierCompound); + externalModifierList.put(modifier.getName(), modifier); + } + instance.setExternalModifiers(externalModifierList); + } + } +} + diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/TemperatureTrend.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/TemperatureTrend.java new file mode 100644 index 00000000..62459986 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/TemperatureTrend.java @@ -0,0 +1,13 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.temperature; + +public enum TemperatureTrend +{ + STILL, INCREASING, DECREASING; +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/AltitudeModifier.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/AltitudeModifier.java new file mode 100644 index 00000000..d36a65ff --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/AltitudeModifier.java @@ -0,0 +1,55 @@ +package toughasnails.temperature.modifier; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; +import toughasnails.api.config.GameplayOption; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.temperature.Temperature; +import toughasnails.temperature.TemperatureDebugger; +import toughasnails.temperature.TemperatureDebugger.Modifier; +import toughasnails.temperature.TemperatureTrend; + +public class AltitudeModifier extends TemperatureModifier { + public final int ALTITUDE_TARGET_MODIFIER; + + public AltitudeModifier(TemperatureDebugger debugger) { + super(debugger); + this.ALTITUDE_TARGET_MODIFIER = SyncedConfig.getIntegerValue(GameplayOption.ALTITUDE_TEMP_MODIFIER); + } + + @Override + public int modifyChangeRate(World world, EntityPlayer player, int changeRate, TemperatureTrend trend) { + return changeRate; + } + + @Override + public Temperature modifyTarget(World world, EntityPlayer player, Temperature temperature) { + int temperatureLevel = temperature.getRawValue(); + int newTemperatureLevel = temperatureLevel; + + debugger.start(Modifier.ALTITUDE_TARGET, newTemperatureLevel); + + if (world.provider.isSurfaceWorld()) { + newTemperatureLevel -= MathHelper + .abs(MathHelper.floor_double(((64 - player.posY) / 64) * ALTITUDE_TARGET_MODIFIER) + 1); + } + + debugger.end(newTemperatureLevel); + + return new Temperature(newTemperatureLevel); + } + + public Temperature modifyTarget(World world, BlockPos position, Temperature temperature) { + int temperatureLevel = temperature.getRawValue(); + int newTemperatureLevel = temperatureLevel; + + if (world.provider.isSurfaceWorld()) { + newTemperatureLevel -= MathHelper + .abs(MathHelper.floor_double(((64 - position.getY()) / 64) * ALTITUDE_TARGET_MODIFIER) + 1); + } + + return new Temperature(newTemperatureLevel); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/ArmorModifier.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/ArmorModifier.java new file mode 100644 index 00000000..ed684698 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/ArmorModifier.java @@ -0,0 +1,128 @@ +package toughasnails.temperature.modifier; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.world.World; +import toughasnails.api.item.TANItems; +import toughasnails.api.temperature.Temperature; +import toughasnails.temperature.TemperatureDebugger; +import toughasnails.temperature.TemperatureDebugger.Modifier; +import toughasnails.temperature.TemperatureTrend; + +public class ArmorModifier extends TemperatureModifier { + public static final int ARMOR_RATE_MODIFIER = 25; + public static final int JELLED_SLIME_TARGET_MODIFIER = -1; + public static final int WOOL_TARGET_MODIFIER = 1; + + public ArmorModifier(TemperatureDebugger debugger) { + super(debugger); + } + + @Override + public int modifyChangeRate(World world, EntityPlayer player, + int changeRate, TemperatureTrend trend) { + int newChangeRate = changeRate; + int armorRateModifier = ARMOR_RATE_MODIFIER; + + switch (trend) { + case INCREASING: + armorRateModifier *= -1; + break; + case STILL: + armorRateModifier = 0; + break; + default: + armorRateModifier = 0; + break; + } + + debugger.start(Modifier.ARMOR_RATE, newChangeRate); + + InventoryPlayer inventory = ((EntityPlayer) player).inventory; + + // Helmet + if (inventory.armorInventory[3] != null) { + newChangeRate += armorRateModifier; + } + + // Chestplate + if (inventory.armorInventory[2] != null) { + newChangeRate += armorRateModifier; + } + + // Legging + if (inventory.armorInventory[1] != null) { + newChangeRate += armorRateModifier; + } + + // Boots + if (inventory.armorInventory[0] != null) { + newChangeRate += armorRateModifier; + } + + debugger.end(newChangeRate); + + return newChangeRate; + } + + @Override + public Temperature modifyTarget(World world, EntityPlayer player, + Temperature temperature) { + int temperatureLevel = temperature.getRawValue(); + int newTemperatureLevel = temperatureLevel; + + debugger.start(Modifier.ARMOR_TARGET, newTemperatureLevel); + + InventoryPlayer inventory = ((EntityPlayer) player).inventory; + + // Helmet + if (inventory.armorInventory[3] != null) { + if (inventory.armorInventory[3].getItem() == TANItems.wool_helmet) { + newTemperatureLevel += WOOL_TARGET_MODIFIER; + } + if (inventory.armorInventory[3] + .getItem() == TANItems.jelled_slime_helmet) { + newTemperatureLevel += JELLED_SLIME_TARGET_MODIFIER; + } + } + + // Chestplate + if (inventory.armorInventory[2] != null) { + if (inventory.armorInventory[2] + .getItem() == TANItems.wool_chestplate) { + newTemperatureLevel += WOOL_TARGET_MODIFIER; + } + if (inventory.armorInventory[2] + .getItem() == TANItems.jelled_slime_chestplate) { + newTemperatureLevel += JELLED_SLIME_TARGET_MODIFIER; + } + } + + // Leggings + if (inventory.armorInventory[1] != null) { + if (inventory.armorInventory[1] + .getItem() == TANItems.wool_leggings) { + newTemperatureLevel += WOOL_TARGET_MODIFIER; + } + if (inventory.armorInventory[1] + .getItem() == TANItems.jelled_slime_leggings) { + newTemperatureLevel += JELLED_SLIME_TARGET_MODIFIER; + } + } + + // Boots + if (inventory.armorInventory[0] != null) { + if (inventory.armorInventory[0].getItem() == TANItems.wool_boots) { + newTemperatureLevel += WOOL_TARGET_MODIFIER; + } + if (inventory.armorInventory[0] + .getItem() == TANItems.jelled_slime_boots) { + newTemperatureLevel += JELLED_SLIME_TARGET_MODIFIER; + } + } + + debugger.end(newTemperatureLevel); + + return new Temperature(newTemperatureLevel); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/BiomeModifier.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/BiomeModifier.java new file mode 100644 index 00000000..7ed8c692 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/BiomeModifier.java @@ -0,0 +1,84 @@ +package toughasnails.temperature.modifier; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import toughasnails.api.config.GameplayOption; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.temperature.Temperature; +import toughasnails.temperature.TemperatureDebugger; +import toughasnails.temperature.TemperatureDebugger.Modifier; +import toughasnails.temperature.TemperatureTrend; +import toughasnails.util.BiomeUtils; + +public class BiomeModifier extends TemperatureModifier { + public final int MAX_TEMP_OFFSET; + + public BiomeModifier(TemperatureDebugger debugger) { + super(debugger); + this.MAX_TEMP_OFFSET = SyncedConfig + .getIntegerValue(GameplayOption.BIOME_TEMP_MODIFIER); + } + + @Override + public int modifyChangeRate(World world, EntityPlayer player, + int changeRate, TemperatureTrend trend) { + Biome biome = world.getBiome(player.getPosition()); + float humidity = biome.getRainfall(); + float humidityMultiplier = 2.0F * Math.abs((humidity % 1.0F) - 0.5F); + int newChangeRate = changeRate - (int) ((10 * humidityMultiplier) * 20); + + debugger.start(Modifier.BIOME_HUMIDITY_RATE, changeRate); + debugger.end(newChangeRate); + + return newChangeRate; + } + + @Override + public Temperature modifyTarget(World world, EntityPlayer player, + Temperature temperature) { + Biome biome = world.getBiome(player.getPosition()); + Biome biomeNorth = world.getBiome(player.getPosition().add(0, 0, -10)); + Biome biomeSouth = world.getBiome(player.getPosition().add(0, 0, 10)); + Biome biomeEast = world.getBiome(player.getPosition().add(10, 0, 0)); + Biome biomeWest = world.getBiome(player.getPosition().add(-10, 0, 0)); + + float biomeTemp = ((BiomeUtils.getBiomeTempNorm(biome) + + BiomeUtils.getBiomeTempNorm(biomeNorth) + + BiomeUtils.getBiomeTempNorm(biomeSouth) + + BiomeUtils.getBiomeTempNorm(biomeEast) + + BiomeUtils.getBiomeTempNorm(biomeWest)) / 5.0F); + + // Denormalize, multiply by the max temp offset, add to the current temp + int newTemperatureLevel = temperature.getRawValue() + + (int) Math.round((biomeTemp * 2.0F - 1.0F) * MAX_TEMP_OFFSET); + + debugger.start(Modifier.BIOME_TEMPERATURE_TARGET, + temperature.getRawValue()); + debugger.end(newTemperatureLevel); + + return new Temperature(newTemperatureLevel); + } + + public Temperature modifyTarget(World world, BlockPos position, + Temperature temperature) { + Biome biome = world.getBiome(position); + Biome biomeNorth = world.getBiome(position.add(0, 0, -10)); + Biome biomeSouth = world.getBiome(position.add(0, 0, 10)); + Biome biomeEast = world.getBiome(position.add(10, 0, 0)); + Biome biomeWest = world.getBiome(position.add(-10, 0, 0)); + + float biomeTemp = ((BiomeUtils.getBiomeTempNorm(biome) + + BiomeUtils.getBiomeTempNorm(biomeNorth) + + BiomeUtils.getBiomeTempNorm(biomeSouth) + + BiomeUtils.getBiomeTempNorm(biomeEast) + + BiomeUtils.getBiomeTempNorm(biomeWest)) / 5.0F); + + // Denormalize, multiply by the max temp offset, add to the current temp + int newTemperatureLevel = temperature.getRawValue() + + (int) Math.round((biomeTemp * 2.0F - 1.0F) * MAX_TEMP_OFFSET); + + return new Temperature(newTemperatureLevel); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/ObjectProximityModifier.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/ObjectProximityModifier.java new file mode 100644 index 00000000..d8de978d --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/ObjectProximityModifier.java @@ -0,0 +1,148 @@ +package toughasnails.temperature.modifier; + +import java.util.ArrayList; + +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import toughasnails.api.temperature.Temperature; +import toughasnails.config.TANConfig; +import toughasnails.temperature.BlockTemperatureData; +import toughasnails.temperature.TemperatureDebugger; +import toughasnails.temperature.TemperatureDebugger.Modifier; +import toughasnails.temperature.TemperatureTrend; +import toughasnails.util.BlockStateUtils; + +//TODO: Replace this with something better +public class ObjectProximityModifier extends TemperatureModifier { + public ObjectProximityModifier(TemperatureDebugger debugger) { + super(debugger); + } + + @Override + public int modifyChangeRate(World world, EntityPlayer player, + int changeRate, TemperatureTrend trend) { + int newChangeRate = changeRate; + BlockPos playerPos = player.getPosition(); + + int tempSourceBlocks = 0; + + // System.out.println(new Calendar(world).getSubSeason()); + + for (int x = -3; x <= 3; x++) { + for (int y = -2; y <= 2; y++) { + for (int z = -3; z <= 3; z++) { + BlockPos pos = playerPos.add(x, y - 1, z); + IBlockState state = world.getBlockState(pos); + + if (getBlockTemperature(state) != 0.0F) + tempSourceBlocks++; + } + } + } + + debugger.start(Modifier.NEARBY_BLOCKS_RATE, newChangeRate); + newChangeRate -= tempSourceBlocks * 20; + debugger.end(newChangeRate); + + return newChangeRate; + } + + @Override + public Temperature modifyTarget(World world, EntityPlayer player, + Temperature temperature) { + int temperatureLevel = temperature.getRawValue(); + int newTemperatureLevel = temperatureLevel; + BlockPos playerPos = player.getPosition(); + + float blockTemperatureModifier = 0.0F; + + for (int x = -3; x <= 3; x++) { + for (int y = -2; y <= 2; y++) { + for (int z = -3; z <= 3; z++) { + BlockPos pos = playerPos.add(x, y - 1, z); + IBlockState state = world.getBlockState(pos); + + blockTemperatureModifier += getBlockTemperature(state); + } + } + } + + debugger.start(Modifier.NEARBY_BLOCKS_TARGET, newTemperatureLevel); + newTemperatureLevel += blockTemperatureModifier; + debugger.end(newTemperatureLevel); + + return new Temperature(newTemperatureLevel); + } + + public static float getBlockTemperature(IBlockState state) { + Material material = state.getMaterial(); + + // NPE guard + if (state.getBlock().getRegistryName() == null) { + return 0.0F; + } + String blockName = state.getBlock().getRegistryName().toString(); + + // Blocks + if (TANConfig.blockTemperatureData.containsKey(blockName)) { + ArrayList blockTempData = TANConfig.blockTemperatureData + .get(blockName); + + // Check if block has relevant state: + for (BlockTemperatureData tempData : blockTempData) { + boolean bAllSpecifiedPropertiesMatch = true; + for (String comparisonProperty : tempData.useProperties) { + IProperty targetProperty = BlockStateUtils + .getPropertyByName(state, comparisonProperty); + + if (!(state.getValue(targetProperty) == tempData.state + .getValue(targetProperty))) { + bAllSpecifiedPropertiesMatch = false; + } + } + + if (bAllSpecifiedPropertiesMatch) { + return tempData.blockTemperature; + } + } + + // If no matching states, then block is at ambient temperature: + return 0.0F; + } + + // Handle materials, but only if we didn't already find an actual block + // to use: + if (material == Material.FIRE) { + return TANConfig.materialTemperatureData.fire; + } + + return 0.0F; + } + + public Temperature modifyTarget(World world, BlockPos position, + Temperature temperature) { + int temperatureLevel = temperature.getRawValue(); + int newTemperatureLevel = temperatureLevel; + + float blockTemperatureModifier = 0.0F; + + for (int x = -3; x <= 3; x++) { + for (int y = -2; y <= 2; y++) { + for (int z = -3; z <= 3; z++) { + BlockPos pos = position.add(x, y - 1, z); + IBlockState state = world.getBlockState(pos); + + blockTemperatureModifier += getBlockTemperature(state); + } + } + } + + newTemperatureLevel += blockTemperatureModifier; + + return new Temperature(newTemperatureLevel); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/PlayerStateModifier.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/PlayerStateModifier.java new file mode 100644 index 00000000..07509419 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/PlayerStateModifier.java @@ -0,0 +1,69 @@ +package toughasnails.temperature.modifier; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import toughasnails.api.temperature.Temperature; +import toughasnails.temperature.TemperatureDebugger; +import toughasnails.temperature.TemperatureDebugger.Modifier; +import toughasnails.temperature.TemperatureTrend; + +public class PlayerStateModifier extends TemperatureModifier { + public static final int SPRINTING_RATE_MODIFIER = 200; + public static final int SPRINTING_TARGET_MODIFIER = 3; + + public PlayerStateModifier(TemperatureDebugger debugger) { + super(debugger); + } + + @Override + public int modifyChangeRate(World world, EntityPlayer player, + int changeRate, TemperatureTrend trend) { + int newChangeRate = changeRate; + int sprintingRateModifier = SPRINTING_RATE_MODIFIER; + + switch (trend) { + case INCREASING: + sprintingRateModifier *= -1; + break; + case STILL: + sprintingRateModifier = 0; + break; + default: + sprintingRateModifier = 0; + break; + } + + debugger.start(Modifier.SPRINTING_RATE, newChangeRate); + + if (player.isSprinting()) { + newChangeRate += sprintingRateModifier; + } + + debugger.end(newChangeRate); + debugger.start(Modifier.HEALTH_RATE, newChangeRate); + + newChangeRate -= (1.0 - (player.getHealth() / player.getMaxHealth())) + * 200; + + debugger.end(newChangeRate); + + return newChangeRate; + } + + @Override + public Temperature modifyTarget(World world, EntityPlayer player, + Temperature temperature) { + int temperatureLevel = temperature.getRawValue(); + int newTemperatureLevel = temperatureLevel; + + debugger.start(Modifier.SPRINTING_TARGET, newTemperatureLevel); + + if (player.isSprinting()) { + newTemperatureLevel += SPRINTING_TARGET_MODIFIER; + } + + debugger.end(newTemperatureLevel); + + return new Temperature(newTemperatureLevel); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/SeasonModifier.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/SeasonModifier.java new file mode 100644 index 00000000..5d998ea8 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/SeasonModifier.java @@ -0,0 +1,187 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.temperature.modifier; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.season.Season.SubSeason; +import toughasnails.api.season.SeasonHelper; +import toughasnails.api.temperature.Temperature; +import toughasnails.api.config.GameplayOption; +import toughasnails.temperature.TemperatureDebugger; +import toughasnails.temperature.TemperatureDebugger.Modifier; +import toughasnails.temperature.TemperatureTrend; + +public class SeasonModifier extends TemperatureModifier { + + public final int EARLY_AUTUMN_MODIFIER; + public final int MID_AUTUMN_MODIFIER; + public final int LATE_AUTUMN_MODIFIER; + public final int EARLY_WINTER_MODIFIER; + public final int MID_WINTER_MODIFIER; + public final int LATE_WINTER_MODIFIER; + public final int EARLY_SPRING_MODIFIER; + public final int MID_SPRING_MODIFIER; + public final int LATE_SPRING_MODIFIER; + public final int EARLY_SUMMER_MODIFIER; + public final int MID_SUMMER_MODIFIER; + public final int LATE_SUMMER_MODIFIER; + + public SeasonModifier(TemperatureDebugger debugger) { + super(debugger); + this.EARLY_AUTUMN_MODIFIER = SyncedConfig + .getIntegerValue(GameplayOption.EARLY_AUTUMN_MODIFIER); + this.MID_AUTUMN_MODIFIER = SyncedConfig + .getIntegerValue(GameplayOption.MID_AUTUMN_MODIFIER); + this.LATE_AUTUMN_MODIFIER = SyncedConfig + .getIntegerValue(GameplayOption.LATE_AUTUMN_MODIFIER); + + this.EARLY_WINTER_MODIFIER = SyncedConfig + .getIntegerValue(GameplayOption.EARLY_WINTER_MODIFIER); + this.MID_WINTER_MODIFIER = SyncedConfig + .getIntegerValue(GameplayOption.MID_WINTER_MODIFIER); + this.LATE_WINTER_MODIFIER = SyncedConfig + .getIntegerValue(GameplayOption.LATE_WINTER_MODIFIER); + + this.EARLY_SPRING_MODIFIER = SyncedConfig + .getIntegerValue(GameplayOption.EARLY_SPRING_MODIFIER); + this.MID_SPRING_MODIFIER = SyncedConfig + .getIntegerValue(GameplayOption.MID_SPRING_MODIFIER); + this.LATE_SPRING_MODIFIER = SyncedConfig + .getIntegerValue(GameplayOption.LATE_SPRING_MODIFIER); + + this.EARLY_SUMMER_MODIFIER = SyncedConfig + .getIntegerValue(GameplayOption.EARLY_SUMMER_MODIFIER); + this.MID_SUMMER_MODIFIER = SyncedConfig + .getIntegerValue(GameplayOption.MID_SUMMER_MODIFIER); + this.LATE_SUMMER_MODIFIER = SyncedConfig + .getIntegerValue(GameplayOption.LATE_SUMMER_MODIFIER); + } + + @Override + public int modifyChangeRate(World world, EntityPlayer player, + int changeRate, TemperatureTrend trend) { + return changeRate; + } + + @Override + public Temperature modifyTarget(World world, EntityPlayer player, + Temperature temperature) { + int temperatureLevel = temperature.getRawValue(); + SubSeason season = SeasonHelper.getSeasonData(world).getSubSeason(); + + if (!(SyncedConfig.getBooleanValue(GameplayOption.ENABLE_SEASONS))) { + season = SubSeason.MID_SUMMER; + } + + debugger.start(Modifier.SEASON_TARGET, temperatureLevel); + + if (world.provider.isSurfaceWorld()) { + switch (season) { + case EARLY_AUTUMN: + temperatureLevel += this.EARLY_AUTUMN_MODIFIER; + break; + case MID_AUTUMN: + temperatureLevel += this.MID_AUTUMN_MODIFIER; + break; + case LATE_AUTUMN: + temperatureLevel += this.LATE_AUTUMN_MODIFIER; + break; + case EARLY_WINTER: + temperatureLevel += this.EARLY_WINTER_MODIFIER; + break; + case MID_WINTER: + temperatureLevel += this.MID_WINTER_MODIFIER; + break; + case LATE_WINTER: + temperatureLevel += this.LATE_WINTER_MODIFIER; + break; + case EARLY_SPRING: + temperatureLevel += this.EARLY_SPRING_MODIFIER; + break; + case MID_SPRING: + temperatureLevel += this.MID_SPRING_MODIFIER; + break; + case LATE_SPRING: + temperatureLevel += this.LATE_SPRING_MODIFIER; + break; + case EARLY_SUMMER: + temperatureLevel += this.EARLY_SUMMER_MODIFIER; + break; + case MID_SUMMER: + temperatureLevel += this.MID_SUMMER_MODIFIER; + break; + case LATE_SUMMER: + temperatureLevel += this.LATE_SUMMER_MODIFIER; + break; + default: + break; + } + } + debugger.end(temperatureLevel); + + return new Temperature(temperatureLevel); + } + + public Temperature modifyTarget(World world, BlockPos position, + Temperature temperature) { + int temperatureLevel = temperature.getRawValue(); + SubSeason season = SeasonHelper.getSeasonData(world).getSubSeason(); + + if (!(SyncedConfig.getBooleanValue(GameplayOption.ENABLE_SEASONS))) { + season = SubSeason.MID_SUMMER; + } + + if (world.provider.isSurfaceWorld()) { + switch (season) { + case EARLY_AUTUMN: + temperatureLevel += this.EARLY_AUTUMN_MODIFIER; + break; + case MID_AUTUMN: + temperatureLevel += this.MID_AUTUMN_MODIFIER; + break; + case LATE_AUTUMN: + temperatureLevel += this.LATE_AUTUMN_MODIFIER; + break; + case EARLY_WINTER: + temperatureLevel += this.EARLY_WINTER_MODIFIER; + break; + case MID_WINTER: + temperatureLevel += this.MID_WINTER_MODIFIER; + break; + case LATE_WINTER: + temperatureLevel += this.LATE_WINTER_MODIFIER; + break; + case EARLY_SPRING: + temperatureLevel += this.EARLY_SPRING_MODIFIER; + break; + case MID_SPRING: + temperatureLevel += this.MID_SPRING_MODIFIER; + break; + case LATE_SPRING: + temperatureLevel += this.LATE_SPRING_MODIFIER; + break; + case EARLY_SUMMER: + temperatureLevel += this.EARLY_SUMMER_MODIFIER; + break; + case MID_SUMMER: + temperatureLevel += this.MID_SUMMER_MODIFIER; + break; + case LATE_SUMMER: + temperatureLevel += this.LATE_SUMMER_MODIFIER; + break; + default: + break; + } + } + + return new Temperature(temperatureLevel); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/TemperatureModifier.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/TemperatureModifier.java new file mode 100644 index 00000000..ab43a732 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/TemperatureModifier.java @@ -0,0 +1,87 @@ +package toughasnails.temperature.modifier; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.util.INBTSerializable; +import toughasnails.api.temperature.Temperature; +import toughasnails.temperature.TemperatureDebugger; +import toughasnails.temperature.TemperatureTrend; + +public abstract class TemperatureModifier +{ + protected final TemperatureDebugger debugger; + + protected TemperatureModifier(TemperatureDebugger debugger) + { + this.debugger = debugger; + } + + public abstract int modifyChangeRate(World world, EntityPlayer player, int changeRate, TemperatureTrend trend); + public abstract Temperature modifyTarget(World world, EntityPlayer player, Temperature temperature); + + public static class ExternalModifier implements INBTSerializable + { + private String name; + private int amount; + private int rate; + private int endTime; + + public ExternalModifier() {} + + public ExternalModifier(String name, int amount, int rate, int endTime) + { + this.name = name; + this.amount = amount; + this.rate = rate; + this.endTime = endTime; + } + + public String getName() + { + return this.name; + } + + public int getAmount() + { + return this.amount; + } + + public int getRate() + { + return this.rate; + } + + public int getEndTime() + { + return this.endTime; + } + + public void setEndTime(int time) + { + this.endTime = time; + } + + @Override + public NBTTagCompound serializeNBT() + { + NBTTagCompound compound = new NBTTagCompound(); + + compound.setString("Name", this.name); + compound.setInteger("Amount", this.amount); + compound.setInteger("Rate", this.rate); + compound.setInteger("EndTime", this.endTime); + + return compound; + } + + @Override + public void deserializeNBT(NBTTagCompound nbt) + { + this.name = nbt.getString("Name"); + this.amount = nbt.getInteger("Amount"); + this.rate = nbt.getInteger("Rate"); + this.endTime = nbt.getInteger("EndTime"); + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/TimeModifier.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/TimeModifier.java new file mode 100644 index 00000000..2572f697 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/TimeModifier.java @@ -0,0 +1,86 @@ +package toughasnails.temperature.modifier; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import toughasnails.api.config.GameplayOption; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.temperature.Temperature; +import toughasnails.temperature.TemperatureDebugger; +import toughasnails.temperature.TemperatureDebugger.Modifier; +import toughasnails.temperature.TemperatureTrend; +import toughasnails.util.BiomeUtils; + +public class TimeModifier extends TemperatureModifier { + public final int TIME_TARGET_MODIFIER; + + /** + * Multiplies how much should the temperature be increased/decreased by the + * closer the biome temp is to a extreme hot or cold + */ + public final float EXTREMITY_MULTIPLIER; + + public TimeModifier(TemperatureDebugger debugger) { + super(debugger); + this.TIME_TARGET_MODIFIER = SyncedConfig + .getIntegerValue(GameplayOption.TIME_TEMP_MODIFIER); + this.EXTREMITY_MULTIPLIER = SyncedConfig + .getFloatValue(GameplayOption.TIME_EXTREMITY_MODIFIER); + } + + @Override + public int modifyChangeRate(World world, EntityPlayer player, + int changeRate, TemperatureTrend trend) { + return changeRate; + } + + @Override + public Temperature modifyTarget(World world, EntityPlayer player, + Temperature temperature) { + Biome biome = world.getBiome(player.getPosition()); + long worldTime = world.getWorldTime(); + + float extremityModifier = BiomeUtils.getBiomeTempExtremity(biome); + // Reaches the highest point during the middle of the day and at + // midnight. Normalized to be between -1 and 1 + float timeNorm = (-Math.abs(((worldTime + 6000) % 24000.0F) - 12000.0F) + + 6000.0F) / 6000.0F; + + int temperatureLevel = temperature.getRawValue(); + int newTemperatureLevel = temperatureLevel; + + debugger.start(Modifier.TIME_TARGET, newTemperatureLevel); + + if (world.provider.isSurfaceWorld()) { + newTemperatureLevel += TIME_TARGET_MODIFIER * timeNorm * (Math + .max(1.0F, extremityModifier * EXTREMITY_MULTIPLIER)); + } + + debugger.end(newTemperatureLevel); + + return new Temperature(newTemperatureLevel); + } + + public Temperature modifyTarget(World world, BlockPos position, + Temperature temperature) { + Biome biome = world.getBiome(position); + long worldTime = world.getWorldTime(); + + float extremityModifier = BiomeUtils.getBiomeTempExtremity(biome); + // Reaches the highest point during the middle of the day and at + // midnight. Normalized to be between -1 and 1 + float timeNorm = (-Math.abs(((worldTime + 6000) % 24000.0F) - 12000.0F) + + 6000.0F) / 6000.0F; + + int temperatureLevel = temperature.getRawValue(); + int newTemperatureLevel = temperatureLevel; + + if (world.provider.isSurfaceWorld()) { + newTemperatureLevel += TIME_TARGET_MODIFIER * timeNorm * (Math + .max(1.0F, extremityModifier * EXTREMITY_MULTIPLIER)); + } + + return new Temperature(newTemperatureLevel); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/WeatherModifier.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/WeatherModifier.java new file mode 100644 index 00000000..3d78c1d0 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/temperature/modifier/WeatherModifier.java @@ -0,0 +1,83 @@ +package toughasnails.temperature.modifier; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import toughasnails.api.config.GameplayOption; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.temperature.Temperature; +import toughasnails.temperature.TemperatureDebugger; +import toughasnails.temperature.TemperatureDebugger.Modifier; +import toughasnails.temperature.TemperatureTrend; + +public class WeatherModifier extends TemperatureModifier { + public static final int WET_RATE_MODIFIER = -750; + public final int WET_TARGET_MODIFIER; + public final int SNOW_TARGET_MODIFIER; + + public WeatherModifier(TemperatureDebugger debugger) { + super(debugger); + this.WET_TARGET_MODIFIER = SyncedConfig + .getIntegerValue(GameplayOption.WET_TEMP_MODIFIER); + this.SNOW_TARGET_MODIFIER = SyncedConfig + .getIntegerValue(GameplayOption.SNOW_TEMP_MODIFIER); + } + + @Override + public int modifyChangeRate(World world, EntityPlayer player, + int changeRate, TemperatureTrend trend) { + int newChangeRate = changeRate; + + debugger.start(Modifier.WET_RATE, changeRate); + + if (player.isWet()) { + newChangeRate += WET_RATE_MODIFIER; + } + + debugger.end(newChangeRate); + + return newChangeRate; + } + + @Override + public Temperature modifyTarget(World world, EntityPlayer player, + Temperature temperature) { + int temperatureLevel = temperature.getRawValue(); + int newTemperatureLevel = temperatureLevel; + + BlockPos playerPos = player.getPosition(); + + if (player.isWet()) { + debugger.start(Modifier.WET_TARGET, newTemperatureLevel); + newTemperatureLevel += WET_TARGET_MODIFIER; + debugger.end(newTemperatureLevel); + } else if (world.isRaining() && world.canSeeSky(playerPos) + && world.getBiome(playerPos).getEnableSnow()) { + debugger.start(Modifier.SNOW_TARGET, newTemperatureLevel); + newTemperatureLevel += SNOW_TARGET_MODIFIER; + debugger.end(newTemperatureLevel); + } + + return new Temperature(newTemperatureLevel); + } + + public Temperature modifyTarget(World world, BlockPos position, + Temperature temperature) { + int temperatureLevel = temperature.getRawValue(); + int newTemperatureLevel = temperatureLevel; + boolean rainChill = SyncedConfig + .getBooleanValue(GameplayOption.RAIN_CHILL); + + if (world.isRaining() && world.canSeeSky(position)) { + Biome biome = world.getBiome(position); + if (biome.getEnableSnow()) { + newTemperatureLevel += SNOW_TARGET_MODIFIER; + } else if (biome.canRain() && rainChill) { + newTemperatureLevel += WET_TARGET_MODIFIER; + } + } + + return new Temperature(newTemperatureLevel); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/thirst/ThirstHandler.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/thirst/ThirstHandler.java new file mode 100644 index 00000000..5bfb6842 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/thirst/ThirstHandler.java @@ -0,0 +1,215 @@ +package toughasnails.thirst; + +import javax.vecmath.Vector3d; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.TANCapabilities; +import toughasnails.api.stat.StatHandlerBase; +import toughasnails.api.stat.capability.IThirst; +import toughasnails.api.config.GameplayOption; +import toughasnails.network.message.MessageUpdateStat; + +public class ThirstHandler extends StatHandlerBase implements IThirst +{ + private int thirstLevel; + private int prevThirstLevel; + private float thirstHydrationLevel; + private float thirstExhaustionLevel; + + /**Used to time the seconds passed since thirst damage was last dealt to the player*/ + private int thirstTimer; + + private Vector3d movementVec; + + public ThirstHandler() + { + this.thirstLevel = 20; + this.thirstHydrationLevel = 5.0F; + } + + @Override + public void update(EntityPlayer player, World world, Phase phase) + { + if (SyncedConfig.getBooleanValue(GameplayOption.ENABLE_THIRST)) + { + if (phase == Phase.START) + { + if (movementVec != null) + { + Vector3d movement = new Vector3d(player.posX, player.posY, player.posZ); + movement.sub(movementVec); movement.absolute(); + int distance = (int)Math.round(movement.length() * 100.0F); + + if (distance > 0) applyMovementExhaustion(player, distance); + } + } + else if (phase == Phase.END) + { + this.movementVec = new Vector3d(player.posX, player.posY, player.posZ); + + EnumDifficulty enumdifficulty = world.getDifficulty(); + + if (this.thirstExhaustionLevel > 4.0F) + { + this.thirstExhaustionLevel -= 4.0F; + + if (this.thirstHydrationLevel > 0.0F) + { + this.thirstHydrationLevel = Math.max(this.thirstHydrationLevel - 1.0F, 0.0F); + } + else if (enumdifficulty != EnumDifficulty.PEACEFUL) + { + this.thirstLevel = Math.max(this.thirstLevel - 1, 0); + } + } + + if (this.thirstLevel <= 0) + { + ++this.thirstTimer; + + //Inflict thirst damage every 4 seconds + if (this.thirstTimer >= 80) + { + if (player.getHealth() > 10.0F || enumdifficulty == EnumDifficulty.HARD || player.getHealth() > 1.0F && enumdifficulty == EnumDifficulty.NORMAL) + { + player.attackEntityFrom(DamageSource.starve, 1.0F); + } + + this.thirstTimer = 0; + } + } + else + { + this.thirstTimer = 0; + } + + //If thirst is too low, prevent the player from sprinting + if (!player.capabilities.isCreativeMode && player.isSprinting() && thirstLevel <= 6) + { + player.setSprinting(false); + } + } + } + } + + private void applyMovementExhaustion(EntityPlayer player, int distance) + { + if (player.isInsideOfMaterial(Material.WATER)) + { + this.addExhaustion(0.015F * (float)distance * 0.01F); + } + else if (player.isInWater()) + { + this.addExhaustion(0.015F * (float)distance * 0.01F); + } + else if (player.onGround) + { + if (player.isSprinting()) + { + this.addExhaustion(0.099999994F * (float)distance * 0.01F); + } + else + { + this.addExhaustion(0.01F * (float)distance * 0.01F); + } + } + } + + @Override + public boolean hasChanged() + { + return this.prevThirstLevel != this.thirstLevel; + } + + @Override + public void onSendClientUpdate() + { + this.prevThirstLevel = this.thirstLevel; + } + + @Override + public IMessage createUpdateMessage() + { + NBTTagCompound data = (NBTTagCompound)TANCapabilities.THIRST.getStorage().writeNBT(TANCapabilities.THIRST, this, null); + return new MessageUpdateStat(TANCapabilities.THIRST, data); + } + + @Override + public void setThirst(int thirst) + { + this.thirstLevel = thirst; + } + + @Override + public void setHydration(float hydration) + { + this.thirstHydrationLevel = hydration; + } + + @Override + public void setExhaustion(float exhaustion) + { + this.thirstExhaustionLevel = exhaustion; + } + + @Override + public int getThirst() + { + return this.thirstLevel; + } + + @Override + public float getHydration() + { + return this.thirstHydrationLevel; + } + + @Override + public float getExhaustion() + { + return this.thirstExhaustionLevel; + } + + @Override + public void setChangeTime(int ticks) + { + this.thirstTimer = ticks; + } + + @Override + public int getChangeTime() + { + return this.thirstTimer; + } + + @Override + public void addStats(int thirst, float hydration) + { + if (SyncedConfig.getBooleanValue(GameplayOption.ENABLE_THIRST)) + { + this.thirstLevel = Math.min(thirst + this.thirstLevel, 20); + this.thirstHydrationLevel = Math.min(this.thirstHydrationLevel + (float)thirst * hydration * 2.0F, (float)this.thirstLevel); + } + } + + public void addExhaustion(float amount) + { + if (SyncedConfig.getBooleanValue(GameplayOption.ENABLE_THIRST)) + { + this.thirstExhaustionLevel = Math.min(this.thirstExhaustionLevel + amount, 40.0F); + } + } + + public boolean isThirsty() + { + return this.thirstLevel < 20; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/thirst/ThirstStorage.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/thirst/ThirstStorage.java new file mode 100644 index 00000000..a51585e6 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/thirst/ThirstStorage.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.thirst; + +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.Capability.IStorage; +import toughasnails.api.stat.capability.IThirst; + +public class ThirstStorage implements IStorage +{ + @Override + public NBTBase writeNBT(Capability capability, IThirst instance, EnumFacing side) + { + NBTTagCompound compound = new NBTTagCompound(); + + compound.setInteger("thirstLevel", instance.getThirst()); + compound.setInteger("thirstTimer", instance.getChangeTime()); + compound.setFloat("thirstHydrationLevel", instance.getHydration()); + compound.setFloat("thirstExhaustionLevel", instance.getExhaustion()); + + return compound; + } + + @Override + public void readNBT(Capability capability, IThirst instance, EnumFacing side, NBTBase nbt) + { + if (!(nbt instanceof NBTTagCompound)) throw new IllegalArgumentException("Thirst must be read from an NBTTagCompound!"); + + NBTTagCompound compound = (NBTTagCompound)nbt; + + if (compound.hasKey("thirstLevel")) + { + instance.setThirst(compound.getInteger("thirstLevel")); + instance.setHydration(compound.getInteger("thirstHydrationLevel")); + instance.setExhaustion(compound.getInteger("thirstExhaustionLevel")); + instance.setChangeTime(compound.getInteger("thirstTimer")); + } + + } +} + diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/tileentity/TileEntitySeasonSensor.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/tileentity/TileEntitySeasonSensor.java new file mode 100644 index 00000000..325e1d9a --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/tileentity/TileEntitySeasonSensor.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.tileentity; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ITickable; +import toughasnails.api.season.SeasonHelper; +import toughasnails.block.BlockSeasonSensor; + +public class TileEntitySeasonSensor extends TileEntity implements ITickable { + @Override + public void update() { + if (this.worldObj != null && !this.worldObj.isRemote + && SeasonHelper.getSeasonData(this.worldObj).getSeasonCycleTicks() % 20L == 0L) { + ((BlockSeasonSensor) this.getBlockType()).updatePower(this.worldObj, this.pos); + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/tileentity/TileEntityTemperatureSpread.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/tileentity/TileEntityTemperatureSpread.java new file mode 100644 index 00000000..959385f3 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/tileentity/TileEntityTemperatureSpread.java @@ -0,0 +1,379 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.tileentity; + +import java.util.Set; + +import com.google.common.base.Predicate; +import com.google.common.collect.Sets; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ITickable; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import toughasnails.api.TANCapabilities; +import toughasnails.api.season.IDecayableCrop; +import toughasnails.api.stat.capability.ITemperature; +import toughasnails.api.temperature.ITemperatureRegulator; +import toughasnails.api.temperature.Temperature; + +public class TileEntityTemperatureSpread extends TileEntity implements ITickable, ITemperatureRegulator { + public static final int MAX_SPREAD_DISTANCE = 50; + public static final int RATE_MODIFIER = -500; + public static final boolean ENABLE_DEBUG = false; + + private Set spawnedEntities; + + private Set[] filledPositions; + private Set obstructedPositions; + + private int updateTicks; + private int temperatureModifier; + + private AxisAlignedBB maxSpreadBox; + + @SuppressWarnings("unchecked") + public TileEntityTemperatureSpread() { + // Initialize sets for all strengths + this.filledPositions = new Set[MAX_SPREAD_DISTANCE + 1]; + for (int i = 0; i < MAX_SPREAD_DISTANCE + 1; i++) { + this.filledPositions[i] = Sets.newConcurrentHashSet(); + } + this.obstructedPositions = Sets.newConcurrentHashSet(); + + if (ENABLE_DEBUG) + this.spawnedEntities = Sets.newHashSet(); + } + + public TileEntityTemperatureSpread(int temperatureModifier) { + this(); + + this.temperatureModifier = temperatureModifier; + } + + // TODO: Stagger updates if necessary, so verification occurs slower away + // from the base position + // Doesn't really seem necessary at the moment, it appears to be fast enough + @Override + public void update() { + World world = this.getWorld(); + + // Verify every second + if (++updateTicks % 20 == 0) { + // Ensure there has been no changes since last time + if (!verify()) { + // Refill again + fill(); + } + + // When first placed, this may be null because it hasn't been + // created when read from NBT + if (this.maxSpreadBox == null) { + this.maxSpreadBox = new AxisAlignedBB(this.pos.getX() - MAX_SPREAD_DISTANCE, + this.pos.getY() - MAX_SPREAD_DISTANCE, this.pos.getZ() - MAX_SPREAD_DISTANCE, + this.pos.getX() + MAX_SPREAD_DISTANCE, this.pos.getY() + MAX_SPREAD_DISTANCE, + this.pos.getZ() + MAX_SPREAD_DISTANCE); + } + + // Iterate over all nearby players + for (EntityPlayer player : world.getEntitiesWithinAABB(EntityPlayer.class, this.maxSpreadBox)) { + BlockPos delta = player.getPosition().subtract(this.getPos()); + int distance = Math.abs(delta.getX()) + Math.abs(delta.getY()) + Math.abs(delta.getZ()); + boolean collided = false; + + // Check if the player collides with any of the filled + // positions. + // Player must be in a strength equal to or less than the + // distance they are away from the coil + outer: for (int i = MAX_SPREAD_DISTANCE - distance; i >= 0; i--) { + for (BlockPos pos : this.filledPositions[i]) { + // If a collision is found, stop looking + if (player.getEntityBoundingBox().intersects(pos.getX(), pos.getY(), pos.getZ(), + pos.getX() + 1D, pos.getY() + 1D, pos.getZ() + 1D)) { + collided = true; + break outer; + } + } + } + + // Apply temperature modifier if collided + if (collided) { + ITemperature temperature = player.getCapability(TANCapabilities.TEMPERATURE, null); + + // Apply modifier for 5 seconds + temperature.applyModifier("Climatisation", this.temperatureModifier, RATE_MODIFIER, 5 * 20); + } + } + + if (ENABLE_DEBUG) { + // There is a mismatch between the filled positions and the + // spawned entities, repopulate spawned entities + // If this is active, there should at least be a position in the + // set for the max spread distance + if (!world.isRemote && spawnedEntities.isEmpty() + && !this.filledPositions[MAX_SPREAD_DISTANCE].isEmpty()) { + for (int strength = 0; strength <= MAX_SPREAD_DISTANCE; strength++) { + for (BlockPos pos : this.filledPositions[strength]) { + final AxisAlignedBB boundingBox = new AxisAlignedBB(pos.getX(), pos.getY(), pos.getZ(), + pos.getX() + 1.0D, pos.getY() + 1.0D, pos.getZ() + 1.0D); + + Predicate predicate = new Predicate() { + @Override + public boolean apply(EntitySmallFireball input) { + // Check intersections with this entity a + // little bit over 1x1x1, because it seemed + // the outer layer of fireballs wasn't + // included otherwise + BlockPos pos = input.getPosition(); + return boundingBox.intersects(pos.getX() - 0.1D, pos.getY() - 0.1D, + pos.getZ() - 0.1D, pos.getX() + 1.1D, pos.getY() + 1.1D, pos.getZ() + 1.1D); + } + }; + + // Fireballs don't have a bounding box so we can't + // use getEntitiesWithinAABB (which really stinks!) + spawnedEntities.addAll(this.getWorld().getEntities(EntitySmallFireball.class, predicate)); + } + } + } + } + } + } + + public void reset() { + if (ENABLE_DEBUG) { + for (Entity entity : this.spawnedEntities) { + entity.setDead(); + } + this.spawnedEntities.clear(); + } + + // Clear set of current positions + for (Set set : this.filledPositions) { + set.clear(); + } + this.obstructedPositions.clear(); + } + + public void fill() { + reset(); + + // Add blocks around the temperature modifier block to the queue + for (EnumFacing facing : EnumFacing.values()) { + BlockPos offsetPos = pos.offset(facing); + + // Only attempt to update tracking for this position if there is air + // here. + // Even positions already being tracked should be filled with air. + if (this.canFill(offsetPos)) + this.filledPositions[MAX_SPREAD_DISTANCE].add(offsetPos); + } + + runStage(MAX_SPREAD_DISTANCE - 1); + + if (ENABLE_DEBUG) { + for (Set trackedPositions : this.filledPositions) { + for (BlockPos trackedPosition : trackedPositions) { + if (trackedPosition != null) { + BlockPos pos = trackedPosition; + EntitySmallFireball fireball = new EntitySmallFireball(getWorld(), (double) pos.getX() + 0.5D, + (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, 0.0D, 0.0D, 0.0D); + this.spawnedEntities.add(fireball); + this.getWorld().spawnEntityInWorld(fireball); + } + } + } + } + } + + private void runStage(int strength) { + // Don't spread if strength is 0 (or somehow less) + if (strength > 0) { + // Populate queue for next stage + for (BlockPos trackedPosition : this.filledPositions[strength + 1]) { + BlockPos pos = trackedPosition; + spreadAroundPos(pos, strength); + } + + // Next stage should have less strength than this + runStage(strength - 1); + } + } + + /** + * Begins tracking this position or updates its strength. Returns true if + * changed from before + **/ + private void setTrackedStrength(BlockPos pos, int strength) { + // Only attempt to update tracking for this position if there is air + // here. + // Even positions already being tracked should be filled with air. + if (this.canFill(pos)) { + this.filledPositions[strength].add(pos); + } else { + this.obstructedPositions.add(pos); + } + } + + /** + * Strength is the strength of the initial pos, not what it will spread to + * its surroundings + */ + private void spreadAroundPos(BlockPos pos, int strength) { + for (EnumFacing facing : EnumFacing.values()) { + BlockPos offsetPos = pos.offset(facing); + + // Don't set if the tracked positions already contains this position + if (this.filledPositions[strength + 1].contains(offsetPos)) { + continue; + } + + // Set suitable adjacent positions as tracked + setTrackedStrength(offsetPos, strength); + } + } + + /** Returns true if verified, false if regen is required */ + public boolean verify() { + for (Set trackedPositions : this.filledPositions) { + for (BlockPos pos : trackedPositions) { + if (!this.canFill(pos)) + return false; + } + } + + for (BlockPos pos : this.obstructedPositions) { + if (this.canFill(pos)) + return false; + } + + return true; + } + + private boolean canFill(BlockPos pos) { + // Only spread within enclosed areas, significantly reduces the impact + // on performance and suits the purpose of coils + return !this.getWorld().isBlockFullCube(pos) && (!this.getWorld().canSeeSky(pos) + || this.getWorld().getBlockState(pos).getBlock() instanceof IDecayableCrop); + } + + @Override + public void readFromNBT(NBTTagCompound compound) { + super.readFromNBT(compound); + + // After pos has been read + this.maxSpreadBox = new AxisAlignedBB(this.pos.getX() - MAX_SPREAD_DISTANCE, + this.pos.getY() - MAX_SPREAD_DISTANCE, this.pos.getZ() - MAX_SPREAD_DISTANCE, + this.pos.getX() + MAX_SPREAD_DISTANCE, this.pos.getY() + MAX_SPREAD_DISTANCE, + this.pos.getZ() + MAX_SPREAD_DISTANCE); + + if (compound.hasKey("FilledPositions")) { + this.temperatureModifier = compound.getInteger("TemperatureModifier"); + + NBTTagCompound filledCompound = compound.getCompoundTag("FilledPositions"); + + for (int strength = 0; strength <= MAX_SPREAD_DISTANCE; strength++) { + if (!filledCompound.hasKey("Strength" + strength)) + throw new IllegalArgumentException( + "Compound missing strength sub-compound Strength" + strength + "!"); + + NBTTagCompound strengthCompound = filledCompound.getCompoundTag("Strength" + strength); + this.filledPositions[strength] = readPosSet(strengthCompound); + } + this.spawnedEntities = Sets.newConcurrentHashSet(); // Recreate + // spawned + // entities set + // and + // repopulate + // later + + NBTTagCompound obstructedCompound = compound.getCompoundTag("ObstructedPositions"); + this.obstructedPositions = readPosSet(obstructedCompound); + } + } + + @Override + public NBTTagCompound writeToNBT(NBTTagCompound compound) { + super.writeToNBT(compound); + + NBTTagCompound filledCompound = new NBTTagCompound(); + + compound.setInteger("TemperatureModifier", this.temperatureModifier); + + for (int i = 0; i <= MAX_SPREAD_DISTANCE; i++) { + NBTTagCompound strengthCompound = new NBTTagCompound(); + writePosSet(strengthCompound, this.filledPositions[i]); + filledCompound.setTag("Strength" + i, strengthCompound); + } + compound.setTag("FilledPositions", filledCompound); + + NBTTagCompound obstructedCompound = new NBTTagCompound(); + writePosSet(obstructedCompound, this.obstructedPositions); + compound.setTag("ObstructedPositions", obstructedCompound); + + return compound; + } + + @Override + public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newSate) { + // This should function as it does in Vanilla, using Forges setup + // appears to break fireball spawning when the state is changed + return oldState.getBlock() != newSate.getBlock(); + } + + private void writePosSet(NBTTagCompound compound, Set posSet) { + compound.setInteger("Count", posSet.size()); + + int index = 0; + + for (BlockPos pos : posSet) { + compound.setTag("Pos" + index, NBTUtil.createPosTag(pos)); + index++; + } + } + + private Set readPosSet(NBTTagCompound compound) { + if (!compound.hasKey("Count")) + throw new IllegalArgumentException("Compound is not a valid pos set"); + + int count = compound.getInteger("Count"); + Set posSet = Sets.newConcurrentHashSet(); + + for (int i = 0; i < count; i++) { + BlockPos pos = NBTUtil.getPosFromTag(compound.getCompoundTag("Pos" + i)); + if (pos != null) + posSet.add(pos); + } + + return posSet; + } + + @Override + public Temperature getRegulatedTemperature() { + return new Temperature(this.temperatureModifier); + } + + @Override + public boolean isPosRegulated(BlockPos pos) { + for (int i = 0; i < MAX_SPREAD_DISTANCE; i++) { + Set regulatedPositions = this.filledPositions[i]; + if (regulatedPositions.contains(pos)) + return true; + } + + return false; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/BiomeUtils.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/BiomeUtils.java new file mode 100644 index 00000000..812b03b9 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/BiomeUtils.java @@ -0,0 +1,21 @@ +package toughasnails.util; + +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.biome.Biome; + +public class BiomeUtils { + /** + * Get biome temperature on a scale of 0 to 1, 0 freezing and 1 boiling hot + **/ + public static float getBiomeTempNorm(Biome biome) { + return MathHelper.clamp_float(biome.getTemperature(), 0.0F, 1.35F) / 1.35F; + } + + /** + * Get the biome temperature's level of extremity from 0 to 1, 0 least + * extreme and 1 most extreme + */ + public static float getBiomeTempExtremity(Biome biome) { + return Math.abs(getBiomeTempNorm(biome) * 2.0F - 1.0F); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/BlockStateUtils.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/BlockStateUtils.java new file mode 100644 index 00000000..db4a6cf0 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/BlockStateUtils.java @@ -0,0 +1,128 @@ +package toughasnails.util; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map.Entry; +import java.util.Stack; + +import com.google.common.collect.ImmutableSet; + +import net.minecraft.block.Block; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import toughasnails.api.ITANBlock; + +public class BlockStateUtils { + + // utility function for dumping block state info to a string + @SuppressWarnings({ "rawtypes", "unchecked" }) + public static String getStateInfoAsString(IBlockState state) { + String desc = state.getBlock().getClass().getName() + "["; + Iterator it = state.getProperties().entrySet().iterator(); + boolean first = true; + while (it.hasNext()) { + if (!first) { + desc = desc + ","; + } + Entry entry = (Entry) it.next(); + IProperty iproperty = (IProperty) entry.getKey(); + Comparable comparable = (Comparable) entry.getValue(); + desc = desc + iproperty.getName() + "=" + iproperty.getName(comparable); + first = false; + } + desc = desc + "]"; + return desc; + } + + // returns a set of states, one for every possible combination of values + // from the provided properties + @SuppressWarnings("rawtypes") + public static ImmutableSet getStatesSet(IBlockState baseState, IProperty... properties) { + Stack propStack = new Stack(); + List states = new ArrayList(); + for (IProperty prop : properties) { + propStack.push(prop); + } + if (!propStack.isEmpty()) { + addStatesToList(baseState, states, propStack); + } + ImmutableSet ret = ImmutableSet.copyOf(states); + return ret; + } + + // recursively add state values to a list + @SuppressWarnings({ "rawtypes", "unchecked" }) + private static void addStatesToList(IBlockState state, List list, Stack stack) { + if (stack.empty()) { + list.add(state); + return; + } else { + IProperty prop = stack.pop(); + for (Object value : prop.getAllowedValues()) { + addStatesToList(state.withProperty(prop, (Comparable) value), list, stack); + } + stack.push(prop); + } + } + + // return all of the different 'preset' variants of a block + // works by looping through all the different values of the properties + // specified in block.getPresetProperties() + // only works on blocks supporting IBOPBlock - returns an empty set for + // vanilla blocks + public static ImmutableSet getBlockPresets(Block block) { + if (!(block instanceof ITANBlock)) { + return ImmutableSet. of(); + } + IBlockState defaultState = block.getDefaultState(); + if (defaultState == null) { + defaultState = block.getBlockState().getBaseState(); + } + return getStatesSet(defaultState, ((ITANBlock) block).getPresetProperties()); + } + + /** + * Discards additional block information to retrieve a state equivalent to + * those in the inventory + **/ + @SuppressWarnings({ "rawtypes", "unchecked" }) + public static IBlockState getPresetState(IBlockState state) { + IBlockState outState = state.getBlock().getDefaultState(); + + if (state.getBlock() instanceof ITANBlock) { + ITANBlock bopBlock = (ITANBlock) state.getBlock(); + + for (IProperty property : bopBlock.getPresetProperties()) { + outState = outState.withProperty(property, state.getValue(property)); + } + } + + return outState; + } + + @SuppressWarnings("rawtypes") + public static IProperty getPropertyByName(IBlockState blockState, String propertyName) { + for (IProperty property : (ImmutableSet>) blockState.getProperties().keySet()) { + if (property.getName().equals(propertyName)) + return property; + } + + return null; + } + + public static boolean isValidPropertyName(IBlockState blockState, String propertyName) { + return getPropertyByName(blockState, propertyName) != null; + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + public static Comparable getPropertyValueByName(IBlockState blockState, IProperty property, String valueName) { + for (Comparable value : (ImmutableSet) property.getAllowedValues()) { + if (value.toString().equals(valueName)) + return value; + } + + return null; + } + +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/MapUtils.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/MapUtils.java new file mode 100644 index 00000000..b11766f0 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/MapUtils.java @@ -0,0 +1,36 @@ +package toughasnails.util; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +public class MapUtils { + @SuppressWarnings("unchecked") + public static > Map sortMapByValue(Map map) { + List> list = new ArrayList>(map.size()); + list.addAll(map.entrySet()); + ValueComparator comparator = new ValueComparator(); + Collections.sort(list, comparator); + + Map result = new LinkedHashMap(); + for (@SuppressWarnings("rawtypes") + Iterator iterator = list.iterator(); iterator.hasNext();) { + Map.Entry entry = (Map.Entry) iterator.next(); + result.put(entry.getKey(), entry.getValue()); + } + + return result; + } + + private static class ValueComparator> implements Comparator> { + @Override + public int compare(Entry o1, Entry o2) { + return -o1.getValue().compareTo(o2.getValue()); + } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/PotionBrewingRecipe.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/PotionBrewingRecipe.java new file mode 100644 index 00000000..eefb961c --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/PotionBrewingRecipe.java @@ -0,0 +1,24 @@ +package toughasnails.util; + +import javax.annotation.Nonnull; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.brewing.BrewingRecipe; + +public class PotionBrewingRecipe extends BrewingRecipe +{ + + private ItemStack input; + + public PotionBrewingRecipe(ItemStack input, ItemStack ingredient, ItemStack output) + { + super(input, ingredient, output); + this.input = input; + } + + @Override + public boolean isInput(@Nonnull ItemStack stack) + { + return super.isInput(stack) && ItemStack.areItemStackTagsEqual(input, stack); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/RenderUtils.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/RenderUtils.java new file mode 100644 index 00000000..2215e5c7 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/RenderUtils.java @@ -0,0 +1,24 @@ +package toughasnails.util; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.VertexBuffer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; + +public class RenderUtils +{ + public static void drawTexturedModalRect(int x, int y, int textureX, int textureY, int width, int height) + { + float f = 0.00390625F; + float f1 = 0.00390625F; + Tessellator tessellator = Tessellator.getInstance(); + VertexBuffer worldrenderer = tessellator.getBuffer(); + worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos((double)(x + 0), (double)(y + height), 0.0D).tex((double)((float)(textureX + 0) * f), (double)((float)(textureY + height) * f1)).endVertex();; + worldrenderer.pos((double)(x + width), (double)(y + height), 0.0D).tex((double)((float)(textureX + width) * f), (double)((float)(textureY + height) * f1)).endVertex(); + worldrenderer.pos((double)(x + width), (double)(y + 0), 0.0D).tex((double)((float)(textureX + width) * f), (double)((float)(textureY + 0) * f1)).endVertex(); + worldrenderer.pos((double)(x + 0), (double)(y + 0), 0.0D).tex((double)((float)(textureX + 0) * f), (double)((float)(textureY + 0) * f1)).endVertex(); + tessellator.draw(); + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/SeasonColourUtil.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/SeasonColourUtil.java new file mode 100644 index 00000000..5dfd8e2c --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/SeasonColourUtil.java @@ -0,0 +1,94 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package toughasnails.util; + + +import org.lwjgl.util.Color; + +import toughasnails.api.config.SyncedConfig; +import toughasnails.api.season.Season.SubSeason; +import toughasnails.api.config.GameplayOption; + +public class SeasonColourUtil +{ + public static int multiplyColours(int colour1, int colour2) + { + //Convert each colour to a scale between 0 and 1 and multiply them + //Multiply by 255 to bring back between 0 and 255 + return (int)((colour1 / 255.0F) * (colour2 / 255.0F) * 255.0F); + } + + public static int overlayBlendChannel(int underColour, int overColour) + { + int retVal; + if (underColour < 128) + { + retVal = multiplyColours(2 * underColour, overColour); + } + else + { + retVal = multiplyColours(2 * (255 - underColour), 255 - overColour); + retVal = 255 - retVal; + } + return retVal; + } + + public static int overlayBlend(int underColour, int overColour) + { + int r = overlayBlendChannel((underColour >> 16) & 255, (overColour >> 16) & 255); + int g = overlayBlendChannel((underColour >> 8) & 255, (overColour >> 8) & 255); + int b = overlayBlendChannel(underColour & 255, overColour & 255); + + return (r & 255) << 16 | (g & 255) << 8 | (b & 255); + } + + public static int saturateColour(int colour, float saturationMultiplier) + { + Color newColour = getColourFromInt(colour); + float[] hsb = newColour.toHSB(null); + hsb[1] *= saturationMultiplier; + newColour.fromHSB(hsb[0], hsb[1], hsb[2]); + return getIntFromColour(newColour); + } + + public static int applySeasonalGrassColouring(SubSeason season, int originalColour) + { + int overlay = season.getGrassOverlay(); + float saturationMultiplier = season.getGrassSaturationMultiplier(); + if (!(SyncedConfig.getBooleanValue(GameplayOption.ENABLE_SEASONS))) + { + overlay = SubSeason.MID_SUMMER.getGrassOverlay(); + saturationMultiplier = SubSeason.MID_SUMMER.getGrassSaturationMultiplier(); + } + int newColour = overlay == 0xFFFFFF ? originalColour : overlayBlend(originalColour, overlay); + return saturationMultiplier != -1 ? saturateColour(newColour, saturationMultiplier) : newColour; + } + + public static int applySeasonalFoliageColouring(SubSeason season, int originalColour) + { + int overlay = season.getFoliageOverlay(); + float saturationMultiplier = season.getFoliageSaturationMultiplier(); + if (!(SyncedConfig.getBooleanValue(GameplayOption.ENABLE_SEASONS))) + { + overlay = SubSeason.MID_SUMMER.getFoliageOverlay(); + saturationMultiplier = SubSeason.MID_SUMMER.getFoliageSaturationMultiplier(); + } + int newColour = overlay == 0xFFFFFF ? originalColour : overlayBlend(originalColour, overlay); + return saturationMultiplier != -1 ? saturateColour(newColour, saturationMultiplier) : newColour; + } + + private static Color getColourFromInt(int colour) + { + return new Color((colour >> 16) & 255, (colour >> 8) & 255, colour & 255); + } + + private static int getIntFromColour(Color colour) + { + return (colour.getRed() & 255) << 16 | (colour.getGreen() & 255) << 8 | colour.getBlue() & 255; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/block/VariantPagingHelper.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/block/VariantPagingHelper.java new file mode 100644 index 00000000..285cd422 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/block/VariantPagingHelper.java @@ -0,0 +1,177 @@ +/******************************************************************************* + * Copyright 2014-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package toughasnails.util.block; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; + +import net.minecraft.block.Block; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IStringSerializable; + +public class VariantPagingHelper & IStringSerializable & VariantPagingHelper.IPagedVariants> { + + public interface IPagedVariants { + + } + + public class PageIndex { + private int pageNum; + private int index; + + public PageIndex(int pageNum, int index) { + this.pageNum = pageNum; + this.index = index; + } + + public int getPageNum() { + return this.pageNum; + } + + public int getIndex() { + return this.index; + } + + @Override + public String toString() { + return "page:" + this.pageNum + " index:" + this.index; + } + } + + protected int variantsPerPage; + protected Class variantsEnumClass; + @SuppressWarnings("rawtypes") + protected Map pageNumToProperty = new HashMap(); + protected Map variantToPageIndex = new HashMap(); + protected Map masterIndexToVariant = new HashMap(); + protected Map pageNumToBlock = new HashMap(); + protected Map blockToPageNum = new HashMap(); + + public VariantPagingHelper(int variantsPerPage, Class variantsEnumClass) { + this(variantsPerPage, variantsEnumClass, Predicates. alwaysTrue()); + } + + @SuppressWarnings("unchecked") + public VariantPagingHelper(int variantsPerPage, Class variantsEnumClass, Predicate filter) { + + this.variantsPerPage = variantsPerPage; + this.variantsEnumClass = variantsEnumClass; + + Object[] variants = variantsEnumClass.getEnumConstants(); + if (variants == null) { + throw new IllegalArgumentException( + "Failed creating PagedBlock - variantsEnumClass has no enum constants - is it an enum class?"); + } + + ArrayList currentPage = new ArrayList(); + int currentPageNum = 0; + + for (Object obj : variants) { + V variant = (V) obj; + if (!filter.apply(variant)) { + continue; + } + currentPage.add(variant); + if (currentPage.size() == variantsPerPage) { + this.addVariantPage(currentPageNum, currentPage); + currentPage = new ArrayList(); + currentPageNum++; + } + } + if (!currentPage.isEmpty()) { + this.addVariantPage(currentPageNum, currentPage); + } + + } + + protected void addVariantPage(int pageNum, ArrayList variants) { + for (int index = 0; index < variants.size(); ++index) { + V variant = variants.get(index); + this.variantToPageIndex.put(variant, new PageIndex(pageNum, index)); + this.masterIndexToVariant.put(Integer.valueOf(pageNum * this.variantsPerPage + index), variant); + } + this.pageNumToProperty.put(Integer.valueOf(pageNum), + PropertyEnum.create("variant", this.variantsEnumClass, variants)); + } + + public void addBlock(int pageNum, B block) { + this.pageNumToBlock.put(pageNum, block); + this.blockToPageNum.put(block, pageNum); + } + + public int getVariantsPerPage() { + return this.variantsPerPage; + } + + public int getNumPages() { + return this.pageNumToProperty.size(); + } + + @SuppressWarnings("rawtypes") + public PropertyEnum getVariantProperty(int pageNum) { + return this.pageNumToProperty.get(pageNum); + } + + public int getIndex(V variant) { + return this.variantToPageIndex.get(variant).getIndex(); + } + + public int getPageNum(V variant) { + return this.variantToPageIndex.get(variant).getPageNum(); + } + + public int getPageNum(B block) { + return this.blockToPageNum.get(block); + } + + @SuppressWarnings("unchecked") + public V getVariant(int pageNum, int index) { + V value = this.masterIndexToVariant.get(pageNum * this.variantsPerPage + index); + + // Use the default value if we can't find one for this index + if (value == null) + value = (V) this.getBlock(pageNum).getDefaultState().getValue(this.getVariantProperty(pageNum)); + + return value; + } + + public V getVariant(B block, int index) { + return this.getVariant(this.getPageNum(block), index); + } + + public B getBlock(int pageNum) { + return this.pageNumToBlock.get(pageNum); + } + + public B getBlock(V variant) { + return this.pageNumToBlock.get(this.getPageNum(variant)); + } + + @SuppressWarnings("unchecked") + public IBlockState getVariantState(V variant) { + return this.getBlock(variant).getDefaultState().withProperty(this.getVariantProperty(this.getPageNum(variant)), + variant); + } + + public ItemStack getVariantItem(V variant) { + return this.getVariantItem(variant, 1); + } + + public ItemStack getVariantItem(V variant, int howMany) { + return new ItemStack(this.getBlock(variant), howMany, + this.getBlock(variant).getMetaFromState(this.getVariantState(variant))); + } + +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/inventory/CreativeTabTAN.java b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/inventory/CreativeTabTAN.java new file mode 100644 index 00000000..99ffb8e9 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/java/toughasnails/util/inventory/CreativeTabTAN.java @@ -0,0 +1,21 @@ +package toughasnails.util.inventory; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import toughasnails.api.item.TANItems; + +public class CreativeTabTAN extends CreativeTabs +{ + public static final CreativeTabs instance = new CreativeTabTAN(CreativeTabs.getNextID(), "tabToughAsNails"); + + private CreativeTabTAN(int index, String label) + { + super(index, label); + } + + @Override + public Item getTabIconItem() + { + return TANItems.tan_icon; + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/META-INF/toughasnails_at.cfg b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/META-INF/toughasnails_at.cfg new file mode 100644 index 00000000..fd8bfe10 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/META-INF/toughasnails_at.cfg @@ -0,0 +1,13 @@ +#Season colouring +public-f net.minecraft.world.biome.BiomeColorHelper field_180291_a #GRASS_COLOR +public-f net.minecraft.world.biome.BiomeColorHelper field_180289_b #FOLIAGE_COLOR +public net.minecraft.world.biome.BiomeColorHelper$ColorResolver + +#Seasonal melting +public net.minecraft.world.World field_73005_l #updateLCG +public net.minecraft.block.BlockIce func_185679_b(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)V + +#Seasonal freezing +public net.minecraft.world.World func_175696_F(Lnet/minecraft/util/math/BlockPos;)Z #isWater + + diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/campfire.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/campfire.json new file mode 100644 index 00000000..95630ad0 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/campfire.json @@ -0,0 +1,36 @@ +{ + "variants": { + "age=0,burning=true": { "model": "toughasnails:campfire" }, + "age=1,burning=true": { "model": "toughasnails:campfire" }, + "age=2,burning=true": { "model": "toughasnails:campfire" }, + "age=3,burning=true": { "model": "toughasnails:campfire" }, + "age=4,burning=true": { "model": "toughasnails:campfire" }, + "age=5,burning=true": { "model": "toughasnails:campfire" }, + "age=6,burning=true": { "model": "toughasnails:campfire" }, + "age=7,burning=true": { "model": "toughasnails:campfire" }, + "age=8,burning=true": { "model": "toughasnails:campfire" }, + "age=9,burning=true": { "model": "toughasnails:campfire" }, + "age=10,burning=true": { "model": "toughasnails:campfire" }, + "age=11,burning=true": { "model": "toughasnails:campfire" }, + "age=12,burning=true": { "model": "toughasnails:campfire" }, + "age=13,burning=true": { "model": "toughasnails:campfire" }, + "age=14,burning=true": { "model": "toughasnails:campfire" }, + "age=15,burning=true": { "model": "toughasnails:campfire" }, + "age=0,burning=false": { "model": "toughasnails:campfire" }, + "age=1,burning=false": { "model": "toughasnails:campfire_out" }, + "age=2,burning=false": { "model": "toughasnails:campfire_out" }, + "age=3,burning=false": { "model": "toughasnails:campfire_out" }, + "age=4,burning=false": { "model": "toughasnails:campfire_out" }, + "age=5,burning=false": { "model": "toughasnails:campfire_out" }, + "age=6,burning=false": { "model": "toughasnails:campfire_out" }, + "age=7,burning=false": { "model": "toughasnails:campfire_out" }, + "age=8,burning=false": { "model": "toughasnails:campfire_out" }, + "age=9,burning=false": { "model": "toughasnails:campfire_out" }, + "age=10,burning=false": { "model": "toughasnails:campfire_out" }, + "age=11,burning=false": { "model": "toughasnails:campfire_out" }, + "age=12,burning=false": { "model": "toughasnails:campfire_out" }, + "age=13,burning=false": { "model": "toughasnails:campfire_out" }, + "age=14,burning=false": { "model": "toughasnails:campfire_out" }, + "age=15,burning=false": { "model": "toughasnails:campfire_out" } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/dead_crops.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/dead_crops.json new file mode 100644 index 00000000..fc91921c --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/dead_crops.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "toughasnails:dead_crops" } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/glowstone_torch.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/glowstone_torch.json new file mode 100644 index 00000000..9239dc0a --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/glowstone_torch.json @@ -0,0 +1,9 @@ +{ + "variants": { + "facing=up": { "model": "toughasnails:glowstone_torch" }, + "facing=east": { "model": "toughasnails:glowstone_torch_wall" }, + "facing=south": { "model": "toughasnails:glowstone_torch_wall", "y": 90 }, + "facing=west": { "model": "toughasnails:glowstone_torch_wall", "y": 180 }, + "facing=north": { "model": "toughasnails:glowstone_torch_wall", "y": 270 } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/rain_collector.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/rain_collector.json new file mode 100644 index 00000000..457e6039 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/rain_collector.json @@ -0,0 +1,8 @@ +{ + "variants": { + "level=0": { "model": "toughasnails:rain_collector_empty" }, + "level=1": { "model": "toughasnails:rain_collector_level1" }, + "level=2": { "model": "toughasnails:rain_collector_level2" }, + "level=3": { "model": "toughasnails:rain_collector_level3" } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/season_sensor_autumn.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/season_sensor_autumn.json new file mode 100644 index 00000000..d7c60ccf --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/season_sensor_autumn.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "toughasnails:season_sensor_autumn" } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/season_sensor_spring.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/season_sensor_spring.json new file mode 100644 index 00000000..4d192e28 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/season_sensor_spring.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "toughasnails:season_sensor_spring" } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/season_sensor_summer.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/season_sensor_summer.json new file mode 100644 index 00000000..5d08fea7 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/season_sensor_summer.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "toughasnails:season_sensor_summer" } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/season_sensor_winter.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/season_sensor_winter.json new file mode 100644 index 00000000..b963d4b9 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/season_sensor_winter.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "toughasnails:season_sensor_winter" } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/temperature_coil.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/temperature_coil.json new file mode 100644 index 00000000..b09bb5a0 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/temperature_coil.json @@ -0,0 +1,8 @@ +{ + "variants": { + "powered=false,variant=cooling": { "model": "toughasnails:cooling_coil_off" }, + "powered=true,variant=cooling": { "model": "toughasnails:cooling_coil_on" }, + "powered=false,variant=heating": { "model": "toughasnails:heating_coil_off" }, + "powered=true,variant=heating": { "model": "toughasnails:heating_coil_on" } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/torch_new.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/torch_new.json new file mode 100644 index 00000000..ab5dfbb2 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/blockstates/torch_new.json @@ -0,0 +1,164 @@ +{ + "variants": { + "age=0,burning=true,facing=up": { "model": "normal_torch" }, + "age=1,burning=true,facing=up": { "model": "normal_torch" }, + "age=2,burning=true,facing=up": { "model": "normal_torch" }, + "age=3,burning=true,facing=up": { "model": "normal_torch" }, + "age=4,burning=true,facing=up": { "model": "normal_torch" }, + "age=5,burning=true,facing=up": { "model": "normal_torch" }, + "age=6,burning=true,facing=up": { "model": "normal_torch" }, + "age=7,burning=true,facing=up": { "model": "normal_torch" }, + "age=8,burning=true,facing=up": { "model": "normal_torch" }, + "age=9,burning=true,facing=up": { "model": "normal_torch" }, + "age=10,burning=true,facing=up": { "model": "normal_torch" }, + "age=11,burning=true,facing=up": { "model": "normal_torch" }, + "age=12,burning=true,facing=up": { "model": "normal_torch" }, + "age=13,burning=true,facing=up": { "model": "normal_torch" }, + "age=14,burning=true,facing=up": { "model": "normal_torch" }, + "age=15,burning=true,facing=up": { "model": "normal_torch" }, + "age=0,burning=true,facing=east": { "model": "normal_torch_wall" }, + "age=1,burning=true,facing=east": { "model": "normal_torch_wall" }, + "age=2,burning=true,facing=east": { "model": "normal_torch_wall" }, + "age=3,burning=true,facing=east": { "model": "normal_torch_wall" }, + "age=4,burning=true,facing=east": { "model": "normal_torch_wall" }, + "age=5,burning=true,facing=east": { "model": "normal_torch_wall" }, + "age=6,burning=true,facing=east": { "model": "normal_torch_wall" }, + "age=7,burning=true,facing=east": { "model": "normal_torch_wall" }, + "age=8,burning=true,facing=east": { "model": "normal_torch_wall" }, + "age=9,burning=true,facing=east": { "model": "normal_torch_wall" }, + "age=10,burning=true,facing=east": { "model": "normal_torch_wall" }, + "age=11,burning=true,facing=east": { "model": "normal_torch_wall" }, + "age=12,burning=true,facing=east": { "model": "normal_torch_wall" }, + "age=13,burning=true,facing=east": { "model": "normal_torch_wall" }, + "age=14,burning=true,facing=east": { "model": "normal_torch_wall" }, + "age=15,burning=true,facing=east": { "model": "normal_torch_wall" }, + "age=0,burning=true,facing=south": { "model": "normal_torch_wall", "y": 90 }, + "age=1,burning=true,facing=south": { "model": "normal_torch_wall", "y": 90 }, + "age=2,burning=true,facing=south": { "model": "normal_torch_wall", "y": 90 }, + "age=3,burning=true,facing=south": { "model": "normal_torch_wall", "y": 90 }, + "age=4,burning=true,facing=south": { "model": "normal_torch_wall", "y": 90 }, + "age=5,burning=true,facing=south": { "model": "normal_torch_wall", "y": 90 }, + "age=6,burning=true,facing=south": { "model": "normal_torch_wall", "y": 90 }, + "age=7,burning=true,facing=south": { "model": "normal_torch_wall", "y": 90 }, + "age=8,burning=true,facing=south": { "model": "normal_torch_wall", "y": 90 }, + "age=9,burning=true,facing=south": { "model": "normal_torch_wall", "y": 90 }, + "age=10,burning=true,facing=south": { "model": "normal_torch_wall", "y": 90 }, + "age=11,burning=true,facing=south": { "model": "normal_torch_wall", "y": 90 }, + "age=12,burning=true,facing=south": { "model": "normal_torch_wall", "y": 90 }, + "age=13,burning=true,facing=south": { "model": "normal_torch_wall", "y": 90 }, + "age=14,burning=true,facing=south": { "model": "normal_torch_wall", "y": 90 }, + "age=15,burning=true,facing=south": { "model": "normal_torch_wall", "y": 90 }, + "age=0,burning=true,facing=west": { "model": "normal_torch_wall", "y": 180 }, + "age=1,burning=true,facing=west": { "model": "normal_torch_wall", "y": 180 }, + "age=2,burning=true,facing=west": { "model": "normal_torch_wall", "y": 180 }, + "age=3,burning=true,facing=west": { "model": "normal_torch_wall", "y": 180 }, + "age=4,burning=true,facing=west": { "model": "normal_torch_wall", "y": 180 }, + "age=5,burning=true,facing=west": { "model": "normal_torch_wall", "y": 180 }, + "age=6,burning=true,facing=west": { "model": "normal_torch_wall", "y": 180 }, + "age=7,burning=true,facing=west": { "model": "normal_torch_wall", "y": 180 }, + "age=8,burning=true,facing=west": { "model": "normal_torch_wall", "y": 180 }, + "age=9,burning=true,facing=west": { "model": "normal_torch_wall", "y": 180 }, + "age=10,burning=true,facing=west": { "model": "normal_torch_wall", "y": 180 }, + "age=11,burning=true,facing=west": { "model": "normal_torch_wall", "y": 180 }, + "age=12,burning=true,facing=west": { "model": "normal_torch_wall", "y": 180 }, + "age=13,burning=true,facing=west": { "model": "normal_torch_wall", "y": 180 }, + "age=14,burning=true,facing=west": { "model": "normal_torch_wall", "y": 180 }, + "age=15,burning=true,facing=west": { "model": "normal_torch_wall", "y": 180 }, + "age=0,burning=true,facing=north": { "model": "normal_torch_wall", "y": 270 }, + "age=1,burning=true,facing=north": { "model": "normal_torch_wall", "y": 270 }, + "age=2,burning=true,facing=north": { "model": "normal_torch_wall", "y": 270 }, + "age=3,burning=true,facing=north": { "model": "normal_torch_wall", "y": 270 }, + "age=4,burning=true,facing=north": { "model": "normal_torch_wall", "y": 270 }, + "age=5,burning=true,facing=north": { "model": "normal_torch_wall", "y": 270 }, + "age=6,burning=true,facing=north": { "model": "normal_torch_wall", "y": 270 }, + "age=7,burning=true,facing=north": { "model": "normal_torch_wall", "y": 270 }, + "age=8,burning=true,facing=north": { "model": "normal_torch_wall", "y": 270 }, + "age=9,burning=true,facing=north": { "model": "normal_torch_wall", "y": 270 }, + "age=10,burning=true,facing=north": { "model": "normal_torch_wall", "y": 270 }, + "age=11,burning=true,facing=north": { "model": "normal_torch_wall", "y": 270 }, + "age=12,burning=true,facing=north": { "model": "normal_torch_wall", "y": 270 }, + "age=13,burning=true,facing=north": { "model": "normal_torch_wall", "y": 270 }, + "age=14,burning=true,facing=north": { "model": "normal_torch_wall", "y": 270 }, + "age=15,burning=true,facing=north": { "model": "normal_torch_wall", "y": 270 }, + "age=0,burning=false,facing=up": { "model": "toughasnails:new_torch" }, + "age=1,burning=false,facing=up": { "model": "toughasnails:new_torch" }, + "age=2,burning=false,facing=up": { "model": "toughasnails:new_torch" }, + "age=3,burning=false,facing=up": { "model": "toughasnails:new_torch" }, + "age=4,burning=false,facing=up": { "model": "toughasnails:new_torch" }, + "age=5,burning=false,facing=up": { "model": "toughasnails:new_torch" }, + "age=6,burning=false,facing=up": { "model": "toughasnails:new_torch" }, + "age=7,burning=false,facing=up": { "model": "toughasnails:new_torch" }, + "age=8,burning=false,facing=up": { "model": "toughasnails:new_torch" }, + "age=9,burning=false,facing=up": { "model": "toughasnails:new_torch" }, + "age=10,burning=false,facing=up": { "model": "toughasnails:new_torch" }, + "age=11,burning=false,facing=up": { "model": "toughasnails:new_torch" }, + "age=12,burning=false,facing=up": { "model": "toughasnails:new_torch" }, + "age=13,burning=false,facing=up": { "model": "toughasnails:new_torch" }, + "age=14,burning=false,facing=up": { "model": "toughasnails:new_torch" }, + "age=15,burning=false,facing=up": { "model": "toughasnails:new_torch" }, + "age=0,burning=false,facing=east": { "model": "toughasnails:new_torch_wall" }, + "age=1,burning=false,facing=east": { "model": "toughasnails:new_torch_wall" }, + "age=2,burning=false,facing=east": { "model": "toughasnails:new_torch_wall" }, + "age=3,burning=false,facing=east": { "model": "toughasnails:new_torch_wall" }, + "age=4,burning=false,facing=east": { "model": "toughasnails:new_torch_wall" }, + "age=5,burning=false,facing=east": { "model": "toughasnails:new_torch_wall" }, + "age=6,burning=false,facing=east": { "model": "toughasnails:new_torch_wall" }, + "age=7,burning=false,facing=east": { "model": "toughasnails:new_torch_wall" }, + "age=8,burning=false,facing=east": { "model": "toughasnails:new_torch_wall" }, + "age=9,burning=false,facing=east": { "model": "toughasnails:new_torch_wall" }, + "age=10,burning=false,facing=east": { "model": "toughasnails:new_torch_wall" }, + "age=11,burning=false,facing=east": { "model": "toughasnails:new_torch_wall" }, + "age=12,burning=false,facing=east": { "model": "toughasnails:new_torch_wall" }, + "age=13,burning=false,facing=east": { "model": "toughasnails:new_torch_wall" }, + "age=14,burning=false,facing=east": { "model": "toughasnails:new_torch_wall" }, + "age=15,burning=false,facing=east": { "model": "toughasnails:new_torch_wall" }, + "age=0,burning=false,facing=south": { "model": "toughasnails:new_torch_wall", "y": 90 }, + "age=1,burning=false,facing=south": { "model": "toughasnails:new_torch_wall", "y": 90 }, + "age=2,burning=false,facing=south": { "model": "toughasnails:new_torch_wall", "y": 90 }, + "age=3,burning=false,facing=south": { "model": "toughasnails:new_torch_wall", "y": 90 }, + "age=4,burning=false,facing=south": { "model": "toughasnails:new_torch_wall", "y": 90 }, + "age=5,burning=false,facing=south": { "model": "toughasnails:new_torch_wall", "y": 90 }, + "age=6,burning=false,facing=south": { "model": "toughasnails:new_torch_wall", "y": 90 }, + "age=7,burning=false,facing=south": { "model": "toughasnails:new_torch_wall", "y": 90 }, + "age=8,burning=false,facing=south": { "model": "toughasnails:new_torch_wall", "y": 90 }, + "age=9,burning=false,facing=south": { "model": "toughasnails:new_torch_wall", "y": 90 }, + "age=10,burning=false,facing=south": { "model": "toughasnails:new_torch_wall", "y": 90 }, + "age=11,burning=false,facing=south": { "model": "toughasnails:new_torch_wall", "y": 90 }, + "age=12,burning=false,facing=south": { "model": "toughasnails:new_torch_wall", "y": 90 }, + "age=13,burning=false,facing=south": { "model": "toughasnails:new_torch_wall", "y": 90 }, + "age=14,burning=false,facing=south": { "model": "toughasnails:new_torch_wall", "y": 90 }, + "age=15,burning=false,facing=south": { "model": "toughasnails:new_torch_wall", "y": 90 }, + "age=0,burning=false,facing=west": { "model": "toughasnails:new_torch_wall", "y": 180 }, + "age=1,burning=false,facing=west": { "model": "toughasnails:new_torch_wall", "y": 180 }, + "age=2,burning=false,facing=west": { "model": "toughasnails:new_torch_wall", "y": 180 }, + "age=3,burning=false,facing=west": { "model": "toughasnails:new_torch_wall", "y": 180 }, + "age=4,burning=false,facing=west": { "model": "toughasnails:new_torch_wall", "y": 180 }, + "age=5,burning=false,facing=west": { "model": "toughasnails:new_torch_wall", "y": 180 }, + "age=6,burning=false,facing=west": { "model": "toughasnails:new_torch_wall", "y": 180 }, + "age=7,burning=false,facing=west": { "model": "toughasnails:new_torch_wall", "y": 180 }, + "age=8,burning=false,facing=west": { "model": "toughasnails:new_torch_wall", "y": 180 }, + "age=9,burning=false,facing=west": { "model": "toughasnails:new_torch_wall", "y": 180 }, + "age=10,burning=false,facing=west": { "model": "toughasnails:new_torch_wall", "y": 180 }, + "age=11,burning=false,facing=west": { "model": "toughasnails:new_torch_wall", "y": 180 }, + "age=12,burning=false,facing=west": { "model": "toughasnails:new_torch_wall", "y": 180 }, + "age=13,burning=false,facing=west": { "model": "toughasnails:new_torch_wall", "y": 180 }, + "age=14,burning=false,facing=west": { "model": "toughasnails:new_torch_wall", "y": 180 }, + "age=15,burning=false,facing=west": { "model": "toughasnails:new_torch_wall", "y": 180 }, + "age=0,burning=false,facing=north": { "model": "toughasnails:new_torch_wall", "y": 270 }, + "age=1,burning=false,facing=north": { "model": "toughasnails:new_torch_wall", "y": 270 }, + "age=2,burning=false,facing=north": { "model": "toughasnails:new_torch_wall", "y": 270 }, + "age=3,burning=false,facing=north": { "model": "toughasnails:new_torch_wall", "y": 270 }, + "age=4,burning=false,facing=north": { "model": "toughasnails:new_torch_wall", "y": 270 }, + "age=5,burning=false,facing=north": { "model": "toughasnails:new_torch_wall", "y": 270 }, + "age=6,burning=false,facing=north": { "model": "toughasnails:new_torch_wall", "y": 270 }, + "age=7,burning=false,facing=north": { "model": "toughasnails:new_torch_wall", "y": 270 }, + "age=8,burning=false,facing=north": { "model": "toughasnails:new_torch_wall", "y": 270 }, + "age=9,burning=false,facing=north": { "model": "toughasnails:new_torch_wall", "y": 270 }, + "age=10,burning=false,facing=north": { "model": "toughasnails:new_torch_wall", "y": 270 }, + "age=11,burning=false,facing=north": { "model": "toughasnails:new_torch_wall", "y": 270 }, + "age=12,burning=false,facing=north": { "model": "toughasnails:new_torch_wall", "y": 270 }, + "age=13,burning=false,facing=north": { "model": "toughasnails:new_torch_wall", "y": 270 }, + "age=14,burning=false,facing=north": { "model": "toughasnails:new_torch_wall", "y": 270 }, + "age=15,burning=false,facing=north": { "model": "toughasnails:new_torch_wall", "y": 270 } + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/lang/en_US.lang b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/lang/en_US.lang new file mode 100644 index 00000000..04ec3456 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/lang/en_US.lang @@ -0,0 +1,113 @@ +achievement.thirst_quencher=Thirst Quencher +achievement.thirst_quencher.desc=Craft a canteen out of leather +achievement.thirst_ender=Thirst Ender +achievement.thirst_ender.desc=Make a bottle of refreshing fruit juice +achievement.campfire_song=Campfire Song +achievement.campfire_song.desc=Light a campfire made out of logs and cobblestone! +achievement.into_ice=Into Ice +achievement.into_ice.desc=Relieve a Freeze of its rod +achievement.hot_or_cold=Hot or Cold +achievement.hot_or_cold.desc=Make a thermometer out of diamonds and Nether quartz +achievement.that_time_of_year=That Time of Year +achievement.that_time_of_year.desc=Craft a season clock with Nether quartz and redstone +achievement.year_one=Year One +achievement.year_one.desc=Survive a full year! +achievement.life_or_death=Life or Death +achievement.life_or_death.desc=Search Nether Fortresses for loot to increase your health! + +commands.toughasnails.usage=/toughasnails [args] +commands.toughasnails.settemp.success=Set player temperature to %s +commands.toughasnails.settemp.disabled=Body Temperature is currently disabled! +commands.toughasnails.setseason.success=Set season to %s +commands.toughasnails.setseason.fail=Invalid season %s +commands.toughasnails.setseason.disabled=Seasons are currently disabled! +commands.toughasnails.setthirst.success=Set thirst to %s +commands.toughasnails.setthirst.disabled=Thirst is currently disabled! +commands.toughasnails.sethealth.success=Set health to %s +commands.toughasnails.sethealth.disabled=Health is currently disabled! +commands.toughasnails.tempat.success=Temperature at dimension %s: %s,%s,%s is %s +commands.toughasnails.tempat.disabled=Temperature is currently disabled! + +config.category.survivalSettings.title=Survival Settings + +itemGroup.tabToughAsNails=Tough As Nails + +tile.campfire.name=Campfire +tile.dead_crops.name=Dead Crops +tile.rain_collector.name=Rain Collector +tile.temperature_coil.cooling_coil.name=Cooling Coil +tile.temperature_coil.heating_coil.name=Heating Coil +tile.season_sensor_spring.name=Season Sensor +tile.season_sensor_summer.name=Season Sensor +tile.season_sensor_autumn.name=Season Sensor +tile.season_sensor_winter.name=Season Sensor +tile.torch_new.name=Torch + +item.air_filter.name=Air Filter +item.bottle_of_blackdamp.name=Bottle of Blackdamp +item.bottle_of_whitedamp.name=Bottle of Whitedamp +item.bottle_of_firedamp.name=Bottle of Firedamp +item.bottle_of_stinkdamp.name=Bottle of Stinkdamp +item.clean_water_canteen.name=Clean Water Canteen +item.charcoal_filter.name=Charcoal Filter +item.dirty_water_canteen.name=Dirty Water Canteen +item.dirty_water_bottle.name=Dirty Water Bottle +item.empty_canteen.name=Empty Canteen +item.filtered_water_canteen.name=Filtered Water Canteen +item.filtered_water_bottle.name=Filtered Water Bottle +item.freeze_powder.name=Freeze Powder +item.freeze_rod.name=Freeze Rod +item.ice_charge.name=Ice Charge +item.ice_cube.name=Ice Cube +item.jelled_slime.name=Jelled Slime +item.jelled_slime_helmet.name=Jelled Slime Helmet +item.jelled_slime_chestplate.name=Jelled Slime Chestplate +item.jelled_slime_leggings.name=Jelled Slime Leggings +item.jelled_slime_boots.name=Jelled Slime Boots +item.juice_apple.name=Apple Juice +item.juice_beetroot.name=Beetroot Juice +item.juice_cactus.name=Cactus Juice +item.juice_carrot.name=Carrot Juice +item.juice_chorus_fruit.name=Chorus Fruit Juice +item.juice_glistering_melon.name=Glistering Melon Juice +item.juice_golden_apple.name=Golden Apple Juice +item.juice_golden_carrot.name=Golden Carrot Juice +item.juice_melon.name=Melon Juice +item.juice_pumpkin.name=Pumpkin Juice +item.lifeblood_crystal.name=Lifeblood Crystal +item.respirator.name=Respirator +item.season_clock.name=Season Clock +item.spawn_egg_freeze.name=Spawn Freeze +item.tan_icon.name=TAN Icon +item.thermometer.name=Thermometer +item.thermometer.read=The temperature here is %d degrees. +item.wool_helmet.name=Wool Hood +item.wool_chestplate.name=Wool Jacket +item.wool_leggings.name=Wool Pants +item.wool_boots.name=Wool Boots + +potion.hypothermia=Hypothermia +potion.hyperthermia=Hyperthermia +potion.thirst=Thirst +potion.cold_resistance=Cold Resistance +potion.heat_resistance=Heat Resistance + +potion.effect.cold_resistance_type=Potion of Cold Resistance +potion.effect.long_cold_resistance_type=Potion of Cold Resistance +potion.effect.heat_resistance_type=Potion of Heat Resistance +potion.effect.long_heat_resistance_type=Potion of Heat Resistance + +splash_potion.effect.cold_resistance_type=Splash Potion of Cold Resistance +splash_potion.effect.long_cold_resistance_type=Splash Potion of Cold Resistance +splash_potion.effect.heat_resistance_type=Splash Potion of Heat Resistance +splash_potion.effect.long_heat_resistance_type=Splash Potion of Heat Resistance + +lingering_potion.effect.cold_resistance_type=Lingering Potion of Cold Resistance +lingering_potion.effect.long_cold_resistance_type=Lingering Potion of Cold Resistance +lingering_potion.effect.heat_resistance_type=Lingering Potion of Heat Resistance +lingering_potion.effect.long_heat_resistance_type=Lingering Potion of Heat Resistance + +tipped_arrow.effect.cold_resistance_type=Arrow of Cold Resistance +tipped_arrow.effect.long_cold_resistance_type=Arrow of Cold Resistance +tipped_arrow.effect.heat_resistance_type=Arrow of Heat Resistance +tipped_arrow.effect.long_heat_resistance_type=Arrow of Heat Resistance \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/lang/fr_FR.lang b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/lang/fr_FR.lang new file mode 100644 index 00000000..1cd3296a --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/lang/fr_FR.lang @@ -0,0 +1,96 @@ +achievement.thirst_quencher=Boisson désaltérante +achievement.thirst_quencher.desc=Fabriquer une gourde en cuir +achievement.thirst_ender=Boisson exotique +achievement.thirst_ender.desc=Fabriquer une fiole d'un jus de fruit rafraichissant +achievement.campfire_song=Musique de Feu de camp +achievement.campfire_song.desc=Allumer un feu de camp créé de bois et de pierres! +achievement.into_ice=Dans la glace +achievement.into_ice.desc=Soulager un Freeze de son bâton +achievement.hot_or_cold=Chaleur ou fraicheur +achievement.hot_or_cold.desc=Fabriquer un thermometre de diamonts et de Quartz du Nether +achievement.that_time_of_year=Cet période de l'année +achievement.that_time_of_year.desc=Fabriquer une montre des saisons de Quartz du Nether et de la redstone +achievement.year_one=Année Une +achievement.year_one.desc=Survivre une année complète! +achievement.life_or_death=Vivre ou mourir +achievement.life_or_death.desc=A la recherche d'une forteresse du Nether pour un butin qui augmente votre santé! + +commands.toughasnails.usage=/toughasnails [args] +commands.toughasnails.settemp.success=Température corporelle du joueur réglée à %s +commands.toughasnails.settemp.disabled=La température corporelle a été désactivée! +commands.toughasnails.setseason.success=Saison réglée à %s +commands.toughasnails.setseason.fail=Saison incorrecte %s +commands.toughasnails.setseason.disabled=Les saisons ont été désactivées! + +config.category.survivalSettings.title=Réglages de Survie + +itemGroup.tabToughAsNails=Tough As Nails + +tile.campfire.name=Feux de camp +tile.dead_crops.name=Cultures mortes +tile.rain_collector.name=Collecteur d'eau de pluie +tile.temperature_coil.cooling_coil.name=Tube de refroidissement +tile.temperature_coil.heating_coil.name=Bobine de chauffage +tile.season_sensor_spring.name=Capteur de saison +tile.season_sensor_summer.name=Capteur de saison +tile.season_sensor_autumn.name=Capteur de saison +tile.season_sensor_winter.name=Capteur de saison +tile.torch_new.name=Torche + +item.air_filter.name=Filtreur d'air +item.bottle_of_blackdamp.name=Fiole de Blackdamp +item.bottle_of_whitedamp.name=Fiole de Whitedamp +item.bottle_of_firedamp.name=Fiole de Firedamp +item.bottle_of_stinkdamp.name=Fiole de Stinkdamp +item.clean_water_canteen.name=Gourde d'eau potable +item.charcoal_filter.name=Filtre au charbon de bois +item.dirty_water_canteen.name=Gourde d'eau sale +item.dirty_water_bottle.name=Fiole d'eau sale +item.empty_canteen.name=Gourde vide +item.filtered_water_canteen.name=Gourde d'eau filtré +item.filtered_water_bottle.name=Fiole d'eau filtré +item.freeze_powder.name=Poudre de glace +item.freeze_rod.name=Bâton de Freeze +item.ice_charge.name=Boule de glace +item.ice_cube.name=Cube de glace +item.jelled_slime.name=Gelée de Slime +item.jelled_slime_helmet.name=Casque en gelée de Slime +item.jelled_slime_chestplate.name=Plastron en gelée de Slime +item.jelled_slime_leggings.name=Jambières en gelée de Slime +item.jelled_slime_boots.name=Bottes en gelée de Slime +item.juice_apple.name=Jus de Pomme +item.juice_beetroot.name=Jus de Betterave +item.juice_cactus.name=Jus de Cactus +item.juice_carrot.name=Jus de Carotte +item.juice_chorus_fruit.name=Jus de fruit de Chorus +item.juice_glistering_melon.name=Jus de Pastèque scintillante +item.juice_golden_apple.name=Jus de Pomme d'orée +item.juice_golden_carrot.name=Jus de Carotte d'orée +item.juice_melon.name=Jus de Pastèque +item.juice_pumpkin.name=Jus de Citrouille +item.lifeblood_crystal.name=Cristal de santé +item.respirator.name=Respirateur +item.season_clock.name=Montre des saisons +item.spawn_egg_freeze.name=Oeuf de Freeze +item.tan_icon.name=TAN Icône +item.thermometer.name=Thermometre +item.wool_helmet.name=Capuche de laine +item.wool_chestplate.name=Veste de laine +item.wool_leggings.name=Pentalon de laine +item.wool_boots.name=Bottes de laine + +potion.hypothermia=Hypothermie +potion.hyperthermia=Hyperthermie +potion.thirst=Soif +potion.cold_resistance=Résistance au froid +potion.heat_resistance=Résistance à la chaleur + +potion.effect.cold_resistance_type=Potion de résistance au froid +potion.effect.long_cold_resistance_type=Potion de résistance au froid +potion.effect.heat_resistance_type=Potion de résistance à la chaleur +potion.effect.long_heat_resistance_type=Potion de résistance à la chaleur + +tipped_arrow.effect.cold_resistance_type=Flêche de résistance au froid +tipped_arrow.effect.long_cold_resistance_type=Flêche de résistance au froid +tipped_arrow.effect.heat_resistance_type=Flêche de résistance à la chaleur +tipped_arrow.effect.long_heat_resistance_type=Flêche de résistance à la chaleur diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/lang/hu_HU.lang b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/lang/hu_HU.lang new file mode 100644 index 00000000..b8a635ef --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/lang/hu_HU.lang @@ -0,0 +1,90 @@ +achievement.thirst_quencher=Szomjoltó +achievement.thirst_quencher.desc=Készíts egy kulacsot bőrből +achievement.thirst_ender=Szomjvégző +achievement.thirst_ender.desc=Készíts egy palack frissítő gyümölcslevet +achievement.campfire_song=Tábortüzi Énekek +achievement.campfire_song.desc=Gyújts egy tábortüzet, ami rönkből és zúzottkőből készül! +achievement.into_ice=Be a jégbe! +achievement.into_ice.desc=Könnyíts meg egy Fagyot a rúdjától ( ͡° ͜ʖ ͡°) +achievement.hot_or_cold=Meleg vagy Hideg +achievement.hot_or_cold.desc=Készíts hőmérőt gyémántból és kvarcból +achievement.that_time_of_year=Az évnek az a napja +achievement.that_time_of_year.desc=Készíts évszakórát kvarcból és vöröskőből +achievement.year_one=Első év +achievement.year_one.desc=Élj túl egy évet! +achievement.life_or_death=Élet vagy Halál +achievement.life_or_death.desc=Keress Pokol kastélyokat zsákmányokért, és növeld az életed! + +commands.toughasnails.usage=/toughasnails [érték] +commands.toughasnails.settemp.success=Játékos hőmérséklete átállítva: %s +commands.toughasnails.setseason.success=Évszak átállítva: %s +commands.toughasnails.setseason.fail=Érvénytelen évszak: %s + +itemGroup.tabToughAsNails=Tough As Nails + +tile.campfire.name=Tábortűz +tile.dead_crops.name=Halott Növény +tile.temperature_coil.cooling_coil.name=Hűtőtest +tile.temperature_coil.heating_coil.name=Fűtőtest +tile.season_sensor_spring.name=Évszak Érzékelő +tile.season_sensor_summer.name=Évszak Érzékelő +tile.season_sensor_autumn.name=Évszak Érzékelő +tile.season_sensor_winter.name=Évszak Érzékelő + +item.air_filter.name=Levegőszűrő +item.bottle_of_blackdamp.name=Palackozott Feketenyirok +item.bottle_of_whitedamp.name=Palackozott Fehérnyirok +item.bottle_of_firedamp.name=Palackozott Tűznyirok +item.bottle_of_stinkdamp.name=Palackozott Bűznyirok +item.clean_water_canteen.name=Tiszta Vizes Kulacs +item.charcoal_filter.name=Faszén Szűrő +item.dirty_water_canteen.name=Koszos Vizes Kulacs +item.dirty_water_bottle.name=Koszos Vizes Palack +item.empty_canteen.name=Üres Kulacs +item.filtered_water_canteen.name=Tisztított Vizes Kulacs +item.filtered_water_bottle.name=Tisztított Vizes Palack +item.freeze_powder.name=Fagypor +item.freeze_rod.name=Fagyrúd +item.ice_charge.name=Jéggolyó +item.ice_cube.name=Jégkocka +item.jelled_slime.name=Kocsonyás Nyálka +item.jelled_slime_helmet.name=Kocsonyás Nyálka Sisak +item.jelled_slime_chestplate.name=Kocsonyás Nyálka Mellvért +item.jelled_slime_leggings.name=Kocsonyás Nyálka Lábszárvédő +item.jelled_slime_boots.name=Kocsonyás Nyálka Csizma +item.juice_apple.name=Almalé +item.juice_beetroot.name=Céklalé +item.juice_cactus.name=Kaktuszlé +item.juice_carrot.name=Répalé +item.juice_chorus_fruit.name=Refréngyümölcslé +item.juice_glistering_melon.name=Ragyogó Dinnyelé +item.juice_golden_apple.name=Aranyalmalé +item.juice_golden_carrot.name=Aranyrépalé +item.juice_melon.name=Dinnyelé +item.juice_pumpkin.name=Töklé +item.lifeblood_crystal.name=Éltető Kristály +item.respirator.name=Gázmaszk +item.season_clock.name=Évszakóra +item.spawn_egg_freeze.name=Idézés: Fagy +item.tan_icon.name=TAN Ikon +item.thermometer.name=Hőmérő +item.wool_helmet.name=Gyapjúcsuklya +item.wool_chestplate.name=Gyapjúmellény +item.wool_leggings.name=Gyapjúnadrág +item.wool_boots.name=Gyapjúcsizma + +potion.hypothermia=Hipotermia +potion.hyperthermia=Hipertermia +potion.thirst=Szomj +potion.cold_resistance=Hidegvédelem +potion.heat_resistance=Hővédelem + +potion.effect.cold_resistance_type=Hidegvédelem bájitala +potion.effect.long_cold_resistance_type=Hidegvédelem bájitala +potion.effect.heat_resistance_type=Hővédelem bájitala +potion.effect.long_heat_resistance_type=Hővédelem bájitala + +tipped_arrow.effect.cold_resistance_type=Hidegvédelem nyila +tipped_arrow.effect.long_cold_resistance_type=Hidegvédelem nyila +tipped_arrow.effect.heat_resistance_type=Hővédelem nyila +tipped_arrow.effect.long_heat_resistance_type=Hővédelem nyila \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/lang/pt_PT.lang b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/lang/pt_PT.lang new file mode 100644 index 00000000..040ec5b7 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/lang/pt_PT.lang @@ -0,0 +1,98 @@ +//Made by marcoasfonseca + +achievement.thirst_quencher=Supressor de Sede +achievement.thirst_quencher.desc=Constrói um cantil a partir de couro. +achievement.thirst_ender=Fim da Sede +achievement.thirst_ender.desc=Faz uma garrafa de sumo de fruta refrescante. +achievement.campfire_song=Juntos à volta da Fogueira +achievement.campfire_song.desc=Acende uma fogueira feita de troncos e empedrado! +achievement.into_ice=Congelado +achievement.into_ice.desc=Faz com que um Freeze largue a sua vara. +achievement.hot_or_cold=Quente ou Frio +achievement.hot_or_cold.desc=Faz um tremómetro a partir de diamantes e quartzo do Nether. +achievement.that_time_of_year=Tempo do Ano +achievement.that_time_of_year.desc=Faz um relógio de estações com quartzo do Nether e redstone. +achievement.year_one=Ano 1 +achievement.year_one.desc=Subrevive um ano! +achievement.life_or_death=Uma Questão de Vida ou Morte! +achievement.life_or_death.desc=Procura nos baús duma Fortaleza do Nether uma melhoria de vida! + +commands.toughasnails.usage=/toughasnails [args] +commands.toughasnails.settemp.success=Set player temperature to %s +commands.toughasnails.settemp.disabled=Body Temperature is currently disabled! +commands.toughasnails.setseason.success=Set season to %s +commands.toughasnails.setseason.fail=Invalid season %s +commands.toughasnails.setseason.disabled=Seasons are currently disabled! + +config.category.survivalSettings.title=Definições de Subrevivência + +itemGroup.tabToughAsNails=Tough As Nails + +tile.campfire.name=Fogueira +tile.dead_crops.name=Plantação Mortas +tile.rain_collector.name=Coletor de Chuva +tile.temperature_coil.cooling_coil.name=Bobina de Arrefecimento +tile.temperature_coil.heating_coil.name=Bobina de Aquecimento +tile.season_sensor_spring.name=Sensor de Estação +tile.season_sensor_summer.name=Sensor de Estação +tile.season_sensor_autumn.name=Sensor de Estação +tile.season_sensor_winter.name=Sensor de Estação +tile.torch_new.name=Tocha + +item.air_filter.name=Filtro de Ar +item.bottle_of_blackdamp.name=Garrafa de Blackdamp +item.bottle_of_whitedamp.name=Garrafa de Whitedamp +item.bottle_of_firedamp.name=Garrafa de Firedamp +item.bottle_of_stinkdamp.name=Garrafa de Stinkdamp +item.clean_water_canteen.name=Cantil de Água Limpa +item.charcoal_filter.name=Filtro de Carvão Vegetal +item.dirty_water_canteen.name=Cantil de Água Suja +item.dirty_water_bottle.name=Garrafa de Água Suja +item.empty_canteen.name=Cantil Vazio +item.filtered_water_canteen.name=Cantil de Água Filtrada +item.filtered_water_bottle.name=Garrafa de Água Filtrada +item.freeze_powder.name=Pó de Freeze +item.freeze_rod.name=Vara de Freeze +item.ice_charge.name=Projétil de Fogo +item.ice_cube.name=Cubo de Gelo +item.jelled_slime.name=Slime Gelatinoso +item.jelled_slime_helmet.name=Capacete de Slime Gelatinoso +item.jelled_slime_chestplate.name=Peitoral de Slime Gelatinoso +item.jelled_slime_leggings.name=Perneiras de Slime Gelatinoso +item.jelled_slime_boots.name=Botas de Slime Gelatinoso +item.juice_apple.name=Sumo de Maçã +item.juice_beetroot.name=Sumo de Beterraba +item.juice_cactus.name=Sumo de Cato +item.juice_carrot.name=Sumo de Cenoura +item.juice_chorus_fruit.name=Sumo de Fruta do Coro +item.juice_glistering_melon.name=Sumo de Melancia Reluzente +item.juice_golden_apple.name=Sumo de Maçã Dourada +item.juice_golden_carrot.name=Sumo de Cenoura Dourada +item.juice_melon.name=Somo de Melancia +item.juice_pumpkin.name=Sumo de Abóbora +item.lifeblood_crystal.name=Cristal de Vida +item.respirator.name=Respirator +item.season_clock.name=Relógio de Estações +item.spawn_egg_freeze.name=Evocar Freeze +item.tan_icon.name=Ícone TAN +item.thermometer.name=Termómetro +item.wool_helmet.name=Capuz de Lã +item.wool_chestplate.name=Casaco de Lã +item.wool_leggings.name=Calças de Lã +item.wool_boots.name=Botas de Lã + +potion.hypothermia=Hipotermia +potion.hyperthermia=hipertermia +potion.thirst=Sede +potion.cold_resistance=Resistência ao Frio +potion.heat_resistance=Resistência ao Calor + +potion.effect.cold_resistance_type=Poção de Resistência ao Frio +potion.effect.long_cold_resistance_type=Poção de Resistência ao Frio +potion.effect.heat_resistance_type=Poção de Resistência ao Calor +potion.effect.long_heat_resistance_type=Poção de Resistência ao Frio + +tipped_arrow.effect.cold_resistance_type=Flecha de Resistência ao Frio +tipped_arrow.effect.long_cold_resistance_type=Flecha de Resistência ao Frio +tipped_arrow.effect.heat_resistance_type=Flecha de Resistência ao Calor +tipped_arrow.effect.long_heat_resistance_type=Flecha de Resistência ao Calor diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/lang/zh_CN.lang b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/lang/zh_CN.lang new file mode 100644 index 00000000..45e491a4 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/lang/zh_CN.lang @@ -0,0 +1,96 @@ +achievement.thirst_quencher=解渴的饮料 +achievement.thirst_quencher.desc=制作一个水壶 +achievement.thirst_ender=脱水终结者 +achievement.thirst_ender.desc=做一瓶新鲜的果汁 +achievement.campfire_song=篝火晚会 +achievement.campfire_song.desc=点燃由圆石和原木制作的篝火! +achievement.into_ice=与冰共舞 +achievement.into_ice.desc=得到一个寒冰棍 +achievement.hot_or_cold=冰与火 +achievement.hot_or_cold.desc=用钻石和下界石英做一个体温计 +achievement.that_time_of_year=一年之计 +achievement.that_time_of_year.desc=用红石和下界石英做一个季节指示器 +achievement.year_one=新年大吉 +achievement.year_one.desc=在游戏中生存下一整年! +achievement.life_or_death=生存与死亡 +achievement.life_or_death.desc=在地狱堡垒找到生命水晶并恢复生命值! + +commands.toughasnails.usage=/toughasnails [参数] +commands.toughasnails.settemp.success=已经将玩家体温设置为%s +commands.toughasnails.settemp.disabled=玩家体温目前已禁用! +commands.toughasnails.setseason.success=已经将季节设置为%s +commands.toughasnails.setseason.fail=无效的季节参数:%s +commands.toughasnails.setseason.disabled=季节目前已禁用! + +config.category.survivalSettings.title=生存设定 + +itemGroup.tabToughAsNails=意志坚定 + +tile.campfire.name=篝火 +tile.dead_crops.name=死亡的作物 +tile.rain_collector.name=雨水收集器 +tile.temperature_coil.cooling_coil.name=冷却旋管 +tile.temperature_coil.heating_coil.name=加热旋管 +tile.season_sensor_spring.name=季节传感器(春) +tile.season_sensor_summer.name=季节传感器(夏) +tile.season_sensor_autumn.name=季节传感器(秋) +tile.season_sensor_winter.name=季节传感器(冬) +tile.torch_new.name=火把 + +item.air_filter.name=空气过滤器 +item.bottle_of_blackdamp.name=一瓶窒息瓦斯 +item.bottle_of_whitedamp.name=一瓶一氧化碳 +item.bottle_of_firedamp.name=一瓶沼气 +item.bottle_of_stinkdamp.name=一瓶硫化氢 +item.clean_water_canteen.name=纯净水水壶 +item.charcoal_filter.name=活性炭过滤器 +item.dirty_water_canteen.name=脏水水壶 +item.dirty_water_bottle.name=脏水水瓶 +item.empty_canteen.name=空水壶 +item.filtered_water_canteen.name=过滤水水壶 +item.filtered_water_bottle.name=过滤水水瓶 +item.freeze_powder.name=寒冰粉 +item.freeze_rod.name=寒冰棒 +item.ice_charge.name=寒冰弹 +item.ice_cube.name=小冰块 +item.jelled_slime.name=冻结史莱姆 +item.jelled_slime_helmet.name=冻结史莱姆头盔 +item.jelled_slime_chestplate.name=冻结史莱姆胸甲 +item.jelled_slime_leggings.name=冻结史莱姆护腿 +item.jelled_slime_boots.name=冻结史莱姆靴子 +item.juice_apple.name=苹果汁 +item.juice_beetroot.name=甜菜汁 +item.juice_cactus.name=仙人掌汁 +item.juice_carrot.name=胡萝卜汁 +item.juice_chorus_fruit.name=紫影果果汁 +item.juice_glistering_melon.name=金西瓜果汁 +item.juice_golden_apple.name=金苹果果汁 +item.juice_golden_carrot.name=金胡萝卜果汁 +item.juice_melon.name=西瓜汁 +item.juice_pumpkin.name=南瓜汁 +item.lifeblood_crystal.name=生命水晶 +item.respirator.name=口罩 +item.season_clock.name=季节指示仪 +item.spawn_egg_freeze.name=生成 寒冰怪 +item.tan_icon.name=TAN图标 +item.thermometer.name=温度计 +item.wool_helmet.name=羊毛头巾 +item.wool_chestplate.name=羊毛夹克 +item.wool_leggings.name=羊毛裤子 +item.wool_boots.name=羊毛靴子 + +potion.hypothermia=伤寒 +potion.hyperthermia=中暑 +potion.thirst=脱水 +potion.cold_resistance=严寒抗性 +potion.heat_resistance=炽热抗性 + +potion.effect.cold_resistance_type=严寒抗性药水 +potion.effect.long_cold_resistance_type=严寒抗性药水 +potion.effect.heat_resistance_type=炽热抗性药水 +potion.effect.long_heat_resistance_type=炙热抗性药水 + +tipped_arrow.effect.cold_resistance_type=严寒抗性之箭 +tipped_arrow.effect.long_cold_resistance_type=严寒抗性之箭 +tipped_arrow.effect.heat_resistance_type=炙热抗性之箭 +tipped_arrow.effect.long_heat_resistance_type=炙热抗性之箭 diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/campfire.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/campfire.json new file mode 100644 index 00000000..758a3f9a --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/campfire.json @@ -0,0 +1,222 @@ +{ + "textures": { + "particle": "toughasnails:items/campfire", + "0": "minecraft:blocks/cobblestone", + "1": "minecraft:blocks/log_oak", + "2": "minecraft:blocks/log_oak_top" + }, + "elements": [ + { + "name": "Stone", + "from": [ 4.0, 0.0, 0.0 ], + "to": [ 7.0, 3.0, 3.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] } + } + }, + { + "name": "Stone", + "from": [ 9.0, 0.0, 0.0 ], + "to": [ 12.0, 3.0, 3.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] } + } + }, + { + "name": "Stone", + "from": [ 13.0, 0.0, 4.0 ], + "to": [ 16.0, 3.0, 7.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] } + } + }, + { + "name": "Stone", + "from": [ 13.0, 0.0, 9.0 ], + "to": [ 16.0, 3.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] } + } + }, + { + "name": "Stone", + "from": [ 9.0, 0.0, 13.0 ], + "to": [ 12.0, 3.0, 16.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] } + } + }, + { + "name": "Stone", + "from": [ 4.0, 0.0, 13.0 ], + "to": [ 7.0, 3.0, 16.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] } + } + }, + { + "name": "Stone", + "from": [ 0.0, 0.0, 9.0 ], + "to": [ 3.0, 3.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] } + } + }, + { + "name": "Stone", + "from": [ 0.0, 0.0, 4.0 ], + "to": [ 3.0, 3.0, 7.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] } + } + }, + { + "name": "Stone Small", + "from": [ 2.0, 0.0, 2.0 ], + "to": [ 4.0, 2.0, 4.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] } + } + }, + { + "name": "Stone Small", + "from": [ 12.0, 0.0, 2.0 ], + "to": [ 14.0, 2.0, 4.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] } + } + }, + { + "name": "Stone Small", + "from": [ 12.0, 0.0, 12.0 ], + "to": [ 14.0, 2.0, 14.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] } + } + }, + { + "name": "Stone Small", + "from": [ 2.0, 0.0, 12.0 ], + "to": [ 4.0, 2.0, 14.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] } + } + }, + { + "name": "Log", + "from": [ 7.0, 0.0, 11.0 ], + "to": [ 9.0, 8.0, 13.0 ], + "rotation": { "origin": [ 8.0, 4.0, 12.0 ], "axis": "x", "angle": -45.0 }, + "faces": { + "north": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "east": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "south": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "west": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "up": { "texture": "#2", "uv": [ 7.0, 7.0, 9.0, 9.0 ] }, + "down": { "texture": "#2", "uv": [ 7.0, 7.0, 9.0, 9.0 ] } + } + }, + { + "name": "Log", + "from": [ 11.0, 0.0, 7.0 ], + "to": [ 13.0, 8.0, 9.0 ], + "rotation": { "origin": [ 12.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 }, + "faces": { + "north": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "east": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "south": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "west": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "up": { "texture": "#2", "uv": [ 7.0, 7.0, 9.0, 9.0 ] }, + "down": { "texture": "#2", "uv": [ 7.0, 7.0, 9.0, 9.0 ] } + } + }, + { + "name": "Log", + "from": [ 7.0, 0.0, 3.0 ], + "to": [ 9.0, 8.0, 5.0 ], + "rotation": { "origin": [ 8.0, 4.0, 4.0 ], "axis": "x", "angle": 45.0 }, + "faces": { + "north": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "east": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "south": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "west": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "up": { "texture": "#2", "uv": [ 7.0, 7.0, 9.0, 9.0 ] }, + "down": { "texture": "#2", "uv": [ 7.0, 7.0, 9.0, 9.0 ] } + } + }, + { + "name": "Log", + "from": [ 3.0, 0.0, 7.0 ], + "to": [ 5.0, 8.0, 9.0 ], + "rotation": { "origin": [ 4.0, 4.0, 8.0 ], "axis": "z", "angle": -45.0 }, + "faces": { + "north": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "east": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "south": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "west": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "up": { "texture": "#2", "uv": [ 7.0, 7.0, 9.0, 9.0 ] }, + "down": { "texture": "#2", "uv": [ 7.0, 7.0, 9.0, 9.0 ] } + } + } + ] +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/campfire_out.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/campfire_out.json new file mode 100644 index 00000000..3ef10365 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/campfire_out.json @@ -0,0 +1,222 @@ +{ + "textures": { + "particle": "toughasnails:items/campfire", + "0": "minecraft:blocks/cobblestone", + "1": "toughasnails:blocks/log_burnt", + "2": "toughasnails:blocks/log_burnt_top" + }, + "elements": [ + { + "name": "Stone", + "from": [ 4.0, 0.0, 0.0 ], + "to": [ 7.0, 3.0, 3.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] } + } + }, + { + "name": "Stone", + "from": [ 9.0, 0.0, 0.0 ], + "to": [ 12.0, 3.0, 3.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] } + } + }, + { + "name": "Stone", + "from": [ 13.0, 0.0, 4.0 ], + "to": [ 16.0, 3.0, 7.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] } + } + }, + { + "name": "Stone", + "from": [ 13.0, 0.0, 9.0 ], + "to": [ 16.0, 3.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] } + } + }, + { + "name": "Stone", + "from": [ 9.0, 0.0, 13.0 ], + "to": [ 12.0, 3.0, 16.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] } + } + }, + { + "name": "Stone", + "from": [ 4.0, 0.0, 13.0 ], + "to": [ 7.0, 3.0, 16.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] } + } + }, + { + "name": "Stone", + "from": [ 0.0, 0.0, 9.0 ], + "to": [ 3.0, 3.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] } + } + }, + { + "name": "Stone", + "from": [ 0.0, 0.0, 4.0 ], + "to": [ 3.0, 3.0, 7.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] } + } + }, + { + "name": "Stone Small", + "from": [ 2.0, 0.0, 2.0 ], + "to": [ 4.0, 2.0, 4.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] } + } + }, + { + "name": "Stone Small", + "from": [ 12.0, 0.0, 2.0 ], + "to": [ 14.0, 2.0, 4.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] } + } + }, + { + "name": "Stone Small", + "from": [ 12.0, 0.0, 12.0 ], + "to": [ 14.0, 2.0, 14.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] } + } + }, + { + "name": "Stone Small", + "from": [ 2.0, 0.0, 12.0 ], + "to": [ 4.0, 2.0, 14.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] } + } + }, + { + "name": "Log", + "from": [ 7.0, 0.0, 11.0 ], + "to": [ 9.0, 8.0, 13.0 ], + "rotation": { "origin": [ 8.0, 4.0, 12.0 ], "axis": "x", "angle": -45.0 }, + "faces": { + "north": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "east": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "south": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "west": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "up": { "texture": "#2", "uv": [ 7.0, 7.0, 9.0, 9.0 ] }, + "down": { "texture": "#2", "uv": [ 7.0, 7.0, 9.0, 9.0 ] } + } + }, + { + "name": "Log", + "from": [ 11.0, 0.0, 7.0 ], + "to": [ 13.0, 8.0, 9.0 ], + "rotation": { "origin": [ 12.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 }, + "faces": { + "north": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "east": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "south": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "west": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "up": { "texture": "#2", "uv": [ 7.0, 7.0, 9.0, 9.0 ] }, + "down": { "texture": "#2", "uv": [ 7.0, 7.0, 9.0, 9.0 ] } + } + }, + { + "name": "Log", + "from": [ 7.0, 0.0, 3.0 ], + "to": [ 9.0, 8.0, 5.0 ], + "rotation": { "origin": [ 8.0, 4.0, 4.0 ], "axis": "x", "angle": 45.0 }, + "faces": { + "north": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "east": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "south": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "west": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "up": { "texture": "#2", "uv": [ 7.0, 7.0, 9.0, 9.0 ] }, + "down": { "texture": "#2", "uv": [ 7.0, 7.0, 9.0, 9.0 ] } + } + }, + { + "name": "Log", + "from": [ 3.0, 0.0, 7.0 ], + "to": [ 5.0, 8.0, 9.0 ], + "rotation": { "origin": [ 4.0, 4.0, 8.0 ], "axis": "z", "angle": -45.0 }, + "faces": { + "north": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "east": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "south": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "west": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 8.0 ] }, + "up": { "texture": "#2", "uv": [ 7.0, 7.0, 9.0, 9.0 ] }, + "down": { "texture": "#2", "uv": [ 7.0, 7.0, 9.0, 9.0 ] } + } + } + ] +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/chiller.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/chiller.json new file mode 100644 index 00000000..a047391c --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/chiller.json @@ -0,0 +1,8 @@ +{ + "parent": "block/orientable", + "textures": { + "top": "blocks/furnace_top", + "front": "toughasnails:blocks/chiller", + "side": "blocks/furnace_side" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/cooling_coil_off.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/cooling_coil_off.json new file mode 100644 index 00000000..116e4495 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/cooling_coil_off.json @@ -0,0 +1,179 @@ +{ + "parent": "block/block", + "textures": { + "particle": "blocks/furnace_top", + "0": "toughasnails:blocks/cooling_coil_off", + "1": "blocks/furnace_top" + }, + "elements": [ + { + "name": "Base", + "from": [ 0.0, 0.0, 0.0 ], + "to": [ 16.0, 2.0, 16.0 ], + "faces": { + "north": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "east": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "south": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "west": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "up": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }, + "down": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] } + } + }, + { + "name": "Coil Rod", + "from": [ 2.0, 2.0, 2.0 ], + "to": [ 14.0, 4.0, 4.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod", + "from": [ 2.0, 2.0, 12.0 ], + "to": [ 14.0, 4.0, 14.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod", + "from": [ 2.0, 2.0, 4.0 ], + "to": [ 4.0, 4.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] } + } + }, + { + "name": "Coil Rod", + "from": [ 12.0, 2.0, 4.0 ], + "to": [ 14.0, 4.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 15.0 ] } + } + }, + { + "name": "Coil Rod 2", + "from": [ 2.0, 6.0, 2.0 ], + "to": [ 14.0, 8.0, 4.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod 2", + "from": [ 2.0, 6.0, 12.0 ], + "to": [ 14.0, 8.0, 14.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod 2", + "from": [ 2.0, 6.0, 4.0 ], + "to": [ 4.0, 8.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] } + } + }, + { + "name": "Coil Rod 2", + "from": [ 12.0, 6.0, 4.0 ], + "to": [ 14.0, 8.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 15.0 ] } + } + }, + { + "name": "Coil Rod 3", + "from": [ 2.0, 10.0, 2.0 ], + "to": [ 14.0, 12.0, 4.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod 3", + "from": [ 2.0, 10.0, 12.0 ], + "to": [ 14.0, 12.0, 14.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod 3", + "from": [ 2.0, 10.0, 4.0 ], + "to": [ 4.0, 12.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] } + } + }, + { + "name": "Coil Rod 3", + "from": [ 12.0, 10.0, 4.0 ], + "to": [ 14.0, 12.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 15.0 ] } + } + } + ] +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/cooling_coil_on.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/cooling_coil_on.json new file mode 100644 index 00000000..775cc3c0 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/cooling_coil_on.json @@ -0,0 +1,179 @@ +{ + "parent": "block/block", + "textures": { + "particle": "blocks/furnace_top", + "0": "toughasnails:blocks/cooling_coil_on", + "1": "blocks/furnace_top" + }, + "elements": [ + { + "name": "Base", + "from": [ 0.0, 0.0, 0.0 ], + "to": [ 16.0, 2.0, 16.0 ], + "faces": { + "north": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "east": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "south": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "west": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "up": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }, + "down": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] } + } + }, + { + "name": "Coil Rod", + "from": [ 2.0, 2.0, 2.0 ], + "to": [ 14.0, 4.0, 4.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod", + "from": [ 2.0, 2.0, 12.0 ], + "to": [ 14.0, 4.0, 14.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod", + "from": [ 2.0, 2.0, 4.0 ], + "to": [ 4.0, 4.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] } + } + }, + { + "name": "Coil Rod", + "from": [ 12.0, 2.0, 4.0 ], + "to": [ 14.0, 4.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 15.0 ] } + } + }, + { + "name": "Coil Rod 2", + "from": [ 2.0, 6.0, 2.0 ], + "to": [ 14.0, 8.0, 4.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod 2", + "from": [ 2.0, 6.0, 12.0 ], + "to": [ 14.0, 8.0, 14.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod 2", + "from": [ 2.0, 6.0, 4.0 ], + "to": [ 4.0, 8.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] } + } + }, + { + "name": "Coil Rod 2", + "from": [ 12.0, 6.0, 4.0 ], + "to": [ 14.0, 8.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 15.0 ] } + } + }, + { + "name": "Coil Rod 3", + "from": [ 2.0, 10.0, 2.0 ], + "to": [ 14.0, 12.0, 4.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod 3", + "from": [ 2.0, 10.0, 12.0 ], + "to": [ 14.0, 12.0, 14.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod 3", + "from": [ 2.0, 10.0, 4.0 ], + "to": [ 4.0, 12.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] } + } + }, + { + "name": "Coil Rod 3", + "from": [ 12.0, 10.0, 4.0 ], + "to": [ 14.0, 12.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 15.0 ] } + } + } + ] +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/dead_crops.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/dead_crops.json new file mode 100644 index 00000000..74760ff3 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/dead_crops.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "toughasnails:blocks/dead_crops" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/fireplace.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/fireplace.json new file mode 100644 index 00000000..167f9ab8 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/fireplace.json @@ -0,0 +1,135 @@ +{ + "parent": "block/block", + "textures": { + "particle": "blocks/brick", + "0": "blocks/brick", + "1": "blocks/log_oak", + "2": "blocks/log_oak_top", + "3": "blocks/iron_bars", + "4": "blocks/fire_layer_0" + }, + "elements": [ + { + "name": "Bottom", + "from": [ 0.0, 0.0, 4.0 ], + "to": [ 16.0, 2.0, 16.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 14.0, 12.0, 16.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] }, + "west": { "texture": "#0", "uv": [ 4.0, 14.0, 16.0, 16.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 12.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 4.0, 16.0, 16.0 ] } + } + }, + { + "name": "Wall", + "from": [ 0.0, 2.0, 4.0 ], + "to": [ 2.0, 10.0, 14.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 14.0, 6.0, 16.0, 14.0 ] }, + "east": { "texture": "#0", "uv": [ 2.0, 6.0, 12.0, 14.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 6.0, 2.0, 14.0 ] }, + "west": { "texture": "#0", "uv": [ 4.0, 6.0, 14.0, 14.0 ] }, + "up": { "texture": "#0", "uv": [ 14.0, 2.0, 16.0, 12.0 ] }, + "down": { "texture": "#0", "uv": [ 14.0, 4.0, 16.0, 14.0 ] } + } + }, + { + "name": "Wall", + "from": [ 14.0, 2.0, 4.0 ], + "to": [ 16.0, 10.0, 14.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 6.0, 2.0, 14.0 ] }, + "east": { "texture": "#0", "uv": [ 2.0, 6.0, 12.0, 14.0 ] }, + "south": { "texture": "#0", "uv": [ 14.0, 6.0, 16.0, 14.0 ] }, + "west": { "texture": "#0", "uv": [ 4.0, 6.0, 14.0, 14.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 2.0, 2.0, 12.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 4.0, 2.0, 14.0 ] } + } + }, + { + "name": "Back", + "from": [ 0.0, 2.0, 14.0 ], + "to": [ 16.0, 10.0, 16.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 6.0, 16.0, 14.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 6.0, 2.0, 14.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 6.0, 16.0, 14.0 ] }, + "west": { "texture": "#0", "uv": [ 14.0, 6.0, 16.0, 14.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] } + } + }, + { + "name": "Top", + "from": [ 0.0, 10.0, 4.0 ], + "to": [ 16.0, 13.0, 16.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 3.0, 16.0, 6.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 3.0, 12.0, 6.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 3.0, 16.0, 6.0 ] }, + "west": { "texture": "#0", "uv": [ 4.0, 3.0, 16.0, 6.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 12.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 4.0, 16.0, 16.0 ] } + } + }, + { + "name": "Upper Top", + "from": [ 2.0, 13.0, 6.0 ], + "to": [ 14.0, 15.0, 14.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 2.0, 1.0, 14.0, 3.0 ] }, + "east": { "texture": "#0", "uv": [ 2.0, 1.0, 10.0, 3.0 ] }, + "south": { "texture": "#0", "uv": [ 2.0, 1.0, 14.0, 3.0 ] }, + "west": { "texture": "#0", "uv": [ 6.0, 1.0, 14.0, 3.0 ] }, + "up": { "texture": "#0", "uv": [ 2.0, 2.0, 14.0, 10.0 ] }, + "down": { "texture": "#0", "uv": [ 2.0, 6.0, 14.0, 14.0 ] } + } + }, + { + "name": "Peak", + "from": [ 4.0, 15.0, 8.0 ], + "to": [ 12.0, 16.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 4.0, 0.0, 12.0, 1.0 ] }, + "east": { "texture": "#0", "uv": [ 4.0, 0.0, 8.0, 1.0 ] }, + "south": { "texture": "#0", "uv": [ 4.0, 0.0, 12.0, 1.0 ] }, + "west": { "texture": "#0", "uv": [ 8.0, 0.0, 12.0, 1.0 ] }, + "up": { "texture": "#0", "uv": [ 4.0, 4.0, 12.0, 8.0 ] }, + "down": { "texture": "#0", "uv": [ 4.0, 8.0, 12.0, 12.0 ] } + } + }, + { + "name": "Log", + "from": [ 2.0, 2.0, 9.0 ], + "to": [ 14.0, 4.0, 13.0 ], + "faces": { + "north": { "texture": "#1", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "east": { "texture": "#2", "uv": [ 6.0, 7.0, 10.0, 9.0 ] }, + "south": { "texture": "#1", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "west": { "texture": "#2", "uv": [ 6.0, 7.0, 10.0, 9.0 ] }, + "up": { "texture": "#1", "uv": [ 6.0, 2.0, 10.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#1", "uv": [ 6.0, 2.0, 10.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Guard", + "from": [ 2.0, 2.0, 5.0 ], + "to": [ 14.0, 4.0, 5.0 ], + "faces": { + "north": { "texture": "#3", "uv": [ 2.0, 0.0, 14.0, 2.0 ] }, + "south": { "texture": "#3", "uv": [ 2.0, 0.0, 14.0, 2.0 ] } + } + }, + { + "name": "Fire", + "from": [ 2.0, 4.0, 11.0 ], + "to": [ 14.0, 10.0, 11.0 ], + "faces": { + "north": { "texture": "#4", "uv": [ 2.0, 6.0, 14.0, 12.0 ] }, + "south": { "texture": "#4", "uv": [ 2.0, 6.0, 14.0, 12.0 ] } + } + } + ] +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/glowstone_torch.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/glowstone_torch.json new file mode 100644 index 00000000..2491e5cb --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/glowstone_torch.json @@ -0,0 +1,6 @@ +{ + "parent": "block/torch", + "textures": { + "torch": "toughasnails:blocks/glowstone_torch" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/glowstone_torch_wall.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/glowstone_torch_wall.json new file mode 100644 index 00000000..41604e90 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/glowstone_torch_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "block/torch_wall", + "textures": { + "torch": "toughasnails:blocks/glowstone_torch" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/heating_coil_off.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/heating_coil_off.json new file mode 100644 index 00000000..fd8793c5 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/heating_coil_off.json @@ -0,0 +1,179 @@ +{ + "parent": "block/block", + "textures": { + "particle": "blocks/furnace_top", + "0": "toughasnails:blocks/heating_coil_off", + "1": "blocks/furnace_top" + }, + "elements": [ + { + "name": "Base", + "from": [ 0.0, 0.0, 0.0 ], + "to": [ 16.0, 2.0, 16.0 ], + "faces": { + "north": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "east": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "south": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "west": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "up": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }, + "down": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] } + } + }, + { + "name": "Coil Rod", + "from": [ 2.0, 2.0, 2.0 ], + "to": [ 14.0, 4.0, 4.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod", + "from": [ 2.0, 2.0, 12.0 ], + "to": [ 14.0, 4.0, 14.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod", + "from": [ 2.0, 2.0, 4.0 ], + "to": [ 4.0, 4.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] } + } + }, + { + "name": "Coil Rod", + "from": [ 12.0, 2.0, 4.0 ], + "to": [ 14.0, 4.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 15.0 ] } + } + }, + { + "name": "Coil Rod 2", + "from": [ 2.0, 6.0, 2.0 ], + "to": [ 14.0, 8.0, 4.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod 2", + "from": [ 2.0, 6.0, 12.0 ], + "to": [ 14.0, 8.0, 14.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod 2", + "from": [ 2.0, 6.0, 4.0 ], + "to": [ 4.0, 8.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] } + } + }, + { + "name": "Coil Rod 2", + "from": [ 12.0, 6.0, 4.0 ], + "to": [ 14.0, 8.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 15.0 ] } + } + }, + { + "name": "Coil Rod 3", + "from": [ 2.0, 10.0, 2.0 ], + "to": [ 14.0, 12.0, 4.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod 3", + "from": [ 2.0, 10.0, 12.0 ], + "to": [ 14.0, 12.0, 14.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod 3", + "from": [ 2.0, 10.0, 4.0 ], + "to": [ 4.0, 12.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] } + } + }, + { + "name": "Coil Rod 3", + "from": [ 12.0, 10.0, 4.0 ], + "to": [ 14.0, 12.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 15.0 ] } + } + } + ] +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/heating_coil_on.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/heating_coil_on.json new file mode 100644 index 00000000..5dccd987 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/heating_coil_on.json @@ -0,0 +1,179 @@ +{ + "parent": "block/block", + "textures": { + "particle": "blocks/furnace_top", + "0": "toughasnails:blocks/heating_coil_on", + "1": "blocks/furnace_top" + }, + "elements": [ + { + "name": "Base", + "from": [ 0.0, 0.0, 0.0 ], + "to": [ 16.0, 2.0, 16.0 ], + "faces": { + "north": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "east": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "south": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "west": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "up": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }, + "down": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] } + } + }, + { + "name": "Coil Rod", + "from": [ 2.0, 2.0, 2.0 ], + "to": [ 14.0, 4.0, 4.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod", + "from": [ 2.0, 2.0, 12.0 ], + "to": [ 14.0, 4.0, 14.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod", + "from": [ 2.0, 2.0, 4.0 ], + "to": [ 4.0, 4.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] } + } + }, + { + "name": "Coil Rod", + "from": [ 12.0, 2.0, 4.0 ], + "to": [ 14.0, 4.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 15.0 ] } + } + }, + { + "name": "Coil Rod 2", + "from": [ 2.0, 6.0, 2.0 ], + "to": [ 14.0, 8.0, 4.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod 2", + "from": [ 2.0, 6.0, 12.0 ], + "to": [ 14.0, 8.0, 14.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod 2", + "from": [ 2.0, 6.0, 4.0 ], + "to": [ 4.0, 8.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] } + } + }, + { + "name": "Coil Rod 2", + "from": [ 12.0, 6.0, 4.0 ], + "to": [ 14.0, 8.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 15.0 ] } + } + }, + { + "name": "Coil Rod 3", + "from": [ 2.0, 10.0, 2.0 ], + "to": [ 14.0, 12.0, 4.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod 3", + "from": [ 2.0, 10.0, 12.0 ], + "to": [ 14.0, 12.0, 14.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "east": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 2.0 ], "rotation": 90 }, + "west": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 }, + "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Coil Rod 3", + "from": [ 2.0, 10.0, 4.0 ], + "to": [ 4.0, 12.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] } + } + }, + { + "name": "Coil Rod 3", + "from": [ 12.0, 10.0, 4.0 ], + "to": [ 14.0, 12.0, 12.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "south": { "texture": "#0", "uv": [ 7.0, 0.0, 9.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ], "rotation": 90 }, + "up": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 11.0 ] }, + "down": { "texture": "#0", "uv": [ 7.0, 3.0, 9.0, 15.0 ] } + } + } + ] +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/new_torch.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/new_torch.json new file mode 100644 index 00000000..d3823dc4 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/new_torch.json @@ -0,0 +1,6 @@ +{ + "parent": "block/torch", + "textures": { + "torch": "toughasnails:blocks/torch_off" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/new_torch_wall.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/new_torch_wall.json new file mode 100644 index 00000000..cc246380 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/new_torch_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "block/torch_wall", + "textures": { + "torch": "toughasnails:blocks/torch_off" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/rain_collector_empty.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/rain_collector_empty.json new file mode 100644 index 00000000..5b1af48c --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/rain_collector_empty.json @@ -0,0 +1,74 @@ +{ + "parent": "block/block", + "ambientocclusion": false, + "textures": { + "particle": "toughasnails:blocks/rain_collector_side", + "top": "toughasnails:blocks/rain_collector_top", + "bottom": "toughasnails:blocks/rain_collector_bottom", + "side": "toughasnails:blocks/rain_collector_side", + "inside": "toughasnails:blocks/rain_collector_inner" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 2, 16, 16 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side", "cullface": "west" }, + "east": { "texture": "#side" } + } + }, + { "from": [ 2, 0, 2 ], + "to": [ 14, 4, 14 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#inside", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side", "cullface": "west" }, + "east": { "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 14, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side" }, + "east": { "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 0, 0 ], + "to": [ 14, 16, 2 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side" }, + "west": { "texture": "#side", "cullface": "west" }, + "east": { "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 0, 14 ], + "to": [ 14, 16, 16 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side", "cullface": "west" }, + "east": { "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 16, 2 ], + "to": [ 14, 16, 14 ], + "faces": { + "up": { "texture": "#top" } + } + } + ] +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/rain_collector_level1.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/rain_collector_level1.json new file mode 100644 index 00000000..500c4749 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/rain_collector_level1.json @@ -0,0 +1,80 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "toughasnails:blocks/rain_collector_side", + "top": "toughasnails:blocks/rain_collector_top", + "bottom": "toughasnails:blocks/rain_collector_bottom", + "side": "toughasnails:blocks/rain_collector_side", + "inside": "toughasnails:blocks/rain_collector_inner", + "water": "blocks/water_still" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 2, 16, 16 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side", "cullface": "west" }, + "east": { "texture": "#side" } + } + }, + { "from": [ 2, 0, 2 ], + "to": [ 14, 4, 14 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#inside", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side", "cullface": "west" }, + "east": { "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 14, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side" }, + "east": { "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 0, 0 ], + "to": [ 14, 16, 2 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side" }, + "west": { "texture": "#side", "cullface": "west" }, + "east": { "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 0, 14 ], + "to": [ 14, 16, 16 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side", "cullface": "west" }, + "east": { "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 16, 2 ], + "to": [ 14, 16, 14 ], + "faces": { + "up": { "texture": "#top" } + } + }, + { "from": [ 2, 9, 2 ], + "to": [ 14, 9, 14 ], + "faces": { + "up": { "texture": "#water" } + } + } + ] +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/rain_collector_level2.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/rain_collector_level2.json new file mode 100644 index 00000000..e21df12f --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/rain_collector_level2.json @@ -0,0 +1,80 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "toughasnails:blocks/rain_collector_side", + "top": "toughasnails:blocks/rain_collector_top", + "bottom": "toughasnails:blocks/rain_collector_bottom", + "side": "toughasnails:blocks/rain_collector_side", + "inside": "toughasnails:blocks/rain_collector_inner", + "water": "blocks/water_still" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 2, 16, 16 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side", "cullface": "west" }, + "east": { "texture": "#side" } + } + }, + { "from": [ 2, 0, 2 ], + "to": [ 14, 4, 14 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#inside", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side", "cullface": "west" }, + "east": { "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 14, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side" }, + "east": { "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 0, 0 ], + "to": [ 14, 16, 2 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side" }, + "west": { "texture": "#side", "cullface": "west" }, + "east": { "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 0, 14 ], + "to": [ 14, 16, 16 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side", "cullface": "west" }, + "east": { "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 16, 2 ], + "to": [ 14, 16, 14 ], + "faces": { + "up": { "texture": "#top" } + } + }, + { "from": [ 2, 12, 2 ], + "to": [ 14, 12, 14 ], + "faces": { + "up": { "texture": "#water" } + } + } + ] +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/rain_collector_level3.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/rain_collector_level3.json new file mode 100644 index 00000000..23bd49a0 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/rain_collector_level3.json @@ -0,0 +1,81 @@ +{ + "parent": "block/block", + "ambientocclusion": false, + "textures": { + "particle": "toughasnails:blocks/rain_collector_side", + "top": "toughasnails:blocks/rain_collector_top", + "bottom": "toughasnails:blocks/rain_collector_bottom", + "side": "toughasnails:blocks/rain_collector_side", + "inside": "toughasnails:blocks/rain_collector_inner", + "water": "blocks/water_still" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 2, 16, 16 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side", "cullface": "west" }, + "east": { "texture": "#side" } + } + }, + { "from": [ 2, 0, 2 ], + "to": [ 14, 4, 14 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#inside", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side", "cullface": "west" }, + "east": { "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 14, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side" }, + "east": { "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 0, 0 ], + "to": [ 14, 16, 2 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side" }, + "west": { "texture": "#side", "cullface": "west" }, + "east": { "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 0, 14 ], + "to": [ 14, 16, 16 ], + "faces": { + "down": { "texture": "#bottom" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side", "cullface": "west" }, + "east": { "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 16, 2 ], + "to": [ 14, 16, 14 ], + "faces": { + "up": { "texture": "#top" } + } + }, + { "from": [ 2, 15, 2 ], + "to": [ 14, 15, 14 ], + "faces": { + "up": { "texture": "#water" } + } + } + ] +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/season_sensor_autumn.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/season_sensor_autumn.json new file mode 100644 index 00000000..a22d1afa --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/season_sensor_autumn.json @@ -0,0 +1,20 @@ +{ "parent": "block/thin_block", + "textures": { + "particle": "toughasnails:blocks/season_sensor_autumn_top", + "top": "toughasnails:blocks/season_sensor_autumn_top", + "side": "toughasnails:blocks/season_sensor_side" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 6, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "east" } + } + } + ] +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/season_sensor_spring.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/season_sensor_spring.json new file mode 100644 index 00000000..22e54165 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/season_sensor_spring.json @@ -0,0 +1,20 @@ +{ "parent": "block/thin_block", + "textures": { + "particle": "toughasnails:blocks/season_sensor_spring_top", + "top": "toughasnails:blocks/season_sensor_spring_top", + "side": "toughasnails:blocks/season_sensor_side" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 6, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "east" } + } + } + ] +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/season_sensor_summer.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/season_sensor_summer.json new file mode 100644 index 00000000..02d2afdb --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/season_sensor_summer.json @@ -0,0 +1,20 @@ +{ "parent": "block/thin_block", + "textures": { + "particle": "toughasnails:blocks/season_sensor_summer_top", + "top": "toughasnails:blocks/season_sensor_summer_top", + "side": "toughasnails:blocks/season_sensor_side" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 6, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "east" } + } + } + ] +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/season_sensor_winter.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/season_sensor_winter.json new file mode 100644 index 00000000..83b0b10c --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/block/season_sensor_winter.json @@ -0,0 +1,20 @@ +{ "parent": "block/thin_block", + "textures": { + "particle": "toughasnails:blocks/season_sensor_winter_top", + "top": "toughasnails:blocks/season_sensor_winter_top", + "side": "toughasnails:blocks/season_sensor_side" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 6, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "east" } + } + } + ] +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/air_filter.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/air_filter.json new file mode 100644 index 00000000..70dd7318 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/air_filter.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/air_filter" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/bottle_of_blackdamp.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/bottle_of_blackdamp.json new file mode 100644 index 00000000..56a20a54 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/bottle_of_blackdamp.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/bottle_of_blackdamp" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/bottle_of_firedamp.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/bottle_of_firedamp.json new file mode 100644 index 00000000..6dc3e495 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/bottle_of_firedamp.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/bottle_of_firedamp" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/bottle_of_stinkdamp.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/bottle_of_stinkdamp.json new file mode 100644 index 00000000..4de96ed7 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/bottle_of_stinkdamp.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/bottle_of_stinkdamp" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/bottle_of_whitedamp.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/bottle_of_whitedamp.json new file mode 100644 index 00000000..3e5b6ff5 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/bottle_of_whitedamp.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/bottle_of_whitedamp" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/campfire.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/campfire.json new file mode 100644 index 00000000..1b6d1fb7 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/campfire.json @@ -0,0 +1,7 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/campfire" + } +} + diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/canteen.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/canteen.json new file mode 100644 index 00000000..7e608038 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/canteen.json @@ -0,0 +1,10 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/canteen_empty" + }, + "overrides": [ + { "predicate": { "filled": 0.0 }, "model": "toughasnails:item/canteen" }, + { "predicate": { "filled": 1.0 }, "model": "toughasnails:item/canteen_filled" } + ] +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/canteen_empty.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/canteen_empty.json new file mode 100644 index 00000000..569114fe --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/canteen_empty.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/canteen_empty" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/canteen_filled.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/canteen_filled.json new file mode 100644 index 00000000..3717343c --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/canteen_filled.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/canteen_filled" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/charcoal_filter.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/charcoal_filter.json new file mode 100644 index 00000000..4290040b --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/charcoal_filter.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/charcoal_filter" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/chiller.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/chiller.json new file mode 100644 index 00000000..11058635 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/chiller.json @@ -0,0 +1,3 @@ +{ + "parent": "toughasnails:block/chiller" +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/cooling_coil.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/cooling_coil.json new file mode 100644 index 00000000..d135c7ef --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/cooling_coil.json @@ -0,0 +1,7 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/cooling_coil" + } +} + diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/dead_crops.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/dead_crops.json new file mode 100644 index 00000000..f63717c9 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/dead_crops.json @@ -0,0 +1,7 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:blocks/dead_crops" + } +} + diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/dirty_water_bottle.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/dirty_water_bottle.json new file mode 100644 index 00000000..d0a1ae57 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/dirty_water_bottle.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/dirty_water_bottle" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/filtered_water_bottle.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/filtered_water_bottle.json new file mode 100644 index 00000000..4ce0eb97 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/filtered_water_bottle.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/filtered_water_bottle" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/fireplace.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/fireplace.json new file mode 100644 index 00000000..b3206a12 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/fireplace.json @@ -0,0 +1,3 @@ +{ + "parent": "toughasnails:block/fireplace" +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/freeze_powder.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/freeze_powder.json new file mode 100644 index 00000000..58a32ccd --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/freeze_powder.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/freeze_powder" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/freeze_rod.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/freeze_rod.json new file mode 100644 index 00000000..016b0475 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/freeze_rod.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/freeze_rod" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/glowstone_torch.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/glowstone_torch.json new file mode 100644 index 00000000..ecfa08fb --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/glowstone_torch.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:blocks/glowstone_torch" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/heating_coil.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/heating_coil.json new file mode 100644 index 00000000..86ea4d6c --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/heating_coil.json @@ -0,0 +1,7 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/heating_coil" + } +} + diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/ice_charge.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/ice_charge.json new file mode 100644 index 00000000..1cf98cf2 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/ice_charge.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/ice_charge" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/ice_cube.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/ice_cube.json new file mode 100644 index 00000000..d41d82bf --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/ice_cube.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/ice_cube" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/jelled_slime.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/jelled_slime.json new file mode 100644 index 00000000..4ae6ea18 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/jelled_slime.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/jelled_slime" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/jelled_slime_boots.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/jelled_slime_boots.json new file mode 100644 index 00000000..7ae4c8a9 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/jelled_slime_boots.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/jelled_slime_boots" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/jelled_slime_chestplate.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/jelled_slime_chestplate.json new file mode 100644 index 00000000..a5162544 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/jelled_slime_chestplate.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/jelled_slime_chestplate" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/jelled_slime_helmet.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/jelled_slime_helmet.json new file mode 100644 index 00000000..acf872d1 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/jelled_slime_helmet.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/jelled_slime_helmet" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/jelled_slime_leggings.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/jelled_slime_leggings.json new file mode 100644 index 00000000..a87fbbd5 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/jelled_slime_leggings.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/jelled_slime_leggings" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_apple.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_apple.json new file mode 100644 index 00000000..f25f5e3a --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_apple.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/juice_apple" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_beetroot.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_beetroot.json new file mode 100644 index 00000000..fec5f365 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_beetroot.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/juice_beetroot" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_cactus.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_cactus.json new file mode 100644 index 00000000..4312c157 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_cactus.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/juice_cactus" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_carrot.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_carrot.json new file mode 100644 index 00000000..7ebcebb2 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_carrot.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/juice_carrot" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_chorus_fruit.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_chorus_fruit.json new file mode 100644 index 00000000..f77cca8b --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_chorus_fruit.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/juice_chorus_fruit" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_glistering_melon.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_glistering_melon.json new file mode 100644 index 00000000..e475b596 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_glistering_melon.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/juice_glistering_melon" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_golden_apple.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_golden_apple.json new file mode 100644 index 00000000..af8df458 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_golden_apple.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/juice_golden_apple" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_golden_carrot.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_golden_carrot.json new file mode 100644 index 00000000..3de39168 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_golden_carrot.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/juice_golden_carrot" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_melon.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_melon.json new file mode 100644 index 00000000..cc4935d2 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_melon.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/juice_melon" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_pumpkin.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_pumpkin.json new file mode 100644 index 00000000..9257be8e --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/juice_pumpkin.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/juice_pumpkin" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/lifeblood_crystal.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/lifeblood_crystal.json new file mode 100644 index 00000000..650dbd7a --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/lifeblood_crystal.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/lifeblood_crystal" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/rain_collector.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/rain_collector.json new file mode 100644 index 00000000..c48326f3 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/rain_collector.json @@ -0,0 +1,7 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/rain_collector" + } +} + diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/respirator.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/respirator.json new file mode 100644 index 00000000..5fd17603 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/respirator.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/respirator" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock.json new file mode 100644 index 00000000..a6af7a48 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock.json @@ -0,0 +1,32 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_00" + }, + "overrides": [ + { "predicate": { "time": 0.0000000000000000 }, "model": "toughasnails:item/season_clock" }, + { "predicate": { "time": 0.0416666666666665 }, "model": "toughasnails:item/season_clock_01" }, + { "predicate": { "time": 0.0833333333333332 }, "model": "toughasnails:item/season_clock_02" }, + { "predicate": { "time": 0.1249999999999999 }, "model": "toughasnails:item/season_clock_03" }, + { "predicate": { "time": 0.1666666666666666 }, "model": "toughasnails:item/season_clock_04" }, + { "predicate": { "time": 0.2083333333333333 }, "model": "toughasnails:item/season_clock_05" }, + { "predicate": { "time": 0.2500000000000000 }, "model": "toughasnails:item/season_clock_06" }, + { "predicate": { "time": 0.2916666666666667 }, "model": "toughasnails:item/season_clock_07" }, + { "predicate": { "time": 0.3333333333333334 }, "model": "toughasnails:item/season_clock_08" }, + { "predicate": { "time": 0.3750000000000001 }, "model": "toughasnails:item/season_clock_09" }, + { "predicate": { "time": 0.4166666666666668 }, "model": "toughasnails:item/season_clock_10" }, + { "predicate": { "time": 0.4583333333333335 }, "model": "toughasnails:item/season_clock_11" }, + { "predicate": { "time": 0.5000000000000000 }, "model": "toughasnails:item/season_clock_12" }, + { "predicate": { "time": 0.5416666666666667 }, "model": "toughasnails:item/season_clock_13" }, + { "predicate": { "time": 0.5833333333333334 }, "model": "toughasnails:item/season_clock_14" }, + { "predicate": { "time": 0.6250000000000001 }, "model": "toughasnails:item/season_clock_15" }, + { "predicate": { "time": 0.6666666666666668 }, "model": "toughasnails:item/season_clock_16" }, + { "predicate": { "time": 0.7083333333333335 }, "model": "toughasnails:item/season_clock_17" }, + { "predicate": { "time": 0.7500000000000000 }, "model": "toughasnails:item/season_clock_18" }, + { "predicate": { "time": 0.7916666666666667 }, "model": "toughasnails:item/season_clock_19" }, + { "predicate": { "time": 0.8333333333333334 }, "model": "toughasnails:item/season_clock_20" }, + { "predicate": { "time": 0.8750000000000001 }, "model": "toughasnails:item/season_clock_21" }, + { "predicate": { "time": 0.9166666666666668 }, "model": "toughasnails:item/season_clock_22" }, + { "predicate": { "time": 0.9583333333333335 }, "model": "toughasnails:item/season_clock_23" } + ] +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_00.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_00.json new file mode 100644 index 00000000..f03f1e33 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_00.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_00" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_01.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_01.json new file mode 100644 index 00000000..081ecbc8 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_01.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_01" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_02.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_02.json new file mode 100644 index 00000000..2cbfed5e --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_02.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_02" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_03.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_03.json new file mode 100644 index 00000000..25adfdf2 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_03.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_03" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_04.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_04.json new file mode 100644 index 00000000..d67c1a4c --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_04.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_04" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_05.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_05.json new file mode 100644 index 00000000..b74cf52d --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_05.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_05" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_06.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_06.json new file mode 100644 index 00000000..0bd92cd9 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_06.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_06" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_07.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_07.json new file mode 100644 index 00000000..685c02a7 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_07.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_07" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_08.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_08.json new file mode 100644 index 00000000..d657ee7e --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_08.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_08" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_09.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_09.json new file mode 100644 index 00000000..d0635214 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_09.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_09" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_10.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_10.json new file mode 100644 index 00000000..1957647d --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_10.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_10" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_11.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_11.json new file mode 100644 index 00000000..f1ace506 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_11.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_11" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_12.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_12.json new file mode 100644 index 00000000..a9f9f4c2 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_12.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_12" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_13.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_13.json new file mode 100644 index 00000000..e46179f3 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_13.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_13" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_14.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_14.json new file mode 100644 index 00000000..88f4e9ec --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_14.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_14" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_15.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_15.json new file mode 100644 index 00000000..609627f2 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_15.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_15" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_16.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_16.json new file mode 100644 index 00000000..5f1bb16a --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_16.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_16" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_17.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_17.json new file mode 100644 index 00000000..cbe42361 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_17.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_17" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_18.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_18.json new file mode 100644 index 00000000..ac768925 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_18.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_18" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_19.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_19.json new file mode 100644 index 00000000..6f899193 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_19.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_19" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_20.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_20.json new file mode 100644 index 00000000..c1305516 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_20.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_20" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_21.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_21.json new file mode 100644 index 00000000..fbf71ffb --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_21.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_21" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_22.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_22.json new file mode 100644 index 00000000..8804bf0b --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_22.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_22" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_23.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_23.json new file mode 100644 index 00000000..47cd6ec8 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_clock_23.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/season_clock_23" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_sensor_autumn.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_sensor_autumn.json new file mode 100644 index 00000000..92087f4a --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_sensor_autumn.json @@ -0,0 +1,4 @@ +{ + "parent": "toughasnails:block/season_sensor_autumn" +} + diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_sensor_spring.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_sensor_spring.json new file mode 100644 index 00000000..240fdbb6 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_sensor_spring.json @@ -0,0 +1,4 @@ +{ + "parent": "toughasnails:block/season_sensor_spring" +} + diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_sensor_summer.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_sensor_summer.json new file mode 100644 index 00000000..0195d50d --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_sensor_summer.json @@ -0,0 +1,4 @@ +{ + "parent": "toughasnails:block/season_sensor_summer" +} + diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_sensor_winter.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_sensor_winter.json new file mode 100644 index 00000000..9a20c52d --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/season_sensor_winter.json @@ -0,0 +1,4 @@ +{ + "parent": "toughasnails:block/season_sensor_winter" +} + diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/spawn_egg_freeze.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/spawn_egg_freeze.json new file mode 100644 index 00000000..908f7fa0 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/spawn_egg_freeze.json @@ -0,0 +1,7 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "items/spawn_egg", + "layer1": "items/spawn_egg_overlay" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/tan_icon.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/tan_icon.json new file mode 100644 index 00000000..c571f410 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/tan_icon.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/tan_icon" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer.json new file mode 100644 index 00000000..d7f3bfe4 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer.json @@ -0,0 +1,29 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_00" + }, + "overrides": [ + { "predicate": { "temperature": 0.000000000000000 }, "model": "toughasnails:item/thermometer" }, + { "predicate": { "temperature": 0.047619047619048 }, "model": "toughasnails:item/thermometer_01" }, + { "predicate": { "temperature": 0.0952380952380956 }, "model": "toughasnails:item/thermometer_02" }, + { "predicate": { "temperature": 0.1428571428571432 }, "model": "toughasnails:item/thermometer_03" }, + { "predicate": { "temperature": 0.1904761904761908 }, "model": "toughasnails:item/thermometer_04" }, + { "predicate": { "temperature": 0.2380952380952384 }, "model": "toughasnails:item/thermometer_05" }, + { "predicate": { "temperature": 0.285714285714286 }, "model": "toughasnails:item/thermometer_06" }, + { "predicate": { "temperature": 0.3333333333333336 }, "model": "toughasnails:item/thermometer_07" }, + { "predicate": { "temperature": 0.3809523809523812 }, "model": "toughasnails:item/thermometer_08" }, + { "predicate": { "temperature": 0.4285714285714288 }, "model": "toughasnails:item/thermometer_09" }, + { "predicate": { "temperature": 0.4761904761904764 }, "model": "toughasnails:item/thermometer_10" }, + { "predicate": { "temperature": 0.523809523809524 }, "model": "toughasnails:item/thermometer_11" }, + { "predicate": { "temperature": 0.5714285714285716 }, "model": "toughasnails:item/thermometer_12" }, + { "predicate": { "temperature": 0.6190476190476192 }, "model": "toughasnails:item/thermometer_13" }, + { "predicate": { "temperature": 0.6666666666666668 }, "model": "toughasnails:item/thermometer_14" }, + { "predicate": { "temperature": 0.7142857142857144 }, "model": "toughasnails:item/thermometer_15" }, + { "predicate": { "temperature": 0.761904761904762 }, "model": "toughasnails:item/thermometer_16" }, + { "predicate": { "temperature": 0.8095238095238096 }, "model": "toughasnails:item/thermometer_17" }, + { "predicate": { "temperature": 0.8571428571428572 }, "model": "toughasnails:item/thermometer_18" }, + { "predicate": { "temperature": 0.9047619047619048 }, "model": "toughasnails:item/thermometer_19" }, + { "predicate": { "temperature": 0.9523809523809524 }, "model": "toughasnails:item/thermometer_20" } + ] +} \ No newline at end of file diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_00.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_00.json new file mode 100644 index 00000000..d82072cd --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_00.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_00" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_01.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_01.json new file mode 100644 index 00000000..87ce488b --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_01.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_01" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_02.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_02.json new file mode 100644 index 00000000..9d718c6b --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_02.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_02" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_03.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_03.json new file mode 100644 index 00000000..514f333b --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_03.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_03" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_04.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_04.json new file mode 100644 index 00000000..4be01e43 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_04.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_04" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_05.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_05.json new file mode 100644 index 00000000..57fd02bf --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_05.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_05" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_06.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_06.json new file mode 100644 index 00000000..d55cee36 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_06.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_06" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_07.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_07.json new file mode 100644 index 00000000..40286dc2 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_07.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_07" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_08.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_08.json new file mode 100644 index 00000000..7d8095cc --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_08.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_18" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_09.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_09.json new file mode 100644 index 00000000..3e542f6f --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_09.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_09" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_10.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_10.json new file mode 100644 index 00000000..e5c14847 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_10.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_10" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_11.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_11.json new file mode 100644 index 00000000..52084a0a --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_11.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_11" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_12.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_12.json new file mode 100644 index 00000000..bba0ad26 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_12.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_12" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_13.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_13.json new file mode 100644 index 00000000..8fea8f2c --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_13.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_13" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_14.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_14.json new file mode 100644 index 00000000..5fd0a416 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_14.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_14" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_15.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_15.json new file mode 100644 index 00000000..09027e3c --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_15.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_15" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_16.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_16.json new file mode 100644 index 00000000..ffba7ef0 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_16.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_16" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_17.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_17.json new file mode 100644 index 00000000..b7d57842 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_17.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_17" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_18.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_18.json new file mode 100644 index 00000000..7d8095cc --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_18.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_18" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_19.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_19.json new file mode 100644 index 00000000..29ca7ddb --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_19.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_19" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_20.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_20.json new file mode 100644 index 00000000..65e29a19 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/thermometer_20.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/thermometer_20" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/torch_new.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/torch_new.json new file mode 100644 index 00000000..4e6da468 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/torch_new.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "blocks/torch_on" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/wool_boots.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/wool_boots.json new file mode 100644 index 00000000..e33031f9 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/wool_boots.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/wool_boots" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/wool_chestplate.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/wool_chestplate.json new file mode 100644 index 00000000..55d04737 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/wool_chestplate.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/wool_chestplate" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/wool_helmet.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/wool_helmet.json new file mode 100644 index 00000000..5cd4bf0f --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/wool_helmet.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/wool_helmet" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/wool_leggings.json b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/wool_leggings.json new file mode 100644 index 00000000..bf09e8ff --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/models/item/wool_leggings.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "toughasnails:items/wool_leggings" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/chiller.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/chiller.png new file mode 100644 index 00000000..da9a7040 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/chiller.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/cooling_coil_off.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/cooling_coil_off.png new file mode 100644 index 00000000..62034e68 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/cooling_coil_off.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/cooling_coil_on.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/cooling_coil_on.png new file mode 100644 index 00000000..fbf99e2e Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/cooling_coil_on.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/dead_crops.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/dead_crops.png new file mode 100644 index 00000000..4bce3384 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/dead_crops.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/glowstone_torch.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/glowstone_torch.png new file mode 100644 index 00000000..62778dba Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/glowstone_torch.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/heating_coil_off.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/heating_coil_off.png new file mode 100644 index 00000000..956351ef Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/heating_coil_off.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/heating_coil_on.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/heating_coil_on.png new file mode 100644 index 00000000..507d8179 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/heating_coil_on.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/log_burnt.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/log_burnt.png new file mode 100644 index 00000000..79b0c68c Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/log_burnt.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/log_burnt_top.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/log_burnt_top.png new file mode 100644 index 00000000..1c94217d Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/log_burnt_top.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/rain_collector_bottom.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/rain_collector_bottom.png new file mode 100644 index 00000000..a3a5a085 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/rain_collector_bottom.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/rain_collector_inner.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/rain_collector_inner.png new file mode 100644 index 00000000..bb80c783 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/rain_collector_inner.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/rain_collector_side.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/rain_collector_side.png new file mode 100644 index 00000000..c7b2230d Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/rain_collector_side.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/rain_collector_top.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/rain_collector_top.png new file mode 100644 index 00000000..393ee7fd Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/rain_collector_top.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/season_sensor_autumn_top.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/season_sensor_autumn_top.png new file mode 100644 index 00000000..93fc55d7 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/season_sensor_autumn_top.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/season_sensor_side.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/season_sensor_side.png new file mode 100644 index 00000000..ed8240ec Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/season_sensor_side.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/season_sensor_spring_top.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/season_sensor_spring_top.png new file mode 100644 index 00000000..bd02cab6 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/season_sensor_spring_top.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/season_sensor_summer_top.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/season_sensor_summer_top.png new file mode 100644 index 00000000..04f9b0d2 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/season_sensor_summer_top.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/season_sensor_winter_top.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/season_sensor_winter_top.png new file mode 100644 index 00000000..773407e5 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/season_sensor_winter_top.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/torch_off.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/torch_off.png new file mode 100644 index 00000000..9af4f5ea Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/blocks/torch_off.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/entity/freeze.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/entity/freeze.png new file mode 100644 index 00000000..47c24d6b Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/entity/freeze.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/gui/fire_vignette.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/gui/fire_vignette.png new file mode 100644 index 00000000..cc3a8af9 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/gui/fire_vignette.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/gui/ice_vignette.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/gui/ice_vignette.png new file mode 100644 index 00000000..e4c74be8 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/gui/ice_vignette.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/gui/logo.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/gui/logo.png new file mode 100644 index 00000000..3dff5718 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/gui/logo.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/gui/overlay.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/gui/overlay.png new file mode 100644 index 00000000..f2e2a769 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/gui/overlay.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/air_filter.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/air_filter.png new file mode 100644 index 00000000..4d7f0cf0 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/air_filter.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/bottle_of_blackdamp.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/bottle_of_blackdamp.png new file mode 100644 index 00000000..44c2d66f Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/bottle_of_blackdamp.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/bottle_of_firedamp.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/bottle_of_firedamp.png new file mode 100644 index 00000000..da6f3515 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/bottle_of_firedamp.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/bottle_of_stinkdamp.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/bottle_of_stinkdamp.png new file mode 100644 index 00000000..393e8d9d Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/bottle_of_stinkdamp.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/bottle_of_whitedamp.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/bottle_of_whitedamp.png new file mode 100644 index 00000000..874fa566 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/bottle_of_whitedamp.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/campfire.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/campfire.png new file mode 100644 index 00000000..94b7dbf7 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/campfire.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/canteen_empty.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/canteen_empty.png new file mode 100644 index 00000000..51b67f0d Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/canteen_empty.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/canteen_filled.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/canteen_filled.png new file mode 100644 index 00000000..f52901a2 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/canteen_filled.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/charcoal_filter.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/charcoal_filter.png new file mode 100644 index 00000000..37d06ee9 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/charcoal_filter.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/cooling_coil.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/cooling_coil.png new file mode 100644 index 00000000..ddf69cfe Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/cooling_coil.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/dew_leaf.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/dew_leaf.png new file mode 100644 index 00000000..3d29e275 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/dew_leaf.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/dirty_water_bottle.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/dirty_water_bottle.png new file mode 100644 index 00000000..83b626ab Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/dirty_water_bottle.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/filtered_water_bottle.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/filtered_water_bottle.png new file mode 100644 index 00000000..568615f1 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/filtered_water_bottle.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/freeze_powder.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/freeze_powder.png new file mode 100644 index 00000000..161e07ff Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/freeze_powder.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/freeze_rod.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/freeze_rod.png new file mode 100644 index 00000000..cf9b4447 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/freeze_rod.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/heating_coil.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/heating_coil.png new file mode 100644 index 00000000..637e17c6 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/heating_coil.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/ice_charge.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/ice_charge.png new file mode 100644 index 00000000..e04fb810 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/ice_charge.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/ice_cube.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/ice_cube.png new file mode 100644 index 00000000..c8b2d85b Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/ice_cube.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/jelled_slime.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/jelled_slime.png new file mode 100644 index 00000000..d3737c6d Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/jelled_slime.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/jelled_slime_boots.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/jelled_slime_boots.png new file mode 100644 index 00000000..c490b1e4 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/jelled_slime_boots.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/jelled_slime_chestplate.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/jelled_slime_chestplate.png new file mode 100644 index 00000000..4143cb41 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/jelled_slime_chestplate.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/jelled_slime_helmet.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/jelled_slime_helmet.png new file mode 100644 index 00000000..5dea8961 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/jelled_slime_helmet.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/jelled_slime_leggings.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/jelled_slime_leggings.png new file mode 100644 index 00000000..6fb01891 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/jelled_slime_leggings.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_apple.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_apple.png new file mode 100644 index 00000000..63ba0dfa Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_apple.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_beetroot.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_beetroot.png new file mode 100644 index 00000000..b01ddbf5 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_beetroot.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_cactus.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_cactus.png new file mode 100644 index 00000000..4ec77fa4 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_cactus.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_carrot.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_carrot.png new file mode 100644 index 00000000..88794336 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_carrot.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_chorus_fruit.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_chorus_fruit.png new file mode 100644 index 00000000..e759570e Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_chorus_fruit.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_glistering_melon.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_glistering_melon.png new file mode 100644 index 00000000..d5ec0570 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_glistering_melon.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_golden_apple.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_golden_apple.png new file mode 100644 index 00000000..e9316746 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_golden_apple.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_golden_carrot.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_golden_carrot.png new file mode 100644 index 00000000..2a659eed Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_golden_carrot.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_melon.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_melon.png new file mode 100644 index 00000000..11cc7785 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_melon.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_pumpkin.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_pumpkin.png new file mode 100644 index 00000000..5299f560 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/juice_pumpkin.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/lifeblood_crystal.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/lifeblood_crystal.png new file mode 100644 index 00000000..4fbaa1fb Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/lifeblood_crystal.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/rain_collector.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/rain_collector.png new file mode 100644 index 00000000..a08d2db0 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/rain_collector.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/respirator.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/respirator.png new file mode 100644 index 00000000..48107226 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/respirator.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_00.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_00.png new file mode 100644 index 00000000..0c09dc0e Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_00.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_01.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_01.png new file mode 100644 index 00000000..8ce92ef8 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_01.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_02.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_02.png new file mode 100644 index 00000000..9a94c3c7 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_02.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_03.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_03.png new file mode 100644 index 00000000..60b654a1 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_03.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_04.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_04.png new file mode 100644 index 00000000..6662d0ac Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_04.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_05.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_05.png new file mode 100644 index 00000000..2881a2eb Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_05.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_06.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_06.png new file mode 100644 index 00000000..8d3d8a19 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_06.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_07.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_07.png new file mode 100644 index 00000000..2723f8a9 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_07.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_08.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_08.png new file mode 100644 index 00000000..71abdb4f Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_08.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_09.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_09.png new file mode 100644 index 00000000..e41daba5 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_09.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_10.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_10.png new file mode 100644 index 00000000..a70a113f Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_10.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_11.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_11.png new file mode 100644 index 00000000..1eb40cc6 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_11.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_12.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_12.png new file mode 100644 index 00000000..c6d70e4e Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_12.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_13.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_13.png new file mode 100644 index 00000000..fdf24df1 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_13.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_14.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_14.png new file mode 100644 index 00000000..a6630fcb Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_14.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_15.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_15.png new file mode 100644 index 00000000..80fbc912 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_15.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_16.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_16.png new file mode 100644 index 00000000..aee14d12 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_16.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_17.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_17.png new file mode 100644 index 00000000..e2133f5a Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_17.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_18.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_18.png new file mode 100644 index 00000000..1a4bb165 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_18.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_19.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_19.png new file mode 100644 index 00000000..4d556f2b Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_19.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_20.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_20.png new file mode 100644 index 00000000..91794eea Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_20.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_21.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_21.png new file mode 100644 index 00000000..e7f834cf Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_21.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_22.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_22.png new file mode 100644 index 00000000..0d86183c Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_22.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_23.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_23.png new file mode 100644 index 00000000..c1aea7a5 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/season_clock_23.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/tan_icon.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/tan_icon.png new file mode 100644 index 00000000..4a82c55b Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/tan_icon.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_00.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_00.png new file mode 100644 index 00000000..381e7669 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_00.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_01.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_01.png new file mode 100644 index 00000000..fc4913b9 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_01.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_02.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_02.png new file mode 100644 index 00000000..b64ceca7 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_02.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_03.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_03.png new file mode 100644 index 00000000..65b1f5b9 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_03.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_04.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_04.png new file mode 100644 index 00000000..68f39b7f Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_04.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_05.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_05.png new file mode 100644 index 00000000..a857bbca Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_05.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_06.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_06.png new file mode 100644 index 00000000..88e3872d Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_06.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_07.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_07.png new file mode 100644 index 00000000..d2d098f0 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_07.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_08.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_08.png new file mode 100644 index 00000000..53922678 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_08.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_09.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_09.png new file mode 100644 index 00000000..64939504 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_09.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_10.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_10.png new file mode 100644 index 00000000..eb97b1cb Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_10.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_11.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_11.png new file mode 100644 index 00000000..34ccc5bb Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_11.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_12.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_12.png new file mode 100644 index 00000000..3c5867c0 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_12.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_13.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_13.png new file mode 100644 index 00000000..2f8fad03 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_13.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_14.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_14.png new file mode 100644 index 00000000..bc8ad043 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_14.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_15.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_15.png new file mode 100644 index 00000000..5d14ef59 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_15.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_16.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_16.png new file mode 100644 index 00000000..0b36240c Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_16.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_17.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_17.png new file mode 100644 index 00000000..bfea1397 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_17.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_18.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_18.png new file mode 100644 index 00000000..f7daf334 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_18.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_19.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_19.png new file mode 100644 index 00000000..baacff95 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_19.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_20.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_20.png new file mode 100644 index 00000000..c4469995 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/thermometer_20.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/wool_boots.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/wool_boots.png new file mode 100644 index 00000000..c58d9043 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/wool_boots.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/wool_chestplate.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/wool_chestplate.png new file mode 100644 index 00000000..fb7d3687 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/wool_chestplate.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/wool_helmet.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/wool_helmet.png new file mode 100644 index 00000000..62aafa07 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/wool_helmet.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/wool_leggings.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/wool_leggings.png new file mode 100644 index 00000000..7c4a1884 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/items/wool_leggings.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/models/armor/jelled_slime_armor_layer_1.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/models/armor/jelled_slime_armor_layer_1.png new file mode 100644 index 00000000..c9d7f9b1 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/models/armor/jelled_slime_armor_layer_1.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/models/armor/jelled_slime_armor_layer_2.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/models/armor/jelled_slime_armor_layer_2.png new file mode 100644 index 00000000..c6c3addc Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/models/armor/jelled_slime_armor_layer_2.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/models/armor/respirator_layer_1.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/models/armor/respirator_layer_1.png new file mode 100644 index 00000000..68817340 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/models/armor/respirator_layer_1.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/models/armor/wool_armor_layer_1.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/models/armor/wool_armor_layer_1.png new file mode 100644 index 00000000..600bdd50 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/models/armor/wool_armor_layer_1.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/models/armor/wool_armor_layer_2.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/models/armor/wool_armor_layer_2.png new file mode 100644 index 00000000..8022d9fe Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/models/armor/wool_armor_layer_2.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/particles/particles.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/particles/particles.png new file mode 100644 index 00000000..e5d54413 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/particles/particles.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/potions/TANPotionFX.png b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/potions/TANPotionFX.png new file mode 100644 index 00000000..0ba9d468 Binary files /dev/null and b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/assets/toughasnails/textures/potions/TANPotionFX.png differ diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/mcmod.info b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/mcmod.info new file mode 100644 index 00000000..c4335729 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/mcmod.info @@ -0,0 +1,10 @@ +[{ + "modid": "ToughAsNails", + "name": "Tough As Nails", + "description": "Adds survival features to increase difficulty and realism, including thirst, body temperature, and more!", + "version": "1.10.2-1.0", + "mcversion": "1.10.2", + "url": "http://mods.curse.com/mc-mods/minecraft/246391-tough-as-nails", + "authorList": ["Adubbz", "Forstride"], + "logoFile": "assets/toughasnails/textures/gui/logo.png" +}] diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/pack.mcmeta b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/pack.mcmeta new file mode 100644 index 00000000..33aae04c --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "pack_format": 1, + "description": "Resources used for Tough As Nails" + } +} diff --git a/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/version.properties b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/version.properties new file mode 100644 index 00000000..c1270b64 --- /dev/null +++ b/forge-1.10.2-12.18.3.2422-mdk/src/main/resources/version.properties @@ -0,0 +1,2 @@ +${modid}.version=${mod_version} +${modid}.build_number=${build_number} \ No newline at end of file