Compare commits

...
Author SHA1 Message Date
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
FalsePattern 24796dab0c fix clients receiving invalid biome ID from server 2022-07-11 20:44:49 +02:00
FalsePattern 3ceaa51119 Extra Utilities compat 2022-07-11 19:55:53 +02:00
FalsePattern eebb1d629e Antique Atlas compat 2022-07-11 01:04:40 +02:00
FalsePattern b1c8d1edb2 twilight forest fix 2022-07-11 00:21:48 +02:00
FalsePattern 4b23b1949c update fplib dep 2022-07-11 00:05:27 +02:00
FalsePattern 0e32ffebae code cleanup 2022-07-11 00:04:59 +02:00
FalsePattern ef52fa6e51 Thaumcraft compat 2022-07-11 00:02:17 +02:00
FalsePattern 42c59a668f twilightforest naming fixes 2022-07-10 23:58:31 +02:00
FalsePattern 9d24a015ff BOP fixes 2022-07-10 23:39:53 +02:00
FalsePattern 3b85cf7db5 chunk provider logic unification 2022-07-10 23:34:52 +02:00
FalsePattern 15803fceff Twilight Forest compat 2022-07-10 23:07:02 +02:00
FalsePattern 4a185892ea clean up some logging 2022-07-10 23:06:24 +02:00
57 changed files with 1610 additions and 1221 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
-3
View File
@@ -144,6 +144,3 @@ gradle-app.setting
.classpath
# End of https://www.toptal.com/developers/gitignore/api/intellij+all,gradle,forgegradle,java
srgmap.cfg
!lib/*.jar
-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.
-674
View File
@@ -1,674 +0,0 @@
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.
Preamble
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
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
software for all its users. We, the Free Software Foundation, use the
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
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
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
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:
(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
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
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
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
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.
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
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"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
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
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
on the Program.
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
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"
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
extent that warranties are provided), that licensees may convey the
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.
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
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
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
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(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 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
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
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
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
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
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
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
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
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
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
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
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
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.
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
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,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
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:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
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
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
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
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.
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:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
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
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
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,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
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,
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
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
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
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
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
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
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,
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.
"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
that they are valid under applicable law. If additional permissions
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
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
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
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
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
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
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
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
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
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
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
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.
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,
nothing other than this License grants you permission to propagate or
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.
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
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
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
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
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
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
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
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,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
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
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
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,
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,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
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
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
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
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
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
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
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.
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
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
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.
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
License will continue to apply to the part which is the covered work,
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.
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
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
version or of any later version published by the Free Software
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
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
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.
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,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
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.
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
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE 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.
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
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
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 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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU 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 General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
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>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
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,
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
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
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
View File
File renamed without changes.
-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
+13 -2
View File
@@ -15,17 +15,30 @@ Comparison of the known limits:
This mod also contains patches for the following mods:
- AbyssalCraft
- Alternate Terrain Generation
- Antique Atlas
- Anti ID Conflict
- ArchaicFix
- Atum
- Biomes O' Plenty
- Biome Wand
- CoFH Lib
- Dark World
- DragonAPI
- Dynamic Surroundings
- Erebus
- Extra Utilities
- Futurepack
- GalactiCraft
- Immersive Cavegen
- More Fun Quicksand Mod
- Nature's Compass
- Netherlicious
- Realistic Terrain Generation
- Thaumcraft
- Tropicraft
- Twilight Forest
- Underground Biomes Constructs
- WorldEdit
@@ -45,5 +58,3 @@ 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)
+111 -14
View File
@@ -1,25 +1,122 @@
static def curse(curseDep) {
return "curse.maven:" + curseDep
}
def deobfCurse(curseDep) {
String curseMaven = "https://cursemaven.com/" //Use https://cursemaven.falsepattern.com/ if this is down
return deobfMaven(curseMaven, curse(curseDep))
}
dependencies {
////////////////Our dependencies////////////////
compileOnly("org.projectlombok:lombok:1.18.22") {
transitive = false
}
annotationProcessor("org.projectlombok:lombok:1.18.22")
compile("com.falsepattern:falsepatternlib-mc1.7.10:0.9.1:dev")
compile("com.falsepattern:falsepatternlib-mc1.7.10:0.9.2: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
//AbyssalCraft 1.9.1.3-FINAL
compile(deobfCurse("abyssalcraft-53686:2311135"))
//Alternate Terrain Generation 0.12.0
compile(curse("atg-228356:2231155"))
//Antique Atlas 4.4.4
compile(deobfCurse("antiqueatlas-227795:2454232"))
//Anti ID Conflict 1.3.5
compile(deobfCurse("antiidconflict-246288:2308279"))
//ArchaicFix snapshot
compile("com.github.embeddedt:ArchaicFix:be8666cb2dbf2e0a8b799e88cef3c0d12e5d4911:dev")
//Atum 0.6.77
compile(deobfCurse("atum-59621:2256356"))
//Biomes O' Plenty 2.1.0.2308
compile(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/mirror/mirror/1.7.10-Biome-Wand-1.1.9.jar
compile(deobf("https://spacechase0.com/wp-content/uploads/2014/10/1.7.10-Biome-Wand-1.1.9.jar"))
//CoFH Lib 1.2.1-185
compile(curse("cofh-lib-220333:2388748"))
//Dark World 0.2
compile(deobfCurse("darkworld-225075:2225172"))
//DragonAPI V31b
compileOnly(deobfCurse("dragonapi-235591:3574508"))
//Dynamic Surroundings 1.0.6.4
compile(deobfCurse("dynamicsurrounding-238891:2642381"))
//Erebus 0.4.7
compile(deobfCurse("theerebus-220698:2305035"))
//Extra Utilities 1.2.12
compile(curse("extrautilities-225561:2264384"))
//Futurepack v18.7
compile(deobfCurse("futurepack-237333:2263966"))
//Galacticraft Core 3.0.12.504
//Mirrored at: https://maven.falsepattern.com/mirror/mirror/GalacticraftCore-1.7-3.0.12.504.jar
compileOnly(deobf("https://micdoodle8.com/new-builds/GC-1.7/504/GalacticraftCore-1.7-3.0.12.504.jar"))
//Immersive Cavegen 1.2g
compile(deobfCurse("immersivecavegen-521557:3649411"))
//More Fun Quicksands Mod 1.0.8.8-fixed
compileOnly(deobfCurse("more-fun-quicksand-mod-321960:2717318"))
//Nature's Compass 1.3.1
compile(deobfCurse("naturescompass-252848:2451823"))
//Netherlicious 3.2.3
compile(deobfCurse("netherlicious-385860:3858031"))
//Realistic Terrain Generation 1.1.1.7
compile(deobfCurse("rtg-237989:2521557"))
//Thaumcraft 4.2.3.5
compile(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
compile(deobf("https://maven.falsepattern.com/mirror/mirror/tropicraft-6.0.5.jar"))
//Twilight Forest 2.3.8
compile(deobfCurse("twilightforest-227639:3039937"))
//Underground Biomes Constructs 0.8-beta49
compileOnly(deobfCurse("undergroundbiomesconstructs-72744:2304497"))
//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/mirror/mirror/1.7.10-SpaceCore-0.7.14.jar
compile(deobf("http://spacechase0.com/files/mcmod/1.7.10-SpaceCore-0.7.14.jar"))
//Baubles 1.0.1.10
//needed by: Thaumcraft
compile(deobfCurse("baubles-227083:2224857"))
//CoroUtil 1.1.3
//needed by: Tropicraft
//Same reason for being mirrored as tropicraft
compile(deobf("https://maven.falsepattern.com/mirror/mirror/coroutil-1.1.3.jar"))
}
+1 -1
View File
@@ -69,7 +69,7 @@ mixinPlugin = mixin.plugin.MixinPlugin
# 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 =
mixinPreinitConfig = mixins.preinit.json
# 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
@@ -1,13 +1,13 @@
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 net.minecraft.world.biome.BiomeGenBase;
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;
@@ -15,18 +15,33 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
version = Tags.VERSION,
name = Tags.MODNAME,
acceptedMinecraftVersions = "[1.7.10]",
dependencies = "required-after:falsepatternlib@[0.9.1,);after:antiidconflict")
dependencies = "required-after:falsepatternlib@[0.9.2,);after:antiidconflict")
public class EndlessIDs {
public static final byte[] BIOME_ARRAY_PLACEHOLDER = new byte[0];
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();
}
}
@@ -147,64 +147,81 @@ 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);
}
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];
for (int i = 0; i < 256; ++i) {
shortArray[i] = (short) (byteArray[i + 256] << 8 | byteArray[i]);
}
short[] shortArray = new short[(byteArray.length + 1) / 2];
byteToShortArray(byteArray, 0, shortArray, 0, byteArray.length);
return shortArray;
}
public static short[] oldBiomeByteToNewShortArray(byte[] byteArray) {
short[] shortArray = new short[256];
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));
}
}
public static void oldBiomeByteToNewShortArray(byte[] byteArray, short[] shortArray) {
for (int i = 0; i < 256; 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)) {
oldBiomeByteToNewShortArray(nbt.getByteArray("Biomes"), data);
} else {
put = false;
}
if (put) {
((IChunkMixin) chunk).setBiomeShortArray(data);
}
}
@@ -15,12 +15,14 @@ import java.util.Set;
import static cpw.mods.fml.relauncher.IFMLLoadingPlugin.DependsOn;
import static cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion;
import static cpw.mods.fml.relauncher.IFMLLoadingPlugin.Name;
import static cpw.mods.fml.relauncher.IFMLLoadingPlugin.SortingIndex;
import static cpw.mods.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions;
@MCVersion("1.7.10")
@Name(Tags.MODID)
@TransformerExclusions({"com.falsepattern.endlessids.asm"})
@DependsOn("falsepatternlib")
@SortingIndex(1001)
public class IEPlugin implements IFMLLoadingPlugin {
static {
try {
@@ -36,13 +38,13 @@ public class IEPlugin implements IFMLLoadingPlugin {
@SneakyThrows
public String[] getASMTransformerClass() {
val cl = ((LaunchClassLoader)this.getClass().getClassLoader());
val cl = ((LaunchClassLoader) this.getClass().getClassLoader());
val field = cl.getClass().getDeclaredField("transformerExceptions");
field.setAccessible(true);
val exceptions = (Set<String>) field.get(cl);
if (exceptions.contains("code.elix_x.coremods")) {
System.out.println("AntiIDConflict detected!");
System.out.println("Removing ASM protections so that we can fix its code.");
IETransformer.logger.info("AntiIDConflict detected!");
IETransformer.logger.info("Removing ASM protections so that we can fix its code.");
exceptions.remove("code.elix_x.coremods");
exceptions.add("code.elix_x.coremods.antiidconflict.core");
exceptions.add("code.elix_x.coremods.antiidconflict.ByteCodeTester");
@@ -1,5 +1,6 @@
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;
@@ -9,6 +10,7 @@ import java.util.Map;
public enum ClassEdit {
FmlRegistry(new FmlRegistry(), new String[]{"cpw.mods.fml.common.registry.GameData",
"cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry"}),
ChunkProviderSuperPatcher(new ChunkProviderSuperPatcher(), new String[0]),
DragonAPIModList(new DragonAPIModList(), new String[]{"Reika.DragonAPI.ModList"});
private static final Map<String, ClassEdit> editMap;
@@ -1,16 +1,20 @@
package com.falsepattern.endlessids.asm;
import com.falsepattern.endlessids.Tags;
import com.falsepattern.endlessids.asm.transformer.ChunkProviderSuperPatcher;
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.Arrays;
public class IETransformer implements IClassTransformer {
public static final Logger logger;
public static boolean isObfuscated;
@@ -27,14 +31,18 @@ public class IETransformer implements IClassTransformer {
if (bytes == null) {
return bytes;
}
final ClassEdit edit = ClassEdit.get(transformedName);
ClassEdit edit = ClassEdit.get(transformedName);
final ClassNode cn = new ClassNode(Opcodes.ASM5);
final ClassReader reader = new ClassReader(bytes);
reader.accept(cn, edit == null ? ClassReader.EXPAND_FRAMES : 0);
if (edit == null) {
return bytes;
if (cn.interfaces.contains("net/minecraft/world/chunk/IChunkProvider")) {
edit = ClassEdit.ChunkProviderSuperPatcher;
} else {
return bytes;
}
}
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) {
@@ -46,7 +54,7 @@ public class IETransformer implements IClassTransformer {
t2.getMessage());
throw new RuntimeException(t2);
}
final ClassWriter writer = new ClassWriter(0);
final ClassWriter writer = new ClassWriter(edit == ClassEdit.ChunkProviderSuperPatcher ? ClassWriter.COMPUTE_FRAMES : 0);
try {
final ClassVisitor check = new CheckClassAdapter(writer);
cn.accept(check);
@@ -55,7 +63,7 @@ public class IETransformer implements IClassTransformer {
t3.getMessage());
throw new RuntimeException(t3);
}
IETransformer.logger.debug("Patched {} successfully.", edit.getName());
IETransformer.logger.debug("Patched {} successfully.", transformedName);
return writer.toByteArray();
}
}
@@ -0,0 +1,324 @@
package com.falsepattern.endlessids.asm.transformer;
import com.falsepattern.endlessids.asm.IClassNodeTransformer;
import com.falsepattern.endlessids.asm.IETransformer;
import lombok.Data;
import lombok.val;
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.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.BiFunction;
import java.util.function.Function;
/**
* <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
* }
* ...
* In ASM form:
*
* L1
* ALOAD chunk
* INVOKEVIRTUAL net/minecraft/world/chunk/Chunk.getBiomeArray ()[B //Replace with INVOKEVIRTUAL net/minecraft/world/chunk/Chunk.getBiomeShortArray ()[S
* ASTORE abyte
* L2
* ICONST_0
* ISTORE k
* L3
* FRAME <snip>
* ILOAD k
* ALOAD abyte
* ARRAYLENGTH
* IF_ICMPGE L6
* L4
* ALOAD abyte
* ILOAD k
*
* //Possibility A:
* ALOAD abiomegenbase
* //Possibility B:
* ALOAD <something else, usually 0, so only check for 0>
* GETFIELD classname.fieldname : [Lnet/minecraft/world/biome/BiomeGenBase;
*
* ILOAD k
* AALOAD
* GETFIELD net/minecraft/world/biome/BiomeGenBase.biomeID : I
* I2B //Replace with I2S
* BASTORE //Replace with SASTORE
* L5
* IINC k 1
* GOTO L3
* L6
* </pre>
*/
public class ChunkProviderSuperPatcher implements IClassNodeTransformer {
private static final String BIOME_GEN_BASE_CLASS = "net/minecraft/world/biome/BiomeGenBase";
private static final String CHUNK_CLASS = "net/minecraft/world/chunk/Chunk";
private static final String BIOME_ID_FIELD = IETransformer.isObfuscated ? "field_76756_M" : "biomeID";
private static final String GET_BIOME_ARRAY_METHOD = IETransformer.isObfuscated ? "func_76605_m" : "getBiomeArray";
private static final Map<Integer, BiFunction<AbstractInsnNode, Memory, Integer>> STATES = new HashMap<>();
static {
STATES.put(0, casting(VarInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.ALOAD) {
memory.chunkIndex = insn.var;
memory.startingInsn = memory.currentInsn;
return 1;
}
return 0;
}));
STATES.put(1, casting(MethodInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.INVOKEVIRTUAL &&
insn.owner.equals(CHUNK_CLASS) &&
insn.name.equals(GET_BIOME_ARRAY_METHOD) &&
insn.desc.equals("()[B")) {
memory.getBiomeArrayInsn = memory.currentInsn;
return 2;
}
return 0;
}));
STATES.put(2, casting(VarInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.ASTORE) {
memory.biomeArrayIndex = insn.var;
return 3;
}
return 0;
}));
STATES.put(3, casting(LabelNode.class, 4));
STATES.put(4, casting(InsnNode.class, (insn) ->
insn.getOpcode() == Opcodes.ICONST_0
? 5 : 0));
STATES.put(5, casting(VarInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.ISTORE) {
memory.iteratorIndex = insn.var;
return 6;
}
return 0;
}));
STATES.put(6, casting(LabelNode.class, 7));
STATES.put(7, casting(FrameNode.class, (insn, memory) ->
memory.locals.get(memory.chunkIndex).equals(CHUNK_CLASS) &&
memory.locals.get(memory.biomeArrayIndex).equals("[B") &&
memory.locals.get(memory.iteratorIndex).equals(1)
? 8 : 0));
STATES.put(8, casting(VarInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.ILOAD &&
insn.var == memory.iteratorIndex) {
memory.tmp = 1;
return 9;
} else if (insn.getOpcode() == Opcodes.ALOAD &&
insn.var == memory.biomeArrayIndex) {
memory.tmp = 2;
return 10;
}
memory.tmp = 0;
return 0;
}));
STATES.put(9, casting(VarInsnNode.class, (insn, memory) -> {
if (memory.tmp == 1) {
if (insn.getOpcode() == Opcodes.ALOAD &&
insn.var == memory.biomeArrayIndex) {
return 10;
}
} else if (memory.tmp == 2) {
if (insn.getOpcode() == Opcodes.ILOAD &&
insn.var == memory.iteratorIndex) {
return 11;
}
}
memory.tmp = 0;
return 0;
}));
STATES.put(10, casting(InsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.ARRAYLENGTH) {
if (memory.tmp == 1) {
return 11;
} else if (memory.tmp == 2) {
return 9;
}
}
memory.tmp = 0;
return 0;
}));
STATES.put(11, casting(JumpInsnNode.class, (insn, memory) -> {
if ((memory.tmp == 1 && insn.getOpcode() == Opcodes.IF_ICMPGE) ||
(memory.tmp == 2 && insn.getOpcode() == Opcodes.IF_ICMPLE)) {
memory.tmp = 0;
return 12;
}
memory.tmp = 0;
return 0;
}));
STATES.put(12, casting(LabelNode.class, 13));
STATES.put(13, casting(VarInsnNode.class, (insn, memory) ->
insn.getOpcode() == Opcodes.ALOAD &&
insn.var == memory.biomeArrayIndex
? 14 : 0));
STATES.put(14, casting(VarInsnNode.class, (insn, memory) ->
insn.getOpcode() == Opcodes.ILOAD &&
insn.var == memory.iteratorIndex
? 15 : 0));
STATES.put(15, casting(VarInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.ALOAD) {
if (insn.var == 0) {
memory.altFlags = 1;
return 16;
} else if (memory.locals.get(insn.var).equals("[L" + BIOME_GEN_BASE_CLASS + ";")) {
memory.altFlags = 0;
memory.biomesForGenerationIndex = insn.var;
return 17;
}
}
return 0;
}));
STATES.put(16, casting(FieldInsnNode.class, (insn, memory) -> {
if ((insn.getOpcode() == Opcodes.GETFIELD || insn.getOpcode() == Opcodes.GETSTATIC) &&
insn.desc.equals("[L" + BIOME_GEN_BASE_CLASS + ";")) {
memory.biomesForGenerationFieldOwner = insn.owner;
memory.biomesForGenerationFieldName = insn.name;
return 17;
}
return 0;
}));
STATES.put(17, casting(VarInsnNode.class, (insn, memory) ->
insn.getOpcode() == Opcodes.ILOAD &&
insn.var == memory.iteratorIndex
? 18 : 0));
STATES.put(18, casting(InsnNode.class, (insn) ->
insn.getOpcode() == Opcodes.AALOAD
? 19 : 0));
STATES.put(19, casting(FieldInsnNode.class, (insn) ->
insn.getOpcode() == Opcodes.GETFIELD &&
insn.owner.equals(BIOME_GEN_BASE_CLASS) &&
insn.name.equals(BIOME_ID_FIELD) &
insn.desc.equals("I")
? 20 : 0));
STATES.put(20, casting(InsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.I2B) {
memory.castInsn = memory.currentInsn;
return 21;
}
return 0;
}));
STATES.put(21, casting(InsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.BASTORE) {
memory.arrayStoreInsn = memory.currentInsn;
return -2;
}
return 0;
}));
}
private static <T> BiFunction<AbstractInsnNode, Memory, Integer> casting(Class<T> clazz, int okState) {
return casting(clazz, (insn, memory) -> okState);
}
private static <T> BiFunction<AbstractInsnNode, Memory, Integer> casting(Class<T> clazz, Function<T, Integer> okCode) {
return casting(clazz, (insn, memory) -> okCode.apply(insn));
}
private static <T> BiFunction<AbstractInsnNode, Memory, Integer> casting(Class<T> clazz, BiFunction<T, Memory, Integer> okCode) {
return (insn, memory) -> {
if (insn instanceof LineNumberNode) {
return -1;
} else if (clazz.isInstance(insn)) {
return okCode.apply(clazz.cast(insn), memory);
} else {
return 0;
}
};
}
@Override
public void transform(final ClassNode cn, final boolean obfuscated) {
for (val method: cn.methods) {
val memory = findTheTarget(method);
if (memory != null) {
val insnList = method.instructions;
for (val node: method.localVariables) {
if (node.desc.equals("[B") && node.index == memory.biomeArrayIndex) {
node.desc = "[S";
}
}
insnList.set(insnList.get(memory.getBiomeArrayInsn), new MethodInsnNode(Opcodes.INVOKEVIRTUAL, "net/minecraft/world/chunk/Chunk", "getBiomeShortArray", "()[S", false));
insnList.set(insnList.get(memory.castInsn), new InsnNode(Opcodes.I2S));
insnList.set(insnList.get(memory.arrayStoreInsn), new InsnNode(Opcodes.SASTORE));
}
}
}
private static Memory findTheTarget(MethodNode method) {
val insnList = method.instructions;
int state = 0;
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 = STATES.get(state).apply(insn, memory);
switch (newState) {
case -1:
continue;
case -2:
return memory;
default:
state = newState;
}
}
return null;
}
@Data
private static class Memory {
int currentInsn;
int startingInsn;
int getBiomeArrayInsn;
int castInsn;
int arrayStoreInsn;
int chunkIndex;
int biomeArrayIndex;
int iteratorIndex;
long altFlags;
String biomesForGenerationFieldOwner;
String biomesForGenerationFieldName;
int biomesForGenerationIndex;
int tmp;
final List<Object> locals = new ArrayList<>();
}
}
@@ -0,0 +1,19 @@
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) {
for (val method: cn.methods) {
if (method.name.equals("generate")) {
val iterator = method.instructions.iterator();
iterator.add(new InsnNode(Opcodes.RETURN));
}
}
}
}
@@ -0,0 +1,30 @@
package com.falsepattern.endlessids.mixin.helpers;
import lombok.val;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import java.util.function.IntFunction;
import static com.falsepattern.endlessids.EndlessIDs.BIOME_ARRAY_PLACEHOLDER;
public class BiomePatchHelper {
public static byte[] getBiomeArrayTweaked(Chunk chunk, IntFunction<BiomeGenBase> biomesForGeneration) {
val chunkBiomes = ((IChunkMixin) chunk).getBiomeShortArray();
for (int i = 0; i < chunkBiomes.length; ++i) {
chunkBiomes[i] = (short) biomesForGeneration.apply(i).biomeID;
}
return BIOME_ARRAY_PLACEHOLDER;
}
public static byte[] getBiomeArrayTweaked(Chunk chunk, BiomeGenBase[] biomesForGeneration) {
val chunkBiomes = ((IChunkMixin) chunk).getBiomeShortArray();
for (int i = 0; i < chunkBiomes.length; ++i) {
chunkBiomes[i] = (short) biomesForGeneration[i].biomeID;
}
return BIOME_ARRAY_PLACEHOLDER;
}
}
@@ -0,0 +1,21 @@
package com.falsepattern.endlessids.mixin.helpers;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class ShortUtil {
public static int unsignedShortToInt(short s) {
return s & 65535;
}
public static int[] unsignedShortToIntArray(short[] shorts) {
int[] ints = new int[shorts.length];
for(int i = 0; i < shorts.length; ++i) {
ints[i] = unsignedShortToInt(shorts[i]);
}
return ints;
}
}
@@ -0,0 +1,44 @@
package com.falsepattern.endlessids.mixin.mixins.client.biomewand;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
import com.spacechase0.minecraft.biomewand.BiomeWandMod;
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.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagByte;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
@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,63 @@
package com.falsepattern.endlessids.mixin.mixins.common.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.Inject;
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;
}
}
}
}
@@ -16,7 +16,8 @@ import java.io.File;
@Mixin(value = AntiIdConflictBase.class,
remap = false)
public abstract class AntiIdConflictBaseMixin {
@Shadow public static File mainFolder;
@Shadow
public static File mainFolder;
@Inject(method = "preinit",
at = @At("HEAD"),
@@ -10,9 +10,7 @@ import org.apache.commons.lang3.ArrayUtils;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
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.ModifyArg;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import net.minecraft.world.biome.BiomeGenBase;
@@ -25,15 +23,20 @@ import static code.elix_x.coremods.antiidconflict.managers.BiomesManager.conflic
@Mixin(value = BiomesManager.class,
remap = false)
public abstract class BiomesManagerMixin {
@Shadow public static String freeBiomeIDs;
@Shadow
public static String freeBiomeIDs;
@Shadow public static String occupiedBiomeIDs;
@Shadow
public static String occupiedBiomeIDs;
@Shadow public static boolean debug;
@Shadow
public static boolean debug;
@Shadow public static int IconflictedIds;
@Shadow
public static int IconflictedIds;
@Shadow public static String conflictedIds;
@Shadow
public static String conflictedIds;
private static String[] getIntervalNaming(int first, int last) {
if (first == last) {
@@ -44,6 +47,7 @@ public abstract class BiomesManagerMixin {
return new String[]{first + "-" + last};
}
}
@ModifyConstant(method = "<clinit>",
constant = @Constant(intValue = VanillaConstants.biomeIDCount),
require = 1)
@@ -77,13 +81,13 @@ public abstract class BiomesManagerMixin {
++BiomesManager.freeIds;
} else if (hasEmpty) {
hasEmpty = false;
for (val part: getIntervalNaming(emptyRegionStart, i - 1)) {
for (val part : getIntervalNaming(emptyRegionStart, i - 1)) {
builder.append(part).append('\n');
}
}
}
if (hasEmpty) {
for (val part: getIntervalNaming(emptyRegionStart, ExtendedConstants.biomeIDCount - 1)) {
for (val part : getIntervalNaming(emptyRegionStart, ExtendedConstants.biomeIDCount - 1)) {
builder.append(part).append('\n');
}
}
@@ -180,13 +184,13 @@ public abstract class BiomesManagerMixin {
hasEmpty = false;
emptyRegionStart = 0;
for(int i = 0; i < biomes.length; ++i) {
for (int i = 0; i < biomes.length; ++i) {
if (!ArrayUtils.isEmpty(conflicts) && conflicts[i] != null) {
writer.println(conflicts[i].getCrashMessage());
} else if (biomes[i] != null) {
if (hasEmpty) {
hasEmpty = false;
for (val part: getIntervalNaming(emptyRegionStart, i - 1)) {
for (val part : getIntervalNaming(emptyRegionStart, i - 1)) {
writer.print(part);
writer.println(" is Available");
}
@@ -203,7 +207,7 @@ public abstract class BiomesManagerMixin {
}
}
if (hasEmpty) {
for (val part: getIntervalNaming(emptyRegionStart, ExtendedConstants.biomeIDCount - 1)) {
for (val part : getIntervalNaming(emptyRegionStart, ExtendedConstants.biomeIDCount - 1)) {
writer.print(part);
writer.println(" is Available");
}
@@ -0,0 +1,49 @@
package com.falsepattern.endlessids.mixin.mixins.common.antiqueatlas;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
import com.falsepattern.endlessids.mixin.helpers.ShortUtil;
import hunternif.mc.atlas.core.BiomeDetectorBase;
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;
import net.minecraft.world.chunk.Chunk;
@Mixin(value = BiomeDetectorBase.class,
remap = false)
public abstract class BiomeDetectorBaseMixin {
@ModifyConstant(method = "<clinit>",
constant = @Constant(intValue = VanillaConstants.biomeIDCount),
require = 2)
private static int extendIDs(int constant) {
return ExtendedConstants.biomeIDCount;
}
private Chunk chunk;
@Redirect(method = "getBiomeID",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B",
remap = true),
require = 1)
private byte[] disableGetter(Chunk instance) {
chunk = instance;
return null;
}
@Redirect(method = "getBiomeID",
at = @At(value = "INVOKE",
target = "Lhunternif/mc/atlas/util/ByteUtil;unsignedByteToIntArray([B)[I"),
require = 1)
private int[] biomeIDs(byte[] i) {
try {
return ShortUtil.unsignedShortToIntArray(((IChunkMixin)chunk).getBiomeShortArray());
} finally {
chunk = null;
}
}
}
@@ -0,0 +1,38 @@
package com.falsepattern.endlessids.mixin.mixins.common.antiqueatlas;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
import com.falsepattern.endlessids.mixin.helpers.ShortUtil;
import hunternif.mc.atlas.core.BiomeDetectorNether;
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 = BiomeDetectorNether.class,
remap = false)
public abstract class BiomeDetectorNetherMixin {
private Chunk chunk;
@Redirect(method = "getBiomeID",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B",
remap = true),
require = 1)
private byte[] disableGetter(Chunk instance) {
chunk = instance;
return null;
}
@Redirect(method = "getBiomeID",
at = @At(value = "INVOKE",
target = "Lhunternif/mc/atlas/util/ByteUtil;unsignedByteToIntArray([B)[I"),
require = 1)
private int[] biomeIDs(byte[] i) {
try {
return ShortUtil.unsignedShortToIntArray(((IChunkMixin)chunk).getBiomeShortArray());
} finally {
chunk = null;
}
}
}
@@ -1,40 +0,0 @@
package com.falsepattern.endlessids.mixin.mixins.common.atg;
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.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import ttftcuts.atg.ATGChunkProvider;
import net.minecraft.block.Block;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
@Mixin(value = ATGChunkProvider.class,
remap = false)
public abstract class ATGChunkProviderMixin {
@Shadow
private BiomeGenBase[] biomesForGeneration;
@Inject(method = "provideChunk",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B",
remap = true,
shift = At.Shift.BEFORE),
cancellable = true,
remap = true,
locals = LocalCapture.CAPTURE_FAILHARD,
require = 1)
private void hijackChunkBiomeSetup(int chunkX, int chunkY, CallbackInfoReturnable<Chunk> cir, Block[] data, byte[] abyte, Chunk chunk) {
val chunkBiomes = ((IChunkMixin) chunk).getBiomeShortArray();
for (int i = 0; i < chunkBiomes.length; i++) {
chunkBiomes[i] = (short) biomesForGeneration[i].biomeID;
}
chunk.generateSkylightMap();
cir.setReturnValue(chunk);
}
}
@@ -0,0 +1,54 @@
package com.falsepattern.endlessids.mixin.mixins.common.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.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);
}
}
}
}
@@ -9,7 +9,14 @@ import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(value = BOPBiomeManager.class,
remap = false)
public abstract class BoPBiomeManagerMixin {
public abstract class BOPBiomeManagerMixin {
@ModifyConstant(method = "<clinit>",
constant = @Constant(intValue = 40),
require = 1)
private static int shiftBiomeIDsUp(int id) {
return id + 14000;
}
@ModifyConstant(method = "getNextFreeBiomeId",
constant = @Constant(intValue = VanillaConstants.biomeIDCount),
require = 1)
@@ -0,0 +1,23 @@
package com.falsepattern.endlessids.mixin.mixins.common.darkworld;
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),
@Constant(intValue = 101),
@Constant(intValue = 102),
@Constant(intValue = 103),
@Constant(intValue = 104),
@Constant(intValue = 105),
@Constant(intValue = 106)},
require = 7)
private static int shiftBiomeIDsUp(int id) {
return id + 10000;
}
}
@@ -0,0 +1,19 @@
package com.falsepattern.endlessids.mixin.mixins.common.dev.spacecore;
import com.spacechase0.minecraft.spacecore.mcp.ModInfoGenerator;
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.callback.CallbackInfo;
@Mixin(value = ModInfoGenerator.class,
remap = false)
public abstract class ModInfoGeneratorMixin {
@Inject(method = "generate",
at = @At("HEAD"),
cancellable = true,
require = 1)
private static void noGenerate(CallbackInfo ci) {
ci.cancel();
}
}
@@ -0,0 +1,97 @@
package com.falsepattern.endlessids.mixin.mixins.common.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.ModifyVariable;
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 + 13000;
}
@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,54 @@
package com.falsepattern.endlessids.mixin.mixins.common.extrautilities;
import com.falsepattern.endlessids.EndlessIDs;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
import com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime;
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 = ChunkProviderEndOfTime.class,
remap = false)
public abstract class ChunkProviderEndOfTimeMixin {
private int id;
private Chunk chunk;
@Redirect(method = "provideChunk",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B",
remap = true),
remap = true,
require = 1)
private byte[] setBiomesTweaked1(Chunk instance) {
chunk = instance;
return EndlessIDs.BIOME_ARRAY_PLACEHOLDER;
}
@Redirect(method = "provideChunk",
at = @At(value = "FIELD",
target = "Lnet/minecraft/world/biome/BiomeGenBase;biomeID:I",
remap = true),
remap = true)
private int setBiomesTweaked2(BiomeGenBase instance) {
return id = instance.biomeID;
}
@Redirect(method = "provideChunk",
at = @At(value = "INVOKE",
target = "Ljava/util/Arrays;fill([BB)V"),
remap = true,
require = 1)
private void setBiomesTweaked3(byte[] bytes, byte b) {
try {
Arrays.fill(((IChunkMixin) chunk).getBiomeShortArray(), (short) id);
} finally {
chunk = null;
id = -1;
}
}
}
@@ -0,0 +1,16 @@
package com.falsepattern.endlessids.mixin.mixins.common.futurepack;
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 id + 11000;
}
}
@@ -0,0 +1,28 @@
package com.falsepattern.endlessids.mixin.mixins.common.galacticraft;
import com.falsepattern.endlessids.mixin.helpers.BiomePatchHelper;
import futurepack.common.dim.ChunkProviderSpace;
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.Shadow;
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;
@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);
}
}
@@ -0,0 +1,18 @@
package com.falsepattern.endlessids.mixin.mixins.common.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 + 12000;
}
}
@@ -1,6 +1,6 @@
package com.falsepattern.endlessids.mixin.mixins.common.rtg;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
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;
@@ -25,13 +25,8 @@ public abstract class ChunkProviderRTGMixin {
remap = true),
remap = true,
require = 1)
private byte[] redictBiomeArrayFillLogic(Chunk chunk) {
short[] biomes = ((IChunkMixin) chunk).getBiomeShortArray();
for (int i = 0; i < biomes.length; ++i) {
biomes[i] = (short) baseBiomesList[xyinverted[i]].biomeID;
}
return new byte[0];
private byte[] setBiomesTweaked(Chunk chunk) {
return BiomePatchHelper.getBiomeArrayTweaked(chunk, (i) -> baseBiomesList[xyinverted[i]]);
}
@Redirect(method = "provideChunk",
@@ -0,0 +1,37 @@
package com.falsepattern.endlessids.mixin.mixins.common.thaumcraft;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import thaumcraft.common.lib.network.PacketHandler;
import thaumcraft.common.lib.network.misc.PacketBiomeChange;
import thaumcraft.common.lib.utils.Utils;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import cpw.mods.fml.common.network.NetworkRegistry;
@Mixin(value = Utils.class,
remap = false)
public abstract class UtilsMixin {
/**
* @author FalsePattern
* @reason Biome ID Extension
*/
@Overwrite
public static void setBiomeAt(World world, int x, int z, BiomeGenBase biome) {
if (biome != null) {
Chunk chunk = world.getChunkFromBlockCoords(x, z);
short[] array = ((IChunkMixin) chunk).getBiomeShortArray();
array[(z & 15) << 4 | x & 15] = (short) (biome.biomeID);
if (!world.isRemote) {
PacketHandler.INSTANCE.sendToAllAround(new PacketBiomeChange(x, z, (short) biome.biomeID),
new NetworkRegistry.TargetPoint(world.provider.dimensionId, x,
world.getHeightValue(x, z), z,
32.0));
}
}
}
}
@@ -0,0 +1,19 @@
package com.falsepattern.endlessids.mixin.mixins.common.tropicraft;
import com.falsepattern.endlessids.constants.VanillaConstants;
import net.tropicraft.world.genlayer.GenLayerTropiVoronoiZoom;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(value = GenLayerTropiVoronoiZoom.class,
remap = false)
public abstract class GenLayerTropiVoronoiZoomMixin {
@ModifyConstant(method = "getInts",
constant = @Constant(intValue = VanillaConstants.biomeIDMask),
remap = true,
require = 1)
private int fixStupidBitMask(int constant) {
return 0xFFFFFFFF;
}
}
@@ -0,0 +1,40 @@
package com.falsepattern.endlessids.mixin.mixins.common.twilightforest;
import com.falsepattern.endlessids.PlaceholderBiome;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
import lombok.val;
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;
import twilightforest.biomes.TFBiomeBase;
import net.minecraft.world.biome.BiomeGenBase;
@Mixin(value = TFBiomeBase.class,
remap = false)
public abstract class TFBiomeBaseMixin {
@ModifyConstant(method = "findNextOpenBiomeId",
constant = @Constant(intValue = VanillaConstants.biomeIDCount),
require = 1)
private static int extendIDs(int constant) {
return ExtendedConstants.biomeIDCount;
}
@Redirect(method = "isConflictAtBiomeID",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/biome/BiomeGenBase;getBiome(I)Lnet/minecraft/world/biome/BiomeGenBase;",
remap = true),
require = 1)
private static BiomeGenBase ignorePlaceholders(int id) {
val biome = BiomeGenBase.getBiome(id);
if (biome instanceof PlaceholderBiome) {
BiomeGenBase.getBiomeGenArray()[id] = null;
return null;
} else {
return biome;
}
}
}
@@ -19,7 +19,8 @@ public abstract class BiomeUndergroundDecoratorMixin {
@Redirect(method = {"replaceChunkOres(IILnet/minecraft/world/World;)V",
"replaceChunkOres(Lnet/minecraft/world/chunk/IChunkProvider;II)V"},
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getBlockLSBArray()[B"),
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getBlockLSBArray()[B",
remap = true),
require = 2)
private byte[] returnMSBasLSB(ExtendedBlockStorage instance) {
if (ebs == null) {
@@ -33,7 +34,8 @@ public abstract class BiomeUndergroundDecoratorMixin {
@Redirect(method = {"replaceChunkOres(IILnet/minecraft/world/World;)V",
"replaceChunkOres(Lnet/minecraft/world/chunk/IChunkProvider;II)V"},
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getBlockMSBArray()Lnet/minecraft/world/chunk/NibbleArray;"),
target = "Lnet/minecraft/world/chunk/storage/ExtendedBlockStorage;getBlockMSBArray()Lnet/minecraft/world/chunk/NibbleArray;",
remap = true),
require = 4)
private NibbleArray returnFakeArray(ExtendedBlockStorage instance) {
return fakeArray == null ? (fakeArray = new NibbleArray(4096, 4)) : fakeArray;
@@ -42,7 +44,8 @@ public abstract class BiomeUndergroundDecoratorMixin {
@Redirect(method = {"replaceChunkOres(IILnet/minecraft/world/World;)V",
"replaceChunkOres(Lnet/minecraft/world/chunk/IChunkProvider;II)V"},
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/NibbleArray;get(III)I"),
target = "Lnet/minecraft/world/chunk/NibbleArray;get(III)I",
remap = true),
require = 2)
private int returnRestOfID(NibbleArray instance, int x, int y, int z) {
return ebs.get().getLSB()[y << 8 | z << 4 | x] & 0xFFFF;
@@ -1,6 +1,5 @@
package com.falsepattern.endlessids.mixin.mixins.common.vanilla.biome;
import com.falsepattern.endlessids.EndlessIDs;
import com.falsepattern.endlessids.PlaceholderBiome;
import lombok.val;
import org.spongepowered.asm.mixin.Mixin;
@@ -11,8 +10,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeDictionary;
import java.util.Arrays;
@Mixin(value = BiomeDictionary.class,
remap = false)
public abstract class BiomeDictionaryMixin {
@@ -21,7 +21,8 @@ import net.minecraft.world.chunk.Chunk;
import java.util.Arrays;
@Mixin(value = Chunk.class, priority = 900)
@Mixin(value = Chunk.class,
priority = 900)
public abstract class ChunkMixin implements IChunkMixin {
@Shadow
@Final
@@ -30,8 +31,9 @@ public abstract class ChunkMixin implements IChunkMixin {
@Final
public int zPosition;
@Shadow
public World worldObj;
@Shadow
private byte[] blockBiomeArray;
@Shadow public World worldObj;
private short[] blockBiomeShortArray;
@Inject(method = "<init>(Lnet/minecraft/world/World;II)V",
@@ -1,58 +0,0 @@
package com.falsepattern.endlessids.mixin.mixins.common.vanilla.worldgen;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
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.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.gen.ChunkProviderEnd;
import java.util.Random;
@Mixin(ChunkProviderEnd.class)
public abstract class ChunkProviderEndMixin {
@Shadow
private Random endRNG;
@Shadow
private BiomeGenBase[] biomesForGeneration;
@Shadow
private World endWorld;
@Shadow
public abstract void func_147420_a(int p_147420_1_, int p_147420_2_, Block[] p_147420_3_, BiomeGenBase[] p_147420_4_);
@Shadow(remap = false)
public abstract void replaceBiomeBlocks(int p_147421_1_, int p_147421_2_, Block[] p_147421_3_, BiomeGenBase[] p_147421_4_, byte[] meta);
/**
* @author FalsePattern
* @reason Direct port from decompiled code
*/
@Overwrite
public Chunk provideChunk(int x, int z) {
this.endRNG.setSeed((long) x * 341873128712L + (long) z * 132897987541L);
Block[] blocks = new Block[32768];
byte[] metadatas = new byte[blocks.length];
this.biomesForGeneration = this.endWorld.getWorldChunkManager()
.loadBlockGeneratorData(this.biomesForGeneration, x * 16, z * 16, 16,
16);
this.func_147420_a(x, z, blocks, this.biomesForGeneration);
this.replaceBiomeBlocks(x, z, blocks, this.biomesForGeneration, metadatas);
Chunk chunk = new Chunk(this.endWorld, blocks, metadatas, x, z);
short[] biomes = ((IChunkMixin) chunk).getBiomeShortArray();
for (int i = 0; i < biomes.length; ++i) {
biomes[i] = (short) this.biomesForGeneration[i].biomeID;
}
chunk.generateSkylightMap();
return chunk;
}
}
@@ -1,81 +0,0 @@
package com.falsepattern.endlessids.mixin.mixins.common.vanilla.worldgen;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
import org.spongepowered.asm.mixin.Final;
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.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
import net.minecraft.world.gen.ChunkProviderFlat;
import net.minecraft.world.gen.MapGenBase;
import java.util.List;
@Mixin(ChunkProviderFlat.class)
public abstract class ChunkProviderFlatMixin implements IChunkProvider {
@Shadow
private World worldObj;
@Shadow
@Final
private Block[] cachedBlockIDs;
@Shadow
@Final
private byte[] cachedBlockMetadata;
@Shadow
@Final
private List structureGenerators;
/**
* @author FalsePattern
* @reason Direct port from dumped code
*/
@Overwrite
public Chunk provideChunk(int x, int z) {
Chunk chunk = new Chunk(this.worldObj, x, z);
for (int Y = 0; Y < this.cachedBlockIDs.length; ++Y) {
Block block = this.cachedBlockIDs[Y];
if (block != null) {
int ebsID = Y >> 4;
ExtendedBlockStorage ebs = chunk.getBlockStorageArray()[ebsID];
if (ebs == null) {
ebs = new ExtendedBlockStorage(Y, !this.worldObj.provider.hasNoSky);
chunk.getBlockStorageArray()[ebsID] = ebs;
}
for (int X = 0; X < 16; ++X) {
for (int Z = 0; Z < 16; ++Z) {
ebs.func_150818_a(X, Y & 15, Z, block);
ebs.setExtBlockMetadata(X, Y & 15, Z, this.cachedBlockMetadata[Y]);
}
}
}
}
chunk.generateSkylightMap();
BiomeGenBase[] bgb = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(null, x * 16, z * 16, 16, 16);
short[] biomeArray = ((IChunkMixin) chunk).getBiomeShortArray();
for (int i = 0; i < biomeArray.length; ++i) {
biomeArray[i] = (short) bgb[i].biomeID;
}
for (Object o : this.structureGenerators) {
MapGenBase structureGenerator = (MapGenBase) o;
structureGenerator.func_151539_a(this, this.worldObj, x, z, null);
}
chunk.generateSkylightMap();
return chunk;
}
}
@@ -1,86 +0,0 @@
package com.falsepattern.endlessids.mixin.mixins.common.vanilla.worldgen;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
import org.spongepowered.asm.mixin.Final;
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.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.ChunkProviderGenerate;
import net.minecraft.world.gen.MapGenBase;
import net.minecraft.world.gen.structure.MapGenMineshaft;
import net.minecraft.world.gen.structure.MapGenScatteredFeature;
import net.minecraft.world.gen.structure.MapGenStronghold;
import net.minecraft.world.gen.structure.MapGenVillage;
import java.util.Random;
@Mixin(ChunkProviderGenerate.class)
public abstract class ChunkProviderGenerateMixin implements IChunkProvider {
@Shadow
private Random rand;
@Shadow
private BiomeGenBase[] biomesForGeneration;
@Shadow
private World worldObj;
@Shadow
private MapGenBase caveGenerator;
@Shadow
private MapGenBase ravineGenerator;
@Shadow
@Final
private boolean mapFeaturesEnabled;
@Shadow
private MapGenMineshaft mineshaftGenerator;
@Shadow
private MapGenVillage villageGenerator;
@Shadow
private MapGenStronghold strongholdGenerator;
@Shadow
private MapGenScatteredFeature scatteredFeatureGenerator;
@Shadow
public abstract void func_147424_a(int p_147424_1_, int p_147424_2_, Block[] p_147424_3_);
@Shadow
public abstract void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_);
/**
* @author FalsePattern
* @reason Direct port from dumped code
*/
@Overwrite
public Chunk provideChunk(int x, int z) {
this.rand.setSeed((long) x * 341873128712L + (long) z * 132897987541L);
Block[] blocks = new Block[65536];
byte[] metadata = new byte[65536];
this.func_147424_a(x, z, blocks);
this.biomesForGeneration = this.worldObj.getWorldChunkManager()
.loadBlockGeneratorData(this.biomesForGeneration, x * 16, z * 16, 16,
16);
this.replaceBlocksForBiome(x, z, blocks, metadata, this.biomesForGeneration);
this.caveGenerator.func_151539_a(this, this.worldObj, x, z, blocks);
this.ravineGenerator.func_151539_a(this, this.worldObj, x, z, blocks);
if (this.mapFeaturesEnabled) {
this.mineshaftGenerator.func_151539_a(this, this.worldObj, x, z, blocks);
this.villageGenerator.func_151539_a(this, this.worldObj, x, z, blocks);
this.strongholdGenerator.func_151539_a(this, this.worldObj, x, z, blocks);
this.scatteredFeatureGenerator.func_151539_a(this, this.worldObj, x, z, blocks);
}
Chunk chunk = new Chunk(this.worldObj, blocks, metadata, x, z);
short[] biomes = ((IChunkMixin) chunk).getBiomeShortArray();
for (int i = 0; i < biomes.length; ++i) {
biomes[i] = (short) this.biomesForGeneration[i].biomeID;
}
chunk.generateSkylightMap();
return chunk;
}
}
@@ -1,61 +0,0 @@
package com.falsepattern.endlessids.mixin.mixins.common.vanilla.worldgen;
import com.falsepattern.endlessids.mixin.helpers.IChunkMixin;
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.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.ChunkProviderHell;
import net.minecraft.world.gen.MapGenBase;
import net.minecraft.world.gen.structure.MapGenNetherBridge;
import java.util.Random;
@Mixin(ChunkProviderHell.class)
public abstract class ChunkProviderHellMixin implements IChunkProvider {
@Shadow
public MapGenNetherBridge genNetherBridge;
@Shadow
private Random hellRNG;
@Shadow
private World worldObj;
@Shadow
private MapGenBase netherCaveGenerator;
@Shadow
public abstract void func_147419_a(int p_147419_1_, int p_147419_2_, Block[] p_147419_3_);
@Shadow(remap = false)
public abstract void replaceBiomeBlocks(int p_147418_1_, int p_147418_2_, Block[] p_147418_3_, byte[] meta, BiomeGenBase[] biomes);
/**
* @author FalsePattern
* @reason Direct port from dumped code
*/
@Overwrite
public Chunk provideChunk(int x, int z) {
this.hellRNG.setSeed((long) x * 341873128712L + (long) z * 132897987541L);
Block[] blocks = new Block[32768];
byte[] metadata = new byte[blocks.length];
BiomeGenBase[] bgb = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(null, x * 16, z * 16, 16, 16);
this.func_147419_a(x, z, blocks);
this.replaceBiomeBlocks(x, z, blocks, metadata, bgb);
this.netherCaveGenerator.func_151539_a(this, this.worldObj, x, z, blocks);
this.genNetherBridge.func_151539_a(this, this.worldObj, x, z, blocks);
Chunk chunk = new Chunk(this.worldObj, blocks, metadata, x, z);
short[] biomes = ((IChunkMixin) chunk).getBiomeShortArray();
for (int i = 0; i < biomes.length; ++i) {
biomes[i] = (short) bgb[i].biomeID;
}
chunk.resetRelightChecks();
return chunk;
}
}
@@ -43,10 +43,6 @@ public enum Mixin implements IMixin {
WorldMixin(Side.COMMON, always(), "vanilla.misc.WorldMixin"),
//endregion Minecraft->common->misc
//region Minecraft->common->worldgen
ChunkProviderEndMixin(Side.COMMON, always(), "vanilla.worldgen.ChunkProviderEndMixin"),
ChunkProviderFlatMixin(Side.COMMON, always(), "vanilla.worldgen.ChunkProviderFlatMixin"),
ChunkProviderGenerateMixin(Side.COMMON, always(), "vanilla.worldgen.ChunkProviderGenerateMixin"),
ChunkProviderHellMixin(Side.COMMON, always(), "vanilla.worldgen.ChunkProviderHellMixin"),
GenLayerRiverMixMixin(Side.COMMON, avoid(TargetedMod.DRAGONAPI), "vanilla.worldgen.GenLayerRiverMixMixin"),
GenLayerVoronoiZoomMixin(Side.COMMON, always(), "vanilla.worldgen.GenLayerVoronoiZoomMixin"),
//endregion Minecraft->common->worldgen
@@ -58,34 +54,51 @@ public enum Mixin implements IMixin {
RenderGlobalMixin(Side.CLIENT, always(), "vanilla.RenderGlobalMixin"),
//endregion Minecraft->client
//endregion Minecraft
//region AntiIDConflict->common
AIDCAntiIdConflictBaseMixin(Side.COMMON, require(TargetedMod.ANTIIDCONFLICT),
"antiidconflict.AntiIdConflictBaseMixin"),
AIDCBiomesGenBasePlaceholderMixin(Side.COMMON, require(TargetedMod.ANTIIDCONFLICT),
"antiidconflict.BiomeGenBasePlaceholderMixin"),
AIDCBiomesManagerMixin(Side.COMMON, require(TargetedMod.ANTIIDCONFLICT),
"antiidconflict.BiomesManagerMixin"),
AIDCDimensionsManagerMixin(Side.COMMON, require(TargetedMod.ANTIIDCONFLICT),
"antiidconflict.DimensionsManagerMixin"),
AIDCEnchantementsManagerMixin(Side.COMMON, require(TargetedMod.ANTIIDCONFLICT),
"antiidconflict.EnchantementsManagerMixin"),
AIDCEntitiesManagerMixin(Side.COMMON, require(TargetedMod.ANTIIDCONFLICT),
"antiidconflict.EntitiesManagerMixin"),
AIDCPotionsManagerMixin(Side.COMMON, require(TargetedMod.ANTIIDCONFLICT),
"antiidconflict.PotionsManagerMixin"),
//endregion AntiIDConflict->common
//region AbyssalCraft->common
AbyssalCraftMixin(Side.COMMON, require(TargetedMod.ABYSSALCRAFT), "abyssalcraft.AbyssalCraftMixin"),
//endregion AbyssalCraft->common
//region ATG->common
ATGBiomeConfigMixin(Side.COMMON, require(TargetedMod.ATG), "atg.ATGBiomeConfigMixin"),
ATGBiomeManagerMixin(Side.COMMON, require(TargetedMod.ATG), "atg.ATGBiomeManagerMixin"),
ATGChunkProviderMixin(Side.COMMON, require(TargetedMod.ATG), "atg.ATGChunkProviderMixin"),
ATGWorldGenRocksMixin(Side.COMMON, require(TargetedMod.ATG), "atg.ATGWorldGenRocksMixin"),
//endregion ATG->common
//region AntiqueAtlas->commond
BiomeDetectorBaseMixin(Side.COMMON, require(TargetedMod.ANTIQUEATLAS), "antiqueatlas.BiomeDetectorBaseMixin"),
BiomeDetectorNetherMixin(Side.COMMON, require(TargetedMod.ANTIQUEATLAS), "antiqueatlas.BiomeDetectorNetherMixin"),
//endregion AntiqueAtlas->commond
//region AntiIDConflict->common
AIDCAntiIdConflictBaseMixin(Side.COMMON, require(TargetedMod.ANTIIDCONFLICT),
"antiidconflict.AntiIdConflictBaseMixin"),
AIDCBiomesGenBasePlaceholderMixin(Side.COMMON, require(TargetedMod.ANTIIDCONFLICT),
"antiidconflict.BiomeGenBasePlaceholderMixin"),
AIDCBiomesManagerMixin(Side.COMMON, require(TargetedMod.ANTIIDCONFLICT), "antiidconflict.BiomesManagerMixin"),
AIDCDimensionsManagerMixin(Side.COMMON, require(TargetedMod.ANTIIDCONFLICT),
"antiidconflict.DimensionsManagerMixin"),
AIDCEnchantementsManagerMixin(Side.COMMON, require(TargetedMod.ANTIIDCONFLICT),
"antiidconflict.EnchantementsManagerMixin"),
AIDCEntitiesManagerMixin(Side.COMMON, require(TargetedMod.ANTIIDCONFLICT), "antiidconflict.EntitiesManagerMixin"),
AIDCPotionsManagerMixin(Side.COMMON, require(TargetedMod.ANTIIDCONFLICT), "antiidconflict.PotionsManagerMixin"),
//endregion AntiIDConflict->common
//region BoP->common
BoPBiomeManagerMixin(Side.COMMON, require(TargetedMod.BOP), "bop.BoPBiomeManagerMixin"),
BOPBiomeManagerMixin(Side.COMMON, require(TargetedMod.BOP), "bop.BOPBiomeManagerMixin"),
//endregion BoP->common
//region BiomeTweaker->common
BiomeEventHandlerMixin(Side.COMMON, require(TargetedMod.BIOMETWEAKER), "biometweaker.BiomeEventHandlerMixin"),
//endregion BiomeTweaker->common
//region Biome Wand
//region Biome Wand->client
BiomeWandItemClientMixin(Side.CLIENT, require(TargetedMod.BIOMEWAND), "biomewand.BiomeWandItemMixin"),
//endregion Biome Wand->client
//region Biome Wand->common
BiomeWandItemMixin(Side.COMMON, require(TargetedMod.BIOMEWAND), "biomewand.BiomeWandItemMixin"),
//endregion Biome Wand->common
//endregion Biome Wand
//region CoFHLib->common
CoFHLibCofhBlockHelperMixin(Side.COMMON, require(TargetedMod.COFHLIB), "cofhlib.BlockHelperMixin"),
//endregion CoFHLib->common
//region DarkWorld->common
DarkWorldModBiomesMixin(Side.COMMON, require(TargetedMod.DARKWORLD), "darkworld.ModBiomesMixin"),
//endregion DarkWorld->common
//region DragonAPI->common
//region DragonAPI->common->vanilla
DragonAPIGenLayerRiverMixMixin(Side.COMMON, require(TargetedMod.DRAGONAPI),
@@ -95,13 +108,23 @@ public enum Mixin implements IMixin {
DragonAPIBlockPropertiesMixin(Side.COMMON, require(TargetedMod.DRAGONAPI), "dragonapi.BlockPropertiesMixin"),
DragonAPIIDTypeMixin(Side.COMMON, require(TargetedMod.DRAGONAPI), "dragonapi.IDTypeMixin"),
//endregion DragonAPI->common
//region Erebus->common
ErebusModBiomesMixin(Side.COMMON, require(TargetedMod.EREBUS), "erebus.ModBiomesMixin"),
//endregion Erebus->common
//region ExtraUtilities->common
ChunkProviderEndOfTimeMixin(Side.COMMON, require(TargetedMod.EXTRAUTILITIES), "extrautilities.ChunkProviderEndOfTimeMixin"),
//endregion ExtraUtilities->common
//region Futurepack->common
FuturepackBiomeGenSpaceMixin(Side.COMMON, require(TargetedMod.FUTUREPACK), "futurepack.BiomeGenSpaceMixin"),
//endregion Futurepack->common
//region GalactiCraftCore->common
GalactiCraftCoreConfigManagerCoreMixin(Side.COMMON, require(TargetedMod.GALACTICRAFTCORE),
GalactiCraftChunkProviderOrbitMixin(Side.COMMON, require(TargetedMod.GALACTICRAFTCORE),
"galacticraft.ChunkProviderOrbitMixin"),
GalactiCraftConfigManagerCoreMixin(Side.COMMON, require(TargetedMod.GALACTICRAFTCORE),
"galacticraft.ConfigManagerCoreMixin"),
//endregion GalactiCraftCore->common
//region ICG->common
ICGMysteriumPatchesFixesCaveMixin(Side.COMMON, require(TargetedMod.ICG),
"icg.MysteriumPatchesFixesCaveMixin"),
ICGMysteriumPatchesFixesCaveMixin(Side.COMMON, require(TargetedMod.ICG), "icg.MysteriumPatchesFixesCaveMixin"),
//endregion ICG->common
//region MFQM->common
MFQMMixin(Side.COMMON, require(TargetedMod.MFQM), "mfqm.MFQMMixin"),
@@ -111,11 +134,25 @@ public enum Mixin implements IMixin {
//region NaturesCompass->common
NaturesCompassBiomeUtilsMixin(Side.COMMON, require(TargetedMod.NATURESCOMPASS), "naturescompass.BiomeUtilsMixin"),
//endregion NaturesCompass->common
//region Netherlicious->common
NetherliciousBiomeConfigurationMixin(Side.COMMON, require(TargetedMod.NETHERLICIOUS),
"netherlicious.BiomeConfigurationMixin"),
//endregion Netherlicious->common
//region RTG->common
RTGChunkProviderRTGMixin(Side.COMMON, require(TargetedMod.RTG), "rtg.ChunkProviderRTGMixin"),
RTGLandscapeGeneratorMixin(Side.COMMON, require(TargetedMod.RTG), "rtg.LandscapeGeneratorMixin"),
RTGRealisticBiomeBaseMixin(Side.COMMON, require(TargetedMod.RTG), "rtg.RealisticBiomeBaseMixin"),
//endregion RTG->common
//region Thaumcraft->common
ThaumcraftUtilsMixin(Side.COMMON, require(TargetedMod.THAUMCRAFT), "thaumcraft.UtilsMixin"),
//endregion Thaumcraft->common
//region Tropicraft->common
GenLayerTropiVoronoiZoomMixin(Side.COMMON, require(TargetedMod.TROPICRAFT),
"tropicraft.GenLayerTropiVoronoiZoomMixin"),
//endregion Tropicraft->common
//region TwilightForest->common
TFBiomeBaseMixin(Side.COMMON, require(TargetedMod.TWILIGHTFOREST), "twilightforest.TFBiomeBaseMixin"),
//endregion TwilightForest->common
//region UBC->common
UBCOreUBifierMixin(Side.COMMON, require(TargetedMod.UBC), "ubc.OreUBifierMixin"),
UBCBiomeUndergroundDecoratorMixin(Side.COMMON, require(TargetedMod.UBC), "ubc.BiomeUndergroundDecoratorMixin"),
@@ -11,16 +11,28 @@ import static com.falsepattern.lib.mixin.ITargetedMod.PredicateHelpers.startsWit
@RequiredArgsConstructor
public enum TargetedMod implements ITargetedMod {
ANTIIDCONFLICT("Anti ID Conflict", true, startsWith("antiidconflict")),
ABYSSALCRAFT("AbyssalCraft", true, startsWith("abyssalcraft-")),
ATG("Alternate Terrain Generation", true, startsWith("atg")),
ANTIQUEATLAS("Antique Atlas", true, startsWith("antiqueatlas")),
ANTIIDCONFLICT("Anti ID Conflict", true, startsWith("antiidconflict")),
BOP("Biomes O' Plenty", true, startsWith("biomesoplenty-")),
BIOMETWEAKER("Biome Tweaker", true, startsWith("biometweaker-")),
BIOMEWAND("Biome Wand", true, startsWith("1.7.10-biome-wand-").or(startsWith("biome-wand"))),
COFHLIB("CoFH Lib", true, startsWith("cofhlib-")),
DARKWORLD("Dark World", true, startsWith("darkworld-")),
DRAGONAPI("DragonAPI", false, startsWith("dragonapi")),
EREBUS("The Erebus", true, startsWith("theerebus")),
EXTRAUTILITIES("Extra Utilities", true, startsWith("extrautilities-")),
FUTUREPACK("Futurepack", true, startsWith("[1.7.10]futurepack").or(startsWith("futurepack-"))),
GALACTICRAFTCORE("GalactiCraftCore", false, startsWith("galacticraftcore")),
ICG("Immersive Cavegen", true, startsWith("immersivecavegen")),
MFQM("More Fun Quicksand Mod", false, startsWith("morefunquicksandmod-")),
NATURESCOMPASS("Nature's Compass", true, startsWith("naturescompass")),
NETHERLICIOUS("Netherlicious", true, startsWith("netherlicious-")),
RTG("Realistic Terrain Generation", true, startsWith("rtg-")),
THAUMCRAFT("Thaumcraft", true, startsWith("thaumcraft")),
TROPICRAFT("Tropicraft", true, startsWith("tropicraft-")),
TWILIGHTFOREST("Twilight Forest", true, startsWith("twilightforest")),
UBC("Underground Biomes Constructs", false, startsWith("undergroundbiomesconstructs-")),
WORLDEDIT("WorldEdit", false, startsWith("worldedit-")),
;
@@ -0,0 +1,7 @@
package com.falsepattern.endlessids.patching;
public class ClientManager extends CommonManager {
public ClientManager() {
super();
}
}
@@ -0,0 +1,87 @@
package com.falsepattern.endlessids.patching;
import com.falsepattern.endlessids.EndlessIDs;
import com.falsepattern.endlessids.patching.patches.common.Futurepack;
import com.falsepattern.endlessids.patching.patches.common.Tropicraft;
import lombok.SneakyThrows;
import lombok.val;
import cpw.mods.fml.common.Loader;
import java.util.ArrayList;
import java.util.List;
public class CommonManager {
protected final List<Patch> patches = new ArrayList<>();
public CommonManager() {
patches.add(new Tropicraft());
patches.add(new Futurepack());
}
@SneakyThrows
public final void construct() {
for (val patch : patches) {
if (Loader.isModLoaded(patch.modid)) {
try {
if (patch.construct()) {
EndlessIDs.LOG.info("Applied preInit patches for " + patch.modid);
}
} catch (Exception e) {
EndlessIDs.LOG.fatal("Failed to apply preInit patches for " + patch.modid, e);
throw e;
}
}
}
}
@SneakyThrows
public final void preInit() {
for (val patch : patches) {
if (Loader.isModLoaded(patch.modid)) {
try {
if (patch.preInit()) {
EndlessIDs.LOG.info("Applied preInit patches for " + patch.modid);
}
} catch (Exception e) {
EndlessIDs.LOG.fatal("Failed to apply preInit patches for " + patch.modid, e);
throw e;
}
}
}
}
@SneakyThrows
public final void init() {
for (val patch : patches) {
if (Loader.isModLoaded(patch.modid)) {
try {
if (patch.init()) {
EndlessIDs.LOG.info("Applied init patches for " + patch.modid);
}
} catch (Exception e) {
EndlessIDs.LOG.fatal("Failed to apply init patches for " + patch.modid, e);
throw e;
}
}
}
}
@SneakyThrows
public final void postInit() {
for (val patch : patches) {
if (Loader.isModLoaded(patch.modid)) {
try {
if (patch.postInit()) {
EndlessIDs.LOG.info("Applied postInit patches for " + patch.modid);
}
} catch (Exception e) {
EndlessIDs.LOG.fatal("Failed to apply postInit patches for " + patch.modid, e);
throw e;
}
}
}
}
}
@@ -0,0 +1,28 @@
package com.falsepattern.endlessids.patching;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public class Patch {
public final String modid;
@SuppressWarnings("RedundantThrows")
public boolean construct() throws Exception {
return false;
}
@SuppressWarnings("RedundantThrows")
public boolean preInit() throws Exception {
return false;
}
@SuppressWarnings("RedundantThrows")
public boolean init() throws Exception {
return false;
}
@SuppressWarnings("RedundantThrows")
public boolean postInit() throws Exception {
return false;
}
}
@@ -0,0 +1,7 @@
package com.falsepattern.endlessids.patching;
public class ServerManager extends CommonManager {
public ServerManager() {
super();
}
}
@@ -0,0 +1,15 @@
package com.falsepattern.endlessids.patching.patches.common;
import com.falsepattern.endlessids.patching.Patch;
public class Futurepack extends Patch {
public Futurepack() {
super("fp");
}
@Override
public boolean construct() throws Exception {
Class.forName("futurepack.common.dim.BiomeGenSpace");
return true;
}
}
@@ -0,0 +1,15 @@
package com.falsepattern.endlessids.patching.patches.common;
import com.falsepattern.endlessids.patching.Patch;
public class Tropicraft extends Patch {
public Tropicraft() {
super("tropicraft");
}
@Override
public boolean init() throws ClassNotFoundException {
Class.forName("net.tropicraft.world.biomes.BiomeGenTropicraft");
return true;
}
}
+12
View File
@@ -0,0 +1,12 @@
{
"required": true,
"minVersion": "0.7.11",
"package": "com.falsepattern.endlessids.mixin.mixins",
"refmap": "mixins.endlessids.refmap.json",
"target": "@env(PREINIT)",
"compatibilityLevel": "JAVA_8",
"mixins": [
"common.dev.spacecore.ModInfoGeneratorMixin"
]
}