mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-28 19:39:22 +00:00
1.21 (#238)
--------- Co-authored-by: Lumine1909 <133463833+Lumine1909@users.noreply.github.com> Co-authored-by: LittleChest <81231195+LittleChest@users.noreply.github.com>
This commit is contained in:
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Get JDK 17
|
||||
- name: Get JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: "21"
|
||||
|
||||
21
.github/workflows/test.yml
vendored
21
.github/workflows/test.yml
vendored
@@ -12,9 +12,7 @@ jobs:
|
||||
steps:
|
||||
- name: Get repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Get JDK 17
|
||||
- name: Get JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: "21"
|
||||
@@ -29,18 +27,19 @@ jobs:
|
||||
run: |
|
||||
git config --global user.email "ci@leavesmc.org"
|
||||
git config --global user.name "LeavesMC CI"
|
||||
- name: Get Build Number
|
||||
run: bash scripts/GetBuildNumber.sh
|
||||
- name: Apply Patches
|
||||
run: ./gradlew applyPatches
|
||||
- name: Create Leavesclip Jar
|
||||
run: ./gradlew createMojmapLeavesclipJar
|
||||
env:
|
||||
BUILD_NUMBER: ${{ env.BUILD_NUMBER }}
|
||||
- name: Get Release Info
|
||||
run: sh scripts/GetReleaseInfo.sh
|
||||
env:
|
||||
BUILD_NUMBER: ${{ env.BUILD_NUMBER }}
|
||||
- name: Move Jar
|
||||
run: |
|
||||
prop() {
|
||||
grep "${1}" gradle.properties | cut -d'=' -f2 | sed 's/\r//'
|
||||
}
|
||||
|
||||
jarName="leaves-$(prop mcVersion).jar"
|
||||
mv build/libs/Leaves-leavesclip-"$(prop version)"-mojmap.jar "$jarName"
|
||||
echo "jar=$jarName" >> "$GITHUB_ENV"
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
||||
19
LICENSE.md
Normal file
19
LICENSE.md
Normal file
@@ -0,0 +1,19 @@
|
||||
Leaves inherits its licensing from upstream projects.
|
||||
|
||||
As such, Leaves is licensed under the
|
||||
[GNU General Public License version 3](licenses/GPL.md); as it inherits it from Paper,
|
||||
who in turn inherits it from the original Spigot, Bukkit and Craftbukkit projects.
|
||||
|
||||
Any author who is _not_ listed below should be presumed to have released their work
|
||||
under the original [GPL](licenses/GPL.md) license.
|
||||
|
||||
In the interest of promoting a better Minecraft platform for everyone, contributors
|
||||
may choose to release their code under the more permissive [MIT License](licenses/MIT.md).
|
||||
|
||||
The authors listed below have chosen to release their code under that more permissive
|
||||
[MIT License](licenses/MIT.md). Any contributor who wants their name added below
|
||||
should submit a pull request to this project to add their name.
|
||||
|
||||
```text
|
||||
LittleChest <hiya@littlew.top>
|
||||
```
|
||||
621
PATCHES-LICENSE
621
PATCHES-LICENSE
@@ -1,621 +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
|
||||
26
README.md
26
README.md
@@ -1,23 +1,23 @@
|
||||
Leaves
|
||||
===========
|
||||
|
||||
[](https://github.com/LeavesMC/Leaves/actions/workflows/leaves.yml)
|
||||
[](https://github.com/LeavesMC/Leaves/actions/workflows/leaves.yml)
|
||||
[](https://github.com/LeavesMC/Leaves/releases/latest)
|
||||
[](https://discord.gg/5hgtU72w33)
|
||||
[](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=nisbmnCFeEJCcYWBQ10th4Fu99XWklH4&authKey=8VlUxSdrFCIwmIpxFQIGR8%2BXvIQ2II%2Bx2JfxuQ8amr9UKgINh%2BdXjudQfc%2FIeTO5&noverify=0&group_code=815857713)
|
||||
|
||||
**English** | [中文](https://github.com/LeavesMC/Leaves/blob/master/README_cn.md)
|
||||
**English** | [中文](README_cn.md)
|
||||
|
||||
> Fork of [Paper](https://github.com/PaperMC/Paper) aims at repairing broken vanilla properties.
|
||||
|
||||
> You can see what we modify and fix at [here](https://github.com/LeavesMC/Leaves/blob/master/docs/MODIFICATION.md)
|
||||
> You can see what we modify and fix at [here](https://docs.leavesmc.org/en/leaves/reference/configuration)
|
||||
|
||||
## How To (Server Admins)
|
||||
Leaves use the same paperclip jar system that Paper uses.
|
||||
Leaves use the same leavesclip(paperclip fork) jar system that Paper uses.
|
||||
|
||||
You can download the latest build (1.20.x) of Leaves by going [here](https://github.com/LeavesMC/Leaves/releases/latest)
|
||||
You can download the latest build (1.21.x) of Leaves by going [here](https://github.com/LeavesMC/Leaves/releases/latest)
|
||||
|
||||
You can also [build it yourself](https://github.com/LeavesMC/Leaves#building).
|
||||
You can also [build it yourself](#building).
|
||||
|
||||
You can visit our [documentation](https://docs.leavesmc.org/leaves/guides/getting-started) for more information.
|
||||
|
||||
@@ -25,22 +25,22 @@ You can visit our [documentation](https://docs.leavesmc.org/leaves/guides/gettin
|
||||
Leaves-API:
|
||||
```kotlin
|
||||
maven {
|
||||
name = 'leavesmc-repo'
|
||||
url = 'https://repo.leavesmc.org/snapshots/'
|
||||
name = "leavesmc-repo"
|
||||
url = "https://repo.leavesmc.org/snapshots/"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.leavesmc.leaves:leaves-api:1.20.6-R0.1-SNAPSHOT")
|
||||
compileOnly("org.leavesmc.leaves:leaves-api:1.21-R0.1-SNAPSHOT")
|
||||
}
|
||||
```
|
||||
|
||||
In order to use Leaves as a dependency you must [build it yourself](https://github.com/LeavesMC/Leaves#building).
|
||||
In order to use Leaves as a dependency you must [build it yourself](#building).
|
||||
Each time you want to update your dependency, you must re-build Leaves.
|
||||
|
||||
Leaves-Server:
|
||||
```kotlin
|
||||
dependencies {
|
||||
compileOnly("org.leavesmc.leaves:leaves:1.20.6-R0.1-SNAPSHOT")
|
||||
compileOnly("org.leavesmc.leaves:leaves:1.21-R0.1-SNAPSHOT")
|
||||
}
|
||||
```
|
||||
|
||||
@@ -54,10 +54,10 @@ You can find the jars in the `build/libs` directory.
|
||||
|
||||
## Pull Requests
|
||||
|
||||
See [Contributing](https://github.com/LeavesMC/Leaves/blob/master/docs/CONTRIBUTING.md)
|
||||
See [Contributing](docs/CONTRIBUTING.md)
|
||||
|
||||
## Special Thanks To:
|
||||
|
||||
[<img src="https://user-images.githubusercontent.com/21148213/121807008-8ffc6700-cc52-11eb-96a7-2f6f260f8fda.png" alt="" width="150">](https://www.jetbrains.com)
|
||||
|
||||
[JetBrains](https://www.jetbrains.com/), creators of the IntelliJ IDEA, supports We with one of their [Open Source Licenses](https://www.jetbrains.com/opensource/). We recommend using IntelliJ IDEA as your IDE.
|
||||
[JetBrains](https://www.jetbrains.com/), creators of the IntelliJ IDEA, supports Leaves with one of their [Open Source Licenses](https://www.jetbrains.com/opensource/). Leaves recommend using IntelliJ IDEA as your IDE.
|
||||
|
||||
24
README_cn.md
24
README_cn.md
@@ -6,18 +6,18 @@ Leaves
|
||||
[](https://discord.gg/5hgtU72w33)
|
||||
[](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=nisbmnCFeEJCcYWBQ10th4Fu99XWklH4&authKey=8VlUxSdrFCIwmIpxFQIGR8%2BXvIQ2II%2Bx2JfxuQ8amr9UKgINh%2BdXjudQfc%2FIeTO5&noverify=0&group_code=815857713)
|
||||
|
||||
[English](https://github.com/LeavesMC/Leaves/blob/master/README.md) | **中文**
|
||||
[English](README.md) | **中文**
|
||||
|
||||
> 一个致力于修复原版服务端被破坏特性的 [Paper](https://github.com/PaperMC/Paper) 分支
|
||||
|
||||
> 你可以在 [这里](https://github.com/LeavesMC/Leaves/blob/master/docs/MODIFICATION_cn.md) 查看所有的修改和修复内容
|
||||
> 你可以在 [这里](https://docs.leavesmc.org/zh_Hans/leaves/reference/configuration) 查看所有的修改和修复内容
|
||||
|
||||
## 对于服务器管理员
|
||||
此分支使用与 Paper 一致的 paperclip 分发
|
||||
此分支使用与 Paper 一致的 leavesclip(paperclip的分支) 分发
|
||||
|
||||
你可以从 [此处](https://github.com/LeavesMC/Leaves/releases/latest) 下载最新的构建结果 (1.20.x)
|
||||
你可以从 [此处](https://github.com/LeavesMC/Leaves/releases/latest) 下载最新的构建结果 (1.21.x)
|
||||
|
||||
也可以通过 [此处](https://github.com/LeavesMC/Leaves/blob/master/README_cn.md#自行构建) 的指南自行构建
|
||||
也可以通过 [此处](#自行构建) 的指南自行构建
|
||||
|
||||
如果你想要获得更多信息,那么你可以访问我们的 [文档](https://docs.leavesmc.org/zh_Hans/leaves/guides/getting-started)
|
||||
|
||||
@@ -25,21 +25,21 @@ Leaves
|
||||
Leaves-API:
|
||||
```kotlin
|
||||
maven {
|
||||
name = 'leavesmc-repo'
|
||||
url = 'https://repo.leavesmc.org/snapshots/'
|
||||
name = "leavesmc-repo"
|
||||
url = "https://repo.leavesmc.org/snapshots/"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.leavesmc.leaves:leaves-api:1.20.6-R0.1-SNAPSHOT")
|
||||
compileOnly("org.leavesmc.leaves:leaves-api:1.21-R0.1-SNAPSHOT")
|
||||
}
|
||||
```
|
||||
|
||||
如果你要将 Leaves 作为依赖,那么你必须进行 [自行构建](https://github.com/LeavesMC/Leaves/blob/master/README_cn.md#自行构建)
|
||||
如果你要将 Leaves 作为依赖,那么你必须进行 [自行构建](#自行构建)
|
||||
|
||||
Leaves-Server:
|
||||
```kotlin
|
||||
dependencies {
|
||||
compileOnly("org.leavesmc.leaves:leaves:1.20.6-R0.1-SNAPSHOT")
|
||||
compileOnly("org.leavesmc.leaves:leaves:1.21R0.1-SNAPSHOT")
|
||||
}
|
||||
```
|
||||
|
||||
@@ -53,10 +53,10 @@ dependencies {
|
||||
|
||||
## 对于想要出一份力的开发者
|
||||
|
||||
可查看 [Contributing](https://github.com/LeavesMC/Leaves/blob/master/docs/CONTRIBUTING_cn.md)
|
||||
可查看 [贡献须知](docs/CONTRIBUTING_cn.md)
|
||||
|
||||
## 特别感谢
|
||||
|
||||
[<img src="https://user-images.githubusercontent.com/21148213/121807008-8ffc6700-cc52-11eb-96a7-2f6f260f8fda.png" alt="" width="150">](https://www.jetbrains.com)
|
||||
|
||||
[JetBrains](https://www.jetbrains.com/),IntelliJ IDEA的创造者,为Leaves提供了 [开源许可证](https://www.jetbrains.com/opensource/)。我们极力推荐使用IntelliJ IDEA作为你的IDE。
|
||||
[JetBrains](https://www.jetbrains.com/),IntelliJ IDEA 的创造者,为 Leaves 提供了 [开源许可证](https://www.jetbrains.com/opensource/)。我们极力推荐使用 IntelliJ IDEA 作为你的 IDE。
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import io.papermc.paperweight.util.*
|
||||
import kotlin.io.path.*
|
||||
|
||||
plugins {
|
||||
java
|
||||
`maven-publish`
|
||||
id("io.papermc.paperweight.patcher") version "1.7.1"
|
||||
id("org.leavesmc.leavesweight.patcher") version "1.0.0-SNAPSHOT"
|
||||
}
|
||||
|
||||
allprojects {
|
||||
@@ -54,14 +51,14 @@ subprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://repo.leavesmc.org/releases") {
|
||||
content { onlyForConfigurations("paperclip") }
|
||||
content { onlyForConfigurations("leavesclip") }
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
remapper("net.fabricmc:tiny-remapper:0.10.2:fat")
|
||||
remapper("net.fabricmc:tiny-remapper:0.10.3:fat")
|
||||
decompiler("org.vineflower:vineflower:1.10.1")
|
||||
paperclip("org.leavesmc:leavesclip:2.0.0")
|
||||
leavesclip("org.leavesmc:leavesclip:2.0.0")
|
||||
}
|
||||
|
||||
paperweight {
|
||||
@@ -101,36 +98,3 @@ allprojects {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (providers.gradleProperty("updatingMinecraft").getOrElse("false").toBoolean()) {
|
||||
|
||||
tasks.withType<io.papermc.paperweight.tasks.CollectATsFromPatches>().configureEach {
|
||||
val dir = layout.projectDirectory.dir("patches/unapplied")
|
||||
if (dir.path.isDirectory()) {
|
||||
extraPatchDir = dir
|
||||
}
|
||||
}
|
||||
tasks.withType<io.papermc.paperweight.tasks.RebuildGitPatches>().configureEach {
|
||||
filterPatches = false
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("createMojmapLeavesclipJar") {
|
||||
group = "paperweight"
|
||||
dependsOn("createMojmapPaperclipJar")
|
||||
doLast {
|
||||
file("build/libs/Leaves-paperclip-${project.version}-mojmap.jar").renameTo(
|
||||
file("build/libs/Leaves-leavesclip-${project.version}-mojmap.jar")
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("createReobfLeavesclipJar") {
|
||||
group = "paperweight"
|
||||
dependsOn("createReobfPaperclipJar")
|
||||
doLast {
|
||||
file("build/libs/Leaves-paperclip-${project.version}-reobf.jar").renameTo(
|
||||
file("build/libs/Leaves-leavesclip-${project.version}-reobf.jar")
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
Leaves Modification
|
||||
===========
|
||||
|
||||
**English** | [中文](https://github.com/LeavesMC/Leaves/blob/master/docs/MODIFICATION_cn.md)
|
||||
|
||||
## Fix (Makes it usable)
|
||||
|
||||
> All of them won't have configurations
|
||||
|
||||
- Gravity block duper
|
||||
- Trading with the void
|
||||
- Tripwire updates when it being removed and not disarmed
|
||||
|
||||
## Modify
|
||||
|
||||
> All of them will have configuration
|
||||
|
||||
- Player can edit sign
|
||||
- Snowball and egg can knockback player
|
||||
- Fakeplayer support (like carpet) (command: `/bot`, permission: `bukkit.command.bot`)
|
||||
- Shears in dispenser can unlimited use
|
||||
- Shears can rotate redstone equipment (like debug-stick)
|
||||
- Budding Amethyst can push by piston
|
||||
- Spectators don't get Advancement
|
||||
- Use stick and shift to ArmorStand can modify ArmorStand's arm status
|
||||
- Remove Player Chat sign (NoChatReport Mod server side)
|
||||
- Instant BlockUpdater reintroduced
|
||||
- Random flatten triangular distribution (like Carpet-TIS-Addition)
|
||||
- Player operation limiter (can make auto break bedrock mod unusable)
|
||||
- Renewable Elytra (when shulker kill phantom)
|
||||
- Stackable Empty Shulker Boxes
|
||||
- MC Technical Survival Mode
|
||||
- Return nether portal fix
|
||||
- Extra Yggdrasil support
|
||||
- Whether use Vanilla random
|
||||
- Update suppression crash fixed
|
||||
- Bedrock break list
|
||||
- No feather falling trample
|
||||
- Shared villager discounts
|
||||
- Redstone wire doesn't connect if on trapdoor (as 1.20-)
|
||||
- Despawn enderman with block in hand
|
||||
- Creative fly no clip (need carpet mod and leaves-carpet protocol)
|
||||
- Enchantment mending compatibility with infinity
|
||||
- Shave snow layers
|
||||
- Mob spawn ignores lc
|
||||
|
||||
## Performance
|
||||
|
||||
> All of it will have configuration
|
||||
|
||||
> Powered by [Pufferfish](https://github.com/pufferfish-gg/Pufferfish)
|
||||
|
||||
- Optimize mob spawning (updating, unavailable yet)
|
||||
- Multithreaded Tracker (updating, unavailable yet)
|
||||
- Fix Paper#6045
|
||||
- Optimize entity coordinate key
|
||||
- Optimize suffocation
|
||||
- Strip raytracing for entity
|
||||
- Optimize Spooky Season check
|
||||
- Optimize Chunk ticking
|
||||
- Skip POI finding in vehicle
|
||||
- Optimize entity target finding
|
||||
- Use more thread Unsafe random
|
||||
- Disable method profiler
|
||||
- Disable inactive goal selector
|
||||
- Skip clone loot parameters
|
||||
- Reduce entity allocations
|
||||
- Remove lambda from ticking guard
|
||||
- Remove iterators from inventory contains
|
||||
- Remove streams from getting nearby players
|
||||
- Remove streams and iterators from range check
|
||||
- Async Pathfinding (updating)
|
||||
- Cache climbing check for activation
|
||||
- Use aging cache for biome temperatures
|
||||
- Reduce entity fluid lookups if no fluids
|
||||
- Reduce chunk loading & lookups
|
||||
- Simpler Vanilla ShapelessRecipes comparison
|
||||
- Improve fluid direction caching
|
||||
|
||||
> Powered by [Purpur](https://github.com/PurpurMC/Purpur)
|
||||
- Don't send useless entity packets
|
||||
|
||||
> Powered by [Carpet-AMS-Addition](https://github.com/Minecraft-AMS/Carpet-AMS-Addition)
|
||||
- Optimized dragon respawn
|
||||
|
||||
## Extra Protocol Support
|
||||
|
||||
> All of it will have configuration
|
||||
|
||||
- PCA sync protocol
|
||||
- BBOR protocol
|
||||
- Jade protocol
|
||||
- Carpet alternative block placement (carpet-extra)
|
||||
- Appleskin protocol
|
||||
- Xaero Map protocol
|
||||
- [Syncmatica](https://github.com/End-Tech/syncmatica) protocol
|
||||
- Leaves-Carpet protocol
|
||||
@@ -1,96 +0,0 @@
|
||||
Leaves Modification
|
||||
===========
|
||||
|
||||
[English](https://github.com/LeavesMC/Leaves/blob/master/docs/MODIFICATION.md) | **中文**
|
||||
|
||||
## 修复(使可用)
|
||||
|
||||
> 所有的修复内容都不会存在配置项
|
||||
|
||||
- 重力方块复制
|
||||
- 虚空交易
|
||||
- 绊线钩即将被水破坏时亦然生成激活的绊线
|
||||
|
||||
## 修改
|
||||
|
||||
> 所有的修改内容都会存在配置项
|
||||
|
||||
- 玩家可以编辑已经放置的告示牌
|
||||
- 雪球和鸡蛋可以击退玩家
|
||||
- 假人支持 (类似carpet) (指令为 `/bot`,权限为 `bukkit.command.bot`)
|
||||
- 发射器里的剪刀可以无限使用
|
||||
- 剪刀可以用来旋转红石原件 (类似调试棒)
|
||||
- 紫水晶母岩可以被活塞推动
|
||||
- 观察者不会获得进度
|
||||
- 对盔甲架下蹲使用木棍可以修改盔甲架的手臂状态
|
||||
- 删除玩家聊天内的签名 (可以替代NoChatReportMod的服务器侧)
|
||||
- 重新引入更新抑制机制
|
||||
- 扁平化随机数三角分布 (类似Carpet-TIS-Addition)
|
||||
- 玩家操作限制器 (可禁止自动破基岩mod)
|
||||
- 可再生鞘翅 (当潜影贝杀死幻翼时)
|
||||
- 可堆叠空潜影箱
|
||||
- 生电模式
|
||||
- 返回传送门位置修复
|
||||
- 额外外置登录服务器支持
|
||||
- 原版随机数 (支持RNG控制)
|
||||
- 更新抑制/跳略崩服修复
|
||||
- 破基岩榜
|
||||
- 有摔落缓冲不会踩坏田
|
||||
- 共享村民打折
|
||||
- 红石粉不会连接到活扳门 (恢复简易更新抑制)
|
||||
- 手上有方块的末影人一样会被刷新
|
||||
- 创造飞行无碰撞箱 (需要配合carpet协议和客户端mod)
|
||||
- 无限和精修不再冲突
|
||||
- 可以铲的雪
|
||||
- 怪物生成无视lc值
|
||||
|
||||
## 性能
|
||||
|
||||
> 所有的性能内容都会存在配置项
|
||||
|
||||
> Powered by [Pufferfish](https://github.com/pufferfish-gg/Pufferfish)
|
||||
- 生物生成优化 (正在升级 暂不可用)
|
||||
- 异步实体追踪 (正在升级 暂不可用)
|
||||
- 修复Paper#6045
|
||||
- 实体坐标键优化
|
||||
- 窒息检测优化
|
||||
- 实体射线优化
|
||||
- 万圣节检测优化
|
||||
- 区块刻优化
|
||||
- 跳过矿车中实体的方块搜索
|
||||
- 实体目标检测优化
|
||||
- 使用更多的线程不安全随机数发生器
|
||||
- 关闭方法分析器
|
||||
- 禁用非活跃实体的目标选择器
|
||||
- 跳过战利品表参数复制
|
||||
- 减少实体分配
|
||||
- 删除部分lambda表达式
|
||||
- 删除容器检查中的iterators
|
||||
- 删除玩家检测中的流
|
||||
- 删除范围检查中的流和iterators
|
||||
- 异步实体寻路 (正在升级 暂不可用)
|
||||
- 缓存实体攀爬检测
|
||||
- 使用更好的生物群系温度缓存
|
||||
- 优化实体流体检查
|
||||
- 优化末影人传送时的区块寻找
|
||||
- 更好的原版无序配方
|
||||
- 优化流体距离计算缓存
|
||||
|
||||
> Powered by [Purpur](https://github.com/PurpurMC/Purpur)
|
||||
- 减少不必要包的发送
|
||||
|
||||
> Powered by [Carpet-AMS-Addition](https://github.com/Minecraft-AMS/Carpet-AMS-Addition)
|
||||
- 龙战优化
|
||||
|
||||
## 额外协议支持
|
||||
|
||||
> 所有的协议内容都会存在配置项
|
||||
|
||||
- PCA同步协议
|
||||
- BBOR结构显示协议
|
||||
- Jade数据同步协议
|
||||
- Carpet精确放置协议 (carpet-extra)
|
||||
- 苹果皮显示协议
|
||||
- Xaero服务器地图设置协议
|
||||
- 共享原理图协议 ([syncmatica](https://github.com/End-Tech/syncmatica))
|
||||
- Leaves-Carpet协议 仅用于同步设置
|
||||
@@ -1,8 +1,8 @@
|
||||
group=org.leavesmc.leaves
|
||||
version=1.20.6-R0.1-SNAPSHOT
|
||||
version=1.21-R0.1-SNAPSHOT
|
||||
|
||||
mcVersion=1.20.6
|
||||
mcVersion=1.21
|
||||
org.gradle.jvmargs=-Xmx2G
|
||||
paperRef=79e2cb620ef03539390d97940824b38b707918f5
|
||||
preVersion=false
|
||||
paperRef=be8ac7acc3ca286aac62c836db03d69b57f7b8fe
|
||||
preVersion=true
|
||||
updatingMinecraft=true
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Leaves Server Config
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 0614bd7e2d658172a7765925adf81b75b5620f11..4304649def2a4e00058e98e7b12b799f6e261325 100644
|
||||
index bbc4d7d3ca84642828f9a3f788ca26bba900d15b..f1163c857bc9012d1fc32ada575a5f6514e2c956 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2256,6 +2256,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2250,6 +2250,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -14,10 +14,10 @@ index 97e78e27ee0eea2c8b24886eeb19164d552323fe..9764fa643039f215627c20a33ca70c9e
|
||||
/.factorypath
|
||||
+
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 47039514503d99e84cb99f4941707a7726286516..345dbebf7a291d43f6f6ceccfba0184af86da531 100644
|
||||
index b9b751ea0d11381e846d5f35f39f285c075c171a..6610aa562f2eaf0e889406b395b1fad8deba8411 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2909,6 +2909,17 @@ public final class Bukkit {
|
||||
@@ -2903,6 +2903,17 @@ public final class Bukkit {
|
||||
}
|
||||
// Paper end - Folia region threading API
|
||||
|
||||
@@ -36,10 +36,10 @@ index 47039514503d99e84cb99f4941707a7726286516..345dbebf7a291d43f6f6ceccfba0184a
|
||||
public static Server.Spigot spigot() {
|
||||
return server.spigot();
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 4304649def2a4e00058e98e7b12b799f6e261325..1300fb43cf20f9400eb337d3104158383951eae8 100644
|
||||
index f1163c857bc9012d1fc32ada575a5f6514e2c956..d506fc269c666d847e4a8590c017bf91e2fcb6d6 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -61,6 +61,7 @@ import org.bukkit.util.CachedServerIcon;
|
||||
@@ -62,6 +62,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -47,7 +47,7 @@ index 4304649def2a4e00058e98e7b12b799f6e261325..1300fb43cf20f9400eb337d310415838
|
||||
|
||||
/**
|
||||
* Represents a server implementation.
|
||||
@@ -2554,4 +2555,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2548,4 +2549,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
*/
|
||||
boolean isOwnedByCurrentRegion(@NotNull Entity entity);
|
||||
// Paper end - Folia region threading API
|
||||
@@ -120,20 +120,20 @@ index 0000000000000000000000000000000000000000..922ca5b27bc0dd443d635646f37f8795
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/entity/BotManager.java b/src/main/java/org/leavesmc/leaves/entity/BotManager.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..7662b8bb1bb47f7a85705709548e00a3918d0502
|
||||
index 0000000000000000000000000000000000000000..ee6848b8990c516aa5c5490546dd16ae5c909740
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/entity/BotManager.java
|
||||
@@ -0,0 +1,107 @@
|
||||
@@ -0,0 +1,124 @@
|
||||
+package org.leavesmc.leaves.entity;
|
||||
+
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.util.Consumer;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+import org.leavesmc.leaves.entity.botaction.CustomBotAction;
|
||||
+
|
||||
+import java.util.Collection;
|
||||
+import java.util.UUID;
|
||||
+import java.util.function.Consumer;
|
||||
+
|
||||
+/**
|
||||
+ * Simple fakeplayer manager
|
||||
@@ -170,11 +170,28 @@ index 0000000000000000000000000000000000000000..7662b8bb1bb47f7a85705709548e00a3
|
||||
+ * @param location a location will create fakeplayer
|
||||
+ * @return a fakeplayer if success, null otherwise
|
||||
+ */
|
||||
+ @Deprecated(since = "1.21")
|
||||
+ @Nullable
|
||||
+ public Bot createBot(@NotNull String name, @NotNull String realName, @Nullable String[] skin, @Nullable String skinName, @NotNull Location location);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates a fakeplayer with given param.
|
||||
+ * <p>
|
||||
+ * prefix and suffix will not be added.
|
||||
+ *
|
||||
+ * @param name fakeplayer name
|
||||
+ * @param realName fakeplayer real name
|
||||
+ * @param skin fakeplayer skin arr
|
||||
+ * @param skinName fakeplayer skin name
|
||||
+ * @param location a location will create fakeplayer
|
||||
+ * @param consumer a consumer after create fakeplayer success
|
||||
+ * @return a fakeplayer if you support skin arr and the creation is success, null otherwise
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public Bot createBot(@NotNull String name, @NotNull String realName, @NotNull String[] skin, @Nullable String skinName, @NotNull Location location, @Nullable Consumer<Bot> consumer);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates a fakeplayer with given param.
|
||||
+ *
|
||||
+ * @param name fakeplayer name
|
||||
+ * @param skinName fakeplayer skin name
|
||||
@@ -439,36 +456,46 @@ index 0000000000000000000000000000000000000000..5e55759fd3d7891e8e1d5d6a306dc814
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/event/bot/BotCreateEvent.java b/src/main/java/org/leavesmc/leaves/event/bot/BotCreateEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..c093f68e5f1749c792255220f39bdbdffb78f0f9
|
||||
index 0000000000000000000000000000000000000000..be510d565c5942efea3423190b06c01873a7abd2
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/event/bot/BotCreateEvent.java
|
||||
@@ -0,0 +1,106 @@
|
||||
@@ -0,0 +1,118 @@
|
||||
+package org.leavesmc.leaves.event.bot;
|
||||
+
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.command.CommandSender;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.Event;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+import java.util.Optional;
|
||||
+
|
||||
+/**
|
||||
+ * Call when a fakeplayer creates a server
|
||||
+ */
|
||||
+public class BotCreateEvent extends Event implements Cancellable {
|
||||
+ public enum CreateReason {
|
||||
+ COMMAND,
|
||||
+ PLUGIN,
|
||||
+ INTERNAL
|
||||
+ }
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+
|
||||
+ private final String bot;
|
||||
+ private final String skin;
|
||||
+ private String joinMessage;
|
||||
+ private final CreateReason reason;
|
||||
+ private final Optional<CommandSender> creator;
|
||||
+ private Location createLocation;
|
||||
+ private boolean cancel = false;
|
||||
+
|
||||
+ public BotCreateEvent(@NotNull final String who, @NotNull final String skin, @NotNull final Location createLocation, @Nullable final String joinMessage) {
|
||||
+ public BotCreateEvent(@NotNull final String who, @NotNull final String skin, @NotNull final Location createLocation, @NotNull CreateReason reason, @Nullable CommandSender creator) {
|
||||
+ this.bot = who;
|
||||
+ this.skin = skin;
|
||||
+ this.joinMessage = joinMessage;
|
||||
+ this.createLocation = createLocation;
|
||||
+ this.reason = reason;
|
||||
+ this.creator = Optional.ofNullable(creator);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -481,25 +508,6 @@ index 0000000000000000000000000000000000000000..c093f68e5f1749c792255220f39bdbdf
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the join message to send to all online players
|
||||
+ *
|
||||
+ * @return string join message. Can be null
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public String getJoinMessage() {
|
||||
+ return joinMessage;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the join message to send to all online players
|
||||
+ *
|
||||
+ * @param joinMessage join message. If null, no message will be sent
|
||||
+ */
|
||||
+ public void setJoinMessage(@Nullable String joinMessage) {
|
||||
+ this.joinMessage = joinMessage;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the location to create the fakeplayer
|
||||
+ *
|
||||
+ * @return Location to create the fakeplayer
|
||||
@@ -528,6 +536,27 @@ index 0000000000000000000000000000000000000000..c093f68e5f1749c792255220f39bdbdf
|
||||
+ return skin;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the create reason of the bot
|
||||
+ *
|
||||
+ * @return create reason
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public CreateReason getReason() {
|
||||
+ return reason;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the creator of the bot
|
||||
+ * if the create reason is not COMMAND, the creator might be Optional.empty()
|
||||
+ *
|
||||
+ * @return An optional of creator
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Optional<CommandSender> getCreator() {
|
||||
+ return creator;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return cancel;
|
||||
@@ -640,14 +669,15 @@ index 0000000000000000000000000000000000000000..a369b468d4793b36dd0944a1368a70e0
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/event/bot/BotJoinEvent.java b/src/main/java/org/leavesmc/leaves/event/bot/BotJoinEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..7500652b01a4ed3c8d59ca003a644a9e024f6512
|
||||
index 0000000000000000000000000000000000000000..e2e0b9fe697ab3b89373264d20d013cb9f65dd40
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/event/bot/BotJoinEvent.java
|
||||
@@ -0,0 +1,27 @@
|
||||
@@ -0,0 +1,51 @@
|
||||
+package org.leavesmc.leaves.event.bot;
|
||||
+
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+import org.leavesmc.leaves.entity.Bot;
|
||||
+
|
||||
+/**
|
||||
@@ -656,8 +686,116 @@ index 0000000000000000000000000000000000000000..7500652b01a4ed3c8d59ca003a644a9e
|
||||
+public class BotJoinEvent extends BotEvent {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+
|
||||
+ public BotJoinEvent(@NotNull Bot who) {
|
||||
+ private String joinMessage;
|
||||
+
|
||||
+ public BotJoinEvent(@NotNull Bot who, @Nullable final String joinMessage) {
|
||||
+ super(who);
|
||||
+ this.joinMessage = joinMessage;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the join message to send to all online players
|
||||
+ *
|
||||
+ * @return string join message. Can be null
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public String getJoinMessage() {
|
||||
+ return joinMessage;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the join message to send to all online players
|
||||
+ *
|
||||
+ * @param joinMessage join message. If null, no message will be sent
|
||||
+ */
|
||||
+ public void setJoinMessage(@Nullable String joinMessage) {
|
||||
+ this.joinMessage = joinMessage;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/event/bot/BotRemoveEvent.java b/src/main/java/org/leavesmc/leaves/event/bot/BotRemoveEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..6aee942d7db322196504d386a009e22e2aa16230
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/event/bot/BotRemoveEvent.java
|
||||
@@ -0,0 +1,79 @@
|
||||
+package org.leavesmc.leaves.event.bot;
|
||||
+
|
||||
+import org.bukkit.command.CommandSender;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+import org.leavesmc.leaves.entity.Bot;
|
||||
+
|
||||
+import java.util.Optional;
|
||||
+
|
||||
+/**
|
||||
+ * Call when a fakeplayer creates a server
|
||||
+ */
|
||||
+public class BotRemoveEvent extends BotEvent implements Cancellable {
|
||||
+ public enum RemoveReason {
|
||||
+ COMMAND,
|
||||
+ PLUGIN,
|
||||
+ DEATH,
|
||||
+ INTERNAL
|
||||
+ }
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+
|
||||
+ private final RemoveReason reason;
|
||||
+ private final Optional<CommandSender> remover;
|
||||
+ private boolean cancel = false;
|
||||
+
|
||||
+ public BotRemoveEvent(@NotNull final Bot who, @NotNull RemoveReason reason) {
|
||||
+ this(who, reason, null);
|
||||
+ }
|
||||
+
|
||||
+ public BotRemoveEvent(@NotNull final Bot who, @NotNull RemoveReason reason, @Nullable CommandSender remover) {
|
||||
+ super(who);
|
||||
+ this.reason = reason;
|
||||
+ this.remover = Optional.ofNullable(remover);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the remove reason of the bot
|
||||
+ *
|
||||
+ * @return remove reason
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public RemoveReason getReason() {
|
||||
+ return reason;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the remover of the bot
|
||||
+ * if the remove reason is not COMMAND, the creator might be Optional.empty()
|
||||
+ *
|
||||
+ * @return An optional of remover
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Optional<CommandSender> getRemover() {
|
||||
+ return remover;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return cancel;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ this.cancel = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Hide irrelevant compilation warnings
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index fd39ed209b20c927054b8482c400beeeeab460a3..d83f2d45849411afd91e27721f73189ed2a8bca5 100644
|
||||
index 540fe7e2c110e79c3742f229b3ed8c54b101d260..c070e3d308b14cc020475c2644955e7546ef6cef 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -130,6 +130,15 @@ val generateApiVersioningFile by tasks.registering {
|
||||
@@ -24,7 +24,7 @@ index fd39ed209b20c927054b8482c400beeeeab460a3..d83f2d45849411afd91e27721f73189e
|
||||
tasks.jar {
|
||||
from(generateApiVersioningFile.map { it.outputs.files.singleFile }) {
|
||||
into("META-INF/maven/${project.group}/${project.name}")
|
||||
@@ -187,6 +196,8 @@ tasks.withType<Javadoc> {
|
||||
@@ -188,6 +197,8 @@ tasks.withType<Javadoc> {
|
||||
into("build/docs/javadoc")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] SIMD support
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index d83f2d45849411afd91e27721f73189ed2a8bca5..a42ee9d752eac9b895d9e7c29994c9f630805311 100644
|
||||
index c070e3d308b14cc020475c2644955e7546ef6cef..286349a28b06eddebbf103def9bd33bcc224f090 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -136,6 +136,7 @@ tasks.withType<JavaCompile> {
|
||||
@@ -16,7 +16,7 @@ index d83f2d45849411afd91e27721f73189ed2a8bca5..a42ee9d752eac9b895d9e7c29994c9f6
|
||||
}
|
||||
// Leaves end - hide irrelevant compilation warnings
|
||||
|
||||
@@ -198,6 +199,7 @@ tasks.withType<Javadoc> {
|
||||
@@ -199,6 +200,7 @@ tasks.withType<Javadoc> {
|
||||
}
|
||||
|
||||
options.addStringOption("Xdoclint:none", "-quiet") // Leaves - hide irrelevant compilation warnings
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Force peaceful mode switch
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index fdb87adfb8d6eff2bfabe7a41398c53d15d4cd98..531a6cae97fe2a415cf906108a0899bf04e613d8 100644
|
||||
index d8a23aa0d898ca3360757721e38ddb97387f7d21..d744614204a840012b51e1f40148caf5f9dc6097 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -4344,6 +4344,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -4213,6 +4213,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
void setSendViewDistance(int viewDistance);
|
||||
// Paper end - view distance api
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@ index 9764fa643039f215627c20a33ca70c9e36b2d599..97e78e27ee0eea2c8b24886eeb19164d
|
||||
/.factorypath
|
||||
-
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 345dbebf7a291d43f6f6ceccfba0184af86da531..f633ddbc5041d93333f3db0cb675deb47d423224 100644
|
||||
index 6610aa562f2eaf0e889406b395b1fad8deba8411..9e7264149efc346d1e8e323b84bb8c19c0c5c58c 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2919,6 +2919,11 @@ public final class Bukkit {
|
||||
@@ -2913,6 +2913,11 @@ public final class Bukkit {
|
||||
return server.getBotManager();
|
||||
}
|
||||
// Leaves end - Bot API
|
||||
@@ -30,10 +30,10 @@ index 345dbebf7a291d43f6f6ceccfba0184af86da531..f633ddbc5041d93333f3db0cb675deb4
|
||||
@NotNull
|
||||
public static Server.Spigot spigot() {
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 1300fb43cf20f9400eb337d3104158383951eae8..98ca0f656ea3a5be30ad49bc7fb22c886adbef03 100644
|
||||
index d506fc269c666d847e4a8590c017bf91e2fcb6d6..fe93598096c904ed7c085ebce49bca2ce882cb75 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -62,6 +62,7 @@ import org.jetbrains.annotations.Contract;
|
||||
@@ -63,6 +63,7 @@ import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.leavesmc.leaves.entity.BotManager;
|
||||
@@ -41,7 +41,7 @@ index 1300fb43cf20f9400eb337d3104158383951eae8..98ca0f656ea3a5be30ad49bc7fb22c88
|
||||
|
||||
/**
|
||||
* Represents a server implementation.
|
||||
@@ -2564,4 +2565,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2558,4 +2559,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
*/
|
||||
@NotNull BotManager getBotManager();
|
||||
// Leaves end - Bot API
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Bytebuf API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index f633ddbc5041d93333f3db0cb675deb47d423224..992db8d11b6cb230488c0e77ce8f4834932bbded 100644
|
||||
index 9e7264149efc346d1e8e323b84bb8c19c0c5c58c..a5be047695fa8fa495da6f8773946768aeaeb05a 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2925,6 +2925,12 @@ public final class Bukkit {
|
||||
@@ -2919,6 +2919,12 @@ public final class Bukkit {
|
||||
}
|
||||
// Leaves end - Photographer API
|
||||
|
||||
@@ -22,10 +22,10 @@ index f633ddbc5041d93333f3db0cb675deb47d423224..992db8d11b6cb230488c0e77ce8f4834
|
||||
public static Server.Spigot spigot() {
|
||||
return server.spigot();
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 98ca0f656ea3a5be30ad49bc7fb22c886adbef03..79ad3c362e5437b28e44270a9c7b8947ce8b00d5 100644
|
||||
index fe93598096c904ed7c085ebce49bca2ce882cb75..1206268f19defd269c63e3391336b9920573454f 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2568,4 +2568,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2562,4 +2562,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
// Leaves start - Photographer API
|
||||
@NotNull PhotographerManager getPhotographerManager();
|
||||
// Leaves end - Photographer API
|
||||
@@ -35,10 +35,10 @@ index 98ca0f656ea3a5be30ad49bc7fb22c886adbef03..79ad3c362e5437b28e44270a9c7b8947
|
||||
+ // Leaves end - Bytebuf API
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index eb34f22e973fe46529eb93f435f5bf7f85091404..ba79992f0c170ab1c0db402698feb5071fe8cf62 100644
|
||||
index 7c56182acaf827f4b1a986a61cea8e9960604c98..45f820485e6f6e3a6a37a30a30c1c6a65b4615bb 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3850,6 +3850,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -3855,6 +3855,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
boolean isChunkSent(long chunkKey);
|
||||
// Paper end
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Build changes
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 4998aff0b7cb084dcda15c6a18bbe45e99b6000a..16b742b5131376ceca04570dd4c088caff62e677 100644
|
||||
index 1a734293c9416f13324bb0edf8f950c9029f8bc4..5025c5df3ee6ed84106782e3f9228874bebe63ca 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -13,7 +13,7 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||
@@ -18,7 +18,7 @@ index 4998aff0b7cb084dcda15c6a18bbe45e99b6000a..16b742b5131376ceca04570dd4c088ca
|
||||
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||
@@ -67,6 +67,15 @@ paperweight {
|
||||
craftBukkitPackageVersion.set("v1_20_R4") // also needs to be updated in MappingEnvironment
|
||||
craftBukkitPackageVersion.set("v1_21_R1") // also needs to be updated in MappingEnvironment
|
||||
}
|
||||
|
||||
+// Leaves start - hide irrelevant compilation warnings
|
||||
@@ -164,10 +164,10 @@ index 790bad0494454ca12ee152e3de6da3da634d9b20..c060857cb0551fff8f5033553b887f3a
|
||||
private static final String BUILD_DEV = "DEV";
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 3751c2a077bd13bac330b93c6efc2a640a17f4f2..2235e5cfd853216fd79cf26244f9f029af1fc3b4 100644
|
||||
index 330bee331335454a61cf8350a6654217c8124445..7a605d767d4f8e13d26071b9965a7724677e57d8 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1165,7 +1165,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1248,7 +1248,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
LOGGER.info("*************************************************************************************");
|
||||
LOGGER.info("This is the first time you're starting this server.");
|
||||
LOGGER.info("It's recommended you read our 'Getting Started' documentation for guidance.");
|
||||
@@ -176,7 +176,7 @@ index 3751c2a077bd13bac330b93c6efc2a640a17f4f2..2235e5cfd853216fd79cf26244f9f029
|
||||
LOGGER.info("*************************************************************************************");
|
||||
}
|
||||
// Paper end - Add onboarding message for initial server start
|
||||
@@ -1920,7 +1920,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1932,7 +1932,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
@DontObfuscate
|
||||
public String getServerModName() {
|
||||
@@ -186,10 +186,10 @@ index 3751c2a077bd13bac330b93c6efc2a640a17f4f2..2235e5cfd853216fd79cf26244f9f029
|
||||
|
||||
public SystemReport fillSystemReport(SystemReport details) {
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index ad967cc2283f902c76e48a59d59cf0dbdacbb5e3..422d87c1503340f3efe50785c4ad0cef6cf67702 100644
|
||||
index 7d82cc6b847124cf4225428ba310309544928148..4214ed228125c6ba36ef2c763f842a54f33446fc 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -231,9 +231,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -235,9 +235,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); // Paper - start watchdog thread
|
||||
thread.start(); // Paper - Enhance console tab completions for brigadier commands; start console thread after MinecraftServer.console & PaperConfig are initialized
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
|
||||
@@ -215,10 +215,10 @@ index 759062d219ff490a3cb19e710c4d18e3e08288e0..3952428c02fe87477f4139f4fa983815
|
||||
|
||||
javax.swing.JLabel jLabel = new javax.swing.JLabel("If you need help setting up your server you can visit:");
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index b86ba59158964f73abd6622341a9acb98a33fa44..1155fc80c0292c8d7efb21dbac3d984176fcaa2d 100644
|
||||
index 6e1f92b45504cef0c4dcbbebf3df339ef4cad0a1..459f47244bdfeab63b5f16d780b0291d36310de8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -303,7 +303,7 @@ public class Main {
|
||||
@@ -273,7 +273,7 @@ public class Main {
|
||||
if (buildDate.before(deadline.getTime())) {
|
||||
// Paper start - This is some stupid bullshit
|
||||
System.err.println("*** Warning, you've not updated in a while! ***");
|
||||
@@ -241,10 +241,10 @@ index 774556a62eb240da42e84db4502e2ed43495be17..fdef98a7796d84c7b0ee61241859e10c
|
||||
|
||||
if (stream != null) {
|
||||
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
index 6db566e3111ec08a99aa429624979cb83a85e272..824679785bbe0ac038c4d529b4cbe857e2e102ca 100644
|
||||
index e5e41dc2d4f7a8c3fea704212507ca0b951664db..6f65c34dab1f031b4015ff3bb9ccdad28e679d38 100644
|
||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
@@ -155,14 +155,14 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
@@ -83,14 +83,14 @@ public class WatchdogThread extends Thread
|
||||
if (isLongTimeout) {
|
||||
// Paper end
|
||||
log.log( Level.SEVERE, "------------------------------" );
|
||||
@@ -262,7 +262,7 @@ index 6db566e3111ec08a99aa429624979cb83a85e272..824679785bbe0ac038c4d529b4cbe857
|
||||
//
|
||||
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
|
||||
{
|
||||
@@ -184,12 +184,12 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
@@ -112,12 +112,12 @@ public class WatchdogThread extends Thread
|
||||
// Paper end
|
||||
} else
|
||||
{
|
||||
@@ -274,10 +274,10 @@ index 6db566e3111ec08a99aa429624979cb83a85e272..824679785bbe0ac038c4d529b4cbe857
|
||||
log.log( Level.SEVERE, "------------------------------" );
|
||||
- log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper
|
||||
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Leaves!):" ); // Paper // Leaevs
|
||||
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper - rewrite chunk system
|
||||
this.dumpTickingInfo(); // Paper - log detailed tick information
|
||||
ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(MinecraftServer.getServer(), isLongTimeout); // Paper - rewrite chunk system
|
||||
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
|
||||
@@ -205,7 +205,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
log.log( Level.SEVERE, "------------------------------" );
|
||||
@@ -132,7 +132,7 @@ public class WatchdogThread extends Thread
|
||||
WatchdogThread.dumpThread( thread, log );
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Delete Timings
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
deleted file mode 100644
|
||||
index 4b467f1af93452d13829f756d55dee18b8889d40..0000000000000000000000000000000000000000
|
||||
index 6b3cde6d4d1e63bec01f502f2027ee9fddac08aa..0000000000000000000000000000000000000000
|
||||
--- a/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
+++ /dev/null
|
||||
@@ -1,181 +0,0 @@
|
||||
@@ -1,178 +0,0 @@
|
||||
-package co.aikar.timings;
|
||||
-
|
||||
-import com.google.common.collect.MapMaker;
|
||||
@@ -59,9 +59,6 @@ index 4b467f1af93452d13829f756d55dee18b8889d40..00000000000000000000000000000000
|
||||
- public static final Timing antiXrayUpdateTimer = Timings.ofSafe("anti-xray - update");
|
||||
- public static final Timing antiXrayObfuscateTimer = Timings.ofSafe("anti-xray - obfuscate");
|
||||
- public static final Timing scoreboardScoreSearch = Timings.ofSafe("Scoreboard score search"); // Paper - add timings for scoreboard search
|
||||
- public static final Timing distanceManagerTick = Timings.ofSafe("Distance Manager Tick"); // Paper - add timings for distance manager
|
||||
-
|
||||
- public static final Timing midTickChunkTasks = Timings.ofSafe("Mid Tick Chunk Tasks");
|
||||
-
|
||||
- private static final Map<Class<?>, String> taskNameCache = new MapMaker().weakKeys().makeMap();
|
||||
-
|
||||
@@ -587,10 +584,10 @@ index 7620c72a4c243cbeea245203ce03a97cbfa7d922..00000000000000000000000000000000
|
||||
-}
|
||||
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
||||
deleted file mode 100644
|
||||
index 22687667ec69a954261e55e59261286ac1b8b8cd..0000000000000000000000000000000000000000
|
||||
index 2f0d9b953802dee821cfde82d22b0567cce8ee91..0000000000000000000000000000000000000000
|
||||
--- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
||||
+++ /dev/null
|
||||
@@ -1,140 +0,0 @@
|
||||
@@ -1,120 +0,0 @@
|
||||
-package co.aikar.timings;
|
||||
-
|
||||
-import net.minecraft.server.level.ServerLevel;
|
||||
@@ -652,16 +649,6 @@ index 22687667ec69a954261e55e59261286ac1b8b8cd..00000000000000000000000000000000
|
||||
-
|
||||
- public final Timing miscMobSpawning;
|
||||
-
|
||||
- public final Timing poiUnload;
|
||||
- public final Timing chunkUnload;
|
||||
- public final Timing poiSaveDataSerialization;
|
||||
- public final Timing chunkSave;
|
||||
- public final Timing chunkSaveDataSerialization;
|
||||
- public final Timing chunkSaveIOWait;
|
||||
- public final Timing chunkUnloadPrepareSave;
|
||||
- public final Timing chunkUnloadPOISerialization;
|
||||
- public final Timing chunkUnloadDataSave;
|
||||
-
|
||||
- public WorldTimingsHandler(Level server) {
|
||||
- String name = ((PrimaryLevelData) server.getLevelData()).getLevelName() + " - ";
|
||||
-
|
||||
@@ -715,71 +702,12 @@ index 22687667ec69a954261e55e59261286ac1b8b8cd..00000000000000000000000000000000
|
||||
-
|
||||
-
|
||||
- miscMobSpawning = Timings.ofSafe(name + "Mob spawning - Misc");
|
||||
-
|
||||
- poiUnload = Timings.ofSafe(name + "Chunk unload - POI");
|
||||
- chunkUnload = Timings.ofSafe(name + "Chunk unload - Chunk");
|
||||
- poiSaveDataSerialization = Timings.ofSafe(name + "Chunk save - POI Data serialization");
|
||||
- chunkSave = Timings.ofSafe(name + "Chunk save - Chunk");
|
||||
- chunkSaveDataSerialization = Timings.ofSafe(name + "Chunk save - Chunk Data serialization");
|
||||
- chunkSaveIOWait = Timings.ofSafe(name + "Chunk save - Chunk IO Wait");
|
||||
- chunkUnloadPrepareSave = Timings.ofSafe(name + "Chunk unload - Async Save Prepare");
|
||||
- chunkUnloadPOISerialization = Timings.ofSafe(name + "Chunk unload - POI Data Serialization");
|
||||
- chunkUnloadDataSave = Timings.ofSafe(name + "Chunk unload - Data Serialization");
|
||||
- }
|
||||
-
|
||||
- public static Timing getTickList(ServerLevel worldserver, String timingsType) {
|
||||
- return Timings.ofSafe(((PrimaryLevelData) worldserver.getLevelData()).getLevelName() + " - Scheduled " + timingsType);
|
||||
- }
|
||||
-}
|
||||
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java
|
||||
index 6bc7c6f16a1649fc9e24e7cf90fca401e5bd4875..5b446e6ac151f99f64f0c442d0b40b5e251bc4c4 100644
|
||||
--- a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java
|
||||
+++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java
|
||||
@@ -1316,9 +1316,7 @@ public final class ChunkHolderManager {
|
||||
}
|
||||
|
||||
public boolean processTicketUpdates() {
|
||||
- co.aikar.timings.MinecraftTimings.distanceManagerTick.startTiming(); try { // Paper - add timings for distance manager
|
||||
return this.processTicketUpdates(true, true, null);
|
||||
- } finally { co.aikar.timings.MinecraftTimings.distanceManagerTick.stopTiming(); } // Paper - add timings for distance manager
|
||||
}
|
||||
|
||||
private static final ThreadLocal<List<ChunkProgressionTask>> CURRENT_TICKET_UPDATE_SCHEDULING = new ThreadLocal<>();
|
||||
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/NewChunkHolder.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/NewChunkHolder.java
|
||||
index 56b07a3306e5735816c8d89601b519cb0db6379a..e932998bb1d833d782e1f6c7f576f521e8ace071 100644
|
||||
--- a/src/main/java/io/papermc/paper/chunk/system/scheduling/NewChunkHolder.java
|
||||
+++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/NewChunkHolder.java
|
||||
@@ -1779,19 +1779,17 @@ public final class NewChunkHolder {
|
||||
boolean canSavePOI = !(chunk instanceof LevelChunk levelChunk && levelChunk.mustNotSave) && (poi != null && poi.isDirty());
|
||||
boolean canSaveEntities = entities != null;
|
||||
|
||||
- try (co.aikar.timings.Timing ignored = this.world.timings.chunkSave.startTiming()) { // Paper
|
||||
- if (canSaveChunk) {
|
||||
- canSaveChunk = this.saveChunk(chunk, unloading);
|
||||
- }
|
||||
- if (canSavePOI) {
|
||||
- canSavePOI = this.savePOI(poi, unloading);
|
||||
- }
|
||||
- if (canSaveEntities) {
|
||||
- // on shutdown, we need to force transient entity chunks to save
|
||||
- canSaveEntities = this.saveEntities(entities, unloading || shutdown);
|
||||
- if (unloading || shutdown) {
|
||||
- this.lastEntityUnload = null;
|
||||
- }
|
||||
+ if (canSaveChunk) {
|
||||
+ canSaveChunk = this.saveChunk(chunk, unloading);
|
||||
+ }
|
||||
+ if (canSavePOI) {
|
||||
+ canSavePOI = this.savePOI(poi, unloading);
|
||||
+ }
|
||||
+ if (canSaveEntities) {
|
||||
+ // on shutdown, we need to force transient entity chunks to save
|
||||
+ canSaveEntities = this.saveEntities(entities, unloading || shutdown);
|
||||
+ if (unloading || shutdown) {
|
||||
+ this.lastEntityUnload = null;
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java b/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java
|
||||
index 0c3c82b28e581286b798ee58ca4193efc2faff4a..fe6a5a6377bcb577b21471ae93639f8dc5fa0f39 100644
|
||||
--- a/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java
|
||||
@@ -813,7 +741,7 @@ index 0c3c82b28e581286b798ee58ca4193efc2faff4a..fe6a5a6377bcb577b21471ae93639f8d
|
||||
// return true as command was handled
|
||||
return 1;
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
index 2874bc3001c4e7d9191e47ba512c5a68369c21f1..0cb47b5fee85230989293d430c02e53391e0ef67 100644
|
||||
index b8499c1cea97a1a88a53053bc7da132f2fd3928d..0a3f2f5b474910af3cabf3bab5310c0e970aed68 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
@@ -1,6 +1,5 @@
|
||||
@@ -873,11 +801,11 @@ index 097500a59336db1bbfffcd1aa4cff7a8586e46ec..35b00c139864dd7925d46a2d6a317d7e
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
||||
index 57e76b53e5e314c3e6b8856010f7a84188121582..d6daa27a8d7aca00b181e90d789f4249e8437d29 100644
|
||||
index d0d36a57ec4896bcb74970f8fb24d8f3e17db133..f7197f1347251a37dd0f6d9ffa2f09bc3a4e1233 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
||||
@@ -50,8 +50,7 @@ public class PacketUtils {
|
||||
try { // Paper - detailed watchdog information
|
||||
@@ -31,8 +31,7 @@ public class PacketUtils {
|
||||
engine.executeIfPossible(() -> {
|
||||
if (listener instanceof ServerCommonPacketListenerImpl serverCommonPacketListener && serverCommonPacketListener.processedDisconnect) return; // CraftBukkit - Don't handle sync packets for kicked players
|
||||
if (listener.shouldHandleMessage(packet)) {
|
||||
- co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings
|
||||
@@ -887,7 +815,7 @@ index 57e76b53e5e314c3e6b8856010f7a84188121582..d6daa27a8d7aca00b181e90d789f4249
|
||||
} catch (Exception exception) {
|
||||
if (exception instanceof ReportedException) {
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 2235e5cfd853216fd79cf26244f9f029af1fc3b4..1f973ed9bb9c753b81979085a6fea45b65165fa3 100644
|
||||
index 7a605d767d4f8e13d26071b9965a7724677e57d8..3a37a083556a722ea6fbc75adf32b36e1b66bcc4 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -3,9 +3,6 @@ package net.minecraft.server;
|
||||
@@ -900,16 +828,16 @@ index 2235e5cfd853216fd79cf26244f9f029af1fc3b4..1f973ed9bb9c753b81979085a6fea45b
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
@@ -190,8 +187,6 @@ import org.bukkit.craftbukkit.CraftRegistry;
|
||||
@@ -196,8 +193,6 @@ import org.bukkit.craftbukkit.CraftRegistry;
|
||||
import org.bukkit.event.server.ServerLoadEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
-import co.aikar.timings.MinecraftTimings; // Paper
|
||||
-
|
||||
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements ServerInfo, CommandSource, AutoCloseable {
|
||||
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements ServerInfo, ChunkIOErrorReporter, CommandSource, AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.server.ChunkSystemMinecraftServer { // Paper - rewrite chunk system
|
||||
|
||||
private static MinecraftServer SERVER; // Paper
|
||||
@@ -972,7 +967,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1044,7 +1039,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
MinecraftServer.LOGGER.info("Stopping server");
|
||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
||||
@@ -917,61 +845,7 @@ index 2235e5cfd853216fd79cf26244f9f029af1fc3b4..1f973ed9bb9c753b81979085a6fea45b
|
||||
// CraftBukkit start
|
||||
if (this.server != null) {
|
||||
this.server.disablePlugins();
|
||||
@@ -1452,34 +1446,29 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
return;
|
||||
}
|
||||
|
||||
- co.aikar.timings.MinecraftTimings.midTickChunkTasks.startTiming();
|
||||
- try {
|
||||
- for (;;) {
|
||||
- boolean moreTasks = this.tickMidTickTasks();
|
||||
- long currTime = System.nanoTime();
|
||||
- long diff = currTime - startTime;
|
||||
-
|
||||
- if (!moreTasks || diff >= MAX_CHUNK_EXEC_TIME) {
|
||||
- if (!moreTasks) {
|
||||
- lastMidTickExecuteFailure = currTime;
|
||||
- }
|
||||
-
|
||||
- // note: negative values reduce the time
|
||||
- long overuse = diff - MAX_CHUNK_EXEC_TIME;
|
||||
- if (overuse >= (10L * 1000L * 1000L)) { // 10ms
|
||||
- // make sure something like a GC or dumb plugin doesn't screw us over...
|
||||
- overuse = 10L * 1000L * 1000L; // 10ms
|
||||
- }
|
||||
+ for (;;) {
|
||||
+ boolean moreTasks = this.tickMidTickTasks();
|
||||
+ long currTime = System.nanoTime();
|
||||
+ long diff = currTime - startTime;
|
||||
|
||||
- double overuseCount = (double)overuse/(double)MAX_CHUNK_EXEC_TIME;
|
||||
- long extraSleep = (long)Math.round(overuseCount*CHUNK_TASK_QUEUE_BACKOFF_MIN_TIME);
|
||||
+ if (!moreTasks || diff >= MAX_CHUNK_EXEC_TIME) {
|
||||
+ if (!moreTasks) {
|
||||
+ lastMidTickExecuteFailure = currTime;
|
||||
+ }
|
||||
|
||||
- lastMidTickExecute = currTime + extraSleep;
|
||||
- return;
|
||||
+ // note: negative values reduce the time
|
||||
+ long overuse = diff - MAX_CHUNK_EXEC_TIME;
|
||||
+ if (overuse >= (10L * 1000L * 1000L)) { // 10ms
|
||||
+ // make sure something like a GC or dumb plugin doesn't screw us over...
|
||||
+ overuse = 10L * 1000L * 1000L; // 10ms
|
||||
}
|
||||
+
|
||||
+ double overuseCount = (double)overuse/(double)MAX_CHUNK_EXEC_TIME;
|
||||
+ long extraSleep = (long)Math.round(overuseCount*CHUNK_TASK_QUEUE_BACKOFF_MIN_TIME);
|
||||
+
|
||||
+ lastMidTickExecute = currTime + extraSleep;
|
||||
+ return;
|
||||
}
|
||||
- } finally {
|
||||
- co.aikar.timings.MinecraftTimings.midTickChunkTasks.stopTiming();
|
||||
}
|
||||
}
|
||||
// Paper end - execute chunk tasks mid tick
|
||||
@@ -1554,15 +1543,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1584,15 +1578,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
public void tickServer(BooleanSupplier shouldKeepTicking) {
|
||||
@@ -989,8 +863,8 @@ index 2235e5cfd853216fd79cf26244f9f029af1fc3b4..1f973ed9bb9c753b81979085a6fea45b
|
||||
// Paper end
|
||||
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper - Server Tick Events
|
||||
|
||||
@@ -1599,9 +1587,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Paper end - Incremental chunk and player saving
|
||||
@@ -1617,9 +1610,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
io.papermc.paper.util.CachedLists.reset(); // Paper
|
||||
// Paper start - move executeAll() into full server tick timing
|
||||
- try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) {
|
||||
@@ -1000,7 +874,7 @@ index 2235e5cfd853216fd79cf26244f9f029af1fc3b4..1f973ed9bb9c753b81979085a6fea45b
|
||||
// Paper end
|
||||
// Paper start - Server Tick Events
|
||||
long endTime = System.nanoTime();
|
||||
@@ -1624,7 +1610,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1642,7 +1633,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.logTickMethodTime(i);
|
||||
this.profiler.pop();
|
||||
org.spigotmc.WatchdogThread.tick(); // Spigot
|
||||
@@ -1008,7 +882,7 @@ index 2235e5cfd853216fd79cf26244f9f029af1fc3b4..1f973ed9bb9c753b81979085a6fea45b
|
||||
}
|
||||
|
||||
private void logTickMethodTime(long tickStartTime) {
|
||||
@@ -1695,9 +1680,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1713,9 +1703,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.getPlayerList().getPlayers().forEach((entityplayer) -> {
|
||||
entityplayer.connection.suspendFlushing();
|
||||
});
|
||||
@@ -1018,7 +892,7 @@ index 2235e5cfd853216fd79cf26244f9f029af1fc3b4..1f973ed9bb9c753b81979085a6fea45b
|
||||
// Paper start - Folia scheduler API
|
||||
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
|
||||
getAllLevels().forEach(level -> {
|
||||
@@ -1714,21 +1697,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1732,21 +1720,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Paper end - Folia scheduler API
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
||||
this.profiler.push("commandFunctions");
|
||||
@@ -1040,7 +914,7 @@ index 2235e5cfd853216fd79cf26244f9f029af1fc3b4..1f973ed9bb9c753b81979085a6fea45b
|
||||
// Send time updates to everyone, it will get the right time from the world the player is in.
|
||||
// Paper start - Perf: Optimize time updates
|
||||
for (final ServerLevel level : this.getAllLevels()) {
|
||||
@@ -1748,7 +1726,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1766,7 +1749,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
}
|
||||
// Paper end - Perf: Optimize time updates
|
||||
@@ -1048,22 +922,17 @@ index 2235e5cfd853216fd79cf26244f9f029af1fc3b4..1f973ed9bb9c753b81979085a6fea45b
|
||||
|
||||
this.isIteratingOverLevels = true; // Paper - Throw exception on world create while being ticked
|
||||
Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; move down
|
||||
@@ -1775,14 +1752,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1792,9 +1774,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.profiler.push("tick");
|
||||
|
||||
try {
|
||||
- worldserver.timings.doTick.startTiming(); // Spigot
|
||||
worldserver.tick(shouldKeepTicking);
|
||||
// Paper start
|
||||
for (final io.papermc.paper.chunk.SingleThreadChunkRegionManager regionManager : worldserver.getChunkSource().chunkMap.regionManagers) {
|
||||
regionManager.recalculateRegions();
|
||||
}
|
||||
// Paper end
|
||||
- worldserver.timings.doTick.stopTiming(); // Spigot
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
|
||||
|
||||
@@ -1797,24 +1772,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1809,24 +1789,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||
|
||||
this.profiler.popPush("connection");
|
||||
@@ -1089,10 +958,10 @@ index 2235e5cfd853216fd79cf26244f9f029af1fc3b4..1f973ed9bb9c753b81979085a6fea45b
|
||||
this.profiler.popPush("send chunks");
|
||||
iterator = this.playerList.getPlayers().iterator();
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 422d87c1503340f3efe50785c4ad0cef6cf67702..340d1b6797d56e2ebdce2d8d7cae62780470e1b7 100644
|
||||
index 4214ed228125c6ba36ef2c763f842a54f33446fc..29d61b407762504dffc26f3048a17327592d9b4a 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -63,7 +63,6 @@ import org.apache.logging.log4j.Level;
|
||||
@@ -65,7 +65,6 @@ import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.io.IoBuilder;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -1100,7 +969,7 @@ index 422d87c1503340f3efe50785c4ad0cef6cf67702..340d1b6797d56e2ebdce2d8d7cae6278
|
||||
import org.bukkit.craftbukkit.util.TerminalCompletionHandler;
|
||||
import org.bukkit.craftbukkit.util.TerminalConsoleWriterThread;
|
||||
import org.bukkit.event.server.ServerCommandEvent;
|
||||
@@ -506,7 +505,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -509,7 +508,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
}
|
||||
|
||||
public void handleConsoleInputs() {
|
||||
@@ -1108,7 +977,7 @@ index 422d87c1503340f3efe50785c4ad0cef6cf67702..340d1b6797d56e2ebdce2d8d7cae6278
|
||||
// Paper start - Perf: use proper queue
|
||||
ConsoleInput servercommand;
|
||||
while ((servercommand = this.serverCommandQueue.poll()) != null) {
|
||||
@@ -523,7 +521,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -526,7 +524,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
@@ -1116,7 +985,7 @@ index 422d87c1503340f3efe50785c4ad0cef6cf67702..340d1b6797d56e2ebdce2d8d7cae6278
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -797,21 +794,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -800,21 +797,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
}
|
||||
// Paper start
|
||||
command.set(event.getCommand());
|
||||
@@ -1139,7 +1008,7 @@ index 422d87c1503340f3efe50785c4ad0cef6cf67702..340d1b6797d56e2ebdce2d8d7cae6278
|
||||
// Paper start
|
||||
if (waitableArray[0] != null) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 7fb9ba3dadb1eca4a1000ea8cf4d13fed2b7db1e..dc20b051d4f14ce4e0b5a0114e02d15716a7c3d6 100644
|
||||
index c96740a82eac9101f74edeb44edf4b64d1d633e0..85b76c5da9eea5bae0dd55f5b7ac1eb1a0211944 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1,6 +1,5 @@
|
||||
@@ -1149,53 +1018,7 @@ index 7fb9ba3dadb1eca4a1000ea8cf4d13fed2b7db1e..dc20b051d4f14ce4e0b5a0114e02d157
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableList.Builder;
|
||||
import com.google.common.collect.Iterables;
|
||||
@@ -543,15 +542,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
protected void tick(BooleanSupplier shouldKeepTicking) {
|
||||
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
||||
|
||||
- try (Timing ignored = this.level.timings.poiUnload.startTiming()) { // Paper
|
||||
gameprofilerfiller.push("poi");
|
||||
this.poiManager.tick(shouldKeepTicking);
|
||||
- } // Paper
|
||||
gameprofilerfiller.popPush("chunk_unload");
|
||||
if (!this.level.noSave()) {
|
||||
- try (Timing ignored = this.level.timings.chunkUnload.startTiming()) { // Paper
|
||||
this.processUnloads(shouldKeepTicking);
|
||||
- } // Paper
|
||||
}
|
||||
|
||||
gameprofilerfiller.pop();
|
||||
@@ -1157,24 +1152,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
||||
// Paper start - optimised tracker
|
||||
private final void processTrackQueue() {
|
||||
- this.level.timings.tracker1.startTiming();
|
||||
- try {
|
||||
- for (TrackedEntity tracker : this.entityMap.values()) {
|
||||
- // update tracker entry
|
||||
- tracker.updatePlayers(tracker.entity.getPlayersInTrackRange());
|
||||
- }
|
||||
- } finally {
|
||||
- this.level.timings.tracker1.stopTiming();
|
||||
+ for (TrackedEntity tracker : this.entityMap.values()) {
|
||||
+ // update tracker entry
|
||||
+ tracker.updatePlayers(tracker.entity.getPlayersInTrackRange());
|
||||
}
|
||||
|
||||
|
||||
- this.level.timings.tracker2.startTiming();
|
||||
- try {
|
||||
- for (TrackedEntity tracker : this.entityMap.values()) {
|
||||
- tracker.serverEntity.sendChanges();
|
||||
- }
|
||||
- } finally {
|
||||
- this.level.timings.tracker2.stopTiming();
|
||||
+ for (TrackedEntity tracker : this.entityMap.values()) {
|
||||
+ tracker.serverEntity.sendChanges();
|
||||
}
|
||||
}
|
||||
// Paper end - optimised tracker
|
||||
@@ -1189,7 +1174,6 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -957,7 +956,6 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
List<ServerPlayer> list = Lists.newArrayList();
|
||||
List<ServerPlayer> list1 = this.level.players();
|
||||
ObjectIterator objectiterator = this.entityMap.values().iterator();
|
||||
@@ -1203,7 +1026,7 @@ index 7fb9ba3dadb1eca4a1000ea8cf4d13fed2b7db1e..dc20b051d4f14ce4e0b5a0114e02d157
|
||||
|
||||
ChunkMap.TrackedEntity playerchunkmap_entitytracker;
|
||||
|
||||
@@ -1214,17 +1198,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -982,17 +980,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
playerchunkmap_entitytracker.serverEntity.sendChanges();
|
||||
}
|
||||
}
|
||||
@@ -1222,40 +1045,20 @@ index 7fb9ba3dadb1eca4a1000ea8cf4d13fed2b7db1e..dc20b051d4f14ce4e0b5a0114e02d157
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index fcecfda569d2a8d6b8a7e228831f822fb7327748..ffab3e27c0d9da2a380a14b6f6ebb243a6fb5e8d 100644
|
||||
index 64ed296cfbe7e5d27286b8cee70454fd1d99ebb0..48991b885c7cad9c201887b222acad7d700bd03b 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -274,10 +274,8 @@ public class ServerChunkCache extends ChunkSource {
|
||||
if (!completablefuture.isDone()) { // Paper
|
||||
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.pushChunkWait(this.level, x1, z1); // Paper - rewrite chunk system
|
||||
com.destroystokyo.paper.io.SyncLoadFinder.logSyncLoad(this.level, x, z); // Paper - Add debug for sync chunk loads
|
||||
- this.level.timings.syncChunkLoad.startTiming(); // Paper
|
||||
chunkproviderserver_b.managedBlock(completablefuture::isDone);
|
||||
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.popChunkWait(); // Paper - rewrite chunk system
|
||||
- this.level.timings.syncChunkLoad.stopTiming(); // Paper
|
||||
} // Paper
|
||||
ChunkResult<ChunkAccess> chunkresult = (ChunkResult) completablefuture.join();
|
||||
ChunkAccess ichunkaccess1 = (ChunkAccess) chunkresult.orElse(null); // CraftBukkit - decompile error
|
||||
@@ -425,17 +423,13 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -357,9 +357,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
|
||||
public void save(boolean flush) {
|
||||
this.runDistanceManagerUpdates();
|
||||
// Paper - rewrite chunk system
|
||||
- try (co.aikar.timings.Timing timed = level.timings.chunkSaveData.startTiming()) { // Paper - Timings
|
||||
this.chunkMap.saveAllChunks(flush);
|
||||
- } // Paper - Timings
|
||||
}
|
||||
|
||||
// Paper start - Incremental chunk and player saving; duplicate save, but call incremental
|
||||
public void saveIncrementally() {
|
||||
this.runDistanceManagerUpdates();
|
||||
- try (co.aikar.timings.Timing timed = level.timings.chunkSaveData.startTiming()) { // Paper - Timings
|
||||
- this.chunkMap.saveIncrementally();
|
||||
- } // Paper - Timings
|
||||
+ this.chunkMap.saveIncrementally();
|
||||
}
|
||||
// Paper end - Incremental chunk and player saving
|
||||
|
||||
@@ -472,26 +466,20 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@Override
|
||||
@@ -387,26 +385,20 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@Override
|
||||
public void tick(BooleanSupplier shouldKeepTicking, boolean tickChunks) {
|
||||
this.level.getProfiler().push("purge");
|
||||
@@ -1269,7 +1072,7 @@ index fcecfda569d2a8d6b8a7e228831f822fb7327748..ffab3e27c0d9da2a380a14b6f6ebb243
|
||||
this.level.getProfiler().popPush("chunks");
|
||||
if (tickChunks) {
|
||||
- this.level.timings.chunks.startTiming(); // Paper - timings
|
||||
this.chunkMap.level.playerChunkLoader.tick(); // Paper - replace player chunk loader - this is mostly required to account for view distance changes
|
||||
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getPlayerChunkLoader().tick(); // Paper - rewrite chunk system
|
||||
this.tickChunks();
|
||||
- this.level.timings.chunks.stopTiming(); // Paper - timings
|
||||
this.chunkMap.tick();
|
||||
@@ -1282,13 +1085,15 @@ index fcecfda569d2a8d6b8a7e228831f822fb7327748..ffab3e27c0d9da2a380a14b6f6ebb243
|
||||
this.level.getProfiler().pop();
|
||||
this.clearCache();
|
||||
}
|
||||
@@ -507,13 +495,11 @@ public class ServerChunkCache extends ChunkSource {
|
||||
gameprofilerfiller.push("pollingChunks");
|
||||
@@ -424,7 +416,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
gameprofilerfiller.push("filteringLoadedChunks");
|
||||
// Paper - optimise chunk tick iteration
|
||||
List<ServerChunkCache.ChunkAndHolder> list = Lists.newArrayListWithCapacity(this.chunkMap.size());
|
||||
Iterator iterator = this.chunkMap.getChunks().iterator();
|
||||
- if (this.level.getServer().tickRateManager().runsNormally()) this.level.timings.chunkTicks.startTiming(); // Paper
|
||||
|
||||
// Paper - optimise chunk tick iteration
|
||||
while (iterator.hasNext()) {
|
||||
ChunkHolder playerchunk = (ChunkHolder) iterator.next();
|
||||
@@ -437,7 +428,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
|
||||
if (this.level.tickRateManager().runsNormally()) {
|
||||
gameprofilerfiller.popPush("naturalSpawnCount");
|
||||
@@ -1296,7 +1101,7 @@ index fcecfda569d2a8d6b8a7e228831f822fb7327748..ffab3e27c0d9da2a380a14b6f6ebb243
|
||||
int k = this.distanceManager.getNaturalSpawnChunkCount();
|
||||
// Paper start - Optional per player mob spawns
|
||||
int naturalSpawnChunkCount = k;
|
||||
@@ -538,7 +524,6 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -462,7 +452,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
spawnercreature_d = NaturalSpawner.createState(naturalSpawnChunkCount, this.level.getAllEntities(), this::getFullChunk, !this.level.paperConfig().entities.spawning.perPlayerMobSpawns ? new LocalMobCapCalculator(this.chunkMap) : null, false);
|
||||
}
|
||||
// Paper end - Optional per player mob spawns
|
||||
@@ -1304,10 +1109,10 @@ index fcecfda569d2a8d6b8a7e228831f822fb7327748..ffab3e27c0d9da2a380a14b6f6ebb243
|
||||
|
||||
this.lastSpawnState = spawnercreature_d;
|
||||
gameprofilerfiller.popPush("spawnAndTick");
|
||||
@@ -647,19 +632,14 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -503,21 +492,16 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
}
|
||||
}
|
||||
}
|
||||
// Paper end - optimise chunk tick iteration
|
||||
- this.level.timings.chunkTicks.stopTiming(); // Paper
|
||||
|
||||
gameprofilerfiller.popPush("customSpawners");
|
||||
@@ -1319,22 +1124,15 @@ index fcecfda569d2a8d6b8a7e228831f822fb7327748..ffab3e27c0d9da2a380a14b6f6ebb243
|
||||
}
|
||||
|
||||
gameprofilerfiller.popPush("broadcast");
|
||||
- // Paper - optimise chunk tick iteration
|
||||
list.forEach((chunkproviderserver_a1) -> {
|
||||
- this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timing
|
||||
// Paper start - optimise chunk tick iteration
|
||||
if (!this.chunkMap.needsChangeBroadcasting.isEmpty()) {
|
||||
it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<ChunkHolder> copy = this.chunkMap.needsChangeBroadcasting.clone();
|
||||
@@ -673,8 +653,6 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
}
|
||||
// Paper end - optimise chunk tick iteration
|
||||
chunkproviderserver_a1.holder.broadcastChanges(chunkproviderserver_a1.chunk);
|
||||
- this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timing
|
||||
- // Paper - optimise chunk tick iteration
|
||||
});
|
||||
gameprofilerfiller.pop();
|
||||
gameprofilerfiller.pop();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..92805a3311bc1f21df9512b14b209e1d51174ac5 100644
|
||||
index e079f4db4e4738f60a6fdbdbf5e4d1baf593a62f..d6af1d0cd2829bc1e7e7c7a7a8014750c2bdac2b 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1,7 +1,6 @@
|
||||
@@ -1345,7 +1143,7 @@ index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..92805a3311bc1f21df9512b14b209e1d
|
||||
import com.google.common.collect.Lists;
|
||||
import com.mojang.datafixers.DataFixer;
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
@@ -851,7 +850,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -682,7 +681,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
|
||||
gameprofilerfiller.popPush("tickPending");
|
||||
@@ -1353,7 +1151,7 @@ index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..92805a3311bc1f21df9512b14b209e1d
|
||||
if (!this.isDebug() && flag) {
|
||||
j = this.getGameTime();
|
||||
gameprofilerfiller.push("blockTicks");
|
||||
@@ -860,24 +858,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -691,24 +689,17 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
this.fluidTicks.tick(j, paperConfig().environment.maxFluidTicks, this::tickFluid); // Paper - configurable max fluid ticks
|
||||
gameprofilerfiller.pop();
|
||||
}
|
||||
@@ -1378,7 +1176,7 @@ index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..92805a3311bc1f21df9512b14b209e1d
|
||||
}
|
||||
|
||||
this.handlingTick = false;
|
||||
@@ -890,7 +881,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -721,7 +712,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
|
||||
if (flag1 || this.emptyTime++ < 300) {
|
||||
gameprofilerfiller.push("entities");
|
||||
@@ -1386,7 +1184,7 @@ index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..92805a3311bc1f21df9512b14b209e1d
|
||||
if (this.dragonFight != null && flag) {
|
||||
gameprofilerfiller.push("dragonFight");
|
||||
this.dragonFight.tick();
|
||||
@@ -898,7 +888,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -729,7 +719,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
|
||||
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
|
||||
@@ -1394,7 +1192,7 @@ index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..92805a3311bc1f21df9512b14b209e1d
|
||||
this.entityTickList.forEach((entity) -> {
|
||||
if (!entity.isRemoved()) {
|
||||
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
|
||||
@@ -925,8 +914,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -756,8 +745,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1403,7 +1201,7 @@ index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..92805a3311bc1f21df9512b14b209e1d
|
||||
gameprofilerfiller.pop();
|
||||
this.tickBlockEntities();
|
||||
}
|
||||
@@ -1039,7 +1026,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -870,7 +857,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
} // Paper - Option to disable ice and snow
|
||||
|
||||
gameprofilerfiller.popPush("tickBlocks");
|
||||
@@ -1411,7 +1209,7 @@ index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..92805a3311bc1f21df9512b14b209e1d
|
||||
if (randomTickSpeed > 0) {
|
||||
// Paper start - optimize random block ticking
|
||||
LevelChunkSection[] sections = chunk.getSections();
|
||||
@@ -1073,7 +1059,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -904,7 +890,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
// Paper end - optimise random block ticking
|
||||
|
||||
@@ -1419,17 +1217,17 @@ index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..92805a3311bc1f21df9512b14b209e1d
|
||||
gameprofilerfiller.pop();
|
||||
}
|
||||
|
||||
@@ -1386,9 +1371,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
currentlyTickingEntity.lazySet(entity);
|
||||
}
|
||||
// Paper end - log detailed entity tick information
|
||||
@@ -1206,9 +1191,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
|
||||
public void tickNonPassenger(Entity entity) {
|
||||
- ++TimingHistory.entityTicks; // Paper - timings
|
||||
// Spigot start
|
||||
- co.aikar.timings.Timing timer; // Paper
|
||||
/*if (!org.spigotmc.ActivationRange.checkIfActive(entity)) { // Paper - comment out - EAR 2, reimplement below
|
||||
entity.tickCount++;
|
||||
timer = entity.getType().inactiveTickTimer.startTiming(); try { // Paper - timings
|
||||
@@ -1397,11 +1380,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1217,11 +1200,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
return;
|
||||
}*/ // Paper - comment out EAR 2
|
||||
// Spigot end
|
||||
@@ -1441,7 +1239,7 @@ index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..92805a3311bc1f21df9512b14b209e1d
|
||||
entity.setOldPosAndRot();
|
||||
ProfilerFiller gameprofilerfiller = this.getProfiler();
|
||||
|
||||
@@ -1411,12 +1390,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1231,12 +1210,10 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
});
|
||||
gameprofilerfiller.incrementCounter("tickNonPassenger");
|
||||
if (isActive) { // Paper - EAR 2
|
||||
@@ -1454,7 +1252,7 @@ index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..92805a3311bc1f21df9512b14b209e1d
|
||||
Iterator iterator = entity.getPassengers().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -1439,8 +1416,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1253,8 +1230,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
if (passenger instanceof Player || this.entityTickList.contains(passenger)) {
|
||||
// Paper - EAR 2
|
||||
final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(passenger);
|
||||
@@ -1463,7 +1261,7 @@ index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..92805a3311bc1f21df9512b14b209e1d
|
||||
// Paper end
|
||||
passenger.setOldPosAndRot();
|
||||
++passenger.tickCount;
|
||||
@@ -1469,8 +1444,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1283,8 +1258,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
|
||||
this.tickPassenger(passenger, entity2);
|
||||
}
|
||||
@@ -1472,46 +1270,7 @@ index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..92805a3311bc1f21df9512b14b209e1d
|
||||
}
|
||||
} else {
|
||||
passenger.stopRiding();
|
||||
@@ -1490,26 +1463,22 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld()));
|
||||
}
|
||||
|
||||
- try (co.aikar.timings.Timing ignored = this.timings.worldSave.startTiming()) {
|
||||
- if (doFull) {
|
||||
- this.saveLevelData(true); // Paper - Write SavedData IO async
|
||||
- }
|
||||
+ if (doFull) {
|
||||
+ this.saveLevelData(true); // Paper - Write SavedData IO async
|
||||
+ }
|
||||
|
||||
- this.timings.worldSaveChunks.startTiming(); // Paper
|
||||
- if (!this.noSave()) chunkproviderserver.saveIncrementally();
|
||||
- this.timings.worldSaveChunks.stopTiming(); // Paper
|
||||
+ if (!this.noSave()) chunkproviderserver.saveIncrementally();
|
||||
|
||||
- // Copied from save()
|
||||
- // CraftBukkit start - moved from MinecraftServer.saveChunks
|
||||
- if (doFull) { // Paper
|
||||
- ServerLevel worldserver1 = this;
|
||||
+ // Copied from save()
|
||||
+ // CraftBukkit start - moved from MinecraftServer.saveChunks
|
||||
+ if (doFull) { // Paper
|
||||
+ ServerLevel worldserver1 = this;
|
||||
|
||||
- this.serverLevelData.setWorldBorder(worldserver1.getWorldBorder().createSettings());
|
||||
- this.serverLevelData.setCustomBossEvents(this.server.getCustomBossEvents().save(this.registryAccess()));
|
||||
- this.convertable.saveDataTag(this.server.registryAccess(), this.serverLevelData, this.server.getPlayerList().getSingleplayerData());
|
||||
- }
|
||||
- // CraftBukkit end
|
||||
+ this.serverLevelData.setWorldBorder(worldserver1.getWorldBorder().createSettings());
|
||||
+ this.serverLevelData.setCustomBossEvents(this.server.getCustomBossEvents().save(this.registryAccess()));
|
||||
+ this.convertable.saveDataTag(this.server.registryAccess(), this.serverLevelData, this.server.getPlayerList().getSingleplayerData());
|
||||
}
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
// Paper end - Incremental chunk and player saving
|
||||
|
||||
@@ -1523,7 +1492,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1306,7 +1279,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
|
||||
if (!savingDisabled) {
|
||||
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(this.getWorld())); // CraftBukkit
|
||||
@@ -1519,20 +1278,21 @@ index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..92805a3311bc1f21df9512b14b209e1d
|
||||
if (progressListener != null) {
|
||||
progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel"));
|
||||
}
|
||||
@@ -1533,11 +1501,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1316,12 +1288,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
progressListener.progressStage(Component.translatable("menu.savingChunks"));
|
||||
}
|
||||
|
||||
- timings.worldSaveChunks.startTiming(); // Paper
|
||||
if (!close) chunkproviderserver.save(flush); // Paper - rewrite chunk system
|
||||
if (close) chunkproviderserver.close(true); // Paper - rewrite chunk system
|
||||
if (!close) { chunkproviderserver.save(flush); } // Paper - add close param
|
||||
- timings.worldSaveChunks.stopTiming(); // Paper
|
||||
- }// Paper
|
||||
// Paper - rewrite chunk system - entity saving moved into ChunkHolder
|
||||
|
||||
} else if (close) { chunkproviderserver.close(false); } // Paper - rewrite chunk system
|
||||
// Paper - rewrite chunk system
|
||||
-
|
||||
}
|
||||
// Paper start - add close param
|
||||
if (close) {
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index a2142930b4d4b05987c90496fb9d733d99040aa0..6957cbfbea51d6a3b57e1c5bfcebd52a25cde8d5 100644
|
||||
index 5f20606cc2c79ad9a4c4d4d6c9e6a2a31a88b282..a45ece7009dd9a2f4682f4c0a4759e2718404b0b 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1,6 +1,5 @@
|
||||
@@ -1542,24 +1302,20 @@ index a2142930b4d4b05987c90496fb9d733d99040aa0..6957cbfbea51d6a3b57e1c5bfcebd52a
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
@@ -1235,7 +1234,6 @@ public abstract class PlayerList {
|
||||
@@ -1183,11 +1182,9 @@ public abstract class PlayerList {
|
||||
|
||||
public void saveAll(int interval) {
|
||||
public void saveAll() {
|
||||
io.papermc.paper.util.MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main
|
||||
- MinecraftTimings.savePlayers.startTiming(); // Paper
|
||||
int numSaved = 0;
|
||||
long now = MinecraftServer.currentTick;
|
||||
for (int i = 0; i < this.players.size(); ++i) {
|
||||
@@ -1246,7 +1244,6 @@ public abstract class PlayerList {
|
||||
}
|
||||
// Paper end - Incremental chunk and player saving
|
||||
this.save(this.players.get(i));
|
||||
}
|
||||
- MinecraftTimings.savePlayers.stopTiming(); // Paper
|
||||
return null; }); // Paper - ensure main
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
index a46bf73c608641bf1f00fd55242de71a0f2ee06e..9b15a2a966de203ada8894a9354ff8e0e737ef75 100644
|
||||
index cb61462d4691a055a4b25f7b953609d8a154fdfe..b2b97c4c61ea5b6f7ec199fabbd1bd1c86647ccc 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
@@ -343,10 +343,6 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
@@ -1587,10 +1343,10 @@ index a46bf73c608641bf1f00fd55242de71a0f2ee06e..9b15a2a966de203ada8894a9354ff8e0
|
||||
return this != EntityType.PLAYER && this != EntityType.LLAMA_SPIT && this != EntityType.WITHER && this != EntityType.BAT && this != EntityType.ITEM_FRAME && this != EntityType.GLOW_ITEM_FRAME && this != EntityType.LEASH_KNOT && this != EntityType.PAINTING && this != EntityType.END_CRYSTAL && this != EntityType.EVOKER_FANGS;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 21e61bb75ac7ce468bc757633ce678b21bcb9deb..5b5d8d2430f2b92f56ea3fb0e9a35aa4b9aea48f 100644
|
||||
index b9cef93fe382b666bec04ca95eeaf2d8acbb3c40..de0c9798261c00a76c7c37c396379f42a44720be 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -150,7 +150,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
|
||||
@@ -157,7 +157,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
|
||||
import org.bukkit.event.player.PlayerItemConsumeEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -1674,10 +1430,10 @@ index 85b4b24361e785acf75571ff98f924c00ae80748..1f3e0392f88a7cb3fb5c0767cdd1b4bc
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 14281a4e72f49dc4eb2ca3da8479c1f81a3a175d..6a1adbc426a8c79c3fefc5a17509d9097ac9f3db 100644
|
||||
index 0d202ce8eb88bfdb8ca3306593d758fa483d8612..41acb79ec31f6f53589d698d1d4547485f0adc71 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -171,7 +171,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -172,7 +172,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
// Paper end - add paper world config
|
||||
|
||||
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
||||
@@ -1685,15 +1441,15 @@ index 14281a4e72f49dc4eb2ca3da8479c1f81a3a175d..6a1adbc426a8c79c3fefc5a17509d909
|
||||
public static BlockPos lastPhysicsProblem; // Spigot
|
||||
private org.spigotmc.TickLimiter entityLimiter;
|
||||
private org.spigotmc.TickLimiter tileLimiter;
|
||||
@@ -284,7 +283,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -342,7 +341,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
public void onBorderSetDamageSafeZOne(WorldBorder border, double safeZoneRadius) {}
|
||||
});
|
||||
// CraftBukkit end
|
||||
- this.timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings
|
||||
this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime);
|
||||
this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime);
|
||||
this.chunkPacketBlockController = this.paperConfig().anticheat.antiXray.enabled ? new com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray(this, executor) : com.destroystokyo.paper.antixray.ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
|
||||
@@ -1252,15 +1250,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
this.entityLookup = new ca.spottedleaf.moonrise.patches.chunk_system.level.entity.dfl.DefaultEntityLookup(this); // Paper - rewrite chunk system
|
||||
@@ -944,15 +942,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
ProfilerFiller gameprofilerfiller = this.getProfiler();
|
||||
|
||||
gameprofilerfiller.push("blockEntities");
|
||||
@@ -1709,7 +1465,7 @@ index 14281a4e72f49dc4eb2ca3da8479c1f81a3a175d..6a1adbc426a8c79c3fefc5a17509d909
|
||||
// Spigot start
|
||||
// Iterator<TickingBlockEntity> iterator = this.blockEntityTickers.iterator();
|
||||
boolean flag = this.tickRateManager().runsNormally();
|
||||
@@ -1289,9 +1284,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -983,9 +978,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
}
|
||||
this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
|
||||
|
||||
@@ -1740,10 +1496,10 @@ index ed8032495af9ce9c23419224814b8d27e4a97c17..189a6bd4967aba72e12170e091dbb5b7
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
index cf8b8c8efd1c9c81eb5f02d75bd75875eb66771f..555d255a79c6136d0df3504218a0bc4681a5489f 100644
|
||||
index 45704653310efe9cb755a644674b54b8722c2c84..0c0b149a6cdfaf1de81bfbb92477fbb5c4a8a4bb 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -103,13 +103,6 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -102,13 +102,6 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
this != Blocks.STRUCTURE_BLOCK &&
|
||||
this != Blocks.JIGSAW;
|
||||
}
|
||||
@@ -1777,18 +1533,18 @@ index c0563260277f9f4bd9ff08993b2efb4bca9a0c60..d93125ea494cb977b1616cabc90e2e7a
|
||||
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
|
||||
public CraftPersistentDataContainer persistentDataContainer;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index 14ee7b5b9b804bebd4e2a846b238547a28a36035..33673bde99023af6a136270091959cca69f514fb 100644
|
||||
index d388fbcbff63928f0e9140c02400a63ba8f19d9c..bfed0a72280631e6f20e6b5d493515c9b589db97 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -785,7 +785,6 @@ public class LevelChunk extends ChunkAccess {
|
||||
this.chunkHolder.getEntityChunk().callEntitiesLoadEvent(); // Paper - rewrite chunk system
|
||||
@@ -628,7 +628,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getChunkTaskScheduler().chunkHolderManager.getChunkHolder(this.locX, this.locZ).getEntityChunk().callEntitiesLoadEvent(); // Paper - rewrite chunk system
|
||||
|
||||
if (this.needsDecoration) {
|
||||
- try (co.aikar.timings.Timing ignored = this.level.timings.chunkLoadPopulate.startTiming()) { // Paper
|
||||
this.needsDecoration = false;
|
||||
java.util.Random random = new java.util.Random();
|
||||
random.setSeed(this.level.getSeed());
|
||||
@@ -805,7 +804,6 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -648,7 +647,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
}
|
||||
}
|
||||
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
|
||||
@@ -1796,7 +1552,7 @@ index 14ee7b5b9b804bebd4e2a846b238547a28a36035..33673bde99023af6a136270091959cca
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1161,7 +1159,6 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -988,7 +986,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
ProfilerFiller gameprofilerfiller = LevelChunk.this.level.getProfiler();
|
||||
|
||||
gameprofilerfiller.push(this::getType);
|
||||
@@ -1804,7 +1560,7 @@ index 14ee7b5b9b804bebd4e2a846b238547a28a36035..33673bde99023af6a136270091959cca
|
||||
BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);
|
||||
|
||||
if (this.blockEntity.getType().isValid(iblockdata)) {
|
||||
@@ -1187,9 +1184,6 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -1014,9 +1011,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
LevelChunk.this.removeBlockEntity(this.getPos());
|
||||
// Paper end - Prevent block entity and entity crashes
|
||||
// Spigot start
|
||||
@@ -1814,30 +1570,6 @@ index 14ee7b5b9b804bebd4e2a846b238547a28a36035..33673bde99023af6a136270091959cca
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 1155fc80c0292c8d7efb21dbac3d984176fcaa2d..77dc69ecec095b4d4129913846a12e5c86f21df5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -346,8 +346,8 @@ public class Main {
|
||||
tryPreloadClass("org.jline.terminal.impl.MouseSupport");
|
||||
tryPreloadClass("org.jline.terminal.impl.MouseSupport$1");
|
||||
tryPreloadClass("org.jline.terminal.Terminal$MouseTracking");
|
||||
- tryPreloadClass("co.aikar.timings.TimingHistory");
|
||||
- tryPreloadClass("co.aikar.timings.TimingHistory$MinuteReport");
|
||||
+ // tryPreloadClass("co.aikar.timings.TimingHistory"); Leaves - remove timings
|
||||
+ // tryPreloadClass("co.aikar.timings.TimingHistory$MinuteReport"); Leaves - remove timings
|
||||
tryPreloadClass("io.netty.channel.AbstractChannelHandlerContext");
|
||||
tryPreloadClass("io.netty.channel.AbstractChannelHandlerContext$11");
|
||||
tryPreloadClass("io.netty.channel.AbstractChannelHandlerContext$12");
|
||||
@@ -360,7 +360,7 @@ public class Main {
|
||||
tryPreloadClass("org.bukkit.craftbukkit.scheduler.CraftScheduler$1");
|
||||
tryPreloadClass("org.bukkit.craftbukkit.scheduler.CraftScheduler$2");
|
||||
tryPreloadClass("org.bukkit.craftbukkit.scheduler.CraftScheduler$3");
|
||||
- tryPreloadClass("org.bukkit.craftbukkit.scheduler.CraftScheduler$4");
|
||||
+ // tryPreloadClass("org.bukkit.craftbukkit.scheduler.CraftScheduler$4"); Leaves - remove timings
|
||||
tryPreloadClass("org.slf4j.helpers.MessageFormatter");
|
||||
tryPreloadClass("org.slf4j.helpers.FormattingTuple");
|
||||
tryPreloadClass("org.slf4j.helpers.BasicMarker");
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
index e85b9bb3f9c225d289a4959921970b9963881199..bb9383f1a457433f9db3e78d7913616280925200 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
@@ -1973,7 +1705,7 @@ index b3e1adeb932da9b3bed16acd94e2f16da48a7c72..e9798517b9211c50a20ea5c69603aab3
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index f99353a60e3f236735ef6e2e6f13381b50ae9b7b..5e42a3392fa03813e3e58e80299625993c560396 100644
|
||||
index d70c5546c8bd6f364fad9b24880b6867efdab644..5735e6ab4c3530cd296580f9e8dcb107607929b1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -220,7 +220,6 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -1985,7 +1717,7 @@ index f99353a60e3f236735ef6e2e6f13381b50ae9b7b..5e42a3392fa03813e3e58e8029962599
|
||||
// Paper end
|
||||
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index 3283ed99c35ffed6805567705e0518d9f84feedc..e32e4ffa222fe72c3d3152a91057113c99d3b122 100644
|
||||
index bf2d18f74b0f0da7c3c30310c74224a1c0853564..621bda8248e35f5a5730f89a4bcfbe6615ed969c 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -34,7 +34,6 @@ import net.minecraft.world.entity.projectile.FireworkRocketEntity;
|
||||
|
||||
@@ -31,10 +31,10 @@ index 46954db7ecd35ac4018fdf476df7c8020d7ce6c8..044c51ebb058fc36074fd178929e3279
|
||||
public PlayerAreaMap() {
|
||||
super();
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 7ef9f67d27cc240191dd5d07e8dcf5fbdebe1049..864e6d223de55f42122485bf6a3c84bbb636479c 100644
|
||||
index 83f3ffdd8fa901b3de580d2359cdb5ead0d762cb..9729b3a7ce3027ff4eb02fcb908768d24f74a5f8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -425,6 +425,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -430,6 +430,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
private UUID originWorld;
|
||||
public boolean freezeLocked = false; // Paper - Freeze Tick Lock API
|
||||
public boolean fixedPose = false; // Paper - Expand Pose API
|
||||
@@ -42,7 +42,7 @@ index 7ef9f67d27cc240191dd5d07e8dcf5fbdebe1049..864e6d223de55f42122485bf6a3c84bb
|
||||
|
||||
public void setOrigin(@javax.annotation.Nonnull Location location) {
|
||||
this.origin = location.toVector();
|
||||
@@ -2554,6 +2555,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2453,6 +2454,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
nbttagcompound.putBoolean("Paper.FreezeLock", true);
|
||||
}
|
||||
// Paper end
|
||||
@@ -50,7 +50,7 @@ index 7ef9f67d27cc240191dd5d07e8dcf5fbdebe1049..864e6d223de55f42122485bf6a3c84bb
|
||||
return nbttagcompound;
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
|
||||
@@ -2701,6 +2703,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2600,6 +2602,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
freezeLocked = nbt.getBoolean("Paper.FreezeLock");
|
||||
}
|
||||
// Paper end
|
||||
@@ -62,7 +62,7 @@ index 7ef9f67d27cc240191dd5d07e8dcf5fbdebe1049..864e6d223de55f42122485bf6a3c84bb
|
||||
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
|
||||
@@ -5000,4 +5007,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4821,4 +4828,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return ((net.minecraft.server.level.ServerChunkCache) level.getChunkSource()).isPositionTicking(this);
|
||||
}
|
||||
// Paper end - Expose entity id counter
|
||||
@@ -75,10 +75,10 @@ index 7ef9f67d27cc240191dd5d07e8dcf5fbdebe1049..864e6d223de55f42122485bf6a3c84bb
|
||||
}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/LeavesLogger.java b/src/main/java/org/leavesmc/leaves/LeavesLogger.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..730174b8c26375510c919fd841dc9371446ae8f2
|
||||
index 0000000000000000000000000000000000000000..47347a3bdab2ff9818bf8198291d2dabec7da8c6
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/LeavesLogger.java
|
||||
@@ -0,0 +1,16 @@
|
||||
@@ -0,0 +1,24 @@
|
||||
+package org.leavesmc.leaves;
|
||||
+
|
||||
+import org.bukkit.Bukkit;
|
||||
@@ -94,6 +94,14 @@ index 0000000000000000000000000000000000000000..730174b8c26375510c919fd841dc9371
|
||||
+ setParent(Bukkit.getLogger());
|
||||
+ setLevel(Level.ALL);
|
||||
+ }
|
||||
+
|
||||
+ public void severe(String msg, Exception exception) {
|
||||
+ this.severe(msg + ", " + exception.getCause() + ": " + exception.getMessage());
|
||||
+ }
|
||||
+
|
||||
+ public void warning(String msg, Exception exception) {
|
||||
+ this.warning(msg + ", " + exception.getCause() + ": " + exception.getMessage());
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/util/AsyncExecutor.java b/src/main/java/org/leavesmc/leaves/util/AsyncExecutor.java
|
||||
new file mode 100644
|
||||
@@ -289,3 +297,109 @@ index 0000000000000000000000000000000000000000..440c4d903e145229bc54eb5b6f3578fd
|
||||
+ return backingMap.size();
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/util/MathUtils.java b/src/main/java/org/leavesmc/leaves/util/MathUtils.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..a6a4fd61644815a7fb01ab1a5844a34f39e57e6d
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/util/MathUtils.java
|
||||
@@ -0,0 +1,100 @@
|
||||
+package org.leavesmc.leaves.util;
|
||||
+
|
||||
+import org.bukkit.util.NumberConversions;
|
||||
+import org.bukkit.util.Vector;
|
||||
+
|
||||
+import java.util.regex.Pattern;
|
||||
+
|
||||
+public class MathUtils {
|
||||
+ // Lag ?
|
||||
+ public static void clean(Vector vector) {
|
||||
+ if (!NumberConversions.isFinite(vector.getX())) vector.setX(0);
|
||||
+ if (!NumberConversions.isFinite(vector.getY())) vector.setY(0);
|
||||
+ if (!NumberConversions.isFinite(vector.getZ())) vector.setZ(0);
|
||||
+ }
|
||||
+
|
||||
+ private static final Pattern numericPattern = Pattern.compile("^-?[1-9]\\d*$|^0$");
|
||||
+
|
||||
+ public static boolean isNumeric(String str) {
|
||||
+ return numericPattern.matcher(str).matches();
|
||||
+ }
|
||||
+
|
||||
+ public static float[] fetchYawPitch(Vector dir) {
|
||||
+ double x = dir.getX();
|
||||
+ double z = dir.getZ();
|
||||
+
|
||||
+ float[] out = new float[2];
|
||||
+
|
||||
+ if (x == 0.0D && z == 0.0D) {
|
||||
+ out[1] = (float) (dir.getY() > 0.0D ? -90 : 90);
|
||||
+ } else {
|
||||
+ double theta = Math.atan2(-x, z);
|
||||
+ out[0] = (float) Math.toDegrees((theta + 6.283185307179586D) % 6.283185307179586D);
|
||||
+
|
||||
+ double x2 = NumberConversions.square(x);
|
||||
+ double z2 = NumberConversions.square(z);
|
||||
+ double xz = Math.sqrt(x2 + z2);
|
||||
+ out[1] = (float) Math.toDegrees(Math.atan(-dir.getY() / xz));
|
||||
+ }
|
||||
+
|
||||
+ return out;
|
||||
+ }
|
||||
+
|
||||
+ public static float fetchPitch(Vector dir) {
|
||||
+ double x = dir.getX();
|
||||
+ double z = dir.getZ();
|
||||
+
|
||||
+ float result;
|
||||
+
|
||||
+ if (x == 0.0D && z == 0.0D) {
|
||||
+ result = (float) (dir.getY() > 0.0D ? -90 : 90);
|
||||
+ } else {
|
||||
+ double x2 = NumberConversions.square(x);
|
||||
+ double z2 = NumberConversions.square(z);
|
||||
+ double xz = Math.sqrt(x2 + z2);
|
||||
+ result = (float) Math.toDegrees(Math.atan(-dir.getY() / xz));
|
||||
+ }
|
||||
+
|
||||
+ return result;
|
||||
+ }
|
||||
+
|
||||
+ public static Vector getDirection(double rotX, double rotY) {
|
||||
+ Vector vector = new Vector();
|
||||
+
|
||||
+ rotX = Math.toRadians(rotX);
|
||||
+ rotY = Math.toRadians(rotY);
|
||||
+
|
||||
+ double xz = Math.abs(Math.cos(rotY));
|
||||
+
|
||||
+ vector.setX(-Math.sin(rotX) * xz);
|
||||
+ vector.setZ(Math.cos(rotX) * xz);
|
||||
+ vector.setY(-Math.sin(rotY));
|
||||
+
|
||||
+ return vector;
|
||||
+ }
|
||||
+
|
||||
+ private static final int[] MULTIPLY_DE_BRUIJN_BIT_POSITION = new int[]{0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9};
|
||||
+
|
||||
+ public static int floorLog2(int value) {
|
||||
+ return ceilLog2(value) - (isPowerOfTwo(value) ? 0 : 1);
|
||||
+ }
|
||||
+
|
||||
+ public static int ceilLog2(int value) {
|
||||
+ value = isPowerOfTwo(value) ? value : smallestEncompassingPowerOfTwo(value);
|
||||
+ return MULTIPLY_DE_BRUIJN_BIT_POSITION[(int) ((long) value * 125613361L >> 27) & 31];
|
||||
+ }
|
||||
+
|
||||
+ public static boolean isPowerOfTwo(int value) {
|
||||
+ return value != 0 && (value & value - 1) == 0;
|
||||
+ }
|
||||
+
|
||||
+ public static int smallestEncompassingPowerOfTwo(int value) {
|
||||
+ int i = value - 1;
|
||||
+ i |= i >> 1;
|
||||
+ i |= i >> 2;
|
||||
+ i |= i >> 4;
|
||||
+ i |= i >> 8;
|
||||
+ i |= i >> 16;
|
||||
+ return i + 1;
|
||||
+ }
|
||||
+}
|
||||
|
||||
@@ -27,7 +27,7 @@ index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..917ffaae401f3374d07d7fb7c024234a
|
||||
if (data == null) {
|
||||
return null;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 5e42a3392fa03813e3e58e80299625993c560396..1fed83a95ae6f3fc805fe5c2e303f4089de194e6 100644
|
||||
index 5735e6ab4c3530cd296580f9e8dcb107607929b1..1d07f5026243196cff49a81635bd17373b02e591 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -503,7 +503,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -41,10 +41,10 @@ index 5e42a3392fa03813e3e58e80299625993c560396..1fed83a95ae6f3fc805fe5c2e303f408
|
||||
@Override
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/util/LeavesVersionFetcher.java b/src/main/java/org/leavesmc/leaves/util/LeavesVersionFetcher.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..b102e2f5cf541b8ced87cf1ec7469ea90da4bb72
|
||||
index 0000000000000000000000000000000000000000..83f9bf9464ded48858b816107b4f14a065d80399
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/util/LeavesVersionFetcher.java
|
||||
@@ -0,0 +1,126 @@
|
||||
@@ -0,0 +1,128 @@
|
||||
+package org.leavesmc.leaves.util;
|
||||
+
|
||||
+import com.destroystokyo.paper.PaperVersionFetcher;
|
||||
@@ -89,6 +89,8 @@ index 0000000000000000000000000000000000000000..b102e2f5cf541b8ced87cf1ec7469ea9
|
||||
+ final ServerBuildInfo build = ServerBuildInfo.buildInfo();
|
||||
+ if (build.buildNumber().isEmpty() && build.gitCommit().isEmpty()) {
|
||||
+ updateMessage = text("You are running a development version without access to version information", color(0xFF5300));
|
||||
+ } else if (build.buildNumber().isEmpty()) {
|
||||
+ updateMessage = text("You are running a development version form CI", color(0xFF5300));
|
||||
+ } else {
|
||||
+ updateMessage = getUpdateStatusMessage("LeavesMC/Leaves", build);
|
||||
+ }
|
||||
@@ -160,7 +162,7 @@ index 0000000000000000000000000000000000000000..b102e2f5cf541b8ced87cf1ec7469ea9
|
||||
+
|
||||
+ try {
|
||||
+ try (BufferedReader reader = Resources.asCharSource(
|
||||
+ URI.create("https://api.leavesmc.org/v2/projects/leaves/versions/" + build.minecraftVersionId() + "/differ/" + build.gitCommit()).toURL(),
|
||||
+ URI.create("https://api.leavesmc.org/v2/projects/leaves/versions/" + build.minecraftVersionId() + "/differ/" + build.gitCommit().get()).toURL(),
|
||||
+ Charsets.UTF_8
|
||||
+ ).openBufferedStream()) {
|
||||
+ return Integer.parseInt(reader.readLine());
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Leaves Server Config And Command
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 16b742b5131376ceca04570dd4c088caff62e677..fe1f6f1a97ab35c44f596596d16765b8b81753a9 100644
|
||||
index 5025c5df3ee6ed84106782e3f9228874bebe63ca..268193499b9f1fae0c01963e8004a3e7422f77ca 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -212,6 +212,14 @@ tasks.registerRunTask("runDevServer") {
|
||||
@@ -23,23 +23,11 @@ index 16b742b5131376ceca04570dd4c088caff62e677..fe1f6f1a97ab35c44f596596d16765b8
|
||||
tasks.registerRunTask("runBundler") {
|
||||
description = "Spin up a test server from the Mojang mapped bundler jar"
|
||||
classpath(rootProject.tasks.named<io.papermc.paperweight.tasks.CreateBundlerJar>("createMojmapBundlerJar").flatMap { it.outputZip })
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 1f973ed9bb9c753b81979085a6fea45b65165fa3..59cc1855d5bebbcaa8f6afc39e91ae0698adcf73 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1147,6 +1147,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
LOGGER.info("Done ({})! For help, type \"help\"", doneTime);
|
||||
// Paper end
|
||||
|
||||
+ org.leavesmc.leaves.LeavesConfig.createWorldSections = false; // Leaves - dont let plugin create worlds fill our config
|
||||
org.spigotmc.WatchdogThread.tick(); // Paper
|
||||
org.spigotmc.WatchdogThread.hasStarted = true; // Paper
|
||||
Arrays.fill( this.recentTps, 20 );
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 340d1b6797d56e2ebdce2d8d7cae62780470e1b7..437f714fc1b38f0040b57cef94a76faa88f1c495 100644
|
||||
index 29d61b407762504dffc26f3048a17327592d9b4a..ec9ade19778c71561b4045ade5ab6cd090768547 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -232,6 +232,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -236,6 +236,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
||||
|
||||
@@ -50,10 +38,10 @@ index 340d1b6797d56e2ebdce2d8d7cae62780470e1b7..437f714fc1b38f0040b57cef94a76faa
|
||||
|
||||
this.setPvpAllowed(dedicatedserverproperties.pvp);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 5db08432b6afd3639688830e717f40ceaf599248..0c8c163d21e6f729c309aa91e69b00b2a41024f2 100644
|
||||
index caf6ff33b42472d30f28629470e12889f50490cc..0de0d0d290625ad4f6cacc1d6374a5d0eb66ca86 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1084,6 +1084,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1087,6 +1087,7 @@ public final class CraftServer implements Server {
|
||||
playerMetadata.removeAll(plugin);
|
||||
}
|
||||
// Paper end
|
||||
@@ -61,7 +49,7 @@ index 5db08432b6afd3639688830e717f40ceaf599248..0c8c163d21e6f729c309aa91e69b00b2
|
||||
this.reloadData();
|
||||
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
|
||||
@@ -3052,6 +3053,14 @@ public final class CraftServer implements Server {
|
||||
@@ -2977,6 +2978,14 @@ public final class CraftServer implements Server {
|
||||
{
|
||||
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
|
||||
}
|
||||
@@ -77,7 +65,7 @@ index 5db08432b6afd3639688830e717f40ceaf599248..0c8c163d21e6f729c309aa91e69b00b2
|
||||
@Override
|
||||
public void restart() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 77dc69ecec095b4d4129913846a12e5c86f21df5..aee7266a002a709e5d9f9215579a7e880b59652a 100644
|
||||
index 459f47244bdfeab63b5f16d780b0291d36310de8..a872421bc3e67fdcc929f104f4b085fbc47760a8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -168,6 +168,14 @@ public class Main {
|
||||
@@ -97,10 +85,10 @@ index 77dc69ecec095b4d4129913846a12e5c86f21df5..aee7266a002a709e5d9f9215579a7e88
|
||||
.withRequiredArg()
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/LeavesConfig.java b/src/main/java/org/leavesmc/leaves/LeavesConfig.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54d5a395d6
|
||||
index 0000000000000000000000000000000000000000..cf5b38338e0349cf75cf7004407fc82a91019c5d
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -0,0 +1,916 @@
|
||||
@@ -0,0 +1,907 @@
|
||||
+package org.leavesmc.leaves;
|
||||
+
|
||||
+import com.destroystokyo.paper.util.SneakyThrow;
|
||||
@@ -121,24 +109,23 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+import java.io.IOException;
|
||||
+import java.util.Collections;
|
||||
+import java.util.List;
|
||||
+import java.util.Locale;
|
||||
+import java.util.logging.Level;
|
||||
+import java.util.Random;
|
||||
+
|
||||
+import org.leavesmc.leaves.protocol.CarpetServerProtocol.CarpetRule;
|
||||
+import org.leavesmc.leaves.protocol.CarpetServerProtocol.CarpetRules;
|
||||
+
|
||||
+//import org.leavesmc.leaves.protocol.bladeren.BladerenProtocol.LeavesFeatureSet; // Leaves - remove protocol temporarily
|
||||
+//import org.leavesmc.leaves.protocol.bladeren.BladerenProtocol.LeavesFeature; // Leaves - remove protocol temporarily
|
||||
+import org.leavesmc.leaves.protocol.bladeren.BladerenProtocol.LeavesFeatureSet;
|
||||
+import org.leavesmc.leaves.protocol.bladeren.BladerenProtocol.LeavesFeature;
|
||||
+
|
||||
+public final class LeavesConfig {
|
||||
+
|
||||
+ public static final String CONFIG_HEADER = "Configuration file for Leaves.";
|
||||
+ public static final int CURRENT_CONFIG_VERSION = 5;
|
||||
+ public static final int CURRENT_CONFIG_VERSION = 6;
|
||||
+
|
||||
+ private static File configFile;
|
||||
+ public static YamlConfiguration config;
|
||||
+ private static int configVersion;
|
||||
+ public static boolean createWorldSections = true;
|
||||
+
|
||||
+ public static void init(final File file) {
|
||||
+ LeavesConfig.configFile = file;
|
||||
@@ -165,11 +152,8 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ LeavesConfig.configVersion = LeavesConfig.config.getInt("config-version", CURRENT_CONFIG_VERSION);
|
||||
+ LeavesConfig.config.set("config-version", CURRENT_CONFIG_VERSION);
|
||||
+
|
||||
+ updateConfigVersion(config);
|
||||
+
|
||||
+ GlobalConfigManager.init();
|
||||
+
|
||||
+ registerCommand("leaves", new LeavesCommand("leaves"));
|
||||
@@ -183,68 +167,13 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @SuppressWarnings("all")
|
||||
+ @Deprecated(forRemoval = true)
|
||||
+ private static void updateConfigVersion(final YamlConfiguration config) {
|
||||
+ if (configVersion < CURRENT_CONFIG_VERSION) {
|
||||
+ switch (configVersion) {
|
||||
+ case 1 -> {
|
||||
+ snowballAndEggCanKnockback = config.getBoolean("settings.snowball-and-egg-can-knockback-player", snowballAndEggCanKnockback);
|
||||
+ fakeplayerSupport = config.getBoolean("settings.fakeplayer.enable", fakeplayerSupport);
|
||||
+ unableFakeplayerNames = (List<String>) config.getList("settings.fakeplayer.unable-fakeplayer-names", unableFakeplayerNames);
|
||||
+ shearsInDispenserCanZeroAmount = config.getBoolean("settings.shears-in-dispenser-can-zero-amount", shearsInDispenserCanZeroAmount);
|
||||
+ redstoneShearsWrench = config.getBoolean("settings.redstone-shears-wrench", redstoneShearsWrench);
|
||||
+ buddingAmethystCanPushByPiston = config.getBoolean("settings.budding-amethyst-can-push-by-piston", buddingAmethystCanPushByPiston);
|
||||
+ spectatorDontGetAdvancement = config.getBoolean("settings.spectator-dont-get-advancement", spectatorDontGetAdvancement);
|
||||
+ stickChangeArmorStandArmStatus = config.getBoolean("settings.stick-change-armorstand-arm-status", stickChangeArmorStandArmStatus);
|
||||
+ noChatSign = config.getBoolean("settings.no-chat-sign", noChatSign);
|
||||
+
|
||||
+ config.set("settings.snowball-and-egg-can-knockback-player", null);
|
||||
+ config.set("settings.player-can-edit-sign", null);
|
||||
+ config.set("settings.fakeplayer", null);
|
||||
+ config.set("settings.shears-in-dispenser-can-zero-amount", null);
|
||||
+ config.set("settings.redstone-shears-wrench", null);
|
||||
+ config.set("settings.budding-amethyst-can-push-by-piston", null);
|
||||
+ config.set("settings.spectator-dont-get-advancement", null);
|
||||
+ config.set("settings.stick-change-armorstand-arm-status", null);
|
||||
+ config.set("settings.no-chat-sign", null);
|
||||
+ }
|
||||
+
|
||||
+ case 2 -> {
|
||||
+ config.set("settings.modify.player-can-edit-sign", null);
|
||||
+ config.set("settings.performance.skip-clone-loot-parameters", null);
|
||||
+ }
|
||||
+
|
||||
+ case 3 -> {
|
||||
+ boolean carpetAlternative = config.getBoolean("settings.protocol.carpet-alternative-block-placement", false);
|
||||
+ alternativeBlockPlacement = carpetAlternative ? AlternativePlaceType.CARPET : AlternativePlaceType.NONE;
|
||||
+ config.set("settings.protocol.carpet-alternative-block-placement", null);
|
||||
+ }
|
||||
+
|
||||
+ case 4 -> {
|
||||
+ shearsInDispenserCanZeroAmount = config.getBoolean("settings.modify.shears-in-dispenser-can-zero-amount", shearsInDispenserCanZeroAmount);
|
||||
+ instantBlockUpdaterReintroduced = config.getBoolean("settings.modify.instant-block-updater-reintroduced", instantBlockUpdaterReintroduced);
|
||||
+ redstoneDontCantOnTrapDoor = config.getBoolean("settings.modify.redstone-wire-dont-connect-if-on-trapdoor", redstoneDontCantOnTrapDoor);
|
||||
+ mendingCompatibilityInfinity = config.getBoolean("settings.modify.mending-compatibility-infinity", mendingCompatibilityInfinity);
|
||||
+ zeroTickPlants = config.getBoolean("settings.modify.zero-tick-plants", zeroTickPlants);
|
||||
+
|
||||
+ config.set("settings.modify.shears-in-dispenser-can-zero-amount", null);
|
||||
+ config.set("settings.modify.instant-block-updater-reintroduced", null);
|
||||
+ config.set("settings.modify.redstone-wire-dont-connect-if-on-trapdoor", null);
|
||||
+ config.set("settings.modify.mending-compatibility-infinity", null);
|
||||
+ config.set("settings.modify.zero-tick-plants", null);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public static void registerCommand(String name, Command command) {
|
||||
+ MinecraftServer.getServer().server.getCommandMap().register(name, "leaves", command);
|
||||
+ MinecraftServer.getServer().server.syncCommands();
|
||||
+ }
|
||||
+
|
||||
+ public static void unregisterCommand(String name) {
|
||||
+ name = name.toLowerCase(java.util.Locale.ENGLISH).trim();
|
||||
+ name = name.toLowerCase(Locale.ENGLISH).trim();
|
||||
+ MinecraftServer.getServer().server.getCommandMap().getKnownCommands().remove(name);
|
||||
+ MinecraftServer.getServer().server.getCommandMap().getKnownCommands().remove("leaves:" + name);
|
||||
+ MinecraftServer.getServer().server.syncCommands();
|
||||
@@ -254,6 +183,7 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+
|
||||
+ // Leaves start - modify - fakeplayer
|
||||
+
|
||||
+ @RemovedConfig(name = "enable", category = "fakeplayer", transform = true)
|
||||
+ @GlobalConfig(name = "enable", category = {"modify", "fakeplayer"}, verify = FakeplayerVerify.class)
|
||||
+ public static boolean fakeplayerSupport = true;
|
||||
+
|
||||
@@ -270,6 +200,7 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @RemovedConfig(name = "unable-fakeplayer-names", category = "fakeplayer", transform = true)
|
||||
+ @GlobalConfig(name = "unable-fakeplayer-names", category = {"modify", "fakeplayer"}, verify = ConfigVerify.ListConfigVerify.class)
|
||||
+ public static List<String> unableFakeplayerNames = List.of("player-name");
|
||||
+
|
||||
@@ -307,13 +238,22 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @GlobalConfig(name = "use-action", category = {"modify", "fakeplayer"})
|
||||
+ public static boolean fakeplayerUseAction = true;
|
||||
+
|
||||
+ @GlobalConfig(name = "modify-config", category = {"modify", "fakeplayer"})
|
||||
+ public static boolean fakeplayerModifyConfig = false;
|
||||
+
|
||||
+ // Leaves end - modify - fakeplayer
|
||||
+
|
||||
+ // Leaves start - modify - minecraft-old
|
||||
+
|
||||
+ @RemovedConfig(name = "shears-in-dispenser-can-zero-amount", category = {}, transform = true)
|
||||
+ @RemovedConfig(name = "shears-in-dispenser-can-zero-amount", category = "modify", transform = true)
|
||||
+ @GlobalConfig(name = "shears-in-dispenser-can-zero-amount", category = {"modify", "minecraft-old"})
|
||||
+ public static boolean shearsInDispenserCanZeroAmount = false;
|
||||
+
|
||||
+ @RemovedConfig(name = "instant-block-updater-reintroduced", category = "modify", transform = true)
|
||||
+ @GlobalConfig(name = "instant-block-updater-reintroduced", category = {"modify", "minecraft-old"}, lock = true)
|
||||
+ public static boolean instantBlockUpdaterReintroduced = false;
|
||||
+
|
||||
@@ -340,12 +280,11 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ @GlobalConfig(name = "crafter-1gt-delay", category = {"modify", "minecraft-old"})
|
||||
+ public static boolean crafter1gt = false;
|
||||
+
|
||||
+ @RemovedConfig(name = "redstone-wire-dont-connect-if-on-trapdoor", category = "modify", transform = true)
|
||||
+ @GlobalConfig(name = "redstone-wire-dont-connect-if-on-trapdoor", category = {"modify", "minecraft-old"})
|
||||
+ public static boolean redstoneDontCantOnTrapDoor = false;
|
||||
+
|
||||
+ @GlobalConfig(name = "mending-compatibility-infinity", category = {"modify", "minecraft-old"})
|
||||
+ public static boolean mendingCompatibilityInfinity = false;
|
||||
+
|
||||
+ @RemovedConfig(name = "zero-tick-plants", category = "modify", transform = true)
|
||||
+ @GlobalConfig(name = "zero-tick-plants", category = {"modify", "minecraft-old"})
|
||||
+ public static boolean zeroTickPlants = false;
|
||||
+
|
||||
@@ -356,13 +295,19 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ private static class RNGFishingVerify extends ConfigVerify.BooleanConfigVerify {
|
||||
+ @Override
|
||||
+ public String check(Boolean old, Boolean value) {
|
||||
+// LeavesFeatureSet.register(LeavesFeature.of("rng_fishing", value)); // Leaves - remove protocol temporarily
|
||||
+ LeavesFeatureSet.register(LeavesFeature.of("rng_fishing", value));
|
||||
+ return null;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @GlobalConfig(name = "protection-stacking", category = {"modify", "minecraft-old"})
|
||||
+ public static boolean protectionStacking = false;
|
||||
+ @GlobalConfig(name = "allow-grindstone-overstacking", category = {"modify", "minecraft-old"})
|
||||
+ public static boolean allowGrindstoneOverstacking = false;
|
||||
+
|
||||
+ @GlobalConfig(name = "allow-entity-portal-with-passenger", category = {"modify", "minecraft-old"})
|
||||
+ public static boolean allowEntityPortalWithPassenger = true;
|
||||
+
|
||||
+ @GlobalConfig(name = "disable-gateway-portal-entity-ticking", category = {"modify", "minecraft-old"})
|
||||
+ public static boolean disableGatewayPortalEntityTicking = false;
|
||||
+
|
||||
+ // Leaves end - modify - minecraft-old
|
||||
+
|
||||
@@ -388,18 +333,23 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+
|
||||
+ // Leaves end - modify - elytra-aeronautics
|
||||
+
|
||||
+ @RemovedConfig(name = "redstone-shears-wrench", category = {}, transform = true)
|
||||
+ @GlobalConfig(name = "redstone-shears-wrench", category = "modify")
|
||||
+ public static boolean redstoneShearsWrench = true;
|
||||
+
|
||||
+ @RemovedConfig(name = "budding-amethyst-can-push-by-piston", category = {}, transform = true)
|
||||
+ @GlobalConfig(name = "budding-amethyst-can-push-by-piston", category = "modify")
|
||||
+ public static boolean buddingAmethystCanPushByPiston = false;
|
||||
+
|
||||
+ @RemovedConfig(name = "spectator-dont-get-advancement", category = {}, transform = true)
|
||||
+ @GlobalConfig(name = "spectator-dont-get-advancement", category = "modify")
|
||||
+ public static boolean spectatorDontGetAdvancement = false;
|
||||
+
|
||||
+ @RemovedConfig(name = "stick-change-armorstand-arm-status", category = {}, transform = true)
|
||||
+ @GlobalConfig(name = "stick-change-armorstand-arm-status", category = "modify")
|
||||
+ public static boolean stickChangeArmorStandArmStatus = true;
|
||||
+
|
||||
+ @RemovedConfig(name = "snowball-and-egg-can-knockback-player", category = {}, transform = true)
|
||||
+ @GlobalConfig(name = "snowball-and-egg-can-knockback-player", category = "modify")
|
||||
+ public static boolean snowballAndEggCanKnockback = true;
|
||||
+
|
||||
@@ -460,7 +410,7 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ private static class UseVanillaRandomVerify extends ConfigVerify.BooleanConfigVerify {
|
||||
+ @Override
|
||||
+ public String check(Boolean old, Boolean value) {
|
||||
+// LeavesFeatureSet.register(LeavesFeature.of("use_vanilla_random", value)); // Leaves - remove protocol temporarily
|
||||
+ LeavesFeatureSet.register(LeavesFeature.of("use_vanilla_random", value));
|
||||
+ return null;
|
||||
+ }
|
||||
+ }
|
||||
@@ -471,9 +421,19 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ @GlobalConfig(name = "bedrock-break-list", category = "modify", lock = true)
|
||||
+ public static boolean bedrockBreakList = false;
|
||||
+
|
||||
+ @GlobalConfig(name = "disable-distance-check-for-use-item", category = "modify")
|
||||
+ @GlobalConfig(name = "disable-distance-check-for-use-item", category = "modify", verify = DisableDistanceCheckForUseItemVerify.class)
|
||||
+ public static boolean disableDistanceCheckForUseItem = false;
|
||||
+
|
||||
+ private static class DisableDistanceCheckForUseItemVerify extends ConfigVerify.BooleanConfigVerify {
|
||||
+ @Override
|
||||
+ public String check(Boolean old, Boolean value) {
|
||||
+ if (alternativeBlockPlacement != AlternativePlaceType.NONE && !value) {
|
||||
+ return "alternative-block-placement is enable, disable-distance-check-for-use-item always need true";
|
||||
+ }
|
||||
+ return null;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @GlobalConfig(name = "no-feather-falling-trample", category = "modify")
|
||||
+ public static boolean noFeatherFallingTrample = false;
|
||||
+
|
||||
@@ -512,7 +472,7 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ private static class LavaRiptideVerify extends ConfigVerify.BooleanConfigVerify {
|
||||
+ @Override
|
||||
+ public String check(Boolean old, Boolean value) {
|
||||
+// LeavesFeatureSet.register(LeavesFeature.of("lava_riptide", value)); // Leaves - remove protocol temporarily
|
||||
+ LeavesFeatureSet.register(LeavesFeature.of("lava_riptide", value));
|
||||
+ return null;
|
||||
+ }
|
||||
+ }
|
||||
@@ -610,6 +570,15 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ @RemovedConfig(name = "tick-command", category = "modify")
|
||||
+ public static boolean tickCommand = false;
|
||||
+
|
||||
+ @RemovedConfig(name = "player-can-edit-sign", category = "modify")
|
||||
+ public static boolean playerCanEditSign = false;
|
||||
+
|
||||
+ @RemovedConfig(name = "mending-compatibility-infinity", category = {"modify", "minecraft-old"})
|
||||
+ public static boolean mendingCompatibilityInfinity = false;
|
||||
+
|
||||
+ @RemovedConfig(name = "protection-stacking", category = {"modify", "minecraft-old"})
|
||||
+ public static boolean protectionStacking = false;
|
||||
+
|
||||
+ // Leaves end - modify - removed
|
||||
+
|
||||
+ // Leaves end - modify
|
||||
@@ -624,9 +593,6 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ @GlobalConfig(name = "inventory-contains-iterators", category = {"performance", "remove"})
|
||||
+ public static boolean removeInventoryContainsIterators = true;
|
||||
+
|
||||
+ @RemovedConfig(name = "get-nearby-players-streams", category = {"performance", "remove"})
|
||||
+ public static boolean removeGetNearPlayerStreams = true;
|
||||
+
|
||||
+ @GlobalConfig(name = "range-check-streams-and-iterators", category = {"performance", "remove"})
|
||||
+ public static boolean removeRangeCheckStreams = true;
|
||||
+
|
||||
@@ -647,18 +613,12 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ @GlobalConfig(name = "enable-suffocation-optimization", category = "performance")
|
||||
+ public static boolean enableSuffocationOptimization = true;
|
||||
+
|
||||
+ @RemovedConfig(name = "strip-raytracing-for-entity", category = "performance")
|
||||
+ public static boolean entityStripRaytracing = true;
|
||||
+
|
||||
+ @GlobalConfig(name = "check-spooky-season-once-an-hour", category = "performance")
|
||||
+ public static boolean checkSpookySeasonOnceAnHour = true;
|
||||
+
|
||||
+ @GlobalConfig(name = "optimize-chunk-ticking", category = "performance", lock = true)
|
||||
+ public static boolean optimizeChunkTicking = true;
|
||||
+
|
||||
+ @RemovedConfig(name = "skip-poi-find-in-vehicle", category = "performance")
|
||||
+ public static boolean skipPOIFindingInVehicle = true;
|
||||
+
|
||||
+ @GlobalConfig(name = "entity-target-find-optimization", category = "performance")
|
||||
+ public static boolean entityTargetFindingOptimization = true;
|
||||
+
|
||||
@@ -678,7 +638,7 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ public static boolean biomeTemperaturesUseAgingCache = true;
|
||||
+
|
||||
+ @GlobalConfig(name = "reduce-entity-fluid-lookup", category = "performance")
|
||||
+ public static boolean reduceEntityFluidLookup = true;
|
||||
+ public static boolean reduceEntityFluidLookup = false;
|
||||
+
|
||||
+ @GlobalConfig(name = "reduce-chuck-load-and-lookup", category = "performance")
|
||||
+ public static boolean reduceChuckLoadAndLookup = true;
|
||||
@@ -692,9 +652,6 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ @GlobalConfig(name = "faster-chunk-serialization", category = "performance")
|
||||
+ public static boolean fasterChunkSerialization = true;
|
||||
+
|
||||
+ @GlobalConfig(name = "optimize-world-generation-and-block-access", category = "performance")
|
||||
+ public static boolean optimizeWorldGenerationAccess = true;
|
||||
+
|
||||
+ @GlobalConfig(name = "cache-world-generator-sea-level", category = "performance")
|
||||
+ public static boolean cacheWorldGeneratorSeaLevel = true;
|
||||
+
|
||||
@@ -757,6 +714,21 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ @RemovedConfig(name = "fix-paper-9372", category = {"performance", "fix"})
|
||||
+ public static boolean fixPaper9372 = true;
|
||||
+
|
||||
+ @RemovedConfig(name = "skip-clone-loot-parameters", category = "performance")
|
||||
+ public static boolean skipCloneLootParameters = true;
|
||||
+
|
||||
+ @RemovedConfig(name = "skip-poi-find-in-vehicle", category = "performance")
|
||||
+ public static boolean skipPOIFindingInVehicle = true;
|
||||
+
|
||||
+ @RemovedConfig(name = "strip-raytracing-for-entity", category = "performance")
|
||||
+ public static boolean entityStripRaytracing = true;
|
||||
+
|
||||
+ @RemovedConfig(name = "get-nearby-players-streams", category = {"performance", "remove"})
|
||||
+ public static boolean removeGetNearPlayerStreams = true;
|
||||
+
|
||||
+ @RemovedConfig(name = "optimize-world-generation-and-block-access", category = "performance")
|
||||
+ public static boolean optimizeWorldGenerationAccess = true;
|
||||
+
|
||||
+ // Leaves end - performance - removed
|
||||
+
|
||||
+ // Leaves end - performance
|
||||
@@ -774,7 +746,7 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ private static class MSPTSyncVerify extends ConfigVerify.BooleanConfigVerify {
|
||||
+ @Override
|
||||
+ public String check(Boolean old, Boolean value) {
|
||||
+// LeavesFeatureSet.register(LeavesFeature.of("mspt_sync", value)); // Leaves - remove protocol temporarily
|
||||
+ LeavesFeatureSet.register(LeavesFeature.of("mspt_sync", value));
|
||||
+ return null;
|
||||
+ }
|
||||
+ }
|
||||
@@ -806,7 +778,7 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ @Override
|
||||
+ public String check(Boolean old, Boolean value) {
|
||||
+ if (value) {
|
||||
+// org.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol.init(); // Leaves - remove protocol temporarily
|
||||
+ org.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol.init();
|
||||
+ }
|
||||
+ return null;
|
||||
+ }
|
||||
@@ -846,6 +818,12 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ }
|
||||
+
|
||||
+ private static class AlternativePlaceVerify extends ConfigVerify.EnumConfigVerify<AlternativePlaceType> {
|
||||
+ @Override
|
||||
+ public void runAfterLoader(Enum<AlternativePlaceType> value) {
|
||||
+ if (value != AlternativePlaceType.NONE) {
|
||||
+ disableDistanceCheckForUseItem = true;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @GlobalConfig(name = "appleskin-protocol", category = "protocol")
|
||||
@@ -922,6 +900,7 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ @GlobalConfig(name = "disable-method-profiler", category = "misc")
|
||||
+ public static boolean disableMethodProfiler = true;
|
||||
+
|
||||
+ @RemovedConfig(name = "no-chat-sign", category = {}, transform = true)
|
||||
+ @GlobalConfig(name = "no-chat-sign", category = "misc")
|
||||
+ public static boolean noChatSign = true;
|
||||
+
|
||||
@@ -950,7 +929,7 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+ public static boolean bstatsPrivacyMode = false;
|
||||
+
|
||||
+ @GlobalConfig(name = "force-minecraft-command", category = "misc")
|
||||
+ public static boolean forceMinecraftCommand = true;
|
||||
+ public static boolean forceMinecraftCommand = false;
|
||||
+
|
||||
+ @GlobalConfig(name = "leaves-packet-event", category = "misc")
|
||||
+ public static boolean leavesPacketEvent = true;
|
||||
@@ -1019,10 +998,10 @@ index 0000000000000000000000000000000000000000..5809475f59efe62e18a0905532810e54
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/command/CommandArgument.java b/src/main/java/org/leavesmc/leaves/command/CommandArgument.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..381cd8b33137a5b7dc688306b56805f35c57012a
|
||||
index 0000000000000000000000000000000000000000..2f0e6671dd8bfe4f320eab92c5f5bbc10abc3b05
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/command/CommandArgument.java
|
||||
@@ -0,0 +1,43 @@
|
||||
@@ -0,0 +1,49 @@
|
||||
+package org.leavesmc.leaves.command;
|
||||
+
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
@@ -1057,6 +1036,12 @@ index 0000000000000000000000000000000000000000..381cd8b33137a5b7dc688306b56805f3
|
||||
+ return this;
|
||||
+ }
|
||||
+
|
||||
+ public CommandArgument setAllTabComplete(List<List<String>> tabComplete) {
|
||||
+ this.tabComplete.clear();
|
||||
+ this.tabComplete.addAll(tabComplete);
|
||||
+ return this;
|
||||
+ }
|
||||
+
|
||||
+ public CommandArgumentResult parse(int index, String @NotNull [] args) {
|
||||
+ Object[] result = new Object[argumentTypes.size()];
|
||||
+ Arrays.fill(result, null);
|
||||
@@ -1068,10 +1053,10 @@ index 0000000000000000000000000000000000000000..381cd8b33137a5b7dc688306b56805f3
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/command/CommandArgumentResult.java b/src/main/java/org/leavesmc/leaves/command/CommandArgumentResult.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..e50ca0473ab4d40e2623ab15f8566276cc14f4e7
|
||||
index 0000000000000000000000000000000000000000..6549037cf0bb8460fef8bef41d2335be079b9e9b
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/command/CommandArgumentResult.java
|
||||
@@ -0,0 +1,62 @@
|
||||
@@ -0,0 +1,61 @@
|
||||
+package org.leavesmc.leaves.command;
|
||||
+
|
||||
+import net.minecraft.core.BlockPos;
|
||||
@@ -1132,7 +1117,6 @@ index 0000000000000000000000000000000000000000..e50ca0473ab4d40e2623ab15f8566276
|
||||
+ return null;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/command/CommandArgumentType.java b/src/main/java/org/leavesmc/leaves/command/CommandArgumentType.java
|
||||
new file mode 100644
|
||||
@@ -1179,7 +1163,7 @@ index 0000000000000000000000000000000000000000..dccd32714b86d1fa3e0a9b10a23f765f
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/command/LeavesCommand.java b/src/main/java/org/leavesmc/leaves/command/LeavesCommand.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..b9e2bdb034dcd5119680ddea44a1eda11a0189b2
|
||||
index 0000000000000000000000000000000000000000..ebd62b1d3a60d3e22e3849047293e1f62533eae7
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/command/LeavesCommand.java
|
||||
@@ -0,0 +1,118 @@
|
||||
@@ -1195,9 +1179,9 @@ index 0000000000000000000000000000000000000000..b9e2bdb034dcd5119680ddea44a1eda1
|
||||
+import org.bukkit.permissions.Permission;
|
||||
+import org.bukkit.permissions.PermissionDefault;
|
||||
+import org.bukkit.plugin.PluginManager;
|
||||
+import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.leavesmc.leaves.command.subcommands.ConfigCommand;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+import org.leavesmc.leaves.command.subcommands.*;
|
||||
+
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.Arrays;
|
||||
@@ -1615,10 +1599,10 @@ index 0000000000000000000000000000000000000000..67d4365d25714c3732274e5ab21981a3
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/config/GlobalConfigManager.java b/src/main/java/org/leavesmc/leaves/config/GlobalConfigManager.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..828bbd8b048df8e48ef007d2c1eefe1458b4b2c3
|
||||
index 0000000000000000000000000000000000000000..0addf5a2f5e015b73b8a02e8f3eef79790eb4587
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/config/GlobalConfigManager.java
|
||||
@@ -0,0 +1,188 @@
|
||||
@@ -0,0 +1,192 @@
|
||||
+package org.leavesmc.leaves.config;
|
||||
+
|
||||
+import org.bukkit.Bukkit;
|
||||
@@ -1647,8 +1631,7 @@ index 0000000000000000000000000000000000000000..828bbd8b048df8e48ef007d2c1eefe14
|
||||
+ if (Modifier.isStatic(field.getModifiers())) {
|
||||
+ field.setAccessible(true);
|
||||
+
|
||||
+ RemovedConfig removedConfig = field.getAnnotation(RemovedConfig.class);
|
||||
+ if (removedConfig != null) {
|
||||
+ for (RemovedConfig removedConfig : field.getAnnotationsByType(RemovedConfig.class)) {
|
||||
+ RemovedVerifiedConfig verifiedConfig = RemovedVerifiedConfig.build(removedConfig, field);
|
||||
+ verifiedConfig.run();
|
||||
+ }
|
||||
@@ -1671,7 +1654,7 @@ index 0000000000000000000000000000000000000000..828bbd8b048df8e48ef007d2c1eefe14
|
||||
+
|
||||
+ try {
|
||||
+ Object savedValue = LeavesConfig.config.get(verifiedConfig.path);
|
||||
+ if (isEnumConfig) {
|
||||
+ if (isEnumConfig && savedValue != null) {
|
||||
+ savedValue = verify.convert(savedValue.toString());
|
||||
+ }
|
||||
+ String checkInfo = verify.check(null, savedValue);
|
||||
@@ -1713,18 +1696,23 @@ index 0000000000000000000000000000000000000000..828bbd8b048df8e48ef007d2c1eefe14
|
||||
+ public void run() {
|
||||
+ if (config.transform()) {
|
||||
+ if (LeavesConfig.config.contains(path)) {
|
||||
+ String string = LeavesConfig.config.get(path).toString();
|
||||
+ try {
|
||||
+ Object object = convert.convert(string);
|
||||
+ field.set(null, object);
|
||||
+ } catch (Exception e) {
|
||||
+ e.printStackTrace();
|
||||
+ Object savedValue = LeavesConfig.config.get(path);
|
||||
+ if (savedValue != null) {
|
||||
+ try {
|
||||
+ Object object = convert.convert(savedValue.toString());
|
||||
+ field.set(null, object);
|
||||
+ } catch (Exception e) {
|
||||
+ LeavesLogger.LOGGER.warning("Failure to load leaves config" + path, e);
|
||||
+ }
|
||||
+ } else {
|
||||
+ LeavesLogger.LOGGER.warning("Failed to convert saved value for " + path + ", reset to default");
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ LeavesConfig.config.set(path, null);
|
||||
+ }
|
||||
+
|
||||
+ @SuppressWarnings("all")
|
||||
+ public static RemovedVerifiedConfig build(RemovedConfig config, Field field) {
|
||||
+ StringBuilder path = new StringBuilder("settings.");
|
||||
+ for (int i = 0; i < config.category().length; i++) {
|
||||
@@ -1738,7 +1726,7 @@ index 0000000000000000000000000000000000000000..828bbd8b048df8e48ef007d2c1eefe14
|
||||
+ constructor.setAccessible(true);
|
||||
+ configConvert = constructor.newInstance();
|
||||
+ } catch (Exception e) {
|
||||
+ e.printStackTrace();
|
||||
+ LeavesLogger.LOGGER.warning("Failure to load leaves config" + path, e);
|
||||
+ }
|
||||
+
|
||||
+ return new RemovedVerifiedConfig(config, configConvert, field, path.toString());
|
||||
@@ -1786,6 +1774,7 @@ index 0000000000000000000000000000000000000000..828bbd8b048df8e48ef007d2c1eefe14
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @SuppressWarnings("all")
|
||||
+ public static VerifiedConfig build(GlobalConfig config, Field field) {
|
||||
+ StringBuilder path = new StringBuilder("settings.");
|
||||
+ for (int i = 0; i < config.category().length; i++) {
|
||||
@@ -1799,29 +1788,30 @@ index 0000000000000000000000000000000000000000..828bbd8b048df8e48ef007d2c1eefe14
|
||||
+ constructor.setAccessible(true);
|
||||
+ configVerify = constructor.newInstance();
|
||||
+ } catch (Exception e) {
|
||||
+ e.printStackTrace();
|
||||
+ LeavesLogger.LOGGER.warning("Failure to load leaves config" + path, e);
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ return new VerifiedConfig(config, configVerify, field, path.toString());
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/config/RemovedConfig.java b/src/main/java/org/leavesmc/leaves/config/RemovedConfig.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..90137a284acaf9036334ee2fe6ab34025acb4f4d
|
||||
index 0000000000000000000000000000000000000000..df9af9e3561ad9eb77f75a6250327e6428d21d1e
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/config/RemovedConfig.java
|
||||
@@ -0,0 +1,19 @@
|
||||
@@ -0,0 +1,21 @@
|
||||
+package org.leavesmc.leaves.config;
|
||||
+
|
||||
+import java.lang.annotation.ElementType;
|
||||
+import java.lang.annotation.Repeatable;
|
||||
+import java.lang.annotation.Retention;
|
||||
+import java.lang.annotation.RetentionPolicy;
|
||||
+import java.lang.annotation.Target;
|
||||
+
|
||||
+@Target(ElementType.FIELD)
|
||||
+@Retention(RetentionPolicy.RUNTIME)
|
||||
+@Repeatable(RemovedConfigs.class)
|
||||
+public @interface RemovedConfig {
|
||||
+
|
||||
+ String name();
|
||||
@@ -1832,3 +1822,21 @@ index 0000000000000000000000000000000000000000..90137a284acaf9036334ee2fe6ab3402
|
||||
+
|
||||
+ Class<? extends ConfigConvert<?>> convert() default ConfigVerify.BooleanConfigVerify.class;
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/config/RemovedConfigs.java b/src/main/java/org/leavesmc/leaves/config/RemovedConfigs.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..b1ab6db328b562a8ab7d2091b47b81cee739adf1
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/config/RemovedConfigs.java
|
||||
@@ -0,0 +1,12 @@
|
||||
+package org.leavesmc.leaves.config;
|
||||
+
|
||||
+import java.lang.annotation.ElementType;
|
||||
+import java.lang.annotation.Retention;
|
||||
+import java.lang.annotation.RetentionPolicy;
|
||||
+import java.lang.annotation.Target;
|
||||
+
|
||||
+@Target(ElementType.FIELD)
|
||||
+@Retention(RetentionPolicy.RUNTIME)
|
||||
+public @interface RemovedConfigs {
|
||||
+ RemovedConfig[] value();
|
||||
+}
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Leaves Protocol Core
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java b/src/main/java/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java
|
||||
index 0211311b3b63bcdea7ebf7bcb24629674c771402..c05a72f4928ee2cec28a61ed06a9079d52634900 100644
|
||||
index 7655987d061bdb2839b30f926efb034046feaea3..7ae6b2bb868cc3d391bae87fa5e141cf64cc6c78 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java
|
||||
@@ -40,13 +40,23 @@ public interface CustomPacketPayload {
|
||||
@@ -33,11 +33,24 @@ index 0211311b3b63bcdea7ebf7bcb24629674c771402..c05a72f4928ee2cec28a61ed06a9079d
|
||||
}
|
||||
};
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/resources/ResourceLocation.java b/src/main/java/net/minecraft/resources/ResourceLocation.java
|
||||
index 1967c43ee3a12e63365cc40ee6565307e2fd73cf..6e376d0db5321d8e9b6e0b54617ffd171bf4ee73 100644
|
||||
--- a/src/main/java/net/minecraft/resources/ResourceLocation.java
|
||||
+++ b/src/main/java/net/minecraft/resources/ResourceLocation.java
|
||||
@@ -36,7 +36,7 @@ public final class ResourceLocation implements Comparable<ResourceLocation> {
|
||||
private final String namespace;
|
||||
private final String path;
|
||||
|
||||
- private ResourceLocation(String namespace, String path) {
|
||||
+ public ResourceLocation(String namespace, String path) { // Leaves - private -> public
|
||||
assert isValidNamespace(namespace);
|
||||
|
||||
assert isValidPath(path);
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 59cc1855d5bebbcaa8f6afc39e91ae0698adcf73..f8ddccd4d9b79c9fb26bca580bf023194bc0eae8 100644
|
||||
index 3a37a083556a722ea6fbc75adf32b36e1b66bcc4..9d7f102b6128638cd478e21867ad9f276bad4f32 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1782,6 +1782,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1798,6 +1798,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
this.profiler.popPush("server gui refresh");
|
||||
|
||||
@@ -47,10 +60,10 @@ index 59cc1855d5bebbcaa8f6afc39e91ae0698adcf73..f8ddccd4d9b79c9fb26bca580bf02319
|
||||
((Runnable) this.tickables.get(i)).run();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
index 308aef9c4933b2bcdd622a34b68efab4a220fe4d..82bf29bb3096797801f768c2b631d8b6cae8f761 100644
|
||||
index b43f87ff4b9853b5d4bbea5ff9686d64d9d0d26b..01c2e26f92d5d1e46b98ebd20727beb779c98095 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
@@ -148,6 +148,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
@@ -149,6 +149,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
|
||||
@Override
|
||||
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
|
||||
@@ -62,7 +75,7 @@ index 308aef9c4933b2bcdd622a34b68efab4a220fe4d..82bf29bb3096797801f768c2b631d8b6
|
||||
// Paper start - Brand support
|
||||
if (packet.payload() instanceof net.minecraft.network.protocol.common.custom.BrandPayload brandPayload) {
|
||||
this.player.clientBrandName = brandPayload.brand();
|
||||
@@ -165,6 +170,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
@@ -166,6 +171,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
String channels = payload.toString(com.google.common.base.Charsets.UTF_8);
|
||||
for (String channel : channels.split("\0")) {
|
||||
this.getCraftPlayer().addChannel(channel);
|
||||
@@ -71,7 +84,7 @@ index 308aef9c4933b2bcdd622a34b68efab4a220fe4d..82bf29bb3096797801f768c2b631d8b6
|
||||
} catch (Exception ex) {
|
||||
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex);
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 6957cbfbea51d6a3b57e1c5bfcebd52a25cde8d5..11d73647d2d94c8131c5e3eeef490fb3472fe0a4 100644
|
||||
index a45ece7009dd9a2f4682f4c0a4759e2718404b0b..ad1aae2c06cae2f0c9756175a61dd32d8e7701ea 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -349,6 +349,8 @@ public abstract class PlayerList {
|
||||
@@ -83,7 +96,7 @@ index 6957cbfbea51d6a3b57e1c5bfcebd52a25cde8d5..11d73647d2d94c8131c5e3eeef490fb3
|
||||
final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();
|
||||
|
||||
if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
|
||||
@@ -595,6 +597,7 @@ public abstract class PlayerList {
|
||||
@@ -588,6 +590,7 @@ public abstract class PlayerList {
|
||||
return this.remove(entityplayer, net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(entityplayer.getDisplayName())));
|
||||
}
|
||||
public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer, net.kyori.adventure.text.Component leaveMessage) {
|
||||
@@ -92,10 +105,10 @@ index 6957cbfbea51d6a3b57e1c5bfcebd52a25cde8d5..11d73647d2d94c8131c5e3eeef490fb3
|
||||
ServerLevel worldserver = entityplayer.serverLevel();
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 0c8c163d21e6f729c309aa91e69b00b2a41024f2..d58f59b7079cb2cfe3e58391ea3a3576aa030542 100644
|
||||
index 0de0d0d290625ad4f6cacc1d6374a5d0eb66ca86..cb4922442cb696e587d07022e152c4fd9a21ca6f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -471,6 +471,7 @@ public final class CraftServer implements Server {
|
||||
@@ -474,6 +474,7 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
this.potionBrewer = new io.papermc.paper.potion.PaperPotionBrewer(console); // Paper - custom potion mixes
|
||||
datapackManager = new io.papermc.paper.datapack.PaperDatapackManager(console.getPackRepository()); // Paper
|
||||
@@ -103,7 +116,7 @@ index 0c8c163d21e6f729c309aa91e69b00b2a41024f2..d58f59b7079cb2cfe3e58391ea3a3576
|
||||
}
|
||||
|
||||
public boolean getCommandBlockOverride(String command) {
|
||||
@@ -1090,6 +1091,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1093,6 +1094,7 @@ public final class CraftServer implements Server {
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
|
||||
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||
@@ -113,10 +126,10 @@ index 0c8c163d21e6f729c309aa91e69b00b2a41024f2..d58f59b7079cb2cfe3e58391ea3a3576
|
||||
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/core/LeavesCustomPayload.java b/src/main/java/org/leavesmc/leaves/protocol/core/LeavesCustomPayload.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..243a8d77d67b9634d6442b60e481d18831367a74
|
||||
index 0000000000000000000000000000000000000000..b09a7bfe4cbff89acfaf4aec498a5b4e5f911cf6
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/core/LeavesCustomPayload.java
|
||||
@@ -0,0 +1,26 @@
|
||||
@@ -0,0 +1,29 @@
|
||||
+package org.leavesmc.leaves.protocol.core;
|
||||
+
|
||||
+import net.minecraft.network.FriendlyByteBuf;
|
||||
@@ -124,11 +137,14 @@ index 0000000000000000000000000000000000000000..243a8d77d67b9634d6442b60e481d188
|
||||
+import net.minecraft.resources.ResourceLocation;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+import java.lang.annotation.ElementType;
|
||||
+import java.lang.annotation.Retention;
|
||||
+import java.lang.annotation.RetentionPolicy;
|
||||
+import java.lang.annotation.Target;
|
||||
+
|
||||
+public interface LeavesCustomPayload<T extends LeavesCustomPayload<T>> extends CustomPacketPayload {
|
||||
+
|
||||
+ @Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
|
||||
+ @Retention(RetentionPolicy.RUNTIME)
|
||||
+ @interface New {
|
||||
+ }
|
||||
@@ -163,13 +179,14 @@ index 0000000000000000000000000000000000000000..986d2a6641ff8017dddf3e5f2655adfc
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/core/LeavesProtocolManager.java b/src/main/java/org/leavesmc/leaves/protocol/core/LeavesProtocolManager.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..3a33982b92bfb12ce1284fb9429672a698a7ce4b
|
||||
index 0000000000000000000000000000000000000000..53b42f150d4bcca3bed444216d848fdf714102bf
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/core/LeavesProtocolManager.java
|
||||
@@ -0,0 +1,365 @@
|
||||
@@ -0,0 +1,384 @@
|
||||
+package org.leavesmc.leaves.protocol.core;
|
||||
+
|
||||
+import net.minecraft.network.FriendlyByteBuf;
|
||||
+import net.minecraft.network.chat.Component;
|
||||
+import net.minecraft.resources.ResourceLocation;
|
||||
+import net.minecraft.server.level.ServerPlayer;
|
||||
+import org.apache.commons.lang.ArrayUtils;
|
||||
@@ -180,6 +197,7 @@ index 0000000000000000000000000000000000000000..3a33982b92bfb12ce1284fb9429672a6
|
||||
+import java.io.File;
|
||||
+import java.io.IOException;
|
||||
+import java.lang.reflect.Constructor;
|
||||
+import java.lang.reflect.Executable;
|
||||
+import java.lang.reflect.InvocationTargetException;
|
||||
+import java.lang.reflect.Method;
|
||||
+import java.lang.reflect.Modifier;
|
||||
@@ -202,9 +220,11 @@ index 0000000000000000000000000000000000000000..3a33982b92bfb12ce1284fb9429672a6
|
||||
+
|
||||
+public class LeavesProtocolManager {
|
||||
+
|
||||
+ private static final Class<?>[] PAYLOAD_PARAMETER_TYPES = {ResourceLocation.class, FriendlyByteBuf.class};
|
||||
+
|
||||
+ private static final LeavesLogger LOGGER = LeavesLogger.LOGGER;
|
||||
+
|
||||
+ private static final Map<LeavesProtocol, Map<ProtocolHandler.PayloadReceiver, Constructor<? extends LeavesCustomPayload<?>>>> KNOWN_TYPES = new HashMap<>();
|
||||
+ private static final Map<LeavesProtocol, Map<ProtocolHandler.PayloadReceiver, Executable>> KNOWN_TYPES = new HashMap<>();
|
||||
+ private static final Map<LeavesProtocol, Map<ProtocolHandler.PayloadReceiver, Method>> KNOW_RECEIVERS = new HashMap<>();
|
||||
+
|
||||
+ private static final List<Method> TICKERS = new ArrayList<>();
|
||||
@@ -229,7 +249,7 @@ index 0000000000000000000000000000000000000000..3a33982b92bfb12ce1284fb9429672a6
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ Map<ProtocolHandler.PayloadReceiver, Constructor<? extends LeavesCustomPayload<?>>> map = KNOWN_TYPES.getOrDefault(protocol, new HashMap<>());
|
||||
+ Map<ProtocolHandler.PayloadReceiver, Executable> map = KNOWN_TYPES.getOrDefault(protocol, new HashMap<>());
|
||||
+ for (final Method method : methods) {
|
||||
+ if (method.isBridge() || method.isSynthetic() || !Modifier.isStatic(method.getModifiers())) {
|
||||
+ continue;
|
||||
@@ -250,14 +270,25 @@ index 0000000000000000000000000000000000000000..3a33982b92bfb12ce1284fb9429672a6
|
||||
+ final ProtocolHandler.PayloadReceiver receiver = method.getAnnotation(ProtocolHandler.PayloadReceiver.class);
|
||||
+ if (receiver != null) {
|
||||
+ try {
|
||||
+ Constructor<? extends LeavesCustomPayload<?>> constructor = receiver.payload().getConstructor(ResourceLocation.class, FriendlyByteBuf.class);
|
||||
+ constructor.setAccessible(true);
|
||||
+
|
||||
+ if (constructor.getAnnotation(LeavesCustomPayload.New.class) == null) {
|
||||
+ LOGGER.warning("Failed to find new annotation for " + receiver.payload().getName());
|
||||
+ boolean found = false;
|
||||
+ for (Method payloadMethod : receiver.payload().getDeclaredMethods()) {
|
||||
+ if (payloadMethod.isAnnotationPresent(LeavesCustomPayload.New.class)) {
|
||||
+ if (payloadMethod.getParameterTypes() == PAYLOAD_PARAMETER_TYPES && payloadMethod.getReturnType() == receiver.payload() && Modifier.isStatic(payloadMethod.getModifiers())) {
|
||||
+ payloadMethod.setAccessible(true);
|
||||
+ map.put(receiver, payloadMethod);
|
||||
+ found = true;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ map.put(receiver, constructor);
|
||||
+ if (!found) {
|
||||
+ Constructor<? extends LeavesCustomPayload<?>> constructor = receiver.payload().getConstructor(PAYLOAD_PARAMETER_TYPES);
|
||||
+ if (constructor.isAnnotationPresent(LeavesCustomPayload.New.class)) {
|
||||
+ map.put(receiver, constructor);
|
||||
+ constructor.setAccessible(true);
|
||||
+ }
|
||||
+ }
|
||||
+ } catch (NoSuchMethodException exception) {
|
||||
+ LOGGER.severe("Failed to find constructor for " + receiver.payload().getName() + ", " + exception.getCause() + ": " + exception.getMessage());
|
||||
+ continue;
|
||||
@@ -315,11 +346,15 @@ index 0000000000000000000000000000000000000000..3a33982b92bfb12ce1284fb9429672a6
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ Map<ProtocolHandler.PayloadReceiver, Constructor<? extends LeavesCustomPayload<?>>> map = KNOWN_TYPES.get(protocol);
|
||||
+ Map<ProtocolHandler.PayloadReceiver, Executable> map = KNOWN_TYPES.get(protocol);
|
||||
+ for (ProtocolHandler.PayloadReceiver receiver : map.keySet()) {
|
||||
+ if (receiver.ignoreId() || ArrayUtils.contains(receiver.payloadId(), id.getPath())) {
|
||||
+ try {
|
||||
+ return map.get(receiver).newInstance(id, buf);
|
||||
+ if (map.get(receiver) instanceof Constructor<?> constructor) {
|
||||
+ return (LeavesCustomPayload<?>) constructor.newInstance(id, buf);
|
||||
+ } else if (map.get(receiver) instanceof Method method) {
|
||||
+ return (LeavesCustomPayload<?>) method.invoke(null, id, buf);
|
||||
+ }
|
||||
+ } catch (InvocationTargetException | InstantiationException | IllegalAccessException exception) {
|
||||
+ LOGGER.warning("Failed to create payload for " + id + " in " + ArrayUtils.toString(protocol.namespace()) + ", " + exception.getCause() + ": " + exception.getMessage());
|
||||
+ buf.readBytes(buf.readableBytes());
|
||||
@@ -333,7 +368,7 @@ index 0000000000000000000000000000000000000000..3a33982b92bfb12ce1284fb9429672a6
|
||||
+
|
||||
+ public static void handlePayload(ServerPlayer player, LeavesCustomPayload<?> payload) {
|
||||
+ if (payload instanceof ErrorPayload errorPayload) {
|
||||
+ player.connection.disconnect("Payload " + Arrays.toString(errorPayload.packetID) + " from " + Arrays.toString(errorPayload.protocolID) + " error", PlayerKickEvent.Cause.INVALID_PAYLOAD);
|
||||
+ player.connection.disconnect(Component.literal("Payload " + Arrays.toString(errorPayload.packetID) + " from " + Arrays.toString(errorPayload.protocolID) + " error"), PlayerKickEvent.Cause.INVALID_PAYLOAD);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
@@ -427,7 +462,7 @@ index 0000000000000000000000000000000000000000..3a33982b92bfb12ce1284fb9429672a6
|
||||
+ }
|
||||
+
|
||||
+ public static Set<Class<?>> getClasses(String pack) {
|
||||
+ Set<Class<?>> classes = new LinkedHashSet<Class<?>>();
|
||||
+ Set<Class<?>> classes = new LinkedHashSet<>();
|
||||
+ String packageDirName = pack.replace('.', '/');
|
||||
+ Enumeration<URL> dirs;
|
||||
+ try {
|
||||
@@ -509,7 +544,7 @@ index 0000000000000000000000000000000000000000..3a33982b92bfb12ce1284fb9429672a6
|
||||
+
|
||||
+ public record EmptyPayload(ResourceLocation id) implements LeavesCustomPayload<EmptyPayload> {
|
||||
+
|
||||
+ @LeavesCustomPayload.New
|
||||
+ @New
|
||||
+ public EmptyPayload(ResourceLocation location, FriendlyByteBuf buf) {
|
||||
+ this(location);
|
||||
+ }
|
||||
@@ -521,7 +556,7 @@ index 0000000000000000000000000000000000000000..3a33982b92bfb12ce1284fb9429672a6
|
||||
+
|
||||
+ public record LeavesPayload(FriendlyByteBuf data, ResourceLocation id) implements LeavesCustomPayload<LeavesPayload> {
|
||||
+
|
||||
+ @LeavesCustomPayload.New
|
||||
+ @New
|
||||
+ public LeavesPayload(ResourceLocation location, FriendlyByteBuf buf) {
|
||||
+ this(new FriendlyByteBuf(buf.readBytes(buf.readableBytes())), location);
|
||||
+ }
|
||||
@@ -534,7 +569,7 @@ index 0000000000000000000000000000000000000000..3a33982b92bfb12ce1284fb9429672a6
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/core/ProtocolHandler.java b/src/main/java/org/leavesmc/leaves/protocol/core/ProtocolHandler.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..f9dc0a60ca4287e5ec91dd3fc1ae315e2826da34
|
||||
index 0000000000000000000000000000000000000000..f941f095184cf4b7af284d1357ea1a85815e8a66
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/core/ProtocolHandler.java
|
||||
@@ -0,0 +1,61 @@
|
||||
@@ -559,7 +594,7 @@ index 0000000000000000000000000000000000000000..f9dc0a60ca4287e5ec91dd3fc1ae315e
|
||||
+
|
||||
+ Class<? extends LeavesCustomPayload<?>> payload();
|
||||
+
|
||||
+ String[] payloadId();
|
||||
+ String[] payloadId() default "";
|
||||
+
|
||||
+ boolean ignoreId() default false;
|
||||
+ }
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
||||
Date: Sat, 30 Oct 2021 21:07:43 +0800
|
||||
Subject: [PATCH] Fix gravity block duper
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 864e6d223de55f42122485bf6a3c84bbb636479c..caed44af1b4c48ecd49a7248845a418dfd9b8fbb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -442,6 +442,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return this.originWorld;
|
||||
}
|
||||
// Paper end - Entity origin API
|
||||
+ /* Leaves - fix gravity block duper
|
||||
// Paper start - make end portalling safe
|
||||
public BlockPos portalBlock;
|
||||
public ServerLevel portalWorld;
|
||||
@@ -472,6 +473,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
this.teleportTo(worldserver, null);
|
||||
}
|
||||
// Paper end - make end portalling safe
|
||||
+ */
|
||||
// Paper start - optimise entity tracking
|
||||
final org.spigotmc.TrackingRange.TrackingRangeType trackingRangeType = org.spigotmc.TrackingRange.getTrackingRangeType(this);
|
||||
|
||||
@@ -3265,7 +3267,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
this.processPortalCooldown();
|
||||
- if (!io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowUnsafeEndPortalTeleportation) this.tickEndPortal(); // Paper - make end portalling safe
|
||||
+ // Leaves - fix gravity block duper
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
|
||||
index 7272d70c672b54dcf595beafd7a2ed33c96e35cb..d8d355b4ee4869fa9a5d7b4dcd81a3375dd976ba 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
|
||||
@@ -61,15 +61,19 @@ public class EndPortalBlock extends BaseEntityBlock {
|
||||
// return; // CraftBukkit - always fire event in case plugins wish to change it
|
||||
}
|
||||
|
||||
- // Paper start - move all of this logic into portal tick
|
||||
- entity.portalWorld = ((ServerLevel)world);
|
||||
- entity.portalBlock = pos.immutable();
|
||||
- if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowUnsafeEndPortalTeleportation) {
|
||||
- entity.tickEndPortal();
|
||||
+ // Leaves start - fix gravity block duper
|
||||
+ // CraftBukkit start - Entity in portal
|
||||
+ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ()));
|
||||
+ world.getCraftServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (entity instanceof ServerPlayer) {
|
||||
+ ((ServerPlayer) entity).changeDimension(worldserver, PlayerTeleportEvent.TeleportCause.END_PORTAL);
|
||||
+ return;
|
||||
}
|
||||
- // Paper end - move all of this logic into portal tick
|
||||
+ // CraftBukkit end
|
||||
+ entity.changeDimension(worldserver);
|
||||
+ // Leaves end - fix gravity block duper
|
||||
}
|
||||
-
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix trading with the void
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 92805a3311bc1f21df9512b14b209e1d51174ac5..c93d0fbb921309a63c21ba7775fdf44aaa7985c4 100644
|
||||
index d6af1d0cd2829bc1e7e7c7a7a8014750c2bdac2b..9ac697d12ec670e2f67d11d94a09de50c7bd0b9e 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -2751,11 +2751,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -2516,11 +2516,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
// Spigot end
|
||||
// Spigot Start
|
||||
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
|
||||
@@ -5,45 +5,35 @@ Subject: [PATCH] Make snowball and egg can knockback player
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Snowball.java b/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
|
||||
index 2b4d206c0d31ba38d7b2af654bd420e85145d441..9711279772d1617395c6fc34ae0b4bea6a215fae 100644
|
||||
index 2b4d206c0d31ba38d7b2af654bd420e85145d441..f1070a44cd51b8d611f64e7e30691de372d9567f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
|
||||
@@ -3,6 +3,7 @@ package net.minecraft.world.entity.projectile;
|
||||
import net.minecraft.core.particles.ItemParticleOption;
|
||||
import net.minecraft.core.particles.ParticleOptions;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
+import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
@@ -61,6 +62,13 @@ public class Snowball extends ThrowableItemProjectile {
|
||||
@@ -61,6 +61,13 @@ public class Snowball extends ThrowableItemProjectile {
|
||||
int i = entity instanceof Blaze ? 3 : 0;
|
||||
|
||||
entity.hurt(this.damageSources().thrown(this, this.getOwner()), (float) i);
|
||||
+
|
||||
+ // Leaves start - make snowball can knockback player
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.snowballAndEggCanKnockback && entity instanceof ServerPlayer) {
|
||||
+ entity.hurt(this.damageSources().thrown(this, this.getOwner()), 0.0000001F);
|
||||
+ ((ServerPlayer) entity).knockback(0.4000000059604645D, this.getX() - entity.getX(), this.getZ() - entity.getZ(), this, io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.DAMAGE);
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.snowballAndEggCanKnockback && entity instanceof net.minecraft.server.level.ServerPlayer player) {
|
||||
+ player.hurt(this.damageSources().thrown(this, this.getOwner()), 0.0000001F);
|
||||
+ player.knockback(0.4000000059604645D, this.getX() - player.getX(), this.getZ() - player.getZ(), this, io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.DAMAGE);
|
||||
+ }
|
||||
+ // Leaves end - make snowball can knockback player
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownEgg.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownEgg.java
|
||||
index 82bb8004635865f5202578d5a6f520048e7269d5..22eae2f5fb8b5b767003e130014e3962d7522fd4 100644
|
||||
index dbd60cc8c39f5d2d4c77e2de4f2567e7fa456cd2..2b8c8d0e813cd673f593dab49ecd4ee2d04dc6fa 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownEgg.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownEgg.java
|
||||
@@ -46,7 +46,14 @@ public class ThrownEgg extends ThrowableItemProjectile {
|
||||
@Override
|
||||
@@ -50,6 +50,12 @@ public class ThrownEgg extends ThrowableItemProjectile {
|
||||
protected void onHitEntity(EntityHitResult entityHitResult) {
|
||||
super.onHitEntity(entityHitResult);
|
||||
+ Entity entity = entityHitResult.getEntity(); // Leaves - make egg can knockback player
|
||||
entityHitResult.getEntity().hurt(this.damageSources().thrown(this, this.getOwner()), 0.0F);
|
||||
+ // Leaves start - make egg can knockback player
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.snowballAndEggCanKnockback && entity instanceof ServerPlayer) {
|
||||
+ entity.hurt(this.damageSources().thrown(this, this.getOwner()), 0.0000001F);
|
||||
+ ((ServerPlayer) entity).knockback(0.4000000059604645D, this.getX() - entity.getX(), this.getZ() - entity.getZ(), this, io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.DAMAGE);
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.snowballAndEggCanKnockback && entityHitResult.getEntity() instanceof ServerPlayer player) {
|
||||
+ player.hurt(this.damageSources().thrown(this, this.getOwner()), 0.0000001F);
|
||||
+ player.knockback(0.4000000059604645D, this.getX() - player.getX(), this.getZ() - player.getZ(), this, io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.DAMAGE);
|
||||
+ }
|
||||
+ // Leaves end - make egg can knockback player
|
||||
}
|
||||
@@ -33,30 +33,11 @@ index 35772110e9318df46a2729dbc0b5879b290011b7..f26989a44cdda9baabf337d573436c6c
|
||||
PlayerAdvancements playerAdvancements = player.getAdvancements();
|
||||
Set<CriterionTrigger.Listener<T>> set = (Set) playerAdvancements.criterionData.get(this); // Paper - fix AdvancementDataPlayer leak
|
||||
if (set != null && !set.isEmpty()) {
|
||||
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
||||
index f40420a6841f03983b0837e177ea2ae7c3a37ca1..27dbea917d1a03aaa0d8de3db49d3cd25e76448f 100644
|
||||
--- a/src/main/java/net/minecraft/network/Connection.java
|
||||
+++ b/src/main/java/net/minecraft/network/Connection.java
|
||||
@@ -392,6 +392,14 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Leaves start - fakeplayer
|
||||
+ public void setListenerForce(PacketListener packetListener) {
|
||||
+ Validate.notNull(packetListener, "packetListener");
|
||||
+ this.packetListener = packetListener;
|
||||
+ this.disconnectListener = null;
|
||||
+ }
|
||||
+ // Leaves end - fakeplayer
|
||||
+
|
||||
public void setListenerForServerboundHandshake(PacketListener packetListener) {
|
||||
if (this.packetListener != null) {
|
||||
throw new IllegalStateException("Listener already set");
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index f8ddccd4d9b79c9fb26bca580bf023194bc0eae8..c671f0ffae3c54290f8cff233306a1cd91aa9ffe 100644
|
||||
index 9d7f102b6128638cd478e21867ad9f276bad4f32..e91c1db3bcb9f9139d4082e3868d7bcb9a9b084e 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -667,6 +667,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -744,6 +744,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
// Paper end - Configurable player collision
|
||||
|
||||
@@ -65,7 +46,7 @@ index f8ddccd4d9b79c9fb26bca580bf023194bc0eae8..c671f0ffae3c54290f8cff233306a1cd
|
||||
this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.POSTWORLD);
|
||||
if (io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper != null) io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper.pluginsEnabled(); // Paper - Remap plugins
|
||||
io.papermc.paper.command.brigadier.PaperCommands.INSTANCE.setValid(); // Paper - reset invalid state for event fire below
|
||||
@@ -967,6 +969,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1039,6 +1041,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
MinecraftServer.LOGGER.info("Stopping server");
|
||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
||||
@@ -74,7 +55,7 @@ index f8ddccd4d9b79c9fb26bca580bf023194bc0eae8..c671f0ffae3c54290f8cff233306a1cd
|
||||
if (this.server != null) {
|
||||
this.server.disablePlugins();
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
||||
index c7e1f2bac3eca9bb72bf1f8c26cccb2905e1ddfc..8d2b26b2ec48727b12ddb1bede53aecb71f46feb 100644
|
||||
index 9fabf9322acd663c4452b562494e74aa42eb19da..b5f18a0115b629930de84a9d086505adaa6087dd 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
||||
@@ -221,6 +221,11 @@ public class PlayerAdvancements {
|
||||
@@ -90,10 +71,10 @@ index c7e1f2bac3eca9bb72bf1f8c26cccb2905e1ddfc..8d2b26b2ec48727b12ddb1bede53aecb
|
||||
AdvancementProgress advancementprogress = this.getOrStartProgress(advancement);
|
||||
boolean flag1 = advancementprogress.isDone();
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index dc20b051d4f14ce4e0b5a0114e02d15716a7c3d6..d1a42800e069fa89d3f3fb4dcb9948d1ac3ea577 100644
|
||||
index 85b76c5da9eea5bae0dd55f5b7ac1eb1a0211944..c6eeb3324fbf58eb7a6eb61aa7a8dfdc46bda4ae 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1435,6 +1435,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1187,6 +1187,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
} else if (this.seenBy.remove(player.connection)) {
|
||||
this.serverEntity.removePairing(player);
|
||||
@@ -108,19 +89,11 @@ index dc20b051d4f14ce4e0b5a0114e02d15716a7c3d6..d1a42800e069fa89d3f3fb4dcb9948d1
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 6a4637eef14cbd84bbe26ef16f004b8f93367a3d..1b64253c30d1528f7401f15eaa336bbf183dc9d2 100644
|
||||
index 89ed20e9c629cf39a24c7a0ce5c4fee41fc64fd5..5afef331ec117adae0c29f5c4b9f43b7be7cdd4c 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -194,6 +194,7 @@ import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
import org.bukkit.event.player.PlayerToggleSneakEvent;
|
||||
import org.bukkit.inventory.MainHand;
|
||||
+import org.leavesmc.leaves.bot.ServerBot;
|
||||
// CraftBukkit end
|
||||
|
||||
public class ServerPlayer extends Player {
|
||||
@@ -208,7 +209,7 @@ public class ServerPlayer extends Player {
|
||||
private static final AttributeModifier CREATIVE_ENTITY_INTERACTION_RANGE_MODIFIER = new AttributeModifier(UUID.fromString("98491ef6-97b1-4584-ae82-71a8cc85cf73"), "Creative entity interaction range modifier", 2.0D, AttributeModifier.Operation.ADD_VALUE);
|
||||
@@ -210,7 +210,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
private static final AttributeModifier CREATIVE_ENTITY_INTERACTION_RANGE_MODIFIER = new AttributeModifier(ResourceLocation.withDefaultNamespace("creative_mode_entity_range"), 2.0D, AttributeModifier.Operation.ADD_VALUE);
|
||||
public ServerGamePacketListenerImpl connection;
|
||||
public final MinecraftServer server;
|
||||
- public final ServerPlayerGameMode gameMode;
|
||||
@@ -128,7 +101,7 @@ index 6a4637eef14cbd84bbe26ef16f004b8f93367a3d..1b64253c30d1528f7401f15eaa336bbf
|
||||
private final PlayerAdvancements advancements;
|
||||
private final ServerStatsCounter stats;
|
||||
private float lastRecordedHealthAndAbsorption = Float.MIN_VALUE;
|
||||
@@ -780,16 +781,20 @@ public class ServerPlayer extends Player {
|
||||
@@ -771,16 +771,20 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
--this.invulnerableTime;
|
||||
}
|
||||
|
||||
@@ -142,7 +115,7 @@ index 6a4637eef14cbd84bbe26ef16f004b8f93367a3d..1b64253c30d1528f7401f15eaa336bbf
|
||||
- this.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.CANT_USE); // Paper - Inventory close reason
|
||||
- this.containerMenu = this.inventoryMenu;
|
||||
+ // Leaves start - skip bot
|
||||
+ if (!(this instanceof ServerBot)) {
|
||||
+ if (!(this instanceof org.leavesmc.leaves.bot.ServerBot)) {
|
||||
+ // Paper start - Configurable container update tick rate
|
||||
+ if (--containerUpdateDelay <= 0) {
|
||||
+ this.containerMenu.broadcastChanges();
|
||||
@@ -158,31 +131,31 @@ index 6a4637eef14cbd84bbe26ef16f004b8f93367a3d..1b64253c30d1528f7401f15eaa336bbf
|
||||
|
||||
Entity entity = this.getCamera();
|
||||
|
||||
@@ -805,7 +810,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -796,7 +800,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
}
|
||||
}
|
||||
|
||||
- CriteriaTriggers.TICK.trigger(this);
|
||||
+ if (!(this instanceof ServerBot)) CriteriaTriggers.TICK.trigger(this); // Leaves - skip bot
|
||||
+ if (!(this instanceof org.leavesmc.leaves.bot.ServerBot)) CriteriaTriggers.TICK.trigger(this); // Leaves - skip bot
|
||||
if (this.levitationStartPos != null) {
|
||||
CriteriaTriggers.LEVITATION.trigger(this, this.levitationStartPos, this.tickCount - this.levitationStartTime);
|
||||
}
|
||||
@@ -1025,7 +1030,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -1016,7 +1020,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
List<DefaultDrop> loot = new java.util.ArrayList<>(this.getInventory().getContainerSize()); // Paper - Restore vanilla drops behavior
|
||||
boolean keepInventory = this.level().getGameRules().getBoolean(GameRules.RULE_KEEPINVENTORY) || this.isSpectator();
|
||||
|
||||
- if (!keepInventory) {
|
||||
+ if (!keepInventory || this instanceof ServerBot) { // Leaves - skip bot
|
||||
+ if (!keepInventory || this instanceof org.leavesmc.leaves.bot.ServerBot) { // Leaves - skip bot
|
||||
for (ItemStack item : this.getInventory().getContents()) {
|
||||
if (!item.isEmpty() && !EnchantmentHelper.hasVanishingCurse(item)) {
|
||||
if (!item.isEmpty() && !EnchantmentHelper.has(item, EnchantmentEffectComponents.PREVENT_EQUIPMENT_DROP)) {
|
||||
loot.add(new DefaultDrop(item, stack -> this.drop(stack, true, false, false))); // Paper - Restore vanilla drops behavior; drop function taken from Inventory#dropAll (don't fire drop event)
|
||||
@@ -1350,6 +1355,13 @@ public class ServerPlayer extends Player {
|
||||
@@ -1416,6 +1420,13 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
this.lastSentHealth = -1.0F;
|
||||
this.lastSentFood = -1;
|
||||
|
||||
+ // Leaves start - bot support
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.fakeplayerSupport) {
|
||||
+ ServerBot.getBots().forEach(bot1 ->
|
||||
+ org.leavesmc.leaves.bot.ServerBot.getBots().forEach(bot1 ->
|
||||
+ bot1.sendFakeDataIfNeed(this, true)); // Leaves - render bot
|
||||
+ }
|
||||
+ // Leaves end - bot support
|
||||
@@ -191,7 +164,7 @@ index 6a4637eef14cbd84bbe26ef16f004b8f93367a3d..1b64253c30d1528f7401f15eaa336bbf
|
||||
PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld());
|
||||
this.level().getCraftServer().getPluginManager().callEvent(changeEvent);
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 11d73647d2d94c8131c5e3eeef490fb3472fe0a4..ef719bf410912b24d57de422d1fa3fb2bcef5105 100644
|
||||
index ad1aae2c06cae2f0c9756175a61dd32d8e7701ea..3d196ce60afd638867a337ecfa3dbe5a29e8c7e0 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -123,6 +123,8 @@ import org.bukkit.event.player.PlayerRespawnEvent.RespawnReason;
|
||||
@@ -225,7 +198,7 @@ index 11d73647d2d94c8131c5e3eeef490fb3472fe0a4..ef719bf410912b24d57de422d1fa3fb2
|
||||
final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();
|
||||
|
||||
if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
|
||||
@@ -999,6 +1016,13 @@ public abstract class PlayerList {
|
||||
@@ -936,6 +953,13 @@ public abstract class PlayerList {
|
||||
}
|
||||
// Paper end - Add PlayerPostRespawnEvent
|
||||
|
||||
@@ -237,9 +210,9 @@ index 11d73647d2d94c8131c5e3eeef490fb3472fe0a4..ef719bf410912b24d57de422d1fa3fb2
|
||||
+ // Leaves end - bot support
|
||||
+
|
||||
// CraftBukkit end
|
||||
|
||||
return entityplayer1;
|
||||
}
|
||||
@@ -1115,11 +1139,16 @@ public abstract class PlayerList {
|
||||
@@ -1068,11 +1092,16 @@ public abstract class PlayerList {
|
||||
}
|
||||
|
||||
public String[] getPlayerNamesArray() {
|
||||
@@ -257,7 +230,7 @@ index 11d73647d2d94c8131c5e3eeef490fb3472fe0a4..ef719bf410912b24d57de422d1fa3fb2
|
||||
|
||||
return astring;
|
||||
}
|
||||
@@ -1598,4 +1627,16 @@ public abstract class PlayerList {
|
||||
@@ -1539,4 +1568,16 @@ public abstract class PlayerList {
|
||||
public boolean isAllowCommandsForAllPlayers() {
|
||||
return this.allowCommandsForAllPlayers;
|
||||
}
|
||||
@@ -275,23 +248,23 @@ index 11d73647d2d94c8131c5e3eeef490fb3472fe0a4..ef719bf410912b24d57de422d1fa3fb2
|
||||
+ // Leaves end - fakeplayer support
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index caed44af1b4c48ecd49a7248845a418dfd9b8fbb..05898ab27ddb80157c842bd0a12ec66ef10936eb 100644
|
||||
index 9729b3a7ce3027ff4eb02fcb908768d24f74a5f8..2dc27d27908a50101e5671809d1331db0cb2a96c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1510,7 +1510,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1393,7 +1393,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return offsetFactor;
|
||||
}
|
||||
|
||||
- private Vec3 collide(Vec3 movement) {
|
||||
+ public Vec3 collide(Vec3 movement) { // Leaves - private -> public
|
||||
// Paper start - optimise collisions
|
||||
final boolean xZero = movement.x == 0.0;
|
||||
final boolean yZero = movement.y == 0.0;
|
||||
AABB axisalignedbb = this.getBoundingBox();
|
||||
List<VoxelShape> list = this.level().getEntityCollisions(this, axisalignedbb.expandTowards(movement));
|
||||
Vec3 vec3d1 = movement.lengthSqr() == 0.0D ? movement : Entity.collideBoundingBox(this, movement, axisalignedbb, this.level(), list);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
index 7dd5e0b935d98d552c916f8412569ff4aa0e9b04..79ed9104efd9695aee9f9f45d342900d88a7ef02 100644
|
||||
index 1223c5d23d0ea6aed068bdf0f5725e2ad49fc82c..0e00f59a8962dd6356d483ef5be3209a3a410008 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
@@ -62,7 +62,7 @@ public class FishingHook extends Projectile {
|
||||
@@ -63,7 +63,7 @@ public class FishingHook extends Projectile {
|
||||
public static final EntityDataAccessor<Integer> DATA_HOOKED_ENTITY = SynchedEntityData.defineId(FishingHook.class, EntityDataSerializers.INT);
|
||||
private static final EntityDataAccessor<Boolean> DATA_BITING = SynchedEntityData.defineId(FishingHook.class, EntityDataSerializers.BOOLEAN);
|
||||
private int life;
|
||||
@@ -353,10 +326,10 @@ index 1b1b475ca27e799e251d6f8a8c9fe1a4fd8bae83..bb9d8cb957f5be517d3ae2959e0406af
|
||||
if (randomsource.nextInt(j) >= world.paperConfig().entities.behavior.playerInsomniaStartTicks) { // Paper - Ability to control player's insomnia and phantoms
|
||||
BlockPos blockposition1 = blockposition.above(20 + randomsource.nextInt(15)).east(-10 + randomsource.nextInt(21)).south(-10 + randomsource.nextInt(21));
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index d58f59b7079cb2cfe3e58391ea3a3576aa030542..a75f5cf9dc6044a3778106adf0c325c1a563e302 100644
|
||||
index cb4922442cb696e587d07022e152c4fd9a21ca6f..d7f373bae76e14ce20515ec22bf48c40a2054f92 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -307,6 +307,7 @@ public final class CraftServer implements Server {
|
||||
@@ -309,6 +309,7 @@ public final class CraftServer implements Server {
|
||||
public static Exception excessiveVelEx; // Paper - Velocity warnings
|
||||
private final io.papermc.paper.logging.SysoutCatcher sysoutCatcher = new io.papermc.paper.logging.SysoutCatcher(); // Paper
|
||||
private final io.papermc.paper.potion.PaperPotionBrewer potionBrewer; // Paper - Custom Potion Mixes
|
||||
@@ -364,7 +337,7 @@ index d58f59b7079cb2cfe3e58391ea3a3576aa030542..a75f5cf9dc6044a3778106adf0c325c1
|
||||
|
||||
// Paper start - Folia region threading API
|
||||
private final io.papermc.paper.threadedregions.scheduler.FallbackRegionScheduler regionizedScheduler = new io.papermc.paper.threadedregions.scheduler.FallbackRegionScheduler();
|
||||
@@ -3291,4 +3292,11 @@ public final class CraftServer implements Server {
|
||||
@@ -3216,4 +3217,11 @@ public final class CraftServer implements Server {
|
||||
return this.potionBrewer;
|
||||
}
|
||||
// Paper end
|
||||
@@ -377,23 +350,14 @@ index d58f59b7079cb2cfe3e58391ea3a3576aa030542..a75f5cf9dc6044a3778106adf0c325c1
|
||||
+ // Leaves end - Bot API
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index a2d336ceb52b63db5c03432ee7bc94dc6a742b82..ff4563be301d237bb2f431e424687891e95b2b4f 100644
|
||||
index 2cde808bfa797256409879505ba205a71f381981..a007beca6c00bce4514889935b1762a37826c75a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -55,6 +55,8 @@ import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.BoundingBox;
|
||||
import org.bukkit.util.NumberConversions;
|
||||
import org.bukkit.util.Vector;
|
||||
+import org.leavesmc.leaves.bot.ServerBot;
|
||||
+import org.leavesmc.leaves.entity.CraftBot;
|
||||
|
||||
import net.md_5.bungee.api.chat.BaseComponent; // Spigot
|
||||
|
||||
@@ -92,6 +94,8 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
@@ -94,6 +94,8 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
return new CraftHumanEntity(server, (net.minecraft.world.entity.player.Player) entity);
|
||||
}
|
||||
|
||||
+ if (entity instanceof ServerBot) { return new CraftBot(server, (ServerBot) entity); }
|
||||
+ if (entity instanceof org.leavesmc.leaves.bot.ServerBot bot) { return new org.leavesmc.leaves.entity.CraftBot(server, bot); }
|
||||
+
|
||||
// Special case complex part, since there is no extra entity type for them
|
||||
if (entity instanceof EnderDragonPart complexPart) {
|
||||
@@ -411,29 +375,12 @@ index bb9383f1a457433f9db3e78d7913616280925200..55b41ca7630db143d70137324a9de871
|
||||
/**
|
||||
* The start ID for the counter.
|
||||
*/
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/LeavesConfig.java b/src/main/java/org/leavesmc/leaves/LeavesConfig.java
|
||||
index 5809475f59efe62e18a0905532810e54d5a395d6..161870271e000effffe87c55c4d1d3e242e19c57 100644
|
||||
--- a/src/main/java/org/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/org/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -204,6 +204,12 @@ public final class LeavesConfig {
|
||||
}
|
||||
}
|
||||
|
||||
+ @GlobalConfig(name = "use-action", category = {"modify", "fakeplayer"})
|
||||
+ public static boolean fakeplayerUseAction = true;
|
||||
+
|
||||
+ @GlobalConfig(name = "modify-config", category = {"modify", "fakeplayer"})
|
||||
+ public static boolean fakeplayerModifyConfig = false;
|
||||
+
|
||||
// Leaves end - modify - fakeplayer
|
||||
|
||||
// Leaves start - modify - minecraft-old
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/bot/BotCommand.java b/src/main/java/org/leavesmc/leaves/bot/BotCommand.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..4b31cd0407d46c3405506470f70568a1c6162262
|
||||
index 0000000000000000000000000000000000000000..b9d4431b8994f79a4569bd267a6f5680b9650bff
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/bot/BotCommand.java
|
||||
@@ -0,0 +1,405 @@
|
||||
@@ -0,0 +1,407 @@
|
||||
+package org.leavesmc.leaves.bot;
|
||||
+
|
||||
+import org.bukkit.Bukkit;
|
||||
@@ -457,6 +404,8 @@ index 0000000000000000000000000000000000000000..4b31cd0407d46c3405506470f70568a1
|
||||
+import org.leavesmc.leaves.entity.Bot;
|
||||
+import org.leavesmc.leaves.event.bot.BotActionEvent;
|
||||
+import org.leavesmc.leaves.event.bot.BotConfigModifyEvent;
|
||||
+import org.leavesmc.leaves.event.bot.BotCreateEvent;
|
||||
+import org.leavesmc.leaves.event.bot.BotRemoveEvent;
|
||||
+
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.HashMap;
|
||||
@@ -575,8 +524,8 @@ index 0000000000000000000000000000000000000000..4b31cd0407d46c3405506470f70568a1
|
||||
+
|
||||
+ if (canCreate(sender, args[1])) {
|
||||
+ if (sender instanceof Player player) {
|
||||
+ new ServerBot.BotCreateState(player.getLocation(), args[1], args.length < 3 ? args[1] : args[2]).createAsync(bot -> bot.createPlayer = player.getUniqueId());
|
||||
+ } else if (sender instanceof ConsoleCommandSender) {
|
||||
+ new ServerBot.BotCreateState(player.getLocation(), args[1], args.length < 3 ? args[1] : args[2], BotCreateEvent.CreateReason.COMMAND, player).create(bot -> bot.createPlayer = player.getUniqueId());
|
||||
+ } else if (sender instanceof ConsoleCommandSender csender) {
|
||||
+ if (args.length < 6) {
|
||||
+ sender.sendMessage(ChatColor.RED + "Use /bot create <name> <skin_name> <bukkit_world_name> <x> <y> <z> to create a fakeplayer");
|
||||
+ return;
|
||||
@@ -589,7 +538,7 @@ index 0000000000000000000000000000000000000000..4b31cd0407d46c3405506470f70568a1
|
||||
+ double z = Double.parseDouble(args[6]);
|
||||
+
|
||||
+ if (world != null) {
|
||||
+ new ServerBot.BotCreateState(new Location(world, x, y, z), args[1], args[2]).createAsync(null);
|
||||
+ new ServerBot.BotCreateState(new Location(world, x, y, z), args[1], args[2], BotCreateEvent.CreateReason.COMMAND, csender).create(null);
|
||||
+ }
|
||||
+ } catch (Exception e) {
|
||||
+ e.printStackTrace();
|
||||
@@ -635,7 +584,7 @@ index 0000000000000000000000000000000000000000..4b31cd0407d46c3405506470f70568a1
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ bot.die(bot.damageSources().fellOutOfWorld());
|
||||
+ bot.onRemove(BotRemoveEvent.RemoveReason.COMMAND, sender);
|
||||
+ }
|
||||
+
|
||||
+ private void onAction(CommandSender sender, String @NotNull [] args) {
|
||||
@@ -1082,7 +1031,7 @@ index 0000000000000000000000000000000000000000..5bd34353b6ea86cd15ff48b8d6570167
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/bot/BotUtil.java b/src/main/java/org/leavesmc/leaves/bot/BotUtil.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..e63bdf65183fb2c55df865b0adc2e207ac50071a
|
||||
index 0000000000000000000000000000000000000000..147293d108bfa5fc5d0ffd66cdc7c0569799d404
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/bot/BotUtil.java
|
||||
@@ -0,0 +1,183 @@
|
||||
@@ -1230,7 +1179,7 @@ index 0000000000000000000000000000000000000000..e63bdf65183fb2c55df865b0adc2e207
|
||||
+ String skin = fakePlayer.get("skin").getAsString();
|
||||
+
|
||||
+ Location location = new Location(Bukkit.getWorld(dimension), pos_x, pos_y, pos_z, yaw, pitch);
|
||||
+ ServerBot.BotCreateState state = new ServerBot.BotCreateState(location, username, skin);
|
||||
+ ServerBot.BotCreateState state = new ServerBot.BotCreateState(location, username, skin, org.leavesmc.leaves.event.bot.BotCreateEvent.CreateReason.INTERNAL, null);
|
||||
+
|
||||
+ ListTag inv = null;
|
||||
+ File file = MinecraftServer.getServer().getWorldPath(LevelResource.ROOT).resolve("fakeplayer/" + getBotUUID(state) + ".dat").toFile();
|
||||
@@ -1246,7 +1195,7 @@ index 0000000000000000000000000000000000000000..e63bdf65183fb2c55df865b0adc2e207
|
||||
+
|
||||
+ final JsonArray finalActions = fakePlayer.get("actions").getAsJsonArray();
|
||||
+ final ListTag finalInv = inv;
|
||||
+ state.createAsync(serverBot -> {
|
||||
+ state.create(serverBot -> {
|
||||
+ if (finalInv != null) {
|
||||
+ serverBot.getInventory().load(finalInv);
|
||||
+ }
|
||||
@@ -1318,10 +1267,10 @@ index 0000000000000000000000000000000000000000..0db337866c71283464d026a4f230016b
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/bot/ServerBot.java b/src/main/java/org/leavesmc/leaves/bot/ServerBot.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..bba57a2d72ab3051aacd4f4defa3e7377511c36b
|
||||
index 0000000000000000000000000000000000000000..0cb04bf5c5da387b295897997ae0692eb8baab6e
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/bot/ServerBot.java
|
||||
@@ -0,0 +1,716 @@
|
||||
@@ -0,0 +1,745 @@
|
||||
+package org.leavesmc.leaves.bot;
|
||||
+
|
||||
+import com.google.common.collect.Lists;
|
||||
@@ -1337,7 +1286,6 @@ index 0000000000000000000000000000000000000000..bba57a2d72ab3051aacd4f4defa3e737
|
||||
+import net.minecraft.network.PacketSendListener;
|
||||
+import net.minecraft.network.protocol.Packet;
|
||||
+import net.minecraft.network.protocol.PacketFlow;
|
||||
+import net.minecraft.network.protocol.game.ClientboundAddEntityPacket;
|
||||
+import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
|
||||
+import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
|
||||
+import net.minecraft.network.protocol.game.ClientboundRemoveEntitiesPacket;
|
||||
@@ -1345,6 +1293,7 @@ index 0000000000000000000000000000000000000000..bba57a2d72ab3051aacd4f4defa3e737
|
||||
+import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
+import net.minecraft.network.syncher.EntityDataSerializers;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import net.minecraft.server.level.ChunkMap;
|
||||
+import net.minecraft.server.level.ClientInformation;
|
||||
+import net.minecraft.server.level.ServerLevel;
|
||||
+import net.minecraft.server.level.ServerPlayer;
|
||||
@@ -1365,6 +1314,7 @@ index 0000000000000000000000000000000000000000..bba57a2d72ab3051aacd4f4defa3e737
|
||||
+import net.minecraft.world.inventory.ChestMenu;
|
||||
+import net.minecraft.world.level.block.state.BlockState;
|
||||
+import net.minecraft.world.level.gameevent.GameEvent;
|
||||
+import net.minecraft.world.level.portal.DimensionTransition;
|
||||
+import net.minecraft.world.level.storage.LevelResource;
|
||||
+import net.minecraft.world.phys.AABB;
|
||||
+import net.minecraft.world.phys.Vec3;
|
||||
@@ -1372,12 +1322,15 @@ index 0000000000000000000000000000000000000000..bba57a2d72ab3051aacd4f4defa3e737
|
||||
+import org.bukkit.ChatColor;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.Material;
|
||||
+import org.bukkit.command.CommandSender;
|
||||
+import org.bukkit.craftbukkit.CraftWorld;
|
||||
+import org.bukkit.craftbukkit.scheduler.CraftScheduler;
|
||||
+import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
+import org.bukkit.util.Vector;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+import org.leavesmc.leaves.LeavesConfig;
|
||||
+import org.leavesmc.leaves.LeavesLogger;
|
||||
+import org.leavesmc.leaves.bot.agent.BotAction;
|
||||
+import org.leavesmc.leaves.bot.agent.actions.StopAction;
|
||||
+import org.leavesmc.leaves.entity.Bot;
|
||||
@@ -1385,9 +1338,9 @@ index 0000000000000000000000000000000000000000..bba57a2d72ab3051aacd4f4defa3e737
|
||||
+import org.leavesmc.leaves.event.bot.BotCreateEvent;
|
||||
+import org.leavesmc.leaves.event.bot.BotInventoryOpenEvent;
|
||||
+import org.leavesmc.leaves.event.bot.BotJoinEvent;
|
||||
+import org.leavesmc.leaves.event.bot.BotRemoveEvent;
|
||||
+import org.leavesmc.leaves.util.MathUtils;
|
||||
+
|
||||
+import javax.annotation.Nullable;
|
||||
+import java.io.BufferedReader;
|
||||
+import java.io.BufferedWriter;
|
||||
+import java.io.File;
|
||||
@@ -1459,7 +1412,7 @@ index 0000000000000000000000000000000000000000..bba57a2d72ab3051aacd4f4defa3e737
|
||||
+
|
||||
+ MinecraftServer server = MinecraftServer.getServer();
|
||||
+
|
||||
+ BotCreateEvent event = new BotCreateEvent(state.name, state.skinName, state.loc, ChatColor.YELLOW + state.name + " joined the game");
|
||||
+ BotCreateEvent event = new BotCreateEvent(state.name, state.skinName, state.loc, state.createReason, state.creator);
|
||||
+ server.server.getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (event.isCancelled()) {
|
||||
@@ -1489,10 +1442,6 @@ index 0000000000000000000000000000000000000000..bba57a2d72ab3051aacd4f4defa3e737
|
||||
+ bot.isRealPlayer = true;
|
||||
+ bot.createState = state;
|
||||
+
|
||||
+ if (event.getJoinMessage() != null) {
|
||||
+ Bukkit.broadcastMessage(event.getJoinMessage());
|
||||
+ }
|
||||
+
|
||||
+ bot.teleportTo(location.getX(), location.getY(), location.getZ());
|
||||
+ bot.setRot(location.getYaw(), location.getPitch());
|
||||
+ bot.getBukkitEntity().setRotation(location.getYaw(), location.getPitch());
|
||||
@@ -1502,9 +1451,13 @@ index 0000000000000000000000000000000000000000..bba57a2d72ab3051aacd4f4defa3e737
|
||||
+ server.getPlayerList().addNewBot(bot);
|
||||
+ bots.add(bot);
|
||||
+
|
||||
+ BotJoinEvent event1 = new BotJoinEvent(bot.getBukkitPlayer());
|
||||
+ BotJoinEvent event1 = new BotJoinEvent(bot.getBukkitPlayer(), ChatColor.YELLOW + state.name + " joined the game");
|
||||
+ server.server.getPluginManager().callEvent(event1);
|
||||
+
|
||||
+ if (event1.getJoinMessage() != null) {
|
||||
+ Bukkit.broadcastMessage(event1.getJoinMessage());
|
||||
+ }
|
||||
+
|
||||
+ return bot;
|
||||
+ }
|
||||
+
|
||||
@@ -1513,7 +1466,7 @@ index 0000000000000000000000000000000000000000..bba57a2d72ab3051aacd4f4defa3e737
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ if (Bukkit.getPlayer(name) != null || ServerBot.getBot(name) != null) {
|
||||
+ if (Bukkit.getPlayerExact(name) != null || ServerBot.getBot(name) != null) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
@@ -1548,13 +1501,20 @@ index 0000000000000000000000000000000000000000..bba57a2d72ab3051aacd4f4defa3e737
|
||||
+ }
|
||||
+
|
||||
+ public void sendFakeData(ServerPlayerConnection playerConnection, boolean login) {
|
||||
+ playerConnection.send(new ClientboundAddEntityPacket(this));
|
||||
+ ChunkMap.TrackedEntity entityTracker = ((ServerLevel) this.level()).getChunkSource().chunkMap.entityMap.get(this.getId());
|
||||
+
|
||||
+ if (entityTracker == null) {
|
||||
+ LeavesLogger.LOGGER.warning("Fakeplayer cant get entity tracker for " + this.getId());
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ playerConnection.send(this.getAddEntityPacket(entityTracker.serverEntity));
|
||||
+ if (login) {
|
||||
+ Bukkit.getScheduler().runTaskLater(CraftScheduler.MINECRAFT, () -> {
|
||||
+ connection.send(new ClientboundRotateHeadPacket(this, (byte) ((getYRot() * 256f) / 360f)));
|
||||
+ playerConnection.send(new ClientboundRotateHeadPacket(this, (byte) ((getYRot() * 256f) / 360f)));
|
||||
+ }, 10);
|
||||
+ } else {
|
||||
+ connection.send(new ClientboundRotateHeadPacket(this, (byte) ((getYRot() * 256f) / 360f)));
|
||||
+ playerConnection.send(new ClientboundRotateHeadPacket(this, (byte) ((getYRot() * 256f) / 360f)));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -1568,18 +1528,25 @@ index 0000000000000000000000000000000000000000..bba57a2d72ab3051aacd4f4defa3e737
|
||||
+ @Override
|
||||
+ public void die(@NotNull DamageSource damageSource) {
|
||||
+ super.die(damageSource);
|
||||
+ this.dieCheck();
|
||||
+ if (removeOnDeath) {
|
||||
+ onRemove(BotRemoveEvent.RemoveReason.DEATH);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private void dieCheck() {
|
||||
+ if (removeOnDeath) {
|
||||
+ bots.remove(this);
|
||||
+ server.getPlayerList().removeBot(this);
|
||||
+ remove(RemovalReason.KILLED);
|
||||
+ this.setDead();
|
||||
+ this.removeTab();
|
||||
+ Bukkit.broadcastMessage(ChatColor.YELLOW + this.getName().getString() + " left the game"); // TODO i18n
|
||||
+ public void onRemove(BotRemoveEvent.RemoveReason reason) {
|
||||
+ onRemove(reason, null);
|
||||
+ }
|
||||
+
|
||||
+ public void onRemove(BotRemoveEvent.RemoveReason reason, @Nullable CommandSender remover) {
|
||||
+ if (!new BotRemoveEvent(this.getBukkitPlayer(), reason, remover).callEvent()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ bots.remove(this);
|
||||
+ server.getPlayerList().removeBot(this);
|
||||
+ remove(RemovalReason.DISCARDED);
|
||||
+ this.setDead();
|
||||
+ this.removeTab();
|
||||
+ Bukkit.broadcastMessage(ChatColor.YELLOW + this.getName().getString() + " left the game"); // TODO i18n
|
||||
+ }
|
||||
+
|
||||
+ private void removeTab() {
|
||||
@@ -1597,7 +1564,7 @@ index 0000000000000000000000000000000000000000..bba57a2d72ab3051aacd4f4defa3e737
|
||||
+
|
||||
+ @Nullable
|
||||
+ @Override
|
||||
+ public Entity changeDimension(@NotNull ServerLevel destination) {
|
||||
+ public Entity changeDimension(@NotNull DimensionTransition teleportTarget) {
|
||||
+ return null; // disable dimension change
|
||||
+ }
|
||||
+
|
||||
@@ -1927,7 +1894,7 @@ index 0000000000000000000000000000000000000000..bba57a2d72ab3051aacd4f4defa3e737
|
||||
+ e.printStackTrace();
|
||||
+ }
|
||||
+ } else {
|
||||
+ removeAllBot();
|
||||
+ removeAllBot(BotRemoveEvent.RemoveReason.INTERNAL);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -1950,11 +1917,11 @@ index 0000000000000000000000000000000000000000..bba57a2d72ab3051aacd4f4defa3e737
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public static boolean removeAllBot() {
|
||||
+ public static boolean removeAllBot(BotRemoveEvent.RemoveReason reason) {
|
||||
+ Iterator<ServerBot> iterator = bots.iterator();
|
||||
+ while (iterator.hasNext()) {
|
||||
+ ServerBot bot = iterator.next();
|
||||
+ bot.die(bot.damageSources().fellOutOfWorld());
|
||||
+ bot.onRemove(reason);
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
@@ -1987,25 +1954,35 @@ index 0000000000000000000000000000000000000000..bba57a2d72ab3051aacd4f4defa3e737
|
||||
+ private String realName;
|
||||
+ private String name;
|
||||
+
|
||||
+ public BotCreateState(Location loc, String realName, String skinName) {
|
||||
+ public BotCreateEvent.CreateReason createReason;
|
||||
+ public CommandSender creator;
|
||||
+
|
||||
+ public BotCreateState(Location loc, String realName, String skinName, BotCreateEvent.CreateReason createReason, CommandSender creator) {
|
||||
+ this.loc = loc;
|
||||
+ this.skinName = skinName;
|
||||
+ this.setRealName(realName);
|
||||
+ this.createReason = createReason;
|
||||
+ this.creator = creator;
|
||||
+ }
|
||||
+
|
||||
+ public BotCreateState(Location loc, String name, String realName, String skinName, String[] skin) {
|
||||
+ public BotCreateState(Location loc, String name, String realName, String skinName, String[] skin, BotCreateEvent.CreateReason createReason, CommandSender creator) {
|
||||
+ this.loc = loc;
|
||||
+ this.skinName = skinName;
|
||||
+ this.skin = skin;
|
||||
+ this.realName = realName;
|
||||
+ this.name = name;
|
||||
+ this.createReason = createReason;
|
||||
+ this.creator = creator;
|
||||
+ }
|
||||
+
|
||||
+ public ServerBot createSync() {
|
||||
+ return createBot(this);
|
||||
+ }
|
||||
+
|
||||
+ public void createAsync(Consumer<ServerBot> consumer) {
|
||||
+ public @Nullable Bot create(Consumer<ServerBot> consumer) {
|
||||
+ if (skin != null) {
|
||||
+ ServerBot bot = createBot(this);
|
||||
+ if (bot != null && consumer != null) {
|
||||
+ consumer.accept(bot);
|
||||
+ }
|
||||
+ return bot != null ? bot.getBukkitEntity() : null;
|
||||
+ }
|
||||
+ Bukkit.getScheduler().runTaskAsynchronously(CraftScheduler.MINECRAFT, () -> {
|
||||
+ if (skinName != null) {
|
||||
+ this.skin = MojangAPI.getSkin(skinName);
|
||||
@@ -2018,6 +1995,7 @@ index 0000000000000000000000000000000000000000..bba57a2d72ab3051aacd4f4defa3e737
|
||||
+ }
|
||||
+ });
|
||||
+ });
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ public void setName(String name) {
|
||||
@@ -3236,33 +3214,6 @@ index 0000000000000000000000000000000000000000..46c8dad4a6205e3e460b82f8ce5617f8
|
||||
+ return false;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/command/CommandArgument.java b/src/main/java/org/leavesmc/leaves/command/CommandArgument.java
|
||||
index 381cd8b33137a5b7dc688306b56805f35c57012a..2f0e6671dd8bfe4f320eab92c5f5bbc10abc3b05 100644
|
||||
--- a/src/main/java/org/leavesmc/leaves/command/CommandArgument.java
|
||||
+++ b/src/main/java/org/leavesmc/leaves/command/CommandArgument.java
|
||||
@@ -32,6 +32,12 @@ public class CommandArgument {
|
||||
return this;
|
||||
}
|
||||
|
||||
+ public CommandArgument setAllTabComplete(List<List<String>> tabComplete) {
|
||||
+ this.tabComplete.clear();
|
||||
+ this.tabComplete.addAll(tabComplete);
|
||||
+ return this;
|
||||
+ }
|
||||
+
|
||||
public CommandArgumentResult parse(int index, String @NotNull [] args) {
|
||||
Object[] result = new Object[argumentTypes.size()];
|
||||
Arrays.fill(result, null);
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/command/CommandArgumentResult.java b/src/main/java/org/leavesmc/leaves/command/CommandArgumentResult.java
|
||||
index e50ca0473ab4d40e2623ab15f8566276cc14f4e7..6549037cf0bb8460fef8bef41d2335be079b9e9b 100644
|
||||
--- a/src/main/java/org/leavesmc/leaves/command/CommandArgumentResult.java
|
||||
+++ b/src/main/java/org/leavesmc/leaves/command/CommandArgumentResult.java
|
||||
@@ -58,5 +58,4 @@ public class CommandArgumentResult {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-
|
||||
}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/entity/CraftBot.java b/src/main/java/org/leavesmc/leaves/entity/CraftBot.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..fe1df01906f15e130cf947bbecb5df4bddf98c7c
|
||||
@@ -3338,26 +3289,28 @@ index 0000000000000000000000000000000000000000..fe1df01906f15e130cf947bbecb5df4b
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/entity/CraftBotManager.java b/src/main/java/org/leavesmc/leaves/entity/CraftBotManager.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..3995912855a612f09567027138f855ec40e26acf
|
||||
index 0000000000000000000000000000000000000000..badd1d78398fc154254cd465c0a59c64b3fa500c
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/entity/CraftBotManager.java
|
||||
@@ -0,0 +1,93 @@
|
||||
@@ -0,0 +1,102 @@
|
||||
+package org.leavesmc.leaves.entity;
|
||||
+
|
||||
+import com.google.common.base.Function;
|
||||
+import com.google.common.collect.Lists;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.util.Consumer;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+import org.leavesmc.leaves.bot.ServerBot;
|
||||
+import org.leavesmc.leaves.bot.agent.Actions;
|
||||
+import org.leavesmc.leaves.bot.agent.actions.CraftCustomBotAction;
|
||||
+import org.leavesmc.leaves.entity.botaction.CustomBotAction;
|
||||
+import org.leavesmc.leaves.event.bot.BotCreateEvent;
|
||||
+import org.leavesmc.leaves.event.bot.BotRemoveEvent;
|
||||
+
|
||||
+import java.util.Collection;
|
||||
+import java.util.Collections;
|
||||
+import java.util.UUID;
|
||||
+import java.util.function.Consumer;
|
||||
+
|
||||
+public class CraftBotManager implements BotManager {
|
||||
+
|
||||
@@ -3380,17 +3333,24 @@ index 0000000000000000000000000000000000000000..3995912855a612f09567027138f855ec
|
||||
+
|
||||
+ @Override
|
||||
+ public @Nullable Bot createBot(@NotNull String name, @NotNull String realName, @Nullable String[] skin, @Nullable String skinName, @NotNull Location location) {
|
||||
+ ServerBot bot = new ServerBot.BotCreateState(location, name, realName, skinName, skin).createSync();
|
||||
+ if (bot != null) {
|
||||
+ return bot.getBukkitPlayer();
|
||||
+ }
|
||||
+ return null;
|
||||
+ return this.createBot(name, realName, skin, skinName, location, null);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void createBot(@NotNull String name, @Nullable String skinName, @NotNull Location location, Consumer<Bot> consumer) {
|
||||
+ new ServerBot.BotCreateState(location, name, skinName).createAsync((serverBot -> {
|
||||
+ consumer.accept(serverBot.getBukkitPlayer());
|
||||
+ public @Nullable Bot createBot(@NotNull String name, @NotNull String realName, @NotNull String[] skin, @Nullable String skinName, @NotNull Location location, @Nullable Consumer<Bot> consumer) {
|
||||
+ return new ServerBot.BotCreateState(location, name, realName, skinName, skin, BotCreateEvent.CreateReason.PLUGIN, null).create((serverBot -> {
|
||||
+ if (consumer != null) {
|
||||
+ consumer.accept(serverBot.getBukkitPlayer());
|
||||
+ }
|
||||
+ }));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void createBot(@NotNull String name, @Nullable String skinName, @NotNull Location location, @Nullable Consumer<Bot> consumer) {
|
||||
+ new ServerBot.BotCreateState(location, name, skinName, BotCreateEvent.CreateReason.PLUGIN, null).create((serverBot -> {
|
||||
+ if (consumer != null) {
|
||||
+ consumer.accept(serverBot.getBukkitPlayer());
|
||||
+ }
|
||||
+ }));
|
||||
+ }
|
||||
+
|
||||
@@ -3398,7 +3358,7 @@ index 0000000000000000000000000000000000000000..3995912855a612f09567027138f855ec
|
||||
+ public void removeBot(@NotNull String name) {
|
||||
+ ServerBot bot = ServerBot.getBot(name);
|
||||
+ if (bot != null) {
|
||||
+ bot.die(bot.damageSources().fellOutOfWorld());
|
||||
+ bot.onRemove(org.leavesmc.leaves.event.bot.BotRemoveEvent.RemoveReason.PLUGIN);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -3406,13 +3366,13 @@ index 0000000000000000000000000000000000000000..3995912855a612f09567027138f855ec
|
||||
+ public void removeBot(@NotNull UUID uuid) {
|
||||
+ ServerBot bot = ServerBot.getBot(uuid);
|
||||
+ if (bot != null) {
|
||||
+ bot.die(bot.damageSources().fellOutOfWorld());
|
||||
+ bot.onRemove(BotRemoveEvent.RemoveReason.PLUGIN);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void removeAllBots() {
|
||||
+ ServerBot.removeAllBot();
|
||||
+ ServerBot.removeAllBot(BotRemoveEvent.RemoveReason.PLUGIN);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
@@ -3435,87 +3395,3 @@ index 0000000000000000000000000000000000000000..3995912855a612f09567027138f855ec
|
||||
+ return Actions.unregister(name);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/util/MathUtils.java b/src/main/java/org/leavesmc/leaves/util/MathUtils.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..6c42b029d98ed293645f06dde6838761f87f20bb
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/util/MathUtils.java
|
||||
@@ -0,0 +1,78 @@
|
||||
+package org.leavesmc.leaves.util;
|
||||
+
|
||||
+import org.bukkit.util.NumberConversions;
|
||||
+import org.bukkit.util.Vector;
|
||||
+
|
||||
+import java.util.regex.Pattern;
|
||||
+
|
||||
+public class MathUtils {
|
||||
+ // Lag ?
|
||||
+ public static void clean(Vector vector) {
|
||||
+ if (!NumberConversions.isFinite(vector.getX())) vector.setX(0);
|
||||
+ if (!NumberConversions.isFinite(vector.getY())) vector.setY(0);
|
||||
+ if (!NumberConversions.isFinite(vector.getZ())) vector.setZ(0);
|
||||
+ }
|
||||
+
|
||||
+ private static final Pattern numericPattern = Pattern.compile("^-?[1-9]\\d*$|^0$");
|
||||
+ public static boolean isNumeric(String str){
|
||||
+ return numericPattern.matcher(str).matches();
|
||||
+ }
|
||||
+
|
||||
+ public static float[] fetchYawPitch(Vector dir) {
|
||||
+ double x = dir.getX();
|
||||
+ double z = dir.getZ();
|
||||
+
|
||||
+ float[] out = new float[2];
|
||||
+
|
||||
+ if (x == 0.0D && z == 0.0D) {
|
||||
+ out[1] = (float) (dir.getY() > 0.0D ? -90 : 90);
|
||||
+ }
|
||||
+
|
||||
+ else {
|
||||
+ double theta = Math.atan2(-x, z);
|
||||
+ out[0] = (float) Math.toDegrees((theta + 6.283185307179586D) % 6.283185307179586D);
|
||||
+
|
||||
+ double x2 = NumberConversions.square(x);
|
||||
+ double z2 = NumberConversions.square(z);
|
||||
+ double xz = Math.sqrt(x2 + z2);
|
||||
+ out[1] = (float) Math.toDegrees(Math.atan(-dir.getY() / xz));
|
||||
+ }
|
||||
+
|
||||
+ return out;
|
||||
+ }
|
||||
+
|
||||
+ public static float fetchPitch(Vector dir) {
|
||||
+ double x = dir.getX();
|
||||
+ double z = dir.getZ();
|
||||
+
|
||||
+ float result;
|
||||
+
|
||||
+ if (x == 0.0D && z == 0.0D) {
|
||||
+ result = (float) (dir.getY() > 0.0D ? -90 : 90);
|
||||
+ }
|
||||
+
|
||||
+ else {
|
||||
+ double x2 = NumberConversions.square(x);
|
||||
+ double z2 = NumberConversions.square(z);
|
||||
+ double xz = Math.sqrt(x2 + z2);
|
||||
+ result = (float) Math.toDegrees(Math.atan(-dir.getY() / xz));
|
||||
+ }
|
||||
+
|
||||
+ return result;
|
||||
+ }
|
||||
+
|
||||
+ public static Vector getDirection(double rotX, double rotY) {
|
||||
+ Vector vector = new Vector();
|
||||
+
|
||||
+ rotX = Math.toRadians(rotX);
|
||||
+ rotY = Math.toRadians(rotY);
|
||||
+
|
||||
+ double xz = Math.abs(Math.cos(rotY));
|
||||
+
|
||||
+ vector.setX(-Math.sin(rotX) * xz);
|
||||
+ vector.setZ(Math.cos(rotX) * xz);
|
||||
+ vector.setY(-Math.sin(rotY));
|
||||
+
|
||||
+ return vector;
|
||||
+ }
|
||||
+}
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Make shears in dispenser can unlimited use
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
||||
index a024c697a65bbab27408da1d6a75e531d9719b47..d572549fa76e08e233b810e1b82f79b8174009b9 100644
|
||||
index 44b79a7c2f8b95a484d1999fa2167ce588f7985b..67c1aaf2fce72da77e74748d3a8855f0e2b02efb 100644
|
||||
--- a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
||||
+++ b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
||||
@@ -64,7 +64,7 @@ public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior {
|
||||
@@ -14,6 +14,6 @@ index a024c697a65bbab27408da1d6a75e531d9719b47..d572549fa76e08e233b810e1b82f79b8
|
||||
this.setSuccess(ShearsDispenseItemBehavior.tryShearBeehive(worldserver, blockposition) || ShearsDispenseItemBehavior.tryShearLivingEntity(worldserver, blockposition, bukkitBlock, craftItem)); // CraftBukkit
|
||||
- if (this.isSuccess()) {
|
||||
+ if (this.isSuccess() && !org.leavesmc.leaves.LeavesConfig.shearsInDispenserCanZeroAmount) { // Leaves - Make shears in dispenser can unlimited use
|
||||
stack.hurtAndBreak(1, worldserver.getRandom(), (ServerPlayer) null, () -> {
|
||||
stack.setCount(0);
|
||||
stack.hurtAndBreak(1, worldserver, (ServerPlayer) null, (item) -> {
|
||||
});
|
||||
}
|
||||
@@ -5,40 +5,31 @@ Subject: [PATCH] Redstone Shears Wrench
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ShearsItem.java b/src/main/java/net/minecraft/world/item/ShearsItem.java
|
||||
index cb809796372a4658aa617404f9fddffff9b45cb7..accea918869275c76bef2dd8ce117e2119947fe2 100644
|
||||
index cb809796372a4658aa617404f9fddffff9b45cb7..f2fb88dd19b7d8e6dd3283266a80503502560fbf 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ShearsItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ShearsItem.java
|
||||
@@ -3,6 +3,7 @@ package net.minecraft.world.item;
|
||||
import java.util.List;
|
||||
import net.minecraft.advancements.CriteriaTriggers;
|
||||
import net.minecraft.core.BlockPos;
|
||||
@@ -19,6 +19,20 @@ import net.minecraft.world.level.block.GrowingPlantHeadBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
|
||||
+// Leaves start - shears wrench
|
||||
+import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
@@ -15,9 +16,21 @@ import net.minecraft.world.item.component.Tool;
|
||||
import net.minecraft.world.item.context.UseOnContext;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
+import net.minecraft.world.level.block.Block;
|
||||
+import net.minecraft.Util;
|
||||
+import net.minecraft.world.level.block.ComparatorBlock;
|
||||
+import net.minecraft.world.level.block.DispenserBlock;
|
||||
import net.minecraft.world.level.block.GrowingPlantHeadBlock;
|
||||
+import net.minecraft.world.level.block.HopperBlock;
|
||||
+import net.minecraft.world.level.block.ObserverBlock;
|
||||
+import net.minecraft.world.level.block.RepeaterBlock;
|
||||
+import net.minecraft.world.level.block.piston.PistonBaseBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
+import net.minecraft.world.level.block.state.StateDefinition;
|
||||
+import net.minecraft.world.level.block.state.properties.Property;
|
||||
+// Leaves end - shears wrench
|
||||
+
|
||||
+import javax.annotation.Nullable;
|
||||
|
||||
public class ShearsItem extends Item {
|
||||
public ShearsItem(Item.Properties settings) {
|
||||
@@ -77,6 +90,60 @@ public class ShearsItem extends Item {
|
||||
super(settings);
|
||||
@@ -77,6 +91,60 @@ public class ShearsItem extends Item {
|
||||
return InteractionResult.sidedSuccess(level.isClientSide);
|
||||
}
|
||||
|
||||
@@ -55,17 +46,17 @@ index cb809796372a4658aa617404f9fddffff9b45cb7..accea918869275c76bef2dd8ce117e21
|
||||
+ }
|
||||
+
|
||||
+ if (block instanceof PistonBaseBlock) {
|
||||
+ if (getNameHelper(blockState, blockstatelist.getProperty("extended")).equals("true")) {
|
||||
+ if (getNameHelper(blockState, PistonBaseBlock.EXTENDED).equals("true")) {
|
||||
+ return InteractionResult.FAIL;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (block instanceof RepeaterBlock || block instanceof ComparatorBlock) {
|
||||
+ if (getNameHelper(blockState, blockstatelist.getProperty("powered")).equals("true")) {
|
||||
+ if (getNameHelper(blockState, ComparatorBlock.POWERED).equals("true")) {
|
||||
+ return InteractionResult.FAIL;
|
||||
+ }
|
||||
+ if (block instanceof RepeaterBlock) {
|
||||
+ if (getNameHelper(blockState, blockstatelist.getProperty("locked")).equals("true")) {
|
||||
+ if (getNameHelper(blockState, RepeaterBlock.LOCKED).equals("true")) {
|
||||
+ return InteractionResult.FAIL;
|
||||
+ }
|
||||
+ }
|
||||
@@ -83,10 +74,10 @@ index cb809796372a4658aa617404f9fddffff9b45cb7..accea918869275c76bef2dd8ce117e21
|
||||
+
|
||||
+ // Leaves start - shears wrench
|
||||
+ private static <T extends Comparable<T>> BlockState cycleState(BlockState state, Property<T> property, boolean inverse) {
|
||||
+ return (BlockState) state.setValue(property, ShearsItem.getRelative(property.getPossibleValues(), state.getValue(property), inverse)); // CraftBukkit - decompile error
|
||||
+ return state.setValue(property, ShearsItem.getRelative(property.getPossibleValues(), state.getValue(property), inverse)); // CraftBukkit - decompile error
|
||||
+ }
|
||||
+
|
||||
+ private static <T> T getRelative(Iterable<T> elements, @Nullable T current, boolean inverse) {
|
||||
+ private static <T> T getRelative(Iterable<T> elements, T current, boolean inverse) {
|
||||
+ return inverse ? Util.findPreviousInIterable(elements, current) : Util.findNextInIterable(elements, current);
|
||||
+ }
|
||||
+
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add isShrink to EntityResurrectEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 5b5d8d2430f2b92f56ea3fb0e9a35aa4b9aea48f..f6bff4eb349f51a20516aecb010d19d5f625575e 100644
|
||||
index de0c9798261c00a76c7c37c396379f42a44720be..8766907511d0234a50f2ae23689a7e3005757309 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1642,12 +1642,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1630,12 +1630,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
|
||||
org.bukkit.inventory.EquipmentSlot handSlot = (hand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand) : null;
|
||||
@@ -23,7 +23,7 @@ index 5b5d8d2430f2b92f56ea3fb0e9a35aa4b9aea48f..f6bff4eb349f51a20516aecb010d19d5
|
||||
itemstack1.shrink(1);
|
||||
}
|
||||
if (itemstack != null && this instanceof ServerPlayer) {
|
||||
@@ -4546,3 +4546,4 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -4595,3 +4595,4 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Budding Amethyst can push by piston
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
index 555d255a79c6136d0df3504218a0bc4681a5489f..e27f2317e4e2f13b6ef12be727046497a750fd3a 100644
|
||||
index 0c0b149a6cdfaf1de81bfbb92477fbb5c4a8a4bb..992c778f4a826be8d7a5a5d96bf7968b741f490e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -591,6 +591,12 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -588,6 +588,12 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
}
|
||||
// Spigot end
|
||||
|
||||
@@ -38,10 +38,10 @@ index 8920855b07a31715327b8102c7faafc9f916825d..32d926a1b952b8069c5bf48c88e3c108
|
||||
+ // Leaves end - budding amethyst can push by piston
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
index 2034ca2edd3aff61d94416266e75402babd3e741..d7ae3a3a63a3eb3a95534c303ba87303cb96744d 100644
|
||||
index a768b07dae4bf75b68e3bc1d3de4b68fc7d23842..80635b82b1da66dbbd8363dd6ace0c2d0686ceb1 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
@@ -1088,7 +1088,7 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
@@ -1016,7 +1016,7 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
}
|
||||
|
||||
public PushReaction getPistonPushReaction() {
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Spectator dont get Advancement
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
||||
index 8d2b26b2ec48727b12ddb1bede53aecb71f46feb..60ad7e71a3d4b9dc7bab2f961865eac76c0f68c1 100644
|
||||
index b5f18a0115b629930de84a9d086505adaa6087dd..ece0aa3bf18e864a261d4d4edf0a98a40e7f6bb3 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
||||
@@ -221,6 +221,11 @@ public class PlayerAdvancements {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Stick can change ArmorStand arm status
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
index a02ca704e98ef42f32c3c50b111ee3537f60bf7b..32fd9c3d79bb9e9e75b03750696425089e503dcb 100644
|
||||
index 2f398750bfee5758ad8b1367b6fc14364e4de776..df29a54063ee957c2b88a12ef228c7d8541a2f2c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
@@ -393,6 +393,12 @@ public class ArmorStand extends LivingEntity {
|
||||
@@ -392,6 +392,12 @@ public class ArmorStand extends LivingEntity {
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
} else {
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] No chat sign
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||
index e83f9517b31c5171b8dc75ab63a5bfe654221c84..19d973a0582c487617fafadd3df4857f8a1819a4 100644
|
||||
index 14e412ebf75b0e06ab53a1c8f9dd1be6ad1e2680..8fe9a0bf5a6c27d8a505afc2f51b3dccc905423b 100644
|
||||
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||
@@ -317,7 +317,7 @@ public final class ChatProcessor {
|
||||
@@ -41,7 +41,7 @@ index 479e6e2aa88a22ef7f8fccb06add6806f5b71d9d..e6a6d09a64414ae6932e9bac338ce360
|
||||
buf.writeCollection(this.entries, (buf2, entry) -> entry.write(buf2));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
index aafeb9c61ddba6a8671f0238eda47b227619f1af..84a57cf6454db6b84aabc78017b64cc57c3a2070 100644
|
||||
index 0cd6a50837efce87ca052a0e1e24db2b75761196..8212aaf92f028ea560b357771cdf5810d84aed43 100644
|
||||
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
@@ -129,6 +129,16 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
@@ -107,10 +107,10 @@ index 5705cb920084b775cce4b361683b32c6b6e003ed..cbff868303d751d09b68f431c78bb13b
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 437f714fc1b38f0040b57cef94a76faa88f1c495..f240a9d90ec469a99d3d8b82cfa3fcb5d0e78057 100644
|
||||
index ec9ade19778c71561b4045ade5ab6cd090768547..2068081a072a0298e95fe40d67e020bf2331f093 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -663,7 +663,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -666,7 +666,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
// Paper start - Add setting for proxy online mode status
|
||||
return dedicatedserverproperties.enforceSecureProfile
|
||||
&& io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
|
||||
@@ -120,10 +120,10 @@ index 437f714fc1b38f0040b57cef94a76faa88f1c495..f240a9d90ec469a99d3d8b82cfa3fcb5
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
index 82bf29bb3096797801f768c2b631d8b6cae8f761..c02f073e6fa16a05927154462af694731c24347b 100644
|
||||
index 01c2e26f92d5d1e46b98ebd20727beb779c98095..ced6a08caf546e245bd6a631df3dc9f8085ed871 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
@@ -295,10 +295,24 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
@@ -296,10 +296,24 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
}
|
||||
|
||||
public void send(Packet<?> packet) {
|
||||
@@ -149,10 +149,10 @@ index 82bf29bb3096797801f768c2b631d8b6cae8f761..c02f073e6fa16a05927154462af69473
|
||||
if (packet == null || this.processedDisconnect) { // Spigot
|
||||
return;
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index ef719bf410912b24d57de422d1fa3fb2bcef5105..00809b615f65b2f4985856673430d8ba68525765 100644
|
||||
index 3d196ce60afd638867a337ecfa3dbe5a29e8c7e0..627c6b4bba6863ea89a2be2c3f163533e0d80147 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1488,7 +1488,7 @@ public abstract class PlayerList {
|
||||
@@ -1429,7 +1429,7 @@ public abstract class PlayerList {
|
||||
}
|
||||
|
||||
public boolean verifyChatTrusted(PlayerChatMessage message) { // Paper - private -> public
|
||||
@@ -6,21 +6,13 @@ Subject: [PATCH] Dont send useless entity packets
|
||||
This patch is Powered by Purpur(https://github.com/PurpurMC/Purpur)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index a2279262c93408c11f5d2290b48fd794975e8cfe..6177fd5c7e1719a1618388f55b8510d8984a5bf2 100644
|
||||
index 1d849ce4e2c85f149af25318b8ffb6dcef6c6788..0c6ee6a22768d3cdd9ddad1c6fbf9bdffd8b4257 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -204,6 +204,7 @@ public class ServerEntity {
|
||||
flag4 = true;
|
||||
flag5 = true;
|
||||
}
|
||||
+ // Leaves end - Better checking
|
||||
} else {
|
||||
this.wasOnGround = this.entity.onGround();
|
||||
this.teleportDelay = 0;
|
||||
@@ -211,6 +212,11 @@ public class ServerEntity {
|
||||
flag4 = true;
|
||||
flag5 = true;
|
||||
}
|
||||
@@ -200,6 +200,11 @@ public class ServerEntity {
|
||||
packet1 = new ClientboundTeleportEntityPacket(this.entity);
|
||||
flag4 = true;
|
||||
flag5 = true;
|
||||
+ // Leaves start - dont send useless entity packets
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.dontSendUselessEntityPackets && isUselessPacket(packet1)) {
|
||||
+ packet1 = null;
|
||||
@@ -29,7 +21,7 @@ index a2279262c93408c11f5d2290b48fd794975e8cfe..6177fd5c7e1719a1618388f55b8510d8
|
||||
}
|
||||
|
||||
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
|
||||
@@ -291,6 +297,21 @@ public class ServerEntity {
|
||||
@@ -281,6 +286,21 @@ public class ServerEntity {
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Optimize entity coordinate key
|
||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
index 1d6b3fe2ce240af4ede61588795456b046eee6c9..21847dfde06ded5944699ca30a4ec9c2d3511555 100644
|
||||
index 02d6c98b7a2212b13ffd9859ebfdc0a8357ebe65..8add631c0614879d24455a96d94bc6711456f223 100644
|
||||
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
@@ -215,7 +215,13 @@ public final class MCUtil {
|
||||
@@ -199,7 +199,13 @@ public final class MCUtil {
|
||||
}
|
||||
|
||||
public static long getCoordinateKey(final Entity entity) {
|
||||
@@ -25,10 +25,10 @@ index 1d6b3fe2ce240af4ede61588795456b046eee6c9..21847dfde06ded5944699ca30a4ec9c2
|
||||
|
||||
public static long getCoordinateKey(final ChunkPos pair) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 05898ab27ddb80157c842bd0a12ec66ef10936eb..ea232cb815666032580a0c6d81e7a52ef92dbaaa 100644
|
||||
index 2dc27d27908a50101e5671809d1331db0cb2a96c..9e984f4bad722244d70d8b45755ca3abd0a22d4a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -311,7 +311,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -316,7 +316,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public double yo;
|
||||
public double zo;
|
||||
private Vec3 position;
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Optimize suffocation
|
||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index f6bff4eb349f51a20516aecb010d19d5f625575e..8d3ed01ba207900aeaa38f3b4f7a51a277b5686b 100644
|
||||
index d6aeaf7f182ff881122dbbe478ed0a74982fbd38..9fadb5b98810efbc477e8cb7daa580b61c92e75c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -426,7 +426,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -448,7 +448,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
boolean flag = this instanceof net.minecraft.world.entity.player.Player;
|
||||
|
||||
if (!this.level().isClientSide) {
|
||||
@@ -18,7 +18,7 @@ index f6bff4eb349f51a20516aecb010d19d5f625575e..8d3ed01ba207900aeaa38f3b4f7a51a2
|
||||
this.hurt(this.damageSources().inWall(), 1.0F);
|
||||
} else if (flag && !this.level().getWorldBorder().isWithinBounds(this.getBoundingBox())) {
|
||||
double d0 = this.level().getWorldBorder().getDistanceToBorder(this) + this.level().getWorldBorder().getDamageSafeZone();
|
||||
@@ -1430,6 +1430,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1407,6 +1407,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
return this.getHealth() <= 0.0F;
|
||||
}
|
||||
|
||||
@@ -6,18 +6,10 @@ Subject: [PATCH] Only check for spooky season once an hour
|
||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
index dc27ddf5131e7398a5390a5187261d4c7fb6ccaa..8237f252cf60cb0ed85f6eb61e2bdb5f8e3cefef 100644
|
||||
index dc27ddf5131e7398a5390a5187261d4c7fb6ccaa..601072324b54d062bd4cceb821ae187d904ad49b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
@@ -215,6 +215,7 @@ public class Bat extends AmbientCreature {
|
||||
super.readAdditionalSaveData(nbt);
|
||||
this.entityData.set(Bat.DATA_ID_FLAGS, nbt.getByte("BatFlags"));
|
||||
}
|
||||
+ // Leaves end - only check for spooky season once an hour
|
||||
|
||||
@Override
|
||||
public void addAdditionalSaveData(CompoundTag nbt) {
|
||||
@@ -239,12 +240,28 @@ public class Bat extends AmbientCreature {
|
||||
@@ -239,13 +239,30 @@ public class Bat extends AmbientCreature {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,5 +40,7 @@ index dc27ddf5131e7398a5390a5187261d4c7fb6ccaa..8237f252cf60cb0ed85f6eb61e2bdb5f
|
||||
+ return j == 10 && i >= 20 || j == 11 && i <= 3;
|
||||
+ }
|
||||
}
|
||||
+ // Leaves end - only check for spooky season once an hour
|
||||
|
||||
private void setupAnimationStates() {
|
||||
if (this.isResting()) {
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Early return optimization for target finding
|
||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java b/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
||||
index d2f0c3b26d4beedb49d86e0242d843590d469d02..0f06374f81f8cc727955c661626dac33d7f7b210 100644
|
||||
index aecb0ad814586bfc5e56755ee14379a69388b38c..c618d7c87a0b2e2ee55cbe64cae80178fd8bd651 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
||||
@@ -76,9 +76,17 @@ public class TargetingConditions {
|
||||
@@ -21,10 +21,10 @@ index d2f0c3b26d4beedb49d86e0242d843590d469d02..0f06374f81f8cc727955c661626dac33
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+ // Leaves end - check range before getting visibility
|
||||
double d = this.testInvisible ? targetEntity.getVisibilityPercent(baseEntity) : 1.0;
|
||||
double e = Math.max((this.useFollowRange ? this.getFollowRange(baseEntity) : this.range) * d, 2.0); // Paper - Fix MC-145656
|
||||
- double f = baseEntity.distanceToSqr(targetEntity.getX(), targetEntity.getY(), targetEntity.getZ());
|
||||
+ // Leaves end - check range before getting visibility
|
||||
if (f > e * e) {
|
||||
return false;
|
||||
}
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Move ThreadUnsafeRandom Initialization
|
||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index c93d0fbb921309a63c21ba7775fdf44aaa7985c4..84472442e0e68c22c4ebeaaf980aee1e8a234d81 100644
|
||||
index 9ac697d12ec670e2f67d11d94a09de50c7bd0b9e..cef5f66db297a68d74cbb7ca538b30d3d362be30 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -971,7 +971,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -802,7 +802,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
// Paper start - optimise random block ticking
|
||||
private final BlockPos.MutableBlockPos chunkTickMutablePosition = new BlockPos.MutableBlockPos();
|
||||
@@ -19,20 +19,42 @@ index c93d0fbb921309a63c21ba7775fdf44aaa7985c4..84472442e0e68c22c4ebeaaf980aee1e
|
||||
|
||||
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 6a1adbc426a8c79c3fefc5a17509d9097ac9f3db..f7823ed9b293b040e38c517d6b96789c7ebba276 100644
|
||||
index 41acb79ec31f6f53589d698d1d4547485f0adc71..42206013ca0790f1366319669fe433640a74798c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -204,6 +204,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
|
||||
public abstract ResourceKey<LevelStem> getTypeKey();
|
||||
@@ -203,11 +203,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
}
|
||||
// Paper end
|
||||
|
||||
- public abstract ResourceKey<LevelStem> getTypeKey();
|
||||
+ protected final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(java.util.concurrent.ThreadLocalRandom.current().nextLong()); // Leaves - move thread unsafe random initialization
|
||||
|
||||
+ public abstract ResourceKey<LevelStem> getTypeKey();
|
||||
// Paper start - rewrite chunk system
|
||||
private ca.spottedleaf.moonrise.patches.chunk_system.level.entity.EntityLookup entityLookup;
|
||||
|
||||
+
|
||||
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config; Async-Anti-Xray: Pass executor
|
||||
@Override
|
||||
public final ca.spottedleaf.moonrise.patches.chunk_system.level.entity.EntityLookup moonrise$getEntityLookup() {
|
||||
return this.entityLookup;
|
||||
@@ -255,14 +257,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
public ChunkAccess moonrise$getSpecificChunkIfLoaded(final int chunkX, final int chunkZ, final ChunkStatus leastStatus) {
|
||||
return this.getChunkSource().getChunk(chunkX, chunkZ, leastStatus, false);
|
||||
}
|
||||
-
|
||||
@Override
|
||||
public void moonrise$midTickTasks() {
|
||||
// no-op on ClientLevel
|
||||
}
|
||||
// Paper end - rewrite chunk system
|
||||
|
||||
- protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray
|
||||
+ protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config; Async-Anti-Xray: Pass executor
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
||||
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
|
||||
@@ -292,6 +294,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
// Paper end - optimise collisions
|
||||
this.generator = gen;
|
||||
@@ -347,6 +348,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
this.chunkPacketBlockController = this.paperConfig().anticheat.antiXray.enabled ? new com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray(this, executor) : com.destroystokyo.paper.antixray.ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
|
||||
}
|
||||
|
||||
+ // Leaves start - thread unsafe random get
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Config to disable method profiler
|
||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index c671f0ffae3c54290f8cff233306a1cd91aa9ffe..b22d0b0a2cb7e877875739abd87a3beac977c82a 100644
|
||||
index e91c1db3bcb9f9139d4082e3868d7bcb9a9b084e..8806c9612e81f53241f5f16663aa781b8e03a98f 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2530,6 +2530,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2546,6 +2546,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
public ProfilerFiller getProfiler() {
|
||||
@@ -22,10 +22,10 @@ index c671f0ffae3c54290f8cff233306a1cd91aa9ffe..b22d0b0a2cb7e877875739abd87a3bea
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index f7823ed9b293b040e38c517d6b96789c7ebba276..db64aef6cd6bc961c2b69853cb2f5a86a044d49d 100644
|
||||
index 42206013ca0790f1366319669fe433640a74798c..6ff8be0ee869860d0afe0026f10aad1a108d0b56 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1782,6 +1782,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1520,6 +1520,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
}
|
||||
|
||||
public ProfilerFiller getProfiler() {
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Throttle goal selector during inactive ticking
|
||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index 8b612b772ca87c852d0b108c2afd6785c261c9b9..a773e3f208b54fac46e5fd532d80fb66f56a5e3c 100644
|
||||
index 7b93c6a04cca2ac31d137f06ef83bb08559b10bf..5c20fad61b81189ad45623346fa2b79ea8aa9b2a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -237,11 +237,13 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
|
||||
@@ -232,11 +232,13 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
return this.lookControl;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ index 8b612b772ca87c852d0b108c2afd6785c261c9b9..a773e3f208b54fac46e5fd532d80fb66
|
||||
public void inactiveTick() {
|
||||
super.inactiveTick();
|
||||
- if (this.goalSelector.inactiveTick()) {
|
||||
+ boolean isThrottled = org.leavesmc.leaves.LeavesConfig.throttleInactiveGoalSelectorTick && inactiveTickDisableCounter++ % 20 != 0; // Leaves - throttle inactive goal selector ticking
|
||||
+ boolean isThrottled = org.leavesmc.leaves.LeavesConfig.throttleInactiveGoalSelectorTick && (inactiveTickDisableCounter++ % 20 != 0); // Leaves - throttle inactive goal selector ticking
|
||||
+ if (this.goalSelector.inactiveTick() && !isThrottled) { // Leaves - throttle inactive goal selector ticking
|
||||
this.goalSelector.tick();
|
||||
}
|
||||
@@ -6,12 +6,12 @@ Subject: [PATCH] Reduce entity allocations
|
||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
index 9ef8f014af332da129bfcd3370da983ec035ecc6..1e5f018ea357c3431d5aabbe435ce7d922f5c3bf 100644
|
||||
index 69992ebc999ea3ff9e47e4e049bcc514c01150ca..2118ad41e94e8f5e5fac50286ceb24ab70db88f2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
@@ -22,9 +22,11 @@ public class AttributeMap {
|
||||
private final Map<Holder<Attribute>, AttributeInstance> attributes = new Object2ObjectOpenHashMap<>();
|
||||
private final Set<AttributeInstance> dirtyAttributes = new ObjectOpenHashSet<>();
|
||||
@@ -23,9 +23,11 @@ public class AttributeMap {
|
||||
private final Set<AttributeInstance> attributesToSync = new ObjectOpenHashSet<>();
|
||||
private final Set<AttributeInstance> attributesToUpdate = new ObjectOpenHashSet<>();
|
||||
private final AttributeSupplier supplier;
|
||||
+ private final java.util.function.Function<Holder<Attribute>, AttributeInstance> createInstance; // Leaves - reduce entity allocations
|
||||
|
||||
@@ -21,7 +21,7 @@ index 9ef8f014af332da129bfcd3370da983ec035ecc6..1e5f018ea357c3431d5aabbe435ce7d9
|
||||
}
|
||||
|
||||
private void onAttributeModified(AttributeInstance instance) {
|
||||
@@ -43,7 +45,13 @@ public class AttributeMap {
|
||||
@@ -49,7 +51,13 @@ public class AttributeMap {
|
||||
|
||||
@Nullable
|
||||
public AttributeInstance getInstance(Holder<Attribute> attribute) {
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Remove lambda from ticking guard
|
||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 38fcba055839fc1b5522e8a88bdaa63d6f24780d..63652c3011c48c461c1b5be1889847b2f065e34c 100644
|
||||
index cef5f66db297a68d74cbb7ca538b30d3d362be30..1ff888bdc9c83a7e84393711ff50c96e78a1d55a 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -908,7 +908,24 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -739,7 +739,23 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
|
||||
gameprofilerfiller.push("tick");
|
||||
@@ -18,15 +18,14 @@ index 38fcba055839fc1b5522e8a88bdaa63d6f24780d..63652c3011c48c461c1b5be1889847b2
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.removeTickGuardLambda) {
|
||||
+ try {
|
||||
+ this.tickNonPassenger(entity); // Leaves - changed
|
||||
+ MinecraftServer.getServer().executeMidTickTasks(); // Tuinity - execute chunk tasks mid tick
|
||||
+ } catch (Throwable throwable) {
|
||||
+ if (throwable instanceof ThreadDeath) throw throwable; // Paper
|
||||
+ // Paper start - Prevent tile entity and entity crashes
|
||||
+ // Paper start - Prevent block entity and entity crashes
|
||||
+ final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
|
||||
+ MinecraftServer.LOGGER.error(msg, throwable);
|
||||
+ getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerInternalException(msg, throwable)));
|
||||
+ entity.discard();
|
||||
+ // Paper end
|
||||
+ getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerInternalException(msg, throwable))); // Paper - ServerExceptionEvent
|
||||
+ entity.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DISCARD);
|
||||
+ // Paper end - Prevent block entity and entity crashes
|
||||
+ }
|
||||
+ } else {
|
||||
+ this.guardEntityTick(this::tickNonPassenger, entity);
|
||||
@@ -0,0 +1,134 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
||||
Date: Wed, 17 Aug 2022 11:04:12 +0800
|
||||
Subject: [PATCH] Remove iterators from inventory contains
|
||||
|
||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
index 6e66141dca61f777b354854b5d0bac2570b8bf3b..eb11482f48c9f330b7fa62a278fd6f07d3a642e1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
@@ -643,17 +643,31 @@ public class Inventory implements Container, Nameable {
|
||||
}
|
||||
|
||||
public boolean contains(ItemStack stack) {
|
||||
- Iterator iterator = this.compartments.iterator();
|
||||
+ // Leaves start - don't allocate iterators
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.removeInventoryContainsIterators) {
|
||||
+ for (int i = 0; i < this.compartments.size(); i++) {
|
||||
+ List<ItemStack> list = this.compartments.get(i);
|
||||
+ for (int j = 0; j < list.size(); j++) {
|
||||
+ ItemStack itemstack = list.get(j);
|
||||
+
|
||||
+ if (!itemstack.isEmpty() && ItemStack.isSameItemSameComponents(itemstack, stack)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+ Iterator iterator = this.compartments.iterator();
|
||||
|
||||
- while (iterator.hasNext()) {
|
||||
- List<ItemStack> list = (List) iterator.next();
|
||||
- Iterator iterator1 = list.iterator();
|
||||
+ while (iterator.hasNext()) {
|
||||
+ List<ItemStack> list = (List) iterator.next();
|
||||
+ Iterator iterator1 = list.iterator();
|
||||
|
||||
- while (iterator1.hasNext()) {
|
||||
- ItemStack itemstack1 = (ItemStack) iterator1.next();
|
||||
+ while (iterator1.hasNext()) {
|
||||
+ ItemStack itemstack1 = (ItemStack) iterator1.next();
|
||||
|
||||
- if (!itemstack1.isEmpty() && ItemStack.isSameItemSameComponents(itemstack1, stack)) {
|
||||
- return true;
|
||||
+ if (!itemstack1.isEmpty() && ItemStack.isSameItemSameComponents(itemstack1, stack)) {
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -662,17 +676,30 @@ public class Inventory implements Container, Nameable {
|
||||
}
|
||||
|
||||
public boolean contains(TagKey<Item> tag) {
|
||||
- Iterator iterator = this.compartments.iterator();
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.removeInventoryContainsIterators) {
|
||||
+ for (int i = 0; i < this.compartments.size(); i++) {
|
||||
+ List<ItemStack> list = this.compartments.get(i);
|
||||
+ for (int j = 0; j < list.size(); j++) {
|
||||
+ ItemStack itemstack = list.get(j);
|
||||
|
||||
- while (iterator.hasNext()) {
|
||||
- List<ItemStack> list = (List) iterator.next();
|
||||
- Iterator iterator1 = list.iterator();
|
||||
+ if (!itemstack.isEmpty() && itemstack.is(tag)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+ Iterator iterator = this.compartments.iterator();
|
||||
+
|
||||
+ while (iterator.hasNext()) {
|
||||
+ List<ItemStack> list = (List) iterator.next();
|
||||
+ Iterator iterator1 = list.iterator();
|
||||
|
||||
- while (iterator1.hasNext()) {
|
||||
- ItemStack itemstack = (ItemStack) iterator1.next();
|
||||
+ while (iterator1.hasNext()) {
|
||||
+ ItemStack itemstack = (ItemStack) iterator1.next();
|
||||
|
||||
- if (!itemstack.isEmpty() && itemstack.is(tag)) {
|
||||
- return true;
|
||||
+ if (!itemstack.isEmpty() && itemstack.is(tag)) {
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -681,21 +708,34 @@ public class Inventory implements Container, Nameable {
|
||||
}
|
||||
|
||||
public boolean contains(Predicate<ItemStack> predicate) {
|
||||
- Iterator iterator = this.compartments.iterator();
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.removeInventoryContainsIterators) {
|
||||
+ for (int i = 0; i < this.compartments.size(); i++) {
|
||||
+ List<ItemStack> list = this.compartments.get(i);
|
||||
+ for (int j = 0; j < list.size(); j++) {
|
||||
+ ItemStack itemstack = list.get(j);
|
||||
|
||||
- while (iterator.hasNext()) {
|
||||
- List<ItemStack> list = (List) iterator.next();
|
||||
- Iterator iterator1 = list.iterator();
|
||||
+ if (predicate.test(itemstack)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+ Iterator iterator = this.compartments.iterator();
|
||||
|
||||
- while (iterator1.hasNext()) {
|
||||
- ItemStack itemstack = (ItemStack) iterator1.next();
|
||||
+ while (iterator.hasNext()) {
|
||||
+ List<ItemStack> list = (List) iterator.next();
|
||||
+ Iterator iterator1 = list.iterator();
|
||||
|
||||
- if (predicate.test(itemstack)) {
|
||||
- return true;
|
||||
+ while (iterator1.hasNext()) {
|
||||
+ ItemStack itemstack = (ItemStack) iterator1.next();
|
||||
+
|
||||
+ if (predicate.test(itemstack)) {
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
-
|
||||
+ // Leaves end - don't allocate iterators
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Remove streams and iterators from range check
|
||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index d1a42800e069fa89d3f3fb4dcb9948d1ac3ea577..da65f980f2145ea03341911ce75f7e61b358c9d7 100644
|
||||
index c6eeb3324fbf58eb7a6eb61aa7a8dfdc46bda4ae..0bcd9f3faba32c4dc1d115a9306594b9334657cb 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1451,19 +1451,45 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1203,19 +1203,45 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
return ChunkMap.this.level.getServer().getScaledTrackingDistance(initialDistance);
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Cache climbing check for activation
|
||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 8d3ed01ba207900aeaa38f3b4f7a51a277b5686b..ef3e4667d0d38e19a595f83bf93af7a9f1ab4c13 100644
|
||||
index 8f5982465154ed03bfb724a57a6ac0dfe6ffc512..8af682d4aebbbd02816a5eb0a62d6ccfc8c1e6ff 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -2042,6 +2042,22 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -2041,6 +2041,22 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
return this.lastClimbablePos;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ index 8d3ed01ba207900aeaa38f3b4f7a51a277b5686b..ef3e4667d0d38e19a595f83bf93af7a9
|
||||
if (this.isSpectator()) {
|
||||
return false;
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index e32e4ffa222fe72c3d3152a91057113c99d3b122..43d49801823c1221d27e89e66422e8748cdc383b 100644
|
||||
index 621bda8248e35f5a5730f89a4bcfbe6615ed969c..47c30ebb3ea6fab0a0d51211905217a1d2a0c770 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -295,7 +295,7 @@ public class ActivationRange
|
||||
@@ -1,80 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
||||
Date: Wed, 17 Aug 2022 11:04:12 +0800
|
||||
Subject: [PATCH] Remove iterators from inventory contains
|
||||
|
||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
index ca7fbe4f8c1e1d2fb90095aa35be4dda3029c23e..3c8f35f92ed7e9518d676087f82d1e4da963b779 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
@@ -1,9 +1,11 @@
|
||||
package net.minecraft.world.entity.player;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
+
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.function.Predicate;
|
||||
+
|
||||
import net.minecraft.CrashReport;
|
||||
import net.minecraft.CrashReportCategory;
|
||||
import net.minecraft.ReportedException;
|
||||
@@ -24,6 +26,7 @@ import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
// CraftBukkit start
|
||||
import java.util.ArrayList;
|
||||
+
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
@@ -643,17 +646,31 @@ public class Inventory implements Container, Nameable {
|
||||
}
|
||||
|
||||
public boolean contains(ItemStack stack) {
|
||||
- Iterator iterator = this.compartments.iterator();
|
||||
+ // Leaves start - don't allocate iterators
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.removeInventoryContainsIterators) {
|
||||
+ for (int i = 0; i < this.compartments.size(); i++) {
|
||||
+ List<ItemStack> list = this.compartments.get(i);
|
||||
+ for (int j = 0; j < list.size(); j++) {
|
||||
+ ItemStack itemstack1 = list.get(j);
|
||||
+
|
||||
+ if (!itemstack1.isEmpty() && ItemStack.isSameItemSameComponents(itemstack1, stack)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+ Iterator iterator = this.compartments.iterator();
|
||||
|
||||
- while (iterator.hasNext()) {
|
||||
- List<ItemStack> list = (List) iterator.next();
|
||||
- Iterator iterator1 = list.iterator();
|
||||
+ while (iterator.hasNext()) {
|
||||
+ List<ItemStack> list = (List) iterator.next();
|
||||
+ Iterator iterator1 = list.iterator();
|
||||
|
||||
- while (iterator1.hasNext()) {
|
||||
- ItemStack itemstack1 = (ItemStack) iterator1.next();
|
||||
+ while (iterator1.hasNext()) {
|
||||
+ ItemStack itemstack1 = (ItemStack) iterator1.next();
|
||||
|
||||
- if (!itemstack1.isEmpty() && ItemStack.isSameItemSameComponents(itemstack1, stack)) {
|
||||
- return true;
|
||||
+ if (!itemstack1.isEmpty() && ItemStack.isSameItemSameComponents(itemstack1, stack)) {
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -695,7 +712,7 @@ public class Inventory implements Container, Nameable {
|
||||
}
|
||||
}
|
||||
}
|
||||
-
|
||||
+ // Leaves end - don't allocate iterators
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Reduce entity fluid lookups if no fluids
|
||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index ea232cb815666032580a0c6d81e7a52ef92dbaaa..57edf910b4a1997f680896c050a192d01aef36bf 100644
|
||||
index 9e984f4bad722244d70d8b45755ca3abd0a22d4a..0653267c90fef463fa94f784012214809bc8c930 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -4492,16 +4492,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4292,16 +4292,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> tag, double speed) {
|
||||
@@ -35,7 +35,7 @@ index ea232cb815666032580a0c6d81e7a52ef92dbaaa..57edf910b4a1997f680896c050a192d0
|
||||
double d1 = 0.0D;
|
||||
boolean flag = this.isPushedByFluid();
|
||||
boolean flag1 = false;
|
||||
@@ -4509,38 +4511,123 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4309,38 +4311,123 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
int k1 = 0;
|
||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
|
||||
|
||||
@@ -181,18 +181,18 @@ index ea232cb815666032580a0c6d81e7a52ef92dbaaa..57edf910b4a1997f680896c050a192d0
|
||||
if (vec3d.length() > 0.0D) {
|
||||
if (k1 > 0) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
|
||||
index a2a5aef769ee8bb638a5a9f3da9812fa4a85dda5..73b0bd67b5d3506383df3be065375c9370cff570 100644
|
||||
index 8cd6c1d838e0332125fde3fc36475034aa4effa0..070821ae15ed1c4cd20129a983bbf73d17871799 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
|
||||
@@ -25,6 +25,7 @@ public class LevelChunkSection {
|
||||
public final PalettedContainer<BlockState> states;
|
||||
@@ -26,6 +26,7 @@ public class LevelChunkSection {
|
||||
// CraftBukkit start - read/write
|
||||
private PalettedContainer<Holder<Biome>> biomes;
|
||||
+ public short fluidStateCount; // Leaves
|
||||
public final com.destroystokyo.paper.util.maplist.IBlockDataList tickingList = new com.destroystokyo.paper.util.maplist.IBlockDataList(); // Paper
|
||||
// Paper start - optimise collisions
|
||||
private int specialCollidingBlocks;
|
||||
@@ -102,6 +103,7 @@ public class LevelChunkSection {
|
||||
+ public short fluidStateCount; // Leaves
|
||||
|
||||
public LevelChunkSection(PalettedContainer<BlockState> datapaletteblock, PalettedContainer<Holder<Biome>> palettedcontainerro) {
|
||||
// CraftBukkit end
|
||||
@@ -86,6 +87,7 @@ public class LevelChunkSection {
|
||||
|
||||
if (!fluid.isEmpty()) {
|
||||
--this.tickingFluidCount;
|
||||
@@ -200,19 +200,19 @@ index a2a5aef769ee8bb638a5a9f3da9812fa4a85dda5..73b0bd67b5d3506383df3be065375c93
|
||||
}
|
||||
|
||||
if (!state.isAir()) {
|
||||
@@ -116,6 +118,7 @@ public class LevelChunkSection {
|
||||
@@ -100,6 +102,7 @@ public class LevelChunkSection {
|
||||
|
||||
if (!fluid1.isEmpty()) {
|
||||
++this.tickingFluidCount;
|
||||
+ --this.fluidStateCount; // Leaves
|
||||
}
|
||||
|
||||
this.updateBlockCallback(x, y, z, iblockdata1, state); // Paper - optimise collisions
|
||||
@@ -162,6 +165,7 @@ public class LevelChunkSection {
|
||||
return iblockdata1;
|
||||
@@ -145,6 +148,7 @@ public class LevelChunkSection {
|
||||
if (fluid.isRandomlyTicking()) {
|
||||
this.tickingFluidCount = (short) (this.tickingFluidCount + 1);
|
||||
}
|
||||
+ this.fluidStateCount++; // Leaves
|
||||
+ LevelChunkSection.this.fluidStateCount++; // Leaves
|
||||
}
|
||||
|
||||
// Paper start - optimise collisions
|
||||
});
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Reduce chunk loading & lookups
|
||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
index 260202fab3ac300552c557b44dcf251f083c6a78..215176eb7152c11c4934c8576ac8c9fa9b2d0833 100644
|
||||
index 828c51477cd8f35d591367b30bf4feef6a250292..17a71bb3b65cc1030b70c931b1dc998d06713231 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
@@ -318,11 +318,28 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||
@@ -320,11 +320,28 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||
private boolean teleport(double x, double y, double z) {
|
||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(x, y, z);
|
||||
|
||||
@@ -6,25 +6,17 @@ Subject: [PATCH] InstantBlockUpdater Reintroduced
|
||||
This patch is Powered by Carpet-TIS-Addition(https://github.com/plusls/Carpet-TIS-Addition)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index db64aef6cd6bc961c2b69853cb2f5a86a044d49d..099617d8aefc9b9f1bbcf2810af64b8152822291 100644
|
||||
index 6ff8be0ee869860d0afe0026f10aad1a108d0b56..133c90ee13587c441ecd47038d389353940ad3bf 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -73,6 +73,7 @@ import net.minecraft.world.level.lighting.LevelLightEngine;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.world.level.redstone.CollectingNeighborUpdater;
|
||||
+import net.minecraft.world.level.redstone.InstantNeighborUpdater;
|
||||
import net.minecraft.world.level.redstone.NeighborUpdater;
|
||||
import net.minecraft.world.level.saveddata.maps.MapId;
|
||||
import net.minecraft.world.level.saveddata.maps.MapItemSavedData;
|
||||
@@ -246,7 +247,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -303,7 +303,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
this.thread = Thread.currentThread();
|
||||
this.biomeManager = new BiomeManager(this, i);
|
||||
this.isDebug = flag1;
|
||||
- this.neighborUpdater = new CollectingNeighborUpdater(this, j);
|
||||
+ // Leaves start - instantBlockUpdaterReintroduced
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.instantBlockUpdaterReintroduced) {
|
||||
+ this.neighborUpdater = new InstantNeighborUpdater(this);
|
||||
+ this.neighborUpdater = new net.minecraft.world.level.redstone.InstantNeighborUpdater(this);
|
||||
+ } else {
|
||||
+ this.neighborUpdater = new CollectingNeighborUpdater(this, j);
|
||||
+ }
|
||||
@@ -5,22 +5,22 @@ Subject: [PATCH] BBOR Protocol
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index c1a50cedca731c08f793ba3eba4210bc26824e16..82751434c31fe8825f32921f498fd0156da15454 100644
|
||||
index 627c6b4bba6863ea89a2be2c3f163533e0d80147..4f3ae7cf3294583b738482964b78ebf2bd65cbbf 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1623,6 +1623,7 @@ public abstract class PlayerList {
|
||||
@@ -1563,6 +1563,7 @@ public abstract class PlayerList {
|
||||
entityplayer.getRecipeBook().sendInitialRecipeBook(entityplayer);
|
||||
}
|
||||
|
||||
+ org.leavesmc.leaves.protocol.BBORProtocol.onDataPackReload(); // Leaves - bbor
|
||||
}
|
||||
|
||||
public boolean isAllowCheatsForAllPlayers() {
|
||||
public boolean isAllowCommandsForAllPlayers() {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index ae746ebde8ba2aded37bc1c9b3c4acdfd5f9def0..344ebb91a1cd4c74d398ded5edd8ef68047d19b2 100644
|
||||
index bfed0a72280631e6f20e6b5d493515c9b589db97..fa577dec9721c25f3c4897be939af7c2ba2e1c84 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -931,6 +931,11 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -746,6 +746,11 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
|
||||
public void setLoaded(boolean loadedToWorld) {
|
||||
this.loaded = loadedToWorld;
|
||||
@@ -34,7 +34,7 @@ index ae746ebde8ba2aded37bc1c9b3c4acdfd5f9def0..344ebb91a1cd4c74d398ded5edd8ef68
|
||||
public Level getLevel() {
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/BBORProtocol.java b/src/main/java/org/leavesmc/leaves/protocol/BBORProtocol.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..4e1e099f6f480ae694405f0b1f98f429e2653d31
|
||||
index 0000000000000000000000000000000000000000..16ef00dde5a1c502449378829b1b6b85d6d145fd
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/BBORProtocol.java
|
||||
@@ -0,0 +1,227 @@
|
||||
@@ -112,8 +112,8 @@ index 0000000000000000000000000000000000000000..4e1e099f6f480ae694405f0b1f98f429
|
||||
+ ServerLevel overworld = MinecraftServer.getServer().overworld();
|
||||
+ ProtocolUtils.sendPayloadPacket(player, INITIALIZE_CLIENT, buf -> {
|
||||
+ buf.writeLong(overworld.getSeed());
|
||||
+ buf.writeInt(overworld.levelData.getXSpawn());
|
||||
+ buf.writeInt(overworld.levelData.getZSpawn());
|
||||
+ buf.writeInt(overworld.levelData.getSpawnPos().getX());
|
||||
+ buf.writeInt(overworld.levelData.getSpawnPos().getZ());
|
||||
+ });
|
||||
+ sendStructureList(player);
|
||||
+ }
|
||||
@@ -1,15 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MC_XiaoHei <xiaohei.xor7studio@foxmail.com>
|
||||
Date: Tue, 7 May 2024 23:46:15 +0800
|
||||
Subject: [PATCH] Placeholder of PCA-sync-protocol
|
||||
|
||||
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index 3811c0d849a3eb028ed1a6b7a2d4747f7f570448..1ad93453221244f880855b510e888e759275b640 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -46,3 +46,4 @@ dependency-reduced-pom.xml
|
||||
# vs code
|
||||
/.vscode
|
||||
/.factorypath
|
||||
+
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] PCA sync protocol
|
||||
This patch is Powered by plusls-carpet-addition(https://github.com/plusls/plusls-carpet-addition)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
||||
index 815eb15086976b8f9e03bf8182d9ed50aec14720..50b690261be56ce1806c611c006d52c5ca02f9c5 100644
|
||||
index 1f5ed236fb7c0c1b0181675747d25d233f534284..08559ff5409d362bc674f63d6e46ced6c0474601 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
||||
@@ -373,6 +373,11 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
|
||||
@@ -436,6 +436,11 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
|
||||
|
||||
@Override
|
||||
public void containerChanged(Container sender) {
|
||||
@@ -20,15 +20,15 @@ index 815eb15086976b8f9e03bf8182d9ed50aec14720..50b690261be56ce1806c611c006d52c5
|
||||
+ // Leaves end - pca
|
||||
boolean flag = this.isSaddled();
|
||||
|
||||
this.updateContainerEquipment();
|
||||
this.syncSaddleToClients();
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
||||
index 4e6c2f6b2e54a4c126e9a026b9cad05ce835ad66..fd1648546542f146ba7b866873f105ed1427ef7d 100644
|
||||
index 49b35fab8ee98a384ee12d36bbe2ac813342f1d6..915b44434eebdd200bef38b4e5e8fcdf5cdcf5ad 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
||||
@@ -64,6 +64,15 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
|
||||
@@ -71,6 +71,15 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
|
||||
super(type, world);
|
||||
this.setPathfindingMalus(BlockPathTypes.DANGER_FIRE, 16.0F);
|
||||
this.setPathfindingMalus(BlockPathTypes.DAMAGE_FIRE, -1.0F);
|
||||
this.setPathfindingMalus(PathType.DANGER_FIRE, 16.0F);
|
||||
this.setPathfindingMalus(PathType.DAMAGE_FIRE, -1.0F);
|
||||
+ // Leaves start - pca
|
||||
+ if (!this.level().isClientSide()) {
|
||||
+ this.inventory.addListener(inventory -> {
|
||||
@@ -42,10 +42,10 @@ index 4e6c2f6b2e54a4c126e9a026b9cad05ce835ad66..fd1648546542f146ba7b866873f105ed
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
||||
index 756d0434472921992c9d84597d7c9c824e93614c..efb69fdb0095c3d730f2a4608f15bf47a5a377a9 100644
|
||||
index 9549eee0d92f322bd5232abd7e695213660c2e22..6044de3b76e236e22d4d00f80dae0380ba82d354 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
||||
@@ -130,7 +130,13 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
|
||||
@@ -126,7 +126,13 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -61,10 +61,10 @@ index 756d0434472921992c9d84597d7c9c824e93614c..efb69fdb0095c3d730f2a4608f15bf47
|
||||
@Override
|
||||
public boolean stillValid(Player player) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
index 89d06253b00604114e543ebbe12a9993ae95dc41..cb0cb894df65e6d4d65b369955a7d7d78fa7bc2b 100644
|
||||
index 730aca233f6e7564d4cb85b5b628d23c4f01d2f4..9ad4600ebee09d81b1785103ad17de47cf1f2ede 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
@@ -575,6 +575,16 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
@@ -558,6 +558,16 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
|
||||
}
|
||||
|
||||
@@ -79,14 +79,14 @@ index 89d06253b00604114e543ebbe12a9993ae95dc41..cb0cb894df65e6d4d65b369955a7d7d7
|
||||
+ // Leaves end - pca
|
||||
+
|
||||
@Override
|
||||
public boolean stillValid(net.minecraft.world.entity.player.Player player) {
|
||||
return Container.stillValidBlockEntity(this, player);
|
||||
public boolean canPlaceItem(int slot, ItemStack stack) {
|
||||
if (slot == 2) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
index 416aa989ebb18a8741cc9d605a1180ab830f6643..213bc3c11ff4ed9bc761e8153aa669d1e2301960 100644
|
||||
index 6186e55014bbb9d5bedaa0e9d196879c55339d42..956c39ab508c2d8a7b9156aa53d655624db91f3d 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
@@ -131,6 +131,16 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
||||
this.items = list;
|
||||
@@ -132,6 +132,16 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
||||
this.items = inventory;
|
||||
}
|
||||
|
||||
+ // Leaves start - pca
|
||||
@@ -103,18 +103,10 @@ index 416aa989ebb18a8741cc9d605a1180ab830f6643..213bc3c11ff4ed9bc761e8153aa669d1
|
||||
protected Component getDefaultName() {
|
||||
return Component.translatable("container.barrel");
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
||||
index d445ed0895293dd45c36226051f5809be8587ebe..160df5cedf5d04c8a8d5d5375a898edc123684ac 100644
|
||||
index 7b263fab4f0014400b3b8e7e33db32f9a125f6ba..cb9d6f3f57192675dc18d9fa80b22498b29da368 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
||||
@@ -4,6 +4,7 @@ import com.google.common.collect.Lists;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
+import java.util.Objects;
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
@@ -131,6 +132,11 @@ public class BeehiveBlockEntity extends BlockEntity {
|
||||
@@ -143,6 +143,11 @@ public class BeehiveBlockEntity extends BlockEntity {
|
||||
super.setChanged();
|
||||
}
|
||||
|
||||
@@ -126,8 +118,8 @@ index d445ed0895293dd45c36226051f5809be8587ebe..160df5cedf5d04c8a8d5d5375a898edc
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -192,6 +198,12 @@ public class BeehiveBlockEntity extends BlockEntity {
|
||||
this.level.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.Context.of(entity, this.getBlockState()));
|
||||
@@ -197,6 +202,12 @@ public class BeehiveBlockEntity extends BlockEntity {
|
||||
this.level.gameEvent((Holder) GameEvent.BLOCK_CHANGE, blockposition, GameEvent.Context.of(entity, this.getBlockState()));
|
||||
}
|
||||
|
||||
+ // Leaves start - pca
|
||||
@@ -139,8 +131,8 @@ index d445ed0895293dd45c36226051f5809be8587ebe..160df5cedf5d04c8a8d5d5375a898edc
|
||||
entity.discard(EntityRemoveEvent.Cause.ENTER_BLOCK); // CraftBukkit - add Bukkit remove cause
|
||||
super.setChanged();
|
||||
}
|
||||
@@ -344,6 +356,11 @@ public class BeehiveBlockEntity extends BlockEntity {
|
||||
if (BeehiveBlockEntity.releaseOccupant(world, pos, state, tileentitybeehive_hivebee, (List) null, tileentitybeehive_releasestatus, flowerPos)) {
|
||||
@@ -312,6 +323,11 @@ public class BeehiveBlockEntity extends BlockEntity {
|
||||
if (BeehiveBlockEntity.releaseOccupant(world, pos, state, tileentitybeehive_hivebee.toOccupant(), (List) null, tileentitybeehive_releasestatus, flowerPos)) {
|
||||
flag = true;
|
||||
iterator.remove();
|
||||
+ // Leaves start - pca
|
||||
@@ -150,8 +142,8 @@ index d445ed0895293dd45c36226051f5809be8587ebe..160df5cedf5d04c8a8d5d5375a898edc
|
||||
+ // Leaves end - pca
|
||||
// CraftBukkit start
|
||||
} else {
|
||||
tileentitybeehive_hivebee.exitTickCounter = tileentitybeehive_hivebee.minOccupationTicks / 2; // Not strictly Vanilla behaviour in cases where bees cannot spawn but still reasonable // Paper - Fix bees aging inside hives; use exitTickCounter to keep actual bee life
|
||||
@@ -395,6 +412,11 @@ public class BeehiveBlockEntity extends BlockEntity {
|
||||
tileentitybeehive_hivebee.exitTickCounter = tileentitybeehive_hivebee.occupant.minTicksInHive / 2; // Not strictly Vanilla behaviour in cases where bees cannot spawn but still reasonable // Paper - Fix bees aging inside hives; use exitTickCounter to keep actual bee life
|
||||
@@ -357,6 +373,11 @@ public class BeehiveBlockEntity extends BlockEntity {
|
||||
this.maxBees = nbt.getInt("Bukkit.MaxEntities");
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -164,11 +156,11 @@ index d445ed0895293dd45c36226051f5809be8587ebe..160df5cedf5d04c8a8d5d5375a898edc
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||
index 9bb542ce3a8c52e1688bb1f66fc916dd23a5fd10..7356c6e03e4823a87a9918ef164b9438e0cec123 100644
|
||||
index a2fafef89d5354e2cb02f5672810909950a57777..54c18c771b96b30167cb5fb4ff1b0c9c63607d47 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||
@@ -334,6 +334,16 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
|
||||
|
||||
return this.canPlaceItem(slot, stack);
|
||||
}
|
||||
|
||||
+ // Leaves start - pca
|
||||
@@ -182,14 +174,14 @@ index 9bb542ce3a8c52e1688bb1f66fc916dd23a5fd10..7356c6e03e4823a87a9918ef164b9438
|
||||
+ // Leaves end - pca
|
||||
+
|
||||
@Override
|
||||
public boolean stillValid(Player player) {
|
||||
return Container.stillValidBlockEntity(this, player);
|
||||
public boolean canTakeItemThroughFace(int slot, ItemStack stack, Direction dir) {
|
||||
return slot == 3 ? stack.is(Items.GLASS_BOTTLE) : true;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
||||
index 9b1243d96e0694c62fc9e82e9be540bce0d2b3ad..13e778bd47792deb571a5294bcf86cec5e04a5cc 100644
|
||||
index b88aa184cd06a0485146f58a5b61a56a50911209..4d4485f1007341a5303374b3facd033c87b887b3 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
||||
@@ -190,6 +190,16 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement
|
||||
this.items = list;
|
||||
@@ -191,6 +191,16 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement
|
||||
this.items = inventory;
|
||||
}
|
||||
|
||||
+ // Leaves start - pca
|
||||
@@ -206,10 +198,10 @@ index 9b1243d96e0694c62fc9e82e9be540bce0d2b3ad..13e778bd47792deb571a5294bcf86cec
|
||||
public float getOpenNess(float tickDelta) {
|
||||
return this.chestLidController.getOpenness(tickDelta);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/ComparatorBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ComparatorBlockEntity.java
|
||||
index 9b2c162c362fcf6093a3bf6da715ae8f18176c82..84b877a712a883b868b139d29da7e09c9552a1e5 100644
|
||||
index 7ea490a61321830c41dfa1bbd5480217dc62f478..d037adbe784d1b9e620d3c0798bc8b86061c5701 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/ComparatorBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/ComparatorBlockEntity.java
|
||||
@@ -23,6 +23,16 @@ public class ComparatorBlockEntity extends BlockEntity {
|
||||
@@ -24,6 +24,16 @@ public class ComparatorBlockEntity extends BlockEntity {
|
||||
this.output = nbt.getInt("OutputSignal");
|
||||
}
|
||||
|
||||
@@ -227,11 +219,11 @@ index 9b2c162c362fcf6093a3bf6da715ae8f18176c82..84b877a712a883b868b139d29da7e09c
|
||||
return this.output;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
||||
index 881379681c39230a00b3a1f11cd87498984396c7..e01eb2025458cf311348c58a1530854053af78f4 100644
|
||||
index 431fb6a658c6aac43b6f9dbd1f578b83f261a4e3..138c045dc694c596083bc2f23831ca22e9484297 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
||||
@@ -92,6 +92,16 @@ public class DispenserBlockEntity extends RandomizableContainerBlockEntity {
|
||||
return -1;
|
||||
@@ -109,6 +109,16 @@ public class DispenserBlockEntity extends RandomizableContainerBlockEntity {
|
||||
return stack;
|
||||
}
|
||||
|
||||
+ // Leaves start - pca
|
||||
@@ -248,11 +240,11 @@ index 881379681c39230a00b3a1f11cd87498984396c7..e01eb2025458cf311348c58a15308540
|
||||
protected Component getDefaultName() {
|
||||
return Component.translatable("container.dispenser");
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
index cdb739df2a285032d25d84f4464f202a7a3fa578..cffc280655851e18439c9dfcb01ff69aab61e025 100644
|
||||
index 8310d132006043e93c612890514c4c7f3eb1c74d..f523f888f2a0ac04f25b30e18cdd765c395cfc18 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
@@ -130,6 +130,16 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
|
||||
@@ -134,6 +134,16 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
this.facing = (Direction) state.getValue(HopperBlock.FACING);
|
||||
}
|
||||
|
||||
+ // Leaves start - pca
|
||||
@@ -268,7 +260,7 @@ index cdb739df2a285032d25d84f4464f202a7a3fa578..cffc280655851e18439c9dfcb01ff69a
|
||||
@Override
|
||||
protected Component getDefaultName() {
|
||||
return Component.translatable("container.hopper");
|
||||
@@ -209,6 +219,11 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
@@ -212,6 +222,11 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
if (flag) {
|
||||
blockEntity.setCooldown(world.spigotConfig.hopperTransfer); // Spigot
|
||||
setChanged(world, pos, state);
|
||||
@@ -281,11 +273,11 @@ index cdb739df2a285032d25d84f4464f202a7a3fa578..cffc280655851e18439c9dfcb01ff69a
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||
index 1fa22445a4ecc8c08dbcf0cc6bd39dc5003604c4..5c311270a39f6b4996c8b58822d24556c67adc41 100644
|
||||
index 0d68db20f5fbe5e834f12c1e8fd429099a44e4b6..5b62860cd64b5e6dc02dadb4651824ac04b00024 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||
@@ -269,6 +269,16 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl
|
||||
this.itemStacks = list;
|
||||
@@ -270,6 +270,16 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl
|
||||
this.itemStacks = inventory;
|
||||
}
|
||||
|
||||
+ // Leaves start - pca
|
||||
@@ -303,16 +295,15 @@ index 1fa22445a4ecc8c08dbcf0cc6bd39dc5003604c4..5c311270a39f6b4996c8b58822d24556
|
||||
return ShulkerBoxBlockEntity.SLOTS;
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/PcaSyncProtocol.java b/src/main/java/org/leavesmc/leaves/protocol/PcaSyncProtocol.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..f4a7aed61511ad9557c8cc4779229b3bf79159dd
|
||||
index 0000000000000000000000000000000000000000..7a86bdc3ddbed0399cdb909cb294d8f8bb5a894f
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/PcaSyncProtocol.java
|
||||
@@ -0,0 +1,389 @@
|
||||
@@ -0,0 +1,391 @@
|
||||
+package org.leavesmc.leaves.protocol;
|
||||
+
|
||||
+import net.minecraft.core.BlockPos;
|
||||
+import net.minecraft.nbt.CompoundTag;
|
||||
+import net.minecraft.network.FriendlyByteBuf;
|
||||
+import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
|
||||
+import net.minecraft.resources.ResourceLocation;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import net.minecraft.server.level.ServerLevel;
|
||||
@@ -333,6 +324,7 @@ index 0000000000000000000000000000000000000000..f4a7aed61511ad9557c8cc4779229b3b
|
||||
+import org.leavesmc.leaves.LeavesConfig;
|
||||
+import org.leavesmc.leaves.LeavesLogger;
|
||||
+import org.leavesmc.leaves.bot.ServerBot;
|
||||
+import org.leavesmc.leaves.protocol.core.LeavesCustomPayload;
|
||||
+import org.leavesmc.leaves.protocol.core.LeavesProtocol;
|
||||
+import org.leavesmc.leaves.protocol.core.ProtocolHandler;
|
||||
+import org.leavesmc.leaves.protocol.core.ProtocolUtils;
|
||||
@@ -522,7 +514,7 @@ index 0000000000000000000000000000000000000000..f4a7aed61511ad9557c8cc4779229b3b
|
||||
+ ProtocolUtils.sendPayloadPacket(player, UPDATE_BLOCK_ENTITY, buf -> {
|
||||
+ buf.writeResourceLocation(world.dimension().location());
|
||||
+ buf.writeBlockPos(blockEntity.getBlockPos());
|
||||
+ buf.writeNbt(blockEntity.saveWithId());
|
||||
+ buf.writeNbt(blockEntity.saveWithId(blockEntity.getLevel().registryAccess()));
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
@@ -658,10 +650,11 @@ index 0000000000000000000000000000000000000000..f4a7aed61511ad9557c8cc4779229b3b
|
||||
+ PcaSyncProtocol.clearPlayerWatchEntity(player);
|
||||
+ }
|
||||
+
|
||||
+ public record SyncBlockEntityPayload(BlockPos pos) implements CustomPacketPayload {
|
||||
+ public record SyncBlockEntityPayload(BlockPos pos) implements LeavesCustomPayload<SyncBlockEntityPayload> {
|
||||
+
|
||||
+ public static final ResourceLocation SYNC_BLOCK_ENTITY = PcaSyncProtocol.id("sync_block_entity");
|
||||
+
|
||||
+ @New
|
||||
+ public SyncBlockEntityPayload(ResourceLocation id, FriendlyByteBuf buf) {
|
||||
+ this(buf.readBlockPos());
|
||||
+ }
|
||||
@@ -677,10 +670,11 @@ index 0000000000000000000000000000000000000000..f4a7aed61511ad9557c8cc4779229b3b
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public record SyncEntityPayload(int entityId) implements CustomPacketPayload {
|
||||
+ public record SyncEntityPayload(int entityId) implements LeavesCustomPayload<SyncEntityPayload> {
|
||||
+
|
||||
+ public static final ResourceLocation SYNC_ENTITY = PcaSyncProtocol.id("sync_entity");
|
||||
+
|
||||
+ @New
|
||||
+ public SyncEntityPayload(ResourceLocation id, FriendlyByteBuf buf) {
|
||||
+ this(buf.readInt());
|
||||
+ }
|
||||
@@ -1,15 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MC_XiaoHei <xiaohei.xor7studio@foxmail.com>
|
||||
Date: Tue, 7 May 2024 23:49:41 +0800
|
||||
Subject: [PATCH] Placeholder of BBOR-Protocol
|
||||
|
||||
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index 1ad93453221244f880855b510e888e759275b640..3811c0d849a3eb028ed1a6b7a2d4747f7f570448 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -46,4 +46,3 @@ dependency-reduced-pom.xml
|
||||
# vs code
|
||||
/.vscode
|
||||
/.factorypath
|
||||
-
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Jade Protocol
|
||||
This patch is Powered by Jade(https://github.com/Snownee/Jade)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
||||
index b38281f963377cc82b360e8457da7cad033b8c36..59f54bf1e86860a9fa35c444edc64ba141f4defb 100644
|
||||
index 792d9039ac0561464c666977ff8308e4c629e5eb..6510d70decdc32d3d9fa694ce9b4b1c7428bd282 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
||||
@@ -58,7 +58,7 @@ public class Armadillo extends Animal {
|
||||
@@ -59,7 +59,7 @@ public class Armadillo extends Animal {
|
||||
public final AnimationState rollOutAnimationState = new AnimationState();
|
||||
public final AnimationState rollUpAnimationState = new AnimationState();
|
||||
public final AnimationState peekAnimationState = new AnimationState();
|
||||
@@ -19,10 +19,10 @@ index b38281f963377cc82b360e8457da7cad033b8c36..59f54bf1e86860a9fa35c444edc64ba1
|
||||
|
||||
public Armadillo(EntityType<? extends Animal> type, Level world) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
index 290d41136f5ec7671bc4990dfe50da0a770c124d..600e03bf2bfbde245d53afa9ed312ebcd7ca8f03 100644
|
||||
index 43046f4a0cff620834ac4647efdcde227185b2ff..a08cd692e332a6caed33cd3db2373e847621ad6a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
@@ -255,7 +255,7 @@ public class Tadpole extends AbstractFish {
|
||||
@@ -256,7 +256,7 @@ public class Tadpole extends AbstractFish {
|
||||
|
||||
}
|
||||
|
||||
@@ -32,10 +32,10 @@ index 290d41136f5ec7671bc4990dfe50da0a770c124d..600e03bf2bfbde245d53afa9ed312ebc
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java
|
||||
index fca0131b9a90ac026a24cf579b17928c19173f3f..f8d0a8ea39cd90a9b45ff97e32e0e7224ddd8808 100644
|
||||
index 055f4b87c01ee7ecf7d2a111b72cc5aa85d9fbe8..5d9030f4787a43c56ae9455180badd5658dea35b 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java
|
||||
@@ -68,7 +68,7 @@ public class TrialSpawnerData {
|
||||
@@ -72,7 +72,7 @@ public class TrialSpawnerData {
|
||||
});
|
||||
public final Set<UUID> detectedPlayers;
|
||||
public final Set<UUID> currentMobs;
|
||||
@@ -46,7 +46,7 @@ index fca0131b9a90ac026a24cf579b17928c19173f3f..f8d0a8ea39cd90a9b45ff97e32e0e722
|
||||
public Optional<SpawnData> nextSpawnData;
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/jade/JadeProtocol.java b/src/main/java/org/leavesmc/leaves/protocol/jade/JadeProtocol.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..cd5dfd55b6554e47a336c7aa4cb24db3cb4919dd
|
||||
index 0000000000000000000000000000000000000000..33741d707715619929e5412a786470c5372f5978
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/jade/JadeProtocol.java
|
||||
@@ -0,0 +1,343 @@
|
||||
@@ -160,7 +160,7 @@ index 0000000000000000000000000000000000000000..cd5dfd55b6554e47a336c7aa4cb24db3
|
||||
+
|
||||
+ @Contract("_ -> new")
|
||||
+ public static @NotNull ResourceLocation mc_id(String path) {
|
||||
+ return new ResourceLocation(path);
|
||||
+ return ResourceLocation.withDefaultNamespace(path);
|
||||
+ }
|
||||
+
|
||||
+ private static boolean isPrimaryKey(ResourceLocation key) {
|
||||
@@ -824,7 +824,7 @@ index 0000000000000000000000000000000000000000..fd4112ed1911171b3c6b5840b7184b5f
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/jade/provider/block/CampfireProvider.java b/src/main/java/org/leavesmc/leaves/protocol/jade/provider/block/CampfireProvider.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..d22013480b53017db71697af37c0b3daa19c7ac5
|
||||
index 0000000000000000000000000000000000000000..a1a479987f2c0b6ff4cfd511cbcac1ea7b1c247b
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/jade/provider/block/CampfireProvider.java
|
||||
@@ -0,0 +1,52 @@
|
||||
@@ -864,7 +864,7 @@ index 0000000000000000000000000000000000000000..d22013480b53017db71697af37c0b3da
|
||||
+ stack = stack.copy();
|
||||
+
|
||||
+ CustomData customData = stack.getOrDefault(DataComponents.CUSTOM_DATA, CustomData.EMPTY)
|
||||
+ .update(COOKING_TIME_CODEC, campfire.cookingTime[i] - campfire.cookingProgress[i])
|
||||
+ .update(NbtOps.INSTANCE, COOKING_TIME_CODEC, campfire.cookingTime[i] - campfire.cookingProgress[i])
|
||||
+ .getOrThrow();
|
||||
+ stack.set(DataComponents.CUSTOM_DATA, customData);
|
||||
+
|
||||
@@ -9,15 +9,34 @@ MasaGadget(https://github.com/plusls/MasaGadget)
|
||||
litematica(https://github.com/maruohon/litematica)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
index 96fb69ec6db2e7c8c728435f0c537b076259b2fb..7632d5ac83c84e943654477b3f36e6605e28c9a7 100644
|
||||
index 96fb69ec6db2e7c8c728435f0c537b076259b2fb..29f38a0a87cb7e27ac18c09dd59e774cfd874592 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
@@ -162,7 +162,7 @@ public class BlockItem extends Item {
|
||||
|
||||
@@ -163,6 +163,27 @@ public class BlockItem extends Item {
|
||||
@Nullable
|
||||
protected BlockState getPlacementState(BlockPlaceContext context) {
|
||||
- BlockState iblockdata = this.getBlock().getStateForPlacement(context);
|
||||
+ BlockState iblockdata = this.getBlock().getRealStateForPlacement(context); // Leaves - alternativeBlockPlacement
|
||||
BlockState iblockdata = this.getBlock().getStateForPlacement(context);
|
||||
+ // Leaves start - alternativeBlockPlacement
|
||||
+ switch (org.leavesmc.leaves.LeavesConfig.alternativeBlockPlacement) {
|
||||
+ case CARPET -> {
|
||||
+ BlockState tryState = org.leavesmc.leaves.protocol.CarpetAlternativeBlockPlacement.alternativeBlockPlacement(getBlock(), context);
|
||||
+ if (tryState != null) {
|
||||
+ iblockdata = tryState;
|
||||
+ }
|
||||
+ }
|
||||
+ case CARPET_FIX -> {
|
||||
+ BlockState tryState = org.leavesmc.leaves.protocol.CarpetAlternativeBlockPlacement.alternativeBlockPlacementFix(getBlock(), context);
|
||||
+ if (tryState != null) {
|
||||
+ iblockdata = tryState;
|
||||
+ }
|
||||
+ }
|
||||
+ case LITEMATICA -> {
|
||||
+ if (iblockdata != null && this.canPlace(context, iblockdata)) {
|
||||
+ return org.leavesmc.leaves.protocol.LitematicaEasyPlaceProtocol.applyPlacementProtocol(iblockdata, context);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Leaves end - alternativeBlockPlacement
|
||||
|
||||
return iblockdata != null && this.canPlace(context, iblockdata) ? iblockdata : null;
|
||||
}
|
||||
@@ -44,10 +63,10 @@ index f8f909ebdad5e96379e8bd8c610164ef0697368e..0b761f3ae15ad4a3b8152f497a604032
|
||||
if (iblockdata2 != null && this.canPlace(world, iblockdata2, blockposition)) {
|
||||
iblockdata1 = iblockdata2;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
index e27f2317e4e2f13b6ef12be727046497a750fd3a..549f77998274404b1b475230d88568fd3e27ac6d 100644
|
||||
index 992c778f4a826be8d7a5a5d96bf7968b741f490e..9fa6c828471bfba2209bd4903e7240e05b6ee2ec 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -412,6 +412,33 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -411,6 +411,33 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
|
||||
public void stepOn(Level world, BlockPos pos, BlockState state, Entity entity) {}
|
||||
|
||||
@@ -83,10 +102,10 @@ index e27f2317e4e2f13b6ef12be727046497a750fd3a..549f77998274404b1b475230d88568fd
|
||||
return this.defaultBlockState();
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/CarpetAlternativeBlockPlacement.java b/src/main/java/org/leavesmc/leaves/protocol/CarpetAlternativeBlockPlacement.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..100356d5b0f62b62e1bcb02ca515225179fc0cc6
|
||||
index 0000000000000000000000000000000000000000..03978356d2716296f8c5e4173d10862db57a3193
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/CarpetAlternativeBlockPlacement.java
|
||||
@@ -0,0 +1,161 @@
|
||||
@@ -0,0 +1,162 @@
|
||||
+package org.leavesmc.leaves.protocol;
|
||||
+
|
||||
+import net.minecraft.core.BlockPos;
|
||||
@@ -127,8 +146,9 @@ index 0000000000000000000000000000000000000000..100356d5b0f62b62e1bcb02ca5152251
|
||||
+ BlockPos blockPos = context.getClickedPos();
|
||||
+ double relativeHitX = hitPos.x - blockPos.getX();
|
||||
+ BlockState state = block.getStateForPlacement(context);
|
||||
+ Player player = context.getPlayer();
|
||||
+
|
||||
+ if (relativeHitX < 2 || state == null) {
|
||||
+ if (relativeHitX < 2 || state == null || player == null) {
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
@@ -147,7 +167,7 @@ index 0000000000000000000000000000000000000000..100356d5b0f62b62e1bcb02ca5152251
|
||||
+ }
|
||||
+
|
||||
+ if (!directionProp.getPossibleValues().contains(facing)) {
|
||||
+ facing = context.getPlayer().getDirection().getOpposite();
|
||||
+ facing = player.getDirection().getOpposite();
|
||||
+ }
|
||||
+
|
||||
+ if (facing != origFacing && directionProp.getPossibleValues().contains(facing)) {
|
||||
@@ -250,15 +270,16 @@ index 0000000000000000000000000000000000000000..100356d5b0f62b62e1bcb02ca5152251
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/LitematicaEasyPlaceProtocol.java b/src/main/java/org/leavesmc/leaves/protocol/LitematicaEasyPlaceProtocol.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..7a49e2591e1eabf9d9444d530f631f038a7a47aa
|
||||
index 0000000000000000000000000000000000000000..affe9b0aa16968ad8832d94af06fd84323830cbb
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/LitematicaEasyPlaceProtocol.java
|
||||
@@ -0,0 +1,214 @@
|
||||
@@ -0,0 +1,195 @@
|
||||
+package org.leavesmc.leaves.protocol;
|
||||
+
|
||||
+import com.google.common.collect.ImmutableSet;
|
||||
+import net.minecraft.core.BlockPos;
|
||||
+import net.minecraft.core.Direction;
|
||||
+import net.minecraft.util.Mth;
|
||||
+import net.minecraft.world.InteractionHand;
|
||||
+import net.minecraft.world.entity.LivingEntity;
|
||||
+import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
@@ -271,7 +292,6 @@ index 0000000000000000000000000000000000000000..7a49e2591e1eabf9d9444d530f631f03
|
||||
+import net.minecraft.world.level.block.state.properties.SlabType;
|
||||
+import net.minecraft.world.phys.Vec3;
|
||||
+import org.leavesmc.leaves.LeavesLogger;
|
||||
+import org.leavesmc.leaves.util.MathUtils;
|
||||
+
|
||||
+import javax.annotation.Nullable;
|
||||
+import java.util.ArrayList;
|
||||
@@ -281,42 +301,31 @@ index 0000000000000000000000000000000000000000..7a49e2591e1eabf9d9444d530f631f03
|
||||
+public class LitematicaEasyPlaceProtocol {
|
||||
+
|
||||
+ public static final ImmutableSet<Property<?>> WHITELISTED_PROPERTIES = ImmutableSet.of(
|
||||
+ // BooleanProperty:
|
||||
+ // INVERTED - DaylightDetector
|
||||
+ // OPEN - Barrel, Door, FenceGate, Trapdoor
|
||||
+ // PERSISTENT - Leaves
|
||||
+ BlockStateProperties.INVERTED,
|
||||
+ BlockStateProperties.OPEN,
|
||||
+ BlockStateProperties.PERSISTENT,
|
||||
+ // EnumProperty:
|
||||
+ // AXIS - Pillar
|
||||
+ // BLOCK_HALF - Stairs, Trapdoor
|
||||
+ // CHEST_TYPE - Chest
|
||||
+ // COMPARATOR_MODE - Comparator
|
||||
+ // DOOR_HINGE - Door
|
||||
+ // SLAB_TYPE - Slab - PARTIAL ONLY: TOP and BOTTOM, not DOUBLE
|
||||
+ // STAIR_SHAPE - Stairs (needed to get the correct state, otherwise the player facing would be a factor)
|
||||
+ // WALL_MOUNT_LOCATION - Button, Grindstone, Lever
|
||||
+ BlockStateProperties.CAN_SUMMON,
|
||||
+ BlockStateProperties.BELL_ATTACHMENT,
|
||||
+ BlockStateProperties.AXIS,
|
||||
+ BlockStateProperties.BED_PART,
|
||||
+ BlockStateProperties.HALF,
|
||||
+ BlockStateProperties.ATTACH_FACE,
|
||||
+ BlockStateProperties.CHEST_TYPE,
|
||||
+ BlockStateProperties.MODE_COMPARATOR,
|
||||
+ BlockStateProperties.DOOR_HINGE,
|
||||
+ BlockStateProperties.DOUBLE_BLOCK_HALF,
|
||||
+ BlockStateProperties.ORIENTATION,
|
||||
+ BlockStateProperties.RAIL_SHAPE,
|
||||
+ BlockStateProperties.RAIL_SHAPE_STRAIGHT,
|
||||
+ BlockStateProperties.SLAB_TYPE,
|
||||
+ BlockStateProperties.STAIRS_SHAPE,
|
||||
+ BlockStateProperties.ATTACH_FACE,
|
||||
+ // IntProperty:
|
||||
+ // BITES - Cake
|
||||
+ // DELAY - Repeater
|
||||
+ // NOTE - NoteBlock
|
||||
+ // ROTATION - Banner, Sign, Skull
|
||||
+ BlockStateProperties.BITES,
|
||||
+ BlockStateProperties.DELAY,
|
||||
+ BlockStateProperties.NOTE,
|
||||
+ BlockStateProperties.ROTATION_16
|
||||
+ );
|
||||
+
|
||||
+ public static <T extends Comparable<T>> BlockState applyPlacementProtocol(BlockState state, BlockPlaceContext context) {
|
||||
+ public static BlockState applyPlacementProtocol(BlockState state, BlockPlaceContext context) {
|
||||
+ return applyPlacementProtocolV3(state, UseContext.from(context, context.getHand()));
|
||||
+ }
|
||||
+
|
||||
@@ -326,7 +335,7 @@ index 0000000000000000000000000000000000000000..7a49e2591e1eabf9d9444d530f631f03
|
||||
+ return state;
|
||||
+ }
|
||||
+
|
||||
+ @Nullable DirectionProperty property = getFirstDirectionProperty(state);
|
||||
+ @Nullable DirectionProperty property = CarpetAlternativeBlockPlacement.getFirstDirectionProperty(state);
|
||||
+
|
||||
+ if (property != null && property != BlockStateProperties.VERTICAL_DIRECTION) {
|
||||
+ state = applyDirectionProperty(state, context, property, protocolValue);
|
||||
@@ -346,15 +355,16 @@ index 0000000000000000000000000000000000000000..7a49e2591e1eabf9d9444d530f631f03
|
||||
+ try {
|
||||
+ for (Property<?> p : propList) {
|
||||
+ if (!(p instanceof DirectionProperty) && WHITELISTED_PROPERTIES.contains(p)) {
|
||||
+ @SuppressWarnings("unchecked") Property<T> prop = (Property<T>) p;
|
||||
+ @SuppressWarnings("unchecked")
|
||||
+ Property<T> prop = (Property<T>) p;
|
||||
+ List<T> list = new ArrayList<>(prop.getPossibleValues());
|
||||
+ list.sort(Comparable::compareTo);
|
||||
+
|
||||
+ int requiredBits = MathUtils.floorLog2(MathUtils.smallestEncompassingPowerOfTwo(list.size()));
|
||||
+ int requiredBits = Mth.log2(Mth.smallestEncompassingPowerOfTwo(list.size()));
|
||||
+ int bitMask = ~(0xFFFFFFFF << requiredBits);
|
||||
+ int valueIndex = protocolValue & bitMask;
|
||||
+
|
||||
+ if (valueIndex >= 0 && valueIndex < list.size()) {
|
||||
+ if (valueIndex < list.size()) {
|
||||
+ T value = list.get(valueIndex);
|
||||
+
|
||||
+ if (!state.getValue(prop).equals(value) && value != SlabType.DOUBLE) {
|
||||
@@ -379,7 +389,7 @@ index 0000000000000000000000000000000000000000..7a49e2591e1eabf9d9444d530f631f03
|
||||
+
|
||||
+ if (decodedFacingIndex == 6) {
|
||||
+ facing = facing.getOpposite();
|
||||
+ } else if (decodedFacingIndex >= 0 && decodedFacingIndex <= 5) {
|
||||
+ } else if (decodedFacingIndex <= 5) {
|
||||
+ facing = Direction.from3DDataValue(decodedFacingIndex);
|
||||
+
|
||||
+ if (!property.getPossibleValues().contains(facing)) {
|
||||
@@ -403,15 +413,6 @@ index 0000000000000000000000000000000000000000..7a49e2591e1eabf9d9444d530f631f03
|
||||
+ return state;
|
||||
+ }
|
||||
+
|
||||
+ private static DirectionProperty getFirstDirectionProperty(BlockState state) {
|
||||
+ for (Property<?> prop : state.getProperties()) {
|
||||
+ if (prop instanceof DirectionProperty) {
|
||||
+ return (DirectionProperty) prop;
|
||||
+ }
|
||||
+ }
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ public static class UseContext {
|
||||
+
|
||||
+ private final Level world;
|
||||
@@ -468,37 +469,3 @@ index 0000000000000000000000000000000000000000..7a49e2591e1eabf9d9444d530f631f03
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/util/MathUtils.java b/src/main/java/org/leavesmc/leaves/util/MathUtils.java
|
||||
index 6c42b029d98ed293645f06dde6838761f87f20bb..cd66a5f1b544640de1277cef870a60b53e1a128b 100644
|
||||
--- a/src/main/java/org/leavesmc/leaves/util/MathUtils.java
|
||||
+++ b/src/main/java/org/leavesmc/leaves/util/MathUtils.java
|
||||
@@ -75,4 +75,29 @@ public class MathUtils {
|
||||
|
||||
return vector;
|
||||
}
|
||||
+
|
||||
+ private static final int[] MULTIPLY_DE_BRUIJN_BIT_POSITION = new int[]{0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9};
|
||||
+
|
||||
+ public static int floorLog2(int value) {
|
||||
+ return ceilLog2(value) - (isPowerOfTwo(value) ? 0 : 1);
|
||||
+ }
|
||||
+
|
||||
+ public static int ceilLog2(int value) {
|
||||
+ value = isPowerOfTwo(value) ? value : smallestEncompassingPowerOfTwo(value);
|
||||
+ return MULTIPLY_DE_BRUIJN_BIT_POSITION[(int)((long)value * 125613361L >> 27) & 31];
|
||||
+ }
|
||||
+
|
||||
+ public static boolean isPowerOfTwo(int value) {
|
||||
+ return value != 0 && (value & value - 1) == 0;
|
||||
+ }
|
||||
+
|
||||
+ public static int smallestEncompassingPowerOfTwo(int value) {
|
||||
+ int i = value - 1;
|
||||
+ i |= i >> 1;
|
||||
+ i |= i >> 2;
|
||||
+ i |= i >> 4;
|
||||
+ i |= i >> 8;
|
||||
+ i |= i >> 16;
|
||||
+ return i + 1;
|
||||
+ }
|
||||
}
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Player operation limiter
|
||||
This patch is Powered by plusls-carpet-addition(https://github.com/plusls/plusls-carpet-addition)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 1b64253c30d1528f7401f15eaa336bbf183dc9d2..e74084548930664d4795d10a3f3448877128c88f 100644
|
||||
index 5afef331ec117adae0c29f5c4b9f43b7be7cdd4c..a873d07351f8909f71805eec16a2e8dc22de3bb4 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -299,6 +299,10 @@ public class ServerPlayer extends Player {
|
||||
@@ -301,6 +301,10 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
|
||||
public @Nullable String clientBrandName = null; // Paper - Brand support
|
||||
public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - Add API for quit reason; there are a lot of changes to do if we change all methods leading to the event
|
||||
@@ -18,9 +18,9 @@ index 1b64253c30d1528f7401f15eaa336bbf183dc9d2..e74084548930664d4795d10a3f344887
|
||||
+ private int placeBlockCountPerTick = 0;
|
||||
+ // Leaves end - player operation limiter
|
||||
|
||||
// Paper start - replace player chunk loader
|
||||
private final java.util.concurrent.atomic.AtomicReference<io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances> viewDistances = new java.util.concurrent.atomic.AtomicReference<>(new io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances(-1, -1, -1));
|
||||
@@ -774,6 +778,7 @@ public class ServerPlayer extends Player {
|
||||
// Paper start - rewrite chunk system
|
||||
private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
|
||||
@@ -764,6 +768,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
this.joining = false;
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -28,7 +28,7 @@ index 1b64253c30d1528f7401f15eaa336bbf183dc9d2..e74084548930664d4795d10a3f344887
|
||||
this.gameMode.tick();
|
||||
this.wardenSpawnTracker.tick();
|
||||
--this.spawnInvulnerableTime;
|
||||
@@ -2883,5 +2888,32 @@ public class ServerPlayer extends Player {
|
||||
@@ -2945,5 +2950,32 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
public CraftPlayer getBukkitEntity() {
|
||||
return (CraftPlayer) super.getBukkitEntity();
|
||||
}
|
||||
@@ -62,18 +62,10 @@ index 1b64253c30d1528f7401f15eaa336bbf183dc9d2..e74084548930664d4795d10a3f344887
|
||||
// CraftBukkit end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
index 1047027610624c9ba4bb5afd5d7f0714a062b198..2afa036e7dcd52ec71b62cd0e30ce1b539459c55 100644
|
||||
index 24b1715397ba8e6f5e9841a030d0e3d964356f89..c0d29abf5a21015a4a0334549c0fd9b9f585f834 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
@@ -43,6 +43,7 @@ import org.bukkit.event.Event;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerGameModeChangeEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
+import org.leavesmc.leaves.event.player.PlayerOperationLimitEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
public class ServerPlayerGameMode {
|
||||
@@ -334,6 +335,19 @@ public class ServerPlayerGameMode {
|
||||
@@ -339,6 +339,19 @@ public class ServerPlayerGameMode {
|
||||
}
|
||||
|
||||
public void destroyAndAck(BlockPos pos, int sequence, String reason) {
|
||||
@@ -82,7 +74,7 @@ index 1047027610624c9ba4bb5afd5d7f0714a062b198..2afa036e7dcd52ec71b62cd0e30ce1b5
|
||||
+ if (reason.equals("insta mine")) {
|
||||
+ player.addInstaBreakCountPerTick();
|
||||
+ if (!player.allowOperation()) {
|
||||
+ MinecraftServer.getServer().server.getPluginManager().callEvent(new PlayerOperationLimitEvent(player.getBukkitEntity(), PlayerOperationLimitEvent.Operation.MINE, CraftBlock.at(level, pos)));
|
||||
+ MinecraftServer.getServer().server.getPluginManager().callEvent(new org.leavesmc.leaves.event.player.PlayerOperationLimitEvent(player.getBukkitEntity(), org.leavesmc.leaves.event.player.PlayerOperationLimitEvent.Operation.MINE, CraftBlock.at(level, pos)));
|
||||
+ this.player.connection.send(new ClientboundBlockUpdatePacket(pos, this.level.getBlockState(pos)));
|
||||
+ this.debugLogging(pos, false, sequence, reason);
|
||||
+ return;
|
||||
@@ -94,22 +86,10 @@ index 1047027610624c9ba4bb5afd5d7f0714a062b198..2afa036e7dcd52ec71b62cd0e30ce1b5
|
||||
this.debugLogging(pos, true, sequence, reason);
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
index 7632d5ac83c84e943654477b3f36e6605e28c9a7..c21a65d9637739f1040dd27b096101a7a7adc0df 100644
|
||||
index 29f38a0a87cb7e27ac18c09dd59e774cfd874592..2759a9eeef85b323b7e1ea78090f4f9d637c938a 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
@@ -32,8 +32,11 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import org.bukkit.craftbukkit.block.CraftBlock;
|
||||
+import org.bukkit.craftbukkit.block.CraftBlockState;
|
||||
+import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
||||
import org.bukkit.event.block.BlockCanBuildEvent;
|
||||
+import org.leavesmc.leaves.event.player.PlayerOperationLimitEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
public class BlockItem extends Item {
|
||||
@@ -80,6 +83,20 @@ public class BlockItem extends Item {
|
||||
@@ -80,6 +80,20 @@ public class BlockItem extends Item {
|
||||
final org.bukkit.block.BlockState oldBlockstate = blockstate != null ? blockstate : org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(blockactioncontext1.getLevel(), blockactioncontext1.getClickedPos()); // Paper - Reset placed block on exception
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -120,7 +100,7 @@ index 7632d5ac83c84e943654477b3f36e6605e28c9a7..c21a65d9637739f1040dd27b096101a7
|
||||
+ player.addPlaceBlockCountPerTick();
|
||||
+ if (!player.allowOperation()) {
|
||||
+ if (blockstate != null) {
|
||||
+ MinecraftServer.getServer().server.getPluginManager().callEvent(new PlayerOperationLimitEvent(player.getBukkitEntity(), PlayerOperationLimitEvent.Operation.PLACE, blockstate.getBlock()));
|
||||
+ MinecraftServer.getServer().server.getPluginManager().callEvent(new org.leavesmc.leaves.event.player.PlayerOperationLimitEvent(player.getBukkitEntity(), org.leavesmc.leaves.event.player.PlayerOperationLimitEvent.Operation.PLACE, blockstate.getBlock()));
|
||||
+ }
|
||||
+ return InteractionResult.FAIL;
|
||||
+ }
|
||||
@@ -6,19 +6,10 @@ Subject: [PATCH] Renewable Elytra
|
||||
This patch is Powered by Carpet-TIS-Addition(https://github.com/plusls/Carpet-TIS-Addition)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
||||
index 68f8945292753535a3b73acb9f48c1594f0789a4..da5df2271a8192bf4c86772bd84107e55f3040aa 100644
|
||||
index c277dac448a64809e93dd7a447ee3dc2a86c860e..5641da81d6f00e153d847b9284251084d545e726 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
||||
@@ -35,6 +35,8 @@ import net.minecraft.world.entity.ai.goal.Goal;
|
||||
import net.minecraft.world.entity.ai.targeting.TargetingConditions;
|
||||
import net.minecraft.world.entity.animal.Cat;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
+import net.minecraft.world.item.ItemStack;
|
||||
+import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.ServerLevelAccessor;
|
||||
import net.minecraft.world.level.levelgen.Heightmap;
|
||||
@@ -233,6 +235,20 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
@@ -233,6 +233,20 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
return entitysize.scale(1.0F + 0.15F * (float) i);
|
||||
}
|
||||
|
||||
@@ -28,7 +19,7 @@ index 68f8945292753535a3b73acb9f48c1594f0789a4..da5df2271a8192bf4c86772bd84107e5
|
||||
+ super.dropFromLootTable(source, causedByPlayer);
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.renewableElytra > 0.0D) {
|
||||
+ if (source.getEntity() instanceof Shulker && this.random.nextDouble() < org.leavesmc.leaves.LeavesConfig.renewableElytra) {
|
||||
+ ItemStack item = new ItemStack(Items.ELYTRA);
|
||||
+ net.minecraft.world.item.ItemStack item = new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.ELYTRA);
|
||||
+ item.setDamageValue(432);
|
||||
+ this.spawnAtLocation(item);
|
||||
+ }
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Stackable ShulkerBoxes
|
||||
This patch is Powered by fabric-carpet(https://github.com/gnembon/fabric-carpet) and plusls-carpet-addition(https://github.com/plusls/plusls-carpet-addition)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
index 8fd3845c4965843be9c37498760d93f1ebdff541..d3fa592892fc72c8fc8f23e8e477eb88902bba16 100644
|
||||
index ea0d9335446b20073b9aafb9de453097355db79c..38c2e27343d68d016621cf953222b915b56a0df2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -22,10 +22,12 @@ import net.minecraft.world.entity.EntityType;
|
||||
@@ -20,9 +20,9 @@ index 8fd3845c4965843be9c37498760d93f1ebdff541..d3fa592892fc72c8fc8f23e8e477eb88
|
||||
import net.minecraft.world.level.Level;
|
||||
+import net.minecraft.world.level.block.ShulkerBoxBlock;
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
import net.minecraft.world.level.portal.DimensionTransition;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
// CraftBukkit start
|
||||
@@ -35,6 +37,7 @@ import net.minecraft.sounds.SoundSource;
|
||||
@@ -36,6 +38,7 @@ import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.stats.Stats;
|
||||
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -30,7 +30,7 @@ index 8fd3845c4965843be9c37498760d93f1ebdff541..d3fa592892fc72c8fc8f23e8e477eb88
|
||||
import org.bukkit.event.entity.EntityPickupItemEvent;
|
||||
import org.bukkit.event.entity.EntityRemoveEvent;
|
||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||
@@ -78,6 +81,13 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
@@ -79,6 +82,13 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
this.setDeltaMovement(this.random.nextDouble() * 0.2D - 0.1D, 0.2D, this.random.nextDouble() * 0.2D - 0.1D);
|
||||
this.setItem(stack);
|
||||
// Paper end - Don't use level random in entity constructors
|
||||
@@ -44,7 +44,7 @@ index 8fd3845c4965843be9c37498760d93f1ebdff541..d3fa592892fc72c8fc8f23e8e477eb88
|
||||
}
|
||||
|
||||
public ItemEntity(Level world, double x, double y, double z, ItemStack stack, double velocityX, double velocityY, double velocityZ) {
|
||||
@@ -314,10 +324,49 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
@@ -315,10 +325,49 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
private boolean isMergable() {
|
||||
ItemStack itemstack = this.getItem();
|
||||
|
||||
@@ -96,10 +96,10 @@ index 8fd3845c4965843be9c37498760d93f1ebdff541..d3fa592892fc72c8fc8f23e8e477eb88
|
||||
ItemStack itemstack1 = other.getItem();
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
index 3c8f35f92ed7e9518d676087f82d1e4da963b779..9037c6c8f0947e72e02552557f3c47625927681e 100644
|
||||
index eb11482f48c9f330b7fa62a278fd6f07d3a642e1..8631f3a5ce5aa24f195d5031dad6d289e4389314 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
@@ -114,7 +114,7 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -111,7 +111,7 @@ public class Inventory implements Container, Nameable {
|
||||
}
|
||||
|
||||
private boolean hasRemainingSpaceForItem(ItemStack existingStack, ItemStack stack) {
|
||||
@@ -108,7 +108,7 @@ index 3c8f35f92ed7e9518d676087f82d1e4da963b779..9037c6c8f0947e72e02552557f3c4762
|
||||
}
|
||||
|
||||
// CraftBukkit start - Watch method above! :D
|
||||
@@ -282,7 +282,9 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -279,7 +279,9 @@ public class Inventory implements Container, Nameable {
|
||||
this.setItem(slot, itemstack1);
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ index 3c8f35f92ed7e9518d676087f82d1e4da963b779..9037c6c8f0947e72e02552557f3c4762
|
||||
int l = Math.min(j, k);
|
||||
|
||||
if (l == 0) {
|
||||
@@ -397,7 +399,7 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -394,7 +396,7 @@ public class Inventory implements Container, Nameable {
|
||||
}
|
||||
|
||||
if (i != -1) {
|
||||
@@ -207,10 +207,10 @@ index c39c773112fb8b534b926f2f2b47fe6fbb69fcb2..ae9338b8a5598e7a257b469adae72858
|
||||
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index f8589837070039b4911a9532b92fa959c7af6352..35e0aac4dc32227c48dc3a0f3a15c02a700fc402 100644
|
||||
index 312b57b4ef340935f4335989ce1d6a4b8b61532c..fa3dbb93a049962fe10cb0391d437acdb45c82af 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -228,7 +228,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
@@ -225,7 +225,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
@Deprecated
|
||||
@Nullable
|
||||
private Item item;
|
||||
@@ -253,10 +253,10 @@ index 20f2b575c8131621edea0e75fbf38a9fe20a36c4..812856b02cab1c437550ba9c706da318
|
||||
protected VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
|
||||
return SHAPE;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
index 8310d132006043e93c612890514c4c7f3eb1c74d..592b330f187fb5eca51d60911bbebbaeaf46ef87 100644
|
||||
index f523f888f2a0ac04f25b30e18cdd765c395cfc18..d9421224778c72f8f9db3c9044bc28c2423bb09d 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
@@ -728,9 +728,9 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
@@ -743,9 +743,9 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
if (itemstack1.isEmpty()) {
|
||||
// Spigot start - SPIGOT-6693, InventorySubcontainer#setItem
|
||||
ItemStack leftover = ItemStack.EMPTY; // Paper - Make hoppers respect inventory max stack size
|
||||
@@ -7,7 +7,7 @@ This patch is Powered by Pufferfish
|
||||
(https://github.com/pufferfish-gg/Pufferfish)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
index c2943d892b067b3f1fb3b93301a092e912d71f08..d5352883ee51dfc646352ae7e2b76af7efd0441e 100644
|
||||
index 1c0712295695727ee9c4d430d4157b8e17cbd71f..1687ab4965433459219bb5d8aaf5ec8e5baeb605 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
@@ -53,6 +53,11 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -22,18 +22,12 @@ index c2943d892b067b3f1fb3b93301a092e912d71f08..d5352883ee51dfc646352ae7e2b76af7
|
||||
private final Map<FluidState, VoxelShape> shapes = Maps.newIdentityHashMap();
|
||||
|
||||
public FlowingFluid() {}
|
||||
@@ -251,40 +256,71 @@ public abstract class FlowingFluid extends Fluid {
|
||||
return false;
|
||||
}
|
||||
// Paper end - optimise collisions
|
||||
- Object2ByteLinkedOpenHashMap object2bytelinkedopenhashmap;
|
||||
@@ -240,40 +245,70 @@ public abstract class FlowingFluid extends Fluid {
|
||||
}
|
||||
|
||||
- if (!state.getBlock().hasDynamicShape() && !fromState.getBlock().hasDynamicShape()) {
|
||||
- object2bytelinkedopenhashmap = (Object2ByteLinkedOpenHashMap) FlowingFluid.OCCLUSION_CACHE.get();
|
||||
- } else {
|
||||
- object2bytelinkedopenhashmap = null;
|
||||
- }
|
||||
+ // Leaves start - cache
|
||||
private boolean canPassThroughWall(Direction face, BlockGetter world, BlockPos pos, BlockState state, BlockPos fromPos, BlockState fromState) {
|
||||
- Object2ByteLinkedOpenHashMap object2bytelinkedopenhashmap;
|
||||
+ // Leaves end - cache
|
||||
+ if (!org.leavesmc.leaves.LeavesConfig.improveFluidDirectionCaching) {
|
||||
+ Object2ByteLinkedOpenHashMap object2bytelinkedopenhashmap;
|
||||
+
|
||||
@@ -42,7 +36,12 @@ index c2943d892b067b3f1fb3b93301a092e912d71f08..d5352883ee51dfc646352ae7e2b76af7
|
||||
+ } else {
|
||||
+ object2bytelinkedopenhashmap = null;
|
||||
+ }
|
||||
+
|
||||
|
||||
- if (!state.getBlock().hasDynamicShape() && !fromState.getBlock().hasDynamicShape()) {
|
||||
- object2bytelinkedopenhashmap = (Object2ByteLinkedOpenHashMap) FlowingFluid.OCCLUSION_CACHE.get();
|
||||
- } else {
|
||||
- object2bytelinkedopenhashmap = null;
|
||||
- }
|
||||
+ Block.BlockStatePairKey block_a;
|
||||
+
|
||||
+ if (object2bytelinkedopenhashmap != null) {
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] MC Technical Survival Mode
|
||||
Will automatically overwrite some configuration after startup
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||
index 19d973a0582c487617fafadd3df4857f8a1819a4..9cf1ab96f4f249f542b6698301237a989d4b6ff8 100644
|
||||
index 8fe9a0bf5a6c27d8a505afc2f51b3dccc905423b..979d70561c1a3b9b539f413ba689a89ab03e413f 100644
|
||||
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||
@@ -331,14 +331,14 @@ public final class ChatProcessor {
|
||||
@@ -26,19 +26,6 @@ index 19d973a0582c487617fafadd3df4857f8a1819a4..9cf1ab96f4f249f542b6698301237a98
|
||||
return player.teamDisplayName();
|
||||
}
|
||||
return player.displayName();
|
||||
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java
|
||||
index 5b446e6ac151f99f64f0c442d0b40b5e251bc4c4..b133b977bc7d452b5032809f84f8ac2ff96ae5bb 100644
|
||||
--- a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java
|
||||
+++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java
|
||||
@@ -608,7 +608,7 @@ public final class ChunkHolderManager {
|
||||
// Delay unload chunk patch originally by Aikar, updated to 1.20 by jpenilla
|
||||
// these days, the patch is mostly useful to keep chunks ticking when players teleport
|
||||
// so that their pets can teleport with them as well.
|
||||
- final long delayTimeout = this.world.paperConfig().chunks.delayChunkUnloadsBy.ticks();
|
||||
+ final long delayTimeout = org.leavesmc.leaves.LeavesConfig.mcTechnicalMode ? 0 : this.world.paperConfig().chunks.delayChunkUnloadsBy.ticks(); // Leaves - mc technical survival mode
|
||||
final TicketType<ChunkPos> toAdd;
|
||||
final long timeout;
|
||||
if (type == RegionizedPlayerChunkLoader.REGION_PLAYER_TICKET && delayTimeout > 0) {
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||
index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..12cf1f7ba7d6c14b8b31d939b6f281bd2135656a 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||
@@ -52,10 +39,10 @@ index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..12cf1f7ba7d6c14b8b31d939b6f281bd
|
||||
throw new RuntimeException("Could not reload paper configuration files", ex);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 63652c3011c48c461c1b5be1889847b2f065e34c..0f3a92155fa0b4ed9d7fbc87202fd04dc01a0890 100644
|
||||
index 1ff888bdc9c83a7e84393711ff50c96e78a1d55a..2d21dbb62c720beead96bf9176c7bd22661592ac 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -2695,7 +2695,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -2452,7 +2452,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
public void onTickingEnd(Entity entity) {
|
||||
ServerLevel.this.entityTickList.remove(entity);
|
||||
// Paper start - Reset pearls when they stop being ticked
|
||||
@@ -65,10 +52,10 @@ index 63652c3011c48c461c1b5be1889847b2f065e34c..0f3a92155fa0b4ed9d7fbc87202fd04d
|
||||
pearl.ownerUUID = null;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index e74084548930664d4795d10a3f3448877128c88f..05ee5e0bcefc25b771eac20e53a7b7a3e0fed944 100644
|
||||
index a873d07351f8909f71805eec16a2e8dc22de3bb4..8a5fbcdbef5d8e14ca09f6a23a19860d92258a5c 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1611,7 +1611,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -1633,7 +1633,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
|
||||
@Override
|
||||
public boolean isInvulnerableTo(DamageSource damageSource) {
|
||||
@@ -78,10 +65,10 @@ index e74084548930664d4795d10a3f3448877128c88f..05ee5e0bcefc25b771eac20e53a7b7a3
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
||||
index d8e440e14b72dc48ae97244f1bed2c06abd997ab..c207bb1aa756a68dfbd397aa7ed40e9647fc8fec 100644
|
||||
index a33d89fe9ca9e343edab8bb1cc88c54130ddb4a7..5efedc1cadf31f2b944ca5401ce0c21131a4ab94 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
||||
@@ -68,7 +68,7 @@ public class EndCrystal extends Entity {
|
||||
@@ -70,7 +70,7 @@ public class EndCrystal extends Entity {
|
||||
// CraftBukkit end
|
||||
}
|
||||
// Paper start - Fix invulnerable end crystals
|
||||
@@ -91,23 +78,23 @@ index d8e440e14b72dc48ae97244f1bed2c06abd997ab..c207bb1aa756a68dfbd397aa7ed40e96
|
||||
|| ((ServerLevel) this.level()).getDragonFight() == null
|
||||
|| ((ServerLevel) this.level()).getDragonFight().respawnStage == null
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||
index f1f352ec0e51f5db59254841a06c176c5a876fc9..eb9529b4bf20f828fd7e8abf6895baf0c7900dcc 100644
|
||||
index 42bd2d9a1528b6210e4dfb56233062fd97c9743b..8d494b549abb452bb554220060cc9c5beec5edf6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||
@@ -75,7 +75,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||
@@ -95,7 +95,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
- if (this.level().spigotConfig.maxTntTicksPerTick > 0 && ++this.level().spigotConfig.currentPrimedTnt > this.level().spigotConfig.maxTntTicksPerTick) { return; } // Spigot
|
||||
+ if (this.level().spigotConfig.maxTntTicksPerTick > 0 && ++this.level().spigotConfig.currentPrimedTnt > (org.leavesmc.leaves.LeavesConfig.mcTechnicalMode ? 2000 : this.level().spigotConfig.maxTntTicksPerTick)) { return; } // Spigot // Leaves - mc technical survival mode
|
||||
this.handlePortal();
|
||||
this.applyGravity();
|
||||
this.move(MoverType.SELF, this.getDeltaMovement());
|
||||
// Paper start - Configurable TNT height nerf
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
index 74c596264d4da551437bd2a23e1c70022cfc73fc..71d2f2a98ede3ba2992ae3745d78b33c9d999650 100644
|
||||
index 5f7d152f41eb85f17bcded4bc8099b998e5a338b..cfc7edcf24646d1605d05c3782c7694bb9f7c435 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
@@ -120,7 +120,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
@@ -126,7 +126,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
if (nbt.hasUUID("Owner")) {
|
||||
this.ownerUUID = nbt.getUUID("Owner");
|
||||
this.cachedOwner = null;
|
||||
@@ -130,10 +117,10 @@ index 9c72271382fa0b6be5f38b45577fb1ae81ce80a3..a9fda9cb7e8266c21aba70d5b1890b30
|
||||
entity.spawnReason == org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) {
|
||||
continue;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
index 592b330f187fb5eca51d60911bbebbaeaf46ef87..b08b7ffbcfbc6a12d74cadf878fd069f7a1345cb 100644
|
||||
index d9421224778c72f8f9db3c9044bc28c2423bb09d..82e8b560ee24ad262df4ad073e66cd129ccb7bb8 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
@@ -280,7 +280,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
@@ -295,7 +295,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
origItemStack.setCount(originalItemCount);
|
||||
}
|
||||
}
|
||||
@@ -142,7 +129,7 @@ index 592b330f187fb5eca51d60911bbebbaeaf46ef87..b08b7ffbcfbc6a12d74cadf878fd069f
|
||||
hopper.setCooldown(level.spigotConfig.hopperTransfer);
|
||||
}
|
||||
return false;
|
||||
@@ -321,7 +321,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
@@ -336,7 +336,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
}
|
||||
origItemStack.setCount(originalItemCount);
|
||||
|
||||
@@ -153,10 +140,10 @@ index 592b330f187fb5eca51d60911bbebbaeaf46ef87..b08b7ffbcfbc6a12d74cadf878fd069f
|
||||
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/util/McTechnicalModeHelper.java b/src/main/java/org/leavesmc/leaves/util/McTechnicalModeHelper.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..b6374842caec8c919839aaf403342208fa4b8f95
|
||||
index 0000000000000000000000000000000000000000..2fdcb75a1fb85ab2fc6759050b2e7ffa601dcfa0
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/util/McTechnicalModeHelper.java
|
||||
@@ -0,0 +1,26 @@
|
||||
@@ -0,0 +1,27 @@
|
||||
+package org.leavesmc.leaves.util;
|
||||
+
|
||||
+import io.papermc.paper.configuration.GlobalConfiguration;
|
||||
@@ -176,6 +163,7 @@ index 0000000000000000000000000000000000000000..b6374842caec8c919839aaf403342208
|
||||
+ GlobalConfiguration.get().unsupportedSettings.allowPistonDuplication = true;
|
||||
+ GlobalConfiguration.get().unsupportedSettings.allowHeadlessPistons = true;
|
||||
+ GlobalConfiguration.get().unsupportedSettings.allowPermanentBlockBreakExploits = true;
|
||||
+ GlobalConfiguration.get().unsupportedSettings.allowUnsafeEndPortalTeleportation = true;
|
||||
+ GlobalConfiguration.get().packetLimiter.allPackets = new GlobalConfiguration.PacketLimiter.PacketLimit(GlobalConfiguration.get().packetLimiter.allPackets.interval(),
|
||||
+ 5000.0, GlobalConfiguration.get().packetLimiter.allPackets.action());
|
||||
+ GlobalConfiguration.get().packetLimiter.overrides = Map.of();
|
||||
@@ -6,18 +6,10 @@ Subject: [PATCH] Return nether portal fix
|
||||
This patch is powered by NetherPortalFix(https://github.com/TwelveIterationMods/NetherPortalFix)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 05ee5e0bcefc25b771eac20e53a7b7a3e0fed944..622e19594039b7fd0841221664c27426b10768cd 100644
|
||||
index 8a5fbcdbef5d8e14ca09f6a23a19860d92258a5c..8d54ab1d3091817c38f3ae8691a3686ad1ac01dc 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -19,6 +19,7 @@ import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.BlockUtil;
|
||||
+import org.leavesmc.leaves.util.ReturnPortalManager;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.CrashReport;
|
||||
import net.minecraft.CrashReportCategory;
|
||||
@@ -1371,6 +1372,24 @@ public class ServerPlayer extends Player {
|
||||
@@ -1436,6 +1436,21 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld());
|
||||
this.level().getCraftServer().getPluginManager().callEvent(changeEvent);
|
||||
// CraftBukkit end
|
||||
@@ -28,66 +20,24 @@ index 05ee5e0bcefc25b771eac20e53a7b7a3e0fed944..622e19594039b7fd0841221664c27426
|
||||
+ final ResourceKey<Level> OVERWORLD = Level.OVERWORLD;
|
||||
+ final ResourceKey<Level> THE_NETHER = Level.NETHER;
|
||||
+ if (!((fromDim != OVERWORLD || toDim != THE_NETHER) && (fromDim != THE_NETHER || toDim != OVERWORLD))) {
|
||||
+ BlockPos lastPos = this.lastPos;
|
||||
+ if (lastPos != null) {
|
||||
+ BlockUtil.FoundRectangle fromPortal = ReturnPortalManager.findPortalAt(this, fromDim, lastPos);
|
||||
+ BlockPos toPos = this.blockPosition();
|
||||
+ if (fromPortal != null) {
|
||||
+ ReturnPortalManager.storeReturnPortal(this, toDim, toPos, fromPortal);
|
||||
+ }
|
||||
+ BlockPos fromPortal = org.leavesmc.leaves.util.ReturnPortalManager.findPortalAt(this, fromDim, lastPos);
|
||||
+ BlockPos toPos = this.blockPosition();
|
||||
+ if (fromPortal != null) {
|
||||
+ org.leavesmc.leaves.util.ReturnPortalManager.storeReturnPortal(this, toDim, toPos, fromPortal);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Leaves end - nether portal fix
|
||||
}
|
||||
// Paper start - Reset shield blocking on dimension change
|
||||
if (this.isBlocking()) {
|
||||
@@ -1423,6 +1442,30 @@ public class ServerPlayer extends Player {
|
||||
protected Optional<BlockUtil.FoundRectangle> getExitPortal(ServerLevel worldserver, BlockPos blockposition, boolean flag, WorldBorder worldborder, int searchRadius, boolean canCreatePortal, int createRadius) { // CraftBukkit
|
||||
Optional<BlockUtil.FoundRectangle> optional = super.getExitPortal(worldserver, blockposition, flag, worldborder, searchRadius, canCreatePortal, createRadius); // CraftBukkit
|
||||
|
||||
+ // Leaves start - nether portal fix
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.netherPortalFix) {
|
||||
+ BlockPos fromPos = blockPosition();
|
||||
+ final ResourceKey<Level> fromDim = level().dimension();
|
||||
+ final ResourceKey<Level> toDim = level().dimension();
|
||||
+ final ResourceKey<Level> OVERWORLD = Level.OVERWORLD;
|
||||
+ final ResourceKey<Level> THE_NETHER = Level.NETHER;
|
||||
+ boolean isTeleportBetweenNetherAndOverworld = (fromDim == OVERWORLD && toDim == THE_NETHER)
|
||||
+ || (fromDim == THE_NETHER && toDim == OVERWORLD);
|
||||
+ if (isInsidePortal && isTeleportBetweenNetherAndOverworld) {
|
||||
+ ReturnPortalManager.ReturnPortal returnPortal = ReturnPortalManager.findReturnPortal(this, fromDim, fromPos);
|
||||
+ if (returnPortal != null) {
|
||||
+ MinecraftServer server = getServer();
|
||||
+ if (server != null) {
|
||||
+ Level toLevel = server.getLevel(toDim);
|
||||
+ if (toLevel != null) {
|
||||
+ return Optional.of(returnPortal.rectangle());
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Leaves end - nether portal fix
|
||||
+
|
||||
if (optional.isPresent() || !canCreatePortal) { // CraftBukkit
|
||||
return optional;
|
||||
} else {
|
||||
// Paper start - Reset shield blocking on dimension change
|
||||
if (this.isBlocking()) {
|
||||
this.stopUsingItem();
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 00809b615f65b2f4985856673430d8ba68525765..a65aede101004f23f76ce08781ab0a94d4c9113e 100644
|
||||
index 4f3ae7cf3294583b738482964b78ebf2bd65cbbf..f16d0a072ca78ddf3eeb3a483a73869e47ed8ce1 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -26,6 +26,7 @@ import java.util.function.Predicate;
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.FileUtil;
|
||||
+import org.leavesmc.leaves.util.ReturnPortalManager; // Leaves - return portal fix
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.LayeredRegistryAccess;
|
||||
@@ -1003,6 +1004,24 @@ public abstract class PlayerList {
|
||||
if (fromWorld != location.getWorld()) {
|
||||
PlayerChangedWorldEvent event = new PlayerChangedWorldEvent(entityplayer.getBukkitEntity(), fromWorld);
|
||||
@@ -940,6 +940,24 @@ public abstract class PlayerList {
|
||||
if (fromWorld != worldserver) {
|
||||
PlayerChangedWorldEvent event = new PlayerChangedWorldEvent(entityplayer.getBukkitEntity(), fromWorld.getWorld());
|
||||
this.server.server.getPluginManager().callEvent(event);
|
||||
+ // Leaves start - nether portal fix
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.netherPortalFix) {
|
||||
@@ -111,10 +61,10 @@ index 00809b615f65b2f4985856673430d8ba68525765..a65aede101004f23f76ce08781ab0a94
|
||||
|
||||
// Save player file again if they were disconnected
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index ef3e4667d0d38e19a595f83bf93af7a9f1ab4c13..9c7fdcd820fa40aa3f0b8fcebc103cbfe7e27450 100644
|
||||
index 8af682d4aebbbd02816a5eb0a62d6ccfc8c1e6ff..0c3e98a478de9524354ad5e3a02f8268b88d7083 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -251,7 +251,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -260,7 +260,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
protected ItemStack useItem;
|
||||
public int useItemRemaining;
|
||||
protected int fallFlyTicks;
|
||||
@@ -123,15 +73,38 @@ index ef3e4667d0d38e19a595f83bf93af7a9f1ab4c13..9c7fdcd820fa40aa3f0b8fcebc103cbf
|
||||
private Optional<BlockPos> lastClimbablePos;
|
||||
@Nullable
|
||||
private DamageSource lastDamageSource;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
|
||||
index ddab7de1d376e9e486e2f920174397ea8804aa29..73b6e6f24852370268bdcb0b06027daa119b5091 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
|
||||
@@ -172,7 +172,18 @@ public class NetherPortalBlock extends Block implements Portal {
|
||||
|
||||
@Nullable
|
||||
private DimensionTransition getExitPortal(ServerLevel worldserver, Entity entity, BlockPos blockposition, BlockPos blockposition1, boolean flag, WorldBorder worldborder, int searchRadius, boolean canCreatePortal, int createRadius) {
|
||||
- Optional<BlockPos> optional = worldserver.getPortalForcer().findClosestPortalPosition(blockposition1, worldborder, searchRadius);
|
||||
+ // Leaves start - fix return portal
|
||||
+ Optional<BlockPos> optional = Optional.empty();
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.netherPortalFix && entity instanceof net.minecraft.server.level.ServerPlayer player) {
|
||||
+ org.leavesmc.leaves.util.ReturnPortalManager.ReturnPortal portal = org.leavesmc.leaves.util.ReturnPortalManager.findReturnPortal(player, entity.level().dimension(), entity.blockPosition());
|
||||
+ if (portal != null && worldserver.getBlockState(portal.pos()).is(Blocks.NETHER_PORTAL)) {
|
||||
+ optional = Optional.of(portal.pos());
|
||||
+ }
|
||||
+ }
|
||||
+ if (optional.isEmpty()) {
|
||||
+ optional = worldserver.getPortalForcer().findClosestPortalPosition(blockposition1, worldborder, searchRadius);
|
||||
+ }
|
||||
+ // Leaves end - fix return portal
|
||||
BlockUtil.FoundRectangle blockutil_rectangle;
|
||||
DimensionTransition.PostDimensionTransition dimensiontransition_a;
|
||||
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/util/ReturnPortalManager.java b/src/main/java/org/leavesmc/leaves/util/ReturnPortalManager.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..d7066d268e7a3b4b2c1b1ef28491078997989d4c
|
||||
index 0000000000000000000000000000000000000000..67eb48e5b30d1dfa93aacbeb31f1b650b5ecb763
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/util/ReturnPortalManager.java
|
||||
@@ -0,0 +1,105 @@
|
||||
@@ -0,0 +1,98 @@
|
||||
+package org.leavesmc.leaves.util;
|
||||
+
|
||||
+import net.minecraft.BlockUtil;
|
||||
+import net.minecraft.core.BlockPos;
|
||||
+import net.minecraft.core.registries.Registries;
|
||||
+import net.minecraft.nbt.CompoundTag;
|
||||
@@ -157,17 +130,15 @@ index 0000000000000000000000000000000000000000..d7066d268e7a3b4b2c1b1ef284910789
|
||||
+ private static final String RETURN_PORTAL_UID = "UID";
|
||||
+ private static final String FROM_DIM = "FromDim";
|
||||
+ private static final String FROM_POS = "FromPos";
|
||||
+ private static final String TO_MIN_CORNER = "ToMinCorner";
|
||||
+ private static final String TO_AXIS_1_SIZE = "ToAxis1Size";
|
||||
+ private static final String TO_AXIS_2_SIZE = "ToAxis2Size";
|
||||
+ private static final String TO_POS = "ToPos";
|
||||
+
|
||||
+ public static BlockUtil.FoundRectangle findPortalAt(Player player, ResourceKey<Level> dim, BlockPos pos) {
|
||||
+ public static BlockPos findPortalAt(Player player, ResourceKey<Level> dim, BlockPos pos) {
|
||||
+ MinecraftServer server = player.level().getServer();
|
||||
+ if (server != null) {
|
||||
+ ServerLevel fromWorld = server.getLevel(dim);
|
||||
+ if (fromWorld != null) {
|
||||
+ PortalForcer portalForcer = fromWorld.getPortalForcer();
|
||||
+ return portalForcer.findPortalAround(pos, false, fromWorld.getWorldBorder()).orElse(null);
|
||||
+ return portalForcer.findClosestPortalPosition(pos, false, fromWorld.getWorldBorder()).orElse(null);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -186,15 +157,13 @@ index 0000000000000000000000000000000000000000..d7066d268e7a3b4b2c1b1ef284910789
|
||||
+ ListTag portalList = getPlayerPortalList(player);
|
||||
+ for (Tag entry : portalList) {
|
||||
+ CompoundTag portal = (CompoundTag) entry;
|
||||
+ ResourceKey<Level> entryFromDim = ResourceKey.create(Registries.DIMENSION, new ResourceLocation(portal.getString(FROM_DIM)));
|
||||
+ ResourceKey<Level> entryFromDim = ResourceKey.create(Registries.DIMENSION, ResourceLocation.parse(portal.getString(FROM_DIM)));
|
||||
+ if (entryFromDim == fromDim) {
|
||||
+ BlockPos portalTrigger = BlockPos.of(portal.getLong(FROM_POS));
|
||||
+ if (portalTrigger.distSqr(fromPos) <= MAX_PORTAL_DISTANCE_SQ) {
|
||||
+ UUID uid = portal.hasUUID(RETURN_PORTAL_UID) ? portal.getUUID(RETURN_PORTAL_UID) : UUID.randomUUID();
|
||||
+ BlockPos minCorner = BlockPos.of(portal.getLong(TO_MIN_CORNER));
|
||||
+ int axis1Size = portal.getInt(TO_AXIS_1_SIZE);
|
||||
+ int axis2Size = portal.getInt(TO_AXIS_2_SIZE);
|
||||
+ return new ReturnPortal(uid, new BlockUtil.FoundRectangle(minCorner, axis1Size, axis2Size));
|
||||
+ final var uid = portal.hasUUID(RETURN_PORTAL_UID) ? portal.getUUID(RETURN_PORTAL_UID) : UUID.randomUUID();
|
||||
+ final var pos = BlockPos.of(portal.getLong(TO_POS));
|
||||
+ return new ReturnPortal(uid, pos);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
@@ -202,7 +171,7 @@ index 0000000000000000000000000000000000000000..d7066d268e7a3b4b2c1b1ef284910789
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ public static void storeReturnPortal(ServerPlayer player, ResourceKey<Level> fromDim, BlockPos fromPos, BlockUtil.FoundRectangle toPortal) {
|
||||
+ public static void storeReturnPortal(ServerPlayer player, ResourceKey<Level> fromDim, BlockPos fromPos, BlockPos toPos) {
|
||||
+ ListTag portalList = getPlayerPortalList(player);
|
||||
+ ReturnPortal returnPortal = findReturnPortal(player, fromDim, fromPos);
|
||||
+ if (returnPortal != null) {
|
||||
@@ -213,9 +182,7 @@ index 0000000000000000000000000000000000000000..d7066d268e7a3b4b2c1b1ef284910789
|
||||
+ portalCompound.putUUID(RETURN_PORTAL_UID, UUID.randomUUID());
|
||||
+ portalCompound.putString(FROM_DIM, String.valueOf(fromDim.location()));
|
||||
+ portalCompound.putLong(FROM_POS, fromPos.asLong());
|
||||
+ portalCompound.putLong(TO_MIN_CORNER, toPortal.minCorner.asLong());
|
||||
+ portalCompound.putInt(TO_AXIS_1_SIZE, toPortal.axis1Size);
|
||||
+ portalCompound.putInt(TO_AXIS_2_SIZE, toPortal.axis2Size);
|
||||
+ portalCompound.putLong(TO_POS, toPos.asLong());
|
||||
+ portalList.add(portalCompound);
|
||||
+ }
|
||||
+
|
||||
@@ -224,13 +191,13 @@ index 0000000000000000000000000000000000000000..d7066d268e7a3b4b2c1b1ef284910789
|
||||
+ ListTag portalList = getPlayerPortalList(player);
|
||||
+ for (int i = 0; i < portalList.size(); i++) {
|
||||
+ CompoundTag entry = (CompoundTag) portalList.get(i);
|
||||
+ if (entry.hasUUID(RETURN_PORTAL_UID) && entry.getUUID(RETURN_PORTAL_UID).equals(portal.uid())) {
|
||||
+ if (entry.hasUUID(RETURN_PORTAL_UID) && entry.getUUID(RETURN_PORTAL_UID).equals(portal.uid)) {
|
||||
+ portalList.remove(i);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public record ReturnPortal(UUID uid, BlockUtil.FoundRectangle rectangle) {
|
||||
+ public record ReturnPortal(UUID uid, BlockPos pos) {
|
||||
+ }
|
||||
+}
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Xaero Map Protocol
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index a65aede101004f23f76ce08781ab0a94d4c9113e..c9e904ab960739c5b64f44ef92e3a02159149e66 100644
|
||||
index f16d0a072ca78ddf3eeb3a483a73869e47ed8ce1..5c47209505af8e9bea3f20effa4e176c32e5109a 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1322,6 +1322,7 @@ public abstract class PlayerList {
|
||||
@@ -1262,6 +1262,7 @@ public abstract class PlayerList {
|
||||
player.connection.send(new ClientboundInitializeBorderPacket(worldborder));
|
||||
player.connection.send(new ClientboundSetTimePacket(world.getGameTime(), world.getDayTime(), world.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)));
|
||||
player.connection.send(new ClientboundSetDefaultSpawnPositionPacket(world.getSharedSpawnPos(), world.getSharedSpawnAngle()));
|
||||
@@ -44,10 +44,10 @@ index 244a19ecd0234fa1d7a6ecfea20751595688605d..7a1f7714616913cbb9d2dfc017567895
|
||||
String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName);
|
||||
LevelStorageSource convertable = LevelStorageSource.createDefault(file.toPath());
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index b22d0b0a2cb7e877875739abd87a3beac977c82a..b55cde303e18898ec791eb6d529ed4434ae70675 100644
|
||||
index 8806c9612e81f53241f5f16663aa781b8e03a98f..bbea145c85a6c96e44bb174c5a3d1f54705ff4c9 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -259,7 +259,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -265,7 +265,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
private boolean isDemo;
|
||||
private volatile boolean isReady;
|
||||
private long lastOverloadWarningNanos;
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Use vanilla random config
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 57edf910b4a1997f680896c050a192d01aef36bf..bff5bdd0ea231c889fd8bab4f68b5bcbdcda2190 100644
|
||||
index 0653267c90fef463fa94f784012214809bc8c930..0bf2a2a5ccb558632c70d77b852167c3c90e5f49 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -579,7 +579,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -539,7 +539,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
this.bb = Entity.INITIAL_AABB;
|
||||
this.stuckSpeedMultiplier = Vec3.ZERO;
|
||||
this.nextStep = 1.0F;
|
||||
@@ -18,10 +18,10 @@ index 57edf910b4a1997f680896c050a192d01aef36bf..bff5bdd0ea231c889fd8bab4f68b5bcb
|
||||
this.fluidHeight = new Object2DoubleArrayMap(2);
|
||||
this.fluidOnEyes = new HashSet();
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
index 0dfb8109fd8c022b079da00f6a0e3fc85b57bf7a..3c9560b63e77059ea32ccf7844817d2d22881162 100644
|
||||
index 1b3978f4ea7e8491e0c0cb6de23c141f44fab414..024ca6a445e5a29fdf5636ff1b4770d4c62f8615 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
@@ -1018,7 +1018,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -1029,7 +1029,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
|
||||
BeeGoToHiveGoal() {
|
||||
super();
|
||||
@@ -31,10 +31,10 @@ index 0dfb8109fd8c022b079da00f6a0e3fc85b57bf7a..3c9560b63e77059ea32ccf7844817d2d
|
||||
this.setFlags(EnumSet.of(Goal.Flag.MOVE));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Squid.java b/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
||||
index 43b4ea96c5c4a6234e5b83d41db9b85c1fe27b8f..7e5294d856a757e55fe873d92d1de00a6a7b570e 100644
|
||||
index 42f4e544fe7fbc342f15eacb5e38d40849e3c419..0bd9ee3d0b546564a069f4aaf7a33e35bfa13ad8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
||||
@@ -42,7 +42,7 @@ public class Squid extends WaterAnimal {
|
||||
@@ -41,7 +41,7 @@ public class Squid extends WaterAnimal {
|
||||
|
||||
public Squid(EntityType<? extends Squid> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -44,10 +44,10 @@ index 43b4ea96c5c4a6234e5b83d41db9b85c1fe27b8f..7e5294d856a757e55fe873d92d1de00a
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
index d3fa592892fc72c8fc8f23e8e477eb88902bba16..1bb762349c868e6a68b46366710dbbee60466eaf 100644
|
||||
index 38c2e27343d68d016621cf953222b915b56a0df2..a1d4d8b6fe488a7056c6613acbd35d3be71ae039 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -78,7 +78,13 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
@@ -79,7 +79,13 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
// Paper start - Don't use level random in entity constructors (to make them thread-safe)
|
||||
this(EntityType.ITEM, world);
|
||||
this.setPos(x, y, z);
|
||||
@@ -63,10 +63,10 @@ index d3fa592892fc72c8fc8f23e8e477eb88902bba16..1bb762349c868e6a68b46366710dbbee
|
||||
// Paper end - Don't use level random in entity constructors
|
||||
// Leaves start - stackable shulker boxes
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||
index eb9529b4bf20f828fd7e8abf6895baf0c7900dcc..248a94f366d9fb30112c65d151b19879c684b803 100644
|
||||
index 8d494b549abb452bb554220060cc9c5beec5edf6..ac05fe9a17f67a4cb12cdb9c381896d7bb0b3f6a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
||||
@@ -42,7 +42,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||
@@ -62,7 +62,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||
public PrimedTnt(Level world, double x, double y, double z, @Nullable LivingEntity igniter) {
|
||||
this(EntityType.TNT, world);
|
||||
this.setPos(x, y, z);
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix update suppression crash
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
||||
index d6daa27a8d7aca00b181e90d789f4249e8437d29..61b0e26a34bf94b10ce0ac78a662d5e97ad4cc9a 100644
|
||||
index f7197f1347251a37dd0f6d9ffa2f09bc3a4e1233..8909f4f65864935f86608b0e00149c57833395aa 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
||||
@@ -52,6 +52,10 @@ public class PacketUtils {
|
||||
@@ -33,6 +33,10 @@ public class PacketUtils {
|
||||
if (listener.shouldHandleMessage(packet)) {
|
||||
try {
|
||||
packet.handle(listener);
|
||||
@@ -20,10 +20,10 @@ index d6daa27a8d7aca00b181e90d789f4249e8437d29..61b0e26a34bf94b10ce0ac78a662d5e9
|
||||
if (exception instanceof ReportedException) {
|
||||
ReportedException reportedexception = (ReportedException) exception;
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index b55cde303e18898ec791eb6d529ed4434ae70675..aa7f001a3f75f7981e8aa27d24041d9a2e0493db 100644
|
||||
index bbea145c85a6c96e44bb174c5a3d1f54705ff4c9..7dc6b8096379360c9a32ae66c5bfde9d2612f3cb 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1756,7 +1756,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1777,7 +1777,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.profiler.push("tick");
|
||||
|
||||
try {
|
||||
@@ -35,11 +35,11 @@ index b55cde303e18898ec791eb6d529ed4434ae70675..aa7f001a3f75f7981e8aa27d24041d9a
|
||||
+ org.leavesmc.leaves.LeavesLogger.LOGGER.info(e.getMessage());
|
||||
+ }
|
||||
+ // Leaves end
|
||||
// Paper start
|
||||
for (final io.papermc.paper.chunk.SingleThreadChunkRegionManager regionManager : worldserver.getChunkSource().chunkMap.regionManagers) {
|
||||
regionManager.recalculateRegions();
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
||||
index 68431244432a4342041e63218cf7d1eb4eb7ebc0..aeb0577abcc0790edaece34939a6756424610dbc 100644
|
||||
index 40518b1a58494525223e47845b4cb57c92a22d5e..4a0617f7b5f528421620ad504467212b7042716f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
||||
@@ -231,7 +231,17 @@ public class ShulkerBoxBlock extends BaseEntityBlock {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Bedrock break list
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index aa7f001a3f75f7981e8aa27d24041d9a2e0493db..658ac73c319683cf8d74d4af8e2a3fca418bd71c 100644
|
||||
index 7dc6b8096379360c9a32ae66c5bfde9d2612f3cb..1a5c7e8473c8d183080f6995c2c76487d7ff5a68 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1793,6 +1793,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1809,6 +1809,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handleTick(); // Leaves - protocol
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Fix trapdoor feature
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java b/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java
|
||||
index 2b5fdcb12dcd8730df24113b9a6d295f000dd9f6..527a77b96a06098aaa4adac5ed46b45851bba00b 100644
|
||||
index 336fcf4af0ffb416b5595a9e65172f36cc36aaa3..b6c8c4af91f9ca2288e97b9402ec88d56385e75d 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java
|
||||
@@ -153,6 +153,8 @@ public class TrapDoorBlock extends HorizontalDirectionalBlock implements SimpleW
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Disable distance check for UseItemOnPacket
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 4ae88bfcead40cd05f9514a48a922a37767cb3cf..d833c9da7b5132485a450bb752bd988ee91e4cf1 100644
|
||||
index 7796e191747be545e744564a2b0b65790f69114d..bef88d547aefa9c5b701aa91ffc58114309a7db7 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1920,7 +1920,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1860,7 +1860,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
Vec3 vec3d1 = vec3d.subtract(Vec3.atCenterOf(blockposition));
|
||||
double d0 = 1.0000001D;
|
||||
|
||||
@@ -5,24 +5,16 @@ Subject: [PATCH] No feather falling trample
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/FarmBlock.java b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
index d59e33e7326489c6d55d316d0130f22235f4c63c..79ef9b8bd2905d4ca3562971823a9bf48e60a038 100644
|
||||
index d59e33e7326489c6d55d316d0130f22235f4c63c..e48b1b7dbfb5d6914420bce0565108c34342922b 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
@@ -14,6 +14,7 @@ import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
+import net.minecraft.world.item.enchantment.Enchantments;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.level.Level;
|
||||
@@ -112,6 +113,13 @@ public class FarmBlock extends Block {
|
||||
@@ -112,6 +112,13 @@ public class FarmBlock extends Block {
|
||||
public void fallOn(Level world, BlockState state, BlockPos pos, Entity entity, float fallDistance) {
|
||||
super.fallOn(world, state, pos, entity, fallDistance); // CraftBukkit - moved here as game rules / events shouldn't affect fall damage.
|
||||
if (!world.isClientSide && world.random.nextFloat() < fallDistance - 0.5F && entity instanceof LivingEntity && (entity instanceof Player || world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) && entity.getBbWidth() * entity.getBbWidth() * entity.getBbHeight() > 0.512F) {
|
||||
+ // Leaves start - noFeatherFallingTrample
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.noFeatherFallingTrample) {
|
||||
+ if (net.minecraft.world.item.enchantment.EnchantmentHelper.getEnchantmentLevel(Enchantments.FEATHER_FALLING, (LivingEntity) entity) > 0) {
|
||||
+ if (net.minecraft.world.item.enchantment.EnchantmentHelper.getEnchantmentLevel(world.registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.ENCHANTMENT).getHolder(net.minecraft.world.item.enchantment.Enchantments.FEATHER_FALLING).get(), (LivingEntity) entity) > 0) {
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
@@ -1,15 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MC_XiaoHei <xiaohei.xor7studio@foxmail.com>
|
||||
Date: Wed, 8 May 2024 22:26:38 +0800
|
||||
Subject: [PATCH] Placeholder for Syncmatica-Protocol
|
||||
|
||||
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index 3811c0d849a3eb028ed1a6b7a2d4747f7f570448..1ad93453221244f880855b510e888e759275b640 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -46,3 +46,4 @@ dependency-reduced-pom.xml
|
||||
# vs code
|
||||
/.vscode
|
||||
/.factorypath
|
||||
+
|
||||
@@ -6,18 +6,18 @@ Subject: [PATCH] Syncmatica Protocol
|
||||
This patch is Powered by Syncmatica(https://github.com/End-Tech/syncmatica)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 98b0cee150e9e27e6bafc7c2afc9d5008ca8ef82..2d388dcafc02a04348a1c07d970b7a8bb8fdf014 100644
|
||||
index bef88d547aefa9c5b701aa91ffc58114309a7db7..51a1be78de7a794d13b64db6958977e2e9d20553 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -312,6 +312,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -314,6 +314,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
Objects.requireNonNull(server);
|
||||
this.signedMessageDecoder = SignedMessageChain.Decoder.unsigned(uuid, server::enforceSecureProfile);
|
||||
this.chatMessageChain = new FutureChain(server.chatExecutor); // CraftBukkit - async chat
|
||||
+ this.exchangeTarget = new org.leavesmc.leaves.protocol.syncmatica.exchange.ExchangeTarget(this); // Leaves - Syncmatica Protocol
|
||||
}
|
||||
|
||||
// CraftBukkit start - add fields
|
||||
@@ -330,6 +331,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
// CraftBukkit start - add fields and methods
|
||||
@@ -332,6 +333,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
private boolean justTeleported = false;
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -28,10 +28,10 @@ index 98b0cee150e9e27e6bafc7c2afc9d5008ca8ef82..2d388dcafc02a04348a1c07d970b7a8b
|
||||
if (this.ackBlockChangesUpTo > -1) {
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/CommunicationManager.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/CommunicationManager.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..4c2aa74795b0883f280eaa721a83ea6891ffdab2
|
||||
index 0000000000000000000000000000000000000000..8c0fd40a89681ef71d9dd2ad63d858e1aad82ceb
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/CommunicationManager.java
|
||||
@@ -0,0 +1,391 @@
|
||||
@@ -0,0 +1,397 @@
|
||||
+package org.leavesmc.leaves.protocol.syncmatica;
|
||||
+
|
||||
+import com.mojang.authlib.GameProfile;
|
||||
@@ -39,13 +39,12 @@ index 0000000000000000000000000000000000000000..4c2aa74795b0883f280eaa721a83ea68
|
||||
+import net.minecraft.core.BlockPos;
|
||||
+import net.minecraft.network.FriendlyByteBuf;
|
||||
+import net.minecraft.network.chat.Component;
|
||||
+import net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket;
|
||||
+import net.minecraft.resources.ResourceLocation;
|
||||
+import net.minecraft.server.level.ServerPlayer;
|
||||
+import net.minecraft.server.network.ServerGamePacketListenerImpl;
|
||||
+import net.minecraft.world.level.block.Mirror;
|
||||
+import net.minecraft.world.level.block.Rotation;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.leavesmc.leaves.LeavesConfig;
|
||||
+import org.leavesmc.leaves.protocol.core.LeavesProtocol;
|
||||
+import org.leavesmc.leaves.protocol.core.LeavesProtocolManager;
|
||||
+import org.leavesmc.leaves.protocol.core.ProtocolHandler;
|
||||
@@ -102,6 +101,9 @@ index 0000000000000000000000000000000000000000..4c2aa74795b0883f280eaa721a83ea68
|
||||
+
|
||||
+ @ProtocolHandler.PlayerJoin
|
||||
+ public static void onPlayerJoin(ServerPlayer player) {
|
||||
+ if (!LeavesConfig.syncmaticaProtocol) {
|
||||
+ return;
|
||||
+ }
|
||||
+ final ExchangeTarget newPlayer = player.connection.exchangeTarget;
|
||||
+ final VersionHandshakeServer hi = new VersionHandshakeServer(newPlayer);
|
||||
+ playerMap.put(newPlayer, player);
|
||||
@@ -112,6 +114,9 @@ index 0000000000000000000000000000000000000000..4c2aa74795b0883f280eaa721a83ea68
|
||||
+
|
||||
+ @ProtocolHandler.PlayerLeave
|
||||
+ public static void onPlayerLeave(ServerPlayer player) {
|
||||
+ if (!LeavesConfig.syncmaticaProtocol) {
|
||||
+ return;
|
||||
+ }
|
||||
+ final ExchangeTarget oldPlayer = player.connection.exchangeTarget;
|
||||
+ final Collection<Exchange> potentialMessageTarget = oldPlayer.getExchanges();
|
||||
+ if (potentialMessageTarget != null) {
|
||||
@@ -124,8 +129,11 @@ index 0000000000000000000000000000000000000000..4c2aa74795b0883f280eaa721a83ea68
|
||||
+ playerMap.remove(oldPlayer);
|
||||
+ }
|
||||
+
|
||||
+ @ProtocolHandler.PayloadReceiver(payload = LeavesProtocolManager.LeavesPayload.class, ignoreId = true, payloadId = "")
|
||||
+ @ProtocolHandler.PayloadReceiver(payload = LeavesProtocolManager.LeavesPayload.class, ignoreId = true)
|
||||
+ public static void onPacketGet(ServerPlayer player, LeavesProtocolManager.LeavesPayload payload) {
|
||||
+ if (!LeavesConfig.syncmaticaProtocol) {
|
||||
+ return;
|
||||
+ }
|
||||
+ onPacket(player.connection.exchangeTarget, payload.id(), payload.data());
|
||||
+ }
|
||||
+
|
||||
@@ -266,9 +274,7 @@ index 0000000000000000000000000000000000000000..4c2aa74795b0883f280eaa721a83ea68
|
||||
+ final FriendlyByteBuf buf = new FriendlyByteBuf(Unpooled.buffer());
|
||||
+ buf.writeUUID(placement.getId());
|
||||
+ client.sendPacket(PacketType.REMOVE_SYNCMATIC.identifier, buf);
|
||||
+ final FriendlyByteBuf buf2 = new FriendlyByteBuf(Unpooled.buffer());
|
||||
+ putMetaData(placement, buf2, client);
|
||||
+ client.sendPacket(PacketType.REGISTER_METADATA.identifier, buf2);
|
||||
+ sendMetaData(placement, client);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
@@ -425,7 +431,7 @@ index 0000000000000000000000000000000000000000..4c2aa74795b0883f280eaa721a83ea68
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/Feature.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/Feature.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..1125755d7d78a118d1fe407e9ca554a89f4d9a9a
|
||||
index 0000000000000000000000000000000000000000..7cb3465b88411c46e79ce661ac7a4bddcf5b33e2
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/Feature.java
|
||||
@@ -0,0 +1,23 @@
|
||||
@@ -454,7 +460,7 @@ index 0000000000000000000000000000000000000000..1125755d7d78a118d1fe407e9ca554a8
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/FeatureSet.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/FeatureSet.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..3d851913e2016fcd384b6a8b1e91753cb8ea91ef
|
||||
index 0000000000000000000000000000000000000000..ddd0f498feb2ad62134ae15a3ddb21527f2f24bf
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/FeatureSet.java
|
||||
@@ -0,0 +1,67 @@
|
||||
@@ -527,7 +533,7 @@ index 0000000000000000000000000000000000000000..3d851913e2016fcd384b6a8b1e91753c
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/FileStorage.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/FileStorage.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..5dccbce7287fe436de9436f35a7d1ffcfc5d74ab
|
||||
index 0000000000000000000000000000000000000000..9139394e87e23190fbfdd82295314b0d50f1acca
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/FileStorage.java
|
||||
@@ -0,0 +1,80 @@
|
||||
@@ -613,7 +619,7 @@ index 0000000000000000000000000000000000000000..5dccbce7287fe436de9436f35a7d1ffc
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/LocalLitematicState.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/LocalLitematicState.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..82ffc8cbd1b488c8723693b685a91c2a4149fb47
|
||||
index 0000000000000000000000000000000000000000..299c57397371b368461a532d2eab695cf4f01fff
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/LocalLitematicState.java
|
||||
@@ -0,0 +1,24 @@
|
||||
@@ -643,7 +649,7 @@ index 0000000000000000000000000000000000000000..82ffc8cbd1b488c8723693b685a91c2a
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/MessageType.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/MessageType.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..04d785846be3670b741d90634f5f691899127835
|
||||
index 0000000000000000000000000000000000000000..b56ca12c650edd13dd7ff52e13c9d3aa465c32ec
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/MessageType.java
|
||||
@@ -0,0 +1,8 @@
|
||||
@@ -657,7 +663,7 @@ index 0000000000000000000000000000000000000000..04d785846be3670b741d90634f5f6918
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/PacketType.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/PacketType.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..8f3227d36da0a3055cc25e538437de58fd5730e3
|
||||
index 0000000000000000000000000000000000000000..36c87c5cc586ad247e9aed26518c890f884010ae
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/PacketType.java
|
||||
@@ -0,0 +1,30 @@
|
||||
@@ -693,7 +699,7 @@ index 0000000000000000000000000000000000000000..8f3227d36da0a3055cc25e538437de58
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/PlayerIdentifier.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/PlayerIdentifier.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..f9ba2a41ab1e0d50bf85fd024b6d29e65b3a5cf7
|
||||
index 0000000000000000000000000000000000000000..b5891b0b49173acfb1a94051b98cb03b7a5ec9cd
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/PlayerIdentifier.java
|
||||
@@ -0,0 +1,37 @@
|
||||
@@ -736,7 +742,7 @@ index 0000000000000000000000000000000000000000..f9ba2a41ab1e0d50bf85fd024b6d29e6
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/PlayerIdentifierProvider.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/PlayerIdentifierProvider.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..f4fc3bac20359ecf17a25d7b8e8f34cfebcf4b24
|
||||
index 0000000000000000000000000000000000000000..df2254edf89e17eec73a692577e77c613cd4c8e4
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/PlayerIdentifierProvider.java
|
||||
@@ -0,0 +1,46 @@
|
||||
@@ -788,7 +794,7 @@ index 0000000000000000000000000000000000000000..f4fc3bac20359ecf17a25d7b8e8f34cf
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/ServerPlacement.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/ServerPlacement.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..8c5bc7d6244d6ccd9a561030fff44ccdecc1ed5c
|
||||
index 0000000000000000000000000000000000000000..70759c9d3c01959169230503954f1f48c5392075
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/ServerPlacement.java
|
||||
@@ -0,0 +1,166 @@
|
||||
@@ -960,7 +966,7 @@ index 0000000000000000000000000000000000000000..8c5bc7d6244d6ccd9a561030fff44ccd
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/ServerPosition.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/ServerPosition.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..3f6ee21ce72943e11f8d924321eb286652c5c533
|
||||
index 0000000000000000000000000000000000000000..9775c6c42a253aaaf1ac7576dba3764c8593d7fe
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/ServerPosition.java
|
||||
@@ -0,0 +1,51 @@
|
||||
@@ -1017,7 +1023,7 @@ index 0000000000000000000000000000000000000000..3f6ee21ce72943e11f8d924321eb2866
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/SubRegionData.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/SubRegionData.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..6903c26742f5e10aa75f52b7abd5273e7116600b
|
||||
index 0000000000000000000000000000000000000000..22fdf92dd686a2dc573eb60cd4d9a08ba7faec5a
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/SubRegionData.java
|
||||
@@ -0,0 +1,90 @@
|
||||
@@ -1113,7 +1119,7 @@ index 0000000000000000000000000000000000000000..6903c26742f5e10aa75f52b7abd5273e
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/SubRegionPlacementModification.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/SubRegionPlacementModification.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0d67b562ed06f8de990c2f3d545e2839837f853d
|
||||
index 0000000000000000000000000000000000000000..a52e299be26d1ec13507dac8d68f7e5736117762
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/SubRegionPlacementModification.java
|
||||
@@ -0,0 +1,65 @@
|
||||
@@ -1184,7 +1190,7 @@ index 0000000000000000000000000000000000000000..0d67b562ed06f8de990c2f3d545e2839
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/SyncmaticManager.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/SyncmaticManager.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..9fbeef1ef528504276895faed4dba41ee0789e77
|
||||
index 0000000000000000000000000000000000000000..27a056b306daa91400946a30e68ce01d47089ac8
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/SyncmaticManager.java
|
||||
@@ -0,0 +1,108 @@
|
||||
@@ -1298,7 +1304,7 @@ index 0000000000000000000000000000000000000000..9fbeef1ef528504276895faed4dba41e
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/SyncmaticaProtocol.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/SyncmaticaProtocol.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..2f44c35e199205ac2a9430c68a6ada3ef92d5d38
|
||||
index 0000000000000000000000000000000000000000..d91c913a283cef1f152c23653d48a85c42f9655b
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/SyncmaticaProtocol.java
|
||||
@@ -0,0 +1,123 @@
|
||||
@@ -1427,7 +1433,7 @@ index 0000000000000000000000000000000000000000..2f44c35e199205ac2a9430c68a6ada3e
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/AbstractExchange.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/AbstractExchange.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..625974f9ce0791b476336abafa6aa1af2f2ffbac
|
||||
index 0000000000000000000000000000000000000000..b06ffeacf699b78f34253a26018ccdf723d5d0ce
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/AbstractExchange.java
|
||||
@@ -0,0 +1,66 @@
|
||||
@@ -1499,7 +1505,7 @@ index 0000000000000000000000000000000000000000..625974f9ce0791b476336abafa6aa1af
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/DownloadExchange.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/DownloadExchange.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..7303769570656f36a3a76215e22020b1292007fb
|
||||
index 0000000000000000000000000000000000000000..b0463dc8dc6f204cd48b73056dc4eb321e7ba602
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/DownloadExchange.java
|
||||
@@ -0,0 +1,125 @@
|
||||
@@ -1630,7 +1636,7 @@ index 0000000000000000000000000000000000000000..7303769570656f36a3a76215e22020b1
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/Exchange.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/Exchange.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..26482e63b7c24c80bdc111cea51b8d7b8052d64e
|
||||
index 0000000000000000000000000000000000000000..0f45ef7f4abcd7cff627e5a3df2a9fca8d6e7585
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/Exchange.java
|
||||
@@ -0,0 +1,20 @@
|
||||
@@ -1656,7 +1662,7 @@ index 0000000000000000000000000000000000000000..26482e63b7c24c80bdc111cea51b8d7b
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/ExchangeTarget.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/ExchangeTarget.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..706680a3d7fae22f94cb86b8da2e306cfcf4cb1b
|
||||
index 0000000000000000000000000000000000000000..1ce637d91f12f8fdd54fce38534861836b6a93ca
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/ExchangeTarget.java
|
||||
@@ -0,0 +1,40 @@
|
||||
@@ -1702,7 +1708,7 @@ index 0000000000000000000000000000000000000000..706680a3d7fae22f94cb86b8da2e306c
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/FeatureExchange.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/FeatureExchange.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..f92739dbfa00de0e078834818dab79e34fc3d245
|
||||
index 0000000000000000000000000000000000000000..45fc01915b18a47bcdf7a7ce55161266e5cd1221
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/FeatureExchange.java
|
||||
@@ -0,0 +1,48 @@
|
||||
@@ -1756,7 +1762,7 @@ index 0000000000000000000000000000000000000000..f92739dbfa00de0e078834818dab79e3
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/ModifyExchangeServer.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/ModifyExchangeServer.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..d87602fa78a8e599b71556f3dd103ff71ee83ae0
|
||||
index 0000000000000000000000000000000000000000..c691201f0af82c4ac19df27639b32637b7f46caf
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/ModifyExchangeServer.java
|
||||
@@ -0,0 +1,81 @@
|
||||
@@ -1843,7 +1849,7 @@ index 0000000000000000000000000000000000000000..d87602fa78a8e599b71556f3dd103ff7
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/UploadExchange.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/UploadExchange.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..9a1b37c69a3946b8f042a1118bf7dcf6ff0967ae
|
||||
index 0000000000000000000000000000000000000000..065a39942603f7b884cca40d8d7b4b47b46d7985
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/UploadExchange.java
|
||||
@@ -0,0 +1,101 @@
|
||||
@@ -1950,7 +1956,7 @@ index 0000000000000000000000000000000000000000..9a1b37c69a3946b8f042a1118bf7dcf6
|
||||
+}
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/VersionHandshakeServer.java b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/VersionHandshakeServer.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..448d5e8423347c0154a146906617e32e18fbc30f
|
||||
index 0000000000000000000000000000000000000000..9614fce87e2522690aac0af4c04d9fbcb72167af
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/leavesmc/leaves/protocol/syncmatica/exchange/VersionHandshakeServer.java
|
||||
@@ -0,0 +1,65 @@
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Despawn enderman with block
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
index 215176eb7152c11c4934c8576ac8c9fa9b2d0833..675a504ac428aaa130dc607bb8e759e156523f33 100644
|
||||
index 17a71bb3b65cc1030b70c931b1dc998d06713231..2a26fb795ca8d71f02d7d991dd28c34118266f02 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
@@ -469,7 +469,7 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||
@@ -471,7 +471,7 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||
|
||||
@Override
|
||||
public boolean requiresCustomPersistence() {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Creative fly no clip
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index 25595bef64199c4ddbe69c65fd149eec33e778ad..7f733ed26ada22c64897c4df84af6eb680d9a02f 100644
|
||||
index 54ba25632c2a9e1c93a5b3a0b92e5280864c49d6..eff9284b853f6771b6d44c851643621897e18a17 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -250,8 +250,8 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -251,8 +251,8 @@ public abstract class Player extends LivingEntity {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
@@ -19,7 +19,7 @@ index 25595bef64199c4ddbe69c65fd149eec33e778ad..7f733ed26ada22c64897c4df84af6eb6
|
||||
this.setOnGround(false);
|
||||
}
|
||||
|
||||
@@ -430,7 +430,7 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -435,7 +435,7 @@ public abstract class Player extends LivingEntity {
|
||||
|
||||
Pose entitypose1;
|
||||
|
||||
@@ -28,7 +28,7 @@ index 25595bef64199c4ddbe69c65fd149eec33e778ad..7f733ed26ada22c64897c4df84af6eb6
|
||||
if (this.canPlayerFitWithinBlocksAndEntitiesWhen(Pose.CROUCHING)) {
|
||||
entitypose1 = Pose.CROUCHING;
|
||||
} else {
|
||||
@@ -577,7 +577,7 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -581,7 +581,7 @@ public abstract class Player extends LivingEntity {
|
||||
}
|
||||
|
||||
this.bob += (f - this.bob) * 0.4F;
|
||||
@@ -37,7 +37,7 @@ index 25595bef64199c4ddbe69c65fd149eec33e778ad..7f733ed26ada22c64897c4df84af6eb6
|
||||
AABB axisalignedbb;
|
||||
|
||||
if (this.isPassenger() && !this.getVehicle().isRemoved()) {
|
||||
@@ -2099,6 +2099,21 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -2110,6 +2110,21 @@ public abstract class Player extends LivingEntity {
|
||||
@Override
|
||||
public abstract boolean isSpectator();
|
||||
|
||||
@@ -60,10 +60,10 @@ index 25595bef64199c4ddbe69c65fd149eec33e778ad..7f733ed26ada22c64897c4df84af6eb6
|
||||
public boolean canBeHitByProjectile() {
|
||||
return !this.isSpectator() && super.canBeHitByProjectile();
|
||||
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
index c21a65d9637739f1040dd27b096101a7a7adc0df..6dec706a2cadedfad0dff5e7784fe9bec65aad6c 100644
|
||||
index 2759a9eeef85b323b7e1ea78090f4f9d637c938a..4b044d76e803027bfc2df7dab9878eca01e62f5a 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
@@ -205,7 +205,7 @@ public class BlockItem extends Item {
|
||||
@@ -223,7 +223,7 @@ public class BlockItem extends Item {
|
||||
CollisionContext voxelshapecollision = entityhuman == null ? CollisionContext.empty() : CollisionContext.of(entityhuman);
|
||||
// CraftBukkit start - store default return
|
||||
Level world = context.getLevel(); // Paper - Cancel hit for vanished players
|
||||
@@ -86,7 +86,7 @@ index 0b761f3ae15ad4a3b8152f497a60403212109534..fdb2bb8a5e6c5d69692804adb086a2d4
|
||||
|
||||
BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(world, blockposition), player, CraftBlockData.fromData(iblockdata1), defaultReturn, org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(context.getHand())); // Paper - Expose hand in BlockCanBuildEvent
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||
index 0d68db20f5fbe5e834f12c1e8fd429099a44e4b6..193673d2b70035dac69422aaae185315a901effc 100644
|
||||
index 5b62860cd64b5e6dc02dadb4651824ac04b00024..6c23de5ebcfaf378b1ab97689e50add07d37ff03 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||
@@ -163,7 +163,7 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl
|
||||
@@ -98,27 +98,6 @@ index 0d68db20f5fbe5e834f12c1e8fd429099a44e4b6..193673d2b70035dac69422aaae185315
|
||||
entity.move(MoverType.SHULKER_BOX, new Vec3((axisalignedbb.getXsize() + 0.01D) * (double) enumdirection.getStepX(), (axisalignedbb.getYsize() + 0.01D) * (double) enumdirection.getStepY(), (axisalignedbb.getZsize() + 0.01D) * (double) enumdirection.getStepZ()));
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
index 93bd70c1dc2ba8b893a6087730071c81fb1132f4..4af071ff2d0a29ad9315e1076436f70f848c89b8 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.util.Mth;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntitySelector;
|
||||
+import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.entity.projectile.ThrownEnderpearl;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
@@ -117,7 +118,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
|
||||
}
|
||||
|
||||
public static boolean canEntityTeleport(Entity entity) {
|
||||
- return EntitySelector.NO_SPECTATORS.test(entity) && !entity.getRootVehicle().isOnPortalCooldown();
|
||||
+ return EntitySelector.NO_SPECTATORS.test(entity) && !entity.getRootVehicle().isOnPortalCooldown() && !(entity instanceof Player player && player.isCreativeFlyOrSpectator()); // Leaves - creative no clip
|
||||
}
|
||||
|
||||
public boolean isSpawning() {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
||||
index b35f476e26a020cf75e53a5eb488717d996a6935..73651a8ae9341807ec96300914d49329fb8a4e90 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
||||
@@ -18,18 +18,10 @@ index ee99519ebd46b1db3e76e7eb86e5cc121c867dc4..63f6f1328c4e39cc1f35480166ae5e22
|
||||
for (int j = 0; j < this.height; j++) {
|
||||
for (int k = 0; k < this.depth; k++) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
index 18a1b4325cac81b040596071dab99ef9bf6f3142..cc08fbadde12ad9f2193811f75628d4bd8d59a0f 100644
|
||||
index 18a1b4325cac81b040596071dab99ef9bf6f3142..478cba8137d153fe922ca7f402d306d8c12bcb31 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
@@ -45,6 +45,7 @@ import net.minecraft.world.entity.boss.enderdragon.phases.EnderDragonPhase;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
+import net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.TheEndPortalBlockEntity;
|
||||
import net.minecraft.world.level.block.state.pattern.BlockInWorld;
|
||||
import net.minecraft.world.level.block.state.pattern.BlockPattern;
|
||||
@@ -289,8 +290,67 @@ public class EndDragonFight {
|
||||
@@ -289,8 +289,67 @@ public class EndDragonFight {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -46,7 +38,7 @@ index 18a1b4325cac81b040596071dab99ef9bf6f3142..cc08fbadde12ad9f2193811f75628d4b
|
||||
+ for (j = cachePortalChunkIteratorZ; j <= 8; ++j) {
|
||||
+ LevelChunk worldChunk = this.level.getChunk(i, j);
|
||||
+ for (BlockEntity blockEntity : worldChunk.getBlockEntities().values()) {
|
||||
+ if (blockEntity instanceof TheEndGatewayBlockEntity) {
|
||||
+ if (blockEntity instanceof net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ if (blockEntity instanceof TheEndPortalBlockEntity) {
|
||||
@@ -97,7 +89,7 @@ index 18a1b4325cac81b040596071dab99ef9bf6f3142..cc08fbadde12ad9f2193811f75628d4b
|
||||
ChunkPos chunkcoordintpair = new ChunkPos(this.origin);
|
||||
|
||||
int i;
|
||||
@@ -619,6 +679,11 @@ public class EndDragonFight {
|
||||
@@ -619,6 +678,11 @@ public class EndDragonFight {
|
||||
}
|
||||
|
||||
public boolean respawnDragon(List<EndCrystal> list) { // CraftBukkit - return boolean
|
||||
@@ -5,52 +5,28 @@ Subject: [PATCH] Shave snow layers
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ShovelItem.java b/src/main/java/net/minecraft/world/item/ShovelItem.java
|
||||
index 24f6a158e4759aac3be8da4cf5e0d40bd295355b..8c15f74cc5f3c4dfc499e6bdab75f10f66ea36b1 100644
|
||||
index 24f6a158e4759aac3be8da4cf5e0d40bd295355b..97c3a9281ef10c88947febf152a005b0cd05cc64 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ShovelItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ShovelItem.java
|
||||
@@ -2,20 +2,25 @@ package net.minecraft.world.item;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.ImmutableMap.Builder;
|
||||
+
|
||||
import java.util.Map;
|
||||
+
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
+import net.minecraft.world.entity.EquipmentSlot;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.context.UseOnContext;
|
||||
+import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.CampfireBlock;
|
||||
+import net.minecraft.world.level.block.SnowLayerBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
|
||||
@@ -44,6 +49,24 @@ public class ShovelItem extends DiggerItem {
|
||||
@@ -44,6 +44,26 @@ public class ShovelItem extends DiggerItem {
|
||||
return InteractionResult.PASS;
|
||||
} else {
|
||||
Player player = context.getPlayer();
|
||||
+ // Leaves start - shaveSnowLayers
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.shaveSnowLayers && blockState.is(Blocks.SNOW)) {
|
||||
+ int layers = blockState.getValue(SnowLayerBlock.LAYERS);
|
||||
+ level.setBlock(blockPos, layers > 1 ? blockState.setValue(SnowLayerBlock.LAYERS, layers - 1) : Blocks.AIR.defaultBlockState(), 11);
|
||||
+ Block.popResource(level, blockPos, new ItemStack(EnchantmentHelper.hasSilkTouch(context.getItemInHand()) ? Items.SNOW : Items.SNOWBALL));
|
||||
+ int layers = blockState.getValue(net.minecraft.world.level.block.SnowLayerBlock.LAYERS);
|
||||
+ ItemStack tool = context.getItemInHand();
|
||||
+ boolean hasSilkTouch = net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(level.registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.ENCHANTMENT).getHolder(net.minecraft.world.item.enchantment.Enchantments.SILK_TOUCH).get(), tool) > 0;
|
||||
+ BlockState shavedBlockState = layers > 1 ? blockState.setValue(net.minecraft.world.level.block.SnowLayerBlock.LAYERS, layers - 1) : Blocks.AIR.defaultBlockState();
|
||||
+
|
||||
+ level.setBlock(blockPos, shavedBlockState, Block.UPDATE_ALL_IMMEDIATE);
|
||||
+ level.gameEvent(GameEvent.BLOCK_CHANGE, blockPos, GameEvent.Context.of(player, shavedBlockState));
|
||||
+
|
||||
+ Block.popResource(level, blockPos, new ItemStack(hasSilkTouch ? Items.SNOW : Items.SNOWBALL));
|
||||
+ level.playSound(player, blockPos, SoundEvents.SNOW_BREAK, SoundSource.BLOCKS, 1.0F, 1.0F);
|
||||
+
|
||||
+ if (player != null) {
|
||||
+ context.getItemInHand().hurtAndBreak(1, player.getRandom(), player, () ->
|
||||
+ player.broadcastBreakEvent(switch (context.getHand()) {
|
||||
+ case MAIN_HAND -> EquipmentSlot.MAINHAND;
|
||||
+ case OFF_HAND -> EquipmentSlot.OFFHAND;
|
||||
+ }));
|
||||
+ tool.hurtAndBreak(1, player, LivingEntity.getSlotForHand(context.getHand()));
|
||||
+ }
|
||||
+
|
||||
+ return InteractionResult.SUCCESS;
|
||||
@@ -59,7 +35,7 @@ index 24f6a158e4759aac3be8da4cf5e0d40bd295355b..8c15f74cc5f3c4dfc499e6bdab75f10f
|
||||
BlockState blockState2 = FLATTENABLES.get(blockState.getBlock());
|
||||
BlockState blockState3 = null;
|
||||
Runnable afterAction = null; // Paper
|
||||
@@ -52,11 +75,11 @@ public class ShovelItem extends DiggerItem {
|
||||
@@ -52,11 +72,11 @@ public class ShovelItem extends DiggerItem {
|
||||
blockState3 = blockState2;
|
||||
} else if (blockState.getBlock() instanceof CampfireBlock && blockState.getValue(CampfireBlock.LIT)) {
|
||||
afterAction = () -> { // Paper
|
||||
@@ -5,18 +5,10 @@ Subject: [PATCH] Spawn ignore lc
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
index a9fda9cb7e8266c21aba70d5b1890b30900a5b00..083a8a7dd99e447904dbac161dd3a1de663d6011 100644
|
||||
index a9fda9cb7e8266c21aba70d5b1890b30900a5b00..a8f792c1ac5740219f014bec5a3875be92b43be9 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
@@ -38,6 +38,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkAccess;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.chunk.LevelChunk;
|
||||
+import net.minecraft.world.level.chunk.LevelChunkSection;
|
||||
import net.minecraft.world.level.levelgen.Heightmap;
|
||||
import net.minecraft.world.level.levelgen.structure.BuiltinStructures;
|
||||
import net.minecraft.world.level.levelgen.structure.Structure;
|
||||
@@ -199,6 +200,19 @@ public final class NaturalSpawner {
|
||||
@@ -199,6 +199,19 @@ public final class NaturalSpawner {
|
||||
}
|
||||
public static int spawnCategoryForChunk(MobCategory group, ServerLevel world, LevelChunk chunk, NaturalSpawner.SpawnPredicate checker, NaturalSpawner.AfterSpawnCallback runner, int maxSpawns, Consumer<Entity> trackEntity) {
|
||||
// Paper end - Optional per player mob spawns
|
||||
@@ -24,7 +16,7 @@ index a9fda9cb7e8266c21aba70d5b1890b30900a5b00..083a8a7dd99e447904dbac161dd3a1de
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.ignoreLC) {
|
||||
+ int spawnN = 0;
|
||||
+ for (int i = chunk.getMinBuildHeight(); i < chunk.getMaxBuildHeight(); i += 16) {
|
||||
+ LevelChunkSection section = chunk.getSections()[chunk.getSectionIndex(i)];
|
||||
+ net.minecraft.world.level.chunk.LevelChunkSection section = chunk.getSections()[chunk.getSectionIndex(i)];
|
||||
+ if (section != null && !section.hasOnlyAir()) {
|
||||
+ BlockPos pos = getRandomPosInChunk(world, chunk).offset(0, i, 0);
|
||||
+ spawnN += spawnCategoryForPosition(group, world, chunk, pos, checker, runner, maxSpawns, trackEntity);
|
||||
@@ -36,7 +28,7 @@ index a9fda9cb7e8266c21aba70d5b1890b30900a5b00..083a8a7dd99e447904dbac161dd3a1de
|
||||
BlockPos blockposition = NaturalSpawner.getRandomPosWithin(world, chunk);
|
||||
|
||||
if (blockposition.getY() >= world.getMinBuildHeight() + 1) {
|
||||
@@ -207,6 +221,16 @@ public final class NaturalSpawner {
|
||||
@@ -207,6 +220,16 @@ public final class NaturalSpawner {
|
||||
return 0; // Paper - Optional per player mob spawns
|
||||
}
|
||||
|
||||
@@ -5,20 +5,19 @@ Subject: [PATCH] Elytra aeronautics no chunk load
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index da65f980f2145ea03341911ce75f7e61b358c9d7..7dcdc9b40c594234d87bef3e75a68ddaa58506a3 100644
|
||||
index 0bcd9f3faba32c4dc1d115a9306594b9334657cb..bab8dbff18bd8435ed86336de067df0de3ca9145 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -166,7 +166,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
// Paper end - use distance map to optimise tracker
|
||||
@@ -169,14 +169,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
// Paper start - distance maps
|
||||
private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets<ServerPlayer> pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>();
|
||||
|
||||
- void addPlayerToDistanceMaps(ServerPlayer player) {
|
||||
+ public void addPlayerToDistanceMaps(ServerPlayer player) { // Leaves - package -> public
|
||||
int chunkX = io.papermc.paper.util.MCUtil.getChunkCoordinate(player.getX());
|
||||
int chunkZ = io.papermc.paper.util.MCUtil.getChunkCoordinate(player.getZ());
|
||||
// Note: players need to be explicitly added to distance maps before they can be updated
|
||||
@@ -182,7 +182,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
// Paper end - use distance map to optimise entity tracker
|
||||
this.nearbyPlayers.addPlayer(player);
|
||||
}
|
||||
|
||||
- void removePlayerFromDistanceMaps(ServerPlayer player) {
|
||||
@@ -26,7 +25,7 @@ index da65f980f2145ea03341911ce75f7e61b358c9d7..7dcdc9b40c594234d87bef3e75a68dda
|
||||
int chunkX = io.papermc.paper.util.MCUtil.getChunkCoordinate(player.getX());
|
||||
int chunkZ = io.papermc.paper.util.MCUtil.getChunkCoordinate(player.getZ());
|
||||
// Note: players need to be explicitly added to distance maps before they can be updated
|
||||
@@ -994,7 +994,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -782,7 +782,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
private boolean skipPlayer(ServerPlayer player) {
|
||||
@@ -36,19 +35,19 @@ index da65f980f2145ea03341911ce75f7e61b358c9d7..7dcdc9b40c594234d87bef3e75a68dda
|
||||
}
|
||||
|
||||
void updatePlayerStatus(ServerPlayer player, boolean added) {
|
||||
@@ -1031,6 +1032,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -820,6 +821,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
public void move(ServerPlayer player) {
|
||||
+ if (player.elytraAeronauticsNoChunk) return; // Leaves - no chunk
|
||||
// Paper - delay this logic for the entity tracker tick, no need to duplicate it
|
||||
ObjectIterator objectiterator = this.entityMap.values().iterator();
|
||||
|
||||
SectionPos sectionposition = player.getLastSectionPos();
|
||||
while (objectiterator.hasNext()) {
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index d833c9da7b5132485a450bb752bd988ee91e4cf1..f605051b11eb23e41c1f0339917a6731c1e6b2f3 100644
|
||||
index 51a1be78de7a794d13b64db6958977e2e9d20553..31ad4e4aaf321ab3c3909145e36a67744d906c65 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -556,7 +556,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -559,7 +559,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
speed *= 2f; // TODO: Get the speed of the vehicle instead of the player
|
||||
|
||||
// Paper start - Prevent moving into unloaded chunks
|
||||
@@ -58,10 +57,10 @@ index d833c9da7b5132485a450bb752bd988ee91e4cf1..f605051b11eb23e41c1f0339917a6731
|
||||
!worldserver.areChunksLoadedForMove(entity.getBoundingBox().expandTowards(new Vec3(toX, toY, toZ).subtract(entity.position())))
|
||||
)) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index bff5bdd0ea231c889fd8bab4f68b5bcbdcda2190..a13843368d161fd252a95a620463d7040fd98308 100644
|
||||
index 0bf2a2a5ccb558632c70d77b852167c3c90e5f49..f9a90bddb0bec8b67da3f9d05a0f3056048c8272 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1156,7 +1156,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1081,7 +1081,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -76,7 +75,7 @@ index bff5bdd0ea231c889fd8bab4f68b5bcbdcda2190..a13843368d161fd252a95a620463d704
|
||||
this.level().getProfiler().push("move");
|
||||
if (this.stuckSpeedMultiplier.lengthSqr() > 1.0E-7D) {
|
||||
movement = movement.multiply(this.stuckSpeedMultiplier);
|
||||
@@ -2104,6 +2110,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1993,6 +1999,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
this.yo = y;
|
||||
this.zo = d4;
|
||||
this.setPos(d3, y, d4);
|
||||
@@ -85,14 +84,13 @@ index bff5bdd0ea231c889fd8bab4f68b5bcbdcda2190..a13843368d161fd252a95a620463d704
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index 7f733ed26ada22c64897c4df84af6eb680d9a02f..24bed620cb7cdb5104d3bdf8f87eb69122e8092c 100644
|
||||
index eff9284b853f6771b6d44c851643621897e18a17..191aeecdf355e94758ed1f8bb7ca1a91a492eab5 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -195,6 +195,8 @@ public abstract class Player extends LivingEntity {
|
||||
public boolean ignoreFallDamageFromCurrentImpulse;
|
||||
@@ -196,6 +196,7 @@ public abstract class Player extends LivingEntity {
|
||||
private int currentImpulseContextResetGraceTime;
|
||||
public boolean affectsSpawning = true; // Paper - Affects Spawning API
|
||||
public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage
|
||||
+ // Paper end
|
||||
+ public boolean elytraAeronauticsNoChunk = false; // Leaves - Elytra aeronautics
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -1,18 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
||||
Date: Tue, 27 Jun 2023 13:48:36 +0800
|
||||
Subject: [PATCH] Enchantment mending compatibility infinity
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.java b/src/main/java/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.java
|
||||
index 81cc05c929d612898609965d82454b89cd18f9f5..96bfa0098a903aca604308877c53336e6269b059 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.java
|
||||
@@ -7,6 +7,6 @@ public class ArrowInfiniteEnchantment extends Enchantment {
|
||||
|
||||
@Override
|
||||
public boolean checkCompatibility(Enchantment other) {
|
||||
- return !(other instanceof MendingEnchantment) && super.checkCompatibility(other);
|
||||
+ return (org.leavesmc.leaves.LeavesConfig.mendingCompatibilityInfinity || !(other instanceof MendingEnchantment)) && super.checkCompatibility(other); // Leaves - mendingCompatibilityInfinity
|
||||
}
|
||||
}
|
||||
28
patches/server/0069-Lava-riptide.patch
Normal file
28
patches/server/0069-Lava-riptide.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
||||
Date: Fri, 7 Jul 2023 16:53:32 +0800
|
||||
Subject: [PATCH] Lava riptide
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/TridentItem.java b/src/main/java/net/minecraft/world/item/TridentItem.java
|
||||
index f1b2d388a1a40a1d909a2e726f32d6c15e1eb0eb..da3887eec5b1e2b8151d71ddb759d083993d54bb 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/TridentItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/TridentItem.java
|
||||
@@ -72,7 +72,7 @@ public class TridentItem extends Item implements ProjectileItem {
|
||||
if (j >= 10) {
|
||||
float f = EnchantmentHelper.getTridentSpinAttackStrength(stack, entityhuman);
|
||||
|
||||
- if (f <= 0.0F || entityhuman.isInWaterOrRain()) {
|
||||
+ if (f <= 0.0F || entityhuman.isInWaterOrRain() || (org.leavesmc.leaves.LeavesConfig.lavaRiptide && entityhuman.isInLava())) { // Leaves - lava riptide
|
||||
if (!TridentItem.isTooDamagedToUse(stack)) {
|
||||
Holder<SoundEvent> holder = (Holder) EnchantmentHelper.pickHighestLevel(stack, EnchantmentEffectComponents.TRIDENT_SOUND).orElse(SoundEvents.TRIDENT_THROW);
|
||||
|
||||
@@ -150,7 +150,7 @@ public class TridentItem extends Item implements ProjectileItem {
|
||||
|
||||
if (TridentItem.isTooDamagedToUse(itemstack)) {
|
||||
return InteractionResultHolder.fail(itemstack);
|
||||
- } else if (EnchantmentHelper.getTridentSpinAttackStrength(itemstack, user) > 0.0F && !user.isInWaterOrRain()) {
|
||||
+ } else if (EnchantmentHelper.getTridentSpinAttackStrength(itemstack, user) > 0.0F && !user.isInWaterOrRain() && !(org.leavesmc.leaves.LeavesConfig.lavaRiptide && user.isInLava())) { // Leaves - lava riptide
|
||||
return InteractionResultHolder.fail(itemstack);
|
||||
} else {
|
||||
user.startUsingItem(hand);
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] No block update command
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 0f3a92155fa0b4ed9d7fbc87202fd04dc01a0890..3bb53128f6919712f0a88ec11c1bce25bf5b8b84 100644
|
||||
index 2d21dbb62c720beead96bf9176c7bd22661592ac..0f1fef8f6e3b89f61b98358c6c8d84af4af2fa5e 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -2464,6 +2464,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -2243,6 +2243,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
|
||||
@Override
|
||||
public void blockUpdated(BlockPos pos, Block block) {
|
||||
@@ -17,10 +17,10 @@ index 0f3a92155fa0b4ed9d7fbc87202fd04dc01a0890..3bb53128f6919712f0a88ec11c1bce25
|
||||
// CraftBukkit start
|
||||
if (this.populating) {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 35e0aac4dc32227c48dc3a0f3a15c02a700fc402..0522368deaa13f13fad4e2f00346f3910a064618 100644
|
||||
index fa3dbb93a049962fe10cb0391d437acdb45c82af..d9217d2a2be6bfa8eb099effac8587af715b975c 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -506,7 +506,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
@@ -527,7 +527,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
net.minecraft.world.level.block.state.BlockState block = world.getBlockState(newblockposition);
|
||||
|
||||
if (!(block.getBlock() instanceof BaseEntityBlock)) { // Containers get placed automatically
|
||||
@@ -30,10 +30,10 @@ index 35e0aac4dc32227c48dc3a0f3a15c02a700fc402..0522368deaa13f13fad4e2f00346f391
|
||||
|
||||
world.notifyAndUpdatePhysics(newblockposition, null, oldBlock, block, world.getBlockState(newblockposition), updateFlag, 512); // send null chunk as chunk.k() returns false by this point
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index f94ca04e55e02f2d8fcb98ad1868319d55da7468..11fadf105e59b4cddc8c4fa4f02b1ce69abfc7c7 100644
|
||||
index fa577dec9721c25f3c4897be939af7c2ba2e1c84..94015519f379fab094b4b24c4b3a1900c1194e17 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -481,7 +481,7 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -370,7 +370,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
} else {
|
||||
// CraftBukkit - Don't place while processing the BlockPlaceEvent, unless it's a BlockContainer. Prevents blocks such as TNT from activating when cancelled.
|
||||
if (!this.level.isClientSide && doPlace && (!this.level.captureBlockStates || block instanceof net.minecraft.world.level.block.BaseEntityBlock)) {
|
||||
@@ -43,10 +43,10 @@ index f94ca04e55e02f2d8fcb98ad1868319d55da7468..11fadf105e59b4cddc8c4fa4f02b1ce6
|
||||
|
||||
if (iblockdata.hasBlockEntity()) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
index d5352883ee51dfc646352ae7e2b76af7efd0441e..57f952323639c1ce409032b8023a7911b4fee9b2 100644
|
||||
index 1687ab4965433459219bb5d8aaf5ec8e5baeb605..36d49bd355b9c061b1663bcac7c9f590173f34df 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
@@ -518,6 +518,7 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -506,6 +506,7 @@ public abstract class FlowingFluid extends Fluid {
|
||||
|
||||
@Override
|
||||
public void tick(Level world, BlockPos pos, FluidState state) {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Raider die skip self raid check
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java
|
||||
index 98e558338b5d9fb03869d2cc21b3e90eb45b95f6..d9e3c0ff607cc55dbe0df4519279889bcb30e1b2 100644
|
||||
index bbf21ea433f9e3963aac0ede597ed8d3c8e50ed8..6e68f8fa8280a106b1a262d86aa130e89d4f5cce 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java
|
||||
@@ -128,7 +128,7 @@ public abstract class Raider extends PatrollingMonster {
|
||||
@@ -121,7 +121,7 @@ public abstract class Raider extends PatrollingMonster {
|
||||
Raid raid = this.getCurrentRaid();
|
||||
|
||||
if (raid != null) {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Container open passthrough
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/SignBlock.java b/src/main/java/net/minecraft/world/level/block/SignBlock.java
|
||||
index f7bae8060d993176799ff3ff4653d760a137faba..01dcc910e9151fb28828f99afa0adc21f5a700d7 100644
|
||||
index 73874cd18a5b335e895ea0b2fefbd521209afe08..0f560a03676571e1ebf3811a7caa4faba0e7ef95 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/SignBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/SignBlock.java
|
||||
@@ -113,6 +113,18 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
|
||||
@@ -110,6 +110,18 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
|
||||
} else {
|
||||
return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION;
|
||||
}
|
||||
@@ -27,7 +27,7 @@ index f7bae8060d993176799ff3ff4653d760a137faba..01dcc910e9151fb28828f99afa0adc21
|
||||
} else {
|
||||
return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION;
|
||||
}
|
||||
@@ -141,6 +153,25 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
|
||||
@@ -138,6 +150,25 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
|
||||
return InteractionResult.SUCCESS;
|
||||
} else if (flag1) {
|
||||
return InteractionResult.SUCCESS;
|
||||
@@ -1,28 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
||||
Date: Fri, 7 Jul 2023 16:53:32 +0800
|
||||
Subject: [PATCH] Lava riptide
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/TridentItem.java b/src/main/java/net/minecraft/world/item/TridentItem.java
|
||||
index 47de500fddb0716d142f8f5876a82a95afaa06fa..b01e85c9665fef476acdde74f08beaba168561db 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/TridentItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/TridentItem.java
|
||||
@@ -70,7 +70,7 @@ public class TridentItem extends Item implements ProjectileItem {
|
||||
if (j >= 10) {
|
||||
int k = EnchantmentHelper.getRiptide(stack);
|
||||
|
||||
- if (k <= 0 || entityhuman.isInWaterOrRain()) {
|
||||
+ if (k <= 0 || entityhuman.isInWaterOrRain() || (org.leavesmc.leaves.LeavesConfig.lavaRiptide && entityhuman.isInLava())) { // Leaves - lava riptide
|
||||
if (!world.isClientSide) {
|
||||
// itemstack.hurtAndBreak(1, entityhuman, EntityLiving.getSlotForHand(entityliving.getUsedItemHand())); // CraftBukkit - moved down
|
||||
if (k == 0) {
|
||||
@@ -155,7 +155,7 @@ public class TridentItem extends Item implements ProjectileItem {
|
||||
|
||||
if (itemstack.getDamageValue() >= itemstack.getMaxDamage() - 1) {
|
||||
return InteractionResultHolder.fail(itemstack);
|
||||
- } else if (EnchantmentHelper.getRiptide(itemstack) > 0 && !user.isInWaterOrRain()) {
|
||||
+ } else if (EnchantmentHelper.getRiptide(itemstack) > 0 && !user.isInWaterOrRain() && !(org.leavesmc.leaves.LeavesConfig.lavaRiptide && user.isInLava())) { // Leaves - lava riptide
|
||||
return InteractionResultHolder.fail(itemstack);
|
||||
} else {
|
||||
user.startUsingItem(hand);
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] SIMD support
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index fe1f6f1a97ab35c44f596596d16765b8b81753a9..28baa9a192a6fd83563b57a411e9bc905ba6b7e1 100644
|
||||
index 268193499b9f1fae0c01963e8004a3e7422f77ca..b35bc56ca35e7ada015e011ab4c3136b4803e48c 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -73,6 +73,7 @@ tasks.withType<JavaCompile> {
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Dont respond ping before start fully
|
||||
This patch is Powered by Gale(https://github.com/GaleMC/Gale)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||
index 6f1c9fa89e718cbc01a8d72de34154f49c5f46db..093d0cea2fa37c96086afdb026bf988a7ea3c9ed 100644
|
||||
index 385457c7151f7e636e1ea2e38ef983f4f532b9b5..b35b0fcd5405c64d15f907ca4d3b33ae204a8d1e 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||
@@ -153,6 +153,12 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
|
||||
@@ -154,6 +154,12 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
|
||||
this.connection.send(new ClientboundStatusResponsePacket(ping));
|
||||
// CraftBukkit end
|
||||
*/
|
||||
@@ -6,18 +6,18 @@ Subject: [PATCH] Faster chunk serialization
|
||||
This patch is Powered by Gale(https://github.com/GaleMC/Gale)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/util/BitStorage.java b/src/main/java/net/minecraft/util/BitStorage.java
|
||||
index 8bafd5fd7499ba4a04bf706cfd1e156073716e21..7082022412dc75e3d84c74acd19bb8452e477d0c 100644
|
||||
index 8bafd5fd7499ba4a04bf706cfd1e156073716e21..91554e0f496a2df9cfe3131fbe3d9706e0a73a38 100644
|
||||
--- a/src/main/java/net/minecraft/util/BitStorage.java
|
||||
+++ b/src/main/java/net/minecraft/util/BitStorage.java
|
||||
@@ -1,6 +1,7 @@
|
||||
@@ -1,5 +1,7 @@
|
||||
package net.minecraft.util;
|
||||
|
||||
import java.util.function.IntConsumer;
|
||||
+import net.minecraft.world.level.chunk.Palette;
|
||||
+
|
||||
import java.util.function.IntConsumer;
|
||||
|
||||
public interface BitStorage {
|
||||
int getAndSet(int index, int value);
|
||||
@@ -31,4 +32,6 @@ public interface BitStorage {
|
||||
@@ -31,4 +33,6 @@ public interface BitStorage {
|
||||
|
||||
}
|
||||
// Paper end
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Cache world generator sea level
|
||||
This patch is Powered by Gale(https://github.com/GaleMC/Gale)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
|
||||
index 8ce870a5341a61fbbaf42021ef7f7f615a6a3e09..d217bccc5af50360e3b3b265953fba91aaf204db 100644
|
||||
index 68be0d51aa64b5d917fb53dbbbdf8966d4f4abd8..4adac668fb3d02ed43a89da446a71503d0380c73 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
|
||||
@@ -62,12 +62,17 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
|
||||
@@ -61,12 +61,17 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
|
||||
private static final BlockState AIR = Blocks.AIR.defaultBlockState();
|
||||
public final Holder<NoiseGeneratorSettings> settings;
|
||||
private final Supplier<Aquifer.FluidPicker> globalFluidPicker;
|
||||
@@ -28,7 +28,7 @@ index 8ce870a5341a61fbbaf42021ef7f7f615a6a3e09..d217bccc5af50360e3b3b265953fba91
|
||||
});
|
||||
}
|
||||
|
||||
@@ -394,7 +399,13 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
|
||||
@@ -409,7 +414,13 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
|
||||
|
||||
@Override
|
||||
public int getSeaLevel() {
|
||||
@@ -1,15 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MC_XiaoHei <xiaohei.xor7studio@foxmail.com>
|
||||
Date: Wed, 8 May 2024 22:28:35 +0800
|
||||
Subject: [PATCH] Placeholder for Bladeren-Protocol
|
||||
|
||||
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index 1ad93453221244f880855b510e888e759275b640..3811c0d849a3eb028ed1a6b7a2d4747f7f570448 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -46,4 +46,3 @@ dependency-reduced-pom.xml
|
||||
# vs code
|
||||
/.vscode
|
||||
/.factorypath
|
||||
-
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user