Begin updating Iron Chests to 1.13, Chests cannot be opened yet but are visible in game.

This commit is contained in:
alexbegt 2019-01-06 16:19:30 -05:00
parent e3130b3e32
commit 402bd8f5f7
116 changed files with 4742 additions and 99 deletions

21
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,21 @@
<!--- We do not take bug reports for outdated builds of Minecraft, or unofficial builds. -->
<!--- Provide a general summary of the issue in the Title above -->
## Version Information
`Minecraft: `
`Forge: `
`Iron Chests: `
## Report Information
<!-- Please provide a detailed description of the issue -->
## Steps to Reproduce
<!-- Please try to provide a way to reproduce the bug reported -->
## Crash Log
<!-- If you crash, please upload the crash log to gist.github.com or pastebin.com and provide a link here -->
## Forge Log
<!-- Upload the fml-client-latest.log to gist.github.com or pastebin.com and provide a link here -->
<!-- Thank you for reporting! -->

674
LICENSE Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@ -1,24 +1,25 @@
// This sets us up for building a forge project - you need all of these
buildscript {
repositories {
mavenLocal()
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
mavenCentral()
}
// This is only here while i'm activly developing FG, Remind me to remove when we publically release
configurations {
classpath.resolutionStrategy {
cacheDynamicVersionsFor 10, 'seconds'
cacheChangingModulesFor 0, 'seconds'
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
}
}
plugins {
id "com.matthewprenger.cursegradle" version "1.0.9"
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'net.minecraftforge.gradle'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'
// This is a simple flatdir repository for "uploadArchives" when you don't have a remote repo to target
repositories {
@ -32,38 +33,58 @@ repositories {
}
}
dependencies {
deobfCompile "mezz.jei:jei_1.12.2:4.10.+"
}
// This is our group. I'm cpw.mods
group = "cpw.mods" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
// This is our actual project within the group. Note: FML has "fml" here. But this is ironchest.
archivesBaseName = "ironchest"
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}
// Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here
minecraft {
version = "1.12.2-14.23.4.2708"
mappings = "snapshot_20180616"
runDir = "run"
mappings channel: 'snapshot', version: mappings_version
// default run configurations.
// these can be tweaked, removed, or duplicated as needed.
runConfig {
name= "Minecraft Client"
main= "net.minecraftforge.userdev.UserdevLauncher"
ideaModuleName = "${project.name}_main"
workingDirectory = project.file("run").canonicalPath
environment "target", "fmluserdevclient"
environment "assetDirectory", downloadAssets.output.absolutePath
environment "FORGE_VERSION", forge_version
environment "FORGE_GROUP", forge_group
environment "MCP_VERSION", mappings_version
environment "MC_VERSION", minecraft_version
environment "MOD_CLASSES", "${sourceSets.main.output.resourcesDir}${File.pathSeparator}${sourceSets.main.output.classesDirs.join(File.pathSeparator)}"
}
runConfig {
name= "Minecraft Server"
main= "net.minecraftforge.userdev.UserdevLauncher"
ideaModuleName = "${project.name}_main"
workingDirectory = project.file("run").canonicalPath
environment "target", "fmluserdevserver"
environment "assetDirectory", downloadAssets.output.absolutePath
environment "FORGE_VERSION", forge_version
environment "FORGE_GROUP", forge_group
environment "MCP_VERSION", mappings_version
environment "MC_VERSION", minecraft_version
environment "MOD_CLASSES", "${sourceSets.main.output.resourcesDir}${File.pathSeparator}${sourceSets.main.output.classesDirs.join(File.pathSeparator)}"
}
}
dependencies {
minecraft 'net.minecraftforge.test:userdev:' + minecraft_version + '-' + forge_version
compile 'net.minecraftforge.test:forge:' + minecraft_version + '-' + forge_version + ':launcher'
}
// IronChest uses git tagging to mark major versions. This sets up the project version to that version data
def versionInfo = getGitVersion()
version = "${project.minecraft.version}-${versionInfo['IronChest.version']}"
curseforge {
apiKey = project.hasProperty('curseforge_apikey') ? project.curseforge_apikey : '0'
project {
id = '228756'
changelog = 'Empty'
releaseType = 'beta'
}
}
version = minecraft_version + "-${versionInfo['IronChest.version']}"
// This wrangles the resources for the jar files- stuff like textures and languages
processResources
@ -72,15 +93,15 @@ processResources
exclude '**/*.xcf'
// we only want to do search/replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
include 'META_INF/mods.toml'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
expand 'version':project.version, 'mcversion':minecraft_version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
exclude 'META_INF/mods.toml'
}
// generate version.properties file from the git version data earlier
@ -88,7 +109,7 @@ processResources
def propsFile = new File(destinationDir, 'version.properties')
def properties = new Properties()
properties.putAll(versionInfo)
properties['IronChest.build.mcversion'] = project.minecraft.version
properties['IronChest.build.mcversion'] = minecraft_version
properties.store(propsFile.newWriter(), null)
}
}

17
gradle.properties Normal file
View File

@ -0,0 +1,17 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
mod_version=1.0.0
# Minecraft Version Information
minecraft_version=1.13
minecraft_version_toml=13
# Forge Version Information
forge_version=24.0.55-1.13-pre
forge_version_toml=24
forge_group=net.minecraftforge.test
# Mappings Information
mappings_version=20181221-1.13.1

Binary file not shown.

View File

@ -1,6 +1,5 @@
#Sun Nov 22 23:58:08 EST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip

110
gradlew vendored
View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
##############################################################################
##
@ -6,47 +6,6 @@
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
@ -61,9 +20,49 @@ while [ -h "$PRG" ] ; do
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@ -90,7 +89,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@ -114,6 +113,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
@ -154,11 +154,19 @@ if $cygwin ; then
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

14
gradlew.bat vendored
View File

@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
@ -46,10 +46,9 @@ echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line

57
idea/code_style.xml Normal file
View File

@ -0,0 +1,57 @@
<code_scheme name="Iron Chests Formatting Guidelines">
<option name="RIGHT_MARGIN" value="160"/>
<option name="ENABLE_JAVADOC_FORMATTING" value="false"/>
<option name="FORMATTER_TAGS_ENABLED" value="true" />
<JSON>
<option name="OBJECT_WRAPPING" value="5"/>
<option name="ARRAY_WRAPPING" value="5"/>
</JSON>
<codeStyleSettings language="JAVA">
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false"/>
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false"/>
<option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1"/>
<option name="KEEP_BLANK_LINES_IN_CODE" value="1"/>
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1"/>
<option name="BLANK_LINES_AROUND_FIELD" value="1"/>
<option name="BRACE_STYLE" value="2"/>
<option name="CLASS_BRACE_STYLE" value="2"/>
<option name="METHOD_BRACE_STYLE" value="2"/>
<option name="ELSE_ON_NEW_LINE" value="true"/>
<option name="WHILE_ON_NEW_LINE" value="true"/>
<option name="CATCH_ON_NEW_LINE" value="true"/>
<option name="FINALLY_ON_NEW_LINE" value="true"/>
<option name="ALIGN_MULTILINE_PARAMETERS" value="false"/>
<option name="ALIGN_MULTILINE_RESOURCES" value="false"/>
<option name="SPACE_WITHIN_ARRAY_INITIALIZER_BRACES" value="true"/>
<option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true"/>
<option name="CALL_PARAMETERS_WRAP" value="1"/>
<option name="METHOD_PARAMETERS_WRAP" value="1"/>
<option name="RESOURCE_LIST_WRAP" value="5"/>
<option name="EXTENDS_LIST_WRAP" value="1"/>
<option name="THROWS_LIST_WRAP" value="1"/>
<option name="EXTENDS_KEYWORD_WRAP" value="1"/>
<option name="THROWS_KEYWORD_WRAP" value="1"/>
<option name="METHOD_CALL_CHAIN_WRAP" value="1"/>
<option name="BINARY_OPERATION_WRAP" value="1"/>
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true"/>
<option name="TERNARY_OPERATION_WRAP" value="5"/>
<option name="ARRAY_INITIALIZER_WRAP" value="1"/>
<option name="IF_BRACE_FORCE" value="3"/>
<option name="DOWHILE_BRACE_FORCE" value="3"/>
<option name="FOR_BRACE_FORCE" value="3"/>
<option name="CLASS_ANNOTATION_WRAP" value="0"/>
<option name="FIELD_ANNOTATION_WRAP" value="0"/>
<indentOptions>
<option name="USE_TAB_CHARACTER" value="true"/>
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JSON">
<option name="KEEP_BLANK_LINES_IN_CODE" value="2"/>
<option name="SPACE_WITHIN_BRACKETS" value="true"/>
<option name="SPACE_WITHIN_BRACES" value="true"/>
<indentOptions>
<option name="INDENT_SIZE" value="4"/>
<option name="USE_TAB_CHARACTER" value="true"/>
</indentOptions>
</codeStyleSettings>
</code_scheme>

31
idea/inspections.xml Normal file
View File

@ -0,0 +1,31 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Iron Chests"/>
<inspection_tool class="ClassReferencesSubclass" enabled="true" level="WARNING" enabled_by_default="true"/>
<inspection_tool class="InstanceofThis" enabled="true" level="WARNING" enabled_by_default="true"/>
<inspection_tool class="MissingOverrideAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="ignoreObjectMethods" value="true"/>
<option name="ignoreAnonymousClassMethods" value="false"/>
</inspection_tool>
<inspection_tool class="NullableProblems" enabled="true" level="WARNING" enabled_by_default="true">
<option name="REPORT_NULLABLE_METHOD_OVERRIDES_NOTNULL" value="true"/>
<option name="REPORT_NOT_ANNOTATED_METHOD_OVERRIDES_NOTNULL" value="false"/>
<option name="REPORT_NOTNULL_PARAMETER_OVERRIDES_NULLABLE" value="false"/>
<option name="REPORT_NOT_ANNOTATED_PARAMETER_OVERRIDES_NOTNULL" value="true"/>
<option name="REPORT_NOT_ANNOTATED_GETTER" value="false"/>
<option name="REPORT_NOT_ANNOTATED_SETTER_PARAMETER" value="true"/>
<option name="REPORT_ANNOTATION_NOT_PROPAGATED_TO_OVERRIDERS" value="false"/>
<option name="REPORT_NULLS_PASSED_TO_NON_ANNOTATED_METHOD" value="true"/>
</inspection_tool>
<inspection_tool class="ObsoleteCollection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoreRequiredObsoleteCollectionTypes" value="false"/>
</inspection_tool>
<inspection_tool class="RedundantSuppression" enabled="true" level="WARNING" enabled_by_default="true"/>
<inspection_tool class="SystemOutErr" enabled="true" level="WARNING" enabled_by_default="true"/>
<inspection_tool class="ThrowablePrintStackTrace" enabled="true" level="WARNING" enabled_by_default="true"/>
<inspection_tool class="UnqualifiedFieldAccess" enabled="true" level="WARNING" enabled_by_default="true"/>
<inspection_tool class="UnqualifiedMethodAccess" enabled="true" level="WARNING" enabled_by_default="true"/>
<inspection_tool class="UnusedImport" enabled="true" level="WARNING" enabled_by_default="true"/>
<inspection_tool class="UseOfObsoleteDateTimeApi" enabled="true" level="WARNING" enabled_by_default="true"/>
</profile>
</component>

19
settings.gradle Normal file
View File

@ -0,0 +1,19 @@
/*
* This settings file was auto generated by the Gradle buildInit task
* by 'sunstrike' at '21/11/13 14:14' with Gradle 1.9
*
* The settings file is used to specify which projects to include in your build.
* In a single project build this file can be empty or even removed.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user guide at http://gradle.org/docs/1.9/userguide/multi_project_builds.html
*/
/*
// To declare projects as part of a multi-project build use the 'include' method
include 'shared'
include 'api'
include 'services:webservice'
*/
rootProject.name = 'ironchest'

View File

@ -0,0 +1,41 @@
package invtweaks.api.container;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* A marker for containers that have a chest-like persistent storage component. Enables the Inventory Tweaks sorting
* buttons for this container.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface ChestContainer
{
// Set to true if the Inventory Tweaks sorting buttons should be shown for this container.
boolean showButtons() default true;
// Size of a chest row
int rowSize() default 9;
// Uses 'large chest' mode for sorting buttons
// (Renders buttons vertically down the right side of the GUI)
boolean isLargeChest() default false;
// Annotation for method to get size of a chest row if it is not a fixed size for this container class
// Signature int func()
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@interface RowSizeCallback
{
}
// Annotation for method to get size of a chest row if it is not a fixed size for this container class
// Signature boolean func()
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@interface IsLargeCallback
{
}
}

View File

