Compare commits

...
Author SHA1 Message Date
FalsePattern 818f201f30 metadata extension 2023-03-02 10:32:12 +01:00
FalsePattern b09565144f replace description 2023-03-01 22:46:34 +01:00
FalsePattern 6fe932e136 better fix for the circularity 2023-03-01 22:46:24 +01:00
FalsePattern 06c44e3cb8 aaand now you can toggle them 2023-03-01 22:39:53 +01:00
FalsePattern 7c5652879f modularize all the mixins 2023-03-01 21:36:39 +01:00
FalsePattern bbeaad3f3c update buildscript 2023-02-28 20:07:25 +01:00
FalsePattern 268a95414c begin modularization 2023-02-28 20:06:46 +01:00
FalsePattern 80e1f2754f update fplib dep 2023-02-28 20:06:18 +01:00
FalsePattern a30a223b87 extend enchantment IDs 2022-12-29 13:16:23 +01:00
FalsePattern 5bd48c168c update readme 2022-12-29 13:03:52 +01:00
FalsePattern 7381139fdf Merge pull request #81 from FalsePattern/1.4-maintenance
Merge fixes from 1.4 maintenance branch
2022-12-29 13:02:16 +01:00
FalsePattern 3c78543a82 Merge pull request #80 from FalsePattern/potion-dev
Potion ID extension
2022-12-29 13:01:51 +01:00
FalsePattern 83227b76f2 Merge pull request #79 from SirFell/potion-dev
Fix AbstractMethodError caused by Lombok naming getter differently
2022-12-29 12:56:15 +01:00
FalsePattern 8e22c69168 RWG crash fix 2022-12-29 12:53:30 +01:00
Vitaly 078cc110ff Remove Lombok annotation and make a getter manually. 2022-12-29 11:42:59 +02:00
FalsePattern 5c81a620e2 crash fix 2022-12-28 19:49:13 +01:00
FalsePattern 012fa8188c alias fix 2022-12-28 19:12:47 +01:00
FalsePattern 495c70223c the rest of the potion ID fixes 2022-12-28 14:24:09 +01:00
FalsePattern 7e97287004 0-32767 2022-12-28 12:36:04 +01:00
FalsePattern ccb2c62a89 fix vanilla potions being deleted 2022-12-28 12:35:20 +01:00
FalsePattern c65179a4b3 Merge pull request #76 from SirFell/master
Extend PotionIDs Byte -> Short
2022-12-28 12:31:59 +01:00
Vitaly d825ea3c97 Fix automatic padding to comply with codestyle 2022-12-28 13:07:29 +02:00
Vitaly 9d5d87fe81 Extend PotionIDs Byte -> Short 2022-12-28 13:04:19 +02:00
FalsePattern 8a3b75cf14 [ci skip] update publishing 2022-12-27 22:35:58 +01:00
FalsePattern 20d7738cc4 [ci skip] update publishing 2022-12-27 22:34:56 +01:00
FalsePattern 84f2bcfb0c unmodpack the dev instance 2022-12-27 22:22:32 +01:00
FalsePattern 393432e674 update license in jar 2022-12-27 22:21:57 +01:00
FalsePattern 4f1db0cba5 update lombok 2022-12-27 22:16:02 +01:00
FalsePattern be11f4475a GalaxySpace compat 2022-12-27 22:13:25 +01:00
FalsePattern 583a040800 weaken rwg mixin 2022-12-27 21:41:28 +01:00
FalsePattern 3f4a29a391 get rid of these two, already patched by the universal tweaker 2022-12-27 21:22:47 +01:00
FalsePattern 720cad2471 fix buildcraft crash in larger packs 2022-12-27 21:05:45 +01:00
FalsePattern df4caea869 update readme 2022-12-27 18:15:38 +01:00
FalsePattern b754475fb1 spread default abyssalcraft ids 2022-12-27 18:14:40 +01:00
FalsePattern 8e248c94c8 Advanced Rocketry compat (#52) 2022-12-27 18:14:27 +01:00
FalsePattern 3e8187850e RWG compat (#61) 2022-12-27 17:22:22 +01:00
FalsePattern ab4bcda4e2 Biomes O' Plenty startup crash fix (#73) 2022-12-27 17:07:15 +01:00
FalsePattern 2f15b44a85 Nomadic Tents compat (#51) 2022-12-27 16:56:49 +01:00
FalsePattern 692ab60b37 Witchery compat (#46) 2022-12-27 16:44:21 +01:00
FalsePattern e248b60c01 collapse the ID spread a bit 2022-12-27 16:17:33 +01:00
FalsePattern 05410cd423 Enderlicious compat (#48) 2022-12-27 16:16:56 +01:00
FalsePattern 3c6bd584cb Fix DataWatcher crash (#67) 2022-12-27 15:25:38 +01:00
FalsePattern 552568dd60 (UBC) make the logger shut up 2022-12-27 15:09:12 +01:00
FalsePattern 50b30383e4 update buildscript 2022-12-27 15:09:00 +01:00
FalsePattern bf6a4068cd [ci skip] Update license 2022-12-27 14:49:34 +01:00
FalsePattern 7059875c78 [ci skip] update readme 2022-09-20 00:55:34 +02:00
FalsePattern 21ee59dffe [ci skip] update publishing 2022-08-28 21:12:49 +02:00
FalsePattern 7d338264e5 [ci skip] update buildscript 2022-08-27 22:44:54 +02:00
FalsePattern 71ead0785e maven fallback code 2022-08-25 22:35:02 +02:00
FalsePattern 4aca859012 CM breaks CI, make it compileonly 2022-08-25 22:22:02 +02:00
FalsePattern ff0dce66f5 update readme 2022-08-25 22:21:39 +02:00
FalsePattern 9a3126d7f9 Random Things compat (#37) 2022-08-25 22:20:51 +02:00
FalsePattern 7ff89947ea Compact Machines compat (#38) 2022-08-25 21:49:32 +02:00
FalsePattern 39e6b70922 buildcraft compat (#40) 2022-08-25 21:32:18 +02:00
FalsePattern bbe23d663d update buildscript and fplib dep
Temporarily disable archaicfix
2022-08-25 21:10:41 +02:00
FalsePattern 5d3bb1bc77 config fixes 2022-07-24 00:41:12 +02:00
FalsePattern 69d09fc70f Implement ASM blacklist system for problematic classes 2022-07-24 00:30:06 +02:00
FalsePattern 973a178fad more Reika mods compat (fixes #26) 2022-07-23 21:39:29 +02:00
FalsePattern 4233905892 update readme 2022-07-23 20:39:21 +02:00
FalsePattern 890e04d0dc Extra Planets compat (fixes #27) 2022-07-23 20:38:36 +02:00
FalsePattern edba4b6145 add gcplanets 2022-07-23 20:36:36 +02:00
FalsePattern 595779ea21 galacticraft base ID shift 2022-07-23 20:36:19 +02:00
FalsePattern 6c78eb217e config refactoring, configurable IDs for hardcoded mods. 2022-07-23 19:53:05 +02:00
FalsePattern 2f88904515 externalize EB dep 2022-07-23 19:14:35 +02:00
FalsePattern 763aa9889a more ASM tweaks 2022-07-23 18:55:58 +02:00
FalsePattern 7ff1c55036 this is now also autopatched 2022-07-23 18:06:00 +02:00
FalsePattern 822e2688b9 improve the chunk provider patch system further 2022-07-23 18:05:48 +02:00
FalsePattern 4c6b927eb4 tweak dependencies to avoid including them in the maven metadata 2022-07-23 16:34:46 +02:00
FalsePattern c19dee3682 state machine improvements, autopatching galacticraft and derivatives 2022-07-23 16:34:11 +02:00
FalsePattern 2d93a1e080 update galacticraft link, upstream died 2022-07-23 01:30:44 +02:00
FalsePattern 5bddcb0346 Highlands compat (fixes #25) 2022-07-23 01:04:40 +02:00
FalsePattern 8e83ba76d4 reduce archaicfix spam 2022-07-23 01:04:17 +02:00
FalsePattern dd26846984 better biometweaker compat 2022-07-23 01:03:52 +02:00
FalsePattern 2268011f5d dev-only patch for fixing some mods that didn't load in dev before. 2022-07-23 00:49:56 +02:00
FalsePattern 356a980bc7 make MFQM way faster to load 2022-07-23 00:36:58 +02:00
FalsePattern c00c54e686 Enhanced Biomes compat 2022-07-22 23:31:14 +02:00
FalsePattern 1ed846b29e LOTR compat (fixes #24) 2022-07-22 21:02:45 +02:00
FalsePattern 54f216922f ModInfoGenerator back to ASM 2022-07-22 20:09:31 +02:00
FalsePattern 582a83a7a6 fix patch system again 2022-07-22 20:09:08 +02:00
FalsePattern b7d7398c04 varags 2022-07-22 20:01:29 +02:00
FalsePattern 71fb7a86a7 improve custom patching engine a bit 2022-07-22 19:57:30 +02:00
FalsePattern 31189ae9d1 fix ASM load order problems 2022-07-22 19:52:05 +02:00
FalsePattern 34a8ff7833 put explanation in javadoc 2022-07-18 21:49:58 +02:00
FalsePattern e44229300a no more atum mixins; remove it from the mod targeting system 2022-07-18 21:46:30 +02:00
FalsePattern d2cdf2f345 remove obsolete mixins 2022-07-18 21:46:15 +02:00
FalsePattern 6272dd6929 clean up the chunk provider patcher 2022-07-18 21:45:51 +02:00
FalsePattern 9ef1b8fabb when the ASM is global 2022-07-18 20:30:58 +02:00
FalsePattern 4b967882e0 move spacecore patch to mixin 2022-07-18 20:29:52 +02:00
FalsePattern 444cef7482 Biome Tweaker compat 2022-07-15 01:37:23 +02:00
FalsePattern 33af25e6fe fix mixin typo 2022-07-14 23:51:31 +02:00
FalsePattern 95f0d8d62e [ci skip] update readme 2022-07-14 23:42:17 +02:00
FalsePattern 3a271b1930 no longer need these thanks to the scattering 2022-07-14 23:27:59 +02:00
FalsePattern ad330ec622 scatter the default biome IDs a bit, should avoid some more conflicts. 2022-07-14 23:27:24 +02:00
FalsePattern 6892b59e4d more packet logic tweaks. 2022-07-14 23:26:55 +02:00
FalsePattern 0f51273d5b Netherlicious compat (fixes #21) 2022-07-14 22:58:53 +02:00
FalsePattern f1a7c548da futurepack biome ID tweak 2022-07-14 22:30:04 +02:00
FalsePattern 7d40fbef5a Dark World compat (fixes #19) 2022-07-14 22:26:08 +02:00
FalsePattern 5e024d8a0c UBC mixin crash fix (fixes #20) 2022-07-14 22:10:22 +02:00
FalsePattern fb3ac74956 mkdir do not error 2022-07-13 22:08:00 +02:00
FalsePattern 600c28edbb miscellaneous fixes to make stuff *just work* 2022-07-13 22:02:45 +02:00
FalsePattern 86f9e54251 galacticraft fixes 2022-07-13 20:57:20 +02:00
FalsePattern 322e267e48 Futurepack compat (fixes #16) 2022-07-13 20:47:09 +02:00
FalsePattern 3d834429f9 externalize patching logic a bit 2022-07-13 20:42:04 +02:00
FalsePattern 7ccf86928f prioritize upstream sources by default to reduce network load. 2022-07-13 20:15:46 +02:00
FalsePattern b721edafe0 move dependencies to mirror 2022-07-13 20:10:15 +02:00
FalsePattern 642a99ea7b Tropicraft compat (fixes #15) 2022-07-13 20:09:55 +02:00
FalsePattern 1aa130549e twilight forest conflict detector fix 2022-07-13 20:07:09 +02:00
FalsePattern 69a4c18eab AbyssalCraft compat (fixes #14) 2022-07-13 19:34:34 +02:00
FalsePattern 927eee5844 Erebus compat (fixes #13) 2022-07-13 18:26:19 +02:00
FalsePattern 4b90a090f8 Atum compat (fixes #12) 2022-07-13 17:43:30 +02:00
FalsePattern 81ad254832 dependency list cleanup 2022-07-13 17:42:56 +02:00
FalsePattern 4fa9674a0d Biome Wand compat 2022-07-12 19:56:39 +02:00
FalsePattern f4b2460ad7 [ci skip] Oops, that should be LGPL 2022-07-11 21:13:57 +02:00
FalsePattern b3c96056b2 [ci skip] Cleanup github bloat 2022-07-11 21:13:21 +02:00
170 changed files with 6288 additions and 1579 deletions

No files matched your search

-10
View File
@@ -1,10 +0,0 @@
if [ ! -z $(git diff --name-only HEAD HEAD~1 | grep build.gradle) ]; then
new_version="$(date +%s)"
sed --in-place "s!^//version:.*!//version: $new_version!g" build.gradle
git add build.gradle
git commit -m "[ci skip] update build script version to $new_version"
git push
echo "Updated buildscript version to $new_version";
else
echo "Ignored buildscript version update: no changes detected"
fi
+1 -1
View File
@@ -35,7 +35,7 @@ jobs:
- name: Run server for 1.5 minutes
run: |
mkdir run
mkdir -p run
echo "eula=true" > run/eula.txt
timeout 90 ./gradlew runServer | tee --append server.log || true
+7 -8
View File
@@ -32,8 +32,13 @@ jobs:
- name: Setup the workspace
run: ./gradlew setupCIWorkspace
- name: Build the mod
run: ./gradlew build
- name: Publish to Maven, Modrinth, and CurseForge
run: ./gradlew publish
env:
MAVEN_DEPLOY_USER: ${{ secrets.MAVEN_DEPLOY_USER }}
MAVEN_DEPLOY_PASSWORD: ${{ secrets.MAVEN_DEPLOY_PASSWORD }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
- name: Release under current tag
uses: "marvinpinto/action-automatic-releases@latest"
@@ -43,9 +48,3 @@ jobs:
prerelease: false
title: "${{ env.RELEASE_VERSION }}"
files: build/libs/*.jar
- name: Publish to maven
run: ./gradlew publish
env:
MAVEN_DEPLOY_USER: ${{ secrets.MAVEN_DEPLOY_USER }}
MAVEN_DEPLOY_PASSWORD: ${{ secrets.MAVEN_DEPLOY_PASSWORD }}
+2 -2
View File
@@ -144,6 +144,6 @@ gradle-app.setting
.classpath
# End of https://www.toptal.com/developers/gitignore/api/intellij+all,gradle,forgegradle,java
!lib/*.jar
srgmap.cfg
!lib/*.jar
srgmap.cfg
-53
View File
@@ -1,53 +0,0 @@
# Code of Merit
1. The project creators, lead developers, core team, constitute
the managing members of the project and have final say in every decision
of the project, technical or otherwise, including overruling previous decisions.
There are no limitations to this decisional power.
2. Contributions are an expected result of your membership on the project.
Don't expect others to do your work or help you with your work forever.
3. All members have the same opportunities to seek any challenge they want
within the project.
4. Authority or position in the project will be proportional
to the accrued contribution. Seniority must be earned.
5. Software is evolutive: the better implementations must supersede lesser
implementations. Technical advantage is the primary evaluation metric.
6. This is a space for technical prowess; topics outside of the project
will not be tolerated.
7. Non technical conflicts will be discussed in a separate space. Disruption
of the project will not be allowed.
8. Individual characteristics, including but not limited to,
body, sex, sexual preference, race, language, religion, nationality,
or political preferences are irrelevant in the scope of the project and
will not be taken into account concerning your value or that of your contribution
to the project.
9. Discuss or debate the idea, not the person.
10. There is no room for ambiguity: Ambiguity will be met with questioning;
further ambiguity will be met with silence. It is the responsibility
of the originator to provide requested context.
11. If something is illegal outside the scope of the project, it is illegal
in the scope of the project. This Code of Merit does not take precedence over
governing law.
12. This Code of Merit governs the technical procedures of the project not the
activities outside of it.
13. Participation on the project equates to agreement of this Code of Merit.
14. No objectives beyond the stated objectives of this project are relevant
to the project. Any intent to deviate the project from its original purpose
of existence will constitute grounds for remedial action which may include
expulsion from the project.
This document is adapted from the Code of Merit, version 1.0.
See: https://codeofmerit.org/.
-16
View File
@@ -1,16 +0,0 @@
# How to contribute
## Describe everything properly
* Make sure to properly fill out the pull request and issue templates
* Ambiguous changes with no explanation will be rejected.
## Make sure to follow existing coding conventions
The most important conventions to upkeep if you don't want your PR rejected:
* 4 spaces per indent level for code, 2 spaces per indent level for json, yaml, etc.
* Parentheses/Brackes/Braces open on the same line, not on a new line
* Method arguments are lists, not paragraphs. Either ALL arguments go on the same line, or every argument goes a SEPARATE line.
* Not everyone has an ultrawide monitor. Try to keep lines below 120 characters in length.
* Do not reformat existing code. Reformatting is done exclusively by the maintainers.
* Annotations have one parameter per line, no exceptions
* Do not pollute the repo with IDE-specific configuration files.
-165
View File
@@ -1,165 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
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 that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU 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 as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
+284 -97
View File
@@ -1,16 +1,203 @@
EndlessIDs
Copyright (C) 2022 FalsePattern
All Rights Reserved
The above copyright notice, this permission notice and the word "SNEED"
shall be included in all copies or substantial portions of the Software.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-------------------------------------------------------------------------------
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
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 that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU 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 as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
-------------------------------------------------------------------------------
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
@@ -19,35 +206,35 @@ GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
When we speak of free software, we are referring to freedom, 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
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
@@ -58,49 +245,49 @@ products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
@@ -109,18 +296,18 @@ work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
1. Source Code.
The "source code" for a work means the preferred form of the work
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
@@ -131,7 +318,7 @@ implementation is available to the public in source code form. A
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
@@ -144,16 +331,16 @@ linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
2. Basic Permissions.
All rights granted under this License are granted for the term of
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
@@ -161,7 +348,7 @@ covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
@@ -172,19 +359,19 @@ for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
@@ -192,9 +379,9 @@ modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
@@ -202,12 +389,12 @@ non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
@@ -232,7 +419,7 @@ terms of section 4, provided that you also meet all of these conditions:
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
@@ -242,9 +429,9 @@ beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
@@ -290,11 +477,11 @@ in one of these ways:
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
@@ -307,7 +494,7 @@ is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
@@ -315,7 +502,7 @@ suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
@@ -326,7 +513,7 @@ if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
@@ -334,15 +521,15 @@ network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
@@ -351,14 +538,14 @@ apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
@@ -385,7 +572,7 @@ that material) supplement the terms of this License with terms:
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
@@ -395,46 +582,46 @@ License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
8. Termination.
You may not propagate or modify a covered work except as expressly
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
@@ -443,14 +630,14 @@ modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
@@ -460,7 +647,7 @@ give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
@@ -468,13 +655,13 @@ rights granted under this License, and you may not initiate litigation
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
@@ -484,19 +671,19 @@ purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
@@ -510,7 +697,7 @@ covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
@@ -518,7 +705,7 @@ or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
@@ -533,13 +720,13 @@ for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
If 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 convey a
covered work so as to satisfy simultaneously your obligations under this
@@ -549,9 +736,9 @@ to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
@@ -560,14 +747,14 @@ but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
The Free Software Foundation may publish revised and/or new versions of
the GNU 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
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
@@ -576,19 +763,19 @@ Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
@@ -597,9 +784,9 @@ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
@@ -609,9 +796,9 @@ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
@@ -622,11 +809,11 @@ copy of the Program in return for a fee.
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
@@ -649,7 +836,7 @@ the "copyright" line and a pointer to where the full notice is found.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
@@ -661,12 +848,12 @@ The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
-14
View File
@@ -1,14 +0,0 @@
## Describe your changes
## The issue this PR is connected to (if applicable)
## What kind of PR is this?
Delete the ones that do not apply.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
## Checklist before requesting a review
- [ ] I have tested the code locally and it works
- [ ] I followed the requirements set in the contribution document
+29 -8
View File
@@ -5,32 +5,55 @@ Comparison of the known limits:
| | Vanilla | NotEnoughIDs | EndlessIDs |
|-----------------|----------------------------------------------------|--------------|----------------------------------|
| Block IDs | 4,096 | 32,000 | 16,777,216 |
| Item IDs | 32,000 | 32,000 | 16,777,216 |
| Biome IDs | 256 | 256 | 65,536 |
| Block IDs | 4,096 | 32,000 | 16,777,216 since 1.3 |
| Block Metadata | 16 | 16 | 65,536 since 1.5 |
| Item IDs | 32,000 | 32,000 | 16,777,216 since 1.3 |
| Biome IDs | 256 | 256 | 65,536 since 1.4 |
| Entity IDs | 256 | 256 | 256 right now, extension planned |
| Potion IDs | 32 | 32 | 32 right now, extension planned |
| Enchantment IDs | 256 | 256 | 256 right now, extension planned |
| Potion IDs | 32 | 32 | 65,536 since 1.5 |
| Enchantment IDs | 256 | 256 | 32,768 since 1.5 |
| Dimension IDs | Theoretically unlimited, 4,294,967,295 in practice | Same | Same |
This mod also contains patches for the following mods:
- AbyssalCraft
- Advanced Rocketry
- Alternate Terrain Generation
- Antique Atlas
- Anti ID Conflict
- ArchaicFix
- Atum
- Biomes O' Plenty
- Biome Wand
- BuildCraft
- ChromatiCraft
- Compact Machines
- CoFH Lib
- Dark World
- DragonAPI
- Dynamic Surroundings
- Enderlicious
- Enhanced Biomes
- Erebus
- Extra Planets
- Extra Utilities
- Futurepack
- GalactiCraft
- Highlands
- Immersive Cavegen
- LOTR
- More Fun Quicksand Mod
- Nature's Compass
- Netherlicious
- Nomadic Tents
- Random Things
- Realistic Terrain Generation
- Realistic World Generation
- Thaumcraft
- Tropicraft
- Twilight Forest
- Underground Biomes Constructs
- Witchery
- WorldEdit
Mods not listed here may or may not work.
@@ -48,6 +71,4 @@ If you find any crashes or incompatibilities, don't hesitate to open an issue.
## Dependencies
- [FalsePatternLib](https://github.com/FalsePattern/FalsePatternLib)
- [SpongeMixins](https://github.com/TimeConqueror/SpongeMixins)
[![POOP badge](https://raw.githubusercontent.com/gist/poop-person/991e80f390384bbeef09d208bff208f4/raw/a9ef83add84a70f2202896c2d81117ff7b169be1/poop-badge.svg)](https://gist.github.com/poop-person/991e80f390384bbeef09d208bff208f4)
- [GasStation](https://github.com/FalsePattern/GasStation)
+231 -68
View File
@@ -1,4 +1,4 @@
//version: 1656003793falsepattern29
//version: 1656003793falsepattern63
/*
DO NOT CHANGE THIS FILE!
@@ -9,6 +9,10 @@ Please check https://github.com/FalsePattern/ExampleMod1.7.10/blob/main/build.gr
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.matthewprenger.cursegradle.CurseArtifact
import com.matthewprenger.cursegradle.CurseRelation
import com.modrinth.minotaur.dependencies.ModDependency
import com.modrinth.minotaur.dependencies.VersionDependency
import org.gradle.internal.logging.text.StyledTextOutput.Style
import org.gradle.internal.logging.text.StyledTextOutputFactory
@@ -24,7 +28,7 @@ buildscript {
mavenLocal()
maven {
name = "forge"
url = "https://maven.minecraftforge.net"
url = "https://mvn.falsepattern.com/forge"
}
maven {
name = "sonatype"
@@ -36,15 +40,19 @@ buildscript {
}
maven {
name = "jitpack"
url = "https://jitpack.falsepattern.com/"
url = "https://mvn.falsepattern.com/jitpack/"
}
maven {
name = "mavenpattern"
url = "https://maven.falsepattern.com/"
url = "https://mvn.falsepattern.com/releases/"
}
maven {
name = "usrv"
url = "https://mvn.falsepattern.com/usrv/"
}
}
dependencies {
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.7'
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2.11'
classpath 'com.falsepattern:jtweaker:0.2.1'
}
}
@@ -63,6 +71,8 @@ plugins {
id 'com.palantir.git-version' version '0.13.0'
id 'de.undercouch.download' version '5.0.1'
id 'com.github.gmazzo.buildconfig' version '3.0.3' apply false
id 'com.modrinth.minotaur' version '2.+' apply false
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
}
apply plugin: 'com.falsepattern.jtweaker'
@@ -118,9 +128,17 @@ propertyDefaultIfUnset("repositoryName", "")
propertyDefaultIfUnset("mavenGroupId", "")
propertyDefaultIfUnset("mavenArtifactId", "")
propertyDefaultIfUnset("hasMixinDeps", false)
propertyDefaultIfUnset("mixinPreinitConfig", "")
propertyDefaultIfUnset("mixinConfigs", "")
propertyDefaultIfUnset("mixinPluginPreInit", "")
propertyDefaultIfUnset("mixinPluginMinimumVersion", "0.8.5")
propertyDefaultIfUnset("remapStubs", false)
propertyDefaultIfUnset("modrinthProjectId", "")
propertyDefaultIfUnset("modrinthDependencies", "")
propertyDefaultIfUnset("curseForgeProjectId", "")
propertyDefaultIfUnset("curseForgeRelations", "")
propertyDefaultIfUnset("changelog", "")
propertyDefaultIfUnset("remoteMappings", "https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/")
propertyDefaultIfUnset("mappingsChannel", "stable")
propertyDefaultIfUnset("mappingsVersion", "12")
@@ -153,8 +171,8 @@ if(accessTransformersFile) {
}
if(usesMixins.toBoolean()) {
if(mixinsPackage.isEmpty() || mixinPlugin.isEmpty()) {
throw new GradleException("\"mixinPlugin\" requires \"mixinsPackage\" and \"mixinPlugin\" to be set!")
if(mixinsPackage.isEmpty()) {
throw new GradleException("\"usesMixins\" requires \"mixinsPackage\" to be set!")
}
targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
@@ -164,12 +182,14 @@ if(usesMixins.toBoolean()) {
throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
}
String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java"
String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".scala"
String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java"
String targetFileKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".kt"
if(!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) {
throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin)
if (!mixinPlugin.isEmpty()) {
String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java"
String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".scala"
String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java"
String targetFileKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".kt"
if (!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) {
throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin)
}
}
}
@@ -237,7 +257,9 @@ minecraft {
runDir = "run"
if (replaceGradleTokenInFile) {
replaceIn replaceGradleTokenInFile
for (file in replaceGradleTokenInFile.split(',')) {
replaceIn file
}
if(gradleTokenModId) {
replace gradleTokenModId, modId
}
@@ -260,9 +282,13 @@ if(file("addon.gradle").exists()) {
apply from: 'repositories.gradle'
configurations {
implementation.extendsFrom(shadowImplementation) // TODO: remove after all uses are refactored
implementation.extendsFrom(shadowCompile)
implementation.extendsFrom(shadeCompile)
for (config in [shadowImplementation, shadowCompile, shadeCompile]) {
implementation.extendsFrom(shadeCompile)
compileClasspath.extendsFrom(config)
runtimeClasspath.extendsFrom(config)
testCompileClasspath.extendsFrom(config)
testRuntimeClasspath.extendsFrom(config)
}
}
repositories {
@@ -273,10 +299,11 @@ repositories {
if(usesMixins.toBoolean() || hasMixinDeps.toBoolean()) {
maven {
name = "sponge"
url = "https://sponge.falsepattern.com/"
url = "https://mvn.falsepattern.com/releases"
}
maven {
url = "https://jitpack.falsepattern.com/"
name = "sponge2"
url = "https://mvn.falsepattern.com/sponge"
}
}
}
@@ -286,46 +313,46 @@ dependencies {
annotationProcessor("org.ow2.asm:asm-debug-all:5.0.3")
annotationProcessor("com.google.guava:guava:24.1.1-jre")
annotationProcessor("com.google.code.gson:gson:2.8.6")
annotationProcessor("org.spongepowered:mixin:0.8-20200110.181151-15")
// using 0.8 to workaround a issue in 0.7 which fails mixin application
compile("org.spongepowered:mixin:0.7.11-20180703.121122-1") {
// Mixin includes a lot of dependencies that are too up-to-date
exclude module: "launchwrapper"
exclude module: "guava"
exclude module: "gson"
exclude module: "commons-io"
exclude module: "log4j-core"
}
compile("com.github.GTNewHorizons:SpongeMixins:1.3.3:dev")
}
if(hasMixinDeps.toBoolean()) {
runtime("org.spongepowered:mixin:0.7.11-20180703.121122-1") {
// Mixin includes a lot of dependencies that are too up-to-date
exclude module: "launchwrapper"
exclude module: "guava"
exclude module: "gson"
exclude module: "commons-io"
exclude module: "log4j-core"
}
runtime("com.github.GTNewHorizons:SpongeMixins:1.3.3:dev")
annotationProcessor("com.llamalad7:MixinExtras:0.1.1-gasstation")
annotationProcessor("org.spongepowered:mixin:0.8.5-gasstation_7")
compile("org.spongepowered:mixin:0.8.5-gasstation_7")
compile("com.llamalad7:MixinExtras:0.1.1-gasstation")
compile("com.falsepattern:00gasstation-mc1.7.10:0.5.1:dev")
runtimeClasspath('org.jetbrains:intellij-fernflower:1.2.1.16')
testRuntimeClasspath('org.jetbrains:intellij-fernflower:1.2.1.16')
} else if(hasMixinDeps.toBoolean()) {
runtime("com.llamalad7:MixinExtras:0.1.1-gasstation")
runtime("org.spongepowered:mixin:0.8.5-gasstation_7")
runtime("com.falsepattern:00gasstation-mc1.7.10:0.5.1:dev")
}
// Latest LWJGL
compile "org.lwjgl.lwjgl:lwjgl:2.9.4-nightly-20150209"
compile "org.lwjgl.lwjgl:lwjgl_util:2.9.4-nightly-20150209"
minecraftNatives "org.lwjgl.lwjgl:lwjgl-platform:2.9.4-nightly-20150209"
minecraftDeps "org.lwjgl.lwjgl:lwjgl:2.9.4-nightly-20150209"
minecraftDeps "org.lwjgl.lwjgl:lwjgl_util:2.9.4-nightly-20150209"
}
apply from: 'dependencies.gradle'
def mixinDir = new File(project.buildDir, 'mixins')
if (!mixinDir.exists()) {
mixinDir.mkdirs()
}
def mixingConfigRefMap = "mixins." + modId + ".refmap.json"
def refMap = "${tasks.compileJava.temporaryDir}" + File.separator + mixingConfigRefMap
def mixinSrg = "${tasks.reobf.temporaryDir}" + File.separator + "mixins.srg"
def srgFile = new File(project.buildDir, 'srgs/mcp-srg.srg')
def mixinSrg = new File(mixinDir, "${mixingConfigRefMap}.srg")
def mixinRefMap = new File(mixinDir, mixingConfigRefMap)
task generateAssets {
if(usesMixins.toBoolean()) {
if(usesMixins.toBoolean() && !mixinPlugin.isEmpty()) {
getFile("/src/main/resources/mixins." + modId + ".json").text = """{
"required": true,
"minVersion": "0.7.11",
"minVersion": "${mixinPluginMinimumVersion}",
"package": "${modGroup}.${mixinsPackage}",
"plugin": "${modGroup}.${mixinPlugin}",
"refmap": "${mixingConfigRefMap}",
"target": "@env(DEFAULT)",
"target": "@env(${mixinPluginPreInit.toBoolean() ? "PREINIT": "DEFAULT"})",
"compatibilityLevel": "JAVA_8"
}
@@ -383,18 +410,14 @@ reobf {
}
}
afterEvaluate {
if(usesMixins.toBoolean()) {
tasks.compileJava {
options.compilerArgs += [
"-AreobfSrgFile=${tasks.reobf.srg}",
"-AoutSrgFile=${mixinSrg}",
"-AoutRefMapFile=${refMap}",
// Elan: from what I understand they are just some linter configs so you get some warning on how to properly code
"-XDenableSunApiLintControl",
"-XDignore.symbol.file"
]
}
if(usesMixins.toBoolean()) {
tasks.compileJava {
options.compilerArgs += [
'-Xlint:-processing',
"-AreobfSrgFile=${srgFile}",
"-AoutSrgFile=${mixinSrg}",
"-AoutRefMapFile=${mixinRefMap}"
]
}
}
@@ -404,7 +427,7 @@ runClient {
if (usesMixins.toBoolean()) {
arguments += [
"--mods=../build/libs/$archivesBaseName-${version}.jar"
"--mods=" + Paths.get("$projectDir").resolve(minecraft.runDir).normalize().relativize(Paths.get("$projectDir/build/libs/$archivesBaseName-${version}.jar"))
]
}
@@ -434,7 +457,7 @@ runServer {
if (usesMixins.toBoolean()) {
arguments += [
"--mods=../build/libs/$archivesBaseName-${version}.jar"
"--mods=" + Paths.get("$projectDir").resolve(minecraft.runDir).normalize().relativize(Paths.get("$projectDir/build/libs/$archivesBaseName-${version}.jar"))
]
}
@@ -476,7 +499,7 @@ processResources {
}
if(usesMixins.toBoolean()) {
from refMap
from mixinRefMap
}
// copy everything else that's not the mcmod.info
@@ -500,9 +523,16 @@ def getManifestAttributes() {
}
if(usesMixins.toBoolean()) {
String[] configs = [];
if (!mixinPlugin.isEmpty()) {
configs += ["mixins.${modId}.json"];
}
if (!mixinConfigs.isEmpty()) {
configs += [mixinConfigs];
}
manifestAttributes += [
"TweakClass" : "org.spongepowered.asm.launch.MixinTweaker",
"MixinConfigs" : "mixins." + modId + ".json" + (mixinPreinitConfig ? "," + mixinPreinitConfig : ""),
"MixinConfigs" : String.join(",", configs),
"ForceLoadAsMod" : !containsMixinsAndOrCoreModOnly.toBoolean()
]
}
@@ -586,6 +616,14 @@ task apiJar(type: Jar) {
getArchiveClassifier().set('api')
}
task copySrgs(type: Copy, dependsOn: 'genSrgs') {
from plugins.getPlugin('forge').delayedFile('{SRG_DIR}')
include '**/*.srg'
into layout.buildDirectory.file('srgs')
}
compileJava.dependsOn(copySrgs)
artifacts {
archives sourcesJar
archives devJar
@@ -636,10 +674,12 @@ publishing {
publications {
maven(MavenPublication) {
from components.java
if(usesShadowedDependencies.toBoolean()) {
if (usesShadowedDependencies.toBoolean()) {
artifact source: shadowJar, classifier: ""
}
artifact source: sourcesJar, classifier: "sources"
if (!project.hasProperty("noPublishedSources") || !noPublishedSources) {
artifact source: sourcesJar, classifier: "sources"
}
artifact source: usesShadowedDependencies.toBoolean() ? shadowDevJar : devJar, classifier: "dev"
if (apiPackage) {
artifact source: apiJar, classifier: "api"
@@ -647,7 +687,7 @@ publishing {
groupId = mavenGroupId
artifactId = mavenArtifactId + "-mc" + minecraftVersion
version = gitVersion()
version = modVersion
// remove extra garbage from minecraft and minecraftDeps configuration
pom.withXml {
@@ -685,6 +725,122 @@ publishing {
}
}
tasks.withType(PublishToMavenRepository) { task ->
dependsOn("build")
}
publishToMavenLocal.dependsOn("build")
if (project.changelog == "") {
File changelogFile = new File(System.getenv("CHANGELOG_FILE") ?: "CHANGELOG.md")
if (changelogFile.exists()) {
project.changelog = changelogFile.getText("UTF-8")
} else {
project.changelog = "No changelog was provided."
}
}
project.changelog = project.changelog.replace("{version}", modVersion)
if (curseForgeProjectId != "" && System.getenv("CURSEFORGE_TOKEN") != null) {
apply plugin: 'com.matthewprenger.cursegradle'
curseforge {
apiKey = System.getenv("CURSEFORGE_TOKEN")
project {
id = curseForgeProjectId
changelogType = "markdown"
changelog = project.changelog
releaseType = modVersion.contains("-a") ? "alpha" : modVersion.contains("-b") ? "beta" : "release"
addGameVersion project.minecraft.version
addGameVersion "Forge"
mainArtifact(jar) {
displayName = "$modName version: $modVersion"
}
}
options {
javaIntegration = false
forgeGradleIntegration = false
}
}
if (curseForgeRelations.size() != 0) {
String[] deps = curseForgeRelations.split(";")
deps.each { dep ->
if (dep.size() == 0) {
return
}
String[] parts = dep.split(":")
String type = parts[0]
String name = parts[1]
addCurseForgeRelation(type, name)
}
}
if (usesMixins.toBoolean()) {
addCurseForgeRelation("requiredDependency", "gasstation")
}
tasks.curseforge.dependsOn(build)
tasks.publish.dependsOn(tasks.curseforge)
}
if (modrinthProjectId != "" && System.getenv("MODRINTH_TOKEN") != null) {
apply plugin: 'com.modrinth.minotaur'
modrinth {
token = System.getenv("MODRINTH_TOKEN")
projectId = modrinthProjectId
versionNumber = modVersion
versionType = modVersion.contains("-a") ? "alpha" : modVersion.contains("-b") ? "beta" : "release"
changelog = project.changelog
uploadFile = jar
gameVersions = [project.minecraft.version]
loaders = ["forge"]
}
if (modrinthDependencies.size() != 0) {
String[] deps = modrinthDependencies.split(";")
deps.each { dep ->
if (dep.size() == 0) {
return
}
String[] parts = dep.split(":")
String[] qual = parts[0].split("-")
String scope = qual[0]
String type = qual[1]
String name = parts[1]
addModrinthDep(scope, type, name)
}
}
if (usesMixins.toBoolean()) {
addModrinthDep("required", "project", "cdeAhgfp")
}
tasks.modrinth.dependsOn(build)
tasks.publish.dependsOn(tasks.modrinth)
}
def addModrinthDep(scope, type, name) {
com.modrinth.minotaur.dependencies.Dependency dep;
if (!(scope in ["required", "optional", "incompatible", "embedded"])) {
throw new Exception("Invalid modrinth dependency scope: " + scope)
}
switch (type) {
case "project":
dep = new ModDependency(name, scope)
break
case "version":
dep = new VersionDependency(name, scope)
break
default:
throw new Exception("Invalid modrinth dependency type: " + type)
}
project.modrinth.dependencies.add(dep)
}
def addCurseForgeRelation(type, name) {
if (!(type in ["requiredDependency", "embeddedLibrary", "optionalDependency", "tool", "incompatible"])) {
throw new Exception("Invalid CurseForge relation type: " + type)
}
CurseArtifact artifact = project.curseforge.curseProjects[0].mainArtifact
CurseRelation rel = (artifact.curseRelations ?: (artifact.curseRelations = new CurseRelation()))
rel."$type"(name)
}
// Updating
task updateBuildScript {
doLast {
@@ -694,7 +850,7 @@ task updateBuildScript {
}
}
if (!skipBuildScriptUpdateCheck.toBoolean() && isNewBuildScriptVersionAvailable(projectDir.toString())) {
if (!project.getGradle().startParameter.isOffline() && !skipBuildScriptUpdateCheck.toBoolean() && isNewBuildScriptVersionAvailable(projectDir.toString())) {
if (autoUpdateBuildScript.toBoolean()) {
performBuildScriptUpdate(projectDir.toString())
} else {
@@ -925,7 +1081,7 @@ def deobf(String sourceURL, String rawFileName) {
}
exec {
commandLine 'java', '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', minecraftVersion, '--mappingsVer', mappingsVer, '--notch'
commandLine Paths.get(System.getProperty("java.home"), "bin", "java").toAbsolutePath().toString(), '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', minecraftVersion, '--mappingsVer', mappingsVer, '--notch'
workingDir bon2Dir
standardOutput = new FileOutputStream("${deobfFile}.log")
}
@@ -977,6 +1133,9 @@ def checkPropertyExists(String propertyName) {
def propertyDefaultIfUnset(String propertyName, defaultValue) {
if (!project.hasProperty(propertyName)) {
System.err.println("Your gradle.properties is missing the $propertyName entry. It has been automatically set to \"$defaultValue\" as fallback. You can find all properties and their description here: https://github.com/FalsePattern/ExampleMod1.7.10/blob/main/gradle.properties")
}
if (!project.hasProperty(propertyName) || project.property(propertyName) == "") {
project.ext.setProperty(propertyName, defaultValue)
}
}
@@ -984,3 +1143,7 @@ def propertyDefaultIfUnset(String propertyName, defaultValue) {
def getFile(String relativePath) {
return new File(projectDir, relativePath)
}
if(file("addon_final.gradle").exists()) {
apply from: "addon_final.gradle"
}
+148 -23
View File
@@ -1,30 +1,155 @@
//file:noinspection DependencyNotationArgument
static def curse(curseDep) {
return "curse.maven:" + curseDep
}
def deobfCurse(curseDep) {
try {
return deobfMaven("https://cursemaven.com/", curse(curseDep))
} catch (Exception ignored) {
println("Failed to get dep " + curseDep + " from cursemaven. Grabbing from mirror.")
return deobfMaven("https://mvn.falsepattern.com/cursemaven/", curse(curseDep))
}
}
dependencies {
compileOnly("org.projectlombok:lombok:1.18.22") {
////////////////Our dependencies////////////////
compileOnly("org.projectlombok:lombok:1.18.24") {
transitive = false
}
annotationProcessor("org.projectlombok:lombok:1.18.22")
annotationProcessor("org.projectlombok:lombok:1.18.24")
compile("com.falsepattern:falsepatternlib-mc1.7.10:0.9.2:dev")
compile("com.falsepattern:falsepatternlib-mc1.7.10:0.10.15:dev")
String curseMaven = "https://cursemaven.falsepattern.com/" //Use https://cursemaven.com/ if this is down
compileOnly(deobfMaven(curseMaven, "curse.maven:undergroundbiomesconstructs-72744:2304497")) // 0.8-beta49
compileOnly(deobfMaven(curseMaven, "curse.maven:more-fun-quicksand-mod-321960:2717318")) // 1.0.8.8-fixed
compileOnly(deobfMaven(curseMaven, "curse.maven:worldedit-225608:2309699")) // 6.1.1
compile("curse.maven:cofh-lib-220333:2388748") // 1.2.1-185-dev
compileOnly(deobfMaven(curseMaven, "curse.maven:dragonapi-235591:3574508")) // V31b
////////////////Patched mods////////////////
compile(deobfMaven(curseMaven, "curse.maven:antiidconflict-246288:2308279")) // 1.3.5
compile("curse.maven:atg-228356:2231155") // 0.12.0
compile(deobfMaven(curseMaven, "curse.maven:biomesoplenty-220318:2499612")) // 2.1.0.2308
compile(deobfMaven(curseMaven, "curse.maven:rtg-237989:2521557")) // 1.1.1.7
compile(deobfMaven(curseMaven, "curse.maven:naturescompass-252848:2451823")) // 1.3.1
compile(deobfMaven(curseMaven, "curse.maven:dynamicsurrounding-238891:2642381")) // 1.0.6.4
compile(deobfMaven(curseMaven, "curse.maven:immersivecavegen-521557:3649411")) // 1.2g
compile(deobfMaven(curseMaven, "curse.maven:twilightforest-227639:3039937")) // 2.3.8
compile(deobfMaven(curseMaven, "curse.maven:thaumcraft-223628:2227552")) // 4.2.3.5
compile(deobfMaven(curseMaven, "curse.maven:baubles-227083:2224857")) // 1.0.1.10, dependency of thaumcraft
compile(deobfMaven(curseMaven, "curse.maven:antiqueatlas-227795:2454232")) // 4.4.4
compile("curse.maven:extrautilities-225561:2264384") // 1.2.12
compile("com.github.embeddedt:ArchaicFix:be8666cb2dbf2e0a8b799e88cef3c0d12e5d4911:dev")
compileOnly(deobf("https://micdoodle8.com/new-builds/GC-1.7/504/GalacticraftCore-1.7-3.0.12.504.jar"))
//AbyssalCraft 1.9.1.3-FINAL
compileOnly(deobfCurse("abyssalcraft-53686:2311135"))
//Advanced Rocketry
compileOnly(deobfCurse("advancedrocketry-236542:2985057"))
//Alternate Terrain Generation 0.12.0
compileOnly(deobfCurse("atg-228356:2231155"))
//Antique Atlas 4.4.4
compileOnly(deobfCurse("antiqueatlas-227795:2454232"))
//Anti ID Conflict 1.3.5
compileOnly(deobfCurse("antiidconflict-246288:2308279"))
// //ArchaicFix 0.2.0
// compileOnly("com.github.embeddedt:ArchaicFix:0.2.0:dev")
//Atum 0.6.77
compileOnly(deobfCurse("atum-59621:2256356"))
//Biomes O' Plenty 2.1.0.2308
compileOnly(deobfCurse("biomesoplenty-220318:2499612"))
//Biome Tweaker 2.0.182
compileOnly(deobfCurse("biometweaker-228895:2279911"))
//Biome Wand 1.1.9
//Mirrored at: https://maven.falsepattern.com/releases/mirror/mirror/1.7.10-Biome-Wand-1.1.9.jar
compileOnly(deobf("https://spacechase0.com/wp-content/uploads/2014/10/1.7.10-Biome-Wand-1.1.9.jar"))
//Buildcraft 7.1.24
compileOnly(deobfCurse("buildcraft-61811:3538651"))
//CoFH Lib 1.2.1-185
compileOnly(deobfCurse("cofh-lib-220333:2388748"))
//CompactMachines 1.21
compileOnly(deobfCurse("compactmachines-224218:2268575"))
//Dark World 0.2
compileOnly(deobfCurse("darkworld-225075:2225172"))
//DragonAPI V31b
compileOnly(deobfCurse("dragonapi-235591:3574508"))
//Dynamic Surroundings 1.0.6.4
compileOnly(deobfCurse("dynamicsurrounding-238891:2642381"))
//Enderlicious 1.1.2
compileOnly(deobfCurse("enderlicious-508777:3504111"))
//Enhanced Biomes 2.5
compileOnly(deobf("https://mvn.falsepattern.com/releases/mirror/mirror/enhancedbiomes-2.5.jar"))
//Erebus 0.4.7
compileOnly(deobfCurse("theerebus-220698:2305035"))
//Extra Planets 2.1.4
compileOnly(deobfCurse("extraplanets-241291:3214413"))
//Extra Utilities 1.2.12
compileOnly(deobfCurse("extrautilities-225561:2264384"))
//Futurepack v18.7
compileOnly(deobfCurse("futurepack-237333:2263966"))
//Galacticraft Core 3.0.12.504
//micdoodle8.com went down
compileOnly(deobf("https://mvn.falsepattern.com/releases/mirror/mirror/micdoodle/GalacticraftCore-1.7-3.0.12.504.jar"))
//Galacticraft Planets 3.0.12.504
compileOnly(deobf("https://mvn.falsepattern.com/releases/mirror/mirror/micdoodle/Galacticraft-Planets-1.7-3.0.12.504.jar"))
//Highlands 2.2.3
compileOnly(deobfCurse("highlands-221226:2227924"))
//Immersive Cavegen 1.2g
compileOnly(deobfCurse("immersivecavegen-521557:3649411"))
//LOTR Mod 36.14
compileOnly(deobfCurse("lotrmod-423748:3646430"))
//More Fun Quicksands Mod 1.0.8.8-fixed
compileOnly(deobfCurse("more-fun-quicksand-mod-321960:2717318"))
//Nature's Compass 1.3.1
compileOnly(deobfCurse("naturescompass-252848:2451823"))
//Netherlicious 3.2.3
compileOnly(deobfCurse("netherlicious-385860:3858031"))
//Nomadic Tents 1.12.1
compileOnly(deobfCurse("nomadictents-238794:2679476"))
//RandomThings 2.2.4
compileOnly(deobfCurse("randomthings-59816:2225310"))
//Realistic Terrain Generation 1.1.1.7
compileOnly(deobfCurse("rtg-237989:2521557"))
//Thaumcraft 4.2.3.5
compileOnly(deobfCurse("thaumcraft-223628:2227552"))
//Tropicraft 6.0.5
//This is from a mirror file, because the file on curseforge is a zip containing other files too.
//Source: https://www.curseforge.com/minecraft/mc-mods/tropicraft/files/2353906
compileOnly(deobf("https://mvn.falsepattern.com/releases/mirror/mirror/tropicraft-6.0.5.jar"))
//Twilight Forest 2.3.8
compileOnly(deobfCurse("twilightforest-227639:3039937"))
//Underground Biomes Constructs 0.8-beta49
compileOnly(deobfCurse("undergroundbiomesconstructs-72744:2304497"))
//Witchery 0.24.1
compileOnly(deobfCurse("witchery-69673:2234410"))
//WorldEdit 6.1.1
compileOnly(deobfCurse("worldedit-225608:2309699"))
////////////////Dependencies for patched mods////////////////
//SpaceCore 0.7.14
//needed by: Biome Wand
//Mirrored at: https://maven.falsepattern.com/releases/mirror/mirror/1.7.10-SpaceCore-0.7.14.jar
compileOnly(deobf("http://spacechase0.com/files/mcmod/1.7.10-SpaceCore-0.7.14.jar"))
}
+131 -21
View File
@@ -1,44 +1,120 @@
# Mod settings
#region mod
modName = EndlessIDs
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
modId = endlessids
# The "root package" of your mod. All of your mod classes *should* be placed under this package for simplicity.
modGroup = com.falsepattern.endlessids
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
# leave this property empty.
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
apiPackage =
# WHY is there no version field?
# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the
# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/
# However, if you really want to, you can use the VERSION environment variable to override this.
minecraftVersion = 1.7.10
forgeVersion = 10.13.4.1614
# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you
# restart Minecraft in development. Choose this dependent on your mod:
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
developmentEnvironmentUserName = Developer
#endregion mod
#
# Publishing settings
#
#region publishing
# The server to upload the artifacts to
repositoryURL = https://maven.falsepattern.com
# Note: Both the modrinth and the curseforge publications are invoked by the "publish" gradle task
# (when the respective publication's project ID is set up correctly, of course). You don't need to individually run
# each of them.
# Maven publishing
#region maven
# The maven server to upload the artifacts to
repositoryURL = https://mvn.falsepattern.com/releases
# What name is the login information inside ~/.m2/settings.xml stored under
# (see https://gist.github.com/FalsePattern/82d93e3cfab01f671cc5f4a95931cfe3 for an example)
# You can also use the MAVEN_DEPLOY_USER and MAVEN_DEPLOY_PASSWORD environment variables to set this information!
repositoryName = mavenpattern
# What the artifact should be called. These will be the "name" of the published package, suffixed with the minecraft version with a -mc prefix (groupid:artifactid-mcminecraftVersion:version:qualifier).
# What the artifact should be called. These will be the "name" of the published package, suffixed with the minecraft
# version with a -mc prefix (groupid:artifactid-mcminecraftVersion:version:qualifier).
# For instance, the default values this example ships with would turn into com.myname:mymodid-mc1.7.10:version
# The version is determined automatically from the git version.
mavenGroupId = com.falsepattern
mavenArtifactId = endlessids
#endregion maven
# Modrinth publishing
#region modrinth
# Publishing to modrinth requires you to set the MODRINTH_TOKEN environment variable to your current modrinth API token.
# The project's ID on Modrinth. Can be either the slug or the ID.
# Leave this empty if you don't want to publish on Modrinth.
modrinthProjectId = qGHY4QGo
# The project's dependencies on Modrinth. You can use this to refer to other projects on Modrinth.
# Syntax: scope1-type1:name1;scope2-type2:name2;...
# Where scope can be one of [required, optional, incompatible, embedded],
# type can be one of [project, version],
# and the name is the Modrinth project or version slug/id of the other mod.
# Example: required-project:fplib;optional-project:spongemixin1710;incompatible-project:gregtech
modrinthDependencies = required-project:fplib
#endregion modrinth
# CurseForge publishing
#region curseforge
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
# The project's numeric ID on CurseForge. You can find this in the About Project box.
# Leave this empty if you don't want to publish on CurseForge.
curseForgeProjectId = 665730
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
# Syntax: type1:name1;type2:name2;...
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
# and the name is the CurseForge project id of the other mod.
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
curseForgeRelations = requiredDependency:fplib
#endregion curseforge
# This will be inserted as the changelog text in the Modrinth/CurseForge publications.
# If the text contains "{version}", it will be replaced with the current mod version. This is useful when the changelog
# is just a URL pointing to a GitHub release tag.
# If left empty, the changelog text will be set to "No changelog URL was provided."
# Example: https://github.com/myname/mymod/releases/tag/{version}
changelog = https://github.com/FalsePattern/EndlessIDs/releases/tag/{version}
# endregion publishing
# Buildscript automatic update checker settings
#region autoupdates
# Will update your build.gradle automatically whenever an update is available
autoUpdateBuildScript = false
# Disable checking of buildscript updates.
skipBuildScriptUpdateCheck = false
minecraftVersion = 1.7.10
forgeVersion = 10.13.4.1614
#endregion autoupdates
# Select a username for testing your mod with breakpoints. You may leave this empty for a random user name each time you
# restart Minecraft in development. Choose this dependent on your mod:
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
developmentEnvironmentUserName = Developer
# Gradle token strings
#region gradletokens
# Define a source file of your project with:
# public static final String VERSION = "GRADLETOKEN_VERSION";
@@ -51,14 +127,10 @@ gradleTokenModName = GRADLETOKEN_MODNAME
gradleTokenVersion = GRADLETOKEN_VERSION
gradleTokenGroupName = GRADLETOKEN_GROUPNAME
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
# leave this property empty.
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
apiPackage =
#endregion gradletokens
# Specify the configuration file for Forge's access transformers here. I must be placed into /src/main/resources/META-INF/
# Example value: mymodid_at.cfg
accessTransformersFile =
# Mixins
#region mixins
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = true
@@ -66,14 +138,49 @@ usesMixins = true
hasMixinDeps = false
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
mixinPlugin = mixin.plugin.MixinPlugin
# Whether you want the plugin to be configured as a PREINIT mixin
mixinPluginPreInit = false
# The minimum SpongePowered Mixins version required by the plugin. Internal default is 0.8.5 (GasStation)
mixinPluginMinimumVersion =
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
mixinsPackage = mixin.mixins
# Specify a preinit mixin here. Preinit mixins should be used very rarely, if at all, so this mixin config will not be managed by the buildscript, only included.
mixinPreinitConfig =
# Specify any custom mixin .json configs here. If you have multiple, comma-separate them. If you don't want to load
# any jsons manually, leave this empty. You can use custom configs even if you already have a plugin added.
# note: mixins.<modid>.json is used by the mixinPlugin's autogenerated config. Additionally, the refmap from the mixinsPackage
# is always put into mixins.<modid>.refmap.json.
# example: mixins.foo.json,mixins.bar.json
mixinConfigs =
#endregion mixins
# Coremod and access transformers
#region core
# Specify the configuration file for Forge's access transformers here. I must be placed into /src/main/resources/META-INF/
# Example value: mymodid_at.cfg
accessTransformersFile =
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
# This parameter is for legacy compatibility only
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
coreModClass = IEPlugin
#endregion core
# Dependency deobfuscation settings (advanced)
#region ddeobf
# These 3 entries specify the location where the SRG mappings should be fetched from. Only set these if you know
# what you're doing. The defaults inside the buildscript should just work without any extra configuration.
remoteMappings =
mappingsChannel =
mappingsVersion =
#endregion ddeobf
# Miscellaneous settings
#region misc
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
containsMixinsAndOrCoreModOnly = false
@@ -91,3 +198,6 @@ remapStubs = true
# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older
# projects. New projects should not use this parameter.
#customArchiveBaseName =
#endregion misc
+3 -3
View File
@@ -3,17 +3,17 @@
repositories {
maven {
name = "cursemaven"
url = "https://cursemaven.falsepattern.com/"
url = "https://mvn.falsepattern.com/cursemaven/"
content {
includeGroup "curse.maven"
}
}
maven {
name = "mavenpattern"
url = "https://maven.falsepattern.com/"
url = "https://mvn.falsepattern.com/releases/"
}
maven {
name = "jitpack"
url = "https://jitpack.falsepattern.com/"
url = "https://mvn.falsepattern.com/jitpack/"
}
}
@@ -1,31 +1,48 @@
package com.falsepattern.endlessids;
import code.elix_x.coremods.antiidconflict.managers.BiomesManager;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.patching.CommonManager;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLConstructionEvent;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
@Mod(modid = Tags.MODID,
version = Tags.VERSION,
name = Tags.MODNAME,
acceptedMinecraftVersions = "[1.7.10]",
dependencies = "required-after:falsepatternlib@[0.9.2,);after:antiidconflict")
dependencies = "required-after:falsepatternlib@[0.10.13,);required-after:gasstation@[0.5.0,);after:antiidconflict")
public class EndlessIDs {
public static final byte[] BIOME_ARRAY_PLACEHOLDER = new byte[0];
public static final byte[] ZERO_LENGTH_BIOME_ARRAY_PLACEHOLDER = new byte[0];
public static final byte[] FAKE_BIOME_ARRAY_PLACEHOLDER = new byte[256];
public static final Logger LOG = LogManager.getLogger(Tags.MODNAME);
private static void antiIdConflictLatePatch() {
BiomesManager.conflicts = new BiomesManager.ConflictingBiomes[ExtendedConstants.biomeIDCount];
@SidedProxy(clientSide = Tags.GROUPNAME + ".patching.ClientManager",
serverSide = Tags.GROUPNAME + ".patching.ServerManager",
modId = Tags.MODID)
private static CommonManager patchManager;
@Mod.EventHandler
public void construct(FMLConstructionEvent e) {
patchManager.construct();
}
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e) {
if (Loader.isModLoaded("antiidconflict")) {
antiIdConflictLatePatch();
}
patchManager.preInit();
}
@Mod.EventHandler
public void init(FMLInitializationEvent e) {
patchManager.init();
}
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent e) {
patchManager.postInit();
}
}
@@ -1,5 +1,6 @@
package com.falsepattern.endlessids;
import com.falsepattern.endlessids.config.GeneralConfig;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
import com.falsepattern.endlessids.mixin.helpers.IExtendedBlockStorageMixin;
@@ -10,29 +11,33 @@ import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.chunk.Chunk;
import java.nio.ByteBuffer;
import java.nio.ShortBuffer;
public class Hooks {
public static byte[] getBlockData(final IExtendedBlockStorageMixin ebs) {
public static void getBlockData(final IExtendedBlockStorageMixin ebs, final byte[] data, final int offset) {
val lsb = ebs.getLSB();
val msb = ebs.getMSB();
final byte[] ret = new byte[lsb.length * 3];
ByteBuffer.wrap(ret).asShortBuffer().put(lsb);
System.arraycopy(msb, 0, ret, lsb.length * 2, lsb.length);
return ret;
Unsafer.arraycopy(lsb, 0, data, offset, lsb.length);
System.arraycopy(msb, 0, data, offset + lsb.length * 2, msb.length);
}
public static void setBlockData(final IExtendedBlockStorageMixin ebs, final byte[] data, final int offset) {
val lsb = ebs.getLSB();
val msb = ebs.getMSB();
val lsbBytes = lsb.length * 2;
ShortBuffer.wrap(ebs.getLSB()).put(ByteBuffer.wrap(data, offset, lsbBytes).asShortBuffer());
System.arraycopy(data, offset + lsbBytes, msb, 0, msb.length);
Unsafer.arraycopy(data, offset, lsb, 0, lsb.length);
System.arraycopy(data, offset + lsb.length * 2, msb, 0, msb.length);
}
public static void writeChunkToNbt(final NBTTagCompound nbt, final IExtendedBlockStorageMixin ebs) {
public static void getBlockMeta(final IExtendedBlockStorageMixin ebs, final byte[] data, final int offset) {
val meta = ebs.getMetaArray();
Unsafer.arraycopy(meta, 0, data, offset, meta.length);
}
public static void setBlockMeta(final IExtendedBlockStorageMixin ebs, final byte[] data, final int offset) {
val meta = ebs.getMetaArray();
Unsafer.arraycopy(data, offset, meta, 0, meta.length);
}
public static void writeBlockDataToNBT(final NBTTagCompound nbt, final IExtendedBlockStorageMixin ebs) {
val ebsLSB = ebs.getLSB();
val ebsMSB = ebs.getMSB();
@@ -81,7 +86,7 @@ public class Hooks {
}
}
public static void readChunkFromNbt(final IExtendedBlockStorageMixin ebs, final NBTTagCompound nbt) {
public static void readBlockDataFromNBT(final IExtendedBlockStorageMixin ebs, final NBTTagCompound nbt) {
assert nbt.hasKey("Blocks");
val byte1Data = nbt.getByteArray("Blocks");
val byte2BottomNibbleData = nbt.hasKey("Add") ? nbt.getByteArray("Add") : null;
@@ -117,7 +122,7 @@ public class Hooks {
if (id > 0) {
final Block block = (Block) Block.blockRegistry.getObjectById(id);
if (block == null) {
if (IEConfig.removeInvalidBlocks) {
if (GeneralConfig.removeInvalidBlocks) {
blkIdsLSB[off] = 0;
}
} else if (block != Blocks.air) {
@@ -134,7 +139,7 @@ public class Hooks {
public static int getIdFromBlockWithCheck(final Block block, final Block oldBlock) {
final int id = Block.getIdFromBlock(block);
if (IEConfig.catchUnregisteredBlocks && id == -1) {
if (GeneralConfig.catchUnregisteredBlocks && id == -1) {
throw new IllegalArgumentException("Block " + block +
" is not registered. <-- Say about this to the author of this mod, or you can try to enable \"RemoveInvalidBlocks\" option in EID config.");
}
@@ -147,65 +152,95 @@ public class Hooks {
throw new IllegalArgumentException("id out of range: " + id);
}
//Biome ID Extender Code
public static void shortToByteArray(short[] shortArray, int shortOffset, byte[] byteArray, int byteOffset, int shortCount) {
for (int i = 0; i < shortCount; i++) {
short s = shortArray[shortOffset + i];
byteArray[byteOffset + i * 2] = (byte)(s & 255);
byteArray[byteOffset + i * 2 + 1] = (byte)((s >>> 8) & 255);
}
}
public static void byteToShortArray(byte[] byteArray, int byteOffset, short[] shortArray, int shortOffset, int byteCount) {
for (int i = 0; i < byteCount; i++) {
byte b = byteArray[byteOffset + i];
shortArray[shortOffset + i / 2] = (short) (i % 2 == 0
? (b & 255)
: (shortArray[shortOffset + i / 2] | ((b & 255) << 8)));
}
}
public static byte[] shortToByteArray(short[] shortArray) {
byte[] byteArray = new byte[512];
for (int i = 0; i < 256; ++i) {
byteArray[i] = (byte) (shortArray[i] & 255);
byteArray[i + 256] = (byte) ((shortArray[i] >>> 8) & 255);
}
byte[] byteArray = new byte[shortArray.length * 2];
shortToByteArray(shortArray, 0, byteArray, 0, shortArray.length);
return byteArray;
}
public static short[] byteToShortArray(byte[] byteArray) {
short[] shortArray = new short[256];
short[] shortArray = new short[(byteArray.length + 1) / 2];
byteToShortArray(byteArray, 0, shortArray, 0, byteArray.length);
return shortArray;
}
public static void byteToShortArrayLegacy(byte[] byteArray, short[] shortArray) {
for (int i = 0; i < 256; ++i) {
shortArray[i] = (short) (((byteArray[i + 256] << 8) & 255) | (byteArray[i] & 255));
}
return shortArray;
}
public static short[] oldBiomeByteToNewShortArray(byte[] byteArray) {
short[] shortArray = new short[256];
for (int i = 0; i < 256; i++) {
private static void scatter(byte[] byteArray, short[] shortArray) {
for (int i = 0; i < byteArray.length; i++) {
shortArray[i] = (short) (byteArray[i] & 0xff);
}
return shortArray;
}
public static int readBiomeArrayFromPacket(Chunk chunk, byte[] array, int offset) {
byte[] byteArray = new byte[512];
System.arraycopy(array, offset, byteArray, 0, 512);
((IChunkMixin) chunk).setBiomeShortArray(byteToShortArray(byteArray));
return byteArray.length;
short[] biomeArray = ((IChunkMixin)chunk).getBiomeShortArray();
byteToShortArray(array, offset, biomeArray, 0, biomeArray.length * 2);
return biomeArray.length * 2;
}
public static int writeBiomeArrayToPacket(Chunk chunk, byte[] array, int offset) {
byte[] byteArray = shortToByteArray(((IChunkMixin) chunk).getBiomeShortArray());
System.arraycopy(byteArray, 0, array, offset, 512);
return byteArray.length;
short[] biomeArray = ((IChunkMixin)chunk).getBiomeShortArray();
shortToByteArray(biomeArray, 0, array, offset, biomeArray.length);
return biomeArray.length * 2;
}
public static void writeChunkBiomeArrayToNbt(Chunk chunk, NBTTagCompound nbt) {
byte[] byteArray = shortToByteArray(((IChunkMixin) chunk).getBiomeShortArray());
nbt.setByteArray("Biomes16", byteArray);
nbt.setByteArray("Biomes16v2", byteArray);
}
public static void readChunkBiomeArrayFromNbt(Chunk chunk, NBTTagCompound nbt) {
short[] data = null;
if (nbt.hasKey("Biomes16", 7)) {
data = byteToShortArray(nbt.getByteArray("Biomes16"));
} else if (nbt.hasKey("Biomes", 7)) {
data = oldBiomeByteToNewShortArray(nbt.getByteArray("Biomes"));
short[] data = ((IChunkMixin)chunk).getBiomeShortArray();
boolean put = false;
if (data == null) {
data = new short[16 * 16];
put = true;
}
if (data != null) {
if (nbt.hasKey("Biomes16v2", 7)) {
byteToShortArray(nbt.getByteArray("Biomes16v2"), 0, data, 0, data.length * 2);
} else if (nbt.hasKey("Biomes16", 7)) {
byteToShortArrayLegacy(nbt.getByteArray("Biomes16"), data);
} else if (nbt.hasKey("Biomes", 7)) {
scatter(nbt.getByteArray("Biomes"), data);
} else {
put = false;
}
if (put) {
((IChunkMixin) chunk).setBiomeShortArray(data);
}
}
public static void readBlockMetaFromNBT(IExtendedBlockStorageMixin instance, NBTTagCompound nbt) {
short[] data = instance.getMetaArray();
if (nbt.hasKey("Data16", 7)) {
byteToShortArray(nbt.getByteArray("Data16"), 0, data, 0, data.length * 2);
} else {
scatter(nbt.getByteArray("Data"), data);
}
}
public static void writeBlockMetaToNBT(IExtendedBlockStorageMixin instance, NBTTagCompound nbt) {
nbt.setByteArray("Data16", shortToByteArray(instance.getMetaArray()));
}
}
@@ -1,24 +0,0 @@
package com.falsepattern.endlessids;
import com.falsepattern.lib.config.Config;
@Config(modid = Tags.MODID)
public class IEConfig {
public static boolean catchUnregisteredBlocks = false;
@Config.Comment("Remove invalid (corrupted) blocks from the game.")
public static boolean removeInvalidBlocks = false;
@Config.Comment("Extend DataWatcher IDs. Vanilla limit is 31, new limit is 127.")
public static boolean extendDataWatcher = false;
@Config.Comment(
"Setting this value greater than 0 will reduce RAM usage, at the cost of less available Block IDs.\n" +
"Notice: This does not affect ITEM IDs.\n" +
"By default, block IDs can also go up to 16 Million, and each additional bit in this setting halves\n" +
"this value.\n" +
"(0: 16M, 1: 8M, 2: 4M, 3: 2M, 4: 1M, 5: 512K, 6: 256K, 7: 128K, 8: 64K, 9: 32K, 10: 16K, 11: 8K, 12: 4K)\n")
@Config.RangeInt(min = 0,
max = 12)
public static int countCorrectionBits = 0;
}
@@ -1,12 +1,12 @@
package com.falsepattern.endlessids;
import com.falsepattern.endlessids.asm.IETransformer;
import com.falsepattern.lib.config.ConfigException;
import com.falsepattern.lib.config.ConfigurationManager;
import com.falsepattern.endlessids.config.GeneralConfig;
import lombok.SneakyThrows;
import lombok.val;
import net.minecraft.launchwrapper.LaunchClassLoader;
import cpw.mods.fml.relauncher.FMLInjectionData;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
import java.util.Map;
@@ -19,16 +19,9 @@ import static cpw.mods.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions;
@MCVersion("1.7.10")
@Name(Tags.MODID)
@TransformerExclusions({"com.falsepattern.endlessids.asm"})
@TransformerExclusions({"com.falsepattern.endlessids.asm", "com.falsepattern.endlessids.config.GeneralConfig"})
@DependsOn("falsepatternlib")
public class IEPlugin implements IFMLLoadingPlugin {
static {
try {
ConfigurationManager.registerConfig(IEConfig.class);
} catch (ConfigException e) {
System.err.println("Failed to load EndlessIDs config. Using defaults.");
}
}
public IEPlugin() {
super();
@@ -51,6 +44,21 @@ public class IEPlugin implements IFMLLoadingPlugin {
}
public String getModContainerClass() {
if (GeneralConfig.extendBiome) {
FMLInjectionData.containers.add(Tags.GROUPNAME + ".containers.BiomeContainer");
}
if (GeneralConfig.extendBlockItem) {
FMLInjectionData.containers.add(Tags.GROUPNAME + ".containers.BlockItemContainer");
}
if (GeneralConfig.extendDataWatcher) {
FMLInjectionData.containers.add(Tags.GROUPNAME + ".containers.DataWatcherContainer");
}
if (GeneralConfig.extendEnchantment) {
FMLInjectionData.containers.add(Tags.GROUPNAME + ".containers.EnchantmentContainer");
}
if (GeneralConfig.extendPotion) {
FMLInjectionData.containers.add(Tags.GROUPNAME + ".containers.PotionContainer");
}
return null;
}
@@ -0,0 +1,59 @@
package com.falsepattern.endlessids;
import lombok.val;
import sun.misc.Unsafe;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.nio.ByteBuffer;
import java.nio.ShortBuffer;
public class Unsafer {
public static final Unsafe UNSAFE;
static {
Field unsafeField = null;
Unsafe unsafe = null;
for (val field: Unsafe.class.getDeclaredFields()) {
if (Modifier.isStatic(field.getModifiers()) && Modifier.isFinal(field.getModifiers()) && field.getType().equals(Unsafe.class)) {
unsafeField = field;
break;
}
}
if (unsafeField != null) {
unsafeField.setAccessible(true);
try {
unsafe = (Unsafe) unsafeField.get(null);
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
if (unsafe == null) {
UNSAFE = null;
new IllegalStateException("Could not retrieve Unsafe! Falling back to bytebuffers!").printStackTrace();
} else {
UNSAFE = unsafe;
}
}
public static void arraycopy(short[] source, int sourceOffset, byte[] target, int targetOffset, int shorts) {
if (UNSAFE != null) {
val sourceOffsetBytes = sourceOffset * 2;
val arrayOffsetSource = UNSAFE.arrayBaseOffset(source.getClass());
val arrayOffsetTarget = UNSAFE.arrayBaseOffset(target.getClass());
UNSAFE.copyMemory(source, arrayOffsetSource + sourceOffsetBytes, target, arrayOffsetTarget + targetOffset, (long)shorts << 1);
} else {
ByteBuffer.wrap(target, targetOffset, target.length - targetOffset).asShortBuffer().put(source, sourceOffset, shorts);
}
}
public static void arraycopy(byte[] source, int sourceOffset, short[] target, int targetOffset, int shorts) {
if (UNSAFE != null) {
val targetOffsetBytes = targetOffset * 2;
val arrayOffsetSource = UNSAFE.arrayBaseOffset(source.getClass());
val arrayOffsetTarget = UNSAFE.arrayBaseOffset(target.getClass());
UNSAFE.copyMemory(source, arrayOffsetSource + sourceOffset, target, arrayOffsetTarget + targetOffsetBytes, (long)shorts << 1);
} else {
ShortBuffer.wrap(target, targetOffset, target.length - targetOffset).put(ByteBuffer.wrap(source, sourceOffset, shorts * 2).asShortBuffer());
}
}
}
@@ -1,15 +1,24 @@
package com.falsepattern.endlessids.asm;
import com.falsepattern.endlessids.asm.transformer.ChunkProviderSuperPatcher;
import com.falsepattern.endlessids.asm.transformer.DragonAPIModList;
import com.falsepattern.endlessids.asm.transformer.FmlRegistry;
import com.falsepattern.endlessids.asm.transformer.SpaceCoreModInfoGenerator;
import com.falsepattern.endlessids.config.GeneralConfig;
import lombok.val;
import java.util.HashMap;
import java.util.Map;
import java.util.function.BooleanSupplier;
public enum ClassEdit {
FmlRegistry(new FmlRegistry(), new String[]{"cpw.mods.fml.common.registry.GameData",
"cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry"}),
DragonAPIModList(new DragonAPIModList(), new String[]{"Reika.DragonAPI.ModList"});
ChunkProviderSuperPatcher(new ChunkProviderSuperPatcher(), () -> GeneralConfig.extendBiome),
DragonAPIModList(new DragonAPIModList(), () -> true, "Reika.DragonAPI.ModList"),
FmlRegistry(new FmlRegistry(),
() -> GeneralConfig.extendBlockItem,
"cpw.mods.fml.common.registry.GameData",
"cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry"),
SpaceCoreModInfoGenerator(new SpaceCoreModInfoGenerator(), () -> true, "com.spacechase0.minecraft.spacecore.mcp.ModInfoGenerator");
private static final Map<String, ClassEdit> editMap;
@@ -23,15 +32,18 @@ public enum ClassEdit {
}
private final IClassNodeTransformer transformer;
private final BooleanSupplier cond;
private final String[] classNames;
ClassEdit(final IClassNodeTransformer transformer, final String[] classNames) {
ClassEdit(final IClassNodeTransformer transformer, BooleanSupplier cond, final String... classNames) {
this.transformer = transformer;
this.cond = cond;
this.classNames = classNames;
}
public static ClassEdit get(final String className) {
return ClassEdit.editMap.get(className);
val ret = ClassEdit.editMap.get(className);
return ret != null && ret.cond.getAsBoolean() ? ret : null;
}
public String getName() {
@@ -1,22 +1,30 @@
package com.falsepattern.endlessids.asm;
import com.falsepattern.endlessids.Tags;
import com.falsepattern.endlessids.asm.transformer.ChunkProviderSuperPatcher;
import com.falsepattern.endlessids.asm.transformer.DevFixer;
import lombok.val;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.util.CheckClassAdapter;
import net.minecraft.launchwrapper.IClassTransformer;
import java.util.ArrayList;
import java.util.List;
public class IETransformer implements IClassTransformer {
public static final Logger logger;
public static boolean isObfuscated;
private static final List<String> blacklist = new ArrayList<>();
static {
logger = LogManager.getLogger(Tags.MODNAME + " ASM");
blacklist.add("net.minecraft.world.chunk.storage.AnvilChunkLoader");
}
public IETransformer() {
@@ -25,37 +33,59 @@ public class IETransformer implements IClassTransformer {
public byte[] transform(final String name, final String transformedName, final byte[] bytes) {
if (bytes == null) {
return null;
}
if (blacklist.contains(transformedName)) {
return bytes;
}
final ClassEdit edit = ClassEdit.get(transformedName);
if (edit == null) {
return bytes;
ClassEdit[] edits = new ClassEdit[2];
edits[0] = ClassEdit.get(transformedName);
ClassNode cn = new ClassNode(Opcodes.ASM5);
{
val reader = new ClassReader(bytes);
reader.accept(cn, 0);
}
IETransformer.logger.debug("Patching {} with {}...", transformedName, edit.getName());
final ClassNode cn = new ClassNode(327680);
final ClassReader reader = new ClassReader(bytes);
reader.accept(cn, 0);
try {
edit.getTransformer().transform(cn, IETransformer.isObfuscated);
} catch (AsmTransformException t) {
IETransformer.logger.error("Error transforming {} with {}: {}", transformedName, edit.getName(),
t.getMessage());
throw t;
} catch (Throwable t2) {
IETransformer.logger.error("Error transforming {} with {}: {}", transformedName, edit.getName(),
t2.getMessage());
throw new RuntimeException(t2);
boolean expanded = false;
if (ChunkProviderSuperPatcher.shouldPatch(cn)) {
expanded = true;
{
cn = new ClassNode(Opcodes.ASM5);
val reader = new ClassReader(bytes);
reader.accept(cn, ClassReader.EXPAND_FRAMES);
}
if (edits[0] == null) {
edits[0] = ClassEdit.ChunkProviderSuperPatcher;
} else {
edits[1] = ClassEdit.ChunkProviderSuperPatcher;
}
}
final ClassWriter writer = new ClassWriter(0);
try {
final ClassVisitor check = new CheckClassAdapter(writer);
cn.accept(check);
} catch (Throwable t3) {
IETransformer.logger.error("Error verifying {} transformed with {}: {}", transformedName, edit.getName(),
t3.getMessage());
throw new RuntimeException(t3);
if (edits[0] == null) {
return isObfuscated ? bytes : DevFixer.fixDev(bytes);
}
IETransformer.logger.debug("Patched {} successfully.", edit.getName());
if (!isObfuscated) {
DevFixer.transform(cn);
}
for (int i = 0; i < edits.length; i++) {
val edit = edits[i];
if (edit == null) {
continue;
}
IETransformer.logger.debug("Patching {} with {}...", transformedName, edit.getName());
try {
edit.getTransformer().transform(cn, IETransformer.isObfuscated);
} catch (AsmTransformException t) {
IETransformer.logger.error("Error transforming {} with {}: {}", transformedName, edit.getName(),
t.getMessage());
throw t;
} catch (Throwable t2) {
IETransformer.logger.error("Error transforming {} with {}: {}", transformedName, edit.getName(),
t2.getMessage());
throw new RuntimeException(t2);
}
}
final ClassWriter writer = new ClassWriter(expanded ? ClassWriter.COMPUTE_FRAMES : 0);
cn.accept(writer);
IETransformer.logger.debug("Patched {} successfully.", transformedName);
return writer.toByteArray();
}
}
@@ -0,0 +1,472 @@
package com.falsepattern.endlessids.asm.transformer;
import com.falsepattern.endlessids.asm.IClassNodeTransformer;
import com.falsepattern.endlessids.asm.IETransformer;
import com.falsepattern.endlessids.config.GeneralConfig;
import lombok.Data;
import lombok.val;
import lombok.var;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldInsnNode;
import org.objectweb.asm.tree.FrameNode;
import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.JumpInsnNode;
import org.objectweb.asm.tree.LabelNode;
import org.objectweb.asm.tree.LineNumberNode;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.VarInsnNode;
import java.util.ArrayList;
import java.util.List;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Supplier;
/**
* <p>This class is the bread and butter of the patching logic from now on. It covers about 90% of cases where manual patching
* was required, and so with a heavy heart, I (finally) implemented a universal patch.</p>
*
* <pre>
* Java form:
* ...
* byte[] abyte = chunk.getBiomeArray(); //replace byte[] with short[] and getBiomeArray with getBiomeShortArray
*
* for (int k = 0; k < abyte.length; ++k) {
* //Possibility A:
* abyte[k] = (byte)abiomegenbase[k].biomeID; //from local variable //replace byte cast with short cast
*
* //Possibility B:
* abyte[k] = (byte)this.biomesToGenerate[k].biomeID; //from arbitrary field //replace byte cast with short cast
*
* //Possibility C:
* abyte[k] = (byte)SomeClass.biome.biomeID; //usually galacticraft and derivatives do this for space stations.
*
* //Possibility D:
* abyte[k] = (byte)object.biome.biomeID; //could also happen.
* }
* ...
* In ASM form:
*
* L1
* //state 0
* ALOAD chunk
* //state 1
* INVOKEVIRTUAL net/minecraft/world/chunk/Chunk.getBiomeArray ()[B //Replace with INVOKEVIRTUAL net/minecraft/world/chunk/Chunk.getBiomeShortArray ()[S
* //state 2
* ASTORE abyte
* //state 3
* L2
* //state 4
* ICONST_0
* //state 5
* ISTORE k
* //state 6
* L3
* //state 7
* FRAME <snip>
* //state 8
* ILOAD k
* //state 9
* ALOAD abyte
* //state 10
* ARRAYLENGTH
* //state 11
* IF_ICMPGE L6
* //state 12
* L4
* //state 13
* ALOAD abyte
* //state 14
* ILOAD k
*
* //Branch A | B | C | D
* //A:
* ALOAD abiomegenbase
*
* //B:
* ALOAD <something else>
* GETFIELD classname.fieldname : [Lnet/minecraft/world/biome/BiomeGenBase;
*
* //C:
* GETSTATIC classname.fieldname : Lnet/minecraft/world/biome/BiomeGenBase;
*
* //D:
* ALOAD <something else>
* GETFIELD classname.fieldname : Lnet/minecraft/world/biome/BiomeGenBase;
*
* //Join A | B
* ILOAD k
* AALOAD
*
* //Join A,B | C | D
*
* //state 15
* GETFIELD net/minecraft/world/biome/BiomeGenBase.biomeID : I
* //state 16
* I2B //Replace with I2S
* //state 17
* BASTORE //Replace with SASTORE
* //state final, matched.
* L5
* IINC k 1
* GOTO L3
* L6
* </pre>
*/
public class ChunkProviderSuperPatcher implements IClassNodeTransformer {
public static final String[] CLASS_BiomeGenBase;
public static final String[] CLASS_IChunkProvider;
public static final String[] CLASS_ChunkProviderGenerate;
public static final String[] CLASS_Chunk;
public static final String[] FIELD_biomeID;
public static final String[] METHOD_getBiomeArray;
static {
if (IETransformer.isObfuscated) {
CLASS_BiomeGenBase = new String[]{"ahu", "net/minecraft/world/biome/BiomeGenBase"};
CLASS_IChunkProvider = new String[]{"apu", "net/minecraft/world/chunk/IChunkProvider"};
CLASS_ChunkProviderGenerate = new String[]{"aqz", "net/minecraft/world/gen/ChunkProviderGenerate"};
CLASS_Chunk = new String[]{"apx", "net/minecraft/world/chunk/Chunk"};
FIELD_biomeID = new String[]{"ay", "field_76756_M"};
METHOD_getBiomeArray = new String[]{"m", "func_76605_m"};
} else {
CLASS_BiomeGenBase = new String[]{"net/minecraft/world/biome/BiomeGenBase"};
CLASS_IChunkProvider = new String[]{"net/minecraft/world/chunk/IChunkProvider"};
CLASS_ChunkProviderGenerate = new String[]{"net/minecraft/world/gen/ChunkProviderGenerate"};
CLASS_Chunk = new String[]{"net/minecraft/world/chunk/Chunk"};
FIELD_biomeID = new String[]{"biomeID"};
METHOD_getBiomeArray = new String[]{"getBiomeArray"};
}
}
public static boolean shouldPatch(final ClassNode cn) {
if (!GeneralConfig.extendBiome) {
return false;
}
for (MethodNode method : cn.methods) {
if (scanForBrokenCall(method)) {
return true;
}
}
return false;
}
private static boolean scanForBrokenCall(MethodNode method) {
val instructions = method.instructions;
val insnCount = instructions.size();
for (int i = 0; i < insnCount; i++) {
val insn = instructions.get(i);
if (insn.getOpcode() != Opcodes.INVOKEVIRTUAL) {
continue;
}
val invoke = (MethodInsnNode) insn;
if (anyMatch(invoke.owner, CLASS_Chunk) &&
anyMatch(invoke.name, METHOD_getBiomeArray) &&
invoke.desc.equals("()[B")) {
return true;
}
}
return false;
}
private static boolean anyMatch(List<String> str, String[] candidates) {
for (val s: str) {
for (val candidate: candidates) {
if (s.equals(candidate)) {
return true;
}
}
}
return false;
}
private static boolean anyMatch(String str, String[] candidates) {
for (val candidate: candidates) {
if (str.equals(candidate)) {
return true;
}
}
return false;
}
private static boolean anyMatch(String str, String[] candidates, String prefix, String suffix) {
for (val candidate: candidates) {
if (str.equals(prefix + candidate + suffix)) {
return true;
}
}
return false;
}
public interface State<T extends AbstractInsnNode> extends BiFunction<T, Memory, State<AbstractInsnNode>> {}
private static State<AbstractInsnNode> STATE0 = null;
private static State<AbstractInsnNode> STATE1 = null;
private static State<AbstractInsnNode> STATE2 = null;
private static State<AbstractInsnNode> STATE3 = null;
private static State<AbstractInsnNode> STATE4 = null;
private static State<AbstractInsnNode> STATE5 = null;
private static State<AbstractInsnNode> STATE6 = null;
private static State<AbstractInsnNode> STATE7 = null;
private static State<AbstractInsnNode> STATE8 = null;
private static State<AbstractInsnNode> STATE9 = null;
private static State<AbstractInsnNode> STATE10 = null;
private static State<AbstractInsnNode> STATE11 = null;
private static State<AbstractInsnNode> STATE12 = null;
private static State<AbstractInsnNode> STATE13 = null;
private static State<AbstractInsnNode> STATE14 = null;
private static State<AbstractInsnNode> STATE14_ABD1 = null;
private static State<AbstractInsnNode> STATE14_ABD1_BD1 = null;
private static State<AbstractInsnNode> STATE14_ABD1_BA2 = null;
private static State<AbstractInsnNode> STATE14_ABD1_BA3 = null;
private static State<AbstractInsnNode> STATE14_C1 = null;
private static State<AbstractInsnNode> STATE15 = null;
private static State<AbstractInsnNode> STATE16 = null;
private static State<AbstractInsnNode> STATE17 = null;
private static State<AbstractInsnNode> STATE_FINAL = null;
static {
STATE_FINAL = (insn, memory) -> STATE_FINAL;
STATE0 = casting(VarInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.ALOAD) {
memory.chunkIndex = insn.var;
memory.startingInsn = memory.currentInsn;
return STATE1;
}
return STATE0;
});
STATE1 = casting(MethodInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.INVOKEVIRTUAL &&
anyMatch(insn.owner, CLASS_Chunk) &&
anyMatch(insn.name, METHOD_getBiomeArray) &&
insn.desc.equals("()[B")) {
memory.getBiomeArrayInsn = memory.currentInsn;
return STATE2;
}
return STATE0;
});
STATE2 = casting(VarInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.ASTORE) {
memory.biomeArrayIndex = insn.var;
return STATE3;
}
return STATE0;
});
STATE3 = typeCheck(LabelNode.class, () -> STATE4);
STATE4 = casting(InsnNode.class, (insn) ->
insn.getOpcode() == Opcodes.ICONST_0
? STATE5 : STATE0);
STATE5 = casting(VarInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.ISTORE) {
memory.iteratorIndex = insn.var;
return STATE6;
}
return STATE0;
});
STATE6 = typeCheck(LabelNode.class, () -> STATE7);
STATE7 = casting(FrameNode.class, (insn, memory) ->
anyMatch((String)memory.locals.get(memory.chunkIndex), CLASS_Chunk) &&
memory.locals.get(memory.biomeArrayIndex).equals("[B") &&
memory.locals.get(memory.iteratorIndex).equals(1)
? STATE8 : STATE0);
STATE8 = casting(VarInsnNode.class, (insn, memory) ->
insn.getOpcode() == Opcodes.ILOAD &&
insn.var == memory.iteratorIndex
? STATE9 : STATE0);
STATE9 = casting(VarInsnNode.class, (insn, memory) ->
insn.getOpcode() == Opcodes.ALOAD
&& insn.var == memory.biomeArrayIndex
? STATE10 : STATE0);
STATE10 = casting(InsnNode.class, (insn) ->
insn.getOpcode() == Opcodes.ARRAYLENGTH
? STATE11 : STATE0);
STATE11 = casting(JumpInsnNode.class, (insn) ->
insn.getOpcode() == Opcodes.IF_ICMPGE
? STATE12 : STATE0);
STATE12 = typeCheck(LabelNode.class, () -> STATE13);
STATE13 = casting(VarInsnNode.class, (insn, memory) ->
insn.getOpcode() == Opcodes.ALOAD &&
insn.var == memory.biomeArrayIndex
? STATE14 : STATE0);
STATE14 = casting(VarInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.ILOAD &&
insn.var == memory.iteratorIndex) {
if (insn.getNext() instanceof FieldInsnNode) {
return STATE14_C1;
} else {
return STATE14_ABD1;
}
}
return STATE0;
});
STATE14_ABD1 = casting(VarInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.ALOAD) {
if (anyMatch((String)memory.locals.get(insn.var), CLASS_BiomeGenBase, "[L", ";")) {
return STATE14_ABD1_BA2;
} else {
return STATE14_ABD1_BD1;
}
}
return STATE0;
});
STATE14_ABD1_BD1 = casting(FieldInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.GETFIELD) {
if (anyMatch(insn.desc, CLASS_BiomeGenBase, "[L", ";")) {
return STATE14_ABD1_BA2;
} else if (anyMatch(insn.desc, CLASS_BiomeGenBase, "L", ";")) {
return STATE15;
}
}
return STATE0;
});
STATE14_ABD1_BA2 = casting(VarInsnNode.class, (insn, memory) ->
insn.getOpcode() == Opcodes.ILOAD &&
insn.var == memory.iteratorIndex
? STATE14_ABD1_BA3 : STATE0);
STATE14_ABD1_BA3 = casting(InsnNode.class, (insn) ->
insn.getOpcode() == Opcodes.AALOAD
? STATE15 : STATE0);
STATE14_C1 = casting(FieldInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.GETSTATIC &&
anyMatch(insn.desc, CLASS_BiomeGenBase, "L", ";")) {
return STATE15;
}
return STATE0;
});
STATE15 = casting(FieldInsnNode.class, (insn) ->
insn.getOpcode() == Opcodes.GETFIELD &&
anyMatch(insn.owner, CLASS_BiomeGenBase) &&
anyMatch(insn.name, FIELD_biomeID) &
insn.desc.equals("I")
? STATE16 : STATE0);
STATE16 = casting(InsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.I2B) {
memory.castInsn = memory.currentInsn;
return STATE17;
}
return STATE0;
});
STATE17 = casting(InsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.BASTORE) {
memory.arrayStoreInsn = memory.currentInsn;
return STATE_FINAL;
}
return STATE0;
});
}
private static <T extends AbstractInsnNode> State<AbstractInsnNode> typeCheck(Class<T> clazz, Supplier<State<AbstractInsnNode>> okState) {
return casting(clazz, (insn, memory) -> okState.get());
}
private static <T extends AbstractInsnNode> State<AbstractInsnNode> casting(Class<T> clazz, Function<T, State<AbstractInsnNode>> okState) {
return casting(clazz, (insn, memory) -> okState.apply(insn));
}
private static <T extends AbstractInsnNode> State<AbstractInsnNode> casting(Class<T> clazz, State<T> okState) {
return (insn, memory) -> {
if (insn instanceof LineNumberNode) {
return null;
} else if (clazz.isInstance(insn)) {
return okState.apply(clazz.cast(insn), memory);
} else {
return STATE0;
}
};
}
@Override
public void transform(final ClassNode cn, final boolean obfuscated) {
boolean patched = false;
for (val method: cn.methods) {
val memory = findTheTarget(method);
if (memory != null) {
patched = true;
IETransformer.logger.debug("[ChunkProvider patcher]: Match found in method " + method.name);
val insnList = method.instructions;
for (val node: method.localVariables) {
if (node.desc.equals("[B") && node.index == memory.biomeArrayIndex) {
node.desc = "[S";
}
}
val getBiomeArray = (MethodInsnNode) insnList.get(memory.getBiomeArrayInsn);
insnList.set(getBiomeArray, new MethodInsnNode(Opcodes.INVOKEVIRTUAL, getBiomeArray.owner, "getBiomeShortArray", "()[S", false));
insnList.set(insnList.get(memory.castInsn), new InsnNode(Opcodes.I2S));
insnList.set(insnList.get(memory.arrayStoreInsn), new InsnNode(Opcodes.SASTORE));
}
}
if (!patched) {
IETransformer.logger.debug("[ChunkProvider patcher]: No matches found in class! This is not explicitly " +
"an error, because the patch might be applied by a mixin instead!");
}
}
private static Memory findTheTarget(MethodNode method) {
val insnList = method.instructions;
var currentState = STATE0;
val memory = new Memory();
for (int insnIndex = 0; insnIndex < insnList.size(); insnIndex++) {
memory.currentInsn = insnIndex;
val insn = insnList.get(insnIndex);
if (insn instanceof FrameNode) {
val frame = (FrameNode) insn;
if (frame.type == Opcodes.F_NEW) {
memory.locals.clear();
memory.locals.addAll(frame.local);
}
}
val newState = currentState.apply(insn, memory);
if (newState != null) {
if (newState == STATE_FINAL) {
return memory;
}
currentState = newState;
}
}
return null;
}
@Data
private static class Memory {
int currentInsn;
int startingInsn;
int getBiomeArrayInsn;
int castInsn;
int arrayStoreInsn;
int chunkIndex;
int biomeArrayIndex;
int iteratorIndex;
final List<Object> locals = new ArrayList<>();
}
}
@@ -0,0 +1,94 @@
package com.falsepattern.endlessids.asm.transformer;
import com.falsepattern.endlessids.asm.ClassEdit;
import com.falsepattern.endlessids.asm.IClassNodeTransformer;
import com.falsepattern.endlessids.asm.IETransformer;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.SneakyThrows;
import lombok.val;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldInsnNode;
import org.objectweb.asm.util.CheckClassAdapter;
import net.minecraft.launchwrapper.Launch;
import java.io.IOException;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class DevFixer {
private static final ClassNode blocks;
static {
if (IETransformer.isObfuscated) {
blocks = null;
} else {
try {
byte[] blox = Launch.classLoader.getClassBytes("net/minecraft/init/Blocks");
blocks = new ClassNode(Opcodes.ASM5);
final ClassReader reader = new ClassReader(blox);
reader.accept(blocks, 0);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
public static byte[] fixDev(byte[] classBytes) {
if (IETransformer.isObfuscated) {
return classBytes;
}
val cn = new ClassNode(Opcodes.ASM5);
val reader = new ClassReader(classBytes);
reader.accept(cn, 0);
transform(cn);
val writer = new ClassWriter(0);
val check = new CheckClassAdapter(writer);
cn.accept(check);
return writer.toByteArray();
}
@SneakyThrows
public static void transform(final ClassNode cn) {
if (IETransformer.isObfuscated) {
return;
}
remapBlocks(cn);
if (cn.name.equals("net/minecraft/world/biome/BiomeGenBase")) {
biomeTweakerCompat(cn);
}
}
private static void biomeTweakerCompat(final ClassNode cn) {
for (val field: cn.fields) {
if (field.name.startsWith("spawnable")) {
field.access &= ~Opcodes.ACC_PROTECTED;
field.access |= Opcodes.ACC_PUBLIC;
}
}
}
private static void remapBlocks(final ClassNode cn) {
for (val method: cn.methods) {
val instructions = method.instructions;
int insnCount = instructions.size();
for (int i = 0; i < insnCount; i++) {
val insn = instructions.get(i);
if (insn instanceof FieldInsnNode) {
val field = (FieldInsnNode) insn;
if (field.getOpcode() == Opcodes.GETSTATIC &&
field.owner.equals("net/minecraft/init/Blocks")) {
for (val blockField: blocks.fields) {
if (blockField.name.equals(field.name) &&
!blockField.desc.equals(field.desc)) {
field.desc = blockField.desc;
}
}
}
}
}
}
}
}
@@ -0,0 +1,22 @@
package com.falsepattern.endlessids.asm.transformer;
import com.falsepattern.endlessids.asm.IClassNodeTransformer;
import lombok.val;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.InsnNode;
public class SpaceCoreModInfoGenerator implements IClassNodeTransformer {
@Override
public void transform(final ClassNode cn, final boolean obfuscated) {
if (obfuscated) {
return;
}
for (val method: cn.methods) {
if (method.name.equals("generate")) {
val iterator = method.instructions.iterator();
iterator.add(new InsnNode(Opcodes.RETURN));
}
}
}
}
@@ -0,0 +1,49 @@
package com.falsepattern.endlessids.config;
import com.falsepattern.endlessids.Tags;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.lib.config.Config;
import com.falsepattern.lib.config.ConfigurationManager;
@Config(modid = Tags.MODID, category = "darkworld")
public class DarkWorldIDConfig {
static {
ConfigurationManager.selfInit();
}
@Config.Comment("Original: 100")
@Config.RangeInt(min = 40, max = ExtendedConstants.biomeIDCount - 1)
@Config.DefaultInt(1100)
public static int darkOceanID;
@Config.Comment("Original: 101")
@Config.RangeInt(min = 40, max = ExtendedConstants.biomeIDCount - 1)
@Config.DefaultInt(1101)
public static int darkPlainsID;
@Config.Comment("Original: 102")
@Config.RangeInt(min = 40, max = ExtendedConstants.biomeIDCount - 1)
@Config.DefaultInt(1102)
public static int darkDesertID;
@Config.Comment("Original: 103")
@Config.RangeInt(min = 40, max = ExtendedConstants.biomeIDCount - 1)
@Config.DefaultInt(1103)
public static int darkHillsID;
@Config.Comment("Original: 104")
@Config.RangeInt(min = 40, max = ExtendedConstants.biomeIDCount - 1)
@Config.DefaultInt(1104)
public static int darkForestID;
@Config.Comment("Original: 105")
@Config.RangeInt(min = 40, max = ExtendedConstants.biomeIDCount - 1)
@Config.DefaultInt(1105)
public static int darkTaigaID;
@Config.Comment("Original: 106")
@Config.RangeInt(min = 40, max = ExtendedConstants.biomeIDCount - 1)
@Config.DefaultInt(1106)
public static int darkSwampID;
}
@@ -0,0 +1,17 @@
package com.falsepattern.endlessids.config;
import com.falsepattern.endlessids.Tags;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.lib.config.Config;
import com.falsepattern.lib.config.ConfigurationManager;
@Config(modid = Tags.MODID, category = "futurepack")
public class FuturepackIDConfig {
static {
ConfigurationManager.selfInit();
}
@Config.Comment("Original: 97")
@Config.RangeInt(min = 40, max = ExtendedConstants.biomeIDCount - 1)
@Config.DefaultInt(2097)
public static int spaceID;
}
@@ -0,0 +1,77 @@
package com.falsepattern.endlessids.config;
import com.falsepattern.endlessids.Tags;
import com.falsepattern.lib.config.Config;
import com.falsepattern.lib.config.ConfigurationManager;
@Config(modid = Tags.MODID)
public class GeneralConfig {
static {
ConfigurationManager.selfInit();
}
@Config.Comment("WARNING: THIS CONFIG IS EXTREMELY SENSITIVE TO CHANGES, DISABLING STUFF ONCE THEY HAVE BEEN ENABLED\n" +
"CAN CORRUPT YOUR WORLD! ONLY TOUCH THIS FILE IF YOU KNOW WHAT YOU'RE DOING!\n" +
"This file should only be edited by modpack developers to finetune it for the modpack. Once an option\n" +
"has been enabled, it modifies the chunk save data format, which is (partially) compatible with\n" +
"vanilla, but removing the mod might cause block/item corruption for higher IDs.\n" +
"Additional note: Every client and server must have the exact same config, this also affects netcode.")
@Config.DefaultString("")
public static String __NOTICE__;
@Config.Comment("Throw an exception when an invalid block is registered. FOR DEBUGGING PURPOSES")
@Config.DefaultBoolean(false)
public static boolean catchUnregisteredBlocks;
@Config.Comment("Remove invalid (corrupted) blocks from the game. FOR DEBUGGING PURPOSES")
@Config.DefaultBoolean(false)
public static boolean removeInvalidBlocks;
@Config.Comment("Extend Biome IDs. Vanilla limit is 256, new limit is 65536.")
@Config.DefaultBoolean(true)
public static boolean extendBiome;
@Config.Comment("Extend Block and Item IDs. Vanilla limit is 4096/32000, new limit is 16777216 for both.\n" +
"See also: countCorrectionBits")
@Config.DefaultBoolean(true)
public static boolean extendBlockItem;
@Config.Comment("Extend DataWatcher IDs. Vanilla limit is 31, new limit is 127.\n" +
"Disabled by default because of uncertain/weak implementation (taken from NotEnoughIDs)")
@Config.DefaultBoolean(false)
public static boolean extendDataWatcher;
@Config.Comment("Extend Enchantment IDs. Vanilla limit is 256, new limit is 32768.")
@Config.DefaultBoolean(true)
public static boolean extendEnchantment;
@Config.Comment("Extend Potion IDs. Vanilla limit is 32, new limit is 65536.")
@Config.DefaultBoolean(true)
public static boolean extendPotion;
@Config.Comment("Extends the maximum redstone signal strength.\n" +
"Only has effect with extendBlockItem enabled.\n" +
"WARNING: THIS IS HERE ONLY FOR FUN, IT WILL DEFINITELY CORRUPT YOUR WORLD!")
@Config.DefaultBoolean(false)
public static boolean extendRedstone;
@Config.Comment("Increases the max signal strength of redstone.\n" +
"Only has effect with both extendBlockItem and extendRedstone enabled.\n" +
"Vanilla value is 15.")
@Config.RangeInt(min = 15,
max = 127)
@Config.DefaultInt(15)
public static int maxRedstone;
@Config.Comment(
"Use this to tune the amount of available block IDs.\n" +
"Minecraft contains some internal code that uses a HUGE amount of RAM with too many block IDs available.\n" +
"Notice: This does not affect ITEM IDs.\n" +
"The vanilla default is 4k block IDs, while the maximum is 16 million.\n" +
"The default setting sets it to 4k (vanilla).\n" +
"increase if necessary (when running out of BLOCK IDs in your modpack)\n" +
"Only effective if extendBlockItem is enabled.\n" +
"(0: 16M, 1: 8M, 2: 4M, 3: 2M, 4: 1M, 5: 512K, 6: 256K, 7: 128K, 8: 64K, 9: 32K, 10: 16K, 11: 8K, 12: 4K)\n")
@Config.RangeInt(min = 0,
max = 12)
@Config.DefaultInt(12)
public static int countCorrectionBits;
}
@@ -1,16 +1,19 @@
package com.falsepattern.endlessids.constants;
import com.falsepattern.endlessids.IEConfig;
import com.falsepattern.endlessids.config.GeneralConfig;
public class ExtendedConstants {
//Tunables
public static final int bitsPerID = 24;
public static final int bitsPerMetadata = 4;
public static final int countCorrectionBits = IEConfig.countCorrectionBits;
public static final int bitsPerMetadata = 16;
public static final int countCorrectionBits = GeneralConfig.countCorrectionBits;
public static final int watchableBits = 7;
public static final int bitsPerBiome = 16;
public static final int maximumPotionIDs = 65536;
public static final int maximumEnchantmentIDs = 32768;
//BlockItemIDs
public static final int nibblesPerID = bitsPerID / 4;
public static final int bytesPerID = (nibblesPerID + 1) / 2;
@@ -31,10 +34,14 @@ public class ExtendedConstants {
public static final int biomeIDMask = biomeIDCount - 1;
public static final int biomeIDNull = biomeIDMask;
public static final int bytesPerBiome = (bitsPerBiome + 7) / 8;
//Chunk
public static final int bytesPerChunk = bytesPerBiome * 256 + bytesPerEBS * 16;
//DataWatcher
public static final int watchableCount = 1 << watchableBits;
public static final int maxWatchableID = watchableCount - 1;
public static final int watchableMask = (0x7 << watchableBits) | maxWatchableID;
//Chunk
public static final int bytesPerChunk =
(GeneralConfig.extendBiome ? bytesPerBiome : VanillaConstants.bytesPerBiome) * 256
+ (GeneralConfig.extendBlockItem ? bytesPerEBS : VanillaConstants.bytesPerEBS) * 16;
}
@@ -0,0 +1,7 @@
package com.falsepattern.endlessids.containers;
public class BiomeContainer extends _Dummy {
public BiomeContainer() {
super("biome", "Biome");
}
}
@@ -0,0 +1,7 @@
package com.falsepattern.endlessids.containers;
public class BlockItemContainer extends _Dummy {
public BlockItemContainer() {
super("blockitem", "BlockItem");
}
}
@@ -0,0 +1,7 @@
package com.falsepattern.endlessids.containers;
public class DataWatcherContainer extends _Dummy {
public DataWatcherContainer() {
super("datawatcher", "DataWatcher");
}
}
@@ -0,0 +1,7 @@
package com.falsepattern.endlessids.containers;
public class EnchantmentContainer extends _Dummy {
public EnchantmentContainer() {
super("enchantment", "Enchantment");
}
}
@@ -0,0 +1,7 @@
package com.falsepattern.endlessids.containers;
public class PotionContainer extends _Dummy {
public PotionContainer() {
super("potion", "Potion");
}
}
@@ -0,0 +1,31 @@
package com.falsepattern.endlessids.containers;
import com.falsepattern.endlessids.Tags;
import com.google.common.eventbus.EventBus;
import lombok.val;
import cpw.mods.fml.common.DummyModContainer;
import cpw.mods.fml.common.LoadController;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.common.versioning.DefaultArtifactVersion;
public class _Dummy extends DummyModContainer {
public _Dummy(String id, String name) {
super(createMetadata(id, name));
}
private static ModMetadata createMetadata(String id, String name) {
val meta = new ModMetadata();
meta.modId = Tags.MODID + "_" + id;
meta.name = Tags.MODNAME + " " + name + " Module";
meta.version = Tags.VERSION;
meta.dependencies.add(new DefaultArtifactVersion(Tags.MODID, Tags.VERSION));
meta.parent = Tags.MODID;
return meta;
}
@Override
public boolean registerBus(EventBus bus, LoadController controller) {
return true;
}
}
@@ -7,7 +7,7 @@ import net.minecraft.world.chunk.Chunk;
import java.util.function.IntFunction;
import static com.falsepattern.endlessids.EndlessIDs.BIOME_ARRAY_PLACEHOLDER;
import static com.falsepattern.endlessids.EndlessIDs.ZERO_LENGTH_BIOME_ARRAY_PLACEHOLDER;
public class BiomePatchHelper {
public static byte[] getBiomeArrayTweaked(Chunk chunk, IntFunction<BiomeGenBase> biomesForGeneration) {
@@ -16,7 +16,7 @@ public class BiomePatchHelper {
for (int i = 0; i < chunkBiomes.length; ++i) {
chunkBiomes[i] = (short) biomesForGeneration.apply(i).biomeID;
}
return BIOME_ARRAY_PLACEHOLDER;
return ZERO_LENGTH_BIOME_ARRAY_PLACEHOLDER;
}
public static byte[] getBiomeArrayTweaked(Chunk chunk, BiomeGenBase[] biomesForGeneration) {
@@ -25,6 +25,6 @@ public class BiomePatchHelper {
for (int i = 0; i < chunkBiomes.length; ++i) {
chunkBiomes[i] = (short) biomesForGeneration[i].biomeID;
}
return BIOME_ARRAY_PLACEHOLDER;
return ZERO_LENGTH_BIOME_ARRAY_PLACEHOLDER;
}
}
@@ -0,0 +1,38 @@
package com.falsepattern.endlessids.mixin.helpers;
import com.falsepattern.endlessids.EndlessIDs;
import net.minecraft.world.biome.BiomeGenBase;
import java.lang.reflect.Field;
public class GalaxySpaceHelper {
private static final Field GSSpaceField;
static {
Class<?> clazz;
try {
clazz = Class.forName("galaxyspace.core.world.gen.GSBiomeGenBase");
} catch (ClassNotFoundException ignored) {
EndlessIDs.LOG.warn("Could not find GalaxySpace's GSBiomeGenBase class in the default package. Checking it in the MEGA package.");
try {
clazz = Class.forName("galaxyspace.core.world.GSBiomeGenBase");
} catch (ClassNotFoundException ignored2) {
EndlessIDs.LOG.warn("Could not find GalaxySpace's GSBiomeGenBase class in the MEGA package either. Throwing an exception.");
throw new IllegalStateException("Could not find GSBiomeGenBase class for GalaxySpace!");
}
}
try {
GSSpaceField = clazz.getDeclaredField("GSSpace");
} catch (NoSuchFieldException e) {
throw new IllegalStateException("Could not find GSSpace field in GSBiomeGenBase class for GalaxySpace!");
}
}
public static BiomeGenBase GSSpace() {
try {
return (BiomeGenBase) GSSpaceField.get(null);
} catch (IllegalAccessException e) {
throw new IllegalStateException("Could not access GSSpace field in GSBiomeGenBase class for GalaxySpace!");
}
}
}
@@ -8,4 +8,6 @@ public interface IExtendedBlockStorageMixin {
short[] getLSB();
byte[] getMSB();
short[] getMetaArray();
}
@@ -0,0 +1,5 @@
package com.falsepattern.endlessids.mixin.helpers;
public interface IS1DPacketEntityEffectMixin {
int getIDExtended();
}
@@ -0,0 +1,139 @@
package com.falsepattern.endlessids.mixin.helpers;
import com.falsepattern.endlessids.Hooks;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.val;
import lotr.common.LOTRDimension;
import lotr.common.network.LOTRPacketBiomeVariantsUnwatch;
import lotr.common.network.LOTRPacketBiomeVariantsWatch;
import lotr.common.network.LOTRPacketHandler;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraft.world.chunk.Chunk;
import cpw.mods.fml.common.FMLLog;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class LOTRBiomeVariantStorageShort {
private static final Map<LOTRDimension, Map<ChunkCoordIntPair, short[]>> chunkVariantMap = new HashMap<>();
private static final Map<LOTRDimension, Map<ChunkCoordIntPair, short[]>> chunkVariantMapClient = new HashMap<>();
private static Map<ChunkCoordIntPair, short[]> getDimensionChunkMap(World world) {
Map<LOTRDimension, Map<ChunkCoordIntPair, short[]>> sourcemap;
if (!world.isRemote) {
sourcemap = chunkVariantMap;
} else {
sourcemap = chunkVariantMapClient;
}
val dim = LOTRDimension.getCurrentDimensionWithFallback(world);
return sourcemap.computeIfAbsent(dim, k -> new HashMap<>());
}
private static ChunkCoordIntPair getChunkKey(Chunk chunk) {
return new ChunkCoordIntPair(chunk.xPosition, chunk.zPosition);
}
public static short[] getChunkBiomeVariants(World world, Chunk chunk) {
return getChunkBiomeVariants(world, getChunkKey(chunk));
}
public static short[] getChunkBiomeVariants(World world, ChunkCoordIntPair chunk) {
return getDimensionChunkMap(world).get(chunk);
}
public static void setChunkBiomeVariants(World world, Chunk chunk, short[] variants) {
setChunkBiomeVariants(world, getChunkKey(chunk), variants);
}
public static void setChunkBiomeVariants(World world, ChunkCoordIntPair chunk, short[] variants) {
getDimensionChunkMap(world).put(chunk, variants);
}
public static void clearChunkBiomeVariants(World world, Chunk chunk) {
clearChunkBiomeVariants(world, getChunkKey(chunk));
}
public static void clearChunkBiomeVariants(World world, ChunkCoordIntPair chunk) {
getDimensionChunkMap(world).remove(chunk);
}
public static void loadChunkVariants(World world, Chunk chunk, NBTTagCompound data) {
if (getChunkBiomeVariants(world, chunk) == null) {
short[] variants;
if (data.hasKey("LOTRBiomeVariantsS")) {
variants = Hooks.byteToShortArray(data.getByteArray("LOTRBiomeVariantsS"));
} else {
variants = new short[256];
}
setChunkBiomeVariants(world, chunk, variants);
}
}
public static void saveChunkVariants(World world, Chunk chunk, NBTTagCompound data) {
val variants = getChunkBiomeVariants(world, chunk);
if (variants != null) {
data.setByteArray("LOTRBiomeVariantsS", Hooks.shortToByteArray(variants));
}
}
public static void clearAllVariants(World world) {
getDimensionChunkMap(world).clear();
FMLLog.info("Unloading LOTR biome variants in %s",
LOTRDimension.getCurrentDimensionWithFallback(world).dimensionName);
}
public static void performCleanup(WorldServer world) {
val dimensionMap = getDimensionChunkMap(world);
val removalChunks = new ArrayList<ChunkCoordIntPair>();
for (val chunk : dimensionMap.keySet()) {
if (!world.theChunkProviderServer.chunkExists(chunk.chunkXPos, chunk.chunkZPos)) {
removalChunks.add(chunk);
}
}
for (val chunk : removalChunks) {
dimensionMap.remove(chunk);
}
}
public static void sendChunkVariantsToPlayer(World world, Chunk chunk, EntityPlayerMP entityplayer) {
short[] variants = getChunkBiomeVariants(world, chunk);
if (variants != null) {
val packet = new LOTRPacketBiomeVariantsWatch(chunk.xPosition, chunk.zPosition,
Hooks.shortToByteArray(variants));
LOTRPacketHandler.networkWrapper.sendTo(packet, entityplayer);
} else {
val dimName = world.provider.getDimensionName();
val posX = chunk.xPosition << 4;
val posZ = chunk.zPosition << 4;
val playerName = entityplayer.getCommandSenderName();
FMLLog.severe("Could not find LOTR biome variants for %s chunk at %d, %d; requested by %s", dimName, posX,
posZ, playerName);
}
}
public static void sendUnwatchToPlayer(World world, Chunk chunk, EntityPlayerMP entityplayer) {
val packet = new LOTRPacketBiomeVariantsUnwatch(chunk.xPosition, chunk.zPosition);
LOTRPacketHandler.networkWrapper.sendTo(packet, entityplayer);
}
public static int getSize(World world) {
val map = getDimensionChunkMap(world);
return map.size();
}
}
@@ -0,0 +1,7 @@
package com.falsepattern.endlessids.mixin.helpers.stubpackage.lotr.common.network;
public class LOTRPacketBiomeVariantsWatch {
public int chunkX;
public int chunkZ;
public byte[] variants;
}
@@ -0,0 +1,38 @@
package com.falsepattern.endlessids.mixin.mixins.client.biome.biomewand;
import com.spacechase0.minecraft.biomewand.item.BiomeWandItem;
import lombok.val;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.biome.BiomeGenBase;
@Mixin(value = BiomeWandItem.class,
remap = false)
public abstract class BiomeWandItemMixin {
/**
* @author FalsePattern
* @reason Biome ID extension
*/
@Overwrite
public int getColorFromItemStack(ItemStack stack, int pass) {
NBTTagCompound tag = stack.getTagCompound();
int biomeID = -1;
if (tag != null && tag.hasKey("sampledBiomeS")) {
biomeID = Short.toUnsignedInt(tag.getShort("sampledBiomeS"));
}
if (pass != 1) {
return -1;
}
if (biomeID < 0) {
return 0;
}
val biome = BiomeGenBase.getBiomeGenArray()[biomeID];
if (biome == null) {
return 0;
}
return biome.color;
}
}
@@ -0,0 +1,48 @@
package com.falsepattern.endlessids.mixin.mixins.client.biome.vanilla;
import com.falsepattern.endlessids.Hooks;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.Slice;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import net.minecraft.world.chunk.Chunk;
import java.util.Iterator;
@Mixin(Chunk.class)
public abstract class ChunkMixin {
@SuppressWarnings("rawtypes")
@Inject(method = "fillChunk",
at = @At(value = "INVOKE",
target = "Ljava/lang/System;arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V",
ordinal = 0),
slice = @Slice(from = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;clearMSBArray()V")),
locals = LocalCapture.CAPTURE_FAILHARD,
require = 1)
private void biomeData(byte[] p_76607_1_, int p_76607_2_, int p_76607_3_, boolean p_76607_4_, CallbackInfo ci, Iterator iterator, int k, boolean flag1, int l) {
Hooks.readBiomeArrayFromPacket((Chunk) (Object) this, p_76607_1_, k);
}
@Redirect(method = "fillChunk",
at = @At(value = "INVOKE",
target = "Ljava/lang/System;arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V",
ordinal = 0),
slice = @Slice(from = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;clearMSBArray()V")),
require = 1)
private void noCopyBiome(Object src, int srcPos, Object dest, int destPos, int length) {}
@Redirect(method = "fillChunk",
at = @At(value = "FIELD",
target = "Lnet/minecraft/world/chunk/Chunk;blockBiomeArray:[B",
args = "array=length"),
require = 1)
private int noBiomeArrayLength(byte[] array) {
return 0;
}
}
@@ -0,0 +1,115 @@
package com.falsepattern.endlessids.mixin.mixins.client.blockitem.vanilla;
import com.falsepattern.endlessids.Hooks;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.mixin.helpers.IExtendedBlockStorageMixin;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.Slice;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import net.minecraft.network.play.server.S21PacketChunkData;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.NibbleArray;
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
import java.util.Iterator;
@Mixin(Chunk.class)
public abstract class ChunkMixin {
@Shadow
private ExtendedBlockStorage[] storageArrays;
//This is needed because the array is not a field, but a local, and local arraylength overriding does not exist
private static byte[] fakeArray;
@Redirect(method = "fillChunk",
at = @At(value = "FIELD",
target = "Lnet/minecraft/world/chunk/Chunk;storageArrays:[Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;",
args = "array=length",
ordinal = 0),
slice = @Slice(from = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getSkylightArray()Lnet/minecraft/world/chunk/NibbleArray;")),
require = 1)
private int noMSBLoop(ExtendedBlockStorage[] array) {
return 0;
}
@SuppressWarnings("rawtypes")
@Inject(method = "fillChunk",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getBlockLSBArray()[B"),
locals = LocalCapture.CAPTURE_FAILHARD,
require = 1)
private void blockData(byte[] p_76607_1_, int p_76607_2_, int p_76607_3_, boolean p_76607_4_, CallbackInfo ci, Iterator iterator, int k, boolean flag1, int l) {
Hooks.setBlockData((IExtendedBlockStorageMixin) this.storageArrays[l], p_76607_1_, k);
}
@Redirect(method = "fillChunk",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getBlockLSBArray()[B"),
require = 1)
private byte[] fakeLSBArray(ExtendedBlockStorage instance) {
return fakeArray != null ? fakeArray : (fakeArray = new byte[16 * 16 * 16 * ExtendedConstants.bytesPerID]);
}
@Redirect(method = "fillChunk",
at = @At(value = "INVOKE",
target = "Ljava/lang/System;arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V",
ordinal = 0),
slice = @Slice(from = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getBlockLSBArray()[B")),
require = 1)
private void noCopy(Object src, int srcPos, Object dest, int destPos, int length) {}
@Inject(method = "fillChunk",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getMetadataArray()Lnet/minecraft/world/chunk/NibbleArray;"),
locals = LocalCapture.CAPTURE_FAILHARD,
require = 1)
private void hookSetBlockMeta(byte[] p_76607_1_, int p_76607_2_, int p_76607_3_, boolean p_76607_4_, CallbackInfo ci, Iterator iterator, int k, boolean flag1, int l) {
Hooks.setBlockMeta((IExtendedBlockStorageMixin) this.storageArrays[l], p_76607_1_, k);
}
private static NibbleArray fakeNarray;
@Redirect(method = "fillChunk",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getMetadataArray()Lnet/minecraft/world/chunk/NibbleArray;"),
require = 1)
private NibbleArray hookSetBlockMetaNoArray(ExtendedBlockStorage instance) {
return fakeNarray != null ? fakeNarray : (fakeNarray = new NibbleArray(null, 0));
}
@Redirect(method = "fillChunk",
at = @At(value = "FIELD",
target = "Lnet/minecraft/world/chunk/NibbleArray;data:[B",
args = "array=length"),
slice = @Slice(from = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getMetadataArray()Lnet/minecraft/world/chunk/NibbleArray;"),
to = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getBlocklightArray()Lnet/minecraft/world/chunk/NibbleArray;")),
expect = 2,
require = 2)
private int hookSetBlockMetaFakeBytesLength(byte[] array) {
return 16 * 16 * 16 * (ExtendedConstants.nibblesPerMetadata >>> 1);
}
@Redirect(method = "fillChunk",
at = @At(value = "INVOKE",
target = "Ljava/lang/System;arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V",
ordinal = 0),
slice = @Slice(from = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getMetadataArray()Lnet/minecraft/world/chunk/NibbleArray;")),
require = 1)
private void hookSetBlockMetaNoCopy(Object src, int srcPos, Object dest, int destPos, int length) {
}
}
@@ -0,0 +1,50 @@
package com.falsepattern.endlessids.mixin.mixins.client.blockitem.vanilla;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import net.minecraft.block.Block;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.network.play.server.S22PacketMultiBlockChange;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
@SideOnly(Side.CLIENT)
@Mixin(NetHandlerPlayClient.class)
public abstract class NetHandlerPlayClientMixin {
@Shadow
private WorldClient clientWorldController;
/**
* @author FalsePattern
* @reason Ported code, TODO figure out a proper mixin for this (difficult)
*/
@Overwrite
public void handleMultiBlockChange(S22PacketMultiBlockChange packetIn) {
int chunkX = packetIn.func_148920_c().chunkXPos * 16;
int chunkZ = packetIn.func_148920_c().chunkZPos * 16;
if (packetIn.func_148921_d() != null) {
DataInputStream dataInput = new DataInputStream(new ByteArrayInputStream(packetIn.func_148921_d()));
try {
for (int var5 = 0; var5 < packetIn.func_148922_e(); ++var5) {
short pos = dataInput.readShort();
short idLSB = dataInput.readShort();
byte idMSB = dataInput.readByte();
int id = (idLSB & 0xFFFF) | ((idMSB & 0xFF) << 16);
int meta = dataInput.readShort() & 0xFFFF;
int x = pos >> 12 & 15;
int z = pos >> 8 & 15;
int y = pos & 255;
this.clientWorldController.func_147492_c(x + chunkX, y, z + chunkZ, Block.getBlockById(id), meta);
}
} catch (IOException ignored) {}
}
}
}
@@ -1,4 +1,4 @@
package com.falsepattern.endlessids.mixin.mixins.client.vanilla;
package com.falsepattern.endlessids.mixin.mixins.client.blockitem.vanilla;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
@@ -1,4 +1,4 @@
package com.falsepattern.endlessids.mixin.mixins.client.vanilla;
package com.falsepattern.endlessids.mixin.mixins.client.blockitem.vanilla;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
@@ -0,0 +1,40 @@
package com.falsepattern.endlessids.mixin.mixins.client.potion.vanilla;
import com.falsepattern.endlessids.mixin.helpers.IS1DPacketEntityEffectMixin;
import lombok.val;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.network.play.server.S1DPacketEntityEffect;
import net.minecraft.potion.PotionEffect;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
@Mixin(NetHandlerPlayClient.class)
public abstract class NetHandlerPlayClientMixin {
private static int theID;
@Inject(method = "handleEntityEffect",
at = @At("HEAD"),
require = 1)
private void grabID(S1DPacketEntityEffect packetIn, CallbackInfo ci) {
theID = ((IS1DPacketEntityEffectMixin)packetIn).getIDExtended();
}
@Redirect(method = "handleEntityEffect",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/entity/EntityLivingBase;addPotionEffect(Lnet/minecraft/potion/PotionEffect;)V"),
require = 1)
private void addPotionEffect(EntityLivingBase entity, PotionEffect effect) {
val newPotion = new PotionEffect(theID, effect.getDuration(), effect.getAmplifier());
theID = 0;
newPotion.setPotionDurationMax(effect.getIsPotionDurationMax());
entity.addPotionEffect(newPotion);
}
}
@@ -0,0 +1,18 @@
package com.falsepattern.endlessids.mixin.mixins.client.redstone;
import com.falsepattern.endlessids.config.GeneralConfig;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import net.minecraft.block.BlockRedstoneWire;
@Mixin(BlockRedstoneWire.class)
public abstract class BlockRedstoneWireMixin {
@ModifyConstant(method = "randomDisplayTick",
constant = @Constant(floatValue = 15.0F),
require = 1)
private float bigRedstone(float constant) {
return GeneralConfig.maxRedstone;
}
}
@@ -0,0 +1,18 @@
package com.falsepattern.endlessids.mixin.mixins.client.redstone;
import com.falsepattern.endlessids.config.GeneralConfig;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import net.minecraft.client.renderer.RenderBlocks;
@Mixin(RenderBlocks.class)
public abstract class RenderBlocksMixin {
@ModifyConstant(method = "renderBlockRedstoneWire",
constant = @Constant(floatValue = 15.0F),
require = 1)
private float bigRedstone(float constant) {
return GeneralConfig.maxRedstone;
}
}
@@ -1,147 +0,0 @@
package com.falsepattern.endlessids.mixin.mixins.client.vanilla;
import com.falsepattern.endlessids.Hooks;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.mixin.helpers.IExtendedBlockStorageMixin;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import net.minecraft.block.Block;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.NibbleArray;
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;
@SuppressWarnings({"rawtypes", "WhileLoopReplaceableByForEach", "unchecked"})
@Mixin(Chunk.class)
public abstract class ChunkMixin {
@Shadow
public Map chunkTileEntityMap;
@Shadow
public World worldObj;
@Shadow
public boolean isLightPopulated;
@Shadow
public boolean isTerrainPopulated;
@Shadow
private ExtendedBlockStorage[] storageArrays;
@Shadow
private byte[] blockBiomeArray;
@Shadow
public abstract void generateHeightMap();
@Shadow
public abstract Block getBlock(int p_150810_1_, int p_150810_2_, int p_150810_3_);
@Shadow
public abstract int getBlockMetadata(int p_76628_1_, int p_76628_2_, int p_76628_3_);
/**
* @author FalsePattern
* @reason Direct port from dumped code
*/
@SideOnly(Side.CLIENT)
@Overwrite
public void fillChunk(byte[] var1, int var2, int var3, boolean var4) {
Iterator var5 = this.chunkTileEntityMap.values().iterator();
while (var5.hasNext()) {
TileEntity var6 = (TileEntity) var5.next();
var6.updateContainingBlockInfo();
var6.getBlockMetadata();
var6.getBlockType();
}
int var16 = 0;
boolean var7 = !this.worldObj.provider.hasNoSky;
int var8;
for (var8 = 0; var8 < this.storageArrays.length; ++var8) {
if ((var2 & 1 << var8) != 0) {
if (this.storageArrays[var8] == null) {
this.storageArrays[var8] = new ExtendedBlockStorage(var8 << 4, var7);
}
Hooks.setBlockData((IExtendedBlockStorageMixin) this.storageArrays[var8], var1, var16);
var16 += 16 * 16 * 16 * ExtendedConstants.bytesPerID;
} else if (var4 && this.storageArrays[var8] != null) {
this.storageArrays[var8] = null;
}
}
NibbleArray var9;
for (var8 = 0; var8 < this.storageArrays.length; ++var8) {
if ((var2 & 1 << var8) != 0 && this.storageArrays[var8] != null) {
var9 = this.storageArrays[var8].getMetadataArray();
System.arraycopy(var1, var16, var9.data, 0, var9.data.length);
var16 += var9.data.length;
}
}
for (var8 = 0; var8 < this.storageArrays.length; ++var8) {
if ((var2 & 1 << var8) != 0 && this.storageArrays[var8] != null) {
var9 = this.storageArrays[var8].getBlocklightArray();
System.arraycopy(var1, var16, var9.data, 0, var9.data.length);
var16 += var9.data.length;
}
}
if (var7) {
for (var8 = 0; var8 < this.storageArrays.length; ++var8) {
if ((var2 & 1 << var8) != 0 && this.storageArrays[var8] != null) {
var9 = this.storageArrays[var8].getSkylightArray();
System.arraycopy(var1, var16, var9.data, 0, var9.data.length);
var16 += var9.data.length;
}
}
}
if (var4) {
var16 += Hooks.readBiomeArrayFromPacket((Chunk) (Object) this, var1, var16);
}
for (var8 = 0; var8 < this.storageArrays.length; ++var8) {
if (this.storageArrays[var8] != null && (var2 & 1 << var8) != 0) {
this.storageArrays[var8].removeInvalidBlocks();
}
}
this.isLightPopulated = true;
this.isTerrainPopulated = true;
this.generateHeightMap();
ArrayList var10 = new ArrayList();
TileEntity var11;
for (var5 = this.chunkTileEntityMap.values().iterator(); var5.hasNext(); var11.updateContainingBlockInfo()) {
var11 = (TileEntity) var5.next();
int var12 = var11.xCoord & 15;
int var13 = var11.yCoord;
int var14 = var11.zCoord & 15;
Block var15 = var11.getBlockType();
if ((var15 != this.getBlock(var12, var13, var14) ||
var11.blockMetadata != this.getBlockMetadata(var12, var13, var14)) &&
var11.shouldRefresh(var15, this.getBlock(var12, var13, var14), var11.blockMetadata,
this.getBlockMetadata(var12, var13, var14), this.worldObj, var12, var13, var14)) {
var10.add(var11);
}
}
Iterator var17 = var10.iterator();
while (var17.hasNext()) {
TileEntity var18 = (TileEntity) var17.next();
var18.invalidate();
}
}
}
@@ -1,52 +0,0 @@
package com.falsepattern.endlessids.mixin.mixins.client.vanilla;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import net.minecraft.block.Block;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.network.play.server.S22PacketMultiBlockChange;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
@SideOnly(Side.CLIENT)
@Mixin(NetHandlerPlayClient.class)
public abstract class NetHandlerPlayClientMixin {
@Shadow
private WorldClient clientWorldController;
/**
* @author FalsePattern
* @reason Direct port from dumped code
*/
@Overwrite
public void handleMultiBlockChange(S22PacketMultiBlockChange packetIn) throws IOException {
int var2 = packetIn.func_148920_c().chunkXPos * 16;
int var3 = packetIn.func_148920_c().chunkZPos * 16;
if (packetIn.func_148921_d() != null) {
DataInputStream dataInput = new DataInputStream(new ByteArrayInputStream(packetIn.func_148921_d()));
for (int var5 = 0; var5 < packetIn.func_148922_e(); ++var5) {
short var6 = dataInput.readShort();
short idLSB = dataInput.readShort();
byte idMSB = dataInput.readByte();
int id = (idLSB & 0xFFFF) | ((idMSB & 0xFF) << 16);
int var9 = dataInput.readByte() & 15;
int var10 = var6 >> 12 & 15;
int var11 = var6 >> 8 & 15;
int var12 = var6 & 255;
this.clientWorldController.func_147492_c(var10 + var2, var12, var11 + var3, Block.getBlockById(id),
var9);
}
}
}
}
@@ -1,7 +1,7 @@
package com.falsepattern.endlessids.mixin.mixins.common.antiidconflict;
import code.elix_x.coremods.antiidconflict.AntiIdConflictBase;
import org.spongepowered.asm.lib.Opcodes;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
@@ -0,0 +1,84 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.abyssalcraft;
import com.falsepattern.endlessids.PlaceholderBiome;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.shinoow.abyssalcraft.AbyssalCraft;
import lombok.val;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.world.biome.BiomeGenBase;
@Mixin(value = AbyssalCraft.class,
remap = false)
public abstract class AbyssalCraftMixin {
@Shadow
public static int configBiomeId1;
@Shadow
public static int configBiomeId2;
@Shadow
public static int configBiomeId3;
@Shadow
public static int configBiomeId4;
@Shadow
public static int configBiomeId5;
@Shadow
public static int configBiomeId6;
@Shadow
public static int configBiomeId7;
@Shadow
public static int configBiomeId8;
@Shadow
public static int configBiomeId9;
@Shadow
public static int configBiomeId10;
@Shadow
public static int configBiomeId11;
@Shadow
public static int configBiomeId12;
@Shadow
public static int configBiomeId13;
@Inject(method = "checkBiomeIds",
at = @At("HEAD"),
require = 1)
private void cleanupBiomeArrayForAssignment(CallbackInfo ci) {
val bga = BiomeGenBase.getBiomeGenArray();
int[] biomes = new int[]{configBiomeId1, configBiomeId2, configBiomeId3, configBiomeId4, configBiomeId5,
configBiomeId6, configBiomeId7, configBiomeId8, configBiomeId9, configBiomeId10,
configBiomeId11, configBiomeId12, configBiomeId13};
for (val biome : biomes) {
if (biome < 0 || biome >= ExtendedConstants.biomeIDCount) {
continue;
}
if (bga[biome] instanceof PlaceholderBiome) {
bga[biome] = null;
}
}
}
@ModifyConstant(method = "syncConfig",
constant = {@Constant(intValue = 100, ordinal = 0),
@Constant(intValue = 101, ordinal = 0),
@Constant(intValue = 102, ordinal = 0),
@Constant(intValue = 103, ordinal = 0),
@Constant(intValue = 104, ordinal = 0),
@Constant(intValue = 105, ordinal = 0),
@Constant(intValue = 106, ordinal = 0),
@Constant(intValue = 107, ordinal = 0),
@Constant(intValue = 108, ordinal = 0),
@Constant(intValue = 109, ordinal = 0),
@Constant(intValue = 110, ordinal = 0),
@Constant(intValue = 112, ordinal = 0),
@Constant(intValue = 113, ordinal = 0)},
require = 13)
private static int shiftBiomeIDsUp(int constant) {
return constant + 8000;
}
}
@@ -1,4 +1,4 @@
package com.falsepattern.endlessids.mixin.mixins.common.antiqueatlas;
package com.falsepattern.endlessids.mixin.mixins.common.biome.antiqueatlas;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
@@ -1,4 +1,4 @@
package com.falsepattern.endlessids.mixin.mixins.common.antiqueatlas;
package com.falsepattern.endlessids.mixin.mixins.common.biome.antiqueatlas;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
import com.falsepattern.endlessids.mixin.helpers.ShortUtil;
@@ -0,0 +1,33 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.arocketry;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import zmaster587.advancedRocketry.AdvancedRocketry;
@Mixin(value = AdvancedRocketry.class,
remap = false)
public abstract class AdvancedRocketryMixin {
@ModifyConstant(method = "load",
constant = {@Constant(intValue = 110, ordinal = 0),
@Constant(intValue = 111, ordinal = 0),
@Constant(intValue = 112, ordinal = 0),
@Constant(intValue = 113, ordinal = 0),
@Constant(intValue = 114, ordinal = 0),
@Constant(intValue = 115, ordinal = 0),
@Constant(intValue = 116, ordinal = 0),
@Constant(intValue = 117, ordinal = 0),
@Constant(intValue = 118, ordinal = 0),
@Constant(intValue = 119, ordinal = 0)},
require = 10)
private static int shiftBiomeIDsUp(int constant) {
return constant + 9000;
}
@ModifyConstant(method = "preInit",
constant = @Constant(intValue = -2),
require = 1)
private static int changeDefaultDimID(int constant) {
return -5613;
}
}
@@ -1,20 +1,17 @@
package com.falsepattern.endlessids.mixin.mixins.common.twilightforest;
package com.falsepattern.endlessids.mixin.mixins.common.biome.arocketry;
import com.falsepattern.endlessids.mixin.helpers.BiomePatchHelper;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import twilightforest.world.ChunkProviderTwilightForest;
import zmaster587.advancedRocketry.api.AdvancedRocketryBiomes;
import zmaster587.advancedRocketry.world.ChunkProviderSpace;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
@Mixin(value = ChunkProviderTwilightForest.class,
@Mixin(value = ChunkProviderSpace.class,
remap = false)
public abstract class ChunkProviderTwilightForestMixin {
@Shadow
private BiomeGenBase[] biomesForGeneration;
public abstract class ChunkProviderSpaceMixin {
@Redirect(method = "provideChunk",
at = @At(value = "INVOKE",
@@ -23,6 +20,6 @@ public abstract class ChunkProviderTwilightForestMixin {
remap = true,
require = 1)
private byte[] setBiomesTweaked(Chunk chunk) {
return BiomePatchHelper.getBiomeArrayTweaked(chunk, biomesForGeneration);
return BiomePatchHelper.getBiomeArrayTweaked(chunk, (i) -> AdvancedRocketryBiomes.spaceBiome);
}
}
@@ -1,4 +1,4 @@
package com.falsepattern.endlessids.mixin.mixins.common.atg;
package com.falsepattern.endlessids.mixin.mixins.common.biome.atg;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
@@ -1,4 +1,4 @@
package com.falsepattern.endlessids.mixin.mixins.common.atg;
package com.falsepattern.endlessids.mixin.mixins.common.biome.atg;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
@@ -1,4 +1,4 @@
package com.falsepattern.endlessids.mixin.mixins.common.atg;
package com.falsepattern.endlessids.mixin.mixins.common.biome.atg;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
@@ -0,0 +1,54 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.biometweaker;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
import me.superckl.biometweaker.common.handler.BiomeEventHandler;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.Arrays;
@Mixin(value = BiomeEventHandler.class,
remap = false)
public abstract class BiomeEventHandlerMixin {
@Mutable
@Shadow
@Final
private int[] colorCache;
@ModifyConstant(method = "<clinit>",
constant = @Constant(intValue = VanillaConstants.biomeIDCount),
require = 1)
private static int extendIDs1(int constant) {
return ExtendedConstants.biomeIDCount;
}
@Inject(method = "<init>",
at = @At("RETURN"),
require = 1)
private void extendIDs2(CallbackInfo ci) {
colorCache = new int[ExtendedConstants.biomeIDCount * 3];
Arrays.fill(colorCache, -2);
}
@ModifyConstant(method = "onGetFoliageColor",
constant = @Constant(intValue = VanillaConstants.biomeIDCount),
require = 1)
private static int extendIDs3(int constant) {
return ExtendedConstants.biomeIDCount;
}
@ModifyConstant(method = "onGetWaterColor",
constant = @Constant(intValue = VanillaConstants.biomeIDCount * 2),
require = 1)
private static int extendIDs4(int constant) {
return ExtendedConstants.biomeIDCount * 2;
}
}
@@ -0,0 +1,111 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.biomewand;
import com.falsepattern.endlessids.PlaceholderBiome;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
import com.spacechase0.minecraft.biomewand.BiomeWandMod;
import com.spacechase0.minecraft.biomewand.item.BiomeWandItem;
import com.spacechase0.minecraft.spacecore.util.TranslateUtils;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import java.util.List;
@Mixin(value = BiomeWandItem.class,
remap = false)
public abstract class BiomeWandItemMixin {
/**
* @author FalsePattern
* @reason Biome ID extension
*/
@Overwrite
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int blockX, int blockY, int blockZ, int side, float par8, float par9, float par10) {
NBTTagCompound tag = stack.getTagCompound();
boolean sample = true;
if (tag != null) {
if (tag.hasKey("sampledBiomeS")) {
sample = false;
}
} else {
tag = new NBTTagCompound();
}
if (sample) {
int relBlockX = blockX & 15;
int relBlockZ = blockZ & 15;
Chunk chunk = world.getChunkFromBlockCoords(blockX, blockZ);
short biome = ((IChunkMixin)chunk).getBiomeShortArray()[relBlockZ * 16 + relBlockX];
tag.setShort("sampledBiomeS", biome);
} else {
short biome = tag.getShort("sampledBiomeS");
for(int ix = blockX - 3; ix <= blockX + 3; ++ix) {
for(int iz = blockZ - 3; iz <= blockZ + 3; ++iz) {
int relBlockX = ix & 15;
int relBlockZ = iz & 15;
Chunk chunk = world.getChunkFromBlockCoords(blockX, blockZ);
((IChunkMixin)chunk).getBiomeShortArray()[relBlockZ << 4 | relBlockX] = biome;
chunk.isModified = true;
BiomeWandMod.proxy.updateRendererAt(ix, iz);
}
}
if (!player.capabilities.isCreativeMode) {
tag.removeTag("sampledBiomeS");
stack.damageItem(1, player);
}
}
stack.setTagCompound(tag);
return true;
}
/**
* @author FalsePattern
* @reason Biome ID extension
*/
@Overwrite
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
NBTTagCompound tag = stack.getTagCompound();
String str = TranslateUtils.translate("biomewand.tooltip.biome") + ": ";
if (tag == null || !tag.hasKey("sampledBiomeS")) {
str = str + TranslateUtils.translate("biomewand.tooltip.none");
} else {
BiomeGenBase b = BiomeGenBase.getBiomeGenArray()[Short.toUnsignedInt(tag.getShort("sampledBiomeS"))];
if (b == null) {
str = str + TranslateUtils.translate("biomewand.tooltip.unknown");
} else {
str = str + b.biomeName;
}
}
list.add(str);
}
/**
* @author FalsePattern
* @reason Biome ID extension
*/
@Overwrite
public void getSubItems(Item item, CreativeTabs tabs, List list) {
list.add(new ItemStack((BiomeWandItem)(Object)this, 1));
for (BiomeGenBase biome : BiomeGenBase.getBiomeGenArray()) {
if (biome != null && !(biome instanceof PlaceholderBiome)) {
NBTTagCompound compound = new NBTTagCompound();
compound.setShort("sampledBiomeS", (short) biome.biomeID);
ItemStack wand = new ItemStack((BiomeWandItem)(Object)this, 1);
wand.setTagCompound(compound);
list.add(wand);
}
}
}
}
@@ -1,4 +1,4 @@
package com.falsepattern.endlessids.mixin.mixins.common.bop;
package com.falsepattern.endlessids.mixin.mixins.common.biome.bop;
import biomesoplenty.common.world.BOPBiomeManager;
import com.falsepattern.endlessids.constants.ExtendedConstants;
@@ -10,6 +10,13 @@ import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(value = BOPBiomeManager.class,
remap = false)
public abstract class BOPBiomeManagerMixin {
@ModifyConstant(method = "<clinit>",
constant = @Constant(intValue = 40),
require = 1)
private static int shiftBiomeIDsUp(int id) {
return id + 5000;
}
@ModifyConstant(method = "getNextFreeBiomeId",
constant = @Constant(intValue = VanillaConstants.biomeIDCount),
require = 1)
@@ -0,0 +1,25 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.bop;
import biomesoplenty.common.core.BOPBiomes;
import biomesoplenty.common.world.BOPBiomeManager;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import net.minecraft.world.biome.BiomeGenBase;
@Mixin(value = BOPBiomes.class,
remap = false)
public abstract class BOPBiomesMixin {
/**
* @author FalsePattern
* @reason Suppress NPE
*/
@Overwrite
private static void disableRiver(BiomeGenBase biome) {
try {
BOPBiomeManager.overworldRiverBiomes[biome.biomeID] = biome;
} catch (Throwable t) {
t.printStackTrace();
}
}
}
@@ -1,19 +1,19 @@
package com.falsepattern.endlessids.mixin.mixins.common.twilightforest;
package com.falsepattern.endlessids.mixin.mixins.common.biome.buildcraft;
import buildcraft.BuildCraftEnergy;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import twilightforest.biomes.TFBiomeBase;
@Mixin(value = TFBiomeBase.class,
@Mixin(value = BuildCraftEnergy.class,
remap = false)
public abstract class TFBiomeBaseMixin {
@ModifyConstant(method = "findNextOpenBiomeId",
public abstract class BuildcraftEnergyMixin {
@ModifyConstant(method = "findUnusedBiomeID",
constant = @Constant(intValue = VanillaConstants.biomeIDCount),
require = 1)
private static int extendIDs(int constant) {
private int extendIDs(int constant) {
return ExtendedConstants.biomeIDCount;
}
}
@@ -0,0 +1,52 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.compactmachines;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
import com.falsepattern.endlessids.mixin.stubpackage.org.dave.CompactMachines.tileentity.TileEntityMachine;
import org.dave.CompactMachines.handler.ConfigurationHandler;
import org.dave.CompactMachines.machines.tools.CubeTools;
import org.dave.CompactMachines.utility.WorldUtils;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.WorldServer;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.common.BiomeDictionary;
@Mixin(value = CubeTools.class,
remap = false)
public abstract class CubeToolsMixin {
/**
* @author FalsePattern
* @reason getBiomeArray fix
*/
@Overwrite
public static void setCubeBiome(int coords, BiomeGenBase biome) {
WorldServer machineWorld = MinecraftServer.getServer().worldServerForDimension(ConfigurationHandler.dimensionId);
Chunk chunk = machineWorld.getChunkFromBlockCoords(coords * ConfigurationHandler.cubeDistance, 0);
if (chunk != null && chunk.isChunkLoaded) {
short[] biomeArray = ((IChunkMixin)chunk).getBiomeShortArray();
for(int x = 0; x < 15; ++x) {
for(int z = 0; z < 15; ++z) {
biomeArray[z << 4 | x] = (short)biome.biomeID;
}
}
}
}
/**
* @author FalsePattern
* @reason getBiomeArray fix
*/
@Overwrite
public static BiomeGenBase getMachineBiome(TileEntityMachine machine) {
short[] biomeArray = ((IChunkMixin)machine.getWorldObj().getChunkFromBlockCoords(machine.xCoord, machine.zCoord)).getBiomeShortArray();
int biomeId = biomeArray[(machine.zCoord & 15) << 4 | machine.xCoord & 15];
return biomeId > 0 && biomeId < BiomeGenBase.getBiomeGenArray().length && BiomeDictionary.isBiomeRegistered(biomeId)
? BiomeGenBase.getBiome(biomeId)
: WorldUtils.getBiomeByName(ConfigurationHandler.defaultBiome);
}
}
@@ -0,0 +1,60 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.darkworld;
import com.falsepattern.endlessids.config.DarkWorldIDConfig;
import matthbo.mods.darkworld.init.ModBiomes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(value = ModBiomes.class,
remap = false)
public abstract class ModBiomesMixin {
@ModifyConstant(method = "init",
constant = @Constant(intValue = 100),
require = 1)
private static int darkOceanID(int id) {
return DarkWorldIDConfig.darkOceanID;
}
@ModifyConstant(method = "init",
constant = @Constant(intValue = 101),
require = 1)
private static int darkPlainsID(int id) {
return DarkWorldIDConfig.darkPlainsID;
}
@ModifyConstant(method = "init",
constant = @Constant(intValue = 102),
require = 1)
private static int darkDesertID(int id) {
return DarkWorldIDConfig.darkDesertID;
}
@ModifyConstant(method = "init",
constant = @Constant(intValue = 103),
require = 1)
private static int darkHillsID(int id) {
return DarkWorldIDConfig.darkHillsID;
}
@ModifyConstant(method = "init",
constant = @Constant(intValue = 104),
require = 1)
private static int darkForestID(int id) {
return DarkWorldIDConfig.darkForestID;
}
@ModifyConstant(method = "init",
constant = @Constant(intValue = 105),
require = 1)
private static int darkTaigaID(int id) {
return DarkWorldIDConfig.darkTaigaID;
}
@ModifyConstant(method = "init",
constant = @Constant(intValue = 106),
require = 1)
private static int darkSwampID(int id) {
return DarkWorldIDConfig.darkSwampID;
}
}
@@ -1,4 +1,4 @@
package com.falsepattern.endlessids.mixin.mixins.common.dragonapi;
package com.falsepattern.endlessids.mixin.mixins.common.biome.dragonapi;
import Reika.DragonAPI.Instantiable.Event.GenLayerRiverEvent;
import com.falsepattern.endlessids.constants.ExtendedConstants;
@@ -0,0 +1,18 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.dragonapi;
import Reika.DragonAPI.Extras.IDType;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(value = IDType.class,
remap = false)
public abstract class IDTypeMixin {
@ModifyConstant(method = "<clinit>",
constant = @Constant(intValue = 254),
require = 1)
private static int extendBiomeIDs(int constant) {
return ExtendedConstants.biomeIDCount - 2;
}
}
@@ -0,0 +1,35 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.dragonapi;
import Reika.DragonAPI.Libraries.World.ReikaChunkHelper;
import com.falsepattern.endlessids.EndlessIDs;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import net.minecraft.world.chunk.Chunk;
@Mixin(value = ReikaChunkHelper.class,
remap = false)
public abstract class ReikaChunkHelperMixin {
private static short[] biomeArray;
@Redirect(method = "copyChunk",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/Chunk;setBiomeArray([B)V",
remap = true),
require = 1)
private static void customSet(Chunk chunk, byte[] p_76616_1_) {
((IChunkMixin)chunk).setBiomeShortArray(biomeArray);
biomeArray = null;
}
@Redirect(method = "copyChunk",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B",
remap = true),
require = 1)
private static byte[] customGet(Chunk chunk) {
biomeArray = ((IChunkMixin)chunk).getBiomeShortArray();
return EndlessIDs.ZERO_LENGTH_BIOME_ARRAY_PLACEHOLDER;
}
}
@@ -0,0 +1,77 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.dragonapi;
import Reika.DragonAPI.Libraries.World.ReikaWorldHelper;
import com.falsepattern.endlessids.EndlessIDs;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
@Mixin(value = ReikaWorldHelper.class,
remap = false)
public abstract class ReikaWorldHelperMixin {
@Redirect(method = {"setBiomeForXZ", "setBiomeAndBlocksForXZ"},
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B",
remap = true),
require = 2)
private static byte[] getFake(Chunk instance) {
return EndlessIDs.FAKE_BIOME_ARRAY_PLACEHOLDER;
}
@Redirect(method = {"setBiomeForXZ", "setBiomeAndBlocksForXZ"},
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/Chunk;setBiomeArray([B)V",
remap = true),
require = 2)
private static void noSet(Chunk instance, byte[] arr) {
}
@Inject(method = "setBiomeForXZ",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/Chunk;setChunkModified()V",
remap = true),
locals = LocalCapture.CAPTURE_FAILHARD,
require = 1)
private static void customLogicSetBiome(World world, int x, int z, BiomeGenBase biome, CallbackInfo ci, Chunk ch, int ax, int az, byte[] biomes, int index) {
((IChunkMixin)ch).getBiomeShortArray()[index] = (short) biome.biomeID;
}
private static int fromBiomeID;
@Inject(method = "setBiomeAndBlocksForXZ",
at = @At(value = "FIELD",
target = "Lnet/minecraft/world/biome/BiomeGenBase;biomeList:[Lnet/minecraft/world/biome/BiomeGenBase;",
remap = true),
locals = LocalCapture.CAPTURE_FAILEXCEPTION,
require = 1)
private static void captureIndexSetBiomeAndBlocks(World world, int x, int z, BiomeGenBase biome, CallbackInfo ci, Chunk ch, int ax, int az, byte[] biomes, int index) {
fromBiomeID = ((IChunkMixin)ch).getBiomeShortArray()[index];
}
@ModifyVariable(method = "setBiomeAndBlocksForXZ",
at = @At("STORE"),
ordinal = 1)
private static BiomeGenBase changeBiomeFrom(BiomeGenBase value) {
return BiomeGenBase.getBiome(fromBiomeID);
}
@Inject(method = "setBiomeAndBlocksForXZ",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/Chunk;setBiomeArray([B)V",
remap = true),
locals = LocalCapture.CAPTURE_FAILEXCEPTION,
require = 1)
private static void customLogicSetBiomeAndBlocks(World world, int x, int z, BiomeGenBase biome, CallbackInfo ci, Chunk ch, int ax, int az, byte[] biomes, int index, BiomeGenBase from) {
((IChunkMixin)ch).getBiomeShortArray()[index] = (short) biome.biomeID;
}
}
@@ -1,4 +1,4 @@
package com.falsepattern.endlessids.mixin.mixins.common.dragonapi.vanilla;
package com.falsepattern.endlessids.mixin.mixins.common.biome.dragonapi.vanilla;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
@@ -0,0 +1,16 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.eb;
import enhancedbiomes.world.biomestats.BiomeIDs;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(BiomeIDs.class)
public abstract class BiomeIDsMixin {
@ModifyConstant(method = "<clinit>",
constant = @Constant(intValue = 39),
require = 1)
private static int extendIDs(int id) {
return id + 6000;
}
}
@@ -0,0 +1,20 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.eb;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
import enhancedbiomes.world.gen.layer.GenLayerArchipelagoEdge;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(value = GenLayerArchipelagoEdge.class,
remap = false)
public abstract class GenLayerArchipelagoEdgeMixin {
@ModifyConstant(method = "getInts",
constant = @Constant(intValue = VanillaConstants.biomeIDCount),
remap = true,
require = 5)
private int extendIDs(int constant) {
return ExtendedConstants.biomeIDCount;
}
}
@@ -0,0 +1,40 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.eb;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
import enhancedbiomes.world.gen.layer.GenLayerEBHills;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(value = GenLayerEBHills.class,
remap = false)
public abstract class GenLayerEBHillsMixin {
@ModifyConstant(method = "getInts",
constant = @Constant(intValue = VanillaConstants.biomeIDCount),
remap = true,
require = 8)
private int extendIDs1(int constant) {
return ExtendedConstants.biomeIDCount;
}
@ModifyConstant(method = "getInts",
constant = @Constant(intValue = 128),
remap = true,
require = 1)
private int extendIDs2(int constant) {
return ExtendedConstants.biomeIDCount;
}
@Redirect(method = "getInts",
at = @At(value = "INVOKE",
target = "Lorg/apache/logging/log4j/Logger;debug(Ljava/lang/String;)V"),
remap = true,
require = 1)
private void noLog(Logger instance, String s) {
}
}
@@ -0,0 +1,28 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.eb;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
import enhancedbiomes.world.gen.layer.GenLayerEBRiverMix;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(value = GenLayerEBRiverMix.class,
remap = false)
public abstract class GenLayerEBRiverMixMixin {
@ModifyConstant(method = "getInts",
constant = @Constant(intValue = VanillaConstants.biomeIDCount),
remap = true,
require = 1)
private int extendIDs1(int constant) {
return ExtendedConstants.biomeIDCount;
}
@ModifyConstant(method = "getInts",
constant = @Constant(intValue = VanillaConstants.biomeIDMask),
remap = true,
require = 1)
private int extendIDs2(int constant) {
return ExtendedConstants.biomeIDMask;
}
}
@@ -0,0 +1,20 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.eb;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
import enhancedbiomes.world.gen.layer.GenLayerEBVoronoiZoom;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(value = GenLayerEBVoronoiZoom.class,
remap = false)
public abstract class GenLayerEBVoronoiZoomMixin {
@ModifyConstant(method = "getInts",
constant = @Constant(intValue = VanillaConstants.biomeIDMask),
remap = true,
require = 2)
private int extendIDs(int constant) {
return ExtendedConstants.biomeIDMask;
}
}
@@ -0,0 +1,18 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.enderlicious;
import DelirusCrux.Enderlicious.Common.Utility.Configuration.BiomeConfiguration;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(value = BiomeConfiguration.class,
remap = false)
public abstract class BiomeConfigurationMixin {
@ModifyConstant(method = "init",
constant = {@Constant(intValue = 200),
@Constant(intValue = 210)},
require = 2)
private static int shiftBiomeIDsUp(int id) {
return id + 3000;
}
}
@@ -0,0 +1,52 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.enderlicious;
import DelirusCrux.Enderlicious.Dimension.EndChunkProvider;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
import lombok.val;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import static com.falsepattern.endlessids.EndlessIDs.ZERO_LENGTH_BIOME_ARRAY_PLACEHOLDER;
@Mixin(value = EndChunkProvider.class,
remap = false)
public abstract class EndChunkProviderMixin {
@Shadow
private BiomeGenBase[] biomesForGeneration;
private int xx;
private int zz;
@Inject(method = "provideChunk",
at = @At("HEAD"),
require = 1)
private void grabXZ(int X, int Y, CallbackInfoReturnable<Chunk> cir) {
xx = X * 16;
zz = Y * 16;
}
@Redirect(method = "provideChunk",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B",
remap = true),
remap = true,
require = 1)
private byte[] setBiomesTweaked(Chunk chunk) {
val chunkBiomes = ((IChunkMixin) chunk).getBiomeShortArray();
for(int k = 0; k < chunkBiomes.length; ++k) {
if (Math.abs(xx) < 160 && Math.abs(zz) < 160) {
chunkBiomes[k] = 9;
} else {
chunkBiomes[k] = (short)this.biomesForGeneration[k].biomeID;
}
}
return ZERO_LENGTH_BIOME_ARRAY_PLACEHOLDER;
}
}
@@ -0,0 +1,96 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.erebus;
import com.falsepattern.endlessids.PlaceholderBiome;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import erebus.ModBiomes;
import lombok.val;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.world.biome.BiomeGenBase;
@Mixin(value = ModBiomes.class,
remap = false)
public abstract class ModBiomesMixin {
@Shadow
public static int undergroundJungleID;
@Shadow
public static int volcanicDesertID;
@Shadow
public static int subterraneanSavannahID;
@Shadow
public static int elysianFieldsID;
@Shadow
public static int ulteriorOutbackID;
@Shadow
public static int fungalForestID;
@Shadow
public static int submergedSwampID;
@Shadow
public static int fieldsSubForestID;
@Shadow
public static int jungleSubLakeID;
@Shadow
public static int jungleSubAsperGroveID;
@Shadow
public static int desertSubCharredForestID;
@Shadow
public static int savannahSubRockyWastelandID;
@Shadow
public static int savannahSubAsperGroveID;
@Shadow
public static int savannahSubSteppeID;
@ModifyConstant(method = "<clinit>",
constant = {@Constant(intValue = 100),
@Constant(intValue = 101),
@Constant(intValue = 102),
@Constant(intValue = 103),
@Constant(intValue = 104),
@Constant(intValue = 105),
@Constant(intValue = 106),
@Constant(intValue = 107)},
require = 8)
private static int shiftBiomeIDsUp(int id) {
return id + 4000;
}
@ModifyConstant(method = "init",
constant = @Constant(intValue = 128),
require = 1)
private static int extendIDs(int constant) {
return ExtendedConstants.biomeIDCount - 129;
}
@ModifyConstant(method = "init",
constant = @Constant(stringValue = "Erebus biome IDs cannot be higher than 127 or smaller than 0!"),
require = 1)
private static String modifyWarning(String str) {
return "Erebus biome IDs cannot be higher than " + (ExtendedConstants.biomeIDCount - 129) + " or smaller than 0!";
}
@Inject(method = "init",
at = @At("HEAD"),
require = 1)
private static void cleanupBiomeArrayForAssignment(CallbackInfo ci) {
val bga = BiomeGenBase.getBiomeGenArray();
int[] biomes = new int[]{undergroundJungleID, volcanicDesertID, subterraneanSavannahID, elysianFieldsID,
ulteriorOutbackID, fungalForestID, submergedSwampID, fieldsSubForestID,
jungleSubLakeID, jungleSubAsperGroveID, desertSubCharredForestID,
savannahSubRockyWastelandID, savannahSubAsperGroveID, savannahSubSteppeID};
for (val biome: biomes) {
if (biome <= 0 || biome >= ExtendedConstants.biomeIDCount - 129) {
continue;
}
if (bga[biome] instanceof PlaceholderBiome) {
bga[biome] = null;
}
}
}
}
@@ -0,0 +1,24 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.extraplanets;
import com.mjr.extraplanets.Config;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
@Mixin(value = Config.class,
remap = false)
public abstract class ConfigMixin {
@Redirect(method = "load",
at = @At(value = "INVOKE",
target = "Lnet/minecraftforge/common/config/Configuration;get(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;)Lnet/minecraftforge/common/config/Property;"))
private static Property shiftBiomeIDsUp(Configuration config, String category, String key, int defaultValue, String comment) {
if (category.equals("biomeID")) {
defaultValue += 17000;
comment = "[range: 0 ~ 65535, default: " + defaultValue + "]";
}
return config.get(category, key, defaultValue, comment);
}
}
@@ -1,4 +1,4 @@
package com.falsepattern.endlessids.mixin.mixins.common.extrautilities;
package com.falsepattern.endlessids.mixin.mixins.common.biome.extrautilities;
import com.falsepattern.endlessids.EndlessIDs;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
@@ -26,7 +26,7 @@ public abstract class ChunkProviderEndOfTimeMixin {
require = 1)
private byte[] setBiomesTweaked1(Chunk instance) {
chunk = instance;
return EndlessIDs.BIOME_ARRAY_PLACEHOLDER;
return EndlessIDs.ZERO_LENGTH_BIOME_ARRAY_PLACEHOLDER;
}
@Redirect(method = "provideChunk",
@@ -0,0 +1,17 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.futurepack;
import com.falsepattern.endlessids.config.FuturepackIDConfig;
import futurepack.common.dim.BiomeGenSpace;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(BiomeGenSpace.class)
public abstract class BiomeGenSpaceMixin {
@ModifyConstant(method = "<clinit>",
constant = @Constant(intValue = 97),
require = 1)
private static int shiftBiomeIDsUp(int id) {
return FuturepackIDConfig.spaceID;
}
}
@@ -0,0 +1,25 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.galacticraft;
import com.falsepattern.endlessids.mixin.helpers.BiomePatchHelper;
import micdoodle8.mods.galacticraft.core.world.gen.BiomeGenBaseOrbit;
import micdoodle8.mods.galacticraft.core.world.gen.ChunkProviderOrbit;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import net.minecraft.world.chunk.Chunk;
@Mixin(value = ChunkProviderOrbit.class,
remap = false)
public abstract class ChunkProviderOrbitMixin {
@Redirect(method = "provideChunk",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B",
remap = true),
remap = true,
require = 1)
private byte[] setBiomesTweaked(Chunk chunk) {
return BiomePatchHelper.getBiomeArrayTweaked(chunk, (i) -> BiomeGenBaseOrbit.space);
}
}
@@ -1,4 +1,4 @@
package com.falsepattern.endlessids.mixin.mixins.common.galacticraft;
package com.falsepattern.endlessids.mixin.mixins.common.biome.galacticraft;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
@@ -10,6 +10,12 @@ import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(value = ConfigManagerCore.class,
remap = false)
public abstract class ConfigManagerCoreMixin {
@ModifyConstant(method = {"<clinit>", "syncConfig"},
constant = @Constant(intValue = 102),
require = 3)
private static int shiftBiomeIDsUp(int id) {
return id + 18000;
}
@ModifyConstant(method = "syncConfig",
constant = @Constant(stringValue = "Biome ID for Moon (Mars will be this + 1, Asteroids + 2 etc). Allowed range 40-250."),
require = 1)
@@ -0,0 +1,26 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.galaxyspace;
import com.falsepattern.endlessids.mixin.helpers.BiomePatchHelper;
import com.falsepattern.endlessids.mixin.helpers.GalaxySpaceHelper;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import net.minecraft.world.chunk.Chunk;
@Pseudo
@Mixin(targets = {"galaxyspace.systems.SolarSystem.planets.kuiperbelt.dimension.ChunkProviderKuiper",
"galaxyspace.SolarSystem.planets.kuiperbelt.dimension.ChunkProviderKuiper"},
remap = false)
public abstract class ChunkProviderKuiperMixin {
@SuppressWarnings("UnresolvedMixinReference")
@Redirect(method = "func_73154_d",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/Chunk;func_76605_m()[B"),
require = 0,
expect = 0)
private byte[] setBiomesTweaked(Chunk chunk) {
return BiomePatchHelper.getBiomeArrayTweaked(chunk, (i) -> GalaxySpaceHelper.GSSpace());
}
}
@@ -0,0 +1,27 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.galaxyspace;
import com.falsepattern.endlessids.mixin.helpers.BiomePatchHelper;
import com.falsepattern.endlessids.mixin.helpers.GalaxySpaceHelper;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import net.minecraft.world.chunk.Chunk;
@Pseudo
@Mixin(targets = {"galaxyspace.systems.SolarSystem.satellites.mars.dimension.ChunkProviderMarsSS",
"galaxyspace.SolarSystem.satellites.mars.dimension.ChunkProviderMarsSS"},
remap = false)
public abstract class ChunkProviderMarsSSMixin {
@SuppressWarnings("UnresolvedMixinReference")
@Redirect(method = "func_73154_d",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/Chunk;func_76605_m()[B"),
require = 0,
expect = 0)
private byte[] setBiomesTweaked(Chunk chunk) {
return BiomePatchHelper.getBiomeArrayTweaked(chunk, (i) -> GalaxySpaceHelper.GSSpace());
}
}
@@ -1,8 +1,8 @@
package com.falsepattern.endlessids.mixin.mixins.common.bop;
package com.falsepattern.endlessids.mixin.mixins.common.biome.galaxyspace;
import biomesoplenty.common.world.ChunkProviderBOPEnd;
import com.falsepattern.endlessids.mixin.helpers.BiomePatchHelper;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@@ -10,18 +10,20 @@ import org.spongepowered.asm.mixin.injection.Redirect;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
@Mixin(value = ChunkProviderBOPEnd.class,
@Pseudo
@Mixin(targets = {"galaxyspace.core.world.gen.ChunkProviderSpaceLakes",
"galaxyspace.core.world.ChunkProviderSpaceLakes"},
remap = false)
public abstract class ChunkProviderBOPEndMixin {
public abstract class ChunkProviderSpaceLakesMixin {
@Shadow
private BiomeGenBase[] biomesForGeneration;
@Redirect(method = "provideChunk",
@SuppressWarnings("UnresolvedMixinReference")
@Redirect(method = "func_73154_d",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B",
remap = true),
remap = true,
require = 1)
target = "Lnet/minecraft/world/chunk/Chunk;func_76605_m()[B"),
require = 0,
expect = 0)
private byte[] setBiomesTweaked(Chunk chunk) {
return BiomePatchHelper.getBiomeArrayTweaked(chunk, biomesForGeneration);
}
@@ -0,0 +1,26 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.galaxyspace;
import com.falsepattern.endlessids.mixin.helpers.BiomePatchHelper;
import com.falsepattern.endlessids.mixin.helpers.GalaxySpaceHelper;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import net.minecraft.world.chunk.Chunk;
@Pseudo
@Mixin(targets = {"galaxyspace.systems.SolarSystem.satellites.venus.dimension.ChunkProviderVenusSS",
"galaxyspace.SolarSystem.satellites.venus.dimension.ChunkProviderVenusSS"},
remap = false)
public abstract class ChunkProviderVenusSSMixin {
@SuppressWarnings("UnresolvedMixinReference")
@Redirect(method = "func_73154_d",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/Chunk;func_76605_m()[B"),
require = 1)
private byte[] setBiomesTweaked(Chunk chunk) {
return BiomePatchHelper.getBiomeArrayTweaked(chunk, (i) -> GalaxySpaceHelper.GSSpace());
}
}
@@ -0,0 +1,19 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.highlands;
import highlands.Config;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
@Mixin(value = Config.class,
remap = false)
public abstract class ConfigMixin {
@ModifyArg(method = "addBiomeEntries",
at = @At(value = "INVOKE",
target = "Lnet/minecraftforge/common/config/Configuration;get(Ljava/lang/String;Ljava/lang/String;I)Lnet/minecraftforge/common/config/Property;"),
index = 2,
require = 44)
private static int shiftBiomeIDsUp(int id) {
return id + 7000;
}
}
@@ -1,4 +1,4 @@
package com.falsepattern.endlessids.mixin.mixins.common.icg;
package com.falsepattern.endlessids.mixin.mixins.common.biome.icg;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
@@ -0,0 +1,140 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.lotr;
import com.falsepattern.endlessids.mixin.helpers.LOTRBiomeVariantStorageShort;
import lotr.common.world.biome.variant.LOTRBiomeVariantStorage;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraft.world.chunk.Chunk;
@Mixin(value = LOTRBiomeVariantStorage.class,
remap = false)
public abstract class LOTRBiomeVariantStorageMixin {
private static UnsupportedOperationException crash() {
return new UnsupportedOperationException("Deprecated method.");
}
/**
* @author FalsePattern
* @reason Fix stuff
*/
@Overwrite
public static byte[] getChunkBiomeVariants(World world, Chunk chunk) {
throw crash();
}
/**
* @author FalsePattern
* @reason Fix stuff
*/
@Overwrite
public static byte[] getChunkBiomeVariants(World world, ChunkCoordIntPair chunk) {
throw crash();
}
/**
* @author FalsePattern
* @reason Fix stuff
*/
@Overwrite
public static void setChunkBiomeVariants(World world, Chunk chunk, byte[] variants) {
throw crash();
}
/**
* @author FalsePattern
* @reason Fix stuff
*/
@Overwrite
public static void setChunkBiomeVariants(World world, ChunkCoordIntPair chunk, byte[] variants) {
throw crash();
}
/**
* @author FalsePattern
* @reason Fix stuff
*/
@Overwrite
public static void clearChunkBiomeVariants(World world, Chunk chunk) {
LOTRBiomeVariantStorageShort.clearChunkBiomeVariants(world, chunk);
}
/**
* @author FalsePattern
* @reason Fix stuff
*/
@Overwrite
public static void clearChunkBiomeVariants(World world, ChunkCoordIntPair chunk) {
LOTRBiomeVariantStorageShort.clearChunkBiomeVariants(world, chunk);
}
/**
* @author FalsePattern
* @reason Fix stuff
*/
@Overwrite
public static void loadChunkVariants(World world, Chunk chunk, NBTTagCompound data) {
LOTRBiomeVariantStorageShort.loadChunkVariants(world, chunk, data);
}
/**
* @author FalsePattern
* @reason Fix stuff
*/
@Overwrite
public static void saveChunkVariants(World world, Chunk chunk, NBTTagCompound data) {
LOTRBiomeVariantStorageShort.saveChunkVariants(world, chunk, data);
}
/**
* @author FalsePattern
* @reason Fix stuff
*/
@Overwrite
public static void clearAllVariants(World world) {
LOTRBiomeVariantStorageShort.clearAllVariants(world);
}
/**
* @author FalsePattern
* @reason Fix stuff
*/
@Overwrite
public static void performCleanup(WorldServer world) {
LOTRBiomeVariantStorageShort.performCleanup(world);
}
/**
* @author FalsePattern
* @reason Fix stuff
*/
@Overwrite
public static void sendChunkVariantsToPlayer(World world, Chunk chunk, EntityPlayerMP entityPlayer) {
LOTRBiomeVariantStorageShort.sendChunkVariantsToPlayer(world, chunk, entityPlayer);
}
/**
* @author FalsePattern
* @reason Fix stuff
*/
@Overwrite
public static void sendUnwatchToPlayer(World world, Chunk chunk, EntityPlayerMP entityPlayer) {
LOTRBiomeVariantStorageShort.sendUnwatchToPlayer(world, chunk, entityPlayer);
}
/**
* @author FalsePattern
* @reason Fix stuff
*/
@Overwrite
public static int getSize(World world) {
return LOTRBiomeVariantStorageShort.getSize(world);
}
}
@@ -0,0 +1,34 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.lotr;
import com.falsepattern.endlessids.mixin.helpers.LOTRBiomeVariantStorageShort;
import lotr.common.world.LOTRChunkProvider;
import lotr.common.world.biome.variant.LOTRBiomeVariant;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
@Mixin(value = LOTRChunkProvider.class,
remap = false)
public abstract class LOTRChunkProviderMixin {
@Shadow
private LOTRBiomeVariant[] variantsForGeneration;
@Redirect(method = "provideChunk",
at = @At(value = "INVOKE",
target = "Llotr/common/world/biome/variant/LOTRBiomeVariantStorage;setChunkBiomeVariants(Lnet/minecraft/world/World;Lnet/minecraft/world/chunk/Chunk;[B)V"),
remap = true,
require = 1)
private void storeShorts(World world, Chunk chunk, byte[] variantsB) {
short[] variants = new short[256];
for (int l = 0; l < variants.length; ++l) {
variants[l] = (short) this.variantsForGeneration[l].variantID;
}
LOTRBiomeVariantStorageShort.setChunkBiomeVariants(world, chunk, variants);
}
}
@@ -0,0 +1,34 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.lotr;
import com.falsepattern.endlessids.mixin.helpers.LOTRBiomeVariantStorageShort;
import lotr.common.world.LOTRChunkProviderUtumno;
import lotr.common.world.biome.variant.LOTRBiomeVariant;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
@Mixin(value = LOTRChunkProviderUtumno.class,
remap = false)
public abstract class LOTRChunkProviderUtumnoMixin {
@Shadow
private LOTRBiomeVariant[] variantsForGeneration;
@Redirect(method = "provideChunk",
at = @At(value = "INVOKE",
target = "Llotr/common/world/biome/variant/LOTRBiomeVariantStorage;setChunkBiomeVariants(Lnet/minecraft/world/World;Lnet/minecraft/world/chunk/Chunk;[B)V"),
remap = true,
require = 1)
private void storeShorts(World world, Chunk chunk, byte[] variantsB) {
short[] variants = new short[256];
for (int l = 0; l < variants.length; ++l) {
variants[l] = (short) this.variantsForGeneration[l].variantID;
}
LOTRBiomeVariantStorageShort.setChunkBiomeVariants(world, chunk, variants);
}
}
@@ -0,0 +1,43 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.lotr;
import com.falsepattern.endlessids.Hooks;
import com.falsepattern.endlessids.mixin.helpers.LOTRBiomeVariantStorageShort;
import lombok.val;
import lotr.common.LOTRMod;
import lotr.common.network.LOTRPacketBiomeVariantsWatch;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.World;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
@Mixin(value = LOTRPacketBiomeVariantsWatch.Handler.class,
remap = false)
public abstract class LOTRPacketBiomeVariantsWatchHandler {
/**
* @author FalsePattern
* @reason fix stuff
*/
@SuppressWarnings("ConstantConditions")
@Overwrite
public IMessage onMessage(LOTRPacketBiomeVariantsWatch pkt, MessageContext context) {
val packet =
(com.falsepattern.endlessids.mixin.helpers.stubpackage.lotr.common.network.LOTRPacketBiomeVariantsWatch) (Object) pkt;
World world = LOTRMod.proxy.getClientWorld();
int chunkX = packet.chunkX;
int chunkZ = packet.chunkZ;
if (world.blockExists(chunkX << 4, 0, chunkZ << 4)) {
LOTRBiomeVariantStorageShort.setChunkBiomeVariants(world, new ChunkCoordIntPair(chunkX, chunkZ),
Hooks.byteToShortArray(packet.variants));
} else {
FMLLog.severe("Client received LOTR biome variant data for nonexistent chunk at %d, %d", chunkX << 4,
chunkZ << 4);
}
return null;
}
}
@@ -0,0 +1,46 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.lotr;
import com.falsepattern.endlessids.mixin.helpers.LOTRBiomeVariantStorageShort;
import lotr.common.world.LOTRWorldChunkManager;
import lotr.common.world.biome.variant.LOTRBiomeVariant;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import cpw.mods.fml.common.FMLLog;
@Mixin(value = LOTRWorldChunkManager.class,
remap = false)
public abstract class LOTRWorldChunkManagerMixin {
@Shadow
private World worldObj;
@Shadow
public abstract LOTRBiomeVariant[] getBiomeVariants(LOTRBiomeVariant[] variants, int i, int k, int xSize, int zSize);
/**
* @author FalsePattern
* @reason fix stuff
*/
@Overwrite
public LOTRBiomeVariant getBiomeVariantAt(int i, int k) {
short[] variants;
Chunk chunk = this.worldObj.getChunkFromBlockCoords(i, k);
if (chunk != null &&
(variants = LOTRBiomeVariantStorageShort.getChunkBiomeVariants(this.worldObj, chunk)) != null) {
if (variants.length == 256) {
int chunkX = i & 0xF;
int chunkZ = k & 0xF;
short variantID = variants[chunkX + chunkZ * 16];
return LOTRBiomeVariant.getVariantForID(variantID);
}
FMLLog.severe("Found chunk biome variant array of unexpected length " + variants.length);
}
if (!this.worldObj.isRemote) {
return this.getBiomeVariants(null, i, k, 1, 1)[0];
}
return LOTRBiomeVariant.STANDARD;
}
}
@@ -1,4 +1,4 @@
package com.falsepattern.endlessids.mixin.mixins.common.naturescompass;
package com.falsepattern.endlessids.mixin.mixins.common.biome.naturescompass;
import com.chaosthedude.naturescompass.util.BiomeUtils;
import com.falsepattern.endlessids.PlaceholderBiome;
@@ -0,0 +1,18 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.netherlicious;
import DelirusCrux.Netherlicious.Utility.Configuration.BiomeConfiguration;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(value = BiomeConfiguration.class,
remap = false)
public abstract class BiomeConfigurationMixin {
@ModifyConstant(method = "init",
constant = {@Constant(intValue = 170),
@Constant(intValue = 175)},
require = 2)
private static int shiftBiomeIDsUp(int id) {
return id + 3000;
}
}
@@ -0,0 +1,28 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.nomadictents;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
import com.yurtmod.dimension.TentChunkProvider;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import java.util.Arrays;
@Mixin(value = TentChunkProvider.class,
remap = false)
public abstract class TentChunkProviderMixin {
@Redirect(method = "provideChunk",
at = @At(value = "INVOKE",
remap = true,
target = "Lnet/minecraft/world/chunk/Chunk;setBiomeArray([B)V"),
remap = true,
require = 1)
private void setBiomesTweaked(Chunk chunk, byte[] p_76616_1_) {
short[] biomeMap = new short[256];
Arrays.fill(biomeMap, (short)BiomeGenBase.ocean.biomeID);
((IChunkMixin)chunk).setBiomeShortArray(biomeMap);
}
}
@@ -0,0 +1,63 @@
package com.falsepattern.endlessids.mixin.mixins.common.biome.randomthings;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
import lumien.randomthings.Items.ItemBiomeCapsule;
import lumien.randomthings.Items.ItemBiomePainter;
import lumien.randomthings.Items.ModItems;
import lumien.randomthings.Network.Messages.MessagePaintBiome;
import lumien.randomthings.Network.PacketHandler;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
@Mixin(ItemBiomePainter.class)
public abstract class ItemBiomePainterMixin {
/**
* @author FalsePattern
* @reason getBiomeArray fix
*/
@Overwrite
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
if (!par2EntityPlayer.inventory.hasItem(ModItems.biomeCapsule)) {
return false;
} else if (par3World.isRemote) {
return true;
} else {
for(int i = 0; i < par2EntityPlayer.inventory.getSizeInventory(); ++i) {
ItemStack is = par2EntityPlayer.inventory.getStackInSlot(i);
if (is != null && is.getItem() instanceof ItemBiomeCapsule && is.getItemDamage() != 0) {
NBTTagCompound nbt = is.stackTagCompound;
if (nbt == null) {
nbt = is.stackTagCompound = new NBTTagCompound();
}
int charges = nbt.getInteger("charges");
if (charges > 0 || par2EntityPlayer.capabilities.isCreativeMode) {
Chunk c = par3World.getChunkFromBlockCoords(par4, par6);
int biomeID = is.getItemDamage() - 1;
short[] biomeArray = ((IChunkMixin)c).getBiomeShortArray(); //changed
if ((biomeArray[(par6 & 15) << 4 | par4 & 15] & 255) != biomeID) {
biomeArray[(par6 & 15) << 4 | par4 & 15] = (short)(biomeID & 0xFFFF); //changed
((IChunkMixin)c).setBiomeShortArray(biomeArray); //changed
if (!par2EntityPlayer.capabilities.isCreativeMode) {
nbt.setInteger("charges", charges - 1);
par2EntityPlayer.inventoryContainer.detectAndSendChanges();
}
PacketHandler.INSTANCE.sendToDimension(new MessagePaintBiome(par4, par5, par6, par3World.provider.dimensionId, biomeID), par3World.provider.dimensionId);
}
}
return true;
}
}
return false;
}
}
}
Loaded 100 of 170 files, more files were not shown because too many files have changed in this diff. Show more