novoline.wtf 3.0
This commit is contained in:
commit
84eb5303aa
6741 files changed
+739533
No files matched your search
@@ -0,0 +1,7 @@
|
||||
.gradle/
|
||||
build/
|
||||
.idea/
|
||||
*.iml
|
||||
run/*
|
||||
!run/natives/
|
||||
!run/natives/**
|
||||
@@ -0,0 +1,12 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="OpenNovoline WTF Client" type="Application" factoryName="Application">
|
||||
<option name="MAIN_CLASS_NAME" value="net.minecraft.client.main.Main" />
|
||||
<module name="opennovoline-wtf.main" />
|
||||
<option name="PROGRAM_PARAMETERS" value="--username Player --version 1.8.9 --gameDir "$PROJECT_DIR$/run" --assetsDir "$USER_HOME$/AppData/Roaming/.minecraft/assets" --assetIndex 1.8 --uuid Player --accessToken 0 --userProperties {} --userType legacy" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx4G -XX:+UseG1GC -Djava.library.path="$PROJECT_DIR$/run/natives" -Dfile.encoding=UTF-8 --enable-native-access=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/run" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
@@ -0,0 +1,7 @@
|
||||
# README
|
||||
|
||||
Novoline.wtf 3.0.. but OpenSource?
|
||||
|
||||
## License
|
||||
|
||||
See [LICENSE](LICENSE) for the full text of the GNU General Public License v3.0. Third-party code, assets, and libraries are subject to their respective licenses.
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
plugins {
|
||||
id 'application'
|
||||
id 'idea'
|
||||
}
|
||||
|
||||
group = 'novoline'
|
||||
version = '3.0'
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(25)
|
||||
}
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass = 'net.minecraft.client.main.Main'
|
||||
}
|
||||
|
||||
idea {
|
||||
module {
|
||||
excludeDirs += file('run')
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation files('libs/novoline-support.jar', 'libs/discord-game-sdk4j-0.5.4.jar')
|
||||
implementation files(
|
||||
'libs/authlib-1.5.21.jar',
|
||||
'libs/codecjorbis-20101023.jar',
|
||||
'libs/codecwav-20101023.jar',
|
||||
'libs/commons-codec-1.9.jar',
|
||||
'libs/commons-compress-1.8.1.jar',
|
||||
'libs/commons-io-2.4.jar',
|
||||
'libs/commons-lang3-3.3.2.jar',
|
||||
'libs/commons-logging-1.1.3.jar',
|
||||
'libs/gson-2.2.4.jar',
|
||||
'libs/guava-17.0.jar',
|
||||
'libs/httpclient-4.3.3.jar',
|
||||
'libs/httpcore-4.3.2.jar',
|
||||
'libs/icu4j-core-mojang-51.2.jar',
|
||||
'libs/jinput-2.0.5.jar',
|
||||
'libs/jna-3.4.0.jar',
|
||||
'libs/jopt-simple-4.6.jar',
|
||||
'libs/jutils-1.0.0.jar',
|
||||
'libs/libraryjavasound-20101123.jar',
|
||||
'libs/librarylwjglopenal-20100824.jar',
|
||||
'libs/log4j-api-2.0-beta9.jar',
|
||||
'libs/log4j-core-2.0-beta9.jar',
|
||||
'libs/netty-1.6.jar',
|
||||
'libs/netty-all-4.0.23.Final.jar',
|
||||
'libs/oshi-core-1.1.jar',
|
||||
'libs/platform-3.4.0.jar',
|
||||
'libs/soundsystem-20120107.jar',
|
||||
'libs/twitch-6.5.jar',
|
||||
'libs/lwjgl-util-vector.jar',
|
||||
'libs/lwjgl-2.9.4.jar',
|
||||
'libs/lwjgl_util-2.9.4-nightly-20150209.jar'
|
||||
)
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.encoding = 'UTF-8'
|
||||
options.fork = true
|
||||
options.forkOptions.memoryMaximumSize = '6g'
|
||||
options.compilerArgs += ['-proc:none', '-implicit:none', '-XDshould-stop.ifError=FLOW']
|
||||
}
|
||||
|
||||
tasks.named('jar', Jar) {
|
||||
archiveFileName = 'opennovoline-wtf.jar'
|
||||
manifest.attributes('Main-Class': application.mainClass.get())
|
||||
}
|
||||
|
||||
def gameDir = layout.projectDirectory.dir('run')
|
||||
def nativesDir = gameDir.dir('natives')
|
||||
def defaultAssets = providers.environmentVariable('APPDATA')
|
||||
.map { new File(it, '.minecraft/assets').absolutePath }
|
||||
.orElse(gameDir.dir('assets').asFile.absolutePath)
|
||||
def assetsPath = providers.gradleProperty('assetsDir').orElse(defaultAssets)
|
||||
def username = providers.gradleProperty('username').orElse('Player')
|
||||
def uuid = providers.gradleProperty('uuid').orElse(username)
|
||||
def accessToken = providers.environmentVariable('NOVOLINE_ACCESS_TOKEN').orElse('0')
|
||||
def userType = providers.gradleProperty('userType').orElse('legacy')
|
||||
|
||||
tasks.named('run', JavaExec) {
|
||||
workingDir = gameDir.asFile
|
||||
maxHeapSize = '4g'
|
||||
jvmArgs '-Djava.library.path=' + nativesDir.asFile.absolutePath,
|
||||
'-Dfile.encoding=UTF-8',
|
||||
'--enable-native-access=ALL-UNNAMED',
|
||||
'--add-opens=java.base/java.lang=ALL-UNNAMED',
|
||||
'--add-opens=java.base/java.lang.reflect=ALL-UNNAMED',
|
||||
'--add-opens=java.base/java.util=ALL-UNNAMED',
|
||||
'--add-opens=java.base/java.net=ALL-UNNAMED',
|
||||
'--add-opens=java.base/java.nio=ALL-UNNAMED',
|
||||
'--add-opens=java.base/sun.nio.ch=ALL-UNNAMED'
|
||||
|
||||
doFirst {
|
||||
def assets = file(assetsPath.get())
|
||||
if (!new File(assets, 'indexes/1.8.json').isFile()) {
|
||||
throw new GradleException("Minecraft 1.8 assets index missing in " + assets + ". Use -PassetsDir=<path>.")
|
||||
}
|
||||
if (!nativesDir.file('lwjgl64.dll').asFile.isFile()) {
|
||||
throw new GradleException("Windows x64 LWJGL natives missing in " + nativesDir.asFile)
|
||||
}
|
||||
args '--username', username.get(),
|
||||
'--version', '1.8.9',
|
||||
'--gameDir', gameDir.asFile.absolutePath,
|
||||
'--assetsDir', assets.absolutePath,
|
||||
'--assetIndex', '1.8',
|
||||
'--uuid', uuid.get(),
|
||||
'--accessToken', accessToken.get(),
|
||||
'--userProperties', '{}',
|
||||
'--userType', userType.get()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
org.gradle.jvmargs=-Xmx2g -Dfile.encoding=UTF-8
|
||||
org.gradle.java.installations.auto-download=false
|
||||
Vendored
BIN
Binary file not shown.
+9
@@ -0,0 +1,9 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.0-bin.zip
|
||||
networkTimeout=120000
|
||||
retries=5
|
||||
retryBackOffMs=1000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -0,0 +1,248 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# gradlew start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh gradlew
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
Vendored
+82
@@ -0,0 +1,82 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem gradlew startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||
setlocal EnableExtensions
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
|
||||
|
||||
@rem Execute gradlew
|
||||
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||
@rem which allows us to clear the local environment before executing the java command
|
||||
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||
|
||||
:exitWithErrorLevel
|
||||
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
rootProject.name = 'opennovoline-wtf'
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,71 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.Map;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockAir extends Block {
|
||||
|
||||
private static Map mapOriginalOpacity = new IdentityHashMap();
|
||||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance(World var1, BlockPos var4, IBlockState var5, float var6, int var7) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReplaceable(World var3, BlockPos var4) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCollideCheck(IBlockState var1, boolean var4) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void restoreLightOpacity(Block var1) {
|
||||
if (net.minecraft.block.BlockAir.mapOriginalOpacity.containsKey(var1)) {
|
||||
int var8 = (Integer)net.minecraft.block.BlockAir.mapOriginalOpacity.get(var1);
|
||||
int var9 = var8;
|
||||
setLightOpacity(var1, var9);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public BlockAir() {
|
||||
super(Material.air);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void setLightOpacity(Block var0, int var1) {
|
||||
int var3 = var1;
|
||||
if (!net.minecraft.block.BlockAir.mapOriginalOpacity.containsKey(var0)) {
|
||||
net.minecraft.block.BlockAir.mapOriginalOpacity.put(var0, var0.lightOpacity);
|
||||
}
|
||||
|
||||
var0.lightOpacity = var3;
|
||||
}
|
||||
|
||||
public BlockAir(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,234 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.lang.invoke.CallSite;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.MethodType;
|
||||
import java.lang.invoke.MutableCallSite;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyDirection;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityFallingBlock;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ContainerRepair;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IInteractionObject;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockAnvil extends BlockFalling {
|
||||
|
||||
public static final PropertyDirection FACING;
|
||||
public static final PropertyInteger DAMAGE;
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, net.minecraft.block.BlockAnvil.FACING, net.minecraft.block.BlockAnvil.DAMAGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
return this.getDefaultState()
|
||||
.withProperty(net.minecraft.block.BlockAnvil.FACING, EnumFacing.getHorizontal(var1 & 3))
|
||||
.withProperty(net.minecraft.block.BlockAnvil.DAMAGE, (var1 & 15) >> 2);
|
||||
}
|
||||
|
||||
static {
|
||||
finishInitialization: {
|
||||
java.lang.String[] var0 = new java.lang.String[]{"damage", "facing"};
|
||||
FACING = PropertyDirection.create((java.lang.String) (var0[1]), (com.google.common.base.Predicate) (EnumFacing.Plane.HORIZONTAL));
|
||||
DAMAGE = PropertyInteger.create(var0[0], 0, 2);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(net.minecraft.item.Item var2, net.minecraft.creativetab.CreativeTabs var4, java.util.List<net.minecraft.item.ItemStack> var6) {
|
||||
byte var11 = 0;
|
||||
byte var12 = 1;
|
||||
Item var13 = var2;
|
||||
var6.add(new ItemStack(var13, var12, var11));
|
||||
byte var14 = 1;
|
||||
byte var15 = 1;
|
||||
Item var16 = var2;
|
||||
var6.add(new ItemStack(var16, var15, var14));
|
||||
byte var17 = 2;
|
||||
byte var18 = 1;
|
||||
Item var19 = var2;
|
||||
var6.add(new ItemStack(var19, var18, var17));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateForEntityRender(IBlockState var3) {
|
||||
return this.getDefaultState().withProperty(net.minecraft.block.BlockAnvil.FACING, EnumFacing.SOUTH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World var1, BlockPos var4, IBlockState var5, EntityPlayer var6, EnumFacing var7, float var8, float var9, float var10
|
||||
) {
|
||||
|
||||
if (!var1.isRemote) {
|
||||
var6.displayGui(new BlockAnvil.Anvil(var1, var4));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStartFalling(EntityFallingBlock var1) {
|
||||
var1.setHurtEntities(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState onBlockPlaced(
|
||||
World var1, BlockPos var2, EnumFacing var3, float var4, float var7, float var8, int var9, EntityLivingBase var10
|
||||
) {
|
||||
|
||||
EnumFacing var15 = var10.getHorizontalFacing().rotateY();
|
||||
return super.onBlockPlaced(var1, var2, var3, var4, var7, var8, var9, var10)
|
||||
.withProperty(net.minecraft.block.BlockAnvil.FACING, var15)
|
||||
.withProperty(net.minecraft.block.BlockAnvil.DAMAGE, var9 >> 2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess var3, BlockPos var4, EnumFacing var5) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public BlockAnvil() {
|
||||
super(Material.AdvancedAntiSkid1ll1iiii);
|
||||
this.setDefaultState(
|
||||
this.blockState
|
||||
.getBaseState()
|
||||
.withProperty(net.minecraft.block.BlockAnvil.FACING, EnumFacing.NORTH)
|
||||
.withProperty(net.minecraft.block.BlockAnvil.DAMAGE, 0)
|
||||
);
|
||||
this.setLightOpacity(0);
|
||||
this.setCreativeTab(CreativeTabs.tabDecorations);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState var1) {
|
||||
return (Integer)var1.getValue(net.minecraft.block.BlockAnvil.DAMAGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess var3, BlockPos var4) {
|
||||
|
||||
|
||||
EnumFacing var9 = (EnumFacing)var3.getBlockState(var4).getValue(net.minecraft.block.BlockAnvil.FACING);
|
||||
if (var9.getAxis() == EnumFacing.Axis.X) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.125F, 1.0F, 1.0F, 0.875F);
|
||||
} else {
|
||||
this.setBlockBounds(0.125F, 0.0F, 0.0F, 0.875F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState var3) {
|
||||
|
||||
int var7 = 0;
|
||||
var7 |= ((EnumFacing)var3.getValue(net.minecraft.block.BlockAnvil.FACING)).getHorizontalIndex();
|
||||
return var7 | (Integer)var3.getValue(net.minecraft.block.BlockAnvil.DAMAGE) << 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEndFalling(World var1, BlockPos var4) {
|
||||
|
||||
var1.playAuxSFX(1022, var4, 0);
|
||||
}
|
||||
|
||||
public static class Anvil implements IInteractionObject {
|
||||
private final BlockPos position;
|
||||
|
||||
|
||||
|
||||
private final World world;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasCustomName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String getGuiID() {
|
||||
return "minecraft:anvil";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container createContainer(InventoryPlayer var2, EntityPlayer var4) {
|
||||
|
||||
return new ContainerRepair(var2, this.world, this.position, var4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "anvil";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public IChatComponent getDisplayName() {
|
||||
|
||||
return new ChatComponentTranslation(Blocks.anvil.getUnlocalizedName() + ".name");
|
||||
}
|
||||
|
||||
public Anvil(World var1, BlockPos var2) {
|
||||
this.world = var1;
|
||||
this.position = var2;
|
||||
}
|
||||
|
||||
public boolean hasCustomName(long argument0) {
|
||||
return this.hasCustomName();
|
||||
}
|
||||
}
|
||||
|
||||
public BlockAnvil(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,330 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.lang.invoke.CallSite;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.MethodType;
|
||||
import java.lang.invoke.MutableCallSite;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyDirection;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityBanner;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockBanner extends BlockContainer {
|
||||
|
||||
|
||||
|
||||
public static final PropertyInteger ROTATION;
|
||||
|
||||
public static final PropertyDirection FACING;
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBox(World var3, BlockPos var4) {
|
||||
|
||||
this.setBlockBoundsBasedOnState(var3, var4);
|
||||
return super.getSelectedBoundingBox(var3, var4);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canSpawnInBlock() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState var1, Random var4, int var5) {
|
||||
return Items.banner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World var1, EntityPlayer var2, BlockPos var3, IBlockState var4, TileEntity var5) {
|
||||
|
||||
|
||||
if (var5 instanceof TileEntityBanner var20) {
|
||||
Item var10003 = Items.banner;
|
||||
int var23 = ((TileEntityBanner)var5).getBaseColor();
|
||||
byte var24 = 1;
|
||||
Item var25 = var10003;
|
||||
ItemStack var21 = new ItemStack(var25, var24, var23);
|
||||
NBTTagCompound var22 = new NBTTagCompound();
|
||||
TileEntityBanner.setBaseColorAndPatterns(var22, var20.getBaseColor(), var20.getPatterns());
|
||||
NBTTagCompound var26 = var22;
|
||||
String var27 = "BlockEntityTag";
|
||||
var21.setTagInfo(var27, var26);
|
||||
spawnAsEntity(var1, var3, var21);
|
||||
} else {
|
||||
super.harvestBlock(var1, var2, var3, var4, (TileEntity)null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocalizedName() {
|
||||
|
||||
return StatCollector.translateToLocal("item.banner.white.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPassable(IBlockAccess var1, BlockPos var2) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World var1, BlockPos var4) {
|
||||
|
||||
return !this.hasInvalidNeighbor(var1, var4) && super.canPlaceBlockAt(var1, var4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance(World var1, BlockPos var4, IBlockState var5, float var6, int var7) {
|
||||
|
||||
|
||||
TileEntity var22 = var1.getTileEntity(var4);
|
||||
if (var22 instanceof TileEntityBanner) {
|
||||
Item var10003 = Items.banner;
|
||||
int var25 = ((TileEntityBanner)var22).getBaseColor();
|
||||
byte var26 = 1;
|
||||
Item var27 = var10003;
|
||||
ItemStack var23 = new ItemStack(var27, var26, var25);
|
||||
NBTTagCompound var24 = new NBTTagCompound();
|
||||
var22.writeToNBT(var24);
|
||||
var24.removeTag("x");
|
||||
var24.removeTag("y");
|
||||
var24.removeTag("z");
|
||||
var24.removeTag("id");
|
||||
NBTTagCompound var28 = var24;
|
||||
String var29 = "BlockEntityTag";
|
||||
var23.setTagInfo(var29, var28);
|
||||
spawnAsEntity(var1, var4, var23);
|
||||
} else {
|
||||
super.dropBlockAsItemWithChance(var1, var4, var5, var6, var7);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected BlockBanner() {
|
||||
super(Material.wood);
|
||||
float var8 = 0.25F;
|
||||
float var9 = 1.0F;
|
||||
this.setBlockBounds(0.5F - var8, 0.0F, 0.5F - var8, 0.5F + var8, var9, 0.5F + var8);
|
||||
}
|
||||
|
||||
static {
|
||||
finishInitialization: {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
FACING = PropertyDirection.create((java.lang.String) ("facing"), (com.google.common.base.Predicate) (EnumFacing.Plane.HORIZONTAL));
|
||||
ROTATION = PropertyInteger.create("rotation", 0, 15);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var3, int var4) {
|
||||
return new TileEntityBanner();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItem(World var1, BlockPos var4) {
|
||||
return Items.banner;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static class BlockBannerHanging extends BlockBanner {
|
||||
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess var3, BlockPos var4) {
|
||||
|
||||
EnumFacing var9 = (EnumFacing)var3.getBlockState(var4).getValue(net.minecraft.block.BlockBanner.FACING);
|
||||
float var10 = 0.0F;
|
||||
|
||||
float var11 = 0.78125F;
|
||||
float var12 = 0.0F;
|
||||
float var13 = 1.0F;
|
||||
float var14 = 0.125F;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
switch (net.minecraft.block.BlockBanner.EnumFacingSwitchMap.AdvancedAntiSkid1li11iI1[var9.ordinal()]) {
|
||||
case 1:
|
||||
default:
|
||||
this.setBlockBounds(var12, var10, 1.0F - var14, var13, var11, 1.0F);
|
||||
break;
|
||||
case 2:
|
||||
this.setBlockBounds(var12, var10, 0.0F, var13, var11, var14);
|
||||
break;
|
||||
case 3:
|
||||
this.setBlockBounds(1.0F - var14, var10, var12, 1.0F, var11, var13);
|
||||
break;
|
||||
case 4:
|
||||
this.setBlockBounds(0.0F, var10, var12, var14, var11, var13);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, net.minecraft.block.BlockBanner.FACING);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public BlockBannerHanging() {
|
||||
super();
|
||||
this.setDefaultState(
|
||||
this.blockState.getBaseState().withProperty(net.minecraft.block.BlockBanner.FACING, EnumFacing.NORTH)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState var3) {
|
||||
|
||||
return ((EnumFacing)var3.getValue(net.minecraft.block.BlockBanner.FACING)).getIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
EnumFacing var6 = EnumFacing.getFront(var1);
|
||||
if (var6.getAxis() == EnumFacing.Axis.Y) {
|
||||
var6 = EnumFacing.NORTH;
|
||||
}
|
||||
|
||||
return this.getDefaultState().withProperty(net.minecraft.block.BlockBanner.FACING, var6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World var1, BlockPos var4, IBlockState var5, Block var6) {
|
||||
|
||||
EnumFacing var18 = (EnumFacing)var5.getValue(net.minecraft.block.BlockBanner.FACING);
|
||||
if (!var1.getBlockState(var4.offset(var18.getOpposite()))
|
||||
.getBlock()
|
||||
.getMaterial()
|
||||
.isSolid()) {
|
||||
this.dropBlockAsItem(var1, var4, var5, 0);
|
||||
var1.setBlockToAir(var4);
|
||||
}
|
||||
|
||||
super.onNeighborBlockChange(var1, var4, var5, var6);
|
||||
}
|
||||
|
||||
public BlockBannerHanging(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
|
||||
public static class BlockBannerStanding extends BlockBanner {
|
||||
|
||||
|
||||
public BlockBannerStanding() {
|
||||
super();
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(net.minecraft.block.BlockBanner.ROTATION, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, net.minecraft.block.BlockBanner.ROTATION);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
return this.getDefaultState().withProperty(net.minecraft.block.BlockBanner.ROTATION, var1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World var1, BlockPos var4, IBlockState var5, Block var6) {
|
||||
|
||||
if (!var1.getBlockState(var4.down()).getBlock().getMaterial().isSolid()) {
|
||||
this.dropBlockAsItem(var1, var4, var5, 0);
|
||||
var1.setBlockToAir(var4);
|
||||
}
|
||||
|
||||
super.onNeighborBlockChange(var1, var4, var5, var6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState var3) {
|
||||
|
||||
return (Integer)var3.getValue(net.minecraft.block.BlockBanner.ROTATION);
|
||||
}
|
||||
|
||||
public BlockBannerStanding(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
|
||||
protected BlockBanner(long argument0, int argument1) {
|
||||
this();
|
||||
}
|
||||
|
||||
public static final class EnumFacingSwitchMap {
|
||||
static final int[] AdvancedAntiSkid1li11iI1 = new int[net.minecraft.util.EnumFacing.values().length];
|
||||
static {
|
||||
try { AdvancedAntiSkid1li11iI1[net.minecraft.util.EnumFacing.NORTH.ordinal()] = 1; } catch (java.lang.NoSuchFieldError missing) {}
|
||||
try { AdvancedAntiSkid1li11iI1[net.minecraft.util.EnumFacing.SOUTH.ordinal()] = 2; } catch (java.lang.NoSuchFieldError missing) {}
|
||||
try { AdvancedAntiSkid1li11iI1[net.minecraft.util.EnumFacing.WEST.ordinal()] = 3; } catch (java.lang.NoSuchFieldError missing) {}
|
||||
try { AdvancedAntiSkid1li11iI1[net.minecraft.util.EnumFacing.EAST.ordinal()] = 4; } catch (java.lang.NoSuchFieldError missing) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import novoline.module.ModuleRegistry;
|
||||
|
||||
public class BlockBarrier extends Block {
|
||||
|
||||
|
||||
@Override
|
||||
public EnumWorldBlockLayer getBlockLayer() {
|
||||
return ModuleRegistry.seeBarriers.isEnabled() ? EnumWorldBlockLayer.TRANSLUCENT : super.getBlockLayer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance(World var1, BlockPos var4, IBlockState var5, float var6, int var7) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return ModuleRegistry.seeBarriers.isEnabled() ? 3 : -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getAmbientOcclusionLightValue() {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess var3, BlockPos var4, EnumFacing var5) {
|
||||
if (ModuleRegistry.seeBarriers.isEnabled()) {
|
||||
IBlockState var10 = var3.getBlockState(var4);
|
||||
Block var11 = var10.getBlock();
|
||||
if (var3.getBlockState(var4.offset(var5.getOpposite())) != var10) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (var11 == this) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return super.shouldSideBeRendered(var3, var4, var5);
|
||||
}
|
||||
|
||||
public BlockBarrier() {
|
||||
super(Material.AdvancedAntiSkid1i1iIilI);
|
||||
this.setBlockUnbreakable();
|
||||
this.setResistance(6000001.0F);
|
||||
this.disableStats();
|
||||
this.translucent = true;
|
||||
}
|
||||
|
||||
public BlockBarrier(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.lang.invoke.CallSite;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.MethodType;
|
||||
import java.lang.invoke.MutableCallSite;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class BlockBasePressurePlate extends Block {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected BlockBasePressurePlate(Material var1) {
|
||||
this(var1, var1.getMaterialMapColor());
|
||||
}
|
||||
|
||||
protected abstract IBlockState setRedstoneStrength(IBlockState var1, int var4);
|
||||
|
||||
private boolean canBePlacedOn(World var1, BlockPos var2) {
|
||||
return World.doesBlockHaveSolidTopSurface(var1, var2) || var1.getBlockState(var2).getBlock() instanceof BlockFence;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsForItemRender() {
|
||||
this.setBlockBounds(0.0F, 0.375F, 0.0F, 1.0F, 0.625F, 1.0F);
|
||||
}
|
||||
|
||||
protected void setBlockBoundsBasedOnState0(IBlockState var3) {
|
||||
|
||||
boolean var10 = this.getRedstoneStrength(var3) > 0;
|
||||
|
||||
if (var10) {
|
||||
this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.03125F, 0.9375F);
|
||||
} else {
|
||||
this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.0625F, 0.9375F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World var1, BlockPos var4, IBlockState var5, Entity var6) {
|
||||
|
||||
if (!var1.isRemote) {
|
||||
int var11 = this.getRedstoneStrength(var5);
|
||||
if (var11 == 0) {
|
||||
this.updateState(var1, var4, var5, var11);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract int getRedstoneStrength(IBlockState var1);
|
||||
|
||||
@Override
|
||||
public void randomTick(World var1, BlockPos var2, IBlockState var3, Random var4) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPassable(IBlockAccess var1, BlockPos var2) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World var1) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int getMobilityFlag() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSpawnInBlock() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWeakPower(IBlockAccess var2, BlockPos var3, IBlockState var4, EnumFacing var5) {
|
||||
return this.getRedstoneStrength(var4);
|
||||
}
|
||||
|
||||
protected void updateState(World var1, BlockPos var4, IBlockState var5, int var6) {
|
||||
|
||||
|
||||
int var24 = this.computeRedstoneStrength(var1, var4);
|
||||
boolean var25 = var6 > 0;
|
||||
boolean var26 = var24 > 0;
|
||||
if (var6 != var24) {
|
||||
var5 = this.setRedstoneStrength(var5, var24);
|
||||
var1.setBlockState(var4, var5, 2);
|
||||
this.updateNeighbors(var1, var4);
|
||||
var1.markBlockRangeForRenderUpdate(var4, var4);
|
||||
}
|
||||
|
||||
if (!var26 && var25) {
|
||||
var1.playSoundEffect(
|
||||
var4.getX() + 0.5,
|
||||
var4.getY() + 0.1,
|
||||
var4.getZ() + 0.5,
|
||||
"random.click",
|
||||
0.3F,
|
||||
0.5F
|
||||
);
|
||||
} else if (var26 && !var25) {
|
||||
var1.playSoundEffect(
|
||||
var4.getX() + 0.5,
|
||||
var4.getY() + 0.1,
|
||||
var4.getZ() + 0.5,
|
||||
"random.click",
|
||||
0.3F,
|
||||
0.6F
|
||||
);
|
||||
}
|
||||
|
||||
if (var26) {
|
||||
var1.scheduleUpdate(var4, this, this.tickRate(var1));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStrongPower(IBlockAccess var3, BlockPos var4, IBlockState var5, EnumFacing var6) {
|
||||
return var6 == EnumFacing.UP ? this.getRedstoneStrength(var5) : 0;
|
||||
}
|
||||
|
||||
protected abstract int computeRedstoneStrength(World var3, BlockPos var4);
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World var1, BlockPos var4, IBlockState var5, Block var6) {
|
||||
|
||||
if (!this.canBePlacedOn(var1, var4.down())) {
|
||||
this.dropBlockAsItem(var1, var4, var5, 0);
|
||||
var1.setBlockToAir(var4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World var1, BlockPos var4, IBlockState var5) {
|
||||
|
||||
if (this.getRedstoneStrength(var5) > 0) {
|
||||
this.updateNeighbors(var1, var4);
|
||||
}
|
||||
|
||||
super.breakBlock(var1, var4, var5);
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected AxisAlignedBB getSensitiveAABB(BlockPos var1) {
|
||||
return new AxisAlignedBB(
|
||||
var1.getX() + 0.125F,
|
||||
var1.getY(),
|
||||
var1.getZ() + 0.125F,
|
||||
var1.getX() + 1 - 0.125F,
|
||||
var1.getY() + 0.25,
|
||||
var1.getZ() + 1 - 0.125F
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected BlockBasePressurePlate(Material var1, MapColor var4) {
|
||||
super(var1, var4);
|
||||
this.setCreativeTab(CreativeTabs.tabRedstone);
|
||||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World var1, BlockPos var2, IBlockState var3, Random var6) {
|
||||
|
||||
if (!var1.isRemote) {
|
||||
int var11 = this.getRedstoneStrength(var3);
|
||||
if (var11 > 0) {
|
||||
this.updateState(var1, var2, var3, var11);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World var1, BlockPos var4) {
|
||||
|
||||
return this.canBePlacedOn(var1, var4.down());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess var3, BlockPos var4) {
|
||||
|
||||
this.setBlockBoundsBasedOnState0(var3.getBlockState(var4));
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void updateNeighbors(World var1, BlockPos var4) {
|
||||
|
||||
var1.notifyNeighborsOfStateChange(var4, this);
|
||||
var1.notifyNeighborsOfStateChange(var4.down(), this);
|
||||
}
|
||||
|
||||
protected BlockBasePressurePlate(net.minecraft.block.material.Material argument0, long argument1) {
|
||||
this(argument0);
|
||||
}
|
||||
|
||||
protected BlockBasePressurePlate(net.minecraft.block.material.Material argument0, int argument1, short argument2, net.minecraft.block.material.MapColor argument3, char argument4) {
|
||||
this(argument0, argument3);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityBeacon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
import net.minecraft.util.HttpUtil;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
public class BlockBeacon extends BlockContainer {
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumWorldBlockLayer getBlockLayer() {
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
public BlockBeacon() {
|
||||
super(Material.glass, MapColor.diamondColor);
|
||||
this.setHardness(3.0F);
|
||||
this.setCreativeTab(CreativeTabs.tabMisc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var3, int var4) {
|
||||
return new TileEntityBeacon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World var3, BlockPos var4, IBlockState var5, EntityLivingBase var6, ItemStack var7) {
|
||||
|
||||
super.onBlockPlacedBy(var3, var4, var5, var6, var7);
|
||||
if (var7.hasDisplayName()) {
|
||||
TileEntity var14 = var3.getTileEntity(var4);
|
||||
if (var14 instanceof TileEntityBeacon) {
|
||||
((TileEntityBeacon)var14).setName(var7.getDisplayName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World var1, BlockPos var4, IBlockState var5, EntityPlayer var6, EnumFacing var7, float var8, float var9, float var10
|
||||
) {
|
||||
|
||||
if (var1.isRemote) {
|
||||
return true;
|
||||
}
|
||||
|
||||
TileEntity var17 = var1.getTileEntity(var4);
|
||||
if (var17 instanceof TileEntityBeacon) {
|
||||
var6.displayGUIChest((TileEntityBeacon)var17);
|
||||
var6.triggerAchievement(StatList.field_181730_N);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World var1, BlockPos var4, IBlockState var5, Block var6) {
|
||||
|
||||
TileEntity var14 = var1.getTileEntity(var4);
|
||||
if (var14 instanceof TileEntityBeacon) {
|
||||
((TileEntityBeacon)var14).updateBeacon();
|
||||
var1.addBlockEvent(var4, this, 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void updateColorAsync(World var0, BlockPos var1) {
|
||||
HttpUtil.field_180193_a.submit(new BlockBeacon.UpdateColorAsyncTask(var0, var1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static class UpdateColorAsyncTask implements Runnable {
|
||||
final BlockPos val$glassPos;
|
||||
|
||||
final World val$worldIn;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
Chunk var11 = this.val$worldIn.getChunkFromBlockCoords(this.val$glassPos);
|
||||
|
||||
for (int var12 = this.val$glassPos.getY() - 1; var12 >= 0; var12--) {
|
||||
BlockPos var13 = new BlockPos(this.val$glassPos.getX(), var12, this.val$glassPos.getZ());
|
||||
if (!var11.canSeeSky(var13)) {
|
||||
break;
|
||||
}
|
||||
|
||||
IBlockState var14 = this.val$worldIn.getBlockState(var13);
|
||||
if (var14.getBlock() == Blocks.beacon) {
|
||||
((WorldServer)this.val$worldIn).addScheduledTask(new BlockBeacon.UpdateColorAsyncTask.UpdateTask(this, var13));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UpdateColorAsyncTask(World var1, BlockPos var2) {
|
||||
this.val$worldIn = var1;
|
||||
this.val$glassPos = var2;
|
||||
}
|
||||
|
||||
public static class UpdateTask implements Runnable {
|
||||
final BlockPos val$blockpos;
|
||||
final BlockBeacon.UpdateColorAsyncTask this$0;
|
||||
|
||||
UpdateTask(BlockBeacon.UpdateColorAsyncTask var1, BlockPos var2) {
|
||||
this.this$0 = var1;
|
||||
this.val$blockpos = var2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
TileEntity var10 = this.this$0.val$worldIn.getTileEntity(this.val$blockpos);
|
||||
if (var10 instanceof TileEntityBeacon) {
|
||||
((TileEntityBeacon)var10).updateBeacon();
|
||||
this.this$0.val$worldIn.addBlockEvent(this.val$blockpos, Blocks.beacon, 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public BlockBeacon(int argument0, byte argument1, int argument2) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,386 @@
|
||||
package net.minecraft.block;
|
||||
import net.minecraft.block.BlockDirectional;
|
||||
import net.minecraft.block.properties.PropertyDirection;
|
||||
|
||||
import java.lang.invoke.CallSite;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.MethodType;
|
||||
import java.lang.invoke.MutableCallSite;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
public class BlockBed extends BlockDirectional {
|
||||
|
||||
public static final PropertyBool OCCUPIED;
|
||||
public static final PropertyEnum<BlockBed.EnumPartType> PART;
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public EnumWorldBlockLayer getBlockLayer() {
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMobilityFlag() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance(World var1, BlockPos var4, IBlockState var5, float var6, int var7) {
|
||||
|
||||
if (var5.getValue(net.minecraft.block.BlockBed.PART) == BlockBed.EnumPartType.FOOT) {
|
||||
super.dropBlockAsItemWithChance(var1, var4, var5, var6, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World var3, BlockPos var4, IBlockState var5, EntityPlayer var6) {
|
||||
|
||||
if (var6.capabilities.isCreativeMode
|
||||
&& var5.getValue(net.minecraft.block.BlockBed.PART) == BlockBed.EnumPartType.HEAD) {
|
||||
BlockPos var14 = var4.offset(
|
||||
((EnumFacing)var5.getValue(net.minecraft.block.BlockDirectional.FACING)).getOpposite()
|
||||
);
|
||||
if (var3.getBlockState(var14).getBlock() == this) {
|
||||
var3.setBlockToAir(var14);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
finishInitialization: {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PART = PropertyEnum.create("part", BlockBed.EnumPartType.class);
|
||||
OCCUPIED = PropertyBool.create("occupied");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void setBedBounds() {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5625F, 1.0F);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Item getItem(World var1, BlockPos var4) {
|
||||
return Items.bed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess var3, BlockPos var4) {
|
||||
|
||||
this.setBedBounds();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World var1, BlockPos var4, IBlockState var5, EntityPlayer var6, EnumFacing var7, float var8, float var9, float var10
|
||||
) {
|
||||
|
||||
|
||||
if (var1.isRemote) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (var5.getValue(net.minecraft.block.BlockBed.PART) != BlockBed.EnumPartType.HEAD) {
|
||||
var4 = var4.offset((EnumFacing)var5.getValue(net.minecraft.block.BlockDirectional.FACING));
|
||||
var5 = var1.getBlockState(var4);
|
||||
if (var5.getBlock() != this) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (var1.provider.canRespawnHere()
|
||||
&& var1.getBiomeGenForCoords(var4) != BiomeGenBase.hell) {
|
||||
if ((Boolean)var5.getValue(net.minecraft.block.BlockBed.OCCUPIED)) {
|
||||
EntityPlayer var39 = this.getPlayerInBed(var1, var4);
|
||||
if (var39 != null) {
|
||||
var6.addChatComponentMessage(new ChatComponentTranslation("tile.bed.occupied"));
|
||||
return true;
|
||||
}
|
||||
|
||||
var5 = var5.withProperty(net.minecraft.block.BlockBed.OCCUPIED, false);
|
||||
var1.setBlockState(var4, var5, 4);
|
||||
}
|
||||
|
||||
EntityPlayer.EnumStatus var40 = var6.trySleep(var4);
|
||||
if (var40 == EntityPlayer.EnumStatus.OK) {
|
||||
var5 = var5.withProperty(net.minecraft.block.BlockBed.OCCUPIED, true);
|
||||
var1.setBlockState(var4, var5, 4);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (var40 == EntityPlayer.EnumStatus.NOT_POSSIBLE_NOW) {
|
||||
var6.addChatComponentMessage(new ChatComponentTranslation("tile.bed.noSleep"));
|
||||
} else if (var40 == EntityPlayer.EnumStatus.NOT_SAFE) {
|
||||
var6.addChatComponentMessage(new ChatComponentTranslation("tile.bed.notSafe"));
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
var1.setBlockToAir(var4);
|
||||
BlockPos var37 = var4.offset(
|
||||
((EnumFacing)var5.getValue(net.minecraft.block.BlockDirectional.FACING)).getOpposite()
|
||||
);
|
||||
if (var1.getBlockState(var37).getBlock() == this) {
|
||||
var1.setBlockToAir(var37);
|
||||
}
|
||||
|
||||
var1.newExplosion(
|
||||
(Entity)null,
|
||||
var4.getX() + 0.5,
|
||||
var4.getY() + 0.5,
|
||||
var4.getZ() + 0.5,
|
||||
5.0F,
|
||||
true,
|
||||
true
|
||||
);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState iBlockState) {
|
||||
|
||||
int n;
|
||||
block5: {
|
||||
int n2;
|
||||
block4: {
|
||||
|
||||
n2 = 0;
|
||||
|
||||
PropertyDirection propertyDirection = BlockDirectional.FACING;
|
||||
n2 = 0 | ((EnumFacing)((Object)iBlockState.getValue(propertyDirection))).getHorizontalIndex();
|
||||
|
||||
PropertyEnum<EnumPartType> propertyEnum = PART;
|
||||
if (iBlockState.getValue(propertyEnum) != EnumPartType.HEAD) break block4;
|
||||
n2 |= 8;
|
||||
|
||||
PropertyBool propertyBool = OCCUPIED;
|
||||
n = ((Boolean)iBlockState.getValue(propertyBool)).booleanValue() ? 1 : 0;
|
||||
|
||||
if (n != 0) {
|
||||
n2 |= 4;
|
||||
}
|
||||
}
|
||||
n = n2;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static BlockPos getSafeExitLocation(World var2, BlockPos var3, int var4) {
|
||||
EnumFacing var11 = (EnumFacing)var2.getBlockState(var3).getValue(net.minecraft.block.BlockDirectional.FACING);
|
||||
|
||||
int var12 = var3.getX();
|
||||
|
||||
int var13 = var3.getY();
|
||||
int var14 = var3.getZ();
|
||||
|
||||
for (int var15 = 0; var15 <= 1; var15++) {
|
||||
int var16 = var12 - var11.getFrontOffsetX() * var15 - 1;
|
||||
int var17 = var14 - var11.getFrontOffsetZ() * var15 - 1;
|
||||
int var18 = var16 + 2;
|
||||
int var19 = var17 + 2;
|
||||
int var20 = var16;
|
||||
|
||||
while (var20 <= var18) {
|
||||
for (int var21 = var17; var21 <= var19; var21++) {
|
||||
BlockPos var22 = new BlockPos(var20, var13, var21);
|
||||
if (hasRoomForPlayer(var2, var22)) {
|
||||
if (var4 <= 0) {
|
||||
return var22;
|
||||
}
|
||||
|
||||
var4--;
|
||||
}
|
||||
}
|
||||
|
||||
var20++;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, net.minecraft.block.BlockDirectional.FACING, net.minecraft.block.BlockBed.PART, net.minecraft.block.BlockBed.OCCUPIED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World var1, BlockPos var4, IBlockState var5, Block var6) {
|
||||
|
||||
|
||||
EnumFacing var17 = (EnumFacing)var5.getValue(net.minecraft.block.BlockDirectional.FACING);
|
||||
if (var5.getValue(net.minecraft.block.BlockBed.PART) == BlockBed.EnumPartType.HEAD) {
|
||||
if (var1.getBlockState(var4.offset(var17.getOpposite())).getBlock() != this) {
|
||||
var1.setBlockToAir(var4);
|
||||
}
|
||||
} else if (var1.getBlockState(var4.offset(var17)).getBlock() != this) {
|
||||
var1.setBlockToAir(var4);
|
||||
if (!var1.isRemote) {
|
||||
this.dropBlockAsItem(var1, var4, var5, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState var1, Random var4, int var5) {
|
||||
return var1.getValue(net.minecraft.block.BlockBed.PART) == BlockBed.EnumPartType.HEAD
|
||||
? null
|
||||
: Items.bed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState var1, IBlockAccess var4, BlockPos var5) {
|
||||
|
||||
if (var1.getValue(net.minecraft.block.BlockBed.PART) == BlockBed.EnumPartType.FOOT) {
|
||||
IBlockState var13 = var4.getBlockState(
|
||||
var5.offset((EnumFacing)var1.getValue(net.minecraft.block.BlockDirectional.FACING))
|
||||
);
|
||||
|
||||
if (var13.getBlock() == this) {
|
||||
var1 = var1.withProperty(
|
||||
net.minecraft.block.BlockBed.OCCUPIED, (Boolean)var13.getValue(net.minecraft.block.BlockBed.OCCUPIED)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return var1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
EnumFacing var6 = EnumFacing.getHorizontal(var1);
|
||||
return (var1 & 8) > 0
|
||||
? this.getDefaultState()
|
||||
.withProperty(net.minecraft.block.BlockBed.PART, BlockBed.EnumPartType.HEAD)
|
||||
.withProperty(net.minecraft.block.BlockDirectional.FACING, var6)
|
||||
.withProperty(net.minecraft.block.BlockBed.OCCUPIED, (var1 & 4) > 0)
|
||||
: this.getDefaultState()
|
||||
.withProperty(net.minecraft.block.BlockBed.PART, BlockBed.EnumPartType.FOOT)
|
||||
.withProperty(net.minecraft.block.BlockDirectional.FACING, var6);
|
||||
}
|
||||
|
||||
public BlockBed() {
|
||||
super(Material.AdvancedAntiSkid11iIIiiI);
|
||||
this.setDefaultState(
|
||||
this.blockState
|
||||
.getBaseState()
|
||||
.withProperty(net.minecraft.block.BlockBed.PART, BlockBed.EnumPartType.FOOT)
|
||||
.withProperty(net.minecraft.block.BlockBed.OCCUPIED, false)
|
||||
);
|
||||
this.setBedBounds();
|
||||
}
|
||||
|
||||
protected static boolean hasRoomForPlayer(World var0, BlockPos var3) {
|
||||
return World.doesBlockHaveSolidTopSurface(var0, var3.down())
|
||||
&& !var0.getBlockState(var3).getBlock().getMaterial().isSolid()
|
||||
&& !var0.getBlockState(var3.up()).getBlock().getMaterial().isSolid();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
private EntityPlayer getPlayerInBed(World var1, BlockPos var2) {
|
||||
|
||||
|
||||
for (EntityPlayer var7 : var1.playerEntities) {
|
||||
if (var7.isPlayerSleeping() && var7.playerLocation.equals(var2)) {
|
||||
return var7;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public enum EnumPartType implements net.minecraft.util.IStringSerializable {
|
||||
HEAD("head"),
|
||||
FOOT("foot");
|
||||
|
||||
private static final net.minecraft.block.BlockBed.EnumPartType[] AdvancedAntiSkid1l1lli1I = $values();
|
||||
private final java.lang.String name;
|
||||
|
||||
EnumPartType(java.lang.String var3) {
|
||||
this.name = var3;
|
||||
}
|
||||
|
||||
private static net.minecraft.block.BlockBed.EnumPartType[] $values() {
|
||||
return new net.minecraft.block.BlockBed.EnumPartType[]{HEAD, FOOT};
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public java.lang.String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public java.lang.String toString() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
||||
public BlockBed(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class BlockBookshelf extends Block {
|
||||
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random var1) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState var1, Random var4, int var5) {
|
||||
return Items.book;
|
||||
}
|
||||
|
||||
public BlockBookshelf() {
|
||||
super(Material.wood);
|
||||
this.setCreativeTab(CreativeTabs.tabBlock);
|
||||
}
|
||||
|
||||
public BlockBookshelf(short argument0, int argument1, char argument2) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BlockBreakable extends Block {
|
||||
private boolean ignoreSimilarity;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public BlockBreakable(Material var1, boolean var2) {
|
||||
this(var1, var2, var1.getMaterialMapColor());
|
||||
}
|
||||
|
||||
protected BlockBreakable(Material var1, boolean var2, MapColor var3) {
|
||||
super(var1, var3);
|
||||
this.ignoreSimilarity = var2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess var3, BlockPos var4, EnumFacing var5) {
|
||||
IBlockState var10 = var3.getBlockState(var4);
|
||||
Block var11 = var10.getBlock();
|
||||
if (this == Blocks.glass || this == Blocks.stained_glass) {
|
||||
if (var3.getBlockState(var4.offset(var5.getOpposite())) != var10) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (var11 == this) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return !this.ignoreSimilarity && var11 == this ? false : super.shouldSideBeRendered(var3, var4, var5);
|
||||
}
|
||||
|
||||
public BlockBreakable(net.minecraft.block.material.Material argument0, boolean argument1, long argument2) {
|
||||
this(argument0, argument1);
|
||||
}
|
||||
|
||||
protected BlockBreakable(net.minecraft.block.material.Material argument0, boolean argument1, net.minecraft.block.material.MapColor argument2, short argument3, long argument4) {
|
||||
this(argument0, argument1, argument2);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,216 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.lang.invoke.CallSite;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.MethodType;
|
||||
import java.lang.invoke.MutableCallSite;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.InventoryHelper;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityBrewingStand;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockBrewingStand extends BlockContainer {
|
||||
|
||||
public static final PropertyBool[] HAS_BOTTLE;
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World var1, BlockPos var2, IBlockState var5, Random var6) {
|
||||
|
||||
double var9 = var2.getX() + 0.4F + var6.nextFloat() * 0.2F;
|
||||
double var11 = var2.getY() + 0.7F + var6.nextFloat() * 0.3F;
|
||||
double var13 = var2.getZ() + 0.4F + var6.nextFloat() * 0.2F;
|
||||
var1.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, var9, var11, var13, 0.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState var3) {
|
||||
|
||||
int var8 = 0;
|
||||
|
||||
for (int var9 = 0; var9 < 3; var9++) {
|
||||
if ((Boolean)var3.getValue(net.minecraft.block.BlockBrewingStand.HAS_BOTTLE[var9])) {
|
||||
var8 |= 1 << var9;
|
||||
}
|
||||
}
|
||||
|
||||
return var8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
static {
|
||||
finishInitialization: {
|
||||
|
||||
HAS_BOTTLE = new PropertyBool[]{
|
||||
PropertyBool.create("has_bottle_0"),
|
||||
PropertyBool.create("has_bottle_1"),
|
||||
PropertyBool.create("has_bottle_2")
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World var3, BlockPos var4, IBlockState var5, EntityLivingBase var6, ItemStack var7) {
|
||||
|
||||
if (var7.hasDisplayName()) {
|
||||
TileEntity var12 = var3.getTileEntity(var4);
|
||||
if (var12 instanceof TileEntityBrewingStand) {
|
||||
((TileEntityBrewingStand)var12).setName(var7.getDisplayName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World var1, BlockPos var4, IBlockState var5, EntityPlayer var6, EnumFacing var7, float var8, float var9, float var10
|
||||
) {
|
||||
|
||||
if (var1.isRemote) {
|
||||
return true;
|
||||
}
|
||||
|
||||
TileEntity var17 = var1.getTileEntity(var4);
|
||||
if (var17 instanceof TileEntityBrewingStand) {
|
||||
var6.displayGUIChest((TileEntityBrewingStand)var17);
|
||||
var6.triggerAchievement(StatList.field_181729_M);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World var1, BlockPos var2, IBlockState var3, AxisAlignedBB var4, List var5, Entity var6) {
|
||||
|
||||
this.setBlockBounds(0.4375F, 0.0F, 0.4375F, 0.5625F, 0.875F, 0.5625F);
|
||||
super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6);
|
||||
this.setBlockBoundsForItemRender();
|
||||
super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World var1, BlockPos var2) {
|
||||
|
||||
return Container.calcRedstone(var1.getTileEntity(var2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumWorldBlockLayer getBlockLayer() {
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocalizedName() {
|
||||
|
||||
return StatCollector.translateToLocal("item.brewingStand.name");
|
||||
}
|
||||
|
||||
public BlockBrewingStand() {
|
||||
super(Material.iron);
|
||||
this.setDefaultState(
|
||||
this.blockState
|
||||
.getBaseState()
|
||||
.withProperty(net.minecraft.block.BlockBrewingStand.HAS_BOTTLE[0], false)
|
||||
.withProperty(net.minecraft.block.BlockBrewingStand.HAS_BOTTLE[1], false)
|
||||
.withProperty(net.minecraft.block.BlockBrewingStand.HAS_BOTTLE[2], false)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var3, int var4) {
|
||||
return new TileEntityBrewingStand();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, net.minecraft.block.BlockBrewingStand.HAS_BOTTLE[0], net.minecraft.block.BlockBrewingStand.HAS_BOTTLE[1], net.minecraft.block.BlockBrewingStand.HAS_BOTTLE[2]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState var1, Random var4, int var5) {
|
||||
return Items.brewing_stand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItem(World var1, BlockPos var4) {
|
||||
return Items.brewing_stand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World var1, BlockPos var4, IBlockState var5) {
|
||||
|
||||
TileEntity var12 = var1.getTileEntity(var4);
|
||||
if (var12 instanceof TileEntityBrewingStand) {
|
||||
InventoryHelper.dropInventoryItems((net.minecraft.world.World) (var1), (net.minecraft.util.BlockPos) (var4), (net.minecraft.inventory.IInventory) ((TileEntityBrewingStand)var12));
|
||||
}
|
||||
|
||||
super.breakBlock(var1, var4, var5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
|
||||
IBlockState var7 = this.getDefaultState();
|
||||
|
||||
for (int var8 = 0; var8 < 3; var8++) {
|
||||
var7 = var7.withProperty(net.minecraft.block.BlockBrewingStand.HAS_BOTTLE[var8], (var1 & 1 << var8) > 0);
|
||||
}
|
||||
|
||||
return var7;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsForItemRender() {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
|
||||
}
|
||||
|
||||
public BlockBrewingStand(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockBush extends Block {
|
||||
|
||||
|
||||
protected BlockBush(Material var3, MapColor var4) {
|
||||
super(var3, var4);
|
||||
this.setTickRandomly(true);
|
||||
float var8 = 0.2F;
|
||||
this.setBlockBounds(0.5F - var8, 0.0F, 0.5F - var8, 0.5F + var8, var8 * 3.0F, 0.5F + var8);
|
||||
this.setCreativeTab(CreativeTabs.tabDecorations);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World var1, BlockPos var4) {
|
||||
|
||||
return super.canPlaceBlockAt(var1, var4)
|
||||
&& this.canPlaceBlockOn(var1.getBlockState(var4.down()).getBlock());
|
||||
}
|
||||
|
||||
public BlockBush() {
|
||||
this(Material.plants);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World var1, BlockPos var4, IBlockState var5, Block var6) {
|
||||
|
||||
super.onNeighborBlockChange(var1, var4, var5, var6);
|
||||
this.checkAndDropBlock(var1, var4, var5);
|
||||
}
|
||||
|
||||
protected void checkAndDropBlock(World var1, BlockPos var2, IBlockState var5) {
|
||||
|
||||
if (!this.canBlockStay(var1, var2, var5)) {
|
||||
this.dropBlockAsItem(var1, var2, var5, 0);
|
||||
var1.setBlockState(var2, Blocks.air.getDefaultState(), 3);
|
||||
}
|
||||
}
|
||||
|
||||
public BlockBush(Material var3) {
|
||||
this(var3, var3.getMaterialMapColor());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World var1, BlockPos var2, IBlockState var3, Random var6) {
|
||||
|
||||
this.checkAndDropBlock(var1, var2, var3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean canBlockStay(World var1, BlockPos var4, IBlockState var5) {
|
||||
|
||||
return this.canPlaceBlockOn(var1.getBlockState(var4.down()).getBlock());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumWorldBlockLayer getBlockLayer() {
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
protected boolean canPlaceBlockOn(Block var1) {
|
||||
return var1 == Blocks.grass || var1 == Blocks.dirt || var1 == Blocks.farmland;
|
||||
}
|
||||
|
||||
protected BlockBush(long argument0, net.minecraft.block.material.Material argument1, net.minecraft.block.material.MapColor argument2) {
|
||||
this(argument1, argument2);
|
||||
}
|
||||
|
||||
public BlockBush(byte argument0, long argument1) {
|
||||
this();
|
||||
}
|
||||
|
||||
public BlockBush(long argument0, net.minecraft.block.material.Material argument1) {
|
||||
this(argument1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,434 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.lang.invoke.CallSite;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.MethodType;
|
||||
import java.lang.invoke.MutableCallSite;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.properties.PropertyDirection;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class BlockButton extends Block {
|
||||
|
||||
|
||||
private final boolean wooden;
|
||||
public static final PropertyDirection FACING;
|
||||
|
||||
public static final PropertyBool POWERED;
|
||||
|
||||
|
||||
@Override
|
||||
public int getStrongPower(IBlockAccess var3, BlockPos var4, IBlockState var5, EnumFacing var6) {
|
||||
return !var5.getValue(net.minecraft.block.BlockButton.POWERED)
|
||||
? 0
|
||||
: (var5.getValue(net.minecraft.block.BlockButton.FACING) == var6 ? 15 : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWeakPower(IBlockAccess var2, BlockPos var3, IBlockState var4, EnumFacing var5) {
|
||||
return var4.getValue(net.minecraft.block.BlockButton.POWERED) ? 15 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
static {
|
||||
finishInitialization: {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
FACING = PropertyDirection.create("facing");
|
||||
POWERED = PropertyBool.create("powered");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World var1, BlockPos var4, IBlockState var5, Entity var6) {
|
||||
|
||||
if (!var1.isRemote
|
||||
&& this.wooden
|
||||
&& !(Boolean)var5.getValue(net.minecraft.block.BlockButton.POWERED)) {
|
||||
this.checkForArrows(var1, var4, var5);
|
||||
}
|
||||
}
|
||||
|
||||
private void notifyNeighbors(World var1, BlockPos var2, EnumFacing var5) {
|
||||
|
||||
var1.notifyNeighborsOfStateChange(var2, this);
|
||||
var1.notifyNeighborsOfStateChange(var2.offset(var5.getOpposite()), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World var1, BlockPos var4, IBlockState var5, EntityPlayer var6, EnumFacing var7, float var8, float var9, float var10
|
||||
) {
|
||||
|
||||
if ((Boolean)var5.getValue(net.minecraft.block.BlockButton.POWERED)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var1.setBlockState(var4, var5.withProperty(net.minecraft.block.BlockButton.POWERED, true), 3);
|
||||
var1.markBlockRangeForRenderUpdate(var4, var4);
|
||||
var1.playSoundEffect(
|
||||
var4.getX() + 0.5, var4.getY() + 0.5, var4.getZ() + 0.5, "random.click", 0.3F, 0.6F
|
||||
);
|
||||
this.notifyNeighbors(var1, var4, (EnumFacing)var5.getValue(net.minecraft.block.BlockButton.FACING));
|
||||
var1.scheduleUpdate(var4, this, this.tickRate(var1));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState onBlockPlaced(
|
||||
World var1, BlockPos var2, EnumFacing var3, float var4, float var7, float var8, int var9, EntityLivingBase var10
|
||||
) {
|
||||
|
||||
return func_181088_a(var1, var2, var3.getOpposite())
|
||||
? this.getDefaultState()
|
||||
.withProperty(net.minecraft.block.BlockButton.FACING, var3)
|
||||
.withProperty(net.minecraft.block.BlockButton.POWERED, false)
|
||||
: this.getDefaultState()
|
||||
.withProperty(net.minecraft.block.BlockButton.FACING, EnumFacing.DOWN)
|
||||
.withProperty(net.minecraft.block.BlockButton.POWERED, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomTick(World var1, BlockPos var2, IBlockState var3, Random var4) {
|
||||
|
||||
}
|
||||
|
||||
protected static boolean func_181088_a(World var2, BlockPos var3, EnumFacing var4) {
|
||||
BlockPos var12 = var3.offset(var4);
|
||||
return var4 == EnumFacing.DOWN
|
||||
? World.doesBlockHaveSolidTopSurface(var2, var12)
|
||||
: var2.getBlockState(var12).getBlock().isNormalCube();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World var1, BlockPos var2, IBlockState var3, Random var6) {
|
||||
|
||||
|
||||
if (!var1.isRemote && (Boolean)var3.getValue(net.minecraft.block.BlockButton.POWERED)) {
|
||||
if (this.wooden) {
|
||||
this.checkForArrows(var1, var2, var3);
|
||||
} else {
|
||||
var1.setBlockState(var2, var3.withProperty(net.minecraft.block.BlockButton.POWERED, false));
|
||||
this.notifyNeighbors(
|
||||
var1, var2, (EnumFacing)var3.getValue(net.minecraft.block.BlockButton.FACING)
|
||||
);
|
||||
var1.playSoundEffect(
|
||||
var2.getX() + 0.5,
|
||||
var2.getY() + 0.5,
|
||||
var2.getZ() + 0.5,
|
||||
"random.click",
|
||||
0.3F,
|
||||
0.5F
|
||||
);
|
||||
var1.markBlockRangeForRenderUpdate(var2, var2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsForItemRender() {
|
||||
float var3 = 0.1875F;
|
||||
float var4 = 0.125F;
|
||||
float var5 = 0.125F;
|
||||
this.setBlockBounds(0.5F - var3, 0.5F - var4, 0.5F - var5, 0.5F + var3, 0.5F + var4, 0.5F + var5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World var1, BlockPos var4, IBlockState var5) {
|
||||
|
||||
if ((Boolean)var5.getValue(net.minecraft.block.BlockButton.POWERED)) {
|
||||
this.notifyNeighbors(var1, var4, (EnumFacing)var5.getValue(net.minecraft.block.BlockButton.FACING));
|
||||
}
|
||||
|
||||
super.breakBlock(var1, var4, var5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess var3, BlockPos var4) {
|
||||
|
||||
this.updateBlockBounds(var3.getBlockState(var4));
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void updateBlockBounds(IBlockState var4) {
|
||||
|
||||
EnumFacing var11 = (EnumFacing)var4.getValue(net.minecraft.block.BlockButton.FACING);
|
||||
boolean var12 = (Boolean)var4.getValue(net.minecraft.block.BlockButton.POWERED);
|
||||
|
||||
float var15 = (var12 ? 1 : 2) / 16.0F;
|
||||
|
||||
switch (net.minecraft.block.BlockButton.EnumFacingSwitchMap.AdvancedAntiSkid1lIi1I1i[var11.ordinal()]) {
|
||||
case 1:
|
||||
this.setBlockBounds(0.0F, 0.375F, 0.3125F, var15, 0.625F, 0.6875F);
|
||||
break;
|
||||
case 2:
|
||||
this.setBlockBounds(1.0F - var15, 0.375F, 0.3125F, 1.0F, 0.625F, 0.6875F);
|
||||
break;
|
||||
case 3:
|
||||
this.setBlockBounds(0.3125F, 0.375F, 0.0F, 0.6875F, 0.625F, var15);
|
||||
break;
|
||||
case 4:
|
||||
this.setBlockBounds(0.3125F, 0.375F, 1.0F - var15, 0.6875F, 0.625F, 1.0F);
|
||||
break;
|
||||
case 5:
|
||||
this.setBlockBounds(0.3125F, 0.0F, 0.375F, 0.6875F, 0.0F + var15, 0.625F);
|
||||
break;
|
||||
case 6:
|
||||
this.setBlockBounds(0.3125F, 1.0F - var15, 0.375F, 0.6875F, 1.0F, 0.625F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World var1, BlockPos var4, IBlockState var5, Block var6) {
|
||||
|
||||
if (this.checkForDrop(var1, var4, var5)
|
||||
&& !func_181088_a(
|
||||
var1, var4, ((EnumFacing)var5.getValue(net.minecraft.block.BlockButton.FACING)).getOpposite()
|
||||
)) {
|
||||
this.dropBlockAsItem(var1, var4, var5, 0);
|
||||
var1.setBlockToAir(var4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void checkForArrows(World var1, BlockPos var2, IBlockState var3) {
|
||||
|
||||
this.updateBlockBounds(var3);
|
||||
AxisAlignedBB var29 = new AxisAlignedBB(
|
||||
var2.getX() + this.minX,
|
||||
var2.getY() + this.minY,
|
||||
var2.getZ() + this.minZ,
|
||||
var2.getX() + this.maxX,
|
||||
var2.getY() + this.maxY,
|
||||
var2.getZ() + this.maxZ
|
||||
);
|
||||
Class<EntityArrow> var30 = EntityArrow.class;
|
||||
List var31 = var1.getEntitiesWithinAABB(var30, var29);
|
||||
boolean var32 = !var31.isEmpty();
|
||||
boolean var33 = (Boolean)var3.getValue(net.minecraft.block.BlockButton.POWERED);
|
||||
if (var32 && !var33) {
|
||||
var1.setBlockState(var2, var3.withProperty(net.minecraft.block.BlockButton.POWERED, true));
|
||||
this.notifyNeighbors(var1, var2, (EnumFacing)var3.getValue(net.minecraft.block.BlockButton.FACING));
|
||||
var1.markBlockRangeForRenderUpdate(var2, var2);
|
||||
var1.playSoundEffect(
|
||||
var2.getX() + 0.5,
|
||||
var2.getY() + 0.5,
|
||||
var2.getZ() + 0.5,
|
||||
"random.click",
|
||||
0.3F,
|
||||
0.6F
|
||||
);
|
||||
}
|
||||
|
||||
if (!var32 && var33) {
|
||||
var1.setBlockState(var2, var3.withProperty(net.minecraft.block.BlockButton.POWERED, false));
|
||||
this.notifyNeighbors(var1, var2, (EnumFacing)var3.getValue(net.minecraft.block.BlockButton.FACING));
|
||||
var1.markBlockRangeForRenderUpdate(var2, var2);
|
||||
var1.playSoundEffect(
|
||||
var2.getX() + 0.5,
|
||||
var2.getY() + 0.5,
|
||||
var2.getZ() + 0.5,
|
||||
"random.click",
|
||||
0.3F,
|
||||
0.5F
|
||||
);
|
||||
}
|
||||
|
||||
if (var32) {
|
||||
var1.scheduleUpdate(var2, this, this.tickRate(var1));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockOnSide(World var1, BlockPos var2, EnumFacing var3) {
|
||||
|
||||
return func_181088_a(var1, var2, var3.getOpposite());
|
||||
}
|
||||
|
||||
private boolean checkForDrop(World var1, BlockPos var4, IBlockState var5) {
|
||||
|
||||
if (this.canPlaceBlockAt(var1, var4)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
this.dropBlockAsItem(var1, var4, var5, 0);
|
||||
var1.setBlockToAir(var4);
|
||||
return false;
|
||||
}
|
||||
|
||||
protected BlockButton(boolean var3) {
|
||||
super(Material.circuits);
|
||||
this.setDefaultState(
|
||||
this.blockState
|
||||
.getBaseState()
|
||||
.withProperty(net.minecraft.block.BlockButton.FACING, EnumFacing.NORTH)
|
||||
.withProperty(net.minecraft.block.BlockButton.POWERED, false)
|
||||
);
|
||||
this.setTickRandomly(true);
|
||||
this.setCreativeTab(CreativeTabs.tabRedstone);
|
||||
this.wooden = var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World var1, BlockPos var4) {
|
||||
|
||||
|
||||
|
||||
for (EnumFacing var14 : EnumFacing.values()) {
|
||||
if (func_181088_a(var1, var4, var14)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState var3) {
|
||||
|
||||
|
||||
byte var8;
|
||||
switch (net.minecraft.block.BlockButton.EnumFacingSwitchMap.AdvancedAntiSkid1lIi1I1i[((EnumFacing)var3.getValue(net.minecraft.block.BlockButton.FACING))
|
||||
.ordinal()]) {
|
||||
case 1:
|
||||
var8 = 1;
|
||||
{
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
var8 = 2;
|
||||
{
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
var8 = 3;
|
||||
{
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
var8 = 4;
|
||||
{
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
default:
|
||||
var8 = 5;
|
||||
break;
|
||||
case 6:
|
||||
var8 = 0;
|
||||
}
|
||||
|
||||
if ((Boolean)var3.getValue(net.minecraft.block.BlockButton.POWERED)) {
|
||||
var8 |= 8;
|
||||
}
|
||||
|
||||
return var8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int tickRate(World var1) {
|
||||
return this.wooden ? 30 : 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
|
||||
|
||||
return this.getDefaultState().withProperty(net.minecraft.block.BlockButton.FACING, switch (var1 & 7) {
|
||||
case 0 -> EnumFacing.DOWN;
|
||||
case 1 -> EnumFacing.EAST;
|
||||
case 2 -> EnumFacing.WEST;
|
||||
case 3 -> EnumFacing.SOUTH;
|
||||
case 4 -> EnumFacing.NORTH;
|
||||
default -> EnumFacing.UP;
|
||||
}).withProperty(net.minecraft.block.BlockButton.POWERED, (var1 & 8) > 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, net.minecraft.block.BlockButton.FACING, net.minecraft.block.BlockButton.POWERED);
|
||||
}
|
||||
|
||||
protected BlockButton(long argument0, boolean argument1) {
|
||||
this(argument1);
|
||||
}
|
||||
|
||||
public static final class EnumFacingSwitchMap {
|
||||
static final int[] AdvancedAntiSkid1lIi1I1i = new int[net.minecraft.util.EnumFacing.values().length];
|
||||
static {
|
||||
try { AdvancedAntiSkid1lIi1I1i[net.minecraft.util.EnumFacing.EAST.ordinal()] = 1; } catch (java.lang.NoSuchFieldError missing) {}
|
||||
try { AdvancedAntiSkid1lIi1I1i[net.minecraft.util.EnumFacing.WEST.ordinal()] = 2; } catch (java.lang.NoSuchFieldError missing) {}
|
||||
try { AdvancedAntiSkid1lIi1I1i[net.minecraft.util.EnumFacing.SOUTH.ordinal()] = 3; } catch (java.lang.NoSuchFieldError missing) {}
|
||||
try { AdvancedAntiSkid1lIi1I1i[net.minecraft.util.EnumFacing.NORTH.ordinal()] = 4; } catch (java.lang.NoSuchFieldError missing) {}
|
||||
try { AdvancedAntiSkid1lIi1I1i[net.minecraft.util.EnumFacing.UP.ordinal()] = 5; } catch (java.lang.NoSuchFieldError missing) {}
|
||||
try { AdvancedAntiSkid1lIi1I1i[net.minecraft.util.EnumFacing.DOWN.ordinal()] = 6; } catch (java.lang.NoSuchFieldError missing) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
public class BlockButtonStone extends BlockButton {
|
||||
|
||||
|
||||
public BlockButtonStone() {
|
||||
super(false);
|
||||
}
|
||||
|
||||
public BlockButtonStone(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
public class BlockButtonWood extends BlockButton {
|
||||
|
||||
|
||||
public BlockButtonWood() {
|
||||
super(true);
|
||||
}
|
||||
|
||||
public BlockButtonWood(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.util.Random;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCactus extends Block {
|
||||
|
||||
public static final PropertyInteger AGE;
|
||||
|
||||
public boolean canBlockStay(World var1, BlockPos var2) {
|
||||
|
||||
|
||||
for (EnumFacing var9 : EnumFacing.Plane.HORIZONTAL) {
|
||||
if (var1.getBlockState(var2.offset(var9))
|
||||
.getBlock()
|
||||
.getMaterial()
|
||||
.isSolid()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Block var11 = var1.getBlockState(var2.down()).getBlock();
|
||||
return var11 == Blocks.cactus || var11 == Blocks.sand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState var3) {
|
||||
|
||||
return (Integer)var3.getValue(net.minecraft.block.BlockCactus.AGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, net.minecraft.block.BlockCactus.AGE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World var1, BlockPos var4, IBlockState var5, Block var6) {
|
||||
|
||||
if (!this.canBlockStay(var1, var4)) {
|
||||
var1.destroyBlock(var4, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) {
|
||||
|
||||
float var6 = 0.0625F;
|
||||
return new AxisAlignedBB(
|
||||
var2.getX() + var6,
|
||||
var2.getY(),
|
||||
var2.getZ() + var6,
|
||||
var2.getX() + 1 - var6,
|
||||
var2.getY() + 1 - var6,
|
||||
var2.getZ() + 1 - var6
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumWorldBlockLayer getBlockLayer() {
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World var1, BlockPos var4, IBlockState var5, Entity var6) {
|
||||
|
||||
var6.attackEntityFrom(DamageSource.cactus, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
return this.getDefaultState().withProperty(net.minecraft.block.BlockCactus.AGE, var1);
|
||||
}
|
||||
|
||||
public BlockCactus() {
|
||||
super(Material.soundPoolEntry);
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(net.minecraft.block.BlockCactus.AGE, 0));
|
||||
this.setTickRandomly(true);
|
||||
this.setCreativeTab(CreativeTabs.tabDecorations);
|
||||
}
|
||||
|
||||
static {
|
||||
|
||||
java.lang.String var0 = "age";
|
||||
AGE = PropertyInteger.create(var0, 0, 15);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World var1, BlockPos var4) {
|
||||
|
||||
return super.canPlaceBlockAt(var1, var4) ? this.canBlockStay(var1, var4) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World var1, BlockPos var2, IBlockState var3, Random var6) {
|
||||
|
||||
|
||||
BlockPos var21 = var2.up();
|
||||
|
||||
if (var1.isAirBlock(var21)) {
|
||||
int var22 = 1;
|
||||
|
||||
do {
|
||||
if (var1.getBlockState(var2.down(var22)).getBlock() != this) {
|
||||
if (var22 < 3) {
|
||||
int var23 = (Integer)var3.getValue(net.minecraft.block.BlockCactus.AGE);
|
||||
if (var23 == 15) {
|
||||
var1.setBlockState(var21, this.getDefaultState());
|
||||
IBlockState var24 = var3.withProperty(net.minecraft.block.BlockCactus.AGE, 0);
|
||||
var1.setBlockState(var2, var24, 4);
|
||||
this.onNeighborBlockChange(var1, var21, var24, this);
|
||||
} else {
|
||||
var1.setBlockState(var2, var3.withProperty(net.minecraft.block.BlockCactus.AGE, var23 + 1), 4);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
var22++;
|
||||
} while (true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBox(World var3, BlockPos var4) {
|
||||
|
||||
float var5 = 0.0625F;
|
||||
return new AxisAlignedBB(
|
||||
var4.getX() + var5,
|
||||
var4.getY(),
|
||||
var4.getZ() + var5,
|
||||
var4.getX() + 1 - var5,
|
||||
var4.getY() + 1,
|
||||
var4.getZ() + 1 - var5
|
||||
);
|
||||
}
|
||||
|
||||
public BlockCactus(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.util.Random;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCake extends Block {
|
||||
public static final PropertyInteger BITES;
|
||||
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState var1, Random var4, int var5) {
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean canBlockStay(World var1, BlockPos var2) {
|
||||
return var1.getBlockState(var2.down()).getBlock().getMaterial().isSolid();
|
||||
}
|
||||
|
||||
private void eatCake(World var1, BlockPos var2, IBlockState var3, EntityPlayer var6) {
|
||||
|
||||
|
||||
if (var6.canEat(false)) {
|
||||
var6.triggerAchievement(StatList.field_181724_H);
|
||||
var6.getFoodStats().addStats((int) (2), (float) (0.1F));
|
||||
int var22 = (Integer)var3.getValue(net.minecraft.block.BlockCake.BITES);
|
||||
if (var22 < 6) {
|
||||
var1.setBlockState(var2, var3.withProperty(net.minecraft.block.BlockCake.BITES, var22 + 1), 3);
|
||||
} else {
|
||||
var1.setBlockToAir(var2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBox(World var3, BlockPos var4) {
|
||||
|
||||
return this.getCollisionBoundingBox(var3, var4, var3.getBlockState(var4));
|
||||
}
|
||||
|
||||
public BlockCake() {
|
||||
super(Material.AdvancedAntiSkidII11llI1);
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(net.minecraft.block.BlockCake.BITES, 0));
|
||||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World var1, BlockPos var4, IBlockState var5, EntityPlayer var6, EnumFacing var7, float var8, float var9, float var10
|
||||
) {
|
||||
|
||||
this.eatCake(var1, var4, var5, var6);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsForItemRender() {
|
||||
float var3 = 0.0625F;
|
||||
float var4 = 0.5F;
|
||||
this.setBlockBounds(var3, 0.0F, var3, 1.0F - var3, var4, 1.0F - var3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World var1, BlockPos var4) {
|
||||
|
||||
return super.canPlaceBlockAt(var1, var4) ? this.canBlockStay(var1, var4) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItem(World var1, BlockPos var4) {
|
||||
return Items.cake;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState var3) {
|
||||
|
||||
return (Integer)var3.getValue(net.minecraft.block.BlockCake.BITES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess var3, BlockPos var4) {
|
||||
|
||||
float var8 = 0.0625F;
|
||||
float var9 = (1 + (Integer)var3.getBlockState(var4).getValue(net.minecraft.block.BlockCake.BITES) * 2)
|
||||
/ 16.0F;
|
||||
float var10 = 0.5F;
|
||||
this.setBlockBounds(var9, 0.0F, var8, 1.0F - var8, var10, 1.0F - var8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World var1, BlockPos var2) {
|
||||
|
||||
return (7 - (Integer)var1.getBlockState(var2).getValue(net.minecraft.block.BlockCake.BITES)) * 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) {
|
||||
|
||||
float var9 = 0.0625F;
|
||||
float var10 = (1 + (Integer)var3.getValue(net.minecraft.block.BlockCake.BITES) * 2) / 16.0F;
|
||||
float var11 = 0.5F;
|
||||
return new AxisAlignedBB(
|
||||
var2.getX() + var10,
|
||||
var2.getY(),
|
||||
var2.getZ() + var9,
|
||||
var2.getX() + 1 - var9,
|
||||
var2.getY() + var11,
|
||||
var2.getZ() + 1 - var9
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumWorldBlockLayer getBlockLayer() {
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
return this.getDefaultState().withProperty(net.minecraft.block.BlockCake.BITES, var1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockClicked(World var1, BlockPos var4, EntityPlayer var5) {
|
||||
|
||||
this.eatCake(var1, var4, var1.getBlockState(var4), var5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random var1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World var1, BlockPos var4, IBlockState var5, Block var6) {
|
||||
|
||||
if (!this.canBlockStay(var1, var4)) {
|
||||
var1.setBlockToAir(var4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, net.minecraft.block.BlockCake.BITES);
|
||||
}
|
||||
|
||||
static {
|
||||
|
||||
java.lang.String var0 = "bites";
|
||||
BITES = PropertyInteger.create(var0, 0, 6);
|
||||
}
|
||||
|
||||
public BlockCake(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.util.List;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCarpet extends Block {
|
||||
public static final PropertyEnum<EnumDyeColor> COLOR;
|
||||
|
||||
|
||||
@Override
|
||||
public MapColor getMapColor(IBlockState var1) {
|
||||
return ((EnumDyeColor)var1.getValue(net.minecraft.block.BlockCarpet.COLOR)).getMapColor();
|
||||
}
|
||||
|
||||
static {
|
||||
|
||||
java.lang.String var0 = "color";
|
||||
COLOR = PropertyEnum.create(var0, EnumDyeColor.class);
|
||||
}
|
||||
|
||||
private boolean checkForDrop(World var1, BlockPos var4, IBlockState var5) {
|
||||
|
||||
if (!this.canBlockStay(var1, var4)) {
|
||||
this.dropBlockAsItem(var1, var4, var5, 0);
|
||||
var1.setBlockToAir(var4);
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(net.minecraft.item.Item var2, net.minecraft.creativetab.CreativeTabs var4, java.util.List<net.minecraft.item.ItemStack> var6) {
|
||||
|
||||
|
||||
for (int var12 = 0; var12 < 16; var12++) {
|
||||
int var13 = var12;
|
||||
byte var14 = 1;
|
||||
Item var15 = var2;
|
||||
var6.add(new ItemStack(var15, var14, var13));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, net.minecraft.block.BlockCarpet.COLOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World var1, BlockPos var4) {
|
||||
|
||||
return super.canPlaceBlockAt(var1, var4) && this.canBlockStay(var1, var4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World var1, BlockPos var4, IBlockState var5, Block var6) {
|
||||
|
||||
this.checkForDrop(var1, var4, var5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess var3, BlockPos var4, EnumFacing var5) {
|
||||
return var5 == EnumFacing.UP ? true : super.shouldSideBeRendered(var3, var4, var5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState var1) {
|
||||
return ((EnumDyeColor)var1.getValue(net.minecraft.block.BlockCarpet.COLOR)).getMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void setBlockBoundsFromMeta(int var1) {
|
||||
byte var2 = 0;
|
||||
float var3 = 1 * (1 + var2) / 16.0F;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, var3, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess var3, BlockPos var4) {
|
||||
|
||||
this.setBlockBoundsFromMeta(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsForItemRender() {
|
||||
this.setBlockBoundsFromMeta(0);
|
||||
}
|
||||
|
||||
private boolean canBlockStay(World var3, BlockPos var4) {
|
||||
return !var3.isAirBlock(var4.down());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
return this.getDefaultState().withProperty(net.minecraft.block.BlockCarpet.COLOR, EnumDyeColor.byMetadata(var1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState var3) {
|
||||
|
||||
return ((EnumDyeColor)var3.getValue(net.minecraft.block.BlockCarpet.COLOR)).getMetadata();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public BlockCarpet() {
|
||||
super(Material.updateState1100);
|
||||
this.setDefaultState(
|
||||
this.blockState.getBaseState().withProperty(net.minecraft.block.BlockCarpet.COLOR, EnumDyeColor.WHITE)
|
||||
);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F);
|
||||
this.setTickRandomly(true);
|
||||
this.setCreativeTab(CreativeTabs.tabDecorations);
|
||||
this.setBlockBoundsFromMeta(0);
|
||||
}
|
||||
|
||||
public BlockCarpet(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class BlockCarrot extends BlockCrops {
|
||||
|
||||
|
||||
@Override
|
||||
protected Item getCrop() {
|
||||
return Items.carrot;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Item getSeed() {
|
||||
return Items.carrot;
|
||||
}
|
||||
|
||||
public BlockCarrot() {
|
||||
super();
|
||||
}
|
||||
|
||||
public BlockCarrot(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,250 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemBanner;
|
||||
import net.minecraft.item.ItemPotion;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.tileentity.TileEntityBanner;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCauldron extends Block {
|
||||
public static final PropertyInteger LEVEL;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
return this.getDefaultState().withProperty(net.minecraft.block.BlockCauldron.LEVEL, var1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World var1, BlockPos var2) {
|
||||
|
||||
return (Integer)var1.getBlockState(var2).getValue(net.minecraft.block.BlockCauldron.LEVEL);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, net.minecraft.block.BlockCauldron.LEVEL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World var1, BlockPos var2, IBlockState var3, AxisAlignedBB var4, List var5, Entity var6) {
|
||||
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F);
|
||||
super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6);
|
||||
float var13 = 0.125F;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, var13, 1.0F, 1.0F);
|
||||
super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var13);
|
||||
super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6);
|
||||
this.setBlockBounds(1.0F - var13, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6);
|
||||
this.setBlockBounds(0.0F, 0.0F, 1.0F - var13, 1.0F, 1.0F, 1.0F);
|
||||
super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6);
|
||||
this.setBlockBoundsForItemRender();
|
||||
}
|
||||
|
||||
public void setWaterLevel(World var1, BlockPos var2, IBlockState var3, int var6) {
|
||||
|
||||
var1.setBlockState(
|
||||
var2, var3.withProperty(net.minecraft.block.BlockCauldron.LEVEL, MathHelper.clamp_int(var6, 0, 3)), 2
|
||||
);
|
||||
var1.updateComparatorOutputLevel(var2, this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState var1, Random var4, int var5) {
|
||||
return Items.cauldron;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsForItemRender() {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItem(World var1, BlockPos var4) {
|
||||
return Items.cauldron;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World var1, BlockPos var4, IBlockState var5, EntityPlayer var6, EnumFacing var7, float var8, float var9, float var10
|
||||
) {
|
||||
|
||||
|
||||
if (var1.isRemote) {
|
||||
return true;
|
||||
}
|
||||
|
||||
ItemStack var49 = var6.inventory.getCurrentItem();
|
||||
if (var49 == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
int var50 = (Integer)var5.getValue(net.minecraft.block.BlockCauldron.LEVEL);
|
||||
Item var51 = var49.getItem();
|
||||
if (var51 == Items.water_bucket) {
|
||||
if (var50 < 3) {
|
||||
if (!var6.capabilities.isCreativeMode) {
|
||||
var6.inventory
|
||||
.setInventorySlotContents(var6.inventory.currentItem, new ItemStack(Items.bucket));
|
||||
}
|
||||
|
||||
var6.triggerAchievement(StatList.field_181725_I);
|
||||
this.setWaterLevel(var1, var4, var5, 3);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (var51 == Items.glass_bottle) {
|
||||
if (var50 > 0) {
|
||||
if (!var6.capabilities.isCreativeMode) {
|
||||
byte var53 = 0;
|
||||
byte var54 = 1;
|
||||
ItemPotion var55 = Items.potionitem;
|
||||
ItemStack var58 = new ItemStack(var55, var54, var53);
|
||||
if (!var6.inventory.addItemStackToInventory(var58)) {
|
||||
EntityItem var56 = new EntityItem(
|
||||
var1, var4.getX() + 0.5, var4.getY() + 1.5, var4.getZ() + 0.5, var58
|
||||
);
|
||||
var1.spawnEntityInWorld(var56);
|
||||
} else if (var6 instanceof EntityPlayerMP) {
|
||||
((EntityPlayerMP)var6).sendContainerToPlayer(var6.inventoryContainer);
|
||||
}
|
||||
|
||||
var6.triggerAchievement(StatList.field_181726_J);
|
||||
var49.stackSize--;
|
||||
if (var49.stackSize <= 0) {
|
||||
var6.inventory.setInventorySlotContents(var6.inventory.currentItem, (ItemStack)null);
|
||||
}
|
||||
}
|
||||
|
||||
this.setWaterLevel(var1, var4, var5, var50 - 1);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (var50 > 0
|
||||
&& var51 instanceof ItemArmor var52
|
||||
&& var52.getArmorMaterial() == ItemArmor.ArmorMaterial.LEATHER
|
||||
&& var52.hasColor(var49)) {
|
||||
var52.removeColor(var49);
|
||||
this.setWaterLevel(var1, var4, var5, var50 - 1);
|
||||
var6.triggerAchievement(StatList.field_181727_K);
|
||||
return true;
|
||||
} else if (var50 > 0 && var51 instanceof ItemBanner && TileEntityBanner.getPatterns(var49) > 0) {
|
||||
ItemStack var57 = var49.copy();
|
||||
var57.stackSize = 1;
|
||||
TileEntityBanner.removeBannerData(var57);
|
||||
if (var49.stackSize <= 1 && !var6.capabilities.isCreativeMode) {
|
||||
var6.inventory.setInventorySlotContents(var6.inventory.currentItem, var57);
|
||||
} else {
|
||||
if (!var6.inventory.addItemStackToInventory(var57)) {
|
||||
EntityItem var47 = new EntityItem(
|
||||
var1, var4.getX() + 0.5, var4.getY() + 1.5, var4.getZ() + 0.5, var57
|
||||
);
|
||||
var1.spawnEntityInWorld(var47);
|
||||
} else if (var6 instanceof EntityPlayerMP) {
|
||||
((EntityPlayerMP)var6).sendContainerToPlayer(var6.inventoryContainer);
|
||||
}
|
||||
|
||||
var6.triggerAchievement(StatList.field_181728_L);
|
||||
if (!var6.capabilities.isCreativeMode) {
|
||||
var49.stackSize--;
|
||||
}
|
||||
}
|
||||
|
||||
if (!var6.capabilities.isCreativeMode) {
|
||||
this.setWaterLevel(var1, var4, var5, var50 - 1);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillWithRain(World var1, BlockPos var4) {
|
||||
|
||||
if (var1.rand.nextInt(20) == 1) {
|
||||
IBlockState var12 = var1.getBlockState(var4);
|
||||
if ((Integer)var12.getValue(net.minecraft.block.BlockCauldron.LEVEL) < 3) {
|
||||
var1.setBlockState(var4, var12.cycleProperty(net.minecraft.block.BlockCauldron.LEVEL), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World var1, BlockPos var4, IBlockState var5, Entity var6) {
|
||||
|
||||
int var14 = (Integer)var5.getValue(net.minecraft.block.BlockCauldron.LEVEL);
|
||||
float var15 = var4.getY() + (6.0F + 3 * var14) / 16.0F;
|
||||
if (!var1.isRemote
|
||||
&& var6.isBurning()
|
||||
&& var14 > 0
|
||||
&& var6.getEntityBoundingBox().minY <= var15) {
|
||||
var6.extinguish();
|
||||
this.setWaterLevel(var1, var4, var5, var14 - 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState var3) {
|
||||
|
||||
return (Integer)var3.getValue(net.minecraft.block.BlockCauldron.LEVEL);
|
||||
}
|
||||
|
||||
public BlockCauldron() {
|
||||
super(Material.iron, MapColor.stoneColor);
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(net.minecraft.block.BlockCauldron.LEVEL, 0));
|
||||
}
|
||||
|
||||
static {
|
||||
|
||||
java.lang.String var0 = "level";
|
||||
LEVEL = PropertyInteger.create(var0, 0, 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public BlockCauldron(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,514 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.lang.invoke.CallSite;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.MethodType;
|
||||
import java.lang.invoke.MutableCallSite;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyDirection;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.passive.EntityOcelot;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryHelper;
|
||||
import net.minecraft.inventory.InventoryLargeChest;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IInteractionObject;
|
||||
import net.minecraft.world.ILockableContainer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockChest extends BlockContainer {
|
||||
|
||||
public static final PropertyDirection FACING;
|
||||
|
||||
public final int chestType;
|
||||
|
||||
private boolean isBelowSolidBlock(World var1, BlockPos var5) {
|
||||
return var1.getBlockState(var5.up()).getBlock().isNormalCube();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, net.minecraft.block.BlockChest.FACING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState onBlockPlaced(
|
||||
World var1, BlockPos var2, EnumFacing var3, float var4, float var7, float var8, int var9, EntityLivingBase var10
|
||||
) {
|
||||
|
||||
return this.getDefaultState().withProperty(net.minecraft.block.BlockChest.FACING, var10.getHorizontalFacing());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var3, int var4) {
|
||||
return new TileEntityChest();
|
||||
}
|
||||
|
||||
static {
|
||||
finishInitialization: {
|
||||
|
||||
FACING = PropertyDirection.create((java.lang.String) ("facing"), (com.google.common.base.Predicate) (EnumFacing.Plane.HORIZONTAL));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World var1, BlockPos var2, IBlockState var5) {
|
||||
|
||||
this.checkForSurroundingChests(var1, var2, var5);
|
||||
|
||||
for (EnumFacing var13 : EnumFacing.Plane.HORIZONTAL) {
|
||||
BlockPos var14 = var2.offset(var13);
|
||||
IBlockState var15 = var1.getBlockState(var14);
|
||||
if (var15.getBlock() == this) {
|
||||
this.checkForSurroundingChests(var1, var14, var15);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower() {
|
||||
return this.chestType == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWeakPower(IBlockAccess var2, BlockPos var3, IBlockState var4, EnumFacing var5) {
|
||||
if (!this.canProvidePower()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int var14 = 0;
|
||||
TileEntity var15 = var2.getTileEntity(var3);
|
||||
if (var15 instanceof TileEntityChest) {
|
||||
var14 = ((TileEntityChest)var15).numPlayersUsing;
|
||||
}
|
||||
|
||||
return MathHelper.clamp_int(var14, 0, 15);
|
||||
}
|
||||
|
||||
public ILockableContainer getLockableContainer(World var3, BlockPos var4) {
|
||||
|
||||
TileEntity var15 = var3.getTileEntity(var4);
|
||||
|
||||
if (!(var15 instanceof TileEntityChest)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
IInteractionObject var16 = (TileEntityChest)var15;
|
||||
if (this.isBlocked(var3, var4)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (EnumFacing var18 : EnumFacing.Plane.HORIZONTAL) {
|
||||
BlockPos var19 = var4.offset(var18);
|
||||
Block var20 = var3.getBlockState(var19).getBlock();
|
||||
if (var20 == this) {
|
||||
if (this.isBlocked(var3, var19)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
TileEntity var21 = var3.getTileEntity(var19);
|
||||
if (var21 instanceof TileEntityChest) {
|
||||
if (var18 != EnumFacing.WEST && var18 != EnumFacing.NORTH) {
|
||||
var16 = new InventoryLargeChest("container.chestDouble", (net.minecraft.world.ILockableContainer) (var16), (TileEntityChest)var21);
|
||||
continue;
|
||||
}
|
||||
|
||||
var16 = new InventoryLargeChest("container.chestDouble", (TileEntityChest)var21, (net.minecraft.world.ILockableContainer) (var16));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (net.minecraft.world.ILockableContainer) (var16);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World var1, BlockPos var4, IBlockState var5) {
|
||||
|
||||
TileEntity var14 = var1.getTileEntity(var4);
|
||||
if (var14 instanceof IInventory) {
|
||||
InventoryHelper.dropInventoryItems((net.minecraft.world.World) (var1), (net.minecraft.util.BlockPos) (var4), (net.minecraft.inventory.IInventory) ((IInventory)var14));
|
||||
var1.updateComparatorOutputLevel(var4, this);
|
||||
}
|
||||
|
||||
super.breakBlock(var1, var4, var5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World var1, BlockPos var4) {
|
||||
|
||||
int var10 = 0;
|
||||
BlockPos var11 = var4.west();
|
||||
BlockPos var12 = var4.east();
|
||||
BlockPos var13 = var4.north();
|
||||
BlockPos var14 = var4.south();
|
||||
if (var1.getBlockState(var11).getBlock() == this) {
|
||||
if (this.isDoubleChest(var1, var11)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var10++;
|
||||
}
|
||||
|
||||
if (var1.getBlockState(var12).getBlock() == this) {
|
||||
if (this.isDoubleChest(var1, var12)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var10++;
|
||||
}
|
||||
|
||||
if (var1.getBlockState(var13).getBlock() == this) {
|
||||
if (this.isDoubleChest(var1, var13)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var10++;
|
||||
}
|
||||
|
||||
if (var1.getBlockState(var14).getBlock() == this) {
|
||||
if (this.isDoubleChest(var1, var14)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var10++;
|
||||
}
|
||||
|
||||
return var10 <= 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World var3, BlockPos var4, IBlockState var5, EntityLivingBase var6, ItemStack var7) {
|
||||
|
||||
net.minecraft.util.EnumFacing var17 = net.minecraft.util.EnumFacing.getHorizontal(net.minecraft.util.MathHelper.floor_double(var6.rotationYaw * 4.0F / 360.0F + 0.5) & 3).getOpposite();
|
||||
net.minecraft.util.EnumFacing var27 = var17;
|
||||
net.minecraft.block.properties.PropertyDirection var28 = net.minecraft.block.BlockChest.FACING;
|
||||
var5 = var5.withProperty(var28, var27);
|
||||
net.minecraft.util.BlockPos var18 = var4.north();
|
||||
|
||||
net.minecraft.util.BlockPos var19 = var4.south();
|
||||
net.minecraft.util.BlockPos var20 = var4.west();
|
||||
net.minecraft.util.BlockPos var21 = var4.east();
|
||||
boolean var22 = this == var3.getBlockState(var18).getBlock();
|
||||
boolean var23 = this == var3.getBlockState(var19).getBlock();
|
||||
boolean var24 = this == var3.getBlockState(var20).getBlock();
|
||||
boolean var25 = this == var3.getBlockState(var21).getBlock();
|
||||
if (!var22 && !var23 && !var24 && !var25) {
|
||||
var3.setBlockState(var4, var5, 3);
|
||||
} else if (var17.getAxis() != net.minecraft.util.EnumFacing.Axis.X || !var22 && !var23) {
|
||||
if (var17.getAxis() == net.minecraft.util.EnumFacing.Axis.Z && (var24 || var25)) {
|
||||
if (var24) {
|
||||
var3.setBlockState(var20, var5, 3);
|
||||
} else {
|
||||
var3.setBlockState(var21, var5, 3);
|
||||
}
|
||||
|
||||
var3.setBlockState(var4, var5, 3);
|
||||
}
|
||||
} else {
|
||||
if (var22) {
|
||||
var3.setBlockState(var18, var5, 3);
|
||||
} else {
|
||||
var3.setBlockState(var19, var5, 3);
|
||||
}
|
||||
|
||||
var3.setBlockState(var4, var5, 3);
|
||||
}
|
||||
|
||||
if (var7.hasDisplayName()) {
|
||||
net.minecraft.tileentity.TileEntity var26 = var3.getTileEntity(var4);
|
||||
if (var26 instanceof net.minecraft.tileentity.TileEntityChest) {
|
||||
((net.minecraft.tileentity.TileEntityChest)var26).setCustomName(var7.getDisplayName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public IBlockState checkForSurroundingChests(World var3, BlockPos var4, IBlockState var6) {
|
||||
|
||||
if (var3.isRemote) {
|
||||
return var6;
|
||||
}
|
||||
|
||||
IBlockState var17 = var3.getBlockState(var4.north());
|
||||
IBlockState var18 = var3.getBlockState(var4.south());
|
||||
IBlockState var19 = var3.getBlockState(var4.west());
|
||||
IBlockState var20 = var3.getBlockState(var4.east());
|
||||
EnumFacing var21 = (EnumFacing)var6.getValue(net.minecraft.block.BlockChest.FACING);
|
||||
Block var22 = var17.getBlock();
|
||||
Block var23 = var18.getBlock();
|
||||
Block var24 = var19.getBlock();
|
||||
Block var25 = var20.getBlock();
|
||||
if (var22 != this && var23 != this) {
|
||||
boolean var35 = var22.isFullBlock();
|
||||
boolean var36 = var23.isFullBlock();
|
||||
if (var24 == this || var25 == this) {
|
||||
BlockPos var37 = var24 == this ? var4.west() : var4.east();
|
||||
IBlockState var38 = var3.getBlockState(var37.north());
|
||||
IBlockState var39 = var3.getBlockState(var37.south());
|
||||
var21 = EnumFacing.SOUTH;
|
||||
EnumFacing var40;
|
||||
if (var24 == this) {
|
||||
var40 = (EnumFacing)var19.getValue(net.minecraft.block.BlockChest.FACING);
|
||||
} else {
|
||||
var40 = (EnumFacing)var20.getValue(net.minecraft.block.BlockChest.FACING);
|
||||
}
|
||||
|
||||
if (var40 == EnumFacing.NORTH) {
|
||||
var21 = EnumFacing.NORTH;
|
||||
}
|
||||
|
||||
Block var32 = var38.getBlock();
|
||||
Block var33 = var39.getBlock();
|
||||
if ((var35 || var32.isFullBlock()) && !var36 && !var33.isFullBlock()) {
|
||||
var21 = EnumFacing.SOUTH;
|
||||
}
|
||||
|
||||
if ((var36 || var33.isFullBlock()) && !var35 && !var32.isFullBlock()) {
|
||||
var21 = EnumFacing.NORTH;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
BlockPos var26 = var22 == this ? var4.north() : var4.south();
|
||||
IBlockState var27 = var3.getBlockState(var26.west());
|
||||
IBlockState var28 = var3.getBlockState(var26.east());
|
||||
var21 = EnumFacing.EAST;
|
||||
EnumFacing var29;
|
||||
if (var22 == this) {
|
||||
var29 = (EnumFacing)var17.getValue(net.minecraft.block.BlockChest.FACING);
|
||||
} else {
|
||||
var29 = (EnumFacing)var18.getValue(net.minecraft.block.BlockChest.FACING);
|
||||
}
|
||||
|
||||
if (var29 == EnumFacing.WEST) {
|
||||
var21 = EnumFacing.WEST;
|
||||
}
|
||||
|
||||
Block var30 = var27.getBlock();
|
||||
Block var31 = var28.getBlock();
|
||||
if ((var24.isFullBlock() || var30.isFullBlock()) && !var25.isFullBlock() && !var31.isFullBlock()) {
|
||||
var21 = EnumFacing.EAST;
|
||||
}
|
||||
|
||||
if ((var25.isFullBlock() || var31.isFullBlock()) && !var24.isFullBlock() && !var30.isFullBlock()) {
|
||||
var21 = EnumFacing.WEST;
|
||||
}
|
||||
}
|
||||
|
||||
var6 = var6.withProperty(net.minecraft.block.BlockChest.FACING, var21);
|
||||
var3.setBlockState(var4, var6, 3);
|
||||
return var6;
|
||||
}
|
||||
|
||||
public BlockChest(int var1) {
|
||||
super(Material.wood);
|
||||
this.setDefaultState(
|
||||
this.blockState.getBaseState().withProperty(net.minecraft.block.BlockChest.FACING, EnumFacing.NORTH)
|
||||
);
|
||||
this.chestType = var1;
|
||||
this.setCreativeTab(CreativeTabs.tabDecorations);
|
||||
this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World var1, BlockPos var2) {
|
||||
|
||||
return Container.calcRedstoneFromInventory(this.getLockableContainer(var1, var2));
|
||||
}
|
||||
|
||||
public IBlockState correctFacing(World var1, BlockPos var5, IBlockState var6) {
|
||||
|
||||
EnumFacing var17 = null;
|
||||
|
||||
for (EnumFacing var19 : EnumFacing.Plane.HORIZONTAL) {
|
||||
IBlockState var20 = var1.getBlockState(var5.offset(var19));
|
||||
if (var20.getBlock() == this) {
|
||||
return var6;
|
||||
}
|
||||
|
||||
if (var20.getBlock().isFullBlock()) {
|
||||
if (var17 != null) {
|
||||
var17 = null;
|
||||
break;
|
||||
}
|
||||
|
||||
var17 = var19;
|
||||
}
|
||||
}
|
||||
|
||||
if (var17 != null) {
|
||||
return var6.withProperty(net.minecraft.block.BlockChest.FACING, var17.getOpposite());
|
||||
}
|
||||
|
||||
EnumFacing var21 = (EnumFacing)var6.getValue(net.minecraft.block.BlockChest.FACING);
|
||||
if (var1.getBlockState(var5.offset(var21)).getBlock().isFullBlock()) {
|
||||
var21 = var21.getOpposite();
|
||||
}
|
||||
|
||||
if (var1.getBlockState(var5.offset(var21)).getBlock().isFullBlock()) {
|
||||
var21 = var21.rotateY();
|
||||
}
|
||||
|
||||
if (var1.getBlockState(var5.offset(var21)).getBlock().isFullBlock()) {
|
||||
var21 = var21.getOpposite();
|
||||
}
|
||||
|
||||
return var6.withProperty(net.minecraft.block.BlockChest.FACING, var21);
|
||||
}
|
||||
|
||||
private boolean isOcelotSittingOnChest(World var1, BlockPos var2) {
|
||||
|
||||
AxisAlignedBB var10 = new AxisAlignedBB(
|
||||
var2.getX(),
|
||||
var2.getY() + 1,
|
||||
var2.getZ(),
|
||||
var2.getX() + 1,
|
||||
var2.getY() + 2,
|
||||
var2.getZ() + 1
|
||||
);
|
||||
Class<EntityOcelot> var11 = EntityOcelot.class;
|
||||
|
||||
for (Entity var14 : (java.lang.Iterable<net.minecraft.entity.Entity>) (java.lang.Iterable<?>) (var1.getEntitiesWithinAABB(var11, var10))) {
|
||||
EntityOcelot var15 = (EntityOcelot)var14;
|
||||
if (var15.isSitting()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isDoubleChest(World var3, BlockPos var4) {
|
||||
|
||||
if (var3.getBlockState(var4).getBlock() != this) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (EnumFacing var9 : EnumFacing.Plane.HORIZONTAL) {
|
||||
if (var3.getBlockState(var4.offset(var9)).getBlock() == this) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess var3, BlockPos var4) {
|
||||
|
||||
if (var3.getBlockState(var4.north()).getBlock() == this) {
|
||||
this.setBlockBounds(0.0625F, 0.0F, 0.0F, 0.9375F, 0.875F, 0.9375F);
|
||||
} else if (var3.getBlockState(var4.south()).getBlock() == this) {
|
||||
this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 1.0F);
|
||||
} else if (var3.getBlockState(var4.west()).getBlock() == this) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
|
||||
} else if (var3.getBlockState(var4.east()).getBlock() == this) {
|
||||
this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 1.0F, 0.875F, 0.9375F);
|
||||
} else {
|
||||
this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStrongPower(IBlockAccess var3, BlockPos var4, IBlockState var5, EnumFacing var6) {
|
||||
return var6 == EnumFacing.UP ? this.getWeakPower(var3, var4, var5, var6) : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World var1, BlockPos var4, IBlockState var5, EntityPlayer var6, EnumFacing var7, float var8, float var9, float var10
|
||||
) {
|
||||
|
||||
if (var1.isRemote) {
|
||||
return true;
|
||||
}
|
||||
|
||||
ILockableContainer var18 = this.getLockableContainer(var1, var4);
|
||||
if (var18 != null) {
|
||||
var6.displayGUIChest(var18);
|
||||
if (this.chestType == 0) {
|
||||
var6.triggerAchievement(StatList.field_181723_aa);
|
||||
} else if (this.chestType == 1) {
|
||||
var6.triggerAchievement(StatList.field_181737_U);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState var3) {
|
||||
|
||||
return ((EnumFacing)var3.getValue(net.minecraft.block.BlockChest.FACING)).getIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World var1, BlockPos var4, IBlockState var5, Block var6) {
|
||||
|
||||
super.onNeighborBlockChange(var1, var4, var5, var6);
|
||||
TileEntity var11 = var1.getTileEntity(var4);
|
||||
if (var11 instanceof TileEntityChest) {
|
||||
var11.updateContainingBlockInfo();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
EnumFacing var6 = EnumFacing.getFront(var1);
|
||||
if (var6.getAxis() == EnumFacing.Axis.Y) {
|
||||
var6 = EnumFacing.NORTH;
|
||||
}
|
||||
|
||||
return this.getDefaultState().withProperty(net.minecraft.block.BlockChest.FACING, var6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean isBlocked(World var1, BlockPos var2) {
|
||||
|
||||
return this.isBelowSolidBlock(var1, var2) || this.isOcelotSittingOnChest(var1, var2);
|
||||
}
|
||||
|
||||
public BlockChest(int argument0, int argument1, int argument2, char argument3) {
|
||||
this(argument0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class BlockClay extends Block {
|
||||
|
||||
|
||||
public BlockClay() {
|
||||
super(Material.AdvancedAntiSkid1ll1Il1i);
|
||||
this.setCreativeTab(CreativeTabs.tabBlock);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random var1) {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState var1, Random var4, int var5) {
|
||||
return Items.clay_ball;
|
||||
}
|
||||
|
||||
public BlockClay(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,245 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.util.Random;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCocoa extends BlockDirectional implements IGrowable {
|
||||
|
||||
public static final PropertyInteger AGE;
|
||||
|
||||
@Override
|
||||
public void updateTick(World var1, BlockPos var2, IBlockState var3, Random var6) {
|
||||
|
||||
|
||||
if (!this.canBlockStay(var1, var2, var3)) {
|
||||
this.dropBlock(var1, var2, var3);
|
||||
} else if (var1.rand.nextInt(5) == 0) {
|
||||
int var20 = (Integer)var3.getValue(net.minecraft.block.BlockCocoa.AGE);
|
||||
if (var20 < 2) {
|
||||
var1.setBlockState(var2, var3.withProperty(net.minecraft.block.BlockCocoa.AGE, var20 + 1), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamageValue(World var2, BlockPos var3) {
|
||||
|
||||
return EnumDyeColor.BROWN.getDyeDamage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
static {
|
||||
java.lang.String var0 = "age";
|
||||
AGE = PropertyInteger.create(var0, 0, 2);
|
||||
}
|
||||
|
||||
public BlockCocoa() {
|
||||
super(Material.plants);
|
||||
this.setDefaultState(
|
||||
this.blockState
|
||||
.getBaseState()
|
||||
.withProperty(net.minecraft.block.BlockDirectional.FACING, EnumFacing.NORTH)
|
||||
.withProperty(net.minecraft.block.BlockCocoa.AGE, 0)
|
||||
);
|
||||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void dropBlock(World var3, BlockPos var4, IBlockState var5) {
|
||||
|
||||
var3.setBlockState(var4, Blocks.air.getDefaultState(), 3);
|
||||
this.dropBlockAsItem(var3, var4, var5, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUseBonemeal(World var3, Random var4, BlockPos var5, IBlockState var6) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canGrow(World var1, BlockPos var2, IBlockState var3, boolean var4) {
|
||||
|
||||
return (Integer)var3.getValue(net.minecraft.block.BlockCocoa.AGE) < 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance(World var1, BlockPos var4, IBlockState var5, float var6, int var7) {
|
||||
|
||||
|
||||
int var17 = (Integer)var5.getValue(net.minecraft.block.BlockCocoa.AGE);
|
||||
byte var18 = 1;
|
||||
if (var17 >= 2) {
|
||||
var18 = 3;
|
||||
}
|
||||
|
||||
for (int var19 = 0; var19 < var18; var19++) {
|
||||
|
||||
Item var10007 = Items.dye;
|
||||
int var20 = EnumDyeColor.BROWN.getDyeDamage();
|
||||
byte var21 = 1;
|
||||
Item var22 = var10007;
|
||||
spawnAsEntity(var1, var4, new ItemStack(var22, var21, var20));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumWorldBlockLayer getBlockLayer() {
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void grow(World var1, Random var2, BlockPos var5, IBlockState var6) {
|
||||
|
||||
var1.setBlockState(
|
||||
var5,
|
||||
var6.withProperty(
|
||||
net.minecraft.block.BlockCocoa.AGE, (Integer)var6.getValue(net.minecraft.block.BlockCocoa.AGE) + 1
|
||||
),
|
||||
2
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItem(World var1, BlockPos var4) {
|
||||
return Items.dye;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState var3) {
|
||||
|
||||
int var7 = 0;
|
||||
var7 |= ((EnumFacing)var3.getValue(net.minecraft.block.BlockDirectional.FACING)).getHorizontalIndex();
|
||||
return var7 | (Integer)var3.getValue(net.minecraft.block.BlockCocoa.AGE) << 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World var1, BlockPos var4, IBlockState var5, Block var6) {
|
||||
|
||||
if (!this.canBlockStay(var1, var4, var5)) {
|
||||
this.dropBlock(var1, var4, var5);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess var3, BlockPos var4) {
|
||||
|
||||
|
||||
IBlockState var9 = var3.getBlockState(var4);
|
||||
EnumFacing var10 = (EnumFacing)var9.getValue(net.minecraft.block.BlockDirectional.FACING);
|
||||
int var11 = (Integer)var9.getValue(net.minecraft.block.BlockCocoa.AGE);
|
||||
int var12 = 4 + var11 * 2;
|
||||
int var13 = 5 + var11 * 2;
|
||||
float var14 = var12 / 2.0F;
|
||||
switch (net.minecraft.block.BlockCocoa.EnumFacingSwitchMap.list[var10.ordinal()]) {
|
||||
case 1:
|
||||
this.setBlockBounds((8.0F - var14) / 16.0F, (12.0F - var13) / 16.0F, (15.0F - var12) / 16.0F, (8.0F + var14) / 16.0F, 0.75F, 0.9375F);
|
||||
break;
|
||||
case 2:
|
||||
this.setBlockBounds((8.0F - var14) / 16.0F, (12.0F - var13) / 16.0F, 0.0625F, (8.0F + var14) / 16.0F, 0.75F, (1.0F + var12) / 16.0F);
|
||||
break;
|
||||
case 3:
|
||||
this.setBlockBounds(0.0625F, (12.0F - var13) / 16.0F, (8.0F - var14) / 16.0F, (1.0F + var12) / 16.0F, 0.75F, (8.0F + var14) / 16.0F);
|
||||
break;
|
||||
case 4:
|
||||
this.setBlockBounds((15.0F - var12) / 16.0F, (12.0F - var13) / 16.0F, (8.0F - var14) / 16.0F, 0.9375F, 0.75F, (8.0F + var14) / 16.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World var3, BlockPos var4, IBlockState var5, EntityLivingBase var6, ItemStack var7) {
|
||||
|
||||
EnumFacing var12 = EnumFacing.fromAngle(var6.rotationYaw);
|
||||
var3.setBlockState(var4, var5.withProperty(net.minecraft.block.BlockDirectional.FACING, var12), 2);
|
||||
}
|
||||
|
||||
public boolean canBlockStay(World var3, BlockPos var4, IBlockState var5) {
|
||||
var4 = var4.offset((EnumFacing)var5.getValue(net.minecraft.block.BlockDirectional.FACING));
|
||||
IBlockState var14 = var3.getBlockState(var4);
|
||||
return var14.getBlock() == Blocks.log
|
||||
&& var14.getValue(BlockPlanks.VARIANT) == BlockPlanks.EnumType.JUNGLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) {
|
||||
|
||||
this.setBlockBoundsBasedOnState(var1, var2);
|
||||
return super.getCollisionBoundingBox(var1, var2, var3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
return this.getDefaultState()
|
||||
.withProperty(net.minecraft.block.BlockDirectional.FACING, EnumFacing.getHorizontal(var1))
|
||||
.withProperty(net.minecraft.block.BlockCocoa.AGE, (var1 & 15) >> 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, net.minecraft.block.BlockDirectional.FACING, net.minecraft.block.BlockCocoa.AGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBox(World var3, BlockPos var4) {
|
||||
|
||||
this.setBlockBoundsBasedOnState(var3, var4);
|
||||
return super.getSelectedBoundingBox(var3, var4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState onBlockPlaced(
|
||||
World var1, BlockPos var2, EnumFacing var3, float var4, float var7, float var8, int var9, EntityLivingBase var10
|
||||
) {
|
||||
|
||||
if (!var3.getAxis().isHorizontal()) {
|
||||
var3 = EnumFacing.NORTH;
|
||||
}
|
||||
|
||||
return this.getDefaultState()
|
||||
.withProperty(net.minecraft.block.BlockDirectional.FACING, var3.getOpposite())
|
||||
.withProperty(net.minecraft.block.BlockCocoa.AGE, 0);
|
||||
}
|
||||
|
||||
public BlockCocoa(long argument0) {
|
||||
this();
|
||||
}
|
||||
|
||||
public static final class EnumFacingSwitchMap {
|
||||
static final int[] list = new int[net.minecraft.util.EnumFacing.values().length];
|
||||
static {
|
||||
try { list[net.minecraft.util.EnumFacing.SOUTH.ordinal()] = 1; } catch (java.lang.NoSuchFieldError missing) {}
|
||||
try { list[net.minecraft.util.EnumFacing.NORTH.ordinal()] = 2; } catch (java.lang.NoSuchFieldError missing) {}
|
||||
try { list[net.minecraft.util.EnumFacing.WEST.ordinal()] = 3; } catch (java.lang.NoSuchFieldError missing) {}
|
||||
try { list[net.minecraft.util.EnumFacing.EAST.ordinal()] = 4; } catch (java.lang.NoSuchFieldError missing) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.util.List;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class BlockColored extends Block {
|
||||
|
||||
public static final PropertyEnum<EnumDyeColor> COLOR;
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
return this.getDefaultState().withProperty(net.minecraft.block.BlockColored.COLOR, EnumDyeColor.byMetadata(var1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState var3) {
|
||||
|
||||
return ((EnumDyeColor)var3.getValue(net.minecraft.block.BlockColored.COLOR)).getMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(net.minecraft.item.Item var2, net.minecraft.creativetab.CreativeTabs var4, java.util.List<net.minecraft.item.ItemStack> var6) {
|
||||
EnumDyeColor[] var12 = EnumDyeColor.values();
|
||||
|
||||
|
||||
for (EnumDyeColor var15 : var12) {
|
||||
int var16 = var15.getMetadata();
|
||||
byte var17 = 1;
|
||||
Item var18 = var2;
|
||||
var6.add(new ItemStack(var18, var17, var16));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState var1) {
|
||||
return ((EnumDyeColor)var1.getValue(net.minecraft.block.BlockColored.COLOR)).getMetadata();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public MapColor getMapColor(IBlockState var1) {
|
||||
return ((EnumDyeColor)var1.getValue(net.minecraft.block.BlockColored.COLOR)).getMapColor();
|
||||
}
|
||||
|
||||
public BlockColored(Material var1) {
|
||||
super(var1);
|
||||
this.setDefaultState(
|
||||
this.blockState.getBaseState().withProperty(net.minecraft.block.BlockColored.COLOR, EnumDyeColor.WHITE)
|
||||
);
|
||||
this.setCreativeTab(CreativeTabs.tabBlock);
|
||||
}
|
||||
|
||||
static {
|
||||
|
||||
java.lang.String var0 = "color";
|
||||
COLOR = PropertyEnum.create(var0, EnumDyeColor.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, net.minecraft.block.BlockColored.COLOR);
|
||||
}
|
||||
|
||||
public BlockColored(net.minecraft.block.material.Material argument0, long argument1) {
|
||||
this(argument0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.lang.invoke.CallSite;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.MethodType;
|
||||
import java.lang.invoke.MutableCallSite;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.command.server.CommandBlockLogic;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityCommandBlock;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCommandBlock extends BlockContainer {
|
||||
|
||||
|
||||
|
||||
|
||||
public static final PropertyBool TRIGGERED;
|
||||
|
||||
public BlockCommandBlock() {
|
||||
super(Material.iron, MapColor.adobeColor);
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(net.minecraft.block.BlockCommandBlock.TRIGGERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World var1, BlockPos var2, IBlockState var3, Random var6) {
|
||||
|
||||
TileEntity var13 = var1.getTileEntity(var2);
|
||||
if (var13 instanceof TileEntityCommandBlock) {
|
||||
((TileEntityCommandBlock)var13).getCommandBlockLogic().trigger(var1);
|
||||
var1.updateComparatorOutputLevel(var2, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World var1, BlockPos var4, IBlockState var5, Block var6) {
|
||||
|
||||
|
||||
if (!var1.isRemote) {
|
||||
boolean var21 = var1.isBlockPowered(var4);
|
||||
boolean var22 = (Boolean)var5.getValue(net.minecraft.block.BlockCommandBlock.TRIGGERED);
|
||||
if (var21 && !var22) {
|
||||
var1.setBlockState(var4, var5.withProperty(net.minecraft.block.BlockCommandBlock.TRIGGERED, true), 4);
|
||||
var1.scheduleUpdate(var4, this, this.tickRate(var1));
|
||||
} else if (!var21 && var22) {
|
||||
var1.setBlockState(var4, var5.withProperty(net.minecraft.block.BlockCommandBlock.TRIGGERED, false), 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random var1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World var3, BlockPos var4, IBlockState var5, EntityLivingBase var6, ItemStack var7) {
|
||||
|
||||
TileEntity var14 = var3.getTileEntity(var4);
|
||||
if (var14 instanceof TileEntityCommandBlock) {
|
||||
CommandBlockLogic var15 = ((TileEntityCommandBlock)var14).getCommandBlockLogic();
|
||||
if (var7.hasDisplayName()) {
|
||||
var15.setName(var7.getDisplayName());
|
||||
}
|
||||
|
||||
if (!var3.isRemote) {
|
||||
var15.setTrackOutput(var3.getGameRules().getBoolean("sendCommandFeedback"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World var1, BlockPos var2) {
|
||||
|
||||
TileEntity var7 = var1.getTileEntity(var2);
|
||||
return var7 instanceof TileEntityCommandBlock ? ((TileEntityCommandBlock)var7).getCommandBlockLogic().getSuccessCount() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState var3) {
|
||||
|
||||
byte var7 = 0;
|
||||
if ((Boolean)var3.getValue(net.minecraft.block.BlockCommandBlock.TRIGGERED)) {
|
||||
var7 |= 1;
|
||||
}
|
||||
|
||||
return var7;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, net.minecraft.block.BlockCommandBlock.TRIGGERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
return this.getDefaultState().withProperty(net.minecraft.block.BlockCommandBlock.TRIGGERED, (var1 & 1) > 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState onBlockPlaced(
|
||||
World var1, BlockPos var2, EnumFacing var3, float var4, float var7, float var8, int var9, EntityLivingBase var10
|
||||
) {
|
||||
|
||||
return this.getDefaultState().withProperty(net.minecraft.block.BlockCommandBlock.TRIGGERED, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World var1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var3, int var4) {
|
||||
return new TileEntityCommandBlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
static {
|
||||
finishInitialization: {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
TRIGGERED = PropertyBool.create("triggered");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World var1, BlockPos var4, IBlockState var5, EntityPlayer var6, EnumFacing var7, float var8, float var9, float var10
|
||||
) {
|
||||
|
||||
TileEntity var15 = var1.getTileEntity(var4);
|
||||
return var15 instanceof TileEntityCommandBlock ? ((TileEntityCommandBlock)var15).getCommandBlockLogic().tryOpenEditCommandBlock(var6) : false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public BlockCommandBlock(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BlockCompressedPowered extends Block {
|
||||
|
||||
|
||||
@Override
|
||||
public int getWeakPower(IBlockAccess var2, BlockPos var3, IBlockState var4, EnumFacing var5) {
|
||||
return 15;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public BlockCompressedPowered(Material var1, MapColor var4) {
|
||||
super(var1, var4);
|
||||
}
|
||||
|
||||
public BlockCompressedPowered(net.minecraft.block.material.Material argument0, long argument1, net.minecraft.block.material.MapColor argument2) {
|
||||
this(argument0, argument2);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class BlockContainer extends Block implements ITileEntityProvider {
|
||||
private static String[] AdvancedAntiSkid1i1ili1i;
|
||||
|
||||
|
||||
public static String[] readStringArray3() {
|
||||
return AdvancedAntiSkid1i1ili1i;
|
||||
}
|
||||
|
||||
public BlockContainer(Material var3) {
|
||||
this(var3, var3.getMaterialMapColor());
|
||||
}
|
||||
|
||||
static {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void breakBlock(World var1, BlockPos var4, IBlockState var5) {
|
||||
|
||||
super.breakBlock(var1, var4, var5);
|
||||
var1.removeTileEntity(var4);
|
||||
}
|
||||
|
||||
public boolean hasInvalidNeighbor(World var1, BlockPos var2) {
|
||||
return this.isInvalidNeighbor(var1, var2, EnumFacing.NORTH)
|
||||
|| this.isInvalidNeighbor(var1, var2, EnumFacing.SOUTH)
|
||||
|| this.isInvalidNeighbor(var1, var2, EnumFacing.WEST)
|
||||
|| this.isInvalidNeighbor(var1, var2, EnumFacing.EAST);
|
||||
}
|
||||
|
||||
protected boolean isInvalidNeighbor(World var1, BlockPos var2, EnumFacing var3) {
|
||||
return var1.getBlockState(var2.offset(var3)).getBlock().getMaterial()
|
||||
== Material.soundPoolEntry;
|
||||
}
|
||||
|
||||
public BlockContainer(Material var1, MapColor var2) {
|
||||
super(var1, var2);
|
||||
this.isBlockContainer = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockEventReceived(World var1, BlockPos var3, IBlockState var4, int var6, int var7) {
|
||||
|
||||
super.onBlockEventReceived(var1, var3, var4, var6, var7);
|
||||
TileEntity var18 = var1.getTileEntity(var3);
|
||||
return var18 == null ? false : var18.receiveClientEvent(var6, var7);
|
||||
}
|
||||
|
||||
public BlockContainer(long argument0, net.minecraft.block.material.Material argument1) {
|
||||
this(argument1);
|
||||
}
|
||||
|
||||
public BlockContainer(net.minecraft.block.material.Material argument0, net.minecraft.block.material.MapColor argument1, long argument2) {
|
||||
this(argument0, argument1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.util.Random;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCrops extends BlockBush implements IGrowable {
|
||||
|
||||
public static final PropertyInteger AGE;
|
||||
|
||||
@Override
|
||||
public void grow(World var1, Random var2, BlockPos var5, IBlockState var6) {
|
||||
|
||||
this.grow(var1, var5, var6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlockStay(World var1, BlockPos var4, IBlockState var5) {
|
||||
|
||||
return (var1.getLight(var4) >= 8 || var1.canSeeSky(var4))
|
||||
&& this.canPlaceBlockOn(var1.getBlockState(var4.down()).getBlock());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canPlaceBlockOn(Block var1) {
|
||||
return var1 == Blocks.farmland;
|
||||
}
|
||||
|
||||
static {
|
||||
java.lang.String var0 = "age";
|
||||
AGE = PropertyInteger.create(var0, 0, 7);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState var1, Random var4, int var5) {
|
||||
return var1.getValue(net.minecraft.block.BlockCrops.AGE) == 7
|
||||
? this.getCrop()
|
||||
: this.getSeed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance(World var1, BlockPos var4, IBlockState var5, float var6, int var7) {
|
||||
|
||||
|
||||
super.dropBlockAsItemWithChance(var1, var4, var5, var6, 0);
|
||||
if (!var1.isRemote) {
|
||||
int var19 = (Integer)var5.getValue(net.minecraft.block.BlockCrops.AGE);
|
||||
if (var19 >= 7) {
|
||||
int var20 = 3 + var7;
|
||||
|
||||
for (int var21 = 0; var21 < var20; var21++) {
|
||||
if (var1.rand.nextInt(15) <= var19) {
|
||||
|
||||
Item var10007 = this.getSeed();
|
||||
byte var22 = 0;
|
||||
byte var23 = 1;
|
||||
Item var24 = var10007;
|
||||
spawnAsEntity(var1, var4, new ItemStack(var24, var23, var22));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected Item getSeed() {
|
||||
return Items.wheat_seeds;
|
||||
}
|
||||
|
||||
protected Item getCrop() {
|
||||
return Items.wheat;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
return this.getDefaultState().withProperty(net.minecraft.block.BlockCrops.AGE, var1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItem(World var1, BlockPos var4) {
|
||||
return this.getSeed();
|
||||
}
|
||||
|
||||
public BlockCrops() {
|
||||
super();
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(net.minecraft.block.BlockCrops.AGE, 0));
|
||||
this.setTickRandomly(true);
|
||||
float var10 = 0.5F;
|
||||
this.setBlockBounds(0.5F - var10, 0.0F, 0.5F - var10, 0.5F + var10, 0.25F, 0.5F + var10);
|
||||
this.setCreativeTab((CreativeTabs)null);
|
||||
this.setHardness(0.0F);
|
||||
this.setStepSound(soundTypeGrass);
|
||||
this.disableStats();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, net.minecraft.block.BlockCrops.AGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUseBonemeal(World var3, Random var4, BlockPos var5, IBlockState var6) {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected static float getGrowthChance(Block var0, World var1, BlockPos var2) {
|
||||
|
||||
float var11 = 1.0F;
|
||||
net.minecraft.util.BlockPos var12 = var2.down();
|
||||
|
||||
for (int var13 = -1; var13 <= 1; var13++) {
|
||||
for (int var14 = -1; var14 <= 1; var14++) {
|
||||
float var15 = 0.0F;
|
||||
net.minecraft.block.state.IBlockState var16 = var1.getBlockState(var12.add((int) (var13), (int) (0), (int) (var14)));
|
||||
if (var16.getBlock() == net.minecraft.init.Blocks.farmland) {
|
||||
var15 = 1.0F;
|
||||
|
||||
net.minecraft.block.properties.PropertyInteger var20 = net.minecraft.block.BlockFarmland.MOISTURE;
|
||||
if ((Integer)var16.getValue(var20) > 0) {
|
||||
var15 = 3.0F;
|
||||
}
|
||||
}
|
||||
|
||||
if (var13 != 0 || var14 != 0) {
|
||||
var15 /= 4.0F;
|
||||
}
|
||||
|
||||
var11 += var15;
|
||||
}
|
||||
}
|
||||
|
||||
net.minecraft.util.BlockPos var21 = var2.north();
|
||||
net.minecraft.util.BlockPos var22 = var2.south();
|
||||
net.minecraft.util.BlockPos var23 = var2.west();
|
||||
net.minecraft.util.BlockPos var24 = var2.east();
|
||||
boolean var17 = var0 == var1.getBlockState(var23).getBlock() || var0 == var1.getBlockState(var24).getBlock();
|
||||
boolean var18 = var0 == var1.getBlockState(var21).getBlock() || var0 == var1.getBlockState(var22).getBlock();
|
||||
if (var17 && var18) {
|
||||
var11 /= 2.0F;
|
||||
} else {
|
||||
boolean var19 = var0 == var1.getBlockState(var23.north()).getBlock()
|
||||
|| var0 == var1.getBlockState(var24.north()).getBlock()
|
||||
|| var0 == var1.getBlockState(var24.south()).getBlock()
|
||||
|| var0 == var1.getBlockState(var23.south()).getBlock();
|
||||
if (var19) {
|
||||
var11 /= 2.0F;
|
||||
}
|
||||
}
|
||||
|
||||
return var11;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canGrow(World var1, BlockPos var2, IBlockState var3, boolean var4) {
|
||||
|
||||
return (Integer)var3.getValue(net.minecraft.block.BlockCrops.AGE) < 7;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState var3) {
|
||||
|
||||
return (Integer)var3.getValue(net.minecraft.block.BlockCrops.AGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World var1, BlockPos var2, IBlockState var3, Random var6) {
|
||||
|
||||
super.updateTick(var1, var2, var3, var6);
|
||||
if (var1.getLightFromNeighbors(var2.up()) >= 9) {
|
||||
int var21 = (Integer)var3.getValue(net.minecraft.block.BlockCrops.AGE);
|
||||
if (var21 < 7) {
|
||||
float var22 = getGrowthChance(this, var1, var2);
|
||||
if (var6.nextInt((int)(25.0F / var22) + 1) == 0) {
|
||||
var1.setBlockState(var2, var3.withProperty(net.minecraft.block.BlockCrops.AGE, var21 + 1), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void grow(World var2, BlockPos var3, IBlockState var5) {
|
||||
|
||||
int var10000 = (Integer)var5.getValue(net.minecraft.block.BlockCrops.AGE);
|
||||
byte var19 = 5;
|
||||
byte var20 = 2;
|
||||
int var18 = var10000 + MathHelper.getRandomIntegerInRange(var2.rand, var20, var19);
|
||||
if (var18 > 7) {
|
||||
var18 = 7;
|
||||
}
|
||||
|
||||
var2.setBlockState(var3, var5.withProperty(net.minecraft.block.BlockCrops.AGE, var18), 2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public BlockCrops(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,224 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.lang.invoke.CallSite;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.MethodType;
|
||||
import java.lang.invoke.MutableCallSite;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityDaylightDetector;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockDaylightDetector extends BlockContainer {
|
||||
|
||||
|
||||
public static final PropertyInteger POWER;
|
||||
|
||||
private final boolean inverted;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
public BlockDaylightDetector(boolean var1) {
|
||||
super(Material.wood);
|
||||
this.inverted = var1;
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(net.minecraft.block.BlockDaylightDetector.POWER, 0));
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F);
|
||||
this.setCreativeTab(CreativeTabs.tabRedstone);
|
||||
this.setHardness(0.2F);
|
||||
this.setStepSound(soundTypeWood);
|
||||
this.setUnlocalizedName("daylightDetector");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState var3) {
|
||||
|
||||
return (Integer)var3.getValue(net.minecraft.block.BlockDaylightDetector.POWER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(net.minecraft.item.Item var2, net.minecraft.creativetab.CreativeTabs var4, java.util.List<net.minecraft.item.ItemStack> var6) {
|
||||
if (!this.inverted) {
|
||||
super.getSubBlocks(var2, var4, var6);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, net.minecraft.block.BlockDaylightDetector.POWER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World var1, BlockPos var4, IBlockState var5, EntityPlayer var6, EnumFacing var7, float var8, float var9, float var10
|
||||
) {
|
||||
|
||||
|
||||
if (var6.isAllowEdit()) {
|
||||
if (var1.isRemote) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.inverted) {
|
||||
var1.setBlockState(
|
||||
var4,
|
||||
Blocks.daylight_detector
|
||||
.getDefaultState()
|
||||
.withProperty(
|
||||
net.minecraft.block.BlockDaylightDetector.POWER, (Integer)var5.getValue(net.minecraft.block.BlockDaylightDetector.POWER)
|
||||
),
|
||||
4
|
||||
);
|
||||
Blocks.daylight_detector.updatePower(var1, var4);
|
||||
} else {
|
||||
var1.setBlockState(
|
||||
var4,
|
||||
Blocks.daylight_detector_inverted
|
||||
.getDefaultState()
|
||||
.withProperty(
|
||||
net.minecraft.block.BlockDaylightDetector.POWER, (Integer)var5.getValue(net.minecraft.block.BlockDaylightDetector.POWER)
|
||||
),
|
||||
4
|
||||
);
|
||||
Blocks.daylight_detector_inverted.updatePower(var1, var4);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return super.onBlockActivated(var1, var4, var5, var6, var7, var8, var9, var10);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void updatePower(World var1, BlockPos var2) {
|
||||
|
||||
if (!var1.provider.getHasNoSky()) {
|
||||
IBlockState var16 = var1.getBlockState(var2);
|
||||
int var17 = var1.getLightFor(EnumSkyBlock.SKY, var2) - var1.getSkylightSubtracted();
|
||||
float var18 = var1.getCelestialAngleRadians(1.0F);
|
||||
float var19 = var18 < (float) Math.PI ? 0.0F : (float) (Math.PI * 2);
|
||||
var18 += (var19 - var18) * 0.2F;
|
||||
var17 = Math.round(var17 * MathHelper.cos(var18));
|
||||
var17 = MathHelper.clamp_int(var17, 0, 15);
|
||||
if (this.inverted) {
|
||||
var17 = 15 - var17;
|
||||
}
|
||||
|
||||
if ((Integer)var16.getValue(net.minecraft.block.BlockDaylightDetector.POWER) != var17) {
|
||||
var1.setBlockState(var2, var16.withProperty(net.minecraft.block.BlockDaylightDetector.POWER, var17), 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
return this.getDefaultState().withProperty(net.minecraft.block.BlockDaylightDetector.POWER, var1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess var3, BlockPos var4) {
|
||||
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Item getItem(World var1, BlockPos var4) {
|
||||
return Item.getItemFromBlock(Blocks.daylight_detector);
|
||||
}
|
||||
|
||||
static {
|
||||
finishInitialization: {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
POWER = PropertyInteger.create("power", 0, 15);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWeakPower(IBlockAccess var2, BlockPos var3, IBlockState var4, EnumFacing var5) {
|
||||
return (Integer)var4.getValue(net.minecraft.block.BlockDaylightDetector.POWER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var3, int var4) {
|
||||
return new TileEntityDaylightDetector();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState var1, Random var4, int var5) {
|
||||
return Item.getItemFromBlock(Blocks.daylight_detector);
|
||||
}
|
||||
|
||||
public BlockDaylightDetector(boolean argument0, long argument1) {
|
||||
this(argument0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockDeadBush extends BlockBush {
|
||||
|
||||
|
||||
public BlockDeadBush() {
|
||||
super(Material.vine);
|
||||
float var5 = 0.4F;
|
||||
this.setBlockBounds(0.5F - var5, 0.0F, 0.5F - var5, 0.5F + var5, 0.8F, 0.5F + var5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapColor getMapColor(IBlockState var1) {
|
||||
return MapColor.woodColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canPlaceBlockOn(Block var1) {
|
||||
return var1 == Blocks.sand
|
||||
|| var1 == Blocks.hardened_clay
|
||||
|| var1 == Blocks.stained_hardened_clay
|
||||
|| var1 == Blocks.dirt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState var1, Random var4, int var5) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReplaceable(World var3, BlockPos var4) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World var1, EntityPlayer var2, BlockPos var3, IBlockState var4, TileEntity var5) {
|
||||
|
||||
|
||||
if (!var1.isRemote
|
||||
&& var2.getCurrentEquippedItem() != null
|
||||
&& var2.getCurrentEquippedItem().getItem() == Items.shears) {
|
||||
var2.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]);
|
||||
spawnAsEntity(var1, var3, new ItemStack(Blocks.deadbush, 1, 0));
|
||||
} else {
|
||||
super.harvestBlock(var1, var2, var3, var4, var5);
|
||||
}
|
||||
}
|
||||
|
||||
public BlockDeadBush(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyDirection;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
public abstract class BlockDirectional extends Block {
|
||||
public static final PropertyDirection FACING;
|
||||
|
||||
|
||||
static {
|
||||
|
||||
java.lang.String var0 = "facing";
|
||||
FACING = PropertyDirection.create((java.lang.String) (var0), (com.google.common.base.Predicate) (EnumFacing.Plane.HORIZONTAL));
|
||||
}
|
||||
|
||||
protected BlockDirectional(Material var1, MapColor var2) {
|
||||
super(var1, var2);
|
||||
}
|
||||
|
||||
public BlockDirectional(Material var1) {
|
||||
super(var1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected BlockDirectional(net.minecraft.block.material.Material argument0, net.minecraft.block.material.MapColor argument1, long argument2) {
|
||||
this(argument0, argument1);
|
||||
}
|
||||
|
||||
public BlockDirectional(net.minecraft.block.material.Material argument0, long argument1) {
|
||||
this(argument0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.util.List;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockDirt extends Block {
|
||||
|
||||
public static final PropertyEnum<BlockDirt.DirtType> VARIANT;
|
||||
public static final PropertyBool SNOWY;
|
||||
|
||||
@Override
|
||||
public int getDamageValue(World var2, BlockPos var3) {
|
||||
|
||||
IBlockState var11 = var2.getBlockState(var3);
|
||||
return var11.getBlock() != this
|
||||
? 0
|
||||
: ((BlockDirt.DirtType)var11.getValue(net.minecraft.block.BlockDirt.VARIANT)).getMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState var1, IBlockAccess var4, BlockPos var5) {
|
||||
|
||||
if (var1.getValue(net.minecraft.block.BlockDirt.VARIANT) == BlockDirt.DirtType.PODZOL) {
|
||||
Block var11 = var4.getBlockState(var5.up()).getBlock();
|
||||
var1 = var1.withProperty(
|
||||
net.minecraft.block.BlockDirt.SNOWY, var11 == Blocks.snow || var11 == Blocks.snow_layer
|
||||
);
|
||||
}
|
||||
|
||||
return var1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState var3) {
|
||||
|
||||
return ((BlockDirt.DirtType)var3.getValue(net.minecraft.block.BlockDirt.VARIANT)).getMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState var1) {
|
||||
BlockDirt.DirtType var7 = (BlockDirt.DirtType)var1.getValue(net.minecraft.block.BlockDirt.VARIANT);
|
||||
if (var7 == BlockDirt.DirtType.PODZOL) {
|
||||
var7 = BlockDirt.DirtType.DIRT;
|
||||
}
|
||||
|
||||
return var7.getMetadata();
|
||||
}
|
||||
|
||||
static {
|
||||
finishInitialization: {
|
||||
|
||||
java.lang.String[] var0 = new java.lang.String[]{"variant", "snowy"};
|
||||
VARIANT = PropertyEnum.create(var0[0], BlockDirt.DirtType.class);
|
||||
SNOWY = PropertyBool.create(var0[1]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public BlockDirt() {
|
||||
super(Material.ground);
|
||||
this.setDefaultState(
|
||||
this.blockState
|
||||
.getBaseState()
|
||||
.withProperty(net.minecraft.block.BlockDirt.VARIANT, BlockDirt.DirtType.DIRT)
|
||||
.withProperty(net.minecraft.block.BlockDirt.SNOWY, false)
|
||||
);
|
||||
this.setCreativeTab(CreativeTabs.tabBlock);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(net.minecraft.item.Item var2, net.minecraft.creativetab.CreativeTabs var4, java.util.List<net.minecraft.item.ItemStack> var6) {
|
||||
var6.add(new ItemStack(this, 1, BlockDirt.DirtType.DIRT.getMetadata()));
|
||||
var6.add(new ItemStack(this, 1, BlockDirt.DirtType.COARSE_DIRT.getMetadata()));
|
||||
var6.add(new ItemStack(this, 1, BlockDirt.DirtType.PODZOL.getMetadata()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapColor getMapColor(IBlockState var1) {
|
||||
return ((BlockDirt.DirtType)var1.getValue(net.minecraft.block.BlockDirt.VARIANT)).func_181066_d();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
return this.getDefaultState().withProperty(net.minecraft.block.BlockDirt.VARIANT, BlockDirt.DirtType.byMetadata(var1));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, net.minecraft.block.BlockDirt.VARIANT, net.minecraft.block.BlockDirt.SNOWY);
|
||||
}
|
||||
|
||||
public enum DirtType implements net.minecraft.util.IStringSerializable {
|
||||
DIRT(0, "dirt", "default", net.minecraft.block.material.MapColor.dirtColor),
|
||||
COARSE_DIRT(1, "coarse_dirt", "coarse", net.minecraft.block.material.MapColor.dirtColor),
|
||||
PODZOL(2, "podzol", net.minecraft.block.material.MapColor.obsidianColor);
|
||||
|
||||
private final int metadata;
|
||||
private static final net.minecraft.block.BlockDirt.DirtType[] METADATA_LOOKUP = new net.minecraft.block.BlockDirt.DirtType[values().length];
|
||||
private final net.minecraft.block.material.MapColor field_181067_h;
|
||||
private final java.lang.String unlocalizedName;
|
||||
private final java.lang.String name;
|
||||
private static final net.minecraft.block.BlockDirt.DirtType[] AdvancedAntiSkid11iIi1i1 = $valuesImpl();
|
||||
|
||||
DirtType(int var3, java.lang.String var4, net.minecraft.block.material.MapColor var5) {
|
||||
this(var3, var4, var4, var5);
|
||||
}
|
||||
|
||||
DirtType(int var3, java.lang.String var4, java.lang.String var5, net.minecraft.block.material.MapColor var6) {
|
||||
this.metadata = var3;
|
||||
this.name = var4;
|
||||
this.unlocalizedName = var5;
|
||||
this.field_181067_h = var6;
|
||||
}
|
||||
|
||||
public java.lang.String getUnlocalizedName() {
|
||||
return this.unlocalizedName;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public java.lang.String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
static {
|
||||
for (net.minecraft.block.BlockDirt.DirtType var15 : values()) {
|
||||
METADATA_LOOKUP[var15.getMetadata()] = var15;
|
||||
}
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public java.lang.String toString() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public net.minecraft.block.material.MapColor func_181066_d() {
|
||||
return this.field_181067_h;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getMetadata() {
|
||||
return this.metadata;
|
||||
}
|
||||
|
||||
private static net.minecraft.block.BlockDirt.DirtType[] $valuesImpl() {
|
||||
return new net.minecraft.block.BlockDirt.DirtType[]{DIRT, COARSE_DIRT, PODZOL};
|
||||
}
|
||||
|
||||
public static net.minecraft.block.BlockDirt.DirtType byMetadata(int var0) {
|
||||
if (var0 < 0 || var0 >= METADATA_LOOKUP.length) {
|
||||
var0 = 0;
|
||||
}
|
||||
|
||||
return METADATA_LOOKUP[var0];
|
||||
}
|
||||
}
|
||||
|
||||
public BlockDirt(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,272 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.util.Random;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.properties.PropertyDirection;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
|
||||
import net.minecraft.dispenser.IBehaviorDispenseItem;
|
||||
import net.minecraft.dispenser.IBlockSource;
|
||||
import net.minecraft.dispenser.IPosition;
|
||||
import net.minecraft.dispenser.PositionImpl;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.InventoryHelper;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityDispenser;
|
||||
import net.minecraft.tileentity.TileEntityDropper;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.RegistryDefaulted;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockDispenser extends BlockContainer {
|
||||
protected Random rand;
|
||||
public static final RegistryDefaulted<Item, IBehaviorDispenseItem> dispenseBehaviorRegistry;
|
||||
public static final PropertyDirection FACING;
|
||||
public static final PropertyBool TRIGGERED;
|
||||
|
||||
@Override
|
||||
public IBlockState getStateForEntityRender(IBlockState var3) {
|
||||
return this.getDefaultState().withProperty(net.minecraft.block.BlockDispenser.FACING, EnumFacing.SOUTH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World var3, BlockPos var4, IBlockState var5, EntityLivingBase var6, ItemStack var7) {
|
||||
|
||||
var3.setBlockState(
|
||||
var4, var5.withProperty(net.minecraft.block.BlockDispenser.FACING, BlockPistonBase.getFacingFromEntity(var3, var4, var6)), 2
|
||||
);
|
||||
if (var7.hasDisplayName()) {
|
||||
TileEntity var18 = var3.getTileEntity(var4);
|
||||
if (var18 instanceof TileEntityDispenser) {
|
||||
((TileEntityDispenser)var18).setCustomName(var7.getDisplayName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World var1, BlockPos var4, IBlockState var5, Block var6) {
|
||||
|
||||
boolean var21 = var1.isBlockPowered(var4) || var1.isBlockPowered(var4.up());
|
||||
boolean var22 = (Boolean)var5.getValue(net.minecraft.block.BlockDispenser.TRIGGERED);
|
||||
if (var21 && !var22) {
|
||||
var1.scheduleUpdate(var4, this, this.tickRate(var1));
|
||||
var1.setBlockState(var4, var5.withProperty(net.minecraft.block.BlockDispenser.TRIGGERED, true), 4);
|
||||
} else if (!var21 && var22) {
|
||||
var1.setBlockState(var4, var5.withProperty(net.minecraft.block.BlockDispenser.TRIGGERED, false), 4);
|
||||
}
|
||||
}
|
||||
|
||||
public static IPosition getDispensePosition(IBlockSource var0) {
|
||||
|
||||
EnumFacing var11 = getFacing(var0.getBlockMetadata());
|
||||
double var12 = var0.getX() + 0.7 * var11.getFrontOffsetX();
|
||||
double var14 = var0.getY() + 0.7 * var11.getFrontOffsetY();
|
||||
double var16 = var0.getZ() + 0.7 * var11.getFrontOffsetZ();
|
||||
return new PositionImpl(var12, var14, var16);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState onBlockPlaced(
|
||||
World var1, BlockPos var2, EnumFacing var3, float var4, float var7, float var8, int var9, EntityLivingBase var10
|
||||
) {
|
||||
|
||||
return this.getDefaultState()
|
||||
.withProperty(net.minecraft.block.BlockDispenser.FACING, BlockPistonBase.getFacingFromEntity(var1, var2, var10))
|
||||
.withProperty(net.minecraft.block.BlockDispenser.TRIGGERED, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World var1, BlockPos var4, IBlockState var5) {
|
||||
|
||||
TileEntity var14 = var1.getTileEntity(var4);
|
||||
if (var14 instanceof TileEntityDispenser) {
|
||||
InventoryHelper.dropInventoryItems((net.minecraft.world.World) (var1), (net.minecraft.util.BlockPos) (var4), (net.minecraft.inventory.IInventory) ((TileEntityDispenser)var14));
|
||||
var1.updateComparatorOutputLevel(var4, this);
|
||||
}
|
||||
|
||||
super.breakBlock(var1, var4, var5);
|
||||
}
|
||||
|
||||
public BlockDispenser() {
|
||||
super(Material.rock);
|
||||
this.rand = new Random();
|
||||
this.setDefaultState(
|
||||
this.blockState
|
||||
.getBaseState()
|
||||
.withProperty(net.minecraft.block.BlockDispenser.FACING, EnumFacing.NORTH)
|
||||
.withProperty(net.minecraft.block.BlockDispenser.TRIGGERED, false)
|
||||
);
|
||||
this.setCreativeTab(CreativeTabs.tabRedstone);
|
||||
}
|
||||
|
||||
protected IBehaviorDispenseItem getBehavior(ItemStack var2) {
|
||||
return (IBehaviorDispenseItem)net.minecraft.block.BlockDispenser.dispenseBehaviorRegistry.getObject(var2 == null ? null : var2.getItem());
|
||||
}
|
||||
|
||||
private void setDefaultDirection(World var1, BlockPos var2, IBlockState var3) {
|
||||
|
||||
if (!var1.isRemote) {
|
||||
EnumFacing var14 = (EnumFacing)var3.getValue(net.minecraft.block.BlockDispenser.FACING);
|
||||
boolean var15 = var1.getBlockState(var2.north()).getBlock().isFullBlock();
|
||||
boolean var16 = var1.getBlockState(var2.south()).getBlock().isFullBlock();
|
||||
if (var14 == EnumFacing.NORTH && var15 && !var16) {
|
||||
var14 = EnumFacing.SOUTH;
|
||||
} else if (var14 == EnumFacing.SOUTH && var16 && !var15) {
|
||||
var14 = EnumFacing.NORTH;
|
||||
} else {
|
||||
boolean var17 = var1.getBlockState(var2.west()).getBlock().isFullBlock();
|
||||
boolean var18 = var1.getBlockState(var2.east()).getBlock().isFullBlock();
|
||||
if (var14 == EnumFacing.WEST && var17 && !var18) {
|
||||
var14 = EnumFacing.EAST;
|
||||
} else if (var14 == EnumFacing.EAST && var18 && !var17) {
|
||||
var14 = EnumFacing.WEST;
|
||||
}
|
||||
}
|
||||
|
||||
var1.setBlockState(
|
||||
var2,
|
||||
var3.withProperty(net.minecraft.block.BlockDispenser.FACING, var14).withProperty(net.minecraft.block.BlockDispenser.TRIGGERED, false),
|
||||
2
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, net.minecraft.block.BlockDispenser.FACING, net.minecraft.block.BlockDispenser.TRIGGERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World var1) {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World var1, BlockPos var2) {
|
||||
|
||||
return Container.calcRedstone(var1.getTileEntity(var2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState var3) {
|
||||
|
||||
int var7 = 0;
|
||||
var7 |= ((EnumFacing)var3.getValue(net.minecraft.block.BlockDispenser.FACING)).getIndex();
|
||||
if ((Boolean)var3.getValue(net.minecraft.block.BlockDispenser.TRIGGERED)) {
|
||||
var7 |= 8;
|
||||
}
|
||||
|
||||
return var7;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
return this.getDefaultState()
|
||||
.withProperty(net.minecraft.block.BlockDispenser.FACING, getFacing(var1))
|
||||
.withProperty(net.minecraft.block.BlockDispenser.TRIGGERED, (var1 & 8) > 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var3, int var4) {
|
||||
return new TileEntityDispenser();
|
||||
}
|
||||
|
||||
static {
|
||||
finishInitialization: {
|
||||
|
||||
java.lang.String[] var0 = new java.lang.String[]{"facing", "triggered"};
|
||||
FACING = PropertyDirection.create(var0[0]);
|
||||
TRIGGERED = PropertyBool.create(var0[1]);
|
||||
dispenseBehaviorRegistry = new RegistryDefaulted<>(new BehaviorDefaultDispenseItem());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World var1, BlockPos var2, IBlockState var3, Random var6) {
|
||||
|
||||
if (!var1.isRemote) {
|
||||
this.dispense(var1, var2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World var1, BlockPos var2, IBlockState var5) {
|
||||
|
||||
super.onBlockAdded(var1, var2, var5);
|
||||
this.setDefaultDirection(var1, var2, var5);
|
||||
}
|
||||
|
||||
protected void dispense(World var2, BlockPos var4) {
|
||||
|
||||
BlockSourceImpl var25 = new BlockSourceImpl(var2, var4);
|
||||
TileEntityDispenser var26 = (TileEntityDispenser)var25.getBlockTileEntity();
|
||||
if (var26 != null) {
|
||||
int var27 = var26.getDispenseSlot();
|
||||
if (var27 < 0) {
|
||||
var2.playAuxSFX(1001, var4, 0);
|
||||
} else {
|
||||
ItemStack var28 = var26.getStackInSlot(var27);
|
||||
IBehaviorDispenseItem var29 = this.getBehavior(var28);
|
||||
if (var29 != IBehaviorDispenseItem.itemDispenseBehaviorProvider) {
|
||||
ItemStack var30 = var29.dispense(var25, var28);
|
||||
var26.setInventorySlotContents(var27, var30.stackSize <= 0 ? null : var30);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static EnumFacing getFacing(int var0) {
|
||||
return EnumFacing.getFront(var0 & 7);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World var1, BlockPos var4, IBlockState var5, EntityPlayer var6, EnumFacing var7, float var8, float var9, float var10
|
||||
) {
|
||||
|
||||
if (var1.isRemote) {
|
||||
return true;
|
||||
}
|
||||
|
||||
TileEntity var18 = var1.getTileEntity(var4);
|
||||
if (var18 instanceof TileEntityDispenser) {
|
||||
var6.displayGUIChest((TileEntityDispenser)var18);
|
||||
if (var18 instanceof TileEntityDropper) {
|
||||
var6.triggerAchievement(StatList.field_181731_O);
|
||||
} else {
|
||||
var6.triggerAchievement(StatList.field_181733_Q);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public BlockDispenser(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,547 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.lang.invoke.CallSite;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.MethodType;
|
||||
import java.lang.invoke.MutableCallSite;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.properties.PropertyDirection;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockDoor extends Block {
|
||||
|
||||
|
||||
public static final PropertyEnum<BlockDoor.EnumHingePosition> HINGE;
|
||||
public static final PropertyDirection FACING;
|
||||
public static final PropertyBool POWERED;
|
||||
public static final PropertyBool OPEN;
|
||||
|
||||
|
||||
public static final PropertyEnum<BlockDoor.EnumDoorHalf> HALF;
|
||||
|
||||
public static EnumFacing getFacing(IBlockAccess var0, BlockPos var3) {
|
||||
|
||||
return getFacing(combineMetadata(var0, var3));
|
||||
}
|
||||
|
||||
private void setBoundBasedOnMeta(int var3) {
|
||||
|
||||
float var9 = 0.1875F;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
|
||||
EnumFacing var10 = getFacing(var3);
|
||||
int var11 = var3;
|
||||
if (isOpen(var11)) {
|
||||
int var12 = var3;
|
||||
if (isHingeLeft(var12)) {
|
||||
if (var10 == EnumFacing.EAST) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 1.0F - var9, 1.0F, 1.0F, 1.0F);
|
||||
} else if (var10 == EnumFacing.SOUTH) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, var9, 1.0F, 1.0F);
|
||||
} else if (var10 == EnumFacing.WEST) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var9);
|
||||
} else if (var10 == EnumFacing.NORTH) {
|
||||
this.setBlockBounds(1.0F - var9, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
} else {
|
||||
if (var10 == EnumFacing.EAST) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var9);
|
||||
} else if (var10 == EnumFacing.SOUTH) {
|
||||
this.setBlockBounds(1.0F - var9, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
} else if (var10 == EnumFacing.WEST) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 1.0F - var9, 1.0F, 1.0F, 1.0F);
|
||||
} else if (var10 == EnumFacing.NORTH) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, var9, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int var13 = var3;
|
||||
if (isHingeLeft(var13)) {
|
||||
if (var10 == EnumFacing.EAST) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, var9, 1.0F, 1.0F);
|
||||
} else if (var10 == EnumFacing.SOUTH) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var9);
|
||||
} else if (var10 == EnumFacing.WEST) {
|
||||
this.setBlockBounds(1.0F - var9, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
} else if (var10 == EnumFacing.NORTH) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 1.0F - var9, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
} else {
|
||||
if (var10 == EnumFacing.EAST) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, var9, 1.0F, 1.0F);
|
||||
} else if (var10 == EnumFacing.SOUTH) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var9);
|
||||
} else if (var10 == EnumFacing.WEST) {
|
||||
this.setBlockBounds(1.0F - var9, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
} else if (var10 == EnumFacing.NORTH) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 1.0F - var9, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World var3, BlockPos var4, IBlockState var5, EntityPlayer var6) {
|
||||
|
||||
BlockPos var12 = var4.down();
|
||||
if (var6.capabilities.isCreativeMode
|
||||
&& var5.getValue(net.minecraft.block.BlockDoor.HALF) == BlockDoor.EnumDoorHalf.UPPER
|
||||
&& var3.getBlockState(var12).getBlock() == this) {
|
||||
var3.setBlockToAir(var12);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPassable(IBlockAccess var1, BlockPos var2) {
|
||||
|
||||
int var9 = combineMetadata(var1, var2);
|
||||
return isOpen(var9);
|
||||
}
|
||||
|
||||
static {
|
||||
finishInitialization: {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
FACING = PropertyDirection.create((java.lang.String) ("facing"), (com.google.common.base.Predicate) (EnumFacing.Plane.HORIZONTAL));
|
||||
OPEN = PropertyBool.create("open");
|
||||
HINGE = PropertyEnum.create("hinge", BlockDoor.EnumHingePosition.class);
|
||||
POWERED = PropertyBool.create("powered");
|
||||
HALF = PropertyEnum.create("half", BlockDoor.EnumDoorHalf.class);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World var1, BlockPos var4, IBlockState var5, EntityPlayer var6, EnumFacing var7, float var8, float var9, float var10
|
||||
) {
|
||||
|
||||
if (this.blockMaterial == Material.iron) {
|
||||
return true;
|
||||
}
|
||||
|
||||
BlockPos var22 = var5.getValue(net.minecraft.block.BlockDoor.HALF) == BlockDoor.EnumDoorHalf.LOWER
|
||||
? var4
|
||||
: var4.down();
|
||||
IBlockState var23 = var4.equals(var22) ? var5 : var1.getBlockState(var22);
|
||||
if (var23.getBlock() != this) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var5 = var23.cycleProperty(OPEN);
|
||||
var1.setBlockState(var22, var5, 2);
|
||||
var1.markBlockRangeForRenderUpdate(var22, var4);
|
||||
var1.playAuxSFXAtEntity(
|
||||
var6, var5.getValue(OPEN) ? 1003 : 1006, var4, 0
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected BlockDoor(Material var1) {
|
||||
super(var1);
|
||||
this.setDefaultState(
|
||||
this.blockState
|
||||
.getBaseState()
|
||||
.withProperty(net.minecraft.block.BlockDoor.FACING, EnumFacing.NORTH)
|
||||
.withProperty(OPEN, false)
|
||||
.withProperty(HINGE, BlockDoor.EnumHingePosition.LEFT)
|
||||
.withProperty(POWERED, false)
|
||||
.withProperty(net.minecraft.block.BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World var1, BlockPos var4) {
|
||||
|
||||
return var4.getY() >= 255
|
||||
? false
|
||||
: World.doesBlockHaveSolidTopSurface(var1, var4.down())
|
||||
&& super.canPlaceBlockAt(var1, var4)
|
||||
&& super.canPlaceBlockAt(var1, var4.up());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
return (var1 & 8) > 0
|
||||
? this.getDefaultState()
|
||||
.withProperty(net.minecraft.block.BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER)
|
||||
.withProperty(HINGE, (var1 & 1) > 0 ? BlockDoor.EnumHingePosition.RIGHT : BlockDoor.EnumHingePosition.LEFT)
|
||||
.withProperty(POWERED, (var1 & 2) > 0)
|
||||
: this.getDefaultState()
|
||||
.withProperty(net.minecraft.block.BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER)
|
||||
.withProperty(net.minecraft.block.BlockDoor.FACING, EnumFacing.getHorizontal(var1 & 3).rotateYCCW())
|
||||
.withProperty(OPEN, (var1 & 4) > 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState var1, IBlockAccess var4, BlockPos var5) {
|
||||
|
||||
|
||||
if (var1.getValue(net.minecraft.block.BlockDoor.HALF) == BlockDoor.EnumDoorHalf.LOWER) {
|
||||
IBlockState var12 = var4.getBlockState(var5.up());
|
||||
if (var12.getBlock() == this) {
|
||||
var1 = var1.withProperty(
|
||||
HINGE,
|
||||
(BlockDoor.EnumHingePosition)var12.getValue(HINGE)
|
||||
)
|
||||
.withProperty(
|
||||
POWERED, (Boolean)var12.getValue(POWERED)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
IBlockState var13 = var4.getBlockState(var5.down());
|
||||
if (var13.getBlock() == this) {
|
||||
var1 = var1.withProperty(
|
||||
net.minecraft.block.BlockDoor.FACING, (EnumFacing)var13.getValue(net.minecraft.block.BlockDoor.FACING)
|
||||
)
|
||||
.withProperty(
|
||||
OPEN, (Boolean)var13.getValue(OPEN)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return var1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumWorldBlockLayer getBlockLayer() {
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
public static boolean isOpen(IBlockAccess var2, BlockPos var3) {
|
||||
|
||||
int var8 = combineMetadata(var2, var3);
|
||||
return isOpen(var8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItem(World var1, BlockPos var4) {
|
||||
return this.getItem();
|
||||
}
|
||||
|
||||
protected static int removeHalfBit(int var0) {
|
||||
return var0 & 7;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState var3) {
|
||||
|
||||
|
||||
int var8 = 0;
|
||||
if (var3.getValue(net.minecraft.block.BlockDoor.HALF) == BlockDoor.EnumDoorHalf.UPPER) {
|
||||
var8 |= 8;
|
||||
if (var3.getValue(HINGE) == BlockDoor.EnumHingePosition.RIGHT) {
|
||||
var8 |= 1;
|
||||
}
|
||||
|
||||
if ((Boolean)var3.getValue(POWERED)) {
|
||||
var8 |= 2;
|
||||
}
|
||||
} else {
|
||||
var8 |= ((EnumFacing)var3.getValue(net.minecraft.block.BlockDoor.FACING))
|
||||
.rotateY()
|
||||
.getHorizontalIndex();
|
||||
if ((Boolean)var3.getValue(OPEN)) {
|
||||
var8 |= 4;
|
||||
}
|
||||
}
|
||||
|
||||
return var8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World var1, BlockPos var4, IBlockState var5, Block var6) {
|
||||
|
||||
|
||||
if (var5.getValue(net.minecraft.block.BlockDoor.HALF) == BlockDoor.EnumDoorHalf.UPPER) {
|
||||
BlockPos var31 = var4.down();
|
||||
IBlockState var32 = var1.getBlockState(var31);
|
||||
if (var32.getBlock() != this) {
|
||||
var1.setBlockToAir(var4);
|
||||
return;
|
||||
}
|
||||
|
||||
if (var6 != this) {
|
||||
this.onNeighborBlockChange(var1, var31, var32, var6);
|
||||
}
|
||||
} else {
|
||||
boolean var35 = false;
|
||||
BlockPos var36 = var4.up();
|
||||
IBlockState var33 = var1.getBlockState(var36);
|
||||
if (var33.getBlock() != this) {
|
||||
var1.setBlockToAir(var4);
|
||||
var35 = true;
|
||||
}
|
||||
|
||||
if (!World.doesBlockHaveSolidTopSurface(var1, var4.down())) {
|
||||
var1.setBlockToAir(var4);
|
||||
var35 = true;
|
||||
if (var33.getBlock() == this) {
|
||||
var1.setBlockToAir(var36);
|
||||
}
|
||||
}
|
||||
|
||||
if (var35) {
|
||||
if (!var1.isRemote) {
|
||||
this.dropBlockAsItem(var1, var4, var5, 0);
|
||||
}
|
||||
} else {
|
||||
boolean var34 = var1.isBlockPowered(var4) || var1.isBlockPowered(var36);
|
||||
if ((var34 || var6.canProvidePower())
|
||||
&& var6 != this
|
||||
&& var34 != (Boolean)var33.getValue(POWERED)) {
|
||||
var1.setBlockState(var36, var33.withProperty(POWERED, var34), 2);
|
||||
if (var34 != (Boolean)var5.getValue(OPEN)) {
|
||||
var1.setBlockState(var4, var5.withProperty(OPEN, var34), 2);
|
||||
var1.markBlockRangeForRenderUpdate(var4, var4);
|
||||
var1.playAuxSFXAtEntity((EntityPlayer)null, var34 ? 1003 : 1006, var4, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState var1, Random var4, int var5) {
|
||||
Item var10000;
|
||||
if (var1.getValue(net.minecraft.block.BlockDoor.HALF) == BlockDoor.EnumDoorHalf.UPPER) {
|
||||
var10000 = null;
|
||||
} else {
|
||||
var10000 = this.getItem();
|
||||
}
|
||||
|
||||
return var10000;
|
||||
}
|
||||
|
||||
public void toggleDoor(World var3, BlockPos var4, boolean var5) {
|
||||
|
||||
IBlockState var17 = var3.getBlockState(var4);
|
||||
if (var17.getBlock() == this) {
|
||||
BlockPos var18 = var17.getValue(net.minecraft.block.BlockDoor.HALF) == BlockDoor.EnumDoorHalf.LOWER
|
||||
? var4
|
||||
: var4.down();
|
||||
IBlockState var19 = var4 == var18 ? var17 : var3.getBlockState(var18);
|
||||
if (var19.getBlock() == this
|
||||
&& (Boolean)var19.getValue(OPEN) != var5) {
|
||||
var3.setBlockState(var18, var19.withProperty(OPEN, var5), 2);
|
||||
var3.markBlockRangeForRenderUpdate(var18, var4);
|
||||
var3.playAuxSFXAtEntity((EntityPlayer)null, var5 ? 1003 : 1006, var4, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBox(World var3, BlockPos var4) {
|
||||
|
||||
this.setBlockBoundsBasedOnState(var3, var4);
|
||||
return super.getSelectedBoundingBox(var3, var4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMobilityFlag() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess var3, BlockPos var4) {
|
||||
|
||||
this.setBoundBasedOnMeta(combineMetadata(var3, var4));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(World var1, BlockPos var2, IBlockState var3) {
|
||||
|
||||
this.setBlockBoundsBasedOnState(var1, var2);
|
||||
return super.getCollisionBoundingBox(var1, var2, var3);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static int combineMetadata(IBlockAccess var0, BlockPos var1) {
|
||||
|
||||
IBlockState var8 = var0.getBlockState(var1);
|
||||
int var9 = var8.getBlock().getMetaFromState(var8);
|
||||
boolean var10 = isTop(var9);
|
||||
IBlockState var11 = var0.getBlockState(var1.down());
|
||||
int var12 = var11.getBlock().getMetaFromState(var11);
|
||||
int var13 = var10 ? var12 : var9;
|
||||
IBlockState var14 = var0.getBlockState(var1.up());
|
||||
int var15 = var14.getBlock().getMetaFromState(var14);
|
||||
int var16 = var10 ? var9 : var15;
|
||||
boolean var17 = (var16 & 1) != 0;
|
||||
boolean var18 = (var16 & 2) != 0;
|
||||
return removeHalfBit(var13) | (var10 ? 8 : 0) | (var17 ? 16 : 0) | (var18 ? 32 : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocalizedName() {
|
||||
|
||||
return StatCollector.translateToLocal((this.getUnlocalizedName() + ".name").replaceAll("tile", "item"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public MovingObjectPosition collisionRayTrace(World var1, BlockPos var2, Vec3 var5, Vec3 var6) {
|
||||
|
||||
this.setBlockBoundsBasedOnState(var1, var2);
|
||||
return super.collisionRayTrace(var1, var2, var5, var6);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(
|
||||
this, net.minecraft.block.BlockDoor.HALF, net.minecraft.block.BlockDoor.FACING, OPEN, HINGE, POWERED
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static EnumFacing getFacing(int var0) {
|
||||
return EnumFacing.getHorizontal(var0 & 3).rotateYCCW();
|
||||
}
|
||||
|
||||
protected static boolean isTop(int var0) {
|
||||
return (var0 & 8) != 0;
|
||||
}
|
||||
|
||||
protected static boolean isOpen(int var0) {
|
||||
int var2 = var0;
|
||||
return (var2 & 4) != 0;
|
||||
}
|
||||
|
||||
protected static boolean isHingeLeft(int var0) {
|
||||
int var2 = var0;
|
||||
return (var2 & 16) != 0;
|
||||
}
|
||||
|
||||
private Item getItem() {
|
||||
return this == Blocks.iron_door
|
||||
? Items.iron_door
|
||||
: (
|
||||
this == Blocks.spruce_door
|
||||
? Items.spruce_door
|
||||
: (
|
||||
this == Blocks.birch_door
|
||||
? Items.birch_door
|
||||
: (
|
||||
this == Blocks.jungle_door
|
||||
? Items.jungle_door
|
||||
: (
|
||||
this == Blocks.acacia_door
|
||||
? Items.acacia_door
|
||||
: (this == Blocks.dark_oak_door ? Items.dark_oak_door : Items.oak_door)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public enum EnumHingePosition implements net.minecraft.util.IStringSerializable {
|
||||
LEFT,
|
||||
RIGHT;
|
||||
|
||||
private static final net.minecraft.block.BlockDoor.EnumHingePosition[] stopwatch34 = $values();
|
||||
|
||||
@java.lang.Override
|
||||
public java.lang.String getName() {
|
||||
return this == LEFT ? "left" : "right";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@java.lang.Override
|
||||
public java.lang.String toString() {
|
||||
return this.getName();
|
||||
}
|
||||
|
||||
private static net.minecraft.block.BlockDoor.EnumHingePosition[] $values() {
|
||||
return new net.minecraft.block.BlockDoor.EnumHingePosition[]{LEFT, RIGHT};
|
||||
}
|
||||
}
|
||||
|
||||
public enum EnumDoorHalf implements net.minecraft.util.IStringSerializable {
|
||||
UPPER,
|
||||
LOWER;
|
||||
|
||||
private static final net.minecraft.block.BlockDoor.EnumDoorHalf[] AdvancedAntiSkid1ill1lIl = $values();
|
||||
|
||||
@java.lang.Override
|
||||
public java.lang.String getName() {
|
||||
return this == UPPER ? "upper" : "lower";
|
||||
}
|
||||
|
||||
private static net.minecraft.block.BlockDoor.EnumDoorHalf[] $values() {
|
||||
return new net.minecraft.block.BlockDoor.EnumDoorHalf[]{UPPER, LOWER};
|
||||
}
|
||||
|
||||
|
||||
|
||||
@java.lang.Override
|
||||
public java.lang.String toString() {
|
||||
return this.getName();
|
||||
}
|
||||
}
|
||||
|
||||
protected BlockDoor(net.minecraft.block.material.Material argument0, long argument1) {
|
||||
this(argument0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,464 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.lang.invoke.CallSite;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.MethodType;
|
||||
import java.lang.invoke.MutableCallSite;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeColorHelper;
|
||||
|
||||
public class BlockDoublePlant extends BlockBush implements IGrowable {
|
||||
|
||||
|
||||
|
||||
public static final PropertyEnum<EnumFacing> FACING;
|
||||
public static final PropertyEnum<BlockDoublePlant.EnumBlockHalf> HALF;
|
||||
|
||||
public static final PropertyEnum<BlockDoublePlant.EnumPlantType> VARIANT;
|
||||
|
||||
@Override
|
||||
public boolean canUseBonemeal(World var3, Random var4, BlockPos var5, IBlockState var6) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState var3) {
|
||||
|
||||
return var3.getValue(net.minecraft.block.BlockDoublePlant.HALF) == BlockDoublePlant.EnumBlockHalf.UPPER
|
||||
? 8 | ((EnumFacing)var3.getValue(FACING)).getHorizontalIndex()
|
||||
: ((BlockDoublePlant.EnumPlantType)var3.getValue(net.minecraft.block.BlockDoublePlant.VARIANT)).getMeta();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block.EnumOffsetType getOffsetType() {
|
||||
return Block.EnumOffsetType.XZ;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void checkAndDropBlock(World var1, BlockPos var2, IBlockState var5) {
|
||||
|
||||
if (!this.canBlockStay(var1, var2, var5)) {
|
||||
boolean var15 = var5.getValue(net.minecraft.block.BlockDoublePlant.HALF) == BlockDoublePlant.EnumBlockHalf.UPPER;
|
||||
BlockPos var16 = var15 ? var2 : var2.up();
|
||||
BlockPos var17 = var15 ? var2.down() : var2;
|
||||
Block var18 = var15 ? this : var1.getBlockState(var16).getBlock();
|
||||
Block var19 = var15 ? var1.getBlockState(var17).getBlock() : this;
|
||||
if (var18 == this) {
|
||||
var1.setBlockState(var16, Blocks.air.getDefaultState(), 2);
|
||||
}
|
||||
|
||||
if (var19 == this) {
|
||||
var1.setBlockState(var17, Blocks.air.getDefaultState(), 3);
|
||||
if (!var15) {
|
||||
this.dropBlockAsItem(var1, var17, var5, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(net.minecraft.item.Item var2, net.minecraft.creativetab.CreativeTabs var4, java.util.List<net.minecraft.item.ItemStack> var6) {
|
||||
|
||||
|
||||
for (BlockDoublePlant.EnumPlantType var15 : BlockDoublePlant.EnumPlantType.values()) {
|
||||
int var16 = var15.getMeta();
|
||||
byte var17 = 1;
|
||||
Item var18 = var2;
|
||||
var6.add(new ItemStack(var18, var17, var16));
|
||||
}
|
||||
}
|
||||
|
||||
public BlockDoublePlant() {
|
||||
super(Material.vine);
|
||||
this.setDefaultState(
|
||||
this.blockState
|
||||
.getBaseState()
|
||||
.withProperty(net.minecraft.block.BlockDoublePlant.VARIANT, BlockDoublePlant.EnumPlantType.SUNFLOWER)
|
||||
.withProperty(net.minecraft.block.BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.LOWER)
|
||||
.withProperty(FACING, EnumFacing.NORTH)
|
||||
);
|
||||
this.setHardness(0.0F);
|
||||
this.setStepSound(soundTypeGrass);
|
||||
this.setUnlocalizedName("doublePlant");
|
||||
}
|
||||
|
||||
private boolean onHarvest(World var1, BlockPos var2, IBlockState var3, EntityPlayer var6) {
|
||||
|
||||
BlockDoublePlant.EnumPlantType var20 = (BlockDoublePlant.EnumPlantType)var3.getValue(net.minecraft.block.BlockDoublePlant.VARIANT);
|
||||
if (var20 != BlockDoublePlant.EnumPlantType.FERN && var20 != BlockDoublePlant.EnumPlantType.GRASS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var6.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]);
|
||||
int var21 = (var20 == BlockDoublePlant.EnumPlantType.GRASS ? BlockTallGrass.EnumType.GRASS : BlockTallGrass.EnumType.FERN).getMeta();
|
||||
spawnAsEntity(var1, var2, new ItemStack(Blocks.tallgrass, 2, var21));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World var3, BlockPos var4, IBlockState var5, EntityLivingBase var6, ItemStack var7) {
|
||||
|
||||
var3.setBlockState(
|
||||
var4.up(),
|
||||
this.getDefaultState().withProperty(net.minecraft.block.BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.UPPER),
|
||||
2
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamageValue(World var2, BlockPos var3) {
|
||||
|
||||
return this.getVariant(var2, var3).getMeta();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState var1, Random var4, int var5) {
|
||||
if (var1.getValue(net.minecraft.block.BlockDoublePlant.HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) {
|
||||
return null;
|
||||
}
|
||||
|
||||
BlockDoublePlant.EnumPlantType var9 = (BlockDoublePlant.EnumPlantType)var1.getValue(net.minecraft.block.BlockDoublePlant.VARIANT);
|
||||
return var9 == BlockDoublePlant.EnumPlantType.FERN
|
||||
? null
|
||||
: (var9 == BlockDoublePlant.EnumPlantType.GRASS ? (var4.nextInt(8) == 0 ? Items.wheat_seeds : null) : Item.getItemFromBlock(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
return (var1 & 8) > 0
|
||||
? this.getDefaultState().withProperty(net.minecraft.block.BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.UPPER)
|
||||
: this.getDefaultState()
|
||||
.withProperty(net.minecraft.block.BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.LOWER)
|
||||
.withProperty(net.minecraft.block.BlockDoublePlant.VARIANT, BlockDoublePlant.EnumPlantType.byMetadata(var1 & 7));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlockStay(World var1, BlockPos var4, IBlockState var5) {
|
||||
|
||||
if (var5.getValue(net.minecraft.block.BlockDoublePlant.HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) {
|
||||
return var1.getBlockState(var4.down()).getBlock() == this;
|
||||
}
|
||||
|
||||
IBlockState var11 = var1.getBlockState(var4.up());
|
||||
return var11.getBlock() == this && super.canBlockStay(var1, var4, var11);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess var3, BlockPos var4) {
|
||||
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World var1, BlockPos var4) {
|
||||
|
||||
return super.canPlaceBlockAt(var1, var4) && var1.isAirBlock(var4.up());
|
||||
}
|
||||
|
||||
|
||||
|
||||
public BlockDoublePlant.EnumPlantType getVariant(IBlockAccess var1, BlockPos var4) {
|
||||
|
||||
IBlockState var10 = var1.getBlockState(var4);
|
||||
if (var10.getBlock() == this) {
|
||||
var10 = this.getActualState(var10, var1, var4);
|
||||
return (BlockDoublePlant.EnumPlantType)var10.getValue(net.minecraft.block.BlockDoublePlant.VARIANT);
|
||||
} else {
|
||||
return BlockDoublePlant.EnumPlantType.FERN;
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
finishInitialization: {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
VARIANT = PropertyEnum.create("variant", BlockDoublePlant.EnumPlantType.class);
|
||||
HALF = PropertyEnum.create("half", BlockDoublePlant.EnumBlockHalf.class);
|
||||
FACING = BlockDirectional.FACING;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World var1, EntityPlayer var2, BlockPos var3, IBlockState var4, TileEntity var5) {
|
||||
|
||||
if (var1.isRemote
|
||||
|| var2.getCurrentEquippedItem() == null
|
||||
|| var2.getCurrentEquippedItem().getItem() != Items.shears
|
||||
|| var4.getValue(net.minecraft.block.BlockDoublePlant.HALF) != BlockDoublePlant.EnumBlockHalf.LOWER
|
||||
|| !this.onHarvest(var1, var3, var4, var2)) {
|
||||
super.harvestBlock(var1, var2, var3, var4, var5);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState var1, IBlockAccess var4, BlockPos var5) {
|
||||
|
||||
if (var1.getValue(net.minecraft.block.BlockDoublePlant.HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) {
|
||||
IBlockState var11 = var4.getBlockState(var5.down());
|
||||
|
||||
if (var11.getBlock() == this) {
|
||||
var1 = var1.withProperty(
|
||||
net.minecraft.block.BlockDoublePlant.VARIANT,
|
||||
(BlockDoublePlant.EnumPlantType)var11.getValue(net.minecraft.block.BlockDoublePlant.VARIANT)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return var1;
|
||||
}
|
||||
|
||||
public void placeAt(World var3, BlockPos var4, BlockDoublePlant.EnumPlantType var5, int var6) {
|
||||
|
||||
var3.setBlockState(
|
||||
var4,
|
||||
this.getDefaultState()
|
||||
.withProperty(net.minecraft.block.BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.LOWER)
|
||||
.withProperty(net.minecraft.block.BlockDoublePlant.VARIANT, var5),
|
||||
var6
|
||||
);
|
||||
var3.setBlockState(
|
||||
var4.up(),
|
||||
this.getDefaultState().withProperty(net.minecraft.block.BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.UPPER),
|
||||
var6
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, net.minecraft.block.BlockDoublePlant.HALF, net.minecraft.block.BlockDoublePlant.VARIANT, FACING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World var3, BlockPos var4, IBlockState var5, EntityPlayer var6) {
|
||||
|
||||
|
||||
if (var5.getValue(net.minecraft.block.BlockDoublePlant.HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) {
|
||||
if (var3.getBlockState(var4.down()).getBlock() == this) {
|
||||
label37:
|
||||
if (!var6.capabilities.isCreativeMode) {
|
||||
IBlockState var21 = var3.getBlockState(var4.down());
|
||||
BlockDoublePlant.EnumPlantType var22 = (BlockDoublePlant.EnumPlantType)var21.getValue(
|
||||
net.minecraft.block.BlockDoublePlant.VARIANT
|
||||
);
|
||||
if (var22 != BlockDoublePlant.EnumPlantType.FERN && var22 != BlockDoublePlant.EnumPlantType.GRASS) {
|
||||
var3.destroyBlock(var4.down(), true);
|
||||
break label37;
|
||||
}
|
||||
|
||||
if (!var3.isRemote) {
|
||||
if (var6.getCurrentEquippedItem() != null && var6.getCurrentEquippedItem().getItem() == Items.shears) {
|
||||
this.onHarvest(var3, var4, var21, var6);
|
||||
var3.setBlockToAir(var4.down());
|
||||
break label37;
|
||||
}
|
||||
|
||||
var3.destroyBlock(var4.down(), true);
|
||||
break label37;
|
||||
}
|
||||
|
||||
var3.setBlockToAir(var4.down());
|
||||
} else {
|
||||
var3.setBlockToAir(var4.down());
|
||||
}
|
||||
}
|
||||
} else if (var6.capabilities.isCreativeMode
|
||||
&& var3.getBlockState(var4.up()).getBlock() == this) {
|
||||
var3.setBlockState(var4.up(), Blocks.air.getDefaultState(), 2);
|
||||
}
|
||||
|
||||
super.onBlockHarvested(var3, var4, var5, var6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canGrow(World var1, BlockPos var2, IBlockState var3, boolean var4) {
|
||||
|
||||
BlockDoublePlant.EnumPlantType var9 = this.getVariant(var1, var2);
|
||||
return var9 != BlockDoublePlant.EnumPlantType.GRASS && var9 != BlockDoublePlant.EnumPlantType.FERN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState var1) {
|
||||
return var1.getValue(net.minecraft.block.BlockDoublePlant.HALF) != BlockDoublePlant.EnumBlockHalf.UPPER
|
||||
&& var1.getValue(net.minecraft.block.BlockDoublePlant.VARIANT) != BlockDoublePlant.EnumPlantType.GRASS
|
||||
? ((BlockDoublePlant.EnumPlantType)var1.getValue(net.minecraft.block.BlockDoublePlant.VARIANT)).getMeta()
|
||||
: 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void grow(World var1, Random var2, BlockPos var5, IBlockState var6) {
|
||||
|
||||
spawnAsEntity(
|
||||
var1,
|
||||
var5,
|
||||
new ItemStack(this, 1, this.getVariant(var1, var5).getMeta())
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReplaceable(World var3, BlockPos var4) {
|
||||
|
||||
IBlockState var10 = var3.getBlockState(var4);
|
||||
if (var10.getBlock() != this) {
|
||||
return true;
|
||||
}
|
||||
|
||||
BlockDoublePlant.EnumPlantType var11 = (BlockDoublePlant.EnumPlantType)this.getActualState(var10, var3, var4)
|
||||
.getValue(net.minecraft.block.BlockDoublePlant.VARIANT);
|
||||
return var11 == BlockDoublePlant.EnumPlantType.FERN || var11 == BlockDoublePlant.EnumPlantType.GRASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int colorMultiplier(IBlockAccess var1, BlockPos var2, int var5) {
|
||||
|
||||
BlockDoublePlant.EnumPlantType var11 = this.getVariant(var1, var2);
|
||||
return var11 != BlockDoublePlant.EnumPlantType.GRASS && var11 != BlockDoublePlant.EnumPlantType.FERN
|
||||
? 16777215
|
||||
: BiomeColorHelper.getGrassColorAtPos(var1, var2);
|
||||
}
|
||||
|
||||
public enum EnumBlockHalf implements net.minecraft.util.IStringSerializable {
|
||||
UPPER,
|
||||
LOWER;
|
||||
|
||||
private static final net.minecraft.block.BlockDoublePlant.EnumBlockHalf[] AdvancedAntiSkid1i1Iiiii = $values();
|
||||
|
||||
|
||||
|
||||
private static net.minecraft.block.BlockDoublePlant.EnumBlockHalf[] $values() {
|
||||
return new net.minecraft.block.BlockDoublePlant.EnumBlockHalf[]{UPPER, LOWER};
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public java.lang.String toString() {
|
||||
return this.getName();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public java.lang.String getName() {
|
||||
return this == UPPER ? "upper" : "lower";
|
||||
}
|
||||
}
|
||||
|
||||
public enum EnumPlantType implements net.minecraft.util.IStringSerializable {
|
||||
SUNFLOWER(0, "sunflower"),
|
||||
SYRINGA(1, "syringa"),
|
||||
GRASS(2, "double_grass", "grass"),
|
||||
FERN(3, "double_fern", "fern"),
|
||||
ROSE(4, "double_rose", "rose"),
|
||||
PAEONIA(5, "paeonia");
|
||||
|
||||
private static final net.minecraft.block.BlockDoublePlant.EnumPlantType[] META_LOOKUP = new net.minecraft.block.BlockDoublePlant.EnumPlantType[values().length];
|
||||
private static final net.minecraft.block.BlockDoublePlant.EnumPlantType[] AdvancedAntiSkid1i1iI1Ii = $values();
|
||||
private final java.lang.String name;
|
||||
private final java.lang.String unlocalizedName;
|
||||
private final int meta;
|
||||
|
||||
public int getMeta() {
|
||||
return this.meta;
|
||||
}
|
||||
|
||||
public java.lang.String getUnlocalizedName() {
|
||||
return this.unlocalizedName;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public java.lang.String toString() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
EnumPlantType(int var3, java.lang.String var4, java.lang.String var5) {
|
||||
this.meta = var3;
|
||||
this.name = var4;
|
||||
this.unlocalizedName = var5;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static {
|
||||
for (net.minecraft.block.BlockDoublePlant.EnumPlantType var15 : values()) {
|
||||
META_LOOKUP[var15.getMeta()] = var15;
|
||||
}
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public java.lang.String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
EnumPlantType(int var3, java.lang.String var4) {
|
||||
this(var3, var4, var4);
|
||||
}
|
||||
|
||||
private static net.minecraft.block.BlockDoublePlant.EnumPlantType[] $values() {
|
||||
return new net.minecraft.block.BlockDoublePlant.EnumPlantType[]{SUNFLOWER, SYRINGA, GRASS, FERN, ROSE, PAEONIA};
|
||||
}
|
||||
|
||||
public static net.minecraft.block.BlockDoublePlant.EnumPlantType byMetadata(int var0) {
|
||||
int var3 = var0;
|
||||
if (var3 < 0 || var3 >= META_LOOKUP.length) {
|
||||
var3 = 0;
|
||||
}
|
||||
|
||||
return META_LOOKUP[var3];
|
||||
}
|
||||
}
|
||||
|
||||
public BlockDoublePlant(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
public class BlockDoubleStoneSlab extends BlockStoneSlab {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isDouble() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public BlockDoubleStoneSlab() {
|
||||
super();
|
||||
}
|
||||
|
||||
public BlockDoubleStoneSlab(int argument0, char argument1, int argument2) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
public class BlockDoubleStoneSlabNew extends BlockStoneSlabNew {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isDouble() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public BlockDoubleStoneSlabNew() {
|
||||
super();
|
||||
}
|
||||
|
||||
public BlockDoubleStoneSlabNew(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
public class BlockDoubleWoodSlab extends BlockWoodSlab {
|
||||
|
||||
|
||||
public BlockDoubleWoodSlab() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDouble() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public BlockDoubleWoodSlab(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityFallingBlock;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockDragonEgg extends Block {
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World var1, BlockPos var4, IBlockState var5, Block var6) {
|
||||
|
||||
var1.scheduleUpdate(var4, this, this.tickRate(var1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World var1, BlockPos var2, IBlockState var5) {
|
||||
|
||||
var1.scheduleUpdate(var2, this, this.tickRate(var1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World var1, BlockPos var2, IBlockState var3, Random var6) {
|
||||
|
||||
this.checkFall(var1, var2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World var1, BlockPos var4, IBlockState var5, EntityPlayer var6, EnumFacing var7, float var8, float var9, float var10
|
||||
) {
|
||||
|
||||
this.teleport(var1, var4);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World var1) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItem(World var1, BlockPos var4) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public BlockDragonEgg() {
|
||||
super(Material.readNumber330, MapColor.blackColor);
|
||||
this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 1.0F, 0.9375F);
|
||||
}
|
||||
|
||||
private void teleport(World var1, BlockPos var4) {
|
||||
|
||||
net.minecraft.block.state.IBlockState var14 = var1.getBlockState(var4);
|
||||
if (var14.getBlock() == this) {
|
||||
for (int var15 = 0; var15 < 1000; var15++) {
|
||||
net.minecraft.util.BlockPos var16 = var4.add(
|
||||
(int) (var1.rand.nextInt(16) - var1.rand.nextInt(16)),
|
||||
(int) (var1.rand.nextInt(8) - var1.rand.nextInt(8)),
|
||||
(int) (var1.rand.nextInt(16) - var1.rand.nextInt(16))
|
||||
);
|
||||
if (var1.getBlockState(var16).getBlock().blockMaterial == net.minecraft.block.material.Material.air) {
|
||||
if (var1.isRemote) {
|
||||
for (int var17 = 0; var17 < 128; var17++) {
|
||||
double var18 = var1.rand.nextDouble();
|
||||
float var20 = (var1.rand.nextFloat() - 0.5F) * 0.2F;
|
||||
float var21 = (var1.rand.nextFloat() - 0.5F) * 0.2F;
|
||||
float var22 = (var1.rand.nextFloat() - 0.5F) * 0.2F;
|
||||
double var23 = var16.getX() + (var4.getX() - var16.getX()) * var18 + (var1.rand.nextDouble() - 0.5) * 1.0 + 0.5;
|
||||
double var25 = var16.getY() + (var4.getY() - var16.getY()) * var18 + var1.rand.nextDouble() * 1.0 - 0.5;
|
||||
double var27 = var16.getZ() + (var4.getZ() - var16.getZ()) * var18 + (var1.rand.nextDouble() - 0.5) * 1.0 + 0.5;
|
||||
var1.spawnParticle(net.minecraft.util.EnumParticleTypes.PORTAL, var23, var25, var27, var20, var21, var22);
|
||||
}
|
||||
} else {
|
||||
var1.setBlockState(var16, var14, 2);
|
||||
var1.setBlockToAir(var4);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockClicked(World var1, BlockPos var4, EntityPlayer var5) {
|
||||
|
||||
this.teleport(var1, var4);
|
||||
}
|
||||
|
||||
private void checkFall(World var2, BlockPos var5) {
|
||||
|
||||
if (BlockFalling.canFallInto(var2, var5.down()) && var5.getY() >= 0) {
|
||||
byte var25 = 32;
|
||||
if (!BlockFalling.fallInstantly
|
||||
&& var2.isAreaLoaded(
|
||||
(net.minecraft.util.BlockPos) (var5.add((int) (-var25), (int) (-var25), (int) (-var25))), (net.minecraft.util.BlockPos) (var5.add((int) (var25), (int) (var25), (int) (var25)))
|
||||
)) {
|
||||
EntityFallingBlock var23 = new EntityFallingBlock(
|
||||
var2,
|
||||
var5.getX() + 0.5F,
|
||||
var5.getY(),
|
||||
var5.getZ() + 0.5F,
|
||||
this.getDefaultState()
|
||||
);
|
||||
var2.spawnEntityInWorld(var23);
|
||||
} else {
|
||||
var2.setBlockToAir(var5);
|
||||
BlockPos var26 = var5;
|
||||
|
||||
while (BlockFalling.canFallInto(var2, var26) && var26.getY() > 0) {
|
||||
var26 = var26.down();
|
||||
}
|
||||
|
||||
if (var26.getY() > 0) {
|
||||
var2.setBlockState(var26, this.getDefaultState(), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess var3, BlockPos var4, EnumFacing var5) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public BlockDragonEgg(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
|
||||
import net.minecraft.dispenser.IBehaviorDispenseItem;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityDispenser;
|
||||
import net.minecraft.tileentity.TileEntityDropper;
|
||||
import net.minecraft.tileentity.TileEntityHopper;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockDropper extends BlockDispenser {
|
||||
|
||||
private final IBehaviorDispenseItem dropBehavior;
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var3, int var4) {
|
||||
return new TileEntityDropper();
|
||||
}
|
||||
|
||||
public BlockDropper() {
|
||||
super();
|
||||
this.dropBehavior = new BehaviorDefaultDispenseItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispense(World var2, BlockPos var4) {
|
||||
|
||||
BlockSourceImpl var36 = new BlockSourceImpl(var2, var4);
|
||||
|
||||
TileEntityDispenser var37 = (TileEntityDispenser)var36.getBlockTileEntity();
|
||||
if (var37 != null) {
|
||||
int var38 = var37.getDispenseSlot();
|
||||
if (var38 < 0) {
|
||||
var2.playAuxSFX(1001, var4, 0);
|
||||
} else {
|
||||
ItemStack var39 = var37.getStackInSlot(var38);
|
||||
if (var39 != null) {
|
||||
EnumFacing var40 = (EnumFacing)var2.getBlockState(var4)
|
||||
.getValue(net.minecraft.block.BlockDispenser.FACING);
|
||||
BlockPos var41 = var4.offset(var40);
|
||||
IInventory var42 = TileEntityHopper.getInventoryAtPosition(
|
||||
var2, var41.getX(), var41.getY(), var41.getZ()
|
||||
);
|
||||
ItemStack var43;
|
||||
if (var42 == null) {
|
||||
var43 = this.dropBehavior.dispense(var36, var39);
|
||||
if (var43 != null && var43.stackSize <= 0) {
|
||||
var43 = null;
|
||||
}
|
||||
} else {
|
||||
var43 = TileEntityHopper.putStackInInventoryAllSlots(
|
||||
var42, var39.copy().splitStack(1), var40.getOpposite()
|
||||
);
|
||||
if (var43 == null) {
|
||||
var43 = var39.copy();
|
||||
if (--var43.stackSize <= 0) {
|
||||
var43 = null;
|
||||
}
|
||||
} else {
|
||||
var43 = var39.copy();
|
||||
}
|
||||
}
|
||||
|
||||
var37.setInventorySlotContents(var38, var43);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IBehaviorDispenseItem getBehavior(ItemStack var2) {
|
||||
return this.dropBehavior;
|
||||
}
|
||||
|
||||
public BlockDropper(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,276 @@
|
||||
package net.minecraft.block;
|
||||
import net.minecraft.block.BlockLiquid;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockDynamicLiquid extends BlockLiquid {
|
||||
int adjacentSourceBlocks;
|
||||
|
||||
private void tryFlowInto(World var3, BlockPos var4, IBlockState var5, int var6) {
|
||||
|
||||
|
||||
if (this.canFlowInto(var3, var4, var5)) {
|
||||
if (var5.getBlock() != Blocks.air) {
|
||||
if (this.blockMaterial == Material.lava) {
|
||||
this.triggerMixEffects(var3, var4);
|
||||
} else {
|
||||
var5.getBlock().dropBlockAsItem(var3, var4, var5, 0);
|
||||
}
|
||||
}
|
||||
|
||||
var3.setBlockState(var4, this.getDefaultState().withProperty(net.minecraft.block.BlockLiquid.LEVEL, var6), 3);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World var1, BlockPos var2, IBlockState var3, Random var6) {
|
||||
|
||||
|
||||
int var45 = (Integer)var3.getValue(net.minecraft.block.BlockLiquid.LEVEL);
|
||||
|
||||
byte var46 = 1;
|
||||
if (this.blockMaterial == Material.lava && !var1.provider.doesWaterVaporize()) {
|
||||
var46 = 2;
|
||||
}
|
||||
|
||||
int var47 = this.tickRate(var1);
|
||||
if (var45 > 0) {
|
||||
int var48 = -100;
|
||||
this.adjacentSourceBlocks = 0;
|
||||
Iterator var49 = EnumFacing.Plane.HORIZONTAL.iterator();
|
||||
|
||||
do {
|
||||
if (!var49.hasNext()) {
|
||||
int var57 = var48 + var46;
|
||||
if (var57 >= 8 || var48 < 0) {
|
||||
var57 = -1;
|
||||
}
|
||||
|
||||
if (this.getLevel(var1, var2.up()) >= 0) {
|
||||
int var59 = this.getLevel(var1, var2.up());
|
||||
if (var59 >= 8) {
|
||||
var57 = var59;
|
||||
} else {
|
||||
var57 = var59 + 8;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.adjacentSourceBlocks >= 2 && this.blockMaterial == Material.water) {
|
||||
IBlockState var60 = var1.getBlockState(var2.down());
|
||||
if (var60.getBlock().getMaterial().isSolid()) {
|
||||
var57 = 0;
|
||||
} else if (var60.getBlock().getMaterial() == this.blockMaterial
|
||||
&& (Integer)var60.getValue(net.minecraft.block.BlockLiquid.LEVEL) == 0) {
|
||||
var57 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.blockMaterial == Material.lava && var45 < 8 && var57 < 8 && var57 > var45 && var6.nextInt(4) != 0) {
|
||||
var47 *= 4;
|
||||
}
|
||||
|
||||
if (var57 == var45) {
|
||||
this.placeStaticBlock(var1, var2, var3);
|
||||
break;
|
||||
}
|
||||
|
||||
var45 = var57;
|
||||
if (var57 < 0) {
|
||||
var1.setBlockToAir(var2);
|
||||
break;
|
||||
}
|
||||
|
||||
var3 = var3.withProperty(net.minecraft.block.BlockLiquid.LEVEL, var57);
|
||||
var1.setBlockState(var2, var3, 2);
|
||||
var1.scheduleUpdate(var2, this, var47);
|
||||
var1.notifyNeighborsOfStateChange(var2, this);
|
||||
break;
|
||||
}
|
||||
|
||||
EnumFacing var50 = (EnumFacing)var49.next();
|
||||
var48 = this.checkAdjacentBlock(var1, var2.offset(var50), var48);
|
||||
} while (true);
|
||||
} else {
|
||||
this.placeStaticBlock(var1, var2, var3);
|
||||
}
|
||||
|
||||
IBlockState var56 = var1.getBlockState(var2.down());
|
||||
if (this.canFlowInto(var1, var2.down(), var56)) {
|
||||
if (this.blockMaterial == Material.lava
|
||||
&& var1.getBlockState(var2.down()).getBlock().getMaterial()
|
||||
== Material.water) {
|
||||
var1.setBlockState(var2.down(), Blocks.stone.getDefaultState());
|
||||
this.triggerMixEffects(var1, var2.down());
|
||||
return;
|
||||
}
|
||||
|
||||
if (var45 >= 8) {
|
||||
this.tryFlowInto(var1, var2.down(), var56, var45);
|
||||
} else {
|
||||
this.tryFlowInto(var1, var2.down(), var56, var45 + 8);
|
||||
}
|
||||
} else if (var45 >= 0) {
|
||||
if (var45 != 0) {
|
||||
BlockPos var10002 = var2.down();
|
||||
|
||||
if (!this.isBlocked(var1, var10002, var56)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Set var58 = this.getPossibleFlowDirections(var1, var2);
|
||||
int var61 = var45 + var46;
|
||||
if (var45 >= 8) {
|
||||
var61 = 1;
|
||||
}
|
||||
|
||||
if (var61 >= 8) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (EnumFacing var52 : (java.lang.Iterable<net.minecraft.util.EnumFacing>) (java.lang.Iterable<?>) (var58)) {
|
||||
this.tryFlowInto(
|
||||
var1, var2.offset(var52), var1.getBlockState(var2.offset(var52)), var61
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int func_176374_a(World var1, BlockPos var2, int var5, EnumFacing var6) {
|
||||
int var18 = 1000;
|
||||
|
||||
|
||||
for (EnumFacing var20 : EnumFacing.Plane.HORIZONTAL) {
|
||||
if (var20 != var6) {
|
||||
BlockPos var21 = var2.offset(var20);
|
||||
IBlockState var22 = var1.getBlockState(var21);
|
||||
|
||||
if (!this.isBlocked(var1, var21, var22)
|
||||
&& (
|
||||
var22.getBlock().getMaterial() != this.blockMaterial
|
||||
|| (Integer)var22.getValue(net.minecraft.block.BlockLiquid.LEVEL) > 0
|
||||
)) {
|
||||
BlockPos var10002 = var21.down();
|
||||
|
||||
if (!this.isBlocked(var1, var10002, var22)) {
|
||||
return var5;
|
||||
}
|
||||
|
||||
if (var5 < 4) {
|
||||
int var23 = this.func_176374_a(var1, var21, var5 + 1, var20.getOpposite());
|
||||
if (var23 < var18) {
|
||||
var18 = var23;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return var18;
|
||||
}
|
||||
|
||||
protected int checkAdjacentBlock(World var1, BlockPos var2, int var5) {
|
||||
int var8 = this.getLevel(var1, var2);
|
||||
if (var8 < 0) {
|
||||
return var5;
|
||||
}
|
||||
|
||||
if (var8 == 0) {
|
||||
this.adjacentSourceBlocks++;
|
||||
}
|
||||
|
||||
if (var8 >= 8) {
|
||||
var8 = 0;
|
||||
}
|
||||
|
||||
return var5 >= 0 && var8 >= var5 ? var5 : var8;
|
||||
}
|
||||
|
||||
private void placeStaticBlock(World world, BlockPos blockPos, IBlockState iBlockState) {
|
||||
|
||||
PropertyInteger propertyInteger = BlockLiquid.LEVEL;
|
||||
Integer n4 = (Integer)iBlockState.getValue(propertyInteger);
|
||||
PropertyInteger propertyInteger2 = BlockLiquid.LEVEL;
|
||||
world.setBlockState(blockPos, BlockDynamicLiquid.AdvancedAntiSkid1liiliII(this.blockMaterial).getDefaultState().withProperty(propertyInteger2, n4), 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World var1, BlockPos var2, IBlockState var5) {
|
||||
|
||||
if (!this.checkForMixing(var1, var2, var5)) {
|
||||
var1.scheduleUpdate(var2, this, this.tickRate(var1));
|
||||
}
|
||||
}
|
||||
|
||||
private java.util.Set<net.minecraft.util.EnumFacing> getPossibleFlowDirections(net.minecraft.world.World var3, net.minecraft.util.BlockPos var4) {
|
||||
int var16 = 1000;
|
||||
|
||||
EnumSet var17 = EnumSet.noneOf(EnumFacing.class);
|
||||
|
||||
for (EnumFacing var19 : EnumFacing.Plane.HORIZONTAL) {
|
||||
BlockPos var20 = var4.offset(var19);
|
||||
IBlockState var21 = var3.getBlockState(var20);
|
||||
|
||||
if (!this.isBlocked(var3, var20, var21)
|
||||
&& (
|
||||
var21.getBlock().getMaterial() != this.blockMaterial
|
||||
|| (Integer)var21.getValue(net.minecraft.block.BlockLiquid.LEVEL) > 0
|
||||
)) {
|
||||
BlockPos var10002 = var20.down();
|
||||
IBlockState var10003 = var3.getBlockState(var20.down());
|
||||
|
||||
int var22;
|
||||
if (this.isBlocked(var3, var10002, var10003)) {
|
||||
var22 = this.func_176374_a(var3, var20, 1, var19.getOpposite());
|
||||
} else {
|
||||
var22 = 0;
|
||||
}
|
||||
|
||||
if (var22 < var16) {
|
||||
var17.clear();
|
||||
}
|
||||
|
||||
if (var22 <= var16) {
|
||||
var17.add(var19);
|
||||
var16 = var22;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return var17;
|
||||
}
|
||||
|
||||
public BlockDynamicLiquid(Material var3) {
|
||||
super(var3);
|
||||
}
|
||||
|
||||
private boolean canFlowInto(World var1, BlockPos var2, IBlockState var3) {
|
||||
net.minecraft.block.material.Material var9 = var3.getBlock().getMaterial();
|
||||
return var9 != this.blockMaterial && var9 != net.minecraft.block.material.Material.lava && !this.isBlocked(var1, var2, var3);
|
||||
}
|
||||
|
||||
private boolean isBlocked(World var1, BlockPos var2, IBlockState var3) {
|
||||
Block var9 = var1.getBlockState(var2).getBlock();
|
||||
return !(var9 instanceof BlockDoor)
|
||||
&& var9 != Blocks.standing_sign
|
||||
&& var9 != Blocks.ladder
|
||||
&& var9 != Blocks.reeds
|
||||
? (var9.blockMaterial == Material.getNumber109 ? true : var9.blockMaterial.blocksMovement())
|
||||
: true;
|
||||
}
|
||||
|
||||
public BlockDynamicLiquid(long argument0, net.minecraft.block.material.Material argument1) {
|
||||
this(argument1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityEnchantmentTable;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockEnchantmentTable extends BlockContainer {
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World var1, BlockPos var4, IBlockState var5, EntityPlayer var6, EnumFacing var7, float var8, float var9, float var10
|
||||
) {
|
||||
|
||||
if (var1.isRemote) {
|
||||
return true;
|
||||
}
|
||||
|
||||
TileEntity var15 = var1.getTileEntity(var4);
|
||||
if (var15 instanceof TileEntityEnchantmentTable) {
|
||||
var6.displayGui((TileEntityEnchantmentTable)var15);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World var1, BlockPos var2, IBlockState var5, Random var6) {
|
||||
|
||||
super.randomDisplayTick(var1, var2, var5, var6);
|
||||
|
||||
for (int var16 = -2; var16 <= 2; var16++) {
|
||||
for (int var17 = -2; var17 <= 2; var17++) {
|
||||
if (var16 > -2 && var16 < 2 && var17 == -1) {
|
||||
var17 = 2;
|
||||
}
|
||||
|
||||
if (var6.nextInt(16) == 0) {
|
||||
for (int var18 = 0; var18 <= 1; var18++) {
|
||||
net.minecraft.util.BlockPos var19 = var2.add((int) (var16), (int) (var18), (int) (var17));
|
||||
if (var1.getBlockState(var19).getBlock() == net.minecraft.init.Blocks.bookshelf) {
|
||||
if (!var1.isAirBlock(var2.add((int) (var16 / 2), (int) (0), (int) (var17 / 2)))) {
|
||||
break;
|
||||
}
|
||||
|
||||
var1.spawnParticle(
|
||||
net.minecraft.util.EnumParticleTypes.ENCHANTMENT_TABLE,
|
||||
var2.getX() + 0.5,
|
||||
var2.getY() + 2.0,
|
||||
var2.getZ() + 0.5,
|
||||
var16 + var6.nextFloat() - 0.5,
|
||||
var18 - var6.nextFloat() - 1.0F,
|
||||
var17 + var6.nextFloat() - 0.5
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
public BlockEnchantmentTable() {
|
||||
super(Material.rock, MapColor.redColor);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F);
|
||||
this.setLightOpacity(0);
|
||||
this.setCreativeTab(CreativeTabs.tabDecorations);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var3, int var4) {
|
||||
return new TileEntityEnchantmentTable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World var3, BlockPos var4, IBlockState var5, EntityLivingBase var6, ItemStack var7) {
|
||||
|
||||
super.onBlockPlacedBy(var3, var4, var5, var6, var7);
|
||||
if (var7.hasDisplayName()) {
|
||||
TileEntity var14 = var3.getTileEntity(var4);
|
||||
if (var14 instanceof TileEntityEnchantmentTable) {
|
||||
((TileEntityEnchantmentTable)var14).setCustomName(var7.getDisplayName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public BlockEnchantmentTable(long argument0) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityEndPortal;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockEndPortal extends BlockContainer {
|
||||
|
||||
@Override
|
||||
public MapColor getMapColor(IBlockState var1) {
|
||||
return MapColor.blackColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public BlockEndPortal(Material var1) {
|
||||
super(var1);
|
||||
this.setLightLevel(1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItem(World var1, BlockPos var4) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var3, int var4) {
|
||||
return new TileEntityEndPortal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World var1, BlockPos var2, IBlockState var3, AxisAlignedBB var4, List var5, Entity var6) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess var3, BlockPos var4) {
|
||||
|
||||
float var5 = 0.0625F;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, var5, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess var3, BlockPos var4, EnumFacing var5) {
|
||||
return var5 == EnumFacing.DOWN ? super.shouldSideBeRendered(var3, var4, var5) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random var1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World var1, BlockPos var2, IBlockState var5, Random var6) {
|
||||
|
||||
double var9 = var2.getX() + var6.nextFloat();
|
||||
double var11 = var2.getY() + 0.8F;
|
||||
double var13 = var2.getZ() + var6.nextFloat();
|
||||
double var15 = 0.0;
|
||||
double var17 = 0.0;
|
||||
double var19 = 0.0;
|
||||
var1.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, var9, var11, var13, var15, var17, var19);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World var1, BlockPos var4, IBlockState var5, Entity var6) {
|
||||
|
||||
if (var6.ridingEntity == null && var6.riddenByEntity == null && !var1.isRemote) {
|
||||
var6.travelToDimension(1);
|
||||
}
|
||||
}
|
||||
|
||||
public BlockEndPortal(net.minecraft.block.material.Material argument0, long argument1) {
|
||||
this(argument0);
|
||||
}
|
||||
}
|
||||
Loaded 100 of 6741 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user