From 9f1ec3348ce7d67390e235f3cddd465edb0f0b6b Mon Sep 17 00:00:00 2001 From: BuildTools Date: Fri, 17 Apr 2020 19:05:52 -0500 Subject: [PATCH] Initial commit --- .gitignore | 22 + CREDITS.txt | 65 + LICENSE-Paulscode IBXM Library.txt | 10 + LICENSE-Paulscode SoundSystem CodecIBXM.txt | 40 + LICENSE.txt | 526 ++++ Readme.txt | 63 +- build.bat | 1 + build.gradle | 77 + changelog.txt | 467 +++ gradle.properties | 3 + gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 52271 bytes gradle/wrapper/gradle-wrapper.properties | 6 + gradlew | 164 + gradlew.bat | 90 + src/main/java/backsun/lod/Main.java | 44 + src/main/java/backsun/lod/hellofunctions.js | 78 + .../java/backsun/lod/proxy/ClientProxy.java | 19 + .../java/backsun/lod/proxy/CommonProxy.java | 18 + .../java/backsun/lod/util/CustomRenderer.java | 28 + src/main/java/backsun/lod/util/Reference.java | 25 + .../java/net/minecraft/block/BlockCactus.java | 213 ++ .../client/renderer/EntityRenderer.java | 2189 ++++++++++++++ .../client/renderer/RenderGlobal.java | 2657 +++++++++++++++++ src/main/resources/mcmod.info | 16 + src/main/resources/pack.mcmeta | 7 + 25 files changed, 6827 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 CREDITS.txt create mode 100644 LICENSE-Paulscode IBXM Library.txt create mode 100644 LICENSE-Paulscode SoundSystem CodecIBXM.txt create mode 100644 LICENSE.txt create mode 100644 build.bat create mode 100644 build.gradle create mode 100644 changelog.txt create mode 100644 gradle.properties create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100644 gradlew create mode 100644 gradlew.bat create mode 100644 src/main/java/backsun/lod/Main.java create mode 100644 src/main/java/backsun/lod/hellofunctions.js create mode 100644 src/main/java/backsun/lod/proxy/ClientProxy.java create mode 100644 src/main/java/backsun/lod/proxy/CommonProxy.java create mode 100644 src/main/java/backsun/lod/util/CustomRenderer.java create mode 100644 src/main/java/backsun/lod/util/Reference.java create mode 100644 src/main/java/net/minecraft/block/BlockCactus.java create mode 100644 src/main/java/net/minecraft/client/renderer/EntityRenderer.java create mode 100644 src/main/java/net/minecraft/client/renderer/RenderGlobal.java create mode 100644 src/main/resources/mcmod.info create mode 100644 src/main/resources/pack.mcmeta diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..2c770e09f --- /dev/null +++ b/.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/CREDITS.txt b/CREDITS.txt new file mode 100644 index 000000000..589f482ef --- /dev/null +++ b/CREDITS.txt @@ -0,0 +1,65 @@ +Minecraft Forge: Credits/Thank You + +Forge is a set of tools and modifications to the Minecraft base game code to assist +mod developers in creating new and exciting content. It has been in development for +several years now, but I would like to take this time thank a few people who have +helped it along it's way. + +First, the people who originally created the Forge projects way back in Minecraft +alpha. Eloraam of RedPower, and SpaceToad of Buildcraft, without their acceptiance +of me taking over the project, who knows what Minecraft modding would be today. + +Secondly, someone who has worked with me, and developed some of the core features +that allow modding to he as functional, and as simple as it is, cpw. For developing +FML, which stabelized the client and server modding ecosystem. As well as the base +loading system that allows us to modify Minecraft's code as elegently as possible. + +Mezz, who has stepped up as the issue and pull request manager. Helping to keep me +sane as well as guiding the community into creating better additions to Forge. + +Searge, Bspks, Fesh0r, ProfMobious, and all the rest over on the MCP team {of which +I am a part}. For creating some of the core tools needed to make Minecraft modding +both possible, and as stable as can be. + On that note, here is some specific information of the MCP data we use: + * Minecraft Coder Pack (MCP) * + Forge Mod Loader and Minecraft Forge have permission to distribute and automatically + download components of MCP and distribute MCP data files. This permission is not + transitive and others wishing to redistribute the Minecraft Forge source independently + should seek permission of MCP or remove the MCP data files and request their users + to download MCP separately. + +And lastly, the countless community members who have spent time submitting bug reports, +pull requests, and just helping out the community in general. Thank you. + +--LexManos + +========================================================================= + +This is Forge Mod Loader. + +You can find the source code at all times at https://github.com/MinecraftForge/MinecraftForge/tree/1.12.x/src/main/java/net/minecraftforge/fml + +This minecraft mod is a clean open source implementation of a mod loader for minecraft servers +and minecraft clients. + +The code is authored by cpw. + +It began by partially implementing an API defined by the client side ModLoader, authored by Risugami. +http://www.minecraftforum.net/topic/75440- +This support has been dropped as of Minecraft release 1.7, as Risugami no longer maintains ModLoader. + +It also contains suggestions and hints and generous helpings of code from LexManos, author of MinecraftForge. +http://www.minecraftforge.net/ + +Additionally, it contains an implementation of topological sort based on that +published at http://keithschwarz.com/interesting/code/?dir=topological-sort + +It also contains code from the Maven project for performing versioned dependency +resolution. http://maven.apache.org/ + +It also contains a partial repackaging of the javaxdelta library from http://sourceforge.net/projects/javaxdelta/ +with credit to it's authors. + +Forge Mod Loader downloads components from the Minecraft Coder Pack +(http://mcp.ocean-labs.de/index.php/Main_Page) with kind permission from the MCP team. + diff --git a/LICENSE-Paulscode IBXM Library.txt b/LICENSE-Paulscode IBXM Library.txt new file mode 100644 index 000000000..d4884b071 --- /dev/null +++ b/LICENSE-Paulscode IBXM Library.txt @@ -0,0 +1,10 @@ +IBXM is copyright (c) 2007, Martin Cameron, and is licensed under the BSD License. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +Neither the name of mumart nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/LICENSE-Paulscode SoundSystem CodecIBXM.txt b/LICENSE-Paulscode SoundSystem CodecIBXM.txt new file mode 100644 index 000000000..a68a49478 --- /dev/null +++ b/LICENSE-Paulscode SoundSystem CodecIBXM.txt @@ -0,0 +1,40 @@ +SoundSystem CodecIBXM Class License: + +You are free to use this class for any purpose, commercial or otherwise. +You may modify this class or source code, and distribute it any way you +like, provided the following conditions are met: + +1) You may not falsely claim to be the author of this class or any + unmodified portion of it. +2) You may not copyright this class or a modified version of it and then + sue me for copyright infringement. +3) If you modify the source code, you must clearly document the changes + made before redistributing the modified source code, so other users know + it is not the original code. +4) You are not required to give me credit for this class in any derived + work, but if you do, you must also mention my website: + http://www.paulscode.com +5) I the author will not be responsible for any damages (physical, + financial, or otherwise) caused by the use if this class or any + portion of it. +6) I the author do not guarantee, warrant, or make any representations, + either expressed or implied, regarding the use of this class or any + portion of it. + +Author: Paul Lamb +http://www.paulscode.com + + +This software is based on or using the IBXM library available from +http://www.geocities.com/sunet2000/ + + +IBXM is copyright (c) 2007, Martin Cameron, and is licensed under the BSD License. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +Neither the name of mumart nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 000000000..97b081bab --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,526 @@ +Unless noted below, Minecraft Forge, Forge Mod Loader, and all +parts herein are 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. + +Homepage: http://MinecraftForge.net/ + http://github.com/MinecraftForge/MinecraftForge + + +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. + + +=== MCP Data === +This software includes data from the Minecraft Coder Pack (MCP), with kind permission +from them. The license to MCP data is not transitive - distribution of this data by +third parties requires independent licensing from the MCP team. This data is not +redistributable without permission from the MCP team. + +=== Sharing === +I grant permission for some parts of FML to be redistributed outside the terms of the LGPL, for the benefit of +the minecraft modding community. All contributions to these parts should be licensed under the same additional grant. + +-- Runtime patcher -- +License is granted to redistribute the runtime patcher code (src/main/java/net/minecraftforge/fml/common/patcher +and subdirectories) under any alternative open source license as classified by the OSI (http://opensource.org/licenses) + +-- ASM transformers -- +License is granted to redistribute the ASM transformer code (src/main/java/net/minecraftforge/common/asm/ and subdirectories) +under any alternative open source license as classified by the OSI (http://opensource.org/licenses) + +========================================================================= +This software includes portions from the Apache Maven project at +http://maven.apache.org/ specifically the ComparableVersion.java code. It is +included based on guidelines at +http://www.softwarefreedom.org/resources/2007/gpl-non-gpl-collaboration.html +with notices intact. The only change is a non-functional change of package name. + +This software contains a partial repackaging of javaxdelta, a BSD licensed program for generating +binary differences and applying them, sourced from the subversion at http://sourceforge.net/projects/javaxdelta/ +authored by genman, heikok, pivot. +The only changes are to replace some Trove collection types with standard Java collections, and repackaged. + +This software contains potions of Paulscodee IBXM library, a BSD liceensed library for +loading and playing IBXM formated auto. No modifications havee beeen made. The associated +licenses can be found along side this one, or at +https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/LICENSE-Paulscode%20IBXM%20Library.txt +https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/LICENSE-Paulscode%20SoundSystem%20CodecIBXM.txt +========================================================================= + + + 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/Readme.txt b/Readme.txt index 73ee31de2..82be8dcd2 100644 --- a/Readme.txt +++ b/Readme.txt @@ -1 +1,62 @@ -This is the readme.txt \ No newline at end of file +------------------------------------------- +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 +============================== + +See the Forge Documentation online for more detailed instructions: +http://mcforge.readthedocs.io/en/latest/gettingstarted/ + +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 prefer 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 affect 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, deobfuscate, and gather required assets to run minecraft, but will not generate 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/build.bat b/build.bat new file mode 100644 index 000000000..6c1fb2cba --- /dev/null +++ b/build.bat @@ -0,0 +1 @@ +./gradlew build \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 000000000..2b30f4634 --- /dev/null +++ b/build.gradle @@ -0,0 +1,77 @@ +buildscript { + repositories { + jcenter() + maven { url = "https://files.minecraftforge.net/maven" } + } + dependencies { + classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' + } +} +apply plugin: 'net.minecraftforge.gradle.forge' +//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. + + +version = "1.0" +group = "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +archivesBaseName = "modid" + +sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. +compileJava { + sourceCompatibility = targetCompatibility = '1.8' +} + +minecraft { + version = "1.12.2-14.23.5.2847" + 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 always work. + // simply re-run your setup task after changing the mappings to update your workspace. + mappings = "snapshot_20171003" + // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. +} + +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 except the mcmod.info + from(sourceSets.main.resources.srcDirs) { + exclude 'mcmod.info' + } +} diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 000000000..d15515960 --- /dev/null +++ b/changelog.txt @@ -0,0 +1,467 @@ +========= +Build: 1.12.2-14.23.5.2846 - Tue Sep 03 21:22:46 GMT 2019 + ichttt: + Fix CME when removing ticket managers (#5861) + +========= +Build: 1.12.2-14.23.5.2844 - Thu Aug 29 02:33:00 GMT 2019 + Barteks2x: + Fix client sometimes generating biomes, causing incorrect biome + generation on integrated server (#5720) + + bs2609: + Add checks for tile entities in now-unloaded chunks (#5724) + +========= +Build: 1.12.2-14.23.5.2843 - Thu Aug 29 02:23:04 GMT 2019 + bs2609: + Fix invalid placeholder entity attributes (MC-150405) (#5718) + +========= +Build: 1.12.2-14.23.5.2842 - Thu Aug 29 02:08:57 GMT 2019 + bs2609: + Allow conditional loading of advancements (#5255) + +========= +Build: 1.12.2-14.23.5.2841 - Thu Aug 29 01:58:50 GMT 2019 + bs2609: + Improve performance of persistent chunk checks (#5706) + + jensen.derik: + Fix lightning not triggering EntityJoinWorldEvent (#5290) + +========= +Build: 1.12.2-14.23.5.2840 - Thu Aug 29 01:19:55 GMT 2019 + lex: + Fix copy paste derp + + +Build 2838: + bs2609: Fix vanilla handling of options file (MC-117449, MC-151173) (#5725) + +Build 2837: + clienthax: Update EnumHelper to be compatible with Eclipse's OpenJ9 JVM. (#5712) + +Build 2836: + tterrag: + Revert "Invalidate tile entities that are queued for removal (#5512)" + This reverts commit 75788f63eea6c33ccef7e5cbcab27ad9ad2c2a04. + This solution is invalid as TEs are free to modify the world + tileEntities list, usually indirectly via chunkloading, from inside + invalidate(). + This happens in vanilla, in TileEntityChest#invalidate, where it calls + checkForAdjacentChests(), which has the potential to load neighboring + chunks and cause a CME. + A more sophisticated solution is needed. + +Build 2835: + bs2609: Fix some vertex format changes not being handled correctly (#5368) + +Build 2834: + bs2609: + Transform vertex normals as well as positions when generating quads + (#5242) + +Build 2833: + rseifert.phone: Fix for SidedInvWrapper isItemValid using wrong slot (#5642) + +Build 2832: + bs2609: Invalidate tile entities that are queued for removal (#5512) + +Build 2831: + lclc98: Added Wool to OreDictionary (#5414) + +Build 2830: + CreativeMD: Fixed boat not taking care of block-liquid hooks (#5086) + +Build 2829: + bs2609: Add Forge dimension-changing hooks to spectator handling code (#5212) + +Build 2828: + ichttt: + Minor performace improvement when building chunks and rendering blocks + (#5286) + +Build 2827: + bs2609: Catch json parsing errors from constants/factories files (#5258) + +Build 2826: + bs2609: Allow custom DataSerializers to be registered safely (#5245) + +Build 2825: + cpw: + Try and make 1.13 mods more obviously wrong in 1.12.. + Signed-off-by: cpw + +Build 2824: + tterrag: Fix #5651 Re-add canPlaceBlockOnSide check in World#mayPlace + +Build 2823: + Pokechu022: + Fail fast when null is used with setTag instead of crashing in + writeEntry (#5257) + +Build 2822: + tterrag: Fix block placement not checking for player collision + +Build 2821: + wynprice999: Added more Constants (#5323) + +Build 2820: + python0429: [1.12.2] Add a few events pertaining to villages (#5302) + +Build 2819: + Tyler Hancock: [1.12] Fix special spawn event not firing in many cases. (#5389) + +Build 2818: + bs2609: Only prompt for missing registries on local worlds (#5348) + +Build 2817: + ckrier.3000: Add EntityPlaceEvent (#5057) + +Build 2816: + bs2609: Generalise EnumRarity to an interface (#5182) + +Build 2815: + bs2609: Apply access-level changes to inner class attributes (#5468) + +Build 2814: + bs2609: Fix small logic error in ItemTextureQuadConverter (#5463) + +Build 2813: + bs2609: Better support for custom bows (#5209) + +Build 2812: + CovertJaguar: Remove FluidStack amount from hashcode calculation (#5272) + molecularphylo: + Fixed incorrect string representation of string list config property + default values in their comments. + bs2609: + Improve tracking of used dimension IDs (#5249) + Closes #5378 Large dimension IDs bloat level.data + +Build 2811: + bs2609: + Fix up torch placement logic to handle more vanilla special-casing + (#5426) + +Build 2810: + LexManos: Written size does not include int bytes. + +Build 2809: + LexManos: + Extend Region files to support >1MB per chunk. If the 'sector count' is + 255, ask the compressed data header for the proper length. + +Build 2808: + tterrag1098: Add default impl to IConfigElement#getValidValuesDisplay + +Build 2807: + tterrag: Simplify custom item rendering by removing GL emissivity hacks + +Build 2806: + tterrag: Support diffuse lighting flag in item rendering + +Build 2805: + bs2609: + Add a hook to allow continuously using items through stack changes + (#4834) + * Add a hook to allow continuously using items through stack changes + + * Update licences + +Build 2804: + oOMitchOo: + Added an additional constructor to every implementation of IFluidBlock. + It is now possible to create a fluid block with a Fluid, Material and + MapColor, so that the Material's MapColor isn't used for the blocks + MapColor. (#5293) + +Build 2803: + bs2609: Add redirects to PotionEffect to respect registry replacement (#5213) + +Build 2802: + alexiy.ov: + Add an annotation for @Config elements which will automatically create a + slider control (#5026) + +Build 2801: + bs2609: Fix small logic error in emissive item rendering code (#5320) + +Build 2800: + molecularphylo: + Allow config GUI cycling button elements generated from enums to display + toString return values, rather than actual values. (#5125) + +Build 2799: + bs2609: Fix incorrect indexing in mipmap generation code (#5201) + +Build 2798: + bs2609: + Ensure slave maps are cleaned up when handling registry overrides + (#5250) + +Build 2797: + d_scalzi: Fix issue with --modListFile. (#5316) + +Build 2796: + LexManos: + Fix potential issues with the Minecraft FakePlayer lingering around + after world unloads. + +Build 2795: + tterrag: Fix potion remove event not always firing, add expiry event + +Build 2794: + tterrag: Clean up CraftingHelper constants loading API + +Build 2793: + tterrag: Fix crash from CraftingHelper due to FileSystem being closed early + +Build 2792: + tterrag: + added PotionHooks, closes #3867, #4375 (#4614) + * solved merge confilct + + * improved var names & removed tabs + + * Added spaces around != + + * fixed typo + +Build 2791: + tterrag: + Add a hook for farmland watering (#4891) + * Add a FarmlandWaterCheckEvent to allow mods to override when Farmland + is watered or not + + * revert 1.12.2 json + + * Move the farmland patch to a ticket based instead of a event based + system + + * Minor changes + + * Faster isValid checks, faster validation/invalidation if the state did + not change, expand test mod to include a test for the validation system + + * remove isValid boolean flag, we can express it with the tick counter + + * Fix test mod resource warnings + + * Remove tick timeout, add a javadoc note to invalidate on chunk unload, + cleaned up test mod + + * Allow mods to provide custom handling to determine if a pos is valid + or not + + * Make SimpleTicket more simple, make register public so custom tickets + can be registered + + * Fixes for review + + * Add missing license headers + + * Use a weak hash set + + * Split up the map into smaller chunk based maps + + * Add missing license headers + + * Make MultiTicketManager more universal for custom implementations, + cleanup imports + +Build 2790: + tterrag: + Add methods to allow loading json constants outside of _constants + (#4975) + * add interface methods for loading json constants from an arbitary file + + + * use try-with-resources + + * don't make modders create jsoncontext, clean up resource use + + * very minor cleanup + +Build 2789: + tterrag: + Compute ASMDataTable submaps parallel, speeds up contructing mods + (#5246) + * Compute submaps parallel, speeds up contructing mods by a lot + + * Use stream API better + +Build 2788: + mezz: Add logging for data manager key registration errors (#5129) + +Build 2787: + mezz: Improve support for custom block path types (#5203) + +Build 2786: + mezz: Fix missing comments in configs created with annotations (#5189) + +Build 2785: + mezz: Allow items to control the rate of repair from mending (#5102) + +Build 2784: + mezz: Improve exception handling from server starting events (#5226) + +Build 2783: + mezz: Improve context provided by potion icon rendering hooks (#5111) + +Build 2782: + mezz: Fix an ObjectHolderRef internal error message (#5214) + +Build 2781: + mezz: Implement rendering for item models with emissive quads (#5047) + +Build 2780: + mezz: Clean up logged mod states (#5227) + mezz: Fix minor issue in getFilledPercentage for Fluid rendering (#5206) + +Build 2779: + mezz: Improve reflection helper methods (#4853) + mezz: Fix inaccurate main thread name shown in client log (#5078) + +Build 2778: + mezz: Fix Baked Item models with transformations (#5241) + +Build 2777: + mezz: + Re-add some missing villager profession patches (#5200) + * Fix zombie villagers only spawning with vanilla professions + * Fix spawning modded villagers that do not have their own building + mezz: Fix missing string parameters in some log messages (#5210) + mezz: Stop firing LivingSetAttackTargetEvent for setRevengeTarget (#5217) + mezz: Prevent RecipeBook from crashing on empty modded ingredients (#5234) + +Build 2776: + mezz: Fix the bed position given to the SleepingTimeCheck event (#5107) + +Build 2775: + LexManos: Fix some null returns from defaulted registries (#5235) + +Build 2774: + LexManos: + Only remove synthetic lambda methods referenced in body of SideOnly + methods (#5127) + +Build 2773: + LexManos: + A different approach to my changes in + https://github.com/MinecraftForge/MinecraftForge/commit/8ace535995522bec0557d4217e0d98b3dc76cf1e + to fix #5207 + LexManos: Fix patches from #5160 setting rotation as well as position (#5233) + LexManos: Use HTTPS for files website. + +Build 2772: + tterrag: Make Forge-provided default transforms accessible to custom models + tterrag: + Make Forge blockstate variants correctly inherit AO setting from vanilla + models (#5190) + * Make Forge blockstate variants correctly inherit AO setting + + * Move variant format checks into variant, check for added properties + + * Small code cleanup + tterrag: fixed visual bug with guislider + tterrag: + Allow IModel to express itself as a vanilla parent (#5195) + * Fix errors caused by fancy missing model being non-vanilla parent + + * Switch instanceof checks to a default IModel method + + * Small code tweaks + +Build 2771: + tterrag: Add CreativeTabs#getLabelColor + +Build 2770: + tterrag: + Allow providing a BufferedImage for banner render generation (#5041) + * Adds an Event to allow providing a BufferedImage for the banner render + generation (cached) + textures, since banners don't use an atlas. + implementation. + + * Missed some copyright; might as well absolut text match, I guess + + * Remove unneeded patch change + + * Fix event variable access convention + + * Formatting fix + + * Improve event handling registration + + * Import cleanup + + * Replace event approach with Supplier approach + + * Better name for test mod (now that it's no longer an event); adds + ENABLE flag + + * Moves MC code into + net.minecraftforge.client.MinecraftForgeClient.getImageLayer to simplify + patch + + * Generalize naming + +Build 2769: + mezz: Fix Mesa biome entry tags in the BiomeDictionary (#5177) + +Build 2768: + LexManos: Bump version number for RB. + +Build 2767: + LexManos: + Change biome spawn list entries to use factory method where possible + (#5075) + LexManos: Prevent some texture loading errors from crashing the game (#5121) + LexManos: Patch PotionHelper to use registry delegates (#5142) + LexManos: Add a notification event for handling game rule changes (#5152) + +Build 2766: + LexManos: + Change universal bucket support to use fluid names instead of instances + (#5031) + +Build 2765: + LexManos: Fix NPE on clientside entities constructed with null world (#5170) + +Build 2764: + tterrag: Fix patches from #5160 running on the client and causing stutter + +Build 2763: + LexManos: + Class transformer optimizations (#5159) + * Filter packages for deobf transformation + * Only serialize transformed class with TerminalTransformer if bytecode + changed + +Build 2762: + github: Update github stale so issues can be Assigned + +Build 2761: + LexManos: + Fix MC-136995 - Chunk loading and unloading issue with entities placed + in exact positions. (#5160) + Scatter gun patches to improve entity tracking and position tracking. + Provided by Aikar through the Paper project, this commit of patches + combines the following patches: + + https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0306-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch + + https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0315-Always-process-chunk-registration-after-moving.patch + + https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0335-Ensure-chunks-are-always-loaded-on-hard-position-set.patch + + https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0378-Sync-Player-Position-to-Vehicles.patch + +Build 2760: + LexManos: Fix --mods and --modListFile arguments not making it past LaunchWrapper. + +Build 2759: + LexManos: Remove BlamingTransformer (#5115) + diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 000000000..e9b9fd5ac --- /dev/null +++ b/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/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..30d399d8d2bf522ff5de94bf434a7cc43a9a74b5 GIT binary patch literal 52271 zcmafaW0a=B^559DjdyI@wy|T|wr$(CJv+9!W822gY&N+!|K#4>Bz;ajPk*RBjZ;RV75EK*;p4^!@(BB5~-#>pF^k0$_Qx&35mhPenc zNjoahrs}{XFFPtR8Xs)MInR7>x_1Kpw+a8w@n0(g``fp7GXFmo^}qAL{*%Yt$3(FfIbReeZ6|xbrftHf0>dl5l+$$VLbG+m|;Uk##see6$CK4I^ ziDe}0)5eiLr!R5hk6u9aKT36^C>3`nJ0l07RQ1h438axccsJk z{kKyd*$G`m`zrtre~(!7|FcIGPiGfXTSX`PzlY^wY3ls9=iw>j>SAGP=VEDW=wk2m zk3%R`v9(7LLh{1^gpVy8R2tN#ZmfE#9!J?P7~nw1MnW^mRmsT;*cyVG*SVY6CqC3a zMccC8L%tQqGz+E@0i)gy&0g_7PV@3~zaE~h-2zQ|SdqjALBoQBT2pPYH^#-Hv8!mV z-r%F^bXb!hjQwm2^oEuNkVelqJLf029>h5N1XzEvYb=HA`@uO_*rgQZG`tKgMrKh~aq~ z6oX{k?;tz&tW3rPe+`Q8F5(m5dJHyv`VX0of2nf;*UaVsiMR!)TjB`jnN2)6z~3CK@xZ_0x>|31=5G$w!HcYiYRDdK3mtO1GgiFavDsn&1zs zF|lz}sx*wA(IJoVYnkC+jmhbirgPO_Y1{luB>!3Jr2eOB{X?e2Vh8>z7F^h$>GKmb z?mzET;(r({HD^;NNqbvUS$lhHSBHOWI#xwT0Y?b!TRic{ z>a%hUpta3P2TbRe_O;s5@KjZ#Dijg4f=MWJ9euZnmd$UCUNS4I#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Gq0vkDB-zOVX&Yk5Ybqnd5 z6{OV1e&TJ`i%i*?w5$C|LIWO+5DO4mz`OqH*QZi5c2-jYXynC!ClT=co&^B7)&2h? z13=A-KV$&d`bGEu2`D-kFi$u%GzdO$(>;**zq0p0^YHyZ200S?_ET0&Nr+xbP8_&X z|JPz&pmmGibc>XLC;GSl{C?#5e*0YfZ!uXRIVo{5MWtu5;*Sx&6#!0k|2cru-S-0- zE8h zKm$d8EgbEE8_UE^EsTT=42c7XPc_ z`L2vjD!__^0DI?~$@p>9_}*ds5&gNf@&D|FQM-dM3}B#%6|l|U_C@_TYJ6V&%)x*XiFW>LwkUonE*6Q zzuqTahCiYSTU$GP%e!GCt7mEjbh`e`w()ofbczuVi2(0WE#_Z26ModS##e^*kI>(T zfS8Msf#ZMW(;uS-;O3Q70a1m49Z2&7@;}X=;{PM+Uk}B1>~EF+b4NVRaQg$g#&=Ze zkGS8v^?#Y4$0-hf;t{;~Bi=8!{(mJreB2w4)93wUp?vvAmj7*W{**Q6C!Dv&e`n9{ z2KbLN=-=!2O>gFL(wm=vD4PE}17FHlHU&C$p3zPo5#?#ere@54V%Y>A7_#I zQM|@iW2al;9OU?hJdTaDgRR2SG{xSSx&Get}{Ko$T z|NTzkB1KdE%B{{_`wo%Vlq*JJ(4pCo>E|AOS7)hr*k=&{`2PqGfje&+o?LU+wvS%=vh)_D{~E(EpqB&*tiJQ0-65Stm4}a^s|D!>Voy|XKl52jW`5Wx_2K{yU2iy19>-ZD@r0!qf|8F1U p \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 000000000..48f580435 --- /dev/null +++ b/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_8_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_8_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_8_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_8_HOME=%JAVA_8_HOME:"=% +set JAVA_EXE=%JAVA_8_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_8_HOME is set to an invalid directory: %JAVA_8_HOME% +echo. +echo Please set the JAVA_8_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/src/main/java/backsun/lod/Main.java b/src/main/java/backsun/lod/Main.java new file mode 100644 index 000000000..8747653fe --- /dev/null +++ b/src/main/java/backsun/lod/Main.java @@ -0,0 +1,44 @@ +package backsun.lod; + +import backsun.lod.proxy.CommonProxy; +import backsun.lod.util.Reference; +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.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; + +/** + * + * @author James Seibel + * @version 04-16-2020 + */ +@Mod(modid = Reference.MOD_ID, name = Reference.NAME, version = Reference.VERSION) +public class Main +{ + @Instance + public static Main instance; + + @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.COMMON_PROXY_CLASS) + public static CommonProxy proxy; + + @EventHandler + public static void PreInit(FMLPreInitializationEvent event) + { + + } + + @EventHandler + public static void Init(FMLInitializationEvent event) + { + + } + + @EventHandler + public static void PostInit(FMLPostInitializationEvent event) + { + + } +} diff --git a/src/main/java/backsun/lod/hellofunctions.js b/src/main/java/backsun/lod/hellofunctions.js new file mode 100644 index 000000000..86bcf7511 --- /dev/null +++ b/src/main/java/backsun/lod/hellofunctions.js @@ -0,0 +1,78 @@ +import { initShaders, vec4, flatten } from "../../helperfunctions.js"; +let gl; +let canvas; +let program; +window.onload = function init() { + canvas = document.getElementById("gl-canvas"); + gl = canvas.getContext("webgl2"); + if (!gl) { + alert("WebGL isn't available"); + } + program = initShaders(gl, "vertex-shader", "fragment-shader"); + gl.useProgram(program); + // creating and buffering data + let trianglePoints = []; // create empty array + // large square + trianglePoints.push(new vec4(0, -0.2, 0, 1)); + trianglePoints.push(new vec4(0.4, 0.2, 0, 1)); + trianglePoints.push(new vec4(0, 0.6, 0, 1)); + trianglePoints.push(new vec4(0, 0.6, 0, 1)); + trianglePoints.push(new vec4(0, -0.2, 0, 1)); + trianglePoints.push(new vec4(-.4, 0.2, 0, 1)); + // bottom small square + trianglePoints.push(new vec4(0, -0.3, 0, 1)); + trianglePoints.push(new vec4(0.175, -0.475, 0, 1)); + trianglePoints.push(new vec4(0, -0.65, 0, 1)); + trianglePoints.push(new vec4(0, -0.3, 0, 1)); + trianglePoints.push(new vec4(0, -0.65, 0, 1)); + trianglePoints.push(new vec4(-0.175, -0.475, 0, 1)); + let offset = 0.225; + // center right small square + trianglePoints.push(new vec4(0 + offset, -0.3 + offset, 0, 1)); + trianglePoints.push(new vec4(0.175 + offset, -0.475 + offset, 0, 1)); + trianglePoints.push(new vec4(0 + offset, -0.65 + offset, 0, 1)); + trianglePoints.push(new vec4(0 + offset, -0.3 + offset, 0, 1)); + trianglePoints.push(new vec4(0 + offset, -0.65 + offset, 0, 1)); + trianglePoints.push(new vec4(-0.175 + offset, -0.475 + offset, 0, 1)); + offset = offset * 2; + // top right small square + trianglePoints.push(new vec4(0 + offset, -0.3 + offset, 0, 1)); + trianglePoints.push(new vec4(0.175 + offset, -0.475 + offset, 0, 1)); + trianglePoints.push(new vec4(0 + offset, -0.65 + offset, 0, 1)); + trianglePoints.push(new vec4(0 + offset, -0.3 + offset, 0, 1)); + trianglePoints.push(new vec4(0 + offset, -0.65 + offset, 0, 1)); + trianglePoints.push(new vec4(-0.175 + offset, -0.475 + offset, 0, 1)); + offset = 0.225; + // center right small square + trianglePoints.push(new vec4(0 - offset, -0.3 + offset, 0, 1)); + trianglePoints.push(new vec4(0.175 - offset, -0.475 + offset, 0, 1)); + trianglePoints.push(new vec4(0 - offset, -0.65 + offset, 0, 1)); + trianglePoints.push(new vec4(0 - offset, -0.3 + offset, 0, 1)); + trianglePoints.push(new vec4(0 - offset, -0.65 + offset, 0, 1)); + trianglePoints.push(new vec4(-0.175 - offset, -0.475 + offset, 0, 1)); + offset = offset * 2; + // top right small square + trianglePoints.push(new vec4(0 - offset, -0.3 + offset, 0, 1)); + trianglePoints.push(new vec4(0.175 - offset, -0.475 + offset, 0, 1)); + trianglePoints.push(new vec4(0 - offset, -0.65 + offset, 0, 1)); + trianglePoints.push(new vec4(0 - offset, -0.3 + offset, 0, 1)); + trianglePoints.push(new vec4(0 - offset, -0.65 + offset, 0, 1)); + trianglePoints.push(new vec4(-0.175 - offset, -0.475 + offset, 0, 1)); + //note that this is default viewing, so we have to stay between -1 and 1 for all coordinates + let bufferID = gl.createBuffer(); // create handle/reference to GPU memory spot + gl.bindBuffer(gl.ARRAY_BUFFER, bufferID); + gl.bufferData(gl.ARRAY_BUFFER, flatten(trianglePoints), gl.STATIC_DRAW); // send from main memory to GPU memory + // flatten converts data to 1D array + let vPosition = gl.getAttribLocation(program, "vPosition"); + gl.vertexAttribPointer(vPosition, 4, gl.FLOAT, false, 0, 0); + gl.enableVertexAttribArray(vPosition); + // end creating and buffering data + gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); // choose where we are going to draw to on the page + gl.clearColor(0.0, 0.0, 0.0, 1.0); // what is the background color (where we haven't drawn anything) + render(); // draw the frame +}; +function render() { + gl.clear(gl.COLOR_BUFFER_BIT); // remove everything that we drew last frame + gl.drawArrays(gl.TRIANGLES, 0, 36); +} +//# sourceMappingURL=hellofunctions.js.map \ No newline at end of file diff --git a/src/main/java/backsun/lod/proxy/ClientProxy.java b/src/main/java/backsun/lod/proxy/ClientProxy.java new file mode 100644 index 000000000..ad9d61120 --- /dev/null +++ b/src/main/java/backsun/lod/proxy/ClientProxy.java @@ -0,0 +1,19 @@ +package backsun.lod.proxy; + +import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.item.Item; +import net.minecraftforge.client.model.ModelLoader; + +public class ClientProxy extends CommonProxy +{ + /** + * @param item + * @param meta + * @param id + */ + @Override + public void registerItemRender(Item item, int meta, String id) + { + ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), id));; + } +} diff --git a/src/main/java/backsun/lod/proxy/CommonProxy.java b/src/main/java/backsun/lod/proxy/CommonProxy.java new file mode 100644 index 000000000..908cf649f --- /dev/null +++ b/src/main/java/backsun/lod/proxy/CommonProxy.java @@ -0,0 +1,18 @@ +package backsun.lod.proxy; + +import net.minecraft.item.Item; + +public class CommonProxy +{ + /** + * + * @param item + * @param meta + * @param id + */ + public void registerItemRender(Item item, int meta, String id) + { + // nothing is needed here, only the clientProxy needs to have an implementation of this + } + +} diff --git a/src/main/java/backsun/lod/util/CustomRenderer.java b/src/main/java/backsun/lod/util/CustomRenderer.java new file mode 100644 index 000000000..0b3d575ec --- /dev/null +++ b/src/main/java/backsun/lod/util/CustomRenderer.java @@ -0,0 +1,28 @@ +package backsun.lod.util; + +import org.lwjgl.opengl.GL11; + +public class CustomRenderer +{ + public static void drawTest(double x, double y, double z) + { + // renders a red x at the coordinates 9 9 9 + double doubleX = x;//mc.player.posX - 0.5; + double doubleY = y;//mc.player.posY + 0.1; + double doubleZ = z;//mc.player.posZ - 0.5; + + GL11.glPushMatrix(); + GL11.glTranslated(-doubleX, -doubleY, -doubleZ); + GL11.glColor3ub((byte)255,(byte)0,(byte)0); + float mx = 9; + float my = 9; + float mz = 9; + GL11.glBegin(GL11.GL_LINES); + GL11.glVertex3f(mx+0.4f,my,mz+0.4f); + GL11.glVertex3f(mx-0.4f,my,mz-0.4f); + GL11.glVertex3f(mx+0.4f,my,mz-0.4f); + GL11.glVertex3f(mx-0.4f,my,mz+0.4f); + GL11.glEnd(); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/backsun/lod/util/Reference.java b/src/main/java/backsun/lod/util/Reference.java new file mode 100644 index 000000000..aa1ae4477 --- /dev/null +++ b/src/main/java/backsun/lod/util/Reference.java @@ -0,0 +1,25 @@ +package backsun.lod.util; + +/** + * + * @author James Seibel + * @version 04-16-2020 + */ +public class Reference +{ + /** the mod's identifier */ + public static final String MOD_ID = "lod"; + /** the mod's name */ + public static final String NAME = "LOD Mod"; + /** the mod's version */ + public static final String VERSION = "1.0"; + /** the version of minecraft this mod is built for */ + public static final String ACCEPTED_VERSIONS = "[1.12.2]"; + + /** where the client proxy class is */ + public static final String CLIENT_PROXY_CLASS = "backsun.lod.proxy.ClientProxy"; + /** where the common proxy class is*/ + public static final String COMMON_PROXY_CLASS = "backsun.lod.proxy.CommonProxy"; + + +} diff --git a/src/main/java/net/minecraft/block/BlockCactus.java b/src/main/java/net/minecraft/block/BlockCactus.java new file mode 100644 index 000000000..eef1fe120 --- /dev/null +++ b/src/main/java/net/minecraft/block/BlockCactus.java @@ -0,0 +1,213 @@ +package net.minecraft.block; + +import java.util.Random; + +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockFaceShape; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +//import net.minecraft.init.Blocks; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; +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; + +public class BlockCactus extends Block implements net.minecraftforge.common.IPlantable +{ + public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15); + protected static final AxisAlignedBB CACTUS_COLLISION_AABB = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 0.9375D, 0.9375D); + protected static final AxisAlignedBB CACTUS_AABB = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 1.0D, 0.9375D); + + protected BlockCactus() + { + super(Material.CACTUS); + this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0))); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.DECORATIONS); + } + + @Override + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (!worldIn.isAreaLoaded(pos, 1)) return; // Forge: prevent growing cactus from loading unloaded chunks with block update + BlockPos blockpos = pos.up(); + + if (worldIn.isAirBlock(blockpos)) + { + int i; + + for (i = 1; worldIn.getBlockState(pos.down(i)).getBlock() == this; ++i) + { + ; + } + + if (i < 3) + { + int j = state.getValue(AGE).intValue(); + + if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(worldIn, blockpos, state, true)) + { + if (j == 15) + { + worldIn.setBlockState(blockpos, this.getDefaultState()); + IBlockState iblockstate = state.withProperty(AGE, Integer.valueOf(0)); + worldIn.setBlockState(pos, iblockstate, 4); + iblockstate.neighborChanged(worldIn, blockpos, this, pos); + } + else + { + worldIn.setBlockState(pos, state.withProperty(AGE, Integer.valueOf(j + 1)), 4); + } + net.minecraftforge.common.ForgeHooks.onCropsGrowPost(worldIn, pos, state, worldIn.getBlockState(pos)); + } + } + } + } + + @Override + public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) + { + return CACTUS_COLLISION_AABB; + } + + /** + * Return an AABB (in world coords!) that should be highlighted when the player is targeting this Block + */ + @Override + @SideOnly(Side.CLIENT) + public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World worldIn, BlockPos pos) + { + return CACTUS_AABB.offset(pos); + } + + @Override + public boolean isFullCube(IBlockState state) + { + return false; + } + + /** + * Used to determine ambient occlusion and culling when rebuilding chunks for render + */ + @Override + public boolean isOpaqueCube(IBlockState state) + { + return false; + } + + /** + * Checks if this block can be placed exactly at the given position. + */ + @Override + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return super.canPlaceBlockAt(worldIn, pos) ? this.canBlockStay(worldIn, pos) : false; + } + + /** + * Called when a neighboring block was changed and marks that this state should perform any checks during a neighbor + * change. Cases may include when redstone power is updated, cactus blocks popping off due to a neighboring solid + * block, etc. + */ + @Override + public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos) + { + // XXX this was changed as a proof of concept + //if (!this.canBlockStay(worldIn, pos)) + //{ + // worldIn.destroyBlock(pos, true); + //} + } + + public boolean canBlockStay(World worldIn, BlockPos pos) + { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + Material material = worldIn.getBlockState(pos.offset(enumfacing)).getMaterial(); + + if (material.isSolid() || material == Material.LAVA) + { + return false; + } + } + + IBlockState state = worldIn.getBlockState(pos.down()); + return state.getBlock().canSustainPlant(state, worldIn, pos.down(), EnumFacing.UP, this) && !worldIn.getBlockState(pos.up()).getMaterial().isLiquid(); + } + + /** + * Called When an Entity Collided with the Block + */ + @Override + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) + { + entityIn.attackEntityFrom(DamageSource.CACTUS, 1.0F); + } + + /** + * Convert the given metadata into a BlockState for this Block + */ + @Override + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(AGE, Integer.valueOf(meta)); + } + + @Override + @SideOnly(Side.CLIENT) + public BlockRenderLayer getBlockLayer() + { + return BlockRenderLayer.CUTOUT; + } + + /** + * Convert the BlockState into the correct metadata value + */ + @Override + public int getMetaFromState(IBlockState state) + { + return state.getValue(AGE).intValue(); + } + + @Override + public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) + { + return net.minecraftforge.common.EnumPlantType.Desert; + } + + @Override + public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos) + { + return getDefaultState(); + } + + @Override + protected BlockStateContainer createBlockState() + { + return new BlockStateContainer(this, new IProperty[] {AGE}); + } + + /** + * Get the geometry of the queried face at the given position and state. This is used to decide whether things like + * buttons are allowed to be placed on the face, or how glass panes connect to the face, among other things. + *