@ -0,0 +1,54 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest;
import cpw.mods.ironchest.client.ClientProxy;
import cpw.mods.ironchest.common.ServerProxy;
import cpw.mods.ironchest.common.core.IronChestBlocks;
import cpw.mods.ironchest.common.core.IronChestItems;
import cpw.mods.ironchest.common.tileentity.IronChestEntityType;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.javafmlmod.FMLModLoadingContext;
@Mod(value = IronChest.MOD_ID)
public class IronChest
{
public static final String MOD_ID = "ironchest";
public static IronChest instance;
public static ServerProxy proxy = DistExecutor.runForDist(() -> ClientProxy::new, () -> ServerProxy::new);
public IronChestBlocks ironChestBlocks = new IronChestBlocks();
public IronChestItems ironChestItems = new IronChestItems();
public IronChestEntityType ironChestEntityType = new IronChestEntityType();
public IronChest()
{
instance = this;
FMLModLoadingContext.get().getModEventBus().addListener(this::preInit);
}
private void preInit(final FMLPreInitializationEvent event)
{
proxy.preInit();
ironChestBlocks.registerBlocks();
ironChestBlocks.registerItems();
ironChestItems.registerItems();
ironChestEntityType.registerTileEntities();
ironChestEntityType.createEntries();
}
}

View File

@ -0,0 +1,39 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.client;
import cpw.mods.ironchest.client.renderer.TileEntityIronChestRenderer;
import cpw.mods.ironchest.common.ServerProxy;
import cpw.mods.ironchest.common.blocks.IronChestType;
import net.minecraftforge.fml.client.registry.ClientRegistry;
public class ClientProxy extends ServerProxy
{
public ClientProxy()
{
}
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public void preInit()
{
System.out.println("hello");
super.preInit();
for (IronChestType type : IronChestType.values())
{
if (type.clazz != null)
{
ClientRegistry.bindTileEntitySpecialRenderer(type.clazz, new TileEntityIronChestRenderer());
}
}
}
}

View File

@ -0,0 +1,137 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.client.gui;
import cpw.mods.ironchest.common.blocks.IronChestType;
import cpw.mods.ironchest.common.gui.ContainerIronChest;
import cpw.mods.ironchest.common.tileentity.TileEntityIronChest;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
public class GUIChest extends GuiContainer
{
public enum ResourceList
{
//@formatter:off
IRON(new ResourceLocation("ironchest", "textures/gui/iron_container.png")),
COPPER(new ResourceLocation("ironchest", "textures/gui/copper_container.png")),
SILVER(new ResourceLocation("ironchest", "textures/gui/silver_container.png")),
GOLD(new ResourceLocation("ironchest", "textures/gui/gold_container.png")),
DIAMOND(new ResourceLocation("ironchest", "textures/gui/diamond_container.png")),
DIRT(new ResourceLocation("ironchest", "textures/gui/dirt_container.png"));
//@formatter:on
public final ResourceLocation location;
ResourceList(ResourceLocation loc)
{
this.location = loc;
}
}
public enum GUI
{
//@formatter:off
IRON(184, 202, ResourceList.IRON, IronChestType.IRON),
GOLD(184, 256, ResourceList.GOLD, IronChestType.GOLD),
DIAMOND(238, 256, ResourceList.DIAMOND, IronChestType.DIAMOND),
COPPER(184, 184, ResourceList.COPPER, IronChestType.COPPER),
SILVER(184, 238, ResourceList.SILVER, IronChestType.SILVER),
CRYSTAL(238, 256, ResourceList.DIAMOND, IronChestType.CRYSTAL),
OBSIDIAN(238, 256, ResourceList.DIAMOND,IronChestType.OBSIDIAN),
DIRTCHEST9000(184, 184, ResourceList.DIRT, IronChestType.DIRTCHEST9000);
//@formatter:on
private int xSize;
private int ySize;
private ResourceList guiResourceList;
private IronChestType mainType;
GUI(int xSize, int ySize, ResourceList guiResourceList, IronChestType mainType)
{
this.xSize = xSize;
this.ySize = ySize;
this.guiResourceList = guiResourceList;
this.mainType = mainType;
}
protected Container makeContainer(IInventory playerInventory, IInventory chestInventory, EntityPlayer player)
{
return new ContainerIronChest(playerInventory, chestInventory, this.mainType, player, this.xSize, this.ySize);
}
public static GUIChest buildGUI(IronChestType type, IInventory playerInventory, TileEntityIronChest chestInventory)
{
return new GUIChest(values()[chestInventory.getIronChestType().ordinal()], playerInventory, chestInventory);
}
}
private GUI type;
private final IInventory upperChestInventory;
private final IInventory lowerChestInventory;
private GUIChest(GUI type, IInventory playerInventory, IInventory chestInventory)
{
super(type.makeContainer(playerInventory, chestInventory, Minecraft.getInstance().player));
this.type = type;
this.xSize = type.xSize;
this.ySize = type.ySize;
this.upperChestInventory = playerInventory;
this.lowerChestInventory = chestInventory;
this.allowUserInput = false;
}
/**
* Draws the screen and all the components in it.
*/
@Override
public void render(int mouseX, int mouseY, float partialTicks)
{
this.drawDefaultBackground();
super.render(mouseX, mouseY, partialTicks);
this.renderHoveredToolTip(mouseX, mouseY);
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
{
this.fontRenderer.drawString(this.lowerChestInventory.getDisplayName().getString(), 8.0F, 6.0F, 4210752);
this.fontRenderer.drawString(this.upperChestInventory.getDisplayName().getString(), 8.0F, this.ySize - 96 + 2, 4210752);
}
/**
* Draws the background layer of this container (behind the items).
*/
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(this.type.guiResourceList.location);
int x = (this.width - this.xSize) / 2;
int y = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
}
}

View File

@ -0,0 +1,222 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.client.renderer;
import java.util.Random;
import com.google.common.primitives.SignedBytes;
import cpw.mods.ironchest.common.blocks.BlockChest;
import cpw.mods.ironchest.common.blocks.BlockIronChest;
import cpw.mods.ironchest.common.blocks.IronChestType;
import cpw.mods.ironchest.common.core.IronChestBlocks;
import cpw.mods.ironchest.common.tileentity.TileEntityCrystalChest;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderEntityItem;
import net.minecraft.client.renderer.entity.model.ModelChest;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.IChestLid;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
public class TileEntityIronChestRenderer<T extends TileEntity & IChestLid> extends TileEntityRenderer<T>
{
private Random random;
private RenderEntityItem itemRenderer;
private ModelChest model;
//@formatter:off
private static float[][] shifts = {
{ 0.3F, 0.45F, 0.3F },
{ 0.7F, 0.45F, 0.3F },
{ 0.3F, 0.45F, 0.7F },
{ 0.7F, 0.45F, 0.7F },
{ 0.3F, 0.1F, 0.3F },
{ 0.7F, 0.1F, 0.3F },
{ 0.3F, 0.1F, 0.7F },
{ 0.7F, 0.1F, 0.7F },
{ 0.5F, 0.32F, 0.5F } };
//@formatter:on
private static EntityItem customitem = new EntityItem(null);
public TileEntityIronChestRenderer()
{
this.model = new ModelChest();
this.random = new Random();
}
@Override
public void render(T tileEntityIn, double x, double y, double z, float partialTicks, int destroyStage)
{
GlStateManager.enableDepthTest();
GlStateManager.depthFunc(515);
GlStateManager.depthMask(true);
IBlockState iblockstate = tileEntityIn.hasWorld() ? tileEntityIn.getBlockState() : (IBlockState) IronChestBlocks.ironChestBlock.getDefaultState().with(BlockIronChest.FACING, EnumFacing.SOUTH);
IronChestType chesttype = IronChestType.IRON;
IronChestType typeNew = BlockChest.getTypeFromBlock(iblockstate.getBlock());
if (typeNew != null)
{
chesttype = typeNew;
}
if (destroyStage >= 0)
{
this.bindTexture(DESTROY_STAGES[destroyStage]);
GlStateManager.matrixMode(5890);
GlStateManager.pushMatrix();
GlStateManager.scalef(4F, 4F, 1F);
GlStateManager.translatef(0.0625F, 0.0625F, 0.0625F);
GlStateManager.matrixMode(5888);
}
else
{
this.bindTexture(chesttype.modelTexture);
}
GlStateManager.pushMatrix();
if (chesttype == IronChestType.CRYSTAL)
{
GlStateManager.disableCull();
}
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.translatef((float) x, (float) y + 1.0F, (float) z + 1.0F);
GlStateManager.scalef(1.0F, -1.0F, -1.0F);
float f = iblockstate.get(BlockIronChest.FACING).getHorizontalAngle();
if (Math.abs(f) > 1.0E-5D)
{
GlStateManager.translatef(0.5F, 0.5F, 0.5F);
GlStateManager.rotatef(f, 0.0F, 1.0F, 0.0F);
GlStateManager.translatef(-0.5F, -0.5F, -0.5F);
}
if (chesttype.isTransparent())
{
GlStateManager.scalef(1F, 0.99F, 1F);
}
this.rotateChestLid(tileEntityIn, partialTicks, model);
model.renderAll();
if (chesttype == IronChestType.CRYSTAL)
{
GlStateManager.enableCull();
}
GlStateManager.popMatrix();
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
if (destroyStage >= 0)
{
GlStateManager.matrixMode(5890);
GlStateManager.popMatrix();
GlStateManager.matrixMode(5888);
}
if (chesttype.isTransparent() && tileEntityIn.getDistanceSq(this.rendererDispatcher.entityX, this.rendererDispatcher.entityY, this.rendererDispatcher.entityZ) < 128d)
{
this.random.setSeed(254L);
float shiftX;
float shiftY;
float shiftZ;
int shift = 0;
float blockScale = 0.70F;
float timeD = (float) (360D * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) - partialTicks;
if (((TileEntityCrystalChest) tileEntityIn).getTopItems().get(1).isEmpty())
{
shift = 8;
blockScale = 0.85F;
}
GlStateManager.pushMatrix();
GlStateManager.translatef((float) x, (float) y, (float) z);
customitem.setWorld(this.getWorld());
customitem.hoverStart = 0F;
for (ItemStack item : ((TileEntityCrystalChest) tileEntityIn).getTopItems())
{
if (shift > shifts.length || shift > 8)
{
break;
}
if (item.isEmpty())
{
shift++;
continue;
}
shiftX = shifts[shift][0];
shiftY = shifts[shift][1];
shiftZ = shifts[shift][2];
shift++;
GlStateManager.pushMatrix();
GlStateManager.translatef(shiftX, shiftY, shiftZ);
GlStateManager.rotatef(timeD, 0F, 1F, 0F);
GlStateManager.scalef(blockScale, blockScale, blockScale);
customitem.setItem(item);
if (this.itemRenderer == null)
{
this.itemRenderer = new RenderEntityItem(Minecraft.getInstance().getRenderManager(), Minecraft.getInstance().getItemRenderer())
{
@Override
public int getModelCount(ItemStack stack)
{
return SignedBytes.saturatedCast(Math.min(stack.getCount() / 32, 15) + 1);
}
@Override
public boolean shouldBob()
{
return false;
}
@Override
public boolean shouldSpreadItems()
{
return true;
}
};
}
this.itemRenderer.doRender(customitem, 0D, 0D, 0D, 0F, partialTicks);
GlStateManager.popMatrix();
}
GlStateManager.popMatrix();
}
}
private void rotateChestLid(T tileEntityIn, float lidAngleIn, ModelChest modelIn)
{
float f = ((IChestLid) tileEntityIn).getLidAngle(lidAngleIn);
f = 1.0F - f;
f = 1.0F - f * f * f;
modelIn.getLid().rotateAngleX = -(f * ((float) Math.PI / 2F));
}
}

View File

@ -0,0 +1,19 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common;
public class ServerProxy
{
public void preInit()
{
}
}

View File

@ -0,0 +1,52 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.ai;
import cpw.mods.ironchest.common.blocks.BlockChest;
import cpw.mods.ironchest.common.tileentity.TileEntityIronChest;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.ai.EntityAIOcelotSit;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorldReaderBase;
public class IronChestAIOcelotSit extends EntityAIOcelotSit
{
public IronChestAIOcelotSit(EntityOcelot ocelotIn, float speedIn)
{
super(ocelotIn, speedIn);
}
/**
* Return true to set given position as destination
*/
@Override
protected boolean shouldMoveTo(IWorldReaderBase worldIn, BlockPos pos)
{
if (!worldIn.isAirBlock(pos.up()))
{
return false;
}
else
{
IBlockState iblockstate = worldIn.getBlockState(pos);
Block block = iblockstate.getBlock();
if (block instanceof BlockChest)
{
return TileEntityIronChest.getPlayersUsing(worldIn, pos) < 1;
}
return super.shouldMoveTo(worldIn, pos);
}
}
}

View File

@ -0,0 +1,47 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.ai;
import java.util.HashSet;
import net.minecraft.entity.ai.EntityAIOcelotSit;
import net.minecraft.entity.ai.EntityAITasks.EntityAITaskEntry;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
public class OcelotsSitOnChestsHandler
{
@SubscribeEvent
public void changeSittingTaskForOcelots(LivingUpdateEvent evt)
{
if (evt.getEntityLiving().ticksExisted < 5 && evt.getEntityLiving() instanceof EntityOcelot)
{
HashSet<EntityAITaskEntry> hashset = new HashSet<EntityAITaskEntry>();
EntityOcelot ocelot = (EntityOcelot) evt.getEntityLiving();
for (EntityAITaskEntry task : ocelot.tasks.taskEntries)
{
if (task.action.getClass() == EntityAIOcelotSit.class)
{
hashset.add(task);
}
}
for (EntityAITaskEntry task : hashset)
{
ocelot.tasks.removeTask(task.action);
ocelot.tasks.addTask(task.priority, new IronChestAIOcelotSit(ocelot, 0.4F));
}
}
}
}

View File

@ -0,0 +1,255 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.blocks;
import javax.annotation.Nullable;
import cpw.mods.ironchest.common.tileentity.TileEntityIronChest;
import net.minecraft.block.Block;
import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.IBlockState;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Enchantments;
import net.minecraft.init.Items;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.DirectionProperty;
import net.minecraft.state.StateContainer;
import net.minecraft.stats.StatList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.INameable;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.ILockableContainer;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
public abstract class BlockChest extends Block implements ITileEntityProvider
{
public static final DirectionProperty FACING = BlockHorizontal.HORIZONTAL_FACING;
protected static final VoxelShape IRON_CHEST_SHAPE = Block.makeCuboidShape(1.0D, 0.0D, 1.0D, 15.0D, 14.0D, 15.0D);
public IronChestType type;
public BlockChest(Builder properties, IronChestType type)
{
super(properties);
this.setDefaultState(((this.stateContainer.getBaseState()).with(FACING, EnumFacing.NORTH)));
this.type = type;
this.setRegistryName(new ResourceLocation(type.itemName));
}
@Override
public boolean isSolid(IBlockState state)
{
return false;
}
@Override
public boolean isFullCube(IBlockState state)
{
return false;
}
@Override
@OnlyIn(Dist.CLIENT)
public boolean hasCustomBreakingProgress(IBlockState state)
{
return true;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state)
{
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
}
@Override
public IBlockState getStateForPlacement(BlockItemUseContext context)
{
EnumFacing enumfacing = context.getPlacementHorizontalFacing().getOpposite();
return this.getDefaultState().with(FACING, enumfacing);
}
@Override
public VoxelShape getShape(IBlockState state, IBlockReader worldIn, BlockPos pos)
{
return IRON_CHEST_SHAPE;
}
@Override
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity != null && tileentity instanceof TileEntityIronChest)
{
TileEntityIronChest teic = (TileEntityIronChest) tileentity;
teic.wasPlaced(placer, stack);
if (stack.hasDisplayName())
{
teic.setCustomName(stack.getDisplayName());
}
}
}
@SuppressWarnings("deprecation")
@Override
public void onReplaced(IBlockState state, World worldIn, BlockPos pos, IBlockState newState, boolean isMoving)
{
if (state.getBlock() != newState.getBlock())
{
TileEntityIronChest tileentity = (TileEntityIronChest) worldIn.getTileEntity(pos);
if (tileentity != null)
{
InventoryHelper.dropInventoryItems(worldIn, pos, tileentity);
worldIn.updateComparatorOutputLevel(pos, this);
tileentity.removeAdornments();
}
super.onReplaced(state, worldIn, pos, newState, isMoving);
}
}
@SuppressWarnings("deprecation")
@Override
public boolean eventReceived(IBlockState state, World worldIn, BlockPos pos, int id, int param)
{
super.eventReceived(state, worldIn, pos, id, param);
TileEntity tileentity = worldIn.getTileEntity(pos);
return tileentity == null ? false : tileentity.receiveClientEvent(id, param);
}
@Override
public boolean hasTileEntity(IBlockState state)
{
return true;
}
@Nullable
public ILockableContainer getContainer(IBlockState state, World worldIn, BlockPos pos)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (!(tileentity instanceof TileEntityIronChest))
{
return null;
}
else
{
return (ILockableContainer) tileentity;
}
}
@SuppressWarnings("deprecation")
@Override
public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, ItemStack stack)
{
if (te instanceof INameable && ((INameable) te).hasCustomName())
{
player.addStat(StatList.BLOCK_MINED.get(this));
player.addExhaustion(0.005F);
if (worldIn.isRemote)
{
return;
}
int i = EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, stack);
Item item = this.getItemDropped(state, worldIn, pos, i).asItem();
if (item == Items.AIR)
{
return;
}
ItemStack itemstack = new ItemStack(item, this.quantityDropped(state, worldIn.rand));
itemstack.setDisplayName(((INameable) te).getCustomName());
spawnAsEntity(worldIn, pos, itemstack);
}
else
{
super.harvestBlock(worldIn, player, pos, state, (TileEntity) null, stack);
}
}
@Override
public boolean hasComparatorInputOverride(IBlockState state)
{
return true;
}
@Override
public int getComparatorInputOverride(IBlockState blockState, World worldIn, BlockPos pos)
{
return Container.calcRedstoneFromInventory(this.getContainer(blockState, worldIn, pos));
}
@Override
public IBlockState rotate(IBlockState state, Rotation rot)
{
return state.with(FACING, rot.rotate(state.get(FACING)));
}
@Override
protected void fillStateContainer(StateContainer.Builder<Block, IBlockState> builder)
{
builder.add(FACING);
}
@Override
public BlockFaceShape getBlockFaceShape(IBlockReader worldIn, IBlockState state, BlockPos pos, EnumFacing face)
{
return BlockFaceShape.UNDEFINED;
}
@Override
public boolean allowsMovement(IBlockState state, IBlockReader worldIn, BlockPos pos, PathType type)
{
return false;
}
public static IronChestType getTypeFromItem(Item itemIn)
{
return getTypeFromBlock(Block.getBlockFromItem(itemIn));
}
public static IronChestType getTypeFromBlock(Block blockIn)
{
return blockIn instanceof BlockChest ? ((BlockChest) blockIn).getType() : null;
}
public IronChestType getType()
{
return this.type;
}
}

View File

@ -0,0 +1,36 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.blocks;
import cpw.mods.ironchest.common.tileentity.TileEntityCopperChest;
import net.minecraft.block.state.IBlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockReader;
public class BlockCopperChest extends BlockChest
{
public BlockCopperChest(Builder properties)
{
super(properties, IronChestType.COPPER);
}
@Override
public TileEntity createTileEntity(IBlockState state, IBlockReader world)
{
return new TileEntityCopperChest();
}
@Override
public TileEntity createNewTileEntity(IBlockReader worldIn)
{
return new TileEntityCopperChest();
}
}

View File

@ -0,0 +1,36 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.blocks;
import cpw.mods.ironchest.common.tileentity.TileEntityCrystalChest;
import net.minecraft.block.state.IBlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockReader;
public class BlockCrystalChest extends BlockChest
{
public BlockCrystalChest(Builder properties)
{
super(properties, IronChestType.CRYSTAL);
}
@Override
public TileEntity createTileEntity(IBlockState state, IBlockReader world)
{
return new TileEntityCrystalChest();
}
@Override
public TileEntity createNewTileEntity(IBlockReader worldIn)
{
return new TileEntityCrystalChest();
}
}

View File

@ -0,0 +1,37 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.blocks;
import cpw.mods.ironchest.common.tileentity.TileEntityDiamondChest;
import net.minecraft.block.state.IBlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockReader;
public class BlockDiamondChest extends BlockChest
{
public BlockDiamondChest(Builder properties)
{
super(properties, IronChestType.DIAMOND);
}
@Override
public TileEntity createTileEntity(IBlockState state, IBlockReader world)
{
return new TileEntityDiamondChest();
}
@Override
public TileEntity createNewTileEntity(IBlockReader worldIn)
{
return new TileEntityDiamondChest();
}
}

View File

@ -0,0 +1,51 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.blocks;
import cpw.mods.ironchest.common.tileentity.TileEntityDirtChest;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagByte;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
public class BlockDirtChest extends BlockChest
{
public BlockDirtChest(Builder properties)
{
super(properties, IronChestType.DIRTCHEST9000);
}
@SuppressWarnings("deprecation")
@Override
public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune)
{
ItemStack stack = getItem(world, pos, state);
stack.setTagInfo("dirtchest", new NBTTagByte((byte) 1));
drops.add(stack);
}
@Override
public TileEntity createTileEntity(IBlockState state, IBlockReader world)
{
return new TileEntityDirtChest();
}
@Override
public TileEntity createNewTileEntity(IBlockReader worldIn)
{
return new TileEntityDirtChest();
}
}

View File

@ -0,0 +1,37 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.blocks;
import cpw.mods.ironchest.common.tileentity.TileEntityGoldChest;
import net.minecraft.block.state.IBlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockReader;
public class BlockGoldChest extends BlockChest
{
public BlockGoldChest(Builder properties)
{
super(properties, IronChestType.GOLD);
}
@Override
public TileEntity createTileEntity(IBlockState state, IBlockReader world)
{
return new TileEntityGoldChest();
}
@Override
public TileEntity createNewTileEntity(IBlockReader worldIn)
{
return new TileEntityGoldChest();
}
}

View File

@ -0,0 +1,37 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.blocks;
import cpw.mods.ironchest.common.tileentity.TileEntityIronChest;
import net.minecraft.block.state.IBlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockReader;
public class BlockIronChest extends BlockChest
{
public BlockIronChest(Builder properties)
{
super(properties, IronChestType.IRON);
}
@Override
public TileEntity createTileEntity(IBlockState state, IBlockReader world)
{
return new TileEntityIronChest();
}
@Override
public TileEntity createNewTileEntity(IBlockReader worldIn)
{
return new TileEntityIronChest();
}
}

View File

@ -0,0 +1,36 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.blocks;
import cpw.mods.ironchest.common.tileentity.TileEntityObsidianChest;
import net.minecraft.block.state.IBlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockReader;
public class BlockObsidianChest extends BlockChest
{
public BlockObsidianChest(Builder properties)
{
super(properties, IronChestType.OBSIDIAN);
}
@Override
public TileEntity createTileEntity(IBlockState state, IBlockReader world)
{
return new TileEntityObsidianChest();
}
@Override
public TileEntity createNewTileEntity(IBlockReader worldIn)
{
return new TileEntityObsidianChest();
}
}

View File

@ -0,0 +1,36 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.blocks;
import cpw.mods.ironchest.common.tileentity.TileEntitySilverChest;
import net.minecraft.block.state.IBlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockReader;
public class BlockSilverChest extends BlockChest
{
public BlockSilverChest(Builder properties)
{
super(properties, IronChestType.SILVER);
}
@Override
public TileEntity createTileEntity(IBlockState state, IBlockReader world)
{
return new TileEntitySilverChest();
}
@Override
public TileEntity createNewTileEntity(IBlockReader worldIn)
{
return new TileEntitySilverChest();
}
}

View File

@ -0,0 +1,199 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.blocks;
import cpw.mods.ironchest.common.core.IronChestBlocks;
import cpw.mods.ironchest.common.gui.slot.ValidatingChestSlot;
import cpw.mods.ironchest.common.tileentity.TileEntityCopperChest;
import cpw.mods.ironchest.common.tileentity.TileEntityCrystalChest;
import cpw.mods.ironchest.common.tileentity.TileEntityDiamondChest;
import cpw.mods.ironchest.common.tileentity.TileEntityDirtChest;
import cpw.mods.ironchest.common.tileentity.TileEntityGoldChest;
import cpw.mods.ironchest.common.tileentity.TileEntityIronChest;
import cpw.mods.ironchest.common.tileentity.TileEntityObsidianChest;
import cpw.mods.ironchest.common.tileentity.TileEntitySilverChest;
import cpw.mods.ironchest.common.util.BlockNames;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.ResourceLocation;
public enum IronChestType implements IStringSerializable
{
//@formatter:off
IRON(54, 9, true, "iron_chest.png", TileEntityIronChest.class, 184, 202, BlockNames.IRON_CHEST),
GOLD(81, 9, true, "gold_chest.png", TileEntityGoldChest.class, 184, 256, BlockNames.GOLD_CHEST),
DIAMOND(108, 12, true, "diamond_chest.png", TileEntityDiamondChest.class, 184, 256, BlockNames.DIAMOND_CHEST),
COPPER(45, 9, false, "copper_chest.png", TileEntityCopperChest.class, 184, 184, BlockNames.COPPER_CHEST),
SILVER(72, 9, false, "silver_chest.png", TileEntitySilverChest.class, 184, 238, BlockNames.SILVER_CHEST),
CRYSTAL(108, 12, true, "crystal_chest.png", TileEntityCrystalChest.class, 238, 256, BlockNames.CRYSTAL_CHEST),
OBSIDIAN(108, 12, false, "obsidian_chest.png", TileEntityObsidianChest.class, 238, 256, BlockNames.OBSIDIAN_CHEST),
DIRTCHEST9000(1, 1, false, "dirt_chest.png", TileEntityDirtChest.class, 184, 184, BlockNames.DIRT_CHEST),
WOOD(0, 0, false, "", null, 0, 0, null);
//@formatter:on
public static final IronChestType VALUES[] = values();
public final String name;
public final int size;
public final int rowLength;
public final boolean tieredChest;
public final ResourceLocation modelTexture;
public final Class<? extends TileEntity> clazz;
public final int xSize;
public final int ySize;
public final String itemName;
IronChestType(int size, int rowLength, boolean tieredChest, String modelTexture, Class<? extends TileEntityIronChest> clazz, int xSize, int ySize, String itemName)
{
this.name = this.name().toLowerCase();
this.size = size;
this.rowLength = rowLength;
this.tieredChest = tieredChest;
this.modelTexture = new ResourceLocation("ironchest", "textures/model/" + modelTexture);
this.clazz = clazz;
this.xSize = xSize;
this.ySize = ySize;
this.itemName = itemName;
}
@Override
public String getName()
{
return this.name;
}
public int getRowCount()
{
return this.size / this.rowLength;
}
public boolean isTransparent()
{
return this == CRYSTAL;
}
public boolean isValidForCreativeMode()
{
return this != WOOD;
}
public boolean isExplosionResistant()
{
return this == OBSIDIAN;
}
public Slot makeSlot(IInventory chestInventory, int index, int x, int y)
{
return new ValidatingChestSlot(chestInventory, index, x, y, this);
}
@SuppressWarnings("deprecation")
private static final Item DIRT_ITEM = Item.getItemFromBlock(Blocks.DIRT);
public boolean acceptsStack(ItemStack itemstack)
{
if (this == DIRTCHEST9000)
{
return itemstack.isEmpty() || itemstack.getItem() == DIRT_ITEM;
}
return true;
}
public static IronChestType get(ResourceLocation resourceLocation)
{
switch (resourceLocation.toString())
{
case BlockNames.IRON_CHEST:
return IRON;
case BlockNames.GOLD_CHEST:
return GOLD;
case BlockNames.DIAMOND_CHEST:
return DIAMOND;
case BlockNames.COPPER_CHEST:
return COPPER;
case BlockNames.SILVER_CHEST:
return SILVER;
case BlockNames.CRYSTAL_CHEST:
return CRYSTAL;
case BlockNames.OBSIDIAN_CHEST:
return OBSIDIAN;
case BlockNames.DIRT_CHEST:
return DIRTCHEST9000;
default:
return WOOD;
}
}
public static IBlockState get(IronChestType type)
{
switch (type)
{
case IRON:
return IronChestBlocks.ironChestBlock.getDefaultState();
case GOLD:
return IronChestBlocks.goldChestBlock.getDefaultState();
case DIAMOND:
return IronChestBlocks.diamondChestBlock.getDefaultState();
case COPPER:
return IronChestBlocks.copperChestBlock.getDefaultState();
case SILVER:
return IronChestBlocks.silverChestBlock.getDefaultState();
case CRYSTAL:
return IronChestBlocks.crystalChestBlock.getDefaultState();
case OBSIDIAN:
return IronChestBlocks.obsidianChestBlock.getDefaultState();
case DIRTCHEST9000:
return IronChestBlocks.dirtChestBlock.getDefaultState();
default:
return null;
}
}
public TileEntityIronChest makeEntity()
{
switch (this)
{
case IRON:
return new TileEntityIronChest();
case GOLD:
return new TileEntityGoldChest();
case DIAMOND:
return new TileEntityDiamondChest();
case COPPER:
return new TileEntityCopperChest();
case SILVER:
return new TileEntitySilverChest();
case CRYSTAL:
return new TileEntityCrystalChest();
case OBSIDIAN:
return new TileEntityObsidianChest();
case DIRTCHEST9000:
return new TileEntityDirtChest();
default:
return null;
}
}
}

View File

@ -0,0 +1,108 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.core;
import cpw.mods.ironchest.common.blocks.BlockChest;
import cpw.mods.ironchest.common.blocks.BlockCopperChest;
import cpw.mods.ironchest.common.blocks.BlockCrystalChest;
import cpw.mods.ironchest.common.blocks.BlockDiamondChest;
import cpw.mods.ironchest.common.blocks.BlockDirtChest;
import cpw.mods.ironchest.common.blocks.BlockGoldChest;
import cpw.mods.ironchest.common.blocks.BlockIronChest;
import cpw.mods.ironchest.common.blocks.BlockObsidianChest;
import cpw.mods.ironchest.common.blocks.BlockSilverChest;
import cpw.mods.ironchest.common.items.ItemChest;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class IronChestBlocks
{
//@formatter:off
public static BlockChest ironChestBlock = new BlockIronChest(Block.Builder.create(Material.IRON).hardnessAndResistance(3.0F, 3.0F));
public static Item ironChestItemBlock = new ItemChest(ironChestBlock, (new Item.Builder()).group(IronChestCreativeTabs.IRON_CHESTS));
public static BlockChest goldChestBlock = new BlockGoldChest(Block.Builder.create(Material.IRON).hardnessAndResistance(3.0F, 3.0F));
public static Item goldChestItemBlock = new ItemChest(goldChestBlock, (new Item.Builder()).group(IronChestCreativeTabs.IRON_CHESTS));
public static BlockChest diamondChestBlock = new BlockDiamondChest(Block.Builder.create(Material.IRON).hardnessAndResistance(3.0F, 3.0F));
public static Item diamondChestItemBlock = new ItemChest(diamondChestBlock, (new Item.Builder()).group(IronChestCreativeTabs.IRON_CHESTS));
public static BlockChest copperChestBlock = new BlockCopperChest(Block.Builder.create(Material.IRON).hardnessAndResistance(3.0F, 3.0F));
public static Item copperChestItemBlock = new ItemChest(copperChestBlock, (new Item.Builder()).group(IronChestCreativeTabs.IRON_CHESTS));
public static BlockChest silverChestBlock = new BlockSilverChest(Block.Builder.create(Material.IRON).hardnessAndResistance(3.0F, 3.0F));
public static Item silverChestItemBlock = new ItemChest(silverChestBlock, (new Item.Builder()).group(IronChestCreativeTabs.IRON_CHESTS));
public static BlockChest crystalChestBlock = new BlockCrystalChest(Block.Builder.create(Material.IRON).hardnessAndResistance(3.0F, 3.0F));
public static Item crystalChestItemBlock = new ItemChest(crystalChestBlock, (new Item.Builder()).group(IronChestCreativeTabs.IRON_CHESTS));
public static BlockChest obsidianChestBlock = new BlockObsidianChest(Block.Builder.create(Material.IRON).hardnessAndResistance(3.0F, 3.0F));
public static Item obsidianChestItemBlock = new ItemChest(obsidianChestBlock, (new Item.Builder()).group(IronChestCreativeTabs.IRON_CHESTS));
public static BlockChest dirtChestBlock = new BlockDirtChest(Block.Builder.create(Material.IRON).hardnessAndResistance(3.0F, 3.0F));
public static Item dirtChestItemBlock = new ItemChest(dirtChestBlock, (new Item.Builder()).group(IronChestCreativeTabs.IRON_CHESTS));
//@formatter:on
public IronChestBlocks()
{
}
public void registerBlocks()
{
// Chest Start
GameRegistry.findRegistry(Block.class).registerAll(ironChestBlock, goldChestBlock, diamondChestBlock, copperChestBlock, silverChestBlock, crystalChestBlock, obsidianChestBlock, dirtChestBlock);
// Chest End
}
public void registerItems()
{
// Chest Start
GameRegistry.findRegistry(Item.class).registerAll(ironChestItemBlock, goldChestItemBlock, diamondChestItemBlock, copperChestItemBlock, silverChestItemBlock, crystalChestItemBlock, obsidianChestItemBlock, dirtChestItemBlock);
// Chest End
}
/*@SubscribeEvent
public static void registerBlocks(final Register<Block> event)
{
System.out.println("hello from registerBlocks");
IForgeRegistry<Block> blockRegistry = event.getRegistry();
// Chest Start
for (IronChestType type : IronChestType.values())
{
if (type.itemName != null)
{
blockRegistry.register(new BlockIronChest(Block.Builder.create(Material.IRON).hardnessAndResistance(3.0F, 3.0F), type, type.itemName));
}
}
// Chest End
}
@SubscribeEvent
public static void registerItems(final Register<Item> event)
{
System.out.println("hello from registerItems");
IForgeRegistry<Item> itemRegistry = event.getRegistry();
// Chest Start
for (IronChestType type : IronChestType.values())
{
if (type != IronChestType.WOOD)
{
itemRegistry.register(new ItemChest(type.block, (new Item.Builder()).group(IronChestCreativeTabs.IRON_CHESTS)));
}
}
// Chest End
}*/
}

View File

@ -0,0 +1,33 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.core;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
public final class IronChestCreativeTabs
{
private IronChestCreativeTabs()
{
}
public static final ItemGroup IRON_CHESTS = new ItemGroup("ironchest")
{
@Override
@OnlyIn(Dist.CLIENT)
public ItemStack createIcon()
{
return new ItemStack(IronChestBlocks.ironChestBlock);
}
};
}

View File

@ -0,0 +1,43 @@
package cpw.mods.ironchest.common.core;
import cpw.mods.ironchest.common.items.ChestChangerType;
import cpw.mods.ironchest.common.items.ItemChestChanger;
import net.minecraft.item.Item;
import net.minecraftforge.event.RegistryEvent.Register;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.registries.IForgeRegistry;
public class IronChestItems
{
//@formatter:off
public static Item.Builder itemBuilder = (new Item.Builder()).group(IronChestCreativeTabs.IRON_CHESTS).maxStackSize(1);
public static Item ironToGoldUpgrade = new ItemChestChanger(itemBuilder, ChestChangerType.IRON_GOLD);
public static Item goldToDiamondUpgrade = new ItemChestChanger(itemBuilder, ChestChangerType.GOLD_DIAMOND);
public static Item copperToSilverUpgrade = new ItemChestChanger(itemBuilder, ChestChangerType.COPPER_SILVER);
public static Item silverToGoldUpgrade = new ItemChestChanger(itemBuilder, ChestChangerType.SILVER_GOLD);
public static Item copperToIronUpgrade = new ItemChestChanger(itemBuilder, ChestChangerType.COPPER_IRON);
public static Item diamondToCrystalUpgrade = new ItemChestChanger(itemBuilder, ChestChangerType.DIAMOND_CRYSTAL);
public static Item woodToIronUpgrade = new ItemChestChanger(itemBuilder, ChestChangerType.WOOD_IRON);
public static Item woodToCopperUpgrade = new ItemChestChanger(itemBuilder, ChestChangerType.WOOD_COPPER);
public static Item diamondToObsidianUpgrade = new ItemChestChanger(itemBuilder, ChestChangerType.DIAMOND_OBSIDIAN);
//@formatter:on
public IronChestItems()
{
}
public void registerItems()
{
// Chest Start
GameRegistry.findRegistry(Item.class).registerAll(ironToGoldUpgrade, goldToDiamondUpgrade, copperToSilverUpgrade, silverToGoldUpgrade, copperToIronUpgrade, diamondToCrystalUpgrade, woodToIronUpgrade, woodToCopperUpgrade, diamondToObsidianUpgrade);
// Chest End
}
public static void registerItems(Register<Item> event)
{
IForgeRegistry<Item> itemRegistry = event.getRegistry();
ChestChangerType.buildItems(itemRegistry);
}
}

View File

@ -0,0 +1,133 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.gui;
import cpw.mods.ironchest.common.blocks.IronChestType;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerIronChest extends Container
{
private IronChestType type;
private EntityPlayer player;
private IInventory chest;
public ContainerIronChest(IInventory playerInventory, IInventory chestInventory, IronChestType type, EntityPlayer player, int xSize, int ySize)
{
this.chest = chestInventory;
this.player = player;
this.type = type;
chestInventory.openInventory(this.player);
this.layoutContainer(playerInventory, chestInventory, type, xSize, ySize);
}
@Override
public boolean canInteractWith(EntityPlayer playerIn)
{
return this.chest.isUsableByPlayer(playerIn);
}
@Override
public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
{
ItemStack itemstack = ItemStack.EMPTY;
Slot slot = this.inventorySlots.get(index);
if (slot != null && slot.getHasStack())
{
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if (index < this.type.size)
{
if (!this.mergeItemStack(itemstack1, this.type.size, this.inventorySlots.size(), true))
{
return ItemStack.EMPTY;
}
}
else if (!this.type.acceptsStack(itemstack1))
{
return ItemStack.EMPTY;
}
else if (!this.mergeItemStack(itemstack1, 0, this.type.size, false))
{
return ItemStack.EMPTY;
}
if (itemstack1.isEmpty())
{
slot.putStack(ItemStack.EMPTY);
}
else
{
slot.onSlotChanged();
}
}
return itemstack;
}
protected void layoutContainer(IInventory playerInventory, IInventory chestInventory, IronChestType type, int xSize, int ySize)
{
if (type == IronChestType.DIRTCHEST9000)
{
this.addSlot(type.makeSlot(chestInventory, 0, 12 + 4 * 18, 8 + 2 * 18));
}
else
{
for (int chestRow = 0; chestRow < type.getRowCount(); chestRow++)
{
for (int chestCol = 0; chestCol < type.rowLength; chestCol++)
{
this.addSlot(type.makeSlot(chestInventory, chestCol + chestRow * type.rowLength, 12 + chestCol * 18, 8 + chestRow * 18));
}
}
}
int leftCol = (xSize - 162) / 2 + 1;
for (int playerInvRow = 0; playerInvRow < 3; playerInvRow++)
{
for (int playerInvCol = 0; playerInvCol < 9; playerInvCol++)
{
this.addSlot(new Slot(playerInventory, playerInvCol + playerInvRow * 9 + 9, leftCol + playerInvCol * 18, ySize - (4 - playerInvRow) * 18 - 10));
}
}
for (int hotbarSlot = 0; hotbarSlot < 9; hotbarSlot++)
{
this.addSlot(new Slot(playerInventory, hotbarSlot, leftCol + hotbarSlot * 18, ySize - 24));
}
}
public EntityPlayer getPlayer()
{
return this.player;
}
@Override
public void onContainerClosed(EntityPlayer playerIn)
{
super.onContainerClosed(playerIn);
this.chest.closeInventory(playerIn);
}
public IInventory getChestInventory()
{
return this.chest;
}
}

View File

@ -0,0 +1,33 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.gui.slot;
import cpw.mods.ironchest.common.blocks.IronChestType;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ValidatingChestSlot extends Slot
{
private IronChestType type;
public ValidatingChestSlot(IInventory inventoryIn, int slotIndex, int xPosition, int yPosition, IronChestType type)
{
super(inventoryIn, slotIndex, xPosition, yPosition);
this.type = type;
}
@Override
public boolean isItemValid(ItemStack stack)
{
return this.type.acceptsStack(stack);
}
}

View File

@ -0,0 +1,81 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.items;
import static cpw.mods.ironchest.common.blocks.IronChestType.COPPER;
import static cpw.mods.ironchest.common.blocks.IronChestType.CRYSTAL;
import static cpw.mods.ironchest.common.blocks.IronChestType.DIAMOND;
import static cpw.mods.ironchest.common.blocks.IronChestType.GOLD;
import static cpw.mods.ironchest.common.blocks.IronChestType.IRON;
import static cpw.mods.ironchest.common.blocks.IronChestType.OBSIDIAN;
import static cpw.mods.ironchest.common.blocks.IronChestType.SILVER;
import static cpw.mods.ironchest.common.blocks.IronChestType.WOOD;
import cpw.mods.ironchest.common.blocks.IronChestType;
import cpw.mods.ironchest.common.core.IronChestCreativeTabs;
import net.minecraft.item.Item;
import net.minecraftforge.registries.IForgeRegistry;
public enum ChestChangerType
{
//@formatter:off
IRON_GOLD(IRON, GOLD, "iron_gold_chest_upgrade"),
GOLD_DIAMOND(GOLD, DIAMOND, "gold_diamond_chest_upgrade"),
COPPER_SILVER(COPPER, SILVER, "copper_silver_chest_upgrade"),
SILVER_GOLD(SILVER, GOLD, "silver_gold_chest_upgrade"),
COPPER_IRON(COPPER, IRON, "copper_iron_chest_upgrade"),
DIAMOND_CRYSTAL(DIAMOND, CRYSTAL, "diamond_crystal_chest_upgrade"),
WOOD_IRON(WOOD, IRON, "wood_iron_chest_upgrade"),
WOOD_COPPER(WOOD, COPPER, "wood_copper_chest_upgrade"),
DIAMOND_OBSIDIAN(DIAMOND, OBSIDIAN, "diamond_obsidian_chest_upgrade");
//@formatter:on
public static final ChestChangerType[] VALUES = values();
public final IronChestType source;
public final IronChestType target;
public final String itemName;
public ItemChestChanger item;
ChestChangerType(IronChestType source, IronChestType target, String itemName)
{
this.source = source;
this.target = target;
this.itemName = itemName;
}
public boolean canUpgrade(IronChestType from)
{
return from == this.source;
}
public ItemChestChanger buildItem(IForgeRegistry<Item> itemRegistry)
{
this.item = new ItemChestChanger((new Item.Builder()).group(IronChestCreativeTabs.IRON_CHESTS).maxStackSize(1), this);
this.item.setRegistryName(this.itemName);
itemRegistry.register(this.item);
return this.item;
}
public static void buildItems(IForgeRegistry<Item> itemRegistry)
{
for (ChestChangerType type : VALUES)
{
type.buildItem(itemRegistry);
}
}
}

View File

@ -0,0 +1,24 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.items;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
public class ItemChest extends ItemBlock
{
public ItemChest(Block block, Builder builder)
{
super(block, builder);
this.setRegistryName(block.getRegistryName());
}
}

View File

@ -0,0 +1,162 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.items;
import cpw.mods.ironchest.common.blocks.BlockChest;
import cpw.mods.ironchest.common.blocks.BlockIronChest;
import cpw.mods.ironchest.common.blocks.IronChestType;
import cpw.mods.ironchest.common.tileentity.TileEntityIronChest;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.world.World;
public class ItemChestChanger extends ItemTooltip
{
public final ChestChangerType type;
public ItemChestChanger(Builder properties, ChestChangerType chestChangerType)
{
super(properties);
this.type = chestChangerType;
this.setRegistryName(chestChangerType.itemName);
}
@Override
public EnumActionResult onItemUseFirst(ItemStack stack, ItemUseContext context)
{
EntityPlayer entityplayer = context.getPlayer();
BlockPos blockpos = context.getPos();
World world = context.getWorld();
ItemStack itemstack = context.getItem();
if (world.isRemote)
{
return EnumActionResult.PASS;
}
if (this.type.canUpgrade(IronChestType.WOOD))
{
if (!(world.getBlockState(blockpos).getBlock() instanceof net.minecraft.block.BlockChest))
{
return EnumActionResult.PASS;
}
}
else
{
//@formatter:off
if (world.getBlockState(blockpos).getBlock().getDefaultState() != IronChestType.get(this.type.source))
//@formatter:on
{
return EnumActionResult.PASS;
}
}
TileEntity te = world.getTileEntity(blockpos);
TileEntityIronChest newchest = new TileEntityIronChest();
ITextComponent customname = null;
NonNullList<ItemStack> chestContents = NonNullList.<ItemStack> withSize(27, ItemStack.EMPTY);
EnumFacing chestFacing = EnumFacing.NORTH;
if (te != null)
{
if (te instanceof TileEntityIronChest)
{
TileEntityIronChest chest = (TileEntityIronChest) te;
IBlockState chestState = world.getBlockState(blockpos);
chestContents = chest.getItems();
chestFacing = chestState.get(BlockChest.FACING);
customname = chest.getCustomName();
newchest = this.type.target.makeEntity();
if (newchest == null)
{
return EnumActionResult.PASS;
}
}
else if (te instanceof TileEntityChest)
{
IBlockState chestState = world.getBlockState(blockpos);
chestFacing = chestState.get(net.minecraft.block.BlockChest.FACING);
TileEntityChest chest = (TileEntityChest) te;
if (TileEntityChest.getPlayersUsing(world, blockpos) > 0)
{
return EnumActionResult.PASS;
}
if (!this.type.canUpgrade(IronChestType.WOOD))
{
return EnumActionResult.PASS;
}
chestContents = NonNullList.<ItemStack> withSize(chest.getSizeInventory(), ItemStack.EMPTY);
for (int i = 0; i < chestContents.size(); i++)
{
chestContents.set(i, chest.getStackInSlot(i));
}
customname = chest.getCustomName();
newchest = this.type.target.makeEntity();
}
}
te.updateContainingBlockInfo();
//if (te instanceof TileEntityChest)
//{
// ((TileEntityChest) te).checkForAdjacentChests();
//}
world.removeTileEntity(blockpos);
world.removeBlock(blockpos);
IBlockState iblockstate = IronChestType.get(this.type.target).with(BlockIronChest.FACING, chestFacing);
System.out.println(iblockstate);
world.setTileEntity(blockpos, newchest);
world.setBlockState(blockpos, iblockstate, 3);
world.notifyBlockUpdate(blockpos, iblockstate, iblockstate, 3);
TileEntity te2 = world.getTileEntity(blockpos);
if (te2 instanceof TileEntityIronChest)
{
if (customname != null)
{
((TileEntityIronChest) te2).setCustomName(customname);
}
((TileEntityIronChest) te2).setItems(chestContents);
}
if (!entityplayer.abilities.isCreativeMode)
{
itemstack.shrink(1);
}
return EnumActionResult.SUCCESS;
}
}

View File

@ -0,0 +1,86 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.items;
import java.util.List;
import javax.annotation.Nullable;
import com.google.common.collect.Lists;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
public class ItemTooltip extends Item
{
public ItemTooltip(Builder properties)
{
super(properties);
}
@Override
@OnlyIn(Dist.CLIENT)
public void addInformation(ItemStack stack, @Nullable World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn)
{
addOptionalTooltip(stack, tooltip);
super.addInformation(stack, worldIn, tooltip, flagIn);
}
public static void addOptionalTooltip(ItemStack stack, List<ITextComponent> tooltip)
{
if (I18n.hasKey(stack.getDisplayName() + ".tooltip"))
{
for (String tooltipString : getTooltips(TextFormatting.GRAY.toString() + translateRecursive(stack.getDisplayName() + ".tooltip")))
{
tooltip.add(new TextComponentString(tooltipString));
}
}
else if (I18n.hasKey(stack.getDisplayName() + ".tooltip"))
{
for (String tooltipString : getTooltips(TextFormatting.GRAY.toString() + translateRecursive(stack.getDisplayName() + ".tooltip")))
{
tooltip.add(new TextComponentString(tooltipString));
}
}
}
public static String translateRecursive(String key, Object... params)
{
return I18n.format(I18n.format(key, params));
}
public static List<String> getTooltips(String text)
{
List<String> list = Lists.newLinkedList();
if (text == null)
return list;
int j = 0;
int k;
while ((k = text.indexOf("\\n", j)) >= 0)
{
list.add(text.substring(j, k));
j = k + 2;
}
list.add(text.substring(j, text.length()));
return list;
}
}

View File

