Initial Commit
This commit is contained in:
parent
d15d9ac848
commit
6c22a5b00f
285 changed files with 12708 additions and 0 deletions
674
GNU GENERAL PUBLIC LICENSE.txt
Normal file
674
GNU GENERAL PUBLIC LICENSE.txt
Normal file
|
|
@ -0,0 +1,674 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://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 <http://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
|
||||
<http://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
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
165
GNU LESSER GENERAL PUBLIC LICENSE.txt
Normal file
165
GNU LESSER GENERAL PUBLIC LICENSE.txt
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
16
TO-DO Log.txt
Normal file
16
TO-DO Log.txt
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
--TEXTURES TEXTURES TEXTURES ]
|
||||
--Finish Water Wand ]____
|
||||
--Finish normal wands/wand parts ] |
|
||||
--Finish wand recipes ] |
|
||||
] |
|
||||
--Make world type ] |
|
||||
-Make dungeon gen ] |---- Jose'
|
||||
-Make ore gen ] |
|
||||
-Make Ruin gen ] |
|
||||
-Make stone gen ] |
|
||||
] |
|
||||
--Remove vanilla recipes where needed ] |
|
||||
-Vanilla tools ]____|
|
||||
-Vanilla armor ]
|
||||
]
|
||||
--Add Mod Armors ]
|
||||
45
common/MysticOres/Blocks/BlockHandler.java
Normal file
45
common/MysticOres/Blocks/BlockHandler.java
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
package MysticOres.Blocks;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import MysticOres.Config;
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Items.ItemHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
public class BlockHandler {
|
||||
|
||||
public static Block ReinforcedGlass;
|
||||
public static Block BlockOres;
|
||||
|
||||
public static void init() {
|
||||
ReinforcedGlass = new BlockReinforcedGlass(Config.ReinforcedGlassID, true).setHardness(4.5F).setResistance(2000.0F).setStepSound(Block.soundGlassFootstep).setUnlocalizedName("Reinforced Glass");
|
||||
BlockOres = new BlockOres(Config.BlockOresID).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("MysticOreBlocks");
|
||||
|
||||
registerBlocks();
|
||||
setBlockHarvestLevels();
|
||||
}
|
||||
|
||||
private static void registerBlocks() {
|
||||
GameRegistry.registerBlock(ReinforcedGlass, "ReinforcedGlass");
|
||||
GameRegistry.registerBlock(BlockOres, ItemBlockOres.class, "OreBlocks!");
|
||||
}
|
||||
|
||||
private static void setBlockHarvestLevels() {
|
||||
MinecraftForge.setBlockHarvestLevel(BlockOres, 0, "pickaxe", 3);
|
||||
MinecraftForge.setBlockHarvestLevel(BlockOres, 1, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(BlockOres, 2, "pickaxe", 3);
|
||||
MinecraftForge.setBlockHarvestLevel(BlockOres, 3, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(BlockOres, 4, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(BlockOres, 5, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(BlockOres, 6, "pickaxe", 1);
|
||||
MinecraftForge.setBlockHarvestLevel(BlockOres, 7, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(BlockOres, 8, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(BlockOres, 9, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(BlockOres, 10, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(BlockOres, 11, "pickaxe", 2);
|
||||
}
|
||||
|
||||
}
|
||||
249
common/MysticOres/Blocks/BlockOres.java
Normal file
249
common/MysticOres/Blocks/BlockOres.java
Normal file
|
|
@ -0,0 +1,249 @@
|
|||
package MysticOres.Blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Items.ItemHandler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBreakable;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.ModMetadata;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockOres extends Block {
|
||||
|
||||
Icon[] textures;
|
||||
|
||||
public BlockOres(int ID) {
|
||||
super(ID, Material.rock);
|
||||
setHardness(3F);
|
||||
setResistance(5F);
|
||||
setCreativeTab(MysticOres.MysticOresTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
textures = new Icon[16];
|
||||
|
||||
for (int i = 0; i < 12; i++)
|
||||
{
|
||||
textures[i] = iconRegister.registerIcon("MysticTextures" + ":" + "MysticOre_" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int side, int meta) {
|
||||
return textures[meta];
|
||||
}
|
||||
|
||||
public int idDropped(int par1, Random par2Random, int par3) {
|
||||
switch(par1){
|
||||
case 1:return ItemHandler.AmethystGem.itemID;
|
||||
case 2:return ItemHandler.IridiumNugget.itemID;
|
||||
case 4:return ItemHandler.TourmalineGem.itemID;
|
||||
case 5:return ItemHandler.TopazGem.itemID;
|
||||
case 7:return ItemHandler.BloodstoneShard.itemID;
|
||||
case 8:return this.BlackSoulstoneDrops(par1, par2Random, par3);
|
||||
case 9:return this.BlueSoulstoneDrops(par1, par2Random, par3);
|
||||
case 10:return this.RedSoulstoneDrops(par1, par2Random, par3);
|
||||
case 11:return ItemHandler.AgateGem.itemID;
|
||||
default:return blockID;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int j) {
|
||||
switch(j){
|
||||
case 1:return 0;
|
||||
case 2:return 0;
|
||||
case 4:return 0;
|
||||
case 5:return 0;
|
||||
case 7:return 0;
|
||||
case 8:return 0;
|
||||
case 9:return 0;
|
||||
case 10:return 0;
|
||||
case 11:return 0;
|
||||
default: return j;
|
||||
}
|
||||
}
|
||||
|
||||
public int xpDropAmount(int j) {
|
||||
switch(j){
|
||||
case 1:return 6;
|
||||
case 2:return 6;
|
||||
case 4:return 6;
|
||||
case 5:return 6;
|
||||
case 7:return 6;
|
||||
case 8:return 6;
|
||||
case 9:return 6;
|
||||
case 10:return 6;
|
||||
case 11:return 6;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected boolean canSilkHarvest()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta)
|
||||
{
|
||||
this.dropXpOnBlockBreak(world, x, y, z, xpDropAmount(meta));
|
||||
}
|
||||
|
||||
public int BlackSoulstoneDrops(int par1, Random par2Random, int par3)
|
||||
{
|
||||
int w = par2Random.nextInt(6);
|
||||
if (w == 0)
|
||||
{
|
||||
return Item.coal.itemID;
|
||||
}
|
||||
if (w == 1)
|
||||
{
|
||||
return Item.gunpowder.itemID;
|
||||
}
|
||||
if (w == 2)
|
||||
{
|
||||
return ItemHandler.ObsidianShard.itemID;
|
||||
}
|
||||
if (w == 3)
|
||||
{
|
||||
return ItemHandler.GlassShard.itemID;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ItemHandler.ObsidianShard.itemID;
|
||||
}
|
||||
}
|
||||
|
||||
public int RedSoulstoneDrops(int par1, Random par2Random, int par3)
|
||||
{
|
||||
int w = par2Random.nextInt(6);
|
||||
if (w == 0)
|
||||
{
|
||||
return Item.lightStoneDust.itemID;
|
||||
}
|
||||
if (w == 1)
|
||||
{
|
||||
return Item.gunpowder.itemID;
|
||||
}
|
||||
if (w == 2)
|
||||
{
|
||||
return ItemHandler.ObsidianShard.itemID;
|
||||
}
|
||||
if (w == 3)
|
||||
{
|
||||
return ItemHandler.GlassShard.itemID;
|
||||
}
|
||||
if (w == 4)
|
||||
{
|
||||
return Item.redstone.itemID;
|
||||
}
|
||||
if (w == 5)
|
||||
{
|
||||
return ItemHandler.MysticPowder.itemID;
|
||||
}
|
||||
if (w==6)
|
||||
{
|
||||
return Block.obsidian.blockID;
|
||||
}
|
||||
if (w==7)
|
||||
{
|
||||
return ItemHandler.ObsidianShard.itemID;
|
||||
}
|
||||
else
|
||||
{
|
||||
return blockID;
|
||||
}
|
||||
}
|
||||
|
||||
public int BlueSoulstoneDrops(int par1, Random par2Random, int par3)
|
||||
{
|
||||
int w = par2Random.nextInt(6);
|
||||
if (w == 0)
|
||||
{
|
||||
return ItemHandler.AgateGem.itemID;
|
||||
}
|
||||
if (w == 1)
|
||||
{
|
||||
return ItemHandler.TourmalineGem.itemID;
|
||||
}
|
||||
if (w == 2)
|
||||
{
|
||||
return ItemHandler.TopazGem.itemID;
|
||||
}
|
||||
if (w == 3)
|
||||
{
|
||||
return ItemHandler.AmethystGem.itemID;
|
||||
}
|
||||
if (w == 4)
|
||||
{
|
||||
return ItemHandler.IridiumNugget.itemID;
|
||||
}
|
||||
if (w == 5)
|
||||
{
|
||||
return Item.diamond.itemID;
|
||||
}
|
||||
if (w == 6)
|
||||
{
|
||||
return Block.obsidian.blockID;
|
||||
}
|
||||
if (w == 7)
|
||||
{
|
||||
return Item.gunpowder.itemID;
|
||||
}
|
||||
if (w==8)
|
||||
{
|
||||
return Item.lightStoneDust.itemID;
|
||||
}
|
||||
else
|
||||
{
|
||||
return blockID;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//meta specific stuff
|
||||
public int idPicked(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
return this.blockID;
|
||||
}
|
||||
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||
{
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
return new ItemStack(this, 1, meta);
|
||||
}
|
||||
|
||||
public void getSubBlocks(int i,CreativeTabs tab, List list)
|
||||
{
|
||||
list.add(new ItemStack(i,1,0));
|
||||
list.add(new ItemStack(i,1,1));
|
||||
list.add(new ItemStack(i,1,2));
|
||||
list.add(new ItemStack(i,1,3));
|
||||
list.add(new ItemStack(i,1,4));
|
||||
list.add(new ItemStack(i,1,5));
|
||||
list.add(new ItemStack(i,1,6));
|
||||
list.add(new ItemStack(i,1,7));
|
||||
list.add(new ItemStack(i,1,8));
|
||||
list.add(new ItemStack(i,1,9));
|
||||
list.add(new ItemStack(i,1,10));
|
||||
list.add(new ItemStack(i,1,11));
|
||||
}
|
||||
}
|
||||
85
common/MysticOres/Blocks/BlockReinforcedGlass.java
Normal file
85
common/MysticOres/Blocks/BlockReinforcedGlass.java
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
package MysticOres.Blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Items.ItemHandler;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraft.block.BlockBreakable;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
|
||||
public class BlockReinforcedGlass extends BlockBreakable
|
||||
{
|
||||
Icon[] textures;
|
||||
|
||||
private boolean RenderSide = false;
|
||||
|
||||
public BlockReinforcedGlass(int par1, boolean par4) {
|
||||
super(par1, "ReinforcedGlass", Material.glass, par4);
|
||||
this.setCreativeTab(MysticOres.MysticOresTab);
|
||||
this.RenderSide = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
textures = new Icon[16];
|
||||
for(int i=0;i<8;i++)
|
||||
{
|
||||
textures[i] = iconRegister.registerIcon("MysticTextures" + ":" + "ReinforcedGlass");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int side, int meta)
|
||||
{
|
||||
return textures[meta];
|
||||
}
|
||||
|
||||
public int idDropped(int par1, Random par2Random, int par3)
|
||||
{
|
||||
return ItemHandler.GlassShard.itemID;
|
||||
}
|
||||
|
||||
public int quantityDropped(Random par1Random)
|
||||
{
|
||||
return 1 + par1Random.nextInt(2);
|
||||
}
|
||||
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean canSilkHarvest()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
int var6 = par1IBlockAccess.getBlockId(par2, par3, par4);
|
||||
return !this.RenderSide && var6 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
51
common/MysticOres/Blocks/ItemBlockOres.java
Normal file
51
common/MysticOres/Blocks/ItemBlockOres.java
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
package MysticOres.Blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import MysticOres.MysticOres;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
|
||||
public class ItemBlockOres extends ItemBlock {
|
||||
|
||||
public ItemBlockOres(int par1) {
|
||||
super(par1);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack i){
|
||||
switch(i.getItemDamage()){
|
||||
case 0:return "Adamantine";
|
||||
case 1:return "Amethyst";
|
||||
case 2:return "Iridium";
|
||||
case 3:return "Mithril";
|
||||
case 4:return "Sapphire";
|
||||
case 5:return "Topaz";
|
||||
case 6:return "Verdite";
|
||||
case 7:return "Bloodstone";
|
||||
case 8:return "BlackSoulstone";
|
||||
case 9:return "BlueSoulstone";
|
||||
case 10:return "RedSoulstone";
|
||||
case 11:return "Agate";
|
||||
default:return "";
|
||||
}
|
||||
}
|
||||
|
||||
public int getMetadata(int par1)
|
||||
{
|
||||
return par1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int par1)
|
||||
{
|
||||
return BlockHandler.BlockOres.getIcon(2, par1);
|
||||
}
|
||||
|
||||
}
|
||||
151
common/MysticOres/Config.java
Normal file
151
common/MysticOres/Config.java
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
package MysticOres;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import net.minecraftforge.common.Configuration;
|
||||
|
||||
public class Config
|
||||
{
|
||||
public static Configuration config;
|
||||
|
||||
public static int AdamantineSwordID;
|
||||
public static int AdamantinePickaxeID;
|
||||
public static int AdamantineShovelID;
|
||||
public static int AdamantineAxeID;
|
||||
public static int AdamantineHoeID;
|
||||
public static int AdamantineIngotID;
|
||||
public static int BloodstoneSwordID;
|
||||
public static int BloodstonePickaxeID;
|
||||
public static int BloodstoneShovelID;
|
||||
public static int BloodstoneAxeID;
|
||||
public static int BloodstoneHoeID;
|
||||
public static int BloodstoneShardID;
|
||||
public static int TopazGemID;
|
||||
public static int TourmalineGemID;
|
||||
public static int AmethystGemID;
|
||||
public static int AgateGemID;
|
||||
public static int MysticPowderID;
|
||||
public static int IridiumSwordID;
|
||||
public static int IridiumPickaxeID;
|
||||
public static int IridiumShovelID;
|
||||
public static int IridiumAxeID;
|
||||
public static int IridiumHoeID;
|
||||
public static int IridiumIngotID;
|
||||
public static int IridiumNuggetID;
|
||||
public static int MithrilSwordID;
|
||||
public static int MithrilPickaxeID;
|
||||
public static int MithrilShovelID;
|
||||
public static int MithrilAxeID;
|
||||
public static int MithrilHoeID;
|
||||
public static int MithrilIngotID;
|
||||
public static int ObsidianSwordID;
|
||||
public static int ObsidianPickaxeID;
|
||||
public static int ObsidianShovelID;
|
||||
public static int ObsidianAxeID;
|
||||
public static int ObsidianHoeID;
|
||||
public static int ObsidianShardID;
|
||||
public static int ObsidianRodID;
|
||||
public static int VerditeSwordID;
|
||||
public static int VerditePickaxeID;
|
||||
public static int VerditeShovelID;
|
||||
public static int VerditeAxeID;
|
||||
public static int VerditeHoeID;
|
||||
public static int VerditeIngotID;
|
||||
public static int GlassShardID;
|
||||
public static int SatchelID;
|
||||
|
||||
public static int AdamantineDustID;
|
||||
public static int MithrilDustID;
|
||||
public static int VerditeDustID;
|
||||
|
||||
public static int ReinforcedGlassID;
|
||||
public static int BlockOresID;
|
||||
|
||||
public static int AgateRarity;
|
||||
public static int AmethystRarity;
|
||||
public static int TopazRarity;
|
||||
public static int TourmalineRarity;
|
||||
|
||||
|
||||
public static int VerditeRarity;
|
||||
public static int MithrilRarity;
|
||||
public static int IridiumRarity;
|
||||
public static int AdamantineRarity;
|
||||
|
||||
public static boolean DustsEnabled;
|
||||
|
||||
public static void initialize(File file)
|
||||
{
|
||||
config = new Configuration(file);
|
||||
|
||||
AdamantineSwordID = config.getItem("Adamantine Sword ID", 15000).getInt();
|
||||
AdamantinePickaxeID = config.getItem("Adamantine Pickaxe ID", 15001).getInt();
|
||||
AdamantineShovelID = config.getItem("Adamantine Shovel ID", 15002).getInt();
|
||||
AdamantineAxeID = config.getItem("Adamantine Axe ID", 15003).getInt();
|
||||
AdamantineHoeID = config.getItem("Adamantine Hoe ID", 15004).getInt();
|
||||
AdamantineIngotID = config.getItem("Adamantine Ingot ID", 15005).getInt();
|
||||
BloodstoneSwordID = config.getItem("Bloodstone Sword ID", 15006).getInt();
|
||||
BloodstonePickaxeID = config.getItem("Bloodstone Pickaxe ID", 15007).getInt();
|
||||
BloodstoneShovelID = config.getItem("Bloodstone Shovel ID", 15008).getInt();
|
||||
BloodstoneAxeID = config.getItem("Bloodstone Axe ID", 15009).getInt();
|
||||
BloodstoneHoeID = config.getItem("Bloodstone Hoe ID", 15010).getInt();
|
||||
BloodstoneShardID = config.getItem("Bloodstone Shard ID", 15011).getInt();
|
||||
TopazGemID = config.getItem("Topaz ID", 15012).getInt();
|
||||
TourmalineGemID = config.getItem("Tourmaline ID", 15013).getInt();
|
||||
AmethystGemID = config.getItem("Amethyst ID", 15014).getInt();
|
||||
MysticPowderID = config.getItem("Mystic Powder ID", 15015).getInt();
|
||||
IridiumSwordID = config.getItem("Iridium Sword ID", 15016).getInt();
|
||||
IridiumPickaxeID = config.getItem("Iridium Pickaxe ID", 15017).getInt();
|
||||
IridiumShovelID = config.getItem("Iridium Shovel ID", 15018).getInt();
|
||||
IridiumAxeID = config.getItem("Iridium Axe ID", 15019).getInt();
|
||||
IridiumHoeID = config.getItem("Iridium Hoe ID", 15020).getInt();
|
||||
IridiumIngotID = config.getItem("Iridium Ingot ID", 15021).getInt();
|
||||
IridiumNuggetID = config.getItem("Iridium Nugget ID", 15022).getInt();
|
||||
MithrilSwordID = config.getItem("Mithril Sword ID", 15023).getInt();
|
||||
MithrilPickaxeID = config.getItem("Mithril Pickaxe ID", 15024).getInt();
|
||||
MithrilShovelID = config.getItem("Mithril Shovel ID", 15025).getInt();
|
||||
MithrilAxeID = config.getItem("Mithril Axe ID", 15026).getInt();
|
||||
MithrilHoeID = config.getItem("Mithril Hoe ID", 15027).getInt();
|
||||
MithrilIngotID = config.getItem("Mithril Ingot ID", 15028).getInt();
|
||||
ObsidianSwordID = config.getItem("Obsidian Sword ID", 15029).getInt();
|
||||
ObsidianPickaxeID = config.getItem("Obsidian Pickaxe ID", 15030).getInt();
|
||||
ObsidianShovelID = config.getItem("Obsidian Shovel ID", 15031).getInt();
|
||||
ObsidianAxeID = config.getItem("Obsidian Axe ID", 15032).getInt();
|
||||
ObsidianHoeID = config.getItem("Obsidian Hoe ID", 15033).getInt();
|
||||
ObsidianShardID = config.getItem("Obsidian Shard ID", 15034).getInt();
|
||||
ObsidianRodID = config.getItem("Obsidian Rod ID", 15035).getInt();
|
||||
VerditeSwordID = config.getItem("Verdite Sword ID", 15036).getInt();
|
||||
VerditePickaxeID = config.getItem("Verdite Pickaxe ID", 15037).getInt();
|
||||
VerditeShovelID = config.getItem("Verdite Shovel ID", 15038).getInt();
|
||||
VerditeAxeID = config.getItem("Verdite Axe ID", 15039).getInt();
|
||||
VerditeHoeID = config.getItem("Verdite Hoe ID", 15040).getInt();
|
||||
VerditeIngotID = config.getItem("Verdite Ingot ID", 15041).getInt();
|
||||
GlassShardID = config.getItem("Glass Shard ID", 15042).getInt();
|
||||
AdamantineDustID = config.getItem("Adamantine Dust ID", 15043).getInt();
|
||||
MithrilDustID = config.getItem("Mithril Dust ID", 15044).getInt();
|
||||
VerditeDustID = config.getItem("Verdite Dust ID", 15045).getInt();
|
||||
AgateGemID = config.getItem("Agate ID", 15046).getInt();
|
||||
SatchelID = config.getItem("Satchel ID", 15047).getInt();
|
||||
|
||||
DustsEnabled = config.get("General", "Enable Recipes for IC2/Thermal Expansion?", true).getBoolean(DustsEnabled);
|
||||
|
||||
BlockOresID = config.getBlock("Ore IDs", 500).getInt();
|
||||
ReinforcedGlassID = config.getBlock("Reinforced Glass ID", 501).getInt();
|
||||
|
||||
AgateRarity = config.get("Ore Rarity", "Rarity of Agate", 3).getInt();
|
||||
AmethystRarity = config.get("Ore Rarity", "Rarity of Amethyst", 3).getInt();
|
||||
TopazRarity = config.get("Ore Rarity", "Rarity of Topaz", 3).getInt();
|
||||
TourmalineRarity = config.get("Ore Rarity", "Rarity of Tourmaline", 3).getInt();
|
||||
VerditeRarity = config.get("Ore Rarity", "Rarity of Verdite Ore", 10).getInt();
|
||||
MithrilRarity = config.get("Ore Rarity", "Rarity of Mithril Ore", 3).getInt();
|
||||
IridiumRarity = config.get("Ore Rarity", "Rarity of Iridium Ore", 2).getInt();
|
||||
AdamantineRarity = config.get("Ore Rarity", "Rarity of Adamantine Ore", 2).getInt();
|
||||
|
||||
config.save();
|
||||
}
|
||||
|
||||
public static void save()
|
||||
{
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
54
common/MysticOres/IC2Handler.java
Normal file
54
common/MysticOres/IC2Handler.java
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
package MysticOres;
|
||||
|
||||
/*
|
||||
import ic2.api.Ic2Recipes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class IC2Handler
|
||||
{
|
||||
|
||||
public static void adamantineRecipe()
|
||||
{
|
||||
ItemStack tOutput = new ItemStack(MysticOres.AdamantineDust, 2, 0);
|
||||
ArrayList<ItemStack> tList = OreDictionary.getOres("oreAdamantine");
|
||||
for (int i = 0; i < tList.size(); i++) {
|
||||
ItemStack tStack = tList.get(i);
|
||||
tStack = tStack.copy();
|
||||
tStack.stackSize = 1;
|
||||
Ic2Recipes.addMaceratorRecipe(tStack, tOutput);
|
||||
}
|
||||
}
|
||||
|
||||
public static void mithrilRecipe()
|
||||
{
|
||||
ItemStack tOutput = new ItemStack(MysticOres.MithrilDust, 2, 0);
|
||||
ArrayList<ItemStack> tList = OreDictionary.getOres("oreMithril");
|
||||
for (int i = 0; i < tList.size(); i++) {
|
||||
ItemStack tStack = tList.get(i);
|
||||
tStack = tStack.copy();
|
||||
tStack.stackSize = 1;
|
||||
Ic2Recipes.addMaceratorRecipe(tStack, tOutput);
|
||||
}
|
||||
}
|
||||
|
||||
public static void verditeRecipe()
|
||||
{
|
||||
ItemStack tOutput = new ItemStack(MysticOres.VerditeDust, 2, 0);
|
||||
ArrayList<ItemStack> tList = OreDictionary.getOres("oreVerdite");
|
||||
for (int i = 0; i < tList.size(); i++) {
|
||||
ItemStack tStack = tList.get(i);
|
||||
tStack = tStack.copy();
|
||||
tStack.stackSize = 1;
|
||||
Ic2Recipes.addMaceratorRecipe(tStack, tOutput);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
15
common/MysticOres/IridiumFuel.java
Normal file
15
common/MysticOres/IridiumFuel.java
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
package MysticOres;
|
||||
|
||||
import MysticOres.Items.ItemHandler;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.common.IFuelHandler;
|
||||
|
||||
public class IridiumFuel implements IFuelHandler {
|
||||
public int getBurnTime(ItemStack fuel)
|
||||
{
|
||||
if(fuel.itemID == ItemHandler.IridiumNugget.itemID)
|
||||
return 12800;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
13
common/MysticOres/Items/EnumTools.java
Normal file
13
common/MysticOres/Items/EnumTools.java
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package MysticOres.Items;
|
||||
|
||||
import net.minecraft.item.EnumToolMaterial;
|
||||
import net.minecraftforge.common.EnumHelper;
|
||||
|
||||
public class EnumTools {
|
||||
static EnumToolMaterial verditeToolMaterial = EnumHelper.addToolMaterial("Verdite", 1, 262, 5.0F, 1, 5);
|
||||
static EnumToolMaterial mithrilToolMaterial = EnumHelper.addToolMaterial("Mithril", 2, 500, 7.0F, 2, 9);
|
||||
static EnumToolMaterial adamantineToolMaterial = EnumHelper.addToolMaterial("Adamantine", 3, 3000, 10.0F, 4, 13);
|
||||
static EnumToolMaterial iridiumToolMaterial = EnumHelper.addToolMaterial("Iridium", 3, 4000, 12.0F, 5, 15);
|
||||
static EnumToolMaterial obsidianToolMaterial = EnumHelper.addToolMaterial("Obsidian", 3, 100, 4.0F, 5, 11);
|
||||
static EnumToolMaterial bloodstoneToolMaterial = EnumHelper.addToolMaterial("Bloodstone", 3, 200, 16.0F, 8, 12);
|
||||
}
|
||||
30
common/MysticOres/Items/ItemAxes.java
Normal file
30
common/MysticOres/Items/ItemAxes.java
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package MysticOres.Items;
|
||||
|
||||
import MysticOres.MysticOres;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.EnumToolMaterial;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.*;
|
||||
|
||||
public class ItemAxes extends ItemAxe
|
||||
{
|
||||
|
||||
public ItemAxes(int par1, EnumToolMaterial par2EnumToolMaterial)
|
||||
{
|
||||
super(par1, par2EnumToolMaterial);
|
||||
|
||||
this.setCreativeTab(MysticOres.MysticOresTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures" + ":" + this.getUnlocalizedName());
|
||||
}
|
||||
}
|
||||
27
common/MysticOres/Items/ItemBase.java
Normal file
27
common/MysticOres/Items/ItemBase.java
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package MysticOres.Items;
|
||||
|
||||
import MysticOres.MysticOres;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
||||
public class ItemBase extends Item
|
||||
{
|
||||
public ItemBase(int i)
|
||||
{
|
||||
super(i);
|
||||
maxStackSize = 64;
|
||||
this.setCreativeTab(MysticOres.MysticOresTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures" + ":" + this.getUnlocalizedName());
|
||||
}
|
||||
}
|
||||
133
common/MysticOres/Items/ItemHandler.java
Normal file
133
common/MysticOres/Items/ItemHandler.java
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
package MysticOres.Items;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import MysticOres.Config;
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class ItemHandler {
|
||||
public static Item AdamantineSword;
|
||||
public static Item AdamantinePickaxe;
|
||||
public static Item AdamantineShovel;
|
||||
public static Item AdamantineAxe;
|
||||
public static Item AdamantineHoe;
|
||||
public static Item AdamantineIngot;
|
||||
|
||||
public static Item BloodstoneSword;
|
||||
public static Item BloodstonePickaxe;
|
||||
public static Item BloodstoneShovel;
|
||||
public static Item BloodstoneAxe;
|
||||
public static Item BloodstoneHoe;
|
||||
public static Item BloodstoneShard;
|
||||
|
||||
public static Item TopazGem;
|
||||
public static Item TourmalineGem;
|
||||
public static Item AmethystGem;
|
||||
public static Item AgateGem;
|
||||
|
||||
public static Item MysticPowder;
|
||||
|
||||
public static Item IridiumSword;
|
||||
public static Item IridiumPickaxe;
|
||||
public static Item IridiumShovel;
|
||||
public static Item IridiumAxe;
|
||||
public static Item IridiumHoe;
|
||||
public static Item IridiumIngot;
|
||||
public static Item IridiumNugget;
|
||||
|
||||
public static Item MithrilSword;
|
||||
public static Item MithrilPickaxe;
|
||||
public static Item MithrilShovel;
|
||||
public static Item MithrilAxe;
|
||||
public static Item MithrilHoe;
|
||||
public static Item MithrilIngot;
|
||||
|
||||
public static Item ObsidianSword;
|
||||
public static Item ObsidianPickaxe;
|
||||
public static Item ObsidianShovel;
|
||||
public static Item ObsidianAxe;
|
||||
public static Item ObsidianHoe;
|
||||
public static Item ObsidianShard;
|
||||
public static Item ObsidianRod;
|
||||
|
||||
public static Item VerditeSword;
|
||||
public static Item VerditePickaxe;
|
||||
public static Item VerditeShovel;
|
||||
public static Item VerditeAxe;
|
||||
public static Item VerditeHoe;
|
||||
public static Item VerditeIngot;
|
||||
|
||||
public static Item GlassShard;
|
||||
|
||||
public static Item Satchel;
|
||||
|
||||
public static Item AdamantineDust;
|
||||
public static Item MithrilDust;
|
||||
public static Item VerditeDust;
|
||||
|
||||
public static void init(){
|
||||
AdamantineIngot = new ItemBase(Config.AdamantineIngotID).setUnlocalizedName("AdamantineIngot");
|
||||
MithrilIngot = new ItemBase(Config.MithrilIngotID).setUnlocalizedName("MithrilIngot");
|
||||
IridiumIngot = new ItemBase(Config.IridiumIngotID).setUnlocalizedName("IridiumIngot");
|
||||
|
||||
ObsidianShard = new ItemBase(Config.ObsidianShardID).setUnlocalizedName("ObsidianShard");
|
||||
BloodstoneShard = new ItemBase(Config.BloodstoneShardID).setUnlocalizedName("BloodstoneShard");
|
||||
|
||||
TopazGem = new ItemBase(Config.TopazGemID).setUnlocalizedName("TopazGem");
|
||||
TourmalineGem = new ItemBase(Config.TourmalineGemID).setUnlocalizedName("TourmalineGem");
|
||||
AmethystGem = new ItemBase(Config.AmethystGemID).setUnlocalizedName("AmethystGem");
|
||||
|
||||
IridiumNugget = new ItemBase(Config.IridiumNuggetID).setUnlocalizedName("IridiumNugget");
|
||||
GlassShard = new ItemBase(Config.GlassShardID).setUnlocalizedName("GlassShard");
|
||||
VerditeIngot = new ItemBase(Config.VerditeIngotID).setUnlocalizedName("VerditeIngot");
|
||||
|
||||
AdamantineSword = new ItemSwords(Config.AdamantineSwordID, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineSword");
|
||||
VerditeSword = new ItemSwords(Config.VerditeSwordID, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeSword");
|
||||
MithrilSword = new ItemSwords(Config.MithrilSwordID, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilSword");
|
||||
IridiumSword = new ItemSwords(Config.IridiumSwordID, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumSword");
|
||||
ObsidianSword = new ItemSwords(Config.ObsidianSwordID, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianSword");
|
||||
BloodstoneSword = new ItemSwords(Config.BloodstoneSwordID, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneSword");
|
||||
|
||||
AdamantinePickaxe = new ItemPickaxes(Config.AdamantinePickaxeID, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantinePickaxe");
|
||||
VerditePickaxe = new ItemPickaxes(Config.VerditePickaxeID, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditePickaxe");
|
||||
MithrilPickaxe = new ItemPickaxes(Config.MithrilPickaxeID, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilPickaxe");
|
||||
IridiumPickaxe = new ItemPickaxes(Config.IridiumPickaxeID, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumPickaxe");
|
||||
ObsidianPickaxe = new ItemPickaxes(Config.ObsidianPickaxeID, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianPickaxe");
|
||||
BloodstonePickaxe = new ItemPickaxes(Config.BloodstonePickaxeID, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstonePickaxe");
|
||||
|
||||
AdamantineShovel = new ItemShovels(Config.AdamantineShovelID, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineShovel");
|
||||
VerditeShovel = new ItemShovels(Config.VerditeShovelID, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeShovel");
|
||||
MithrilShovel = new ItemShovels(Config.MithrilShovelID, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilShovel");
|
||||
IridiumShovel = new ItemShovels(Config.IridiumShovelID, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumShovel");
|
||||
ObsidianShovel = new ItemShovels(Config.ObsidianShovelID, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianShovel");
|
||||
BloodstoneShovel = new ItemShovels(Config.BloodstoneShovelID, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneShovel");
|
||||
|
||||
AdamantineAxe = new ItemAxes(Config.AdamantineAxeID, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineAxe");
|
||||
VerditeAxe = new ItemAxes(Config.VerditeAxeID, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeAxe");
|
||||
MithrilAxe = new ItemAxes(Config.MithrilAxeID, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilAxe");
|
||||
IridiumAxe = new ItemAxes(Config.IridiumAxeID, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumAxe");
|
||||
ObsidianAxe = new ItemAxes(Config.ObsidianAxeID, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianAxe");
|
||||
BloodstoneAxe = new ItemAxes(Config.BloodstoneAxeID, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneAxe");
|
||||
|
||||
AdamantineHoe = new ItemHoes(Config.AdamantineHoeID, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineHoe");
|
||||
VerditeHoe = new ItemHoes(Config.VerditeHoeID, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeHoe");
|
||||
MithrilHoe = new ItemHoes(Config.MithrilHoeID, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilHoe");
|
||||
IridiumHoe = new ItemHoes(Config.IridiumHoeID, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumHoe");
|
||||
ObsidianHoe = new ItemHoes(Config.ObsidianHoeID, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianHoe");
|
||||
BloodstoneHoe = new ItemHoes(Config.BloodstoneHoeID, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneHoe");
|
||||
|
||||
AdamantineDust = new ItemBase(Config.AdamantineDustID).setUnlocalizedName("AdamantineDust");
|
||||
MithrilDust = new ItemBase(Config.MithrilDustID).setUnlocalizedName("MithrilDust");
|
||||
VerditeDust = new ItemBase(Config.VerditeDustID).setUnlocalizedName("VerditeDust");
|
||||
AgateGem = new ItemBase(Config.AgateGemID).setUnlocalizedName("AgateGem");
|
||||
|
||||
ObsidianRod = new ItemBase(Config.ObsidianRodID).setUnlocalizedName("ObsidianRod");
|
||||
|
||||
MysticPowder = new ItemBase(Config.MysticPowderID).setUnlocalizedName("MysticPowder");
|
||||
|
||||
Satchel = new ItemSatchel(Config.SatchelID).setUnlocalizedName("Satchel");
|
||||
}
|
||||
}
|
||||
30
common/MysticOres/Items/ItemHoes.java
Normal file
30
common/MysticOres/Items/ItemHoes.java
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package MysticOres.Items;
|
||||
|
||||
import MysticOres.MysticOres;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.EnumToolMaterial;
|
||||
import net.minecraft.item.ItemHoe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.Event.Result;
|
||||
import net.minecraftforge.event.entity.player.UseHoeEvent;
|
||||
|
||||
public class ItemHoes extends ItemHoe
|
||||
{
|
||||
|
||||
public ItemHoes(int par1, EnumToolMaterial par2EnumToolMaterial)
|
||||
{
|
||||
super(par1, par2EnumToolMaterial);
|
||||
this.setCreativeTab(MysticOres.MysticOresTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures" + ":" + this.getUnlocalizedName());
|
||||
}
|
||||
}
|
||||
5
common/MysticOres/Items/ItemIridiumNugget.java
Normal file
5
common/MysticOres/Items/ItemIridiumNugget.java
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
package MysticOres.Items;
|
||||
|
||||
public class ItemIridiumNugget {
|
||||
|
||||
}
|
||||
28
common/MysticOres/Items/ItemPickaxes.java
Normal file
28
common/MysticOres/Items/ItemPickaxes.java
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
package MysticOres.Items;
|
||||
|
||||
import MysticOres.MysticOres;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.EnumToolMaterial;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemPickaxes extends ItemPickaxe
|
||||
{
|
||||
|
||||
public ItemPickaxes(int par1, EnumToolMaterial par2EnumToolMaterial)
|
||||
{
|
||||
super(par1, par2EnumToolMaterial);
|
||||
|
||||
this.setCreativeTab(MysticOres.MysticOresTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures" + ":" + this.getUnlocalizedName());
|
||||
}
|
||||
}
|
||||
48
common/MysticOres/Items/ItemSatchel.java
Normal file
48
common/MysticOres/Items/ItemSatchel.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
package MysticOres.Items;
|
||||
|
||||
import MysticOres.MysticOres;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.src.*;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemSatchel extends Item
|
||||
{
|
||||
|
||||
public ItemSatchel(int par1)
|
||||
{
|
||||
super(par1);
|
||||
setCreativeTab(MysticOres.MysticOresTab);
|
||||
maxStackSize = 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack is, World world, EntityPlayer player)
|
||||
{
|
||||
if(!player.isSneaking())
|
||||
{
|
||||
IInventory inv;
|
||||
inv = player.getInventoryEnderChest();
|
||||
player.displayGUIChest(inv);
|
||||
}
|
||||
return is;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean hasEffect(ItemStack par1ItemStack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures" + ":" + this.getUnlocalizedName());
|
||||
}
|
||||
}
|
||||
28
common/MysticOres/Items/ItemShovels.java
Normal file
28
common/MysticOres/Items/ItemShovels.java
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
package MysticOres.Items;
|
||||
|
||||
import MysticOres.MysticOres;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.EnumToolMaterial;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemShovels extends ItemSpade
|
||||
{
|
||||
|
||||
public ItemShovels(int par1, EnumToolMaterial par2EnumToolMaterial)
|
||||
{
|
||||
super(par1, par2EnumToolMaterial);
|
||||
|
||||
this.setCreativeTab(MysticOres.MysticOresTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures" + ":" + this.getUnlocalizedName());
|
||||
}
|
||||
}
|
||||
28
common/MysticOres/Items/ItemSwords.java
Normal file
28
common/MysticOres/Items/ItemSwords.java
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
package MysticOres.Items;
|
||||
|
||||
import MysticOres.MysticOres;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.EnumToolMaterial;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
|
||||
public class ItemSwords extends ItemSword
|
||||
{
|
||||
|
||||
public ItemSwords(int par1, EnumToolMaterial par2EnumToolMaterial)
|
||||
{
|
||||
super(par1, par2EnumToolMaterial);
|
||||
|
||||
this.setCreativeTab(MysticOres.MysticOresTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("MysticTextures" + ":" + this.getUnlocalizedName());
|
||||
}
|
||||
}
|
||||
78
common/MysticOres/Lang.java
Normal file
78
common/MysticOres/Lang.java
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
package MysticOres;
|
||||
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
import MysticOres.Items.ItemHandler;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
|
||||
public class Lang
|
||||
{
|
||||
public static void init()
|
||||
{
|
||||
LanguageRegistry.instance().addName(BlockHandler.ReinforcedGlass, "Reinforced Glass");
|
||||
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.BlockOres, 1, 0), "Adamantine");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.BlockOres, 1, 1), "Amethyst Ore");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.BlockOres, 1, 2), "Iridium Ore");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.BlockOres, 1, 3), "Mithril Ore");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.BlockOres, 1, 4), "Tourmaline Ore");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.BlockOres, 1, 5), "Topaz Ore");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.BlockOres, 1, 6), "Verdite Ore");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.BlockOres, 1, 7), "Bloodstone");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.BlockOres, 1, 8), "Black Soulstone");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.BlockOres, 1, 9), "Blue Soulstone");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.BlockOres, 1, 10), "Red Soulstone");
|
||||
LanguageRegistry.instance().addName(new ItemStack(BlockHandler.BlockOres, 1, 11), "Agate Ore");
|
||||
|
||||
LanguageRegistry.instance().addName(ItemHandler.AdamantineIngot, "Adamantine Ingot");
|
||||
LanguageRegistry.instance().addName(ItemHandler.MithrilIngot, "Mithril Ingot");
|
||||
LanguageRegistry.instance().addName(ItemHandler.ObsidianShard, "Obsidian Shard");
|
||||
LanguageRegistry.instance().addName(ItemHandler.ObsidianRod, "Obsidian Rod");
|
||||
LanguageRegistry.instance().addName(ItemHandler.BloodstoneShard, "Bloodstone Shard");
|
||||
LanguageRegistry.instance().addName(ItemHandler.TopazGem, "Topaz");
|
||||
LanguageRegistry.instance().addName(ItemHandler.AmethystGem, "Amethyst");
|
||||
LanguageRegistry.instance().addName(ItemHandler.TourmalineGem, "Tourmaline");
|
||||
LanguageRegistry.instance().addName(ItemHandler.MysticPowder, "Mystic Powder");
|
||||
LanguageRegistry.instance().addName(ItemHandler.IridiumIngot, "Iridium Ingot");
|
||||
LanguageRegistry.instance().addName(ItemHandler.IridiumNugget, "Iridium Nugget");
|
||||
LanguageRegistry.instance().addName(ItemHandler.GlassShard, "Glass Shard");
|
||||
LanguageRegistry.instance().addName(ItemHandler.VerditeIngot, "Verdite Ingot");
|
||||
LanguageRegistry.instance().addName(ItemHandler.VerditeDust, "Verdite Dust");
|
||||
LanguageRegistry.instance().addName(ItemHandler.MithrilDust, "Mithril Dust");
|
||||
LanguageRegistry.instance().addName(ItemHandler.AdamantineDust, "Adamantine Dust");
|
||||
LanguageRegistry.instance().addName(ItemHandler.AgateGem, "Agate");
|
||||
LanguageRegistry.instance().addName(ItemHandler.AdamantineSword, "Adamantine Sword");
|
||||
LanguageRegistry.instance().addName(ItemHandler.MithrilSword, "Mithril Sword");
|
||||
LanguageRegistry.instance().addName(ItemHandler.VerditeSword, "Verdite Sword");
|
||||
LanguageRegistry.instance().addName(ItemHandler.IridiumSword, "Iridium Sword");
|
||||
LanguageRegistry.instance().addName(ItemHandler.ObsidianSword, "Obsidian Sword");
|
||||
LanguageRegistry.instance().addName(ItemHandler.BloodstoneSword, "Bloodstone Sword");
|
||||
LanguageRegistry.instance().addName(ItemHandler.AdamantinePickaxe, "Adamantine Pickaxe");
|
||||
LanguageRegistry.instance().addName(ItemHandler.MithrilPickaxe, "Mithril Pickaxe");
|
||||
LanguageRegistry.instance().addName(ItemHandler.VerditePickaxe, "Verdite Pickaxe");
|
||||
LanguageRegistry.instance().addName(ItemHandler.IridiumPickaxe, "Iridium Pickaxe");
|
||||
LanguageRegistry.instance().addName(ItemHandler.ObsidianPickaxe, "Obsidian Pickaxe");
|
||||
LanguageRegistry.instance().addName(ItemHandler.BloodstonePickaxe, "Bloodstone Pickaxe");
|
||||
LanguageRegistry.instance().addName(ItemHandler.AdamantineShovel, "Adamantine Shovel");
|
||||
LanguageRegistry.instance().addName(ItemHandler.MithrilShovel, "Mithril Shovel");
|
||||
LanguageRegistry.instance().addName(ItemHandler.VerditeShovel, "Verdite Shovel");
|
||||
LanguageRegistry.instance().addName(ItemHandler.IridiumShovel, "Iridium Shovel");
|
||||
LanguageRegistry.instance().addName(ItemHandler.ObsidianShovel, "Obsidian Shovel");
|
||||
LanguageRegistry.instance().addName(ItemHandler.BloodstoneShovel, "Bloodstone Shovel");
|
||||
LanguageRegistry.instance().addName(ItemHandler.AdamantineAxe, "Adamantine Axe");
|
||||
LanguageRegistry.instance().addName(ItemHandler.MithrilAxe, "Mithril Axe");
|
||||
LanguageRegistry.instance().addName(ItemHandler.VerditeAxe, "Verdite Axe");
|
||||
LanguageRegistry.instance().addName(ItemHandler.IridiumAxe, "Iridium Axe");
|
||||
LanguageRegistry.instance().addName(ItemHandler.ObsidianAxe, "Obsidian Axe");
|
||||
LanguageRegistry.instance().addName(ItemHandler.BloodstoneAxe, "Bloodstone Axe");
|
||||
LanguageRegistry.instance().addName(ItemHandler.AdamantineHoe, "Adamantine Hoe");
|
||||
LanguageRegistry.instance().addName(ItemHandler.MithrilHoe, "Mithril Hoe");
|
||||
LanguageRegistry.instance().addName(ItemHandler.VerditeHoe, "Verdite Hoe");
|
||||
LanguageRegistry.instance().addName(ItemHandler.IridiumHoe, "Iridium Hoe");
|
||||
LanguageRegistry.instance().addName(ItemHandler.Satchel, "Magical Bag");
|
||||
LanguageRegistry.instance().addName(ItemHandler.BloodstoneHoe, "Bloodstone Hoe");
|
||||
LanguageRegistry.instance().addName(ItemHandler.ObsidianHoe, "Obsidian Hoe");
|
||||
|
||||
LanguageRegistry.instance().addStringLocalization("itemGroup.MysticOresTab", "en_US", "Mystic Ores!");
|
||||
}
|
||||
}
|
||||
5
common/MysticOres/Lib/BlockIds.java
Normal file
5
common/MysticOres/Lib/BlockIds.java
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
package MysticOres.Lib;
|
||||
|
||||
public class BlockIds {
|
||||
|
||||
}
|
||||
5
common/MysticOres/Lib/ItemIds.java
Normal file
5
common/MysticOres/Lib/ItemIds.java
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
package MysticOres.Lib;
|
||||
|
||||
public class ItemIds {
|
||||
|
||||
}
|
||||
5
common/MysticOres/Lib/Strings.java
Normal file
5
common/MysticOres/Lib/Strings.java
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
package MysticOres.Lib;
|
||||
|
||||
public class Strings {
|
||||
|
||||
}
|
||||
62
common/MysticOres/ModHandler.java
Normal file
62
common/MysticOres/ModHandler.java
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
package MysticOres;
|
||||
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
import MysticOres.Items.ItemHandler;
|
||||
import thaumcraft.api.EnumTag;
|
||||
import thaumcraft.api.ObjectTags;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class ModHandler
|
||||
{
|
||||
public static void init()
|
||||
{
|
||||
|
||||
//Thaumcraft API
|
||||
if(Loader.isModLoaded("Thaumcraft") == true)
|
||||
{
|
||||
ThaumcraftApi.registerObjectTag(ItemHandler.AdamantineIngot.itemID, 0, (new ObjectTags()).add(EnumTag.METAL, 10).add(EnumTag.VALUABLE, 4));
|
||||
ThaumcraftApi.registerObjectTag(ItemHandler.MithrilIngot.itemID, 0, (new ObjectTags()).add(EnumTag.METAL, 8).add(EnumTag.MAGIC, 2));
|
||||
ThaumcraftApi.registerObjectTag(ItemHandler.VerditeIngot.itemID, 0, (new ObjectTags()).add(EnumTag.METAL, 8).add(EnumTag.PLANT, 2));
|
||||
ThaumcraftApi.registerObjectTag(ItemHandler.IridiumIngot.itemID, 0, (new ObjectTags()).add(EnumTag.METAL, 16).add(EnumTag.VALUABLE, 8));
|
||||
ThaumcraftApi.registerObjectTag(ItemHandler.AmethystGem.itemID, 0, (new ObjectTags()).add(EnumTag.MAGIC, 4).add(EnumTag.VALUABLE, 2));
|
||||
ThaumcraftApi.registerObjectTag(ItemHandler.TourmalineGem.itemID, 0, (new ObjectTags()).add(EnumTag.MAGIC, 4).add(EnumTag.VALUABLE, 2));
|
||||
ThaumcraftApi.registerObjectTag(ItemHandler.TopazGem.itemID, 0, (new ObjectTags()).add(EnumTag.MAGIC, 4).add(EnumTag.VALUABLE, 2));
|
||||
ThaumcraftApi.registerObjectTag(ItemHandler.AgateGem.itemID, 0, (new ObjectTags()).add(EnumTag.MAGIC, 4).add(EnumTag.VALUABLE, 2));
|
||||
ThaumcraftApi.registerObjectTag(ItemHandler.MysticPowder.itemID, 0, (new ObjectTags()).add(EnumTag.MAGIC, 4).add(EnumTag.VALUABLE, 2)
|
||||
.add(EnumTag.EXCHANGE, 9));
|
||||
ThaumcraftApi.registerObjectTag(BlockHandler.ReinforcedGlass.blockID, 0, (new ObjectTags()).add(EnumTag.CRYSTAL, 4).add(EnumTag.ROCK, 2));
|
||||
ThaumcraftApi.registerObjectTag(ItemHandler.IridiumNugget.itemID, 0, (new ObjectTags()).add(EnumTag.POISON, 2).add(EnumTag.FIRE, 1).add(EnumTag.MAGIC, 4)
|
||||
.add(EnumTag.POWER, 6));
|
||||
ThaumcraftApi.registerObjectTag(ItemHandler.BloodstoneShard.itemID, 0, (new ObjectTags()).add(EnumTag.CRYSTAL, 1).add(EnumTag.DARK, 1));
|
||||
ThaumcraftApi.registerObjectTag(BlockHandler.BlockOres.blockID, 7, (new ObjectTags()).add(EnumTag.DARK, 4).add(EnumTag.EVIL, 2));
|
||||
|
||||
System.out.println("[Mystic Ores] Thaumcraft Integration Initialized Successfully!");
|
||||
}
|
||||
|
||||
|
||||
//IC2 API
|
||||
/*
|
||||
if(Loader.isModLoaded("IC2") == true && Config.DustsEnabled == true)
|
||||
{
|
||||
IC2Handler.adamantineRecipe();
|
||||
IC2Handler.mithrilRecipe();
|
||||
IC2Handler.verditeRecipe();
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
//TE API
|
||||
if(Loader.isModLoaded("ThermalExpansion") == true && Config.DustsEnabled == true)
|
||||
{
|
||||
ThermalExpansionHandler.init();
|
||||
|
||||
GameRegistry.addSmelting(MysticOres.AdamantineDust.itemID, new ItemStack(MysticOres.AdamantineIngot), 0.0F);
|
||||
GameRegistry.addSmelting(MysticOres.MithrilDust.itemID, new ItemStack(MysticOres.MithrilIngot), 0.0F);
|
||||
GameRegistry.addSmelting(MysticOres.VerditeDust.itemID, new ItemStack(MysticOres.VerditeIngot), 0.0F);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
91
common/MysticOres/MysticOres.java
Normal file
91
common/MysticOres/MysticOres.java
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
package MysticOres;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
import MysticOres.Blocks.BlockOres;
|
||||
import MysticOres.Blocks.BlockReinforcedGlass;
|
||||
import MysticOres.Blocks.ItemBlockOres;
|
||||
import MysticOres.Items.ItemAxes;
|
||||
import MysticOres.Items.ItemBase;
|
||||
import MysticOres.Items.ItemHandler;
|
||||
import MysticOres.Items.ItemHoes;
|
||||
import MysticOres.Items.ItemPickaxes;
|
||||
import MysticOres.Items.ItemSatchel;
|
||||
import MysticOres.Items.ItemShovels;
|
||||
import MysticOres.Items.ItemSwords;
|
||||
import MysticOres.Worldgen.WorldGenHandler;
|
||||
import MysticOres.Worldgen.WorldGenAdamantine;
|
||||
import MysticOres.Worldgen.WorldGenAgate;
|
||||
import MysticOres.Worldgen.WorldGenAmethyst;
|
||||
import MysticOres.Worldgen.WorldGenIridium;
|
||||
import MysticOres.Worldgen.WorldGenMithril;
|
||||
import MysticOres.Worldgen.WorldGenMysticNetherMinable;
|
||||
import MysticOres.Worldgen.WorldGenTopaz;
|
||||
import MysticOres.Worldgen.WorldGenTourmaline;
|
||||
import MysticOres.Worldgen.WorldGenVerdite;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockGrass;
|
||||
import net.minecraft.block.BlockLeaves;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumToolMaterial;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.DungeonHooks;
|
||||
import net.minecraftforge.common.EnumHelper;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import net.minecraftforge.common.ForgeVersion;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.Init;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.Mod.PostInit;
|
||||
import cpw.mods.fml.common.Mod.PreInit;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.network.NetworkMod;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@Mod(modid = "Mystic Ores", name = "Mystic Ores", version = "0.1")
|
||||
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
|
||||
|
||||
public class MysticOres
|
||||
{
|
||||
public static CreativeTabs MysticOresTab = new TabMysticOres(CreativeTabs.getNextID(), "MysticOresTab");
|
||||
|
||||
@PreInit
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
Config.initialize(new File(event.getModConfigurationDirectory(), "Mystic Mods/Mystic Ores.cfg"));
|
||||
Config.save();
|
||||
}
|
||||
|
||||
@Init
|
||||
public void load(FMLInitializationEvent event)
|
||||
{
|
||||
BlockHandler.init();
|
||||
ItemHandler.init();
|
||||
GameRegistry.registerFuelHandler(new IridiumFuel());
|
||||
RecipeHandler.init();
|
||||
OreDictionaryHandler.init();
|
||||
WorldGenHandler.init();
|
||||
Lang.init();
|
||||
}
|
||||
|
||||
@PostInit
|
||||
public void postInit(FMLPostInitializationEvent event)
|
||||
{
|
||||
ModHandler.init();
|
||||
}
|
||||
}
|
||||
33
common/MysticOres/OreDictionaryHandler.java
Normal file
33
common/MysticOres/OreDictionaryHandler.java
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
package MysticOres;
|
||||
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
import MysticOres.Items.ItemHandler;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class OreDictionaryHandler
|
||||
{
|
||||
public static void init()
|
||||
{
|
||||
OreDictionary.registerOre("ingotAdamantine", new ItemStack(ItemHandler.AdamantineIngot));
|
||||
OreDictionary.registerOre("ingotMithril", new ItemStack(ItemHandler.MithrilIngot));
|
||||
OreDictionary.registerOre("ingotVerdite", new ItemStack(ItemHandler.VerditeIngot));
|
||||
OreDictionary.registerOre("ingotIridium", new ItemStack(ItemHandler.IridiumIngot));
|
||||
OreDictionary.registerOre("gemTourmaline", new ItemStack(ItemHandler.TourmalineGem));
|
||||
OreDictionary.registerOre("gemTopaz", new ItemStack(ItemHandler.TopazGem));
|
||||
OreDictionary.registerOre("gemAmethyst", new ItemStack(ItemHandler.AmethystGem));
|
||||
OreDictionary.registerOre("gemAgate", new ItemStack(ItemHandler.AgateGem));
|
||||
|
||||
OreDictionary.registerOre("oreAdamantine", new ItemStack(BlockHandler.BlockOres, 1, 0));
|
||||
OreDictionary.registerOre("oreAmethyst", new ItemStack(BlockHandler.BlockOres, 1, 1));
|
||||
OreDictionary.registerOre("oreIridium", new ItemStack(BlockHandler.BlockOres, 1, 2));
|
||||
OreDictionary.registerOre("oreMithril", new ItemStack(BlockHandler.BlockOres, 1, 3));
|
||||
OreDictionary.registerOre("oreSapphire", new ItemStack(BlockHandler.BlockOres, 1, 4));
|
||||
OreDictionary.registerOre("oreTopaz", new ItemStack(BlockHandler.BlockOres, 1, 5));
|
||||
OreDictionary.registerOre("oreVerdite", new ItemStack(BlockHandler.BlockOres, 1, 6));
|
||||
OreDictionary.registerOre("oreBloodstone", new ItemStack(BlockHandler.BlockOres, 1, 7));
|
||||
OreDictionary.registerOre("oreBlackSoulstone", new ItemStack(BlockHandler.BlockOres, 1, 8));
|
||||
OreDictionary.registerOre("oreRedSoulstone", new ItemStack(BlockHandler.BlockOres, 1, 9));
|
||||
OreDictionary.registerOre("oreBlueSoulstone", new ItemStack(BlockHandler.BlockOres, 1, 10));
|
||||
}
|
||||
}
|
||||
572
common/MysticOres/RecipeHandler.java
Normal file
572
common/MysticOres/RecipeHandler.java
Normal file
|
|
@ -0,0 +1,572 @@
|
|||
package MysticOres;
|
||||
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
import MysticOres.Items.ItemHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockGrass;
|
||||
import net.minecraft.block.BlockLeaves;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class RecipeHandler
|
||||
{
|
||||
public static void init(){
|
||||
recipes();
|
||||
blockRecipes();
|
||||
blockSmelting();
|
||||
itemRecipes();
|
||||
itemSmelting();
|
||||
mysticGemRecipes();
|
||||
mysticPowderRecipes();
|
||||
}
|
||||
|
||||
private static void recipes()
|
||||
{
|
||||
GameRegistry.addRecipe(new ItemStack(Block.glass, 1), new Object [] {
|
||||
"##", "##", '#', ItemHandler.GlassShard
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.obsidian, 1), new Object[] {
|
||||
"##", "##", '#', ItemHandler.ObsidianShard
|
||||
});
|
||||
}
|
||||
|
||||
private static void blockRecipes(){
|
||||
GameRegistry.addRecipe(new ItemStack(BlockHandler.BlockOres, 8, 7), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.dirt, Character.valueOf('O'), ItemHandler.AgateGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(BlockHandler.BlockOres, 16, 7), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), new ItemStack(BlockHandler.BlockOres, 1, 3), Character.valueOf('O'), ItemHandler.AgateGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(BlockHandler.BlockOres, 8, 3), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.dirt, Character.valueOf('O'), ItemHandler.AmethystGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(BlockHandler.ReinforcedGlass, 8), new Object[] {
|
||||
"###", "#D#", "###", '#', ItemHandler.GlassShard, 'D', ItemHandler.ObsidianShard
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(BlockHandler.BlockOres, 1, 7), new Object[] {
|
||||
"##", "##", '#', ItemHandler.BloodstoneShard
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(BlockHandler.BlockOres, 2, 7), new Object[] {
|
||||
ItemHandler.MysticPowder, new ItemStack(BlockHandler.BlockOres, 1, 7)
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(BlockHandler.BlockOres, 2, 3), new Object[] {
|
||||
ItemHandler.MysticPowder, new ItemStack(BlockHandler.BlockOres, 1, 3)
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(BlockHandler.BlockOres, 2, 0), new Object[] {
|
||||
ItemHandler.MysticPowder, new ItemStack(BlockHandler.BlockOres, 1, 0)
|
||||
});
|
||||
}
|
||||
|
||||
private static void blockSmelting(){
|
||||
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockOres.blockID, 0, new ItemStack(ItemHandler.AdamantineIngot), 0.9F);
|
||||
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockOres.blockID, 3, new ItemStack(ItemHandler.MithrilIngot), 0.7F);
|
||||
FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockOres.blockID, 6, new ItemStack(ItemHandler.VerditeIngot), 0.4F);
|
||||
}
|
||||
|
||||
private static void itemRecipes(){
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.ObsidianRod, 2), new Object[] {
|
||||
"#", "#", '#', ItemHandler.ObsidianShard
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.IridiumIngot, 1), new Object[] {
|
||||
"###", "#O#", "###", '#', ItemHandler.IridiumNugget, 'O', ItemHandler.AdamantineIngot
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ItemHandler.GlassShard, 4), new Object[] {
|
||||
Block.glass
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ItemHandler.ObsidianShard, 4), new Object[] {
|
||||
Block.obsidian
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ItemHandler.MysticPowder, 8), new Object[] {
|
||||
ItemHandler.TourmalineGem, ItemHandler.TopazGem, ItemHandler.AmethystGem, ItemHandler.AgateGem
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ItemHandler.BloodstoneShard, 2), new Object[] {
|
||||
new ItemStack(BlockHandler.BlockOres, 1, 7)
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.VerditePickaxe, 1), new Object[] {
|
||||
"###", " S ", " S ", '#', ItemHandler.VerditeIngot, 'S', Item.stick
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.VerditeSword, 1), new Object[] {
|
||||
"#", "#", "S", '#', ItemHandler.VerditeIngot, 'S', Item.stick
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.VerditeShovel, 1), new Object[] {
|
||||
"#", "S", "S", '#', ItemHandler.VerditeIngot, 'S', Item.stick
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.VerditeAxe, 1), new Object[] {
|
||||
"## ", "#S ", " S ", '#', ItemHandler.VerditeIngot, 'S', Item.stick
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.VerditeAxe, 1), new Object[] {
|
||||
"## ", "S# ", "S ", '#', ItemHandler.VerditeIngot, 'S', Item.stick
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.VerditeHoe, 1), new Object[] {
|
||||
"## ", " S ", " S ", '#', ItemHandler.VerditeIngot, 'S', Item.stick
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.VerditeHoe, 1), new Object[] {
|
||||
"## ", "S ", "S ", '#', ItemHandler.VerditeIngot, 'S', Item.stick
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.MithrilPickaxe, 1), new Object[] {
|
||||
"###", " S ", " S ", '#', ItemHandler.MithrilIngot, 'S', Item.stick
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.MithrilSword, 1), new Object[] {
|
||||
"#", "#", "S", '#', ItemHandler.MithrilIngot, 'S', Item.stick
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.MithrilShovel, 1), new Object[] {
|
||||
"#", "S", "S", '#', ItemHandler.MithrilIngot, 'S', Item.stick
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.MithrilAxe, 1), new Object[] {
|
||||
"## ", "#S ", " S ", '#', ItemHandler.MithrilIngot, 'S', Item.stick
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.MithrilAxe, 1), new Object[] {
|
||||
"## ", "S# ", "S ", '#', ItemHandler.MithrilIngot, 'S', Item.stick
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.MithrilHoe, 1), new Object[] {
|
||||
"## ", " S ", " S ", '#', ItemHandler.MithrilIngot, 'S', Item.stick
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.MithrilHoe, 1), new Object[] {
|
||||
"## ", "S ", "S ", '#', ItemHandler.MithrilIngot, 'S', Item.stick
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.AdamantinePickaxe, 1), new Object[] {
|
||||
"###", " S ", " S ", '#', ItemHandler.AdamantineIngot, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.AdamantineSword, 1), new Object[] {
|
||||
"#", "#", "S", '#', ItemHandler.AdamantineIngot, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.AdamantineShovel, 1), new Object[] {
|
||||
"#", "S", "S", '#', ItemHandler.AdamantineIngot, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.AdamantineAxe, 1), new Object[] {
|
||||
"## ", "#S ", " S ", '#', ItemHandler.AdamantineIngot, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.AdamantineAxe, 1), new Object[] {
|
||||
"## ", "S# ", "S ", '#', ItemHandler.AdamantineIngot, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.AdamantineHoe, 1), new Object[] {
|
||||
"## ", " S ", " S ", '#', ItemHandler.AdamantineIngot, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.AdamantineHoe, 1), new Object[] {
|
||||
"## ", "S ", "S ", '#', ItemHandler.AdamantineIngot, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.IridiumPickaxe, 1), new Object[] {
|
||||
"###", " S ", " S ", '#', ItemHandler.IridiumIngot, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.IridiumSword, 1), new Object[] {
|
||||
"#", "#", "S", '#', ItemHandler.IridiumIngot, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.IridiumShovel, 1), new Object[] {
|
||||
"#", "S", "S", '#', ItemHandler.IridiumIngot, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.IridiumAxe, 1), new Object[] {
|
||||
"## ", "#S ", " S ", '#', ItemHandler.IridiumIngot, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.IridiumAxe, 1), new Object[] {
|
||||
"## ", "S# ", "S ", '#', ItemHandler.IridiumIngot, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.IridiumHoe, 1), new Object[] {
|
||||
"## ", " S ", " S ", '#', ItemHandler.IridiumIngot, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.IridiumHoe, 1), new Object[] {
|
||||
"## ", "S ", "S ", '#', ItemHandler.IridiumIngot, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.ObsidianPickaxe, 1), new Object[] {
|
||||
"###", " S ", " S ", '#', Block.obsidian, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.ObsidianSword, 1), new Object[] {
|
||||
"#", "#", "S", '#', Block.obsidian, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.ObsidianShovel, 1), new Object[] {
|
||||
"#", "S", "S", '#', Block.obsidian, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.ObsidianAxe, 1), new Object[] {
|
||||
"## ", "#S ", " S ", '#', Block.obsidian, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.ObsidianAxe, 1), new Object[] {
|
||||
"## ", "S# ", "S ", '#', Block.obsidian, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.ObsidianHoe, 1), new Object[] {
|
||||
"## ", " S ", " S ", '#', Block.obsidian, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.ObsidianHoe, 1), new Object[] {
|
||||
"## ", "S ", "S ", '#', Block.obsidian, 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.BloodstonePickaxe, 1), new Object[] {
|
||||
"###", " S ", " S ", '#', new ItemStack(BlockHandler.BlockOres, 1, 7), 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.BloodstoneSword, 1), new Object[] {
|
||||
"#", "#", "S", '#', new ItemStack(BlockHandler.BlockOres, 1, 7), 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.BloodstoneShovel, 1), new Object[] {
|
||||
"#", "S", "S", '#', new ItemStack(BlockHandler.BlockOres, 1, 7), 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.BloodstoneAxe, 1), new Object[] {
|
||||
"## ", "#S ", " S ", '#', new ItemStack(BlockHandler.BlockOres, 1, 7), 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.BloodstoneAxe, 1), new Object[] {
|
||||
"## ", "S# ", "S ", '#', new ItemStack(BlockHandler.BlockOres, 1, 7), 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.BloodstoneHoe, 1), new Object[] {
|
||||
"## ", " S ", " S ", '#', new ItemStack(BlockHandler.BlockOres, 1, 7), 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.BloodstoneHoe, 1), new Object[] {
|
||||
"## ", "S ", "S ", '#', new ItemStack(BlockHandler.BlockOres, 1, 7), 'S', ItemHandler.ObsidianRod
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.Satchel, 1), new Object[] {
|
||||
"#$#", "$%$", "#$#", '#', Item.silk, '$', ItemHandler.MysticPowder, '%', Block.enderChest
|
||||
});
|
||||
}
|
||||
|
||||
private static void itemSmelting(){
|
||||
GameRegistry.addSmelting(ItemHandler.AdamantineDust.itemID, new ItemStack(ItemHandler.AdamantineIngot), 0.0F);
|
||||
GameRegistry.addSmelting(ItemHandler.MithrilDust.itemID, new ItemStack(ItemHandler.MithrilIngot), 0.0F);
|
||||
GameRegistry.addSmelting(ItemHandler.VerditeDust.itemID, new ItemStack(ItemHandler.VerditeIngot), 0.0F);
|
||||
}
|
||||
|
||||
private static void mysticGemRecipes()
|
||||
{
|
||||
GameRegistry.addRecipe(new ItemStack(Item.slimeBall, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.stone, Character.valueOf('O'), ItemHandler.AgateGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.cobblestoneMossy, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.cobblestone, Character.valueOf('O'), ItemHandler.AgateGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(BlockGrass.grass, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.sand, Character.valueOf('O'), ItemHandler.AgateGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.seeds, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.sapling, Character.valueOf('O'), ItemHandler.AgateGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.wheat, 16), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Item.reed, Character.valueOf('O'), ItemHandler.AgateGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.seeds, 32), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Item.egg, Character.valueOf('O'), ItemHandler.AgateGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.cactus, 32), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Item.slimeBall, Character.valueOf('O'), ItemHandler.AgateGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.oreCoal, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.gravel, Character.valueOf('O'), ItemHandler.AgateGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.flint, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), ItemHandler.GlassShard, Character.valueOf('O'), ItemHandler.AgateGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.tallGrass, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Item.seeds, Character.valueOf('O'), ItemHandler.AgateGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.bookShelf, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.planks, Character.valueOf('O'), ItemHandler.AgateGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.cloth, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.glass, Character.valueOf('O'), ItemHandler.AgateGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.leather, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Item.stick, Character.valueOf('O'), ItemHandler.AgateGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.glass, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.stone, Character.valueOf('O'), ItemHandler.TourmalineGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.ice, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.blockSnow, Character.valueOf('O'), ItemHandler.TourmalineGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.blockLapis, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.blockIron, Character.valueOf('O'), ItemHandler.TourmalineGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.reed, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.sapling, Character.valueOf('O'), ItemHandler.TourmalineGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.glass, 16), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.sand, Character.valueOf('O'), ItemHandler.TourmalineGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.blockSnow, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.dirt, Character.valueOf('O'), ItemHandler.TourmalineGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.oreLapis, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.oreCoal, Character.valueOf('O'), ItemHandler.TourmalineGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.snowball, 16), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Item.reed, Character.valueOf('O'), ItemHandler.TourmalineGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.sugar, 16), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Item.egg, Character.valueOf('O'), ItemHandler.TourmalineGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.clay, 16), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Item.slimeBall, Character.valueOf('O'), ItemHandler.TourmalineGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.mushroomBrown, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Item.seeds, Character.valueOf('O'), ItemHandler.TourmalineGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.sandStone, 16), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.planks, Character.valueOf('O'), ItemHandler.TourmalineGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.snow, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.glass, Character.valueOf('O'), ItemHandler.TourmalineGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.silk, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Item.stick, Character.valueOf('O'), ItemHandler.TourmalineGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.sandStone, 16), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.stone, Character.valueOf('O'), ItemHandler.TopazGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.netherrack, 16), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.cobblestone, Character.valueOf('O'), ItemHandler.TopazGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.blockGold, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.blockIron, Character.valueOf('O'), ItemHandler.TopazGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.wood, 16), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.sapling, Character.valueOf('O'), ItemHandler.TopazGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.sponge, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.sand, Character.valueOf('O'), ItemHandler.TopazGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.oreIron, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.dirt, Character.valueOf('O'), ItemHandler.TopazGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.oreRedstone, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.oreLapis, Character.valueOf('O'), ItemHandler.TopazGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.appleRed, 1), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Item.reed, Character.valueOf('O'), ItemHandler.TopazGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.feather, 32), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Item.egg, Character.valueOf('O'), ItemHandler.TopazGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.arrow, 32), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), ItemHandler.GlassShard, Character.valueOf('O'), ItemHandler.TopazGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.mushroomRed, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Item.seeds, Character.valueOf('O'), ItemHandler.TopazGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.doorWood, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.planks, Character.valueOf('O'), ItemHandler.TopazGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.glowStone, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.glass, Character.valueOf('O'), ItemHandler.TopazGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.bone, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Item.stick, Character.valueOf('O'), ItemHandler.TopazGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.blockClay, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.stone, Character.valueOf('O'), ItemHandler.AmethystGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.tnt, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.brick, Character.valueOf('O'), ItemHandler.AmethystGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.diamond, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.blockLapis, Character.valueOf('O'), ItemHandler.AmethystGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(BlockLeaves.leaves, 16), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.sapling, Character.valueOf('O'), ItemHandler.AmethystGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.oreGold, 16), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.sand, Character.valueOf('O'), ItemHandler.AmethystGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.oreDiamond, 4), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.oreRedstone, Character.valueOf('O'), ItemHandler.AmethystGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.book, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Item.reed, Character.valueOf('O'), ItemHandler.AmethystGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.cookie, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Item.egg, Character.valueOf('O'), ItemHandler.AmethystGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.cake, 1), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Item.slimeBall, Character.valueOf('O'), ItemHandler.AmethystGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.music, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.planks, Character.valueOf('O'), ItemHandler.AmethystGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Block.pumpkinLantern, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Block.glass, Character.valueOf('O'), ItemHandler.AmethystGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.VerditeIngot, 16), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Item.ingotIron, Character.valueOf('O'), ItemHandler.AgateGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.BloodstoneShard, 16), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), ItemHandler.ObsidianShard, Character.valueOf('O'), ItemHandler.TopazGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.IridiumNugget, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), ItemHandler.ObsidianShard, Character.valueOf('O'), ItemHandler.AmethystGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.ObsidianShard, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), ItemHandler.GlassShard, Character.valueOf('O'), ItemHandler.AmethystGem
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ItemHandler.ObsidianRod, 8), new Object[] {
|
||||
"XXX", "XOX", "XXX", Character.valueOf('X'), Item.stick, Character.valueOf('O'), ItemHandler.AmethystGem
|
||||
});
|
||||
}
|
||||
|
||||
private static void mysticPowderRecipes(){
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreGold, 2), new Object[] {
|
||||
ItemHandler.MysticPowder, Block.oreGold
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreIron, 2), new Object[] {
|
||||
ItemHandler.MysticPowder, Block.oreIron
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ItemHandler.BloodstoneShard, 2), new Object[] {
|
||||
ItemHandler.MysticPowder, ItemHandler.BloodstoneShard
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Item.gunpowder, 2), new Object[] {
|
||||
ItemHandler.MysticPowder, Item.gunpowder
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ItemHandler.IridiumNugget, 2), new Object[] {
|
||||
ItemHandler.MysticPowder, ItemHandler.IridiumNugget
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreCoal, 2), new Object[] {
|
||||
ItemHandler.MysticPowder, Block.oreCoal
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreIron, 3), new Object[] {
|
||||
ItemHandler.MysticPowder, Block.oreIron
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreGold, 3), new Object[] {
|
||||
ItemHandler.MysticPowder, Block.oreGold
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreRedstone, 2), new Object[] {
|
||||
ItemHandler.MysticPowder, Block.oreRedstone
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreLapis, 2), new Object[] {
|
||||
ItemHandler.MysticPowder, Block.oreLapis
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Block.oreDiamond, 2), new Object[] {
|
||||
ItemHandler.MysticPowder, Block.oreDiamond
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Item.sugar, 18), new Object[] {
|
||||
ItemHandler.MysticPowder, Item.sugar
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Item.redstone, 12), new Object[] {
|
||||
ItemHandler.MysticPowder, Item.redstone
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Item.lightStoneDust, 6), new Object[] {
|
||||
ItemHandler.MysticPowder, Item.lightStoneDust
|
||||
});
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Item.gunpowder, 3), new Object[] {
|
||||
ItemHandler.MysticPowder, Item.gunpowder
|
||||
});
|
||||
}
|
||||
}
|
||||
19
common/MysticOres/TabMysticOres.java
Normal file
19
common/MysticOres/TabMysticOres.java
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package MysticOres;
|
||||
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TabMysticOres extends CreativeTabs {
|
||||
|
||||
public TabMysticOres(int par1, String par2Str) {
|
||||
super(par1, par2Str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getIconItemStack() {
|
||||
return new ItemStack(BlockHandler.BlockOres, 1, 7);
|
||||
}
|
||||
|
||||
}
|
||||
32
common/MysticOres/ThermalExpansionHandler.java
Normal file
32
common/MysticOres/ThermalExpansionHandler.java
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package MysticOres;
|
||||
|
||||
/*
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import thermalexpansion.api.crafting.*;
|
||||
|
||||
public class ThermalExpansionHandler
|
||||
{
|
||||
public static void init()
|
||||
{
|
||||
//Adamantine Recipe
|
||||
CraftingManagers.pulverizerManager.addRecipe(400, new ItemStack(MysticOres.BlockOres, 1, 0),
|
||||
new ItemStack(MysticOres.AdamantineDust, 2, 0), true);
|
||||
|
||||
//Mithril Recipe
|
||||
CraftingManagers.pulverizerManager.addRecipe(400, new ItemStack(MysticOres.BlockOres, 1, 3),
|
||||
new ItemStack(MysticOres.MithrilDust, 2, 0), true);
|
||||
|
||||
//Verdite Recipe
|
||||
CraftingManagers.pulverizerManager.addRecipe(400, new ItemStack(MysticOres.BlockOres, 1, 6),
|
||||
new ItemStack(MysticOres.VerditeDust, 2, 0), true);
|
||||
|
||||
//Iridium Ingot Recipe
|
||||
CraftingManagers.smelterManager.addRecipe(800, new ItemStack(MysticOres.AdamantineIngot, 1, 0),
|
||||
new ItemStack(MysticOres.IridiumNugget, 8, 0), new ItemStack(MysticOres.IridiumIngot, 2, 0),
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
75
common/MysticOres/Worldgen/NetherHandler.java
Normal file
75
common/MysticOres/Worldgen/NetherHandler.java
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
package MysticOres.Worldgen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class NetherHandler extends WorldGenerator {
|
||||
|
||||
private int minableBlockId;
|
||||
private int minableBlockMeta = 0;
|
||||
|
||||
private int numberOfBlocks;
|
||||
|
||||
public NetherHandler(int par1, int par2) {
|
||||
this.minableBlockId = par1;
|
||||
this.numberOfBlocks = par2;
|
||||
}
|
||||
|
||||
public NetherHandler(int id, int meta, int number) {
|
||||
this(id, number);
|
||||
minableBlockMeta = meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) {
|
||||
float var6 = par2Random.nextFloat() * (float) Math.PI;
|
||||
double var7 = (double) ((float) (par3 + 8) + MathHelper.sin(var6) * (float) this.numberOfBlocks / 8.0F);
|
||||
double var9 = (double) ((float) (par3 + 8) - MathHelper.sin(var6) * (float) this.numberOfBlocks / 8.0F);
|
||||
double var11 = (double) ((float) (par5 + 8) + MathHelper.cos(var6) * (float) this.numberOfBlocks / 8.0F);
|
||||
double var13 = (double) ((float) (par5 + 8) - MathHelper.cos(var6) * (float) this.numberOfBlocks / 8.0F);
|
||||
double var15 = (double) (par4 + par2Random.nextInt(3) - 2);
|
||||
double var17 = (double) (par4 + par2Random.nextInt(3) - 2);
|
||||
|
||||
for (int nBlockNumberTry = 0; nBlockNumberTry <= this.numberOfBlocks; ++nBlockNumberTry) {
|
||||
double var20 = var7 + (var9 - var7) * (double) nBlockNumberTry / (double) this.numberOfBlocks;
|
||||
double var22 = var15 + (var17 - var15) * (double) nBlockNumberTry / (double) this.numberOfBlocks;
|
||||
double var24 = var11 + (var13 - var11) * (double) nBlockNumberTry / (double) this.numberOfBlocks;
|
||||
double var26 = par2Random.nextDouble() * (double) this.numberOfBlocks / 16.0D;
|
||||
double var28 = (double) (MathHelper.sin((float) nBlockNumberTry * (float) Math.PI / (float) this.numberOfBlocks) + 1.0F) * var26 + 1.0D;
|
||||
double var30 = (double) (MathHelper.sin((float) nBlockNumberTry * (float) Math.PI / (float) this.numberOfBlocks) + 1.0F) * var26 + 1.0D;
|
||||
int var32 = MathHelper.floor_double(var20 - var28 / 2.0D);
|
||||
int var33 = MathHelper.floor_double(var22 - var30 / 2.0D);
|
||||
int var34 = MathHelper.floor_double(var24 - var28 / 2.0D);
|
||||
int var35 = MathHelper.floor_double(var20 + var28 / 2.0D);
|
||||
int var36 = MathHelper.floor_double(var22 + var30 / 2.0D);
|
||||
int var37 = MathHelper.floor_double(var24 + var28 / 2.0D);
|
||||
|
||||
for (int var38 = var32; var38 <= var35; ++var38) {
|
||||
double var39 = ((double) var38 + 0.5D - var20) / (var28 / 2.0D);
|
||||
|
||||
if (var39 * var39 < 1.0D) {
|
||||
for (int var41 = var33; var41 <= var36; ++var41) {
|
||||
double var42 = ((double) var41 + 0.5D - var22) / (var30 / 2.0D);
|
||||
|
||||
if (var39 * var39 + var42 * var42 < 1.0D) {
|
||||
for (int var44 = var34; var44 <= var37; ++var44) {
|
||||
double var45 = ((double) var44 + 0.5D - var24) / (var28 / 2.0D);
|
||||
|
||||
int blocktoreplace = par1World.getBlockId(var38, var41, var44);
|
||||
if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && blocktoreplace == Block.netherrack.blockID) {
|
||||
par1World.setBlock(var38, var41, var44, this.minableBlockId, minableBlockMeta, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
34
common/MysticOres/Worldgen/WorldGenAdamantine.java
Normal file
34
common/MysticOres/Worldgen/WorldGenAdamantine.java
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
package MysticOres.Worldgen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.Config;
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenAdamantine implements IWorldGenerator {
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||
for (int i = 0; i < Config.AdamantineRarity; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(8);
|
||||
int Ycoord = random.nextInt(16);
|
||||
int Zcoord = blockZ + random.nextInt(8);
|
||||
|
||||
(new WorldGenMinable(BlockHandler.BlockOres.blockID, 0, 3)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
35
common/MysticOres/Worldgen/WorldGenAgate.java
Normal file
35
common/MysticOres/Worldgen/WorldGenAgate.java
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
package MysticOres.Worldgen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.Config;
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenAgate implements IWorldGenerator
|
||||
{
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider){
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||
for (int i = 0; i < Config.AgateRarity; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(32);
|
||||
int Ycoord = random.nextInt(60);
|
||||
int Zcoord = blockZ + random.nextInt(32);
|
||||
|
||||
(new WorldGenMinable(BlockHandler.BlockOres.blockID, 11, 4, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
common/MysticOres/Worldgen/WorldGenAmethyst.java
Normal file
36
common/MysticOres/Worldgen/WorldGenAmethyst.java
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
package MysticOres.Worldgen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.Config;
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenAmethyst implements IWorldGenerator {
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
||||
{
|
||||
for (int i = 0; i < Config.AmethystRarity; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(24);
|
||||
int Ycoord = random.nextInt(60);
|
||||
int Zcoord = blockZ + random.nextInt(24);
|
||||
|
||||
(new WorldGenMinable(BlockHandler.BlockOres.blockID, 1, 4, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
24
common/MysticOres/Worldgen/WorldGenHandler.java
Normal file
24
common/MysticOres/Worldgen/WorldGenHandler.java
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
package MysticOres.Worldgen;
|
||||
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class WorldGenHandler
|
||||
{
|
||||
public static void init()
|
||||
{
|
||||
GameRegistry.registerWorldGenerator(new WorldGenVerdite());
|
||||
GameRegistry.registerWorldGenerator(new WorldGenTopaz());
|
||||
GameRegistry.registerWorldGenerator(new WorldGenTourmaline());
|
||||
GameRegistry.registerWorldGenerator(new WorldGenMithril());
|
||||
GameRegistry.registerWorldGenerator(new WorldGenIridium());
|
||||
GameRegistry.registerWorldGenerator(new WorldGenAmethyst());
|
||||
GameRegistry.registerWorldGenerator(new WorldGenAdamantine());
|
||||
GameRegistry.registerWorldGenerator(new WorldGenAgate());
|
||||
GameRegistry.registerWorldGenerator(new WorldGenMysticNetherMinable(BlockHandler.BlockOres.blockID, 7, 1));
|
||||
GameRegistry.registerWorldGenerator(new WorldGenMysticNetherMinable(BlockHandler.BlockOres.blockID, 8, 3));
|
||||
GameRegistry.registerWorldGenerator(new WorldGenMysticNetherMinable(BlockHandler.BlockOres.blockID, 9, 2));
|
||||
GameRegistry.registerWorldGenerator(new WorldGenMysticNetherMinable(BlockHandler.BlockOres.blockID, 10, 3));
|
||||
}
|
||||
}
|
||||
36
common/MysticOres/Worldgen/WorldGenIridium.java
Normal file
36
common/MysticOres/Worldgen/WorldGenIridium.java
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
package MysticOres.Worldgen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.Config;
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenIridium implements IWorldGenerator {
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
||||
{
|
||||
for (int i = 0; i < Config.IridiumRarity; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(12);
|
||||
int Zcoord = blockZ + random.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(BlockHandler.BlockOres.blockID, 2, 6, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
35
common/MysticOres/Worldgen/WorldGenMithril.java
Normal file
35
common/MysticOres/Worldgen/WorldGenMithril.java
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
package MysticOres.Worldgen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.Config;
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenMithril implements IWorldGenerator {
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||
for (int i = 0; i < Config.MithrilRarity; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(64);
|
||||
int Zcoord = blockZ + random.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(BlockHandler.BlockOres.blockID, 3, 6, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
45
common/MysticOres/Worldgen/WorldGenMysticNetherMinable.java
Normal file
45
common/MysticOres/Worldgen/WorldGenMysticNetherMinable.java
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
package MysticOres.Worldgen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenMysticNetherMinable implements IWorldGenerator {
|
||||
|
||||
private int minableBlockId;
|
||||
private int minableBlockMeta = 0;
|
||||
|
||||
private int numberOfBlocks;
|
||||
|
||||
public WorldGenMysticNetherMinable(int blockId, int numBlocks) {
|
||||
this.minableBlockId = blockId;
|
||||
this.numberOfBlocks = numBlocks;
|
||||
}
|
||||
|
||||
public WorldGenMysticNetherMinable(int blockId, int meta, int numBlocks) {
|
||||
this(blockId, numBlocks);
|
||||
minableBlockMeta = meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||
if (world.provider.isHellWorld)
|
||||
generateNether(world, random, chunkX * 16, chunkZ * 16);
|
||||
|
||||
}
|
||||
|
||||
private void generateNether(World world, Random random, int i, int j) {
|
||||
for (int j1 = 0; j1 < 50; j1++) {
|
||||
int Xcoordinate = i + random.nextInt(16);
|
||||
int Zcoordinate = j + random.nextInt(16);
|
||||
int Ycoordinate = random.nextInt(256);
|
||||
new NetherHandler(minableBlockId, minableBlockMeta, numberOfBlocks).generate(world, random, Xcoordinate, Ycoordinate, Zcoordinate);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
35
common/MysticOres/Worldgen/WorldGenTopaz.java
Normal file
35
common/MysticOres/Worldgen/WorldGenTopaz.java
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
package MysticOres.Worldgen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.Config;
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenTopaz implements IWorldGenerator {
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||
for (int i = 0; i < Config.TopazRarity; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(60);
|
||||
int Zcoord = blockZ + random.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(BlockHandler.BlockOres.blockID, 5, 4, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
33
common/MysticOres/Worldgen/WorldGenTourmaline.java
Normal file
33
common/MysticOres/Worldgen/WorldGenTourmaline.java
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
package MysticOres.Worldgen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.Config;
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenTourmaline implements IWorldGenerator {
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider){
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||
for (int i = 0; i < Config.TourmalineRarity; i++){
|
||||
int Xcoord = blockX + random.nextInt(32);
|
||||
int Ycoord = random.nextInt(60);
|
||||
int Zcoord = blockZ + random.nextInt(32);
|
||||
|
||||
(new WorldGenMinable(BlockHandler.BlockOres.blockID, 4, 4, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
common/MysticOres/Worldgen/WorldGenVerdite.java
Normal file
36
common/MysticOres/Worldgen/WorldGenVerdite.java
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
package MysticOres.Worldgen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.Config;
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenVerdite implements IWorldGenerator {
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
||||
{
|
||||
for (int i = 0; i < Config.VerditeRarity; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(30) + 70;
|
||||
int Zcoord = blockZ + random.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(BlockHandler.BlockOres.blockID, 6, 9, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
25
common/MysticRuins/Config.java
Normal file
25
common/MysticRuins/Config.java
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package MysticRuins;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import net.minecraftforge.common.Configuration;
|
||||
|
||||
public class Config
|
||||
{
|
||||
public static Configuration config;
|
||||
public static int RuinRarity;
|
||||
public static int DunRarity;
|
||||
|
||||
public static void initialize(File file)
|
||||
{
|
||||
config = new Configuration(file);
|
||||
RuinRarity = config.get("General", "Ruin Rarity", 2).getInt();
|
||||
DunRarity = config.get("General", "Mystic Dungeon Rarity", 1).getInt();
|
||||
config.save();
|
||||
}
|
||||
|
||||
public static void save()
|
||||
{
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
30
common/MysticRuins/DungeonLoot.java
Normal file
30
common/MysticRuins/DungeonLoot.java
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package MysticRuins;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraftforge.common.ChestGenHooks;
|
||||
|
||||
public class DungeonLoot
|
||||
{
|
||||
public DungeonLoot()
|
||||
{
|
||||
addLoot();
|
||||
}
|
||||
|
||||
public static ChestGenHooks MysticRuinChest;
|
||||
|
||||
public static void addLoot ()
|
||||
{
|
||||
MysticRuinChest = new ChestGenHooks("MysticRuinChest", new WeightedRandomChestContent[0], 3, 27);
|
||||
|
||||
MysticRuinChest.addItem(new WeightedRandomChestContent(new ItemStack(Item.ingotGold, 1, 0), 60, 1, 1));
|
||||
MysticRuinChest.addItem(new WeightedRandomChestContent(new ItemStack(Item.diamond, 1, 0), 100, 1, 1));
|
||||
MysticRuinChest.addItem(new WeightedRandomChestContent(new ItemStack(Item.ingotIron, 1, 0), 30, 1, 1));
|
||||
MysticRuinChest.addItem(new WeightedRandomChestContent(new ItemStack(Item.enderPearl, 4, 0), 20, 1, 1));
|
||||
MysticRuinChest.addItem(new WeightedRandomChestContent(new ItemStack(Item.appleRed, 3, 0), 10, 1, 1));
|
||||
MysticRuinChest.addItem(new WeightedRandomChestContent(new ItemStack(Item.appleGold, 1, 0), 50, 1, 1));
|
||||
MysticRuinChest.addItem(new WeightedRandomChestContent(new ItemStack(Item.emerald, 1, 0), 200, 1, 1));
|
||||
MysticRuinChest.addItem(new WeightedRandomChestContent(new ItemStack(Item.shovelIron, 1, 0), 60, 1, 1));
|
||||
}
|
||||
}
|
||||
48
common/MysticRuins/MysticRuins.java
Normal file
48
common/MysticRuins/MysticRuins.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
package MysticRuins;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.DungeonHooks;
|
||||
import net.minecraftforge.common.EnumHelper;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.Init;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.Mod.PostInit;
|
||||
import cpw.mods.fml.common.Mod.PreInit;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.network.NetworkMod;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
|
||||
@Mod(modid = "Mystic Ruins", name = "Mystic Ruins", version = "0.1")
|
||||
@NetworkMod(clientSideRequired = false, serverSideRequired = false)
|
||||
|
||||
public class MysticRuins
|
||||
{
|
||||
@PreInit
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
Config.initialize(new File(event.getModConfigurationDirectory(), "Mystic Mods/Mystic Ruins.cfg"));
|
||||
Config.save();
|
||||
}
|
||||
|
||||
@Init
|
||||
public void load(FMLInitializationEvent event)
|
||||
{
|
||||
GameRegistry.registerWorldGenerator(new WorldGenRuin());
|
||||
GameRegistry.registerWorldGenerator(new WorldGenRuin$1());
|
||||
GameRegistry.registerWorldGenerator(new WorldGenMysticDungeon());
|
||||
}
|
||||
|
||||
@PostInit
|
||||
public void postInit(FMLPostInitializationEvent event)
|
||||
{
|
||||
}
|
||||
}
|
||||
3998
common/MysticRuins/StructureMysticDungeon.java
Normal file
3998
common/MysticRuins/StructureMysticDungeon.java
Normal file
File diff suppressed because it is too large
Load diff
553
common/MysticRuins/StructureRuin$1.java
Normal file
553
common/MysticRuins/StructureRuin$1.java
Normal file
|
|
@ -0,0 +1,553 @@
|
|||
package MysticRuins;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.tileentity.TileEntityMobSpawner;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class StructureRuin$1 extends WorldGenerator
|
||||
{
|
||||
|
||||
public StructureRuin$1()
|
||||
{
|
||||
}
|
||||
|
||||
public boolean generate(World world, Random random, int i, int j, int k)
|
||||
{
|
||||
int l = random.nextInt(100);
|
||||
if(l >= 10)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for(int i1 = 0; i1 < 1; i1++)
|
||||
{
|
||||
int j1 = (i + random.nextInt(8)) - random.nextInt(8);
|
||||
int k1 = (j + random.nextInt(4)) - random.nextInt(4);
|
||||
int l1 = (k + random.nextInt(8)) - random.nextInt(8);
|
||||
if(!world.isAirBlock(j1, k1, l1) || world.getBlockId(j1, k1 - 1, l1) != Block.grass.blockID || !Block.pumpkin.canPlaceBlockAt(world, j1, k1, l1))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
int i2 = random.nextInt(3) + 1;
|
||||
if(i2 == 1)
|
||||
{
|
||||
int j2 = random.nextInt(8) + 5;
|
||||
int i3 = random.nextInt(8) + 5;
|
||||
int l3 = random.nextInt(8) + 5;
|
||||
int k4 = random.nextInt(4) + 3;
|
||||
int j5 = 1;
|
||||
int i6 = 0;
|
||||
int l6 = 1;
|
||||
boolean flag = false;
|
||||
int k7 = random.nextInt(100);
|
||||
int j8 = random.nextInt(100);
|
||||
if(j8 <= 20)
|
||||
{
|
||||
j5 = 0;
|
||||
} else
|
||||
{
|
||||
j5 = random.nextInt(4) + 5;
|
||||
}
|
||||
world.setBlock(j1, k1 - j5, l1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 1, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - j5) + 2, l1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 2, l1 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - j5) + 3, l1 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - j5) + 4, l1 + 1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 5, l1 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - j5) + 2, l1 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - j5) + 3, l1 + 2, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 4, l1 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, k1 - j5, l1 + 3, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - j5) + 1, l1 + 3, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 2, l1 + 3, Block.stoneBrick.blockID);
|
||||
|
||||
world.setBlock(j1, k1 - j5 - k4, l1 + 2, Block.chest.blockID);
|
||||
TileEntityChest tileentitychest = (TileEntityChest) world.getBlockTileEntity(j1, k1 - j5 - k4, l1 + 2);
|
||||
Random rand = new Random();
|
||||
for(int slot = 0; slot < tileentitychest.getSizeInventory(); slot++)
|
||||
{
|
||||
int num = rand.nextInt(32);
|
||||
|
||||
if(num == 1)
|
||||
{
|
||||
tileentitychest.setInventorySlotContents(slot, new ItemStack(Item.pickaxeIron, 1, 0));
|
||||
}
|
||||
|
||||
if(num == 2)
|
||||
{
|
||||
tileentitychest.setInventorySlotContents(slot, new ItemStack(Item.axeIron, 1, 0));
|
||||
}
|
||||
|
||||
if(num == 3)
|
||||
{
|
||||
tileentitychest.setInventorySlotContents(slot, new ItemStack(Item.swordIron, 1, 0));
|
||||
}
|
||||
|
||||
if(num == 4)
|
||||
{
|
||||
tileentitychest.setInventorySlotContents(slot, new ItemStack(Item.shovelIron, 1, 0));
|
||||
}
|
||||
|
||||
if(num == 5)
|
||||
{
|
||||
tileentitychest.setInventorySlotContents(slot, new ItemStack(Item.ingotGold, 1, 0));
|
||||
}
|
||||
|
||||
if(num == 6)
|
||||
{
|
||||
tileentitychest.setInventorySlotContents(slot, new ItemStack(Item.ingotIron, 1, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
world.setBlock(j1, k1 - j5 - k4 - 1, l1 + 2, Block.dirt.blockID);
|
||||
l6 = 1;
|
||||
i6 = 0;
|
||||
flag = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 4) || world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 5) || world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 6) || world.getBlockId(j1 + l3, k1 - j5 - l6, l1 + l3 + 4) == Block.waterStill.blockID || world.getBlockId(j1 + l3, k1 - j5 - l6, l1 + l3 + 5) == Block.waterStill.blockID || world.getBlockId(j1 + l3, k1 - j5 - l6, l1 + l3 + 6) == Block.waterStill.blockID)
|
||||
{
|
||||
i6++;
|
||||
} else
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
} while(!flag && l6++ < 12);
|
||||
world.setBlock(j1 + l3, k1 - j5 - i6, l1 + l3 + 4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l3 + 1, k1 - j5 - i6, l1 + l3 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l3 + 1, ((k1 - j5) + 1) - i6, l1 + l3 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l3 + 2, k1 - j5 - i6, l1 + l3 + 4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + l3 + 3, k1 - j5 - i6, l1 + l3 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l3 + 4, k1 - j5 - i6, l1 + l3 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l3 + 5, k1 - j5 - i6, l1 + l3 + 4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + l3, k1 - j5 - i6, l1 + l3 + 5, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 5, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 6, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l3, ((k1 - j5) + 3) - i6, l1 + l3 + 6, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l3, k1 - j5 - i6, l1 + l3 + 7, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 7, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 7, Block.stoneBrick.blockID, 1, 2);
|
||||
k7 = random.nextInt(100);
|
||||
if(k7 <= 30)
|
||||
{
|
||||
world.setBlock(j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5, Block.mobSpawner.blockID);
|
||||
TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getBlockTileEntity(j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5);
|
||||
if(spawner != null)
|
||||
{
|
||||
spawner.func_98049_a().setMobID("Zombie");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
world.setBlock(j1 + l3, k1 - j5 - i6 - k4 - 1, l1 + l3 + 5, Block.dirt.blockID);
|
||||
}
|
||||
l6 = 1;
|
||||
i6 = 0;
|
||||
flag = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 - i3, k1 - j5 - l6, l1 - 4) || world.isAirBlock(j1 - i3, k1 - j5 - l6, l1 - 5) || world.isAirBlock(j1 - i3 - 1, k1 - j5 - l6, l1 - 5) || world.getBlockId(j1 - i3, k1 - j5 - l6, l1 - 4) == Block.waterStill.blockID || world.getBlockId(j1 - i3, k1 - j5 - l6, l1 - 5) == Block.waterStill.blockID || world.getBlockId(j1 - i3 - 1, k1 - j5 - l6, l1 - 5) == Block.waterStill.blockID)
|
||||
{
|
||||
i6++;
|
||||
} else
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
} while(!flag && l6++ < 12);
|
||||
world.setBlock(j1 - i3, k1 - j5 - i6, l1 - 4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - i3, ((k1 - j5) + 1) - i6, l1 - 4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - i3, k1 - j5 - i6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - i3 - 1, k1 - j5 - i6, l1 - 5, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - i3 - 1, ((k1 - j5) + 1) - i6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - i3 - 1, ((k1 - j5) + 2) - i6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - i3 - 2, k1 - j5 - i6, l1 - 5, Block.stoneBrick.blockID);
|
||||
k7 = random.nextInt(100);
|
||||
if(k7 <= 60)
|
||||
{
|
||||
world.setBlock(j1 - i3 - 1, k1 - j5 - i6 - k4, l1 - 5, Block.dirt.blockID);
|
||||
world.setBlock(j1 - i3 - 1, k1 - j5 - i6 - k4 - 1, l1 - 5, Block.dirt.blockID);
|
||||
}
|
||||
}
|
||||
if(i2 == 2)
|
||||
{
|
||||
int k2 = random.nextInt(8) + 5;
|
||||
int j3 = random.nextInt(8) + 5;
|
||||
int i4 = random.nextInt(8) + 5;
|
||||
int l4 = random.nextInt(4) + 3;
|
||||
int k5 = 1;
|
||||
int j6 = 0;
|
||||
int i7 = 1;
|
||||
boolean flag1 = false;
|
||||
int l7 = random.nextInt(100);
|
||||
int k8 = random.nextInt(100);
|
||||
if(k8 <= 20)
|
||||
{
|
||||
k5 = 0;
|
||||
} else
|
||||
{
|
||||
k5 = random.nextInt(4) + 5;
|
||||
}
|
||||
world.setBlock(j1, k1 - k5, l1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1, k1 - k5, l1 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, k1 - k5, l1 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, k1 - k5, l1 + 3, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, k1 - k5, l1 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - k5) + 1, l1 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - k5) + 2, l1 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - k5) + 3, l1 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - k5) + 1, l1 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + 1, k1 - k5, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + 2, k1 - k5, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, k1 - k5 - l4, l1 + 2, Block.dirt.blockID);
|
||||
world.setBlock(j1, k1 - k5 - l4 - 1, l1 + 2, Block.dirt.blockID);
|
||||
i7 = 1;
|
||||
j6 = 0;
|
||||
flag1 = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 - k2, k1 - k5 - i7, l1 - 4) || world.isAirBlock(j1 - k2, k1 - k5 - i7, l1 - 5) || world.isAirBlock(j1 - k2 - 1, k1 - k5 - i7, l1 - 5) || world.getBlockId(j1 - k2, k1 - k5 - i7, l1 - 4) == Block.waterStill.blockID || world.getBlockId(j1 - k2, k1 - k5 - i7, l1 - 5) == Block.waterStill.blockID || world.getBlockId(j1 - k2 - 1, k1 - k5 - i7, l1 - 5) == Block.waterStill.blockID)
|
||||
{
|
||||
j6++;
|
||||
} else
|
||||
{
|
||||
flag1 = true;
|
||||
}
|
||||
} while(!flag1 && i7++ < 12);
|
||||
world.setBlock(j1 - k2, k1 - k5 - j6, l1 - 3, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - k2, k1 - k5 - j6, l1 - 4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k2, ((k1 - k5) + 1) - j6, l1 - 4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k2, ((k1 - k5) + 2) - j6, l1 - 4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k2, k1 - k5 - j6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k2, ((k1 - k5) + 1) - j6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k2, ((k1 - k5) + 2) - j6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k2, ((k1 - k5) + 3) - j6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k2, ((k1 - k5) + 4) - j6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k2 - 1, k1 - k5 - j6, l1 - 5, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - k2 - 1, ((k1 - k5) + 1) - j6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k2 - 1, ((k1 - k5) + 2) - j6, l1 - 5, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k2 - 2, k1 - k5 - j6, l1 - 5, Block.stoneBrick.blockID);
|
||||
l7 = random.nextInt(100);
|
||||
if(l7 <= 30)
|
||||
{
|
||||
world.setBlock(j1 - k2 - 1, k1 - k5 - j6 - l4, l1 - 5, Block.dirt.blockID);
|
||||
world.setBlock(j1 - k2 - 1, k1 - k5 - j6 - l4 - 1, l1 - 5, Block.dirt.blockID);
|
||||
}
|
||||
i7 = 1;
|
||||
j6 = 0;
|
||||
flag1 = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 4) || world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 6) || world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 8) || world.getBlockId(j1 + i4, k1 - k5 - i7, l1 + 4) == Block.waterStill.blockID || world.getBlockId(j1 + i4, k1 - k5 - i7, l1 + 6) == Block.waterStill.blockID || world.getBlockId(j1 + i4, k1 - k5 - i7, l1 + 8) == Block.waterStill.blockID)
|
||||
{
|
||||
j6++;
|
||||
} else
|
||||
{
|
||||
flag1 = true;
|
||||
}
|
||||
} while(!flag1 && i7++ < 12);
|
||||
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + i4, ((k1 - k5) + 1) - j6, l1 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + i4 + 1, k1 - k5 - j6, l1 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + i4 + 1, ((k1 - k5) + 1) - j6, l1 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + i4 + 2, k1 - k5 - j6, l1 + 4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + i4 + 3, k1 - k5 - j6, l1 + 4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + i4 + 3, ((k1 - k5) + 1) - j6, l1 + 4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + i4 + 4, k1 - k5 - j6, l1 + 4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + i4 + 5, k1 - k5 - j6, l1 + 4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 5, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + i4, ((k1 - k5) + 1) - j6, l1 + 5, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + i4, ((k1 - k5) + 2) - j6, l1 + 6, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 7, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + i4, ((k1 - k5) + 1) - j6, l1 + 7, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + i4, ((k1 - k5) + 2) - j6, l1 + 7, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 8, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + i4, ((k1 - k5) + 1) - j6, l1 + 8, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 9, Block.stoneBrick.blockID, 1, 2);
|
||||
l7 = random.nextInt(100);
|
||||
if(l7 <= 60)
|
||||
{
|
||||
world.setBlock(j1 + i4, k1 - k5 - j6 - l4, l1 + 7, Block.dirt.blockID);
|
||||
world.setBlock(j1 + i4, k1 - k5 - j6 - l4 - 1, l1 + 7, Block.dirt.blockID);
|
||||
}
|
||||
i7 = 1;
|
||||
j6 = 0;
|
||||
flag1 = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 - j3, k1 - k5 - i7, l1 + i4) || world.isAirBlock(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) || world.isAirBlock((j1 - j3) + 1, k1 - k5 - i7, l1 + i4) || world.getBlockId(j1 - j3, k1 - k5 - i7, l1 + i4) == Block.waterStill.blockID || world.getBlockId(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) == Block.waterStill.blockID || world.getBlockId((j1 - j3) + 1, k1 - k5 - i7, l1 + i4) == Block.waterStill.blockID)
|
||||
{
|
||||
j6++;
|
||||
} else
|
||||
{
|
||||
flag1 = true;
|
||||
}
|
||||
} while(!flag1 && i7++ < 12);
|
||||
world.setBlock((j1 - j3) + 1, k1 - k5 - j6, l1 + i4, Block.stoneBrick.blockID);
|
||||
world.setBlock((j1 - j3) + 1, ((k1 - k5) + 1) - j6, l1 + i4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock((j1 - j3) + 1, ((k1 - k5) + 2) - j6, l1 + i4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock((j1 - j3) + 2, k1 - k5 - j6, l1 + i4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - j3, k1 - k5 - j6, (l1 + i4) - 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 2, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 2, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 5) - j6, (l1 + i4) - 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - j3, k1 - k5 - j6, (l1 + i4) - 3, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 3, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 3, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 3, Block.stoneBrick.blockID, 1, 2);
|
||||
l7 = random.nextInt(100);
|
||||
if(l7 <= 30)
|
||||
{
|
||||
world.setBlock(j1 - j3, k1 - k5 - j6 - l4, (l1 + i4) - 2, Block.dirt.blockID);
|
||||
world.setBlock(j1 - j3, k1 - k5 - j6 - l4 - 1, (l1 + i4) - 2, Block.dirt.blockID);
|
||||
}
|
||||
i7 = 1;
|
||||
j6 = 0;
|
||||
flag1 = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) || world.isAirBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) || world.isAirBlock(j1 + j3 + 5, k1 - k5 - i7, l1 - 7) || world.getBlockId(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) == Block.waterStill.blockID || world.getBlockId(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) == Block.waterStill.blockID || world.getBlockId(j1 + j3 + 5, k1 - k5 - i7, l1 - 7) == Block.waterStill.blockID)
|
||||
{
|
||||
j6++;
|
||||
} else
|
||||
{
|
||||
flag1 = true;
|
||||
}
|
||||
} while(!flag1 && i7++ < 12);
|
||||
world.setBlock(j1 + j3 + 4, k1 - k5 - j6, l1 - 6, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 6, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + j3 + 4, ((k1 - k5) + 2) - j6, l1 - 6, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + j3 + 4, k1 - k5 - j6, l1 - 7, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 7, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + j3 + 5, k1 - k5 - j6, l1 - 7, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + j3 + 5, ((k1 - k5) + 1) - j6, l1 - 7, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + j3 + 5, ((k1 - k5) + 2) - j6, l1 - 7, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + j3 + 6, k1 - k5 - j6, l1 - 7, Block.stoneBrick.blockID);
|
||||
l7 = random.nextInt(100);
|
||||
if(l7 <= 30)
|
||||
{
|
||||
world.setBlock(j1 + j3 + 4, k1 - k5 - j6 - l4, l1 - 7, Block.dirt.blockID);
|
||||
world.setBlock(j1 + j3 + 4, k1 - k5 - j6 - l4 - 1, l1 - 7, Block.dirt.blockID);
|
||||
}
|
||||
}
|
||||
if(i2 != 3)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
int l2 = random.nextInt(8) + 5;
|
||||
int k3 = random.nextInt(8) + 5;
|
||||
int j4 = random.nextInt(8) + 5;
|
||||
int i5 = random.nextInt(4) + 3;
|
||||
int l5 = 1;
|
||||
int k6 = 0;
|
||||
int j7 = 1;
|
||||
boolean flag2 = false;
|
||||
int i8 = random.nextInt(100);
|
||||
int l8 = random.nextInt(100);
|
||||
if(l8 <= 20)
|
||||
{
|
||||
l5 = 0;
|
||||
} else
|
||||
{
|
||||
l5 = random.nextInt(4) + 5;
|
||||
}
|
||||
world.setBlock(j1, k1 - l5, l1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - 1, k1 - l5, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - 1, (k1 - l5) + 1, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - 1, (k1 - l5) + 2, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - 1, (k1 - l5) + 3, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - l5) + 1, l1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 2, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - l5) + 3, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - l5) + 4, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, (k1 - l5) + 5, l1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, k1 - l5, l1 + 1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 2, l1 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1, k1 - l5, l1 + 2, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 1, l1 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||
|
||||
world.setBlock(j1, k1 - l5 - i5, l1 + 1, Block.dirt.blockID);
|
||||
world.setBlock(j1, k1 - l5 - i5 - 1, l1 + 1, Block.dirt.blockID);
|
||||
j7 = 1;
|
||||
k6 = 0;
|
||||
flag2 = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) || world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) || world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4) || world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) == Block.waterStill.blockID || world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) == Block.waterStill.blockID || world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4) == Block.waterStill.blockID)
|
||||
{
|
||||
k6++;
|
||||
} else
|
||||
{
|
||||
flag2 = true;
|
||||
}
|
||||
} while(!flag2 && j7++ < 12);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2 + 1, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2 + 2, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2 + 3, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 3) - k6, l1 + j4 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 2, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 3, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 3, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 6, Block.stoneBrick.blockID);
|
||||
i8 = random.nextInt(100);
|
||||
if(i8 <= 30)
|
||||
{
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6 - i5, l1 + j4 + 1, Block.dirt.blockID);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6 - i5 - 1, l1 + j4 + 1, Block.dirt.blockID);
|
||||
}
|
||||
j7 = 1;
|
||||
k6 = 0;
|
||||
flag2 = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 2) || world.isAirBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 4) || world.isAirBlock(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6) || world.getBlockId(j1 - k3, k1 - l5 - j7, l1 - l2 - 2) == Block.waterStill.blockID || world.getBlockId(j1 - k3, k1 - l5 - j7, l1 - l2 - 4) == Block.waterStill.blockID || world.getBlockId(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6) == Block.waterStill.blockID)
|
||||
{
|
||||
k6++;
|
||||
} else
|
||||
{
|
||||
flag2 = true;
|
||||
}
|
||||
} while(!flag2 && j7++ < 12);
|
||||
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - k3, (k1 - l5 - k6) + 1, l1 - l2 - 1, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - k3, (k1 - l5 - k6) + 2, l1 - l2 - 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 3, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 3, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k3 - 1, k1 - l5 - k6, l1 - l2 - 6, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - k3 - 2, k1 - l5 - k6, l1 - l2 - 6, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - k3 - 2, ((k1 - l5) + 1) - k6, l1 - l2 - 6, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - k3 - 3, k1 - l5 - k6, l1 - l2 - 6, Block.stoneBrick.blockID);
|
||||
i8 = random.nextInt(100);
|
||||
if(i8 <= 60)
|
||||
{
|
||||
world.setBlock(j1 - k3 - 1, k1 - l5 - k6 - i5, l1 - l2 - 6, Block.dirt.blockID);
|
||||
world.setBlock(j1 - k3 - 1, k1 - l5 - k6 - i5 - 1, l1 - l2 - 6, Block.dirt.blockID);
|
||||
}
|
||||
j7 = 1;
|
||||
k6 = 0;
|
||||
flag2 = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 + l2, k1 - l5 - j7, l1 + j4) || world.isAirBlock(j1 + l2 + 2, k1 - l5 - j7, l1 + j4) || world.isAirBlock(j1 + l2 + 4, k1 - l5 - j7, l1 + j4) || world.getBlockId(j1 + l2, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID || world.getBlockId(j1 + l2 + 2, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID || world.getBlockId(j1 + l2 + 4, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID)
|
||||
{
|
||||
k6++;
|
||||
} else
|
||||
{
|
||||
flag2 = true;
|
||||
}
|
||||
} while(!flag2 && j7++ < 12);
|
||||
world.setBlock(j1 + l2, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + l2 + 1, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l2 + 1, ((k1 - l5) + 2) - k6, l1 + j4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + l2 + 1, ((k1 - l5) + 3) - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l2 + 2, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + l2 + 2, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + l2 + 2, ((k1 - l5) + 2) - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l2 + 3, ((k1 - l5) + 2) - k6, l1 + j4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 + l2 + 4, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l2 + 4, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 + l2 + 5, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1, 2);
|
||||
i8 = random.nextInt(100);
|
||||
if(i8 <= 30)
|
||||
{
|
||||
world.setBlock(j1 + l2 + 2, k1 - l5 - k6 - i5, l1 + j4, Block.dirt.blockID);
|
||||
world.setBlock(j1 + l2 + 2, k1 - l5 - k6 - i5 - 1, l1 + j4, Block.dirt.blockID);
|
||||
}
|
||||
j7 = 1;
|
||||
k6 = 0;
|
||||
flag2 = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 1) || world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 3) || world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 4) || world.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 1) == Block.waterStill.blockID || world.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 3) == Block.waterStill.blockID || world.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 4) == Block.waterStill.blockID)
|
||||
{
|
||||
k6++;
|
||||
} else
|
||||
{
|
||||
flag2 = true;
|
||||
}
|
||||
} while(!flag2 && j7++ < 12);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 1, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 2, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 2, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 3, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 3, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 4, Block.stoneBrick.blockID);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 4, Block.stoneBrick.blockID, 1, 2);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 5, Block.stoneBrick.blockID, 1, 2);
|
||||
i8 = random.nextInt(100);
|
||||
if(i8 <= 30)
|
||||
{
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3, Block.chest.blockID);
|
||||
TileEntityChest chest = (TileEntityChest) world.getBlockTileEntity(j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3);
|
||||
Random rand = new Random();
|
||||
for(int slot = 0; slot < chest.getSizeInventory(); slot++)
|
||||
{
|
||||
int num = rand.nextInt(16);
|
||||
|
||||
if(num == 1)
|
||||
{
|
||||
chest.setInventorySlotContents(slot, new ItemStack(Item.enderPearl, 4, 0));
|
||||
}
|
||||
|
||||
if(num == 2)
|
||||
{
|
||||
chest.setInventorySlotContents(slot, new ItemStack(Item.diamond, 1, 0));
|
||||
}
|
||||
|
||||
if(num == 3)
|
||||
{
|
||||
chest.setInventorySlotContents(slot, new ItemStack(Item.emerald, 1, 0));
|
||||
}
|
||||
|
||||
if(num == 4)
|
||||
{
|
||||
chest.setInventorySlotContents(slot, new ItemStack(Item.appleGold, 1, 0));
|
||||
}
|
||||
|
||||
if(num == 5)
|
||||
{
|
||||
chest.setInventorySlotContents(slot, new ItemStack(Item.ingotGold, 1, 0));
|
||||
}
|
||||
|
||||
if(num == 6)
|
||||
{
|
||||
chest.setInventorySlotContents(slot, new ItemStack(Item.ingotIron, 1, 0));
|
||||
}
|
||||
}
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6 - i5 - 1, l1 + k3 + 3, Block.dirt.blockID);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
553
common/MysticRuins/StructureRuin.java
Normal file
553
common/MysticRuins/StructureRuin.java
Normal file
|
|
@ -0,0 +1,553 @@
|
|||
package MysticRuins;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.tileentity.TileEntityMobSpawner;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class StructureRuin extends WorldGenerator
|
||||
{
|
||||
|
||||
public StructureRuin()
|
||||
{
|
||||
}
|
||||
|
||||
public boolean generate(World world, Random random, int i, int j, int k)
|
||||
{
|
||||
int l = random.nextInt(100);
|
||||
if(l >= 10)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for(int i1 = 0; i1 < 1; i1++)
|
||||
{
|
||||
int j1 = (i + random.nextInt(8)) - random.nextInt(8);
|
||||
int k1 = (j + random.nextInt(4)) - random.nextInt(4);
|
||||
int l1 = (k + random.nextInt(8)) - random.nextInt(8);
|
||||
if(!world.isAirBlock(j1, k1, l1) || world.getBlockId(j1, k1 - 1, l1) != Block.grass.blockID || !Block.pumpkin.canPlaceBlockAt(world, j1, k1, l1))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
int i2 = random.nextInt(3) + 1;
|
||||
if(i2 == 1)
|
||||
{
|
||||
int j2 = random.nextInt(8) + 5;
|
||||
int i3 = random.nextInt(8) + 5;
|
||||
int l3 = random.nextInt(8) + 5;
|
||||
int k4 = random.nextInt(4) + 3;
|
||||
int j5 = 1;
|
||||
int i6 = 0;
|
||||
int l6 = 1;
|
||||
boolean flag = false;
|
||||
int k7 = random.nextInt(100);
|
||||
int j8 = random.nextInt(100);
|
||||
if(j8 <= 20)
|
||||
{
|
||||
j5 = 0;
|
||||
} else
|
||||
{
|
||||
j5 = random.nextInt(4) + 5;
|
||||
}
|
||||
world.setBlock(j1, k1 - j5, l1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 1, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 2, l1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 2, l1 + 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 3, l1 + 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 4, l1 + 1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 5, l1 + 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 2, l1 + 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 3, l1 + 2, Block.cobblestone.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 4, l1 + 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, k1 - j5, l1 + 3, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 1, l1 + 3, Block.cobblestone.blockID);
|
||||
world.setBlock(j1, (k1 - j5) + 2, l1 + 3, Block.cobblestone.blockID);
|
||||
|
||||
world.setBlock(j1, k1 - j5 - k4, l1 + 2, Block.chest.blockID);
|
||||
TileEntityChest tileentitychest = (TileEntityChest) world.getBlockTileEntity(j1, k1 - j5 - k4, l1 + 2);
|
||||
Random rand = new Random();
|
||||
for(int slot = 0; slot < tileentitychest.getSizeInventory(); slot++)
|
||||
{
|
||||
int num = rand.nextInt(32);
|
||||
|
||||
if(num == 1)
|
||||
{
|
||||
tileentitychest.setInventorySlotContents(slot, new ItemStack(Item.pickaxeIron, 1, 0));
|
||||
}
|
||||
|
||||
if(num == 2)
|
||||
{
|
||||
tileentitychest.setInventorySlotContents(slot, new ItemStack(Item.axeIron, 1, 0));
|
||||
}
|
||||
|
||||
if(num == 3)
|
||||
{
|
||||
tileentitychest.setInventorySlotContents(slot, new ItemStack(Item.swordIron, 1, 0));
|
||||
}
|
||||
|
||||
if(num == 4)
|
||||
{
|
||||
tileentitychest.setInventorySlotContents(slot, new ItemStack(Item.shovelIron, 1, 0));
|
||||
}
|
||||
|
||||
if(num == 5)
|
||||
{
|
||||
tileentitychest.setInventorySlotContents(slot, new ItemStack(Item.ingotGold, 1, 0));
|
||||
}
|
||||
|
||||
if(num == 6)
|
||||
{
|
||||
tileentitychest.setInventorySlotContents(slot, new ItemStack(Item.ingotIron, 1, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
world.setBlock(j1, k1 - j5 - k4 - 1, l1 + 2, Block.dirt.blockID);
|
||||
l6 = 1;
|
||||
i6 = 0;
|
||||
flag = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 4) || world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 5) || world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 6) || world.getBlockId(j1 + l3, k1 - j5 - l6, l1 + l3 + 4) == Block.waterStill.blockID || world.getBlockId(j1 + l3, k1 - j5 - l6, l1 + l3 + 5) == Block.waterStill.blockID || world.getBlockId(j1 + l3, k1 - j5 - l6, l1 + l3 + 6) == Block.waterStill.blockID)
|
||||
{
|
||||
i6++;
|
||||
} else
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
} while(!flag && l6++ < 12);
|
||||
world.setBlock(j1 + l3, k1 - j5 - i6, l1 + l3 + 4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l3 + 1, k1 - j5 - i6, l1 + l3 + 4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l3 + 1, ((k1 - j5) + 1) - i6, l1 + l3 + 4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l3 + 2, k1 - j5 - i6, l1 + l3 + 4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + l3 + 3, k1 - j5 - i6, l1 + l3 + 4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l3 + 4, k1 - j5 - i6, l1 + l3 + 4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l3 + 5, k1 - j5 - i6, l1 + l3 + 4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + l3, k1 - j5 - i6, l1 + l3 + 5, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 5, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 6, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l3, ((k1 - j5) + 3) - i6, l1 + l3 + 6, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l3, k1 - j5 - i6, l1 + l3 + 7, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 7, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 7, Block.cobblestoneMossy.blockID);
|
||||
k7 = random.nextInt(100);
|
||||
if(k7 <= 30)
|
||||
{
|
||||
world.setBlock(j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5, Block.mobSpawner.blockID);
|
||||
TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getBlockTileEntity(j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5);
|
||||
if(spawner != null)
|
||||
{
|
||||
spawner.func_98049_a().setMobID("Zombie");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
world.setBlock(j1 + l3, k1 - j5 - i6 - k4 - 1, l1 + l3 + 5, Block.dirt.blockID);
|
||||
}
|
||||
l6 = 1;
|
||||
i6 = 0;
|
||||
flag = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 - i3, k1 - j5 - l6, l1 - 4) || world.isAirBlock(j1 - i3, k1 - j5 - l6, l1 - 5) || world.isAirBlock(j1 - i3 - 1, k1 - j5 - l6, l1 - 5) || world.getBlockId(j1 - i3, k1 - j5 - l6, l1 - 4) == Block.waterStill.blockID || world.getBlockId(j1 - i3, k1 - j5 - l6, l1 - 5) == Block.waterStill.blockID || world.getBlockId(j1 - i3 - 1, k1 - j5 - l6, l1 - 5) == Block.waterStill.blockID)
|
||||
{
|
||||
i6++;
|
||||
} else
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
} while(!flag && l6++ < 12);
|
||||
world.setBlock(j1 - i3, k1 - j5 - i6, l1 - 4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - i3, ((k1 - j5) + 1) - i6, l1 - 4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - i3, k1 - j5 - i6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - i3 - 1, k1 - j5 - i6, l1 - 5, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - i3 - 1, ((k1 - j5) + 1) - i6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - i3 - 1, ((k1 - j5) + 2) - i6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - i3 - 2, k1 - j5 - i6, l1 - 5, Block.cobblestone.blockID);
|
||||
k7 = random.nextInt(100);
|
||||
if(k7 <= 60)
|
||||
{
|
||||
world.setBlock(j1 - i3 - 1, k1 - j5 - i6 - k4, l1 - 5, Block.dirt.blockID);
|
||||
world.setBlock(j1 - i3 - 1, k1 - j5 - i6 - k4 - 1, l1 - 5, Block.dirt.blockID);
|
||||
}
|
||||
}
|
||||
if(i2 == 2)
|
||||
{
|
||||
int k2 = random.nextInt(8) + 5;
|
||||
int j3 = random.nextInt(8) + 5;
|
||||
int i4 = random.nextInt(8) + 5;
|
||||
int l4 = random.nextInt(4) + 3;
|
||||
int k5 = 1;
|
||||
int j6 = 0;
|
||||
int i7 = 1;
|
||||
boolean flag1 = false;
|
||||
int l7 = random.nextInt(100);
|
||||
int k8 = random.nextInt(100);
|
||||
if(k8 <= 20)
|
||||
{
|
||||
k5 = 0;
|
||||
} else
|
||||
{
|
||||
k5 = random.nextInt(4) + 5;
|
||||
}
|
||||
world.setBlock(j1, k1 - k5, l1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1, k1 - k5, l1 + 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, k1 - k5, l1 + 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, k1 - k5, l1 + 3, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, k1 - k5, l1 + 4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - k5) + 1, l1 + 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - k5) + 2, l1 + 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - k5) + 3, l1 + 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - k5) + 1, l1 + 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + 1, k1 - k5, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + 2, k1 - k5, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, k1 - k5 - l4, l1 + 2, Block.dirt.blockID);
|
||||
world.setBlock(j1, k1 - k5 - l4 - 1, l1 + 2, Block.dirt.blockID);
|
||||
i7 = 1;
|
||||
j6 = 0;
|
||||
flag1 = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 - k2, k1 - k5 - i7, l1 - 4) || world.isAirBlock(j1 - k2, k1 - k5 - i7, l1 - 5) || world.isAirBlock(j1 - k2 - 1, k1 - k5 - i7, l1 - 5) || world.getBlockId(j1 - k2, k1 - k5 - i7, l1 - 4) == Block.waterStill.blockID || world.getBlockId(j1 - k2, k1 - k5 - i7, l1 - 5) == Block.waterStill.blockID || world.getBlockId(j1 - k2 - 1, k1 - k5 - i7, l1 - 5) == Block.waterStill.blockID)
|
||||
{
|
||||
j6++;
|
||||
} else
|
||||
{
|
||||
flag1 = true;
|
||||
}
|
||||
} while(!flag1 && i7++ < 12);
|
||||
world.setBlock(j1 - k2, k1 - k5 - j6, l1 - 3, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - k2, k1 - k5 - j6, l1 - 4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k2, ((k1 - k5) + 1) - j6, l1 - 4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k2, ((k1 - k5) + 2) - j6, l1 - 4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k2, k1 - k5 - j6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k2, ((k1 - k5) + 1) - j6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k2, ((k1 - k5) + 2) - j6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k2, ((k1 - k5) + 3) - j6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k2, ((k1 - k5) + 4) - j6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k2 - 1, k1 - k5 - j6, l1 - 5, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - k2 - 1, ((k1 - k5) + 1) - j6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k2 - 1, ((k1 - k5) + 2) - j6, l1 - 5, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k2 - 2, k1 - k5 - j6, l1 - 5, Block.cobblestone.blockID);
|
||||
l7 = random.nextInt(100);
|
||||
if(l7 <= 30)
|
||||
{
|
||||
world.setBlock(j1 - k2 - 1, k1 - k5 - j6 - l4, l1 - 5, Block.dirt.blockID);
|
||||
world.setBlock(j1 - k2 - 1, k1 - k5 - j6 - l4 - 1, l1 - 5, Block.dirt.blockID);
|
||||
}
|
||||
i7 = 1;
|
||||
j6 = 0;
|
||||
flag1 = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 4) || world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 6) || world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 8) || world.getBlockId(j1 + i4, k1 - k5 - i7, l1 + 4) == Block.waterStill.blockID || world.getBlockId(j1 + i4, k1 - k5 - i7, l1 + 6) == Block.waterStill.blockID || world.getBlockId(j1 + i4, k1 - k5 - i7, l1 + 8) == Block.waterStill.blockID)
|
||||
{
|
||||
j6++;
|
||||
} else
|
||||
{
|
||||
flag1 = true;
|
||||
}
|
||||
} while(!flag1 && i7++ < 12);
|
||||
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + i4, ((k1 - k5) + 1) - j6, l1 + 4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + i4 + 1, k1 - k5 - j6, l1 + 4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + i4 + 1, ((k1 - k5) + 1) - j6, l1 + 4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + i4 + 2, k1 - k5 - j6, l1 + 4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + i4 + 3, k1 - k5 - j6, l1 + 4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + i4 + 3, ((k1 - k5) + 1) - j6, l1 + 4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + i4 + 4, k1 - k5 - j6, l1 + 4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + i4 + 5, k1 - k5 - j6, l1 + 4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 5, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + i4, ((k1 - k5) + 1) - j6, l1 + 5, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + i4, ((k1 - k5) + 2) - j6, l1 + 6, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 7, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + i4, ((k1 - k5) + 1) - j6, l1 + 7, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + i4, ((k1 - k5) + 2) - j6, l1 + 7, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 8, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + i4, ((k1 - k5) + 1) - j6, l1 + 8, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + i4, k1 - k5 - j6, l1 + 9, Block.cobblestoneMossy.blockID);
|
||||
l7 = random.nextInt(100);
|
||||
if(l7 <= 60)
|
||||
{
|
||||
world.setBlock(j1 + i4, k1 - k5 - j6 - l4, l1 + 7, Block.dirt.blockID);
|
||||
world.setBlock(j1 + i4, k1 - k5 - j6 - l4 - 1, l1 + 7, Block.dirt.blockID);
|
||||
}
|
||||
i7 = 1;
|
||||
j6 = 0;
|
||||
flag1 = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 - j3, k1 - k5 - i7, l1 + i4) || world.isAirBlock(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) || world.isAirBlock((j1 - j3) + 1, k1 - k5 - i7, l1 + i4) || world.getBlockId(j1 - j3, k1 - k5 - i7, l1 + i4) == Block.waterStill.blockID || world.getBlockId(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) == Block.waterStill.blockID || world.getBlockId((j1 - j3) + 1, k1 - k5 - i7, l1 + i4) == Block.waterStill.blockID)
|
||||
{
|
||||
j6++;
|
||||
} else
|
||||
{
|
||||
flag1 = true;
|
||||
}
|
||||
} while(!flag1 && i7++ < 12);
|
||||
world.setBlock((j1 - j3) + 1, k1 - k5 - j6, l1 + i4, Block.cobblestone.blockID);
|
||||
world.setBlock((j1 - j3) + 1, ((k1 - k5) + 1) - j6, l1 + i4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock((j1 - j3) + 1, ((k1 - k5) + 2) - j6, l1 + i4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock((j1 - j3) + 2, k1 - k5 - j6, l1 + i4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - j3, k1 - k5 - j6, (l1 + i4) - 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 2, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 2, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 5) - j6, (l1 + i4) - 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - j3, k1 - k5 - j6, (l1 + i4) - 3, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 3, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 3, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 3, Block.cobblestoneMossy.blockID);
|
||||
l7 = random.nextInt(100);
|
||||
if(l7 <= 30)
|
||||
{
|
||||
world.setBlock(j1 - j3, k1 - k5 - j6 - l4, (l1 + i4) - 2, Block.dirt.blockID);
|
||||
world.setBlock(j1 - j3, k1 - k5 - j6 - l4 - 1, (l1 + i4) - 2, Block.dirt.blockID);
|
||||
}
|
||||
i7 = 1;
|
||||
j6 = 0;
|
||||
flag1 = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) || world.isAirBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) || world.isAirBlock(j1 + j3 + 5, k1 - k5 - i7, l1 - 7) || world.getBlockId(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) == Block.waterStill.blockID || world.getBlockId(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) == Block.waterStill.blockID || world.getBlockId(j1 + j3 + 5, k1 - k5 - i7, l1 - 7) == Block.waterStill.blockID)
|
||||
{
|
||||
j6++;
|
||||
} else
|
||||
{
|
||||
flag1 = true;
|
||||
}
|
||||
} while(!flag1 && i7++ < 12);
|
||||
world.setBlock(j1 + j3 + 4, k1 - k5 - j6, l1 - 6, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 6, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + j3 + 4, ((k1 - k5) + 2) - j6, l1 - 6, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + j3 + 4, k1 - k5 - j6, l1 - 7, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 7, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + j3 + 5, k1 - k5 - j6, l1 - 7, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + j3 + 5, ((k1 - k5) + 1) - j6, l1 - 7, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + j3 + 5, ((k1 - k5) + 2) - j6, l1 - 7, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + j3 + 6, k1 - k5 - j6, l1 - 7, Block.cobblestone.blockID);
|
||||
l7 = random.nextInt(100);
|
||||
if(l7 <= 30)
|
||||
{
|
||||
world.setBlock(j1 + j3 + 4, k1 - k5 - j6 - l4, l1 - 7, Block.dirt.blockID);
|
||||
world.setBlock(j1 + j3 + 4, k1 - k5 - j6 - l4 - 1, l1 - 7, Block.dirt.blockID);
|
||||
}
|
||||
}
|
||||
if(i2 != 3)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
int l2 = random.nextInt(8) + 5;
|
||||
int k3 = random.nextInt(8) + 5;
|
||||
int j4 = random.nextInt(8) + 5;
|
||||
int i5 = random.nextInt(4) + 3;
|
||||
int l5 = 1;
|
||||
int k6 = 0;
|
||||
int j7 = 1;
|
||||
boolean flag2 = false;
|
||||
int i8 = random.nextInt(100);
|
||||
int l8 = random.nextInt(100);
|
||||
if(l8 <= 20)
|
||||
{
|
||||
l5 = 0;
|
||||
} else
|
||||
{
|
||||
l5 = random.nextInt(4) + 5;
|
||||
}
|
||||
world.setBlock(j1, k1 - l5, l1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - 1, k1 - l5, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - 1, (k1 - l5) + 1, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - 1, (k1 - l5) + 2, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - 1, (k1 - l5) + 3, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 1, l1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 2, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 3, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 4, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 5, l1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, k1 - l5, l1 + 1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 2, l1 + 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1, k1 - l5, l1 + 2, Block.cobblestone.blockID);
|
||||
world.setBlock(j1, (k1 - l5) + 1, l1 + 2, Block.cobblestoneMossy.blockID);
|
||||
|
||||
world.setBlock(j1, k1 - l5 - i5, l1 + 1, Block.dirt.blockID);
|
||||
world.setBlock(j1, k1 - l5 - i5 - 1, l1 + 1, Block.dirt.blockID);
|
||||
j7 = 1;
|
||||
k6 = 0;
|
||||
flag2 = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) || world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) || world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4) || world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) == Block.waterStill.blockID || world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) == Block.waterStill.blockID || world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4) == Block.waterStill.blockID)
|
||||
{
|
||||
k6++;
|
||||
} else
|
||||
{
|
||||
flag2 = true;
|
||||
}
|
||||
} while(!flag2 && j7++ < 12);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2 + 1, k1 - l5 - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2 + 2, k1 - l5 - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2 + 3, k1 - l5 - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 3) - k6, l1 + j4 + 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 2, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 3, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 3, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 6, Block.cobblestone.blockID);
|
||||
i8 = random.nextInt(100);
|
||||
if(i8 <= 30)
|
||||
{
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6 - i5, l1 + j4 + 1, Block.dirt.blockID);
|
||||
world.setBlock(j1 + k3 + l2, k1 - l5 - k6 - i5 - 1, l1 + j4 + 1, Block.dirt.blockID);
|
||||
}
|
||||
j7 = 1;
|
||||
k6 = 0;
|
||||
flag2 = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 2) || world.isAirBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 4) || world.isAirBlock(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6) || world.getBlockId(j1 - k3, k1 - l5 - j7, l1 - l2 - 2) == Block.waterStill.blockID || world.getBlockId(j1 - k3, k1 - l5 - j7, l1 - l2 - 4) == Block.waterStill.blockID || world.getBlockId(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6) == Block.waterStill.blockID)
|
||||
{
|
||||
k6++;
|
||||
} else
|
||||
{
|
||||
flag2 = true;
|
||||
}
|
||||
} while(!flag2 && j7++ < 12);
|
||||
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - k3, (k1 - l5 - k6) + 1, l1 - l2 - 1, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - k3, (k1 - l5 - k6) + 2, l1 - l2 - 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 3, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 3, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k3, k1 - l5 - k6, l1 - l2 - 4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k3 - 1, k1 - l5 - k6, l1 - l2 - 6, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - k3 - 2, k1 - l5 - k6, l1 - l2 - 6, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - k3 - 2, ((k1 - l5) + 1) - k6, l1 - l2 - 6, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - k3 - 3, k1 - l5 - k6, l1 - l2 - 6, Block.cobblestone.blockID);
|
||||
i8 = random.nextInt(100);
|
||||
if(i8 <= 60)
|
||||
{
|
||||
world.setBlock(j1 - k3 - 1, k1 - l5 - k6 - i5, l1 - l2 - 6, Block.dirt.blockID);
|
||||
world.setBlock(j1 - k3 - 1, k1 - l5 - k6 - i5 - 1, l1 - l2 - 6, Block.dirt.blockID);
|
||||
}
|
||||
j7 = 1;
|
||||
k6 = 0;
|
||||
flag2 = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 + l2, k1 - l5 - j7, l1 + j4) || world.isAirBlock(j1 + l2 + 2, k1 - l5 - j7, l1 + j4) || world.isAirBlock(j1 + l2 + 4, k1 - l5 - j7, l1 + j4) || world.getBlockId(j1 + l2, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID || world.getBlockId(j1 + l2 + 2, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID || world.getBlockId(j1 + l2 + 4, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID)
|
||||
{
|
||||
k6++;
|
||||
} else
|
||||
{
|
||||
flag2 = true;
|
||||
}
|
||||
} while(!flag2 && j7++ < 12);
|
||||
world.setBlock(j1 + l2, k1 - l5 - k6, l1 + j4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + l2 + 1, k1 - l5 - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l2 + 1, ((k1 - l5) + 2) - k6, l1 + j4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + l2 + 1, ((k1 - l5) + 3) - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l2 + 2, k1 - l5 - k6, l1 + j4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + l2 + 2, ((k1 - l5) + 1) - k6, l1 + j4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + l2 + 2, ((k1 - l5) + 2) - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l2 + 3, ((k1 - l5) + 2) - k6, l1 + j4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 + l2 + 4, k1 - l5 - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l2 + 4, ((k1 - l5) + 1) - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 + l2 + 5, k1 - l5 - k6, l1 + j4, Block.cobblestoneMossy.blockID);
|
||||
i8 = random.nextInt(100);
|
||||
if(i8 <= 30)
|
||||
{
|
||||
world.setBlock(j1 + l2 + 2, k1 - l5 - k6 - i5, l1 + j4, Block.dirt.blockID);
|
||||
world.setBlock(j1 + l2 + 2, k1 - l5 - k6 - i5 - 1, l1 + j4, Block.dirt.blockID);
|
||||
}
|
||||
j7 = 1;
|
||||
k6 = 0;
|
||||
flag2 = false;
|
||||
do
|
||||
{
|
||||
if(world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 1) || world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 3) || world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 4) || world.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 1) == Block.waterStill.blockID || world.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 3) == Block.waterStill.blockID || world.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 4) == Block.waterStill.blockID)
|
||||
{
|
||||
k6++;
|
||||
} else
|
||||
{
|
||||
flag2 = true;
|
||||
}
|
||||
} while(!flag2 && j7++ < 12);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 1, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 2, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 2, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 3, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 3, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 4, Block.cobblestone.blockID);
|
||||
world.setBlock(j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 4, Block.cobblestoneMossy.blockID);
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6, l1 + k3 + 5, Block.cobblestoneMossy.blockID);
|
||||
i8 = random.nextInt(100);
|
||||
if(i8 <= 30)
|
||||
{
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3, Block.chest.blockID);
|
||||
TileEntityChest chest = (TileEntityChest) world.getBlockTileEntity(j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3);
|
||||
Random rand = new Random();
|
||||
for(int slot = 0; slot < chest.getSizeInventory(); slot++)
|
||||
{
|
||||
int num = rand.nextInt(16);
|
||||
|
||||
if(num == 1)
|
||||
{
|
||||
chest.setInventorySlotContents(slot, new ItemStack(Item.enderPearl, 4, 0));
|
||||
}
|
||||
|
||||
if(num == 2)
|
||||
{
|
||||
chest.setInventorySlotContents(slot, new ItemStack(Item.diamond, 1, 0));
|
||||
}
|
||||
|
||||
if(num == 3)
|
||||
{
|
||||
chest.setInventorySlotContents(slot, new ItemStack(Item.emerald, 1, 0));
|
||||
}
|
||||
|
||||
if(num == 4)
|
||||
{
|
||||
chest.setInventorySlotContents(slot, new ItemStack(Item.appleGold, 1, 0));
|
||||
}
|
||||
|
||||
if(num == 5)
|
||||
{
|
||||
chest.setInventorySlotContents(slot, new ItemStack(Item.ingotGold, 1, 0));
|
||||
}
|
||||
|
||||
if(num == 6)
|
||||
{
|
||||
chest.setInventorySlotContents(slot, new ItemStack(Item.ingotIron, 1, 0));
|
||||
}
|
||||
}
|
||||
world.setBlock(j1 - 3, k1 - l5 - k6 - i5 - 1, l1 + k3 + 3, Block.dirt.blockID);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
31
common/MysticRuins/WorldGenMysticDungeon.java
Normal file
31
common/MysticRuins/WorldGenMysticDungeon.java
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package MysticRuins;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenMysticDungeon implements IWorldGenerator
|
||||
{
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
||||
{
|
||||
for (int i = 0; i < Config.DunRarity; i++)
|
||||
{
|
||||
int Xcoord1 = blockX + random.nextInt(16) + 8;
|
||||
int Ycoord1 = random.nextInt(9) + 28;
|
||||
int Zcoord1 = blockZ + random.nextInt(16) + 8;
|
||||
|
||||
(new StructureMysticDungeon()).generate(world, random, Xcoord1, Ycoord1, Zcoord1);
|
||||
}
|
||||
}
|
||||
}
|
||||
31
common/MysticRuins/WorldGenRuin$1.java
Normal file
31
common/MysticRuins/WorldGenRuin$1.java
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package MysticRuins;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenRuin$1 implements IWorldGenerator
|
||||
{
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
||||
{
|
||||
for (int i = 0; i < Config.RuinRarity; i++)
|
||||
{
|
||||
int Xcoord1 = blockX + random.nextInt(16) + 8;
|
||||
int Ycoord1 = random.nextInt(11) + 60;
|
||||
int Zcoord1 = blockZ + random.nextInt(16) + 8;
|
||||
|
||||
(new StructureRuin$1()).generate(world, random, Xcoord1, Ycoord1, Zcoord1);
|
||||
}
|
||||
}
|
||||
}
|
||||
31
common/MysticRuins/WorldGenRuin.java
Normal file
31
common/MysticRuins/WorldGenRuin.java
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package MysticRuins;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenRuin implements IWorldGenerator
|
||||
{
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
||||
{
|
||||
for (int i = 0; i < Config.RuinRarity; i++)
|
||||
{
|
||||
int Xcoord1 = blockX + random.nextInt(16) + 8;
|
||||
int Ycoord1 = random.nextInt(11) + 60;
|
||||
int Zcoord1 = blockZ + random.nextInt(16) + 8;
|
||||
|
||||
(new StructureRuin()).generate(world, random, Xcoord1, Ycoord1, Zcoord1);
|
||||
}
|
||||
}
|
||||
}
|
||||
88
common/MysticStones/BlockPlanks.java
Normal file
88
common/MysticStones/BlockPlanks.java
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
package MysticStones;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.ModMetadata;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockPlanks extends Block {
|
||||
|
||||
Icon[] textures;
|
||||
|
||||
public BlockPlanks(int ID) {
|
||||
super(ID, Material.wood);
|
||||
setHardness(2F);
|
||||
setResistance(5F);
|
||||
setCreativeTab(MysticStones.MysticStonesTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int j)
|
||||
{
|
||||
return j;
|
||||
}
|
||||
|
||||
public ItemStack getPickBlock(MovingObjectPosition target,World world, int x, int y, int z)
|
||||
{
|
||||
int id = idPicked(world, x, y, z);
|
||||
|
||||
if (id == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Item item = Item.itemsList[id];
|
||||
if (item == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new ItemStack(id, 1, getDamageValue(world, x, y, z));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
textures = new Icon[16];
|
||||
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
textures[i] = iconRegister.registerIcon("MysticTextures" + ":" + "Planks_" + i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int side, int meta)
|
||||
{
|
||||
return textures[meta];
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void getSubBlocks(int i,CreativeTabs tab, List list)
|
||||
{
|
||||
list.add(new ItemStack(i,1,0));
|
||||
list.add(new ItemStack(i,1,1));
|
||||
list.add(new ItemStack(i,1,2));
|
||||
list.add(new ItemStack(i,1,3));
|
||||
list.add(new ItemStack(i,1,4));
|
||||
list.add(new ItemStack(i,1,5));
|
||||
list.add(new ItemStack(i,1,6));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
86
common/MysticStones/BlockReinforced.java
Normal file
86
common/MysticStones/BlockReinforced.java
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
package MysticStones;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.ModMetadata;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockReinforced extends Block {
|
||||
|
||||
Icon[] textures;
|
||||
|
||||
public BlockReinforced(int ID) {
|
||||
super(ID, Material.iron);
|
||||
setHardness(4F);
|
||||
setResistance(2000F);
|
||||
setCreativeTab(MysticStones.MysticStonesTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int j)
|
||||
{
|
||||
return j;
|
||||
}
|
||||
|
||||
public boolean isBeaconBase(World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ)
|
||||
{
|
||||
return (true);
|
||||
}
|
||||
|
||||
public ItemStack getPickBlock(MovingObjectPosition target,World world, int x, int y, int z)
|
||||
{
|
||||
int id = idPicked(world, x, y, z);
|
||||
|
||||
if (id == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Item item = Item.itemsList[id];
|
||||
if (item == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new ItemStack(id, 1, getDamageValue(world, x, y, z));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
textures = new Icon[16];
|
||||
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
textures[i] = iconRegister.registerIcon("MysticTextures" + ":" + "ReinforcedBricks_" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int side, int meta)
|
||||
{
|
||||
return textures[meta];
|
||||
}
|
||||
|
||||
|
||||
public void getSubBlocks(int i,CreativeTabs tab, List list)
|
||||
{
|
||||
for(int k=0;k<8;k++)
|
||||
{
|
||||
list.add(new ItemStack(i,1,k));
|
||||
}
|
||||
}
|
||||
}
|
||||
84
common/MysticStones/BlockStoneBricks.java
Normal file
84
common/MysticStones/BlockStoneBricks.java
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
package MysticStones;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.ModMetadata;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockStoneBricks extends Block {
|
||||
|
||||
Icon[] textures;
|
||||
|
||||
public BlockStoneBricks(int ID) {
|
||||
super(ID, Material.rock);
|
||||
setHardness(2F);
|
||||
setResistance(5F);
|
||||
setCreativeTab(MysticStones.MysticStonesTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int j)
|
||||
{
|
||||
return j;
|
||||
}
|
||||
|
||||
public ItemStack getPickBlock(MovingObjectPosition target,World world, int x, int y, int z)
|
||||
{
|
||||
int id = idPicked(world, x, y, z);
|
||||
|
||||
if (id == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Item item = Item.itemsList[id];
|
||||
if (item == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new ItemStack(id, 1, getDamageValue(world, x, y, z));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
textures = new Icon[16];
|
||||
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
textures[i] = iconRegister.registerIcon("MysticTextures" + ":" + "Bricks_" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int side, int meta)
|
||||
{
|
||||
return textures[meta];
|
||||
}
|
||||
|
||||
public void getSubBlocks(int i,CreativeTabs tab, List list)
|
||||
{
|
||||
list.add(new ItemStack(i,1,0));
|
||||
list.add(new ItemStack(i,1,1));
|
||||
list.add(new ItemStack(i,1,2));
|
||||
list.add(new ItemStack(i,1,3));
|
||||
list.add(new ItemStack(i,1,4));
|
||||
list.add(new ItemStack(i,1,5));
|
||||
list.add(new ItemStack(i,1,6));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
93
common/MysticStones/BlockStones.java
Normal file
93
common/MysticStones/BlockStones.java
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
package MysticStones;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.ModMetadata;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockStones extends Block {
|
||||
|
||||
Icon[] textures;
|
||||
|
||||
public BlockStones(int ID) {
|
||||
super(ID, Material.rock);
|
||||
setHardness(1F);
|
||||
setResistance(5F);
|
||||
setCreativeTab(MysticStones.MysticStonesTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int j)
|
||||
{
|
||||
switch(j)
|
||||
{
|
||||
case 0:return 1;
|
||||
case 2:return 3;
|
||||
case 4:return 5;
|
||||
case 6:return 7;
|
||||
case 8:return 9;
|
||||
case 10:return 11;
|
||||
case 12:return 13;
|
||||
default:return j;
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean canSilkHarvest()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||
{
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
return new ItemStack(this, 1, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
textures = new Icon[16];
|
||||
|
||||
for (int i = 0; i < 14; i++)
|
||||
{
|
||||
textures[i] = iconRegister.registerIcon("MysticTextures" + ":" + "Stones_" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int side, int meta)
|
||||
{
|
||||
return textures[meta];
|
||||
}
|
||||
|
||||
public void getSubBlocks(int i,CreativeTabs tab, List list)
|
||||
{
|
||||
list.add(new ItemStack(i,1,0));
|
||||
list.add(new ItemStack(i,1,1));
|
||||
list.add(new ItemStack(i,1,2));
|
||||
list.add(new ItemStack(i,1,3));
|
||||
list.add(new ItemStack(i,1,4));
|
||||
list.add(new ItemStack(i,1,5));
|
||||
list.add(new ItemStack(i,1,6));
|
||||
list.add(new ItemStack(i,1,7));
|
||||
list.add(new ItemStack(i,1,8));
|
||||
list.add(new ItemStack(i,1,9));
|
||||
list.add(new ItemStack(i,1,10));
|
||||
list.add(new ItemStack(i,1,11));
|
||||
list.add(new ItemStack(i,1,12));
|
||||
list.add(new ItemStack(i,1,13));
|
||||
}
|
||||
}
|
||||
35
common/MysticStones/Config.java
Normal file
35
common/MysticStones/Config.java
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
package MysticStones;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import net.minecraftforge.common.Configuration;
|
||||
|
||||
public class Config
|
||||
{
|
||||
public static Configuration config;
|
||||
|
||||
public static int PlanksID;
|
||||
public static int StonesID;
|
||||
public static int StoneBricksID;
|
||||
public static int ReinforcedBricksID;
|
||||
|
||||
public static boolean Rare;
|
||||
|
||||
public static void initialize(File file)
|
||||
{
|
||||
config = new Configuration(file);
|
||||
|
||||
PlanksID = config.getBlock("Plank IDs", 509).getInt();
|
||||
StonesID = config.getBlock("Stone IDs", 510).getInt();
|
||||
StoneBricksID = config.getBlock("Stone Brick IDs", 511).getInt();
|
||||
ReinforcedBricksID = config.getBlock("Reinforced Brick IDs", 512).getInt();
|
||||
Rare = config.get("General", "Increase the Rarity of Stones?", false).getBoolean(Rare);
|
||||
|
||||
config.save();
|
||||
}
|
||||
|
||||
public static void save()
|
||||
{
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
44
common/MysticStones/ItemBlockPlanks.java
Normal file
44
common/MysticStones/ItemBlockPlanks.java
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
package MysticStones;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
|
||||
public class ItemBlockPlanks extends ItemBlock {
|
||||
|
||||
public ItemBlockPlanks(int par1) {
|
||||
super(par1);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack i){
|
||||
switch(i.getItemDamage()){
|
||||
case 0:return "BlackPlank";
|
||||
case 1:return "RedPlank";
|
||||
case 2:return "GreenPlank";
|
||||
case 3:return "PurplePlank";
|
||||
case 4:return "BluePlank";
|
||||
case 5:return "LimePlank";
|
||||
case 6:return "YellowPlank";
|
||||
default:return "";
|
||||
}
|
||||
}
|
||||
|
||||
public int getMetadata(int par1)
|
||||
{
|
||||
return par1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int par1)
|
||||
{
|
||||
return MysticStones.Planks.getIcon(2, par1);
|
||||
}
|
||||
|
||||
}
|
||||
56
common/MysticStones/ItemBlockReinforced.java
Normal file
56
common/MysticStones/ItemBlockReinforced.java
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
package MysticStones;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
|
||||
public class ItemBlockReinforced extends ItemBlock {
|
||||
|
||||
public ItemBlockReinforced(int par1) {
|
||||
super(par1);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack i){
|
||||
switch(i.getItemDamage()){
|
||||
case 0:return "MithrilBricks";
|
||||
case 1:return "VerditeBricks";
|
||||
case 2:return "IridiumBricks";
|
||||
case 3:return "AdamantineBricks";
|
||||
case 4:return "TourmalineBricks";
|
||||
case 5:return "TopazBricks";
|
||||
case 6:return "AmethystBricks";
|
||||
case 7:return "AgateBricks";
|
||||
default:return "";
|
||||
}
|
||||
}
|
||||
|
||||
public int getMetadata(int par1)
|
||||
{
|
||||
return par1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
if(par2EntityPlayer.isSneaking() == false)
|
||||
{
|
||||
par3List.add("Works As A Beacon Block Too!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int par1)
|
||||
{
|
||||
return MysticStones.ReinforcedBricks.getIcon(2, par1);
|
||||
}
|
||||
|
||||
}
|
||||
46
common/MysticStones/ItemBlockStoneBricks.java
Normal file
46
common/MysticStones/ItemBlockStoneBricks.java
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
package MysticStones;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
|
||||
public class ItemBlockStoneBricks extends ItemBlock {
|
||||
|
||||
public ItemBlockStoneBricks(int par1) {
|
||||
super(par1);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack i){
|
||||
switch(i.getItemDamage()){
|
||||
case 0:return "AnorthositeBricks";
|
||||
case 1:return "LimestoneBricks";
|
||||
case 2:return "MarbleBricks";
|
||||
case 3:return "MigmatiteBricks";
|
||||
case 4:return "OrthogneissBricks";
|
||||
case 5:return "SlateBricks";
|
||||
case 6:return "TravertineBricks";
|
||||
default:return "";
|
||||
}
|
||||
}
|
||||
|
||||
public int getMetadata(int par1)
|
||||
{
|
||||
return par1;
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int par1)
|
||||
{
|
||||
return MysticStones.StoneBricks.getIcon(2, par1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
51
common/MysticStones/ItemBlockStones.java
Normal file
51
common/MysticStones/ItemBlockStones.java
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
package MysticStones;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
|
||||
public class ItemBlockStones extends ItemBlock {
|
||||
|
||||
public ItemBlockStones(int par1) {
|
||||
super(par1);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack i){
|
||||
switch(i.getItemDamage()){
|
||||
case 0:return "AnorthositeSmooth";
|
||||
case 1:return "Anorthosite";
|
||||
case 2:return "LimestoneSmooth";
|
||||
case 3:return "Limestone";
|
||||
case 4:return "MarbleSmooth";
|
||||
case 5:return "Marble";
|
||||
case 6:return "MigmatiteSmooth";
|
||||
case 7:return "Migmatite";
|
||||
case 8:return "OrthogneissSmooth";
|
||||
case 9:return "Orthogneiss";
|
||||
case 10:return "SlateSmooth";
|
||||
case 11:return "Slate";
|
||||
case 12:return "TravertineSmooth";
|
||||
case 13:return "Travertine";
|
||||
default:return "";
|
||||
}
|
||||
}
|
||||
|
||||
public int getMetadata(int par1)
|
||||
{
|
||||
return par1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int par1)
|
||||
{
|
||||
return MysticStones.Stones.getIcon(2, par1);
|
||||
}
|
||||
|
||||
}
|
||||
123
common/MysticStones/MysticStones.java
Normal file
123
common/MysticStones/MysticStones.java
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
package MysticStones;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.DungeonHooks;
|
||||
import net.minecraftforge.common.EnumHelper;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.Init;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.Mod.PostInit;
|
||||
import cpw.mods.fml.common.Mod.PreInit;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.network.NetworkMod;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
|
||||
@Mod(modid = "Mystic Stones", name = "Mystic Stones", version = "0.1")
|
||||
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
|
||||
|
||||
public class MysticStones
|
||||
{
|
||||
public static Block Planks;
|
||||
public static Block Stones;
|
||||
public static Block StoneBricks;
|
||||
public static Block ReinforcedBricks;
|
||||
|
||||
public static CreativeTabs MysticStonesTab = new TabMysticStones(CreativeTabs.getNextID(), "MysticStonesTab");
|
||||
|
||||
private Configuration config;
|
||||
|
||||
|
||||
@PreInit
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
Config.initialize(new File(event.getModConfigurationDirectory(), "Mystic Mods/Mystic Stones.cfg"));
|
||||
Config.save();
|
||||
}
|
||||
|
||||
@Init
|
||||
public void load(FMLInitializationEvent event)
|
||||
{
|
||||
|
||||
Planks = new BlockPlanks(Config.PlanksID).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("ColoredPlanks");
|
||||
Stones = new BlockStones(Config.StonesID).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("MysticStones");
|
||||
StoneBricks = new BlockStoneBricks(Config.StoneBricksID).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("MysticStoneBricks");
|
||||
ReinforcedBricks = new BlockReinforced(Config.ReinforcedBricksID).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("ReinforcedBricks");
|
||||
|
||||
GameRegistry.registerBlock(Planks, ItemBlockPlanks.class, "Planks");
|
||||
GameRegistry.registerBlock(Stones, ItemBlockStones.class, "Stones");
|
||||
GameRegistry.registerBlock(StoneBricks, ItemBlockStoneBricks.class, "StoneBricks");
|
||||
GameRegistry.registerBlock(ReinforcedBricks, ItemBlockReinforced.class, "Reinforcedbricks");
|
||||
|
||||
|
||||
RecipeHandler.CraftPlanks();
|
||||
RecipeHandler.CraftStoneBricks();
|
||||
RecipeHandler.CraftElse();
|
||||
RecipeHandler.CraftReinforced();
|
||||
|
||||
LanguageRegistry.instance().addName(new ItemStack(Stones, 1, 0), "Smooth Anorthosite");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Stones, 1, 1), "Anorthosite");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Stones, 1, 2), "Smooth Limestone");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Stones, 1, 3), "Limestone");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Stones, 1, 4), "Smooth Marble");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Stones, 1, 5), "Marble");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Stones, 1, 6), "Smooth Migmatite");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Stones, 1, 7), "Migmatite");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Stones, 1, 8), "Smooth Orthogneiss");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Stones, 1, 9), "Orthogneiss");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Stones, 1, 10), "Smooth Slate");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Stones, 1, 11), "Slate");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Stones, 1, 12), "Smooth Travertine");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Stones, 1, 13), "Travertine");
|
||||
LanguageRegistry.instance().addName(new ItemStack(StoneBricks, 1, 0), "Anorthosite Bricks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(StoneBricks, 1, 1), "Limestone Bricks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(StoneBricks, 1, 2), "Marble Bricks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(StoneBricks, 1, 3), "Migmatite Bricks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(StoneBricks, 1, 4), "Orthogneiss Bricks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(StoneBricks, 1, 5), "Slate Bricks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(StoneBricks, 1, 6), "Travertine Bricks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Planks, 1, 0), "Purple Planks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Planks, 1, 1), "Green Planks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Planks, 1, 2), "Black Planks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Planks, 1, 3), "Orange Planks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Planks, 1, 4), "Red Planks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Planks, 1, 5), "Blue Planks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(Planks, 1, 6), "Yellow Planks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(ReinforcedBricks, 1, 0), "Reinforced Mithril Bricks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(ReinforcedBricks, 1, 1), "Reinforced Verdite Bricks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(ReinforcedBricks, 1, 2), "Reinforced Iridium Bricks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(ReinforcedBricks, 1, 3), "Reinforced Adamantine Bricks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(ReinforcedBricks, 1, 4), "Reinforced Tourmaline Bricks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(ReinforcedBricks, 1, 5), "Reinforced Topaz Bricks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(ReinforcedBricks, 1, 6), "Reinforced Amethyst Bricks");
|
||||
LanguageRegistry.instance().addName(new ItemStack(ReinforcedBricks, 1, 7), "Reinforced Agate Bricks");
|
||||
|
||||
LanguageRegistry.instance().addStringLocalization("itemGroup.MysticStonesTab", "en_US", "Mystic Stones!");
|
||||
|
||||
GameRegistry.registerWorldGenerator(new WorldgenSmoothAnorthosite());
|
||||
GameRegistry.registerWorldGenerator(new WorldgenSmoothLimestone());
|
||||
GameRegistry.registerWorldGenerator(new WorldgenSmoothMarble());
|
||||
GameRegistry.registerWorldGenerator(new WorldgenSmoothMigmatite());
|
||||
GameRegistry.registerWorldGenerator(new WorldgenSmoothOrthogneiss());
|
||||
GameRegistry.registerWorldGenerator(new WorldgenSmoothSlate());
|
||||
GameRegistry.registerWorldGenerator(new WorldgenSmoothTravertine());
|
||||
|
||||
}
|
||||
@PostInit
|
||||
public void postInit(FMLPostInitializationEvent event)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
179
common/MysticStones/RecipeHandler.java
Normal file
179
common/MysticStones/RecipeHandler.java
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
package MysticStones;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class RecipeHandler
|
||||
{
|
||||
public static void CraftPlanks()
|
||||
{
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 0),
|
||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 0)}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 0),
|
||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 1)}));
|
||||
|
||||
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 1),
|
||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 2)}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 1),
|
||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 3)}));
|
||||
|
||||
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 2),
|
||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 4)}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 2),
|
||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 5)}));
|
||||
|
||||
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 3),
|
||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 6)}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 3),
|
||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 7)}));
|
||||
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 4),
|
||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 8)}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 4),
|
||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 9)}));
|
||||
|
||||
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 5),
|
||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 10)}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 5),
|
||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 11)}));
|
||||
|
||||
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 6),
|
||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 12)}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(MysticStones.Planks, 1, 6),
|
||||
new Object[]{"plankWood", new ItemStack(MysticStones.Stones, 1, 13)}));
|
||||
}
|
||||
|
||||
public static void CraftReinforced()
|
||||
{
|
||||
if(Loader.isModLoaded("MysticOres"))
|
||||
{
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 0), new Object[] {
|
||||
"X#X", "###", "X#X", Character.valueOf('#'), "ingotMithril", Character.valueOf('X'), Block.stone}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 1), new Object[] {
|
||||
"X#X", "###", "X#X", Character.valueOf('#'), "ingotVerdite", Character.valueOf('X'), Block.stone}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 2), new Object[] {
|
||||
"X#X", "###", "X#X", Character.valueOf('#'), "ingotIridium", Character.valueOf('X'), Block.stone}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 3), new Object[] {
|
||||
"X#X", "###", "X#X", Character.valueOf('#'), "ingotAdamantine", Character.valueOf('X'), Block.stone}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 4), new Object[] {
|
||||
"X#X", "###", "X#X", Character.valueOf('#'), "gemTourmaline", Character.valueOf('X'), Block.stone}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 5), new Object[] {
|
||||
"X#X", "###", "X#X", Character.valueOf('#'), "gemTopaz", Character.valueOf('X'), Block.stone}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 6), new Object[] {
|
||||
"X#X", "###", "X#X", Character.valueOf('#'), "gemAmethyst", Character.valueOf('X'), Block.stone}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 7), new Object[] {
|
||||
"X#X", "###", "X#X", Character.valueOf('#'), "gemAgate", Character.valueOf('X'), Block.stone}));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void CraftStoneBricks()
|
||||
{
|
||||
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 0), new Object[] {
|
||||
"##", "##", '#', new ItemStack(MysticStones.Stones, 1, 0)
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 1), new Object[] {
|
||||
"##", "##", '#', new ItemStack(MysticStones.Stones, 1, 2)
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 2), new Object[] {
|
||||
"##", "##", '#', new ItemStack(MysticStones.Stones, 1, 4)
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 3), new Object[] {
|
||||
"##", "##", '#', new ItemStack(MysticStones.Stones, 1, 6)
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 4), new Object[] {
|
||||
"##", "##", '#', new ItemStack(MysticStones.Stones, 1, 8)
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 5), new Object[] {
|
||||
"##", "##", '#', new ItemStack(MysticStones.Stones, 1, 10)
|
||||
});
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(MysticStones.StoneBricks, 4, 6), new Object[] {
|
||||
"##", "##", '#', new ItemStack(MysticStones.Stones, 1, 12)
|
||||
});
|
||||
}
|
||||
|
||||
public static void CraftElse()
|
||||
{
|
||||
|
||||
if(Loader.isModLoaded("Mystic Ores") == true)
|
||||
{
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 0),
|
||||
true, new Object[]{"#$#", "$$$", "#$#", '$', "ingotMithril", '#', Block.stone}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 1),
|
||||
true, new Object[]{"#$#", "$$$", "#$#", '$', "ingotVerdite", '#', Block.stone}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 2),
|
||||
true, new Object[]{"#$#", "$$$", "#$#", '$', "ingotIridium", '#', Block.stone}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 3),
|
||||
true, new Object[]{"#$#", "$$$", "#$#", '$', "ingotAdamantine", '#', Block.stone}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 4),
|
||||
true, new Object[]{"#$#", "$$$", "#$#", '$', "gemTourmaline", '#', Block.stone}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 5),
|
||||
true, new Object[]{"#$#", "$$$", "#$#", '$', "gemTopaz", '#', Block.stone}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 6),
|
||||
true, new Object[]{"#$#", "$$$", "#$#", '$', "gemAmethyst", '#', Block.stone}));
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MysticStones.ReinforcedBricks, 1, 7),
|
||||
true, new Object[]{"#$#", "$$$", "#$#", '$', "gemAgate", '#', Block.stone}));
|
||||
}
|
||||
|
||||
//smelting
|
||||
FurnaceRecipes.smelting().addSmelting(MysticStones.Stones.blockID, 1, new ItemStack(MysticStones.Stones, 1, 0), 0.1F);
|
||||
FurnaceRecipes.smelting().addSmelting(MysticStones.Stones.blockID, 3, new ItemStack(MysticStones.Stones, 1, 2), 0.1F);
|
||||
FurnaceRecipes.smelting().addSmelting(MysticStones.Stones.blockID, 5, new ItemStack(MysticStones.Stones, 1, 4), 0.1F);
|
||||
FurnaceRecipes.smelting().addSmelting(MysticStones.Stones.blockID, 7, new ItemStack(MysticStones.Stones, 1, 6), 0.1F);
|
||||
FurnaceRecipes.smelting().addSmelting(MysticStones.Stones.blockID, 9, new ItemStack(MysticStones.Stones, 1, 8), 0.1F);
|
||||
FurnaceRecipes.smelting().addSmelting(MysticStones.Stones.blockID, 11, new ItemStack(MysticStones.Stones, 1, 10), 0.1F);
|
||||
FurnaceRecipes.smelting().addSmelting(MysticStones.Stones.blockID, 13, new ItemStack(MysticStones.Stones, 1, 12), 0.1F);
|
||||
|
||||
for (int i=0;i<7;i++)
|
||||
{
|
||||
OreDictionary.registerOre("plankWood", new ItemStack(MysticStones.Planks, 1, i));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
19
common/MysticStones/TabMysticStones.java
Normal file
19
common/MysticStones/TabMysticStones.java
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package MysticStones;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TabMysticStones extends CreativeTabs {
|
||||
|
||||
public TabMysticStones(int par1, String par2Str) {
|
||||
super(par1, par2Str);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getIconItemStack() {
|
||||
return new ItemStack(MysticStones.ReinforcedBricks, 1, 4);
|
||||
}
|
||||
|
||||
}
|
||||
47
common/MysticStones/WorldgenSmoothAnorthosite.java
Normal file
47
common/MysticStones/WorldgenSmoothAnorthosite.java
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
package MysticStones;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldgenSmoothAnorthosite implements IWorldGenerator
|
||||
{
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
||||
{
|
||||
if(Config.Rare == false){
|
||||
for(int i=0; i<3; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(40) + 20;
|
||||
int Zcoord = blockZ + random.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(MysticStones.Stones.blockID, 0, 24, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
|
||||
if(Config.Rare == true){
|
||||
for(int i=0; i<2; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(40) + 20;
|
||||
int Zcoord = blockZ + random.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(MysticStones.Stones.blockID, 0, 24, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
50
common/MysticStones/WorldgenSmoothLimestone.java
Normal file
50
common/MysticStones/WorldgenSmoothLimestone.java
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
package MysticStones;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldgenSmoothLimestone implements IWorldGenerator
|
||||
{
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
||||
{
|
||||
if(Config.Rare == false){
|
||||
for(int i=0; i<3; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(40) + 20;
|
||||
int Zcoord = blockZ + random.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(MysticStones.Stones.blockID, 2, 48, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
|
||||
if(Config.Rare == true){
|
||||
for(int i=0; i<2; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(40) + 20;
|
||||
int Zcoord = blockZ + random.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(MysticStones.Stones.blockID, 2, 48, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
48
common/MysticStones/WorldgenSmoothMarble.java
Normal file
48
common/MysticStones/WorldgenSmoothMarble.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
package MysticStones;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldgenSmoothMarble implements IWorldGenerator
|
||||
{
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
||||
{
|
||||
if(Config.Rare == false){
|
||||
for(int i=0; i<3; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(40) + 20;
|
||||
int Zcoord = blockZ + random.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(MysticStones.Stones.blockID, 4, 24, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
|
||||
if(Config.Rare == true){
|
||||
for(int i=0; i<2; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(40) + 20;
|
||||
int Zcoord = blockZ + random.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(MysticStones.Stones.blockID, 4, 24, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
48
common/MysticStones/WorldgenSmoothMigmatite.java
Normal file
48
common/MysticStones/WorldgenSmoothMigmatite.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
package MysticStones;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldgenSmoothMigmatite implements IWorldGenerator
|
||||
{
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
||||
{
|
||||
if(Config.Rare == false){
|
||||
for(int i=0; i<3; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(40) + 20;
|
||||
int Zcoord = blockZ + random.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(MysticStones.Stones.blockID, 6, 48, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
|
||||
if(Config.Rare == true){
|
||||
for(int i=0; i<2; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(40) + 20;
|
||||
int Zcoord = blockZ + random.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(MysticStones.Stones.blockID, 6, 24, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
48
common/MysticStones/WorldgenSmoothOrthogneiss.java
Normal file
48
common/MysticStones/WorldgenSmoothOrthogneiss.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
package MysticStones;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldgenSmoothOrthogneiss implements IWorldGenerator
|
||||
{
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
||||
{
|
||||
if(Config.Rare == false){
|
||||
for(int i=0; i<3; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(40) + 20;
|
||||
int Zcoord = blockZ + random.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(MysticStones.Stones.blockID, 8, 48, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
|
||||
if(Config.Rare == true){
|
||||
for(int i=0; i<2; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(40) + 20;
|
||||
int Zcoord = blockZ + random.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(MysticStones.Stones.blockID, 8, 24, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
48
common/MysticStones/WorldgenSmoothSlate.java
Normal file
48
common/MysticStones/WorldgenSmoothSlate.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
package MysticStones;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldgenSmoothSlate implements IWorldGenerator
|
||||
{
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
||||
{
|
||||
if(Config.Rare == false){
|
||||
for(int i=0; i<3; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(40) + 20;
|
||||
int Zcoord = blockZ + random.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(MysticStones.Stones.blockID, 10, 24, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
|
||||
if(Config.Rare == true){
|
||||
for(int i=0; i<2; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(40) + 20;
|
||||
int Zcoord = blockZ + random.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(MysticStones.Stones.blockID, 10, 24, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
48
common/MysticStones/WorldgenSmoothTravertine.java
Normal file
48
common/MysticStones/WorldgenSmoothTravertine.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
package MysticStones;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldgenSmoothTravertine implements IWorldGenerator
|
||||
{
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
switch (world.provider.dimensionId)
|
||||
{
|
||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
||||
{
|
||||
if(Config.Rare == false){
|
||||
for(int i=0; i<3; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(40) + 20;
|
||||
int Zcoord = blockZ + random.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(MysticStones.Stones.blockID, 12, 24, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
|
||||
if(Config.Rare == true){
|
||||
for(int i=0; i<2; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(40) + 20;
|
||||
int Zcoord = blockZ + random.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(MysticStones.Stones.blockID, 12, 24, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
106
common/thaumcraft/api/EnumTag.java
Normal file
106
common/thaumcraft/api/EnumTag.java
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
package thaumcraft.api;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public enum EnumTag {
|
||||
UNKNOWN (63,"Obscurus","Unknown, Obscured",1,false,0x282828),
|
||||
|
||||
WIND (0,"Aura","Air, Wind, Breath, Movement",1,false,0xc0c0d7),
|
||||
FIRE (6,"Ignis","Fire, Heat, Burn, Light",2,true,0xff5a01),
|
||||
ROCK (11,"Saxum","Earth, Stone, Ground, Foundation",4,false,0x5c4842),
|
||||
WATER (21,"Aqua","Water, Fluid, Cold",3,false,0x3cd4fc),
|
||||
|
||||
PLANT (36,"Herba","Herb, Plant, Grass",4,false,0x01ac00),
|
||||
BEAST (53,"Bestia","Animal, Beast",3,true,0x9f6409),
|
||||
FLESH (54,"Corpus","Body, Flesh, Physique",3,false,0xee478d),
|
||||
METAL (12,"Metallum","Metal, Mine, Ore",4,false,0xd8d8d8),
|
||||
CRYSTAL (20,"Vitreus","Glass, Crystal, Gem, Transparent",1,false,0x80ffff),
|
||||
SOUND (24,"Sonus","Sound, Noise, Din",3,false,0x10c9c0),
|
||||
|
||||
EXCHANGE (14,"Permutatio","Exchange, Change, Barter",4,false,0x578357),
|
||||
LIFE (26,"Victus","Life force, Food, Sustenance",3,false,0xde0005),
|
||||
DEATH (27,"Mortuus","Death, Decay, Undead",6,true,0x404040),
|
||||
SPIRIT (30,"Animus","Soul, Spirit",1,false,0xe0e0e0),
|
||||
VOID (2,"Vacuos","Empty, Void, Insubstantial",1,true,0xc0c0d7),
|
||||
VISION (3,"Visum","Sight, Vision, Appearance",3,false,0xd5d4ec),
|
||||
KNOWLEDGE (4,"Cognitio","Learning, Knowledge, Inquiry",1,false,0x8080ee),
|
||||
DESTRUCTION (7,"Fractus","Destruction, Fragmented, Shattered",2,true,0x506050),
|
||||
POWER (9,"Potentia","Power, Energy, Strength",2,true,0xc0ffff),
|
||||
MECHANISM (10,"Machina","Mechanism, Machine, Device",2,false,0x8080a0),
|
||||
ARMOR (17,"Tutamen","Defense, Protection, Security",4,false,0x00c0c0),
|
||||
WEAPON (18,"Telum","Arrow, Sword, Weapon",2,true,0xc05050),
|
||||
TOOL (19,"Instrumentum","Instrument, Tool, Implement",4,false,0x4040ee),
|
||||
POISON (29,"Venenum","Poison, Drug, Impure",3,true,0x89f000),
|
||||
VALUABLE (31,"Carus","Expensive, Precious, Valuable",4,false,0xe6be44),
|
||||
PURE (37,"Purus","Pure, Clean, Stainless",3,false,0xa5fffd),
|
||||
MAGIC (40,"Praecantatio","Magic, Sorcery",5,false,0x9700c0),
|
||||
TIME (41,"Tempus","Time, Moment, Season",5,false,0x9070e0),
|
||||
CONTROL (48,"Imperito","Control, Command, Dominate",5,false,0x98994b),
|
||||
DARK (49,"Tenebris","Dark, Night, Blindness",5,true,0x252525),
|
||||
CRAFT (50,"Fabrico","Create, Construct, Work",2,false,0x809d80),
|
||||
EVIL (56,"Malum","Evil, The Nether, Malice",5,true,0x700000),
|
||||
FLUX (57,"Mutatio","Flux, Chaos",5,true,0xb80bb9),
|
||||
ELDRITCH (58,"Alienis","Eldritch, The End, Strange, Alien",5,true,0x805080),
|
||||
|
||||
|
||||
//TOREMOVE
|
||||
TRAP (28,"Vinculum","Bind, Imprison, Trap",4,true,0x9a8080),
|
||||
INSECT (55,"Bestiola","Spider, Web, Insects",3,false,0x808880),
|
||||
MOTION (1,"Motus","Motion, Movement, Speed",1,false,0xcdccf4),
|
||||
FLIGHT (5,"Volito","Flight, Leap",1,false,0xe7e7d7),
|
||||
LIGHT (8,"Lux","Light, Brightness, Day",2,false,0xfff663),
|
||||
CLOTH (15,"Pannus","Cloth, Fabric, Garment, Thread",3,false,0xeaeac2),
|
||||
EARTH (16,"Solum","Earth, Soil, Ground, Foundation",4,false,0x713f2d),
|
||||
WEATHER (22,"Aer","Weather, Mist, Climate",3,false,0xc0ffff),
|
||||
COLD (23,"Gelum","Cold, Ice, Frost",3,true,0xe1ffff),
|
||||
HEAL (25,"Sano","Heal, Repair, Make Sound",3,false, 0xff8184),
|
||||
WOOD (32,"Lignum","Wood, Forest, Tree",4,false,0x058105),
|
||||
FLOWER (33,"Flos","Flower, Bloom, Blossom",4,false,0xffff40),
|
||||
FUNGUS (34,"Fungus","Mushroom, Toadstool, Fungi",4,false,0xf7e5c7),
|
||||
CROP (35,"Messis","Crops, Harvest",4,false,0xe3ff80),
|
||||
;
|
||||
|
||||
// Attributes
|
||||
public final int id;
|
||||
public final String name;
|
||||
public final String meaning;
|
||||
|
||||
/**
|
||||
* rough categories for the aspect types. Mostly just used to determine the common aspect type in certain biomes.
|
||||
*/
|
||||
public final int element; //1-air, 2-fire, 3-water, 4-earth, 5-mystical, 6-dead/aggressive, 999-deprecated
|
||||
|
||||
/**
|
||||
* will wisps spawned from this fluxtype be aggressive?
|
||||
*/
|
||||
public final boolean aggro;
|
||||
|
||||
public final int color;
|
||||
|
||||
private EnumTag(int id, String name, String meaning, int element,boolean aggro, int color ) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.meaning = meaning;
|
||||
this.element = element;
|
||||
this.color = color;
|
||||
this.aggro = aggro;
|
||||
|
||||
}
|
||||
|
||||
// Lookup
|
||||
private static final Map<Integer,EnumTag> lookup = new HashMap<Integer,EnumTag>();
|
||||
|
||||
static { for(EnumTag s : EnumSet.allOf(EnumTag.class)) lookup.put(s.getId(), s); }
|
||||
|
||||
public int getId() { return id; }
|
||||
|
||||
public static EnumTag get(int id) {
|
||||
if (lookup.get(id)==null||lookup.get(id).element==999)
|
||||
return EnumTag.FLUX;
|
||||
else
|
||||
return lookup.get(id);
|
||||
}
|
||||
|
||||
}
|
||||
63
common/thaumcraft/api/IAspectSource.java
Normal file
63
common/thaumcraft/api/IAspectSource.java
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
package thaumcraft.api;
|
||||
|
||||
|
||||
/**
|
||||
* @author Azanor
|
||||
*
|
||||
* This interface is implemented by tile entites (or possibly anything else) like jars, alembics and the
|
||||
* crucible so that they can act as an essentia source for blocks like the infusion altar.
|
||||
*
|
||||
*/
|
||||
public interface IAspectSource {
|
||||
|
||||
/**
|
||||
* This method is used to add a certain amount of an aspect to the tile entity.
|
||||
* @param tag
|
||||
* @param amount
|
||||
* @return the amount of aspect left over that could not be added.
|
||||
*/
|
||||
public int addToSource(EnumTag tag, int amount);
|
||||
|
||||
/**
|
||||
* Removes a certain amount of a specific aspect from the tile entity
|
||||
* @param tag
|
||||
* @param amount
|
||||
* @return true if that amount of aspect was available and was removed
|
||||
*/
|
||||
public boolean takeFromSource(EnumTag tag, int amount);
|
||||
|
||||
/**
|
||||
* removes a bunch of different aspects and amounts from the tile entity.
|
||||
* @param ot the ObjectTags object that contains the aspects and their amounts.
|
||||
* @return true if all the aspects and their amounts were available and successfully removed
|
||||
*/
|
||||
public boolean takeFromSource(ObjectTags ot);
|
||||
|
||||
/**
|
||||
* Checks if the tile entity contains the listed amount (or more) of the aspect
|
||||
* @param tag
|
||||
* @param amount
|
||||
* @return
|
||||
*/
|
||||
public boolean doesSourceContainAmount(EnumTag tag,int amount);
|
||||
|
||||
/**
|
||||
* Checks if the tile entity contains all the listed aspects and their amounts
|
||||
* @param ot the ObjectTags object that contains the aspects and their amounts.
|
||||
* @return
|
||||
*/
|
||||
public boolean doesSourceContain(ObjectTags ot);
|
||||
|
||||
/**
|
||||
* Returns how much of the aspect this tile entity contains
|
||||
* @param tag
|
||||
* @return the amount of that aspect found
|
||||
*/
|
||||
public int sourceContains(EnumTag tag);
|
||||
|
||||
/**
|
||||
* Returns all the aspects and their amounts that this tile entity contains
|
||||
* @return
|
||||
*/
|
||||
public ObjectTags getSourceTags();
|
||||
}
|
||||
15
common/thaumcraft/api/IVisDiscounter.java
Normal file
15
common/thaumcraft/api/IVisDiscounter.java
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
package thaumcraft.api;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author Azanor
|
||||
* ItemArmor with this interface will grant a discount to the vis cost of actions the wearer performs with casting wands.
|
||||
* The amount returned is the percentage by which the cost is discounted. There is a built-int max discount of 50%, but
|
||||
* individual items really shouldn't have a discount more than 5%
|
||||
*/
|
||||
public interface IVisDiscounter {
|
||||
|
||||
int getVisDiscount();
|
||||
|
||||
}
|
||||
27
common/thaumcraft/api/IVisRepairable.java
Normal file
27
common/thaumcraft/api/IVisRepairable.java
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package thaumcraft.api;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
||||
/**
|
||||
* @author Azanor
|
||||
* Items and tools with this interface can receive the Repair enchantment.
|
||||
* Armor, weapons and tools are handled automatically.
|
||||
* Usually 1 vis equals 1 point of durability every 2 seconds (1 second for repair II)
|
||||
* Repair enchant values over II also grants a reduction in speed, but at a much
|
||||
* reduced rate (about 2 ticks per rating over II)
|
||||
* Some sample code:<p>
|
||||
* <i>
|
||||
* public void doRepair(ItemStack is, Entity e) {<br>
|
||||
* if (AuraManager.decreaseClosestAura(e.worldObj,e.posX, e.posY, e.posZ, 1)) {<br>
|
||||
* is.damageItem(-1,(EntityLiving) e);<br>
|
||||
* }<br>
|
||||
* }<br><br>
|
||||
*</i>
|
||||
*/
|
||||
public interface IVisRepairable {
|
||||
|
||||
void doRepair(ItemStack stack, Entity e);
|
||||
|
||||
}
|
||||
58
common/thaumcraft/api/ItemApi.java
Normal file
58
common/thaumcraft/api/ItemApi.java
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
package thaumcraft.api;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
|
||||
/**
|
||||
* @author Azanor
|
||||
*
|
||||
* This is used to gain access to the items in my mod.
|
||||
* I only give some examples and it will probably still
|
||||
* require a bit of work for you to get hold of everything you need.
|
||||
*
|
||||
*/
|
||||
public class ItemApi {
|
||||
|
||||
public static ItemStack getItem(String itemString, int meta) {
|
||||
ItemStack item = null;
|
||||
|
||||
try {
|
||||
String itemClass = "thaumcraft.common.Config";
|
||||
Object obj = Class.forName(itemClass).getField(itemString).get(null);
|
||||
if (obj instanceof Item) {
|
||||
item = new ItemStack((Item) obj,1,meta);
|
||||
} else if (obj instanceof Block) {
|
||||
item = new ItemStack((Block) obj,1,meta);
|
||||
} else if (obj instanceof ItemStack) {
|
||||
item = (ItemStack) obj;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
FMLLog.warning("[Thaumcraft] Could not retrieve item or block identified by: " + itemString);
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Some examples
|
||||
*
|
||||
* Casting Wands:
|
||||
* itemWandCastingApprentice, itemWandCastingAdept, itemWandCastingMage
|
||||
*
|
||||
* Elemental Wands:
|
||||
* itemWandFire, itemWandLightning, itemWandFrost, itemWandTrade, itemWandExcavation, itemHellrod
|
||||
*
|
||||
* Resources:
|
||||
* itemEssence, itemWispEssence, itemResource, itemShard, itemNugget,
|
||||
* itemNuggetChicken, itemNuggetBeef, itemNuggetPork, itemTripleMeatTreat,
|
||||
* blockWooden, blockMarker
|
||||
*
|
||||
* Research:
|
||||
* itemResearchNotes, itemInkwell, itemThaumonomicon
|
||||
*
|
||||
*/
|
||||
|
||||
}
|
||||
171
common/thaumcraft/api/ObjectTags.java
Normal file
171
common/thaumcraft/api/ObjectTags.java
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
package thaumcraft.api;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ObjectTags implements Serializable {
|
||||
|
||||
public Map<EnumTag,Integer> tags = new HashMap<EnumTag,Integer>();//aspects associated with this object
|
||||
|
||||
|
||||
/**
|
||||
* this creates a new aspect list with preloaded values based off the aspects of the given item.
|
||||
* @param id the item/block id of an existing item
|
||||
* @param meta the damage value of an existing item
|
||||
*/
|
||||
public ObjectTags(int id, int meta) {
|
||||
ObjectTags temp = ThaumcraftApiHelper.getObjectTags(new ItemStack(id,1,meta));
|
||||
if (temp!=null)
|
||||
for (EnumTag tag:temp.getAspects()) {
|
||||
add(tag,temp.getAmount(tag));
|
||||
}
|
||||
}
|
||||
|
||||
public ObjectTags() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the amount of different aspects in this collection
|
||||
*/
|
||||
public int size() {
|
||||
return tags.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return an array of all the aspects in this collection
|
||||
*/
|
||||
public EnumTag[] getAspects() {
|
||||
EnumTag[] q = new EnumTag[1];
|
||||
return tags.keySet().toArray(q);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return an array of all the aspects in this collection sorted by name
|
||||
*/
|
||||
public EnumTag[] getAspectsSorted() {
|
||||
EnumTag[] out = tags.keySet().toArray(new EnumTag[1]);
|
||||
boolean change=false;
|
||||
do {
|
||||
change=false;
|
||||
for(int a=0;a<out.length-1;a++) {
|
||||
EnumTag e1 = out[a];
|
||||
EnumTag e2 = out[a+1];
|
||||
if (e1!=null && e2!=null && e1.name.compareTo(e2.name)>0) {
|
||||
out[a] = e2;
|
||||
out[a+1] = e1;
|
||||
change = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while (change==true);
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return an array of all the aspects in this collection sorted by name
|
||||
*/
|
||||
public EnumTag[] getAspectsSortedAmount() {
|
||||
EnumTag[] out = tags.keySet().toArray(new EnumTag[1]);
|
||||
boolean change=false;
|
||||
do {
|
||||
change=false;
|
||||
for(int a=0;a<out.length-1;a++) {
|
||||
int e1 = getAmount(out[a]);
|
||||
int e2 = getAmount(out[a+1]);
|
||||
if (e1>0 && e2>0 && e2>e1) {
|
||||
EnumTag ea = out[a];
|
||||
EnumTag eb = out[a+1];
|
||||
out[a] = eb;
|
||||
out[a+1] = ea;
|
||||
change = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while (change==true);
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key
|
||||
* @return the amount associated with the given aspect in this collection
|
||||
*/
|
||||
public int getAmount(EnumTag key) {
|
||||
return tags.get(key)==null?0:tags.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reduces the amount of an aspect in this collection by the given amount.
|
||||
* If reduced below 0 the aspect will be removed completely.
|
||||
* @param key
|
||||
* @param amount
|
||||
* @return
|
||||
*/
|
||||
public boolean reduceAmount(EnumTag key, int amount) {
|
||||
if (getAmount(key)>=amount) {
|
||||
int am = getAmount(key)-amount;
|
||||
if (am<=0) tags.remove(key); else
|
||||
tags.put(key, am);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reduces the amount of an aspect in this collection by the given amount.
|
||||
* If reduced below 0 the aspect will be removed completely.
|
||||
* If the aspect does not exist then a negative value will be added.
|
||||
* Only used by aura internals for flux management.
|
||||
* @param key
|
||||
* @param amount
|
||||
* @return
|
||||
*/
|
||||
public ObjectTags remove(EnumTag key, int amount) {
|
||||
if (getAmount(key)>=amount) {
|
||||
int am = getAmount(key)-amount;
|
||||
if (am<=0) tags.remove(key); else
|
||||
this.tags.put(key, am);
|
||||
} else if (getAmount(key)==0) {
|
||||
this.tags.put(key, -amount);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds this aspect and amount to the collection.
|
||||
* If the aspect exists then its value will be increased by the given amount.
|
||||
* @param aspect
|
||||
* @param amount
|
||||
* @return
|
||||
*/
|
||||
public ObjectTags add(EnumTag aspect, int amount) {
|
||||
if (this.tags.containsKey(aspect)) {
|
||||
int oldamount = this.tags.get(aspect);
|
||||
amount+=oldamount;
|
||||
}
|
||||
this.tags.put( aspect, amount );
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds this aspect and amount to the collection.
|
||||
* If the aspect exists then only the highest of the old or new amount will be used.
|
||||
* @param aspect
|
||||
* @param amount
|
||||
* @return
|
||||
*/
|
||||
public ObjectTags merge(EnumTag aspect, int amount) {
|
||||
if (this.tags.containsKey(aspect)) {
|
||||
int oldamount = this.tags.get(aspect);
|
||||
if (amount<oldamount) amount=oldamount;
|
||||
}
|
||||
this.tags.put( aspect, amount );
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
816
common/thaumcraft/api/ThaumcraftApi.java
Normal file
816
common/thaumcraft/api/ThaumcraftApi.java
Normal file
|
|
@ -0,0 +1,816 @@
|
|||
package thaumcraft.api;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.EnumArmorMaterial;
|
||||
import net.minecraft.item.EnumToolMaterial;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.EnumHelper;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import thaumcraft.api.aura.AuraNode;
|
||||
import thaumcraft.api.crafting.IArcaneRecipe;
|
||||
import thaumcraft.api.crafting.IInfusionRecipe;
|
||||
import thaumcraft.api.crafting.RecipeCrucible;
|
||||
import thaumcraft.api.crafting.ShapedArcaneCraftingRecipes;
|
||||
import thaumcraft.api.crafting.ShapedInfusionCraftingRecipes;
|
||||
import thaumcraft.api.crafting.ShapelessArcaneCraftingRecipes;
|
||||
import thaumcraft.api.crafting.ShapelessInfusionCraftingRecipes;
|
||||
import thaumcraft.api.research.IScanEventHandler;
|
||||
import thaumcraft.api.research.ResearchList;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
|
||||
|
||||
/**
|
||||
* @author Azanor
|
||||
*
|
||||
*
|
||||
* IMPORTANT: If you are adding your own aspects to items it is a good idea to do it AFTER Thaumcraft adds its aspects, otherwise odd things may happen.
|
||||
*
|
||||
*/
|
||||
public class ThaumcraftApi {
|
||||
|
||||
//Materials
|
||||
public static EnumToolMaterial toolMatThaumium = EnumHelper.addToolMaterial("THAUMIUM", 3, 400, 7F, 2, 22);
|
||||
public static EnumToolMaterial toolMatElemental = EnumHelper.addToolMaterial("THAUMIUM_ELEMENTAL", 3, 1500, 10F, 3, 18);
|
||||
public static EnumArmorMaterial armorMatThaumium = EnumHelper.addArmorMaterial("THAUMIUM", 25, new int[] { 2, 6, 5, 2 }, 25);
|
||||
public static EnumArmorMaterial armorMatSpecial = EnumHelper.addArmorMaterial("SPECIAL", 25, new int[] { 1, 3, 2, 1 }, 25);
|
||||
|
||||
|
||||
|
||||
//Miscellaneous
|
||||
/**
|
||||
* Portable Hole Block-id Blacklist.
|
||||
* Simply add the block-id's of blocks you don't want the portable hole to go through.
|
||||
*/
|
||||
public static ArrayList<Integer> portableHoleBlackList = new ArrayList<Integer>();
|
||||
|
||||
|
||||
//RESEARCH/////////////////////////////////////////
|
||||
public static Document researchDoc = null;
|
||||
public static ArrayList<String> apiResearchFiles = new ArrayList<String>();
|
||||
public static ArrayList<IScanEventHandler> scanEventhandlers = new ArrayList<IScanEventHandler>();
|
||||
|
||||
/**
|
||||
* Used to add your own xml files that the research system will check of recipes and descriptions of custom research
|
||||
* @param resourceLoc The xml file. For example The default file used by TC is
|
||||
* "/thaumcraft/resources/research.xml"
|
||||
*/
|
||||
public static void registerResearchXML(String resourceLoc) {
|
||||
if (!apiResearchFiles.contains(resourceLoc)) apiResearchFiles.add(resourceLoc);
|
||||
}
|
||||
|
||||
public static void registerScanEventhandler(IScanEventHandler scanEventHandler) {
|
||||
scanEventhandlers.add(scanEventHandler);
|
||||
}
|
||||
|
||||
//RECIPES/////////////////////////////////////////
|
||||
private static ArrayList crucibleRecipes = new ArrayList();
|
||||
private static List craftingRecipes = new ArrayList();
|
||||
private static HashMap<List,ItemStack> smeltingBonus = new HashMap<List,ItemStack>();
|
||||
private static ArrayList<List> smeltingBonusExlusion = new ArrayList<List>();
|
||||
|
||||
/**
|
||||
* This method is used to determine what bonus items are generated when the infernal furnace smelts items
|
||||
* @param in The result (not input) of the smelting operation. e.g. new ItemStack(ingotGold)
|
||||
* @param out The bonus item that can be produced from the smelting operation e.g. new ItemStack(nuggetGold,0,0).
|
||||
* Stacksize should be 0 unless you want to guarantee that at least 1 item is always produced.
|
||||
*/
|
||||
public static void addSmeltingBonus(ItemStack in, ItemStack out) {
|
||||
smeltingBonus.put(
|
||||
Arrays.asList(in.itemID,in.getItemDamage()),
|
||||
new ItemStack(out.itemID,0,out.getItemDamage()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the bonus item produced from a smelting operation in the infernal furnace
|
||||
* @param in The result of the smelting operation. e.g. new ItemStack(ingotGold)
|
||||
* @return the The bonus item that can be produced
|
||||
*/
|
||||
public static ItemStack getSmeltingBonus(ItemStack in) {
|
||||
return smeltingBonus.get(Arrays.asList(in.itemID,in.getItemDamage()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Excludes specific items from producing bonus items when they are smelted in the infernal furnace, even
|
||||
* if their smelt result would normally produce a bonus item.
|
||||
* @param in The item to be smelted that should never produce a bonus item (e.g. the various macerated dusts form IC2)
|
||||
* Even though they produce gold, iron, etc. ingots, they should NOT produce bonus nuggets as well.
|
||||
*/
|
||||
public static void addSmeltingBonusExclusion(ItemStack in) {
|
||||
smeltingBonusExlusion.add(Arrays.asList(in.itemID,in.getItemDamage()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sees if an item is allowed to produce bonus items when smelted in the infernal furnace
|
||||
* @param in The item you wish to check
|
||||
* @return true or false
|
||||
*/
|
||||
public static boolean isSmeltingBonusExluded(ItemStack in) {
|
||||
return smeltingBonusExlusion.contains(Arrays.asList(in.itemID,in.getItemDamage()));
|
||||
}
|
||||
|
||||
public static List getCraftingRecipes() {
|
||||
return craftingRecipes;
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE:
|
||||
* All arcane and infusion crafting recipes are NBT sensitive.
|
||||
* Simply add as much nbt data to the crafting ingredient itemstacks as you wish
|
||||
* to match with the actual input items. For example this recipe will turn a warded
|
||||
* jar filled with crystal essentia into a stack of diamonds:
|
||||
*
|
||||
* ItemStack is = new ItemStack(itemJarFilled);
|
||||
* is.setTagInfo("tag", new NBTTagByte("tag", (byte) EnumTag.CRYSTAL.id));
|
||||
* is.setTagInfo("amount", new NBTTagByte("amount", (byte) 64));
|
||||
* ThaumcraftApi.addShapelessArcaneCraftingRecipe("THEJARISNOWDIAMONDS", 50,
|
||||
* new ItemStack(Item.diamond,64,0), new Object[] { is });
|
||||
*
|
||||
* If no tag was added for "amount" then the jar would simply have had to contain any
|
||||
* amount of crystal essentia.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param key the research key required for this recipe to work. Leave blank if it will work without research
|
||||
* @param cost the vis cost
|
||||
* @param par1ItemStack the recipe output
|
||||
* @param par2ArrayOfObj the recipe. Format is exactly the same as vanilla recipes
|
||||
*/
|
||||
public static void addArcaneCraftingRecipe(String key, int cost, ItemStack par1ItemStack, Object ... par2ArrayOfObj)
|
||||
{
|
||||
String var3 = "";
|
||||
int var4 = 0;
|
||||
int var5 = 0;
|
||||
int var6 = 0;
|
||||
int var9;
|
||||
|
||||
if (par2ArrayOfObj[var4] instanceof String[])
|
||||
{
|
||||
String[] var7 = (String[])((String[])par2ArrayOfObj[var4++]);
|
||||
String[] var8 = var7;
|
||||
var9 = var7.length;
|
||||
|
||||
for (int var10 = 0; var10 < var9; ++var10)
|
||||
{
|
||||
String var11 = var8[var10];
|
||||
++var6;
|
||||
var5 = var11.length();
|
||||
var3 = var3 + var11;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (par2ArrayOfObj[var4] instanceof String)
|
||||
{
|
||||
String var13 = (String)par2ArrayOfObj[var4++];
|
||||
++var6;
|
||||
var5 = var13.length();
|
||||
var3 = var3 + var13;
|
||||
}
|
||||
}
|
||||
|
||||
HashMap var14;
|
||||
|
||||
for (var14 = new HashMap(); var4 < par2ArrayOfObj.length; var4 += 2)
|
||||
{
|
||||
Character var16 = (Character)par2ArrayOfObj[var4];
|
||||
ItemStack var17 = null;
|
||||
|
||||
if (par2ArrayOfObj[var4 + 1] instanceof Item)
|
||||
{
|
||||
var17 = new ItemStack((Item)par2ArrayOfObj[var4 + 1]);
|
||||
}
|
||||
else if (par2ArrayOfObj[var4 + 1] instanceof Block)
|
||||
{
|
||||
var17 = new ItemStack((Block)par2ArrayOfObj[var4 + 1], 1, -1);
|
||||
}
|
||||
else if (par2ArrayOfObj[var4 + 1] instanceof ItemStack)
|
||||
{
|
||||
var17 = (ItemStack)par2ArrayOfObj[var4 + 1];
|
||||
}
|
||||
|
||||
var14.put(var16, var17);
|
||||
}
|
||||
|
||||
ItemStack[] var15 = new ItemStack[var5 * var6];
|
||||
|
||||
for (var9 = 0; var9 < var5 * var6; ++var9)
|
||||
{
|
||||
char var18 = var3.charAt(var9);
|
||||
|
||||
if (var14.containsKey(Character.valueOf(var18)))
|
||||
{
|
||||
var15[var9] = ((ItemStack)var14.get(Character.valueOf(var18))).copy();
|
||||
}
|
||||
else
|
||||
{
|
||||
var15[var9] = null;
|
||||
}
|
||||
}
|
||||
|
||||
craftingRecipes.add(new ShapedArcaneCraftingRecipes(key, var5, var6, var15, par1ItemStack,cost));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key the research key required for this recipe to work. Leave blank if it will work without research
|
||||
* @param recipeKey a string value of the key used in your research.xml for this recipe to display in the thaumonomicon
|
||||
* @param cost the vis cost
|
||||
* @param par1ItemStack the recipe output
|
||||
* @param par2ArrayOfObj the recipe. Format is exactly the same as vanilla recipes
|
||||
*/
|
||||
public static void addArcaneCraftingRecipe(String key, String recipeKey, int cost, ItemStack par1ItemStack, Object ... par2ArrayOfObj) {
|
||||
addArcaneCraftingRecipe(key,cost,par1ItemStack,par2ArrayOfObj);
|
||||
ResearchList.craftingRecipesForResearch.put(recipeKey, Arrays.asList(getCraftingRecipes().size()-1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key the research key required for this recipe to work. Leave blank if it will work without research
|
||||
* @param cost the vis cost
|
||||
* @param par1ItemStack the recipe output
|
||||
* @param par2ArrayOfObj the recipe. Format is exactly the same as vanilla shapeless recipes
|
||||
*/
|
||||
public static void addShapelessArcaneCraftingRecipe(String key, int cost, ItemStack par1ItemStack, Object ... par2ArrayOfObj)
|
||||
{
|
||||
ArrayList var3 = new ArrayList();
|
||||
Object[] var4 = par2ArrayOfObj;
|
||||
int var5 = par2ArrayOfObj.length;
|
||||
|
||||
for (int var6 = 0; var6 < var5; ++var6)
|
||||
{
|
||||
Object var7 = var4[var6];
|
||||
|
||||
if (var7 instanceof ItemStack)
|
||||
{
|
||||
var3.add(((ItemStack)var7).copy());
|
||||
}
|
||||
else if (var7 instanceof Item)
|
||||
{
|
||||
var3.add(new ItemStack((Item)var7));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(var7 instanceof Block))
|
||||
{
|
||||
throw new RuntimeException("Invalid shapeless recipe!");
|
||||
}
|
||||
|
||||
var3.add(new ItemStack((Block)var7));
|
||||
}
|
||||
}
|
||||
|
||||
craftingRecipes.add(new ShapelessArcaneCraftingRecipes(key, par1ItemStack, var3, cost));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key the research key required for this recipe to work. Leave blank if it will work without research
|
||||
* @param recipeKey a string value of the key used in your research.xml for this recipe to display in the thaumonomicon
|
||||
* @param cost the vis cost
|
||||
* @param par1ItemStack the recipe output
|
||||
* @param par2ArrayOfObj the recipe. Format is exactly the same as vanilla shapeless recipes
|
||||
*/
|
||||
public static void addShapelessArcaneCraftingRecipe(String key, String recipeKey, int cost, ItemStack par1ItemStack, Object ... par2ArrayOfObj) {
|
||||
addShapelessArcaneCraftingRecipe(key,cost,par1ItemStack,par2ArrayOfObj);
|
||||
ResearchList.craftingRecipesForResearch.put(recipeKey, Arrays.asList(getCraftingRecipes().size()-1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key the research key required for this recipe to work. Leave blank if it will work without research
|
||||
* @param cost the vis cost
|
||||
* @param tags ObjectTags list of required aspects and their amounts. No more than 5 aspects should be used in a recipe.
|
||||
* @param par1ItemStack the recipe output
|
||||
* @param par2ArrayOfObj the recipe. Format is exactly the same as vanilla recipes
|
||||
*/
|
||||
public static void addInfusionCraftingRecipe(String key, int cost, ObjectTags tags, ItemStack par1ItemStack, Object ... par2ArrayOfObj)
|
||||
{
|
||||
String var3 = "";
|
||||
int var4 = 0;
|
||||
int var5 = 0;
|
||||
int var6 = 0;
|
||||
int var9;
|
||||
|
||||
if (par2ArrayOfObj[var4] instanceof String[])
|
||||
{
|
||||
String[] var7 = (String[])((String[])par2ArrayOfObj[var4++]);
|
||||
String[] var8 = var7;
|
||||
var9 = var7.length;
|
||||
|
||||
for (int var10 = 0; var10 < var9; ++var10)
|
||||
{
|
||||
String var11 = var8[var10];
|
||||
++var6;
|
||||
var5 = var11.length();
|
||||
var3 = var3 + var11;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (par2ArrayOfObj[var4] instanceof String)
|
||||
{
|
||||
String var13 = (String)par2ArrayOfObj[var4++];
|
||||
++var6;
|
||||
var5 = var13.length();
|
||||
var3 = var3 + var13;
|
||||
}
|
||||
}
|
||||
|
||||
HashMap var14;
|
||||
|
||||
for (var14 = new HashMap(); var4 < par2ArrayOfObj.length; var4 += 2)
|
||||
{
|
||||
Character var16 = (Character)par2ArrayOfObj[var4];
|
||||
ItemStack var17 = null;
|
||||
|
||||
if (par2ArrayOfObj[var4 + 1] instanceof Item)
|
||||
{
|
||||
var17 = new ItemStack((Item)par2ArrayOfObj[var4 + 1]);
|
||||
}
|
||||
else if (par2ArrayOfObj[var4 + 1] instanceof Block)
|
||||
{
|
||||
var17 = new ItemStack((Block)par2ArrayOfObj[var4 + 1], 1, -1);
|
||||
}
|
||||
else if (par2ArrayOfObj[var4 + 1] instanceof ItemStack)
|
||||
{
|
||||
var17 = (ItemStack)par2ArrayOfObj[var4 + 1];
|
||||
}
|
||||
|
||||
var14.put(var16, var17);
|
||||
}
|
||||
|
||||
ItemStack[] var15 = new ItemStack[var5 * var6];
|
||||
|
||||
for (var9 = 0; var9 < var5 * var6; ++var9)
|
||||
{
|
||||
char var18 = var3.charAt(var9);
|
||||
|
||||
if (var14.containsKey(Character.valueOf(var18)))
|
||||
{
|
||||
var15[var9] = ((ItemStack)var14.get(Character.valueOf(var18))).copy();
|
||||
}
|
||||
else
|
||||
{
|
||||
var15[var9] = null;
|
||||
}
|
||||
}
|
||||
|
||||
craftingRecipes.add(new ShapedInfusionCraftingRecipes(key, var5, var6, var15, par1ItemStack,cost,tags));
|
||||
}
|
||||
|
||||
/**
|
||||
* Recipe is NBT sensitive
|
||||
* @param key the research key required for this recipe to work. Leave blank if it will work without research
|
||||
* @param recipeKey a string value of the key used in your research.xml for this recipe to display in the thaumonomicon
|
||||
* @param cost the vis cost
|
||||
* @param tags ObjectTags list of required aspects and their amounts. No more than 5 aspects should be used in a recipe.
|
||||
* @param par1ItemStack the recipe output
|
||||
* @param par2ArrayOfObj the recipe. Format is exactly the same as vanilla recipes
|
||||
*/
|
||||
public static void addInfusionCraftingRecipe(String key, String recipeKey, int cost, ObjectTags tags, ItemStack par1ItemStack, Object ... par2ArrayOfObj) {
|
||||
addInfusionCraftingRecipe(key, cost, tags, par1ItemStack, par2ArrayOfObj);
|
||||
ResearchList.craftingRecipesForResearch.put(recipeKey, Arrays.asList(getCraftingRecipes().size()-1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Recipe is NBT sensitive
|
||||
* @param key the research key required for this recipe to work. Leave blank if it will work without research
|
||||
* @param cost the vis cost
|
||||
* @param tags ObjectTags list of required aspects and their amounts. No more than 5 aspects should be used in a recipe.
|
||||
* @param par1ItemStack the recipe output
|
||||
* @param par2ArrayOfObj the recipe. Format is exactly the same as vanilla shapeless recipes
|
||||
*/
|
||||
public static void addShapelessInfusionCraftingRecipe(String key, int cost, ObjectTags tags, ItemStack par1ItemStack, Object ... par2ArrayOfObj)
|
||||
{
|
||||
ArrayList var3 = new ArrayList();
|
||||
Object[] var4 = par2ArrayOfObj;
|
||||
int var5 = par2ArrayOfObj.length;
|
||||
|
||||
for (int var6 = 0; var6 < var5; ++var6)
|
||||
{
|
||||
Object var7 = var4[var6];
|
||||
|
||||
if (var7 instanceof ItemStack)
|
||||
{
|
||||
var3.add(((ItemStack)var7).copy());
|
||||
}
|
||||
else if (var7 instanceof Item)
|
||||
{
|
||||
var3.add(new ItemStack((Item)var7));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(var7 instanceof Block))
|
||||
{
|
||||
throw new RuntimeException("Invalid shapeless recipe!");
|
||||
}
|
||||
|
||||
var3.add(new ItemStack((Block)var7));
|
||||
}
|
||||
}
|
||||
|
||||
craftingRecipes.add(new ShapelessInfusionCraftingRecipes(key, par1ItemStack, var3, cost,tags));
|
||||
}
|
||||
|
||||
/**
|
||||
* Recipe is NBT sensitive
|
||||
* @param key the research key required for this recipe to work. Leave blank if it will work without research
|
||||
* @param recipeKey a string value of the key used in your research.xml for this recipe to display in the thaumonomicon
|
||||
* @param cost the vis cost
|
||||
* @param tags ObjectTags list of required aspects and their amounts. No more than 5 aspects should be used in a recipe.
|
||||
* @param par1ItemStack the recipe output
|
||||
* @param par2ArrayOfObj the recipe. Format is exactly the same as vanilla shapeless recipes
|
||||
*/
|
||||
public static void addShapelessInfusionCraftingRecipe(String key, String recipeKey, int cost, ObjectTags tags, ItemStack par1ItemStack, Object ... par2ArrayOfObj) {
|
||||
addShapelessInfusionCraftingRecipe(key, cost, tags, par1ItemStack, par2ArrayOfObj);
|
||||
ResearchList.craftingRecipesForResearch.put(recipeKey, Arrays.asList(getCraftingRecipes().size()-1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key the research key required for this recipe to work. Unlike the arcane crafting and infusion crafting
|
||||
* recipes a recipe key is automatically created using the same key.
|
||||
* See method below if the research and recipes keys do not match
|
||||
* @param result the output result
|
||||
* @param cost the vis cost
|
||||
* @param tags the aspects required to craft this
|
||||
*/
|
||||
public static void addCrucibleRecipe(String key, ItemStack result, int cost, ObjectTags tags) {
|
||||
getCrucibleRecipes().add(new RecipeCrucible(key, result, tags, cost));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key the research key required for this recipe to work.
|
||||
* @param recipeKey a string value of the key used in your research.xml for this recipe to display in the thaumonomicon
|
||||
* @param result the output result
|
||||
* @param cost the vis cost
|
||||
* @param tags the aspects required to craft this
|
||||
*/
|
||||
public static void addCrucibleRecipe(String key, String recipeKey, ItemStack result, int cost, ObjectTags tags) {
|
||||
getCrucibleRecipes().add(new RecipeCrucible(key, recipeKey, result, tags, cost));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key the recipe key (NOT research key)
|
||||
* @return the recipe
|
||||
*/
|
||||
public static RecipeCrucible getCrucibleRecipe(String key) {
|
||||
for (Object r:getCrucibleRecipes()) {
|
||||
if (r instanceof RecipeCrucible) {
|
||||
if (((RecipeCrucible)r).key.equals(key))
|
||||
return (RecipeCrucible)r;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param stack the recipe result
|
||||
* @return the recipe
|
||||
*/
|
||||
public static RecipeCrucible getCrucibleRecipe(ItemStack stack) {
|
||||
for (Object r:getCrucibleRecipes()) {
|
||||
if (r instanceof RecipeCrucible) {
|
||||
if (((RecipeCrucible)r).recipeOutput.isItemEqual(stack))
|
||||
return (RecipeCrucible)r;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param stack the item
|
||||
* @return the thaumcraft recipe key that produces that item. Used by the thaumonomicon drilldown feature.
|
||||
*/
|
||||
public static String getCraftingRecipeKey(ItemStack stack) {
|
||||
for (Object r:getCraftingRecipes()) {
|
||||
if (r instanceof IArcaneRecipe) {
|
||||
if (ThaumcraftApiHelper.areItemsEqual(stack,((IArcaneRecipe)r).getRecipeOutput()))
|
||||
return ((IArcaneRecipe)r).getKey();
|
||||
}
|
||||
if (r instanceof IInfusionRecipe) {
|
||||
if (ThaumcraftApiHelper.areItemsEqual(stack,((IInfusionRecipe)r).getRecipeOutput()))
|
||||
return ((IInfusionRecipe)r).getKey();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
//TAGS////////////////////////////////////////
|
||||
|
||||
public static Map<List,ObjectTags> objectTags = new HashMap<List,ObjectTags>();
|
||||
|
||||
/**
|
||||
* Checks to see if the passed item/block already has aspects associated with it.
|
||||
* @param id
|
||||
* @param meta
|
||||
* @return
|
||||
*/
|
||||
public static boolean exists(int id, int meta) {
|
||||
ObjectTags tmp = ThaumcraftApi.objectTags.get(Arrays.asList(id,meta));
|
||||
if (tmp==null) {
|
||||
tmp = ThaumcraftApi.objectTags.get(Arrays.asList(id,-1));
|
||||
if (meta==-1 && tmp==null) {
|
||||
int index=0;
|
||||
do {
|
||||
tmp = ThaumcraftApi.objectTags.get(Arrays.asList(id,index));
|
||||
index++;
|
||||
} while (index<16 && tmp==null);
|
||||
}
|
||||
if (tmp==null) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to assign apsects to the given item/block. Here is an example of the declaration for cobblestone:<p>
|
||||
* <i>ThaumcraftApi.registerObjectTag(Block.cobblestone.blockID, -1, (new ObjectTags()).add(EnumTag.ROCK, 1).add(EnumTag.DESTRUCTION, 1));</i>
|
||||
* @param id
|
||||
* @param meta pass -1 if all damage values of this item/block should have the same aspects
|
||||
* @param aspects A ObjectTags object of the associated aspects
|
||||
*/
|
||||
public static void registerObjectTag(int id, int meta, ObjectTags aspects) {
|
||||
aspects = ThaumcraftApiHelper.cullTags(aspects);
|
||||
objectTags.put(Arrays.asList(id,meta), aspects);
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to assign aspects to the given item/block.
|
||||
* Attempts to automatically generate aspect tags by checking registered recipes.
|
||||
* Here is an example of the declaration for pistons:<p>
|
||||
* <i>ThaumcraftApi.registerComplexObjectTag(Block.pistonBase.blockID, 0, (new ObjectTags()).add(EnumTag.MECHANISM, 2).add(EnumTag.MOTION, 4));</i>
|
||||
* @param id
|
||||
* @param meta pass -1 if all damage values of this item/block should have the same aspects
|
||||
* @param aspects A ObjectTags object of the associated aspects
|
||||
*/
|
||||
public static void registerComplexObjectTag(int id, int meta, ObjectTags aspects ) {
|
||||
if (!exists(id,meta)) {
|
||||
ObjectTags tmp = ThaumcraftApiHelper.generateTags(id, meta);
|
||||
if (tmp != null && tmp.size()>0) {
|
||||
for(EnumTag tag:tmp.getAspects()) {
|
||||
aspects.add(tag, tmp.getAmount(tag));
|
||||
}
|
||||
}
|
||||
registerObjectTag(id,meta,aspects);
|
||||
} else {
|
||||
ObjectTags tmp = ThaumcraftApiHelper.getObjectTags(new ItemStack(id,1,meta));
|
||||
for(EnumTag tag:aspects.getAspects()) {
|
||||
tmp.merge(tag, tmp.getAmount(tag));
|
||||
}
|
||||
registerObjectTag(id,meta,tmp);
|
||||
}
|
||||
}
|
||||
|
||||
public static ArrayList getCrucibleRecipes() {
|
||||
return crucibleRecipes;
|
||||
}
|
||||
|
||||
|
||||
//AURAS//////////////////////////////////////////////////
|
||||
|
||||
private static Method addFluxToClosest;
|
||||
/**
|
||||
* Adds flux to the node closest to the given location
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param tags ObjectTags list of all the EnumTags and amounts of flux to add.
|
||||
*/
|
||||
public static void addFluxToClosest(World world, float x, float y, float z, ObjectTags tags) {
|
||||
try {
|
||||
if(addFluxToClosest == null) {
|
||||
Class fake = Class.forName("thaumcraft.common.aura.AuraManager");
|
||||
addFluxToClosest = fake.getMethod("addFluxToClosest", World.class, float.class, float.class, float.class, ObjectTags.class);
|
||||
}
|
||||
addFluxToClosest.invoke(null, world,x,y,z,tags);
|
||||
} catch(Exception ex) {
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.aura.AuraManager method addFluxToClosest");
|
||||
}
|
||||
}
|
||||
|
||||
private static Method decreaseClosestAura;
|
||||
/**
|
||||
* Removes an amount of vis from the aura node closest to the given location
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param amount The amount of vis to remove
|
||||
* @param doit If set to false it will merely perform a check to see if there is enough vis to perform the operation.
|
||||
* If set to true it will actually decrease the vis as well.
|
||||
* @return It will return true if there was enough vis to perform this operation
|
||||
*/
|
||||
public static boolean decreaseClosestAura(World world, double x, double y, double z, int amount, boolean doit) {
|
||||
boolean ret=false;
|
||||
try {
|
||||
if(decreaseClosestAura == null) {
|
||||
Class fake = Class.forName("thaumcraft.common.aura.AuraManager");
|
||||
decreaseClosestAura = fake.getMethod("decreaseClosestAura", World.class, double.class, double.class, double.class, int.class, boolean.class);
|
||||
}
|
||||
ret = (Boolean) decreaseClosestAura.invoke(null, world,x,y,z,amount,doit);
|
||||
} catch(Exception ex) {
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.aura.AuraManager method decreaseClosestAura");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
private static Method increaseLowestAura;
|
||||
/**
|
||||
* Increases the lowest aura near the given location.
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param amount
|
||||
* @return it will return true if the operation was a success
|
||||
*/
|
||||
public static boolean increaseLowestAura(World world, double x, double y, double z, int amount) {
|
||||
boolean ret=false;
|
||||
try {
|
||||
if(increaseLowestAura == null) {
|
||||
Class fake = Class.forName("thaumcraft.common.aura.AuraManager");
|
||||
increaseLowestAura = fake.getMethod("increaseLowestAura", World.class, double.class, double.class, double.class, int.class);
|
||||
}
|
||||
ret = (Boolean) increaseLowestAura.invoke(null, world,x,y,z,amount);
|
||||
} catch(Exception ex) {
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.aura.AuraManager method increaseLowestAura");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
private static Method getClosestAuraWithinRange;
|
||||
/**
|
||||
* Gets the id of the closest aura node within range of the given coordinates. Only checks loaded chunks
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param range distance (in blocks) to check
|
||||
* @return returns -1 if no aura is found, otherwise returns the aura node id.
|
||||
*/
|
||||
public static int getClosestAuraWithinRange(World world, double x, double y, double z, double range) {
|
||||
int ret=-1;
|
||||
try {
|
||||
if(getClosestAuraWithinRange == null) {
|
||||
Class fake = Class.forName("thaumcraft.common.aura.AuraManager");
|
||||
getClosestAuraWithinRange = fake.getMethod("getClosestAuraWithinRange", World.class, double.class, double.class, double.class, double.class);
|
||||
}
|
||||
ret = (Integer) getClosestAuraWithinRange.invoke(null, world,x,y,z,range);
|
||||
} catch(Exception ex) {
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.aura.AuraManager method getClosestAuraWithinRange");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
private static Method getNodeCopy;
|
||||
/**
|
||||
* Gets an copy of the AuraNode object for the given node
|
||||
* @param nodeId the int key of the aura node
|
||||
* @return returns a COPY of the auranode object, not the object itself.
|
||||
* Auranode values should only be altered via queNodeChanges - NEVER directly
|
||||
*/
|
||||
public static AuraNode getNodeCopy(int nodeId) {
|
||||
AuraNode node = null;
|
||||
try {
|
||||
if(getNodeCopy == null) {
|
||||
Class fake = Class.forName("thaumcraft.common.aura.AuraManager");
|
||||
getNodeCopy = fake.getMethod("getNodeCopy", int.class);
|
||||
}
|
||||
node = (AuraNode) getNodeCopy.invoke(null, nodeId);
|
||||
} catch(Exception ex) {
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.aura.AuraManager method getNodeCopy");
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
private static Method queueNodeChanges;
|
||||
/**
|
||||
* This method is used to alter the values of aura nodes. The changes specified are placed in a queue for processing by
|
||||
* the aura thread.<br>
|
||||
*
|
||||
* For example:<br>
|
||||
* queNodeChanges(55,8,0,false,null,0,0,0); //will increase node 55's current vis by 8<br>
|
||||
* queNodeChanges(55,0,0,false,new ObjectTags().remove(EnumTag.FIRE,3),0,0,0); //will reduce node 55's FIRE flux levels by 3<br>
|
||||
* queNodeChanges(55,11,11,false,null,0,.5f,0); //will increase node 55's current and base level by 11 and increase its y pos by .5f<br>
|
||||
*
|
||||
* @param nodeId
|
||||
* @param levelMod the amount by which the auras vis level should be changed (positive or negative)
|
||||
* @param baseMod the amount by which the auras max vis level should be changed (positive or negative)
|
||||
* @param toggleLock if set to true the nodes lock state will toggle to its opposite value. Currently doesn't do much
|
||||
* @param flx a ObjectTags collection of the all the flux to add (if positive) or remove (if negative) to the node
|
||||
* @param x by how much the nodes x position should be altered. Should usually be less than 1
|
||||
* @param y by how much the nodes y position should be altered. Should usually be less than 1
|
||||
* @param z by how much the nodes z position should be altered. Should usually be less than 1
|
||||
*/
|
||||
public static void queueNodeChanges(int nodeId, int levelMod, int baseMod, boolean toggleLock, ObjectTags flux,
|
||||
float x,float y,float z) {
|
||||
try {
|
||||
if(queueNodeChanges == null) {
|
||||
Class fake = Class.forName("thaumcraft.common.aura.AuraManager");
|
||||
queueNodeChanges = fake.getMethod("queueNodeChanges",
|
||||
int.class, int.class, int.class, boolean.class, ObjectTags.class, float.class, float.class, float.class);
|
||||
}
|
||||
queueNodeChanges.invoke(null, nodeId, levelMod, baseMod, toggleLock, flux, x, y, z);
|
||||
} catch(Exception ex) {
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.aura.AuraManager method queueNodeChanges");
|
||||
}
|
||||
}
|
||||
|
||||
//BIOMES//////////////////////////////////////////////////
|
||||
@Deprecated
|
||||
public static HashMap<Integer,List> biomeInfo = new HashMap<Integer,List>();
|
||||
|
||||
/**
|
||||
* Registers custom biomes with thaumcraft
|
||||
* @Deprecated I will be switching over the the forge BiomeDictionary system in the future so any mods that add biomes should just make sure they are tagged correctly
|
||||
* @param biomeID The id of the biome
|
||||
* @param visLevel The average vis level of nodes generated in this biome
|
||||
* @param tag The EnumTag associated with this biome (used to determine infused ore spawns among other things)
|
||||
* @param greatwood Does this biome support greatwood trees
|
||||
* @param silverwood Does this biome support silverwood trees
|
||||
*/
|
||||
@Deprecated
|
||||
public static void registerBiomeInfo(int biomeID, int visLevel, EnumTag tag, boolean greatwood, boolean silverwood) {
|
||||
biomeInfo.put(biomeID, Arrays.asList(visLevel, tag, greatwood, silverwood));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static int getBiomeAura(int biomeId) {
|
||||
try {
|
||||
return (Integer) biomeInfo.get(biomeId).get(0);
|
||||
} catch (Exception e) {}
|
||||
return 200;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static EnumTag getBiomeTag(int biomeId) {
|
||||
try {
|
||||
return (EnumTag) biomeInfo.get(biomeId).get(1);
|
||||
} catch (Exception e) {}
|
||||
return EnumTag.UNKNOWN;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean getBiomeSupportsGreatwood(int biomeId) {
|
||||
try {
|
||||
return (Boolean) biomeInfo.get(biomeId).get(2);
|
||||
} catch (Exception e) {}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean getBiomeSupportsSilverwood(int biomeId) {
|
||||
try {
|
||||
return (Boolean) biomeInfo.get(biomeId).get(3);
|
||||
} catch (Exception e) {}
|
||||
return false;
|
||||
}
|
||||
|
||||
//CROPS //////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* To define mod crops you need to use FMLInterModComms in your @Mod.Init method.
|
||||
* There are two 'types' of crops you can add. Standard crops and clickable crops.
|
||||
*
|
||||
* Standard crops work like normal vanilla crops - they grow until a certain metadata
|
||||
* value is reached and you harvest them by destroying the block and collecting the blocks.
|
||||
* You need to create and ItemStack that tells the golem what block id and metadata represents
|
||||
* the crop when fully grown.
|
||||
* Example for vanilla wheat:
|
||||
* FMLInterModComms.sendMessage("Thaumcraft", "harvestStandardCrop", new ItemStack(Block.crops,1,7));
|
||||
*
|
||||
* Clickable crops are crops that you right click to gather their bounty instead of destroying them.
|
||||
* As for standard crops, you need to create and ItemStack that tells the golem what block id
|
||||
* and metadata represents the crop when fully grown. The golem will trigger the blocks onBlockActivated method.
|
||||
* Example (this will technically do nothing since clicking wheat does nothing, but you get the idea):
|
||||
* FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(Block.crops,1,7));
|
||||
*/
|
||||
|
||||
@Deprecated
|
||||
public static HashMap<Integer,Integer> crops = new HashMap<Integer,Integer>();
|
||||
|
||||
/**
|
||||
* This is used to add mod crops to the list of crops harvested by golems
|
||||
* that do not use the standard crop growth pattern<br>
|
||||
* (i.e. being an instance of BlockCrops and being fully grown at meta 7).<br>
|
||||
* Only seeds implementing IPlantable will be replanted.
|
||||
* @param blockID the block id of the crop
|
||||
* @param grownMeta the metadata value when the crop is considered fully grown.
|
||||
* The block with this id and meta will be the one the golem breaks.
|
||||
*/
|
||||
@Deprecated
|
||||
public static void addHarvestableCrop(int blockID, int grownMeta) {
|
||||
crops.put(blockID, grownMeta);
|
||||
}
|
||||
|
||||
}
|
||||
103
common/thaumcraft/api/ThaumcraftApiHelper.java
Normal file
103
common/thaumcraft/api/ThaumcraftApiHelper.java
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
package thaumcraft.api;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
|
||||
public class ThaumcraftApiHelper {
|
||||
public static ObjectTags cullTags(ObjectTags temp) {
|
||||
while (temp!=null && temp.size()>5) {
|
||||
EnumTag lowest = null;
|
||||
int low = Integer.MAX_VALUE;
|
||||
for (EnumTag tag:temp.getAspects()) {
|
||||
if (temp.getAmount(tag)<low) {
|
||||
low = temp.getAmount(tag);
|
||||
lowest = tag;
|
||||
}
|
||||
}
|
||||
temp.tags.remove(lowest);
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
|
||||
public static boolean areItemsEqual(ItemStack s1,ItemStack s2)
|
||||
{
|
||||
if (s1.isItemStackDamageable() && s2.isItemStackDamageable())
|
||||
{
|
||||
return s1.itemID == s2.itemID;
|
||||
} else
|
||||
return s1.itemID == s2.itemID && s1.getItemDamage() == s2.getItemDamage();
|
||||
}
|
||||
|
||||
static Method isResearchComplete;
|
||||
static Method getObjectTags;
|
||||
static Method getBonusTags;
|
||||
static Method generateTags;
|
||||
public static boolean isResearchComplete(String username, String researchkey) {
|
||||
boolean ot = false;
|
||||
try {
|
||||
if(isResearchComplete == null) {
|
||||
Class fake = Class.forName("thaumcraft.common.research.ResearchManager");
|
||||
isResearchComplete = fake.getMethod("isResearchComplete", String.class, String.class);
|
||||
}
|
||||
ot = (Boolean) isResearchComplete.invoke(null, username, researchkey);
|
||||
} catch(Exception ex) {
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.research.ResearchManager method isResearchComplete");
|
||||
}
|
||||
return ot;
|
||||
}
|
||||
|
||||
public static ItemStack getStackInRowAndColumn(Object instance, int row, int column) {
|
||||
ItemStack ot = null;
|
||||
try {
|
||||
Class fake = Class.forName("thaumcraft.common.tiles.TileMagicWorkbench");
|
||||
Method getStackInRowAndColumn = fake.getMethod("getStackInRowAndColumn", int.class, int.class);
|
||||
ot = (ItemStack) getStackInRowAndColumn.invoke(instance, row, column);
|
||||
} catch(Exception ex) {
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.tiles.TileMagicWorkbench method getStackInRowAndColumn");
|
||||
}
|
||||
return ot;
|
||||
}
|
||||
|
||||
public static ObjectTags getObjectTags(ItemStack is) {
|
||||
ObjectTags ot = null;
|
||||
try {
|
||||
if(getObjectTags == null) {
|
||||
Class fake = Class.forName("thaumcraft.common.lib.ThaumcraftCraftingManager");
|
||||
getObjectTags = fake.getMethod("getObjectTags", ItemStack.class);
|
||||
}
|
||||
ot = (ObjectTags) getObjectTags.invoke(null, is);
|
||||
} catch(Exception ex) {
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.ThaumcraftCraftingManager method getObjectTags");
|
||||
}
|
||||
return ot;
|
||||
}
|
||||
|
||||
public static ObjectTags getBonusObjectTags(ItemStack is,ObjectTags ot) {
|
||||
|
||||
try {
|
||||
if(getBonusTags == null) {
|
||||
Class fake = Class.forName("thaumcraft.common.lib.ThaumcraftCraftingManager");
|
||||
getBonusTags = fake.getMethod("getBonusTags", ItemStack.class, ObjectTags.class);
|
||||
}
|
||||
ot = (ObjectTags) getBonusTags.invoke(null, is, ot);
|
||||
} catch(Exception ex) {
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.ThaumcraftCraftingManager method getBonusTags");
|
||||
}
|
||||
return ot;
|
||||
}
|
||||
|
||||
public static ObjectTags generateTags(int id, int meta) {
|
||||
try {
|
||||
if(generateTags == null) {
|
||||
Class fake = Class.forName("thaumcraft.common.lib.ThaumcraftCraftingManager");
|
||||
generateTags = fake.getMethod("generateTags", int.class, int.class);
|
||||
}
|
||||
return (ObjectTags) generateTags.invoke(null, id, meta);
|
||||
} catch(Exception ex) {
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.ThaumcraftCraftingManager method generateTags");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
85
common/thaumcraft/api/aspects/Aspect.java
Normal file
85
common/thaumcraft/api/aspects/Aspect.java
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
package thaumcraft.api.aspects;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class Aspect {
|
||||
|
||||
String tag;
|
||||
Aspect[] components;
|
||||
|
||||
public Aspect(String tag, Aspect[] components) {
|
||||
this.tag = tag;
|
||||
this.components = components;
|
||||
|
||||
aspects.put(tag, this);
|
||||
}
|
||||
|
||||
public Aspect(String tag) {
|
||||
this.tag = tag;
|
||||
aspects.put(tag, this);
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
public void setTag(String tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
public Aspect[] getComponents() {
|
||||
return components;
|
||||
}
|
||||
|
||||
public void setComponents(Aspect[] components) {
|
||||
this.components = components;
|
||||
}
|
||||
|
||||
///////////////////////////////
|
||||
public static HashMap<String,Aspect> aspects = new HashMap<String,Aspect>();
|
||||
|
||||
//PRIMAL
|
||||
public static final Aspect AIR = new Aspect("Air");
|
||||
public static final Aspect EARTH = new Aspect("Earth");
|
||||
public static final Aspect FIRE = new Aspect("Fire");
|
||||
public static final Aspect WATER = new Aspect("Water");
|
||||
public static final Aspect POSITIVE = new Aspect("Positive");
|
||||
public static final Aspect NEGATIVE = new Aspect("Negative");
|
||||
public static final Aspect ORDER = new Aspect("Order");
|
||||
public static final Aspect CHAOS = new Aspect("Chaos");
|
||||
|
||||
//SECONDARY TODO
|
||||
public static final Aspect VOID = new Aspect("Void", new Aspect[] {NEGATIVE, POSITIVE});
|
||||
public static final Aspect LIGHT = new Aspect("Light", new Aspect[] {AIR, FIRE});
|
||||
public static final Aspect DARKNESS = new Aspect("Darkness", new Aspect[] {VOID, LIGHT});
|
||||
public static final Aspect ASTRAL = new Aspect("Astral", new Aspect[] {VOID, DARKNESS});
|
||||
public static final Aspect ENERGY = new Aspect("Energy", new Aspect[] {POSITIVE, FIRE});
|
||||
public static final Aspect LIFE = new Aspect("Life", new Aspect[] {POSITIVE, ENERGY});
|
||||
public static final Aspect DEATH = new Aspect("Death", new Aspect[] {NEGATIVE, ENERGY});
|
||||
public static final Aspect MOTION = new Aspect("Motion", new Aspect[] {AIR, ORDER});
|
||||
public static final Aspect WEATHER = new Aspect("Weather", new Aspect[] {AIR, CHAOS});
|
||||
public static final Aspect STONE = new Aspect("Stone", new Aspect[] {EARTH, ORDER});
|
||||
public static final Aspect METAL = new Aspect("Metal", new Aspect[] {STONE, FIRE});
|
||||
public static final Aspect SAND = new Aspect("Sand", new Aspect[] {AIR, STONE});
|
||||
public static final Aspect SOUL = new Aspect("Soul", new Aspect[] {DEATH, LIFE});
|
||||
public static final Aspect HEAL = new Aspect("Heal", new Aspect[] {POSITIVE, LIFE});
|
||||
public static final Aspect HARM = new Aspect("Harm", new Aspect[] {NEGATIVE, LIFE});
|
||||
public static final Aspect ANIMATE = new Aspect("Animate",new Aspect[] {MOTION, LIFE});
|
||||
public static final Aspect MAN = new Aspect("Man", new Aspect[] {LIFE, SOUL});
|
||||
public static final Aspect BEAST = new Aspect("Beast", new Aspect[] {LIFE, CHAOS});
|
||||
public static final Aspect BIRD = new Aspect("Bird", new Aspect[] {BEAST, AIR});
|
||||
public static final Aspect FISH = new Aspect("Fish", new Aspect[] {BEAST, WATER});
|
||||
public static final Aspect SEED = new Aspect("Seed", new Aspect[] {LIFE, EARTH});
|
||||
public static final Aspect TREE = new Aspect("Tree", new Aspect[] {SEED, EARTH});
|
||||
public static final Aspect TOOL = new Aspect("Tool", new Aspect[] {MAN, METAL});
|
||||
public static final Aspect MINE = new Aspect("Mine", new Aspect[] {MAN, STONE});
|
||||
public static final Aspect WOOD = new Aspect("Wood", new Aspect[] {TREE, TOOL});
|
||||
public static final Aspect MACHINE = new Aspect("Machine", new Aspect[] {TOOL, ORDER});
|
||||
|
||||
|
||||
// public static final Aspect TRAVEL = new Aspect("Travel", new Aspect[] {MOTION, EARTH});
|
||||
// public static final Aspect TELEPORT = new Aspect("Teleport", new Aspect[] {TRAVEL, VOID});
|
||||
// public static final Aspect GLASS = new Aspect("Glass", new Aspect[] {SAND, FIRE});
|
||||
// public static final Aspect CLAY = new Aspect("Clay", new Aspect[] {SAND, LIFE});
|
||||
|
||||
}
|
||||
38
common/thaumcraft/api/aura/AuraNode.java
Normal file
38
common/thaumcraft/api/aura/AuraNode.java
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
package thaumcraft.api.aura;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import thaumcraft.api.ObjectTags;
|
||||
|
||||
public class AuraNode implements Serializable {
|
||||
//key
|
||||
public int key;
|
||||
|
||||
//aura
|
||||
public short level;
|
||||
public short baseLevel;
|
||||
public ObjectTags flux = new ObjectTags();
|
||||
public EnumNodeType type;
|
||||
|
||||
//location
|
||||
public int dimension;
|
||||
public double xPos;
|
||||
public double yPos;
|
||||
public double zPos;
|
||||
public boolean locked;
|
||||
|
||||
public AuraNode(int key, short lvl, EnumNodeType type, int dim, int x, int y, int z) {
|
||||
this.key = key;
|
||||
this.level = lvl;
|
||||
this.baseLevel = lvl;
|
||||
this.type = type;
|
||||
this.dimension = dim;
|
||||
this.xPos = x+.5d;
|
||||
this.yPos = y+.5d;
|
||||
this.zPos = z+.5d;
|
||||
}
|
||||
|
||||
public AuraNode() {
|
||||
}
|
||||
|
||||
}
|
||||
21
common/thaumcraft/api/aura/EnumNodeType.java
Normal file
21
common/thaumcraft/api/aura/EnumNodeType.java
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package thaumcraft.api.aura;
|
||||
|
||||
|
||||
|
||||
public enum EnumNodeType {
|
||||
NORMAL,
|
||||
PURE,
|
||||
DARK,
|
||||
UNSTABLE;
|
||||
|
||||
public static final EnumNodeType[] VALID_TYPES = {NORMAL,PURE,DARK,UNSTABLE};
|
||||
|
||||
public static EnumNodeType getType(int id)
|
||||
{
|
||||
if (id >= 0 && id < VALID_TYPES.length)
|
||||
{
|
||||
return VALID_TYPES[id];
|
||||
}
|
||||
return NORMAL;
|
||||
}
|
||||
}
|
||||
30
common/thaumcraft/api/crafting/IArcaneRecipe.java
Normal file
30
common/thaumcraft/api/crafting/IArcaneRecipe.java
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package thaumcraft.api.crafting;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IArcaneRecipe
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Used to check if a recipe matches current crafting inventory
|
||||
* @param player
|
||||
*/
|
||||
boolean matches(IInventory var1, EntityPlayer player);
|
||||
|
||||
/**
|
||||
* Returns an Item that is the result of this recipe
|
||||
*/
|
||||
ItemStack getCraftingResult(IInventory var1);
|
||||
|
||||
/**
|
||||
* Returns the size of the recipe area
|
||||
*/
|
||||
int getRecipeSize();
|
||||
|
||||
ItemStack getRecipeOutput();
|
||||
int getCost();
|
||||
String getKey();
|
||||
}
|
||||
30
common/thaumcraft/api/crafting/IInfusionRecipe.java
Normal file
30
common/thaumcraft/api/crafting/IInfusionRecipe.java
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package thaumcraft.api.crafting;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import thaumcraft.api.ObjectTags;
|
||||
|
||||
public interface IInfusionRecipe
|
||||
{
|
||||
/**
|
||||
* Used to check if a recipe matches current crafting inventory
|
||||
* @param player
|
||||
*/
|
||||
boolean matches(IInventory var1, EntityPlayer player);
|
||||
|
||||
/**
|
||||
* Returns an Item that is the result of this recipe
|
||||
*/
|
||||
ItemStack getCraftingResult(IInventory var1);
|
||||
|
||||
/**
|
||||
* Returns the size of the recipe area
|
||||
*/
|
||||
int getRecipeSize();
|
||||
|
||||
ItemStack getRecipeOutput();
|
||||
int getCost();
|
||||
ObjectTags getTags();
|
||||
String getKey();
|
||||
}
|
||||
51
common/thaumcraft/api/crafting/RecipeCrucible.java
Normal file
51
common/thaumcraft/api/crafting/RecipeCrucible.java
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
package thaumcraft.api.crafting;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import thaumcraft.api.EnumTag;
|
||||
import thaumcraft.api.ObjectTags;
|
||||
|
||||
public class RecipeCrucible {
|
||||
|
||||
public ItemStack recipeOutput;
|
||||
public ObjectTags tags;
|
||||
public String key;
|
||||
public String researchKey;
|
||||
public int cost;
|
||||
|
||||
public RecipeCrucible(String researchKey, String key, ItemStack result, ObjectTags tags, int cost) {
|
||||
recipeOutput = result;
|
||||
this.tags = tags;
|
||||
this.key = key;
|
||||
this.researchKey = researchKey;
|
||||
this.cost = cost;
|
||||
}
|
||||
|
||||
public RecipeCrucible(String key, ItemStack result, ObjectTags tags, int cost) {
|
||||
recipeOutput = result;
|
||||
this.tags = tags;
|
||||
this.key = key;
|
||||
this.researchKey = key;
|
||||
this.cost = cost;
|
||||
}
|
||||
|
||||
public boolean matches(ObjectTags itags) {
|
||||
if (itags==null) return false;
|
||||
for (EnumTag tag:tags.getAspects()) {
|
||||
if (itags.getAmount(tag)<tags.getAmount(tag)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public ObjectTags removeMatching(ObjectTags itags) {
|
||||
ObjectTags temptags = new ObjectTags();
|
||||
temptags.tags.putAll(itags.tags);
|
||||
|
||||
for (EnumTag tag:tags.getAspects()) {
|
||||
if (!temptags.reduceAmount(tag, tags.getAmount(tag))) return null;
|
||||
}
|
||||
|
||||
itags = temptags;
|
||||
return itags;
|
||||
}
|
||||
|
||||
}
|
||||
167
common/thaumcraft/api/crafting/ShapedArcaneCraftingRecipes.java
Normal file
167
common/thaumcraft/api/crafting/ShapedArcaneCraftingRecipes.java
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
package thaumcraft.api.crafting;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
|
||||
public class ShapedArcaneCraftingRecipes implements IArcaneRecipe
|
||||
{
|
||||
/** How many horizontal slots this recipe is wide. */
|
||||
public int recipeWidth;
|
||||
|
||||
/** How many vertical slots this recipe uses. */
|
||||
public int recipeHeight;
|
||||
|
||||
public String key;
|
||||
|
||||
public int cost;
|
||||
|
||||
/** Is a array of ItemStack that composes the recipe. */
|
||||
public ItemStack[] recipeItems;
|
||||
|
||||
/** Is the ItemStack that you get when craft the recipe. */
|
||||
private ItemStack recipeOutput;
|
||||
|
||||
/** Is the itemID of the output item that you get when craft the recipe. */
|
||||
public final int recipeOutputItemID;
|
||||
|
||||
public ShapedArcaneCraftingRecipes(String key, int par1, int par2, ItemStack[] par3ArrayOfItemStack, ItemStack par4ItemStack, int cost)
|
||||
{
|
||||
this.recipeOutputItemID = par4ItemStack.itemID;
|
||||
this.recipeWidth = par1;
|
||||
this.recipeHeight = par2;
|
||||
this.recipeItems = par3ArrayOfItemStack;
|
||||
this.recipeOutput = par4ItemStack;
|
||||
this.key = key;
|
||||
this.cost = cost;
|
||||
}
|
||||
|
||||
public ItemStack getRecipeOutput()
|
||||
{
|
||||
return this.recipeOutput;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to check if a recipe matches current crafting inventory
|
||||
*/
|
||||
public boolean matches(IInventory par1InventoryCrafting, EntityPlayer player)
|
||||
{
|
||||
if (key.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.username, key)) {
|
||||
return false;
|
||||
}
|
||||
for (int var2 = 0; var2 <= 3 - this.recipeWidth; ++var2)
|
||||
{
|
||||
for (int var3 = 0; var3 <= 3 - this.recipeHeight; ++var3)
|
||||
{
|
||||
if (this.checkMatch(par1InventoryCrafting, var2, var3, true))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.checkMatch(par1InventoryCrafting, var2, var3, false))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the region of a crafting inventory is match for the recipe.
|
||||
*/
|
||||
private boolean checkMatch(IInventory par1InventoryCrafting, int par2, int par3, boolean par4)
|
||||
{
|
||||
for (int var5 = 0; var5 < 3; ++var5)
|
||||
{
|
||||
for (int var6 = 0; var6 < 3; ++var6)
|
||||
{
|
||||
int var7 = var5 - par2;
|
||||
int var8 = var6 - par3;
|
||||
ItemStack var9 = null;
|
||||
|
||||
if (var7 >= 0 && var8 >= 0 && var7 < this.recipeWidth && var8 < this.recipeHeight)
|
||||
{
|
||||
if (par4)
|
||||
{
|
||||
var9 = this.recipeItems[this.recipeWidth - var7 - 1 + var8 * this.recipeWidth];
|
||||
}
|
||||
else
|
||||
{
|
||||
var9 = this.recipeItems[var7 + var8 * this.recipeWidth];
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack var10 = ThaumcraftApiHelper.getStackInRowAndColumn(par1InventoryCrafting, var5, var6);
|
||||
|
||||
if (var10 != null || var9 != null)
|
||||
{
|
||||
if (var10 == null && var9 != null || var10 != null && var9 == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (var9.itemID != var10.itemID)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (var9.getItemDamage() != OreDictionary.WILDCARD_VALUE && var9.getItemDamage() != var10.getItemDamage())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (var9.hasTagCompound()) {
|
||||
NBTTagCompound tc = var9.getTagCompound();
|
||||
for (Object tag:tc.getTags().toArray()) {
|
||||
NBTBase base = (NBTBase)tag;
|
||||
Class nc = NBTBase.newTag(base.getId(), base.getName()).getClass();
|
||||
if (!(var10.hasTagCompound() &&
|
||||
nc.cast(var10.getTagCompound().getTag(base.getName())).equals(nc.cast(base)))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an Item that is the result of this recipe
|
||||
*/
|
||||
public ItemStack getCraftingResult(IInventory par1InventoryCrafting)
|
||||
{
|
||||
return new ItemStack(this.recipeOutput.itemID, this.recipeOutput.stackSize, this.recipeOutput.getItemDamage());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the size of the recipe area
|
||||
*/
|
||||
public int getRecipeSize()
|
||||
{
|
||||
return this.recipeWidth * this.recipeHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCost() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,171 @@
|
|||
package thaumcraft.api.crafting;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import thaumcraft.api.ObjectTags;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
|
||||
public class ShapedInfusionCraftingRecipes implements IInfusionRecipe
|
||||
{
|
||||
/** How many horizontal slots this recipe is wide. */
|
||||
public int recipeWidth;
|
||||
|
||||
/** How many vertical slots this recipe uses. */
|
||||
public int recipeHeight;
|
||||
|
||||
public String key;
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public int cost;
|
||||
|
||||
public ObjectTags tags;
|
||||
|
||||
/** Is a array of ItemStack that composes the recipe. */
|
||||
public ItemStack[] recipeItems;
|
||||
|
||||
/** Is the ItemStack that you get when craft the recipe. */
|
||||
private ItemStack recipeOutput;
|
||||
|
||||
/** Is the itemID of the output item that you get when craft the recipe. */
|
||||
public final int recipeOutputItemID;
|
||||
|
||||
public ShapedInfusionCraftingRecipes(String key, int par1, int par2, ItemStack[] par3ArrayOfItemStack, ItemStack par4ItemStack, int cost, ObjectTags tags)
|
||||
{
|
||||
this.recipeOutputItemID = par4ItemStack.itemID;
|
||||
this.recipeWidth = par1;
|
||||
this.recipeHeight = par2;
|
||||
this.recipeItems = par3ArrayOfItemStack;
|
||||
this.recipeOutput = par4ItemStack;
|
||||
this.key = key;
|
||||
this.cost = cost;
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public ItemStack getRecipeOutput()
|
||||
{
|
||||
return this.recipeOutput;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to check if a recipe matches current crafting inventory
|
||||
*/
|
||||
public boolean matches(IInventory par1InventoryCrafting, EntityPlayer player)
|
||||
{
|
||||
if (key.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.username, key)) {
|
||||
return false;
|
||||
}
|
||||
for (int var2 = 0; var2 <= 3 - this.recipeWidth; ++var2)
|
||||
{
|
||||
for (int var3 = 0; var3 <= 3 - this.recipeHeight; ++var3)
|
||||
{
|
||||
if (this.checkMatch(par1InventoryCrafting, var2, var3, true))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.checkMatch(par1InventoryCrafting, var2, var3, false))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the region of a crafting inventory is match for the recipe.
|
||||
*/
|
||||
private boolean checkMatch(IInventory par1InventoryCrafting, int par2, int par3, boolean par4)
|
||||
{
|
||||
for (int var5 = 0; var5 < 3; ++var5)
|
||||
{
|
||||
for (int var6 = 0; var6 < 3; ++var6)
|
||||
{
|
||||
int var7 = var5 - par2;
|
||||
int var8 = var6 - par3;
|
||||
ItemStack var9 = null;
|
||||
|
||||
if (var7 >= 0 && var8 >= 0 && var7 < this.recipeWidth && var8 < this.recipeHeight)
|
||||
{
|
||||
if (par4)
|
||||
{
|
||||
var9 = this.recipeItems[this.recipeWidth - var7 - 1 + var8 * this.recipeWidth];
|
||||
}
|
||||
else
|
||||
{
|
||||
var9 = this.recipeItems[var7 + var8 * this.recipeWidth];
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack var10 = ThaumcraftApiHelper.getStackInRowAndColumn(par1InventoryCrafting, var5, var6);
|
||||
|
||||
if (var10 != null || var9 != null)
|
||||
{
|
||||
if (var10 == null && var9 != null || var10 != null && var9 == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (var9.itemID != var10.itemID)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (var9.getItemDamage() != OreDictionary.WILDCARD_VALUE && var9.getItemDamage() != var10.getItemDamage())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (var9.hasTagCompound()) {
|
||||
NBTTagCompound tc = var9.getTagCompound();
|
||||
for (Object tag:tc.getTags().toArray()) {
|
||||
NBTBase base = (NBTBase)tag;
|
||||
Class nc = NBTBase.newTag(base.getId(), base.getName()).getClass();
|
||||
if (!(var10.hasTagCompound() &&
|
||||
nc.cast(var10.getTagCompound().getTag(base.getName())).equals(nc.cast(base)))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an Item that is the result of this recipe
|
||||
*/
|
||||
public ItemStack getCraftingResult(IInventory par1InventoryCrafting)
|
||||
{
|
||||
return new ItemStack(this.recipeOutput.itemID, this.recipeOutput.stackSize, this.recipeOutput.getItemDamage());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the size of the recipe area
|
||||
*/
|
||||
public int getRecipeSize()
|
||||
{
|
||||
return this.recipeWidth * this.recipeHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCost() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ObjectTags getTags() {
|
||||
return tags;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
package thaumcraft.api.crafting;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
|
||||
public class ShapelessArcaneCraftingRecipes implements IArcaneRecipe
|
||||
{
|
||||
/** Is the ItemStack that you get when craft the recipe. */
|
||||
private final ItemStack recipeOutput;
|
||||
|
||||
/** Is a List of ItemStack that composes the recipe. */
|
||||
public final List recipeItems;
|
||||
|
||||
public String key;
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public int cost;
|
||||
|
||||
public ShapelessArcaneCraftingRecipes(String key, ItemStack par1ItemStack, List par2List, int cost)
|
||||
{
|
||||
this.recipeOutput = par1ItemStack;
|
||||
this.recipeItems = par2List;
|
||||
this.key = key;
|
||||
this.cost = cost;
|
||||
}
|
||||
|
||||
public ItemStack getRecipeOutput()
|
||||
{
|
||||
return this.recipeOutput;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to check if a recipe matches current crafting inventory
|
||||
*/
|
||||
public boolean matches(IInventory par1InventoryCrafting, EntityPlayer player)
|
||||
{
|
||||
if (key.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.username, key)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ArrayList var2 = new ArrayList(this.recipeItems);
|
||||
|
||||
for (int var3 = 0; var3 < 3; ++var3)
|
||||
{
|
||||
for (int var4 = 0; var4 < 3; ++var4)
|
||||
{
|
||||
ItemStack var5 = ThaumcraftApiHelper.getStackInRowAndColumn(par1InventoryCrafting, var4, var3);
|
||||
|
||||
if (var5 != null)
|
||||
{
|
||||
boolean var6 = false;
|
||||
Iterator var7 = var2.iterator();
|
||||
|
||||
while (var7.hasNext())
|
||||
{
|
||||
ItemStack var8 = (ItemStack)var7.next();
|
||||
|
||||
if (var5.itemID == var8.itemID && (var8.getItemDamage() == OreDictionary.WILDCARD_VALUE || var5.getItemDamage() == var8.getItemDamage()))
|
||||
{
|
||||
boolean matches=true;
|
||||
if (var8.hasTagCompound()) {
|
||||
NBTTagCompound tc = var8.getTagCompound();
|
||||
for (Object tag:tc.getTags().toArray()) {
|
||||
NBTBase base = (NBTBase)tag;
|
||||
Class nc = NBTBase.newTag(base.getId(), base.getName()).getClass();
|
||||
if (!(var5.hasTagCompound() &&
|
||||
nc.cast(var5.getTagCompound().getTag(base.getName())).equals(nc.cast(base)))) {
|
||||
matches=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (matches) {
|
||||
var6 = true;
|
||||
var2.remove(var8);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!var6)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return var2.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an Item that is the result of this recipe
|
||||
*/
|
||||
public ItemStack getCraftingResult(IInventory par1InventoryCrafting)
|
||||
{
|
||||
return this.recipeOutput.copy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the size of the recipe area
|
||||
*/
|
||||
public int getRecipeSize()
|
||||
{
|
||||
return this.recipeItems.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCost() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
package thaumcraft.api.crafting;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import thaumcraft.api.ObjectTags;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
|
||||
public class ShapelessInfusionCraftingRecipes implements IInfusionRecipe
|
||||
{
|
||||
/** Is the ItemStack that you get when craft the recipe. */
|
||||
private final ItemStack recipeOutput;
|
||||
|
||||
/** Is a List of ItemStack that composes the recipe. */
|
||||
public final List recipeItems;
|
||||
|
||||
public String key;
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public int cost;
|
||||
|
||||
public ObjectTags tags;
|
||||
|
||||
public ShapelessInfusionCraftingRecipes(String key, ItemStack par1ItemStack, List par2List, int cost, ObjectTags tags)
|
||||
{
|
||||
this.recipeOutput = par1ItemStack;
|
||||
this.recipeItems = par2List;
|
||||
this.key = key;
|
||||
this.cost = cost;
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public ItemStack getRecipeOutput()
|
||||
{
|
||||
return this.recipeOutput;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to check if a recipe matches current crafting inventory
|
||||
*/
|
||||
public boolean matches(IInventory par1InventoryCrafting, EntityPlayer player)
|
||||
{
|
||||
if (key.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.username, key)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ArrayList var2 = new ArrayList(this.recipeItems);
|
||||
|
||||
for (int var3 = 0; var3 < 3; ++var3)
|
||||
{
|
||||
for (int var4 = 0; var4 < 3; ++var4)
|
||||
{
|
||||
ItemStack var5 = ThaumcraftApiHelper.getStackInRowAndColumn(par1InventoryCrafting, var4, var3);
|
||||
|
||||
if (var5 != null)
|
||||
{
|
||||
boolean var6 = false;
|
||||
Iterator var7 = var2.iterator();
|
||||
|
||||
while (var7.hasNext())
|
||||
{
|
||||
ItemStack var8 = (ItemStack)var7.next();
|
||||
|
||||
if (var5.itemID == var8.itemID && (var8.getItemDamage() == OreDictionary.WILDCARD_VALUE || var5.getItemDamage() == var8.getItemDamage()))
|
||||
{
|
||||
boolean matches=true;
|
||||
if (var8.hasTagCompound()) {
|
||||
NBTTagCompound tc = var8.getTagCompound();
|
||||
for (Object tag:tc.getTags().toArray()) {
|
||||
NBTBase base = (NBTBase)tag;
|
||||
Class nc = NBTBase.newTag(base.getId(), base.getName()).getClass();
|
||||
if (!(var5.hasTagCompound() &&
|
||||
nc.cast(var5.getTagCompound().getTag(base.getName())).equals(nc.cast(base)))) {
|
||||
matches=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (matches) {
|
||||
var6 = true;
|
||||
var2.remove(var8);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!var6)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return var2.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an Item that is the result of this recipe
|
||||
*/
|
||||
public ItemStack getCraftingResult(IInventory par1InventoryCrafting)
|
||||
{
|
||||
return this.recipeOutput.copy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the size of the recipe area
|
||||
*/
|
||||
public int getRecipeSize()
|
||||
{
|
||||
return this.recipeItems.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCost() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ObjectTags getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
package thaumcraft.api.crafting;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import thaumcraft.api.ObjectTags;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
|
||||
public class ShapelessInfusionCraftingWithNBTRecipes implements IInfusionRecipe
|
||||
{
|
||||
/** Is the ItemStack that you get when craft the recipe. */
|
||||
private final ItemStack recipeOutput;
|
||||
|
||||
/** Is a List of ItemStack that composes the recipe. */
|
||||
public final List recipeItems;
|
||||
|
||||
/** Is a List of nbt key/value pairs. */
|
||||
public final List<NBTBase> nbtList;
|
||||
|
||||
public String key;
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public int cost;
|
||||
|
||||
public ObjectTags tags;
|
||||
|
||||
public ShapelessInfusionCraftingWithNBTRecipes(String key,
|
||||
ItemStack par1ItemStack,
|
||||
List par2List, int cost, ObjectTags tags,
|
||||
List<NBTBase> nbtList)
|
||||
{
|
||||
this.recipeOutput = par1ItemStack;
|
||||
this.recipeItems = par2List;
|
||||
this.key = key;
|
||||
this.cost = cost;
|
||||
this.tags = tags;
|
||||
this.nbtList = nbtList;
|
||||
}
|
||||
|
||||
public ItemStack getRecipeOutput()
|
||||
{
|
||||
return this.recipeOutput;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to check if a recipe matches current crafting inventory
|
||||
*/
|
||||
public boolean matches(IInventory par1InventoryCrafting, EntityPlayer player)
|
||||
{
|
||||
if (key.length()>0 && !ThaumcraftApiHelper.isResearchComplete(player.username, key)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ArrayList var2 = new ArrayList(this.recipeItems);
|
||||
|
||||
for (int var3 = 0; var3 < 3; ++var3)
|
||||
{
|
||||
for (int var4 = 0; var4 < 3; ++var4)
|
||||
{
|
||||
ItemStack var5 = ThaumcraftApiHelper.getStackInRowAndColumn(par1InventoryCrafting, var4, var3);
|
||||
|
||||
if (var5 != null)
|
||||
{
|
||||
boolean var6 = false;
|
||||
Iterator var7 = var2.iterator();
|
||||
b1:
|
||||
while (var7.hasNext())
|
||||
{
|
||||
ItemStack var8 = (ItemStack)var7.next();
|
||||
|
||||
if (var5.itemID == var8.itemID && (var8.getItemDamage() == OreDictionary.WILDCARD_VALUE || var5.getItemDamage() == var8.getItemDamage()))
|
||||
{
|
||||
for (NBTBase nbt:nbtList) {
|
||||
try {
|
||||
Class nc = NBTBase.newTag(nbt.getId(), nbt.getName()).getClass();
|
||||
if (var5.hasTagCompound() &&
|
||||
nc.cast(var5.getTagCompound().getTag(nbt.getName())).equals(nc.cast(nbt))) {
|
||||
var6 = true;
|
||||
var2.remove(var8);
|
||||
break b1;
|
||||
}
|
||||
} catch (Exception e) {/*probably classcast*/}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!var6)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return var2.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an Item that is the result of this recipe
|
||||
*/
|
||||
public ItemStack getCraftingResult(IInventory par1InventoryCrafting)
|
||||
{
|
||||
return this.recipeOutput.copy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the size of the recipe area
|
||||
*/
|
||||
public int getRecipeSize()
|
||||
{
|
||||
return this.recipeItems.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCost() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ObjectTags getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
}
|
||||
9
common/thaumcraft/api/research/IScanEventHandler.java
Normal file
9
common/thaumcraft/api/research/IScanEventHandler.java
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
package thaumcraft.api.research;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IScanEventHandler {
|
||||
ScanResult scanPhenomena(ItemStack stack, World world, EntityPlayer player);
|
||||
}
|
||||
274
common/thaumcraft/api/research/ResearchItem.java
Normal file
274
common/thaumcraft/api/research/ResearchItem.java
Normal file
|
|
@ -0,0 +1,274 @@
|
|||
package thaumcraft.api.research;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import thaumcraft.api.ObjectTags;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ResearchItem
|
||||
{
|
||||
/**
|
||||
* A short string used as a key for this research. Must be unique
|
||||
*/
|
||||
public final String key;
|
||||
|
||||
/**
|
||||
* The name of the research shown in the thaumonomicon
|
||||
*/
|
||||
public String name;
|
||||
|
||||
/**
|
||||
* The blurb text shown below the research name in the thaumonomicon
|
||||
*/
|
||||
public String popupText;
|
||||
|
||||
/**
|
||||
* A longer description of the research. This is the text shown in the handheld research scroll and the research table.
|
||||
*/
|
||||
public String longText;
|
||||
|
||||
/**
|
||||
* The aspect tags and their values required to complete this research
|
||||
*/
|
||||
public final ObjectTags tags;
|
||||
|
||||
/**
|
||||
* This links to any research that needs to be completed before this research can be discovered or learnt.
|
||||
*/
|
||||
public ResearchItem[] parents = null;
|
||||
|
||||
/**
|
||||
* Like parent above, but a line will not be displayed in the thaumonomicon linking them. Just used to prevent clutter.
|
||||
*/
|
||||
public ResearchItem[] parentsHidden = null;
|
||||
/**
|
||||
* any research linked to this that will be unlocked automatically when this research is complete
|
||||
*/
|
||||
public ResearchItem[] siblings = null;
|
||||
|
||||
/**
|
||||
* the horizontal position of the research icon
|
||||
*/
|
||||
public final int displayColumn;
|
||||
|
||||
/**
|
||||
* the vertical position of the research icon
|
||||
*/
|
||||
public final int displayRow;
|
||||
|
||||
/**
|
||||
* the itemstack of an item or block that will be used as the icon for this research
|
||||
*/
|
||||
public final ItemStack itemStack;
|
||||
|
||||
/**
|
||||
* the index within the research.png file used for this research if it does not use an item icon
|
||||
*/
|
||||
public final int iconIndex;
|
||||
|
||||
/**
|
||||
* Special research has a spiky border. Used for important research milestones.
|
||||
*/
|
||||
private boolean isSpecial;
|
||||
/**
|
||||
* This indicates if the research should use a circular icon border. Usually used for research that doesn't
|
||||
* have recipes or that unlocks automatically via the sibling system
|
||||
*/
|
||||
private boolean isStub;
|
||||
/**
|
||||
* Indicates research that cannot be gained by normal means (either via normal or lost research),
|
||||
* but still uses a normal icon. Works much like isStub but is handy for mods that wish to add research
|
||||
* through their own means and keep a normal icon.
|
||||
*/
|
||||
private boolean isAlternate;
|
||||
/**
|
||||
* Hidden research does not display in the thaumonomicon until discovered
|
||||
*/
|
||||
private boolean isHidden;
|
||||
/**
|
||||
* Lost research can only be discovered via knowledge fragments
|
||||
*/
|
||||
private boolean isLost;
|
||||
/**
|
||||
* These research items will automatically unlock for all players on game start
|
||||
*/
|
||||
private boolean isAutoUnlock;
|
||||
|
||||
|
||||
|
||||
public ResearchItem(String par1, ObjectTags tags, int par3, int par4, int icon)
|
||||
{
|
||||
this(par1, tags, par3, par4, (ItemStack)null, icon);
|
||||
}
|
||||
|
||||
public ResearchItem(String par1, ObjectTags tags, int par3, int par4, ItemStack par5Item)
|
||||
{
|
||||
this(par1, tags, par3, par4, par5Item, -1);
|
||||
}
|
||||
|
||||
public ResearchItem(String par1, ObjectTags tags, int par3, int par4, Item par5Item)
|
||||
{
|
||||
this(par1, tags, par3, par4, new ItemStack(par5Item), -1);
|
||||
}
|
||||
|
||||
public ResearchItem(String par1, ObjectTags tags, int par3, int par4, Block par5Block)
|
||||
{
|
||||
this(par1, tags, par3, par4, new ItemStack(par5Block), -1);
|
||||
}
|
||||
|
||||
public ResearchItem(String par1, ObjectTags tags, int par3, int par4, ItemStack par5ItemStack, int icon)
|
||||
{
|
||||
this.key = par1;
|
||||
this.tags = tags;
|
||||
this.name = "";
|
||||
this.longText = "";
|
||||
this.popupText = "";
|
||||
|
||||
Element el = ThaumcraftApi.researchDoc.getElementById(key);
|
||||
if (el!=null) {
|
||||
NodeList children = el.getChildNodes();
|
||||
for (int a=0;a<children.getLength();a++) {
|
||||
if (children.item(a).getNodeName().equals("name")) {
|
||||
this.name = children.item(a).getTextContent();
|
||||
} else
|
||||
if (children.item(a).getNodeName().equals("longText")) {
|
||||
this.longText = children.item(a).getTextContent();
|
||||
} else
|
||||
if (children.item(a).getNodeName().equals("popupText") ) {
|
||||
this.popupText = children.item(a).getTextContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.itemStack = par5ItemStack;
|
||||
this.iconIndex = icon;
|
||||
this.displayColumn = par3;
|
||||
this.displayRow = par4;
|
||||
|
||||
|
||||
if (par3 < ResearchList.minDisplayColumn)
|
||||
{
|
||||
ResearchList.minDisplayColumn = par3;
|
||||
}
|
||||
|
||||
if (par4 < ResearchList.minDisplayRow)
|
||||
{
|
||||
ResearchList.minDisplayRow = par4;
|
||||
}
|
||||
|
||||
if (par3 > ResearchList.maxDisplayColumn)
|
||||
{
|
||||
ResearchList.maxDisplayColumn = par3;
|
||||
}
|
||||
|
||||
if (par4 > ResearchList.maxDisplayRow)
|
||||
{
|
||||
ResearchList.maxDisplayRow = par4;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public ResearchItem setSpecial()
|
||||
{
|
||||
this.isSpecial = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResearchItem setStub()
|
||||
{
|
||||
this.isStub = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResearchItem setAlternate()
|
||||
{
|
||||
this.isAlternate = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResearchItem setHidden()
|
||||
{
|
||||
this.isHidden = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResearchItem setLost()
|
||||
{
|
||||
this.isLost = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResearchItem setParents(ResearchItem... par)
|
||||
{
|
||||
this.parents = par;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResearchItem setParentsHidden(ResearchItem... par)
|
||||
{
|
||||
this.parentsHidden = par;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResearchItem setSiblings(ResearchItem... sib)
|
||||
{
|
||||
this.siblings = sib;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResearchItem registerResearchItem()
|
||||
{
|
||||
ResearchList.research.put(key, this);
|
||||
return this;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getName()
|
||||
{
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean getSpecial()
|
||||
{
|
||||
return this.isSpecial;
|
||||
}
|
||||
|
||||
public boolean getStub()
|
||||
{
|
||||
return this.isStub;
|
||||
}
|
||||
|
||||
public boolean getAlternate()
|
||||
{
|
||||
return this.isAlternate;
|
||||
}
|
||||
|
||||
public boolean getHidden()
|
||||
{
|
||||
return this.isHidden;
|
||||
}
|
||||
|
||||
public boolean getLost()
|
||||
{
|
||||
return this.isLost;
|
||||
}
|
||||
|
||||
public boolean getAutoUnlock() {
|
||||
return isAutoUnlock;
|
||||
}
|
||||
|
||||
public ResearchItem setAutoUnlock()
|
||||
{
|
||||
this.isAutoUnlock = true;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
91
common/thaumcraft/api/research/ResearchList.java
Normal file
91
common/thaumcraft/api/research/ResearchList.java
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
package thaumcraft.api.research;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import thaumcraft.api.EnumTag;
|
||||
|
||||
public class ResearchList {
|
||||
|
||||
/** Is the smallest column used on the GUI. */
|
||||
public static int minDisplayColumn;
|
||||
|
||||
/** Is the smallest row used on the GUI. */
|
||||
public static int minDisplayRow;
|
||||
|
||||
/** Is the biggest column used on the GUI. */
|
||||
public static int maxDisplayColumn;
|
||||
|
||||
/** Is the biggest row used on the GUI. */
|
||||
public static int maxDisplayRow;
|
||||
|
||||
//Research
|
||||
public static Map<String, ResearchItem> research = new HashMap<String,ResearchItem>();
|
||||
|
||||
|
||||
public static Map<String, List> craftingRecipesForResearch = new HashMap<String, List>();
|
||||
|
||||
//
|
||||
|
||||
|
||||
/**
|
||||
* @param key
|
||||
* @return the research item linked to this key
|
||||
*/
|
||||
public static ResearchItem getResearch(String key) {
|
||||
return research.get(key);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param key
|
||||
* @return the name of the research linked to this key
|
||||
*/
|
||||
public static String getResearchName(String key) {
|
||||
ResearchItem rr = research.get(key);
|
||||
if (rr==null) return "";
|
||||
return rr.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key
|
||||
* @return a list of the enumtags used in this research. returns the numeric values and not the actual enum
|
||||
*/
|
||||
public static byte[] getResearchTags(String key) {
|
||||
ResearchItem rr = research.get(key);
|
||||
if (rr==null) return null;
|
||||
byte[] output = new byte[rr.tags.size()];
|
||||
EnumTag[] et = rr.tags.getAspects();
|
||||
for (int a=0;a<rr.tags.size();a++) {
|
||||
output[a] = (byte) et[a].id;
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key
|
||||
* @return the aspect enumtag ordinal with the highest value. Used to determine scroll color and similar things
|
||||
*/
|
||||
public static int getResearchPrimaryTag(String key) {
|
||||
int t=0;
|
||||
int amt=0;
|
||||
ResearchItem rr = research.get(key);
|
||||
if (rr==null) return 0;
|
||||
for (EnumTag tag:rr.tags.getAspects()) {
|
||||
if (rr.tags.getAmount(tag)>amt) {
|
||||
t=tag.id;
|
||||
amt=rr.tags.getAmount(tag);
|
||||
};
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
public static int getResearchAmount(String key, EnumTag tag) {
|
||||
ResearchItem rr = research.get(key);
|
||||
if (rr==null) return 0;
|
||||
return rr.tags.getAmount(tag);
|
||||
}
|
||||
|
||||
}
|
||||
14
common/thaumcraft/api/research/ResearchPlayer.java
Normal file
14
common/thaumcraft/api/research/ResearchPlayer.java
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
package thaumcraft.api.research;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ResearchPlayer {
|
||||
public Map<String,List<String>> researchCompleted = new HashMap<String,List<String>>();
|
||||
|
||||
public Map<String,List<Short[]>> objectsScanned = new HashMap<String,List<Short[]>>();
|
||||
public Map<String,List<String>> entitiesScanned = new HashMap<String,List<String>>();
|
||||
public Map<String,List<String>> phenomenaScanned = new HashMap<String,List<String>>();
|
||||
|
||||
}
|
||||
39
common/thaumcraft/api/research/ScanResult.java
Normal file
39
common/thaumcraft/api/research/ScanResult.java
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
package thaumcraft.api.research;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ScanResult {
|
||||
public byte type = 0; //1=blocks,2=entities,3=phenomena
|
||||
public int blockId;
|
||||
public int blockMeta;
|
||||
public Entity entity;
|
||||
public String phenomena;
|
||||
|
||||
public ScanResult(byte type, int blockId, int blockMeta, Entity entity,
|
||||
String phenomena) {
|
||||
super();
|
||||
this.type = type;
|
||||
this.blockId = blockId;
|
||||
this.blockMeta = blockMeta;
|
||||
this.entity = entity;
|
||||
this.phenomena = phenomena;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof ScanResult) {
|
||||
ScanResult sr = (ScanResult) obj;
|
||||
if (type != sr.type)
|
||||
return false;
|
||||
if (type == 1
|
||||
&& (blockId != sr.blockId || blockMeta != sr.blockMeta))
|
||||
return false;
|
||||
if (type == 2 && entity.entityId != sr.entity.entityId)
|
||||
return false;
|
||||
if (type == 3 && !phenomena.equals(sr.phenomena))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
BIN
mods/Experiments/textures/misc/spark.png
Normal file
BIN
mods/Experiments/textures/misc/spark.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 201 B |
BIN
mods/MysticTextures/OreStone_.psd
Normal file
BIN
mods/MysticTextures/OreStone_.psd
Normal file
Binary file not shown.
BIN
mods/MysticTextures/textures/armor/adamantine_1.png
Normal file
BIN
mods/MysticTextures/textures/armor/adamantine_1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
BIN
mods/MysticTextures/textures/armor/adamantine_2.png
Normal file
BIN
mods/MysticTextures/textures/armor/adamantine_2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
BIN
mods/MysticTextures/textures/armor/iridium_1.png
Normal file
BIN
mods/MysticTextures/textures/armor/iridium_1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
BIN
mods/MysticTextures/textures/armor/iridium_2.png
Normal file
BIN
mods/MysticTextures/textures/armor/iridium_2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
BIN
mods/MysticTextures/textures/armor/mithril_1.png
Normal file
BIN
mods/MysticTextures/textures/armor/mithril_1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue