mirror of
https://github.com/GTNewHorizons/waila.git
synced 2026-11-15 01:25:16 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a750f76a5d | ||
|
|
cd587ee8ca | ||
|
|
987254caca | ||
|
|
ef5ff0c6ed | ||
|
|
e9947e3960 | ||
|
|
95bf99a24a | ||
|
|
be530da970 | ||
|
|
5d82ebf0d5 | ||
|
|
165cb1003c | ||
|
|
5388d1bea0 | ||
|
|
c40c032531 | ||
|
|
bf0bb6e0c7 | ||
|
|
42c35d2b69 | ||
|
|
e9b440616e | ||
|
|
d1b354f05e | ||
|
|
0742ef2422 | ||
|
|
8e45cb8064 | ||
|
|
6896998934 | ||
|
|
74a2805844 | ||
|
|
c95daee0e2 | ||
|
|
bb5cd6cbfa | ||
|
|
3dde25b1a4 | ||
|
|
66649fa9dd | ||
|
|
a87c29bb2f | ||
|
|
3a057e4aba | ||
|
|
b50df6af26 | ||
|
|
8e8fd7f2bd | ||
|
|
d9f209a1d4 | ||
|
|
5e6ccc5ff8 | ||
|
|
bbfcc3b3ad | ||
|
|
d4a7b62644 | ||
|
|
417a75a896 | ||
|
|
b551d54e5c | ||
|
|
16ca8f2917 | ||
|
|
e7f2cab192 | ||
|
|
40063f3799 | ||
|
|
326d2b519b | ||
|
|
a7668e321c | ||
|
|
79af54e8cf | ||
|
|
09f8bbe33e | ||
|
|
1908f39995 | ||
|
|
748fc3fffa | ||
|
|
250dc6ac2a | ||
|
|
b81d2d3709 | ||
|
|
a873131d2f | ||
|
|
b5689428e8 | ||
|
|
d6285e2932 | ||
|
|
eb348d10fc | ||
|
|
7eb3ddb50c | ||
|
|
fde934363c | ||
|
|
dce9809205 | ||
|
|
15bee287f3 | ||
|
|
f28ed4c274 | ||
|
|
fc3606b71c | ||
|
|
aeff9c1039 | ||
|
|
9fd13c9ca1 | ||
|
|
ac1cc77258 | ||
|
|
e6005e55af | ||
|
|
62ec48ba21 | ||
|
|
7ab8981dde | ||
|
|
f8202e8fa8 | ||
|
|
b18fb9df61 | ||
|
|
b4ca299115 | ||
|
|
b0104482bb | ||
|
|
ef9ee6441d | ||
|
|
4ad3e92fae | ||
|
|
098c88676e | ||
|
|
4b05b017f7 | ||
|
|
a92a5dde3c | ||
|
|
a6890c5824 | ||
|
|
e87d08a789 | ||
|
|
65d8ef8c63 | ||
|
|
878a00b16b | ||
|
|
984b26c7fd | ||
|
|
b2cc1e02d7 | ||
|
|
83c7ef6aa9 | ||
|
|
6fca3468e2 | ||
|
|
d134aba573 | ||
|
|
8f32c0c770 | ||
|
|
e0a5da865f | ||
|
|
69a62e6edf | ||
|
|
a6da4adc08 | ||
|
|
2d3768423f | ||
|
|
cb2491f3f3 | ||
|
|
9248b75a0c | ||
|
|
fc46634fcc | ||
|
|
9df8f252c0 | ||
|
|
a844fb4815 | ||
|
|
58266d3cd1 | ||
|
|
94a22bf6ca | ||
|
|
32a50e112b | ||
|
|
6dbcf366bd | ||
|
|
24efba751d | ||
|
|
e681b98231 | ||
|
|
30d88b4c45 | ||
|
|
9a13ff7898 | ||
|
|
91ac3a9e32 | ||
|
|
1036c7c0c0 | ||
|
|
c03d9183a8 | ||
|
|
5da91bea2d | ||
|
|
c2ceb365d9 | ||
|
|
4488c37149 | ||
|
|
3c3fcad888 | ||
|
|
391cfe8290 | ||
|
|
8c2ff2b56f | ||
|
|
d9a16ba7fa | ||
|
|
3b906f4de8 | ||
|
|
0496543d70 | ||
|
|
e9cc68d2b1 | ||
|
|
8a5dc45240 | ||
|
|
d23855b263 | ||
|
|
5601fcdf7b | ||
|
|
a87d3b9de7 | ||
|
|
67775bad84 | ||
|
|
3d004700fb | ||
|
|
b3b2024ce7 | ||
|
|
c1cfb94a0d | ||
|
|
029d141872 | ||
|
|
ed93c68fb9 | ||
|
|
4b8acb517e | ||
|
|
419308e2ac | ||
|
|
8dc890421d | ||
|
|
fe90900b55 | ||
|
|
1d9807e6d6 | ||
|
|
58931febc4 | ||
|
|
d72dfa5775 | ||
|
|
dbf49534da | ||
|
|
aad38c1eac | ||
|
|
c0727b2157 | ||
|
|
3085f7442a | ||
|
|
25cfff7354 | ||
|
|
13f49db4b7 | ||
|
|
117808a326 | ||
|
|
31ee058c87 | ||
|
|
4d8087fb4c | ||
|
|
cef91a3ef4 | ||
|
|
9da2402851 | ||
|
|
3eaffb5812 | ||
|
|
643d1bfad2 | ||
|
|
ad6fd7290a | ||
|
|
7e012ff6c6 | ||
|
|
b547b7ece6 | ||
|
|
022d792d01 | ||
|
|
c4f6b40ea5 | ||
|
|
709f750a2a | ||
|
|
281a8f26dd | ||
|
|
03b8097ccb | ||
|
|
6a2c137bce | ||
|
|
e9c43a71fa | ||
|
|
f7e0e24548 | ||
|
|
73c5383d59 | ||
|
|
4cbe727b81 | ||
|
|
00ea3d77cc | ||
|
|
bc424e1d01 | ||
|
|
3c048e9795 | ||
|
|
eeb3c7f48a | ||
|
|
ee1118ee4b | ||
|
|
636ae4203e | ||
|
|
5360475686 | ||
|
|
15f89627c6 | ||
|
|
e42914c721 | ||
|
|
394d9cd564 | ||
|
|
f648c41890 | ||
|
|
37498dc0b1 | ||
|
|
ed1a4d010d | ||
|
|
83ee66d8a6 | ||
|
|
c4dcdd926a | ||
|
|
3048dfe09a | ||
|
|
6acfa28ef7 | ||
|
|
bac71d0894 | ||
|
|
b2dabe7bed | ||
|
|
78a8f92b2f | ||
|
|
137db44e23 | ||
|
|
d744bdf25b | ||
|
|
1eb67afea6 | ||
|
|
396dbd734a | ||
|
|
fb00790fdc | ||
|
|
39124f153f | ||
|
|
acda2b4a85 | ||
|
|
5a82bb2a5c | ||
|
|
f754ab5fbe | ||
|
|
4ebbd2b3e9 | ||
|
|
4970a268f4 | ||
|
|
da64a0a019 | ||
|
|
d687bb5383 | ||
|
|
37d07ab99f | ||
|
|
172e8ca659 | ||
|
|
243ca7db20 | ||
|
|
39a979ef62 |
No files matched your search
+387
@@ -0,0 +1,387 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
APACHE COMMONS MATH DERIVATIVE WORKS:
|
||||
|
||||
The Apache commons-math library includes a number of subcomponents
|
||||
whose implementation is derived from original sources written
|
||||
in C or Fortran. License terms of the original sources
|
||||
are reproduced below.
|
||||
|
||||
===============================================================================
|
||||
For the lmder, lmpar and qrsolv Fortran routine from minpack and translated in
|
||||
the LevenbergMarquardtOptimizer class in package
|
||||
org.apache.commons.math3.optimization.general
|
||||
Original source copyright and license statement:
|
||||
|
||||
Minpack Copyright Notice (1999) University of Chicago. All rights reserved
|
||||
|
||||
Redistribution and use in source and binary forms, with or
|
||||
without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials
|
||||
provided with the distribution.
|
||||
|
||||
3. The end-user documentation included with the
|
||||
redistribution, if any, must include the following
|
||||
acknowledgment:
|
||||
|
||||
"This product includes software developed by the
|
||||
University of Chicago, as Operator of Argonne National
|
||||
Laboratory.
|
||||
|
||||
Alternately, this acknowledgment may appear in the software
|
||||
itself, if and wherever such third-party acknowledgments
|
||||
normally appear.
|
||||
|
||||
4. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS"
|
||||
WITHOUT WARRANTY OF ANY KIND. THE COPYRIGHT HOLDER, THE
|
||||
UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND
|
||||
THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE
|
||||
OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY
|
||||
OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR
|
||||
USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF
|
||||
THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4)
|
||||
DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION
|
||||
UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL
|
||||
BE CORRECTED.
|
||||
|
||||
5. LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT
|
||||
HOLDER, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF
|
||||
ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT,
|
||||
INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF
|
||||
ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER
|
||||
SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT
|
||||
(INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE,
|
||||
EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE
|
||||
POSSIBILITY OF SUCH LOSS OR DAMAGES.
|
||||
===============================================================================
|
||||
|
||||
Copyright and license statement for the odex Fortran routine developed by
|
||||
E. Hairer and G. Wanner and translated in GraggBulirschStoerIntegrator class
|
||||
in package org.apache.commons.math3.ode.nonstiff:
|
||||
|
||||
|
||||
Copyright (c) 2004, Ernst Hairer
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
===============================================================================
|
||||
|
||||
Copyright and license statement for the original lapack fortran routines
|
||||
translated in EigenDecompositionImpl class in package
|
||||
org.apache.commons.math3.linear:
|
||||
|
||||
Copyright (c) 1992-2008 The University of Tennessee. All rights reserved.
|
||||
|
||||
$COPYRIGHT$
|
||||
|
||||
Additional copyrights may follow
|
||||
|
||||
$HEADER$
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer listed
|
||||
in this license in the documentation and/or other materials
|
||||
provided with the distribution.
|
||||
|
||||
- Neither the name of the copyright holders nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
===============================================================================
|
||||
|
||||
Copyright and license statement for the original Mersenne twister C
|
||||
routines translated in MersenneTwister class in package
|
||||
org.apache.commons.math3.random:
|
||||
|
||||
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. The names of its contributors may not be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
===============================================================================
|
||||
|
||||
The class "org.apache.commons.math3.exception.util.LocalizedFormatsTest" is
|
||||
an adapted version of "OrekitMessagesTest" test class for the Orekit library
|
||||
The "org.apache.commons.math3.analysis.interpolation.HermiteInterpolator"
|
||||
has been imported from the Orekit space flight dynamics library.
|
||||
|
||||
Th Orekit library is described at:
|
||||
https://www.orekit.org/forge/projects/orekit
|
||||
The original files are distributed under the terms of the Apache 2 license
|
||||
which is: Copyright 2010 CS Communication & Systèmes
|
||||
Binary file not shown.
@@ -0,0 +1,127 @@
|
||||
screen.button.waila=Waila
|
||||
screen.button.modules=Module
|
||||
screen.label.scale=Maße
|
||||
screen.label.dragtuto=Verschiebe das HUD, um seine Position zu ändern.
|
||||
|
||||
screen.button.default=Standard
|
||||
screen.button.cancel=Abbrechen
|
||||
screen.button.ok=Ok
|
||||
screen.button.yes=Ja
|
||||
screen.button.no=Nein
|
||||
screen.button.back=Zurück
|
||||
screen.button.hidden=Versteckt
|
||||
screen.button.visible=Sichtbar
|
||||
screen.button.maintained=Gewartet
|
||||
screen.button.toggled=Geschaltet
|
||||
|
||||
choice.showhidewaila=Zeige/Verstecke Waila
|
||||
choice.showhideidmeta=Zeige ID:Metadata
|
||||
choice.toggledmaintained=Geschaltet/Gewartet
|
||||
choice.showliquids=Flüssigkeiten
|
||||
screen.button.configureaspect=Konfiguriere Aspekt...
|
||||
|
||||
enchant.title.name=Name
|
||||
enchant.title.minlvl=Min lvl
|
||||
enchant.title.maxlvl=Max lvl
|
||||
enchant.title.weight=Gewicht
|
||||
enchant.label.enchantability=Verzauberbarkeit
|
||||
|
||||
waila.keybind.wailaconfig=[Waila] Config-Bildschirm
|
||||
waila.keybind.wailadisplay=[Waila] Zeigen/Verstecken
|
||||
waila.keybind.liquid=[Waila] Zeige Flüssigkeiten
|
||||
waila.keybind.recipe=[Waila] Zeige Rezept
|
||||
waila.keybind.usage=[Waila] Zeige Nutzung
|
||||
waila.keybind.testing=[Waila] Testen
|
||||
|
||||
client.msg.norecipe=Kein Rezept gefunden.
|
||||
client.msg.nousage=Keine Nutzung gefunden.
|
||||
|
||||
hud.msg.none=<Nichts>
|
||||
hud.msg.empty=<Leer>
|
||||
hud.msg.output=Output
|
||||
hud.msg.input=Input
|
||||
hud.msg.out=Out
|
||||
hud.msg.in=In
|
||||
hud.msg.power=Energie
|
||||
hud.msg.storage=Gespeichert
|
||||
hud.msg.any=Jegliches
|
||||
hud.msg.mode=Modus
|
||||
hud.msg.maxpower=Max Energie
|
||||
hud.msg.trigger=Trigger
|
||||
hud.msg.maxio=Max IO
|
||||
|
||||
hud.msg.send=Senden
|
||||
hud.msg.recv=Empfangen
|
||||
hud.msg.item=Item
|
||||
hud.msg.fluid=Flüssigk.
|
||||
hud.msg.energ=Energie
|
||||
hud.msg.frequency=Frequenz
|
||||
|
||||
hud.msg.owner=Besitzer
|
||||
hud.msg.public=Öffentlich
|
||||
hud.msg.restricted=Eingeschränkt
|
||||
hud.msg.private=Privat
|
||||
|
||||
hud.msg.white=Weiß
|
||||
hud.msg.orange=Orange
|
||||
hud.msg.magenta=Magenta
|
||||
hud.msg.lblue=HBlau
|
||||
hud.msg.yellow=Gelb
|
||||
hud.msg.lime=HGrün
|
||||
hud.msg.pink=Pink
|
||||
hud.msg.gray=Grau
|
||||
hud.msg.lgray=HGrau
|
||||
hud.msg.cyan=Türkis
|
||||
hud.msg.purple=Violett
|
||||
hud.msg.blue=Blau
|
||||
hud.msg.brown=Braun
|
||||
hud.msg.green=Grün
|
||||
hud.msg.red=Rot
|
||||
hud.msg.black=Schwarz
|
||||
|
||||
hud.msg.growth=Wachstum
|
||||
hud.msg.mature=Erwachsen
|
||||
hud.msg.off=Aus
|
||||
hud.msg.on=An
|
||||
hud.msg.state=Status
|
||||
hud.msg.delay=Verzögerung
|
||||
hud.msg.comparator=Komparator
|
||||
hud.msg.substractor=Substraktor
|
||||
hud.msg.record=Platte
|
||||
|
||||
option.appeng.monitorcontent=Monitorinhalt
|
||||
option.bb.content=Fassinhalt
|
||||
option.bc.tankamount=Flüssigk.-Menge
|
||||
option.bc.tanktype=Flüssigk.-Typ
|
||||
option.enderstorage.colors=Farben
|
||||
option.ic2.inputeumach=Max EU-Input [Maschinen]
|
||||
option.ic2.inputeuother=Max EU-Input [Anderes]
|
||||
option.ic2.outputeu=Max EU-Output
|
||||
option.ic2.storage=Energie gespeichert
|
||||
option.thaumcraft.storedvis=Kondensatorspeicher
|
||||
option.thermalexpansion.energyhandler=Zeige RO-Speicher
|
||||
option.thermalexpansion.energycell=Zeige EZellen IN/OUT
|
||||
option.thermalexpansion.fluidtype=Zeige Flüssigk.-Typ
|
||||
option.thermalexpansion.fluidamount=Zeige Flüssigk.-Menge
|
||||
option.thermalexpansion.tankmode=Zeige Tankmodus
|
||||
option.thermalexpansion.tesssendrecv=Tesseraktmodus
|
||||
option.thermalexpansion.tessfreq=Tesseraktfrequenz
|
||||
option.thermalexpansion.owner=Zeige Besitzer
|
||||
option.thermalexpansion.conditemmode=Zeige Itemduktmodus
|
||||
option.vanilla.spawntype=Spawner-Typ
|
||||
option.vanilla.growthvalue=Wachstumswert
|
||||
option.vanilla.leverstate=Hebelstatus
|
||||
option.vanilla.repeater=Repeater-Verzögerung
|
||||
option.vanilla.comparator=Komparatormodus
|
||||
option.vanilla.redstone=Redstone-Stärke
|
||||
option.vanilla.jukebox=Musikbox-Platte
|
||||
option.etb.displaydata=Zeigel Sockeldaten
|
||||
option.enderio.inout=Zeige Input/Output
|
||||
option.enderio.storage=Zeige gespeicherte MJ
|
||||
option.enderio.owner=Zeige Block-Besitzer
|
||||
option.enderio.channel=Zeige Hypercube-Kanal
|
||||
option.bcapi.storage=Zeige gespeicherte MJ
|
||||
option.bcapi.consump=Zeige maximale Energie
|
||||
option.bcapi.trigger=Zeige Startenergie
|
||||
option.pr.showio=Zeige Gatter IO
|
||||
option.pr.showdata=Zeige Gatterdaten
|
||||
@@ -0,0 +1,127 @@
|
||||
screen.button.waila=Waila
|
||||
screen.button.modules=Modules
|
||||
screen.label.scale=Scale
|
||||
screen.label.dragtuto=Drag the HUD to setup its position.
|
||||
|
||||
screen.button.default=Default
|
||||
screen.button.cancel=Cancel
|
||||
screen.button.ok=Ok
|
||||
screen.button.yes=Yes
|
||||
screen.button.no=No
|
||||
screen.button.back=Back
|
||||
screen.button.hidden=Hidden
|
||||
screen.button.visible=Visible
|
||||
screen.button.maintained=Maintained
|
||||
screen.button.toggled=Toggled
|
||||
|
||||
choice.showhidewaila=Show/Hide Waila
|
||||
choice.showhideidmeta=Show ID:Metadata
|
||||
choice.toggledmaintained=Toggled/Maintained
|
||||
choice.showliquids=Liquids
|
||||
screen.button.configureaspect=Configure aspect...
|
||||
|
||||
enchant.title.name=Name
|
||||
enchant.title.minlvl=Min lvl
|
||||
enchant.title.maxlvl=Max lvl
|
||||
enchant.title.weight=Weight
|
||||
enchant.label.enchantability=Enchantability
|
||||
|
||||
waila.keybind.wailaconfig=[Waila] Config screen
|
||||
waila.keybind.wailadisplay=[Waila] Show/Hide
|
||||
waila.keybind.liquid=[Waila] Show liquids
|
||||
waila.keybind.recipe=[Waila] Show recipe
|
||||
waila.keybind.usage=[Waila] Show usage
|
||||
waila.keybind.testing=[Waila] Testing
|
||||
|
||||
client.msg.norecipe=No recipe found.
|
||||
client.msg.nousage=No usage found.
|
||||
|
||||
hud.msg.none=<None>
|
||||
hud.msg.empty=<Empty>
|
||||
hud.msg.output=Output
|
||||
hud.msg.input=Input
|
||||
hud.msg.out=Out
|
||||
hud.msg.in=In
|
||||
hud.msg.power=Power
|
||||
hud.msg.storage=Storage
|
||||
hud.msg.any=Any
|
||||
hud.msg.mode=Mode
|
||||
hud.msg.maxpower=Max Power
|
||||
hud.msg.trigger=Trigger
|
||||
hud.msg.maxio=Max IO
|
||||
|
||||
hud.msg.send=Send
|
||||
hud.msg.recv=Recv
|
||||
hud.msg.item=Item
|
||||
hud.msg.fluid=Fluid
|
||||
hud.msg.energ=Energy
|
||||
hud.msg.frequency=Frequency
|
||||
|
||||
hud.msg.owner=Owner
|
||||
hud.msg.public=Public
|
||||
hud.msg.restricted=Restricted
|
||||
hud.msg.private=Private
|
||||
|
||||
hud.msg.white=White
|
||||
hud.msg.orange=Orange
|
||||
hud.msg.magenta=Magenta
|
||||
hud.msg.lblue=LBlue
|
||||
hud.msg.yellow=Yellow
|
||||
hud.msg.lime=Lime
|
||||
hud.msg.pink=Pink
|
||||
hud.msg.gray=Gray
|
||||
hud.msg.lgray=LGray
|
||||
hud.msg.cyan=Cyan
|
||||
hud.msg.purple=Purple
|
||||
hud.msg.blue=Blue
|
||||
hud.msg.brown=Brown
|
||||
hud.msg.green=Green
|
||||
hud.msg.red=Red
|
||||
hud.msg.black=Black
|
||||
|
||||
hud.msg.growth=Growth
|
||||
hud.msg.mature=Mature
|
||||
hud.msg.off=Off
|
||||
hud.msg.on=On
|
||||
hud.msg.state=State
|
||||
hud.msg.delay=Delay
|
||||
hud.msg.comparator=Comparator
|
||||
hud.msg.substractor=Substractor
|
||||
hud.msg.record=Record
|
||||
|
||||
option.appeng.monitorcontent=Monitor's content
|
||||
option.bb.content=Barrel's content
|
||||
option.bc.tankamount=Liquid amount
|
||||
option.bc.tanktype=Liquid type
|
||||
option.enderstorage.colors=Colors
|
||||
option.ic2.inputeumach=Max EU input [Machines]
|
||||
option.ic2.inputeuother=Max EU input [Other]
|
||||
option.ic2.outputeu=Max EU output
|
||||
option.ic2.storage=Energy stored
|
||||
option.thaumcraft.storedvis=Capacitor storage
|
||||
option.thermalexpansion.energyhandler=Show RF storage
|
||||
option.thermalexpansion.energycell=Show ECell IN/OUT
|
||||
option.thermalexpansion.fluidtype=Show fluid type
|
||||
option.thermalexpansion.fluidamount=Show fluid amount
|
||||
option.thermalexpansion.tankmode=Show tank mode
|
||||
option.thermalexpansion.tesssendrecv=Tesseract mode
|
||||
option.thermalexpansion.tessfreq=Tesseract frequency
|
||||
option.thermalexpansion.owner=Show owner
|
||||
option.thermalexpansion.conditemmode=Show Itemduct mode
|
||||
option.vanilla.spawntype=Spawner type
|
||||
option.vanilla.growthvalue=Growth value
|
||||
option.vanilla.leverstate=Lever state
|
||||
option.vanilla.repeater=Repeater delay
|
||||
option.vanilla.comparator=Comparator mode
|
||||
option.vanilla.redstone=Redstone power
|
||||
option.vanilla.jukebox=Jukebox disk
|
||||
option.etb.displaydata=Show socket data
|
||||
option.enderio.inout=Show input/output
|
||||
option.enderio.storage=Show stored MJ
|
||||
option.enderio.owner=Show block owner
|
||||
option.enderio.channel=Show hypercube channel
|
||||
option.bcapi.storage=Show stored MJ
|
||||
option.bcapi.consump=Show maximum power
|
||||
option.bcapi.trigger=Show triggering energy
|
||||
option.pr.showio=Show gates IO
|
||||
option.pr.showdata=Show gates data
|
||||
@@ -0,0 +1,127 @@
|
||||
screen.button.waila=Waila
|
||||
screen.button.modules=Modules
|
||||
screen.label.scale=Echelle
|
||||
screen.label.dragtuto=Faites glisser le HUD pour paramétrer la position.
|
||||
|
||||
screen.button.default=Défaut
|
||||
screen.button.cancel=Annuler
|
||||
screen.button.ok=Ok
|
||||
screen.button.yes=Oui
|
||||
screen.button.no=Non
|
||||
screen.button.back=Retour
|
||||
screen.button.hidden=Masquer
|
||||
screen.button.visible=Afficher
|
||||
screen.button.maintained=Maintenu
|
||||
screen.button.toggled=Switché
|
||||
|
||||
choice.showhidewaila=Afficher/Masquer Waila
|
||||
choice.showhideidmeta=Afficher ID:Metadata
|
||||
choice.toggledmaintained= Switché/Maintenu
|
||||
choice.showliquids=Liquides
|
||||
screen.button.configureaspect=Configurer l'aspect…
|
||||
|
||||
enchant.title.name=Nom
|
||||
enchant.title.minlvl=Min lvl
|
||||
enchant.title.maxlvl=Max lvl
|
||||
enchant.title.weight=Poids
|
||||
enchant.label.enchantability=Enchantabilitée
|
||||
|
||||
waila.keybind.wailaconfig=[Waila] Ecran de config
|
||||
waila.keybind.wailadisplay=[Waila] Afficher/Masquer
|
||||
waila.keybind.liquid=[Waila] Afficher les liquides
|
||||
waila.keybind.recipe=[Waila] Afficher les recettes
|
||||
waila.keybind.usage=[Waila] Afficher l'utilisation
|
||||
waila.keybind.testing=[Waila] Test
|
||||
|
||||
client.msg.norecipe=Pas de recette trouvée.
|
||||
client.msg.nousage=Pas d'utilisation trouvée.
|
||||
|
||||
hud.msg.none=<Aucun>
|
||||
hud.msg.empty=<Vide>
|
||||
hud.msg.output=Sortie
|
||||
hud.msg.input=Entrée
|
||||
hud.msg.out=Sortie
|
||||
hud.msg.in=Entrée
|
||||
hud.msg.power=Energie
|
||||
hud.msg.storage=Stockage
|
||||
hud.msg.any=Tout
|
||||
hud.msg.mode=Mode
|
||||
hud.msg.maxpower=Max Puissance
|
||||
hud.msg.trigger=Déclencheur
|
||||
hud.msg.maxio=Max Entrée/Sortie
|
||||
|
||||
hud.msg.send=Envoyer
|
||||
hud.msg.recv=Recevoir
|
||||
hud.msg.item=Objet
|
||||
hud.msg.fluid=Fluide
|
||||
hud.msg.energ=Energie
|
||||
hud.msg.frequency=Fréquence
|
||||
|
||||
hud.msg.owner=Propriétaire
|
||||
hud.msg.public=Publique
|
||||
hud.msg.restricted=Limité
|
||||
hud.msg.private=Privée
|
||||
|
||||
hud.msg.white=Blanc
|
||||
hud.msg.orange=Orange
|
||||
hud.msg.magenta=Magenta
|
||||
hud.msg.lblue=Bleu clair
|
||||
hud.msg.yellow=Jaune
|
||||
hud.msg.lime=Vert clair
|
||||
hud.msg.pink=Rose
|
||||
hud.msg.gray=Gris
|
||||
hud.msg.lgray=Gris clair
|
||||
hud.msg.cyan=Cyan
|
||||
hud.msg.purple=Violet
|
||||
hud.msg.blue=Bleu
|
||||
hud.msg.brown=Marron
|
||||
hud.msg.green=Vert
|
||||
hud.msg.red=Rouge
|
||||
hud.msg.black=Noir
|
||||
|
||||
hud.msg.growth=Croissance
|
||||
hud.msg.mature=Mature
|
||||
hud.msg.off=Off
|
||||
hud.msg.on=On
|
||||
hud.msg.state=Etat
|
||||
hud.msg.delay=Retard
|
||||
hud.msg.comparator=Comparateur
|
||||
hud.msg.substractor=Soustracteur
|
||||
hud.msg.record=Disque
|
||||
|
||||
option.appeng.monitorcontent=Contenu des écrans
|
||||
option.bb.content=Contenu des barils
|
||||
option.bc.tankamount=Niveau de liquide
|
||||
option.bc.tanktype=Sorte de liquide
|
||||
option.enderstorage.colors=Couleurs
|
||||
option.ic2.inputeumach=Max EU en entrée [Machines]
|
||||
option.ic2.inputeuother=Max EU en entrée [Autres]
|
||||
option.ic2.outputeu=Max EU en sortie
|
||||
option.ic2.storage=Energie stockée
|
||||
option.thaumcraft.storedvis=Condensateur de stockage
|
||||
option.thermalexpansion.energyhandler=Afficher stockage RF
|
||||
option.thermalexpansion.energycell=Afficher ECell Entrée/Sortie
|
||||
option.thermalexpansion.fluidtype=Afficher sorte fluides
|
||||
option.thermalexpansion.fluidamount=Afficher niveau fluides
|
||||
option.thermalexpansion.tankmode=Afficher mode Réservoir
|
||||
option.thermalexpansion.tesssendrecv=Tesseract mode
|
||||
option.thermalexpansion.tessfreq=Tesseract fréquence
|
||||
option.thermalexpansion.owner=Afficher propriétaire
|
||||
option.thermalexpansion.conditemmode=Afficher Itemduct mode
|
||||
option.vanilla.spawntype=Spawner type
|
||||
option.vanilla.growthvalue=Niveau de croissance
|
||||
option.vanilla.leverstate=Etat Levier
|
||||
option.vanilla.repeater=Répeteur retard
|
||||
option.vanilla.comparator=Comparateur mode
|
||||
option.vanilla.redstone=Redstone puissance
|
||||
option.vanilla.jukebox=Jukebox disque
|
||||
option.etb.displaydata=Afficher données socket
|
||||
option.enderio.inout=Afficher Entrée/Sortie
|
||||
option.enderio.storage=Afficher MJ stocké
|
||||
option.enderio.owner=Afficher propriétaire du bloc
|
||||
option.enderio.channel=Afficher hypercube canal
|
||||
option.bcapi.storage=Afficher MJ stocké
|
||||
option.bcapi.consump=Afficher puissance maximale
|
||||
option.bcapi.trigger=Energie déclanchement
|
||||
option.pr.showio=Afficher plaques IO
|
||||
option.pr.showdata=Afficher plaques data
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 82 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 82 KiB |
@@ -0,0 +1,35 @@
|
||||
package mcp.mobius.waila;
|
||||
|
||||
public final class Constants {
|
||||
public static String BIND_SCREEN_WIKI = "showwiki";
|
||||
public static String BIND_SCREEN_TECH = "showtechtree";
|
||||
public static String BIND_SCREEN_ENCH = "showenchant";
|
||||
|
||||
public static String BIND_WAILA_CFG = "waila.keybind.wailaconfig";
|
||||
public static String BIND_WAILA_SHOW = "waila.keybind.wailadisplay";
|
||||
public static String BIND_WAILA_LIQUID = "waila.keybind.liquid";
|
||||
public static String BIND_WAILA_RECIPE = "waila.keybind.recipe";
|
||||
public static String BIND_WAILA_USAGE = "waila.keybind.usage";
|
||||
public static String BIND_WAILA_TESTING= "waila.keybind.testing";
|
||||
|
||||
public static String CFG_NEI_SHOW = "world.highlight_tips";
|
||||
public static String BIND_NEI_SHOW = "keys.world.highlight_tips";
|
||||
|
||||
public static String CFG_WAILA_SHOW = "waila.cfg.show";
|
||||
public static String CFG_WAILA_MODE = "waila.cfg.showmode";
|
||||
public static String CFG_WAILA_LIQUID = "waila.cfg.liquid";
|
||||
public static String CFG_WAILA_METADATA = "waila.cfg.metadata";
|
||||
public static String CFG_WAILA_KEYBIND = "waila.cfg.keybind";
|
||||
public static String CFG_WAILA_POSX = "waila.cfg.posx";
|
||||
public static String CFG_WAILA_POSY = "waila.cfg.posy";
|
||||
public static String CFG_WAILA_SCALE = "waila.cfg.scale";
|
||||
|
||||
|
||||
public static String CFG_WAILA_ALPHA = "waila.cfg.alpha";
|
||||
public static String CFG_WAILA_BGCOLOR = "waila.cfg.bgcolor";
|
||||
public static String CFG_WAILA_GRADIENT1 = "waila.cfg.gradient1";
|
||||
public static String CFG_WAILA_GRADIENT2 = "waila.cfg.gradient2";
|
||||
public static String CFG_WAILA_FONTCOLOR = "waila.cfg.fontcolor";
|
||||
|
||||
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package mcp.mobius.waila;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.ItemInfo;
|
||||
import codechicken.nei.forge.GuiContainerManager;
|
||||
import cpw.mods.fml.client.registry.KeyBindingRegistry;
|
||||
|
||||
import mcp.mobius.waila.addons.ConfigHandler;
|
||||
import mcp.mobius.waila.addons.buildcraft.BCModule;
|
||||
import mcp.mobius.waila.addons.buildcraft.HUDHandlerBCTanks;
|
||||
import mcp.mobius.waila.addons.ic2.HUDHandlerIC2IEnergySource;
|
||||
import mcp.mobius.waila.addons.ic2.HUDHandlerIC2IEnergySink;
|
||||
import mcp.mobius.waila.addons.ic2.HUDHandlerIC2IEnergyStorage;
|
||||
import mcp.mobius.waila.addons.ic2.IC2Module;
|
||||
import mcp.mobius.waila.addons.vanillamc.HUDHandlerVanilla;
|
||||
import mcp.mobius.waila.gui.ConfigKeyHandler;
|
||||
import mcp.mobius.waila.handlers.HUDHandlerExternal;
|
||||
import mcp.mobius.waila.handlers.HUDHandlerWaila;
|
||||
import mcp.mobius.waila.handlers.TooltipHandlerWaila;
|
||||
import mcp.mobius.waila.server.ProxyServer;
|
||||
|
||||
public class ProxyClient extends ProxyServer {
|
||||
|
||||
public ProxyClient() {}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerHandlers(){
|
||||
GuiContainerManager.addTooltipHandler(new TooltipHandlerWaila());
|
||||
//GuiContainerManager.addInputHandler(new EnchantementHandler());
|
||||
API.registerHighlightHandler(new HUDHandlerExternal(), ItemInfo.Layout.HEADER);
|
||||
API.registerHighlightHandler(new HUDHandlerExternal(), ItemInfo.Layout.BODY);
|
||||
API.registerHighlightHandler(new HUDHandlerWaila(), ItemInfo.Layout.FOOTER);
|
||||
API.registerHighlightHandler(new HUDHandlerWaila(), ItemInfo.Layout.HEADER);
|
||||
|
||||
//API.registerHighlightIdentifier(2000, new HUDHandlerExternal());
|
||||
KeyBindingRegistry.registerKeyBinding(new ConfigKeyHandler());
|
||||
//API.addKeyBind("showenchant", "Display enchantements", Keyboard.KEY_RSHIFT);
|
||||
this.registerMods();
|
||||
}
|
||||
|
||||
public void registerMods(){
|
||||
|
||||
HUDHandlerVanilla.register();
|
||||
|
||||
/* BETTER BARRELS */
|
||||
/*
|
||||
try {
|
||||
Class ModBetterBarrels = Class.forName("mcp.mobius.betterbarrels.mod_BetterBarrels");
|
||||
mod_Waila.log.log(Level.INFO, "BetterBarrel mod found.");
|
||||
HUDHandlerBetterBarrels.register();
|
||||
ConfigHandler.instance().addConfig("BetterBarrels", "betterbarrels.content", "Barrel content");
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.INFO, "BetterBarrel mod not found. Skipping.");
|
||||
}
|
||||
*/
|
||||
|
||||
/* BUILDCRAFT */
|
||||
BCModule.register();
|
||||
|
||||
/* INDUSTRIALCRAFT2 */
|
||||
IC2Module.register();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package mcp.mobius.waila;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class WailaExceptionHandler {
|
||||
|
||||
public WailaExceptionHandler() {}
|
||||
|
||||
private static ArrayList<String> errs = new ArrayList<String>();
|
||||
|
||||
public static List<String> handleErr(Throwable e, String className, List<String> currenttip){
|
||||
if (!errs.contains(className)){
|
||||
errs.add(className);
|
||||
|
||||
for (StackTraceElement elem : e.getStackTrace()){
|
||||
mod_Waila.log.log(Level.WARNING, String.format("%s.%s:%s",elem.getClassName(), elem.getMethodName(), elem.getLineNumber()));
|
||||
if (elem.getClassName().contains("waila")) break;
|
||||
}
|
||||
|
||||
mod_Waila.log.log(Level.WARNING, String.format("Catched unhandled exception : [%s] %s",className,e));
|
||||
}
|
||||
if (currenttip != null)
|
||||
currenttip.add("<ERROR>");
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -80,5 +80,24 @@ public class ConfigHandler implements IWailaConfigHandler {
|
||||
@Override
|
||||
public boolean getConfig(String key){
|
||||
return this.getConfig(key, true);
|
||||
}
|
||||
}
|
||||
|
||||
public int getConfigInt(String key){
|
||||
mod_Waila.instance.config.load();
|
||||
Property prop = mod_Waila.instance.config.get(Configuration.CATEGORY_GENERAL, key, 0);
|
||||
return prop.getInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConfig(String key, boolean value){
|
||||
mod_Waila.instance.config.load();
|
||||
mod_Waila.instance.config.get(Configuration.CATEGORY_GENERAL, key, true).set(value);;
|
||||
mod_Waila.instance.config.save();
|
||||
}
|
||||
|
||||
public void setConfigInt(String key, int value){
|
||||
mod_Waila.instance.config.load();
|
||||
mod_Waila.instance.config.get(Configuration.CATEGORY_GENERAL, key, 0).set(value);;
|
||||
mod_Waila.instance.config.save();
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,25 @@
|
||||
package mcp.mobius.waila.addons;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import au.com.bytecode.opencsv.CSVReader;
|
||||
import net.minecraft.block.Block;
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import codechicken.nei.api.API;
|
||||
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.api.IWailaBlockDecorator;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.IWailaRegistrar;
|
||||
import mcp.mobius.waila.handlers.HUDHandlerExternal;
|
||||
import mcp.mobius.waila.api.IWailaSummaryProvider;
|
||||
import mcp.mobius.waila.handlers.hud.HUDHandlerExternal;
|
||||
|
||||
public class ExternalModulesHandler implements IWailaRegistrar {
|
||||
|
||||
@@ -23,6 +34,13 @@ public class ExternalModulesHandler implements IWailaRegistrar {
|
||||
public LinkedHashMap<Class, ArrayList<IWailaDataProvider>> tailBlockProviders = new LinkedHashMap<Class, ArrayList<IWailaDataProvider>>();
|
||||
public LinkedHashMap<Class, ArrayList<IWailaDataProvider>> stackBlockProviders = new LinkedHashMap<Class, ArrayList<IWailaDataProvider>>();
|
||||
|
||||
public LinkedHashMap<Integer, ArrayList<IWailaBlockDecorator>> blockIdDecorators = new LinkedHashMap<Integer, ArrayList<IWailaBlockDecorator>>();
|
||||
public LinkedHashMap<Class, ArrayList<IWailaBlockDecorator>> blockClassDecorators = new LinkedHashMap<Class, ArrayList<IWailaBlockDecorator>>();
|
||||
|
||||
public LinkedHashMap<String, LinkedHashMap <String, LinkedHashMap <String, String>>> wikiDescriptions = new LinkedHashMap<String, LinkedHashMap <String, LinkedHashMap <String, String>>>();
|
||||
|
||||
public LinkedHashMap<Class, ArrayList<IWailaSummaryProvider>> summaryProviders = new LinkedHashMap<Class, ArrayList<IWailaSummaryProvider>>();
|
||||
|
||||
private ExternalModulesHandler() {
|
||||
instance = this;
|
||||
}
|
||||
@@ -35,12 +53,22 @@ public class ExternalModulesHandler implements IWailaRegistrar {
|
||||
|
||||
@Override
|
||||
public void addConfig(String modname, String key, String configname) {
|
||||
ConfigHandler.instance().addConfig(modname, key, configname);
|
||||
ConfigHandler.instance().addConfig(modname, key, LangUtil.translateG(configname));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addConfigRemote(String modname, String key, String configname) {
|
||||
ConfigHandler.instance().addConfigServer(modname, key, configname);
|
||||
ConfigHandler.instance().addConfigServer(modname, key, LangUtil.translateG(configname));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addConfig(String modname, String key) {
|
||||
ConfigHandler.instance().addConfig(modname, key, LangUtil.translateG("option." + key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addConfigRemote(String modname, String key) {
|
||||
ConfigHandler.instance().addConfigServer(modname, key, LangUtil.translateG("option." + key));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -71,12 +99,14 @@ public class ExternalModulesHandler implements IWailaRegistrar {
|
||||
this.bodyBlockProviders.get(block).add(dataProvider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTailProvider(IWailaDataProvider dataProvider, int blockID) {
|
||||
if (!this.tailProviders.containsKey(blockID))
|
||||
this.tailProviders.put(blockID, new ArrayList<IWailaDataProvider>());
|
||||
this.tailProviders.get(blockID).add(dataProvider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTailProvider(IWailaDataProvider dataProvider, Class block) {
|
||||
if (!this.tailBlockProviders.containsKey(block))
|
||||
this.tailBlockProviders.put(block, new ArrayList<IWailaDataProvider>());
|
||||
@@ -91,6 +121,35 @@ public class ExternalModulesHandler implements IWailaRegistrar {
|
||||
API.registerHighlightIdentifier(blockID, new HUDHandlerExternal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerStackProvider(IWailaDataProvider dataProvider, Class block) {
|
||||
for (int i = 0; i < Block.blocksList.length; i++)
|
||||
if (block.isInstance(Block.blocksList[i])){
|
||||
this.registerStackProvider(dataProvider, i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerShortDataProvider(IWailaSummaryProvider dataProvider, Class item) {
|
||||
if (!this.summaryProviders.containsKey(item))
|
||||
this.summaryProviders.put(item, new ArrayList<IWailaSummaryProvider>());
|
||||
this.summaryProviders.get(item).add(dataProvider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockDecorator(IWailaBlockDecorator decorator, int blockID) {
|
||||
if (!this.blockIdDecorators.containsKey(blockID))
|
||||
this.blockIdDecorators.put(blockID, new ArrayList<IWailaBlockDecorator>());
|
||||
this.blockIdDecorators.get(blockID).add(decorator);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockDecorator(IWailaBlockDecorator decorator, Class block) {
|
||||
if (!this.blockClassDecorators.containsKey(block))
|
||||
this.blockClassDecorators.put(block, new ArrayList<IWailaBlockDecorator>());
|
||||
this.blockClassDecorators.get(block).add(decorator);
|
||||
}
|
||||
|
||||
/* Arrays getters */
|
||||
|
||||
public ArrayList<IWailaDataProvider> getHeadProviders(int blockID) {
|
||||
@@ -131,10 +190,32 @@ public class ExternalModulesHandler implements IWailaRegistrar {
|
||||
|
||||
return returnList;
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<IWailaDataProvider> getStackProviders(int blockID) {
|
||||
return this.stackProviders.get(blockID);
|
||||
}
|
||||
|
||||
public ArrayList<IWailaSummaryProvider> getSummaryProvider(Object item){
|
||||
ArrayList<IWailaSummaryProvider> returnList = new ArrayList<IWailaSummaryProvider>();
|
||||
for (Class clazz : this.summaryProviders.keySet())
|
||||
if (clazz.isInstance(item))
|
||||
returnList.addAll(this.summaryProviders.get(clazz));
|
||||
|
||||
return returnList;
|
||||
}
|
||||
|
||||
public ArrayList<IWailaBlockDecorator> getBlockDecorators(int blockID){
|
||||
return this.blockIdDecorators.get(blockID);
|
||||
}
|
||||
|
||||
public ArrayList<IWailaBlockDecorator> getBlockDecorators(Object block){
|
||||
ArrayList<IWailaBlockDecorator> returnList = new ArrayList<IWailaBlockDecorator>();
|
||||
for (Class clazz : this.blockClassDecorators.keySet())
|
||||
if (clazz.isInstance(block))
|
||||
returnList.addAll(this.blockClassDecorators.get(clazz));
|
||||
|
||||
return returnList;
|
||||
}
|
||||
|
||||
/* Providers querry methods */
|
||||
|
||||
@@ -173,5 +254,144 @@ public class ExternalModulesHandler implements IWailaRegistrar {
|
||||
if (clazz.isInstance(block))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasSummaryProvider(Class item){
|
||||
return this.summaryProviders.containsKey(item);
|
||||
}
|
||||
|
||||
public boolean hasBlockDecorator(int blockID){
|
||||
return this.blockIdDecorators.containsKey(blockID);
|
||||
}
|
||||
|
||||
public boolean hasBlockDecorator(Object block){
|
||||
for (Class clazz : this.blockClassDecorators.keySet())
|
||||
if (clazz.isInstance(block))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* ----------------- */
|
||||
@Override
|
||||
public void registerDocTextFile(String filename) {
|
||||
List<String[]> docData = null;
|
||||
int nentries = 0;
|
||||
|
||||
|
||||
try{
|
||||
docData = this.readFileAsString(filename);
|
||||
} catch (IOException e){
|
||||
mod_Waila.log.log(Level.WARNING, String.format("Error while accessing file %s : %s", filename, e));
|
||||
return;
|
||||
}
|
||||
|
||||
for (String[] ss : docData){
|
||||
String modid = ss[0];
|
||||
String name = ss[1];
|
||||
String meta = ss[2];
|
||||
String desc = ss[5].replace('$', '\n');
|
||||
if (!(desc.trim().equals(""))){
|
||||
if (!this.wikiDescriptions.containsKey(modid))
|
||||
this.wikiDescriptions.put(modid, new LinkedHashMap <String, LinkedHashMap <String, String>>());
|
||||
if (!this.wikiDescriptions.get(modid).containsKey(name))
|
||||
this.wikiDescriptions.get(modid).put(name, new LinkedHashMap<String, String>());
|
||||
|
||||
this.wikiDescriptions.get(modid).get(name).put(meta, desc);
|
||||
System.out.printf("Registered %s %s %s\n", modid, name, meta);
|
||||
nentries += 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
String[] sections = docData.split(">>>>");
|
||||
for (String s : sections){
|
||||
s.trim();
|
||||
if (!s.equals("")){
|
||||
try{
|
||||
String name = s.split("\r?\n",2)[0].trim();
|
||||
String desc = s.split("\r?\n",2)[1].trim();
|
||||
if (!this.wikiDescriptions.containsKey(modid))
|
||||
this.wikiDescriptions.put(modid, new LinkedHashMap <String, String>());
|
||||
this.wikiDescriptions.get(modid).put(name, desc);
|
||||
nentries += 1;
|
||||
}catch (Exception e){
|
||||
System.out.printf("%s\n", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
mod_Waila.log.log(Level.INFO, String.format("Registered %s entries from %s", nentries, filename));
|
||||
}
|
||||
|
||||
public boolean hasDocTextModID(String modid){
|
||||
return this.wikiDescriptions.containsKey(modid);
|
||||
}
|
||||
|
||||
public boolean hasDocTextItem(String modid, String item){
|
||||
if (this.hasDocTextModID(modid))
|
||||
return this.wikiDescriptions.get(modid).containsKey(item);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasDocTextMeta(String modid, String item, String meta){
|
||||
if (this.hasDocTextItem(modid, item))
|
||||
return this.wikiDescriptions.get(modid).get(item).containsKey(meta);
|
||||
return false;
|
||||
}
|
||||
|
||||
public LinkedHashMap<String, String> getDocText(String modid, String name){
|
||||
return this.wikiDescriptions.get(modid).get(name);
|
||||
}
|
||||
|
||||
public String getDocText(String modid, String name, String meta){
|
||||
return this.wikiDescriptions.get(modid).get(name).get(meta);
|
||||
}
|
||||
|
||||
public boolean hasDocTextSpecificMeta(String modid, String name, String meta){
|
||||
for (String s : this.getDocText(modid, name).keySet())
|
||||
if (s.equals(meta))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getDoxTextWildcardMatch(String modid, String name){
|
||||
Set<String> keys = this.wikiDescriptions.get(modid).keySet();
|
||||
for (String s : keys){
|
||||
String regexed = s;
|
||||
regexed = regexed.replace(".", "\\.");
|
||||
regexed = regexed.replace("*", ".*");
|
||||
|
||||
if (name.matches(s))
|
||||
return s;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<String[]> readFileAsString(String filePath) throws IOException {
|
||||
// URL fileURL = this.getClass().getResource(filePath);
|
||||
// File filedata = new File(fileURL);
|
||||
// Reader paramReader = new InputStreamReader(this.getClass().getResourceAsStream(filePath));
|
||||
|
||||
InputStream in = getClass().getResourceAsStream(filePath);
|
||||
BufferedReader input = new BufferedReader(new InputStreamReader(in));
|
||||
CSVReader reader = new CSVReader(input);
|
||||
|
||||
List<String[]> myEntries = reader.readAll();
|
||||
reader.close();
|
||||
|
||||
return myEntries;
|
||||
/*
|
||||
StringBuffer fileData = new StringBuffer();
|
||||
//BufferedReader reader = new BufferedReader(paramReader);
|
||||
|
||||
char[] buf = new char[1024];
|
||||
int numRead=0;
|
||||
while((numRead=input.read(buf)) != -1){
|
||||
String readData = String.valueOf(buf, 0, numRead);
|
||||
fileData.append(readData);
|
||||
}
|
||||
input.close();
|
||||
return fileData.toString();
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package mcp.mobius.waila.addons.appeng;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.addons.ExternalModulesHandler;
|
||||
|
||||
public class AppEngModule {
|
||||
|
||||
public static Class TileStorageMonitor = null;
|
||||
public static Class IAEItemStack = null;
|
||||
public static Method TileStorageMonitor_getItem = null;
|
||||
public static Method IAEItemStack_getItemStack = null;
|
||||
|
||||
public static void register(){
|
||||
try{
|
||||
TileStorageMonitor = Class.forName("appeng.me.tile.TileStorageMonitor");
|
||||
IAEItemStack = Class.forName("appeng.api.IAEItemStack");
|
||||
|
||||
|
||||
TileStorageMonitor_getItem = TileStorageMonitor.getMethod("getItem");
|
||||
IAEItemStack_getItemStack = IAEItemStack.getMethod("getItemStack");
|
||||
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[AppEng] Class not found. " + e);
|
||||
return;
|
||||
} catch (SecurityException e) {
|
||||
mod_Waila.log.log(Level.WARNING, "[AppEng] Security Exception. " + e);
|
||||
return;
|
||||
} catch (NoSuchMethodException e) {
|
||||
mod_Waila.log.log(Level.WARNING, "[AppEng] Method not found. " + e);
|
||||
return;
|
||||
}
|
||||
|
||||
mod_Waila.log.log(Level.INFO, "AppEng mod found.");
|
||||
ExternalModulesHandler.instance().addConfig("Applied Energetic", "appeng.monitorcontent");
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDAppEngMonitor(), TileStorageMonitor);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package mcp.mobius.waila.addons.appeng;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.List;
|
||||
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class HUDAppEngMonitor implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
TileEntity entity = accessor.getTileEntity();
|
||||
if (entity != null){
|
||||
if (config.getConfig("appeng.monitorcontent")){
|
||||
try {
|
||||
ItemStack stack = (ItemStack)AppEngModule.IAEItemStack_getItemStack.invoke(AppEngModule.IAEItemStack.cast(AppEngModule.TileStorageMonitor_getItem.invoke(entity)));
|
||||
if (stack != null)
|
||||
currenttip.add(stack.getDisplayName());
|
||||
else
|
||||
currenttip.add(LangUtil.translateG("hud.msg.none"));
|
||||
} catch (Exception e) {
|
||||
System.out.printf("%s\n", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package mcp.mobius.waila.addons.betterbarrels;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.addons.ExternalModulesHandler;
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.ItemInfo;
|
||||
|
||||
public class BetterBarrelsModule {
|
||||
public static Class TileEntityBarrel = null;
|
||||
public static Class IBarrelStorage = null;
|
||||
public static Field TileEntityBarrel_Storage = null;
|
||||
public static Method IBarrelStorage_getItem = null;
|
||||
|
||||
public static void register(){
|
||||
try{
|
||||
TileEntityBarrel = Class.forName("mcp.mobius.betterbarrels.common.TileEntityBarrel");
|
||||
IBarrelStorage = Class.forName("mcp.mobius.betterbarrels.common.IBarrelStorage");
|
||||
TileEntityBarrel_Storage = TileEntityBarrel.getField("storage");
|
||||
IBarrelStorage_getItem = IBarrelStorage.getMethod("getItem");
|
||||
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[BB] BetterBarrel classes not found.");
|
||||
} catch (NoSuchFieldException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[BB] Storage field not found.");
|
||||
} catch (NoSuchMethodException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[BB] getItem() not found.");
|
||||
}
|
||||
|
||||
if (IBarrelStorage_getItem != null){
|
||||
mod_Waila.log.log(Level.INFO, "Waila module BetterBarrel succefully hooked.");
|
||||
ExternalModulesHandler.instance().addConfig("BetterBarrels", "bb.content");
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerBBContent(), TileEntityBarrel);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package mcp.mobius.waila.addons.betterbarrels;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
//import mcp.mobius.betterbarrels.common.TileEntityBarrel;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.ItemInfo;
|
||||
import codechicken.nei.api.ItemInfo.Layout;
|
||||
import codechicken.nei.api.IHighlightHandler;
|
||||
|
||||
public class HUDHandlerBBContent implements IWailaDataProvider {
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
TileEntity entity = accessor.getTileEntity();
|
||||
|
||||
if (!config.getConfig("bb.content")) return currenttip;
|
||||
|
||||
if ((entity != null) && (BetterBarrelsModule.TileEntityBarrel.isInstance(entity))){
|
||||
ItemStack stack = null;
|
||||
try {
|
||||
stack = (ItemStack) BetterBarrelsModule.IBarrelStorage_getItem.invoke(BetterBarrelsModule.TileEntityBarrel_Storage.get(entity));
|
||||
} catch (Exception e){
|
||||
mod_Waila.log.log(Level.SEVERE, "[BB] Unhandled exception trying to access a barrel storage for display !.\n" + String.valueOf(e));
|
||||
currenttip.add("<ERROR!>");
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
if (stack != null){
|
||||
currenttip.add(stack.getDisplayName());
|
||||
} else {
|
||||
currenttip.add(LangUtil.translateG("hud.msg.empty"));
|
||||
}
|
||||
}
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package mcp.mobius.waila.addons.betterbarrels;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
//import mcp.mobius.betterbarrels.common.TileEntityBarrel;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.ItemInfo;
|
||||
import codechicken.nei.api.ItemInfo.Layout;
|
||||
import codechicken.nei.api.IHighlightHandler;
|
||||
|
||||
public class HUDHandlerBetterBarrels implements IHighlightHandler {
|
||||
|
||||
static private Class TileEntityBarrel = null;
|
||||
static private Class IBarrelStorage = null;
|
||||
static private Field TileEntityBarrel_Storage = null;
|
||||
static private Method IBarrelStorage_getItem = null;
|
||||
|
||||
@Override
|
||||
public ItemStack identifyHighlight(World world, EntityPlayer player, MovingObjectPosition mop) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleTextData(ItemStack itemStack, World world, EntityPlayer player, MovingObjectPosition mop, List<String> currenttip, Layout layout) {
|
||||
|
||||
TileEntity entity = world.getBlockTileEntity(mop.blockX, mop.blockY, mop.blockZ);
|
||||
|
||||
if ((entity != null) && (TileEntityBarrel.isInstance(entity))){
|
||||
ItemStack stack = null;
|
||||
try {
|
||||
stack = (ItemStack) IBarrelStorage_getItem.invoke(TileEntityBarrel_Storage.get(entity));
|
||||
} catch (Exception e){
|
||||
mod_Waila.log.log(Level.SEVERE, "[BB] Unhandled exception trying to access a barrel storage for display !.\n" + String.valueOf(e));
|
||||
currenttip.add("<ERROR!>");
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
if (stack != null){
|
||||
currenttip.add(stack.getDisplayName());
|
||||
} else {
|
||||
currenttip.add("<Empty>");
|
||||
}
|
||||
}
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
public static void register(){
|
||||
try{
|
||||
TileEntityBarrel = Class.forName("mcp.mobius.betterbarrels.common.TileEntityBarrel");
|
||||
IBarrelStorage = Class.forName("mcp.mobius.betterbarrels.common.IBarrelStorage");
|
||||
TileEntityBarrel_Storage = TileEntityBarrel.getField("storage");
|
||||
IBarrelStorage_getItem = IBarrelStorage.getMethod("getItem");
|
||||
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[BB] BetterBarrel classes not found.");
|
||||
} catch (NoSuchFieldException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[BB] Storage field not found.");
|
||||
} catch (NoSuchMethodException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[BB] getItem() not found.");
|
||||
}
|
||||
|
||||
if (IBarrelStorage_getItem != null){
|
||||
mod_Waila.log.log(Level.INFO, "Waila module BetterBarrel succefully hooked.");
|
||||
API.registerHighlightHandler(new HUDHandlerBetterBarrels(), ItemInfo.Layout.BODY);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
package mcp.mobius.waila.addons.buildcraft;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.addons.ConfigHandler;
|
||||
import mcp.mobius.waila.addons.ExternalModulesHandler;
|
||||
import mcp.mobius.waila.addons.ic2.HUDHandlerIC2IEnergySink;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
public class BCModule {
|
||||
@@ -16,9 +13,9 @@ public class BCModule {
|
||||
public static Class IPowerReceptor = null;
|
||||
public static Class PipeTransportPower = null;
|
||||
public static Class TileGenericPipe = null;
|
||||
public static Class TileEngine = null;
|
||||
|
||||
public static Method TileTank_GetTanks = null;
|
||||
public static Method IPowerReceptor_PowerRequest = null;
|
||||
public static Method TileTank_getTankInfo = null;
|
||||
|
||||
public static void register(){
|
||||
try {
|
||||
@@ -31,12 +28,7 @@ public class BCModule {
|
||||
|
||||
try{
|
||||
TileTank = Class.forName("buildcraft.factory.TileTank");
|
||||
IPowerReceptor = Class.forName("buildcraft.api.power.IPowerReceptor");
|
||||
PipeTransportPower = Class.forName("buildcraft.transport.PipeTransportPower");
|
||||
TileGenericPipe = Class.forName("buildcraft.transport.TileGenericPipe");
|
||||
|
||||
TileTank_GetTanks = TileTank.getMethod("getTanks", ForgeDirection.class);
|
||||
IPowerReceptor_PowerRequest = IPowerReceptor.getMethod("powerRequest", ForgeDirection.class);
|
||||
TileTank_getTankInfo = TileTank.getMethod("getTankInfo", ForgeDirection.class);
|
||||
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[BC] Class not found. " + e);
|
||||
@@ -46,13 +38,10 @@ public class BCModule {
|
||||
return;
|
||||
}
|
||||
|
||||
ExternalModulesHandler.instance().addConfig("Buildcraft", "bc.tankamount", "Liquid amount");
|
||||
ExternalModulesHandler.instance().addConfig("Buildcraft", "bc.tanktype", "Liquid type");
|
||||
ExternalModulesHandler.instance().addConfigRemote("Buildcraft", "bc.powerpipe", "Power pipes");
|
||||
ExternalModulesHandler.instance().addConfig("Buildcraft", "bc.tankamount");
|
||||
ExternalModulesHandler.instance().addConfig("Buildcraft", "bc.tanktype");
|
||||
ExternalModulesHandler.instance().registerHeadProvider(new HUDHandlerBCTanks(), TileTank);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerBCTanks(), TileTank);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerBCPipes(), TileGenericPipe);
|
||||
//ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerBCIPowerReceptor(), PipeTransportPower);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package mcp.mobius.waila.addons.buildcraft;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.addons.ExternalModulesHandler;
|
||||
|
||||
public class BCPowerAPIModule {
|
||||
|
||||
public static Class PowerHandler = null;
|
||||
public static Method PH_getMinEnergyReceived = null;
|
||||
public static Method PH_getMaxEnergyReceived = null;
|
||||
public static Method PH_getMaxEnergyStored = null;
|
||||
public static Method PH_getEnergyStored = null;
|
||||
public static Method PH_getActivationEnergy = null;
|
||||
|
||||
public static Class IPowerReceptor = null;
|
||||
public static Method IPowerReceptor_getPowerReceiver = null;
|
||||
|
||||
public static Class PowerReceiver = null;
|
||||
public static Method PR_getMinEnergyReceived = null;
|
||||
public static Method PR_getMaxEnergyReceived = null;
|
||||
public static Method PR_getMaxEnergyStored = null;
|
||||
public static Method PR_getEnergyStored = null;
|
||||
public static Method PR_getActivationEnergy = null;
|
||||
|
||||
public static void register(){
|
||||
try{
|
||||
Class ModClass = Class.forName("buildcraft.api.power.IPowerReceptor");
|
||||
mod_Waila.log.log(Level.INFO, "Buildcraft Power API found.");
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.INFO, "[Buildcraft Power API] Buildcraft Power API mod not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
try{
|
||||
PowerHandler = Class.forName("buildcraft.api.power.PowerHandler");
|
||||
PH_getMinEnergyReceived = PowerHandler.getMethod("getMinEnergyReceived");
|
||||
PH_getMaxEnergyReceived = PowerHandler.getMethod("getMaxEnergyReceived");
|
||||
PH_getMaxEnergyStored = PowerHandler.getMethod("getMaxEnergyStored");
|
||||
PH_getEnergyStored = PowerHandler.getMethod("getEnergyStored");
|
||||
PH_getActivationEnergy = PowerHandler.getMethod("getActivationEnergy");
|
||||
|
||||
IPowerReceptor = Class.forName("buildcraft.api.power.IPowerReceptor");
|
||||
IPowerReceptor_getPowerReceiver = IPowerReceptor.getMethod("getPowerReceiver", ForgeDirection.class);
|
||||
|
||||
PowerReceiver = Class.forName("buildcraft.api.power.PowerHandler$PowerReceiver");
|
||||
PR_getMinEnergyReceived = PowerReceiver.getMethod("getMinEnergyReceived");
|
||||
PR_getMaxEnergyReceived = PowerReceiver.getMethod("getMaxEnergyReceived");
|
||||
PR_getMaxEnergyStored = PowerReceiver.getMethod("getMaxEnergyStored");
|
||||
PR_getEnergyStored = PowerReceiver.getMethod("getEnergyStored");
|
||||
PR_getActivationEnergy = PowerReceiver.getMethod("getActivationEnergy");
|
||||
|
||||
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Class not found. " + e);
|
||||
return;
|
||||
} catch (NoSuchMethodException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Method not found." + e);
|
||||
return;
|
||||
// } catch (NoSuchFieldException e){
|
||||
// mod_Waila.log.log(Level.WARNING, "[EnderStorage] Field not found." + e);
|
||||
// return;
|
||||
} catch (Exception e){
|
||||
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Unhandled exception." + e);
|
||||
return;
|
||||
}
|
||||
|
||||
ExternalModulesHandler.instance().addConfigRemote("BuildcraftAPI", "bcapi.storage");
|
||||
ExternalModulesHandler.instance().addConfig("BuildcraftAPI", "bcapi.consump");
|
||||
ExternalModulesHandler.instance().addConfig("BuildcraftAPI", "bcapi.trigger");
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerIPowerReceptor(), IPowerReceptor);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package mcp.mobius.waila.addons.buildcraft;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.liquids.ILiquidTank;
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class HUDHandlerBCIPowerReceptor implements IWailaDataProvider {
|
||||
|
||||
public HUDHandlerBCIPowerReceptor() {
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
// int powerRequest = 0;
|
||||
// try{
|
||||
// powerRequest = (Integer)BCModule.IPowerReceptor_PowerRequest.invoke(BCModule.IPowerReceptor.cast(accessor.getTileEntity()), ForgeDirection.UNKNOWN);
|
||||
// }
|
||||
// catch (Exception e){
|
||||
// mod_Waila.log.log(Level.SEVERE, "[BC] Unhandled exception trying to access a tank for display !.\n" + String.valueOf(e));
|
||||
// return currenttip;
|
||||
// }
|
||||
// currenttip.add(String.valueOf(powerRequest));
|
||||
|
||||
NBTTagCompound tag = accessor.getNBTData();
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package mcp.mobius.waila.addons.buildcraft;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class HUDHandlerBCPipes implements IWailaDataProvider {
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
NBTTagCompound tag = accessor.getNBTData();
|
||||
if (this.hasPartialKey(tag, "internalNextPower") && config.getConfig("bc.powerpipe")){
|
||||
double power = Math.max(0, this.getPartialKeySum(tag, "internalNextPower"));
|
||||
currenttip.add(String.format("Power : %.1f MJ", power));
|
||||
}
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
public boolean hasPartialKey(NBTTagCompound tag, String key){
|
||||
for (Object k : tag.tagMap.keySet())
|
||||
if (((String)k).contains(key))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public double getPartialKeySum(NBTTagCompound tag, String key){
|
||||
double retVal = 0;
|
||||
for (Object k : tag.tagMap.keySet())
|
||||
if (((String)k).contains(key))
|
||||
retVal += tag.getDouble((String)k);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,27 +1,28 @@
|
||||
package mcp.mobius.waila.addons.buildcraft;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
//import buildcraft.factory.TileTank;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.addons.ConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.liquids.ILiquidTank;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import codechicken.nei.api.ItemInfo.Layout;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IHighlightHandler;
|
||||
|
||||
public class HUDHandlerBCTanks implements IWailaDataProvider {
|
||||
|
||||
@@ -32,35 +33,41 @@ public class HUDHandlerBCTanks implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
ILiquidTank tank = this.getTank(accessor);
|
||||
LiquidStack stack = tank != null ? tank.getLiquid() : null;
|
||||
FluidTankInfo tank = this.getTank(accessor);
|
||||
FluidStack stack = tank != null ? tank.fluid : null;
|
||||
|
||||
|
||||
String name = currenttip.get(0);
|
||||
if (stack != null && ConfigHandler.instance().getConfig("bc.tanktype"))
|
||||
name = name + " (" + stack.asItemStack().getDisplayName() + ")";
|
||||
name = name + " (" + stack.getFluid().getName() + ")";
|
||||
else if (stack == null && ConfigHandler.instance().getConfig("bc.tanktype"))
|
||||
name = name + " <Empty>";
|
||||
name = name + " " + LangUtil.translateG("hud.msg.empty");
|
||||
currenttip.set(0, name);
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
ILiquidTank tank = this.getTank(accessor);
|
||||
LiquidStack stack = tank != null ? tank.getLiquid() : null;
|
||||
int liquidAmount = stack != null ? stack.amount:0;
|
||||
int capacity = tank != null ? tank.getCapacity() : 0;
|
||||
FluidTankInfo tank = this.getTank(accessor);
|
||||
FluidStack stack = tank != null ? tank.fluid : null;
|
||||
int liquidAmount = stack != null ? stack.amount:0;
|
||||
int capacity = tank != null ? tank.capacity : 0;
|
||||
|
||||
if (ConfigHandler.instance().getConfig("bc.tankamount"))
|
||||
currenttip.add(String.valueOf(liquidAmount) + "/" + String.valueOf(capacity) + " mB");
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
public ILiquidTank getTank(IWailaDataAccessor accessor){
|
||||
ILiquidTank tank = null;
|
||||
public FluidTankInfo getTank(IWailaDataAccessor accessor){
|
||||
FluidTankInfo tank = null;
|
||||
try{
|
||||
tank = ((ILiquidTank[])BCModule.TileTank_GetTanks.invoke(BCModule.TileTank.cast(accessor.getTileEntity()), ForgeDirection.UNKNOWN))[0];
|
||||
tank = ((FluidTankInfo[])BCModule.TileTank_getTankInfo.invoke(BCModule.TileTank.cast(accessor.getTileEntity()), ForgeDirection.UNKNOWN))[0];
|
||||
} catch (Exception e){
|
||||
mod_Waila.log.log(Level.SEVERE, "[BC] Unhandled exception trying to access a tank for display !.\n" + String.valueOf(e));
|
||||
return null;
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package mcp.mobius.waila.addons.buildcraft;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import mcp.mobius.waila.WailaExceptionHandler;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class HUDHandlerIPowerReceptor implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
|
||||
try{
|
||||
|
||||
String maxPowerStr = LangUtil.translateG("hud.msg.maxpower");
|
||||
String triggerStr = LangUtil.translateG("hud.msg.trigger");
|
||||
|
||||
Object powerReceiver = BCPowerAPIModule.IPowerReceptor_getPowerReceiver.invoke(accessor.getTileEntity(), ForgeDirection.UNKNOWN);
|
||||
if (powerReceiver != null){
|
||||
|
||||
Float minEnergyRecv = (Float)BCPowerAPIModule.PR_getMinEnergyReceived.invoke(powerReceiver);
|
||||
Float maxEnergyRecv = (Float)BCPowerAPIModule.PR_getMaxEnergyReceived.invoke(powerReceiver);
|
||||
Float activation = (Float)BCPowerAPIModule.PR_getActivationEnergy.invoke(powerReceiver);
|
||||
|
||||
|
||||
if(accessor.getNBTData().hasKey("powerProvider") && accessor.getNBTData().getCompoundTag("powerProvider").hasKey("storedEnergy") && config.getConfig("bcapi.storage")){
|
||||
Float energyStored = (Float)accessor.getNBTData().getCompoundTag("powerProvider").getFloat("storedEnergy");
|
||||
Float maxEnergyStor = (Float)BCPowerAPIModule.PR_getMaxEnergyStored.invoke(powerReceiver);
|
||||
if (maxEnergyStor != 0.0f)
|
||||
currenttip.add(String.format("%.1f / %.1f MJ", energyStored, maxEnergyStor));
|
||||
}
|
||||
|
||||
if(accessor.getNBTData().hasKey("storedEnergy") && config.getConfig("bcapi.storage")){
|
||||
Float energyStored = (Float)accessor.getNBTData().getFloat("storedEnergy");
|
||||
Float maxEnergyStor = (Float)BCPowerAPIModule.PR_getMaxEnergyStored.invoke(powerReceiver);
|
||||
if (maxEnergyStor != 0.0f)
|
||||
currenttip.add(String.format("%.1f / %.1f MJ", energyStored, maxEnergyStor));
|
||||
}
|
||||
|
||||
if (maxEnergyRecv != 0.0f && config.getConfig("bcapi.consump"))
|
||||
//currenttip.add(String.format("Min/Max Input : %.1f / %.1f MJ/t", minEnergyRecv, maxEnergyRecv));
|
||||
currenttip.add(String.format("%s : %.1f MJ/t", maxPowerStr, maxEnergyRecv));
|
||||
|
||||
if (activation != 0.0f && config.getConfig("bcapi.trigger"))
|
||||
currenttip.add(String.format("%s : %.1f MJ", triggerStr, activation));
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
>>>>buildcraft.transport.ItemPlug:*
|
||||
This is a plug for pipes.
|
||||
@@ -0,0 +1,64 @@
|
||||
package mcp.mobius.waila.addons.enderio;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.addons.ExternalModulesHandler;
|
||||
|
||||
public class EnderIOModule {
|
||||
|
||||
public static Class TileCapacitorBank = null;
|
||||
public static Method TCB_getMaxInput = null;
|
||||
public static Method TCB_getMaxOutput = null;
|
||||
public static Method TCB_getEnergyStored = null;
|
||||
public static Method TCB_getMaxEnergyStored = null;
|
||||
public static Method TCB_getMaxIO = null;
|
||||
|
||||
public static Class TileTesseract = null;
|
||||
|
||||
public static void register(){
|
||||
try{
|
||||
Class ModClass = Class.forName("crazypants.enderio.EnderIO");
|
||||
mod_Waila.log.log(Level.INFO, "EnderIO mod found.");
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.INFO, "[EnderIO] EnderIO mod not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
try{
|
||||
|
||||
TileCapacitorBank = Class.forName("crazypants.enderio.machine.power.TileCapacitorBank");
|
||||
TCB_getEnergyStored = TileCapacitorBank.getMethod("getEnergyStored");
|
||||
TCB_getMaxInput = TileCapacitorBank.getMethod("getMaxInput");
|
||||
TCB_getMaxOutput = TileCapacitorBank.getMethod("getMaxOutput");
|
||||
TCB_getMaxEnergyStored = TileCapacitorBank.getMethod("getMaxEnergyStored");
|
||||
TCB_getMaxIO = TileCapacitorBank.getMethod("getMaxIO");
|
||||
|
||||
TileTesseract = Class.forName("crazypants.enderio.machine.hypercube.TileHyperCube");
|
||||
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Class not found. " + e);
|
||||
return;
|
||||
} catch (NoSuchMethodException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Method not found." + e);
|
||||
return;
|
||||
// } catch (NoSuchFieldException e){
|
||||
// mod_Waila.log.log(Level.WARNING, "[EnderStorage] Field not found." + e);
|
||||
// return;
|
||||
} catch (Exception e){
|
||||
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Unhandled exception." + e);
|
||||
return;
|
||||
}
|
||||
|
||||
ExternalModulesHandler.instance().addConfig("EnderIO", "enderio.inout");
|
||||
ExternalModulesHandler.instance().addConfig("EnderIO", "enderio.storage");
|
||||
ExternalModulesHandler.instance().addConfig("EnderIO", "enderio.owner");
|
||||
ExternalModulesHandler.instance().addConfig("EnderIO", "enderio.channel");
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerCapacitor(), TileCapacitorBank);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerTesseract(), TileTesseract);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package mcp.mobius.waila.addons.enderio;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import mcp.mobius.waila.WailaExceptionHandler;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class HUDHandlerCapacitor implements IWailaDataProvider{
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
|
||||
try{
|
||||
|
||||
String maxIOStr = LangUtil.translateG("hud.msg.maxio");
|
||||
String inputStr = LangUtil.translateG("hud.msg.input");
|
||||
String outputStr = LangUtil.translateG("hud.msg.output");
|
||||
|
||||
Integer maxEnergyStored = (Integer)EnderIOModule.TCB_getMaxEnergyStored.invoke(accessor.getTileEntity());
|
||||
Float energyStored = (Float)EnderIOModule.TCB_getEnergyStored.invoke(accessor.getTileEntity());
|
||||
Integer maxIO = (Integer)EnderIOModule.TCB_getMaxIO.invoke(accessor.getTileEntity());
|
||||
Integer maxInput = (Integer)EnderIOModule.TCB_getMaxInput.invoke(accessor.getTileEntity());
|
||||
Integer maxOutput = (Integer)EnderIOModule.TCB_getMaxOutput.invoke(accessor.getTileEntity());
|
||||
|
||||
if (config.getConfig("enderio.storage"))
|
||||
currenttip.add(String.format("%.1f / %d MJ", energyStored, maxEnergyStored));
|
||||
|
||||
if (config.getConfig("enderio.inout")){
|
||||
currenttip.add(String.format("%s : %d MJ/t ", maxIOStr, maxIO));
|
||||
currenttip.add(String.format("%s : %d MJ/t ", inputStr, maxInput));
|
||||
currenttip.add(String.format("%s : %d MJ/t ", outputStr, maxOutput));
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package mcp.mobius.waila.addons.enderio;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class HUDHandlerTesseract implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
|
||||
String channel = "%s : \u00a7f%s\u00a7r %s";
|
||||
String freq;
|
||||
String frequser;
|
||||
String owner;
|
||||
|
||||
if (config.getConfig("enderio.channel")){
|
||||
|
||||
if (accessor.getNBTData().hasKey("channelName")){
|
||||
freq = accessor.getNBTData().getString("channelName");
|
||||
|
||||
if (accessor.getNBTData().hasKey("channelUser"))
|
||||
frequser = "[ \u00a7f" + accessor.getNBTData().getString("channelUser") + " \u00a7r]";
|
||||
else
|
||||
frequser = "[ \u00a7f" + LangUtil.translateG("hud.msg.public") + " \u00a7r]";
|
||||
|
||||
}
|
||||
else{
|
||||
freq = LangUtil.translateG("hud.msg.none");
|
||||
frequser = "";
|
||||
}
|
||||
|
||||
currenttip.add(String.format(channel, LangUtil.translateG("hud.msg.frequency"), freq, frequser));
|
||||
}
|
||||
|
||||
if (config.getConfig("enderio.owner")){
|
||||
if (accessor.getNBTData().hasKey("owner"))
|
||||
currenttip.add(String.format("%s : \u00a7f%s", LangUtil.translateG("hud.msg.owner"), accessor.getNBTData().getString("owner")));
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package mcp.mobius.waila.addons.enderstorage;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.addons.ExternalModulesHandler;
|
||||
|
||||
public class EnderStorageModule {
|
||||
|
||||
public static Class TileFrequencyOwner = null;
|
||||
public static Field TileFrequencyOwner_Freq = null;
|
||||
|
||||
public static Class EnderStorageManager = null;
|
||||
public static Method GetColourFromFreq = null;
|
||||
|
||||
public static Class TileEnderTank = null;
|
||||
|
||||
public static void register(){
|
||||
try{
|
||||
Class EnderStorage = Class.forName("codechicken.enderstorage.EnderStorage");
|
||||
mod_Waila.log.log(Level.INFO, "EnderStorage mod found.");
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.INFO, "[EnderStorage] EnderStorage mod not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
try{
|
||||
|
||||
TileFrequencyOwner = Class.forName("codechicken.enderstorage.common.TileFrequencyOwner");
|
||||
TileFrequencyOwner_Freq = TileFrequencyOwner.getField("freq");
|
||||
|
||||
EnderStorageManager = Class.forName("codechicken.enderstorage.api.EnderStorageManager");
|
||||
GetColourFromFreq = EnderStorageManager.getDeclaredMethod("getColourFromFreq", Integer.TYPE, Integer.TYPE);
|
||||
|
||||
TileEnderTank = Class.forName("codechicken.enderstorage.storage.liquid.TileEnderTank");
|
||||
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Class not found. " + e);
|
||||
return;
|
||||
} catch (NoSuchMethodException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Method not found." + e);
|
||||
return;
|
||||
} catch (NoSuchFieldException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Field not found." + e);
|
||||
return;
|
||||
} catch (Exception e){
|
||||
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Unhandled exception." + e);
|
||||
return;
|
||||
}
|
||||
|
||||
ExternalModulesHandler.instance().addConfig("EnderStorage", "enderstorage.colors");
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerStorage(), TileFrequencyOwner);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package mcp.mobius.waila.addons.enderstorage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import mcp.mobius.waila.WailaExceptionHandler;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class HUDHandlerStorage implements IWailaDataProvider {
|
||||
|
||||
private static String[] colors = {
|
||||
LangUtil.translateG("hud.msg.white"),
|
||||
LangUtil.translateG("hud.msg.orange"),
|
||||
LangUtil.translateG("hud.msg.magenta"),
|
||||
LangUtil.translateG("hud.msg.lblue"),
|
||||
LangUtil.translateG("hud.msg.yellow"),
|
||||
LangUtil.translateG("hud.msg.lime"),
|
||||
LangUtil.translateG("hud.msg.pink"),
|
||||
LangUtil.translateG("hud.msg.gray"),
|
||||
LangUtil.translateG("hud.msg.lgray"),
|
||||
LangUtil.translateG("hud.msg.cyan"),
|
||||
LangUtil.translateG("hud.msg.purple"),
|
||||
LangUtil.translateG("hud.msg.blue"),
|
||||
LangUtil.translateG("hud.msg.brown"),
|
||||
LangUtil.translateG("hud.msg.green"),
|
||||
LangUtil.translateG("hud.msg.red"),
|
||||
LangUtil.translateG("hud.msg.black")
|
||||
};
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
if(config.getConfig("enderstorage.colors")){
|
||||
try{
|
||||
|
||||
int freq = EnderStorageModule.TileFrequencyOwner_Freq.getInt(accessor.getTileEntity());
|
||||
int freqLeft = (Integer)EnderStorageModule.GetColourFromFreq.invoke(null, freq, 0);
|
||||
int freqCenter = (Integer)EnderStorageModule.GetColourFromFreq.invoke(null, freq, 1);
|
||||
int freqRight = (Integer)EnderStorageModule.GetColourFromFreq.invoke(null, freq, 2);
|
||||
|
||||
if (!EnderStorageModule.TileEnderTank.isInstance(accessor.getTileEntity()))
|
||||
currenttip.add(String.format("%s/%s/%s", colors[freqLeft], colors[freqCenter], colors[freqRight]));
|
||||
else
|
||||
currenttip.add(String.format("%s/%s/%s", colors[freqRight], colors[freqCenter], colors[freqLeft]));
|
||||
|
||||
|
||||
} catch (Exception e){
|
||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package mcp.mobius.waila.addons.etb;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.addons.ExternalModulesHandler;
|
||||
|
||||
public class ETBModule {
|
||||
|
||||
public static Class TileSocket = null;
|
||||
public static Field Socket_sides = null;
|
||||
public static Field Socket_configs = null;
|
||||
//public static Field Socket_sideID = null;
|
||||
//public static Field Socket_sideMeta = null;
|
||||
//public static Field Socket_facID = null;
|
||||
//public static Field Socket_facMeta = null;
|
||||
|
||||
public static Class SocketsMod = null;
|
||||
public static Item module = null;
|
||||
|
||||
public static Class SideConfig = null;
|
||||
public static Field SC_tank = null;
|
||||
public static Field SC_inventory = null;
|
||||
public static Field SC_rsControl = null;
|
||||
public static Field SC_rsLatch = null;
|
||||
|
||||
public static void register(){
|
||||
try{
|
||||
Class ModClass = Class.forName("emasher.sockets.TileSocket");
|
||||
mod_Waila.log.log(Level.INFO, "Engineer Toolbox mod found.");
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.INFO, "[Engineer Toolbox] Engineer Toolbox mod not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
try{
|
||||
|
||||
TileSocket = Class.forName("emasher.sockets.TileSocket");
|
||||
Socket_sides = TileSocket.getField("sides");
|
||||
Socket_configs = TileSocket.getField("configs");
|
||||
//Socket_sideID = TileSocket.getField("sideID");
|
||||
//Socket_sideMeta = TileSocket.getField("sideMeta");
|
||||
//Socket_facID = TileSocket.getField("facID");
|
||||
//Socket_facMeta = TileSocket.getField("facMeta");
|
||||
|
||||
SocketsMod = Class.forName("emasher.sockets.SocketsMod");
|
||||
module = (Item)SocketsMod.getField("module").get(null);
|
||||
|
||||
SideConfig = Class.forName("emasher.api.SideConfig");
|
||||
SC_tank = SideConfig.getField("tank");
|
||||
SC_inventory = SideConfig.getField("inventory");
|
||||
SC_rsControl = SideConfig.getField("rsControl");
|
||||
SC_rsLatch = SideConfig.getField("rsLatch");
|
||||
|
||||
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Class not found. " + e);
|
||||
return;
|
||||
// } catch (NoSuchMethodException e){
|
||||
// mod_Waila.log.log(Level.WARNING, "[EnderStorage] Method not found." + e);
|
||||
// return;
|
||||
} catch (NoSuchFieldException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Field not found." + e);
|
||||
return;
|
||||
} catch (Exception e){
|
||||
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Unhandled exception." + e);
|
||||
return;
|
||||
}
|
||||
|
||||
ExternalModulesHandler.instance().addConfig("Engineer Toolbox", "etb.displaydata");
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerSocket(), TileSocket);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package mcp.mobius.waila.addons.etb;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import mcp.mobius.waila.WailaExceptionHandler;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class HUDHandlerSocket implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
if (!config.getConfig("etb.displaydata")) return currenttip;
|
||||
|
||||
try {
|
||||
int[] sides = (int[])ETBModule.Socket_sides.get(accessor.getTileEntity());
|
||||
Object[] configs = (Object[])ETBModule.Socket_configs.get(accessor.getTileEntity());
|
||||
|
||||
for( int s = 0; s < 6; s++){
|
||||
if (sides[s]!=0){
|
||||
|
||||
int tank = (Integer)ETBModule.SC_tank.get(configs[s]);
|
||||
int inventory = (Integer)ETBModule.SC_inventory.get(configs[s]);
|
||||
boolean[] rsControl = (boolean[])ETBModule.SC_rsControl.get(configs[s]);
|
||||
boolean[] rsLatch = (boolean[])ETBModule.SC_rsLatch.get(configs[s]);
|
||||
|
||||
|
||||
ItemStack stack = new ItemStack(ETBModule.module, 1, sides[s]);
|
||||
String tipstr = String.format("%-5s : %s ", ForgeDirection.getOrientation(s), stack.getDisplayName());
|
||||
|
||||
String configstr = "[ ";
|
||||
|
||||
if (tank != -1)
|
||||
configstr += "\u00a79" + String.valueOf(tank) + " ";
|
||||
|
||||
if (inventory != -1)
|
||||
configstr += "\u00a7a" + String.valueOf(inventory) + " ";
|
||||
|
||||
if (rsControl[0] || rsControl[1] || rsControl[2]){
|
||||
configstr += "\u00a7c";
|
||||
configstr += rsControl[0] ? "1" : "0";
|
||||
configstr += rsControl[1] ? "1" : "0";
|
||||
configstr += rsControl[2] ? "1" : "0";
|
||||
configstr += " ";
|
||||
}
|
||||
|
||||
if (rsLatch[0] || rsLatch[1] || rsLatch[2]){
|
||||
configstr += "\u00a75";
|
||||
configstr += rsLatch[0] ? "1" : "0";
|
||||
configstr += rsLatch[1] ? "1" : "0";
|
||||
configstr += rsLatch[2] ? "1" : "0";
|
||||
configstr += " ";
|
||||
}
|
||||
|
||||
configstr += "\u00a7r]";
|
||||
|
||||
if (!configstr.equals("[ \u00a7r]"))
|
||||
tipstr += " " + configstr;
|
||||
|
||||
/*
|
||||
if ((tank != -1) && (inventory != -1))
|
||||
tipstr += String.format("[ \u00a79%d \u00a7a%d \u00a7r]", tank, inventory);
|
||||
else if (tank != -1)
|
||||
tipstr += String.format("[ \u00a79%d \u00a7r]", tank);
|
||||
else if (inventory != -1)
|
||||
tipstr += String.format("[ \u00a7a%d \u00a7r]", inventory);
|
||||
*/
|
||||
|
||||
currenttip.add(tipstr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package mcp.mobius.waila.addons.gravestone;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.addons.ExternalModulesHandler;
|
||||
|
||||
public class GravestoneModule {
|
||||
|
||||
public static Class BlockGraveStone = null;
|
||||
|
||||
public static void register(){
|
||||
|
||||
try{
|
||||
Class ModGravestone = Class.forName("GraveStone.ModGraveStone");
|
||||
mod_Waila.log.log(Level.INFO, "GraveStone mod found.");
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.INFO, "[GraveStone] GraveStone mod not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
BlockGraveStone = Class.forName("GraveStone.block.BlockGSGraveStone");
|
||||
} catch (ClassNotFoundException e) {
|
||||
mod_Waila.log.log(Level.WARNING, "[GraveStone] Class not found. " + e);
|
||||
}
|
||||
|
||||
|
||||
ExternalModulesHandler.instance().registerStackProvider(new HUDHandlerGravestone(), BlockGraveStone);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package mcp.mobius.waila.addons.gravestone;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class HUDHandlerGravestone implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return new ItemStack(accessor.getBlock(), 0, accessor.getMetadata());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package mcp.mobius.waila.addons.ic2;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class HUDHandlerDoor implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return IC2Module.ReinforcedDoorStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,26 +1,17 @@
|
||||
package mcp.mobius.waila.addons.ic2;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.addons.ConfigHandler;
|
||||
import mcp.mobius.waila.addons.ExternalModulesHandler;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IHighlightHandler;
|
||||
import codechicken.nei.api.ItemInfo.Layout;
|
||||
|
||||
public class HUDHandlerIC2IEnergySink implements IWailaDataProvider {
|
||||
|
||||
@@ -48,22 +39,30 @@ public class HUDHandlerIC2IEnergySink implements IWailaDataProvider {
|
||||
|
||||
int ntransformers = this.getTransformerUpgrades(accessor);
|
||||
if (ntransformers > 0){
|
||||
maxinput = maxinput * (int)Math.pow(4.0D, (double)Math.min(3, ntransformers));
|
||||
maxinput = maxinput * (int)Math.pow(4.0D, Math.min(3, ntransformers));
|
||||
}
|
||||
|
||||
|
||||
if (ConfigHandler.instance().getConfig("ic2.inputeuother") && (maxinput != -1) && !this.canUpgrade(accessor.getNBTData()))
|
||||
currenttip.add(String.format("IN : %s EU/t", maxinput));
|
||||
|
||||
if (ConfigHandler.instance().getConfig("ic2.inputeumach") && (maxinput != -1) && this.canUpgrade(accessor.getNBTData()))
|
||||
currenttip.add(String.format("IN : %s EU/t", maxinput));
|
||||
if (ConfigHandler.instance().getConfig("ic2.inputeuother") && (maxinput > 4096))
|
||||
currenttip.add(String.format("%s : %s", LangUtil.translateG("hud.msg.input"), LangUtil.translateG("hud.msg.any")));
|
||||
|
||||
else if (ConfigHandler.instance().getConfig("ic2.inputeuother") && (maxinput != -1) && !this.canUpgrade(accessor.getNBTData()))
|
||||
currenttip.add(String.format("%s : %s EU/t", LangUtil.translateG("hud.msg.input"), maxinput));
|
||||
|
||||
else if (ConfigHandler.instance().getConfig("ic2.inputeumach") && (maxinput != -1) && this.canUpgrade(accessor.getNBTData()))
|
||||
currenttip.add(String.format("%s : %s EU/t", LangUtil.translateG("hud.msg.input"), maxinput));
|
||||
|
||||
if (config.getConfig("ic2.storage"))
|
||||
if (accessor.getNBTData().hasKey("energy") && !IC2Module.IEnergyStorage.isInstance(accessor.getTileEntity()))
|
||||
currenttip.add(String.format("Storage : %s EU", accessor.getNBTInteger(accessor.getNBTData(), "energy")));
|
||||
currenttip.add(String.format("%s : %s EU", LangUtil.translateG("hud.msg.storage"), accessor.getNBTInteger(accessor.getNBTData(), "energy")));
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
public boolean canUpgrade(NBTTagCompound tag){
|
||||
if (tag.hasKey("InvSlots"))
|
||||
|
||||
@@ -1,26 +1,15 @@
|
||||
package mcp.mobius.waila.addons.ic2;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.addons.ConfigHandler;
|
||||
import mcp.mobius.waila.addons.ExternalModulesHandler;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagInt;
|
||||
import net.minecraft.nbt.NBTTagShort;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IHighlightHandler;
|
||||
import codechicken.nei.api.ItemInfo.Layout;
|
||||
|
||||
public class HUDHandlerIC2IEnergySource implements IWailaDataProvider {
|
||||
|
||||
@@ -39,6 +28,7 @@ public class HUDHandlerIC2IEnergySource implements IWailaDataProvider {
|
||||
//if (accessor.getTileEntity() != null && TEElectricBlock.isInstance(accessor.getTileEntity())){
|
||||
int output = -1;
|
||||
|
||||
/*
|
||||
try{
|
||||
if (IC2Module.IEnergySource.isInstance(accessor.getTileEntity()))
|
||||
output = (Integer)(IC2Module.IEnergySource_GetOutput.invoke(IC2Module.IEnergySource.cast(accessor.getTileEntity())));
|
||||
@@ -46,14 +36,20 @@ public class HUDHandlerIC2IEnergySource implements IWailaDataProvider {
|
||||
mod_Waila.log.log(Level.SEVERE, "[IC2] Unhandled exception trying to access an IEnergySource for display !.\n" + String.valueOf(e));
|
||||
return currenttip;
|
||||
}
|
||||
*/
|
||||
|
||||
if (ConfigHandler.instance().getConfig("ic2.outputeu") && (output != -1))
|
||||
currenttip.add(String.format("OUT : %s EU/t", output));
|
||||
currenttip.add(String.format("%s : %s EU/t", LangUtil.translateG("hud.msg.output"), output));
|
||||
|
||||
if (config.getConfig("ic2.storage"))
|
||||
if (accessor.getNBTData().hasKey("storage") && !IC2Module.IEnergyStorage.isInstance(accessor.getTileEntity()))
|
||||
currenttip.add(String.format("Storage : %s EU", accessor.getNBTInteger(accessor.getNBTData(), "storage")));
|
||||
currenttip.add(String.format("%s : %s EU", LangUtil.translateG("hud.msg.storage"), accessor.getNBTInteger(accessor.getNBTData(), "storage")));
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,13 @@
|
||||
package mcp.mobius.waila.addons.ic2;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.addons.ConfigHandler;
|
||||
import mcp.mobius.waila.addons.ExternalModulesHandler;
|
||||
import mcp.mobius.waila.addons.vanillamc.HUDHandlerVanilla;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IHighlightHandler;
|
||||
import codechicken.nei.api.ItemInfo.Layout;
|
||||
|
||||
public class HUDHandlerIC2IEnergyStorage implements IWailaDataProvider {
|
||||
|
||||
@@ -56,6 +42,11 @@ public class HUDHandlerIC2IEnergyStorage implements IWailaDataProvider {
|
||||
if ((capacity != -1) && (stored != -1))
|
||||
currenttip.add(String.format("%s/%s EU", stored, capacity));
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ public class IC2Module {
|
||||
/* Methods interfaces */
|
||||
public static Method IEnergyStorage_GetCapacity = null;
|
||||
public static Method IEnergySink_GetInput = null;
|
||||
public static Method IEnergySource_GetOutput = null;
|
||||
//public static Method IEnergySource_GetOutput = null;
|
||||
|
||||
/* Some required items */
|
||||
public static Class IC2Items = null;
|
||||
@@ -27,6 +27,11 @@ public class IC2Module {
|
||||
public static Field EnergyStorageUpgrade = null;
|
||||
public static ItemStack EnergyStorageUpgradeStack = null;
|
||||
|
||||
/* Fix for doors */
|
||||
public static Class BlockIC2Door = null;
|
||||
public static Field ReinforcedDoor = null;
|
||||
public static ItemStack ReinforcedDoorStack = null;
|
||||
|
||||
|
||||
public static void register(){
|
||||
|
||||
@@ -45,7 +50,7 @@ public class IC2Module {
|
||||
IEnergySource = Class.forName("ic2.api.energy.tile.IEnergySource");
|
||||
|
||||
IEnergySink_GetInput = IEnergySink.getMethod("getMaxSafeInput");
|
||||
IEnergySource_GetOutput = IEnergySource.getMethod("getMaxEnergyOutput");
|
||||
//IEnergySource_GetOutput = IEnergySource.getMethod("getMaxEnergyOutput");
|
||||
IEnergyStorage_GetCapacity = IEnergyStorage.getMethod("getCapacity");
|
||||
|
||||
IC2Items = Class.forName("ic2.core.Ic2Items");
|
||||
@@ -55,6 +60,10 @@ public class IC2Module {
|
||||
TransformerUpgradeStack = (ItemStack)TransformerUpgrade.get(null);
|
||||
EnergyStorageUpgradeStack = (ItemStack)EnergyStorageUpgrade.get(null);
|
||||
|
||||
BlockIC2Door = Class.forName("ic2.core.block.BlockIC2Door");
|
||||
ReinforcedDoor = IC2Items.getDeclaredField("reinforcedDoor");
|
||||
ReinforcedDoorStack = (ItemStack)ReinforcedDoor.get(null);
|
||||
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[IC2] Class not found. " + e);
|
||||
return;
|
||||
@@ -69,21 +78,14 @@ public class IC2Module {
|
||||
return;
|
||||
}
|
||||
|
||||
ExternalModulesHandler.instance().addConfigRemote("IndustrialCraft2", "ic2.inputeumach", "Max EU input [Machines]");
|
||||
ExternalModulesHandler.instance().addConfig("IndustrialCraft2", "ic2.inputeuother", "Max EU input [Other]");
|
||||
ExternalModulesHandler.instance().addConfig("IndustrialCraft2", "ic2.outputeu", "Max EU output");
|
||||
ExternalModulesHandler.instance().addConfigRemote("IndustrialCraft2", "ic2.storage", "Energy stored");
|
||||
ExternalModulesHandler.instance().addConfigRemote("IndustrialCraft2", "ic2.inputeumach");
|
||||
ExternalModulesHandler.instance().addConfig("IndustrialCraft2", "ic2.inputeuother");
|
||||
ExternalModulesHandler.instance().addConfig("IndustrialCraft2", "ic2.outputeu");
|
||||
ExternalModulesHandler.instance().addConfigRemote("IndustrialCraft2", "ic2.storage");
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerIC2IEnergySink(), IEnergySink);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerIC2IEnergySource(), IEnergySource);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerIC2IEnergyStorage(), IEnergyStorage);
|
||||
ExternalModulesHandler.instance().registerStackProvider(new HUDHandlerDoor(), BlockIC2Door);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
package mcp.mobius.waila.addons.projectred;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import mcp.mobius.waila.api.IWailaBlockDecorator;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.gui.helpers.UIHelper;
|
||||
|
||||
public class HUDDecoratorRsGateLogic implements IWailaBlockDecorator {
|
||||
|
||||
static byte[][] IOARRAY={
|
||||
{1,1,2,1} /* OR */, {1,1,2,1} /* NOR */, {1,2,2,2} /* NOT */, {1,1,2,1} /* AND */,
|
||||
{1,1,2,1} /* NAND */, {0,1,2,1} /* XOR */, {0,1,2,1} /* XNOR */, {1,2,2,2} /* Buf */,
|
||||
{3,4,2,5} /* Multi */, {1,0,2,0} /* Pulse */, {1,0,2,0} /* Repeat */, {1,2,2,2} /* Rand */,
|
||||
{2,1,2,1} /* Latch */, {2,1,2,1} /* Toggle*/, {6,1,2,2} /* Transp */, {2,0,0,0} /* Light */,
|
||||
{2,0,0,0} /* Rain */, {1,7,2,7} /* Timer */, {2,2,2,2} /* Sequen */, {2,9,2,8} /* Count */,
|
||||
{1,2,2,6} /* State */, {6,1,2,1} /* Sync */, {10,1,10,1} /* Bus */, {11,12,11,12} /* Null */,
|
||||
{11,12,11,12} /* Inver */, {11,12,11,12} /* Buff */, {1,9,2,8} /* Cmp */, {1,12,2,12} /* And */,
|
||||
};
|
||||
|
||||
static String[] IONAMES={ "", "IN", "OUT", "SWAP", "IN_A", "IN_B", "LOCK", "IO", "POS", "NEG", "BUS", "A", "B"};
|
||||
|
||||
@Override
|
||||
public void decorateBlock(ItemStack itemStack, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
if (!config.getConfig("pr.showio")) return;
|
||||
|
||||
|
||||
int orient = 0;
|
||||
int subID = 0;
|
||||
int shape = 0;
|
||||
boolean found = false;
|
||||
|
||||
if (!accessor.getNBTData().hasKey("parts")) return;
|
||||
NBTTagList parts = accessor.getNBTData().getTagList("parts");
|
||||
for (int i = 0; i < parts.tagCount(); i++){
|
||||
NBTTagCompound subtag = (NBTTagCompound)parts.tagAt(i);
|
||||
String id = subtag.getString("id");
|
||||
|
||||
if (id.equals("pr_sgate") || id.equals("pr_igate") ||
|
||||
id.equals("pr_tgate") || id.equals("pr_bgate") ||
|
||||
id.equals("pr_agate") || id.equals("pr_rgate")){
|
||||
orient = accessor.getNBTInteger(subtag, "orient");
|
||||
subID = accessor.getNBTInteger(subtag, "subID");
|
||||
shape = accessor.getNBTInteger(subtag, "shape");
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) return;
|
||||
|
||||
//orient = orient - ((orient & 0x10) + (orient & 0x8) + (orient & 0x4));
|
||||
int hOrient = orient & 0x3;
|
||||
ForgeDirection vOrient = ForgeDirection.getOrientation((orient - (orient & 0x3)) >> 2);
|
||||
|
||||
//System.out.printf("%s\n", ForgeDirection.getOrientation(vOrient));
|
||||
|
||||
if (vOrient == ForgeDirection.EAST)
|
||||
hOrient -= 1;
|
||||
|
||||
if (vOrient == ForgeDirection.WEST)
|
||||
hOrient += 1;
|
||||
|
||||
if (hOrient == -1)
|
||||
hOrient = 3;
|
||||
|
||||
String[] IOStr = new String[4];
|
||||
for (int i = 0; i < 4; i++)
|
||||
IOStr[i] = IONAMES[IOARRAY[subID][i]];
|
||||
|
||||
String[] IOStrRot = new String[4];
|
||||
|
||||
for (int i = 0; i < 4 ; i++){
|
||||
int j = i + hOrient;
|
||||
if (j >= 4) j -= 4;
|
||||
IOStrRot[j] = IOStr[i];
|
||||
}
|
||||
|
||||
switch(vOrient){
|
||||
case DOWN:
|
||||
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.5F, 0.2F, 1.4F, 90F, 0F, 0F); // Orient 0
|
||||
UIHelper.drawFloatingText(IOStrRot[1], accessor.getRenderingPosition(), -0.4F, 0.2F, 0.5F, 90F, 270F, 0F); // Orient 1
|
||||
UIHelper.drawFloatingText(IOStrRot[2], accessor.getRenderingPosition(), 0.5F, 0.2F, -0.4F, 90F, 180F, 0F); // Orient 2
|
||||
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), 1.4F, 0.2F, 0.5F, 90F, 90F, 0F); // Orient 3
|
||||
break;
|
||||
case EAST:
|
||||
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.8F, 0.5F, 1.4F, 0F, 90F, 90F);
|
||||
UIHelper.drawFloatingText(IOStrRot[1], accessor.getRenderingPosition(), 0.8F, -0.4F, 0.5F, 0F, 90F, 180F);
|
||||
UIHelper.drawFloatingText(IOStrRot[2], accessor.getRenderingPosition(), 0.8F, 0.5F, -0.4F, 0F, 90F, 270F);
|
||||
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), 0.8F, 1.4F, 0.5F, 0F, 90F, 0F);
|
||||
break;
|
||||
case NORTH:
|
||||
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.5F, 1.4F, 0.2F, 0F, 180F, 0F);
|
||||
UIHelper.drawFloatingText(IOStrRot[1], accessor.getRenderingPosition(), 1.4F, 0.5F, 0.2F, 0F, 180F, 90F);
|
||||
UIHelper.drawFloatingText(IOStrRot[2], accessor.getRenderingPosition(), 0.5F, -0.4F, 0.2F, 0F, 180F, 180F);
|
||||
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), -0.4F, 0.5F, 0.2F, 0F, 180F, 270F);
|
||||
break;
|
||||
case SOUTH:
|
||||
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.5F, 1.4F, 0.8F, 0F, 0F, 0F);
|
||||
UIHelper.drawFloatingText(IOStrRot[1], accessor.getRenderingPosition(), -0.4F, 0.5F, 0.8F, 0F, 0F, 90F);
|
||||
UIHelper.drawFloatingText(IOStrRot[2], accessor.getRenderingPosition(), 0.5F, -0.4F, 0.8F, 0F, 0F, 180F);
|
||||
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), 1.4F, 0.5F, 0.8F, 0F, 0F, 270F);
|
||||
break;
|
||||
case UP:
|
||||
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.5F, 0.8F, 1.4F, 270F, 180F, 0F);
|
||||
UIHelper.drawFloatingText(IOStrRot[1], accessor.getRenderingPosition(), 1.4F, 0.8F, 0.5F, 270F, 270F, 0F);
|
||||
UIHelper.drawFloatingText(IOStrRot[2], accessor.getRenderingPosition(), 0.5F, 0.8F, -0.4F, 270F, 0F, 0F);
|
||||
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), -0.4F, 0.8F, 0.5F, 270F, 90F, 0F);
|
||||
break;
|
||||
case WEST:
|
||||
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.2F, 0.5F, 1.4F, 180F, 90F, 90F);
|
||||
UIHelper.drawFloatingText(IOStrRot[1], accessor.getRenderingPosition(), 0.2F, 1.4F, 0.5F, 180F, 90F, 180F);
|
||||
UIHelper.drawFloatingText(IOStrRot[2], accessor.getRenderingPosition(), 0.2F, 0.5F, -0.4F, 180F, 90F, 270F);
|
||||
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), 0.2F, -0.4F, 0.5F, 180F, 90F, 0F);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
double x = accessor.getRenderingPosition().xCoord;
|
||||
double y = accessor.getRenderingPosition().yCoord;
|
||||
double z = accessor.getRenderingPosition().zCoord;
|
||||
|
||||
switch(vOrient){
|
||||
case DOWN:
|
||||
UIHelper.drawRectangle(x - 0.1, y + 0.1, z, x, y + 0.1, z + 0.35, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x - 0.1, y + 0.1, z + 0.65, x, y + 0.1, z + 1.0, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x + 1.0, y + 0.1, z, x + 1.1, y + 0.1, z + 0.35, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x + 1.0, y + 0.1, z + 0.65, x + 1.1, y + 0.1, z + 1.0, 255, 255, 255, 150 );
|
||||
|
||||
UIHelper.drawRectangle(x - 0.1, y + 0.1, z - 0.1, x + 0.35, y + 0.1, z + 0.1, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x + 0.65, y + 0.1, z - 0.1, x + 1.1, y + 0.1, z + 0.1, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x - 0.1, y + 0.1, z + 1.0, x + 0.35, y + 0.1, z + 1.1, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x + 0.65, y + 0.1, z + 1.0, x + 1.1, y + 0.1, z + 1.1, 255, 255, 255, 150 );
|
||||
break;
|
||||
case EAST:
|
||||
UIHelper.drawRectangleEW(x + 0.9, y, z - 0.1, x + 0.9, y + 0.35, z, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangleEW(x + 0.9, y + 0.65, z - 0.1, x + 0.9, y + 1.0, z, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangleEW(x + 0.9, y, z + 1.0, x + 0.9, y + 0.35, z + 1.1, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangleEW(x + 0.9, y + 0.65, z + 1.0, x + 0.9, y + 1.0, z + 1.1, 255, 255, 255, 150 );
|
||||
|
||||
UIHelper.drawRectangleEW(x + 0.9, y - 0.1, z - 0.1, x + 0.9, y, z + 0.35, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangleEW(x + 0.9, y - 0.1, z + 0.65, x + 0.9, y, z + 1.1, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangleEW(x + 0.9, y + 1.0, z - 0.1, x + 0.9, y + 1.1, z + 0.35, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangleEW(x + 0.9, y + 1.0, z + 0.65, x + 0.9, y + 1.1, z + 1.1, 255, 255, 255, 150 );
|
||||
break;
|
||||
case NORTH:
|
||||
UIHelper.drawRectangle(x - 0.1, y, z + 0.1, x, y + 0.35, z + 0.1, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x - 0.1, y + 0.65, z + 0.1, x, y + 1.0, z + 0.1, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x + 1.0, y, z + 0.1, x + 1.1, y + 0.35, z + 0.1, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x + 1.0, y + 0.65, z + 0.1, x + 1.1, y + 1.0, z + 0.1, 255, 255, 255, 150 );
|
||||
|
||||
UIHelper.drawRectangle(x - 0.1, y - 0.1, z + 0.1, x + 0.35, y, z + 0.1, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x + 0.65, y - 0.1, z + 0.1, x + 1.1, y, z + 0.1, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x - 0.1, y + 1.0, z + 0.1, x + 0.35, y + 1.1, z + 0.1, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x + 0.65, y + 1.0, z + 0.1, x + 1.1, y + 1.1, z + 0.1, 255, 255, 255, 150 );
|
||||
break;
|
||||
case SOUTH:
|
||||
UIHelper.drawRectangle(x, y, z + 0.9, x - 0.1, y + 0.35, z + 0.9, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x, y + 0.65, z + 0.9, x - 0.1, y + 1.0, z + 0.9, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x + 1.1, y, z + 0.9, x + 1.0, y + 0.35, z + 0.9, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x + 1.1, y + 0.65, z + 0.9, x + 1.0, y + 1.0, z + 0.9, 255, 255, 255, 150 );
|
||||
|
||||
UIHelper.drawRectangle(x + 0.35, y - 0.1, z + 0.9, x - 0.1, y, z + 0.9, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x + 1.10, y - 0.1, z + 0.9, x + 0.65, y, z + 0.9, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x + 0.35, y + 1.0, z + 0.9, x - 0.1, y + 1.1, z + 0.9, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x + 1.1, y + 1.0, z + 0.9, x + 0.65, y + 1.1, z + 0.9, 255, 255, 255, 150 );
|
||||
break;
|
||||
case UP:
|
||||
UIHelper.drawRectangle(x, y + 0.9, z, x - 0.1, y + 0.9, z + 0.35, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x, y + 0.9, z + 0.65, x - 0.1, y + 0.9, z + 1.0, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x + 1.1, y + 0.9, z, x + 1.0, y + 0.9, z + 0.35, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x + 1.1, y + 0.9, z + 0.65, x + 1.0, y + 0.9, z + 1.0, 255, 255, 255, 150 );
|
||||
|
||||
UIHelper.drawRectangle(x + 0.35, y + 0.9, z - 0.1, x - 0.1, y + 0.9, z + 0.1, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x + 1.1, y + 0.9, z - 0.1, x + 0.65, y + 0.9, z + 0.1, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x +0.35, y + 0.9, z + 1.0, x - 0.1, y + 0.9, z + 1.1, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangle(x + 1.1, y + 0.9, z + 1.0, x + 0.65, y + 0.9, z + 1.1, 255, 255, 255, 150 );
|
||||
|
||||
break;
|
||||
case WEST:
|
||||
UIHelper.drawRectangleEW(x + 0.1, y+ 0.35, z - 0.1, x + 0.1, y , z, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangleEW(x + 0.1, y + 1.0, z - 0.1, x + 0.1, y + 0.65, z, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangleEW(x + 0.1, y + 0.35, z + 1.0, x + 0.1, y, z + 1.1, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangleEW(x + 0.1, y + 1.0, z + 1.0, x + 0.1, y + 0.65, z + 1.1, 255, 255, 255, 150 );
|
||||
|
||||
UIHelper.drawRectangleEW(x + 0.1, y, z - 0.1, x + 0.1, y - 0.1, z + 0.35, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangleEW(x + 0.1, y, z + 0.65, x + 0.1, y - 0.1, z + 1.1, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangleEW(x + 0.1, y + 1.1, z - 0.1, x + 0.1, y + 1.0, z + 0.35, 255, 255, 255, 150 );
|
||||
UIHelper.drawRectangleEW(x + 0.1, y + 1.1, z + 0.65, x + 0.1, y + 1.0, z + 1.1, 255, 255, 255, 150 );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package mcp.mobius.waila.addons.projectred;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class HUDHandlerRsGateLogic implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
if (!config.getConfig("pr.showdata")) return currenttip;
|
||||
|
||||
int orient = 0;
|
||||
int subID = 0;
|
||||
int shape = 0;
|
||||
int pmax = 0;
|
||||
int val = 0;
|
||||
int max = 0;
|
||||
int dec = 0;
|
||||
int inc = 0;
|
||||
|
||||
boolean found = false;
|
||||
|
||||
if (!accessor.getNBTData().hasKey("parts")) return currenttip;
|
||||
NBTTagList parts = accessor.getNBTData().getTagList("parts");
|
||||
for (int i = 0; i < parts.tagCount(); i++){
|
||||
NBTTagCompound subtag = (NBTTagCompound)parts.tagAt(i);
|
||||
String id = subtag.getString("id");
|
||||
|
||||
if (id.equals("pr_sgate") || id.equals("pr_igate") ||
|
||||
id.equals("pr_tgate") || id.equals("pr_bgate") ||
|
||||
id.equals("pr_agate") || id.equals("pr_rgate")){
|
||||
orient = accessor.getNBTInteger(subtag, "orient");
|
||||
subID = accessor.getNBTInteger(subtag, "subID");
|
||||
shape = accessor.getNBTInteger(subtag, "shape");
|
||||
|
||||
if (subID == 17)
|
||||
pmax = accessor.getNBTInteger(subtag, "pmax");
|
||||
|
||||
if (subID == 19){
|
||||
val = accessor.getNBTInteger(subtag, "val");
|
||||
max = accessor.getNBTInteger(subtag, "max");
|
||||
dec = accessor.getNBTInteger(subtag, "dec");
|
||||
inc = accessor.getNBTInteger(subtag, "inc");
|
||||
}
|
||||
|
||||
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) return currenttip;
|
||||
|
||||
switch(subID){
|
||||
case 10:
|
||||
currenttip.add(String.format("Delay : \u00a7f%d ticks", (int)Math.pow(2, shape)));
|
||||
break;
|
||||
|
||||
case 15:
|
||||
if (shape == 0)
|
||||
currenttip.add("Shape : \u00a7fOpen");
|
||||
if (shape == 1)
|
||||
currenttip.add("Shape : \u00a7fHalf closed");
|
||||
if (shape == 2)
|
||||
currenttip.add("Shape : \u00a7fclosed");
|
||||
break;
|
||||
|
||||
case 17:
|
||||
currenttip.add(String.format("Timer : \u00a7f%d \u00a7rms", (pmax + 2) * 50));
|
||||
break;
|
||||
|
||||
case 19:
|
||||
|
||||
|
||||
currenttip.add(String.format("Value : \u00a7f%d \u00a7r/ \u00a7f%d", val, max));
|
||||
currenttip.add(String.format("Step : \u00a7f-%d \u00a7r/ \u00a7f+%d", dec, inc));
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package mcp.mobius.waila.addons.projectred;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.addons.ExternalModulesHandler;
|
||||
|
||||
public class ProjectRedModule {
|
||||
|
||||
|
||||
public static Class BlockMultipart = null;
|
||||
|
||||
public static void register(){
|
||||
try{
|
||||
Class ModClass = Class.forName("mrtjp.projectred.ProjectRedIntegration");
|
||||
mod_Waila.log.log(Level.INFO, "ProjectRed|Integration mod found.");
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.INFO, "[ProjectRed] ProjectRed|Integration mod not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
try{
|
||||
|
||||
//InstancedRsGateLogic = Class.forName("mrtjp.projectred.integration.InstancedRsGateLogic");
|
||||
BlockMultipart = Class.forName("codechicken.multipart.BlockMultipart");
|
||||
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Class not found. " + e);
|
||||
return;
|
||||
// } catch (NoSuchMethodException e){
|
||||
// mod_Waila.log.log(Level.WARNING, "[EnderStorage] Method not found." + e);
|
||||
// return;
|
||||
// } catch (NoSuchFieldException e){
|
||||
// mod_Waila.log.log(Level.WARNING, "[EnderStorage] Field not found." + e);
|
||||
// return;
|
||||
} catch (Exception e){
|
||||
mod_Waila.log.log(Level.WARNING, "[EnderStorage] Unhandled exception." + e);
|
||||
return;
|
||||
}
|
||||
|
||||
ExternalModulesHandler.instance().addConfigRemote("Project:Red", "pr.showio");
|
||||
ExternalModulesHandler.instance().addConfigRemote("Project:Red", "pr.showdata");
|
||||
|
||||
ExternalModulesHandler.instance().registerBlockDecorator(new HUDDecoratorRsGateLogic(), BlockMultipart);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerRsGateLogic(), BlockMultipart);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package mcp.mobius.waila.addons.thaumcraft;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mcp.mobius.waila.WailaExceptionHandler;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class HUDHandlerCapacitor implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
if (config.getConfig("thaumcraft.storedvis")){
|
||||
try{
|
||||
short storedVis = ThaumcraftModule.TileCrystalCapacitor_StoredVis.getShort(accessor.getTileEntity());
|
||||
short maxVis = ThaumcraftModule.TileCrystalCapacitor_MaxVis.getShort(accessor.getTileEntity());
|
||||
|
||||
currenttip.add(String.format("%s/%s vis", storedVis, maxVis));
|
||||
}catch (Exception e){
|
||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getClass().getName(), currenttip);
|
||||
}
|
||||
}
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package mcp.mobius.waila.addons.thaumcraft;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class HUDHandlerLeaves implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return new ItemStack(accessor.getBlock(), 0, accessor.getMetadata());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package mcp.mobius.waila.addons.thaumcraft;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class HUDHandlerPlants implements IWailaDataProvider {
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return new ItemStack(accessor.getBlock(), 0, accessor.getMetadata());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package mcp.mobius.waila.addons.thaumcraft;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.addons.ExternalModulesHandler;
|
||||
|
||||
public class ThaumcraftModule {
|
||||
|
||||
public static Class BlockMagicalLeaves = null;
|
||||
public static Class BlockCustomPlant = null;
|
||||
|
||||
public static Class TileCrystalCapacitor = null;
|
||||
public static Field TileCrystalCapacitor_StoredVis = null;
|
||||
public static Field TileCrystalCapacitor_MaxVis = null;
|
||||
|
||||
public static void register(){
|
||||
|
||||
try{
|
||||
Class ModThaumcraft = Class.forName("thaumcraft.common.Thaumcraft");
|
||||
mod_Waila.log.log(Level.INFO, "Thaumcraft mod found.");
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.INFO, "[Thaumcraft] Thaumcraft mod not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
try{
|
||||
BlockMagicalLeaves = Class.forName("thaumcraft.common.world.BlockMagicalLeaves");
|
||||
BlockCustomPlant = Class.forName("thaumcraft.common.world.BlockCustomPlant");
|
||||
|
||||
TileCrystalCapacitor = Class.forName("thaumcraft.common.tiles.TileCrystalCapacitor");
|
||||
TileCrystalCapacitor_StoredVis = TileCrystalCapacitor.getField("storedVis");
|
||||
TileCrystalCapacitor_MaxVis = TileCrystalCapacitor.getField("maxVis");
|
||||
|
||||
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[Thaumcraft] Class not found. " + e);
|
||||
return;
|
||||
// } catch (NoSuchMethodException e){
|
||||
// mod_Waila.log.log(Level.WARNING, "[Thaumcraft] Method not found." + e);
|
||||
// return;
|
||||
} catch (NoSuchFieldException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[Thaumcraft] Field not found." + e);
|
||||
return;
|
||||
// } catch (Exception e){
|
||||
// mod_Waila.log.log(Level.WARNING, "[Thaumcraft] Unhandled exception." + e);
|
||||
// return;
|
||||
}
|
||||
ExternalModulesHandler.instance().addConfig("Thaumcraft", "thaumcraft.storedvis");
|
||||
ExternalModulesHandler.instance().registerStackProvider(new HUDHandlerLeaves(), BlockMagicalLeaves);
|
||||
ExternalModulesHandler.instance().registerStackProvider(new HUDHandlerPlants(), BlockCustomPlant);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerCapacitor(), TileCrystalCapacitor);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package mcp.mobius.waila.addons.thermalexpansion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import mcp.mobius.waila.WailaExceptionHandler;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class HUDHandlerConduitFluid implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
|
||||
if (config.getConfig("thermalexpansion.fluidtype")){
|
||||
|
||||
try {
|
||||
FluidStack fluid = (FluidStack)ThermalExpansionModule.TileConduitFluid_getRenderFluid.invoke(accessor.getTileEntity());
|
||||
|
||||
try{
|
||||
currenttip.add(fluid.getFluid().getLocalizedName());
|
||||
} catch (NullPointerException f){
|
||||
currenttip.add(LangUtil.translateG("hud.msg.empty"));
|
||||
}
|
||||
|
||||
} catch (Exception e){
|
||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||
}
|
||||
|
||||
}
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package mcp.mobius.waila.addons.thermalexpansion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class HUDHandlerConduitItem implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
|
||||
if (accessor.getNBTData().hasKey("Mode") && accessor.getNBTInteger(accessor.getNBTData(), "Mode") != 0){
|
||||
int mode = accessor.getNBTInteger(accessor.getNBTData(), "Mode");
|
||||
|
||||
if (mode == 1)
|
||||
currenttip.add("Mode : \u00a7fDense");
|
||||
else if (mode == 2)
|
||||
currenttip.add("Mode : \u00a7fVacuum");
|
||||
else if (mode == 3)
|
||||
currenttip.add("Mode : \u00a7fRound-Robin");
|
||||
else
|
||||
currenttip.add("Mode : <UNKNOWN>");
|
||||
}
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package mcp.mobius.waila.addons.thermalexpansion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import mcp.mobius.waila.WailaExceptionHandler;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class HUDHandlerEnergyCell implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
if (!config.getConfig("thermalexpansion.energycell")) return currenttip;
|
||||
|
||||
int energyReceive = accessor.getNBTInteger(accessor.getNBTData(), "Recv");
|
||||
int energySend = accessor.getNBTInteger(accessor.getNBTData(), "Send");
|
||||
|
||||
currenttip.add(String.format("%s/%s : %d / %d RF/t", LangUtil.translateG("hud.msg.in"), LangUtil.translateG("hud.msg.out"), energyReceive, energySend));
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package mcp.mobius.waila.addons.thermalexpansion;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import mcp.mobius.waila.WailaExceptionHandler;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class HUDHandlerIEnergyHandler implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
|
||||
if (!config.getConfig("thermalexpansion.energyhandler")) return currenttip;
|
||||
if (!accessor.getNBTData().hasKey("Energy")) return currenttip;
|
||||
|
||||
int energy = accessor.getNBTInteger(accessor.getNBTData(), "Energy");
|
||||
try {
|
||||
Integer maxEnergy = (Integer)ThermalExpansionModule.IEnergyHandler_getMaxStorage.invoke(accessor.getTileEntity(), ForgeDirection.UNKNOWN);
|
||||
if (maxEnergy != 0)
|
||||
currenttip.add(String.format("%d / %d RF", energy, maxEnergy));
|
||||
} catch (Exception e){
|
||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package mcp.mobius.waila.addons.thermalexpansion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
|
||||
public class HUDHandlerISecureTile implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
|
||||
if (config.getConfig("thermalexpansion.owner")){
|
||||
|
||||
String owner = accessor.getNBTData().getString("Owner");
|
||||
int iaccess = accessor.getNBTInteger(accessor.getNBTData(), "Access");
|
||||
|
||||
String access = "INVALID";
|
||||
switch(iaccess){
|
||||
case 0:
|
||||
access = LangUtil.translateG("hud.msg.public");
|
||||
break;
|
||||
case 1:
|
||||
access = LangUtil.translateG("hud.msg.restricted");
|
||||
break;
|
||||
case 2:
|
||||
access = LangUtil.translateG("hud.msg.private");
|
||||
break;
|
||||
}
|
||||
|
||||
currenttip.add(String.format("%s : \u00a7f%s\u00a7r [ %s ]", LangUtil.translateG("hud.msg.owner"), owner, access));
|
||||
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package mcp.mobius.waila.addons.thermalexpansion;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.List;
|
||||
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import mcp.mobius.waila.WailaExceptionHandler;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class HUDHandlerTank implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
if (!config.getConfig("thermalexpansion.fluidtype")) return currenttip;
|
||||
|
||||
try {
|
||||
FluidStack fluid = (FluidStack)ThermalExpansionModule.TileTank_getTankFluid.invoke(accessor.getTileEntity());
|
||||
String name = currenttip.get(0);
|
||||
|
||||
try{
|
||||
name += String.format(" < %s >", fluid.getFluid().getLocalizedName());
|
||||
} catch (NullPointerException f){
|
||||
name += " " + LangUtil.translateG("hud.msg.empty");
|
||||
}
|
||||
|
||||
currenttip.set(0, name);
|
||||
|
||||
} catch (Exception e){
|
||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||
}
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
try {
|
||||
if (config.getConfig("thermalexpansion.fluidamount")){
|
||||
int amount = 0;
|
||||
if (accessor.getNBTData().hasKey("Amount"))
|
||||
amount = accessor.getNBTInteger(accessor.getNBTData(), "Amount");
|
||||
|
||||
Integer capacity = (Integer)ThermalExpansionModule.TileTank_getTankCapacity.invoke(accessor.getTileEntity());
|
||||
|
||||
currenttip.add(String.format("%d / %d mB", amount, capacity));
|
||||
}
|
||||
|
||||
if (config.getConfig("thermalexpansion.tankmode")){
|
||||
Byte mode = (Byte)ThermalExpansionModule.TileTank_mode.get(accessor.getTileEntity());
|
||||
if (mode == 0)
|
||||
currenttip.add(String.format("%s : \u00a7a%s", LangUtil.translateG("hud.msg.mode"), LangUtil.translateG("hud.msg.input")));
|
||||
else if (mode == 1)
|
||||
currenttip.add(String.format("%s : \u00a7c%s", LangUtil.translateG("hud.msg.mode"), LangUtil.translateG("hud.msg.output")));
|
||||
else
|
||||
currenttip.add(String.format("Mode : Unknown (%d)", mode));
|
||||
}
|
||||
|
||||
|
||||
|
||||
} catch (Exception e){
|
||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package mcp.mobius.waila.addons.thermalexpansion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class HUDHandlerTesseract implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
|
||||
if (config.getConfig("thermalexpansion.tesssendrecv")){
|
||||
String send = String.format("%s : ", LangUtil.translateG("hud.msg.send"));
|
||||
String recv = String.format("%s : ", LangUtil.translateG("hud.msg.recv"));
|
||||
String item = String.format("\u00a7a%s ", LangUtil.translateG("hud.msg.item"));
|
||||
String fluid= String.format("\u00a79%s ", LangUtil.translateG("hud.msg.fluid"));
|
||||
String energ= String.format("\u00a7c%s ", LangUtil.translateG("hud.msg.energ"));
|
||||
|
||||
|
||||
switch (accessor.getNBTInteger(accessor.getNBTData(), "Item.Mode")){
|
||||
case 0:
|
||||
send += item;
|
||||
break;
|
||||
case 1:
|
||||
recv += item;
|
||||
break;
|
||||
case 2:
|
||||
send += item;
|
||||
recv += item;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (accessor.getNBTInteger(accessor.getNBTData(), "Fluid.Mode")){
|
||||
case 0:
|
||||
send += fluid;
|
||||
break;
|
||||
case 1:
|
||||
recv += fluid;
|
||||
break;
|
||||
case 2:
|
||||
send += fluid;
|
||||
recv += fluid;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (accessor.getNBTInteger(accessor.getNBTData(), "Energy.Mode")){
|
||||
case 0:
|
||||
send += energ;
|
||||
break;
|
||||
case 1:
|
||||
recv += energ;
|
||||
break;
|
||||
case 2:
|
||||
send += energ;
|
||||
recv += energ;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!send.equals(String.format("%s : ", LangUtil.translateG("hud.msg.send"))))
|
||||
currenttip.add(send);
|
||||
|
||||
if (!send.equals(String.format("%s : ", LangUtil.translateG("hud.msg.recv"))))
|
||||
currenttip.add(recv);
|
||||
}
|
||||
|
||||
if (config.getConfig("thermalexpansion.tessfreq"))
|
||||
currenttip.add(String.format("%s : %d",LangUtil.translateG("hud.msg.frequency"), accessor.getNBTInteger(accessor.getNBTData(), "Frequency")));
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package mcp.mobius.waila.addons.thermalexpansion;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.addons.ExternalModulesHandler;
|
||||
|
||||
public class ThermalExpansionModule {
|
||||
|
||||
public static Class IEnergyHandler = null;
|
||||
public static Method IEnergyHandler_getMaxStorage = null;
|
||||
|
||||
public static Class TileEnergyCell = null;
|
||||
|
||||
public static Class TileTank = null;
|
||||
public static Method TileTank_getTankFluid = null;
|
||||
public static Method TileTank_getTankCapacity = null;
|
||||
public static Field TileTank_mode = null;
|
||||
|
||||
public static Class TileConduitFluid = null;
|
||||
public static Method TileConduitFluid_getRenderFluid = null;
|
||||
public static Method TileConduitFluid_getRenderFluidLevel = null;
|
||||
|
||||
public static Class TileConduitItems = null;
|
||||
|
||||
public static Class TileTesseract = null;
|
||||
|
||||
public static Class ISecureTile = null;
|
||||
|
||||
//public static Field TileTesseract_modItem = null;
|
||||
//public static Field TileTesseract_modFluid = null;
|
||||
//public static Field TileTesseract_modEnergy = null;
|
||||
|
||||
|
||||
//public static Class TileConduitBase = null;
|
||||
//public static Field TileConduitBase_isInput = null;
|
||||
//public static Field TileConduitBase_isOutput = null;
|
||||
|
||||
public static void register(){
|
||||
|
||||
try{
|
||||
Class ModThermalExpansion = Class.forName("thermalexpansion.ThermalExpansion");
|
||||
mod_Waila.log.log(Level.INFO, "Thermal Expansion mod found.");
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.INFO, "[Thermal Expansion] ThermalExpansion mod not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
try{
|
||||
IEnergyHandler = Class.forName("cofh.api.energy.IEnergyHandler");
|
||||
IEnergyHandler_getMaxStorage = IEnergyHandler.getMethod("getMaxEnergyStored", ForgeDirection.class);
|
||||
TileEnergyCell = Class.forName("thermalexpansion.block.energycell.TileEnergyCell");
|
||||
|
||||
TileTank = Class.forName("thermalexpansion.block.tank.TileTank");
|
||||
TileTank_getTankFluid = TileTank.getMethod("getTankFluid");
|
||||
TileTank_getTankCapacity = TileTank.getMethod("getTankCapacity");
|
||||
TileTank_mode = TileTank.getField("mode");
|
||||
|
||||
TileConduitFluid = Class.forName("thermalexpansion.block.conduit.fluid.TileConduitFluid");
|
||||
TileConduitFluid_getRenderFluid = TileConduitFluid.getMethod("getRenderFluid");
|
||||
TileConduitFluid_getRenderFluidLevel = TileConduitFluid.getMethod("getRenderFluidLevel");
|
||||
|
||||
TileConduitItems = Class.forName("thermalexpansion.block.conduit.item.TileConduitItem");
|
||||
|
||||
TileTesseract = Class.forName("thermalexpansion.block.tesseract.TileTesseract");
|
||||
|
||||
ISecureTile = Class.forName("cofh.api.tileentity.ISecureTile");
|
||||
|
||||
//TileTesseract_modItem = TileTesseract.getField("modItem");
|
||||
//TileTesseract_modFluid = TileTesseract.getField("modFluid");
|
||||
//TileTesseract_modEnergy = TileTesseract.getField("modEnergy");
|
||||
|
||||
//TileConduitBase = Class.forName("thermalexpansion.block.conduit.TileConduitBase");
|
||||
//TileConduitBase_isInput = TileConduitBase.getField("isInput");
|
||||
//TileConduitBase_isOutput = TileConduitBase.getField("isOutput");
|
||||
|
||||
//TileEnergyCell_energyReceive = TileEnergyCell.getField("energyReceive");
|
||||
//TileEnergyCell_energySend = TileEnergyCell.getField("energySend");
|
||||
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[Thermal Expansion] Class not found. " + e);
|
||||
return;
|
||||
} catch (NoSuchMethodException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[Thermal Expansion] Method not found." + e);
|
||||
return;
|
||||
} catch (NoSuchFieldException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[Thermal Expansion] Field not found." + e);
|
||||
return;
|
||||
// } catch (Exception e){
|
||||
// mod_Waila.log.log(Level.WARNING, "[Thermal Expansion] Unhandled exception." + e);
|
||||
// return;
|
||||
}
|
||||
|
||||
ExternalModulesHandler.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energyhandler");
|
||||
ExternalModulesHandler.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energycell");
|
||||
ExternalModulesHandler.instance().addConfig("Thermal Expansion", "thermalexpansion.fluidtype");
|
||||
ExternalModulesHandler.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.fluidamount");
|
||||
ExternalModulesHandler.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.conditemmode");
|
||||
ExternalModulesHandler.instance().addConfig("Thermal Expansion", "thermalexpansion.tankmode");
|
||||
ExternalModulesHandler.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.tesssendrecv");
|
||||
ExternalModulesHandler.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.tessfreq");
|
||||
ExternalModulesHandler.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.owner");
|
||||
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerIEnergyHandler(), IEnergyHandler);
|
||||
//ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerIEnergyHandler(), TileEnergyCell);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerEnergyCell(), TileEnergyCell);
|
||||
ExternalModulesHandler.instance().registerHeadProvider(new HUDHandlerTank(), TileTank);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerTank(), TileTank);
|
||||
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerConduitFluid(), TileConduitFluid);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerTesseract(), TileTesseract);
|
||||
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerConduitItem(), TileConduitItems);
|
||||
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerISecureTile(), ISecureTile);
|
||||
|
||||
//ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerConduitBase(), TileConduitBase);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package mcp.mobius.waila.addons.twilightforest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
|
||||
public class TwilightForestGenericOverride implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return new ItemStack(accessor.getBlock(), 0, accessor.getMetadata());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package mcp.mobius.waila.addons.twilightforest;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.addons.ExternalModulesHandler;
|
||||
|
||||
public class TwilightForestModule {
|
||||
|
||||
public static Class BlockTFRoots = null;
|
||||
public static Class BlockTFPlant = null;
|
||||
public static Class BlockTFSapling = null;
|
||||
|
||||
public static void register(){
|
||||
|
||||
try{
|
||||
Class TwilightForestMod = Class.forName("twilightforest.TwilightForestMod");
|
||||
mod_Waila.log.log(Level.INFO, "TwilightForestMod mod found.");
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.INFO, "[TwilightForestMod] TwilightForestMod mod not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
BlockTFRoots = Class.forName("twilightforest.block.BlockTFRoots");
|
||||
BlockTFPlant = Class.forName("twilightforest.block.BlockTFPlant");
|
||||
BlockTFSapling = Class.forName("twilightforest.block.BlockTFSapling");
|
||||
} catch (ClassNotFoundException e) {
|
||||
mod_Waila.log.log(Level.WARNING, "[TwilightForestMod] Class not found. " + e);
|
||||
}
|
||||
|
||||
|
||||
ExternalModulesHandler.instance().registerStackProvider(new TwilightForestGenericOverride(), BlockTFRoots);
|
||||
ExternalModulesHandler.instance().registerStackProvider(new TwilightForestGenericOverride(), BlockTFPlant);
|
||||
//ExternalModulesHandler.instance().registerStackProvider(new TwilightForestGenericOverride(), BlockTFSapling);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package mcp.mobius.waila.addons.vanillamc;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import mcp.mobius.waila.api.IWailaBlockDecorator;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.gui.helpers.UIHelper;
|
||||
|
||||
public class HUDDecoratorVanilla implements IWailaBlockDecorator {
|
||||
|
||||
@Override
|
||||
public void decorateBlock(ItemStack itemStack, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
//UIHelper.drawBillboardText(itemStack.getDisplayName(), accessor.getRenderingPosition(), 0.5F, 1.5F, 0.5F, accessor.getPartialFrame());
|
||||
UIHelper.drawFloatingText("IN", accessor.getRenderingPosition(), 0.5F, 0.2F, -0.2F, 90F, 0F, 0F);
|
||||
UIHelper.drawFloatingText("OUT", accessor.getRenderingPosition(), -0.2F, 0.2F, 0.5F, 90F, 90F, 0F);
|
||||
UIHelper.drawFloatingText("OUT", accessor.getRenderingPosition(), 1.2F, 0.2F, 0.5F, 90F, -90F, 0F);
|
||||
UIHelper.drawFloatingText("OUT", accessor.getRenderingPosition(), 0.5F, 0.2F, 1.2F, 90F, -180F, 0F);
|
||||
|
||||
double offset = 0.1;
|
||||
double delta = 1 + 2 * offset;
|
||||
|
||||
double x = accessor.getRenderingPosition().xCoord - offset;
|
||||
double y = accessor.getRenderingPosition().yCoord - offset;
|
||||
double z = accessor.getRenderingPosition().zCoord - offset;
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
|
||||
tessellator.setColorRGBA(255, 255, 255, 150);
|
||||
|
||||
tessellator.addVertex(x, y + 0.2 , z);
|
||||
tessellator.addVertex(x, y + 0.2 , z + delta/2 - 0.1);
|
||||
tessellator.addVertex(x + offset, y + 0.2, z + delta/2 - 0.1);
|
||||
tessellator.addVertex(x + offset, y + 0.2, z);
|
||||
|
||||
tessellator.addVertex(x, y + 0.2 , z + delta/2 + 0.1);
|
||||
tessellator.addVertex(x, y + 0.2 , z + delta);
|
||||
tessellator.addVertex(x + offset, y + 0.2, z + delta);
|
||||
tessellator.addVertex(x + offset, y + 0.2, z + delta/2 + 0.1);
|
||||
|
||||
tessellator.addVertex(x + delta - 0.1, y + 0.2 , z + 0.1);
|
||||
tessellator.addVertex(x + delta - 0.1, y + 0.2 , z + delta/2 - 0.1);
|
||||
tessellator.addVertex(x + delta + offset - 0.1, y + 0.2, z + delta/2 - 0.1);
|
||||
tessellator.addVertex(x + delta + offset - 0.1, y + 0.2, z + 0.1);
|
||||
|
||||
tessellator.addVertex(x + delta - 0.1, y + 0.2 , z + delta/2 + 0.1);
|
||||
tessellator.addVertex(x + delta - 0.1, y + 0.2 , z + delta);
|
||||
tessellator.addVertex(x + delta + offset - 0.1, y + 0.2, z + delta);
|
||||
tessellator.addVertex(x + delta + offset - 0.1, y + 0.2, z + delta/2 + 0.1);
|
||||
|
||||
|
||||
tessellator.addVertex(x+ 0.1, y + 0.2, z);
|
||||
tessellator.addVertex(x+ 0.1, y + 0.2, z+ offset);
|
||||
tessellator.addVertex(x+ delta/2 - 0.1, y + 0.2, z+ offset);
|
||||
tessellator.addVertex(x+ delta/2 - 0.1, y + 0.2, z);
|
||||
|
||||
tessellator.addVertex(x+ delta/2 + 0.1, y + 0.2, z);
|
||||
tessellator.addVertex(x+ delta/2 + 0.1, y + 0.2, z+ offset);
|
||||
tessellator.addVertex(x+ delta, y + 0.2, z+ offset);
|
||||
tessellator.addVertex(x+ delta, y + 0.2, z);
|
||||
|
||||
tessellator.addVertex(x + 0.1, y + 0.2, z+ delta - 0.1);
|
||||
tessellator.addVertex(x + 0.1, y + 0.2, z+ offset+ delta - 0.1);
|
||||
tessellator.addVertex(x+ delta/2 - 0.1, y + 0.2, z+ offset+ delta - 0.1);
|
||||
tessellator.addVertex(x+ delta/2 - 0.1, y + 0.2, z+ delta - 0.1);
|
||||
|
||||
tessellator.addVertex(x+ delta/2 + 0.1, y + 0.2, z+ delta - 0.1);
|
||||
tessellator.addVertex(x+ delta/2 + 0.1, y + 0.2, z+ offset+ delta - 0.1);
|
||||
tessellator.addVertex(x+ delta - 0.1, y + 0.2, z+ offset+ delta - 0.1);
|
||||
tessellator.addVertex(x+ delta - 0.1, y + 0.2, z+ delta - 0.1);
|
||||
|
||||
tessellator.draw();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,15 +2,13 @@ package mcp.mobius.waila.addons.vanillamc;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockLever;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemRecord;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityComparator;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntityMobSpawner;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import mcp.mobius.waila.addons.ExternalModulesHandler;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
@@ -30,8 +28,11 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
|
||||
static int comparatorIdl = Block.redstoneComparatorIdle.blockID;
|
||||
static int comparatorAct = Block.redstoneComparatorActive.blockID;
|
||||
static int redstone = Block.redstoneWire.blockID;
|
||||
static int jukebox = Block.jukebox.blockID;
|
||||
static int cocoa = Block.cocoaPlant.blockID;
|
||||
static int netherwart = Block.netherStalk.blockID;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
@@ -44,7 +45,7 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
|
||||
/* Mob spawner handler */
|
||||
if (blockID == mobSpawnerID && accessor.getTileEntity() instanceof TileEntityMobSpawner && config.getConfig("vanilla.spawntype")){
|
||||
String name = currenttip.get(0);
|
||||
String mobname = ((TileEntityMobSpawner)accessor.getTileEntity()).func_98049_a().getEntityNameToSpawn();
|
||||
String mobname = ((TileEntityMobSpawner)accessor.getTileEntity()).getSpawnerLogic().getEntityNameToSpawn();
|
||||
currenttip.set(0, String.format("%s (%s)", name, mobname));
|
||||
}
|
||||
|
||||
@@ -62,18 +63,37 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
|
||||
/* Crops */
|
||||
if (config.getConfig("vanilla.growthvalue"))
|
||||
if (blockID == cropsID || blockID == melonStemID || blockID == pumpkinStemID || blockID == carrotID || blockID == potatoID){
|
||||
float growthValue = ((float)accessor.getMetadata() / 7.0F) * 100.0F;
|
||||
if (growthValue != 100.0)
|
||||
currenttip.add(String.format("Growth : %.0f %%", growthValue));
|
||||
float growthValue = (accessor.getMetadata() / 7.0F) * 100.0F;
|
||||
if (growthValue < 100.0)
|
||||
currenttip.add(String.format("%s : %.0f %%", LangUtil.translateG("hud.msg.growth"), growthValue));
|
||||
else
|
||||
currenttip.add("Growth : Mature");
|
||||
currenttip.add(String.format("%s : %s", LangUtil.translateG("hud.msg.growth"), LangUtil.translateG("hud.msg.mature")));
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
if (blockID == cocoa){
|
||||
|
||||
float growthValue = ((accessor.getMetadata() >> 2) / 2.0F) * 100.0F;
|
||||
if (growthValue < 100.0)
|
||||
currenttip.add(String.format("%s : %.0f %%", LangUtil.translateG("hud.msg.growth"), growthValue));
|
||||
else
|
||||
currenttip.add(String.format("%s : %s", LangUtil.translateG("hud.msg.growth"), LangUtil.translateG("hud.msg.mature")));
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
if (blockID == netherwart){
|
||||
float growthValue = (accessor.getMetadata() / 3.0F) * 100.0F;
|
||||
if (growthValue < 100.0)
|
||||
currenttip.add(String.format("%s : %.0f %%", LangUtil.translateG("hud.msg.growth"), growthValue));
|
||||
else
|
||||
currenttip.add(String.format("%s : %s", LangUtil.translateG("hud.msg.growth"), LangUtil.translateG("hud.msg.mature")));
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
if (config.getConfig("vanilla.leverstate"))
|
||||
if (blockID == leverID){
|
||||
String redstoneOn = (accessor.getMetadata() & 8) == 0 ? "Off" : "On";
|
||||
currenttip.add("State : " + redstoneOn);
|
||||
String redstoneOn = (accessor.getMetadata() & 8) == 0 ? LangUtil.translateG("hud.msg.off") : LangUtil.translateG("hud.msg.on");
|
||||
currenttip.add(String.format("%s : %s", LangUtil.translateG("hud.msg.state"), redstoneOn));
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@@ -81,15 +101,15 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
|
||||
if ((blockID == repeaterIdle) ||(blockID == repeaterActv)){
|
||||
int tick = (accessor.getMetadata() >> 2) + 1 ;
|
||||
if (tick == 1)
|
||||
currenttip.add(String.format("Delay : %s tick", tick));
|
||||
currenttip.add(String.format("%s : %s tick", LangUtil.translateG("hud.msg.delay"), tick));
|
||||
else
|
||||
currenttip.add(String.format("Delay : %s ticks", tick));
|
||||
currenttip.add(String.format("%s : %s ticks", LangUtil.translateG("hud.msg.delay"), tick));
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
if (config.getConfig("vanilla.comparator"))
|
||||
if ((blockID == comparatorIdl) ||(blockID == comparatorAct)){
|
||||
String mode = ((accessor.getMetadata() >> 2) & 1) == 0 ? "Comparator" : "Substractor";
|
||||
String mode = ((accessor.getMetadata() >> 2) & 1) == 0 ? LangUtil.translateG("hud.msg.comparator") : LangUtil.translateG("hud.msg.substractor");
|
||||
//int outputSignal = ((TileEntityComparator)entity).func_96100_a();
|
||||
currenttip.add("Mode : " + mode);
|
||||
//currenttip.add(String.format("Out : %s", outputSignal));
|
||||
@@ -98,20 +118,38 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
|
||||
|
||||
if (config.getConfig("vanilla.redstone"))
|
||||
if (blockID == redstone){
|
||||
currenttip.add(String.format("Power : %s" , accessor.getMetadata()));
|
||||
currenttip.add(String.format("%s : %s" , LangUtil.translateG("hud.msg.power"), accessor.getMetadata()));
|
||||
return currenttip;
|
||||
}
|
||||
}
|
||||
|
||||
if (config.getConfig("vanilla.jukebox"))
|
||||
if (blockID == jukebox){
|
||||
NBTTagCompound tag = accessor.getNBTData();
|
||||
Item record = null;
|
||||
if (tag.hasKey("Record")){
|
||||
record = Item.itemsList[accessor.getNBTInteger(tag, "Record")];
|
||||
currenttip.add(((ItemRecord)record).getRecordTitle());
|
||||
} else {
|
||||
currenttip.add(LangUtil.translateG("hud.msg.empty"));
|
||||
}
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
public static void register(){
|
||||
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.spawntype", "Spawner type");
|
||||
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.growthvalue", "Growth value");
|
||||
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.leverstate", "Lever state");
|
||||
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.repeater", "Repeater delay");
|
||||
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.comparator", "Comparator mode");
|
||||
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.redstone", "Redstone power");
|
||||
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.spawntype");
|
||||
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.growthvalue");
|
||||
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.leverstate");
|
||||
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.repeater");
|
||||
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.comparator");
|
||||
ExternalModulesHandler.instance().addConfig("VanillaMC", "vanilla.redstone");
|
||||
ExternalModulesHandler.instance().addConfigRemote("VanillaMC", "vanilla.jukebox");
|
||||
ExternalModulesHandler.instance().registerHeadProvider(new HUDHandlerVanilla(), mobSpawnerID);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), cropsID);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), melonStemID);
|
||||
@@ -124,7 +162,14 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), comparatorIdl);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), comparatorAct);
|
||||
ExternalModulesHandler.instance().registerHeadProvider(new HUDHandlerVanilla(), redstone);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), redstone);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), redstone);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), jukebox);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), cocoa);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerVanilla(), netherwart);
|
||||
|
||||
ExternalModulesHandler.instance().registerDocTextFile("/mcp/mobius/waila/addons/vanillamc/WikiData.csv");
|
||||
|
||||
//ExternalModulesHandler.instance().registerBlockDecorator(new HUDDecoratorVanilla(), repeaterIdle);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,667 @@
|
||||
Minecraft,tile.*,0,Stone,net.minecraft.item.ItemBlock,This is a crazy test !
|
||||
Minecraft,tile.grass,0,Grass Block,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.dirt,0,Dirt,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.stonebrick,0,Cobblestone,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.wood.oak,0,Oak Wood Planks,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.wood.spruce,1,Spruce Wood Planks,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.wood.birch,2,Birch Wood Planks,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.wood.jungle,3,Jungle Wood Planks,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.sapling.oak,0,Oak Sapling,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.sapling.spruce,1,Spruce Sapling,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.sapling.birch,2,Birch Sapling,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.sapling.jungle,3,Jungle Sapling,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.bedrock,0,Bedrock,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.water,0,Water,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.water,0,Water,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.lava,0,Lava,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.lava,0,Lava,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.sand,0,Sand,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.gravel,0,Gravel,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.oreGold,0,Gold Ore,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.oreIron,0,Iron Ore,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.oreCoal,0,Coal Ore,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.log.oak,0,Oak Wood,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.log.spruce,1,Spruce Wood,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.log.birch,2,Birch Wood,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.log.jungle,3,Jungle Wood,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.leaves.oak,0,Oak Leaves,net.minecraft.item.ItemLeaves,
|
||||
Minecraft,tile.leaves.spruce,1,Spruce Leaves,net.minecraft.item.ItemLeaves,
|
||||
Minecraft,tile.leaves.birch,2,Birch Leaves,net.minecraft.item.ItemLeaves,
|
||||
Minecraft,tile.leaves.jungle,3,Jungle Leaves,net.minecraft.item.ItemLeaves,
|
||||
Minecraft,tile.sponge,0,Sponge,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.glass,0,Glass,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.oreLapis,0,Lapis Lazuli Ore,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.blockLapis,0,Lapis Lazuli Block,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.dispenser,0,Dispenser,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.sandStone.default,0,Sandstone,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.sandStone.chiseled,1,Chiseled Sandstone,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.sandStone.smooth,2,Smooth Sandstone,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.musicBlock,0,Note Block,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.goldenRail,0,Powered Rail,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.detectorRail,0,Detector Rail,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.pistonStickyBase,0,Sticky Piston,net.minecraft.item.ItemPiston,
|
||||
Minecraft,tile.web,0,Cobweb,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.tallgrass.grass,1,Grass,net.minecraft.item.ItemColored,
|
||||
Minecraft,tile.tallgrass.fern,2,Fern,net.minecraft.item.ItemColored,
|
||||
Minecraft,tile.deadbush,0,Dead Bush,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.pistonBase,0,Piston,net.minecraft.item.ItemPiston,
|
||||
Minecraft,tile.cloth.white,0,Wool,net.minecraft.item.ItemCloth,
|
||||
Minecraft,tile.cloth.orange,1,Orange Wool,net.minecraft.item.ItemCloth,
|
||||
Minecraft,tile.cloth.magenta,2,Magenta Wool,net.minecraft.item.ItemCloth,
|
||||
Minecraft,tile.cloth.lightBlue,3,Light Blue Wool,net.minecraft.item.ItemCloth,
|
||||
Minecraft,tile.cloth.yellow,4,Yellow Wool,net.minecraft.item.ItemCloth,
|
||||
Minecraft,tile.cloth.lime,5,Lime Wool,net.minecraft.item.ItemCloth,
|
||||
Minecraft,tile.cloth.pink,6,Pink Wool,net.minecraft.item.ItemCloth,
|
||||
Minecraft,tile.cloth.gray,7,Gray Wool,net.minecraft.item.ItemCloth,
|
||||
Minecraft,tile.cloth.silver,8,Light Gray Wool,net.minecraft.item.ItemCloth,
|
||||
Minecraft,tile.cloth.cyan,9,Cyan Wool,net.minecraft.item.ItemCloth,
|
||||
Minecraft,tile.cloth.purple,10,Purple Wool,net.minecraft.item.ItemCloth,
|
||||
Minecraft,tile.cloth.blue,11,Blue Wool,net.minecraft.item.ItemCloth,
|
||||
Minecraft,tile.cloth.brown,12,Brown Wool,net.minecraft.item.ItemCloth,
|
||||
Minecraft,tile.cloth.green,13,Green Wool,net.minecraft.item.ItemCloth,
|
||||
Minecraft,tile.cloth.red,14,Red Wool,net.minecraft.item.ItemCloth,
|
||||
Minecraft,tile.cloth.black,15,Black Wool,net.minecraft.item.ItemCloth,
|
||||
Minecraft,tile.flower,0,Flower,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.rose,0,Rose,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.mushroom,0,Mushroom,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.mushroom,0,Mushroom,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.blockGold,0,Block of Gold,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.blockIron,0,Block of Iron,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.stoneSlab.stone,0,Stone Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.sand,1,Sandstone Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.wood,2,Wooden Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.cobble,3,Cobblestone Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.brick,4,Bricks Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.smoothStoneBrick,5,Stone Bricks Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.netherBrick,6,Nether Brick Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.quartz,7,Quartz Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.stone,8,Stone Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.stone,9,Stone Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.stone,10,Stone Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.stone,11,Stone Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.stone,12,Stone Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.stone,13,Stone Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.stone,14,Stone Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.stone,15,Stone Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.stone,0,Stone Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.sand,1,Sandstone Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.cobble,3,Cobblestone Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.brick,4,Bricks Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.smoothStoneBrick,5,Stone Bricks Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.netherBrick,6,Nether Brick Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.stoneSlab.quartz,7,Quartz Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.brick,0,Bricks,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.tnt,0,TNT,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.bookshelf,0,Bookshelf,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.stoneMoss,0,Moss Stone,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.obsidian,0,Obsidian,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.torch,0,Torch,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.fire,0,Fire,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.mobSpawner,90,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,50,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,51,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,52,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,53,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,54,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,55,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,56,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,57,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,58,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,59,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,60,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,61,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,62,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,64,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,65,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,66,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,91,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,92,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,93,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,94,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,95,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,96,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,97,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,98,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,99,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.mobSpawner,120,Monster Spawner,codechicken.nei.ItemMobSpawner,
|
||||
Minecraft,tile.stairsWood,0,Oak Wood Stairs,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.chest,0,Chest,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.oreDiamond,0,Diamond Ore,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.blockDiamond,0,Block of Diamond,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.workbench,0,Crafting Table,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.farmland,0,Farmland,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.furnace,0,Furnace,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.ladder,0,Ladder,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.rail,0,Rail,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.stairsStone,0,Stone Stairs,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.lever,0,Lever,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.pressurePlate,0,Pressure Plate,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.pressurePlate,0,Pressure Plate,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.oreRedstone,0,Redstone Ore,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.notGate,0,Redstone Torch,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.button,0,Button,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.snow,0,Snow,net.minecraft.item.ItemSnow,
|
||||
Minecraft,tile.ice,0,Ice,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.snow,0,Snow,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.cactus,0,Cactus,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.clay,0,Clay,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.jukebox,0,Jukebox,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.fence,0,Fence,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.pumpkin,0,Pumpkin,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.hellrock,0,Netherrack,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.hellsand,0,Soul Sand,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.lightgem,0,Glowstone,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.portal,0,Portal,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.litpumpkin,0,Jack 'o' Lantern,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.cake,0,Cake,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.lockedchest,0,Locked chest,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.trapdoor,0,Trapdoor,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.monsterStoneEgg.stone,0,Stone Monster Egg,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.monsterStoneEgg.cobble,1,Cobblestone Monster Egg,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.monsterStoneEgg.brick,2,Stone Brick Monster Egg,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.stonebricksmooth.default,0,Stone Bricks,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.stonebricksmooth.mossy,1,Mossy Stone Bricks,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.stonebricksmooth.cracked,2,Cracked Stone Bricks,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.stonebricksmooth.chiseled,3,Chiseled Stone Bricks,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.mushroom,0,Mushroom,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.mushroom,0,Mushroom,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.fenceIron,0,Iron Bars,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.thinGlass,0,Glass Pane,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.melon,0,Melon,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.vine,0,Vines,net.minecraft.item.ItemColored,
|
||||
Minecraft,tile.fenceGate,0,Fence Gate,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.stairsBrick,0,Brick Stairs,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.stairsStoneBrickSmooth,0,Stone Brick Stairs,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.mycel,0,Mycelium,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.waterlily,0,Lily Pad,net.minecraft.item.ItemLilyPad,
|
||||
Minecraft,tile.netherBrick,0,Nether Brick,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.netherFence,0,Nether Brick Fence,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.stairsNetherBrick,0,Nether Brick Stairs,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.enchantmentTable,0,Enchantment Table,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.null,0,,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.endPortalFrame,0,End Portal,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.whiteStone,0,End Stone,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.dragonEgg,0,Dragon Egg,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.redstoneLight,0,Redstone Lamp,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.woodSlab.oak,0,Oak Wood Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.woodSlab.spruce,1,Spruce Wood Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.woodSlab.birch,2,Birch Wood Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.woodSlab.jungle,3,Jungle Wood Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.woodSlab.oak,9,Oak Wood Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.woodSlab.oak,10,Oak Wood Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.woodSlab.oak,11,Oak Wood Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.woodSlab.oak,0,Oak Wood Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.woodSlab.spruce,1,Spruce Wood Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.woodSlab.birch,2,Birch Wood Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.woodSlab.jungle,3,Jungle Wood Slab,net.minecraft.item.ItemSlab,
|
||||
Minecraft,tile.cocoa,0,Cocoa,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.stairsSandStone,0,Sandstone Stairs,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.oreEmerald,0,Emerald Ore,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.tripWireSource,0,Tripwire Hook,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.blockEmerald,0,Block of Emerald,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.stairsWoodSpruce,0,Spruce Wood Stairs,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.stairsWoodBirch,0,Birch Wood Stairs,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.stairsWoodJungle,0,Jungle Wood Stairs,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.commandBlock,0,Command Block,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.beacon,0,Beacon,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.cobbleWall.normal,0,Cobblestone Wall,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.cobbleWall.mossy,1,Mossy Cobblestone Wall,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.button,0,Button,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.anvil.intact,0,Anvil,net.minecraft.item.ItemAnvilBlock,
|
||||
Minecraft,tile.anvil.slightlyDamaged,1,Slightly Damaged Anvil,net.minecraft.item.ItemAnvilBlock,
|
||||
Minecraft,tile.anvil.veryDamaged,2,Very Damaged Anvil,net.minecraft.item.ItemAnvilBlock,
|
||||
Minecraft,tile.chestTrap,0,Trapped Chest,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.weightedPlate_light,0,Weighted Pressure Plate (Light),net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.weightedPlate_heavy,0,Weighted Pressure Plate (Heavy),net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.comparator,0,,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.comparator,0,,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.daylightDetector,0,Daylight Sensor,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.blockRedstone,0,Block of Redstone,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.netherquartz,0,Nether Quartz Ore,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.hopper,0,Hopper,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.quartzBlock.default,0,Block of Quartz,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.quartzBlock.chiseled,1,Chiseled Quartz Block,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.quartzBlock.lines,2,Pillar Quartz Block,net.minecraft.item.ItemMultiTextureTile,
|
||||
Minecraft,tile.stairsQuartz,0,Quartz Stairs,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.activatorRail,0,Activator Rail,net.minecraft.item.ItemBlock,
|
||||
Minecraft,tile.dropper,0,Dropper,net.minecraft.item.ItemBlock,
|
||||
EnderStorage,tile.enderchest|0,0,Ender Chest,codechicken.enderstorage.common.ItemEnderStorage,
|
||||
EnderStorage,tile.enderchest|1,4096,Ender Tank,codechicken.enderstorage.common.ItemEnderStorage,
|
||||
Minecraft,item.shovelIron,0,Iron Shovel,net.minecraft.item.ItemSpade,
|
||||
Minecraft,item.pickaxeIron,0,Iron Pickaxe,net.minecraft.item.ItemPickaxe,
|
||||
Minecraft,item.hatchetIron,0,Iron Axe,net.minecraft.item.ItemAxe,
|
||||
Minecraft,item.flintAndSteel,0,Flint and Steel,net.minecraft.item.ItemFlintAndSteel,
|
||||
Minecraft,item.apple,0,Apple,net.minecraft.item.ItemFood,
|
||||
Minecraft,item.bow,0,Bow,net.minecraft.item.ItemBow,
|
||||
Minecraft,item.arrow,0,Arrow,net.minecraft.item.Item,
|
||||
Minecraft,item.coal,0,Coal,net.minecraft.item.ItemCoal,
|
||||
Minecraft,item.charcoal,1,Charcoal,net.minecraft.item.ItemCoal,
|
||||
Minecraft,item.diamond,0,Diamond,net.minecraft.item.Item,
|
||||
Minecraft,item.ingotIron,0,Iron Ingot,net.minecraft.item.Item,
|
||||
Minecraft,item.ingotGold,0,Gold Ingot,net.minecraft.item.Item,
|
||||
Minecraft,item.swordIron,0,Iron Sword,net.minecraft.item.ItemSword,
|
||||
Minecraft,item.swordWood,0,Wooden Sword,net.minecraft.item.ItemSword,
|
||||
Minecraft,item.shovelWood,0,Wooden Shovel,net.minecraft.item.ItemSpade,
|
||||
Minecraft,item.pickaxeWood,0,Wooden Pickaxe,net.minecraft.item.ItemPickaxe,
|
||||
Minecraft,item.hatchetWood,0,Wooden Axe,net.minecraft.item.ItemAxe,
|
||||
Minecraft,item.swordStone,0,Stone Sword,net.minecraft.item.ItemSword,
|
||||
Minecraft,item.shovelStone,0,Stone Shovel,net.minecraft.item.ItemSpade,
|
||||
Minecraft,item.pickaxeStone,0,Stone Pickaxe,net.minecraft.item.ItemPickaxe,
|
||||
Minecraft,item.hatchetStone,0,Stone Axe,net.minecraft.item.ItemAxe,
|
||||
Minecraft,item.swordDiamond,0,Diamond Sword,net.minecraft.item.ItemSword,
|
||||
Minecraft,item.shovelDiamond,0,Diamond Shovel,net.minecraft.item.ItemSpade,
|
||||
Minecraft,item.pickaxeDiamond,0,Diamond Pickaxe,net.minecraft.item.ItemPickaxe,
|
||||
Minecraft,item.hatchetDiamond,0,Diamond Axe,net.minecraft.item.ItemAxe,
|
||||
Minecraft,item.stick,0,Stick,net.minecraft.item.Item,
|
||||
Minecraft,item.bowl,0,Bowl,net.minecraft.item.Item,
|
||||
Minecraft,item.mushroomStew,0,Mushroom Stew,net.minecraft.item.ItemSoup,
|
||||
Minecraft,item.swordGold,0,Golden Sword,net.minecraft.item.ItemSword,
|
||||
Minecraft,item.shovelGold,0,Golden Shovel,net.minecraft.item.ItemSpade,
|
||||
Minecraft,item.pickaxeGold,0,Golden Pickaxe,net.minecraft.item.ItemPickaxe,
|
||||
Minecraft,item.hatchetGold,0,Golden Axe,net.minecraft.item.ItemAxe,
|
||||
Minecraft,item.string,0,String,net.minecraft.item.ItemReed,
|
||||
Minecraft,item.feather,0,Feather,net.minecraft.item.Item,
|
||||
Minecraft,item.sulphur,0,Gunpowder,net.minecraft.item.Item,
|
||||
Minecraft,item.hoeWood,0,Wooden Hoe,net.minecraft.item.ItemHoe,
|
||||
Minecraft,item.hoeStone,0,Stone Hoe,net.minecraft.item.ItemHoe,
|
||||
Minecraft,item.hoeIron,0,Iron Hoe,net.minecraft.item.ItemHoe,
|
||||
Minecraft,item.hoeDiamond,0,Diamond Hoe,net.minecraft.item.ItemHoe,
|
||||
Minecraft,item.hoeGold,0,Golden Hoe,net.minecraft.item.ItemHoe,
|
||||
Minecraft,item.seeds,0,Seeds,net.minecraft.item.ItemSeeds,
|
||||
Minecraft,item.wheat,0,Wheat,net.minecraft.item.Item,
|
||||
Minecraft,item.bread,0,Bread,net.minecraft.item.ItemFood,
|
||||
Minecraft,item.helmetCloth,0,Leather Cap,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.chestplateCloth,0,Leather Tunic,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.leggingsCloth,0,Leather Pants,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.bootsCloth,0,Leather Boots,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.helmetChain,0,Chain Helmet,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.chestplateChain,0,Chain Chestplate,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.leggingsChain,0,Chain Leggings,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.bootsChain,0,Chain Boots,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.helmetIron,0,Iron Helmet,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.chestplateIron,0,Iron Chestplate,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.leggingsIron,0,Iron Leggings,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.bootsIron,0,Iron Boots,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.helmetDiamond,0,Diamond Helmet,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.chestplateDiamond,0,Diamond Chestplate,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.leggingsDiamond,0,Diamond Leggings,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.bootsDiamond,0,Diamond Boots,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.helmetGold,0,Golden Helmet,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.chestplateGold,0,Golden Chestplate,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.leggingsGold,0,Golden Leggings,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.bootsGold,0,Golden Boots,net.minecraft.item.ItemArmor,
|
||||
Minecraft,item.flint,0,Flint,net.minecraft.item.Item,
|
||||
Minecraft,item.porkchopRaw,0,Raw Porkchop,net.minecraft.item.ItemFood,
|
||||
Minecraft,item.porkchopCooked,0,Cooked Porkchop,net.minecraft.item.ItemFood,
|
||||
Minecraft,item.painting,0,Painting,net.minecraft.item.ItemHangingEntity,
|
||||
Minecraft,item.appleGold,0,Golden Apple,net.minecraft.item.ItemAppleGold,
|
||||
Minecraft,item.sign,0,Sign,net.minecraft.item.ItemSign,
|
||||
Minecraft,item.doorWood,0,Wooden Door,net.minecraft.item.ItemDoor,
|
||||
Minecraft,item.bucket,0,Bucket,net.minecraft.item.ItemBucket,
|
||||
Minecraft,item.bucketWater,0,Water Bucket,net.minecraft.item.ItemBucket,
|
||||
Minecraft,item.bucketLava,0,Lava Bucket,net.minecraft.item.ItemBucket,
|
||||
Minecraft,item.minecart,0,Minecart,net.minecraft.item.ItemMinecart,
|
||||
Minecraft,item.saddle,0,Saddle,net.minecraft.item.ItemSaddle,
|
||||
Minecraft,item.doorIron,0,Iron Door,net.minecraft.item.ItemDoor,
|
||||
Minecraft,item.redstone,0,Redstone,net.minecraft.item.ItemRedstone,
|
||||
Minecraft,item.snowball,0,Snowball,net.minecraft.item.ItemSnowball,
|
||||
Minecraft,item.boat,0,Boat,net.minecraft.item.ItemBoat,
|
||||
Minecraft,item.leather,0,Leather,net.minecraft.item.Item,
|
||||
Minecraft,item.milk,0,Milk,net.minecraft.item.ItemBucketMilk,
|
||||
Minecraft,item.brick,0,Brick,net.minecraft.item.Item,
|
||||
Minecraft,item.clay,0,Clay,net.minecraft.item.Item,
|
||||
Minecraft,item.reeds,0,Sugar Canes,net.minecraft.item.ItemReed,
|
||||
Minecraft,item.paper,0,Paper,net.minecraft.item.Item,
|
||||
Minecraft,item.book,0,Book,net.minecraft.item.ItemBook,
|
||||
Minecraft,item.slimeball,0,Slimeball,net.minecraft.item.Item,
|
||||
Minecraft,item.minecartChest,0,Minecart with Chest,net.minecraft.item.ItemMinecart,
|
||||
Minecraft,item.minecartFurnace,0,Minecart with Furnace,net.minecraft.item.ItemMinecart,
|
||||
Minecraft,item.egg,0,Egg,net.minecraft.item.ItemEgg,
|
||||
Minecraft,item.compass,0,Compass,net.minecraft.item.Item,
|
||||
Minecraft,item.fishingRod,0,Fishing Rod,net.minecraft.item.ItemFishingRod,
|
||||
Minecraft,item.clock,0,Clock,net.minecraft.item.Item,
|
||||
Minecraft,item.yellowDust,0,Glowstone Dust,net.minecraft.item.Item,
|
||||
Minecraft,item.fishRaw,0,Raw Fish,net.minecraft.item.ItemFood,
|
||||
Minecraft,item.fishCooked,0,Cooked Fish,net.minecraft.item.ItemFood,
|
||||
Minecraft,item.dyePowder.black,0,Ink Sac,net.minecraft.item.ItemDye,
|
||||
Minecraft,item.dyePowder.red,1,Rose Red,net.minecraft.item.ItemDye,
|
||||
Minecraft,item.dyePowder.green,2,Cactus Green,net.minecraft.item.ItemDye,
|
||||
Minecraft,item.dyePowder.brown,3,Cocoa Beans,net.minecraft.item.ItemDye,
|
||||
Minecraft,item.dyePowder.blue,4,Lapis Lazuli,net.minecraft.item.ItemDye,
|
||||
Minecraft,item.dyePowder.purple,5,Purple Dye,net.minecraft.item.ItemDye,
|
||||
Minecraft,item.dyePowder.cyan,6,Cyan Dye,net.minecraft.item.ItemDye,
|
||||
Minecraft,item.dyePowder.silver,7,Light Gray Dye,net.minecraft.item.ItemDye,
|
||||
Minecraft,item.dyePowder.gray,8,Gray Dye,net.minecraft.item.ItemDye,
|
||||
Minecraft,item.dyePowder.pink,9,Pink Dye,net.minecraft.item.ItemDye,
|
||||
Minecraft,item.dyePowder.lime,10,Lime Dye,net.minecraft.item.ItemDye,
|
||||
Minecraft,item.dyePowder.yellow,11,Dandelion Yellow,net.minecraft.item.ItemDye,
|
||||
Minecraft,item.dyePowder.lightBlue,12,Light Blue Dye,net.minecraft.item.ItemDye,
|
||||
Minecraft,item.dyePowder.magenta,13,Magenta Dye,net.minecraft.item.ItemDye,
|
||||
Minecraft,item.dyePowder.orange,14,Orange Dye,net.minecraft.item.ItemDye,
|
||||
Minecraft,item.dyePowder.white,15,Bone Meal,net.minecraft.item.ItemDye,
|
||||
Minecraft,item.bone,0,Bone,net.minecraft.item.Item,
|
||||
Minecraft,item.sugar,0,Sugar,net.minecraft.item.Item,
|
||||
Minecraft,item.cake,0,Cake,net.minecraft.item.ItemReed,
|
||||
Minecraft,item.bed,0,Bed,net.minecraft.item.ItemBed,
|
||||
Minecraft,item.diode,0,Redstone Repeater,net.minecraft.item.ItemReed,
|
||||
Minecraft,item.cookie,0,Cookie,net.minecraft.item.ItemFood,
|
||||
Minecraft,item.map,0,Map,net.minecraft.item.ItemMap,
|
||||
Minecraft,item.shears,0,Shears,net.minecraft.item.ItemShears,
|
||||
Minecraft,item.melon,0,Melon,net.minecraft.item.ItemFood,
|
||||
Minecraft,item.seeds_pumpkin,0,Pumpkin Seeds,net.minecraft.item.ItemSeeds,
|
||||
Minecraft,item.seeds_melon,0,Melon Seeds,net.minecraft.item.ItemSeeds,
|
||||
Minecraft,item.beefRaw,0,Raw Beef,net.minecraft.item.ItemFood,
|
||||
Minecraft,item.beefCooked,0,Steak,net.minecraft.item.ItemFood,
|
||||
Minecraft,item.chickenRaw,0,Raw Chicken,net.minecraft.item.ItemFood,
|
||||
Minecraft,item.chickenCooked,0,Cooked Chicken,net.minecraft.item.ItemFood,
|
||||
Minecraft,item.rottenFlesh,0,Rotten Flesh,net.minecraft.item.ItemFood,
|
||||
Minecraft,item.enderPearl,0,Ender Pearl,net.minecraft.item.ItemEnderPearl,
|
||||
Minecraft,item.blazeRod,0,Blaze Rod,net.minecraft.item.Item,
|
||||
Minecraft,item.ghastTear,0,Ghast Tear,net.minecraft.item.Item,
|
||||
Minecraft,item.goldNugget,0,Gold Nugget,net.minecraft.item.Item,
|
||||
Minecraft,item.netherStalkSeeds,0,Nether Wart,net.minecraft.item.ItemSeeds,
|
||||
Minecraft,item.potion,0,Water Bottle,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16,Awkward Potion,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,32,Thick Potion,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,64,Mundane Potion,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,8193,Potion of Regeneration,net.minecraft.item.ItemPotion,Potion of Regeneration
|
||||
Minecraft,item.potion,8194,Potion of Swiftness,net.minecraft.item.ItemPotion,Potion of Swiftness
|
||||
Minecraft,item.potion,8195,Potion of Fire Resistance,net.minecraft.item.ItemPotion,Potion of Fire Resistance
|
||||
Minecraft,item.potion,8196,Potion of Poison,net.minecraft.item.ItemPotion,Potion of Poison
|
||||
Minecraft,item.potion,8197,Potion of Healing,net.minecraft.item.ItemPotion,Potion of Healing
|
||||
Minecraft,item.potion,8198,Potion of Night Vision,net.minecraft.item.ItemPotion,Potion of Night Vision
|
||||
Minecraft,item.potion,8200,Potion of Weakness,net.minecraft.item.ItemPotion,Potion of Weakness
|
||||
Minecraft,item.potion,8201,Potion of Strength,net.minecraft.item.ItemPotion,Potion of Strength
|
||||
Minecraft,item.potion,8202,Potion of Slowness,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,8204,Potion of Harming,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,8206,Potion of Invisibility,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,8225,Potion of Regeneration,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,8226,Potion of Swiftness,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,8228,Potion of Poison,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,8229,Potion of Healing,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,8233,Potion of Strength,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,*,Potion of Harming,net.minecraft.item.ItemPotion,This is a generic potion entry
|
||||
Minecraft,item.potion,8257,Potion of Regeneration,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,8258,Potion of Swiftness,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,8259,Potion of Fire Resistance,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,8260,Potion of Poison,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,8262,Potion of Night Vision,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,8264,Potion of Weakness,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,8265,Potion of Strength,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,8266,Potion of Slowness,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,8270,Potion of Invisibility,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16384,Mundane Potion,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16385,Splash Potion of Regeneration,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16386,Splash Potion of Swiftness,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16387,Splash Potion of Fire Resistance,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16388,Splash Potion of Poison,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16389,Splash Potion of Healing,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16390,Splash Potion of Night Vision,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16392,Splash Potion of Weakness,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16393,Splash Potion of Strength,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16394,Splash Potion of Slowness,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16396,Splash Potion of Harming,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16398,Splash Potion of Invisibility,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16417,Splash Potion of Regeneration,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16418,Splash Potion of Swiftness,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16420,Splash Potion of Poison,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16421,Splash Potion of Healing,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16425,Splash Potion of Strength,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16428,Splash Potion of Harming,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16449,Splash Potion of Regeneration,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16450,Splash Potion of Swiftness,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16451,Splash Potion of Fire Resistance,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16452,Splash Potion of Poison,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16454,Splash Potion of Night Vision,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16456,Splash Potion of Weakness,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16457,Splash Potion of Strength,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16458,Splash Potion of Slowness,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.potion,16462,Splash Potion of Invisibility,net.minecraft.item.ItemPotion,
|
||||
Minecraft,item.glassBottle,0,Glass Bottle,net.minecraft.item.ItemGlassBottle,
|
||||
Minecraft,item.spiderEye,0,Spider Eye,net.minecraft.item.ItemFood,
|
||||
Minecraft,item.fermentedSpiderEye,0,Fermented Spider Eye,net.minecraft.item.Item,
|
||||
Minecraft,item.blazePowder,0,Blaze Powder,net.minecraft.item.Item,
|
||||
Minecraft,item.magmaCream,0,Magma Cream,net.minecraft.item.Item,
|
||||
Minecraft,item.brewingStand,0,Brewing Stand,net.minecraft.item.ItemReed,
|
||||
Minecraft,item.cauldron,0,Cauldron,net.minecraft.item.ItemReed,
|
||||
Minecraft,item.eyeOfEnder,0,Eye of Ender,net.minecraft.item.ItemEnderEye,
|
||||
Minecraft,item.speckledMelon,0,Glistering Melon,net.minecraft.item.Item,
|
||||
Minecraft,item.monsterPlacer,50,Spawn Creeper,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,51,Spawn Skeleton,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,52,Spawn Spider,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,54,Spawn Zombie,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,55,Spawn Slime,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,56,Spawn Ghast,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,57,Spawn Zombie Pigman,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,58,Spawn Enderman,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,59,Spawn Cave Spider,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,60,Spawn Silverfish,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,61,Spawn Blaze,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,62,Spawn Magma Cube,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,65,Spawn Bat,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,66,Spawn Witch,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,90,Spawn Pig,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,91,Spawn Sheep,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,92,Spawn Cow,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,93,Spawn Chicken,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,94,Spawn Squid,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,95,Spawn Wolf,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,96,Spawn Mooshroom,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,97,Spawn Snow Golem,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,98,Spawn Ocelot,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,99,Spawn Iron Golem,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.monsterPlacer,120,Spawn Villager,net.minecraft.item.ItemMonsterPlacer,
|
||||
Minecraft,item.expBottle,0,Bottle o' Enchanting,net.minecraft.item.ItemExpBottle,
|
||||
Minecraft,item.fireball,0,Fire Charge,net.minecraft.item.ItemFireball,
|
||||
Minecraft,item.writingBook,0,Book and Quill,net.minecraft.item.ItemWritableBook,
|
||||
Minecraft,item.writtenBook,0,Written Book,net.minecraft.item.ItemEditableBook,
|
||||
Minecraft,item.emerald,0,Emerald,net.minecraft.item.Item,
|
||||
Minecraft,item.frame,0,Item Frame,net.minecraft.item.ItemHangingEntity,
|
||||
Minecraft,item.flowerPot,0,Flower Pot,net.minecraft.item.ItemReed,
|
||||
Minecraft,item.carrots,0,Carrot,net.minecraft.item.ItemSeedFood,
|
||||
Minecraft,item.potato,0,Potato,net.minecraft.item.ItemSeedFood,
|
||||
Minecraft,item.potatoBaked,0,Baked Potato,net.minecraft.item.ItemFood,
|
||||
Minecraft,item.potatoPoisonous,0,Poisonous Potato,net.minecraft.item.ItemFood,
|
||||
Minecraft,item.emptyMap,0,Empty Map,net.minecraft.item.ItemEmptyMap,
|
||||
Minecraft,item.carrotGolden,0,Golden Carrot,net.minecraft.item.ItemFood,
|
||||
Minecraft,item.skull.skeleton,0,Skeleton Skull,net.minecraft.item.ItemSkull,
|
||||
Minecraft,item.skull.wither,1,Wither Skeleton Skull,net.minecraft.item.ItemSkull,
|
||||
Minecraft,item.skull.zombie,2,Zombie Head,net.minecraft.item.ItemSkull,
|
||||
Minecraft,item.skull.char,3,Head,net.minecraft.item.ItemSkull,
|
||||
Minecraft,item.skull.creeper,4,Creeper Head,net.minecraft.item.ItemSkull,
|
||||
Minecraft,item.carrotOnAStick,0,Carrot on a Stick,net.minecraft.item.ItemCarrotOnAStick,
|
||||
Minecraft,item.netherStar,0,Nether Star,net.minecraft.item.ItemSimpleFoiled,
|
||||
Minecraft,item.pumpkinPie,0,Pumpkin Pie,net.minecraft.item.ItemFood,
|
||||
Minecraft,item.fireworks,0,Firework Rocket,net.minecraft.item.ItemFirework,
|
||||
Minecraft,item.fireworksCharge,0,Firework Star,net.minecraft.item.ItemFireworkCharge,
|
||||
Minecraft,item.enchantedBook,0,Enchanted Book,net.minecraft.item.ItemEnchantedBook,
|
||||
Minecraft,item.comparator,0,Redstone Comparator,net.minecraft.item.ItemReed,
|
||||
Minecraft,item.netherbrick,0,Nether Brick,net.minecraft.item.Item,
|
||||
Minecraft,item.netherquartz,0,Nether Quartz,net.minecraft.item.Item,
|
||||
Minecraft,item.minecartTnt,0,Minecart with TNT,net.minecraft.item.ItemMinecart,
|
||||
Minecraft,item.minecartHopper,0,Minecart with Hopper,net.minecraft.item.ItemMinecart,
|
||||
BuildCraft|Factory,tile.miningWellBlock,0,Mining Well,buildcraft.core.ItemBlockBuildCraft,
|
||||
BuildCraft|Factory,tile.plainPipeBlock,0,Mining Pipe,buildcraft.core.ItemBlockBuildCraft,
|
||||
BuildCraft|Factory,tile.autoWorkbenchBlock,0,Autocrafting Table,buildcraft.core.ItemBlockBuildCraft,
|
||||
BuildCraft|Factory,tile.machineBlock,0,Quarry,buildcraft.core.ItemBlockBuildCraft,
|
||||
BuildCraft|Builders,tile.markerBlock,0,Land Mark,buildcraft.core.ItemBlockBuildCraft,
|
||||
BuildCraft|Builders,tile.fillerBlock,0,Filler,buildcraft.core.ItemBlockBuildCraft,
|
||||
BuildCraft|Builders,tile.builderBlock,0,Builder,buildcraft.core.ItemBlockBuildCraft,
|
||||
BuildCraft|Builders,tile.architectBlock,0,Architect Table,buildcraft.core.ItemBlockBuildCraft,
|
||||
BuildCraft|Factory,tile.frameBlock,0,Frame,buildcraft.core.ItemBlockBuildCraft,
|
||||
BuildCraft|Energy,tile.engineWood,0,Redstone Engine,buildcraft.energy.ItemEngine,
|
||||
BuildCraft|Energy,tile.engineStone,1,Stirling Engine,buildcraft.energy.ItemEngine,
|
||||
BuildCraft|Energy,tile.engineIron,2,Combustion Engine,buildcraft.energy.ItemEngine,
|
||||
BuildCraft|Factory,tile.pumpBlock,0,Pump,buildcraft.core.ItemBlockBuildCraft,
|
||||
BuildCraft|Factory,tile.tankBlock,0,Tank,buildcraft.core.ItemBlockBuildCraft,
|
||||
BuildCraft|Transport,tile.null,0,,net.minecraft.item.ItemBlock,
|
||||
BuildCraft|Factory,tile.refineryBlock,0,Refinery,buildcraft.core.ItemBlockBuildCraft,
|
||||
BuildCraft|Builders,tile.libraryBlock,0,Blueprint Library,buildcraft.core.ItemBlockBuildCraft,
|
||||
BuildCraft|Silicon,tile.laserBlock,0,Laser,buildcraft.core.ItemBlockBuildCraft,
|
||||
BuildCraft|Silicon,block.assemblyTableBlock,0,Assembly Table,buildcraft.silicon.ItemLaserTable,
|
||||
BuildCraft|Silicon,block.assemblyWorkbenchBlock,1,Advanced Crafting Table,buildcraft.silicon.ItemLaserTable,
|
||||
BuildCraft|Builders,tile.pathMarkerBlock,0,Path Marker,buildcraft.core.ItemBlockBuildCraft,
|
||||
BuildCraft|Factory,tile.blockHopper,0,Chute,buildcraft.core.ItemBlockBuildCraft,
|
||||
BuildCraft|Energy,tile.oilMoving,0,Oil,buildcraft.core.ItemBlockBuildCraft,
|
||||
BuildCraft|Energy,tile.oilStill,0,Oil,buildcraft.core.ItemBlockBuildCraft,
|
||||
BuildCraft|Core,tile.spring.water,0,Water Spring,buildcraft.core.ItemSpring,
|
||||
BuildCraft|Core,tile.spring.oil,1,Oil Spring,buildcraft.core.ItemSpring,
|
||||
Minecraft,item.record,0,Music Disc,net.minecraft.item.ItemRecord,
|
||||
Minecraft,item.record,0,Music Disc,net.minecraft.item.ItemRecord,
|
||||
Minecraft,item.record,0,Music Disc,net.minecraft.item.ItemRecord,
|
||||
Minecraft,item.record,0,Music Disc,net.minecraft.item.ItemRecord,
|
||||
Minecraft,item.record,0,Music Disc,net.minecraft.item.ItemRecord,
|
||||
Minecraft,item.record,0,Music Disc,net.minecraft.item.ItemRecord,
|
||||
Minecraft,item.record,0,Music Disc,net.minecraft.item.ItemRecord,
|
||||
Minecraft,item.record,0,Music Disc,net.minecraft.item.ItemRecord,
|
||||
Minecraft,item.record,0,Music Disc,net.minecraft.item.ItemRecord,
|
||||
Minecraft,item.record,0,Music Disc,net.minecraft.item.ItemRecord,
|
||||
Minecraft,item.record,0,Music Disc,net.minecraft.item.ItemRecord,
|
||||
Minecraft,item.record,0,Music Disc,net.minecraft.item.ItemRecord,
|
||||
EnderStorage,item.enderpouch,0,Ender Pouch,codechicken.enderstorage.storage.item.ItemEnderPouch,
|
||||
BuildCraft|Core,item.woodenGearItem,0,Wood Gear,buildcraft.core.ItemBuildCraft,
|
||||
BuildCraft|Core,item.stoneGearItem,0,Stone Gear,buildcraft.core.ItemBuildCraft,
|
||||
BuildCraft|Core,item.ironGearItem,0,Iron Gear,buildcraft.core.ItemBuildCraft,
|
||||
BuildCraft|Core,item.goldGearItem,0,Gold Gear,buildcraft.core.ItemBuildCraft,
|
||||
BuildCraft|Core,item.diamondGearItem,0,Diamond Gear,buildcraft.core.ItemBuildCraft,
|
||||
BuildCraft|Builders,item.templateItem,0,Template,buildcraft.builders.ItemBptTemplate,
|
||||
BuildCraft|Core,item.wrenchItem,0,Wrench,buildcraft.core.ItemWrench,
|
||||
BuildCraft|Energy,item.bucketOil,0,Oil Bucket,buildcraft.energy.ItemBucketOil,
|
||||
BuildCraft|Energy,item.fuel,0,Fuel,buildcraft.core.ItemBuildCraft,
|
||||
BuildCraft|Transport,item.pipeWaterproof,0,Pipe Waterproof,buildcraft.core.ItemBuildCraft,
|
||||
BuildCraft|Energy,item.bucketFuel,0,Fuel Bucket,buildcraft.core.ItemBuildCraft,
|
||||
BuildCraft|Transport,item.pipeGate.0,0,Gate,buildcraft.transport.ItemGate,
|
||||
BuildCraft|Transport,item.pipeGate.1,1,Iron AND Gate,buildcraft.transport.ItemGate,
|
||||
BuildCraft|Transport,item.pipeGate.2,2,Iron OR Gate,buildcraft.transport.ItemGate,
|
||||
BuildCraft|Transport,item.pipeGate.3,3,Gold AND Gate,buildcraft.transport.ItemGate,
|
||||
BuildCraft|Transport,item.pipeGate.4,4,Gold OR Gate,buildcraft.transport.ItemGate,
|
||||
BuildCraft|Transport,item.pipeGate.5,5,Diamond AND Gate,buildcraft.transport.ItemGate,
|
||||
BuildCraft|Transport,item.pipeGate.6,6,Diamond OR Gate,buildcraft.transport.ItemGate,
|
||||
BuildCraft|Transport,item.redPipeWire,0,Red Pipe Wire,buildcraft.core.ItemBuildCraft,
|
||||
BuildCraft|Transport,item.bluePipeWire,0,Blue Pipe Wire,buildcraft.core.ItemBuildCraft,
|
||||
BuildCraft|Transport,item.greenPipeWire,0,Green Pipe Wire,buildcraft.core.ItemBuildCraft,
|
||||
BuildCraft|Transport,item.yellowPipeWire,0,Yellow Pipe Wire,buildcraft.core.ItemBuildCraft,
|
||||
BuildCraft|Silicon,item.redstoneChipset.0,0,Redstone Chipset,buildcraft.core.ItemRedstoneChipset,
|
||||
BuildCraft|Silicon,item.redstoneChipset.1,1,Redstone Iron Chipset,buildcraft.core.ItemRedstoneChipset,
|
||||
BuildCraft|Silicon,item.redstoneChipset.2,2,Redstone Golden Chipset,buildcraft.core.ItemRedstoneChipset,
|
||||
BuildCraft|Silicon,item.redstoneChipset.3,3,Redstone Diamond Chipset,buildcraft.core.ItemRedstoneChipset,
|
||||
BuildCraft|Silicon,item.redstoneChipset.4,4,Pulsating Chipset,buildcraft.core.ItemRedstoneChipset,
|
||||
BuildCraft|Builders,item.blueprintItem,0,Blueprint,buildcraft.builders.ItemBptBluePrint,
|
||||
BuildCraft|Transport,item.pipeGateAutarchic.0,0,Autarchic Gate,buildcraft.transport.ItemGate,
|
||||
BuildCraft|Transport,item.pipeGateAutarchic.1,1,Autarchic Iron AND Gate,buildcraft.transport.ItemGate,
|
||||
BuildCraft|Transport,item.pipeGateAutarchic.2,2,Autarchic Iron OR Gate,buildcraft.transport.ItemGate,
|
||||
BuildCraft|Transport,item.pipeGateAutarchic.3,3,Autarchic Gold AND Gate,buildcraft.transport.ItemGate,
|
||||
BuildCraft|Transport,item.pipeGateAutarchic.4,4,Autarchic Gold OR Gate,buildcraft.transport.ItemGate,
|
||||
BuildCraft|Transport,item.pipeGateAutarchic.5,5,Autarchic Diamond AND Gate,buildcraft.transport.ItemGate,
|
||||
BuildCraft|Transport,item.pipeGateAutarchic.6,6,Autarchic Diamond OR Gate,buildcraft.transport.ItemGate,
|
||||
BuildCraft|Transport,item.Facade,16,Facade: Stone,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,48,Facade: Dirt,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,64,Facade: Cobblestone,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,80,Facade: Oak Wood Planks,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,81,Facade: Spruce Wood Planks,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,82,Facade: Birch Wood Planks,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,83,Facade: Jungle Wood Planks,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,192,Facade: Sand,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,208,Facade: Gravel,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,224,Facade: Gold Ore,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,240,Facade: Iron Ore,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,256,Facade: Coal Ore,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,272,Facade: Oak Wood,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,273,Facade: Spruce Wood,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,274,Facade: Birch Wood,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,275,Facade: Jungle Wood,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,320,Facade: Glass,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,336,Facade: Lapis Lazuli Ore,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,352,Facade: Lapis Lazuli Block,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,384,Facade: Sandstone,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,385,Facade: Chiseled Sandstone,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,386,Facade: Smooth Sandstone,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,560,Facade: Wool,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,561,Facade: Orange Wool,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,562,Facade: Magenta Wool,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,563,Facade: Light Blue Wool,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,564,Facade: Yellow Wool,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,565,Facade: Lime Wool,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,566,Facade: Pink Wool,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,567,Facade: Gray Wool,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,568,Facade: Light Gray Wool,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,569,Facade: Cyan Wool,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,570,Facade: Purple Wool,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,571,Facade: Blue Wool,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,572,Facade: Brown Wool,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,573,Facade: Green Wool,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,574,Facade: Red Wool,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,575,Facade: Black Wool,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,656,Facade: Block of Gold,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,672,Facade: Block of Iron,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,688,Facade: Stone Slab,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,689,Facade: Sandstone Slab,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,690,Facade: Wooden Slab,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,691,Facade: Cobblestone Slab,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,692,Facade: Bricks Slab,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,693,Facade: Stone Bricks Slab,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,694,Facade: Nether Brick Slab,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,695,Facade: Quartz Slab,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,720,Facade: Bricks,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,736,Facade: TNT,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,752,Facade: Bookshelf,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,768,Facade: Moss Stone,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,784,Facade: Obsidian,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,896,Facade: Diamond Ore,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,912,Facade: Block of Diamond,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,928,Facade: Crafting Table,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1168,Facade: Redstone Ore,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1280,Facade: Snow,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1312,Facade: Clay,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1376,Facade: Pumpkin,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1392,Facade: Netherrack,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1408,Facade: Soul Sand,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1424,Facade: Glowstone,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1456,Facade: Jack 'o' Lantern,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1552,Facade: Stone Monster Egg,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1553,Facade: Cobblestone Monster Egg,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1554,Facade: Stone Brick Monster Egg,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1568,Facade: Stone Bricks,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1569,Facade: Mossy Stone Bricks,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1570,Facade: Cracked Stone Bricks,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1571,Facade: Chiseled Stone Bricks,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1584,Facade: Mushroom,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1648,Facade: Melon,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1760,Facade: Mycelium,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1792,Facade: Nether Brick,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1936,Facade: End Stone,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,1968,Facade: Redstone Lamp,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,2000,Facade: Oak Wood Slab,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,2001,Facade: Spruce Wood Slab,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,2002,Facade: Birch Wood Slab,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,2003,Facade: Jungle Wood Slab,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,2064,Facade: Emerald Ore,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,2128,Facade: Block of Emerald,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,2432,Facade: Block of Redstone,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,2448,Facade: Nether Quartz Ore,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,2480,Facade: Block of Quartz,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,2481,Facade: Chiseled Quartz Block,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.Facade,2482,Facade: Pillar Quartz Block,buildcraft.transport.ItemFacade,
|
||||
BuildCraft|Transport,item.PipePlug,0,Pipe Plug,buildcraft.transport.ItemPlug,
|
||||
BuildCraft|Transport,item.PipeItemsWood,0,Wooden Transport Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipeItemsCobblestone,0,Cobblestone Transport Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipeItemsStone,0,Stone Transport Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipeItemsIron,0,Iron Transport Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipeItemsGold,0,Golden Transport Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipeItemsDiamond,0,Diamond Transport Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipeItemsObsidian,0,Obsidian Transport Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipeItemsEmerald,0,Emerald Transport Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipeLiquidsWood,0,Wooden Waterproof Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipeLiquidsCobblestone,0,Cobblestone Waterproof Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipeLiquidsStone,0,Stone Waterproof Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipeLiquidsIron,0,Iron Waterproof Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipeLiquidsGold,0,Golden Waterproof Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipeLiquidsEmerald,0,Emerald Waterproof Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipePowerWood,0,Wooden Conductive Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipePowerStone,0,Stone Conductive Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipePowerGold,0,Golden Conductive Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipeItemsVoid,0,Void Transport Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipeLiquidsVoid,0,Void Waterproof Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipeItemsSandstone,0,Sandstone Transport Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipeLiquidsSandstone,0,Sandstone Waterproof Pipe,buildcraft.transport.ItemPipe,
|
||||
BuildCraft|Transport,item.PipeStructureCobblestone,0,Cobblestone Structure Pipe,buildcraft.transport.ItemPipe,
|
||||
|
@@ -0,0 +1,13 @@
|
||||
>>>>tile.stone
|
||||
This is basic stone.
|
||||
>>>>item.swordDiamond
|
||||
This is a diamond sword.
|
||||
Good at killing zombies and creepers.
|
||||
>>>>item.pickaxeWood
|
||||
Your very first pickaxe.
|
||||
Not good at anything, beside getting splinters.
|
||||
>>>>item.pickaxeDiamond
|
||||
The ultimate pickaxe, made out of refined diamonds.
|
||||
Shinnnnyyyy.
|
||||
>>>>item.pickaxeIron
|
||||
Sturdy, solid, efficient. Your best friend.
|
||||
@@ -0,0 +1,5 @@
|
||||
Minecraft,tile.stone,,,This is basic stone.
|
||||
Minecraft,item.swordDiamond,,,This is a diamond sword.$Good at killing zombies and creepers.
|
||||
Minecraft,item.pickaxeWood,,,"Your very first pickaxe.$Not good at anything, beside getting splinters."
|
||||
Minecraft,item.pickaxeDiamond,,,"The ultimate pickaxe, made out of refined diamonds."
|
||||
Minecraft,item.pickaxeIron,,,"Sturdy, solid, efficient. Your best friend."
|
||||
|
@@ -2,12 +2,7 @@ package mcp.mobius.waila.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IWailaBlock {
|
||||
/*
|
||||
@@ -34,4 +29,5 @@ public interface IWailaBlock {
|
||||
|
||||
List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
|
||||
List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
|
||||
List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package mcp.mobius.waila.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IWailaBlockDecorator {
|
||||
|
||||
void decorateBlock(ItemStack itemStack, IWailaDataAccessor accessor, IWailaConfigHandler config);
|
||||
|
||||
}
|
||||
@@ -23,4 +23,6 @@ public interface IWailaConfigHandler {
|
||||
|
||||
/* Returns the current value of an option (true/false) with a default value true if not set*/
|
||||
public boolean getConfig(String key);
|
||||
|
||||
public void setConfig(String key, boolean value);
|
||||
}
|
||||
@@ -1,23 +1,23 @@
|
||||
package mcp.mobius.waila.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IWailaDataAccessor {
|
||||
World getWorld();
|
||||
EntityPlayer getPlayer();
|
||||
Block getBlock();
|
||||
int getBlockID();
|
||||
int getMetadata();
|
||||
World getWorld();
|
||||
EntityPlayer getPlayer();
|
||||
Block getBlock();
|
||||
int getBlockID();
|
||||
int getMetadata();
|
||||
TileEntity getTileEntity();
|
||||
MovingObjectPosition getPosition();
|
||||
Vec3 getRenderingPosition();
|
||||
NBTTagCompound getNBTData();
|
||||
int getNBTInteger(NBTTagCompound tag, String keyname);
|
||||
int getNBTInteger(NBTTagCompound tag, String keyname);
|
||||
double getPartialFrame();
|
||||
}
|
||||
@@ -4,16 +4,28 @@ public interface IWailaRegistrar {
|
||||
/* Add a config option in the section modname with displayed text configtext and access key keyname */
|
||||
public void addConfig(String modname, String keyname, String configtext);
|
||||
public void addConfigRemote(String modname, String keyname, String configtext);
|
||||
public void addConfig(String modname, String keyname);
|
||||
public void addConfigRemote(String modname, String keyname);
|
||||
|
||||
/* Register a IWailaDataProvider for the given blockID, either for the Head section or the Body section */
|
||||
public void registerHeadProvider (IWailaDataProvider dataProvider, int blockID);
|
||||
public void registerBodyProvider (IWailaDataProvider dataProvider, int blockID);
|
||||
public void registerTailProvider (IWailaDataProvider dataProvider, int blockID);
|
||||
|
||||
/* Register a stack overrider for the given blockID */
|
||||
public void registerStackProvider(IWailaDataProvider dataProvider, int blockID);
|
||||
|
||||
public void registerStackProvider(IWailaDataProvider dataProvider, Class block);
|
||||
|
||||
/* Same thing, but works on a class hierarchy instead */
|
||||
public void registerHeadProvider (IWailaDataProvider dataProvider, Class block);
|
||||
public void registerBodyProvider (IWailaDataProvider dataProvider, Class block);
|
||||
public void registerTailProvider (IWailaDataProvider dataProvider, Class block);
|
||||
|
||||
/* The block decorators */
|
||||
public void registerBlockDecorator (IWailaBlockDecorator decorator, int blockID);
|
||||
public void registerBlockDecorator (IWailaBlockDecorator decorator, Class block);
|
||||
|
||||
public void registerDocTextFile (String filename);
|
||||
|
||||
public void registerShortDataProvider (IWailaSummaryProvider dataProvider, Class item);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package mcp.mobius.waila.api;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IWailaSummaryProvider {
|
||||
/* This interface is used to control the display data in the description screen */
|
||||
|
||||
/* BASIC TOOLS & ITEMS DATA */
|
||||
//EnumToolMaterial getMaterial(ItemStack stack);
|
||||
//String getMaterialName(ItemStack stack);
|
||||
//String getEffectiveBlock(ItemStack stack);
|
||||
//int getHarvestLevel(ItemStack stack);
|
||||
//float getEfficiencyOnProperMaterial(ItemStack stack);
|
||||
//int getEnchantability(ItemStack stack);
|
||||
//int getDamageVsEntity(ItemStack stack);
|
||||
//int getDurability(ItemStack stack);
|
||||
|
||||
LinkedHashMap<String, String> getSummary(ItemStack stack, LinkedHashMap<String, String> currentSummary, IWailaConfigHandler config);
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
package mcp.mobius.waila.client;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import mcp.mobius.waila.Constants;
|
||||
import mcp.mobius.waila.addons.ConfigHandler;
|
||||
import mcp.mobius.waila.gui.screens.config.ScreenConfig;
|
||||
import mcp.mobius.waila.gui.screens.info.ScreenEnchants;
|
||||
import mcp.mobius.waila.handlers.nei.HandlerEnchants;
|
||||
import mcp.mobius.waila.overlay.RayTracing;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumMovingObjectType;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.forge.GuiContainerManager;
|
||||
import codechicken.nei.recipe.GuiCraftingRecipe;
|
||||
import codechicken.nei.recipe.GuiUsageRecipe;
|
||||
import cpw.mods.fml.client.registry.KeyBindingRegistry.KeyHandler;
|
||||
import cpw.mods.fml.common.TickType;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
|
||||
public class ConfigKeyHandler extends KeyHandler {
|
||||
|
||||
static boolean firstInventory = true;
|
||||
|
||||
public ConfigKeyHandler()
|
||||
{
|
||||
super(new KeyBinding[]{
|
||||
new KeyBinding(Constants.BIND_WAILA_CFG, Keyboard.KEY_NUMPAD0),
|
||||
new KeyBinding(Constants.BIND_WAILA_SHOW, Keyboard.KEY_NUMPAD1),
|
||||
new KeyBinding(Constants.BIND_WAILA_LIQUID, Keyboard.KEY_NUMPAD2),
|
||||
new KeyBinding(Constants.BIND_WAILA_RECIPE, Keyboard.KEY_NUMPAD3),
|
||||
new KeyBinding(Constants.BIND_WAILA_USAGE, Keyboard.KEY_NUMPAD4),
|
||||
//new KeyBinding(Constants.BIND_WAILA_TESTING, Keyboard.KEY_NUMPAD9),
|
||||
}, new boolean[]{
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
//false
|
||||
});
|
||||
|
||||
/*
|
||||
LanguageRegistry.instance().addStringLocalization(Constants.BIND_WAILA_CFG, LangUtil.translateG("keybind.configscreen"));
|
||||
LanguageRegistry.instance().addStringLocalization(Constants.BIND_WAILA_SHOW, LangUtil.translateG("keybind.showhide"));
|
||||
LanguageRegistry.instance().addStringLocalization(Constants.BIND_WAILA_LIQUID, LangUtil.translateG("keybind.showliquid"));
|
||||
LanguageRegistry.instance().addStringLocalization(Constants.BIND_WAILA_RECIPE, LangUtil.translateG("keybind.showrecipe"));
|
||||
LanguageRegistry.instance().addStringLocalization(Constants.BIND_WAILA_USAGE, LangUtil.translateG("keybind.showusage"));
|
||||
LanguageRegistry.instance().addStringLocalization(Constants.BIND_WAILA_TESTING, LangUtil.translateG("keybind.testing"));
|
||||
*/
|
||||
//LanguageRegistry.instance().addStringLocalization(Constants.BIND_SCREEN_ENCH, "[Waila] Show enchant screen");
|
||||
//LanguageRegistry.instance().addStringLocalization("key.wailatedump", "[Waila] Dump server TE");
|
||||
|
||||
GuiContainerManager.addInputHandler(new HandlerEnchants());
|
||||
API.addKeyBind(Constants.BIND_SCREEN_ENCH, Keyboard.KEY_I);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) {
|
||||
if (!tickEnd) return;
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if (kb.keyDescription == Constants.BIND_WAILA_CFG){
|
||||
if(mc.currentScreen == null)
|
||||
mc.displayGuiScreen(new ScreenConfig(mc.currentScreen));
|
||||
}
|
||||
|
||||
if (kb.keyDescription == Constants.BIND_WAILA_TESTING){
|
||||
if(mc.currentScreen == null)
|
||||
mc.displayGuiScreen(new ScreenEnchants(mc.currentScreen));
|
||||
}
|
||||
|
||||
if (mc.currentScreen != null)
|
||||
return;
|
||||
|
||||
if (kb.keyDescription == Constants.BIND_WAILA_SHOW && ConfigHandler.instance().getConfig(Constants.CFG_WAILA_MODE)){
|
||||
boolean status = ConfigHandler.instance().getConfig(Constants.CFG_WAILA_SHOW);
|
||||
ConfigHandler.instance().setConfig(Constants.CFG_WAILA_SHOW, !status);
|
||||
}
|
||||
|
||||
else if (kb.keyDescription == Constants.BIND_WAILA_SHOW && !ConfigHandler.instance().getConfig(Constants.CFG_WAILA_MODE)){
|
||||
ConfigHandler.instance().setConfig(Constants.CFG_WAILA_SHOW, true);
|
||||
}
|
||||
|
||||
else if (kb.keyDescription == Constants.BIND_WAILA_LIQUID){
|
||||
boolean status = ConfigHandler.instance().getConfig(Constants.CFG_WAILA_LIQUID);
|
||||
ConfigHandler.instance().setConfig(Constants.CFG_WAILA_LIQUID, !status);
|
||||
}
|
||||
|
||||
else if (kb.keyDescription == Constants.BIND_WAILA_RECIPE){
|
||||
this.openRecipeGUI(true);
|
||||
}
|
||||
|
||||
else if (kb.keyDescription == Constants.BIND_WAILA_USAGE){
|
||||
this.openRecipeGUI(false);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void openRecipeGUI(boolean recipe){
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
boolean uiResult;
|
||||
String msg;
|
||||
|
||||
if ((RayTracing.raytracedTarget != null) && (RayTracing.raytracedTarget.typeOfHit == EnumMovingObjectType.TILE)){
|
||||
List<ItemStack> stacks = RayTracing.getIdentifierItems();
|
||||
if (stacks.size() > 0){
|
||||
mc.displayGuiScreen(new GuiInventory(mc.thePlayer));
|
||||
if (firstInventory){
|
||||
try {Thread.sleep(1000);} catch (Exception e){};
|
||||
firstInventory = false;
|
||||
}
|
||||
|
||||
if(recipe)
|
||||
if(!GuiCraftingRecipe.openRecipeGui("item", stacks.get(0).copy())){
|
||||
ItemStack target = stacks.get(0).copy();
|
||||
target.setItemDamage(0);
|
||||
if(!GuiCraftingRecipe.openRecipeGui("item", target)){
|
||||
mc.thePlayer.addChatMessage("\u00a7f\u00a7o" + LangUtil.translateG("client.msg.norecipe"));
|
||||
mc.displayGuiScreen((GuiScreen)null);
|
||||
mc.setIngameFocus();
|
||||
}
|
||||
}
|
||||
|
||||
if(!recipe)
|
||||
if(!GuiUsageRecipe.openRecipeGui("item", stacks.get(0).copy())){
|
||||
ItemStack target = stacks.get(0).copy();
|
||||
target.setItemDamage(0);
|
||||
if(!GuiUsageRecipe.openRecipeGui("item", target)){
|
||||
mc.thePlayer.addChatMessage("\u00a7f\u00a7o" + LangUtil.translateG("client.msg.nousage"));
|
||||
mc.displayGuiScreen((GuiScreen)null);
|
||||
mc.setIngameFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyUp(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd) {
|
||||
if (!tickEnd) return;
|
||||
if (kb.keyDescription == Constants.BIND_WAILA_SHOW && !ConfigHandler.instance().getConfig(Constants.CFG_WAILA_MODE)){
|
||||
ConfigHandler.instance().setConfig(Constants.CFG_WAILA_SHOW, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<TickType> ticks() {
|
||||
return EnumSet.of(TickType.CLIENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return "Waila Config Screen Keybind";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package mcp.mobius.waila.client;
|
||||
|
||||
import mcp.mobius.waila.Constants;
|
||||
import mcp.mobius.waila.addons.ExternalModulesHandler;
|
||||
import mcp.mobius.waila.addons.appeng.AppEngModule;
|
||||
import mcp.mobius.waila.addons.buildcraft.BCModule;
|
||||
import mcp.mobius.waila.addons.buildcraft.BCPowerAPIModule;
|
||||
import mcp.mobius.waila.addons.enderio.EnderIOModule;
|
||||
import mcp.mobius.waila.addons.enderstorage.EnderStorageModule;
|
||||
import mcp.mobius.waila.addons.etb.ETBModule;
|
||||
import mcp.mobius.waila.addons.gravestone.GravestoneModule;
|
||||
import mcp.mobius.waila.addons.ic2.IC2Module;
|
||||
import mcp.mobius.waila.addons.projectred.ProjectRedModule;
|
||||
import mcp.mobius.waila.addons.thaumcraft.ThaumcraftModule;
|
||||
import mcp.mobius.waila.addons.thermalexpansion.ThermalExpansionModule;
|
||||
import mcp.mobius.waila.addons.twilightforest.TwilightForestModule;
|
||||
import mcp.mobius.waila.addons.vanillamc.HUDHandlerVanilla;
|
||||
import mcp.mobius.waila.gui.truetyper.FontLoader;
|
||||
import mcp.mobius.waila.gui.truetyper.TrueTypeFont;
|
||||
import mcp.mobius.waila.handlers.SummaryProviderDefault;
|
||||
import mcp.mobius.waila.handlers.hud.HUDHandlerExternal;
|
||||
import mcp.mobius.waila.handlers.hud.HUDHandlerWaila;
|
||||
import mcp.mobius.waila.handlers.tooltip.TooltipHandlerWaila;
|
||||
import mcp.mobius.waila.overlay.WailaTickHandler;
|
||||
import mcp.mobius.waila.server.ProxyServer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.ItemInfo;
|
||||
import codechicken.nei.forge.GuiContainerManager;
|
||||
import cpw.mods.fml.client.registry.KeyBindingRegistry;
|
||||
import cpw.mods.fml.common.registry.TickRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
public class ProxyClient extends ProxyServer {
|
||||
|
||||
TrueTypeFont minecraftiaFont;
|
||||
|
||||
//public static LangUtil lang = LangUtil.loadLangDir("waila");
|
||||
|
||||
public ProxyClient() {}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerHandlers(){
|
||||
|
||||
LangUtil.instance.loadLangDir("waila");
|
||||
|
||||
minecraftiaFont = FontLoader.createFont(new ResourceLocation("waila", "fonts/Minecraftia.ttf"), 14, true);
|
||||
|
||||
TickRegistry.registerTickHandler(new WailaTickHandler(), Side.CLIENT);
|
||||
|
||||
GuiContainerManager.addTooltipHandler(new TooltipHandlerWaila());
|
||||
API.registerHighlightHandler(new HUDHandlerExternal(), ItemInfo.Layout.HEADER);
|
||||
API.registerHighlightHandler(new HUDHandlerExternal(), ItemInfo.Layout.BODY);
|
||||
API.registerHighlightHandler(new HUDHandlerWaila(), ItemInfo.Layout.FOOTER);
|
||||
API.registerHighlightHandler(new HUDHandlerWaila(), ItemInfo.Layout.HEADER);
|
||||
|
||||
KeyBindingRegistry.registerKeyBinding(new ConfigKeyHandler());
|
||||
|
||||
// We mute the default keybind for displaying the tooltip
|
||||
NEIClientConfig.getSetting(Constants.BIND_NEI_SHOW).setIntValue(Keyboard.KEY_NONE);
|
||||
NEIClientConfig.getSetting(Constants.CFG_NEI_SHOW).setBooleanValue(false);
|
||||
|
||||
//API.addKeyBind(Constants.BIND_WIKI, "Display wiki", Keyboard.KEY_RSHIFT);
|
||||
//API.addKeyBind(Constants.BIND_TECH, "Display techtree", Keyboard.KEY_RSHIFT);
|
||||
|
||||
ExternalModulesHandler.instance().registerShortDataProvider(new SummaryProviderDefault(), Item.class);
|
||||
|
||||
this.registerMods();
|
||||
}
|
||||
|
||||
public void registerMods(){
|
||||
|
||||
HUDHandlerVanilla.register();
|
||||
|
||||
/*BETTER BARRELS*/
|
||||
//BetterBarrelsModule.register();
|
||||
|
||||
/* BUILDCRAFT */
|
||||
BCModule.register();
|
||||
|
||||
/* INDUSTRIALCRAFT2 */
|
||||
IC2Module.register();
|
||||
|
||||
/*Thaumcraft*/
|
||||
ThaumcraftModule.register();
|
||||
|
||||
/*EnderStorage*/
|
||||
EnderStorageModule.register();
|
||||
|
||||
/*Gravestone*/
|
||||
GravestoneModule.register();
|
||||
|
||||
/*Twilight forest*/
|
||||
TwilightForestModule.register();
|
||||
|
||||
/* Applied Energetics */
|
||||
AppEngModule.register();
|
||||
|
||||
/* Thermal Expansion */
|
||||
ThermalExpansionModule.register();
|
||||
|
||||
/* ETB */
|
||||
ETBModule.register();
|
||||
|
||||
/* EnderIO */
|
||||
EnderIOModule.register();
|
||||
|
||||
/* Buildcraft Power API */
|
||||
BCPowerAPIModule.register();
|
||||
|
||||
/* ProjectRed API */
|
||||
ProjectRedModule.register();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getFont(){return this.minecraftiaFont;}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package mcp.mobius.waila.client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import mcp.mobius.waila.WailaExceptionHandler;
|
||||
import mcp.mobius.waila.addons.ConfigHandler;
|
||||
import mcp.mobius.waila.addons.ExternalModulesHandler;
|
||||
import mcp.mobius.waila.api.IWailaBlockDecorator;
|
||||
import mcp.mobius.waila.handlers.DataAccessor;
|
||||
import mcp.mobius.waila.overlay.RayTracing;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
|
||||
public class WailaClientEventHandler {
|
||||
|
||||
@ForgeSubscribe
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderWorldLast(RenderWorldLastEvent event) {
|
||||
if (RayTracing.raytracedTarget == null || RayTracing.raytracedStack == null) return;
|
||||
|
||||
double partialTicks = event.partialTicks;
|
||||
|
||||
DataAccessor accessor = DataAccessor.instance;
|
||||
World world = Minecraft.getMinecraft().theWorld;
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
EntityLivingBase viewEntity = Minecraft.getMinecraft().renderViewEntity;
|
||||
|
||||
if (world == null || player == null || viewEntity == null) return;
|
||||
|
||||
accessor.set(world, player, RayTracing.raytracedTarget, viewEntity, partialTicks);
|
||||
|
||||
Block block = accessor.getBlock();
|
||||
int blockID = accessor.getBlockID();
|
||||
|
||||
if (!ExternalModulesHandler.instance().hasBlockDecorator(blockID) && !ExternalModulesHandler.instance().hasBlockDecorator(block)) return;
|
||||
|
||||
GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glDepthMask(false);
|
||||
|
||||
if (ExternalModulesHandler.instance().hasBlockDecorator(blockID)){
|
||||
for (IWailaBlockDecorator decorator : ExternalModulesHandler.instance().getBlockDecorators(blockID))
|
||||
try{
|
||||
GL11.glPushMatrix();
|
||||
decorator.decorateBlock(RayTracing.raytracedStack, accessor, ConfigHandler.instance());
|
||||
GL11.glPopMatrix();
|
||||
} catch (Throwable e){
|
||||
GL11.glPopMatrix();
|
||||
WailaExceptionHandler.handleErr(e, decorator.getClass().toString(), null);
|
||||
}
|
||||
}
|
||||
|
||||
if (ExternalModulesHandler.instance().hasBlockDecorator(block)){
|
||||
for (IWailaBlockDecorator decorator : ExternalModulesHandler.instance().getBlockDecorators(block))
|
||||
try{
|
||||
GL11.glPushMatrix();
|
||||
decorator.decorateBlock(RayTracing.raytracedStack, accessor, ConfigHandler.instance());
|
||||
GL11.glPopMatrix();
|
||||
} catch (Throwable e){
|
||||
GL11.glPopMatrix();
|
||||
WailaExceptionHandler.handleErr(e, decorator.getClass().toString(), null);
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glPopAttrib();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
package mcp.mobius.waila.gui;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
|
||||
import mcp.mobius.waila.addons.ConfigHandler;
|
||||
import mcp.mobius.waila.handlers.DataAccessor;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagByteArray;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import cpw.mods.fml.client.registry.KeyBindingRegistry.KeyHandler;
|
||||
import cpw.mods.fml.common.TickType;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
|
||||
public class ConfigKeyHandler extends KeyHandler {
|
||||
|
||||
public ConfigKeyHandler()
|
||||
{
|
||||
super(new KeyBinding[]{
|
||||
new KeyBinding("key.wailaconfig", Keyboard.KEY_NUMPAD0),
|
||||
new KeyBinding("key.wailadisplay", Keyboard.KEY_NUMPAD1),
|
||||
//new KeyBinding("key.wailatedump", Keyboard.KEY_NUMPAD1),
|
||||
}, new boolean[]{
|
||||
false,
|
||||
false,
|
||||
//false
|
||||
});
|
||||
|
||||
LanguageRegistry.instance().addStringLocalization("key.wailaconfig", "[Waila] Config screen");
|
||||
LanguageRegistry.instance().addStringLocalization("key.wailadisplay", "[Waila] Show/Hide");
|
||||
//LanguageRegistry.instance().addStringLocalization("key.wailatedump", "[Waila] Dump server TE");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) {
|
||||
if (!tickEnd) return;
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if (kb.keyDescription == "key.wailaconfig"){
|
||||
if(mc.currentScreen == null)
|
||||
mc.displayGuiScreen(new GuiConfigScreen(mc.currentScreen));
|
||||
}
|
||||
else if (kb.keyDescription == "key.wailadisplay" && ConfigHandler.instance().getConfig("waila.showmode")){
|
||||
boolean status = NEIClientConfig.getSetting("options.inworld tooltips").getBooleanValue();
|
||||
NEIClientConfig.getSetting("options.inworld tooltips").setBooleanValue(!status);
|
||||
}
|
||||
else if (kb.keyDescription == "key.wailadisplay" && !ConfigHandler.instance().getConfig("waila.showmode")){
|
||||
NEIClientConfig.getSetting("options.inworld tooltips").setBooleanValue(true);
|
||||
}
|
||||
else if (kb.keyDescription == "key.wailatedump"){
|
||||
this.dumpTag(DataAccessor.instance.remoteNbt, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void dumpTag(NBTTagCompound nbt, int tab){
|
||||
if (nbt == null) return;
|
||||
|
||||
for (Object s : nbt.tagMap.keySet()){
|
||||
for (int i = 0; i < tab; i++)
|
||||
System.out.printf("\t");
|
||||
|
||||
String key = (String)s;
|
||||
NBTBase tag = nbt.getTag(key);
|
||||
String tagtype = tag.getClass().getSimpleName();
|
||||
|
||||
if (!(tag instanceof NBTTagCompound) && !(tag instanceof NBTTagList))
|
||||
System.out.printf("[%s]%s : %s\n", tagtype, key, tag);
|
||||
|
||||
if (tag instanceof NBTTagByteArray){
|
||||
byte[] array = nbt.getByteArray(key);
|
||||
for (int i = 0; i < array.length; i++)
|
||||
System.out.printf("%s ", array[i]);
|
||||
System.out.printf("\n");
|
||||
}
|
||||
|
||||
if (tag instanceof NBTTagCompound){
|
||||
System.out.printf("[%s]%s\n", tagtype, s);
|
||||
this.dumpTag(nbt.getCompoundTag(key), tab + 1);
|
||||
}
|
||||
|
||||
if (tag instanceof NBTTagList){
|
||||
System.out.printf("[%s]%s\n", tagtype, s);
|
||||
|
||||
for (Object o : nbt.getTagList(key).tagList){
|
||||
NBTBase subtag = (NBTBase)o;
|
||||
|
||||
if (!(subtag instanceof NBTTagCompound))
|
||||
System.out.printf("[%s]%s : %s\n", subtag.getClass().getSimpleName(), subtag.getName(), subtag);
|
||||
|
||||
if (subtag instanceof NBTTagCompound)
|
||||
this.dumpTag((NBTTagCompound)subtag, tab + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyUp(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd) {
|
||||
if (!tickEnd) return;
|
||||
if (kb.keyDescription == "key.wailadisplay" && !ConfigHandler.instance().getConfig("waila.showmode")){
|
||||
NEIClientConfig.getSetting("options.inworld tooltips").setBooleanValue(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<TickType> ticks() {
|
||||
return EnumSet.of(TickType.CLIENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return "Waila Config Screen Keybind";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package mcp.mobius.waila.gui;
|
||||
|
||||
import mcp.mobius.waila.gui.widget.Button2States;
|
||||
import mcp.mobius.waila.gui.widget.ButtonChangeScreen;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
public class GuiBaseConfigScreen extends GuiScreen {
|
||||
|
||||
protected GuiScreen parentGui; // GUI we will return to in the case we are call from a GUI
|
||||
|
||||
public GuiBaseConfigScreen(GuiScreen _parentGui) {
|
||||
this.parentGui = _parentGui;
|
||||
}
|
||||
|
||||
@Override
|
||||
/* Here we draw anything special, and super takes care of the buttons for us */
|
||||
public void drawScreen(int i, int j, float f)
|
||||
{
|
||||
drawDefaultBackground();
|
||||
super.drawScreen(i, j, f);
|
||||
}
|
||||
|
||||
@Override
|
||||
/* Here we handle key presses. Super will just close the gui on ESC, and we like it like that */
|
||||
public void keyTyped(char keyChar, int keyID)
|
||||
{
|
||||
super.keyTyped(keyChar, keyID);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton guibutton)
|
||||
{
|
||||
if (guibutton instanceof ButtonChangeScreen)
|
||||
((ButtonChangeScreen)guibutton).pressButton();
|
||||
|
||||
else if (guibutton instanceof Button2States)
|
||||
((Button2States)guibutton).pressButton();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package mcp.mobius.waila.gui;
|
||||
|
||||
import mcp.mobius.waila.gui.widget.ButtonChangeScreen;
|
||||
import mcp.mobius.waila.gui.widget.ContainerButtons;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
public class GuiConfigScreen extends GuiBaseConfigScreen {
|
||||
|
||||
public GuiConfigScreen(GuiScreen _parentGui) {
|
||||
super(_parentGui);
|
||||
}
|
||||
|
||||
@Override
|
||||
/* We init the GUI data here (buttons, etc) */
|
||||
public void initGui()
|
||||
{
|
||||
buttonList.add(new ButtonChangeScreen(200, width / 2 - 100, height / 6 + 168, "Done", null));
|
||||
ContainerButtons container = new ContainerButtons(this, 5, height/2-10, width - 10, height);
|
||||
container.addButton(new ButtonChangeScreen(201, "Waila", new GuiWailaConfig(this) ));
|
||||
container.addButton(new ButtonChangeScreen(202, "Modules", new GuiModules(this)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package mcp.mobius.waila.gui;
|
||||
|
||||
import mcp.mobius.waila.addons.ConfigHandler;
|
||||
import mcp.mobius.waila.gui.widget.ButtonChangeScreen;
|
||||
import mcp.mobius.waila.gui.widget.ButtonConfigOption;
|
||||
import mcp.mobius.waila.gui.widget.ButtonConfigRemote;
|
||||
import mcp.mobius.waila.gui.widget.ContainerButtons;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
public class GuiModuleOptions extends GuiBaseConfigScreen {
|
||||
|
||||
private String modName;
|
||||
|
||||
public GuiModuleOptions(GuiScreen _parentGui, String _modName) {
|
||||
super(_parentGui);
|
||||
this.modName = _modName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
buttonList.add(new ButtonChangeScreen(200, width / 2 - 100, height / 6 + 168, "Back", this.parentGui));
|
||||
ContainerButtons container = new ContainerButtons(this, 5, 0, width - 10, height);
|
||||
|
||||
for (String key:ConfigHandler.instance().getConfigKeys(this.modName).keySet()){
|
||||
if (ConfigHandler.instance().isServerRequired(key))
|
||||
container.addButton(new ButtonConfigRemote(-1, "No", "Yes", ConfigHandler.instance().getConfigKeys(this.modName).get(key), key ));
|
||||
else
|
||||
container.addButton(new ButtonConfigOption(-1, "No", "Yes", ConfigHandler.instance().getConfigKeys(this.modName).get(key), key ));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package mcp.mobius.waila.gui;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import mcp.mobius.waila.addons.ConfigHandler;
|
||||
import mcp.mobius.waila.gui.widget.ButtonChangeScreen;
|
||||
import mcp.mobius.waila.gui.widget.ContainerButtons;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
public class GuiModules extends GuiBaseConfigScreen {
|
||||
|
||||
private HashMap<String, GuiScreen> screens = new HashMap<String, GuiScreen>();
|
||||
|
||||
public GuiModules(GuiScreen _parentGui) {
|
||||
super(_parentGui);
|
||||
for (String key : ConfigHandler.instance().getModuleNames())
|
||||
screens.put(key, new GuiModuleOptions(this, key));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
buttonList.add(new ButtonChangeScreen(200, width / 2 - 100, height / 6 + 168, "Back", this.parentGui));
|
||||
ContainerButtons container = new ContainerButtons(this, 5, 0, width - 10, height);
|
||||
|
||||
for (String key : ConfigHandler.instance().getModuleNames())
|
||||
container.addButton(new ButtonChangeScreen(-1, key, screens.get(key)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package mcp.mobius.waila.gui;
|
||||
|
||||
import mcp.mobius.waila.gui.widget.ButtonChangeScreen;
|
||||
import mcp.mobius.waila.gui.widget.ButtonConfigNEI;
|
||||
import mcp.mobius.waila.gui.widget.ButtonConfigOption;
|
||||
import mcp.mobius.waila.gui.widget.ContainerButtons;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
public class GuiWailaConfig extends GuiBaseConfigScreen {
|
||||
|
||||
public GuiWailaConfig(GuiScreen _parentGui) {
|
||||
super(_parentGui);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
buttonList.add(new ButtonChangeScreen(200, width / 2 - 100, height / 6 + 168, "Back", this.parentGui));
|
||||
|
||||
ContainerButtons container = new ContainerButtons(this, 5, 0, width - 10, height);
|
||||
container.addButton(new ButtonConfigNEI(-1, "Hidden", "Shown", "Show/Hide Waila", "options.inworld tooltips" ));
|
||||
container.addButton(new ButtonConfigOption(-1, "Maintened", "Toggled", "Toggle/Maintened", "waila.showmode" ));
|
||||
container.addButton(new ButtonConfigOption(-1, "Hidden", "Visible", "Show ID:Metadata", "waila.showmetadata", false ));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package mcp.mobius.waila.gui.events;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import mcp.mobius.waila.gui.interfaces.IWidget;
|
||||
|
||||
public class MouseEvent {
|
||||
|
||||
public enum EventType {NONE, MOVE, CLICK, RELEASED, DRAG, WHEEL, ENTER, LEAVE};
|
||||
|
||||
public long timestamp;
|
||||
public Minecraft mc;
|
||||
public IWidget srcwidget;
|
||||
public IWidget trgwidget;
|
||||
public double x,y;
|
||||
public int z;
|
||||
public static int buttonCount = Mouse.getButtonCount();
|
||||
public boolean[] buttonState = new boolean[buttonCount];
|
||||
public EventType type;
|
||||
public int button = -1;
|
||||
|
||||
|
||||
public MouseEvent(IWidget widget){
|
||||
this.srcwidget = widget;
|
||||
this.timestamp = System.nanoTime();
|
||||
|
||||
this.mc = Minecraft.getMinecraft();
|
||||
|
||||
this.x = (double)Mouse.getEventX() * (double)this.srcwidget.getSize().getX() / (double)this.mc.displayWidth;
|
||||
this.y = (double)this.srcwidget.getSize().getY() - (double)Mouse.getEventY() * (double)this.srcwidget.getSize().getY() / (double)this.mc.displayHeight - 1.0;
|
||||
|
||||
//this.x = Mouse.getEventX();
|
||||
//this.y = Mouse.getEventY();
|
||||
|
||||
//System.out.printf("%s %s\n", this.x, this.y);
|
||||
|
||||
//this.z = Mouse.getEventDWheel();
|
||||
this.z = Mouse.getDWheel();
|
||||
|
||||
for (int i = 0; i < buttonCount; i++)
|
||||
buttonState[i] = Mouse.isButtonDown(i);
|
||||
|
||||
this.trgwidget = this.srcwidget.getWidgetAtCoordinates(this.x, this.y);
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
String retstring = String.format("MOUSE %s : [%s] [ %.2f %.2f %d ] [", this.type, this.timestamp, this.x, this.y, this.z);
|
||||
if (this.buttonCount < 5)
|
||||
for (int i = 0; i < this.buttonCount; i++)
|
||||
retstring += String.format(" %s ", this.buttonState[i]);
|
||||
else
|
||||
for (int i = 0; i < 5; i++)
|
||||
retstring += String.format(" %s ", this.buttonState[i]);
|
||||
retstring += "]";
|
||||
|
||||
if (this.button != -1)
|
||||
retstring += String.format(" Button %s", this.button);
|
||||
|
||||
return retstring;
|
||||
}
|
||||
|
||||
// Returns the event type based on the previous mouse event.
|
||||
public EventType getEventType(MouseEvent me){
|
||||
|
||||
this.type = EventType.NONE;
|
||||
|
||||
if (this.trgwidget != me.trgwidget){
|
||||
this.type = EventType.ENTER;
|
||||
return this.type;
|
||||
}
|
||||
|
||||
if (this.z != 0){
|
||||
this.type = EventType.WHEEL;
|
||||
return this.type;
|
||||
}
|
||||
|
||||
for (int i = 0; i < this.buttonCount; i++){
|
||||
if (this.buttonState[i] != me.buttonState[i]){
|
||||
if (this.buttonState[i] == true)
|
||||
this.type = EventType.CLICK;
|
||||
else
|
||||
this.type = EventType.RELEASED;
|
||||
this.button = i;
|
||||
return this.type;
|
||||
}
|
||||
}
|
||||
|
||||
//MOVE & DRAG EVENTS (we moved the mouse and button 0 was clicked or not)
|
||||
if ((this.x != me.x) || (this.y != me.y)){
|
||||
if (this.buttonState[0] == true)
|
||||
this.type = EventType.DRAG;
|
||||
else
|
||||
this.type = EventType.MOVE;
|
||||
return this.type;
|
||||
}
|
||||
|
||||
return this.type;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package mcp.mobius.waila.gui.helpers;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
public class ReverseIterator<T> implements Iterable<T> {
|
||||
|
||||
private ListIterator<T> listIterator;
|
||||
|
||||
public ReverseIterator(Collection<T> wrappedList) {
|
||||
List list = Lists.newArrayList(wrappedList);
|
||||
this.listIterator = list.listIterator(wrappedList.size());
|
||||
}
|
||||
|
||||
public Iterator<T> iterator() {
|
||||
return new Iterator<T>() {
|
||||
|
||||
public boolean hasNext() {
|
||||
return listIterator.hasPrevious();
|
||||
}
|
||||
|
||||
public T next() {
|
||||
return listIterator.previous();
|
||||
}
|
||||
|
||||
public void remove() {
|
||||
listIterator.remove();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package mcp.mobius.waila.gui.helpers;
|
||||
|
||||
public class UIException extends RuntimeException {
|
||||
public UIException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
package mcp.mobius.waila.gui.helpers;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class UIHelper {
|
||||
|
||||
public static void drawTexture(int posX, int posY, int sizeX, int sizeY)
|
||||
{
|
||||
UIHelper.drawTexture(posX, posY, sizeX, sizeY, 0, 0, 256, 256);
|
||||
}
|
||||
|
||||
public static void drawTexture(int posX, int posY, int sizeX, int sizeY, int texU, int texV, int texSizeU, int texSizeV)
|
||||
{
|
||||
float zLevel = 0.0F;
|
||||
float f = 0.00390625F;
|
||||
|
||||
Tessellator tess = Tessellator.instance;
|
||||
tess.startDrawingQuads();
|
||||
tess.addVertexWithUV((double)(posX + 0), (double)(posY + sizeY), (double)zLevel, texU*f, (texV + texSizeV)*f);
|
||||
tess.addVertexWithUV((double)(posX + sizeX), (double)(posY + sizeY), (double)zLevel, (texU + texSizeU)*f, (texV + texSizeV)*f);
|
||||
tess.addVertexWithUV((double)(posX + sizeX), (double)(posY + 0), (double)zLevel, (texU + texSizeU)*f, texV*f);
|
||||
tess.addVertexWithUV((double)(posX + 0), (double)(posY + 0), (double)zLevel, texU*f, texV*f);
|
||||
tess.draw();
|
||||
}
|
||||
|
||||
public static void drawGradientRect(int minx, int miny, int maxx, int maxy, int zlevel, int color1, int color2)
|
||||
{
|
||||
float alpha1 = (float)(color1 >> 24 & 255) / 255.0F;
|
||||
float red1 = (float)(color1 >> 16 & 255) / 255.0F;
|
||||
float green1 = (float)(color1 >> 8 & 255) / 255.0F;
|
||||
float blue1 = (float)(color1 & 255) / 255.0F;
|
||||
float alpha2 = (float)(color2 >> 24 & 255) / 255.0F;
|
||||
float red2 = (float)(color2 >> 16 & 255) / 255.0F;
|
||||
float green2 = (float)(color2 >> 8 & 255) / 255.0F;
|
||||
float blue2 = (float)(color2 & 255) / 255.0F;
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red1, green1, blue1, alpha1);
|
||||
tessellator.addVertex((double)maxx, (double)miny, (double)zlevel);
|
||||
tessellator.addVertex((double)minx, (double)miny, (double)zlevel);
|
||||
tessellator.setColorRGBA_F(red2, green2, blue2, alpha2);
|
||||
tessellator.addVertex((double)minx, (double)maxy, (double)zlevel);
|
||||
tessellator.addVertex((double)maxx, (double)maxy, (double)zlevel);
|
||||
tessellator.draw();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
public static void drawBillboardText(String text, Vec3 pos, float offX, float offY, float offZ, double partialFrame){
|
||||
UIHelper.drawBillboardText(text, (float)pos.xCoord, (float)pos.yCoord, (float)pos.zCoord, offX, offY, offZ, partialFrame);
|
||||
}
|
||||
|
||||
public static void drawBillboardText(String text, float posX, float posY, float posZ, float offX, float offY, float offZ, double partialFrame){
|
||||
EntityLivingBase player = Minecraft.getMinecraft().renderViewEntity;
|
||||
float playerViewY = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * (float)partialFrame;
|
||||
float playerViewX = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * (float)partialFrame;
|
||||
|
||||
UIHelper.drawFloatingText(text, posX, posY, posZ, offX, offY, offZ, playerViewX, playerViewY * -1.0F, 0.0F);
|
||||
}
|
||||
|
||||
public static void drawFloatingText(String text, Vec3 pos, float offX, float offY, float offZ, float rotX, float rotY, float rotZ){
|
||||
UIHelper.drawFloatingText(text, (float)pos.xCoord, (float)pos.yCoord, (float)pos.zCoord, offX, offY, offZ, rotX, rotY, rotZ);
|
||||
}
|
||||
|
||||
public static void drawFloatingText(String text, float posX, float posY, float posZ, float offX, float offY, float offZ, float rotX, float rotY, float rotZ){
|
||||
|
||||
if (text.isEmpty()) return;
|
||||
|
||||
FontRenderer fontrenderer = Minecraft.getMinecraft().fontRenderer;
|
||||
|
||||
float f = 1.6F;
|
||||
float f1 = 0.016666668F * f;
|
||||
GL11.glPushMatrix();
|
||||
|
||||
|
||||
//GL11.glTranslatef((float)accessor.getPosition().blockX + 0.0F, (float)accessor.getPosition().blockY + 0.5F, (float)accessor.getPosition().blockZ);
|
||||
GL11.glTranslatef(posX + offX, posY + offY, posZ + offZ);
|
||||
|
||||
//GL11.glTranslatef(posX, posY, posZ);
|
||||
GL11.glNormal3f(0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(rotY, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(rotX, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(rotZ, 0.0F, 0.0F, 1.0F);
|
||||
//GL11.glTranslatef(offX, offY, offZ);
|
||||
|
||||
GL11.glScalef(-f1, -f1, f1);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
byte b0 = 0;
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
tessellator.startDrawingQuads();
|
||||
int j = fontrenderer.getStringWidth(text) / 2;
|
||||
tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F);
|
||||
tessellator.addVertex((double)(-j - 1), (double)(-1 + b0), 0.0D);
|
||||
tessellator.addVertex((double)(-j - 1), (double)(8 + b0), 0.0D);
|
||||
tessellator.addVertex((double)(j + 1), (double)(8 + b0), 0.0D);
|
||||
tessellator.addVertex((double)(j + 1), (double)(-1 + b0), 0.0D);
|
||||
tessellator.draw();
|
||||
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
fontrenderer.drawString(text, -fontrenderer.getStringWidth(text) / 2, b0, 553648127);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDepthMask(true);
|
||||
fontrenderer.drawString(text, -fontrenderer.getStringWidth(text) / 2, b0, -1);
|
||||
//GL11.glEnable(GL11.GL_LIGHTING);
|
||||
//GL11.glDisable(GL11.GL_BLEND);
|
||||
//GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
}
|
||||
|
||||
public static void drawRectangle(double x1, double y1, double z1, double x2, double y2, double z2, int r, int g, int b, int a){
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
tessellator.setColorRGBA(r, g, b, a);
|
||||
tessellator.startDrawingQuads();
|
||||
|
||||
tessellator.addVertex(x1, y2, z1);
|
||||
tessellator.addVertex(x1, y1, z2);
|
||||
tessellator.addVertex(x2, y1, z2);
|
||||
tessellator.addVertex(x2, y2, z1);
|
||||
|
||||
tessellator.draw();
|
||||
|
||||
}
|
||||
|
||||
public static void drawRectangleEW(double x1, double y1, double z1, double x2, double y2, double z2, int r, int g, int b, int a){
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
tessellator.setColorRGBA(r, g, b, a);
|
||||
tessellator.startDrawingQuads();
|
||||
|
||||
tessellator.addVertex(x1, y1, z1);
|
||||
tessellator.addVertex(x1, y1, z2);
|
||||
tessellator.addVertex(x2, y2, z2);
|
||||
tessellator.addVertex(x2, y2, z1);
|
||||
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package mcp.mobius.waila.gui.interfaces;
|
||||
|
||||
public enum CType {
|
||||
REL_X,
|
||||
REL_Y,
|
||||
RELXY,
|
||||
ABSXY;
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package mcp.mobius.waila.gui.interfaces;
|
||||
|
||||
import mcp.mobius.waila.gui.events.MouseEvent;
|
||||
import mcp.mobius.waila.gui.widgets.WidgetGeometry;
|
||||
|
||||
import org.lwjgl.util.Point;
|
||||
|
||||
public interface IWidget {
|
||||
// Should all the coordinates, sizes, etc be % or absolute values ?
|
||||
// Should we allow 2 methods for an absolute referencing (screen pos) and relative one (parent pos) ?
|
||||
|
||||
IWidget getParent();
|
||||
void setParent(IWidget parent);
|
||||
|
||||
IWidget setGeometry(WidgetGeometry geom);
|
||||
WidgetGeometry getGeometry();
|
||||
|
||||
IWidget setPos(double x, double y);
|
||||
IWidget setPos(double x, double y, boolean fracX, boolean fracY);
|
||||
IWidget setSize(double sx, double sy);
|
||||
IWidget setSize(double sx, double sy, boolean fracX, boolean fracY);
|
||||
IWidget adjustSize();
|
||||
|
||||
Point getPos();
|
||||
Point getSize();
|
||||
int getRight();
|
||||
int getLeft();
|
||||
int getTop();
|
||||
int getBottom();
|
||||
|
||||
void draw();
|
||||
void draw(Point pos);
|
||||
void show();
|
||||
void hide();
|
||||
void setAlpha(float alpha);
|
||||
float getAlpha();
|
||||
boolean shouldRender();
|
||||
|
||||
IWidget addWidget(String name, IWidget widget);
|
||||
IWidget addWidget(String name, IWidget widget, RenderPriority priority);
|
||||
IWidget getWidget(String name);
|
||||
IWidget delWidget(String name);
|
||||
IWidget getWidgetAtCoordinates(double posX, double posY);
|
||||
|
||||
boolean isWidgetAtCoordinates(double posx, double posy);
|
||||
|
||||
void handleMouseInput();
|
||||
|
||||
void onMouseClick(MouseEvent event);
|
||||
void onMouseDrag(MouseEvent event);
|
||||
void onMouseMove(MouseEvent event);
|
||||
void onMouseRelease(MouseEvent event);
|
||||
void onMouseWheel(MouseEvent event);
|
||||
void onMouseEnter(MouseEvent event);
|
||||
void onMouseLeave(MouseEvent event);
|
||||
|
||||
void emit(Signal signal, Object... params);
|
||||
void onWidgetEvent(IWidget srcwidget, Signal signal, Object... params);
|
||||
|
||||
//boolean onMouseEnter();
|
||||
//boolean onMouseMoved();
|
||||
//boolean onMouseLeave();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package mcp.mobius.waila.gui.interfaces;
|
||||
|
||||
public enum RenderPriority {
|
||||
LOW,
|
||||
MEDIUM,
|
||||
HIGH;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package mcp.mobius.waila.gui.interfaces;
|
||||
|
||||
public enum Signal {
|
||||
DRAGGED,
|
||||
CLICKED,
|
||||
VALUE_CHANGED,
|
||||
GEOM_CHANGED;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package mcp.mobius.waila.gui.interfaces;
|
||||
|
||||
public enum WAlign {
|
||||
LEFT,CENTER,RIGHT,TOP,BOTTOM;
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package mcp.mobius.waila.gui.screens;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import mcp.mobius.waila.gui.interfaces.IWidget;
|
||||
import mcp.mobius.waila.gui.widgets.LayoutCanvas;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
public abstract class ScreenBase extends GuiScreen{
|
||||
protected GuiScreen parent; // Return screen if available.
|
||||
protected Minecraft mc; // Minecraft instance
|
||||
protected HashMap<String, IWidget> widgets; // List of widgets on this ui
|
||||
|
||||
public ScreenBase(GuiScreen parent) {
|
||||
this.parent = parent;
|
||||
this.mc = Minecraft.getMinecraft();
|
||||
this.widgets = new HashMap<String, IWidget>();
|
||||
|
||||
this.addWidget("canvas", new LayoutCanvas());
|
||||
|
||||
Mouse.getDWheel(); // We init the DWheel method (getDWheel returns the value since the last call, so we have to call it once on ui creation)
|
||||
}
|
||||
|
||||
/////////////////////
|
||||
// WIDGET HANDLING //
|
||||
/////////////////////
|
||||
|
||||
public IWidget addWidget(String name, IWidget widget){
|
||||
this.widgets.put(name, widget);
|
||||
return this.getWidget(name);
|
||||
}
|
||||
|
||||
public IWidget getWidget(String name){
|
||||
return this.widgets.get(name);
|
||||
}
|
||||
|
||||
public IWidget delWidget(String name){
|
||||
IWidget widget = this.getWidget(name);
|
||||
this.widgets.remove(widget);
|
||||
return widget;
|
||||
}
|
||||
|
||||
public IWidget getRoot(){
|
||||
return this.getWidget("canvas");
|
||||
}
|
||||
|
||||
/////////////////////
|
||||
// DRAWING METHODS //
|
||||
/////////////////////
|
||||
|
||||
@Override
|
||||
public void drawScreen(int i, int j, float f) {
|
||||
this.drawDefaultBackground(); //The dark background common to most of the UIs
|
||||
super.drawScreen(i, j, f);
|
||||
|
||||
for (IWidget widget: this.widgets.values())
|
||||
widget.draw();
|
||||
}
|
||||
|
||||
// Used to easily display a UI without having to mess with mc handle.
|
||||
public void display(){
|
||||
this.mc.displayGuiScreen(this);
|
||||
}
|
||||
|
||||
/////////////////////
|
||||
// INPUT METHODS //
|
||||
/////////////////////
|
||||
|
||||
//Keyboard handling. Basic one is just returning to the previous UI when Esc is pressed
|
||||
@Override
|
||||
public void keyTyped(char keyChar, int keyID)
|
||||
{
|
||||
if (keyID == 1)
|
||||
if (this.parent == null){
|
||||
this.mc.displayGuiScreen((GuiScreen)null);
|
||||
this.mc.setIngameFocus();
|
||||
} else
|
||||
this.mc.displayGuiScreen(this.parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMouseInput()
|
||||
{
|
||||
this.getRoot().handleMouseInput();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package mcp.mobius.waila.gui.screens.config;
|
||||
|
||||
import mcp.mobius.waila.Constants;
|
||||
import mcp.mobius.waila.gui.interfaces.CType;
|
||||
import mcp.mobius.waila.gui.interfaces.WAlign;
|
||||
import mcp.mobius.waila.gui.screens.ScreenBase;
|
||||
import mcp.mobius.waila.gui.widgets.LayoutBase;
|
||||
import mcp.mobius.waila.gui.widgets.WidgetGeometry;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonBooleanConfig;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonContainer;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonContainerLabel;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonScreenChange;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
public class ScreenConfig extends ScreenBase {
|
||||
public ScreenConfig(GuiScreen parent){
|
||||
super(parent);
|
||||
|
||||
this.getRoot().addWidget("ButtonContainer", new ButtonContainer(this.getRoot(), 2, 100, 25.0));
|
||||
this.getRoot().getWidget("ButtonContainer").setGeometry(new WidgetGeometry(50.0, 50.0, 50.0, 30.0, CType.RELXY, CType.REL_X, WAlign.CENTER, WAlign.CENTER));
|
||||
|
||||
ButtonContainer buttonContainer = ((ButtonContainer)this.getRoot().getWidget("ButtonContainer"));
|
||||
|
||||
buttonContainer.addButton( new ButtonScreenChange(this.getRoot(), "screen.button.waila", new ScreenWailaConfig(this)));
|
||||
buttonContainer.addButton( new ButtonScreenChange(this.getRoot(), "screen.button.modules", new ScreenModuleChoice(this)));
|
||||
|
||||
this.getRoot().addWidget("LayoutBack", new LayoutBase(this.getRoot()));
|
||||
this.getRoot().getWidget("LayoutBack").setGeometry(new WidgetGeometry(0.0, 80.0, 100.0, 20.0, CType.RELXY, CType.RELXY));
|
||||
this.getRoot().getWidget("LayoutBack").addWidget("ButtonBack", new ButtonScreenChange(this.getRoot().getWidget("LayoutBack"), "screen.button.back", this.parent));
|
||||
this.getRoot().getWidget("LayoutBack").getWidget("ButtonBack").setGeometry(new WidgetGeometry(50.0, 50.0, 100.0, 20.0, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,254 @@
|
||||
package mcp.mobius.waila.gui.screens.config;
|
||||
|
||||
import org.lwjgl.util.Point;
|
||||
|
||||
import mcp.mobius.waila.Constants;
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.addons.ConfigHandler;
|
||||
import mcp.mobius.waila.gui.events.MouseEvent;
|
||||
import mcp.mobius.waila.gui.interfaces.CType;
|
||||
import mcp.mobius.waila.gui.interfaces.IWidget;
|
||||
import mcp.mobius.waila.gui.interfaces.RenderPriority;
|
||||
import mcp.mobius.waila.gui.interfaces.Signal;
|
||||
import mcp.mobius.waila.gui.interfaces.WAlign;
|
||||
import mcp.mobius.waila.gui.screens.ScreenBase;
|
||||
import mcp.mobius.waila.gui.widgets.LabelFixedFont;
|
||||
import mcp.mobius.waila.gui.widgets.LayoutBase;
|
||||
import mcp.mobius.waila.gui.widgets.LayoutMargin;
|
||||
import mcp.mobius.waila.gui.widgets.WidgetGeometry;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonLabel;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonScreenChange;
|
||||
import mcp.mobius.waila.gui.widgets.movable.PictureMovableRC;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
public class ScreenHUDConfig extends ScreenBase {
|
||||
|
||||
private class EventCanvas extends LayoutBase{
|
||||
IWidget draggedWidget = null;
|
||||
|
||||
float scale;
|
||||
|
||||
public EventCanvas(IWidget parent, GuiScreen prevScreen){
|
||||
super(parent);
|
||||
this.setGeometry(new WidgetGeometry(0.0,0.0,100.0,100.0,CType.RELXY, CType.RELXY));
|
||||
|
||||
/*
|
||||
IWidget layoutX = this.addWidget("LayoutX", new LayoutBase(this));
|
||||
layoutX.setGeometry(new WidgetGeometry(40.0,50.0,20,60, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
|
||||
layoutX.addWidget("ButtonXAdd", new ButtonLabel(null, "+")).setGeometry(new WidgetGeometry(0.0, 0.0,20,20, CType.RELXY, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
|
||||
layoutX.addWidget("ButtonXSub", new ButtonLabel(null, "-")).setGeometry(new WidgetGeometry(0.0,100.0,20,20, CType.RELXY, CType.ABSXY, WAlign.LEFT, WAlign.BOTTOM));
|
||||
layoutX.addWidget("ValueDisplayX", new LabelFixedFont(null, "0")).setGeometry(new WidgetGeometry(50.0,50.0,20,20, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
|
||||
*/
|
||||
|
||||
/*
|
||||
IWidget layoutY = this.addWidget("LayoutY", new LayoutBase(this));
|
||||
layoutY.setGeometry(new WidgetGeometry(50.0,50.0,20,60,CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
|
||||
layoutY.addWidget("ButtonYAdd", new ButtonLabel(null, "+")).setGeometry(new WidgetGeometry(0.0, 0.0,20,20, CType.RELXY, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
|
||||
layoutY.addWidget("ButtonYSub", new ButtonLabel(null, "-")).setGeometry(new WidgetGeometry(0.0,100.0,20,20, CType.RELXY, CType.ABSXY, WAlign.LEFT, WAlign.BOTTOM));
|
||||
layoutY.addWidget("ValueDisplayY", new LabelFixedFont(null, "0")).setGeometry(new WidgetGeometry(50.0,50.0,20,20, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
|
||||
*/
|
||||
|
||||
double picX = ConfigHandler.instance().getConfigInt(Constants.CFG_WAILA_POSX) / 100.0;
|
||||
double picY = ConfigHandler.instance().getConfigInt(Constants.CFG_WAILA_POSY) / 100.0;
|
||||
float picAlpha = ConfigHandler.instance().getConfigInt(Constants.CFG_WAILA_ALPHA) / 100.0f;
|
||||
scale = ConfigHandler.instance().getConfigInt(Constants.CFG_WAILA_SCALE) / 100.0f;
|
||||
|
||||
int picSX = (int)(180 / this.rez.getScaleFactor() * scale), picSY = (int)(62 / this.rez.getScaleFactor() * scale);
|
||||
this.addWidget("Layout", new LayoutMargin(null), RenderPriority.HIGH);
|
||||
((LayoutMargin)this.getWidget("Layout")).setMargins(picSX/2, picSX/2, picSY/2, picSY/2);
|
||||
this.getWidget("Layout").addWidget("Picture", new PictureMovableRC(null, "waila:textures/config_template.png")).setGeometry(new WidgetGeometry(picX, picY, picSX, picSY,CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
|
||||
|
||||
this.addWidget("TextTuto1", new LabelFixedFont(null, "screen.label.dragtuto")).setGeometry(new WidgetGeometry(50.0, 30.0,20,20, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));;
|
||||
|
||||
IWidget layoutX = this.addWidget("LayoutX", new LayoutBase(this));
|
||||
layoutX.setGeometry(new WidgetGeometry(35.0,50.0,20,80,CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
|
||||
layoutX.addWidget("LabelX", new LabelFixedFont(null, "X")) .setGeometry(new WidgetGeometry(50.0, 0.0,20,20, CType.REL_X, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
|
||||
layoutX.addWidget("ButtonXAdd", new ButtonLabel(null, "+")) .setGeometry(new WidgetGeometry(0.0, 10.0,20,20, CType.REL_X, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
|
||||
layoutX.addWidget("ValueDisplayX", new LabelFixedFont(null, "0")) .setGeometry(new WidgetGeometry(50.0, 40.0,20,20, CType.REL_X, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
|
||||
layoutX.addWidget("ButtonXSub", new ButtonLabel(null, "-")) .setGeometry(new WidgetGeometry(0.0, 60.0,20,20, CType.REL_X, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
|
||||
|
||||
IWidget layoutY = this.addWidget("LayoutY", new LayoutBase(this));
|
||||
layoutY.setGeometry(new WidgetGeometry(45.0,50.0,20,80,CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
|
||||
layoutY.addWidget("LabelY", new LabelFixedFont(null, "Y")) .setGeometry(new WidgetGeometry(50.0, 0.0,20,20, CType.REL_X, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
|
||||
layoutY.addWidget("ButtonYAdd", new ButtonLabel(null, "+")) .setGeometry(new WidgetGeometry(0.0, 10.0,20,20, CType.REL_X, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
|
||||
layoutY.addWidget("ValueDisplayY", new LabelFixedFont(null, "0")) .setGeometry(new WidgetGeometry(50.0, 40.0,20,20, CType.REL_X, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
|
||||
layoutY.addWidget("ButtonYSub", new ButtonLabel(null, "-")) .setGeometry(new WidgetGeometry(0.0, 60.0,20,20, CType.REL_X, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
|
||||
|
||||
IWidget layoutAlpha = this.addWidget("LayoutAlpha", new LayoutBase(this));
|
||||
layoutAlpha.setGeometry(new WidgetGeometry(55.0,50.0,20,80,CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
|
||||
layoutAlpha.addWidget("LabelAlpha", new LabelFixedFont(null, "Alpha")).setGeometry(new WidgetGeometry(50.0, 0.0,20,20, CType.REL_X, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
|
||||
layoutAlpha.addWidget("ButtonAlphaAdd", new ButtonLabel(null, "+")) .setGeometry(new WidgetGeometry(0.0, 10.0,20,20, CType.REL_X, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
|
||||
layoutAlpha.addWidget("ValueDisplayAlpha", new LabelFixedFont(null, "0")) .setGeometry(new WidgetGeometry(50.0, 40.0,20,20, CType.REL_X, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
|
||||
layoutAlpha.addWidget("ButtonAlphaSub", new ButtonLabel(null, "-")) .setGeometry(new WidgetGeometry(0.0, 60.0,20,20, CType.REL_X, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
|
||||
|
||||
IWidget layoutScale = this.addWidget("LayoutScale", new LayoutBase(this));
|
||||
layoutScale.setGeometry(new WidgetGeometry(65.0,50.0,20,80,CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
|
||||
layoutScale.addWidget("LabelScale", new LabelFixedFont(null, "screen.label.scale")).setGeometry(new WidgetGeometry(50.0, 0.0,20,20, CType.REL_X, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
|
||||
layoutScale.addWidget("ButtonScaleAdd", new ButtonLabel(null, "+")) .setGeometry(new WidgetGeometry(0.0, 10.0,20,20, CType.REL_X, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
|
||||
layoutScale.addWidget("ValueDisplayScale", new LabelFixedFont(null, "0")) .setGeometry(new WidgetGeometry(50.0, 40.0,20,20, CType.REL_X, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
|
||||
layoutScale.addWidget("ButtonScaleSub", new ButtonLabel(null, "-")) .setGeometry(new WidgetGeometry(0.0, 60.0,20,20, CType.REL_X, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
|
||||
|
||||
|
||||
this.addWidget("ButtonCancel", new ButtonScreenChange(null, "screen.button.cancel", prevScreen)).setGeometry(new WidgetGeometry(70.0,97.0,75,20, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.BOTTOM));
|
||||
this.addWidget("ButtonOk", new ButtonScreenChange(null, "screen.button.ok", prevScreen)).setGeometry(new WidgetGeometry(30.0,97.0,75,20, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.BOTTOM));
|
||||
this.addWidget("ButtonDefault",new ButtonLabel(null, "screen.button.default")).setGeometry(new WidgetGeometry(50.0,97.0,75,20, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.BOTTOM));
|
||||
|
||||
|
||||
|
||||
((LabelFixedFont)this.getWidget("LayoutX").getWidget("ValueDisplayX")).setText(String.format("%.2f", picX));
|
||||
((LabelFixedFont)this.getWidget("LayoutY").getWidget("ValueDisplayY")).setText(String.format("%.2f", picY));
|
||||
((LabelFixedFont)this.getWidget("LayoutAlpha").getWidget("ValueDisplayAlpha")).setText(String.format("%.2f", picAlpha));
|
||||
((LabelFixedFont)this.getWidget("LayoutScale").getWidget("ValueDisplayScale")).setText(String.format("%.2f", scale));
|
||||
|
||||
this.getWidget("Layout").getWidget("Picture").setAlpha(picAlpha);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IWidget getWidgetAtCoordinates(double posX, double posY){
|
||||
if (this.getWidget("Layout").getWidget("Picture").isWidgetAtCoordinates(posX, posY))
|
||||
return this.getWidget("Layout").getWidget("Picture");
|
||||
else
|
||||
return super.getWidgetAtCoordinates(posX, posY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMouseClick(MouseEvent event){
|
||||
//System.out.println(this.getWidgetAtCoordinates(event.x, event.y));
|
||||
|
||||
if ((event.button == 0) && (this.getWidget("Layout").getWidget("Picture").isWidgetAtCoordinates(event.x, event.y))){
|
||||
this.getWidget("Layout").getWidget("Picture").onMouseClick(event);
|
||||
this.draggedWidget = this.getWidget("Layout").getWidget("Picture");
|
||||
}
|
||||
else
|
||||
super.onMouseClick(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMouseDrag(MouseEvent event){
|
||||
|
||||
//if ((this.getWidgetAtCoordinates(event.x, event.y) == this) && (this.draggedWidget != null)){
|
||||
if (this.draggedWidget != null){
|
||||
this.draggedWidget.onMouseDrag(event);
|
||||
} else {
|
||||
super.onMouseDrag(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMouseRelease(MouseEvent event){
|
||||
if (event.button == 0)
|
||||
this.draggedWidget = null;
|
||||
super.onMouseRelease(event);
|
||||
}
|
||||
|
||||
|
||||
private void updateData(){
|
||||
((LabelFixedFont)this.getWidget("LayoutX").getWidget("ValueDisplayX")).setText(String.format("%.2f", this.getWidget("Layout").getWidget("Picture").getGeometry().getRawPos().getX()));
|
||||
((LabelFixedFont)this.getWidget("LayoutY").getWidget("ValueDisplayY")).setText(String.format("%.2f", this.getWidget("Layout").getWidget("Picture").getGeometry().getRawPos().getY()));
|
||||
((LabelFixedFont)this.getWidget("LayoutAlpha").getWidget("ValueDisplayAlpha")).setText(String.format("%.2f", this.getWidget("Layout").getWidget("Picture").getAlpha()));
|
||||
((LabelFixedFont)this.getWidget("LayoutScale").getWidget("ValueDisplayScale")).setText(String.format("%.2f", scale));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWidgetEvent(IWidget srcwidget, Signal signal, Object... params){
|
||||
|
||||
if (this.getWidget("Layout") == null) return;
|
||||
|
||||
if (srcwidget.equals(this.getWidget("Layout").getWidget("Picture")) && signal == Signal.DRAGGED){
|
||||
this.draggedWidget = this.getWidget("Layout").getWidget("Picture");
|
||||
this.updateData();
|
||||
}
|
||||
|
||||
if (signal == Signal.CLICKED){
|
||||
|
||||
IWidget picture = this.getWidget("Layout").getWidget("Picture");
|
||||
double pictureX = picture.getGeometry().getRawPos().getX();
|
||||
double pictureY = picture.getGeometry().getRawPos().getY();
|
||||
double pixelToPercentX = 100.0D / picture.getParent().getSize().getX();
|
||||
double pixelToPercentY = 100.0D / picture.getParent().getSize().getY();
|
||||
|
||||
if (srcwidget.equals(this.getWidget("LayoutX").getWidget("ButtonXAdd"))){
|
||||
double newPos = Math.min(pictureX + pixelToPercentX, 100.0);
|
||||
picture.setPos(newPos, pictureY);
|
||||
}
|
||||
|
||||
if (srcwidget.equals(this.getWidget("LayoutX").getWidget("ButtonXSub"))){
|
||||
double newPos = Math.max(pictureX - pixelToPercentX, 0.0);
|
||||
picture.setPos(newPos, pictureY);
|
||||
}
|
||||
|
||||
if (srcwidget.equals(this.getWidget("LayoutY").getWidget("ButtonYAdd"))){
|
||||
double newPos = Math.min(pictureY + pixelToPercentY, 100.0);
|
||||
picture.setPos(pictureX, newPos);
|
||||
}
|
||||
|
||||
if (srcwidget.equals(this.getWidget("LayoutY").getWidget("ButtonYSub"))){
|
||||
double newPos = Math.max(pictureY - pixelToPercentY, 0.0);
|
||||
picture.setPos(pictureX, newPos);
|
||||
}
|
||||
|
||||
if (srcwidget.equals(this.getWidget("LayoutAlpha").getWidget("ButtonAlphaAdd")))
|
||||
picture.setAlpha(Math.min(picture.getAlpha() + 0.05f, 1.0f));
|
||||
|
||||
if (srcwidget.equals(this.getWidget("LayoutAlpha").getWidget("ButtonAlphaSub")))
|
||||
picture.setAlpha(Math.max(picture.getAlpha() - 0.05f, 0.0f));
|
||||
|
||||
if (srcwidget.equals(this.getWidget("LayoutScale").getWidget("ButtonScaleAdd"))){
|
||||
scale += 0.05f;
|
||||
scale = Math.max(0.10f, scale);
|
||||
scale = Math.min(2.00f, scale);
|
||||
|
||||
int picSX = (int)(180 / this.rez.getScaleFactor() * scale), picSY = (int)(62 / this.rez.getScaleFactor() * scale);
|
||||
picture.setSize(picSX, picSY);
|
||||
((LayoutMargin)this.getWidget("Layout")).setMargins(picSX/2, picSX/2, picSY/2, picSY/2);
|
||||
}
|
||||
|
||||
if (srcwidget.equals(this.getWidget("LayoutScale").getWidget("ButtonScaleSub"))){
|
||||
scale -= 0.05f;
|
||||
scale = Math.max(0.10f, scale);
|
||||
scale = Math.min(2.00f, scale);
|
||||
|
||||
int picSX = (int)(180 / this.rez.getScaleFactor() * scale), picSY = (int)(62 / this.rez.getScaleFactor() * scale);
|
||||
picture.setSize(picSX, picSY);
|
||||
((LayoutMargin)this.getWidget("Layout")).setMargins(picSX/2, picSX/2, picSY/2, picSY/2);
|
||||
}
|
||||
|
||||
//picture.emit(Signal.DRAGGED, picture.getPos());
|
||||
this.updateData();
|
||||
|
||||
}
|
||||
if (srcwidget.equals(this.getWidget("ButtonOk")) && signal == Signal.CLICKED){
|
||||
ConfigHandler.instance().setConfigInt(Constants.CFG_WAILA_POSX, (int)(this.getWidget("Layout").getWidget("Picture").getGeometry().getRawPos().getX() * 100.0));
|
||||
ConfigHandler.instance().setConfigInt(Constants.CFG_WAILA_POSY, (int)(this.getWidget("Layout").getWidget("Picture").getGeometry().getRawPos().getY() * 100.0));
|
||||
ConfigHandler.instance().setConfigInt(Constants.CFG_WAILA_ALPHA, (int)(this.getWidget("Layout").getWidget("Picture").getAlpha() * 100.0));
|
||||
ConfigHandler.instance().setConfigInt(Constants.CFG_WAILA_SCALE, (int)(scale * 100.0));
|
||||
|
||||
mod_Waila.alpha = ConfigHandler.instance().getConfigInt(Constants.CFG_WAILA_ALPHA);
|
||||
mod_Waila.posX = ConfigHandler.instance().getConfigInt(Constants.CFG_WAILA_POSX);
|
||||
mod_Waila.posY = ConfigHandler.instance().getConfigInt(Constants.CFG_WAILA_POSY);
|
||||
mod_Waila.scale = ConfigHandler.instance().getConfigInt(Constants.CFG_WAILA_SCALE) / 100.0f;
|
||||
|
||||
mod_Waila.updateColors();
|
||||
}
|
||||
|
||||
if (srcwidget.equals(this.getWidget("ButtonDefault")) && signal == Signal.CLICKED){
|
||||
this.getWidget("Layout").getWidget("Picture").setPos(50.0, 1.0);
|
||||
this.getWidget("Layout").getWidget("Picture").setAlpha(0.8f);
|
||||
this.scale = 1.0f;
|
||||
int picSX = (int)(180 / this.rez.getScaleFactor() * scale), picSY = (int)(62 / this.rez.getScaleFactor() * scale);
|
||||
this.getWidget("Layout").getWidget("Picture").setSize(picSX, picSY);
|
||||
((LayoutMargin)this.getWidget("Layout")).setMargins(picSX/2, picSX/2, picSY/2, picSY/2);
|
||||
|
||||
this.updateData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ScreenHUDConfig(GuiScreen parent){
|
||||
super(parent);
|
||||
|
||||
this.getRoot().addWidget("EventCanvas", new EventCanvas(this.getRoot(), parent));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package mcp.mobius.waila.gui.screens.config;
|
||||
|
||||
import mcp.mobius.waila.addons.ConfigHandler;
|
||||
import mcp.mobius.waila.gui.interfaces.CType;
|
||||
import mcp.mobius.waila.gui.interfaces.WAlign;
|
||||
import mcp.mobius.waila.gui.screens.ScreenBase;
|
||||
import mcp.mobius.waila.gui.widgets.LayoutBase;
|
||||
import mcp.mobius.waila.gui.widgets.WidgetGeometry;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonContainer;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonScreenChange;
|
||||
import mcp.mobius.waila.gui_old.widget_old.ButtonChangeScreen;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
public class ScreenModuleChoice extends ScreenBase {
|
||||
|
||||
public ScreenModuleChoice(GuiScreen parent){
|
||||
super(parent);
|
||||
|
||||
this.getRoot().addWidget("ButtonContainer", new ButtonContainer(this.getRoot(), 3, 100, 25.0));
|
||||
this.getRoot().getWidget("ButtonContainer").setGeometry(new WidgetGeometry(50.0, 20.0, 400.0, 60.0, CType.RELXY, CType.REL_Y, WAlign.CENTER, WAlign.TOP));
|
||||
|
||||
ButtonContainer buttonContainer = ((ButtonContainer)this.getRoot().getWidget("ButtonContainer"));
|
||||
|
||||
for (String key : ConfigHandler.instance().getModuleNames())
|
||||
buttonContainer.addButton( new ButtonScreenChange(this.getRoot(), key, new ScreenModuleConfig(this, key)));
|
||||
|
||||
this.getRoot().addWidget("LayoutBack", new LayoutBase(this.getRoot()));
|
||||
this.getRoot().getWidget("LayoutBack").setGeometry(new WidgetGeometry(0.0, 80.0, 100.0, 20.0, CType.RELXY, CType.RELXY));
|
||||
this.getRoot().getWidget("LayoutBack").addWidget("ButtonBack", new ButtonScreenChange(this.getRoot().getWidget("LayoutBack"), "Back", this.parent));
|
||||
this.getRoot().getWidget("LayoutBack").getWidget("ButtonBack").setGeometry(new WidgetGeometry(50.0, 50.0, 100.0, 20.0, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package mcp.mobius.waila.gui.screens.config;
|
||||
|
||||
import mcp.mobius.waila.addons.ConfigHandler;
|
||||
import mcp.mobius.waila.gui.interfaces.CType;
|
||||
import mcp.mobius.waila.gui.interfaces.WAlign;
|
||||
import mcp.mobius.waila.gui.screens.ScreenBase;
|
||||
import mcp.mobius.waila.gui.widgets.LayoutBase;
|
||||
import mcp.mobius.waila.gui.widgets.WidgetGeometry;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonBooleanConfig;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonBooleanConfigRemote;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonContainer;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonContainerLabel;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonScreenChange;
|
||||
import mcp.mobius.waila.gui_old.widget_old.ButtonConfigOption;
|
||||
import mcp.mobius.waila.gui_old.widget_old.ButtonConfigRemote;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
public class ScreenModuleConfig extends ScreenBase {
|
||||
|
||||
private String modName;
|
||||
|
||||
public ScreenModuleConfig(GuiScreen parent, String modname){
|
||||
super(parent);
|
||||
|
||||
this.modName = modname;
|
||||
|
||||
this.getRoot().addWidget("ButtonContainer", new ButtonContainerLabel(this.getRoot(), 2, 100, 25.0));
|
||||
this.getRoot().getWidget("ButtonContainer").setGeometry(new WidgetGeometry(0.0, 20.0, 100.0, 60.0, CType.RELXY, CType.RELXY, WAlign.LEFT, WAlign.TOP));
|
||||
|
||||
ButtonContainerLabel buttonContainer = ((ButtonContainerLabel)this.getRoot().getWidget("ButtonContainer"));
|
||||
|
||||
for (String key:ConfigHandler.instance().getConfigKeys(this.modName).keySet()){
|
||||
if (ConfigHandler.instance().isServerRequired(key))
|
||||
buttonContainer.addButton(new ButtonBooleanConfigRemote(this.getRoot(), key, "screen.button.no", "screen.button.yes"), ConfigHandler.instance().getConfigKeys(this.modName).get(key));
|
||||
else
|
||||
buttonContainer.addButton(new ButtonBooleanConfig(this.getRoot(), key, "screen.button.no", "screen.button.yes"), ConfigHandler.instance().getConfigKeys(this.modName).get(key));
|
||||
//buttonContainer.addButton(new ButtonConfigRemote(-1, "No", "Yes", ConfigHandler.instance().getConfigKeys(this.modName).get(key), key ));
|
||||
//else
|
||||
//buttonContainer.addButton(new ButtonConfigOption(-1, "No", "Yes", ConfigHandler.instance().getConfigKeys(this.modName).get(key), key ));
|
||||
}
|
||||
|
||||
this.getRoot().addWidget("LayoutBack", new LayoutBase(this.getRoot()));
|
||||
this.getRoot().getWidget("LayoutBack").setGeometry(new WidgetGeometry(0.0, 80.0, 100.0, 20.0, CType.RELXY, CType.RELXY));
|
||||
this.getRoot().getWidget("LayoutBack").addWidget("ButtonBack", new ButtonScreenChange(this.getRoot().getWidget("LayoutBack"), "screen.button.back", this.parent));
|
||||
this.getRoot().getWidget("LayoutBack").getWidget("ButtonBack").setGeometry(new WidgetGeometry(50.0, 50.0, 100.0, 20.0, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package mcp.mobius.waila.gui.screens.config;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import mcp.mobius.waila.Constants;
|
||||
import mcp.mobius.waila.gui.interfaces.CType;
|
||||
import mcp.mobius.waila.gui.interfaces.WAlign;
|
||||
import mcp.mobius.waila.gui.screens.ScreenBase;
|
||||
import mcp.mobius.waila.gui.widgets.LayoutBase;
|
||||
import mcp.mobius.waila.gui.widgets.WidgetGeometry;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonBooleanConfig;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonContainerLabel;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonIntegerConfig;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonScreenChange;
|
||||
|
||||
public class ScreenWailaConfig extends ScreenBase {
|
||||
public ScreenWailaConfig(GuiScreen parent){
|
||||
super(parent);
|
||||
|
||||
this.getRoot().addWidget("ButtonContainer", new ButtonContainerLabel(this.getRoot(), 2, 100, 25.0));
|
||||
this.getRoot().getWidget("ButtonContainer").setGeometry(new WidgetGeometry(0.0, 10.0, 100.0, 50.0, CType.RELXY, CType.RELXY));
|
||||
|
||||
ButtonContainerLabel buttonContainer = ((ButtonContainerLabel)this.getRoot().getWidget("ButtonContainer"));
|
||||
|
||||
buttonContainer.addButton( new ButtonBooleanConfig(this.getRoot(), Constants.CFG_WAILA_SHOW, true, true, "screen.button.hidden", "screen.button.visible"), "choice.showhidewaila");
|
||||
buttonContainer.addButton( new ButtonBooleanConfig(this.getRoot(), Constants.CFG_WAILA_MODE, true, true, "screen.button.maintained", "screen.button.toggled"), "choice.toggledmaintained");
|
||||
buttonContainer.addButton( new ButtonBooleanConfig(this.getRoot(), Constants.CFG_WAILA_METADATA, true, false,"screen.button.hidden", "screen.button.visible"), "choice.showhideidmeta");
|
||||
buttonContainer.addButton( new ButtonBooleanConfig(this.getRoot(), Constants.CFG_WAILA_LIQUID, true, false,"screen.button.hidden", "screen.button.visible"), "choice.showliquids");
|
||||
|
||||
|
||||
this.getRoot().addWidget("LayoutConfigPos", new LayoutBase(this.getRoot()));
|
||||
this.getRoot().getWidget("LayoutConfigPos").setGeometry(new WidgetGeometry(0.0, 50.0, 100.0, 20.0, CType.RELXY, CType.RELXY));
|
||||
this.getRoot().getWidget("LayoutConfigPos").addWidget("ButtonConfigPos", new ButtonScreenChange(null, "screen.button.configureaspect", new ScreenHUDConfig(this)));
|
||||
this.getRoot().getWidget("LayoutConfigPos").getWidget("ButtonConfigPos").setGeometry(new WidgetGeometry(50.0, 50.0, 150.0, 20.0, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
|
||||
|
||||
this.getRoot().addWidget("LayoutBack", new LayoutBase(this.getRoot()));
|
||||
this.getRoot().getWidget("LayoutBack").setGeometry(new WidgetGeometry(0.0, 80.0, 100.0, 20.0, CType.RELXY, CType.RELXY));
|
||||
this.getRoot().getWidget("LayoutBack").addWidget("ButtonBack", new ButtonScreenChange(null, "screen.button.back", this.parent));
|
||||
this.getRoot().getWidget("LayoutBack").getWidget("ButtonBack").setGeometry(new WidgetGeometry(50.0, 50.0, 100.0, 20.0, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.CENTER));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package mcp.mobius.waila.gui.screens.info;
|
||||
|
||||
import codechicken.lib.lang.LangUtil;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import mcp.mobius.waila.gui.interfaces.CType;
|
||||
import mcp.mobius.waila.gui.interfaces.WAlign;
|
||||
import mcp.mobius.waila.gui.screens.ScreenBase;
|
||||
import mcp.mobius.waila.gui.widgets.ItemStackDisplay;
|
||||
import mcp.mobius.waila.gui.widgets.LabelFixedFont;
|
||||
import mcp.mobius.waila.gui.widgets.LayoutBase;
|
||||
import mcp.mobius.waila.gui.widgets.ViewTable;
|
||||
import mcp.mobius.waila.gui.widgets.WidgetGeometry;
|
||||
|
||||
public class ScreenEnchants extends ScreenBase {
|
||||
|
||||
public ScreenEnchants(GuiScreen parent) {
|
||||
super(parent);
|
||||
|
||||
this.getRoot().addWidget("Layout_Title", new LayoutBase(null))
|
||||
.setGeometry(new WidgetGeometry(50.0, 10.0, 50.0, 32.0, CType.REL_X, CType.REL_X, WAlign.CENTER, WAlign.TOP));
|
||||
|
||||
this.getRoot().getWidget("Layout_Title").addWidget("ItemStack", new ItemStackDisplay(null))
|
||||
.setGeometry(new WidgetGeometry(0.0, 0.0, 32.0, 32.0, CType.ABSXY, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
|
||||
|
||||
this.getRoot().getWidget("Layout_Title").addWidget("LabelName", new LabelFixedFont(null, "None"))
|
||||
.setGeometry(new WidgetGeometry(40.0, 4.0, 16.0, 16.0, CType.ABSXY, CType.ABSXY, WAlign.LEFT, WAlign.TOP));
|
||||
|
||||
this.getRoot().getWidget("Layout_Title").addWidget("LabelEnchantability", new LabelFixedFont(null, "None"))
|
||||
.setGeometry(new WidgetGeometry(40.0, 22.0, 16.0, 16.0, CType.ABSXY, CType.REL_X, WAlign.LEFT, WAlign.BOTTOM));
|
||||
|
||||
this.getRoot().addWidget("Table", new ViewTable(null))
|
||||
.setGeometry(new WidgetGeometry(50.0, 50.0, 90.0, 80.0, CType.REL_X, CType.RELXY, WAlign.CENTER, WAlign.TOP));
|
||||
|
||||
String columnName = "\u00a7a\u00a7o" + LangUtil.translateG("enchant.title.name");
|
||||
String columnMinLvl= "\u00a7a\u00a7o" + LangUtil.translateG("enchant.title.minlvl");;
|
||||
String columnMaxLvl= "\u00a7a\u00a7o" + LangUtil.translateG("enchant.title.maxlvl");;
|
||||
String columnWeight= "\u00a7a\u00a7o" + LangUtil.translateG("enchant.title.weight");;
|
||||
|
||||
((ViewTable)this.getRoot().getWidget("Table"))
|
||||
.setColumnsTitle(columnName, columnMinLvl, columnMaxLvl, columnWeight, "\u00a7a\u00a7oMod")
|
||||
.setColumnsWidth(35.0, 10.0, 10.0, 10.0, 35.0)
|
||||
.setColumnsAlign(WAlign.LEFT, WAlign.CENTER, WAlign.CENTER, WAlign.CENTER, WAlign.LEFT);
|
||||
}
|
||||
|
||||
public ViewTable getTable(){
|
||||
return (ViewTable)this.getRoot().getWidget("Table");
|
||||
}
|
||||
|
||||
public ScreenEnchants addRow(String...strings ){
|
||||
this.getTable().addRow(strings);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ScreenEnchants setStack(ItemStack stack){
|
||||
((ItemStackDisplay)this.getRoot().getWidget("Layout_Title").getWidget("ItemStack")).setStack(stack);
|
||||
this.getRoot().getWidget("Layout_Title").adjustSize();
|
||||
return this;
|
||||
}
|
||||
|
||||
public ScreenEnchants setName(String name){
|
||||
((LabelFixedFont)this.getRoot().getWidget("Layout_Title").getWidget("LabelName")).setText(name);
|
||||
this.getRoot().getWidget("Layout_Title").adjustSize();
|
||||
return this;
|
||||
}
|
||||
|
||||
public ScreenEnchants setEnchantability(String value){
|
||||
((LabelFixedFont)this.getRoot().getWidget("Layout_Title").getWidget("LabelEnchantability")).setText(String.format("%s : %s", LangUtil.translateG("enchant.label.enchantability"), value));
|
||||
this.getRoot().getWidget("Layout_Title").adjustSize();
|
||||
return this;
|
||||
}
|
||||
|
||||
/*
|
||||
public ScreenEnchants setStack(ItemStack stack){
|
||||
((ItemStackDisplay)this.getRoot().getWidget("ItemStack")).setStack(stack);
|
||||
return this;
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package mcp.mobius.waila.gui.testing;
|
||||
|
||||
import org.lwjgl.util.Point;
|
||||
|
||||
import mcp.mobius.waila.gui.events.MouseEvent;
|
||||
import mcp.mobius.waila.gui.helpers.UIException;
|
||||
import mcp.mobius.waila.gui.interfaces.CType;
|
||||
import mcp.mobius.waila.gui.interfaces.IWidget;
|
||||
import mcp.mobius.waila.gui.interfaces.WAlign;
|
||||
import mcp.mobius.waila.gui.screens.ScreenBase;
|
||||
import mcp.mobius.waila.gui.widgets.ItemStackDisplay;
|
||||
import mcp.mobius.waila.gui.widgets.LabelFixedFont;
|
||||
import mcp.mobius.waila.gui.widgets.LayoutBase;
|
||||
import mcp.mobius.waila.gui.widgets.LayoutCropping;
|
||||
import mcp.mobius.waila.gui.widgets.PictureDisplay;
|
||||
import mcp.mobius.waila.gui.widgets.PictureSwitch;
|
||||
import mcp.mobius.waila.gui.widgets.ViewTable;
|
||||
import mcp.mobius.waila.gui.widgets.ViewportScrollable;
|
||||
import mcp.mobius.waila.gui.widgets.WidgetBase;
|
||||
import mcp.mobius.waila.gui.widgets.WidgetGeometry;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonBoolean;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonContainerLabel;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonInteger;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonIntegerConfig;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonScreenChange;
|
||||
import mcp.mobius.waila.gui.widgets.movable.PictureMovableRC;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ScreenTest extends ScreenBase {
|
||||
|
||||
public ScreenTest(GuiScreen parent) {
|
||||
super(parent);
|
||||
|
||||
this.getRoot().addWidget("Test", new ViewTable(null))
|
||||
.setGeometry(new WidgetGeometry(50.0, 50.0, 90.0, 90.0, CType.RELXY, CType.RELXY, WAlign.CENTER, WAlign.CENTER));
|
||||
((ViewTable)this.getRoot().getWidget("Test"))
|
||||
.setColumnsTitle("Column1","Column2","Column3")
|
||||
.setColumnsWidth(30.0,30.0,30.0)
|
||||
.setColumnsAlign(WAlign.CENTER, WAlign.CENTER, WAlign.CENTER)
|
||||
.addRow("test1", "test2", "test3")
|
||||
.addRow("test1", "test2", "test3")
|
||||
.addRow("test1", "test2", "test3")
|
||||
.addRow("test1", "test2", "test3")
|
||||
.addRow("test1", "test2", "test3")
|
||||
.addRow("test1", "test2", "test3")
|
||||
.addRow("test1", "test2", "test3")
|
||||
.addRow("test1", "test2", "test3")
|
||||
.addRow("test1", "test2", "test3")
|
||||
.addRow("test1", "test2", "test3");
|
||||
|
||||
|
||||
/*
|
||||
this.getRoot().addWidget("Test", new Row(null)).setGeometry(new WidgetGeometry(50.0, 50.0, 90.0, 20.0, CType.RELXY, CType.REL_X, WAlign.CENTER, WAlign.CENTER));
|
||||
((Row)this.getRoot().getWidget("Test")).setColumnsText("aabbbbbbbbbbbbbbbbbbbbbbbbb","bb","cc");
|
||||
((Row)this.getRoot().getWidget("Test")).setColumnsWidth(30.0,30.0,30.0);
|
||||
((Row)this.getRoot().getWidget("Test")).setColumnsAlign(WAlign.LEFT, WAlign.CENTER, WAlign.CENTER);
|
||||
*/
|
||||
|
||||
|
||||
//this.getRoot().addWidget("TestLayout", new LayoutBase(null)).setGeometry(new WidgetGeometry(50.0, 50.0, 90.0, 90.0, CType.RELXY, CType.RELXY, WAlign.CENTER, WAlign.CENTER));
|
||||
//((LayoutBase)this.getRoot().getWidget("TestLayout")).setBackgroundColors(0xff505050, 0xff505050);
|
||||
|
||||
//this.getRoot().addWidget("Layout", new ViewportScrollable(null)).setGeometry(new WidgetGeometry(50.0,50.0,75.0,75.0,CType.RELXY, CType.RELXY, WAlign.CENTER, WAlign.CENTER));
|
||||
//((ViewportScrollable)this.getRoot().getWidget("Layout")).attachWidget(new PictureSwitch(this.getRoot(), "waila:textures/test.png", "waila:textures/test_solar.png")).setSize(900, 900);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package mcp.mobius.waila.gui.testing;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import mcp.mobius.waila.gui.interfaces.CType;
|
||||
import mcp.mobius.waila.gui.interfaces.WAlign;
|
||||
import mcp.mobius.waila.gui.screens.ScreenBase;
|
||||
import mcp.mobius.waila.gui.widgets.LabelFixedFont;
|
||||
import mcp.mobius.waila.gui.widgets.WidgetGeometry;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonContainerLabel;
|
||||
import mcp.mobius.waila.gui.widgets.buttons.ButtonIntegerConfig;
|
||||
|
||||
public class ScreenTest2 extends ScreenBase {
|
||||
|
||||
public ScreenTest2(GuiScreen parent) {
|
||||
super(parent);
|
||||
//this.getRoot().addWidget("Picture", new PictureSwitch(this.getRoot(), "waila:textures/test.png", "waila:textures/test_solar.png"));
|
||||
//this.getRoot().addWidget("Button", new ButtonInteger(this.getRoot(), "Val0", "Val1", "Val2"));
|
||||
//this.getRoot().getWidget("Button").setGeometry(new WidgetGeometry(50.0D, 50.0D, 100.0D, 20.0D, true, false, WidgetAlign.CENTER, WidgetAlign.CENTER));
|
||||
|
||||
this.getRoot().addWidget("Buttons", new ButtonContainerLabel(this.getRoot(), 2, 100, 30.0));
|
||||
this.getRoot().getWidget("Buttons").setGeometry(new WidgetGeometry(0.0, 0.0, 100.0, 50.0, CType.RELXY, CType.RELXY));
|
||||
|
||||
//((ButtonContainer)this.getRoot().getWidget("Buttons")).addButton(new ButtonIntegerConfig(this.getRoot(), "testconfig", true, 0, "Val0", "Val1", "Val2"));
|
||||
|
||||
this.getRoot().addWidget("Text", new LabelFixedFont(this.getRoot(), "waila:textures/test.png"));
|
||||
this.getRoot().getWidget("Text").setGeometry(new WidgetGeometry(50.0D, 10.0D, 50.0D, 50.0D, CType.RELXY, CType.ABSXY, WAlign.CENTER, WAlign.TOP));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package mcp.mobius.waila.gui.truetyper;
|
||||
|
||||
/**
|
||||
* TrueTyper: Open Source TTF implementation for Minecraft.
|
||||
* Copyright (C) 2013 - Mr_okushama
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import java.nio.FloatBuffer;
|
||||
|
||||
import org.lwjgl.BufferUtils;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.util.vector.Matrix4f;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraftforge.client.GuiIngameForge;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
public class FontHelper {
|
||||
|
||||
private static String formatEscape = "\u00A7";
|
||||
|
||||
|
||||
public static void drawString(String s, float x, float y, TrueTypeFont font, float scaleX, float scaleY, float... rgba){
|
||||
drawString(s,x,y,font,scaleX,scaleY,0,rgba);
|
||||
|
||||
}
|
||||
|
||||
public static void drawString(String s, float x, float y, TrueTypeFont font, float scaleX, float scaleY, float rotationZ, float... rgba){
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
ScaledResolution sr = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
|
||||
if(mc.gameSettings.hideGUI){
|
||||
return;
|
||||
}
|
||||
int amt = 1;
|
||||
if(sr.getScaleFactor() == 1){
|
||||
amt = 2;
|
||||
}
|
||||
|
||||
FloatBuffer matrixData = BufferUtils.createFloatBuffer(16);
|
||||
GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, matrixData);
|
||||
FontHelper.set2DMode(matrixData);
|
||||
GL11.glPushMatrix();
|
||||
y = mc.displayHeight-(y*sr.getScaleFactor())-(((font.getLineHeight()/amt)));
|
||||
float tx = (x*sr.getScaleFactor())+(font.getWidth(s)/2);
|
||||
float tranx = tx+2;
|
||||
float trany = y+(font.getLineHeight()/2);
|
||||
GL11.glTranslatef(tranx,trany,0);
|
||||
GL11.glRotatef(rotationZ, 0f, 0f, 1f);
|
||||
GL11.glTranslatef(-tranx,-trany,0);
|
||||
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
if(s.contains(formatEscape)){
|
||||
String[] pars = s.split(formatEscape);
|
||||
float totalOffset = 0;
|
||||
for(int i = 0; i < pars.length; i++){
|
||||
String par = pars[i];
|
||||
float[] c = rgba;
|
||||
if(i > 0){
|
||||
c = Formatter.getFormatted(par.charAt(0));
|
||||
par = par.substring(1, par.length());
|
||||
}
|
||||
font.drawString((x*sr.getScaleFactor()+totalOffset), y, par, scaleX/amt, scaleY/amt, c);
|
||||
totalOffset += font.getWidth(par);
|
||||
}
|
||||
}else{
|
||||
font.drawString((x*sr.getScaleFactor()), y, s, scaleX/amt, scaleY/amt, rgba);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
FontHelper.set3DMode();
|
||||
}
|
||||
|
||||
private static void set2DMode(FloatBuffer matrixData) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
ScaledResolution sr = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
|
||||
mc.entityRenderer.setupOverlayRendering();
|
||||
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
||||
GL11.glPushMatrix();
|
||||
//GL11.glLoadMatrix(matrixData);
|
||||
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glOrtho(0, mc.displayWidth, 0, mc.displayHeight, -1, 1);
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glLoadIdentity();
|
||||
|
||||
Matrix4f matrix = new Matrix4f();
|
||||
matrix.load(matrixData);
|
||||
GL11.glTranslatef(matrix.m30*sr.getScaleFactor(),-matrix.m31*sr.getScaleFactor(), 0f);
|
||||
|
||||
}
|
||||
|
||||
private static void set3DMode() {
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
||||
GL11.glPopMatrix();
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
mc.entityRenderer.setupOverlayRendering();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package mcp.mobius.waila.gui.truetyper;
|
||||
|
||||
/**
|
||||
* TrueTyper: Open Source TTF implementation for Minecraft.
|
||||
* Copyright (C) 2013 - Mr_okushama
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import java.awt.Font;
|
||||
import java.awt.FontFormatException;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class FontLoader{
|
||||
|
||||
public static TrueTypeFont loadSystemFont(String name, float defSize, boolean antialias){
|
||||
return loadSystemFont(name, defSize, antialias, Font.TRUETYPE_FONT);
|
||||
|
||||
}
|
||||
|
||||
public static TrueTypeFont loadSystemFont(String name, float defSize, boolean antialias, int type){
|
||||
Font font;
|
||||
TrueTypeFont out = null;
|
||||
try {
|
||||
font = new Font(name, type, (int)defSize);
|
||||
font = font.deriveFont(defSize);
|
||||
out = new TrueTypeFont(font, antialias);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
public static TrueTypeFont createFont(ResourceLocation res, float defSize, boolean antialias){
|
||||
return createFont(res, defSize, antialias, Font.TRUETYPE_FONT);
|
||||
}
|
||||
|
||||
public static TrueTypeFont createFont(ResourceLocation res, float defSize, boolean antialias, int type){
|
||||
Font font;
|
||||
TrueTypeFont out = null;
|
||||
try {
|
||||
font = Font.createFont(type, Minecraft.getMinecraft().func_110442_L().func_110536_a(res).func_110527_b());
|
||||
font = font.deriveFont(defSize);
|
||||
out = new TrueTypeFont(font, antialias);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package mcp.mobius.waila.gui.truetyper;
|
||||
|
||||
/**
|
||||
* TrueTyper: Open Source TTF implementation for Minecraft.
|
||||
* Copyright (C) 2013 - Mr_okushama
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
public class Formatter {
|
||||
|
||||
public static float[] getFormatted(char c){
|
||||
int[] outrgba = null;
|
||||
float[] outfloat;
|
||||
switch(c){
|
||||
case '0':
|
||||
outrgba = new int[]{0,0,0,0,255};
|
||||
break;
|
||||
case '1':
|
||||
outrgba = new int[]{0,0,170,255};
|
||||
break;
|
||||
case '2':
|
||||
outrgba = new int[]{0,170,0,255};
|
||||
break;
|
||||
case '3':
|
||||
outrgba = new int[]{0,170,170,255};
|
||||
break;
|
||||
case '4':
|
||||
outrgba = new int[]{170,0,0,255};
|
||||
break;
|
||||
case '5':
|
||||
outrgba = new int[]{170,0,170,255};
|
||||
break;
|
||||
case '6':
|
||||
outrgba = new int[]{255,170,0,255};
|
||||
break;
|
||||
case '7':
|
||||
outrgba = new int[]{170,170,170,255};
|
||||
break;
|
||||
case '8':
|
||||
outrgba = new int[]{85,85,85,255};
|
||||
break;
|
||||
case '9':
|
||||
outrgba = new int[]{85,85,255,255};
|
||||
break;
|
||||
case 'a':
|
||||
outrgba = new int[]{85,255,85,255};
|
||||
break;
|
||||
case 'b':
|
||||
outrgba = new int[]{85,255,255,255};
|
||||
break;
|
||||
case 'c':
|
||||
outrgba = new int[]{255,85,85,255};
|
||||
break;
|
||||
case 'd':
|
||||
outrgba = new int[]{85,255,255,255};
|
||||
break;
|
||||
case 'e':
|
||||
outrgba = new int[]{255,255,85,255};
|
||||
break;
|
||||
case 'f':
|
||||
outrgba = new int[]{255,255,255,255};
|
||||
break;
|
||||
default:
|
||||
outrgba = new int[]{255,255,255,255};
|
||||
break;
|
||||
}
|
||||
outfloat = new float[outrgba.length];
|
||||
for(int i = 0; i < outrgba.length ; i++){
|
||||
outfloat[i] = outrgba[i] > 0 ? outrgba[i]/255 : 0;
|
||||
}
|
||||
return outfloat;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package mcp.mobius.waila.gui.truetyper;
|
||||
|
||||
/**
|
||||
* TrueTyper: Open Source TTF implementation for Minecraft.
|
||||
* Copyright (C) 2013 - Mr_okushama
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import java.awt.Font;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class Test {
|
||||
|
||||
public static ArrayList<TrueTypeFont> testFonts = new ArrayList<TrueTypeFont>();
|
||||
public static float[] white = {1f,1f,1f,1f};
|
||||
public static boolean init = false;
|
||||
public static void initTest(){
|
||||
return;
|
||||
/*
|
||||
GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||
Font[] fonts = e.getAllFonts();
|
||||
{
|
||||
int max = 9;
|
||||
for(Font f : fonts){
|
||||
boolean pass = true;
|
||||
for(TrueTypeFont ttf : testFonts){
|
||||
if(ttf.font.getFontName().startsWith(f.getFontName().substring(0, 1))){
|
||||
pass = false;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if(pass){
|
||||
max--;
|
||||
if(max == 0){
|
||||
break;
|
||||
}
|
||||
testFonts.add(FontLoader.loadSystemFont(f.getFontName(), 24f, false));
|
||||
testFonts.add(FontLoader.loadSystemFont(f.getFontName(), 24f, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
init = true;
|
||||
|
||||
}
|
||||
|
||||
public static void doTest(){
|
||||
if(!init){
|
||||
initTest();
|
||||
}
|
||||
for(int i =0; i < testFonts.size(); i++){
|
||||
int y = 10+i*12;
|
||||
int x = 10;
|
||||
FontHelper.drawString("He"+EnumChatFormatting.GOLD+"llo "+EnumChatFormatting.GREEN+"wor"+EnumChatFormatting.YELLOW+"ld", x, y, testFonts.get(i), 1f, 1f);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,507 @@
|
||||
package mcp.mobius.waila.gui.truetyper;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
import java.awt.FontMetrics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.RenderingHints;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.DataBuffer;
|
||||
import java.awt.image.DataBufferByte;
|
||||
import java.awt.image.DataBufferInt;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.nio.IntBuffer;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
|
||||
import org.lwjgl.BufferUtils;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
import org.lwjgl.opengl.GL30;
|
||||
import org.lwjgl.util.glu.GLU;
|
||||
|
||||
|
||||
/**
|
||||
* TrueTyper: Open Source TTF implementation for Minecraft.
|
||||
* Modified from Slick2D - under BSD Licensing - http://slick.ninjacave.com/license/
|
||||
*
|
||||
* Copyright (c) 2013 - Slick2D
|
||||
*
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
public class TrueTypeFont {
|
||||
public final static int
|
||||
ALIGN_LEFT = 0,
|
||||
ALIGN_RIGHT = 1,
|
||||
ALIGN_CENTER = 2;
|
||||
/** Array that holds necessary information about the font characters */
|
||||
private FloatObject[] charArray = new FloatObject[256];
|
||||
|
||||
/** Map of user defined font characters (Character <-> IntObject) */
|
||||
private Map customChars = new HashMap();
|
||||
|
||||
/** Boolean flag on whether AntiAliasing is enabled or not */
|
||||
protected boolean antiAlias;
|
||||
|
||||
/** Font's size */
|
||||
private float fontSize = 0;
|
||||
|
||||
/** Font's height */
|
||||
private float fontHeight = 0;
|
||||
|
||||
/** Texture used to cache the font 0-255 characters */
|
||||
private int fontTextureID;
|
||||
|
||||
/** Default font texture width */
|
||||
private int textureWidth = 1024;
|
||||
|
||||
/** Default font texture height */
|
||||
private int textureHeight = 1024;
|
||||
|
||||
/** A reference to Java's AWT Font that we create our font texture from */
|
||||
protected Font font;
|
||||
|
||||
/** The font metrics for our Java AWT font */
|
||||
private FontMetrics fontMetrics;
|
||||
|
||||
|
||||
private int correctL = 9, correctR = 8;
|
||||
|
||||
private class FloatObject {
|
||||
/** Character's width */
|
||||
public float width;
|
||||
|
||||
/** Character's height */
|
||||
public float height;
|
||||
|
||||
/** Character's stored x position */
|
||||
public float storedX;
|
||||
|
||||
/** Character's stored y position */
|
||||
public float storedY;
|
||||
}
|
||||
|
||||
|
||||
public TrueTypeFont(Font font, boolean antiAlias, char[] additionalChars) {
|
||||
this.font = font;
|
||||
this.fontSize = font.getSize()+3;
|
||||
this.antiAlias = antiAlias;
|
||||
|
||||
createSet( additionalChars );
|
||||
System.out.println("TrueTypeFont loaded: "+font+" - AntiAlias = "+antiAlias);
|
||||
fontHeight -= 1;
|
||||
if (fontHeight <= 0) fontHeight = 1;
|
||||
}
|
||||
|
||||
public TrueTypeFont(Font font, boolean antiAlias) {
|
||||
this( font, antiAlias, null );
|
||||
}
|
||||
public void setCorrection(boolean on) {
|
||||
if (on) {
|
||||
correctL = 2;
|
||||
correctR = 1;
|
||||
} else {
|
||||
correctL = 0;
|
||||
correctR = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private BufferedImage getFontImage(char ch) {
|
||||
// Create a temporary image to extract the character's size
|
||||
BufferedImage tempfontImage = new BufferedImage(1, 1,
|
||||
BufferedImage.TYPE_INT_ARGB);
|
||||
Graphics2D g = (Graphics2D) tempfontImage.getGraphics();
|
||||
if (antiAlias == true) {
|
||||
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
|
||||
RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
}
|
||||
g.setFont(font);
|
||||
fontMetrics = g.getFontMetrics();
|
||||
float charwidth = fontMetrics.charWidth(ch)+8;
|
||||
|
||||
if (charwidth <= 0) {
|
||||
charwidth = 7;
|
||||
}
|
||||
float charheight = fontMetrics.getHeight()+3;
|
||||
if (charheight <= 0) {
|
||||
charheight = fontSize;
|
||||
}
|
||||
|
||||
// Create another image holding the character we are creating
|
||||
BufferedImage fontImage;
|
||||
fontImage = new BufferedImage((int)charwidth,(int)charheight,
|
||||
BufferedImage.TYPE_INT_ARGB);
|
||||
Graphics2D gt = (Graphics2D) fontImage.getGraphics();
|
||||
if (antiAlias == true) {
|
||||
gt.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
|
||||
RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
}
|
||||
gt.setFont(font);
|
||||
|
||||
gt.setColor(Color.WHITE);
|
||||
int charx = 3;
|
||||
int chary = 1;
|
||||
gt.drawString(String.valueOf(ch), (charx), (chary)
|
||||
+ fontMetrics.getAscent());
|
||||
|
||||
return fontImage;
|
||||
|
||||
}
|
||||
|
||||
private void createSet( char[] customCharsArray ) {
|
||||
// If there are custom chars then I expand the font texture twice
|
||||
if (customCharsArray != null && customCharsArray.length > 0) {
|
||||
textureWidth *= 2;
|
||||
}
|
||||
|
||||
// In any case this should be done in other way. Texture with size 512x512
|
||||
// can maintain only 256 characters with resolution of 32x32. The texture
|
||||
// size should be calculated dynamicaly by looking at character sizes.
|
||||
|
||||
try {
|
||||
|
||||
BufferedImage imgTemp = new BufferedImage(textureWidth, textureHeight, BufferedImage.TYPE_INT_ARGB);
|
||||
Graphics2D g = (Graphics2D) imgTemp.getGraphics();
|
||||
|
||||
g.setColor(new Color(0,0,0,1));
|
||||
g.fillRect(0,0,textureWidth,textureHeight);
|
||||
|
||||
float rowHeight = 0;
|
||||
float positionX = 0;
|
||||
float positionY = 0;
|
||||
|
||||
int customCharsLength = ( customCharsArray != null ) ? customCharsArray.length : 0;
|
||||
|
||||
for (int i = 0; i < 256 + customCharsLength; i++) {
|
||||
|
||||
// get 0-255 characters and then custom characters
|
||||
char ch = ( i < 256 ) ? (char) i : customCharsArray[i-256];
|
||||
|
||||
BufferedImage fontImage = getFontImage(ch);
|
||||
|
||||
FloatObject newIntObject = new FloatObject();
|
||||
|
||||
newIntObject.width = fontImage.getWidth();
|
||||
newIntObject.height = fontImage.getHeight();
|
||||
|
||||
if (positionX + newIntObject.width >= textureWidth) {
|
||||
positionX = 0;
|
||||
positionY += rowHeight;
|
||||
rowHeight = 0;
|
||||
}
|
||||
|
||||
newIntObject.storedX = positionX;
|
||||
newIntObject.storedY = positionY;
|
||||
|
||||
if (newIntObject.height > fontHeight) {
|
||||
fontHeight = newIntObject.height;
|
||||
}
|
||||
|
||||
if (newIntObject.height > rowHeight) {
|
||||
rowHeight = newIntObject.height;
|
||||
}
|
||||
|
||||
// Draw it here
|
||||
g.drawImage(fontImage, (int)positionX, (int)positionY, null);
|
||||
|
||||
positionX += newIntObject.width;
|
||||
|
||||
if( i < 256 ) { // standard characters
|
||||
charArray[i] = newIntObject;
|
||||
} else { // custom characters
|
||||
customChars.put( new Character( ch ), newIntObject );
|
||||
}
|
||||
|
||||
fontImage = null;
|
||||
}
|
||||
|
||||
fontTextureID = loadImage(imgTemp);
|
||||
|
||||
|
||||
|
||||
//.getTexture(font.toString(), imgTemp);
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("Failed to create font.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void drawQuad(float drawX, float drawY, float drawX2, float drawY2,
|
||||
float srcX, float srcY, float srcX2, float srcY2) {
|
||||
float DrawWidth = drawX2 - drawX;
|
||||
float DrawHeight = drawY2 - drawY;
|
||||
float TextureSrcX= srcX / textureWidth;
|
||||
float TextureSrcY = srcY / textureHeight;
|
||||
float SrcWidth = srcX2 - srcX;
|
||||
float SrcHeight = srcY2 - srcY;
|
||||
float RenderWidth = (SrcWidth / textureWidth);
|
||||
float RenderHeight = (SrcHeight / textureHeight);
|
||||
Tessellator t = Tessellator.instance;
|
||||
|
||||
//t.setColorRGBA_F(0f, 0f, 0f, 1f);
|
||||
|
||||
t.addVertexWithUV(drawX, drawY, 0, TextureSrcX, TextureSrcY);
|
||||
//GL11.glTexCoord2f(TextureSrcX, TextureSrcY);
|
||||
//GL11.glVertex2f(drawX, drawY);
|
||||
|
||||
t.addVertexWithUV(drawX, drawY + DrawHeight, 0, TextureSrcX, TextureSrcY + RenderHeight);
|
||||
//GL11.glTexCoord2f(TextureSrcX, TextureSrcY + RenderHeight);
|
||||
//GL11.glVertex2f(drawX, drawY + DrawHeight);
|
||||
|
||||
t.addVertexWithUV(drawX + DrawWidth, drawY + DrawHeight, 0, TextureSrcX + RenderWidth, TextureSrcY + RenderHeight);
|
||||
//GL11.glTexCoord2f(TextureSrcX + RenderWidth, TextureSrcY + RenderHeight);
|
||||
//GL11.glVertex2f(drawX + DrawWidth, drawY + DrawHeight);
|
||||
|
||||
t.addVertexWithUV(drawX + DrawWidth, drawY, 0, TextureSrcX + RenderWidth, TextureSrcY);
|
||||
//GL11.glTexCoord2f(TextureSrcX + RenderWidth, TextureSrcY);
|
||||
//GL11.glVertex2f(drawX + DrawWidth, drawY);
|
||||
}
|
||||
|
||||
public float getWidth(String whatchars) {
|
||||
float totalwidth = 0;
|
||||
FloatObject floatObject = null;
|
||||
int currentChar = 0;
|
||||
float lastWidth = -10f;
|
||||
for (int i = 0; i < whatchars.length(); i++) {
|
||||
currentChar = whatchars.charAt(i);
|
||||
if (currentChar < 256) {
|
||||
floatObject = charArray[currentChar];
|
||||
} else {
|
||||
floatObject = (FloatObject)customChars.get( new Character( (char) currentChar ) );
|
||||
}
|
||||
|
||||
if( floatObject != null ){
|
||||
totalwidth += floatObject.width/2;
|
||||
lastWidth = floatObject.width;
|
||||
}
|
||||
}
|
||||
//System.out.println("Size: "+totalwidth);
|
||||
return this.fontMetrics.stringWidth(whatchars);
|
||||
//return (totalwidth);
|
||||
}
|
||||
|
||||
public float getHeight() {
|
||||
return fontHeight;
|
||||
}
|
||||
|
||||
|
||||
public float getHeight(String HeightString) {
|
||||
return fontHeight;
|
||||
}
|
||||
|
||||
public float getLineHeight() {
|
||||
return fontHeight;
|
||||
}
|
||||
|
||||
public void drawString(float x, float y, String whatchars, float scaleX, float scaleY, float... rgba) {
|
||||
if(rgba.length == 0) rgba = new float[]{1f,1f,1f,1f};
|
||||
drawString(x,y,whatchars, 0, whatchars.length()-1, scaleX, scaleY, ALIGN_LEFT, rgba);
|
||||
}
|
||||
public void drawString(float x, float y, String whatchars, float scaleX, float scaleY, int format, float... rgba) {
|
||||
if(rgba.length == 0) rgba = new float[]{1f,1f,1f,1f};
|
||||
|
||||
drawString(x,y,whatchars, 0, whatchars.length()-1, scaleX, scaleY, format, rgba);
|
||||
}
|
||||
|
||||
|
||||
public void drawString(float x, float y, String whatchars, int startIndex, int endIndex, float scaleX, float scaleY, int format, float... rgba) {
|
||||
if(rgba.length == 0) rgba = new float[]{1f,1f,1f,1f};
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef (scaleX, scaleY, 1.0f);
|
||||
|
||||
FloatObject floatObject = null;
|
||||
int charCurrent;
|
||||
|
||||
|
||||
float totalwidth = 0;
|
||||
int i = startIndex, d, c;
|
||||
float startY = 0;
|
||||
|
||||
|
||||
|
||||
switch (format) {
|
||||
case ALIGN_RIGHT: {
|
||||
d = -1;
|
||||
c = correctR;
|
||||
|
||||
while (i < endIndex) {
|
||||
if (whatchars.charAt(i) == '\n') startY -= fontHeight;
|
||||
i++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ALIGN_CENTER: {
|
||||
for (int l = startIndex; l <= endIndex; l++) {
|
||||
charCurrent = whatchars.charAt(l);
|
||||
if (charCurrent == '\n') break;
|
||||
if (charCurrent < 256) {
|
||||
floatObject = charArray[charCurrent];
|
||||
} else {
|
||||
floatObject = (FloatObject)customChars.get( new Character( (char) charCurrent ) );
|
||||
}
|
||||
totalwidth += floatObject.width-correctL;
|
||||
}
|
||||
totalwidth /= -2;
|
||||
}
|
||||
case ALIGN_LEFT:
|
||||
default: {
|
||||
d = 1;
|
||||
c = correctL;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, fontTextureID);
|
||||
Tessellator t = Tessellator.instance;
|
||||
t.startDrawingQuads();
|
||||
// GL11.glBegin(GL11.GL_QUADS);
|
||||
if(rgba.length == 4)
|
||||
t.setColorRGBA_F(rgba[0], rgba[1], rgba[2], rgba[3]);
|
||||
while (i >= startIndex && i <= endIndex) {
|
||||
|
||||
charCurrent = whatchars.charAt(i);
|
||||
if (charCurrent < 256) {
|
||||
floatObject = charArray[charCurrent];
|
||||
} else {
|
||||
floatObject = (FloatObject)customChars.get( new Character( (char) charCurrent ) );
|
||||
}
|
||||
|
||||
if( floatObject != null ) {
|
||||
if (d < 0) totalwidth += (floatObject.width-c) * d;
|
||||
if (charCurrent == '\n') {
|
||||
startY -= fontHeight * d;
|
||||
totalwidth = 0;
|
||||
if (format == ALIGN_CENTER) {
|
||||
for (int l = i+1; l <= endIndex; l++) {
|
||||
charCurrent = whatchars.charAt(l);
|
||||
if (charCurrent == '\n') break;
|
||||
if (charCurrent < 256) {
|
||||
floatObject = charArray[charCurrent];
|
||||
} else {
|
||||
floatObject = (FloatObject)customChars.get( new Character( (char) charCurrent ) );
|
||||
}
|
||||
totalwidth += floatObject.width-correctL;
|
||||
}
|
||||
totalwidth /= -2;
|
||||
}
|
||||
//if center get next lines total width/2;
|
||||
}
|
||||
else {
|
||||
drawQuad((totalwidth + floatObject.width) + x/scaleX,
|
||||
startY + y/scaleY,
|
||||
totalwidth + x/scaleX,
|
||||
(startY + floatObject.height) + y/scaleY,
|
||||
floatObject.storedX + floatObject.width,
|
||||
floatObject.storedY + floatObject.height,
|
||||
floatObject.storedX,
|
||||
floatObject.storedY);
|
||||
if (d > 0) totalwidth += (floatObject.width-c) * d ;
|
||||
}
|
||||
i += d;
|
||||
|
||||
}
|
||||
}
|
||||
t.draw();
|
||||
// GL11.glEnd();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
public static int loadImage(BufferedImage bufferedImage) {
|
||||
try {
|
||||
short width = (short)bufferedImage.getWidth();
|
||||
short height = (short)bufferedImage.getHeight();
|
||||
//textureLoader.bpp = bufferedImage.getColorModel().hasAlpha() ? (byte)32 : (byte)24;
|
||||
int bpp = (byte)bufferedImage.getColorModel().getPixelSize();
|
||||
ByteBuffer byteBuffer;
|
||||
DataBuffer db = bufferedImage.getData().getDataBuffer();
|
||||
if (db instanceof DataBufferInt) {
|
||||
int intI[] = ((DataBufferInt)(bufferedImage.getData().getDataBuffer())).getData();
|
||||
byte newI[] = new byte[intI.length * 4];
|
||||
for (int i = 0; i < intI.length; i++) {
|
||||
byte b[] = intToByteArray(intI[i]);
|
||||
int newIndex = i*4;
|
||||
|
||||
newI[newIndex] = b[1];
|
||||
newI[newIndex+1] = b[2];
|
||||
newI[newIndex+2] = b[3];
|
||||
newI[newIndex+3] = b[0];
|
||||
}
|
||||
|
||||
byteBuffer = ByteBuffer.allocateDirect(
|
||||
width*height*(bpp/8))
|
||||
.order(ByteOrder.nativeOrder())
|
||||
.put(newI);
|
||||
} else {
|
||||
byteBuffer = ByteBuffer.allocateDirect(
|
||||
width*height*(bpp/8))
|
||||
.order(ByteOrder.nativeOrder())
|
||||
.put(((DataBufferByte)(bufferedImage.getData().getDataBuffer())).getData());
|
||||
}
|
||||
byteBuffer.flip();
|
||||
|
||||
|
||||
int internalFormat = GL11.GL_RGBA8,
|
||||
format = GL11.GL_RGBA;
|
||||
IntBuffer textureId = BufferUtils.createIntBuffer(1);;
|
||||
GL11.glGenTextures(textureId);
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureId.get(0));
|
||||
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP);
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP);
|
||||
|
||||
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
|
||||
//GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
|
||||
//GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR_MIPMAP_NEAREST);
|
||||
|
||||
//GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR_MIPMAP_LINEAR);
|
||||
//GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST_MIPMAP_LINEAR);
|
||||
//GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST_MIPMAP_NEAREST);
|
||||
|
||||
GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_MODULATE);
|
||||
|
||||
GLU.gluBuild2DMipmaps(GL11.GL_TEXTURE_2D, internalFormat, width, height, format, GL11.GL_UNSIGNED_BYTE, byteBuffer);
|
||||
return textureId.get(0);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
public static boolean isSupported(String fontname) {
|
||||
Font font[] = getFonts();
|
||||
for (int i = font.length-1; i >= 0; i--) {
|
||||
if (font[i].getName().equalsIgnoreCase(fontname))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static Font[] getFonts() {
|
||||
return GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
|
||||
}
|
||||
public static byte[] intToByteArray(int value) {
|
||||
return new byte[] {
|
||||
(byte)(value >>> 24),
|
||||
(byte)(value >>> 16),
|
||||
(byte)(value >>> 8),
|
||||
(byte)value};
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
IntBuffer scratch = BufferUtils.createIntBuffer(1);
|
||||
scratch.put(0, fontTextureID);
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0);
|
||||
GL11.glDeleteTextures(scratch);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package mcp.mobius.waila.gui.widgets;
|
||||
|
||||
import mcp.mobius.waila.gui.interfaces.IWidget;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.util.Point;
|
||||
|
||||
import codechicken.nei.forge.GuiContainerManager;
|
||||
|
||||
public class ItemStackDisplay extends WidgetBase {
|
||||
|
||||
ItemStack stack = null;
|
||||
|
||||
public ItemStackDisplay(IWidget parent){
|
||||
this(parent, null);
|
||||
}
|
||||
|
||||
public ItemStackDisplay(IWidget parent, ItemStack stack){
|
||||
super(parent);
|
||||
this.stack = stack;
|
||||
this.setSize(16, 16);
|
||||
}
|
||||
|
||||
public void setStack(ItemStack stack){
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
public ItemStack getStack(){
|
||||
return this.stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Point pos) {
|
||||
if (this.stack == null) return;
|
||||
|
||||
float scaleX = this.getSize().getX()/16.0f;
|
||||
float scaleY = this.getSize().getY()/16.0f;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(scaleX, scaleY, 1.0f);
|
||||
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GuiContainerManager.drawItem((int)(pos.getX()/scaleX), (int)(pos.getY()/scaleX), this.stack);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
Loaded 100 of 163 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user