@ -0,0 +1,133 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.tileentity;
import com.mojang.datafixers.DataFixUtils;
import com.mojang.datafixers.types.Type;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SharedConstants;
import net.minecraft.util.datafix.DataFixesManager;
import net.minecraft.util.datafix.TypeReferences;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.registries.IForgeRegistry;
import net.minecraftforge.registries.IForgeRegistryEntry;
public class IronChestEntityType
{
public static TileEntityType<?> IRON_CHEST;
public static TileEntityType<?> GOLD_CHEST;
public static TileEntityType<?> DIAMOND_CHEST;
public static TileEntityType<?> CRYSTAL_CHEST;
public static TileEntityType<?> DIRT_CHEST;
public static TileEntityType<?> COPPER_CHEST;
public static TileEntityType<?> SILVER_CHEST;
public static TileEntityType<?> OBSIDIAN_CHEST;
public IronChestEntityType()
{
}
@SuppressWarnings("unchecked")
public void registerTileEntities()
{
IForgeRegistry e = GameRegistry.findRegistry(TileEntityType.class);
registerTileEntityType(e, register("iron_chest", TileEntityType.Builder.create(TileEntityIronChest::new)), "iron_chest");
registerTileEntityType(e, register("gold_chest", TileEntityType.Builder.create(TileEntityGoldChest::new)), "gold_chest");
registerTileEntityType(e, register("diamond_chest", TileEntityType.Builder.create(TileEntityDiamondChest::new)), "diamond_chest");
registerTileEntityType(e, register("crystal_chest", TileEntityType.Builder.create(TileEntityCrystalChest::new)), "crystal_chest");
registerTileEntityType(e, register("dirt_chest", TileEntityType.Builder.create(TileEntityDirtChest::new)), "dirt_chest");
registerTileEntityType(e, register("copper_chest", TileEntityType.Builder.create(TileEntityCopperChest::new)), "copper_chest");
registerTileEntityType(e, register("silver_chest", TileEntityType.Builder.create(TileEntitySilverChest::new)), "silver_chest");
registerTileEntityType(e, register("obsidian_chest", TileEntityType.Builder.create(TileEntityObsidianChest::new)), "obsidian_chest");
}
@SuppressWarnings("unchecked")
public void createEntries()
{
IForgeRegistry<?> e = GameRegistry.findRegistry(TileEntityType.class);
IronChestEntityType.IRON_CHEST = (TileEntityType<?>) e.getValue(new ResourceLocation("ironchest", "iron_chest"));
IronChestEntityType.GOLD_CHEST = (TileEntityType<?>) e.getValue(new ResourceLocation("ironchest", "gold_chest"));
IronChestEntityType.DIAMOND_CHEST = (TileEntityType<?>) e.getValue(new ResourceLocation("ironchest", "diamond_chest"));
IronChestEntityType.CRYSTAL_CHEST = (TileEntityType<?>) e.getValue(new ResourceLocation("ironchest", "crystal_chest"));
IronChestEntityType.DIRT_CHEST = (TileEntityType<?>) e.getValue(new ResourceLocation("ironchest", "dirt_chest"));
IronChestEntityType.COPPER_CHEST = (TileEntityType<?>) e.getValue(new ResourceLocation("ironchest", "copper_chest"));
IronChestEntityType.SILVER_CHEST = (TileEntityType<?>) e.getValue(new ResourceLocation("ironchest", "silver_chest"));
IronChestEntityType.OBSIDIAN_CHEST = (TileEntityType<?>) e.getValue(new ResourceLocation("ironchest", "obsidian_chest"));
}
/*@SubscribeEvent
public static void onTileEntityRegistry(final Register<TileEntityType<?>> e)
{
System.out.println("hello from onTileEntityRegistry");
registerTileEntityType(e.getRegistry(), register("iron_chest", TileEntityType.Builder.create(TileEntityIronChest::new)), "iron_chest");
registerTileEntityType(e.getRegistry(), register("gold_chest", TileEntityType.Builder.create(TileEntityGoldChest::new)), "gold_chest");
registerTileEntityType(e.getRegistry(), register("diamond_chest", TileEntityType.Builder.create(TileEntityDiamondChest::new)), "diamond_chest");
registerTileEntityType(e.getRegistry(), register("crystal_chest", TileEntityType.Builder.create(TileEntityCrystalChest::new)), "crystal_chest");
registerTileEntityType(e.getRegistry(), register("dirt_chest", TileEntityType.Builder.create(TileEntityDirtChest::new)), "dirt_chest");
registerTileEntityType(e.getRegistry(), register("copper_chest", TileEntityType.Builder.create(TileEntityCopperChest::new)), "copper_chest");
registerTileEntityType(e.getRegistry(), register("silver_chest", TileEntityType.Builder.create(TileEntitySilverChest::new)), "silver_chest");
registerTileEntityType(e.getRegistry(), register("obsidian_chest", TileEntityType.Builder.create(TileEntityObsidianChest::new)), "obsidian_chest");
IronChestEntityType.IRON_CHEST = e.getRegistry().getValue(new ResourceLocation("ironchest", "iron_chest"));
IronChestEntityType.GOLD_CHEST = e.getRegistry().getValue(new ResourceLocation("ironchest", "gold_chest"));
IronChestEntityType.DIAMOND_CHEST = e.getRegistry().getValue(new ResourceLocation("ironchest", "diamond_chest"));
IronChestEntityType.CRYSTAL_CHEST = e.getRegistry().getValue(new ResourceLocation("ironchest", "crystal_chest"));
IronChestEntityType.DIRT_CHEST = e.getRegistry().getValue(new ResourceLocation("ironchest", "dirt_chest"));
IronChestEntityType.COPPER_CHEST = e.getRegistry().getValue(new ResourceLocation("ironchest", "copper_chest"));
IronChestEntityType.SILVER_CHEST = e.getRegistry().getValue(new ResourceLocation("ironchest", "silver_chest"));
IronChestEntityType.OBSIDIAN_CHEST = e.getRegistry().getValue(new ResourceLocation("ironchest", "obsidian_chest"));
}*/
protected static <T extends TileEntityType<?>> T registerTileEntityType(IForgeRegistry<TileEntityType<?>> registry, T tileEntityType, String name)
{
register(registry, tileEntityType, new ResourceLocation("ironchest", name));
return tileEntityType;
}
protected static <T extends IForgeRegistryEntry<T>> T register(IForgeRegistry<T> registry, T thing, ResourceLocation name)
{
thing.setRegistryName(name);
registry.register(thing);
return thing;
}
public static <T extends TileEntity> TileEntityType<T> register(String id, TileEntityType.Builder<T> builder)
{
Type<?> type = null;
try
{
type = DataFixesManager.getDataFixer().getSchema(DataFixUtils.makeKey(1519)).getChoiceType(TypeReferences.BLOCK_ENTITY, id);
}
catch (IllegalArgumentException illegalstateexception)
{
if (SharedConstants.developmentMode)
{
throw illegalstateexception;
}
}
TileEntityType<T> tileentitytype = builder.build(type);
return tileentitytype;
}
}

View File

@ -0,0 +1,21 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.tileentity;
import cpw.mods.ironchest.common.blocks.IronChestType;
public class TileEntityCopperChest extends TileEntityIronChest
{
public TileEntityCopperChest()
{
super(IronChestEntityType.COPPER_CHEST, IronChestType.COPPER);
}
}

View File

@ -0,0 +1,231 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.tileentity;
import java.util.Collections;
import java.util.Comparator;
import cpw.mods.ironchest.common.blocks.IronChestType;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
public class TileEntityCrystalChest extends TileEntityIronChest
{
/** Crystal Chest top stacks */
private NonNullList<ItemStack> topStacks;
/** If the inventory got touched */
private boolean inventoryTouched;
/** If the inventory had items */
private boolean hadStuff;
public TileEntityCrystalChest()
{
super(IronChestEntityType.CRYSTAL_CHEST, IronChestType.CRYSTAL);
this.topStacks = NonNullList.<ItemStack> withSize(8, ItemStack.EMPTY);
}
@Override
public void tick()
{
super.tick();
if (!this.world.isRemote && this.inventoryTouched)
{
this.inventoryTouched = false;
this.sortTopStacks();
}
}
@Override
public void setItems(NonNullList<ItemStack> contents)
{
super.setItems(contents);
this.inventoryTouched = true;
}
@Override
public ItemStack getStackInSlot(int index)
{
this.fillWithLoot((EntityPlayer) null);
this.inventoryTouched = true;
return this.getItems().get(index);
}
public NonNullList<ItemStack> getTopItems()
{
return this.topStacks;
}
protected void sortTopStacks()
{
if (!this.getIronChestType().isTransparent() || (this.world != null && this.world.isRemote))
{
return;
}
NonNullList<ItemStack> tempCopy = NonNullList.<ItemStack> withSize(this.getSizeInventory(), ItemStack.EMPTY);
boolean hasStuff = false;
int compressedIdx = 0;
mainLoop:
for (int i = 0; i < this.getSizeInventory(); i++)
{
ItemStack itemStack = this.getItems().get(i);
if (!itemStack.isEmpty())
{
for (int j = 0; j < compressedIdx; j++)
{
ItemStack tempCopyStack = tempCopy.get(j);
if (ItemStack.areItemsEqualIgnoreDurability(tempCopyStack, itemStack))
{
if (itemStack.getCount() != tempCopyStack.getCount())
{
tempCopyStack.grow(itemStack.getCount());
}
continue mainLoop;
}
}
tempCopy.set(compressedIdx, itemStack.copy());
compressedIdx++;
hasStuff = true;
}
}
if (!hasStuff && this.hadStuff)
{
this.hadStuff = false;
for (int i = 0; i < this.getTopItems().size(); i++)
{
this.getTopItems().set(i, ItemStack.EMPTY);
}
if (this.world != null)
{
IBlockState iblockstate = this.world.getBlockState(this.pos);
this.world.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3);
}
return;
}
this.hadStuff = true;
Collections.sort(tempCopy, new Comparator<ItemStack>()
{
@Override
public int compare(ItemStack stack1, ItemStack stack2)
{
if (stack1.isEmpty())
{
return 1;
}
else if (stack2.isEmpty())
{
return -1;
}
else
{
return stack2.getCount() - stack1.getCount();
}
}
});
int p = 0;
for (ItemStack element : tempCopy)
{
if (!element.isEmpty() && element.getCount() > 0)
{
if (p == this.getTopItems().size())
{
break;
}
this.getTopItems().set(p, element);
p++;
}
}
for (int i = p; i < this.getTopItems().size(); i++)
{
this.getTopItems().set(i, ItemStack.EMPTY);
}
if (this.world != null)
{
IBlockState iblockstate = this.world.getBlockState(this.pos);
this.world.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3);
}
sendTopStacksPacket();
}
public NonNullList<ItemStack> buildItemStackDataList()
{
if (this.getIronChestType().isTransparent())
{
NonNullList<ItemStack> sortList = NonNullList.<ItemStack> withSize(this.getTopItems().size(), ItemStack.EMPTY);
int pos = 0;
for (ItemStack is : this.topStacks)
{
if (!is.isEmpty())
{
sortList.set(pos, is);
}
else
{
sortList.set(pos, ItemStack.EMPTY);
}
pos++;
}
return sortList;
}
return NonNullList.<ItemStack> withSize(this.getTopItems().size(), ItemStack.EMPTY);
}
protected void sendTopStacksPacket()
{
//NonNullList<ItemStack> stacks = this.buildItemStackDataList();
//@formatter:off
//IronChest.packetHandler.sendToAllAround(new MessageCrystalChestSync(this, stacks), new TargetPoint(world.provider.getDimension(), getPos().getX(), getPos().getY(), getPos().getZ(), 128));
//@formatter:on
}
public void receiveMessageFromServer(NonNullList<ItemStack> topStacks)
{
this.topStacks = topStacks;
}
}

View File

@ -0,0 +1,21 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.tileentity;
import cpw.mods.ironchest.common.blocks.IronChestType;
public class TileEntityDiamondChest extends TileEntityIronChest
{
public TileEntityDiamondChest()
{
super(IronChestEntityType.DIAMOND_CHEST, IronChestType.DIAMOND);
}
}

View File

@ -0,0 +1,62 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.tileentity;
import cpw.mods.ironchest.common.blocks.IronChestType;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
public class TileEntityDirtChest extends TileEntityIronChest
{
private static ItemStack dirtChest9000GuideBook = new ItemStack(Items.WRITTEN_BOOK);
static
{
dirtChest9000GuideBook.setTagInfo("author", new NBTTagString("cpw"));
dirtChest9000GuideBook.setTagInfo("title", new NBTTagString(I18n.format("book.ironchest.dirtchest9000.title")));
NBTTagList pages = new NBTTagList();
pages.add(new NBTTagString(ITextComponent.Serializer.toJson(new TextComponentString(I18n.format("book.ironchest.dirtchest9000.page1")))));
pages.add(new NBTTagString(ITextComponent.Serializer.toJson(new TextComponentString(I18n.format("book.ironchest.dirtchest9000.page2")))));
pages.add(new NBTTagString(ITextComponent.Serializer.toJson(new TextComponentString(I18n.format("book.ironchest.dirtchest9000.page3")))));
pages.add(new NBTTagString(ITextComponent.Serializer.toJson(new TextComponentString(I18n.format("book.ironchest.dirtchest9000.page4")))));
pages.add(new NBTTagString(ITextComponent.Serializer.toJson(new TextComponentString(I18n.format("book.ironchest.dirtchest9000.page5")))));
dirtChest9000GuideBook.setTagInfo("pages", pages);
}
public TileEntityDirtChest()
{
super(IronChestEntityType.DIRT_CHEST, IronChestType.DIRTCHEST9000);
}
@Override
public void wasPlaced(EntityLivingBase entityliving, ItemStack itemStack)
{
if (!(itemStack.hasTag() && itemStack.getTag().getBoolean("dirtchest")))
{
this.setInventorySlotContents(0, dirtChest9000GuideBook.copy());
}
}
@Override
public void removeAdornments()
{
if (!this.getItems().get(0).isEmpty() && this.getItems().get(0).isItemEqual(dirtChest9000GuideBook))
{
this.getItems().set(0, ItemStack.EMPTY);
}
}
}

View File

@ -0,0 +1,21 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.tileentity;
import cpw.mods.ironchest.common.blocks.IronChestType;
public class TileEntityGoldChest extends TileEntityIronChest
{
public TileEntityGoldChest()
{
super(IronChestEntityType.GOLD_CHEST, IronChestType.GOLD);
}
}

View File