+ * Common values are {@code SOLID}, which is the default, and {@code UNDEFINED}, which represents something that + * does not fit the other descriptions and will generally cause other things not to connect to the face. + * + * @return an approximation of the form of the given face + */ + @Override + public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face) + { + return BlockFaceShape.UNDEFINED; + } +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/renderer/EntityRenderer.java b/src/main/java/net/minecraft/client/renderer/EntityRenderer.java new file mode 100644 index 000000000..a97936bf8 --- /dev/null +++ b/src/main/java/net/minecraft/client/renderer/EntityRenderer.java @@ -0,0 +1,2189 @@ +package net.minecraft.client.renderer; + +import java.awt.Graphics; +import java.awt.image.BufferedImage; +import java.awt.image.ImageObserver; +import java.io.IOException; +import java.nio.FloatBuffer; +import java.util.List; +import java.util.Random; + +import javax.annotation.Nullable; +import javax.imageio.ImageIO; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GLContext; +import org.lwjgl.util.glu.Project; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import com.google.gson.JsonSyntaxException; + +import backsun.lod.util.CustomRenderer; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.MapItemRenderer; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.particle.ParticleManager; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.culling.ClippingHelperImpl; +import net.minecraft.client.renderer.culling.Frustum; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.client.shader.ShaderGroup; +import net.minecraft.client.shader.ShaderLinkHelper; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.crash.ICrashReportDetail; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.MobEffects; +import net.minecraft.init.SoundEvents; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EntitySelectors; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MouseFilter; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.ScreenShotHelper; +import net.minecraft.util.SoundCategory; +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.GameType; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +@SuppressWarnings("deprecation") +@SideOnly(Side.CLIENT) +public class EntityRenderer implements IResourceManagerReloadListener +{ + private static final Logger LOGGER = LogManager.getLogger(); + private static final ResourceLocation RAIN_TEXTURES = new ResourceLocation("textures/environment/rain.png"); + private static final ResourceLocation SNOW_TEXTURES = new ResourceLocation("textures/environment/snow.png"); + public static boolean anaglyphEnable; + /** Anaglyph field (0=R, 1=GB) */ + public static int anaglyphField; + /** A reference to the Minecraft object. */ + private final Minecraft mc; + private final IResourceManager resourceManager; + private final Random random = new Random(); + private float farPlaneDistance; + public final ItemRenderer itemRenderer; + private final MapItemRenderer mapItemRenderer; + /** Entity renderer update count */ + private int rendererUpdateCount; + /** Pointed entity */ + private Entity pointedEntity; + private final MouseFilter mouseFilterXAxis = new MouseFilter(); + private final MouseFilter mouseFilterYAxis = new MouseFilter(); + /** Previous third person distance */ + private float thirdPersonDistancePrev = 4.0F; + /** Smooth cam yaw */ + private float smoothCamYaw; + /** Smooth cam pitch */ + private float smoothCamPitch; + /** Smooth cam filter X */ + private float smoothCamFilterX; + /** Smooth cam filter Y */ + private float smoothCamFilterY; + /** Smooth cam partial ticks */ + private float smoothCamPartialTicks; + /** FOV modifier hand */ + private float fovModifierHand; + /** FOV modifier hand prev */ + private float fovModifierHandPrev; + private float bossColorModifier; + private float bossColorModifierPrev; + /** Cloud fog mode */ + private boolean cloudFog; + private boolean renderHand = true; + private boolean drawBlockOutline = true; + private long timeWorldIcon; + /** Previous frame time in milliseconds */ + private long prevFrameTime = Minecraft.getSystemTime(); + /** The texture id of the blocklight/skylight texture used for lighting effects */ + private final DynamicTexture lightmapTexture; + /** Colors computed in updateLightmap() and loaded into the lightmap emptyTexture */ + private final int[] lightmapColors; + private final ResourceLocation locationLightMap; + /** Is set, updateCameraAndRender() calls updateLightmap(); set by updateTorchFlicker() */ + private boolean lightmapUpdateNeeded; + /** Torch flicker X */ + private float torchFlickerX; + private float torchFlickerDX; + /** Rain sound counter */ + private int rainSoundCounter; + private final float[] rainXCoords = new float[1024]; + private final float[] rainYCoords = new float[1024]; + /** Fog color buffer */ + private final FloatBuffer fogColorBuffer = GLAllocation.createDirectFloatBuffer(16); + private float fogColorRed; + private float fogColorGreen; + private float fogColorBlue; + /** Fog color 2 */ + private float fogColor2; + /** Fog color 1 */ + private float fogColor1; + private int debugViewDirection; + private boolean debugView; + private double cameraZoom = 1.0D; + private double cameraYaw; + private double cameraPitch; + private ItemStack itemActivationItem; + private int itemActivationTicks; + private float itemActivationOffX; + private float itemActivationOffY; + private ShaderGroup shaderGroup; + private static final ResourceLocation[] SHADERS_TEXTURES = new ResourceLocation[] {new ResourceLocation("shaders/post/notch.json"), new ResourceLocation("shaders/post/fxaa.json"), new ResourceLocation("shaders/post/art.json"), new ResourceLocation("shaders/post/bumpy.json"), new ResourceLocation("shaders/post/blobs2.json"), new ResourceLocation("shaders/post/pencil.json"), new ResourceLocation("shaders/post/color_convolve.json"), new ResourceLocation("shaders/post/deconverge.json"), new ResourceLocation("shaders/post/flip.json"), new ResourceLocation("shaders/post/invert.json"), new ResourceLocation("shaders/post/ntsc.json"), new ResourceLocation("shaders/post/outline.json"), new ResourceLocation("shaders/post/phosphor.json"), new ResourceLocation("shaders/post/scan_pincushion.json"), new ResourceLocation("shaders/post/sobel.json"), new ResourceLocation("shaders/post/bits.json"), new ResourceLocation("shaders/post/desaturate.json"), new ResourceLocation("shaders/post/green.json"), new ResourceLocation("shaders/post/blur.json"), new ResourceLocation("shaders/post/wobble.json"), new ResourceLocation("shaders/post/blobs.json"), new ResourceLocation("shaders/post/antialias.json"), new ResourceLocation("shaders/post/creeper.json"), new ResourceLocation("shaders/post/spider.json")}; + public static final int SHADER_COUNT = SHADERS_TEXTURES.length; + private int shaderIndex; + private boolean useShader; + private int frameCount; + + public EntityRenderer(Minecraft mcIn, IResourceManager resourceManagerIn) + { + this.shaderIndex = SHADER_COUNT; + this.mc = mcIn; + this.resourceManager = resourceManagerIn; + this.itemRenderer = mcIn.getItemRenderer(); + this.mapItemRenderer = new MapItemRenderer(mcIn.getTextureManager()); + this.lightmapTexture = new DynamicTexture(16, 16); + this.locationLightMap = mcIn.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture); + this.lightmapColors = this.lightmapTexture.getTextureData(); + this.shaderGroup = null; + + for (int i = 0; i < 32; ++i) + { + for (int j = 0; j < 32; ++j) + { + float f = j - 16; + float f1 = i - 16; + float f2 = MathHelper.sqrt(f * f + f1 * f1); + this.rainXCoords[i << 5 | j] = -f1 / f2; + this.rainYCoords[i << 5 | j] = f / f2; + } + } + } + + public boolean isShaderActive() + { + return OpenGlHelper.shadersSupported && this.shaderGroup != null; + } + + public void stopUseShader() + { + if (this.shaderGroup != null) + { + this.shaderGroup.deleteShaderGroup(); + } + + this.shaderGroup = null; + this.shaderIndex = SHADER_COUNT; + } + + public void switchUseShader() + { + this.useShader = !this.useShader; + } + + /** + * What shader to use when spectating this entity + */ + public void loadEntityShader(@Nullable Entity entityIn) + { + if (OpenGlHelper.shadersSupported) + { + if (this.shaderGroup != null) + { + this.shaderGroup.deleteShaderGroup(); + } + + this.shaderGroup = null; + + if (entityIn instanceof EntityCreeper) + { + this.loadShader(new ResourceLocation("shaders/post/creeper.json")); + } + else if (entityIn instanceof EntitySpider) + { + this.loadShader(new ResourceLocation("shaders/post/spider.json")); + } + else if (entityIn instanceof EntityEnderman) + { + this.loadShader(new ResourceLocation("shaders/post/invert.json")); + } + else net.minecraftforge.client.ForgeHooksClient.loadEntityShader(entityIn, this); + } + } + + public void loadShader(ResourceLocation resourceLocationIn) + { + try + { + this.shaderGroup = new ShaderGroup(this.mc.getTextureManager(), this.resourceManager, this.mc.getFramebuffer(), resourceLocationIn); + this.shaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight); + this.useShader = true; + } + catch (IOException ioexception) + { + LOGGER.warn("Failed to load shader: {}", resourceLocationIn, ioexception); + this.shaderIndex = SHADER_COUNT; + this.useShader = false; + } + catch (JsonSyntaxException jsonsyntaxexception) + { + LOGGER.warn("Failed to load shader: {}", resourceLocationIn, jsonsyntaxexception); + this.shaderIndex = SHADER_COUNT; + this.useShader = false; + } + } + + @Override + public void onResourceManagerReload(IResourceManager resourceManager) + { + if (this.shaderGroup != null) + { + this.shaderGroup.deleteShaderGroup(); + } + + this.shaderGroup = null; + + if (this.shaderIndex == SHADER_COUNT) + { + this.loadEntityShader(this.mc.getRenderViewEntity()); + } + else + { + this.loadShader(SHADERS_TEXTURES[this.shaderIndex]); + } + } + + /** + * Updates the entity renderer + */ + public void updateRenderer() + { + if (OpenGlHelper.shadersSupported && ShaderLinkHelper.getStaticShaderLinkHelper() == null) + { + ShaderLinkHelper.setNewStaticShaderLinkHelper(); + } + + this.updateFovModifierHand(); + this.updateTorchFlicker(); + this.fogColor2 = this.fogColor1; + this.thirdPersonDistancePrev = 4.0F; + + if (this.mc.gameSettings.smoothCamera) + { + float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; + float f1 = f * f * f * 8.0F; + this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * f1); + this.smoothCamFilterY = this.mouseFilterYAxis.smooth(this.smoothCamPitch, 0.05F * f1); + this.smoothCamPartialTicks = 0.0F; + this.smoothCamYaw = 0.0F; + this.smoothCamPitch = 0.0F; + } + else + { + this.smoothCamFilterX = 0.0F; + this.smoothCamFilterY = 0.0F; + this.mouseFilterXAxis.reset(); + this.mouseFilterYAxis.reset(); + } + + if (this.mc.getRenderViewEntity() == null) + { + this.mc.setRenderViewEntity(this.mc.player); + } + + float f3 = this.mc.world.getLightBrightness(new BlockPos(this.mc.getRenderViewEntity().getPositionEyes(1F))); // Forge: fix MC-51150 + float f4 = this.mc.gameSettings.renderDistanceChunks / 32.0F; + float f2 = f3 * (1.0F - f4) + f4; + this.fogColor1 += (f2 - this.fogColor1) * 0.1F; + ++this.rendererUpdateCount; + this.itemRenderer.updateEquippedItem(); + this.addRainParticles(); + this.bossColorModifierPrev = this.bossColorModifier; + + if (this.mc.ingameGUI.getBossOverlay().shouldDarkenSky()) + { + this.bossColorModifier += 0.05F; + + if (this.bossColorModifier > 1.0F) + { + this.bossColorModifier = 1.0F; + } + } + else if (this.bossColorModifier > 0.0F) + { + this.bossColorModifier -= 0.0125F; + } + + if (this.itemActivationTicks > 0) + { + --this.itemActivationTicks; + + if (this.itemActivationTicks == 0) + { + this.itemActivationItem = null; + } + } + } + + public ShaderGroup getShaderGroup() + { + return this.shaderGroup; + } + + public void updateShaderGroupSize(int width, int height) + { + if (OpenGlHelper.shadersSupported) + { + if (this.shaderGroup != null) + { + this.shaderGroup.createBindFramebuffers(width, height); + } + + this.mc.renderGlobal.createBindEntityOutlineFbs(width, height); + } + } + + /** + * Gets the block or object that is being moused over. + */ + public void getMouseOver(float partialTicks) + { + Entity entity = this.mc.getRenderViewEntity(); + + if (entity != null) + { + if (this.mc.world != null) + { + this.mc.mcProfiler.startSection("pick"); + this.mc.pointedEntity = null; + double d0 = this.mc.playerController.getBlockReachDistance(); + this.mc.objectMouseOver = entity.rayTrace(d0, partialTicks); + Vec3d vec3d = entity.getPositionEyes(partialTicks); + boolean flag = false; + double d1 = d0; + + if (this.mc.playerController.extendedReach()) + { + d1 = 6.0D; + d0 = d1; + } + else + { + if (d0 > 3.0D) + { + flag = true; + } + } + + if (this.mc.objectMouseOver != null) + { + d1 = this.mc.objectMouseOver.hitVec.distanceTo(vec3d); + } + + Vec3d vec3d1 = entity.getLook(1.0F); + Vec3d vec3d2 = vec3d.addVector(vec3d1.x * d0, vec3d1.y * d0, vec3d1.z * d0); + this.pointedEntity = null; + Vec3d vec3d3 = null; + List list = this.mc.world.getEntitiesInAABBexcluding(entity, entity.getEntityBoundingBox().expand(vec3d1.x * d0, vec3d1.y * d0, vec3d1.z * d0).grow(1.0D, 1.0D, 1.0D), Predicates.and(EntitySelectors.NOT_SPECTATING, new Predicate() + { + @Override + public boolean apply(@Nullable Entity p_apply_1_) + { + return p_apply_1_ != null && p_apply_1_.canBeCollidedWith(); + } + })); + double d2 = d1; + + for (int j = 0; j < list.size(); ++j) + { + Entity entity1 = list.get(j); + AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().grow(entity1.getCollisionBorderSize()); + RayTraceResult raytraceresult = axisalignedbb.calculateIntercept(vec3d, vec3d2); + + if (axisalignedbb.contains(vec3d)) + { + if (d2 >= 0.0D) + { + this.pointedEntity = entity1; + vec3d3 = raytraceresult == null ? vec3d : raytraceresult.hitVec; + d2 = 0.0D; + } + } + else if (raytraceresult != null) + { + double d3 = vec3d.distanceTo(raytraceresult.hitVec); + + if (d3 < d2 || d2 == 0.0D) + { + if (entity1.getLowestRidingEntity() == entity.getLowestRidingEntity() && !entity1.canRiderInteract()) + { + if (d2 == 0.0D) + { + this.pointedEntity = entity1; + vec3d3 = raytraceresult.hitVec; + } + } + else + { + this.pointedEntity = entity1; + vec3d3 = raytraceresult.hitVec; + d2 = d3; + } + } + } + } + + if (this.pointedEntity != null && flag && vec3d.distanceTo(vec3d3) > 3.0D) + { + this.pointedEntity = null; + this.mc.objectMouseOver = new RayTraceResult(RayTraceResult.Type.MISS, vec3d3, (EnumFacing)null, new BlockPos(vec3d3)); + } + + if (this.pointedEntity != null && (d2 < d1 || this.mc.objectMouseOver == null)) + { + this.mc.objectMouseOver = new RayTraceResult(this.pointedEntity, vec3d3); + + if (this.pointedEntity instanceof EntityLivingBase || this.pointedEntity instanceof EntityItemFrame) + { + this.mc.pointedEntity = this.pointedEntity; + } + } + + this.mc.mcProfiler.endSection(); + } + } + } + + /** + * Update FOV modifier hand + */ + private void updateFovModifierHand() + { + float f = 1.0F; + + if (this.mc.getRenderViewEntity() instanceof AbstractClientPlayer) + { + AbstractClientPlayer abstractclientplayer = (AbstractClientPlayer)this.mc.getRenderViewEntity(); + f = abstractclientplayer.getFovModifier(); + } + + this.fovModifierHandPrev = this.fovModifierHand; + this.fovModifierHand += (f - this.fovModifierHand) * 0.5F; + + if (this.fovModifierHand > 1.5F) + { + this.fovModifierHand = 1.5F; + } + + if (this.fovModifierHand < 0.1F) + { + this.fovModifierHand = 0.1F; + } + } + + /** + * Changes the field of view of the player depending on if they are underwater or not + */ + private float getFOVModifier(float partialTicks, boolean useFOVSetting) + { + if (this.debugView) + { + return 90.0F; + } + else + { + Entity entity = this.mc.getRenderViewEntity(); + float f = 70.0F; + + if (useFOVSetting) + { + f = this.mc.gameSettings.fovSetting; + f = f * (this.fovModifierHandPrev + (this.fovModifierHand - this.fovModifierHandPrev) * partialTicks); + } + + if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).getHealth() <= 0.0F) + { + float f1 = ((EntityLivingBase)entity).deathTime + partialTicks; + f /= (1.0F - 500.0F / (f1 + 500.0F)) * 2.0F + 1.0F; + } + + IBlockState iblockstate = ActiveRenderInfo.getBlockStateAtEntityViewpoint(this.mc.world, entity, partialTicks); + + if (iblockstate.getMaterial() == Material.WATER) + { + f = f * 60.0F / 70.0F; + } + + return net.minecraftforge.client.ForgeHooksClient.getFOVModifier(this, entity, iblockstate, partialTicks, f); + } + } + + private void hurtCameraEffect(float partialTicks) + { + if (this.mc.getRenderViewEntity() instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)this.mc.getRenderViewEntity(); + float f = entitylivingbase.hurtTime - partialTicks; + + if (entitylivingbase.getHealth() <= 0.0F) + { + float f1 = entitylivingbase.deathTime + partialTicks; + GlStateManager.rotate(40.0F - 8000.0F / (f1 + 200.0F), 0.0F, 0.0F, 1.0F); + } + + if (f < 0.0F) + { + return; + } + + f = f / entitylivingbase.maxHurtTime; + f = MathHelper.sin(f * f * f * f * (float)Math.PI); + float f2 = entitylivingbase.attackedAtYaw; + GlStateManager.rotate(-f2, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-f * 14.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(f2, 0.0F, 1.0F, 0.0F); + } + } + + /** + * Updates the bobbing render effect of the player. + */ + private void applyBobbing(float partialTicks) + { + if (this.mc.getRenderViewEntity() instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)this.mc.getRenderViewEntity(); + float f = entityplayer.distanceWalkedModified - entityplayer.prevDistanceWalkedModified; + float f1 = -(entityplayer.distanceWalkedModified + f * partialTicks); + float f2 = entityplayer.prevCameraYaw + (entityplayer.cameraYaw - entityplayer.prevCameraYaw) * partialTicks; + float f3 = entityplayer.prevCameraPitch + (entityplayer.cameraPitch - entityplayer.prevCameraPitch) * partialTicks; + GlStateManager.translate(MathHelper.sin(f1 * (float)Math.PI) * f2 * 0.5F, -Math.abs(MathHelper.cos(f1 * (float)Math.PI) * f2), 0.0F); + GlStateManager.rotate(MathHelper.sin(f1 * (float)Math.PI) * f2 * 3.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(Math.abs(MathHelper.cos(f1 * (float)Math.PI - 0.2F) * f2) * 5.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(f3, 1.0F, 0.0F, 0.0F); + } + } + + /** + * sets up player's eye (or camera in third person mode) + */ + private void orientCamera(float partialTicks) + { + Entity entity = this.mc.getRenderViewEntity(); + float f = entity.getEyeHeight(); + double d0 = entity.prevPosX + (entity.posX - entity.prevPosX) * partialTicks; + double d1 = entity.prevPosY + (entity.posY - entity.prevPosY) * partialTicks + f; + double d2 = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * partialTicks; + + if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).isPlayerSleeping()) + { + f = (float)(f + 1.0D); + GlStateManager.translate(0.0F, 0.3F, 0.0F); + + if (!this.mc.gameSettings.debugCamEnable) + { + BlockPos blockpos = new BlockPos(entity); + IBlockState iblockstate = this.mc.world.getBlockState(blockpos); + net.minecraftforge.client.ForgeHooksClient.orientBedCamera(this.mc.world, blockpos, iblockstate, entity); + + GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks + 180.0F, 0.0F, -1.0F, 0.0F); + GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, -1.0F, 0.0F, 0.0F); + } + } + else if (this.mc.gameSettings.thirdPersonView > 0) + { + double d3 = this.thirdPersonDistancePrev + (4.0F - this.thirdPersonDistancePrev) * partialTicks; + + if (this.mc.gameSettings.debugCamEnable) + { + GlStateManager.translate(0.0F, 0.0F, (float)(-d3)); + } + else + { + float f1 = entity.rotationYaw; + float f2 = entity.rotationPitch; + + if (this.mc.gameSettings.thirdPersonView == 2) + { + f2 += 180.0F; + } + + double d4 = -MathHelper.sin(f1 * 0.017453292F) * MathHelper.cos(f2 * 0.017453292F) * d3; + double d5 = MathHelper.cos(f1 * 0.017453292F) * MathHelper.cos(f2 * 0.017453292F) * d3; + double d6 = (-MathHelper.sin(f2 * 0.017453292F)) * d3; + + for (int i = 0; i < 8; ++i) + { + float f3 = (i & 1) * 2 - 1; + float f4 = (i >> 1 & 1) * 2 - 1; + float f5 = (i >> 2 & 1) * 2 - 1; + f3 = f3 * 0.1F; + f4 = f4 * 0.1F; + f5 = f5 * 0.1F; + RayTraceResult raytraceresult = this.mc.world.rayTraceBlocks(new Vec3d(d0 + f3, d1 + f4, d2 + f5), new Vec3d(d0 - d4 + f3 + f5, d1 - d6 + f4, d2 - d5 + f5)); + + if (raytraceresult != null) + { + double d7 = raytraceresult.hitVec.distanceTo(new Vec3d(d0, d1, d2)); + + if (d7 < d3) + { + d3 = d7; + } + } + } + + if (this.mc.gameSettings.thirdPersonView == 2) + { + GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); + } + + GlStateManager.rotate(entity.rotationPitch - f2, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(entity.rotationYaw - f1, 0.0F, 1.0F, 0.0F); + GlStateManager.translate(0.0F, 0.0F, (float)(-d3)); + GlStateManager.rotate(f1 - entity.rotationYaw, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(f2 - entity.rotationPitch, 1.0F, 0.0F, 0.0F); + } + } + else + { + GlStateManager.translate(0.0F, 0.0F, 0.05F); + } + + if (!this.mc.gameSettings.debugCamEnable) + { + float yaw = entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks + 180.0F; + float pitch = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks; + float roll = 0.0F; + if (entity instanceof EntityAnimal) + { + EntityAnimal entityanimal = (EntityAnimal)entity; + yaw = entityanimal.prevRotationYawHead + (entityanimal.rotationYawHead - entityanimal.prevRotationYawHead) * partialTicks + 180.0F; + } + IBlockState state = ActiveRenderInfo.getBlockStateAtEntityViewpoint(this.mc.world, entity, partialTicks); + net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup event = new net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup(this, entity, state, partialTicks, yaw, pitch, roll); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); + GlStateManager.rotate(event.getRoll(), 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(event.getPitch(), 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(event.getYaw(), 0.0F, 1.0F, 0.0F); + } + + GlStateManager.translate(0.0F, -f, 0.0F); + d0 = entity.prevPosX + (entity.posX - entity.prevPosX) * partialTicks; + d1 = entity.prevPosY + (entity.posY - entity.prevPosY) * partialTicks + f; + d2 = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * partialTicks; + this.cloudFog = this.mc.renderGlobal.hasCloudFog(d0, d1, d2, partialTicks); + } + + /** + * sets up projection, view effects, camera position/rotation + */ + private void setupCameraTransform(float partialTicks, int pass) + { + this.farPlaneDistance = this.mc.gameSettings.renderDistanceChunks * 16; + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + + if (this.mc.gameSettings.anaglyph) + { + GlStateManager.translate((-(pass * 2 - 1)) * 0.07F, 0.0F, 0.0F); + } + + if (this.cameraZoom != 1.0D) + { + GlStateManager.translate((float)this.cameraYaw, (float)(-this.cameraPitch), 0.0F); + GlStateManager.scale(this.cameraZoom, this.cameraZoom, 1.0D); + } + + Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * MathHelper.SQRT_2); + GlStateManager.matrixMode(5888); + GlStateManager.loadIdentity(); + + if (this.mc.gameSettings.anaglyph) + { + GlStateManager.translate((pass * 2 - 1) * 0.1F, 0.0F, 0.0F); + } + + this.hurtCameraEffect(partialTicks); + + if (this.mc.gameSettings.viewBobbing) + { + this.applyBobbing(partialTicks); + } + + float f1 = this.mc.player.prevTimeInPortal + (this.mc.player.timeInPortal - this.mc.player.prevTimeInPortal) * partialTicks; + + if (f1 > 0.0F) + { + int i = 20; + + if (this.mc.player.isPotionActive(MobEffects.NAUSEA)) + { + i = 7; + } + + float f2 = 5.0F / (f1 * f1 + 5.0F) - f1 * 0.04F; + f2 = f2 * f2; + GlStateManager.rotate((this.rendererUpdateCount + partialTicks) * i, 0.0F, 1.0F, 1.0F); + GlStateManager.scale(1.0F / f2, 1.0F, 1.0F); + GlStateManager.rotate(-(this.rendererUpdateCount + partialTicks) * i, 0.0F, 1.0F, 1.0F); + } + + this.orientCamera(partialTicks); + + if (this.debugView) + { + switch (this.debugViewDirection) + { + case 0: + GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F); + break; + case 1: + GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); + break; + case 2: + GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F); + break; + case 3: + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + break; + case 4: + GlStateManager.rotate(-90.0F, 1.0F, 0.0F, 0.0F); + } + } + } + + /** + * Render player hand + */ + private void renderHand(float partialTicks, int pass) + { + if (!this.debugView) + { + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + + if (this.mc.gameSettings.anaglyph) + { + GlStateManager.translate((-(pass * 2 - 1)) * 0.07F, 0.0F, 0.0F); + } + + Project.gluPerspective(this.getFOVModifier(partialTicks, false), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); + GlStateManager.matrixMode(5888); + GlStateManager.loadIdentity(); + + if (this.mc.gameSettings.anaglyph) + { + GlStateManager.translate((pass * 2 - 1) * 0.1F, 0.0F, 0.0F); + } + + GlStateManager.pushMatrix(); + this.hurtCameraEffect(partialTicks); + + if (this.mc.gameSettings.viewBobbing) + { + this.applyBobbing(partialTicks); + } + + boolean flag = this.mc.getRenderViewEntity() instanceof EntityLivingBase && ((EntityLivingBase)this.mc.getRenderViewEntity()).isPlayerSleeping(); + + if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(mc.renderGlobal, partialTicks, pass)) + if (this.mc.gameSettings.thirdPersonView == 0 && !flag && !this.mc.gameSettings.hideGUI && !this.mc.playerController.isSpectator()) + { + this.enableLightmap(); + this.itemRenderer.renderItemInFirstPerson(partialTicks); + this.disableLightmap(); + } + + GlStateManager.popMatrix(); + + if (this.mc.gameSettings.thirdPersonView == 0 && !flag) + { + this.itemRenderer.renderOverlays(partialTicks); + this.hurtCameraEffect(partialTicks); + } + + if (this.mc.gameSettings.viewBobbing) + { + this.applyBobbing(partialTicks); + } + } + } + + public void disableLightmap() + { + GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GlStateManager.disableTexture2D(); + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); + } + + public void enableLightmap() + { + GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GlStateManager.matrixMode(5890); + GlStateManager.loadIdentity(); + GlStateManager.scale(0.00390625F, 0.00390625F, 0.00390625F); + GlStateManager.translate(8.0F, 8.0F, 8.0F); + GlStateManager.matrixMode(5888); + this.mc.getTextureManager().bindTexture(this.locationLightMap); + GlStateManager.glTexParameteri(3553, 10241, 9729); + GlStateManager.glTexParameteri(3553, 10240, 9729); + GlStateManager.glTexParameteri(3553, 10242, 10496); + GlStateManager.glTexParameteri(3553, 10243, 10496); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.enableTexture2D(); + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); + } + + /** + * Recompute a random value that is applied to block color in updateLightmap() + */ + private void updateTorchFlicker() + { + this.torchFlickerDX = (float)(this.torchFlickerDX + (Math.random() - Math.random()) * Math.random() * Math.random()); + this.torchFlickerDX = (float)(this.torchFlickerDX * 0.9D); + this.torchFlickerX += this.torchFlickerDX - this.torchFlickerX; + this.lightmapUpdateNeeded = true; + } + + private void updateLightmap(float partialTicks) + { + if (this.lightmapUpdateNeeded) + { + this.mc.mcProfiler.startSection("lightTex"); + World world = this.mc.world; + + if (world != null) + { + float f = world.getSunBrightness(1.0F); + float f1 = f * 0.95F + 0.05F; + + for (int i = 0; i < 256; ++i) + { + float f2 = world.provider.getLightBrightnessTable()[i / 16] * f1; + float f3 = world.provider.getLightBrightnessTable()[i % 16] * (this.torchFlickerX * 0.1F + 1.5F); + + if (world.getLastLightningBolt() > 0) + { + f2 = world.provider.getLightBrightnessTable()[i / 16]; + } + + float f4 = f2 * (f * 0.65F + 0.35F); + float f5 = f2 * (f * 0.65F + 0.35F); + float f6 = f3 * ((f3 * 0.6F + 0.4F) * 0.6F + 0.4F); + float f7 = f3 * (f3 * f3 * 0.6F + 0.4F); + float f8 = f4 + f3; + float f9 = f5 + f6; + float f10 = f2 + f7; + f8 = f8 * 0.96F + 0.03F; + f9 = f9 * 0.96F + 0.03F; + f10 = f10 * 0.96F + 0.03F; + + if (this.bossColorModifier > 0.0F) + { + float f11 = this.bossColorModifierPrev + (this.bossColorModifier - this.bossColorModifierPrev) * partialTicks; + f8 = f8 * (1.0F - f11) + f8 * 0.7F * f11; + f9 = f9 * (1.0F - f11) + f9 * 0.6F * f11; + f10 = f10 * (1.0F - f11) + f10 * 0.6F * f11; + } + + if (world.provider.getDimensionType().getId() == 1) + { + f8 = 0.22F + f3 * 0.75F; + f9 = 0.28F + f6 * 0.75F; + f10 = 0.25F + f7 * 0.75F; + } + + float[] colors = {f8, f9, f10}; + world.provider.getLightmapColors(partialTicks, f, f2, f3, colors); + f8 = colors[0]; f9 = colors[1]; f10 = colors[2]; + + // Forge: fix MC-58177 + f8 = MathHelper.clamp(f8, 0f, 1f); + f9 = MathHelper.clamp(f9, 0f, 1f); + f10 = MathHelper.clamp(f10, 0f, 1f); + + if (this.mc.player.isPotionActive(MobEffects.NIGHT_VISION)) + { + float f15 = this.getNightVisionBrightness(this.mc.player, partialTicks); + float f12 = 1.0F / f8; + + if (f12 > 1.0F / f9) + { + f12 = 1.0F / f9; + } + + if (f12 > 1.0F / f10) + { + f12 = 1.0F / f10; + } + + f8 = f8 * (1.0F - f15) + f8 * f12 * f15; + f9 = f9 * (1.0F - f15) + f9 * f12 * f15; + f10 = f10 * (1.0F - f15) + f10 * f12 * f15; + } + + if (f8 > 1.0F) + { + f8 = 1.0F; + } + + if (f9 > 1.0F) + { + f9 = 1.0F; + } + + if (f10 > 1.0F) + { + f10 = 1.0F; + } + + float f16 = this.mc.gameSettings.gammaSetting; + float f17 = 1.0F - f8; + float f13 = 1.0F - f9; + float f14 = 1.0F - f10; + f17 = 1.0F - f17 * f17 * f17 * f17; + f13 = 1.0F - f13 * f13 * f13 * f13; + f14 = 1.0F - f14 * f14 * f14 * f14; + f8 = f8 * (1.0F - f16) + f17 * f16; + f9 = f9 * (1.0F - f16) + f13 * f16; + f10 = f10 * (1.0F - f16) + f14 * f16; + f8 = f8 * 0.96F + 0.03F; + f9 = f9 * 0.96F + 0.03F; + f10 = f10 * 0.96F + 0.03F; + + if (f8 > 1.0F) + { + f8 = 1.0F; + } + + if (f9 > 1.0F) + { + f9 = 1.0F; + } + + if (f10 > 1.0F) + { + f10 = 1.0F; + } + + if (f8 < 0.0F) + { + f8 = 0.0F; + } + + if (f9 < 0.0F) + { + f9 = 0.0F; + } + + if (f10 < 0.0F) + { + f10 = 0.0F; + } + + int k = (int)(f8 * 255.0F); + int l = (int)(f9 * 255.0F); + int i1 = (int)(f10 * 255.0F); + this.lightmapColors[i] = -16777216 | k << 16 | l << 8 | i1; + } + + this.lightmapTexture.updateDynamicTexture(); + this.lightmapUpdateNeeded = false; + this.mc.mcProfiler.endSection(); + } + } + } + + private float getNightVisionBrightness(EntityLivingBase entitylivingbaseIn, float partialTicks) + { + int i = entitylivingbaseIn.getActivePotionEffect(MobEffects.NIGHT_VISION).getDuration(); + return i > 200 ? 1.0F : 0.7F + MathHelper.sin((i - partialTicks) * (float)Math.PI * 0.2F) * 0.3F; + } + + public void updateCameraAndRender(float partialTicks, long nanoTime) + { + boolean flag = Display.isActive(); + + if (!flag && this.mc.gameSettings.pauseOnLostFocus && (!this.mc.gameSettings.touchscreen || !Mouse.isButtonDown(1))) + { + if (Minecraft.getSystemTime() - this.prevFrameTime > 500L) + { + this.mc.displayInGameMenu(); + } + } + else + { + this.prevFrameTime = Minecraft.getSystemTime(); + } + + this.mc.mcProfiler.startSection("mouse"); + + if (flag && Minecraft.IS_RUNNING_ON_MAC && this.mc.inGameHasFocus && !Mouse.isInsideWindow()) + { + Mouse.setGrabbed(false); + Mouse.setCursorPosition(Display.getWidth() / 2, Display.getHeight() / 2 - 20); + Mouse.setGrabbed(true); + } + + if (this.mc.inGameHasFocus && flag) + { + this.mc.mouseHelper.mouseXYChange(); + this.mc.getTutorial().handleMouse(this.mc.mouseHelper); + float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; + float f1 = f * f * f * 8.0F; + float f2 = this.mc.mouseHelper.deltaX * f1; + float f3 = this.mc.mouseHelper.deltaY * f1; + int i = 1; + + if (this.mc.gameSettings.invertMouse) + { + i = -1; + } + + if (this.mc.gameSettings.smoothCamera) + { + this.smoothCamYaw += f2; + this.smoothCamPitch += f3; + float f4 = partialTicks - this.smoothCamPartialTicks; + this.smoothCamPartialTicks = partialTicks; + f2 = this.smoothCamFilterX * f4; + f3 = this.smoothCamFilterY * f4; + this.mc.player.turn(f2, f3 * i); + } + else + { + this.smoothCamYaw = 0.0F; + this.smoothCamPitch = 0.0F; + this.mc.player.turn(f2, f3 * i); + } + } + + this.mc.mcProfiler.endSection(); + + if (!this.mc.skipRenderWorld) + { + anaglyphEnable = this.mc.gameSettings.anaglyph; + final ScaledResolution scaledresolution = new ScaledResolution(this.mc); + int i1 = scaledresolution.getScaledWidth(); + int j1 = scaledresolution.getScaledHeight(); + final int k1 = Mouse.getX() * i1 / this.mc.displayWidth; + final int l1 = j1 - Mouse.getY() * j1 / this.mc.displayHeight - 1; + int i2 = this.mc.gameSettings.limitFramerate; + + if (this.mc.world != null) + { + this.mc.mcProfiler.startSection("level"); + int j = Math.min(Minecraft.getDebugFPS(), i2); + j = Math.max(j, 60); + long k = System.nanoTime() - nanoTime; + long l = Math.max(1000000000 / j / 4 - k, 0L); + this.renderWorld(partialTicks, System.nanoTime() + l); + + if (this.mc.isSingleplayer() && this.timeWorldIcon < Minecraft.getSystemTime() - 1000L) + { + this.timeWorldIcon = Minecraft.getSystemTime(); + + if (!this.mc.getIntegratedServer().isWorldIconSet()) + { + this.createWorldIcon(); + } + } + + if (OpenGlHelper.shadersSupported) + { + this.mc.renderGlobal.renderEntityOutlineFramebuffer(); + + if (this.shaderGroup != null && this.useShader) + { + GlStateManager.matrixMode(5890); + GlStateManager.pushMatrix(); + GlStateManager.loadIdentity(); + this.shaderGroup.render(partialTicks); + GlStateManager.popMatrix(); + } + + this.mc.getFramebuffer().bindFramebuffer(true); + } + + this.mc.mcProfiler.endStartSection("gui"); + + if (!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) + { + GlStateManager.alphaFunc(516, 0.1F); + this.setupOverlayRendering(); + this.renderItemActivation(i1, j1, partialTicks); + this.mc.ingameGUI.renderGameOverlay(partialTicks); + } + + this.mc.mcProfiler.endSection(); + } + else + { + GlStateManager.viewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + GlStateManager.matrixMode(5888); + GlStateManager.loadIdentity(); + this.setupOverlayRendering(); + // Forge: Fix MC-112292 + net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.instance.renderEngine = this.mc.getTextureManager(); + // Forge: also fix rendering text before entering world (not part of MC-112292, but the same reason) + net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.instance.fontRenderer = this.mc.fontRenderer; + } + + if (this.mc.currentScreen != null) + { + GlStateManager.clear(256); + + try + { + net.minecraftforge.client.ForgeHooksClient.drawScreen(this.mc.currentScreen, k1, l1, this.mc.getTickLength()); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering screen"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Screen render details"); + crashreportcategory.addDetail("Screen name", new ICrashReportDetail() + { + @Override + public String call() throws Exception + { + return EntityRenderer.this.mc.currentScreen.getClass().getCanonicalName(); + } + }); + crashreportcategory.addDetail("Mouse location", new ICrashReportDetail() + { + @Override + public String call() throws Exception + { + return String.format("Scaled: (%d, %d). Absolute: (%d, %d)", k1, l1, Mouse.getX(), Mouse.getY()); + } + }); + crashreportcategory.addDetail("Screen size", new ICrashReportDetail() + { + @Override + public String call() throws Exception + { + return String.format("Scaled: (%d, %d). Absolute: (%d, %d). Scale factor of %d", scaledresolution.getScaledWidth(), scaledresolution.getScaledHeight(), EntityRenderer.this.mc.displayWidth, EntityRenderer.this.mc.displayHeight, scaledresolution.getScaleFactor()); + } + }); + throw new ReportedException(crashreport); + } + } + } + } + + private void createWorldIcon() + { + if (this.mc.renderGlobal.getRenderedChunks() > 10 && this.mc.renderGlobal.hasNoChunkUpdates() && !this.mc.getIntegratedServer().isWorldIconSet()) + { + BufferedImage bufferedimage = ScreenShotHelper.createScreenshot(this.mc.displayWidth, this.mc.displayHeight, this.mc.getFramebuffer()); + int i = bufferedimage.getWidth(); + int j = bufferedimage.getHeight(); + int k = 0; + int l = 0; + + if (i > j) + { + k = (i - j) / 2; + i = j; + } + else + { + l = (j - i) / 2; + } + + try + { + BufferedImage bufferedimage1 = new BufferedImage(64, 64, 1); + Graphics graphics = bufferedimage1.createGraphics(); + graphics.drawImage(bufferedimage, 0, 0, 64, 64, k, l, k + i, l + i, (ImageObserver)null); + graphics.dispose(); + ImageIO.write(bufferedimage1, "png", this.mc.getIntegratedServer().getWorldIconFile()); + } + catch (IOException ioexception) + { + LOGGER.warn("Couldn't save auto screenshot", ioexception); + } + } + } + + public void renderStreamIndicator(float partialTicks) + { + this.setupOverlayRendering(); + } + + private boolean isDrawBlockOutline() + { + if (!this.drawBlockOutline) + { + return false; + } + else + { + Entity entity = this.mc.getRenderViewEntity(); + boolean flag = entity instanceof EntityPlayer && !this.mc.gameSettings.hideGUI; + + if (flag && !((EntityPlayer)entity).capabilities.allowEdit) + { + ItemStack itemstack = ((EntityPlayer)entity).getHeldItemMainhand(); + + if (this.mc.objectMouseOver != null && this.mc.objectMouseOver.typeOfHit == RayTraceResult.Type.BLOCK) + { + BlockPos blockpos = this.mc.objectMouseOver.getBlockPos(); + Block block = this.mc.world.getBlockState(blockpos).getBlock(); + + if (this.mc.playerController.getCurrentGameType() == GameType.SPECTATOR) + { + flag = block.hasTileEntity(this.mc.world.getBlockState(blockpos)) && this.mc.world.getTileEntity(blockpos) instanceof IInventory; + } + else + { + flag = !itemstack.isEmpty() && (itemstack.canDestroy(block) || itemstack.canPlaceOn(block)); + } + } + } + + return flag; + } + } + + public void renderWorld(float partialTicks, long finishTimeNano) + { + this.updateLightmap(partialTicks); + + if (this.mc.getRenderViewEntity() == null) + { + this.mc.setRenderViewEntity(this.mc.player); + } + + this.getMouseOver(partialTicks); + GlStateManager.enableDepth(); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(516, 0.5F); + this.mc.mcProfiler.startSection("center"); + + if (this.mc.gameSettings.anaglyph) + { + anaglyphField = 0; + GlStateManager.colorMask(false, true, true, false); + this.renderWorldPass(0, partialTicks, finishTimeNano); + anaglyphField = 1; + GlStateManager.colorMask(true, false, false, false); + this.renderWorldPass(1, partialTicks, finishTimeNano); + GlStateManager.colorMask(true, true, true, false); + } + else + { + this.renderWorldPass(2, partialTicks, finishTimeNano); + } + + this.mc.mcProfiler.endSection(); + } + + /** + * XXX + * @param pass + * @param partialTicks + * @param finishTimeNano + */ + private void renderWorldPass(int pass, float partialTicks, long finishTimeNano) + { + RenderGlobal renderglobal = this.mc.renderGlobal; + ParticleManager particlemanager = this.mc.effectRenderer; + boolean flag = this.isDrawBlockOutline(); + GlStateManager.enableCull(); + this.mc.mcProfiler.endStartSection("clear"); + GlStateManager.viewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + this.updateFogColor(partialTicks); + GlStateManager.clear(16640); + this.mc.mcProfiler.endStartSection("camera"); + this.setupCameraTransform(partialTicks, pass); + ActiveRenderInfo.updateRenderInfo(this.mc.getRenderViewEntity(), this.mc.gameSettings.thirdPersonView == 2); //Forge: MC-46445 Spectator mode particles and sounds computed from where you have been before + this.mc.mcProfiler.endStartSection("frustum"); + ClippingHelperImpl.getInstance(); + this.mc.mcProfiler.endStartSection("culling"); + ICamera icamera = new Frustum(); + Entity entity = this.mc.getRenderViewEntity(); + double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * partialTicks; + double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks; + double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * partialTicks; + icamera.setPosition(d0, d1, d2); + + if (this.mc.gameSettings.renderDistanceChunks >= 4) + { + this.setupFog(-1, partialTicks); + this.mc.mcProfiler.endStartSection("sky"); + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); + GlStateManager.matrixMode(5888); + renderglobal.renderSky(partialTicks, pass); + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * MathHelper.SQRT_2); + GlStateManager.matrixMode(5888); + } + + this.setupFog(0, partialTicks); + GlStateManager.shadeModel(7425); + + if (entity.posY + entity.getEyeHeight() < 128.0D) + { + this.renderCloudsCheck(renderglobal, partialTicks, pass, d0, d1, d2); + } + + this.mc.mcProfiler.endStartSection("prepareterrain"); + this.setupFog(0, partialTicks); + this.mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + RenderHelper.disableStandardItemLighting(); + this.mc.mcProfiler.endStartSection("terrain_setup"); + renderglobal.setupTerrain(entity, partialTicks, icamera, this.frameCount++, this.mc.player.isSpectator()); + + if (pass == 0 || pass == 2) + { + this.mc.mcProfiler.endStartSection("updatechunks"); + this.mc.renderGlobal.updateChunks(finishTimeNano); + } + + this.mc.mcProfiler.endStartSection("terrain"); + GlStateManager.matrixMode(5888); + GlStateManager.pushMatrix(); + GlStateManager.disableAlpha(); + + + // TODO + CustomRenderer.drawTest(d0,d1,d2); + + // XXX + // totally opaque blocks + renderglobal.renderBlockLayer(BlockRenderLayer.SOLID, partialTicks, pass, entity); + GlStateManager.enableAlpha(); + this.mc.getTextureManager().getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).setBlurMipmap(false, this.mc.gameSettings.mipmapLevels > 0); // FORGE: fix flickering leaves when mods mess up the blurMipmap settings + // blocks with a transparent texture component (grass on dirt counts) + renderglobal.renderBlockLayer(BlockRenderLayer.CUTOUT_MIPPED, partialTicks, pass, entity); + this.mc.getTextureManager().getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap(); + this.mc.getTextureManager().getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).setBlurMipmap(false, false); + // blocks with a transparent texture component (grass on dirt counts) + renderglobal.renderBlockLayer(BlockRenderLayer.CUTOUT, partialTicks, pass, entity); + this.mc.getTextureManager().getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap(); + GlStateManager.shadeModel(7424); + GlStateManager.alphaFunc(516, 0.1F); + + if (!this.debugView) + { + GlStateManager.matrixMode(5888); + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + RenderHelper.enableStandardItemLighting(); + this.mc.mcProfiler.endStartSection("entities"); + net.minecraftforge.client.ForgeHooksClient.setRenderPass(0); + renderglobal.renderEntities(entity, icamera, partialTicks); + net.minecraftforge.client.ForgeHooksClient.setRenderPass(0); + RenderHelper.disableStandardItemLighting(); + this.disableLightmap(); + } + + GlStateManager.matrixMode(5888); + GlStateManager.popMatrix(); + + if (flag && this.mc.objectMouseOver != null && !entity.isInsideOfMaterial(Material.WATER)) + { + EntityPlayer entityplayer = (EntityPlayer)entity; + GlStateManager.disableAlpha(); + this.mc.mcProfiler.endStartSection("outline"); + if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, mc.objectMouseOver, 0, partialTicks)) + renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, partialTicks); + GlStateManager.enableAlpha(); + } + + if (this.mc.debugRenderer.shouldRender()) + { + this.mc.debugRenderer.renderDebug(partialTicks, finishTimeNano); + } + + this.mc.mcProfiler.endStartSection("destroyProgress"); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + this.mc.getTextureManager().getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).setBlurMipmap(false, false); + renderglobal.drawBlockDamageTexture(Tessellator.getInstance(), Tessellator.getInstance().getBuffer(), entity, partialTicks); + this.mc.getTextureManager().getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap(); + GlStateManager.disableBlend(); + + if (!this.debugView) + { + this.enableLightmap(); + this.mc.mcProfiler.endStartSection("litParticles"); + particlemanager.renderLitParticles(entity, partialTicks); + RenderHelper.disableStandardItemLighting(); + this.setupFog(0, partialTicks); + this.mc.mcProfiler.endStartSection("particles"); + particlemanager.renderParticles(entity, partialTicks); + this.disableLightmap(); + } + + GlStateManager.depthMask(false); + GlStateManager.enableCull(); + this.mc.mcProfiler.endStartSection("weather"); + this.renderRainSnow(partialTicks); + GlStateManager.depthMask(true); + renderglobal.renderWorldBorder(entity, partialTicks); + GlStateManager.disableBlend(); + GlStateManager.enableCull(); + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + GlStateManager.alphaFunc(516, 0.1F); + this.setupFog(0, partialTicks); + GlStateManager.enableBlend(); + GlStateManager.depthMask(false); + this.mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + GlStateManager.shadeModel(7425); + this.mc.mcProfiler.endStartSection("translucent"); + renderglobal.renderBlockLayer(BlockRenderLayer.TRANSLUCENT, partialTicks, pass, entity); + if (!this.debugView) //Only render if render pass 0 happens as well. + { + RenderHelper.enableStandardItemLighting(); + this.mc.mcProfiler.endStartSection("entities"); + net.minecraftforge.client.ForgeHooksClient.setRenderPass(1); + renderglobal.renderEntities(entity, icamera, partialTicks); + // restore blending function changed by RenderGlobal.preRenderDamagedBlocks + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + net.minecraftforge.client.ForgeHooksClient.setRenderPass(-1); + RenderHelper.disableStandardItemLighting(); + } + GlStateManager.shadeModel(7424); + GlStateManager.depthMask(true); + GlStateManager.enableCull(); + GlStateManager.disableBlend(); + GlStateManager.disableFog(); + + if (entity.posY + entity.getEyeHeight() >= 128.0D) + { + this.mc.mcProfiler.endStartSection("aboveClouds"); + this.renderCloudsCheck(renderglobal, partialTicks, pass, d0, d1, d2); + } + + this.mc.mcProfiler.endStartSection("forge_render_last"); + net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(renderglobal, partialTicks); + + this.mc.mcProfiler.endStartSection("hand"); + + if (this.renderHand) + { + GlStateManager.clear(256); + this.renderHand(partialTicks, pass); + } + + } + + + + + private void renderCloudsCheck(RenderGlobal renderGlobalIn, float partialTicks, int pass, double x, double y, double z) + { + if (this.mc.gameSettings.shouldRenderClouds() != 0) + { + this.mc.mcProfiler.endStartSection("clouds"); + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 4.0F); + GlStateManager.matrixMode(5888); + GlStateManager.pushMatrix(); + this.setupFog(0, partialTicks); + renderGlobalIn.renderClouds(partialTicks, pass, x, y, z); + GlStateManager.disableFog(); + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * MathHelper.SQRT_2); + GlStateManager.matrixMode(5888); + } + } + + private void addRainParticles() + { + float f = this.mc.world.getRainStrength(1.0F); + + if (!this.mc.gameSettings.fancyGraphics) + { + f /= 2.0F; + } + + if (f != 0.0F) + { + this.random.setSeed(this.rendererUpdateCount * 312987231L); + Entity entity = this.mc.getRenderViewEntity(); + World world = this.mc.world; + BlockPos blockpos = new BlockPos(entity); + double d0 = 0.0D; + double d1 = 0.0D; + double d2 = 0.0D; + int j = 0; + int k = (int)(100.0F * f * f); + + if (this.mc.gameSettings.particleSetting == 1) + { + k >>= 1; + } + else if (this.mc.gameSettings.particleSetting == 2) + { + k = 0; + } + + for (int l = 0; l < k; ++l) + { + BlockPos blockpos1 = world.getPrecipitationHeight(blockpos.add(this.random.nextInt(10) - this.random.nextInt(10), 0, this.random.nextInt(10) - this.random.nextInt(10))); + Biome biome = world.getBiome(blockpos1); + BlockPos blockpos2 = blockpos1.down(); + IBlockState iblockstate = world.getBlockState(blockpos2); + + if (blockpos1.getY() <= blockpos.getY() + 10 && blockpos1.getY() >= blockpos.getY() - 10 && biome.canRain() && biome.getTemperature(blockpos1) >= 0.15F) + { + double d3 = this.random.nextDouble(); + double d4 = this.random.nextDouble(); + AxisAlignedBB axisalignedbb = iblockstate.getBoundingBox(world, blockpos2); + + if (iblockstate.getMaterial() != Material.LAVA && iblockstate.getBlock() != Blocks.MAGMA) + { + if (iblockstate.getMaterial() != Material.AIR) + { + ++j; + + if (this.random.nextInt(j) == 0) + { + d0 = blockpos2.getX() + d3; + d1 = blockpos2.getY() + 0.1F + axisalignedbb.maxY - 1.0D; + d2 = blockpos2.getZ() + d4; + } + + this.mc.world.spawnParticle(EnumParticleTypes.WATER_DROP, blockpos2.getX() + d3, blockpos2.getY() + 0.1F + axisalignedbb.maxY, blockpos2.getZ() + d4, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + else + { + this.mc.world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, blockpos1.getX() + d3, blockpos1.getY() + 0.1F - axisalignedbb.minY, blockpos1.getZ() + d4, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + } + + if (j > 0 && this.random.nextInt(3) < this.rainSoundCounter++) + { + this.rainSoundCounter = 0; + + if (d1 > blockpos.getY() + 1 && world.getPrecipitationHeight(blockpos).getY() > MathHelper.floor(blockpos.getY())) + { + this.mc.world.playSound(d0, d1, d2, SoundEvents.WEATHER_RAIN_ABOVE, SoundCategory.WEATHER, 0.1F, 0.5F, false); + } + else + { + this.mc.world.playSound(d0, d1, d2, SoundEvents.WEATHER_RAIN, SoundCategory.WEATHER, 0.2F, 1.0F, false); + } + } + } + } + + /** + * Render rain and snow + */ + protected void renderRainSnow(float partialTicks) + { + net.minecraftforge.client.IRenderHandler renderer = this.mc.world.provider.getWeatherRenderer(); + if (renderer != null) + { + renderer.render(partialTicks, this.mc.world, mc); + return; + } + + float f = this.mc.world.getRainStrength(partialTicks); + + if (f > 0.0F) + { + this.enableLightmap(); + Entity entity = this.mc.getRenderViewEntity(); + World world = this.mc.world; + int i = MathHelper.floor(entity.posX); + int j = MathHelper.floor(entity.posY); + int k = MathHelper.floor(entity.posZ); + Tessellator tessellator = Tessellator.getInstance(); + BufferBuilder bufferbuilder = tessellator.getBuffer(); + GlStateManager.disableCull(); + GlStateManager.glNormal3f(0.0F, 1.0F, 0.0F); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + GlStateManager.alphaFunc(516, 0.1F); + double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * partialTicks; + double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks; + double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * partialTicks; + int l = MathHelper.floor(d1); + int i1 = 5; + + if (this.mc.gameSettings.fancyGraphics) + { + i1 = 10; + } + + int j1 = -1; + float f1 = this.rendererUpdateCount + partialTicks; + bufferbuilder.setTranslation(-d0, -d1, -d2); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = k - i1; k1 <= k + i1; ++k1) + { + for (int l1 = i - i1; l1 <= i + i1; ++l1) + { + int i2 = (k1 - k + 16) * 32 + l1 - i + 16; + double d3 = this.rainXCoords[i2] * 0.5D; + double d4 = this.rainYCoords[i2] * 0.5D; + blockpos$mutableblockpos.setPos(l1, 0, k1); + Biome biome = world.getBiome(blockpos$mutableblockpos); + + if (biome.canRain() || biome.getEnableSnow()) + { + int j2 = world.getPrecipitationHeight(blockpos$mutableblockpos).getY(); + int k2 = j - i1; + int l2 = j + i1; + + if (k2 < j2) + { + k2 = j2; + } + + if (l2 < j2) + { + l2 = j2; + } + + int i3 = j2; + + if (j2 < l) + { + i3 = l; + } + + if (k2 != l2) + { + this.random.setSeed(l1 * l1 * 3121 + l1 * 45238971 ^ k1 * k1 * 418711 + k1 * 13761); + blockpos$mutableblockpos.setPos(l1, k2, k1); + float f2 = biome.getTemperature(blockpos$mutableblockpos); + + if (world.getBiomeProvider().getTemperatureAtHeight(f2, j2) >= 0.15F) + { + if (j1 != 0) + { + if (j1 >= 0) + { + tessellator.draw(); + } + + j1 = 0; + this.mc.getTextureManager().bindTexture(RAIN_TEXTURES); + bufferbuilder.begin(7, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP); + } + + double d5 = -((double)(this.rendererUpdateCount + l1 * l1 * 3121 + l1 * 45238971 + k1 * k1 * 418711 + k1 * 13761 & 31) + (double)partialTicks) / 32.0D * (3.0D + this.random.nextDouble()); + double d6 = l1 + 0.5F - entity.posX; + double d7 = k1 + 0.5F - entity.posZ; + float f3 = MathHelper.sqrt(d6 * d6 + d7 * d7) / i1; + float f4 = ((1.0F - f3 * f3) * 0.5F + 0.5F) * f; + blockpos$mutableblockpos.setPos(l1, i3, k1); + int j3 = world.getCombinedLight(blockpos$mutableblockpos, 0); + int k3 = j3 >> 16 & 65535; + int l3 = j3 & 65535; + bufferbuilder.pos(l1 - d3 + 0.5D, l2, k1 - d4 + 0.5D).tex(0.0D, k2 * 0.25D + d5).color(1.0F, 1.0F, 1.0F, f4).lightmap(k3, l3).endVertex(); + bufferbuilder.pos(l1 + d3 + 0.5D, l2, k1 + d4 + 0.5D).tex(1.0D, k2 * 0.25D + d5).color(1.0F, 1.0F, 1.0F, f4).lightmap(k3, l3).endVertex(); + bufferbuilder.pos(l1 + d3 + 0.5D, k2, k1 + d4 + 0.5D).tex(1.0D, l2 * 0.25D + d5).color(1.0F, 1.0F, 1.0F, f4).lightmap(k3, l3).endVertex(); + bufferbuilder.pos(l1 - d3 + 0.5D, k2, k1 - d4 + 0.5D).tex(0.0D, l2 * 0.25D + d5).color(1.0F, 1.0F, 1.0F, f4).lightmap(k3, l3).endVertex(); + } + else + { + if (j1 != 1) + { + if (j1 >= 0) + { + tessellator.draw(); + } + + j1 = 1; + this.mc.getTextureManager().bindTexture(SNOW_TEXTURES); + bufferbuilder.begin(7, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP); + } + + double d8 = -((this.rendererUpdateCount & 511) + partialTicks) / 512.0F; + double d9 = this.random.nextDouble() + f1 * 0.01D * ((float)this.random.nextGaussian()); + double d10 = this.random.nextDouble() + f1 * (float)this.random.nextGaussian() * 0.001D; + double d11 = l1 + 0.5F - entity.posX; + double d12 = k1 + 0.5F - entity.posZ; + float f6 = MathHelper.sqrt(d11 * d11 + d12 * d12) / i1; + float f5 = ((1.0F - f6 * f6) * 0.3F + 0.5F) * f; + blockpos$mutableblockpos.setPos(l1, i3, k1); + int i4 = (world.getCombinedLight(blockpos$mutableblockpos, 0) * 3 + 15728880) / 4; + int j4 = i4 >> 16 & 65535; + int k4 = i4 & 65535; + bufferbuilder.pos(l1 - d3 + 0.5D, l2, k1 - d4 + 0.5D).tex(0.0D + d9, k2 * 0.25D + d8 + d10).color(1.0F, 1.0F, 1.0F, f5).lightmap(j4, k4).endVertex(); + bufferbuilder.pos(l1 + d3 + 0.5D, l2, k1 + d4 + 0.5D).tex(1.0D + d9, k2 * 0.25D + d8 + d10).color(1.0F, 1.0F, 1.0F, f5).lightmap(j4, k4).endVertex(); + bufferbuilder.pos(l1 + d3 + 0.5D, k2, k1 + d4 + 0.5D).tex(1.0D + d9, l2 * 0.25D + d8 + d10).color(1.0F, 1.0F, 1.0F, f5).lightmap(j4, k4).endVertex(); + bufferbuilder.pos(l1 - d3 + 0.5D, k2, k1 - d4 + 0.5D).tex(0.0D + d9, l2 * 0.25D + d8 + d10).color(1.0F, 1.0F, 1.0F, f5).lightmap(j4, k4).endVertex(); + } + } + } + } + } + + if (j1 >= 0) + { + tessellator.draw(); + } + + bufferbuilder.setTranslation(0.0D, 0.0D, 0.0D); + GlStateManager.enableCull(); + GlStateManager.disableBlend(); + GlStateManager.alphaFunc(516, 0.1F); + this.disableLightmap(); + } + } + + /** + * Setup orthogonal projection for rendering GUI screen overlays + */ + public void setupOverlayRendering() + { + ScaledResolution scaledresolution = new ScaledResolution(this.mc); + GlStateManager.clear(256); + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + GlStateManager.ortho(0.0D, scaledresolution.getScaledWidth_double(), scaledresolution.getScaledHeight_double(), 0.0D, 1000.0D, 3000.0D); + GlStateManager.matrixMode(5888); + GlStateManager.loadIdentity(); + GlStateManager.translate(0.0F, 0.0F, -2000.0F); + } + + /** + * calculates fog and calls glClearColor + */ + private void updateFogColor(float partialTicks) + { + World world = this.mc.world; + Entity entity = this.mc.getRenderViewEntity(); + float f = 0.25F + 0.75F * this.mc.gameSettings.renderDistanceChunks / 32.0F; + f = 1.0F - (float)Math.pow(f, 0.25D); + Vec3d vec3d = world.getSkyColor(this.mc.getRenderViewEntity(), partialTicks); + float f1 = (float)vec3d.x; + float f2 = (float)vec3d.y; + float f3 = (float)vec3d.z; + Vec3d vec3d1 = world.getFogColor(partialTicks); + this.fogColorRed = (float)vec3d1.x; + this.fogColorGreen = (float)vec3d1.y; + this.fogColorBlue = (float)vec3d1.z; + + if (this.mc.gameSettings.renderDistanceChunks >= 4) + { + double d0 = MathHelper.sin(world.getCelestialAngleRadians(partialTicks)) > 0.0F ? -1.0D : 1.0D; + Vec3d vec3d2 = new Vec3d(d0, 0.0D, 0.0D); + float f5 = (float)entity.getLook(partialTicks).dotProduct(vec3d2); + + if (f5 < 0.0F) + { + f5 = 0.0F; + } + + if (f5 > 0.0F) + { + float[] afloat = world.provider.calcSunriseSunsetColors(world.getCelestialAngle(partialTicks), partialTicks); + + if (afloat != null) + { + f5 = f5 * afloat[3]; + this.fogColorRed = this.fogColorRed * (1.0F - f5) + afloat[0] * f5; + this.fogColorGreen = this.fogColorGreen * (1.0F - f5) + afloat[1] * f5; + this.fogColorBlue = this.fogColorBlue * (1.0F - f5) + afloat[2] * f5; + } + } + } + + this.fogColorRed += (f1 - this.fogColorRed) * f; + this.fogColorGreen += (f2 - this.fogColorGreen) * f; + this.fogColorBlue += (f3 - this.fogColorBlue) * f; + float f8 = world.getRainStrength(partialTicks); + + if (f8 > 0.0F) + { + float f4 = 1.0F - f8 * 0.5F; + float f10 = 1.0F - f8 * 0.4F; + this.fogColorRed *= f4; + this.fogColorGreen *= f4; + this.fogColorBlue *= f10; + } + + float f9 = world.getThunderStrength(partialTicks); + + if (f9 > 0.0F) + { + float f11 = 1.0F - f9 * 0.5F; + this.fogColorRed *= f11; + this.fogColorGreen *= f11; + this.fogColorBlue *= f11; + } + + IBlockState iblockstate = ActiveRenderInfo.getBlockStateAtEntityViewpoint(this.mc.world, entity, partialTicks); + + if (this.cloudFog) + { + Vec3d vec3d3 = world.getCloudColour(partialTicks); + this.fogColorRed = (float)vec3d3.x; + this.fogColorGreen = (float)vec3d3.y; + this.fogColorBlue = (float)vec3d3.z; + } + else + { + //Forge Moved to Block. + Vec3d viewport = ActiveRenderInfo.projectViewFromEntity(entity, partialTicks); + BlockPos viewportPos = new BlockPos(viewport); + IBlockState viewportState = this.mc.world.getBlockState(viewportPos); + Vec3d inMaterialColor = viewportState.getBlock().getFogColor(this.mc.world, viewportPos, viewportState, entity, new Vec3d(fogColorRed, fogColorGreen, fogColorBlue), partialTicks); + this.fogColorRed = (float)inMaterialColor.x; + this.fogColorGreen = (float)inMaterialColor.y; + this.fogColorBlue = (float)inMaterialColor.z; + } + + float f13 = this.fogColor2 + (this.fogColor1 - this.fogColor2) * partialTicks; + this.fogColorRed *= f13; + this.fogColorGreen *= f13; + this.fogColorBlue *= f13; + double d1 = (entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks) * world.provider.getVoidFogYFactor(); + + if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).isPotionActive(MobEffects.BLINDNESS)) + { + int i = ((EntityLivingBase)entity).getActivePotionEffect(MobEffects.BLINDNESS).getDuration(); + + if (i < 20) + { + d1 *= 1.0F - i / 20.0F; + } + else + { + d1 = 0.0D; + } + } + + if (d1 < 1.0D) + { + if (d1 < 0.0D) + { + d1 = 0.0D; + } + + d1 = d1 * d1; + this.fogColorRed = (float)(this.fogColorRed * d1); + this.fogColorGreen = (float)(this.fogColorGreen * d1); + this.fogColorBlue = (float)(this.fogColorBlue * d1); + } + + if (this.bossColorModifier > 0.0F) + { + float f14 = this.bossColorModifierPrev + (this.bossColorModifier - this.bossColorModifierPrev) * partialTicks; + this.fogColorRed = this.fogColorRed * (1.0F - f14) + this.fogColorRed * 0.7F * f14; + this.fogColorGreen = this.fogColorGreen * (1.0F - f14) + this.fogColorGreen * 0.6F * f14; + this.fogColorBlue = this.fogColorBlue * (1.0F - f14) + this.fogColorBlue * 0.6F * f14; + } + + if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).isPotionActive(MobEffects.NIGHT_VISION)) + { + float f15 = this.getNightVisionBrightness((EntityLivingBase)entity, partialTicks); + float f6 = 1.0F / this.fogColorRed; + + if (f6 > 1.0F / this.fogColorGreen) + { + f6 = 1.0F / this.fogColorGreen; + } + + if (f6 > 1.0F / this.fogColorBlue) + { + f6 = 1.0F / this.fogColorBlue; + } + + // Forge: fix MC-4647 and MC-10480 + if (Float.isInfinite(f6)) f6 = Math.nextAfter(f6, 0.0); + + this.fogColorRed = this.fogColorRed * (1.0F - f15) + this.fogColorRed * f6 * f15; + this.fogColorGreen = this.fogColorGreen * (1.0F - f15) + this.fogColorGreen * f6 * f15; + this.fogColorBlue = this.fogColorBlue * (1.0F - f15) + this.fogColorBlue * f6 * f15; + } + + if (this.mc.gameSettings.anaglyph) + { + float f16 = (this.fogColorRed * 30.0F + this.fogColorGreen * 59.0F + this.fogColorBlue * 11.0F) / 100.0F; + float f17 = (this.fogColorRed * 30.0F + this.fogColorGreen * 70.0F) / 100.0F; + float f7 = (this.fogColorRed * 30.0F + this.fogColorBlue * 70.0F) / 100.0F; + this.fogColorRed = f16; + this.fogColorGreen = f17; + this.fogColorBlue = f7; + } + + net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entity, iblockstate, partialTicks, this.fogColorRed, this.fogColorGreen, this.fogColorBlue); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); + + this.fogColorRed = event.getRed(); + this.fogColorGreen = event.getGreen(); + this.fogColorBlue = event.getBlue(); + + GlStateManager.clearColor(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 0.0F); + } + + /** + * Sets up the fog to be rendered. If the arg passed in is -1 the fog starts at 0 and goes to 80% of far plane + * distance and is used for sky rendering. + */ + private void setupFog(int startCoords, float partialTicks) + { + Entity entity = this.mc.getRenderViewEntity(); + this.setupFogColor(false); + GlStateManager.glNormal3f(0.0F, -1.0F, 0.0F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + IBlockState iblockstate = ActiveRenderInfo.getBlockStateAtEntityViewpoint(this.mc.world, entity, partialTicks); + float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(this, entity, iblockstate, partialTicks, 0.1F); + if (hook >= 0) GlStateManager.setFogDensity(hook); + else + if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).isPotionActive(MobEffects.BLINDNESS)) + { + float f1 = 5.0F; + int i = ((EntityLivingBase)entity).getActivePotionEffect(MobEffects.BLINDNESS).getDuration(); + + if (i < 20) + { + f1 = 5.0F + (this.farPlaneDistance - 5.0F) * (1.0F - i / 20.0F); + } + + GlStateManager.setFog(GlStateManager.FogMode.LINEAR); + + if (startCoords == -1) + { + GlStateManager.setFogStart(0.0F); + GlStateManager.setFogEnd(f1 * 0.8F); + } + else + { + GlStateManager.setFogStart(f1 * 0.25F); + GlStateManager.setFogEnd(f1); + } + + if (GLContext.getCapabilities().GL_NV_fog_distance) + { + GlStateManager.glFogi(34138, 34139); + } + } + else if (this.cloudFog) + { + GlStateManager.setFog(GlStateManager.FogMode.EXP); + GlStateManager.setFogDensity(0.1F); + } + else if (iblockstate.getMaterial() == Material.WATER) + { + GlStateManager.setFog(GlStateManager.FogMode.EXP); + + if (entity instanceof EntityLivingBase) + { + if (((EntityLivingBase)entity).isPotionActive(MobEffects.WATER_BREATHING)) + { + GlStateManager.setFogDensity(0.01F); + } + else + { + GlStateManager.setFogDensity(0.1F - EnchantmentHelper.getRespirationModifier((EntityLivingBase)entity) * 0.03F); + } + } + else + { + GlStateManager.setFogDensity(0.1F); + } + } + else if (iblockstate.getMaterial() == Material.LAVA) + { + GlStateManager.setFog(GlStateManager.FogMode.EXP); + GlStateManager.setFogDensity(2.0F); + } + else + { + float f = this.farPlaneDistance; + GlStateManager.setFog(GlStateManager.FogMode.LINEAR); + + if (startCoords == -1) + { + GlStateManager.setFogStart(0.0F); + GlStateManager.setFogEnd(f); + } + else + { + GlStateManager.setFogStart(f * 0.75F); + GlStateManager.setFogEnd(f); + } + + if (GLContext.getCapabilities().GL_NV_fog_distance) + { + GlStateManager.glFogi(34138, 34139); + } + + if (this.mc.world.provider.doesXZShowFog((int)entity.posX, (int)entity.posZ) || this.mc.ingameGUI.getBossOverlay().shouldCreateFog()) + { + GlStateManager.setFogStart(f * 0.05F); + GlStateManager.setFogEnd(Math.min(f, 192.0F) * 0.5F); + } + net.minecraftforge.client.ForgeHooksClient.onFogRender(this, entity, iblockstate, partialTicks, startCoords, f); + } + + GlStateManager.enableColorMaterial(); + GlStateManager.enableFog(); + GlStateManager.colorMaterial(1028, 4608); + } + + public void setupFogColor(boolean black) + { + if (black) + { + GlStateManager.glFog(2918, this.setFogColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); + } + else + { + GlStateManager.glFog(2918, this.setFogColorBuffer(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 1.0F)); + } + } + + /** + * Update and return fogColorBuffer with the RGBA values passed as arguments + */ + private FloatBuffer setFogColorBuffer(float red, float green, float blue, float alpha) + { + this.fogColorBuffer.clear(); + this.fogColorBuffer.put(red).put(green).put(blue).put(alpha); + this.fogColorBuffer.flip(); + return this.fogColorBuffer; + } + + public void resetData() + { + this.itemActivationItem = null; + this.mapItemRenderer.clearLoadedMaps(); + } + + public MapItemRenderer getMapItemRenderer() + { + return this.mapItemRenderer; + } + + public static void drawNameplate(FontRenderer fontRendererIn, String str, float x, float y, float z, int verticalShift, float viewerYaw, float viewerPitch, boolean isThirdPersonFrontal, boolean isSneaking) + { + GlStateManager.pushMatrix(); + GlStateManager.translate(x, y, z); + GlStateManager.glNormal3f(0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-viewerYaw, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate((isThirdPersonFrontal ? -1 : 1) * viewerPitch, 1.0F, 0.0F, 0.0F); + GlStateManager.scale(-0.025F, -0.025F, 0.025F); + GlStateManager.disableLighting(); + GlStateManager.depthMask(false); + + if (!isSneaking) + { + GlStateManager.disableDepth(); + } + + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + int i = fontRendererIn.getStringWidth(str) / 2; + GlStateManager.disableTexture2D(); + Tessellator tessellator = Tessellator.getInstance(); + BufferBuilder bufferbuilder = tessellator.getBuffer(); + bufferbuilder.begin(7, DefaultVertexFormats.POSITION_COLOR); + bufferbuilder.pos(-i - 1, -1 + verticalShift, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + bufferbuilder.pos(-i - 1, 8 + verticalShift, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + bufferbuilder.pos(i + 1, 8 + verticalShift, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + bufferbuilder.pos(i + 1, -1 + verticalShift, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + tessellator.draw(); + GlStateManager.enableTexture2D(); + + if (!isSneaking) + { + fontRendererIn.drawString(str, -fontRendererIn.getStringWidth(str) / 2, verticalShift, 553648127); + GlStateManager.enableDepth(); + } + + GlStateManager.depthMask(true); + fontRendererIn.drawString(str, -fontRendererIn.getStringWidth(str) / 2, verticalShift, isSneaking ? 553648127 : -1); + GlStateManager.enableLighting(); + GlStateManager.disableBlend(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.popMatrix(); + } + + public void displayItemActivation(ItemStack stack) + { + this.itemActivationItem = stack; + this.itemActivationTicks = 40; + this.itemActivationOffX = this.random.nextFloat() * 2.0F - 1.0F; + this.itemActivationOffY = this.random.nextFloat() * 2.0F - 1.0F; + } + + private void renderItemActivation(int p_190563_1_, int p_190563_2_, float p_190563_3_) + { + if (this.itemActivationItem != null && this.itemActivationTicks > 0) + { + int i = 40 - this.itemActivationTicks; + float f = (i + p_190563_3_) / 40.0F; + float f1 = f * f; + float f2 = f * f1; + float f3 = 10.25F * f2 * f1 + -24.95F * f1 * f1 + 25.5F * f2 + -13.8F * f1 + 4.0F * f; + float f4 = f3 * (float)Math.PI; + float f5 = this.itemActivationOffX * (p_190563_1_ / 4); + float f6 = this.itemActivationOffY * (p_190563_2_ / 4); + GlStateManager.enableAlpha(); + GlStateManager.pushMatrix(); + GlStateManager.pushAttrib(); + GlStateManager.enableDepth(); + GlStateManager.disableCull(); + RenderHelper.enableStandardItemLighting(); + GlStateManager.translate(p_190563_1_ / 2 + f5 * MathHelper.abs(MathHelper.sin(f4 * 2.0F)), p_190563_2_ / 2 + f6 * MathHelper.abs(MathHelper.sin(f4 * 2.0F)), -50.0F); + float f7 = 50.0F + 175.0F * MathHelper.sin(f4); + GlStateManager.scale(f7, -f7, f7); + GlStateManager.rotate(900.0F * MathHelper.abs(MathHelper.sin(f4)), 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(6.0F * MathHelper.cos(f * 8.0F), 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(6.0F * MathHelper.cos(f * 8.0F), 0.0F, 0.0F, 1.0F); + this.mc.getRenderItem().renderItem(this.itemActivationItem, ItemCameraTransforms.TransformType.FIXED); + GlStateManager.popAttrib(); + GlStateManager.popMatrix(); + RenderHelper.disableStandardItemLighting(); + GlStateManager.enableCull(); + GlStateManager.disableDepth(); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/renderer/RenderGlobal.java b/src/main/java/net/minecraft/client/renderer/RenderGlobal.java new file mode 100644 index 000000000..73391eb35 --- /dev/null +++ b/src/main/java/net/minecraft/client/renderer/RenderGlobal.java @@ -0,0 +1,2657 @@ +package net.minecraft.client.renderer; + +import java.io.IOException; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Queue; +import java.util.Random; +import java.util.Set; + +import javax.annotation.Nullable; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.util.vector.Vector3f; +import org.lwjgl.util.vector.Vector4f; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Queues; +import com.google.common.collect.Sets; +import com.google.gson.JsonSyntaxException; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockChest; +import net.minecraft.block.BlockEnderChest; +import net.minecraft.block.BlockSign; +import net.minecraft.block.BlockSkull; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.ISound; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.particle.Particle; +import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher; +import net.minecraft.client.renderer.chunk.CompiledChunk; +import net.minecraft.client.renderer.chunk.IRenderChunkFactory; +import net.minecraft.client.renderer.chunk.ListChunkFactory; +import net.minecraft.client.renderer.chunk.RenderChunk; +import net.minecraft.client.renderer.chunk.VboChunkFactory; +import net.minecraft.client.renderer.chunk.VisGraph; +import net.minecraft.client.renderer.culling.ClippingHelper; +import net.minecraft.client.renderer.culling.ClippingHelperImpl; +import net.minecraft.client.renderer.culling.Frustum; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.renderer.vertex.VertexBuffer; +import net.minecraft.client.renderer.vertex.VertexFormat; +import net.minecraft.client.renderer.vertex.VertexFormatElement; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.client.shader.Framebuffer; +import net.minecraft.client.shader.ShaderGroup; +import net.minecraft.client.shader.ShaderLinkHelper; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.crash.ICrashReportDetail; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.init.SoundEvents; +import net.minecraft.item.Item; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemRecord; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.ClassInheritanceMultiMap; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.SoundEvent; +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.IWorldEventListener; +import net.minecraft.world.World; +import net.minecraft.world.border.WorldBorder; +import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +/** + * The only change was removing some unused variables + * @version 04-16-2020 + */ +@SuppressWarnings("deprecation") +@SideOnly(Side.CLIENT) +public class RenderGlobal implements IWorldEventListener, IResourceManagerReloadListener +{ + private static final Logger LOGGER = LogManager.getLogger(); + private static final ResourceLocation MOON_PHASES_TEXTURES = new ResourceLocation("textures/environment/moon_phases.png"); + private static final ResourceLocation SUN_TEXTURES = new ResourceLocation("textures/environment/sun.png"); + private static final ResourceLocation CLOUDS_TEXTURES = new ResourceLocation("textures/environment/clouds.png"); + private static final ResourceLocation END_SKY_TEXTURES = new ResourceLocation("textures/environment/end_sky.png"); + private static final ResourceLocation FORCEFIELD_TEXTURES = new ResourceLocation("textures/misc/forcefield.png"); + /** A reference to the Minecraft object. */ + private final Minecraft mc; + /** The RenderEngine instance used by RenderGlobal */ + private final TextureManager renderEngine; + private final RenderManager renderManager; + private WorldClient world; + private Set chunksToUpdate = Sets.newLinkedHashSet(); + /** List of OpenGL lists for the current render pass */ + private List renderInfos = Lists.newArrayListWithCapacity(69696); + /** Global tile entities, always rendered (beacon, end teleporter, structures) */ + private final Set setTileEntities = Sets.newHashSet(); + private ViewFrustum viewFrustum; + /** The star GL Call list */ + private int starGLCallList = -1; + /** OpenGL sky list */ + private int glSkyList = -1; + /** OpenGL sky list 2 */ + private int glSkyList2 = -1; + private final VertexFormat vertexBufferFormat; + private VertexBuffer starVBO; + private VertexBuffer skyVBO; + private VertexBuffer sky2VBO; + /** counts the cloud render updates. Used with mod to stagger some updates */ + private int cloudTickCounter; + /** + * Stores blocks currently being broken. Key is entity ID of the thing doing the breaking. Value is a + * DestroyBlockProgress + */ + private final Map damagedBlocks = Maps.newHashMap(); + /** Currently playing sounds. Type: HashMap */ + private final Map mapSoundPositions = Maps.newHashMap(); + private final TextureAtlasSprite[] destroyBlockIcons = new TextureAtlasSprite[10]; + private Framebuffer entityOutlineFramebuffer; + /** Stores the shader group for the entity_outline shader */ + private ShaderGroup entityOutlineShader; + private double frustumUpdatePosX = Double.MIN_VALUE; + private double frustumUpdatePosY = Double.MIN_VALUE; + private double frustumUpdatePosZ = Double.MIN_VALUE; + private int frustumUpdatePosChunkX = Integer.MIN_VALUE; + private int frustumUpdatePosChunkY = Integer.MIN_VALUE; + private int frustumUpdatePosChunkZ = Integer.MIN_VALUE; + private double lastViewEntityX = Double.MIN_VALUE; + private double lastViewEntityY = Double.MIN_VALUE; + private double lastViewEntityZ = Double.MIN_VALUE; + private double lastViewEntityPitch = Double.MIN_VALUE; + private double lastViewEntityYaw = Double.MIN_VALUE; + private ChunkRenderDispatcher renderDispatcher; + private ChunkRenderContainer renderContainer; + private int renderDistanceChunks = -1; + /** Render entities startup counter (init value=2) */ + private int renderEntitiesStartupCounter = 2; + /** Count entities total */ + private int countEntitiesTotal; + /** Count entities rendered */ + private int countEntitiesRendered; + /** Count entities hidden */ + private int countEntitiesHidden; + private boolean debugFixTerrainFrustum; + private ClippingHelper debugFixedClippingHelper; + private final Vector4f[] debugTerrainMatrix = new Vector4f[8]; + private final Vector3d debugTerrainFrustumPosition = new Vector3d(); + private boolean vboEnabled; + IRenderChunkFactory renderChunkFactory; + private double prevRenderSortX; + private double prevRenderSortY; + private double prevRenderSortZ; + private boolean displayListEntitiesDirty = true; + private boolean entityOutlinesRendered; + private final Set setLightUpdates = Sets.newHashSet(); + + public RenderGlobal(Minecraft mcIn) + { + this.mc = mcIn; + this.renderManager = mcIn.getRenderManager(); + this.renderEngine = mcIn.getTextureManager(); + this.renderEngine.bindTexture(FORCEFIELD_TEXTURES); + GlStateManager.glTexParameteri(3553, 10242, 10497); + GlStateManager.glTexParameteri(3553, 10243, 10497); + GlStateManager.bindTexture(0); + this.updateDestroyBlockIcons(); + this.vboEnabled = OpenGlHelper.useVbo(); + + if (this.vboEnabled) + { + this.renderContainer = new VboRenderList(); + this.renderChunkFactory = new VboChunkFactory(); + } + else + { + this.renderContainer = new RenderList(); + this.renderChunkFactory = new ListChunkFactory(); + } + + this.vertexBufferFormat = new VertexFormat(); + this.vertexBufferFormat.addElement(new VertexFormatElement(0, VertexFormatElement.EnumType.FLOAT, VertexFormatElement.EnumUsage.POSITION, 3)); + this.generateStars(); + this.generateSky(); + this.generateSky2(); + } + + @Override + public void onResourceManagerReload(IResourceManager resourceManager) + { + this.updateDestroyBlockIcons(); + } + + private void updateDestroyBlockIcons() + { + TextureMap texturemap = this.mc.getTextureMapBlocks(); + + for (int i = 0; i < this.destroyBlockIcons.length; ++i) + { + this.destroyBlockIcons[i] = texturemap.getAtlasSprite("minecraft:blocks/destroy_stage_" + i); + } + } + + /** + * Creates the entity outline shader to be stored in RenderGlobal.entityOutlineShader + */ + public void makeEntityOutlineShader() + { + if (OpenGlHelper.shadersSupported) + { + if (ShaderLinkHelper.getStaticShaderLinkHelper() == null) + { + ShaderLinkHelper.setNewStaticShaderLinkHelper(); + } + + ResourceLocation resourcelocation = new ResourceLocation("shaders/post/entity_outline.json"); + + try + { + this.entityOutlineShader = new ShaderGroup(this.mc.getTextureManager(), this.mc.getResourceManager(), this.mc.getFramebuffer(), resourcelocation); + this.entityOutlineShader.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight); + this.entityOutlineFramebuffer = this.entityOutlineShader.getFramebufferRaw("final"); + } + catch (IOException ioexception) + { + LOGGER.warn("Failed to load shader: {}", resourcelocation, ioexception); + this.entityOutlineShader = null; + this.entityOutlineFramebuffer = null; + } + catch (JsonSyntaxException jsonsyntaxexception) + { + LOGGER.warn("Failed to load shader: {}", resourcelocation, jsonsyntaxexception); + this.entityOutlineShader = null; + this.entityOutlineFramebuffer = null; + } + } + else + { + this.entityOutlineShader = null; + this.entityOutlineFramebuffer = null; + } + } + + public void renderEntityOutlineFramebuffer() + { + if (this.isRenderEntityOutlines()) + { + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ZERO, GlStateManager.DestFactor.ONE); + this.entityOutlineFramebuffer.framebufferRenderExt(this.mc.displayWidth, this.mc.displayHeight, false); + GlStateManager.disableBlend(); + } + } + + protected boolean isRenderEntityOutlines() + { + return this.entityOutlineFramebuffer != null && this.entityOutlineShader != null && this.mc.player != null; + } + + private void generateSky2() + { + Tessellator tessellator = Tessellator.getInstance(); + BufferBuilder bufferbuilder = tessellator.getBuffer(); + + if (this.sky2VBO != null) + { + this.sky2VBO.deleteGlBuffers(); + } + + if (this.glSkyList2 >= 0) + { + GLAllocation.deleteDisplayLists(this.glSkyList2); + this.glSkyList2 = -1; + } + + if (this.vboEnabled) + { + this.sky2VBO = new VertexBuffer(this.vertexBufferFormat); + this.renderSky(bufferbuilder, -16.0F, true); + bufferbuilder.finishDrawing(); + bufferbuilder.reset(); + this.sky2VBO.bufferData(bufferbuilder.getByteBuffer()); + } + else + { + this.glSkyList2 = GLAllocation.generateDisplayLists(1); + GlStateManager.glNewList(this.glSkyList2, 4864); + this.renderSky(bufferbuilder, -16.0F, true); + tessellator.draw(); + GlStateManager.glEndList(); + } + } + + private void generateSky() + { + Tessellator tessellator = Tessellator.getInstance(); + BufferBuilder bufferbuilder = tessellator.getBuffer(); + + if (this.skyVBO != null) + { + this.skyVBO.deleteGlBuffers(); + } + + if (this.glSkyList >= 0) + { + GLAllocation.deleteDisplayLists(this.glSkyList); + this.glSkyList = -1; + } + + if (this.vboEnabled) + { + this.skyVBO = new VertexBuffer(this.vertexBufferFormat); + this.renderSky(bufferbuilder, 16.0F, false); + bufferbuilder.finishDrawing(); + bufferbuilder.reset(); + this.skyVBO.bufferData(bufferbuilder.getByteBuffer()); + } + else + { + this.glSkyList = GLAllocation.generateDisplayLists(1); + GlStateManager.glNewList(this.glSkyList, 4864); + this.renderSky(bufferbuilder, 16.0F, false); + tessellator.draw(); + GlStateManager.glEndList(); + } + } + + private void renderSky(BufferBuilder bufferBuilderIn, float posY, boolean reverseX) + { + bufferBuilderIn.begin(7, DefaultVertexFormats.POSITION); + + for (int k = -384; k <= 384; k += 64) + { + for (int l = -384; l <= 384; l += 64) + { + float f = k; + float f1 = k + 64; + + if (reverseX) + { + f1 = k; + f = k + 64; + } + + bufferBuilderIn.pos(f, posY, l).endVertex(); + bufferBuilderIn.pos(f1, posY, l).endVertex(); + bufferBuilderIn.pos(f1, posY, l + 64).endVertex(); + bufferBuilderIn.pos(f, posY, l + 64).endVertex(); + } + } + } + + private void generateStars() + { + Tessellator tessellator = Tessellator.getInstance(); + BufferBuilder bufferbuilder = tessellator.getBuffer(); + + if (this.starVBO != null) + { + this.starVBO.deleteGlBuffers(); + } + + if (this.starGLCallList >= 0) + { + GLAllocation.deleteDisplayLists(this.starGLCallList); + this.starGLCallList = -1; + } + + if (this.vboEnabled) + { + this.starVBO = new VertexBuffer(this.vertexBufferFormat); + this.renderStars(bufferbuilder); + bufferbuilder.finishDrawing(); + bufferbuilder.reset(); + this.starVBO.bufferData(bufferbuilder.getByteBuffer()); + } + else + { + this.starGLCallList = GLAllocation.generateDisplayLists(1); + GlStateManager.pushMatrix(); + GlStateManager.glNewList(this.starGLCallList, 4864); + this.renderStars(bufferbuilder); + tessellator.draw(); + GlStateManager.glEndList(); + GlStateManager.popMatrix(); + } + } + + private void renderStars(BufferBuilder bufferBuilderIn) + { + Random random = new Random(10842L); + bufferBuilderIn.begin(7, DefaultVertexFormats.POSITION); + + for (int i = 0; i < 1500; ++i) + { + double d0 = random.nextFloat() * 2.0F - 1.0F; + double d1 = random.nextFloat() * 2.0F - 1.0F; + double d2 = random.nextFloat() * 2.0F - 1.0F; + double d3 = 0.15F + random.nextFloat() * 0.1F; + double d4 = d0 * d0 + d1 * d1 + d2 * d2; + + if (d4 < 1.0D && d4 > 0.01D) + { + d4 = 1.0D / Math.sqrt(d4); + d0 = d0 * d4; + d1 = d1 * d4; + d2 = d2 * d4; + double d5 = d0 * 100.0D; + double d6 = d1 * 100.0D; + double d7 = d2 * 100.0D; + double d8 = Math.atan2(d0, d2); + double d9 = Math.sin(d8); + double d10 = Math.cos(d8); + double d11 = Math.atan2(Math.sqrt(d0 * d0 + d2 * d2), d1); + double d12 = Math.sin(d11); + double d13 = Math.cos(d11); + double d14 = random.nextDouble() * Math.PI * 2.0D; + double d15 = Math.sin(d14); + double d16 = Math.cos(d14); + + for (int j = 0; j < 4; ++j) + { + double d18 = ((j & 2) - 1) * d3; + double d19 = ((j + 1 & 2) - 1) * d3; + double d21 = d18 * d16 - d19 * d15; + double d22 = d19 * d16 + d18 * d15; + double d23 = d21 * d12 + 0.0D * d13; + double d24 = 0.0D * d12 - d21 * d13; + double d25 = d24 * d9 - d22 * d10; + double d26 = d22 * d9 + d24 * d10; + bufferBuilderIn.pos(d5 + d25, d6 + d23, d7 + d26).endVertex(); + } + } + } + } + + /** + * set null to clear + */ + public void setWorldAndLoadRenderers(@Nullable WorldClient worldClientIn) + { + if (this.world != null) + { + this.world.removeEventListener(this); + } + + this.frustumUpdatePosX = Double.MIN_VALUE; + this.frustumUpdatePosY = Double.MIN_VALUE; + this.frustumUpdatePosZ = Double.MIN_VALUE; + this.frustumUpdatePosChunkX = Integer.MIN_VALUE; + this.frustumUpdatePosChunkY = Integer.MIN_VALUE; + this.frustumUpdatePosChunkZ = Integer.MIN_VALUE; + this.renderManager.setWorld(worldClientIn); + this.world = worldClientIn; + + if (worldClientIn != null) + { + worldClientIn.addEventListener(this); + this.loadRenderers(); + } + else + { + this.chunksToUpdate.clear(); + this.renderInfos.clear(); + + if (this.viewFrustum != null) + { + this.viewFrustum.deleteGlResources(); + this.viewFrustum = null; + } + + if (this.renderDispatcher != null) + { + this.renderDispatcher.stopWorkerThreads(); + } + + this.renderDispatcher = null; + } + } + + /** + * Loads all the renderers and sets up the basic settings usage + */ + public void loadRenderers() + { + if (this.world != null) + { + if (this.renderDispatcher == null) + { + this.renderDispatcher = new ChunkRenderDispatcher(); + } + + this.displayListEntitiesDirty = true; + Blocks.LEAVES.setGraphicsLevel(this.mc.gameSettings.fancyGraphics); + Blocks.LEAVES2.setGraphicsLevel(this.mc.gameSettings.fancyGraphics); + this.renderDistanceChunks = this.mc.gameSettings.renderDistanceChunks; + boolean flag = this.vboEnabled; + this.vboEnabled = OpenGlHelper.useVbo(); + + if (flag && !this.vboEnabled) + { + this.renderContainer = new RenderList(); + this.renderChunkFactory = new ListChunkFactory(); + } + else if (!flag && this.vboEnabled) + { + this.renderContainer = new VboRenderList(); + this.renderChunkFactory = new VboChunkFactory(); + } + + if (flag != this.vboEnabled) + { + this.generateStars(); + this.generateSky(); + this.generateSky2(); + } + + if (this.viewFrustum != null) + { + this.viewFrustum.deleteGlResources(); + } + + this.stopChunkUpdates(); + + synchronized (this.setTileEntities) + { + this.setTileEntities.clear(); + } + + this.viewFrustum = new ViewFrustum(this.world, this.mc.gameSettings.renderDistanceChunks, this, this.renderChunkFactory); + + if (this.world != null) + { + Entity entity = this.mc.getRenderViewEntity(); + + if (entity != null) + { + this.viewFrustum.updateChunkPositions(entity.posX, entity.posZ); + } + } + + this.renderEntitiesStartupCounter = 2; + } + } + + protected void stopChunkUpdates() + { + this.chunksToUpdate.clear(); + this.renderDispatcher.stopChunkUpdates(); + } + + public void createBindEntityOutlineFbs(int width, int height) + { + if (OpenGlHelper.shadersSupported) + { + if (this.entityOutlineShader != null) + { + this.entityOutlineShader.createBindFramebuffers(width, height); + } + } + } + + public void renderEntities(Entity renderViewEntity, ICamera camera, float partialTicks) + { + int pass = net.minecraftforge.client.MinecraftForgeClient.getRenderPass(); + if (this.renderEntitiesStartupCounter > 0) + { + if (pass > 0) return; + --this.renderEntitiesStartupCounter; + } + else + { + double d0 = renderViewEntity.prevPosX + (renderViewEntity.posX - renderViewEntity.prevPosX) * partialTicks; + double d1 = renderViewEntity.prevPosY + (renderViewEntity.posY - renderViewEntity.prevPosY) * partialTicks; + double d2 = renderViewEntity.prevPosZ + (renderViewEntity.posZ - renderViewEntity.prevPosZ) * partialTicks; + this.world.profiler.startSection("prepare"); + TileEntityRendererDispatcher.instance.prepare(this.world, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.getRenderViewEntity(), this.mc.objectMouseOver, partialTicks); + this.renderManager.cacheActiveRenderInfo(this.world, this.mc.fontRenderer, this.mc.getRenderViewEntity(), this.mc.pointedEntity, this.mc.gameSettings, partialTicks); + if(pass == 0) + { + this.countEntitiesTotal = 0; + this.countEntitiesRendered = 0; + this.countEntitiesHidden = 0; + } + Entity entity = this.mc.getRenderViewEntity(); + double d3 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * partialTicks; + double d4 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks; + double d5 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * partialTicks; + TileEntityRendererDispatcher.staticPlayerX = d3; + TileEntityRendererDispatcher.staticPlayerY = d4; + TileEntityRendererDispatcher.staticPlayerZ = d5; + this.renderManager.setRenderPosition(d3, d4, d5); + this.mc.entityRenderer.enableLightmap(); + this.world.profiler.endStartSection("global"); + List list = this.world.getLoadedEntityList(); + if (pass == 0) + { + this.countEntitiesTotal = list.size(); + } + + for (int i = 0; i < this.world.weatherEffects.size(); ++i) + { + Entity entity1 = this.world.weatherEffects.get(i); + if (!entity1.shouldRenderInPass(pass)) continue; + ++this.countEntitiesRendered; + + if (entity1.isInRangeToRender3d(d0, d1, d2)) + { + this.renderManager.renderEntityStatic(entity1, partialTicks, false); + } + } + + this.world.profiler.endStartSection("entities"); + List list1 = Lists.newArrayList(); + List list2 = Lists.newArrayList(); + BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain(); + + for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.renderInfos) + { + Chunk chunk = this.world.getChunkFromBlockCoords(renderglobal$containerlocalrenderinformation.renderChunk.getPosition()); + ClassInheritanceMultiMap classinheritancemultimap = chunk.getEntityLists()[renderglobal$containerlocalrenderinformation.renderChunk.getPosition().getY() / 16]; + + if (!classinheritancemultimap.isEmpty()) + { + for (Entity entity2 : classinheritancemultimap) + { + if(!entity2.shouldRenderInPass(pass)) continue; + boolean flag = this.renderManager.shouldRender(entity2, camera, d0, d1, d2) || entity2.isRidingOrBeingRiddenBy(this.mc.player); + + if (flag) + { + boolean flag1 = this.mc.getRenderViewEntity() instanceof EntityLivingBase ? ((EntityLivingBase)this.mc.getRenderViewEntity()).isPlayerSleeping() : false; + + if ((entity2 != this.mc.getRenderViewEntity() || this.mc.gameSettings.thirdPersonView != 0 || flag1) && (entity2.posY < 0.0D || entity2.posY >= 256.0D || this.world.isBlockLoaded(blockpos$pooledmutableblockpos.setPos(entity2)))) + { + ++this.countEntitiesRendered; + this.renderManager.renderEntityStatic(entity2, partialTicks, false); + + if (this.isOutlineActive(entity2, entity, camera)) + { + list1.add(entity2); + } + + if (this.renderManager.isRenderMultipass(entity2)) + { + list2.add(entity2); + } + } + } + } + } + } + + blockpos$pooledmutableblockpos.release(); + + if (!list2.isEmpty()) + { + for (Entity entity3 : list2) + { + this.renderManager.renderMultipass(entity3, partialTicks); + } + } + + if(pass == 0) + if (this.isRenderEntityOutlines() && (!list1.isEmpty() || this.entityOutlinesRendered)) + { + this.world.profiler.endStartSection("entityOutlines"); + this.entityOutlineFramebuffer.framebufferClear(); + this.entityOutlinesRendered = !list1.isEmpty(); + + if (!list1.isEmpty()) + { + GlStateManager.depthFunc(519); + GlStateManager.disableFog(); + this.entityOutlineFramebuffer.bindFramebuffer(false); + RenderHelper.disableStandardItemLighting(); + this.renderManager.setRenderOutlines(true); + + for (int j = 0; j < list1.size(); ++j) + { + this.renderManager.renderEntityStatic(list1.get(j), partialTicks, false); + } + + this.renderManager.setRenderOutlines(false); + RenderHelper.enableStandardItemLighting(); + GlStateManager.depthMask(false); + this.entityOutlineShader.render(partialTicks); + GlStateManager.enableLighting(); + GlStateManager.depthMask(true); + GlStateManager.enableFog(); + GlStateManager.enableBlend(); + GlStateManager.enableColorMaterial(); + GlStateManager.depthFunc(515); + GlStateManager.enableDepth(); + GlStateManager.enableAlpha(); + } + + this.mc.getFramebuffer().bindFramebuffer(false); + } + + this.world.profiler.endStartSection("blockentities"); + RenderHelper.enableStandardItemLighting(); + + TileEntityRendererDispatcher.instance.preDrawBatch(); + for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 : this.renderInfos) + { + List list3 = renderglobal$containerlocalrenderinformation1.renderChunk.getCompiledChunk().getTileEntities(); + + if (!list3.isEmpty()) + { + for (TileEntity tileentity2 : list3) + { + if (!tileentity2.shouldRenderInPass(pass) || !camera.isBoundingBoxInFrustum(tileentity2.getRenderBoundingBox())) continue; + TileEntityRendererDispatcher.instance.render(tileentity2, partialTicks, -1); + } + } + } + + synchronized (this.setTileEntities) + { + for (TileEntity tileentity : this.setTileEntities) + { + if (!tileentity.shouldRenderInPass(pass) || !camera.isBoundingBoxInFrustum(tileentity.getRenderBoundingBox())) continue; + TileEntityRendererDispatcher.instance.render(tileentity, partialTicks, -1); + } + } + TileEntityRendererDispatcher.instance.drawBatch(pass); + + this.preRenderDamagedBlocks(); + + for (DestroyBlockProgress destroyblockprogress : this.damagedBlocks.values()) + { + BlockPos blockpos = destroyblockprogress.getPosition(); + + if (this.world.getBlockState(blockpos).getBlock().hasTileEntity()) + { + TileEntity tileentity1 = this.world.getTileEntity(blockpos); + + if (tileentity1 instanceof TileEntityChest) + { + TileEntityChest tileentitychest = (TileEntityChest)tileentity1; + + if (tileentitychest.adjacentChestXNeg != null) + { + blockpos = blockpos.offset(EnumFacing.WEST); + tileentity1 = this.world.getTileEntity(blockpos); + } + else if (tileentitychest.adjacentChestZNeg != null) + { + blockpos = blockpos.offset(EnumFacing.NORTH); + tileentity1 = this.world.getTileEntity(blockpos); + } + } + + IBlockState iblockstate = this.world.getBlockState(blockpos); + + if (tileentity1 != null && iblockstate.hasCustomBreakingProgress()) + { + TileEntityRendererDispatcher.instance.render(tileentity1, partialTicks, destroyblockprogress.getPartialBlockDamage()); + } + } + } + + this.postRenderDamagedBlocks(); + this.mc.entityRenderer.disableLightmap(); + this.mc.mcProfiler.endSection(); + } + } + + /** + * Checks if the given entity should have an outline rendered. + */ + private boolean isOutlineActive(Entity entityIn, Entity viewer, ICamera camera) + { + boolean flag = viewer instanceof EntityLivingBase && ((EntityLivingBase)viewer).isPlayerSleeping(); + + if (entityIn == viewer && this.mc.gameSettings.thirdPersonView == 0 && !flag) + { + return false; + } + else if (entityIn.isGlowing()) + { + return true; + } + else if (this.mc.player.isSpectator() && this.mc.gameSettings.keyBindSpectatorOutlines.isKeyDown() && entityIn instanceof EntityPlayer) + { + return entityIn.ignoreFrustumCheck || camera.isBoundingBoxInFrustum(entityIn.getEntityBoundingBox()) || entityIn.isRidingOrBeingRiddenBy(this.mc.player); + } + else + { + return false; + } + } + + /** + * Gets the render info for use on the Debug screen + */ + public String getDebugInfoRenders() + { + int i = this.viewFrustum.renderChunks.length; + int j = this.getRenderedChunks(); + return String.format("C: %d/%d %sD: %d, L: %d, %s", j, i, this.mc.renderChunksMany ? "(s) " : "", this.renderDistanceChunks, this.setLightUpdates.size(), this.renderDispatcher == null ? "null" : this.renderDispatcher.getDebugInfo()); + } + + protected int getRenderedChunks() + { + int i = 0; + + for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.renderInfos) + { + CompiledChunk compiledchunk = renderglobal$containerlocalrenderinformation.renderChunk.compiledChunk; + + if (compiledchunk != CompiledChunk.DUMMY && !compiledchunk.isEmpty()) + { + ++i; + } + } + + return i; + } + + /** + * Gets the entities info for use on the Debug screen + */ + public String getDebugInfoEntities() + { + return "E: " + this.countEntitiesRendered + "/" + this.countEntitiesTotal + ", B: " + this.countEntitiesHidden; + } + + public void setupTerrain(Entity viewEntity, double partialTicks, ICamera camera, int frameCount, boolean playerSpectator) + { + if (this.mc.gameSettings.renderDistanceChunks != this.renderDistanceChunks) + { + this.loadRenderers(); + } + + this.world.profiler.startSection("camera"); + double d0 = viewEntity.posX - this.frustumUpdatePosX; + double d1 = viewEntity.posY - this.frustumUpdatePosY; + double d2 = viewEntity.posZ - this.frustumUpdatePosZ; + + if (this.frustumUpdatePosChunkX != viewEntity.chunkCoordX || this.frustumUpdatePosChunkY != viewEntity.chunkCoordY || this.frustumUpdatePosChunkZ != viewEntity.chunkCoordZ || d0 * d0 + d1 * d1 + d2 * d2 > 16.0D) + { + this.frustumUpdatePosX = viewEntity.posX; + this.frustumUpdatePosY = viewEntity.posY; + this.frustumUpdatePosZ = viewEntity.posZ; + this.frustumUpdatePosChunkX = viewEntity.chunkCoordX; + this.frustumUpdatePosChunkY = viewEntity.chunkCoordY; + this.frustumUpdatePosChunkZ = viewEntity.chunkCoordZ; + this.viewFrustum.updateChunkPositions(viewEntity.posX, viewEntity.posZ); + } + + this.world.profiler.endStartSection("renderlistcamera"); + double d3 = viewEntity.lastTickPosX + (viewEntity.posX - viewEntity.lastTickPosX) * partialTicks; + double d4 = viewEntity.lastTickPosY + (viewEntity.posY - viewEntity.lastTickPosY) * partialTicks; + double d5 = viewEntity.lastTickPosZ + (viewEntity.posZ - viewEntity.lastTickPosZ) * partialTicks; + this.renderContainer.initialize(d3, d4, d5); + this.world.profiler.endStartSection("cull"); + + if (this.debugFixedClippingHelper != null) + { + Frustum frustum = new Frustum(this.debugFixedClippingHelper); + frustum.setPosition(this.debugTerrainFrustumPosition.x, this.debugTerrainFrustumPosition.y, this.debugTerrainFrustumPosition.z); + camera = frustum; + } + + this.mc.mcProfiler.endStartSection("culling"); + BlockPos blockpos1 = new BlockPos(d3, d4 + viewEntity.getEyeHeight(), d5); + RenderChunk renderchunk = this.viewFrustum.getRenderChunk(blockpos1); + BlockPos blockpos = new BlockPos(MathHelper.floor(d3 / 16.0D) * 16, MathHelper.floor(d4 / 16.0D) * 16, MathHelper.floor(d5 / 16.0D) * 16); + this.displayListEntitiesDirty = this.displayListEntitiesDirty || !this.chunksToUpdate.isEmpty() || viewEntity.posX != this.lastViewEntityX || viewEntity.posY != this.lastViewEntityY || viewEntity.posZ != this.lastViewEntityZ || viewEntity.rotationPitch != this.lastViewEntityPitch || viewEntity.rotationYaw != this.lastViewEntityYaw; + this.lastViewEntityX = viewEntity.posX; + this.lastViewEntityY = viewEntity.posY; + this.lastViewEntityZ = viewEntity.posZ; + this.lastViewEntityPitch = viewEntity.rotationPitch; + this.lastViewEntityYaw = viewEntity.rotationYaw; + boolean flag = this.debugFixedClippingHelper != null; + this.mc.mcProfiler.endStartSection("update"); + + if (!flag && this.displayListEntitiesDirty) + { + this.displayListEntitiesDirty = false; + this.renderInfos = Lists.newArrayList(); + Queue queue = Queues.newArrayDeque(); + Entity.setRenderDistanceWeight(MathHelper.clamp(this.mc.gameSettings.renderDistanceChunks / 8.0D, 1.0D, 2.5D)); + boolean flag1 = this.mc.renderChunksMany; + + if (renderchunk != null) + { + boolean flag2 = false; + RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation3 = new RenderGlobal.ContainerLocalRenderInformation(renderchunk, (EnumFacing)null, 0); + Set set1 = this.getVisibleFacings(blockpos1); + + if (set1.size() == 1) + { + Vector3f vector3f = this.getViewVector(viewEntity, partialTicks); + EnumFacing enumfacing = EnumFacing.getFacingFromVector(vector3f.x, vector3f.y, vector3f.z).getOpposite(); + set1.remove(enumfacing); + } + + if (set1.isEmpty()) + { + flag2 = true; + } + + if (flag2 && !playerSpectator) + { + this.renderInfos.add(renderglobal$containerlocalrenderinformation3); + } + else + { + if (playerSpectator && this.world.getBlockState(blockpos1).isOpaqueCube()) + { + flag1 = false; + } + + renderchunk.setFrameIndex(frameCount); + queue.add(renderglobal$containerlocalrenderinformation3); + } + } + else + { + int i = blockpos1.getY() > 0 ? 248 : 8; + + for (int j = -this.renderDistanceChunks; j <= this.renderDistanceChunks; ++j) + { + for (int k = -this.renderDistanceChunks; k <= this.renderDistanceChunks; ++k) + { + RenderChunk renderchunk1 = this.viewFrustum.getRenderChunk(new BlockPos((j << 4) + 8, i, (k << 4) + 8)); + + if (renderchunk1 != null && camera.isBoundingBoxInFrustum(renderchunk1.boundingBox.expand(0.0, blockpos1.getY() > 0 ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY, 0.0))) // Forge: fix MC-73139 + { + renderchunk1.setFrameIndex(frameCount); + queue.add(new RenderGlobal.ContainerLocalRenderInformation(renderchunk1, (EnumFacing)null, 0)); + } + } + } + } + + this.mc.mcProfiler.startSection("iteration"); + + while (!queue.isEmpty()) + { + RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 = queue.poll(); + RenderChunk renderchunk3 = renderglobal$containerlocalrenderinformation1.renderChunk; + EnumFacing enumfacing2 = renderglobal$containerlocalrenderinformation1.facing; + this.renderInfos.add(renderglobal$containerlocalrenderinformation1); + + for (EnumFacing enumfacing1 : EnumFacing.values()) + { + RenderChunk renderchunk2 = this.getRenderChunkOffset(blockpos, renderchunk3, enumfacing1); + + if ((!flag1 || !renderglobal$containerlocalrenderinformation1.hasDirection(enumfacing1.getOpposite())) && (!flag1 || enumfacing2 == null || renderchunk3.getCompiledChunk().isVisible(enumfacing2.getOpposite(), enumfacing1)) && renderchunk2 != null && renderchunk2.setFrameIndex(frameCount) && camera.isBoundingBoxInFrustum(renderchunk2.boundingBox)) + { + RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation = new RenderGlobal.ContainerLocalRenderInformation(renderchunk2, enumfacing1, renderglobal$containerlocalrenderinformation1.counter + 1); + renderglobal$containerlocalrenderinformation.setDirection(renderglobal$containerlocalrenderinformation1.setFacing, enumfacing1); + queue.add(renderglobal$containerlocalrenderinformation); + } + } + } + + this.mc.mcProfiler.endSection(); + } + + this.mc.mcProfiler.endStartSection("captureFrustum"); + + if (this.debugFixTerrainFrustum) + { + this.fixTerrainFrustum(d3, d4, d5); + this.debugFixTerrainFrustum = false; + } + + this.mc.mcProfiler.endStartSection("rebuildNear"); + Set set = this.chunksToUpdate; + this.chunksToUpdate = Sets.newLinkedHashSet(); + + for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation2 : this.renderInfos) + { + RenderChunk renderchunk4 = renderglobal$containerlocalrenderinformation2.renderChunk; + + if (renderchunk4.needsUpdate() || set.contains(renderchunk4)) + { + this.displayListEntitiesDirty = true; + BlockPos blockpos2 = renderchunk4.getPosition().add(8, 8, 8); + boolean flag3 = blockpos2.distanceSq(blockpos1) < 768.0D; + + if (net.minecraftforge.common.ForgeModContainer.alwaysSetupTerrainOffThread || (!renderchunk4.needsImmediateUpdate() && !flag3)) + { + this.chunksToUpdate.add(renderchunk4); + } + else + { + this.mc.mcProfiler.startSection("build near"); + this.renderDispatcher.updateChunkNow(renderchunk4); + renderchunk4.clearNeedsUpdate(); + this.mc.mcProfiler.endSection(); + } + } + } + + this.chunksToUpdate.addAll(set); + this.mc.mcProfiler.endSection(); + } + + private Set getVisibleFacings(BlockPos pos) + { + VisGraph visgraph = new VisGraph(); + BlockPos blockpos = new BlockPos(pos.getX() >> 4 << 4, pos.getY() >> 4 << 4, pos.getZ() >> 4 << 4); + Chunk chunk = this.world.getChunkFromBlockCoords(blockpos); + + for (BlockPos.MutableBlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(blockpos, blockpos.add(15, 15, 15))) + { + if (chunk.getBlockState(blockpos$mutableblockpos).isOpaqueCube()) + { + visgraph.setOpaqueCube(blockpos$mutableblockpos); + } + } + + return visgraph.getVisibleFacings(pos); + } + + /** + * Returns RenderChunk offset from given RenderChunk in given direction, or null if it can't be seen by player at + * given BlockPos. + */ + @Nullable + private RenderChunk getRenderChunkOffset(BlockPos playerPos, RenderChunk renderChunkBase, EnumFacing facing) + { + BlockPos blockpos = renderChunkBase.getBlockPosOffset16(facing); + + if (MathHelper.abs(playerPos.getX() - blockpos.getX()) > this.renderDistanceChunks * 16) + { + return null; + } + else if (blockpos.getY() >= 0 && blockpos.getY() < 256) + { + return MathHelper.abs(playerPos.getZ() - blockpos.getZ()) > this.renderDistanceChunks * 16 ? null : this.viewFrustum.getRenderChunk(blockpos); + } + else + { + return null; + } + } + + private void fixTerrainFrustum(double x, double y, double z) + { + this.debugFixedClippingHelper = new ClippingHelperImpl(); + ((ClippingHelperImpl)this.debugFixedClippingHelper).init(); + Matrix4f matrix4f = new Matrix4f(this.debugFixedClippingHelper.modelviewMatrix); + matrix4f.transpose(); + Matrix4f matrix4f1 = new Matrix4f(this.debugFixedClippingHelper.projectionMatrix); + matrix4f1.transpose(); + Matrix4f matrix4f2 = new Matrix4f(); + Matrix4f.mul(matrix4f1, matrix4f, matrix4f2); + matrix4f2.invert(); + this.debugTerrainFrustumPosition.x = x; + this.debugTerrainFrustumPosition.y = y; + this.debugTerrainFrustumPosition.z = z; + this.debugTerrainMatrix[0] = new Vector4f(-1.0F, -1.0F, -1.0F, 1.0F); + this.debugTerrainMatrix[1] = new Vector4f(1.0F, -1.0F, -1.0F, 1.0F); + this.debugTerrainMatrix[2] = new Vector4f(1.0F, 1.0F, -1.0F, 1.0F); + this.debugTerrainMatrix[3] = new Vector4f(-1.0F, 1.0F, -1.0F, 1.0F); + this.debugTerrainMatrix[4] = new Vector4f(-1.0F, -1.0F, 1.0F, 1.0F); + this.debugTerrainMatrix[5] = new Vector4f(1.0F, -1.0F, 1.0F, 1.0F); + this.debugTerrainMatrix[6] = new Vector4f(1.0F, 1.0F, 1.0F, 1.0F); + this.debugTerrainMatrix[7] = new Vector4f(-1.0F, 1.0F, 1.0F, 1.0F); + + for (int i = 0; i < 8; ++i) + { + Matrix4f.transform(matrix4f2, this.debugTerrainMatrix[i], this.debugTerrainMatrix[i]); + this.debugTerrainMatrix[i].x /= this.debugTerrainMatrix[i].w; + this.debugTerrainMatrix[i].y /= this.debugTerrainMatrix[i].w; + this.debugTerrainMatrix[i].z /= this.debugTerrainMatrix[i].w; + this.debugTerrainMatrix[i].w = 1.0F; + } + } + + protected Vector3f getViewVector(Entity entityIn, double partialTicks) + { + float f = (float)(entityIn.prevRotationPitch + (entityIn.rotationPitch - entityIn.prevRotationPitch) * partialTicks); + float f1 = (float)(entityIn.prevRotationYaw + (entityIn.rotationYaw - entityIn.prevRotationYaw) * partialTicks); + + if (Minecraft.getMinecraft().gameSettings.thirdPersonView == 2) + { + f += 180.0F; + } + + float f2 = MathHelper.cos(-f1 * 0.017453292F - (float)Math.PI); + float f3 = MathHelper.sin(-f1 * 0.017453292F - (float)Math.PI); + float f4 = -MathHelper.cos(-f * 0.017453292F); + float f5 = MathHelper.sin(-f * 0.017453292F); + return new Vector3f(f3 * f4, f5, f2 * f4); + } + + /** + * XXX renderBlockLayer + * @param blockLayerIn + * @param partialTicks + * @param pass + * @param entityIn + * @return + */ + public int renderBlockLayer(BlockRenderLayer blockLayerIn, double partialTicks, int pass, Entity entityIn) + { + RenderHelper.disableStandardItemLighting(); + + if (blockLayerIn == BlockRenderLayer.TRANSLUCENT) + { + this.mc.mcProfiler.startSection("translucent_sort"); + double d0 = entityIn.posX - this.prevRenderSortX; + double d1 = entityIn.posY - this.prevRenderSortY; + double d2 = entityIn.posZ - this.prevRenderSortZ; + + if (d0 * d0 + d1 * d1 + d2 * d2 > 1.0D) + { + this.prevRenderSortX = entityIn.posX; + this.prevRenderSortY = entityIn.posY; + this.prevRenderSortZ = entityIn.posZ; + int k = 0; + + for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.renderInfos) + { + if (renderglobal$containerlocalrenderinformation.renderChunk.compiledChunk.isLayerStarted(blockLayerIn) && k++ < 15) + { + this.renderDispatcher.updateTransparencyLater(renderglobal$containerlocalrenderinformation.renderChunk); + } + } + } + + this.mc.mcProfiler.endSection(); + } + + this.mc.mcProfiler.startSection("filterempty"); + int l = 0; + boolean flag = blockLayerIn == BlockRenderLayer.TRANSLUCENT; + int i1 = flag ? this.renderInfos.size() - 1 : 0; + int i = flag ? -1 : this.renderInfos.size(); + int j1 = flag ? -1 : 1; + + for (int j = i1; j != i; j += j1) + { + RenderChunk renderchunk = (this.renderInfos.get(j)).renderChunk; + + if (!renderchunk.getCompiledChunk().isLayerEmpty(blockLayerIn)) + { + ++l; + this.renderContainer.addRenderChunk(renderchunk, blockLayerIn); + + // XXX + } + } + + this.mc.mcProfiler.func_194339_b(() -> + { + return "render_" + blockLayerIn; + }); + this.renderBlockLayer(blockLayerIn); + this.mc.mcProfiler.endSection(); + return l; + } + + @SuppressWarnings("incomplete-switch") + private void renderBlockLayer(BlockRenderLayer blockLayerIn) + { + this.mc.entityRenderer.enableLightmap(); + + if (OpenGlHelper.useVbo()) + { + GlStateManager.glEnableClientState(32884); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + GlStateManager.glEnableClientState(32888); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit); + GlStateManager.glEnableClientState(32888); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + GlStateManager.glEnableClientState(32886); + } + + this.renderContainer.renderChunkLayer(blockLayerIn); + + if (OpenGlHelper.useVbo()) + { + for (VertexFormatElement vertexformatelement : DefaultVertexFormats.BLOCK.getElements()) + { + VertexFormatElement.EnumUsage vertexformatelement$enumusage = vertexformatelement.getUsage(); + int k1 = vertexformatelement.getIndex(); + + switch (vertexformatelement$enumusage) + { + case POSITION: + GlStateManager.glDisableClientState(32884); + break; + case UV: + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + k1); + GlStateManager.glDisableClientState(32888); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + break; + case COLOR: + GlStateManager.glDisableClientState(32886); + GlStateManager.resetColor(); + } + } + } + + this.mc.entityRenderer.disableLightmap(); + } + + private void cleanupDamagedBlocks(Iterator iteratorIn) + { + while (iteratorIn.hasNext()) + { + DestroyBlockProgress destroyblockprogress = iteratorIn.next(); + int k1 = destroyblockprogress.getCreationCloudUpdateTick(); + + if (this.cloudTickCounter - k1 > 400) + { + iteratorIn.remove(); + } + } + } + + public void updateClouds() + { + ++this.cloudTickCounter; + + if (this.cloudTickCounter % 20 == 0) + { + this.cleanupDamagedBlocks(this.damagedBlocks.values().iterator()); + } + + if (!this.setLightUpdates.isEmpty() && !this.renderDispatcher.hasNoFreeRenderBuilders() && this.chunksToUpdate.isEmpty()) + { + Iterator iterator = this.setLightUpdates.iterator(); + + while (iterator.hasNext()) + { + BlockPos blockpos = iterator.next(); + iterator.remove(); + int k1 = blockpos.getX(); + int l1 = blockpos.getY(); + int i2 = blockpos.getZ(); + this.markBlocksForUpdate(k1 - 1, l1 - 1, i2 - 1, k1 + 1, l1 + 1, i2 + 1, false); + } + } + } + + private void renderSkyEnd() + { + GlStateManager.disableFog(); + GlStateManager.disableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + RenderHelper.disableStandardItemLighting(); + GlStateManager.depthMask(false); + this.renderEngine.bindTexture(END_SKY_TEXTURES); + Tessellator tessellator = Tessellator.getInstance(); + BufferBuilder bufferbuilder = tessellator.getBuffer(); + + for (int k1 = 0; k1 < 6; ++k1) + { + GlStateManager.pushMatrix(); + + if (k1 == 1) + { + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + } + + if (k1 == 2) + { + GlStateManager.rotate(-90.0F, 1.0F, 0.0F, 0.0F); + } + + if (k1 == 3) + { + GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F); + } + + if (k1 == 4) + { + GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F); + } + + if (k1 == 5) + { + GlStateManager.rotate(-90.0F, 0.0F, 0.0F, 1.0F); + } + + bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + bufferbuilder.pos(-100.0D, -100.0D, -100.0D).tex(0.0D, 0.0D).color(40, 40, 40, 255).endVertex(); + bufferbuilder.pos(-100.0D, -100.0D, 100.0D).tex(0.0D, 16.0D).color(40, 40, 40, 255).endVertex(); + bufferbuilder.pos(100.0D, -100.0D, 100.0D).tex(16.0D, 16.0D).color(40, 40, 40, 255).endVertex(); + bufferbuilder.pos(100.0D, -100.0D, -100.0D).tex(16.0D, 0.0D).color(40, 40, 40, 255).endVertex(); + tessellator.draw(); + GlStateManager.popMatrix(); + } + + GlStateManager.depthMask(true); + GlStateManager.enableTexture2D(); + GlStateManager.enableAlpha(); + } + + public void renderSky(float partialTicks, int pass) + { + net.minecraftforge.client.IRenderHandler renderer = this.world.provider.getSkyRenderer(); + if (renderer != null) + { + renderer.render(partialTicks, world, mc); + return; + } + + if (this.mc.world.provider.getDimensionType().getId() == 1) + { + this.renderSkyEnd(); + } + else if (this.mc.world.provider.isSurfaceWorld()) + { + GlStateManager.disableTexture2D(); + Vec3d vec3d = this.world.getSkyColor(this.mc.getRenderViewEntity(), partialTicks); + float f = (float)vec3d.x; + float f1 = (float)vec3d.y; + float f2 = (float)vec3d.z; + + if (pass != 2) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + GlStateManager.color(f, f1, f2); + Tessellator tessellator = Tessellator.getInstance(); + BufferBuilder bufferbuilder = tessellator.getBuffer(); + GlStateManager.depthMask(false); + GlStateManager.enableFog(); + GlStateManager.color(f, f1, f2); + + if (this.vboEnabled) + { + this.skyVBO.bindBuffer(); + GlStateManager.glEnableClientState(32884); + GlStateManager.glVertexPointer(3, 5126, 12, 0); + this.skyVBO.drawArrays(7); + this.skyVBO.unbindBuffer(); + GlStateManager.glDisableClientState(32884); + } + else + { + GlStateManager.callList(this.glSkyList); + } + + GlStateManager.disableFog(); + GlStateManager.disableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + RenderHelper.disableStandardItemLighting(); + float[] afloat = this.world.provider.calcSunriseSunsetColors(this.world.getCelestialAngle(partialTicks), partialTicks); + + if (afloat != null) + { + GlStateManager.disableTexture2D(); + GlStateManager.shadeModel(7425); + GlStateManager.pushMatrix(); + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(MathHelper.sin(this.world.getCelestialAngleRadians(partialTicks)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F); + float f6 = afloat[0]; + float f7 = afloat[1]; + float f8 = afloat[2]; + + if (pass != 2) + { + float f9 = (f6 * 30.0F + f7 * 59.0F + f8 * 11.0F) / 100.0F; + float f10 = (f6 * 30.0F + f7 * 70.0F) / 100.0F; + float f11 = (f6 * 30.0F + f8 * 70.0F) / 100.0F; + f6 = f9; + f7 = f10; + f8 = f11; + } + + bufferbuilder.begin(6, DefaultVertexFormats.POSITION_COLOR); + bufferbuilder.pos(0.0D, 100.0D, 0.0D).color(f6, f7, f8, afloat[3]).endVertex(); + + for (int j2 = 0; j2 <= 16; ++j2) + { + float f21 = j2 * ((float)Math.PI * 2F) / 16.0F; + float f12 = MathHelper.sin(f21); + float f13 = MathHelper.cos(f21); + bufferbuilder.pos(f12 * 120.0F, f13 * 120.0F, -f13 * 40.0F * afloat[3]).color(afloat[0], afloat[1], afloat[2], 0.0F).endVertex(); + } + + tessellator.draw(); + GlStateManager.popMatrix(); + GlStateManager.shadeModel(7424); + } + + GlStateManager.enableTexture2D(); + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + GlStateManager.pushMatrix(); + float f16 = 1.0F - this.world.getRainStrength(partialTicks); + GlStateManager.color(1.0F, 1.0F, 1.0F, f16); + GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(this.world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F); + float f17 = 30.0F; + this.renderEngine.bindTexture(SUN_TEXTURES); + bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX); + bufferbuilder.pos((-f17), 100.0D, (-f17)).tex(0.0D, 0.0D).endVertex(); + bufferbuilder.pos(f17, 100.0D, (-f17)).tex(1.0D, 0.0D).endVertex(); + bufferbuilder.pos(f17, 100.0D, f17).tex(1.0D, 1.0D).endVertex(); + bufferbuilder.pos((-f17), 100.0D, f17).tex(0.0D, 1.0D).endVertex(); + tessellator.draw(); + f17 = 20.0F; + this.renderEngine.bindTexture(MOON_PHASES_TEXTURES); + int k1 = this.world.getMoonPhase(); + int i2 = k1 % 4; + int k2 = k1 / 4 % 2; + float f22 = (i2 + 0) / 4.0F; + float f23 = (k2 + 0) / 2.0F; + float f24 = (i2 + 1) / 4.0F; + float f14 = (k2 + 1) / 2.0F; + bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX); + bufferbuilder.pos((-f17), -100.0D, f17).tex(f24, f14).endVertex(); + bufferbuilder.pos(f17, -100.0D, f17).tex(f22, f14).endVertex(); + bufferbuilder.pos(f17, -100.0D, (-f17)).tex(f22, f23).endVertex(); + bufferbuilder.pos((-f17), -100.0D, (-f17)).tex(f24, f23).endVertex(); + tessellator.draw(); + GlStateManager.disableTexture2D(); + float f15 = this.world.getStarBrightness(partialTicks) * f16; + + if (f15 > 0.0F) + { + GlStateManager.color(f15, f15, f15, f15); + + if (this.vboEnabled) + { + this.starVBO.bindBuffer(); + GlStateManager.glEnableClientState(32884); + GlStateManager.glVertexPointer(3, 5126, 12, 0); + this.starVBO.drawArrays(7); + this.starVBO.unbindBuffer(); + GlStateManager.glDisableClientState(32884); + } + else + { + GlStateManager.callList(this.starGLCallList); + } + } + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); + GlStateManager.enableFog(); + GlStateManager.popMatrix(); + GlStateManager.disableTexture2D(); + GlStateManager.color(0.0F, 0.0F, 0.0F); + double d3 = this.mc.player.getPositionEyes(partialTicks).y - this.world.getHorizon(); + + if (d3 < 0.0D) + { + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, 12.0F, 0.0F); + + if (this.vboEnabled) + { + this.sky2VBO.bindBuffer(); + GlStateManager.glEnableClientState(32884); + GlStateManager.glVertexPointer(3, 5126, 12, 0); + this.sky2VBO.drawArrays(7); + this.sky2VBO.unbindBuffer(); + GlStateManager.glDisableClientState(32884); + } + else + { + GlStateManager.callList(this.glSkyList2); + } + + GlStateManager.popMatrix(); + float f19 = -((float)(d3 + 65.0D)); + bufferbuilder.begin(7, DefaultVertexFormats.POSITION_COLOR); + bufferbuilder.pos(-1.0D, f19, 1.0D).color(0, 0, 0, 255).endVertex(); + bufferbuilder.pos(1.0D, f19, 1.0D).color(0, 0, 0, 255).endVertex(); + bufferbuilder.pos(1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + bufferbuilder.pos(-1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + bufferbuilder.pos(-1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex(); + bufferbuilder.pos(1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex(); + bufferbuilder.pos(1.0D, f19, -1.0D).color(0, 0, 0, 255).endVertex(); + bufferbuilder.pos(-1.0D, f19, -1.0D).color(0, 0, 0, 255).endVertex(); + bufferbuilder.pos(1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex(); + bufferbuilder.pos(1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + bufferbuilder.pos(1.0D, f19, 1.0D).color(0, 0, 0, 255).endVertex(); + bufferbuilder.pos(1.0D, f19, -1.0D).color(0, 0, 0, 255).endVertex(); + bufferbuilder.pos(-1.0D, f19, -1.0D).color(0, 0, 0, 255).endVertex(); + bufferbuilder.pos(-1.0D, f19, 1.0D).color(0, 0, 0, 255).endVertex(); + bufferbuilder.pos(-1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + bufferbuilder.pos(-1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex(); + bufferbuilder.pos(-1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex(); + bufferbuilder.pos(-1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + bufferbuilder.pos(1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + bufferbuilder.pos(1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex(); + tessellator.draw(); + } + + if (this.world.provider.isSkyColored()) + { + GlStateManager.color(f * 0.2F + 0.04F, f1 * 0.2F + 0.04F, f2 * 0.6F + 0.1F); + } + else + { + GlStateManager.color(f, f1, f2); + } + + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, -((float)(d3 - 16.0D)), 0.0F); + GlStateManager.callList(this.glSkyList2); + GlStateManager.popMatrix(); + GlStateManager.enableTexture2D(); + GlStateManager.depthMask(true); + } + } + + public void renderClouds(float partialTicks, int pass, double p_180447_3_, double p_180447_5_, double p_180447_7_) + { + if (net.minecraftforge.fml.client.FMLClientHandler.instance().renderClouds(this.cloudTickCounter, partialTicks)) return; + if (this.mc.world.provider.isSurfaceWorld()) + { + if (this.mc.gameSettings.shouldRenderClouds() == 2) + { + this.renderCloudsFancy(partialTicks, pass, p_180447_3_, p_180447_5_, p_180447_7_); + } + else + { + GlStateManager.disableCull(); + Tessellator tessellator = Tessellator.getInstance(); + BufferBuilder bufferbuilder = tessellator.getBuffer(); + this.renderEngine.bindTexture(CLOUDS_TEXTURES); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + Vec3d vec3d = this.world.getCloudColour(partialTicks); + float f = (float)vec3d.x; + float f1 = (float)vec3d.y; + float f2 = (float)vec3d.z; + + if (pass != 2) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + double d5 = this.cloudTickCounter + partialTicks; + double d3 = p_180447_3_ + d5 * 0.029999999329447746D; + int i2 = MathHelper.floor(d3 / 2048.0D); + int j2 = MathHelper.floor(p_180447_7_ / 2048.0D); + d3 = d3 - i2 * 2048; + double lvt_22_1_ = p_180447_7_ - j2 * 2048; + float f6 = this.world.provider.getCloudHeight() - (float)p_180447_5_ + 0.33F; + float f7 = (float)(d3 * 4.8828125E-4D); + float f8 = (float)(lvt_22_1_ * 4.8828125E-4D); + bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + + for (int k2 = -256; k2 < 256; k2 += 32) + { + for (int l2 = -256; l2 < 256; l2 += 32) + { + bufferbuilder.pos(k2 + 0, f6, l2 + 32).tex((k2 + 0) * 4.8828125E-4F + f7, (l2 + 32) * 4.8828125E-4F + f8).color(f, f1, f2, 0.8F).endVertex(); + bufferbuilder.pos(k2 + 32, f6, l2 + 32).tex((k2 + 32) * 4.8828125E-4F + f7, (l2 + 32) * 4.8828125E-4F + f8).color(f, f1, f2, 0.8F).endVertex(); + bufferbuilder.pos(k2 + 32, f6, l2 + 0).tex((k2 + 32) * 4.8828125E-4F + f7, (l2 + 0) * 4.8828125E-4F + f8).color(f, f1, f2, 0.8F).endVertex(); + bufferbuilder.pos(k2 + 0, f6, l2 + 0).tex((k2 + 0) * 4.8828125E-4F + f7, (l2 + 0) * 4.8828125E-4F + f8).color(f, f1, f2, 0.8F).endVertex(); + } + } + + tessellator.draw(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableBlend(); + GlStateManager.enableCull(); + } + } + } + + /** + * Checks if the given position is to be rendered with cloud fog + */ + public boolean hasCloudFog(double x, double y, double z, float partialTicks) + { + return false; + } + + private void renderCloudsFancy(float partialTicks, int pass, double x, double y, double z) + { + GlStateManager.disableCull(); + Tessellator tessellator = Tessellator.getInstance(); + BufferBuilder bufferbuilder = tessellator.getBuffer(); + double d3 = this.cloudTickCounter + partialTicks; + double d4 = (x + d3 * 0.029999999329447746D) / 12.0D; + double d5 = z / 12.0D + 0.33000001311302185D; + float f2 = this.world.provider.getCloudHeight() - (float)y + 0.33F; + int k1 = MathHelper.floor(d4 / 2048.0D); + int l1 = MathHelper.floor(d5 / 2048.0D); + d4 = d4 - k1 * 2048; + d5 = d5 - l1 * 2048; + this.renderEngine.bindTexture(CLOUDS_TEXTURES); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + Vec3d vec3d = this.world.getCloudColour(partialTicks); + float f3 = (float)vec3d.x; + float f4 = (float)vec3d.y; + float f5 = (float)vec3d.z; + + if (pass != 2) + { + float f6 = (f3 * 30.0F + f4 * 59.0F + f5 * 11.0F) / 100.0F; + float f7 = (f3 * 30.0F + f4 * 70.0F) / 100.0F; + float f8 = (f3 * 30.0F + f5 * 70.0F) / 100.0F; + f3 = f6; + f4 = f7; + f5 = f8; + } + + float f25 = f3 * 0.9F; + float f26 = f4 * 0.9F; + float f27 = f5 * 0.9F; + float f9 = f3 * 0.7F; + float f10 = f4 * 0.7F; + float f11 = f5 * 0.7F; + float f12 = f3 * 0.8F; + float f13 = f4 * 0.8F; + float f14 = f5 * 0.8F; + float f16 = MathHelper.floor(d4) * 0.00390625F; + float f17 = MathHelper.floor(d5) * 0.00390625F; + float f18 = (float)(d4 - MathHelper.floor(d4)); + float f19 = (float)(d5 - MathHelper.floor(d5)); + GlStateManager.scale(12.0F, 1.0F, 12.0F); + + for (int k2 = 0; k2 < 2; ++k2) + { + if (k2 == 0) + { + GlStateManager.colorMask(false, false, false, false); + } + else + { + switch (pass) + { + case 0: + GlStateManager.colorMask(false, true, true, true); + break; + case 1: + GlStateManager.colorMask(true, false, false, true); + break; + case 2: + GlStateManager.colorMask(true, true, true, true); + } + } + + for (int l2 = -3; l2 <= 4; ++l2) + { + for (int i3 = -3; i3 <= 4; ++i3) + { + bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL); + float f21 = l2 * 8; + float f22 = i3 * 8; + float f23 = f21 - f18; + float f24 = f22 - f19; + + if (f2 > -5.0F) + { + bufferbuilder.pos(f23 + 0.0F, f2 + 0.0F, f24 + 8.0F).tex((f21 + 0.0F) * 0.00390625F + f16, (f22 + 8.0F) * 0.00390625F + f17).color(f9, f10, f11, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex(); + bufferbuilder.pos(f23 + 8.0F, f2 + 0.0F, f24 + 8.0F).tex((f21 + 8.0F) * 0.00390625F + f16, (f22 + 8.0F) * 0.00390625F + f17).color(f9, f10, f11, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex(); + bufferbuilder.pos(f23 + 8.0F, f2 + 0.0F, f24 + 0.0F).tex((f21 + 8.0F) * 0.00390625F + f16, (f22 + 0.0F) * 0.00390625F + f17).color(f9, f10, f11, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex(); + bufferbuilder.pos(f23 + 0.0F, f2 + 0.0F, f24 + 0.0F).tex((f21 + 0.0F) * 0.00390625F + f16, (f22 + 0.0F) * 0.00390625F + f17).color(f9, f10, f11, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex(); + } + + if (f2 <= 5.0F) + { + bufferbuilder.pos(f23 + 0.0F, f2 + 4.0F - 9.765625E-4F, f24 + 8.0F).tex((f21 + 0.0F) * 0.00390625F + f16, (f22 + 8.0F) * 0.00390625F + f17).color(f3, f4, f5, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex(); + bufferbuilder.pos(f23 + 8.0F, f2 + 4.0F - 9.765625E-4F, f24 + 8.0F).tex((f21 + 8.0F) * 0.00390625F + f16, (f22 + 8.0F) * 0.00390625F + f17).color(f3, f4, f5, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex(); + bufferbuilder.pos(f23 + 8.0F, f2 + 4.0F - 9.765625E-4F, f24 + 0.0F).tex((f21 + 8.0F) * 0.00390625F + f16, (f22 + 0.0F) * 0.00390625F + f17).color(f3, f4, f5, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex(); + bufferbuilder.pos(f23 + 0.0F, f2 + 4.0F - 9.765625E-4F, f24 + 0.0F).tex((f21 + 0.0F) * 0.00390625F + f16, (f22 + 0.0F) * 0.00390625F + f17).color(f3, f4, f5, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex(); + } + + if (l2 > -1) + { + for (int j3 = 0; j3 < 8; ++j3) + { + bufferbuilder.pos(f23 + j3 + 0.0F, f2 + 0.0F, f24 + 8.0F).tex((f21 + j3 + 0.5F) * 0.00390625F + f16, (f22 + 8.0F) * 0.00390625F + f17).color(f25, f26, f27, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex(); + bufferbuilder.pos(f23 + j3 + 0.0F, f2 + 4.0F, f24 + 8.0F).tex((f21 + j3 + 0.5F) * 0.00390625F + f16, (f22 + 8.0F) * 0.00390625F + f17).color(f25, f26, f27, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex(); + bufferbuilder.pos(f23 + j3 + 0.0F, f2 + 4.0F, f24 + 0.0F).tex((f21 + j3 + 0.5F) * 0.00390625F + f16, (f22 + 0.0F) * 0.00390625F + f17).color(f25, f26, f27, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex(); + bufferbuilder.pos(f23 + j3 + 0.0F, f2 + 0.0F, f24 + 0.0F).tex((f21 + j3 + 0.5F) * 0.00390625F + f16, (f22 + 0.0F) * 0.00390625F + f17).color(f25, f26, f27, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex(); + } + } + + if (l2 <= 1) + { + for (int k3 = 0; k3 < 8; ++k3) + { + bufferbuilder.pos(f23 + k3 + 1.0F - 9.765625E-4F, f2 + 0.0F, f24 + 8.0F).tex((f21 + k3 + 0.5F) * 0.00390625F + f16, (f22 + 8.0F) * 0.00390625F + f17).color(f25, f26, f27, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex(); + bufferbuilder.pos(f23 + k3 + 1.0F - 9.765625E-4F, f2 + 4.0F, f24 + 8.0F).tex((f21 + k3 + 0.5F) * 0.00390625F + f16, (f22 + 8.0F) * 0.00390625F + f17).color(f25, f26, f27, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex(); + bufferbuilder.pos(f23 + k3 + 1.0F - 9.765625E-4F, f2 + 4.0F, f24 + 0.0F).tex((f21 + k3 + 0.5F) * 0.00390625F + f16, (f22 + 0.0F) * 0.00390625F + f17).color(f25, f26, f27, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex(); + bufferbuilder.pos(f23 + k3 + 1.0F - 9.765625E-4F, f2 + 0.0F, f24 + 0.0F).tex((f21 + k3 + 0.5F) * 0.00390625F + f16, (f22 + 0.0F) * 0.00390625F + f17).color(f25, f26, f27, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex(); + } + } + + if (i3 > -1) + { + for (int l3 = 0; l3 < 8; ++l3) + { + bufferbuilder.pos(f23 + 0.0F, f2 + 4.0F, f24 + l3 + 0.0F).tex((f21 + 0.0F) * 0.00390625F + f16, (f22 + l3 + 0.5F) * 0.00390625F + f17).color(f12, f13, f14, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex(); + bufferbuilder.pos(f23 + 8.0F, f2 + 4.0F, f24 + l3 + 0.0F).tex((f21 + 8.0F) * 0.00390625F + f16, (f22 + l3 + 0.5F) * 0.00390625F + f17).color(f12, f13, f14, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex(); + bufferbuilder.pos(f23 + 8.0F, f2 + 0.0F, f24 + l3 + 0.0F).tex((f21 + 8.0F) * 0.00390625F + f16, (f22 + l3 + 0.5F) * 0.00390625F + f17).color(f12, f13, f14, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex(); + bufferbuilder.pos(f23 + 0.0F, f2 + 0.0F, f24 + l3 + 0.0F).tex((f21 + 0.0F) * 0.00390625F + f16, (f22 + l3 + 0.5F) * 0.00390625F + f17).color(f12, f13, f14, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex(); + } + } + + if (i3 <= 1) + { + for (int i4 = 0; i4 < 8; ++i4) + { + bufferbuilder.pos(f23 + 0.0F, f2 + 4.0F, f24 + i4 + 1.0F - 9.765625E-4F).tex((f21 + 0.0F) * 0.00390625F + f16, (f22 + i4 + 0.5F) * 0.00390625F + f17).color(f12, f13, f14, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex(); + bufferbuilder.pos(f23 + 8.0F, f2 + 4.0F, f24 + i4 + 1.0F - 9.765625E-4F).tex((f21 + 8.0F) * 0.00390625F + f16, (f22 + i4 + 0.5F) * 0.00390625F + f17).color(f12, f13, f14, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex(); + bufferbuilder.pos(f23 + 8.0F, f2 + 0.0F, f24 + i4 + 1.0F - 9.765625E-4F).tex((f21 + 8.0F) * 0.00390625F + f16, (f22 + i4 + 0.5F) * 0.00390625F + f17).color(f12, f13, f14, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex(); + bufferbuilder.pos(f23 + 0.0F, f2 + 0.0F, f24 + i4 + 1.0F - 9.765625E-4F).tex((f21 + 0.0F) * 0.00390625F + f16, (f22 + i4 + 0.5F) * 0.00390625F + f17).color(f12, f13, f14, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex(); + } + } + + tessellator.draw(); + } + } + } + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableBlend(); + GlStateManager.enableCull(); + } + + public void updateChunks(long finishTimeNano) + { + this.displayListEntitiesDirty |= this.renderDispatcher.runChunkUploads(finishTimeNano); + + if (!this.chunksToUpdate.isEmpty()) + { + Iterator iterator = this.chunksToUpdate.iterator(); + + while (iterator.hasNext()) + { + RenderChunk renderchunk1 = iterator.next(); + boolean flag1; + + if (renderchunk1.needsImmediateUpdate()) + { + flag1 = this.renderDispatcher.updateChunkNow(renderchunk1); + } + else + { + flag1 = this.renderDispatcher.updateChunkLater(renderchunk1); + } + + if (!flag1) + { + break; + } + + renderchunk1.clearNeedsUpdate(); + iterator.remove(); + long k1 = finishTimeNano - System.nanoTime(); + + if (k1 < 0L) + { + break; + } + } + } + } + + public void renderWorldBorder(Entity entityIn, float partialTicks) + { + Tessellator tessellator = Tessellator.getInstance(); + BufferBuilder bufferbuilder = tessellator.getBuffer(); + WorldBorder worldborder = this.world.getWorldBorder(); + double d3 = this.mc.gameSettings.renderDistanceChunks * 16; + + if (entityIn.posX >= worldborder.maxX() - d3 || entityIn.posX <= worldborder.minX() + d3 || entityIn.posZ >= worldborder.maxZ() - d3 || entityIn.posZ <= worldborder.minZ() + d3) + { + double d4 = 1.0D - worldborder.getClosestDistance(entityIn) / d3; + d4 = Math.pow(d4, 4.0D); + double d5 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * partialTicks; + double d6 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * partialTicks; + double d7 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * partialTicks; + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + this.renderEngine.bindTexture(FORCEFIELD_TEXTURES); + GlStateManager.depthMask(false); + GlStateManager.pushMatrix(); + int k1 = worldborder.getStatus().getColor(); + float f = (k1 >> 16 & 255) / 255.0F; + float f1 = (k1 >> 8 & 255) / 255.0F; + float f2 = (k1 & 255) / 255.0F; + GlStateManager.color(f, f1, f2, (float)d4); + GlStateManager.doPolygonOffset(-3.0F, -3.0F); + GlStateManager.enablePolygonOffset(); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.enableAlpha(); + GlStateManager.disableCull(); + float f3 = Minecraft.getSystemTime() % 3000L / 3000.0F; + bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX); + bufferbuilder.setTranslation(-d5, -d6, -d7); + double d8 = Math.max(MathHelper.floor(d7 - d3), worldborder.minZ()); + double d9 = Math.min(MathHelper.ceil(d7 + d3), worldborder.maxZ()); + + if (d5 > worldborder.maxX() - d3) + { + float f7 = 0.0F; + + for (double d10 = d8; d10 < d9; f7 += 0.5F) + { + double d11 = Math.min(1.0D, d9 - d10); + float f8 = (float)d11 * 0.5F; + bufferbuilder.pos(worldborder.maxX(), 256.0D, d10).tex(f3 + f7, f3 + 0.0F).endVertex(); + bufferbuilder.pos(worldborder.maxX(), 256.0D, d10 + d11).tex(f3 + f8 + f7, f3 + 0.0F).endVertex(); + bufferbuilder.pos(worldborder.maxX(), 0.0D, d10 + d11).tex(f3 + f8 + f7, f3 + 128.0F).endVertex(); + bufferbuilder.pos(worldborder.maxX(), 0.0D, d10).tex(f3 + f7, f3 + 128.0F).endVertex(); + ++d10; + } + } + + if (d5 < worldborder.minX() + d3) + { + float f9 = 0.0F; + + for (double d12 = d8; d12 < d9; f9 += 0.5F) + { + double d15 = Math.min(1.0D, d9 - d12); + float f12 = (float)d15 * 0.5F; + bufferbuilder.pos(worldborder.minX(), 256.0D, d12).tex(f3 + f9, f3 + 0.0F).endVertex(); + bufferbuilder.pos(worldborder.minX(), 256.0D, d12 + d15).tex(f3 + f12 + f9, f3 + 0.0F).endVertex(); + bufferbuilder.pos(worldborder.minX(), 0.0D, d12 + d15).tex(f3 + f12 + f9, f3 + 128.0F).endVertex(); + bufferbuilder.pos(worldborder.minX(), 0.0D, d12).tex(f3 + f9, f3 + 128.0F).endVertex(); + ++d12; + } + } + + d8 = Math.max(MathHelper.floor(d5 - d3), worldborder.minX()); + d9 = Math.min(MathHelper.ceil(d5 + d3), worldborder.maxX()); + + if (d7 > worldborder.maxZ() - d3) + { + float f10 = 0.0F; + + for (double d13 = d8; d13 < d9; f10 += 0.5F) + { + double d16 = Math.min(1.0D, d9 - d13); + float f13 = (float)d16 * 0.5F; + bufferbuilder.pos(d13, 256.0D, worldborder.maxZ()).tex(f3 + f10, f3 + 0.0F).endVertex(); + bufferbuilder.pos(d13 + d16, 256.0D, worldborder.maxZ()).tex(f3 + f13 + f10, f3 + 0.0F).endVertex(); + bufferbuilder.pos(d13 + d16, 0.0D, worldborder.maxZ()).tex(f3 + f13 + f10, f3 + 128.0F).endVertex(); + bufferbuilder.pos(d13, 0.0D, worldborder.maxZ()).tex(f3 + f10, f3 + 128.0F).endVertex(); + ++d13; + } + } + + if (d7 < worldborder.minZ() + d3) + { + float f11 = 0.0F; + + for (double d14 = d8; d14 < d9; f11 += 0.5F) + { + double d17 = Math.min(1.0D, d9 - d14); + float f14 = (float)d17 * 0.5F; + bufferbuilder.pos(d14, 256.0D, worldborder.minZ()).tex(f3 + f11, f3 + 0.0F).endVertex(); + bufferbuilder.pos(d14 + d17, 256.0D, worldborder.minZ()).tex(f3 + f14 + f11, f3 + 0.0F).endVertex(); + bufferbuilder.pos(d14 + d17, 0.0D, worldborder.minZ()).tex(f3 + f14 + f11, f3 + 128.0F).endVertex(); + bufferbuilder.pos(d14, 0.0D, worldborder.minZ()).tex(f3 + f11, f3 + 128.0F).endVertex(); + ++d14; + } + } + + tessellator.draw(); + bufferbuilder.setTranslation(0.0D, 0.0D, 0.0D); + GlStateManager.enableCull(); + GlStateManager.disableAlpha(); + GlStateManager.doPolygonOffset(0.0F, 0.0F); + GlStateManager.disablePolygonOffset(); + GlStateManager.enableAlpha(); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); + GlStateManager.depthMask(true); + } + } + + private void preRenderDamagedBlocks() + { + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.DST_COLOR, GlStateManager.DestFactor.SRC_COLOR, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + GlStateManager.enableBlend(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 0.5F); + // FORGE: Fix MC-234 + GlStateManager.doPolygonOffset(-1.0F, -10.0F); + GlStateManager.enablePolygonOffset(); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.enableAlpha(); + GlStateManager.pushMatrix(); + } + + private void postRenderDamagedBlocks() + { + GlStateManager.disableAlpha(); + GlStateManager.doPolygonOffset(0.0F, 0.0F); + GlStateManager.disablePolygonOffset(); + GlStateManager.enableAlpha(); + GlStateManager.depthMask(true); + GlStateManager.popMatrix(); + } + + public void drawBlockDamageTexture(Tessellator tessellatorIn, BufferBuilder bufferBuilderIn, Entity entityIn, float partialTicks) + { + double d3 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * partialTicks; + double d4 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * partialTicks; + double d5 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * partialTicks; + + if (!this.damagedBlocks.isEmpty()) + { + this.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + this.preRenderDamagedBlocks(); + bufferBuilderIn.begin(7, DefaultVertexFormats.BLOCK); + bufferBuilderIn.setTranslation(-d3, -d4, -d5); + bufferBuilderIn.noColor(); + Iterator iterator = this.damagedBlocks.values().iterator(); + + while (iterator.hasNext()) + { + DestroyBlockProgress destroyblockprogress = iterator.next(); + BlockPos blockpos = destroyblockprogress.getPosition(); + double d6 = blockpos.getX() - d3; + double d7 = blockpos.getY() - d4; + double d8 = blockpos.getZ() - d5; + Block block = this.world.getBlockState(blockpos).getBlock(); + TileEntity te = this.world.getTileEntity(blockpos); + boolean hasBreak = block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull; + if (!hasBreak) hasBreak = te != null && te.canRenderBreaking(); + + if (!hasBreak) + { + if (d6 * d6 + d7 * d7 + d8 * d8 > 1024.0D) + { + iterator.remove(); + } + else + { + IBlockState iblockstate = this.world.getBlockState(blockpos); + + if (iblockstate.getMaterial() != Material.AIR) + { + int k1 = destroyblockprogress.getPartialBlockDamage(); + TextureAtlasSprite textureatlassprite = this.destroyBlockIcons[k1]; + BlockRendererDispatcher blockrendererdispatcher = this.mc.getBlockRendererDispatcher(); + blockrendererdispatcher.renderBlockDamage(iblockstate, blockpos, textureatlassprite, this.world); + } + } + } + } + + tessellatorIn.draw(); + bufferBuilderIn.setTranslation(0.0D, 0.0D, 0.0D); + this.postRenderDamagedBlocks(); + } + } + + /** + * Draws the selection box for the player. + */ + public void drawSelectionBox(EntityPlayer player, RayTraceResult movingObjectPositionIn, int execute, float partialTicks) + { + if (execute == 0 && movingObjectPositionIn.typeOfHit == RayTraceResult.Type.BLOCK) + { + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + GlStateManager.glLineWidth(2.0F); + GlStateManager.disableTexture2D(); + GlStateManager.depthMask(false); + BlockPos blockpos = movingObjectPositionIn.getBlockPos(); + IBlockState iblockstate = this.world.getBlockState(blockpos); + + if (iblockstate.getMaterial() != Material.AIR && this.world.getWorldBorder().contains(blockpos)) + { + double d3 = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks; + double d4 = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks; + double d5 = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks; + drawSelectionBoundingBox(iblockstate.getSelectedBoundingBox(this.world, blockpos).grow(0.0020000000949949026D).offset(-d3, -d4, -d5), 0.0F, 0.0F, 0.0F, 0.4F); + } + + GlStateManager.depthMask(true); + GlStateManager.enableTexture2D(); + GlStateManager.disableBlend(); + } + } + + public static void drawSelectionBoundingBox(AxisAlignedBB box, float red, float green, float blue, float alpha) + { + drawBoundingBox(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, red, green, blue, alpha); + } + + public static void drawBoundingBox(double minX, double minY, double minZ, double maxX, double maxY, double maxZ, float red, float green, float blue, float alpha) + { + Tessellator tessellator = Tessellator.getInstance(); + BufferBuilder bufferbuilder = tessellator.getBuffer(); + bufferbuilder.begin(3, DefaultVertexFormats.POSITION_COLOR); + drawBoundingBox(bufferbuilder, minX, minY, minZ, maxX, maxY, maxZ, red, green, blue, alpha); + tessellator.draw(); + } + + public static void drawBoundingBox(BufferBuilder buffer, double minX, double minY, double minZ, double maxX, double maxY, double maxZ, float red, float green, float blue, float alpha) + { + buffer.pos(minX, minY, minZ).color(red, green, blue, 0.0F).endVertex(); + buffer.pos(minX, minY, minZ).color(red, green, blue, alpha).endVertex(); + buffer.pos(maxX, minY, minZ).color(red, green, blue, alpha).endVertex(); + buffer.pos(maxX, minY, maxZ).color(red, green, blue, alpha).endVertex(); + buffer.pos(minX, minY, maxZ).color(red, green, blue, alpha).endVertex(); + buffer.pos(minX, minY, minZ).color(red, green, blue, alpha).endVertex(); + buffer.pos(minX, maxY, minZ).color(red, green, blue, alpha).endVertex(); + buffer.pos(maxX, maxY, minZ).color(red, green, blue, alpha).endVertex(); + buffer.pos(maxX, maxY, maxZ).color(red, green, blue, alpha).endVertex(); + buffer.pos(minX, maxY, maxZ).color(red, green, blue, alpha).endVertex(); + buffer.pos(minX, maxY, minZ).color(red, green, blue, alpha).endVertex(); + buffer.pos(minX, maxY, maxZ).color(red, green, blue, 0.0F).endVertex(); + buffer.pos(minX, minY, maxZ).color(red, green, blue, alpha).endVertex(); + buffer.pos(maxX, maxY, maxZ).color(red, green, blue, 0.0F).endVertex(); + buffer.pos(maxX, minY, maxZ).color(red, green, blue, alpha).endVertex(); + buffer.pos(maxX, maxY, minZ).color(red, green, blue, 0.0F).endVertex(); + buffer.pos(maxX, minY, minZ).color(red, green, blue, alpha).endVertex(); + buffer.pos(maxX, minY, minZ).color(red, green, blue, 0.0F).endVertex(); + } + + public static void renderFilledBox(AxisAlignedBB aabb, float red, float green, float blue, float alpha) + { + renderFilledBox(aabb.minX, aabb.minY, aabb.minZ, aabb.maxX, aabb.maxY, aabb.maxZ, red, green, blue, alpha); + } + + public static void renderFilledBox(double minX, double minY, double minZ, double maxX, double maxY, double maxZ, float red, float green, float blue, float alpha) + { + Tessellator tessellator = Tessellator.getInstance(); + BufferBuilder bufferbuilder = tessellator.getBuffer(); + bufferbuilder.begin(5, DefaultVertexFormats.POSITION_COLOR); + addChainedFilledBoxVertices(bufferbuilder, minX, minY, minZ, maxX, maxY, maxZ, red, green, blue, alpha); + tessellator.draw(); + } + + public static void addChainedFilledBoxVertices(BufferBuilder builder, double p_189693_1_, double p_189693_3_, double p_189693_5_, double p_189693_7_, double p_189693_9_, double p_189693_11_, float red, float green, float blue, float alpha) + { + builder.pos(p_189693_1_, p_189693_3_, p_189693_5_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_1_, p_189693_3_, p_189693_5_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_1_, p_189693_3_, p_189693_5_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_1_, p_189693_3_, p_189693_11_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_1_, p_189693_9_, p_189693_5_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_1_, p_189693_9_, p_189693_11_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_1_, p_189693_9_, p_189693_11_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_1_, p_189693_3_, p_189693_11_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_7_, p_189693_9_, p_189693_11_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_7_, p_189693_3_, p_189693_11_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_7_, p_189693_3_, p_189693_11_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_7_, p_189693_3_, p_189693_5_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_7_, p_189693_9_, p_189693_11_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_7_, p_189693_9_, p_189693_5_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_7_, p_189693_9_, p_189693_5_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_7_, p_189693_3_, p_189693_5_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_1_, p_189693_9_, p_189693_5_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_1_, p_189693_3_, p_189693_5_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_1_, p_189693_3_, p_189693_5_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_7_, p_189693_3_, p_189693_5_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_1_, p_189693_3_, p_189693_11_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_7_, p_189693_3_, p_189693_11_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_7_, p_189693_3_, p_189693_11_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_1_, p_189693_9_, p_189693_5_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_1_, p_189693_9_, p_189693_5_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_1_, p_189693_9_, p_189693_11_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_7_, p_189693_9_, p_189693_5_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_7_, p_189693_9_, p_189693_11_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_7_, p_189693_9_, p_189693_11_).color(red, green, blue, alpha).endVertex(); + builder.pos(p_189693_7_, p_189693_9_, p_189693_11_).color(red, green, blue, alpha).endVertex(); + } + + private void markBlocksForUpdate(int minX, int minY, int minZ, int maxX, int maxY, int maxZ, boolean updateImmediately) + { + this.viewFrustum.markBlocksForUpdate(minX, minY, minZ, maxX, maxY, maxZ, updateImmediately); + } + + @Override + public void notifyBlockUpdate(World worldIn, BlockPos pos, IBlockState oldState, IBlockState newState, int flags) + { + int k1 = pos.getX(); + int l1 = pos.getY(); + int i2 = pos.getZ(); + this.markBlocksForUpdate(k1 - 1, l1 - 1, i2 - 1, k1 + 1, l1 + 1, i2 + 1, (flags & 8) != 0); + } + + @Override + public void notifyLightSet(BlockPos pos) + { + this.setLightUpdates.add(pos.toImmutable()); + } + + /** + * On the client, re-renders all blocks in this range, inclusive. On the server, does nothing. + */ + @Override + public void markBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2) + { + this.markBlocksForUpdate(x1 - 1, y1 - 1, z1 - 1, x2 + 1, y2 + 1, z2 + 1, false); + } + + @Override + public void playRecord(@Nullable SoundEvent soundIn, BlockPos pos) + { + ISound isound = this.mapSoundPositions.get(pos); + + if (isound != null) + { + this.mc.getSoundHandler().stopSound(isound); + this.mapSoundPositions.remove(pos); + } + + if (soundIn != null) + { + ItemRecord itemrecord = ItemRecord.getBySound(soundIn); + + if (itemrecord != null) + { + this.mc.ingameGUI.setRecordPlayingMessage(itemrecord.getRecordNameLocal()); + } + + ISound positionedsoundrecord = PositionedSoundRecord.getRecordSoundRecord(soundIn, pos.getX(), pos.getY(), pos.getZ()); + this.mapSoundPositions.put(pos, positionedsoundrecord); + this.mc.getSoundHandler().playSound(positionedsoundrecord); + } + + this.setPartying(this.world, pos, soundIn != null); + } + + private void setPartying(World p_193054_1_, BlockPos pos, boolean p_193054_3_) + { + for (EntityLivingBase entitylivingbase : p_193054_1_.getEntitiesWithinAABB(EntityLivingBase.class, (new AxisAlignedBB(pos)).grow(3.0D))) + { + entitylivingbase.setPartying(pos, p_193054_3_); + } + } + + @Override + public void playSoundToAllNearExcept(@Nullable EntityPlayer player, SoundEvent soundIn, SoundCategory category, double x, double y, double z, float volume, float pitch) + { + } + + @Override + public void spawnParticle(int particleID, boolean ignoreRange, double xCoord, double yCoord, double zCoord, double xSpeed, double ySpeed, double zSpeed, int... parameters) + { + this.spawnParticle(particleID, ignoreRange, false, xCoord, yCoord, zCoord, xSpeed, ySpeed, zSpeed, parameters); + } + + @Override + public void spawnParticle(int id, boolean ignoreRange, boolean p_190570_3_, final double x, final double y, final double z, double xSpeed, double ySpeed, double zSpeed, int... parameters) + { + try + { + this.spawnParticle0(id, ignoreRange, p_190570_3_, x, y, z, xSpeed, ySpeed, zSpeed, parameters); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception while adding particle"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Particle being added"); + crashreportcategory.addCrashSection("ID", Integer.valueOf(id)); + + if (parameters != null) + { + crashreportcategory.addCrashSection("Parameters", parameters); + } + + crashreportcategory.addDetail("Position", new ICrashReportDetail() + { + @Override + public String call() throws Exception + { + return CrashReportCategory.getCoordinateInfo(x, y, z); + } + }); + throw new ReportedException(crashreport); + } + } + + private void spawnParticle(EnumParticleTypes particleIn, double xCoord, double yCoord, double zCoord, double xSpeed, double ySpeed, double zSpeed, int... parameters) + { + this.spawnParticle(particleIn.getParticleID(), particleIn.getShouldIgnoreRange(), xCoord, yCoord, zCoord, xSpeed, ySpeed, zSpeed, parameters); + } + + @Nullable + private Particle spawnParticle0(int particleID, boolean ignoreRange, double xCoord, double yCoord, double zCoord, double xSpeed, double ySpeed, double zSpeed, int... parameters) + { + return this.spawnParticle0(particleID, ignoreRange, false, xCoord, yCoord, zCoord, xSpeed, ySpeed, zSpeed, parameters); + } + + @Nullable + private Particle spawnParticle0(int particleID, boolean ignoreRange, boolean minParticles, double xCoord, double yCoord, double zCoord, double xSpeed, double ySpeed, double zSpeed, int... parameters) + { + Entity entity = this.mc.getRenderViewEntity(); + + if (this.mc != null && entity != null && this.mc.effectRenderer != null) + { + int k1 = this.calculateParticleLevel(minParticles); + double d3 = entity.posX - xCoord; + double d4 = entity.posY - yCoord; + double d5 = entity.posZ - zCoord; + + if (ignoreRange) + { + return this.mc.effectRenderer.spawnEffectParticle(particleID, xCoord, yCoord, zCoord, xSpeed, ySpeed, zSpeed, parameters); + } + else if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D) + { + return null; + } + else + { + return k1 > 1 ? null : this.mc.effectRenderer.spawnEffectParticle(particleID, xCoord, yCoord, zCoord, xSpeed, ySpeed, zSpeed, parameters); + } + } + else + { + return null; + } + } + + private int calculateParticleLevel(boolean p_190572_1_) + { + int k1 = this.mc.gameSettings.particleSetting; + + if (p_190572_1_ && k1 == 2 && this.world.rand.nextInt(10) == 0) + { + k1 = 1; + } + + if (k1 == 1 && this.world.rand.nextInt(3) == 0) + { + k1 = 2; + } + + return k1; + } + + /** + * Called on all IWorldAccesses when an entity is created or loaded. On client worlds, starts downloading any + * necessary textures. On server worlds, adds the entity to the entity tracker. + */ + @Override + public void onEntityAdded(Entity entityIn) + { + } + + /** + * Called on all IWorldAccesses when an entity is unloaded or destroyed. On client worlds, releases any downloaded + * textures. On server worlds, removes the entity from the entity tracker. + */ + @Override + public void onEntityRemoved(Entity entityIn) + { + } + + /** + * Deletes all display lists + */ + public void deleteAllDisplayLists() + { + } + + @Override + public void broadcastSound(int soundID, BlockPos pos, int data) + { + switch (soundID) + { + case 1023: + case 1028: + case 1038: + Entity entity = this.mc.getRenderViewEntity(); + + if (entity != null) + { + double d3 = pos.getX() - entity.posX; + double d4 = pos.getY() - entity.posY; + double d5 = pos.getZ() - entity.posZ; + double d6 = Math.sqrt(d3 * d3 + d4 * d4 + d5 * d5); + double d7 = entity.posX; + double d8 = entity.posY; + double d9 = entity.posZ; + + if (d6 > 0.0D) + { + d7 += d3 / d6 * 2.0D; + d8 += d4 / d6 * 2.0D; + d9 += d5 / d6 * 2.0D; + } + + if (soundID == 1023) + { + this.world.playSound(d7, d8, d9, SoundEvents.ENTITY_WITHER_SPAWN, SoundCategory.HOSTILE, 1.0F, 1.0F, false); + } + else if (soundID == 1038) + { + this.world.playSound(d7, d8, d9, SoundEvents.BLOCK_END_PORTAL_SPAWN, SoundCategory.HOSTILE, 1.0F, 1.0F, false); + } + else + { + this.world.playSound(d7, d8, d9, SoundEvents.ENTITY_ENDERDRAGON_DEATH, SoundCategory.HOSTILE, 5.0F, 1.0F, false); + } + } + + default: + } + } + + @Override + public void playEvent(EntityPlayer player, int type, BlockPos blockPosIn, int data) + { + Random random = this.world.rand; + + switch (type) + { + case 1000: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_DISPENSER_DISPENSE, SoundCategory.BLOCKS, 1.0F, 1.0F, false); + break; + case 1001: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_DISPENSER_FAIL, SoundCategory.BLOCKS, 1.0F, 1.2F, false); + break; + case 1002: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_DISPENSER_LAUNCH, SoundCategory.BLOCKS, 1.0F, 1.2F, false); + break; + case 1003: + this.world.playSound(blockPosIn, SoundEvents.ENTITY_ENDEREYE_LAUNCH, SoundCategory.NEUTRAL, 1.0F, 1.2F, false); + break; + case 1004: + this.world.playSound(blockPosIn, SoundEvents.ENTITY_FIREWORK_SHOOT, SoundCategory.NEUTRAL, 1.0F, 1.2F, false); + break; + case 1005: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_IRON_DOOR_OPEN, SoundCategory.BLOCKS, 1.0F, this.world.rand.nextFloat() * 0.1F + 0.9F, false); + break; + case 1006: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_WOODEN_DOOR_OPEN, SoundCategory.BLOCKS, 1.0F, this.world.rand.nextFloat() * 0.1F + 0.9F, false); + break; + case 1007: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_WOODEN_TRAPDOOR_OPEN, SoundCategory.BLOCKS, 1.0F, this.world.rand.nextFloat() * 0.1F + 0.9F, false); + break; + case 1008: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_FENCE_GATE_OPEN, SoundCategory.BLOCKS, 1.0F, this.world.rand.nextFloat() * 0.1F + 0.9F, false); + break; + case 1009: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (random.nextFloat() - random.nextFloat()) * 0.8F, false); + break; + case 1010: + + if (Item.getItemById(data) instanceof ItemRecord) + { + this.world.playRecord(blockPosIn, ((ItemRecord)Item.getItemById(data)).getSound()); + } + else + { + this.world.playRecord(blockPosIn, (SoundEvent)null); + } + + break; + case 1011: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_IRON_DOOR_CLOSE, SoundCategory.BLOCKS, 1.0F, this.world.rand.nextFloat() * 0.1F + 0.9F, false); + break; + case 1012: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_WOODEN_DOOR_CLOSE, SoundCategory.BLOCKS, 1.0F, this.world.rand.nextFloat() * 0.1F + 0.9F, false); + break; + case 1013: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_WOODEN_TRAPDOOR_CLOSE, SoundCategory.BLOCKS, 1.0F, this.world.rand.nextFloat() * 0.1F + 0.9F, false); + break; + case 1014: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_FENCE_GATE_CLOSE, SoundCategory.BLOCKS, 1.0F, this.world.rand.nextFloat() * 0.1F + 0.9F, false); + break; + case 1015: + this.world.playSound(blockPosIn, SoundEvents.ENTITY_GHAST_WARN, SoundCategory.HOSTILE, 10.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1016: + this.world.playSound(blockPosIn, SoundEvents.ENTITY_GHAST_SHOOT, SoundCategory.HOSTILE, 10.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1017: + this.world.playSound(blockPosIn, SoundEvents.ENTITY_ENDERDRAGON_SHOOT, SoundCategory.HOSTILE, 10.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1018: + this.world.playSound(blockPosIn, SoundEvents.ENTITY_BLAZE_SHOOT, SoundCategory.HOSTILE, 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1019: + this.world.playSound(blockPosIn, SoundEvents.ENTITY_ZOMBIE_ATTACK_DOOR_WOOD, SoundCategory.HOSTILE, 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1020: + this.world.playSound(blockPosIn, SoundEvents.ENTITY_ZOMBIE_ATTACK_IRON_DOOR, SoundCategory.HOSTILE, 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1021: + this.world.playSound(blockPosIn, SoundEvents.ENTITY_ZOMBIE_BREAK_DOOR_WOOD, SoundCategory.HOSTILE, 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1022: + this.world.playSound(blockPosIn, SoundEvents.ENTITY_WITHER_BREAK_BLOCK, SoundCategory.HOSTILE, 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1024: + this.world.playSound(blockPosIn, SoundEvents.ENTITY_WITHER_SHOOT, SoundCategory.HOSTILE, 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1025: + this.world.playSound(blockPosIn, SoundEvents.ENTITY_BAT_TAKEOFF, SoundCategory.NEUTRAL, 0.05F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1026: + this.world.playSound(blockPosIn, SoundEvents.ENTITY_ZOMBIE_INFECT, SoundCategory.HOSTILE, 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1027: + this.world.playSound(blockPosIn, SoundEvents.ENTITY_ZOMBIE_VILLAGER_CONVERTED, SoundCategory.NEUTRAL, 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1029: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_ANVIL_DESTROY, SoundCategory.BLOCKS, 1.0F, this.world.rand.nextFloat() * 0.1F + 0.9F, false); + break; + case 1030: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_ANVIL_USE, SoundCategory.BLOCKS, 1.0F, this.world.rand.nextFloat() * 0.1F + 0.9F, false); + break; + case 1031: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_ANVIL_LAND, SoundCategory.BLOCKS, 0.3F, this.world.rand.nextFloat() * 0.1F + 0.9F, false); + break; + case 1032: + this.mc.getSoundHandler().playSound(PositionedSoundRecord.getMasterRecord(SoundEvents.BLOCK_PORTAL_TRAVEL, random.nextFloat() * 0.4F + 0.8F)); + break; + case 1033: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_CHORUS_FLOWER_GROW, SoundCategory.BLOCKS, 1.0F, 1.0F, false); + break; + case 1034: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_CHORUS_FLOWER_DEATH, SoundCategory.BLOCKS, 1.0F, 1.0F, false); + break; + case 1035: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_BREWING_STAND_BREW, SoundCategory.BLOCKS, 1.0F, 1.0F, false); + break; + case 1036: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_IRON_TRAPDOOR_CLOSE, SoundCategory.BLOCKS, 1.0F, this.world.rand.nextFloat() * 0.1F + 0.9F, false); + break; + case 1037: + this.world.playSound(blockPosIn, SoundEvents.BLOCK_IRON_TRAPDOOR_OPEN, SoundCategory.BLOCKS, 1.0F, this.world.rand.nextFloat() * 0.1F + 0.9F, false); + break; + case 2000: + int j2 = data % 3 - 1; + int k1 = data / 3 % 3 - 1; + double d11 = blockPosIn.getX() + j2 * 0.6D + 0.5D; + double d13 = blockPosIn.getY() + 0.5D; + double d15 = blockPosIn.getZ() + k1 * 0.6D + 0.5D; + + for (int l2 = 0; l2 < 10; ++l2) + { + double d16 = random.nextDouble() * 0.2D + 0.01D; + double d19 = d11 + j2 * 0.01D + (random.nextDouble() - 0.5D) * k1 * 0.5D; + double d22 = d13 + (random.nextDouble() - 0.5D) * 0.5D; + double d25 = d15 + k1 * 0.01D + (random.nextDouble() - 0.5D) * j2 * 0.5D; + double d27 = j2 * d16 + random.nextGaussian() * 0.01D; + double d29 = -0.03D + random.nextGaussian() * 0.01D; + double d30 = k1 * d16 + random.nextGaussian() * 0.01D; + this.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d19, d22, d25, d27, d29, d30); + } + + return; + case 2001: + Block block = Block.getBlockById(data & 4095); + + if (block.getDefaultState().getMaterial() != Material.AIR) + { + SoundType soundtype = block.getSoundType(Block.getStateById(data), world, blockPosIn, null); + this.world.playSound(blockPosIn, soundtype.getBreakSound(), SoundCategory.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F, false); + } + + this.mc.effectRenderer.addBlockDestroyEffects(blockPosIn, block.getStateFromMeta(data >> 12 & 255)); + break; + case 2002: + case 2007: + double d9 = blockPosIn.getX(); + double d10 = blockPosIn.getY(); + double d12 = blockPosIn.getZ(); + + for (int k2 = 0; k2 < 8; ++k2) + { + this.spawnParticle(EnumParticleTypes.ITEM_CRACK, d9, d10, d12, random.nextGaussian() * 0.15D, random.nextDouble() * 0.2D, random.nextGaussian() * 0.15D, Item.getIdFromItem(Items.SPLASH_POTION)); + } + + float f5 = (data >> 16 & 255) / 255.0F; + float f = (data >> 8 & 255) / 255.0F; + float f1 = (data >> 0 & 255) / 255.0F; + EnumParticleTypes enumparticletypes = type == 2007 ? EnumParticleTypes.SPELL_INSTANT : EnumParticleTypes.SPELL; + + for (int j3 = 0; j3 < 100; ++j3) + { + double d18 = random.nextDouble() * 4.0D; + double d21 = random.nextDouble() * Math.PI * 2.0D; + double d24 = Math.cos(d21) * d18; + double d26 = 0.01D + random.nextDouble() * 0.5D; + double d28 = Math.sin(d21) * d18; + Particle particle1 = this.spawnParticle0(enumparticletypes.getParticleID(), enumparticletypes.getShouldIgnoreRange(), d9 + d24 * 0.1D, d10 + 0.3D, d12 + d28 * 0.1D, d24, d26, d28); + + if (particle1 != null) + { + float f4 = 0.75F + random.nextFloat() * 0.25F; + particle1.setRBGColorF(f5 * f4, f * f4, f1 * f4); + particle1.multiplyVelocity((float)d18); + } + } + + this.world.playSound(blockPosIn, SoundEvents.ENTITY_SPLASH_POTION_BREAK, SoundCategory.NEUTRAL, 1.0F, this.world.rand.nextFloat() * 0.1F + 0.9F, false); + break; + case 2003: + double d3 = blockPosIn.getX() + 0.5D; + double d4 = blockPosIn.getY(); + double d5 = blockPosIn.getZ() + 0.5D; + + for (int l1 = 0; l1 < 8; ++l1) + { + this.spawnParticle(EnumParticleTypes.ITEM_CRACK, d3, d4, d5, random.nextGaussian() * 0.15D, random.nextDouble() * 0.2D, random.nextGaussian() * 0.15D, Item.getIdFromItem(Items.ENDER_EYE)); + } + + for (double d14 = 0.0D; d14 < (Math.PI * 2D); d14 += 0.15707963267948966D) + { + this.spawnParticle(EnumParticleTypes.PORTAL, d3 + Math.cos(d14) * 5.0D, d4 - 0.4D, d5 + Math.sin(d14) * 5.0D, Math.cos(d14) * -5.0D, 0.0D, Math.sin(d14) * -5.0D); + this.spawnParticle(EnumParticleTypes.PORTAL, d3 + Math.cos(d14) * 5.0D, d4 - 0.4D, d5 + Math.sin(d14) * 5.0D, Math.cos(d14) * -7.0D, 0.0D, Math.sin(d14) * -7.0D); + } + + return; + case 2004: + + for (int i3 = 0; i3 < 20; ++i3) + { + double d17 = blockPosIn.getX() + 0.5D + (this.world.rand.nextFloat() - 0.5D) * 2.0D; + double d20 = blockPosIn.getY() + 0.5D + (this.world.rand.nextFloat() - 0.5D) * 2.0D; + double d23 = blockPosIn.getZ() + 0.5D + (this.world.rand.nextFloat() - 0.5D) * 2.0D; + this.world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d17, d20, d23, 0.0D, 0.0D, 0.0D, new int[0]); + this.world.spawnParticle(EnumParticleTypes.FLAME, d17, d20, d23, 0.0D, 0.0D, 0.0D, new int[0]); + } + + return; + case 2005: + ItemDye.spawnBonemealParticles(this.world, blockPosIn, data); + break; + case 2006: + + for (int i2 = 0; i2 < 200; ++i2) + { + float f2 = random.nextFloat() * 4.0F; + float f3 = random.nextFloat() * ((float)Math.PI * 2F); + double d6 = MathHelper.cos(f3) * f2; + double d7 = 0.01D + random.nextDouble() * 0.5D; + double d8 = MathHelper.sin(f3) * f2; + Particle particle = this.spawnParticle0(EnumParticleTypes.DRAGON_BREATH.getParticleID(), false, blockPosIn.getX() + d6 * 0.1D, blockPosIn.getY() + 0.3D, blockPosIn.getZ() + d8 * 0.1D, d6, d7, d8); + + if (particle != null) + { + particle.multiplyVelocity(f2); + } + } + + this.world.playSound(blockPosIn, SoundEvents.ENTITY_ENDERDRAGON_FIREBALL_EPLD, SoundCategory.HOSTILE, 1.0F, this.world.rand.nextFloat() * 0.1F + 0.9F, false); + break; + case 3000: + this.world.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, true, blockPosIn.getX() + 0.5D, blockPosIn.getY() + 0.5D, blockPosIn.getZ() + 0.5D, 0.0D, 0.0D, 0.0D, new int[0]); + this.world.playSound(blockPosIn, SoundEvents.BLOCK_END_GATEWAY_SPAWN, SoundCategory.BLOCKS, 10.0F, (1.0F + (this.world.rand.nextFloat() - this.world.rand.nextFloat()) * 0.2F) * 0.7F, false); + break; + case 3001: + this.world.playSound(blockPosIn, SoundEvents.ENTITY_ENDERDRAGON_GROWL, SoundCategory.HOSTILE, 64.0F, 0.8F + this.world.rand.nextFloat() * 0.3F, false); + } + } + + @Override + public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress) + { + if (progress >= 0 && progress < 10) + { + DestroyBlockProgress destroyblockprogress = this.damagedBlocks.get(Integer.valueOf(breakerId)); + + if (destroyblockprogress == null || destroyblockprogress.getPosition().getX() != pos.getX() || destroyblockprogress.getPosition().getY() != pos.getY() || destroyblockprogress.getPosition().getZ() != pos.getZ()) + { + destroyblockprogress = new DestroyBlockProgress(breakerId, pos); + this.damagedBlocks.put(Integer.valueOf(breakerId), destroyblockprogress); + } + + destroyblockprogress.setPartialBlockDamage(progress); + destroyblockprogress.setCloudUpdateTick(this.cloudTickCounter); + } + else + { + this.damagedBlocks.remove(Integer.valueOf(breakerId)); + } + } + + public boolean hasNoChunkUpdates() + { + return this.chunksToUpdate.isEmpty() && this.renderDispatcher.hasChunkUpdates(); + } + + public void setDisplayListEntitiesDirty() + { + this.displayListEntitiesDirty = true; + } + + public void updateTileEntities(Collection tileEntitiesToRemove, Collection tileEntitiesToAdd) + { + synchronized (this.setTileEntities) + { + this.setTileEntities.removeAll(tileEntitiesToRemove); + this.setTileEntities.addAll(tileEntitiesToAdd); + } + } + + @SideOnly(Side.CLIENT) + class ContainerLocalRenderInformation + { + final RenderChunk renderChunk; + final EnumFacing facing; + byte setFacing; + final int counter; + + private ContainerLocalRenderInformation(RenderChunk renderChunkIn, EnumFacing facingIn, @Nullable int counterIn) + { + this.renderChunk = renderChunkIn; + this.facing = facingIn; + this.counter = counterIn; + } + + public void setDirection(byte p_189561_1_, EnumFacing p_189561_2_) + { + this.setFacing = (byte)(this.setFacing | p_189561_1_ | 1 << p_189561_2_.ordinal()); + } + + public boolean hasDirection(EnumFacing p_189560_1_) + { + return (this.setFacing & 1 << p_189560_1_.ordinal()) > 0; + } + } +} \ No newline at end of file diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info new file mode 100644 index 000000000..33bd657ca --- /dev/null +++ b/src/main/resources/mcmod.info @@ -0,0 +1,16 @@ +[ +{ + "modid": "lod", + "name": "LOD Mod", + "description": "Work in Progress.", + "version": "0.1", + "mcversion": "1.12.2", + "url": "", + "updateUrl": "", + "authorList": ["James Seibel"], + "credits": "TechnoVision for his modding tutorial.", + "logoFile": "", + "screenshots": [], + "dependencies": [] +} +] diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta new file mode 100644 index 000000000..401826761 --- /dev/null +++ b/src/main/resources/pack.mcmeta @@ -0,0 +1,7 @@ +{ + "pack": { + "description": "examplemod resources", + "pack_format": 3, + "_comment": "A pack_format of 3 should be used starting with Minecraft 1.11. All resources, including language files, should be lowercase (eg: en_us.lang). A pack_format of 2 will load your mod resources with LegacyV2Adapter, which requires language files to have uppercase letters (eg: en_US.lang)." + } +}