@ -0,0 +1,368 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.tileentity;
import cpw.mods.ironchest.common.blocks.BlockChest;
import cpw.mods.ironchest.common.blocks.BlockIronChest;
import cpw.mods.ironchest.common.blocks.IronChestType;
import cpw.mods.ironchest.common.gui.ContainerIronChest;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ItemStackHelper;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.IChestLid;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityLockableLoot;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.ITickable;
import net.minecraft.util.NonNullList;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.IBlockReader;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
public class TileEntityIronChest extends TileEntityLockableLoot implements IChestLid, ITickable
{
private NonNullList<ItemStack> chestContents;
/** The current angle of the lid (between 0 and 1) */
protected float lidAngle;
/** The angle of the lid last tick */
protected float prevLidAngle;
/** The number of players currently using this chest */
protected int numPlayersUsing;
/**
* A counter that is incremented once each tick. Used to determine when to recompute {@link #numPlayersUsing}; this
* is done every 200 ticks (but staggered between different chests). However, the new value isn't actually sent to
* clients when it is changed.
*/
private int ticksSinceSync;
private IronChestType chestType;
public TileEntityIronChest()
{
this(IronChestEntityType.IRON_CHEST, IronChestType.IRON);
}
protected TileEntityIronChest(TileEntityType<?> typeIn, IronChestType chestTypeIn)
{
super(typeIn);
this.chestType = chestTypeIn;
this.chestContents = NonNullList.<ItemStack> withSize(chestTypeIn.size, ItemStack.EMPTY);
}
@Override
public void setItems(NonNullList<ItemStack> contents)
{
this.chestContents = NonNullList.<ItemStack> withSize(this.getIronChestType().size, ItemStack.EMPTY);
for (int i = 0; i < contents.size(); i++)
{
if (i < this.chestContents.size())
{
this.getItems().set(i, contents.get(i));
}
}
}
@Override
public int getSizeInventory()
{
return this.getItems().size();
}
public IronChestType getIronChestType()
{
IronChestType type = IronChestType.IRON;
if (this.hasWorld())
{
IronChestType typeNew = BlockChest.getTypeFromBlock(this.getBlockState().getBlock());
if (typeNew != null)
{
type = typeNew;
}
}
return type;
}
@Override
public ItemStack getStackInSlot(int index)
{
this.fillWithLoot((EntityPlayer) null);
return this.getItems().get(index);
}
@Override
public void markDirty()
{
super.markDirty();
//this.sortTopStacks();
}
@Override
public void tick()
{
int i = this.pos.getX();
int j = this.pos.getY();
int k = this.pos.getZ();
++this.ticksSinceSync;
if (!this.world.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + i + j + k) % 200 == 0)
{
this.numPlayersUsing = 0;
for (EntityPlayer entityplayer : this.world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(i - 5.0F, j - 5.0F, k - 5.0F, i + 1 + 5.0F, j + 1 + 5.0F, k + 1 + 5.0F)))
{
if (entityplayer.openContainer instanceof ContainerIronChest)
{
++this.numPlayersUsing;
}
}
}
this.prevLidAngle = this.lidAngle;
if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F)
{
this.playSound(SoundEvents.BLOCK_CHEST_OPEN);
}
if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F)
{
float f2 = this.lidAngle;
if (this.numPlayersUsing > 0)
{
this.lidAngle += 0.1F;
}
else
{
this.lidAngle -= 0.1F;
}
if (this.lidAngle > 1.0F)
{
this.lidAngle = 1.0F;
}
if (this.lidAngle < 0.5F && f2 >= 0.5F)
{
this.playSound(SoundEvents.BLOCK_CHEST_CLOSE);
}
if (this.lidAngle < 0.0F)
{
this.lidAngle = 0.0F;
}
}
}
private void playSound(SoundEvent soundIn)
{
double d0 = this.pos.getX() + 0.5D;
double d1 = this.pos.getY() + 0.5D;
double d2 = this.pos.getZ() + 0.5D;
this.world.playSound((EntityPlayer) null, d0, d1, d2, soundIn, SoundCategory.BLOCKS, 0.5F, this.world.rand.nextFloat() * 0.1F + 0.9F);
}
@Override
public ITextComponent getName()
{
ITextComponent itextcomponent = this.getCustomName();
return itextcomponent != null ? itextcomponent : new TextComponentTranslation(this.getIronChestType().name(), new Object[0]);
}
@Override
public void read(NBTTagCompound compound)
{
super.read(compound);
this.chestContents = NonNullList.<ItemStack> withSize(this.getSizeInventory(), ItemStack.EMPTY);
if (!this.checkLootAndRead(compound))
{
ItemStackHelper.loadAllItems(compound, this.chestContents);
}
if (compound.contains("CustomName", 8))
{
this.customName = ITextComponent.Serializer.fromJson(compound.getString("CustomName"));
}
}
@Override
public NBTTagCompound write(NBTTagCompound compound)
{
super.write(compound);
if (!this.checkLootAndWrite(compound))
{
ItemStackHelper.saveAllItems(compound, this.chestContents);
}
ITextComponent itextcomponent = this.getCustomName();
if (itextcomponent != null)
{
compound.putString("CustomName", ITextComponent.Serializer.toJson(itextcomponent));
}
return compound;
}
@Override
public int getInventoryStackLimit()
{
return 64;
}
/**
* See {@link Block#eventReceived} for more information. This must return true serverside before it is called
* clientside.
*/
@Override
public boolean receiveClientEvent(int id, int type)
{
if (id == 1)
{
this.numPlayersUsing = type;
return true;
}
else
{
return super.receiveClientEvent(id, type);
}
}
@Override
public void openInventory(EntityPlayer player)
{
if (!player.isSpectator())
{
if (this.numPlayersUsing < 0)
{
this.numPlayersUsing = 0;
}
++this.numPlayersUsing;
this.onOpenOrClose();
}
}
@Override
public void closeInventory(EntityPlayer player)
{
if (!player.isSpectator())
{
--this.numPlayersUsing;
this.onOpenOrClose();
}
}
protected void onOpenOrClose()
{
Block block = this.getBlockState().getBlock();
if (block instanceof BlockIronChest)
{
this.world.addBlockEvent(this.pos, block, 1, this.numPlayersUsing);
this.world.notifyNeighborsOfStateChange(this.pos, block);
}
}
@Override
public boolean isItemValidForSlot(int index, ItemStack stack)
{
return this.getIronChestType().acceptsStack(stack);
}
public void wasPlaced(EntityLivingBase entityliving, ItemStack stack)
{
}
public void removeAdornments()
{
}
@Override
public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn)
{
this.fillWithLoot(playerIn);
return new ContainerIronChest(playerInventory, this, this.chestType, playerIn, this.chestType.xSize, this.chestType.ySize);
}
@Override
public String getGuiID()
{
return "IronChest:" + this.getIronChestType().name() + "_chest";
}
@Override
public NonNullList<ItemStack> getItems()
{
return this.chestContents;
}
@Override
public boolean isEmpty()
{
for (ItemStack itemstack : this.chestContents)
{
if (!itemstack.isEmpty())
{
return false;
}
}
return true;
}
@Override
@OnlyIn(Dist.CLIENT)
public float getLidAngle(float partialTicks)
{
return this.prevLidAngle + (this.lidAngle - this.prevLidAngle) * partialTicks;
}
public static int getPlayersUsing(IBlockReader reader, BlockPos posIn)
{
IBlockState iblockstate = reader.getBlockState(posIn);
if (iblockstate.hasTileEntity())
{
TileEntity tileentity = reader.getTileEntity(posIn);
if (tileentity instanceof TileEntityIronChest)
{
return ((TileEntityIronChest) tileentity).numPlayersUsing;
}
}
return 0;
}
}

View File

@ -0,0 +1,21 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.tileentity;
import cpw.mods.ironchest.common.blocks.IronChestType;
public class TileEntityObsidianChest extends TileEntityIronChest
{
public TileEntityObsidianChest()
{
super(IronChestEntityType.OBSIDIAN_CHEST, IronChestType.OBSIDIAN);
}
}

View File

@ -0,0 +1,21 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.tileentity;
import cpw.mods.ironchest.common.blocks.IronChestType;
public class TileEntitySilverChest extends TileEntityIronChest
{
public TileEntitySilverChest()
{
super(IronChestEntityType.SILVER_CHEST, IronChestType.SILVER);
}
}

View File

@ -0,0 +1,32 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.util;
import cpw.mods.ironchest.IronChest;
public class BlockNames
{
public static final String IRON_CHEST = IronChest.MOD_ID + ":iron_chest";
public static final String GOLD_CHEST = IronChest.MOD_ID + ":gold_chest";
public static final String DIAMOND_CHEST = IronChest.MOD_ID + ":diamond_chest";
public static final String COPPER_CHEST = IronChest.MOD_ID + ":copper_chest";
public static final String SILVER_CHEST = IronChest.MOD_ID + ":silver_chest";
public static final String CRYSTAL_CHEST = IronChest.MOD_ID + ":crystal_chest";
public static final String OBSIDIAN_CHEST = IronChest.MOD_ID + ":obsidian_chest";
public static final String DIRT_CHEST = IronChest.MOD_ID + ":dirt_chest";
}

View File

@ -0,0 +1,26 @@
package mcp;
import javax.annotation.Nonnull;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import javax.annotation.meta.TypeQualifierDefault;
/**
* This annotation can be applied to a package, class or method to indicate that
* the method in that element are nonnull by default unless there is:
* <ul>
* <li>An explicit nullness annotation
* <li>The method overrides a method in a superclass (in which case the
* annotation of the corresponding method in the superclass applies)
* <li> there is a default parameter annotation applied to a more tightly nested
* element.
* </ul>
*
*/
@Documented
@Nonnull
@TypeQualifierDefault(ElementType.METHOD) // Note: This is a copy of javax.annotation.ParametersAreNonnullByDefault with target changed to METHOD
@Retention(RetentionPolicy.RUNTIME)
public @interface MethodsReturnNonnullByDefault {}

View File

@ -0,0 +1,21 @@
modLoader="javafml"
loaderVersion="[24,)"
issueTrackerURL="https://github.com/progwml6/ironchest/issues"
displayURL="https://minecraft.curseforge.com/projects/iron-chests"
authors="CPW, alexbegt, progwml6"
[[mods]]
modId="ironchest"
version="${version}"
displayName="Iron Chests"
description='''
New chests with larger sizes, with in-place upgrade items.
The feature chest is the crystal chest, which is transparent - some inventory contents are visible without opening the chest
'''
[[dependencies.ironchest]]
modId="forge"
mandatory=true
versionRange="[24,)"
ordering="NONE"
side="BOTH"

View File

@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "ironchest:block/copper_chest" }
}
}

View File

@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "ironchest:block/crystal_chest" }
}
}

View File

@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "ironchest:block/diamond_chest" }
}
}

View File

@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "ironchest:block/dirt_chest" }
}
}

View File

@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "ironchest:block/gold_chest" }
}
}

View File

@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "ironchest:block/iron_chest" }
}
}

View File

@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "ironchest:block/obsidian_chest" }
}
}

View File

@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "ironchest:block/silver_chest" }
}
}

View File

@ -0,0 +1,33 @@
{
"_comment": "Blocks",
"block.ironchest.iron_chest": "Iron Chest",
"block.ironchest.gold_chest": "Gold Chest",
"block.ironchest.diamond_chest": "Diamond Chest",
"block.ironchest.copper_chest": "Copper Chest",
"block.ironchest.silver_chest": "Silver Chest",
"block.ironchest.crystal_chest": "Crystal Chest",
"block.ironchest.obsidian_chest": "Obsidian Chest",
"block.ironchest.dirt_chest": "DirtChest 9000!",
"_comment": "Upgrades",
"item.ironchest.iron_gold_chest_upgrade": "Iron to Gold Chest Upgrade",
"item.ironchest.gold_diamond_chest_upgrade": "Gold to Diamond Chest Upgrade",
"item.ironchest.copper_silver_chest_upgrade": "Copper to Silver Chest Upgrade",
"item.ironchest.silver_gold_chest_upgrade": "Silver to Gold Chest Upgrade",
"item.ironchest.copper_iron_chest_upgrade": "Copper to Iron Chest Upgrade",
"item.ironchest.diamond_crystal_chest_upgrade": "Diamond to Crystal Chest Upgrade",
"item.ironchest.wood_iron_chest_upgrade": "Wood to Iron Chest Upgrade",
"item.ironchest.wood_copper_chest_upgrade": "Wood to Copper Chest Upgrade",
"item.ironchest.diamond_obsidian_chest_upgrade": "Diamond to Obsidian Chest Upgrade",
"_comment": "Books",
"book.ironchest.dirtchest9000.title": "How to use your DirtChest 9000!",
"book.ironchest.dirtchest9000.page1": "Welcome to your new DirtChest 9000! We hope you will enjoy many happy years of storing your stack of dirt in our storage utility.",
"book.ironchest.dirtchest9000.page2": "Usage: simply insert the stack of dirt of your choice into the highly receptive slot and enjoy the great convenience of having that dirt available to you, any time you pass by this chest!",
"book.ironchest.dirtchest9000.page3": "We hope you have enjoyed reviewing this instruction manual, and hope you will consider using our products in future! Kind regards, The DirtChest 9000 manual writers incorporated.",
"book.ironchest.dirtchest9000.page4": "Warranty: This product has no warranty of any kind. Your dirt may not be stored, it may slowly leech into the environment, or alternatively, it may not do anything at all.",
"book.ironchest.dirtchest9000.page5": "DirtChest 9000 is kind to the environment. Please dispose of this guide book responsibly, and do not whatever you do just chuck it into some lava. We would be very sad.",
"_comment": "Item Groups",
"itemGroup.ironchest": "Iron Chests"
}

View File

@ -0,0 +1,42 @@
{
"parent": "block/block",
"textures": {
"texture": "ironchest:model/copper_chest",
"particle": "ironchest:block/copper_break"
},
"elements": [
{ "from": [ 1, 0, 1 ],
"to": [ 15, 10, 15 ],
"faces": {
"down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" },
"up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" },
"north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" },
"south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" },
"west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" },
"east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" }
}
},
{ "from": [ 1, 9, 1 ],
"to": [ 15, 14, 15 ],
"faces": {
"down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" },
"up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" },
"north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" },
"south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" },
"west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" },
"east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" }
}
},
{ "from": [ 7, 7, 0 ],
"to": [ 9, 11, 1 ],
"faces": {
"down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" },
"north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" },
"south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" },
"west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" },
"east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" }
}
}
]
}

View File

@ -0,0 +1,42 @@
{
"parent": "block/block",
"textures": {
"texture": "ironchest:model/crystal_chest",
"particle": "ironchest:block/crystal_break"
},
"elements": [
{ "from": [ 1, 0, 1 ],
"to": [ 15, 10, 15 ],
"faces": {
"down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" },
"up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" },
"north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" },
"south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" },
"west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" },
"east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" }
}
},
{ "from": [ 1, 9, 1 ],
"to": [ 15, 14, 15 ],
"faces": {
"down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" },
"up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" },
"north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" },
"south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" },
"west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" },
"east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" }
}
},
{ "from": [ 7, 7, 0 ],
"to": [ 9, 11, 1 ],
"faces": {
"down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" },
"north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" },
"south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" },
"west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" },
"east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" }
}
}
]
}

View File

@ -0,0 +1,42 @@
{
"parent": "block/block",
"textures": {
"texture": "ironchest:model/diamond_chest",
"particle": "ironchest:block/diamond_break"
},
"elements": [
{ "from": [ 1, 0, 1 ],
"to": [ 15, 10, 15 ],
"faces": {
"down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" },
"up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" },
"north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" },
"south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" },
"west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" },
"east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" }
}
},
{ "from": [ 1, 9, 1 ],
"to": [ 15, 14, 15 ],
"faces": {
"down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" },
"up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" },
"north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" },
"south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" },
"west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" },
"east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" }
}
},
{ "from": [ 7, 7, 0 ],
"to": [ 9, 11, 1 ],
"faces": {
"down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" },
"north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" },
"south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" },
"west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" },
"east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" }
}
}
]
}

View File

@ -0,0 +1,42 @@
{
"parent": "block/block",
"textures": {
"texture": "ironchest:model/dirt_chest",
"particle": "minecraft:block/dirt"
},
"elements": [
{ "from": [ 1, 0, 1 ],
"to": [ 15, 10, 15 ],
"faces": {
"down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" },
"up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" },
"north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" },
"south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" },
"west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" },
"east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" }
}
},
{ "from": [ 1, 9, 1 ],
"to": [ 15, 14, 15 ],
"faces": {
"down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" },
"up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" },
"north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" },
"south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" },
"west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" },
"east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" }
}
},
{ "from": [ 7, 7, 0 ],
"to": [ 9, 11, 1 ],
"faces": {
"down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" },
"north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" },
"south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" },
"west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" },
"east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" }
}
}
]
}

View File

@ -0,0 +1,42 @@
{
"parent": "block/block",
"textures": {
"texture": "ironchest:model/gold_chest",
"particle": "ironchest:block/gold_break"
},
"elements": [
{ "from": [ 1, 0, 1 ],
"to": [ 15, 10, 15 ],
"faces": {
"down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" },
"up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" },
"north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" },
"south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" },
"west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" },
"east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" }
}
},
{ "from": [ 1, 9, 1 ],
"to": [ 15, 14, 15 ],
"faces": {
"down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" },
"up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" },
"north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" },
"south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" },
"west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" },
"east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" }
}
},
{ "from": [ 7, 7, 0 ],
"to": [ 9, 11, 1 ],
"faces": {
"down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" },
"north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" },
"south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" },
"west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" },
"east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" }
}
}
]
}

View File

@ -0,0 +1,42 @@
{
"parent": "block/block",
"textures": {
"texture": "ironchest:model/iron_chest",
"particle": "ironchest:block/iron_break"
},
"elements": [
{ "from": [ 1, 0, 1 ],
"to": [ 15, 10, 15 ],
"faces": {
"down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" },
"up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" },
"north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" },
"south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" },
"west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" },
"east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" }
}
},
{ "from": [ 1, 9, 1 ],
"to": [ 15, 14, 15 ],
"faces": {
"down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" },
"up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" },
"north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" },
"south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" },
"west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" },
"east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" }
}
},
{ "from": [ 7, 7, 0 ],
"to": [ 9, 11, 1 ],
"faces": {
"down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" },
"north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" },
"south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" },
"west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" },
"east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" }
}
}
]
}

View File

@ -0,0 +1,42 @@
{
"parent": "block/block",
"textures": {
"texture": "ironchest:model/obsidian_chest",
"particle": "minecraft:block/obsidian"
},
"elements": [
{ "from": [ 1, 0, 1 ],
"to": [ 15, 10, 15 ],
"faces": {
"down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" },
"up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" },
"north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" },
"south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" },
"west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" },
"east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" }
}
},
{ "from": [ 1, 9, 1 ],
"to": [ 15, 14, 15 ],
"faces": {
"down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" },
"up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" },
"north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" },
"south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" },
"west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" },
"east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" }
}
},
{ "from": [ 7, 7, 0 ],
"to": [ 9, 11, 1 ],
"faces": {
"down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" },
"north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" },
"south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" },
"west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" },
"east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" }
}
}
]
}

View File

@ -0,0 +1,42 @@
{
"parent": "block/block",
"textures": {
"texture": "ironchest:model/silver_chest",
"particle": "ironchest:block/silver_break"
},
"elements": [
{ "from": [ 1, 0, 1 ],
"to": [ 15, 10, 15 ],
"faces": {
"down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" },
"up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" },
"north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" },
"south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" },
"west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" },
"east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" }
}
},
{ "from": [ 1, 9, 1 ],
"to": [ 15, 14, 15 ],
"faces": {
"down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" },
"up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" },
"north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" },
"south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" },
"west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" },
"east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" }
}
},
{ "from": [ 7, 7, 0 ],
"to": [ 9, 11, 1 ],
"faces": {
"down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" },
"north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" },
"south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" },
"west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" },
"east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" }
}
}
]
}

View File

@ -0,0 +1,35 @@
{
"parent": "builtin/entity",
"display": {
"gui": {
"rotation": [ 30, 45, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.625, 0.625, 0.625 ]
},
"ground": {
"rotation": [ 0, 0, 0 ],
"translation": [ 0, 3, 0],
"scale":[ 0.25, 0.25, 0.25 ]
},
"head": {
"rotation": [ 0, 180, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 1, 1, 1]
},
"fixed": {
"rotation": [ 0, 180, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.5, 0.5, 0.5 ]
},
"thirdperson_righthand": {
"rotation": [ 75, 315, 0 ],
"translation": [ 0, 2.5, 0],
"scale": [ 0.375, 0.375, 0.375 ]
},
"firstperson_righthand": {
"rotation": [ 0, 315, 0 ],
"translation": [ 0, 0, 0],
"scale": [ 0.4, 0.4, 0.4 ]
}
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "ironchest:item/copper_iron_upgrade"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "ironchest:item/copper_silver_upgrade"
}
}

View File

@ -0,0 +1,35 @@
{
"parent": "builtin/entity",
"display": {
"gui": {
"rotation": [ 30, 45, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.625, 0.625, 0.625 ]
},
"ground": {
"rotation": [ 0, 0, 0 ],
"translation": [ 0, 3, 0],
"scale":[ 0.25, 0.25, 0.25 ]
},
"head": {
"rotation": [ 0, 180, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 1, 1, 1]
},
"fixed": {
"rotation": [ 0, 180, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.5, 0.5, 0.5 ]
},
"thirdperson_righthand": {
"rotation": [ 75, 315, 0 ],
"translation": [ 0, 2.5, 0],
"scale": [ 0.375, 0.375, 0.375 ]
},
"firstperson_righthand": {
"rotation": [ 0, 315, 0 ],
"translation": [ 0, 0, 0],
"scale": [ 0.4, 0.4, 0.4 ]
}
}
}

View File

@ -0,0 +1,35 @@
{
"parent": "builtin/entity",
"display": {
"gui": {
"rotation": [ 30, 45, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.625, 0.625, 0.625 ]
},
"ground": {
"rotation": [ 0, 0, 0 ],
"translation": [ 0, 3, 0],
"scale":[ 0.25, 0.25, 0.25 ]
},
"head": {
"rotation": [ 0, 180, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 1, 1, 1]
},
"fixed": {
"rotation": [ 0, 180, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.5, 0.5, 0.5 ]
},
"thirdperson_righthand": {
"rotation": [ 75, 315, 0 ],
"translation": [ 0, 2.5, 0],
"scale": [ 0.375, 0.375, 0.375 ]
},
"firstperson_righthand": {
"rotation": [ 0, 315, 0 ],
"translation": [ 0, 0, 0],
"scale": [ 0.4, 0.4, 0.4 ]
}
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "ironchest:item/diamond_crystal_upgrade"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "ironchest:item/diamond_obsidian_upgrade"
}
}

View File

@ -0,0 +1,35 @@
{
"parent": "builtin/entity",
"display": {
"gui": {
"rotation": [ 30, 45, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.625, 0.625, 0.625 ]
},
"ground": {
"rotation": [ 0, 0, 0 ],
"translation": [ 0, 3, 0],
"scale":[ 0.25, 0.25, 0.25 ]
},
"head": {
"rotation": [ 0, 180, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 1, 1, 1]
},
"fixed": {
"rotation": [ 0, 180, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.5, 0.5, 0.5 ]
},
"thirdperson_righthand": {
"rotation": [ 75, 315, 0 ],
"translation": [ 0, 2.5, 0],
"scale": [ 0.375, 0.375, 0.375 ]
},
"firstperson_righthand": {
"rotation": [ 0, 315, 0 ],
"translation": [ 0, 0, 0],
"scale": [ 0.4, 0.4, 0.4 ]
}
}
}

View File

@ -0,0 +1,35 @@
{
"parent": "builtin/entity",
"display": {
"gui": {
"rotation": [ 30, 45, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.625, 0.625, 0.625 ]
},
"ground": {
"rotation": [ 0, 0, 0 ],
"translation": [ 0, 3, 0],
"scale":[ 0.25, 0.25, 0.25 ]
},
"head": {
"rotation": [ 0, 180, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 1, 1, 1]
},
"fixed": {
"rotation": [ 0, 180, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.5, 0.5, 0.5 ]
},
"thirdperson_righthand": {
"rotation": [ 75, 315, 0 ],
"translation": [ 0, 2.5, 0],
"scale": [ 0.375, 0.375, 0.375 ]
},
"firstperson_righthand": {
"rotation": [ 0, 315, 0 ],
"translation": [ 0, 0, 0],
"scale": [ 0.4, 0.4, 0.4 ]
}
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "ironchest:item/gold_diamond_upgrade"
}
}

View File

@ -0,0 +1,35 @@
{
"parent": "builtin/entity",
"display": {
"gui": {
"rotation": [ 30, 45, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.625, 0.625, 0.625 ]
},
"ground": {
"rotation": [ 0, 0, 0 ],
"translation": [ 0, 3, 0],
"scale":[ 0.25, 0.25, 0.25 ]
},
"head": {
"rotation": [ 0, 180, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 1, 1, 1]
},
"fixed": {
"rotation": [ 0, 180, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.5, 0.5, 0.5 ]
},
"thirdperson_righthand": {
"rotation": [ 75, 315, 0 ],
"translation": [ 0, 2.5, 0],
"scale": [ 0.375, 0.375, 0.375 ]
},
"firstperson_righthand": {
"rotation": [ 0, 315, 0 ],
"translation": [ 0, 0, 0],
"scale": [ 0.4, 0.4, 0.4 ]
}
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "ironchest:item/iron_gold_upgrade"
}
}

View File

@ -0,0 +1,35 @@
{
"parent": "builtin/entity",
"display": {
"gui": {
"rotation": [ 30, 45, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.625, 0.625, 0.625 ]
},
"ground": {
"rotation": [ 0, 0, 0 ],
"translation": [ 0, 3, 0],
"scale":[ 0.25, 0.25, 0.25 ]
},
"head": {
"rotation": [ 0, 180, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 1, 1, 1]
},
"fixed": {
"rotation": [ 0, 180, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.5, 0.5, 0.5 ]
},
"thirdperson_righthand": {
"rotation": [ 75, 315, 0 ],
"translation": [ 0, 2.5, 0],
"scale": [ 0.375, 0.375, 0.375 ]
},
"firstperson_righthand": {
"rotation": [ 0, 315, 0 ],
"translation": [ 0, 0, 0],
"scale": [ 0.4, 0.4, 0.4 ]
}
}
}

View File

@ -0,0 +1,35 @@
{
"parent": "builtin/entity",
"display": {
"gui": {
"rotation": [ 30, 45, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.625, 0.625, 0.625 ]
},
"ground": {
"rotation": [ 0, 0, 0 ],
"translation": [ 0, 3, 0],
"scale":[ 0.25, 0.25, 0.25 ]
},
"head": {
"rotation": [ 0, 180, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 1, 1, 1]
},
"fixed": {
"rotation": [ 0, 180, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.5, 0.5, 0.5 ]
},
"thirdperson_righthand": {
"rotation": [ 75, 315, 0 ],
"translation": [ 0, 2.5, 0],
"scale": [ 0.375, 0.375, 0.375 ]
},
"firstperson_righthand": {
"rotation": [ 0, 315, 0 ],
"translation": [ 0, 0, 0],
"scale": [ 0.4, 0.4, 0.4 ]
}
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "ironchest:item/silver_gold_upgrade"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "ironchest:item/wood_copper_upgrade"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "ironchest:item/wood_iron_upgrade"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

Some files were not shown because too many files have changed in this diff Show More