mirror of
https://github.com/GTNewHorizons/waila.git
synced 2026-11-24 22:14:40 +00:00
Compare commits
29
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bcb9174fa | ||
|
|
fae07b5ca2 | ||
|
|
bc46b8840d | ||
|
|
7d72e0680e | ||
|
|
ee237c3a44 | ||
|
|
4c4cb95782 | ||
|
|
9698692020 | ||
|
|
e7524e80f1 | ||
|
|
d682f65320 | ||
|
|
3801124648 | ||
|
|
2b73a517e8 | ||
|
|
50221c750b | ||
|
|
752dcd9986 | ||
|
|
2edac37178 | ||
|
|
85f2b035a4 | ||
|
|
4ee7d7396c | ||
|
|
d10840fc54 | ||
|
|
80cfdfd41e | ||
|
|
08a9f33dbb | ||
|
|
8023588d71 | ||
|
|
6ca097d5d0 | ||
|
|
fba608a2d1 | ||
|
|
f04bb197ac | ||
|
|
8b30294ae0 | ||
|
|
d4441c85ce | ||
|
|
c1480d632c | ||
|
|
8268d0a384 | ||
|
|
78eb719f06 | ||
|
|
0c73ed59c3 |
No files matched your search
@@ -0,0 +1,2 @@
|
|||||||
|
# Ignore spotlessApply reformat
|
||||||
|
4ee7d7396c8a27b994d49169140edbf9adfdc2dc
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
* text eol=lf
|
||||||
|
|
||||||
|
*.[jJ][aA][rR] binary
|
||||||
|
|
||||||
|
*.[pP][nN][gG] binary
|
||||||
|
*.[jJ][pP][gG] binary
|
||||||
|
*.[jJ][pP][eE][gG] binary
|
||||||
|
*.[gG][iI][fF] binary
|
||||||
|
*.[tT][iI][fF] binary
|
||||||
|
*.[tT][iI][fF][fF] binary
|
||||||
|
*.[iI][cC][oO] binary
|
||||||
|
*.[sS][vV][gG] text
|
||||||
|
*.[eE][pP][sS] binary
|
||||||
|
*.[xX][cC][fF] binary
|
||||||
|
|
||||||
|
*.[kK][aA][rR] binary
|
||||||
|
*.[mM]4[aA] binary
|
||||||
|
*.[mM][iI][dD] binary
|
||||||
|
*.[mM][iI][dD][iI] binary
|
||||||
|
*.[mM][pP]3 binary
|
||||||
|
*.[oO][gG][gG] binary
|
||||||
|
*.[rR][aA] binary
|
||||||
|
|
||||||
|
*.7[zZ] binary
|
||||||
|
*.[gG][zZ] binary
|
||||||
|
*.[tT][aA][rR] binary
|
||||||
|
*.[tT][gG][zZ] binary
|
||||||
|
*.[zZ][iI][pP] binary
|
||||||
|
|
||||||
|
*.[tT][cC][nN] binary
|
||||||
|
*.[sS][oO] binary
|
||||||
|
*.[dD][lL][lL] binary
|
||||||
|
*.[dD][yY][lL][iI][bB] binary
|
||||||
|
*.[pP][sS][dD] binary
|
||||||
|
*.[tT][tT][fF] binary
|
||||||
|
*.[oO][tT][fF] binary
|
||||||
|
|
||||||
|
*.[pP][aA][tT][cC][hH] -text
|
||||||
|
|
||||||
|
*.[bB][aA][tT] text eol=crlf
|
||||||
|
*.[cC][mM][dD] text eol=crlf
|
||||||
|
*.[pP][sS]1 text eol=crlf
|
||||||
|
|
||||||
|
*[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
directory="run/crash-reports"
|
|
||||||
if [ -d $directory ]; then
|
|
||||||
echo "Crash reports detected:"
|
|
||||||
cat $directory/*
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "No crash reports detected"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
|
|
||||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
|
||||||
|
|
||||||
name: Build and test
|
name: Build and test
|
||||||
|
|
||||||
@@ -11,35 +9,5 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
runs-on: ubuntu-latest
|
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master
|
||||||
steps:
|
secrets: inherit
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set up JDK 8
|
|
||||||
uses: actions/setup-java@v2
|
|
||||||
with:
|
|
||||||
java-version: '8'
|
|
||||||
distribution: 'adopt'
|
|
||||||
cache: gradle
|
|
||||||
|
|
||||||
- name: Grant execute permission for gradlew
|
|
||||||
run: chmod +x gradlew
|
|
||||||
|
|
||||||
- name: Setup the workspace
|
|
||||||
run: ./gradlew setupCIWorkspace
|
|
||||||
|
|
||||||
- name: Build the mod
|
|
||||||
run: ./gradlew build
|
|
||||||
|
|
||||||
- name: Run server for 1 minute
|
|
||||||
run: |
|
|
||||||
mkdir run
|
|
||||||
echo "eula=true" > run/eula.txt
|
|
||||||
timeout 10 ./gradlew runServer || true
|
|
||||||
|
|
||||||
- name: Test no crashes happend
|
|
||||||
run: |
|
|
||||||
chmod +x .github/scripts/test-no-crash-reports.sh
|
|
||||||
.github/scripts/test-no-crash-reports.sh
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
|
|
||||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
|
||||||
|
|
||||||
name: Release latest build
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master, main ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-release:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set release version
|
|
||||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Set up JDK 8
|
|
||||||
uses: actions/setup-java@v2
|
|
||||||
with:
|
|
||||||
java-version: '8'
|
|
||||||
distribution: 'adopt'
|
|
||||||
cache: gradle
|
|
||||||
|
|
||||||
- name: Grant execute permission for gradlew
|
|
||||||
run: chmod +x gradlew
|
|
||||||
|
|
||||||
- name: Setup the workspace
|
|
||||||
run: ./gradlew setupCIWorkspace
|
|
||||||
|
|
||||||
- name: Build the mod
|
|
||||||
run: ./gradlew build
|
|
||||||
|
|
||||||
- name: Update latest tag
|
|
||||||
uses: "marvinpinto/action-automatic-releases@latest"
|
|
||||||
with:
|
|
||||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
automatic_release_tag: "latest"
|
|
||||||
prerelease: false
|
|
||||||
title: "Latest build"
|
|
||||||
files: build/libs/*.jar
|
|
||||||
@@ -1,45 +1,14 @@
|
|||||||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
|
|
||||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
|
||||||
|
|
||||||
name: Release tagged build
|
name: Release tagged build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags: [ '*' ]
|
||||||
- '*'
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
release-tags:
|
||||||
runs-on: ubuntu-latest
|
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/release-tags.yml@master
|
||||||
steps:
|
secrets: inherit
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set release version
|
|
||||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Set up JDK 8
|
|
||||||
uses: actions/setup-java@v2
|
|
||||||
with:
|
|
||||||
java-version: '8'
|
|
||||||
distribution: 'adopt'
|
|
||||||
cache: gradle
|
|
||||||
|
|
||||||
- name: Grant execute permission for gradlew
|
|
||||||
run: chmod +x gradlew
|
|
||||||
|
|
||||||
- name: Setup the workspace
|
|
||||||
run: ./gradlew setupCIWorkspace
|
|
||||||
|
|
||||||
- name: Build the mod
|
|
||||||
run: ./gradlew build
|
|
||||||
|
|
||||||
- name: Release under current tag
|
|
||||||
uses: "marvinpinto/action-automatic-releases@latest"
|
|
||||||
with:
|
|
||||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
|
|
||||||
prerelease: false
|
|
||||||
title: "${{ env.RELEASE_VERSION }}"
|
|
||||||
files: build/libs/*.jar
|
|
||||||
@@ -26,3 +26,4 @@ whitelist.json
|
|||||||
*.ipr
|
*.ipr
|
||||||
*.iws
|
*.iws
|
||||||
src/main/resources/mixins.*.json
|
src/main/resources/mixins.*.json
|
||||||
|
*.bat
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# Any Github changes require admin approval
|
||||||
|
/.github/** @GTNewHorizons/admin
|
||||||
|
|
||||||
@@ -0,0 +1,437 @@
|
|||||||
|
Attribution-NonCommercial-ShareAlike 4.0 International
|
||||||
|
|
||||||
|
=======================================================================
|
||||||
|
|
||||||
|
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
||||||
|
does not provide legal services or legal advice. Distribution of
|
||||||
|
Creative Commons public licenses does not create a lawyer-client or
|
||||||
|
other relationship. Creative Commons makes its licenses and related
|
||||||
|
information available on an "as-is" basis. Creative Commons gives no
|
||||||
|
warranties regarding its licenses, any material licensed under their
|
||||||
|
terms and conditions, or any related information. Creative Commons
|
||||||
|
disclaims all liability for damages resulting from their use to the
|
||||||
|
fullest extent possible.
|
||||||
|
|
||||||
|
Using Creative Commons Public Licenses
|
||||||
|
|
||||||
|
Creative Commons public licenses provide a standard set of terms and
|
||||||
|
conditions that creators and other rights holders may use to share
|
||||||
|
original works of authorship and other material subject to copyright
|
||||||
|
and certain other rights specified in the public license below. The
|
||||||
|
following considerations are for informational purposes only, are not
|
||||||
|
exhaustive, and do not form part of our licenses.
|
||||||
|
|
||||||
|
Considerations for licensors: Our public licenses are
|
||||||
|
intended for use by those authorized to give the public
|
||||||
|
permission to use material in ways otherwise restricted by
|
||||||
|
copyright and certain other rights. Our licenses are
|
||||||
|
irrevocable. Licensors should read and understand the terms
|
||||||
|
and conditions of the license they choose before applying it.
|
||||||
|
Licensors should also secure all rights necessary before
|
||||||
|
applying our licenses so that the public can reuse the
|
||||||
|
material as expected. Licensors should clearly mark any
|
||||||
|
material not subject to the license. This includes other CC-
|
||||||
|
licensed material, or material used under an exception or
|
||||||
|
limitation to copyright. More considerations for licensors:
|
||||||
|
wiki.creativecommons.org/Considerations_for_licensors
|
||||||
|
|
||||||
|
Considerations for the public: By using one of our public
|
||||||
|
licenses, a licensor grants the public permission to use the
|
||||||
|
licensed material under specified terms and conditions. If
|
||||||
|
the licensor's permission is not necessary for any reason--for
|
||||||
|
example, because of any applicable exception or limitation to
|
||||||
|
copyright--then that use is not regulated by the license. Our
|
||||||
|
licenses grant only permissions under copyright and certain
|
||||||
|
other rights that a licensor has authority to grant. Use of
|
||||||
|
the licensed material may still be restricted for other
|
||||||
|
reasons, including because others have copyright or other
|
||||||
|
rights in the material. A licensor may make special requests,
|
||||||
|
such as asking that all changes be marked or described.
|
||||||
|
Although not required by our licenses, you are encouraged to
|
||||||
|
respect those requests where reasonable. More considerations
|
||||||
|
for the public:
|
||||||
|
wiki.creativecommons.org/Considerations_for_licensees
|
||||||
|
|
||||||
|
=======================================================================
|
||||||
|
|
||||||
|
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
|
||||||
|
Public License
|
||||||
|
|
||||||
|
By exercising the Licensed Rights (defined below), You accept and agree
|
||||||
|
to be bound by the terms and conditions of this Creative Commons
|
||||||
|
Attribution-NonCommercial-ShareAlike 4.0 International Public License
|
||||||
|
("Public License"). To the extent this Public License may be
|
||||||
|
interpreted as a contract, You are granted the Licensed Rights in
|
||||||
|
consideration of Your acceptance of these terms and conditions, and the
|
||||||
|
Licensor grants You such rights in consideration of benefits the
|
||||||
|
Licensor receives from making the Licensed Material available under
|
||||||
|
these terms and conditions.
|
||||||
|
|
||||||
|
|
||||||
|
Section 1 -- Definitions.
|
||||||
|
|
||||||
|
a. Adapted Material means material subject to Copyright and Similar
|
||||||
|
Rights that is derived from or based upon the Licensed Material
|
||||||
|
and in which the Licensed Material is translated, altered,
|
||||||
|
arranged, transformed, or otherwise modified in a manner requiring
|
||||||
|
permission under the Copyright and Similar Rights held by the
|
||||||
|
Licensor. For purposes of this Public License, where the Licensed
|
||||||
|
Material is a musical work, performance, or sound recording,
|
||||||
|
Adapted Material is always produced where the Licensed Material is
|
||||||
|
synched in timed relation with a moving image.
|
||||||
|
|
||||||
|
b. Adapter's License means the license You apply to Your Copyright
|
||||||
|
and Similar Rights in Your contributions to Adapted Material in
|
||||||
|
accordance with the terms and conditions of this Public License.
|
||||||
|
|
||||||
|
c. BY-NC-SA Compatible License means a license listed at
|
||||||
|
creativecommons.org/compatiblelicenses, approved by Creative
|
||||||
|
Commons as essentially the equivalent of this Public License.
|
||||||
|
|
||||||
|
d. Copyright and Similar Rights means copyright and/or similar rights
|
||||||
|
closely related to copyright including, without limitation,
|
||||||
|
performance, broadcast, sound recording, and Sui Generis Database
|
||||||
|
Rights, without regard to how the rights are labeled or
|
||||||
|
categorized. For purposes of this Public License, the rights
|
||||||
|
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
||||||
|
Rights.
|
||||||
|
|
||||||
|
e. Effective Technological Measures means those measures that, in the
|
||||||
|
absence of proper authority, may not be circumvented under laws
|
||||||
|
fulfilling obligations under Article 11 of the WIPO Copyright
|
||||||
|
Treaty adopted on December 20, 1996, and/or similar international
|
||||||
|
agreements.
|
||||||
|
|
||||||
|
f. Exceptions and Limitations means fair use, fair dealing, and/or
|
||||||
|
any other exception or limitation to Copyright and Similar Rights
|
||||||
|
that applies to Your use of the Licensed Material.
|
||||||
|
|
||||||
|
g. License Elements means the license attributes listed in the name
|
||||||
|
of a Creative Commons Public License. The License Elements of this
|
||||||
|
Public License are Attribution, NonCommercial, and ShareAlike.
|
||||||
|
|
||||||
|
h. Licensed Material means the artistic or literary work, database,
|
||||||
|
or other material to which the Licensor applied this Public
|
||||||
|
License.
|
||||||
|
|
||||||
|
i. Licensed Rights means the rights granted to You subject to the
|
||||||
|
terms and conditions of this Public License, which are limited to
|
||||||
|
all Copyright and Similar Rights that apply to Your use of the
|
||||||
|
Licensed Material and that the Licensor has authority to license.
|
||||||
|
|
||||||
|
j. Licensor means the individual(s) or entity(ies) granting rights
|
||||||
|
under this Public License.
|
||||||
|
|
||||||
|
k. NonCommercial means not primarily intended for or directed towards
|
||||||
|
commercial advantage or monetary compensation. For purposes of
|
||||||
|
this Public License, the exchange of the Licensed Material for
|
||||||
|
other material subject to Copyright and Similar Rights by digital
|
||||||
|
file-sharing or similar means is NonCommercial provided there is
|
||||||
|
no payment of monetary compensation in connection with the
|
||||||
|
exchange.
|
||||||
|
|
||||||
|
l. Share means to provide material to the public by any means or
|
||||||
|
process that requires permission under the Licensed Rights, such
|
||||||
|
as reproduction, public display, public performance, distribution,
|
||||||
|
dissemination, communication, or importation, and to make material
|
||||||
|
available to the public including in ways that members of the
|
||||||
|
public may access the material from a place and at a time
|
||||||
|
individually chosen by them.
|
||||||
|
|
||||||
|
m. Sui Generis Database Rights means rights other than copyright
|
||||||
|
resulting from Directive 96/9/EC of the European Parliament and of
|
||||||
|
the Council of 11 March 1996 on the legal protection of databases,
|
||||||
|
as amended and/or succeeded, as well as other essentially
|
||||||
|
equivalent rights anywhere in the world.
|
||||||
|
|
||||||
|
n. You means the individual or entity exercising the Licensed Rights
|
||||||
|
under this Public License. Your has a corresponding meaning.
|
||||||
|
|
||||||
|
|
||||||
|
Section 2 -- Scope.
|
||||||
|
|
||||||
|
a. License grant.
|
||||||
|
|
||||||
|
1. Subject to the terms and conditions of this Public License,
|
||||||
|
the Licensor hereby grants You a worldwide, royalty-free,
|
||||||
|
non-sublicensable, non-exclusive, irrevocable license to
|
||||||
|
exercise the Licensed Rights in the Licensed Material to:
|
||||||
|
|
||||||
|
a. reproduce and Share the Licensed Material, in whole or
|
||||||
|
in part, for NonCommercial purposes only; and
|
||||||
|
|
||||||
|
b. produce, reproduce, and Share Adapted Material for
|
||||||
|
NonCommercial purposes only.
|
||||||
|
|
||||||
|
2. Exceptions and Limitations. For the avoidance of doubt, where
|
||||||
|
Exceptions and Limitations apply to Your use, this Public
|
||||||
|
License does not apply, and You do not need to comply with
|
||||||
|
its terms and conditions.
|
||||||
|
|
||||||
|
3. Term. The term of this Public License is specified in Section
|
||||||
|
6(a).
|
||||||
|
|
||||||
|
4. Media and formats; technical modifications allowed. The
|
||||||
|
Licensor authorizes You to exercise the Licensed Rights in
|
||||||
|
all media and formats whether now known or hereafter created,
|
||||||
|
and to make technical modifications necessary to do so. The
|
||||||
|
Licensor waives and/or agrees not to assert any right or
|
||||||
|
authority to forbid You from making technical modifications
|
||||||
|
necessary to exercise the Licensed Rights, including
|
||||||
|
technical modifications necessary to circumvent Effective
|
||||||
|
Technological Measures. For purposes of this Public License,
|
||||||
|
simply making modifications authorized by this Section 2(a)
|
||||||
|
(4) never produces Adapted Material.
|
||||||
|
|
||||||
|
5. Downstream recipients.
|
||||||
|
|
||||||
|
a. Offer from the Licensor -- Licensed Material. Every
|
||||||
|
recipient of the Licensed Material automatically
|
||||||
|
receives an offer from the Licensor to exercise the
|
||||||
|
Licensed Rights under the terms and conditions of this
|
||||||
|
Public License.
|
||||||
|
|
||||||
|
b. Additional offer from the Licensor -- Adapted Material.
|
||||||
|
Every recipient of Adapted Material from You
|
||||||
|
automatically receives an offer from the Licensor to
|
||||||
|
exercise the Licensed Rights in the Adapted Material
|
||||||
|
under the conditions of the Adapter's License You apply.
|
||||||
|
|
||||||
|
c. No downstream restrictions. You may not offer or impose
|
||||||
|
any additional or different terms or conditions on, or
|
||||||
|
apply any Effective Technological Measures to, the
|
||||||
|
Licensed Material if doing so restricts exercise of the
|
||||||
|
Licensed Rights by any recipient of the Licensed
|
||||||
|
Material.
|
||||||
|
|
||||||
|
6. No endorsement. Nothing in this Public License constitutes or
|
||||||
|
may be construed as permission to assert or imply that You
|
||||||
|
are, or that Your use of the Licensed Material is, connected
|
||||||
|
with, or sponsored, endorsed, or granted official status by,
|
||||||
|
the Licensor or others designated to receive attribution as
|
||||||
|
provided in Section 3(a)(1)(A)(i).
|
||||||
|
|
||||||
|
b. Other rights.
|
||||||
|
|
||||||
|
1. Moral rights, such as the right of integrity, are not
|
||||||
|
licensed under this Public License, nor are publicity,
|
||||||
|
privacy, and/or other similar personality rights; however, to
|
||||||
|
the extent possible, the Licensor waives and/or agrees not to
|
||||||
|
assert any such rights held by the Licensor to the limited
|
||||||
|
extent necessary to allow You to exercise the Licensed
|
||||||
|
Rights, but not otherwise.
|
||||||
|
|
||||||
|
2. Patent and trademark rights are not licensed under this
|
||||||
|
Public License.
|
||||||
|
|
||||||
|
3. To the extent possible, the Licensor waives any right to
|
||||||
|
collect royalties from You for the exercise of the Licensed
|
||||||
|
Rights, whether directly or through a collecting society
|
||||||
|
under any voluntary or waivable statutory or compulsory
|
||||||
|
licensing scheme. In all other cases the Licensor expressly
|
||||||
|
reserves any right to collect such royalties, including when
|
||||||
|
the Licensed Material is used other than for NonCommercial
|
||||||
|
purposes.
|
||||||
|
|
||||||
|
|
||||||
|
Section 3 -- License Conditions.
|
||||||
|
|
||||||
|
Your exercise of the Licensed Rights is expressly made subject to the
|
||||||
|
following conditions.
|
||||||
|
|
||||||
|
a. Attribution.
|
||||||
|
|
||||||
|
1. If You Share the Licensed Material (including in modified
|
||||||
|
form), You must:
|
||||||
|
|
||||||
|
a. retain the following if it is supplied by the Licensor
|
||||||
|
with the Licensed Material:
|
||||||
|
|
||||||
|
i. identification of the creator(s) of the Licensed
|
||||||
|
Material and any others designated to receive
|
||||||
|
attribution, in any reasonable manner requested by
|
||||||
|
the Licensor (including by pseudonym if
|
||||||
|
designated);
|
||||||
|
|
||||||
|
ii. a copyright notice;
|
||||||
|
|
||||||
|
iii. a notice that refers to this Public License;
|
||||||
|
|
||||||
|
iv. a notice that refers to the disclaimer of
|
||||||
|
warranties;
|
||||||
|
|
||||||
|
v. a URI or hyperlink to the Licensed Material to the
|
||||||
|
extent reasonably practicable;
|
||||||
|
|
||||||
|
b. indicate if You modified the Licensed Material and
|
||||||
|
retain an indication of any previous modifications; and
|
||||||
|
|
||||||
|
c. indicate the Licensed Material is licensed under this
|
||||||
|
Public License, and include the text of, or the URI or
|
||||||
|
hyperlink to, this Public License.
|
||||||
|
|
||||||
|
2. You may satisfy the conditions in Section 3(a)(1) in any
|
||||||
|
reasonable manner based on the medium, means, and context in
|
||||||
|
which You Share the Licensed Material. For example, it may be
|
||||||
|
reasonable to satisfy the conditions by providing a URI or
|
||||||
|
hyperlink to a resource that includes the required
|
||||||
|
information.
|
||||||
|
3. If requested by the Licensor, You must remove any of the
|
||||||
|
information required by Section 3(a)(1)(A) to the extent
|
||||||
|
reasonably practicable.
|
||||||
|
|
||||||
|
b. ShareAlike.
|
||||||
|
|
||||||
|
In addition to the conditions in Section 3(a), if You Share
|
||||||
|
Adapted Material You produce, the following conditions also apply.
|
||||||
|
|
||||||
|
1. The Adapter's License You apply must be a Creative Commons
|
||||||
|
license with the same License Elements, this version or
|
||||||
|
later, or a BY-NC-SA Compatible License.
|
||||||
|
|
||||||
|
2. You must include the text of, or the URI or hyperlink to, the
|
||||||
|
Adapter's License You apply. You may satisfy this condition
|
||||||
|
in any reasonable manner based on the medium, means, and
|
||||||
|
context in which You Share Adapted Material.
|
||||||
|
|
||||||
|
3. You may not offer or impose any additional or different terms
|
||||||
|
or conditions on, or apply any Effective Technological
|
||||||
|
Measures to, Adapted Material that restrict exercise of the
|
||||||
|
rights granted under the Adapter's License You apply.
|
||||||
|
|
||||||
|
|
||||||
|
Section 4 -- Sui Generis Database Rights.
|
||||||
|
|
||||||
|
Where the Licensed Rights include Sui Generis Database Rights that
|
||||||
|
apply to Your use of the Licensed Material:
|
||||||
|
|
||||||
|
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
||||||
|
to extract, reuse, reproduce, and Share all or a substantial
|
||||||
|
portion of the contents of the database for NonCommercial purposes
|
||||||
|
only;
|
||||||
|
|
||||||
|
b. if You include all or a substantial portion of the database
|
||||||
|
contents in a database in which You have Sui Generis Database
|
||||||
|
Rights, then the database in which You have Sui Generis Database
|
||||||
|
Rights (but not its individual contents) is Adapted Material,
|
||||||
|
including for purposes of Section 3(b); and
|
||||||
|
|
||||||
|
c. You must comply with the conditions in Section 3(a) if You Share
|
||||||
|
all or a substantial portion of the contents of the database.
|
||||||
|
|
||||||
|
For the avoidance of doubt, this Section 4 supplements and does not
|
||||||
|
replace Your obligations under this Public License where the Licensed
|
||||||
|
Rights include other Copyright and Similar Rights.
|
||||||
|
|
||||||
|
|
||||||
|
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
||||||
|
|
||||||
|
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
||||||
|
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
||||||
|
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
||||||
|
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
||||||
|
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
||||||
|
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
||||||
|
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
||||||
|
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
||||||
|
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
||||||
|
|
||||||
|
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
||||||
|
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
||||||
|
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
||||||
|
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
||||||
|
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
||||||
|
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
||||||
|
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
||||||
|
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
||||||
|
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
||||||
|
|
||||||
|
c. The disclaimer of warranties and limitation of liability provided
|
||||||
|
above shall be interpreted in a manner that, to the extent
|
||||||
|
possible, most closely approximates an absolute disclaimer and
|
||||||
|
waiver of all liability.
|
||||||
|
|
||||||
|
|
||||||
|
Section 6 -- Term and Termination.
|
||||||
|
|
||||||
|
a. This Public License applies for the term of the Copyright and
|
||||||
|
Similar Rights licensed here. However, if You fail to comply with
|
||||||
|
this Public License, then Your rights under this Public License
|
||||||
|
terminate automatically.
|
||||||
|
|
||||||
|
b. Where Your right to use the Licensed Material has terminated under
|
||||||
|
Section 6(a), it reinstates:
|
||||||
|
|
||||||
|
1. automatically as of the date the violation is cured, provided
|
||||||
|
it is cured within 30 days of Your discovery of the
|
||||||
|
violation; or
|
||||||
|
|
||||||
|
2. upon express reinstatement by the Licensor.
|
||||||
|
|
||||||
|
For the avoidance of doubt, this Section 6(b) does not affect any
|
||||||
|
right the Licensor may have to seek remedies for Your violations
|
||||||
|
of this Public License.
|
||||||
|
|
||||||
|
c. For the avoidance of doubt, the Licensor may also offer the
|
||||||
|
Licensed Material under separate terms or conditions or stop
|
||||||
|
distributing the Licensed Material at any time; however, doing so
|
||||||
|
will not terminate this Public License.
|
||||||
|
|
||||||
|
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
||||||
|
License.
|
||||||
|
|
||||||
|
|
||||||
|
Section 7 -- Other Terms and Conditions.
|
||||||
|
|
||||||
|
a. The Licensor shall not be bound by any additional or different
|
||||||
|
terms or conditions communicated by You unless expressly agreed.
|
||||||
|
|
||||||
|
b. Any arrangements, understandings, or agreements regarding the
|
||||||
|
Licensed Material not stated herein are separate from and
|
||||||
|
independent of the terms and conditions of this Public License.
|
||||||
|
|
||||||
|
|
||||||
|
Section 8 -- Interpretation.
|
||||||
|
|
||||||
|
a. For the avoidance of doubt, this Public License does not, and
|
||||||
|
shall not be interpreted to, reduce, limit, restrict, or impose
|
||||||
|
conditions on any use of the Licensed Material that could lawfully
|
||||||
|
be made without permission under this Public License.
|
||||||
|
|
||||||
|
b. To the extent possible, if any provision of this Public License is
|
||||||
|
deemed unenforceable, it shall be automatically reformed to the
|
||||||
|
minimum extent necessary to make it enforceable. If the provision
|
||||||
|
cannot be reformed, it shall be severed from this Public License
|
||||||
|
without affecting the enforceability of the remaining terms and
|
||||||
|
conditions.
|
||||||
|
|
||||||
|
c. No term or condition of this Public License will be waived and no
|
||||||
|
failure to comply consented to unless expressly agreed to by the
|
||||||
|
Licensor.
|
||||||
|
|
||||||
|
d. Nothing in this Public License constitutes or may be interpreted
|
||||||
|
as a limitation upon, or waiver of, any privileges and immunities
|
||||||
|
that apply to the Licensor or You, including from the legal
|
||||||
|
processes of any jurisdiction or authority.
|
||||||
|
|
||||||
|
=======================================================================
|
||||||
|
|
||||||
|
Creative Commons is not a party to its public
|
||||||
|
licenses. Notwithstanding, Creative Commons may elect to apply one of
|
||||||
|
its public licenses to material it publishes and in those instances
|
||||||
|
will be considered the “Licensor.” The text of the Creative Commons
|
||||||
|
public licenses is dedicated to the public domain under the CC0 Public
|
||||||
|
Domain Dedication. Except for the limited purpose of indicating that
|
||||||
|
material is shared under a Creative Commons public license or as
|
||||||
|
otherwise permitted by the Creative Commons policies published at
|
||||||
|
creativecommons.org/policies, Creative Commons does not authorize the
|
||||||
|
use of the trademark "Creative Commons" or any other trademark or logo
|
||||||
|
of Creative Commons without its prior written consent including,
|
||||||
|
without limitation, in connection with any unauthorized modifications
|
||||||
|
to any of its public licenses or any other arrangements,
|
||||||
|
understandings, or agreements concerning use of licensed material. For
|
||||||
|
the avoidance of doubt, this paragraph does not form part of the
|
||||||
|
public licenses.
|
||||||
|
|
||||||
|
Creative Commons may be contacted at creativecommons.org.
|
||||||
+1403
-298
File diff suppressed because it is too large.
Load diff
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
// Add your dependencies here
|
// Add your dependencies here
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile("com.github.GTNewHorizons:NotEnoughItems:master-SNAPSHOT:dev")
|
implementation('com.github.GTNewHorizons:NotEnoughItems:2.4.13-GTNH:dev')
|
||||||
|
|
||||||
shadowImplementation("au.com.bytecode:opencsv:2.4")
|
shadowImplementation('au.com.bytecode:opencsv:2.4')
|
||||||
}
|
}
|
||||||
+9
-6
@@ -15,15 +15,15 @@ autoUpdateBuildScript = false
|
|||||||
minecraftVersion = 1.7.10
|
minecraftVersion = 1.7.10
|
||||||
forgeVersion = 10.13.4.1614
|
forgeVersion = 10.13.4.1614
|
||||||
|
|
||||||
# Select a username for testing your mod with breakpoints. You may leave this empty for a random user name each time you
|
# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you
|
||||||
# restart Minecraft in development. Choose this dependent on your mod:
|
# restart Minecraft in development. Choose this dependent on your mod:
|
||||||
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
|
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
|
||||||
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
|
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
|
||||||
developmentEnvironmentUserName = "Developer"
|
developmentEnvironmentUserName = Developer
|
||||||
|
|
||||||
# Define a source file of your project with:
|
# Define a source file of your project with:
|
||||||
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||||
# The string's content will be replaced with your mods version when compiled. You should use this to specify your mod's
|
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
|
||||||
# version in @Mod([...], version = VERSION, [...])
|
# version in @Mod([...], version = VERSION, [...])
|
||||||
# Leave these properties empty to skip individual token replacements
|
# Leave these properties empty to skip individual token replacements
|
||||||
replaceGradleTokenInFile = Waila.java
|
replaceGradleTokenInFile = Waila.java
|
||||||
@@ -37,9 +37,9 @@ gradleTokenGroupName =
|
|||||||
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
|
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
|
||||||
apiPackage = api
|
apiPackage = api
|
||||||
|
|
||||||
# Specify the configuration file for Forge's access transformers here. I must be placed into /src/main/resources/META-INF/
|
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
|
||||||
# Example value: mymodid_at.cfg
|
# Example value: mymodid_at.cfg
|
||||||
accessTransformersFile =
|
accessTransformersFile = Waila_at.cfg
|
||||||
|
|
||||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||||
usesMixins = false
|
usesMixins = false
|
||||||
@@ -48,7 +48,7 @@ mixinPlugin =
|
|||||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
||||||
mixinsPackage =
|
mixinsPackage =
|
||||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||||
# This parameter is for legacy compatability only
|
# This parameter is for legacy compatibility only
|
||||||
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
|
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
|
||||||
coreModClass =
|
coreModClass =
|
||||||
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
|
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
|
||||||
@@ -58,3 +58,6 @@ containsMixinsAndOrCoreModOnly = false
|
|||||||
# If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your
|
# If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your
|
||||||
# responsibility check the licence and request permission for distribution, if required.
|
# responsibility check the licence and request permission for distribution, if required.
|
||||||
usesShadowedDependencies = true
|
usesShadowedDependencies = true
|
||||||
|
|
||||||
|
# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories
|
||||||
|
includeWellKnownRepositories = true
|
||||||
Vendored
BIN
Binary file not shown.
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env sh
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright 2015 the original author or authors.
|
# Copyright © 2015-2021 the original authors.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@@ -17,78 +17,113 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
##
|
#
|
||||||
## Gradle start up script for UN*X
|
# Gradle start up script for POSIX generated by Gradle.
|
||||||
##
|
#
|
||||||
|
# Important for running:
|
||||||
|
#
|
||||||
|
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||||
|
# noncompliant, but you have some other compliant shell such as ksh or
|
||||||
|
# bash, then to run this script, type that shell name before the whole
|
||||||
|
# command line, like:
|
||||||
|
#
|
||||||
|
# ksh Gradle
|
||||||
|
#
|
||||||
|
# Busybox and similar reduced shells will NOT work, because this script
|
||||||
|
# requires all of these POSIX shell features:
|
||||||
|
# * functions;
|
||||||
|
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||||
|
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||||
|
# * compound commands having a testable exit status, especially «case»;
|
||||||
|
# * various built-in commands including «command», «set», and «ulimit».
|
||||||
|
#
|
||||||
|
# Important for patching:
|
||||||
|
#
|
||||||
|
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||||
|
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||||
|
#
|
||||||
|
# The "traditional" practice of packing multiple parameters into a
|
||||||
|
# space-separated string is a well documented source of bugs and security
|
||||||
|
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||||
|
# options in "$@", and eventually passing that to Java.
|
||||||
|
#
|
||||||
|
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||||
|
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||||
|
# see the in-line comments for details.
|
||||||
|
#
|
||||||
|
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||||
|
# Darwin, MinGW, and NonStop.
|
||||||
|
#
|
||||||
|
# (3) This script is generated from the Groovy template
|
||||||
|
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
|
# within the Gradle project.
|
||||||
|
#
|
||||||
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
# Attempt to set APP_HOME
|
# Attempt to set APP_HOME
|
||||||
# Resolve links: $0 may be a link
|
|
||||||
PRG="$0"
|
|
||||||
# Need this for relative symlinks.
|
|
||||||
while [ -h "$PRG" ] ; do
|
|
||||||
ls=`ls -ld "$PRG"`
|
|
||||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
||||||
if expr "$link" : '/.*' > /dev/null; then
|
|
||||||
PRG="$link"
|
|
||||||
else
|
|
||||||
PRG=`dirname "$PRG"`"/$link"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
SAVED="`pwd`"
|
|
||||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
|
||||||
APP_HOME="`pwd -P`"
|
|
||||||
cd "$SAVED" >/dev/null
|
|
||||||
|
|
||||||
APP_NAME="Gradle"
|
# Resolve links: $0 may be a link
|
||||||
APP_BASE_NAME=`basename "$0"`
|
app_path=$0
|
||||||
|
|
||||||
|
# Need this for daisy-chained symlinks.
|
||||||
|
while
|
||||||
|
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||||
|
[ -h "$app_path" ]
|
||||||
|
do
|
||||||
|
ls=$( ls -ld "$app_path" )
|
||||||
|
link=${ls#*' -> '}
|
||||||
|
case $link in #(
|
||||||
|
/*) app_path=$link ;; #(
|
||||||
|
*) app_path=$APP_HOME$link ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# This is normally unused
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
APP_BASE_NAME=${0##*/}
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD="maximum"
|
MAX_FD=maximum
|
||||||
|
|
||||||
warn () {
|
warn () {
|
||||||
echo "$*"
|
echo "$*"
|
||||||
}
|
} >&2
|
||||||
|
|
||||||
die () {
|
die () {
|
||||||
echo
|
echo
|
||||||
echo "$*"
|
echo "$*"
|
||||||
echo
|
echo
|
||||||
exit 1
|
exit 1
|
||||||
}
|
} >&2
|
||||||
|
|
||||||
# OS specific support (must be 'true' or 'false').
|
# OS specific support (must be 'true' or 'false').
|
||||||
cygwin=false
|
cygwin=false
|
||||||
msys=false
|
msys=false
|
||||||
darwin=false
|
darwin=false
|
||||||
nonstop=false
|
nonstop=false
|
||||||
case "`uname`" in
|
case "$( uname )" in #(
|
||||||
CYGWIN* )
|
CYGWIN* ) cygwin=true ;; #(
|
||||||
cygwin=true
|
Darwin* ) darwin=true ;; #(
|
||||||
;;
|
MSYS* | MINGW* ) msys=true ;; #(
|
||||||
Darwin* )
|
NONSTOP* ) nonstop=true ;;
|
||||||
darwin=true
|
|
||||||
;;
|
|
||||||
MINGW* )
|
|
||||||
msys=true
|
|
||||||
;;
|
|
||||||
NONSTOP* )
|
|
||||||
nonstop=true
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
if [ -n "$JAVA_HOME" ] ; then
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
# IBM's JDK on AIX uses strange locations for the executables
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||||
else
|
else
|
||||||
JAVACMD="$JAVA_HOME/bin/java"
|
JAVACMD=$JAVA_HOME/bin/java
|
||||||
fi
|
fi
|
||||||
if [ ! -x "$JAVACMD" ] ; then
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
@@ -97,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
|
|||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
JAVACMD="java"
|
JAVACMD=java
|
||||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
@@ -105,84 +140,105 @@ location of your Java installation."
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# Increase the maximum file descriptors if we can.
|
||||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
MAX_FD_LIMIT=`ulimit -H -n`
|
case $MAX_FD in #(
|
||||||
if [ $? -eq 0 ] ; then
|
max*)
|
||||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
MAX_FD="$MAX_FD_LIMIT"
|
# shellcheck disable=SC3045
|
||||||
fi
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
ulimit -n $MAX_FD
|
warn "Could not query maximum file descriptor limit"
|
||||||
if [ $? -ne 0 ] ; then
|
esac
|
||||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
case $MAX_FD in #(
|
||||||
fi
|
'' | soft) :;; #(
|
||||||
else
|
*)
|
||||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
fi
|
# shellcheck disable=SC3045
|
||||||
fi
|
ulimit -n "$MAX_FD" ||
|
||||||
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
# For Darwin, add options to specify how the application appears in the dock
|
|
||||||
if $darwin; then
|
|
||||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
||||||
fi
|
|
||||||
|
|
||||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
|
||||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
|
||||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
||||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
||||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
|
||||||
|
|
||||||
# We build the pattern for arguments to be converted via cygpath
|
|
||||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
||||||
SEP=""
|
|
||||||
for dir in $ROOTDIRSRAW ; do
|
|
||||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
||||||
SEP="|"
|
|
||||||
done
|
|
||||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
||||||
# Add a user-defined pattern to the cygpath arguments
|
|
||||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
||||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
||||||
fi
|
|
||||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
||||||
i=0
|
|
||||||
for arg in "$@" ; do
|
|
||||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
|
||||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
|
||||||
|
|
||||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
|
||||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
|
||||||
else
|
|
||||||
eval `echo args$i`="\"$arg\""
|
|
||||||
fi
|
|
||||||
i=$((i+1))
|
|
||||||
done
|
|
||||||
case $i in
|
|
||||||
(0) set -- ;;
|
|
||||||
(1) set -- "$args0" ;;
|
|
||||||
(2) set -- "$args0" "$args1" ;;
|
|
||||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
|
||||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
||||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
||||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
||||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
||||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
||||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Escape application args
|
# Collect all arguments for the java command, stacking in reverse order:
|
||||||
save () {
|
# * args from the command line
|
||||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
# * the main class name
|
||||||
echo " "
|
# * -classpath
|
||||||
}
|
# * -D...appname settings
|
||||||
APP_ARGS=$(save "$@")
|
# * --module-path (only if needed)
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||||
|
|
||||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
if "$cygwin" || "$msys" ; then
|
||||||
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
|
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||||
|
|
||||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
|
||||||
cd "$(dirname "$0")"
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
for arg do
|
||||||
|
if
|
||||||
|
case $arg in #(
|
||||||
|
-*) false ;; # don't mess with options #(
|
||||||
|
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||||
|
[ -e "$t" ] ;; #(
|
||||||
|
*) false ;;
|
||||||
|
esac
|
||||||
|
then
|
||||||
|
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||||
|
fi
|
||||||
|
# Roll the args list around exactly as many times as the number of
|
||||||
|
# args, so each arg winds up back in the position where it started, but
|
||||||
|
# possibly modified.
|
||||||
|
#
|
||||||
|
# NB: a `for` loop captures its iteration list before it begins, so
|
||||||
|
# changing the positional parameters here affects neither the number of
|
||||||
|
# iterations, nor the values presented in `arg`.
|
||||||
|
shift # remove old arg
|
||||||
|
set -- "$@" "$arg" # push replacement arg
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Collect all arguments for the java command;
|
||||||
|
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||||
|
# shell script including quotes and variable substitutions, so put them in
|
||||||
|
# double quotes to make sure that they get re-expanded; and
|
||||||
|
# * put everything else in single quotes, so that it's not re-expanded.
|
||||||
|
|
||||||
|
set -- \
|
||||||
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
-classpath "$CLASSPATH" \
|
||||||
|
org.gradle.wrapper.GradleWrapperMain \
|
||||||
|
"$@"
|
||||||
|
|
||||||
|
# Stop when "xargs" is not available.
|
||||||
|
if ! command -v xargs >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "xargs is not available"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use "xargs" to parse quoted args.
|
||||||
|
#
|
||||||
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
#
|
||||||
|
# In Bash we could simply go:
|
||||||
|
#
|
||||||
|
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||||
|
# set -- "${ARGS[@]}" "$@"
|
||||||
|
#
|
||||||
|
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||||
|
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||||
|
# character that might be a shell metacharacter, then use eval to reverse
|
||||||
|
# that process (while maintaining the separation between arguments), and wrap
|
||||||
|
# the whole thing up as a single "set" statement.
|
||||||
|
#
|
||||||
|
# This will of course break if any of these variables contains a newline or
|
||||||
|
# an unmatched quote.
|
||||||
|
#
|
||||||
|
|
||||||
|
eval "set -- $(
|
||||||
|
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||||
|
xargs -n1 |
|
||||||
|
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||||
|
tr '\n' ' '
|
||||||
|
)" '"$@"'
|
||||||
|
|
||||||
exec "$JAVACMD" "$@"
|
exec "$JAVACMD" "$@"
|
||||||
Vendored
+15
-23
@@ -14,7 +14,7 @@
|
|||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%" == "" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem Gradle startup script for Windows
|
@rem Gradle startup script for Windows
|
||||||
@@ -25,10 +25,14 @@
|
|||||||
if "%OS%"=="Windows_NT" setlocal
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
|
@rem This is normally unused
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
@@ -37,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
|||||||
|
|
||||||
set JAVA_EXE=java.exe
|
set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if "%ERRORLEVEL%" == "0" goto init
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
@@ -51,7 +55,7 @@ goto fail
|
|||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto init
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
@@ -61,38 +65,26 @@ echo location of your Java installation.
|
|||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:init
|
|
||||||
@rem Get command-line arguments, handling Windows variants
|
|
||||||
|
|
||||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
|
||||||
|
|
||||||
:win9xME_args
|
|
||||||
@rem Slurp the command line arguments.
|
|
||||||
set CMD_LINE_ARGS=
|
|
||||||
set _SKIP=2
|
|
||||||
|
|
||||||
:win9xME_args_slurp
|
|
||||||
if "x%~1" == "x" goto execute
|
|
||||||
|
|
||||||
set CMD_LINE_ARGS=%*
|
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||||
|
|
||||||
:fail
|
:fail
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
rem the _cmd.exe /c_ return code!
|
rem the _cmd.exe /c_ return code!
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
set EXIT_CODE=%ERRORLEVEL%
|
||||||
exit /b 1
|
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||||
|
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||||
|
exit /b %EXIT_CODE%
|
||||||
|
|
||||||
:mainEnd
|
:mainEnd
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
// Add any additional repositiroes for your dependencies here
|
// Add any additional repositiroes for your dependencies here
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
|
||||||
url = "https://jitpack.io"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
// RetroFuturaGradle
|
||||||
|
name "GTNH Maven"
|
||||||
|
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
||||||
|
allowInsecureProtocol = true
|
||||||
|
mavenContent {
|
||||||
|
includeGroup("com.gtnewhorizons.retrofuturagradle")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gradlePluginPortal()
|
||||||
|
mavenCentral()
|
||||||
|
mavenLocal()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id 'com.diffplug.blowdryerSetup' version '1.6.0'
|
||||||
|
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains
|
||||||
|
}
|
||||||
|
|
||||||
|
blowdryerSetup {
|
||||||
|
repoSubfolder 'gtnhShared'
|
||||||
|
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.0')
|
||||||
|
//devLocal '.' // Use this when testing config updates locally
|
||||||
|
}
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
package mcp.mobius.waila;
|
package mcp.mobius.waila;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
|
||||||
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
@@ -9,22 +10,6 @@ import org.apache.logging.log4j.Logger;
|
|||||||
import com.google.common.eventbus.EventBus;
|
import com.google.common.eventbus.EventBus;
|
||||||
import com.google.common.eventbus.Subscribe;
|
import com.google.common.eventbus.Subscribe;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaRegistrar;
|
|
||||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
|
||||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|
||||||
import mcp.mobius.waila.network.NetworkHandler;
|
|
||||||
import mcp.mobius.waila.network.WailaPacketHandler;
|
|
||||||
import mcp.mobius.waila.overlay.OverlayConfig;
|
|
||||||
import mcp.mobius.waila.overlay.DecoratorRenderer;
|
|
||||||
import mcp.mobius.waila.overlay.WailaTickHandler;
|
|
||||||
import mcp.mobius.waila.server.ProxyServer;
|
|
||||||
import mcp.mobius.waila.utils.Constants;
|
|
||||||
import mcp.mobius.waila.utils.ModIdentification;
|
|
||||||
import net.minecraft.client.resources.I18n;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraftforge.common.config.Configuration;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import cpw.mods.fml.common.FMLModContainer;
|
import cpw.mods.fml.common.FMLModContainer;
|
||||||
import cpw.mods.fml.common.Mod;
|
import cpw.mods.fml.common.Mod;
|
||||||
@@ -38,37 +23,50 @@ import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
|
|||||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||||
|
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||||
import mcp.mobius.waila.client.KeyEvent;
|
import mcp.mobius.waila.client.KeyEvent;
|
||||||
import mcp.mobius.waila.commands.CommandDumpHandlers;
|
import mcp.mobius.waila.commands.CommandDumpHandlers;
|
||||||
|
import mcp.mobius.waila.network.NetworkHandler;
|
||||||
|
import mcp.mobius.waila.network.WailaPacketHandler;
|
||||||
|
import mcp.mobius.waila.overlay.DecoratorRenderer;
|
||||||
|
import mcp.mobius.waila.overlay.OverlayConfig;
|
||||||
|
import mcp.mobius.waila.overlay.WailaTickHandler;
|
||||||
|
import mcp.mobius.waila.server.ProxyServer;
|
||||||
|
import mcp.mobius.waila.utils.ModIdentification;
|
||||||
|
|
||||||
@Mod(modid="Waila", name="Waila", version="GRADLETOKEN_VERSION", dependencies="after:NotEnoughItems@[1.0.4.0,)", acceptableRemoteVersions="*")
|
@Mod(
|
||||||
|
modid = "Waila",
|
||||||
|
name = "Waila",
|
||||||
|
version = "GRADLETOKEN_VERSION",
|
||||||
|
dependencies = "after:NotEnoughItems@[1.0.4.0,)",
|
||||||
|
acceptableRemoteVersions = "*")
|
||||||
/*
|
/*
|
||||||
@NetworkMod(channels = {"Waila"},clientSideRequired=false, serverSideRequired=false, connectionHandler = WailaConnectionHandler.class,
|
* @NetworkMod(channels = {"Waila"},clientSideRequired=false, serverSideRequired=false, connectionHandler =
|
||||||
packetHandler = WailaPacketHandler.class, versionBounds="[1.5.0,)")
|
* WailaConnectionHandler.class, packetHandler = WailaPacketHandler.class, versionBounds="[1.5.0,)") //packetHandler =
|
||||||
//packetHandler = WailaPacketHandler.class)
|
* WailaPacketHandler.class)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class Waila {
|
public class Waila {
|
||||||
// The instance of your mod that Forge uses.
|
|
||||||
@Instance("Waila")
|
|
||||||
public static Waila instance;
|
|
||||||
|
|
||||||
@SidedProxy(clientSide="mcp.mobius.waila.client.ProxyClient", serverSide="mcp.mobius.waila.server.ProxyServer")
|
// The instance of your mod that Forge uses.
|
||||||
public static ProxyServer proxy;
|
@Instance("Waila")
|
||||||
public static Logger log = LogManager.getLogger("Waila");
|
public static Waila instance;
|
||||||
public boolean serverPresent = false;
|
|
||||||
|
@SidedProxy(clientSide = "mcp.mobius.waila.client.ProxyClient", serverSide = "mcp.mobius.waila.server.ProxyServer")
|
||||||
|
public static ProxyServer proxy;
|
||||||
|
public static Logger log = LogManager.getLogger("Waila");
|
||||||
|
public boolean serverPresent = false;
|
||||||
|
|
||||||
/* INIT SEQUENCE */
|
/* INIT SEQUENCE */
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void preInit(FMLPreInitializationEvent event) {
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
ConfigHandler.instance().loadDefaultConfig(event);
|
ConfigHandler.instance().loadDefaultConfig(event);
|
||||||
OverlayConfig.updateColors();
|
OverlayConfig.updateColors();
|
||||||
MinecraftForge.EVENT_BUS.register(new DecoratorRenderer());
|
MinecraftForge.EVENT_BUS.register(new DecoratorRenderer());
|
||||||
WailaPacketHandler.INSTANCE.ordinal();
|
WailaPacketHandler.INSTANCE.ordinal();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void initialize(FMLInitializationEvent event) {
|
public void initialize(FMLInitializationEvent event) {
|
||||||
@@ -79,97 +77,80 @@ public class Waila {
|
|||||||
FMLbus.register(this);
|
FMLbus.register(this);
|
||||||
} catch (Throwable t) {}
|
} catch (Throwable t) {}
|
||||||
|
|
||||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT){
|
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
|
||||||
MinecraftForge.EVENT_BUS.register(new DecoratorRenderer());
|
MinecraftForge.EVENT_BUS.register(new DecoratorRenderer());
|
||||||
FMLCommonHandler.instance().bus().register(new KeyEvent());
|
FMLCommonHandler.instance().bus().register(new KeyEvent());
|
||||||
FMLCommonHandler.instance().bus().register(WailaTickHandler.instance());
|
FMLCommonHandler.instance().bus().register(WailaTickHandler.instance());
|
||||||
|
|
||||||
}
|
}
|
||||||
FMLCommonHandler.instance().bus().register(new NetworkHandler());
|
FMLCommonHandler.instance().bus().register(new NetworkHandler());
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void postInit(FMLPostInitializationEvent event) {
|
|
||||||
proxy.registerHandlers();
|
|
||||||
ModIdentification.init();
|
|
||||||
|
|
||||||
/*
|
|
||||||
if (ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_KEYBIND, true)){
|
|
||||||
|
|
||||||
for (String key: ModIdentification.keyhandlerStrings.keySet()){
|
|
||||||
String orig = I18n.getString(key);
|
|
||||||
if (orig.equals(key))
|
|
||||||
orig = LanguageRegistry.instance().getStringLocalization(key);
|
|
||||||
if (orig.equals(key))
|
|
||||||
orig = LangUtil.translateG(key);
|
|
||||||
if (orig.isEmpty())
|
|
||||||
orig = key;
|
|
||||||
|
|
||||||
String modif;
|
|
||||||
if (orig.startsWith("[") || orig.contains(":"))
|
|
||||||
modif = orig;
|
|
||||||
else{
|
|
||||||
String id = ModIdentification.keyhandlerStrings.get(key);
|
|
||||||
|
|
||||||
if (id.contains("."))
|
|
||||||
id = id.split("\\.")[0];
|
|
||||||
|
|
||||||
if (id.length() > 10)
|
|
||||||
id = id.substring(0, 11);
|
|
||||||
|
|
||||||
if (id.isEmpty())
|
|
||||||
id = "????";
|
|
||||||
|
|
||||||
modif = String.format("[%s] %s", id, orig);
|
|
||||||
}
|
|
||||||
|
|
||||||
LanguageRegistry.instance().addStringLocalization(key, modif);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void loadComplete(FMLLoadCompleteEvent event) {
|
|
||||||
proxy.registerMods();
|
|
||||||
proxy.registerIMCs();
|
|
||||||
|
|
||||||
/*
|
|
||||||
String[] ores = OreDictionary.getOreNames();
|
|
||||||
for (String s : ores)
|
|
||||||
for (ItemStack stack : OreDictionary.getOres(s))
|
|
||||||
System.out.printf("%s : %s\n", s, stack);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void processIMC(FMLInterModComms.IMCEvent event)
|
public void postInit(FMLPostInitializationEvent event) {
|
||||||
{
|
proxy.registerHandlers();
|
||||||
for (IMCMessage imcMessage : event.getMessages()){
|
ModIdentification.init();
|
||||||
if (!imcMessage.isStringMessage()) continue;
|
|
||||||
|
|
||||||
if (imcMessage.key.equalsIgnoreCase("addconfig")){
|
/*
|
||||||
String[] params = imcMessage.getStringValue().split("\\$\\$");
|
* if (ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_KEYBIND, true)){
|
||||||
if (params.length != 3){
|
* for (String key: ModIdentification.keyhandlerStrings.keySet()){ String orig = I18n.getString(key); if
|
||||||
Waila.log.warn(String.format("Error while parsing config option from [ %s ] for %s", imcMessage.getSender(), imcMessage.getStringValue()));
|
* (orig.equals(key)) orig = LanguageRegistry.instance().getStringLocalization(key); if (orig.equals(key)) orig
|
||||||
continue;
|
* = LangUtil.translateG(key); if (orig.isEmpty()) orig = key; String modif; if (orig.startsWith("[") ||
|
||||||
}
|
* orig.contains(":")) modif = orig; else{ String id = ModIdentification.keyhandlerStrings.get(key); if
|
||||||
Waila.log.info(String.format("Receiving config request from [ %s ] for %s", imcMessage.getSender(), imcMessage.getStringValue()));
|
* (id.contains(".")) id = id.split("\\.")[0]; if (id.length() > 10) id = id.substring(0, 11); if (id.isEmpty())
|
||||||
ConfigHandler.instance().addConfig(params[0], params[1], params[2]);
|
* id = "????"; modif = String.format("[%s] %s", id, orig); }
|
||||||
}
|
* LanguageRegistry.instance().addStringLocalization(key, modif); } }
|
||||||
|
*/
|
||||||
|
|
||||||
if (imcMessage.key.equalsIgnoreCase("register")){
|
}
|
||||||
Waila.log.info(String.format("Receiving registration request from [ %s ] for method %s", imcMessage.getSender(), imcMessage.getStringValue()));
|
|
||||||
ModuleRegistrar.instance().addIMCRequest(imcMessage.getStringValue(), imcMessage.getSender());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void loadComplete(FMLLoadCompleteEvent event) {
|
||||||
|
proxy.registerMods();
|
||||||
|
proxy.registerIMCs();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* String[] ores = OreDictionary.getOreNames(); for (String s : ores) for (ItemStack stack :
|
||||||
|
* OreDictionary.getOres(s)) System.out.printf("%s : %s\n", s, stack);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void serverStarting(FMLServerStartingEvent event){
|
public void processIMC(FMLInterModComms.IMCEvent event) {
|
||||||
event.registerServerCommand(new CommandDumpHandlers());
|
for (IMCMessage imcMessage : event.getMessages()) {
|
||||||
}
|
if (!imcMessage.isStringMessage()) continue;
|
||||||
|
|
||||||
|
if (imcMessage.key.equalsIgnoreCase("addconfig")) {
|
||||||
|
String[] params = imcMessage.getStringValue().split("\\$\\$");
|
||||||
|
if (params.length != 3) {
|
||||||
|
Waila.log.warn(
|
||||||
|
String.format(
|
||||||
|
"Error while parsing config option from [ %s ] for %s",
|
||||||
|
imcMessage.getSender(),
|
||||||
|
imcMessage.getStringValue()));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Waila.log.info(
|
||||||
|
String.format(
|
||||||
|
"Receiving config request from [ %s ] for %s",
|
||||||
|
imcMessage.getSender(),
|
||||||
|
imcMessage.getStringValue()));
|
||||||
|
ConfigHandler.instance().addConfig(params[0], params[1], params[2]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (imcMessage.key.equalsIgnoreCase("register")) {
|
||||||
|
Waila.log.info(
|
||||||
|
String.format(
|
||||||
|
"Receiving registration request from [ %s ] for method %s",
|
||||||
|
imcMessage.getSender(),
|
||||||
|
imcMessage.getStringValue()));
|
||||||
|
ModuleRegistrar.instance().addIMCRequest(imcMessage.getStringValue(), imcMessage.getSender());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void serverStarting(FMLServerStartingEvent event) {
|
||||||
|
event.registerServerCommand(new CommandDumpHandlers());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -6,25 +6,25 @@ import mcp.mobius.waila.Waila;
|
|||||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||||
|
|
||||||
public class AgricultureModule {
|
public class AgricultureModule {
|
||||||
public static Class BlockCrop = null;
|
|
||||||
|
|
||||||
|
public static Class BlockCrop = null;
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
try{
|
try {
|
||||||
Class Agriculture = Class.forName("com.teammetallurgy.agriculture.Agriculture");
|
Class Agriculture = Class.forName("com.teammetallurgy.agriculture.Agriculture");
|
||||||
Waila.log.log(Level.INFO, "Agriculture mod found.");
|
Waila.log.log(Level.INFO, "Agriculture mod found.");
|
||||||
} catch (ClassNotFoundException e){
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[Agriculture] Agriculture mod not found.");
|
Waila.log.log(Level.INFO, "[Agriculture] Agriculture mod not found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try {
|
||||||
BlockCrop = Class.forName("com.teammetallurgy.agriculture.crops.BlockCrop");
|
BlockCrop = Class.forName("com.teammetallurgy.agriculture.crops.BlockCrop");
|
||||||
} catch (ClassNotFoundException e){
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.WARN, "[Agriculture] Class not found. " + e);
|
Waila.log.log(Level.WARN, "[Agriculture] Class not found. " + e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerCrop(), BlockCrop);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerCrop(), BlockCrop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,50 +2,55 @@ package mcp.mobius.waila.addons.agriculture;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
import mcp.mobius.waila.cbcore.LangUtil;
|
||||||
|
|
||||||
public class HUDHandlerCrop implements IWailaDataProvider {
|
public class HUDHandlerCrop implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
if (!config.getConfig("general.showcrop")) return currenttip;
|
IWailaConfigHandler config) {
|
||||||
|
if (!config.getConfig("general.showcrop")) return currenttip;
|
||||||
|
|
||||||
int growthStage = accessor.getMetadata();
|
int growthStage = accessor.getMetadata();
|
||||||
|
|
||||||
float growthValue = (growthStage / 6.0F) * 100.0F;
|
float growthValue = (growthStage / 6.0F) * 100.0F;
|
||||||
if (growthValue < 100.0)
|
if (growthValue < 100.0)
|
||||||
currenttip.add(String.format("%s : %.0f %%", LangUtil.translateG("hud.msg.growth"), growthValue));
|
currenttip.add(String.format("%s : %.0f %%", LangUtil.translateG("hud.msg.growth"), growthValue));
|
||||||
else
|
else currenttip.add(
|
||||||
currenttip.add(String.format("%s : %s", LangUtil.translateG("hud.msg.growth"), LangUtil.translateG("hud.msg.mature")));
|
String.format("%s : %s", LangUtil.translateG("hud.msg.growth"), LangUtil.translateG("hud.msg.mature")));
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
return tag;
|
int y, int z) {
|
||||||
}
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,43 +2,41 @@ package mcp.mobius.waila.addons.buildcraft;
|
|||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Level;
|
import org.apache.logging.log4j.Level;
|
||||||
|
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
|
||||||
import mcp.mobius.waila.Waila;
|
import mcp.mobius.waila.Waila;
|
||||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||||
|
|
||||||
public class BCModule {
|
public class BCModule {
|
||||||
|
|
||||||
public static Class TileTank = null;
|
public static Class TileTank = null;
|
||||||
public static Method TileTank_getTankInfo = null;
|
public static Method TileTank_getTankInfo = null;
|
||||||
|
|
||||||
//public static Class IPowerReceptor = null;
|
// public static Class IPowerReceptor = null;
|
||||||
//public static Class PipeTransportPower = null;
|
// public static Class PipeTransportPower = null;
|
||||||
//public static Class TileGenericPipe = null;
|
// public static Class TileGenericPipe = null;
|
||||||
//public static Class TileEngine = null;
|
// public static Class TileEngine = null;
|
||||||
|
|
||||||
|
public static void register() {
|
||||||
|
try {
|
||||||
|
TileTank = Class.forName("buildcraft.factory.TileTank");
|
||||||
|
TileTank_getTankInfo = TileTank.getMethod("getTankInfo", ForgeDirection.class);
|
||||||
|
|
||||||
|
ModuleRegistrar.instance().addConfig("Buildcraft", "bc.tankamount");
|
||||||
|
ModuleRegistrar.instance().addConfig("Buildcraft", "bc.tanktype");
|
||||||
|
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerBCTanks(), TileTank);
|
||||||
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerBCTanks(), TileTank);
|
||||||
|
|
||||||
public static void register(){
|
} catch (ClassNotFoundException e) {
|
||||||
try{
|
Waila.log.log(Level.WARN, "[BC] Class not found. " + e);
|
||||||
TileTank = Class.forName("buildcraft.factory.TileTank");
|
return;
|
||||||
TileTank_getTankInfo = TileTank.getMethod("getTankInfo", ForgeDirection.class);
|
} catch (NoSuchMethodException e) {
|
||||||
|
Waila.log.log(Level.WARN, "[BC] Method not found." + e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfig("Buildcraft", "bc.tankamount");
|
}
|
||||||
ModuleRegistrar.instance().addConfig("Buildcraft", "bc.tanktype");
|
|
||||||
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerBCTanks(), TileTank);
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerBCTanks(), TileTank);
|
|
||||||
|
|
||||||
} catch (ClassNotFoundException e){
|
|
||||||
Waila.log.log(Level.WARN, "[BC] Class not found. " + e);
|
|
||||||
return;
|
|
||||||
} catch (NoSuchMethodException e){
|
|
||||||
Waila.log.log(Level.WARN, "[BC] Method not found." + e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,18 +2,6 @@ package mcp.mobius.waila.addons.buildcraft;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
//import buildcraft.factory.TileTank;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import org.apache.logging.log4j.Level;
|
|
||||||
|
|
||||||
import mcp.mobius.waila.Waila;
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
|
||||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
@@ -22,62 +10,76 @@ import net.minecraft.world.World;
|
|||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
import net.minecraftforge.fluids.FluidTankInfo;
|
import net.minecraftforge.fluids.FluidTankInfo;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.Level;
|
||||||
|
|
||||||
|
import mcp.mobius.waila.Waila;
|
||||||
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
import mcp.mobius.waila.cbcore.LangUtil;
|
||||||
|
|
||||||
public class HUDHandlerBCTanks implements IWailaDataProvider {
|
public class HUDHandlerBCTanks implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
FluidTankInfo tank = this.getTank(accessor);
|
IWailaConfigHandler config) {
|
||||||
FluidStack stack = tank != null ? tank.fluid : 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.getFluid().getName() + ")";
|
||||||
|
else if (stack == null && ConfigHandler.instance().getConfig("bc.tanktype"))
|
||||||
|
name = name + " " + LangUtil.translateG("hud.msg.empty");
|
||||||
|
currenttip.set(0, name);
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
String name = currenttip.get(0);
|
@Override
|
||||||
if (stack != null && ConfigHandler.instance().getConfig("bc.tanktype"))
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
name = name + " (" + stack.getFluid().getName() + ")";
|
IWailaConfigHandler config) {
|
||||||
else if (stack == null && ConfigHandler.instance().getConfig("bc.tanktype"))
|
FluidTankInfo tank = this.getTank(accessor);
|
||||||
name = name + " " + LangUtil.translateG("hud.msg.empty");
|
FluidStack stack = tank != null ? tank.fluid : null;
|
||||||
currenttip.set(0, name);
|
int liquidAmount = stack != null ? stack.amount : 0;
|
||||||
return currenttip;
|
int capacity = tank != null ? tank.capacity : 0;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
if (ConfigHandler.instance().getConfig("bc.tankamount"))
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
currenttip.add(String.valueOf(liquidAmount) + "/" + String.valueOf(capacity) + " mB");
|
||||||
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"))
|
return currenttip;
|
||||||
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;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
public FluidTankInfo getTank(IWailaDataAccessor accessor) {
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
FluidTankInfo tank = null;
|
||||||
return currenttip;
|
try {
|
||||||
}
|
tank = ((FluidTankInfo[]) BCModule.TileTank_getTankInfo
|
||||||
|
.invoke(BCModule.TileTank.cast(accessor.getTileEntity()), ForgeDirection.UNKNOWN))[0];
|
||||||
|
} catch (Exception e) {
|
||||||
|
Waila.log.log(
|
||||||
|
Level.ERROR,
|
||||||
|
"[BC] Unhandled exception trying to access a tank for display !.\n" + String.valueOf(e));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return tank;
|
||||||
|
}
|
||||||
|
|
||||||
public FluidTankInfo getTank(IWailaDataAccessor accessor){
|
@Override
|
||||||
FluidTankInfo tank = null;
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
try{
|
int y, int z) {
|
||||||
tank = ((FluidTankInfo[])BCModule.TileTank_getTankInfo.invoke(BCModule.TileTank.cast(accessor.getTileEntity()), ForgeDirection.UNKNOWN))[0];
|
return tag;
|
||||||
} catch (Exception e){
|
}
|
||||||
Waila.log.log(Level.ERROR, "[BC] Unhandled exception trying to access a tank for display !.\n" + String.valueOf(e));
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return tank;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,39 +2,26 @@ package mcp.mobius.waila.addons.carpenters;
|
|||||||
|
|
||||||
public class CarpentersModule {
|
public class CarpentersModule {
|
||||||
|
|
||||||
public static Class TEBase = null;
|
public static Class TEBase = null;
|
||||||
public static Class BlockCarpentersDoor = null;
|
public static Class BlockCarpentersDoor = null;
|
||||||
public static Class BlockCarpentersHatch = null;
|
public static Class BlockCarpentersHatch = null;
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
/*
|
/*
|
||||||
try{
|
* try{ Class CarpentersBlocks = Class.forName("carpentersblocks.CarpentersBlocks"); Waila.log.log(Level.INFO,
|
||||||
Class CarpentersBlocks = Class.forName("carpentersblocks.CarpentersBlocks");
|
* "CarpentersBlocks mod found."); } catch (ClassNotFoundException e){ Waila.log.log(Level.INFO,
|
||||||
Waila.log.log(Level.INFO, "CarpentersBlocks mod found.");
|
* "[CarpentersBlocks] CarpentersBlocks mod not found."); return; } try{ TEBase =
|
||||||
} catch (ClassNotFoundException e){
|
* Class.forName("carpentersblocks.tileentity.TEBase"); BlockCarpentersDoor =
|
||||||
Waila.log.log(Level.INFO, "[CarpentersBlocks] CarpentersBlocks mod not found.");
|
* Class.forName("carpentersblocks.block.BlockCarpentersDoor"); BlockCarpentersHatch =
|
||||||
return;
|
* Class.forName("carpentersblocks.block.BlockCarpentersHatch"); } catch (ClassNotFoundException e){
|
||||||
}
|
* Waila.log.log(Level.WARNING, "[CarpentersBlocks] Class not found. " + e); return; } catch (Exception e) {
|
||||||
|
* Waila.log.log(Level.WARNING, "[CarpentersBlocks] Error while loading module. " + e); return; }
|
||||||
try{
|
* ModuleRegistrar.instance().addConfig("Carpenter's Blocks", "carpenters.hide");
|
||||||
TEBase = Class.forName("carpentersblocks.tileentity.TEBase");
|
* ModuleRegistrar.instance().registerStackProvider(new HUDCarpentersBlocksTE(), BlockCarpentersDoor);
|
||||||
BlockCarpentersDoor = Class.forName("carpentersblocks.block.BlockCarpentersDoor");
|
* ModuleRegistrar.instance().registerStackProvider(new HUDCarpentersBlocksTE(), BlockCarpentersHatch);
|
||||||
BlockCarpentersHatch = Class.forName("carpentersblocks.block.BlockCarpentersHatch");
|
* ModuleRegistrar.instance().registerSyncedNBTKey("data", TEBase);
|
||||||
|
* ModuleRegistrar.instance().registerSyncedNBTKey("cover_6", TEBase);
|
||||||
} catch (ClassNotFoundException e){
|
*/
|
||||||
Waila.log.log(Level.WARNING, "[CarpentersBlocks] Class not found. " + e);
|
}
|
||||||
return;
|
|
||||||
} catch (Exception e) {
|
|
||||||
Waila.log.log(Level.WARNING, "[CarpentersBlocks] Error while loading module. " + e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfig("Carpenter's Blocks", "carpenters.hide");
|
|
||||||
ModuleRegistrar.instance().registerStackProvider(new HUDCarpentersBlocksTE(), BlockCarpentersDoor);
|
|
||||||
ModuleRegistrar.instance().registerStackProvider(new HUDCarpentersBlocksTE(), BlockCarpentersHatch);
|
|
||||||
ModuleRegistrar.instance().registerSyncedNBTKey("data", TEBase);
|
|
||||||
ModuleRegistrar.instance().registerSyncedNBTKey("cover_6", TEBase);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -7,60 +7,50 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
|
||||||
public class HUDCarpentersBlocksTE implements IWailaDataProvider {
|
public class HUDCarpentersBlocksTE implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
/*
|
/*
|
||||||
if (!config.getConfig("carpenters.hide")) return null;
|
* if (!config.getConfig("carpenters.hide")) return null; NBTTagCompound tag = accessor.getNBTData(); short data
|
||||||
|
* = tag.getShort("data"); short cover = tag.getShort("cover_6");
|
||||||
|
* if(CarpentersModule.BlockCarpentersDoor.isInstance(accessor.getBlock())){ int type = data & 0x7; if (type !=
|
||||||
|
* 5) return null; if (cover == 0) return null; return new ItemStack(cover & 0xfff, 0, (cover & 0xf000) >>> 12);
|
||||||
|
* } else if (CarpentersModule.BlockCarpentersHatch.isInstance(accessor.getBlock())){ int type = data & 0x7; if
|
||||||
|
* (type != 0) return null; if (cover == 0) return null; return new ItemStack(cover & 0xfff, 0, (cover & 0xf000)
|
||||||
|
* >>> 12); }
|
||||||
|
*/
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
NBTTagCompound tag = accessor.getNBTData();
|
@Override
|
||||||
short data = tag.getShort("data");
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
short cover = tag.getShort("cover_6");
|
IWailaConfigHandler config) {
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
if(CarpentersModule.BlockCarpentersDoor.isInstance(accessor.getBlock())){
|
@Override
|
||||||
int type = data & 0x7;
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
if (type != 5) return null;
|
IWailaConfigHandler config) {
|
||||||
if (cover == 0) return null;
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
return new ItemStack(cover & 0xfff, 0, (cover & 0xf000) >>> 12);
|
@Override
|
||||||
}
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
|
IWailaConfigHandler config) {
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
else if (CarpentersModule.BlockCarpentersHatch.isInstance(accessor.getBlock())){
|
@Override
|
||||||
int type = data & 0x7;
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
if (type != 0) return null;
|
int y, int z) {
|
||||||
if (cover == 0) return null;
|
if (te != null) te.writeToNBT(tag);
|
||||||
|
return tag;
|
||||||
return new ItemStack(cover & 0xfff, 0, (cover & 0xf000) >>> 12);
|
}
|
||||||
}
|
|
||||||
*/
|
|
||||||
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) {
|
|
||||||
return currenttip;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
|
||||||
return currenttip;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
|
||||||
if (te != null)
|
|
||||||
te.writeToNBT(tag);
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -9,57 +9,57 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class EnderIOModule {
|
public class EnderIOModule {
|
||||||
|
|
||||||
public static Class TileCapacitorBank = null;
|
public static Class TileCapacitorBank = null;
|
||||||
public static Method TCB_getMaxInput = null;
|
public static Method TCB_getMaxInput = null;
|
||||||
public static Method TCB_getMaxOutput = null;
|
public static Method TCB_getMaxOutput = null;
|
||||||
public static Method TCB_getEnergyStored = null;
|
public static Method TCB_getEnergyStored = null;
|
||||||
public static Method TCB_getMaxEnergyStored = null;
|
public static Method TCB_getMaxEnergyStored = null;
|
||||||
public static Method TCB_getMaxIO = null;
|
public static Method TCB_getMaxIO = null;
|
||||||
|
|
||||||
public static Class TileTesseract = null;
|
public static Class TileTesseract = null;
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
try{
|
try {
|
||||||
Class ModClass = Class.forName("crazypants.enderio.EnderIO");
|
Class ModClass = Class.forName("crazypants.enderio.EnderIO");
|
||||||
Waila.log.log(Level.INFO, "EnderIO mod found.");
|
Waila.log.log(Level.INFO, "EnderIO mod found.");
|
||||||
} catch (ClassNotFoundException e){
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[EnderIO] EnderIO mod not found.");
|
Waila.log.log(Level.INFO, "[EnderIO] EnderIO mod not found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try {
|
||||||
|
|
||||||
TileCapacitorBank = Class.forName("crazypants.enderio.machine.power.TileCapacitorBank");
|
TileCapacitorBank = Class.forName("crazypants.enderio.machine.power.TileCapacitorBank");
|
||||||
TCB_getEnergyStored = TileCapacitorBank.getMethod("getEnergyStored");
|
TCB_getEnergyStored = TileCapacitorBank.getMethod("getEnergyStored");
|
||||||
TCB_getMaxInput = TileCapacitorBank.getMethod("getMaxInput");
|
TCB_getMaxInput = TileCapacitorBank.getMethod("getMaxInput");
|
||||||
TCB_getMaxOutput = TileCapacitorBank.getMethod("getMaxOutput");
|
TCB_getMaxOutput = TileCapacitorBank.getMethod("getMaxOutput");
|
||||||
TCB_getMaxEnergyStored = TileCapacitorBank.getMethod("getMaxEnergyStored");
|
TCB_getMaxEnergyStored = TileCapacitorBank.getMethod("getMaxEnergyStored");
|
||||||
TCB_getMaxIO = TileCapacitorBank.getMethod("getMaxIO");
|
TCB_getMaxIO = TileCapacitorBank.getMethod("getMaxIO");
|
||||||
|
|
||||||
TileTesseract = Class.forName("crazypants.enderio.machine.hypercube.TileHyperCube");
|
TileTesseract = Class.forName("crazypants.enderio.machine.hypercube.TileHyperCube");
|
||||||
|
|
||||||
} catch (ClassNotFoundException e){
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.WARN, "[EnderStorage] Class not found. " + e);
|
Waila.log.log(Level.WARN, "[EnderStorage] Class not found. " + e);
|
||||||
return;
|
return;
|
||||||
} catch (NoSuchMethodException e){
|
} catch (NoSuchMethodException e) {
|
||||||
Waila.log.log(Level.WARN, "[EnderStorage] Method not found." + e);
|
Waila.log.log(Level.WARN, "[EnderStorage] Method not found." + e);
|
||||||
return;
|
return;
|
||||||
// } catch (NoSuchFieldException e){
|
// } catch (NoSuchFieldException e){
|
||||||
// mod_Waila.log.log(Level.WARNING, "[EnderStorage] Field not found." + e);
|
// mod_Waila.log.log(Level.WARNING, "[EnderStorage] Field not found." + e);
|
||||||
// return;
|
// return;
|
||||||
} catch (Exception e){
|
} catch (Exception e) {
|
||||||
Waila.log.log(Level.WARN, "[EnderStorage] Unhandled exception." + e);
|
Waila.log.log(Level.WARN, "[EnderStorage] Unhandled exception." + e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfig("EnderIO", "enderio.inout");
|
ModuleRegistrar.instance().addConfig("EnderIO", "enderio.inout");
|
||||||
ModuleRegistrar.instance().addConfig("EnderIO", "enderio.storage");
|
ModuleRegistrar.instance().addConfig("EnderIO", "enderio.storage");
|
||||||
ModuleRegistrar.instance().addConfig("EnderIO", "enderio.owner");
|
ModuleRegistrar.instance().addConfig("EnderIO", "enderio.owner");
|
||||||
ModuleRegistrar.instance().addConfig("EnderIO", "enderio.channel");
|
ModuleRegistrar.instance().addConfig("EnderIO", "enderio.channel");
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerCapacitor(), TileCapacitorBank);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerCapacitor(), TileCapacitorBank);
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTesseract(), TileTesseract);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTesseract(), TileTesseract);
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerCapacitor(), TileCapacitorBank);
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerCapacitor(), TileCapacitorBank);
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerTesseract(), TileTesseract);
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerTesseract(), TileTesseract);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,75 +1,110 @@
|
|||||||
package mcp.mobius.waila.addons.enderio;
|
package mcp.mobius.waila.addons.enderio;
|
||||||
|
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.ALIGNRIGHT;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.RESET;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.TAB;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.WHITE;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
import mcp.mobius.waila.cbcore.LangUtil;
|
||||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||||
import static mcp.mobius.waila.api.SpecialChars.*;
|
|
||||||
|
|
||||||
public class HUDHandlerCapacitor implements IWailaDataProvider{
|
public class HUDHandlerCapacitor implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
|
IWailaConfigHandler config) {
|
||||||
|
|
||||||
if (accessor.getPlayer().isSneaking()){
|
if (accessor.getPlayer().isSneaking()) {
|
||||||
try{
|
try {
|
||||||
|
|
||||||
String maxIOStr = LangUtil.translateG("hud.msg.maxio");
|
String maxIOStr = LangUtil.translateG("hud.msg.maxio");
|
||||||
String inputStr = LangUtil.translateG("hud.msg.input");
|
String inputStr = LangUtil.translateG("hud.msg.input");
|
||||||
String outputStr = LangUtil.translateG("hud.msg.output");
|
String outputStr = LangUtil.translateG("hud.msg.output");
|
||||||
|
|
||||||
if (config.getConfig("enderio.storage")){
|
if (config.getConfig("enderio.storage")) {
|
||||||
Integer maxEnergyStored = (Integer)EnderIOModule.TCB_getMaxEnergyStored.invoke(accessor.getTileEntity());
|
Integer maxEnergyStored = (Integer) EnderIOModule.TCB_getMaxEnergyStored
|
||||||
Double energyStored = (Double)EnderIOModule.TCB_getEnergyStored.invoke(accessor.getTileEntity());
|
.invoke(accessor.getTileEntity());
|
||||||
currenttip.add(String.format("%s%.1f%s / %s%d%s RF", WHITE, energyStored * 10, RESET, WHITE, maxEnergyStored * 10, RESET));
|
Double energyStored = (Double) EnderIOModule.TCB_getEnergyStored.invoke(accessor.getTileEntity());
|
||||||
}
|
currenttip.add(
|
||||||
|
String.format(
|
||||||
|
"%s%.1f%s / %s%d%s RF",
|
||||||
|
WHITE,
|
||||||
|
energyStored * 10,
|
||||||
|
RESET,
|
||||||
|
WHITE,
|
||||||
|
maxEnergyStored * 10,
|
||||||
|
RESET));
|
||||||
|
}
|
||||||
|
|
||||||
if (config.getConfig("enderio.inout")){
|
if (config.getConfig("enderio.inout")) {
|
||||||
Integer maxIO = (Integer)EnderIOModule.TCB_getMaxIO.invoke(accessor.getTileEntity());
|
Integer maxIO = (Integer) EnderIOModule.TCB_getMaxIO.invoke(accessor.getTileEntity());
|
||||||
Integer maxInput = (Integer)EnderIOModule.TCB_getMaxInput.invoke(accessor.getTileEntity());
|
Integer maxInput = (Integer) EnderIOModule.TCB_getMaxInput.invoke(accessor.getTileEntity());
|
||||||
Integer maxOutput = (Integer)EnderIOModule.TCB_getMaxOutput.invoke(accessor.getTileEntity());
|
Integer maxOutput = (Integer) EnderIOModule.TCB_getMaxOutput.invoke(accessor.getTileEntity());
|
||||||
currenttip.add(String.format("%s : %s%d%sRF/t ", maxIOStr, TAB + ALIGNRIGHT + WHITE, maxIO * 10, TAB + ALIGNRIGHT));
|
currenttip.add(
|
||||||
currenttip.add(String.format("%s : %s%d%sRF/t ", inputStr, TAB + ALIGNRIGHT + WHITE, maxInput * 10, TAB + ALIGNRIGHT));
|
String.format(
|
||||||
currenttip.add(String.format("%s : %s%d%sRF/t ", outputStr,TAB + ALIGNRIGHT + WHITE, maxOutput * 10, TAB + ALIGNRIGHT));
|
"%s : %s%d%sRF/t ",
|
||||||
}
|
maxIOStr,
|
||||||
|
TAB + ALIGNRIGHT + WHITE,
|
||||||
|
maxIO * 10,
|
||||||
|
TAB + ALIGNRIGHT));
|
||||||
|
currenttip.add(
|
||||||
|
String.format(
|
||||||
|
"%s : %s%d%sRF/t ",
|
||||||
|
inputStr,
|
||||||
|
TAB + ALIGNRIGHT + WHITE,
|
||||||
|
maxInput * 10,
|
||||||
|
TAB + ALIGNRIGHT));
|
||||||
|
currenttip.add(
|
||||||
|
String.format(
|
||||||
|
"%s : %s%d%sRF/t ",
|
||||||
|
outputStr,
|
||||||
|
TAB + ALIGNRIGHT + WHITE,
|
||||||
|
maxOutput * 10,
|
||||||
|
TAB + ALIGNRIGHT));
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
currenttip = WailaExceptionHandler
|
||||||
|
.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
return currenttip;
|
||||||
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;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
return currenttip;
|
int y, int z) {
|
||||||
}
|
if (te != null) te.writeToNBT(tag);
|
||||||
|
return tag;
|
||||||
@Override
|
}
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
|
||||||
if (te != null)
|
|
||||||
te.writeToNBT(tag);
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,79 +1,95 @@
|
|||||||
package mcp.mobius.waila.addons.enderio;
|
package mcp.mobius.waila.addons.enderio;
|
||||||
|
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.RESET;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.TAB;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.WHITE;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
import static mcp.mobius.waila.api.SpecialChars.*;
|
import mcp.mobius.waila.cbcore.LangUtil;
|
||||||
|
|
||||||
public class HUDHandlerTesseract implements IWailaDataProvider {
|
public class HUDHandlerTesseract implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
|
IWailaConfigHandler config) {
|
||||||
|
|
||||||
if (accessor.getPlayer().isSneaking()){
|
if (accessor.getPlayer().isSneaking()) {
|
||||||
|
|
||||||
String channel = "%s : %s%s%s %s";
|
String channel = "%s : %s%s%s %s";
|
||||||
String freq;
|
String freq;
|
||||||
String frequser;
|
String frequser;
|
||||||
String owner;
|
String owner;
|
||||||
|
|
||||||
if (config.getConfig("enderio.channel")){
|
if (config.getConfig("enderio.channel")) {
|
||||||
|
|
||||||
if (accessor.getNBTData().hasKey("channelName")){
|
if (accessor.getNBTData().hasKey("channelName")) {
|
||||||
freq = accessor.getNBTData().getString("channelName");
|
freq = accessor.getNBTData().getString("channelName");
|
||||||
|
|
||||||
if (accessor.getNBTData().hasKey("channelUser"))
|
if (accessor.getNBTData().hasKey("channelUser"))
|
||||||
frequser = "[ " + WHITE + accessor.getNBTData().getString("channelUser") + RESET + " ]";
|
frequser = "[ " + WHITE + accessor.getNBTData().getString("channelUser") + RESET + " ]";
|
||||||
else
|
else frequser = "[ " + WHITE + LangUtil.translateG("hud.msg.public") + RESET + " ]";
|
||||||
frequser = "[ " + WHITE + LangUtil.translateG("hud.msg.public") + RESET +" ]";
|
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else{
|
freq = LangUtil.translateG("hud.msg.none");
|
||||||
freq = LangUtil.translateG("hud.msg.none");
|
frequser = "";
|
||||||
frequser = "";
|
}
|
||||||
}
|
|
||||||
|
|
||||||
currenttip.add(String.format(channel, LangUtil.translateG("hud.msg.frequency"), TAB + WHITE, freq, RESET, frequser));
|
currenttip.add(
|
||||||
}
|
String.format(
|
||||||
|
channel,
|
||||||
|
LangUtil.translateG("hud.msg.frequency"),
|
||||||
|
TAB + WHITE,
|
||||||
|
freq,
|
||||||
|
RESET,
|
||||||
|
frequser));
|
||||||
|
}
|
||||||
|
|
||||||
if (config.getConfig("enderio.owner")){
|
if (config.getConfig("enderio.owner")) {
|
||||||
if (accessor.getNBTData().hasKey("owner"))
|
if (accessor.getNBTData().hasKey("owner")) currenttip.add(
|
||||||
currenttip.add(String.format("%s : %s%s", LangUtil.translateG("hud.msg.owner"), TAB + WHITE, accessor.getNBTData().getString("owner")));
|
String.format(
|
||||||
}
|
"%s : %s%s",
|
||||||
|
LangUtil.translateG("hud.msg.owner"),
|
||||||
|
TAB + WHITE,
|
||||||
|
accessor.getNBTData().getString("owner")));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
if (te != null)
|
int y, int z) {
|
||||||
te.writeToNBT(tag);
|
if (te != null) te.writeToNBT(tag);
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -10,49 +10,49 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class EnderStorageModule {
|
public class EnderStorageModule {
|
||||||
|
|
||||||
public static Class TileFrequencyOwner = null;
|
public static Class TileFrequencyOwner = null;
|
||||||
public static Field TileFrequencyOwner_Freq = null;
|
public static Field TileFrequencyOwner_Freq = null;
|
||||||
|
|
||||||
public static Class EnderStorageManager = null;
|
public static Class EnderStorageManager = null;
|
||||||
public static Method GetColourFromFreq = null;
|
public static Method GetColourFromFreq = null;
|
||||||
|
|
||||||
public static Class TileEnderTank = null;
|
public static Class TileEnderTank = null;
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
try{
|
try {
|
||||||
Class EnderStorage = Class.forName("codechicken.enderstorage.EnderStorage");
|
Class EnderStorage = Class.forName("codechicken.enderstorage.EnderStorage");
|
||||||
Waila.log.log(Level.INFO, "EnderStorage mod found.");
|
Waila.log.log(Level.INFO, "EnderStorage mod found.");
|
||||||
} catch (ClassNotFoundException e){
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[EnderStorage] EnderStorage mod not found.");
|
Waila.log.log(Level.INFO, "[EnderStorage] EnderStorage mod not found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try {
|
||||||
|
|
||||||
TileFrequencyOwner = Class.forName("codechicken.enderstorage.common.TileFrequencyOwner");
|
TileFrequencyOwner = Class.forName("codechicken.enderstorage.common.TileFrequencyOwner");
|
||||||
TileFrequencyOwner_Freq = TileFrequencyOwner.getField("freq");
|
TileFrequencyOwner_Freq = TileFrequencyOwner.getField("freq");
|
||||||
|
|
||||||
EnderStorageManager = Class.forName("codechicken.enderstorage.api.EnderStorageManager");
|
EnderStorageManager = Class.forName("codechicken.enderstorage.api.EnderStorageManager");
|
||||||
GetColourFromFreq = EnderStorageManager.getDeclaredMethod("getColourFromFreq", Integer.TYPE, Integer.TYPE);
|
GetColourFromFreq = EnderStorageManager.getDeclaredMethod("getColourFromFreq", Integer.TYPE, Integer.TYPE);
|
||||||
|
|
||||||
TileEnderTank = Class.forName("codechicken.enderstorage.storage.liquid.TileEnderTank");
|
TileEnderTank = Class.forName("codechicken.enderstorage.storage.liquid.TileEnderTank");
|
||||||
|
|
||||||
} catch (ClassNotFoundException e){
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.WARN, "[EnderStorage] Class not found. " + e);
|
Waila.log.log(Level.WARN, "[EnderStorage] Class not found. " + e);
|
||||||
return;
|
return;
|
||||||
} catch (NoSuchMethodException e){
|
} catch (NoSuchMethodException e) {
|
||||||
Waila.log.log(Level.WARN, "[EnderStorage] Method not found." + e);
|
Waila.log.log(Level.WARN, "[EnderStorage] Method not found." + e);
|
||||||
return;
|
return;
|
||||||
} catch (NoSuchFieldException e){
|
} catch (NoSuchFieldException e) {
|
||||||
Waila.log.log(Level.WARN, "[EnderStorage] Field not found." + e);
|
Waila.log.log(Level.WARN, "[EnderStorage] Field not found." + e);
|
||||||
return;
|
return;
|
||||||
} catch (Exception e){
|
} catch (Exception e) {
|
||||||
Waila.log.log(Level.WARN, "[EnderStorage] Unhandled exception." + e);
|
Waila.log.log(Level.WARN, "[EnderStorage] Unhandled exception." + e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfig("EnderStorage", "enderstorage.colors");
|
ModuleRegistrar.instance().addConfig("EnderStorage", "enderstorage.colors");
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerStorage(), TileFrequencyOwner);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerStorage(), TileFrequencyOwner);
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerStorage(), TileFrequencyOwner);
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerStorage(), TileFrequencyOwner);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,83 +2,75 @@ package mcp.mobius.waila.addons.enderstorage;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
import mcp.mobius.waila.cbcore.LangUtil;
|
||||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||||
|
|
||||||
public class HUDHandlerStorage implements IWailaDataProvider {
|
public class HUDHandlerStorage implements IWailaDataProvider {
|
||||||
|
|
||||||
private static String[] colors = {
|
private static String[] colors = { LangUtil.translateG("hud.msg.white"), LangUtil.translateG("hud.msg.orange"),
|
||||||
LangUtil.translateG("hud.msg.white"),
|
LangUtil.translateG("hud.msg.magenta"), LangUtil.translateG("hud.msg.lblue"),
|
||||||
LangUtil.translateG("hud.msg.orange"),
|
LangUtil.translateG("hud.msg.yellow"), LangUtil.translateG("hud.msg.lime"),
|
||||||
LangUtil.translateG("hud.msg.magenta"),
|
LangUtil.translateG("hud.msg.pink"), LangUtil.translateG("hud.msg.gray"),
|
||||||
LangUtil.translateG("hud.msg.lblue"),
|
LangUtil.translateG("hud.msg.lgray"), LangUtil.translateG("hud.msg.cyan"),
|
||||||
LangUtil.translateG("hud.msg.yellow"),
|
LangUtil.translateG("hud.msg.purple"), LangUtil.translateG("hud.msg.blue"),
|
||||||
LangUtil.translateG("hud.msg.lime"),
|
LangUtil.translateG("hud.msg.brown"), LangUtil.translateG("hud.msg.green"),
|
||||||
LangUtil.translateG("hud.msg.pink"),
|
LangUtil.translateG("hud.msg.red"), LangUtil.translateG("hud.msg.black") };
|
||||||
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
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
if(config.getConfig("enderstorage.colors")){
|
IWailaConfigHandler config) {
|
||||||
try{
|
if (config.getConfig("enderstorage.colors")) {
|
||||||
|
try {
|
||||||
|
|
||||||
int freq = EnderStorageModule.TileFrequencyOwner_Freq.getInt(accessor.getTileEntity());
|
int freq = EnderStorageModule.TileFrequencyOwner_Freq.getInt(accessor.getTileEntity());
|
||||||
int freqLeft = (Integer)EnderStorageModule.GetColourFromFreq.invoke(null, freq, 0);
|
int freqLeft = (Integer) EnderStorageModule.GetColourFromFreq.invoke(null, freq, 0);
|
||||||
int freqCenter = (Integer)EnderStorageModule.GetColourFromFreq.invoke(null, freq, 1);
|
int freqCenter = (Integer) EnderStorageModule.GetColourFromFreq.invoke(null, freq, 1);
|
||||||
int freqRight = (Integer)EnderStorageModule.GetColourFromFreq.invoke(null, freq, 2);
|
int freqRight = (Integer) EnderStorageModule.GetColourFromFreq.invoke(null, freq, 2);
|
||||||
|
|
||||||
if (!EnderStorageModule.TileEnderTank.isInstance(accessor.getTileEntity()))
|
if (!EnderStorageModule.TileEnderTank.isInstance(accessor.getTileEntity()))
|
||||||
currenttip.add(String.format("%s/%s/%s", colors[freqLeft], colors[freqCenter], colors[freqRight]));
|
currenttip.add(String.format("%s/%s/%s", colors[freqLeft], colors[freqCenter], colors[freqRight]));
|
||||||
else
|
else currenttip.add(String.format("%s/%s/%s", colors[freqRight], colors[freqCenter], colors[freqLeft]));
|
||||||
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} catch (Exception e){
|
return currenttip;
|
||||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
|
IWailaConfigHandler config) {
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
return currenttip;
|
@Override
|
||||||
}
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
|
int y, int z) {
|
||||||
@Override
|
if (te != null) te.writeToNBT(tag);
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
return tag;
|
||||||
return currenttip;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
|
||||||
if (te != null)
|
|
||||||
te.writeToNBT(tag);
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -9,75 +9,72 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class ETBModule {
|
public class ETBModule {
|
||||||
|
|
||||||
public static Class TileSocket = null;
|
public static Class TileSocket = null;
|
||||||
public static Field Socket_sides = null;
|
public static Field Socket_sides = null;
|
||||||
public static Field Socket_configs = null;
|
public static Field Socket_configs = null;
|
||||||
//public static Field Socket_sideID = null;
|
// public static Field Socket_sideID = null;
|
||||||
//public static Field Socket_sideMeta = null;
|
// public static Field Socket_sideMeta = null;
|
||||||
//public static Field Socket_facID = null;
|
// public static Field Socket_facID = null;
|
||||||
//public static Field Socket_facMeta = null;
|
// public static Field Socket_facMeta = null;
|
||||||
|
|
||||||
public static Class SocketsMod = null;
|
public static Class SocketsMod = null;
|
||||||
public static Field module = null;
|
public static Field module = null;
|
||||||
|
|
||||||
public static Class SideConfig = null;
|
public static Class SideConfig = null;
|
||||||
public static Field SC_tank = null;
|
public static Field SC_tank = null;
|
||||||
public static Field SC_inventory = null;
|
public static Field SC_inventory = null;
|
||||||
public static Field SC_rsControl = null;
|
public static Field SC_rsControl = null;
|
||||||
public static Field SC_rsLatch = null;
|
public static Field SC_rsLatch = null;
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
try{
|
try {
|
||||||
Class ModClass = Class.forName("emasher.sockets.TileSocket");
|
Class ModClass = Class.forName("emasher.sockets.TileSocket");
|
||||||
Waila.log.log(Level.INFO, "Engineer Toolbox mod found.");
|
Waila.log.log(Level.INFO, "Engineer Toolbox mod found.");
|
||||||
} catch (ClassNotFoundException e){
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[Engineer Toolbox] Engineer Toolbox mod not found.");
|
Waila.log.log(Level.INFO, "[Engineer Toolbox] Engineer Toolbox mod not found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try {
|
||||||
|
|
||||||
TileSocket = Class.forName("emasher.sockets.TileSocket");
|
TileSocket = Class.forName("emasher.sockets.TileSocket");
|
||||||
Socket_sides = TileSocket.getField("sides");
|
Socket_sides = TileSocket.getField("sides");
|
||||||
Socket_configs = TileSocket.getField("configs");
|
Socket_configs = TileSocket.getField("configs");
|
||||||
//Socket_sideID = TileSocket.getField("sideID");
|
// Socket_sideID = TileSocket.getField("sideID");
|
||||||
//Socket_sideMeta = TileSocket.getField("sideMeta");
|
// Socket_sideMeta = TileSocket.getField("sideMeta");
|
||||||
//Socket_facID = TileSocket.getField("facID");
|
// Socket_facID = TileSocket.getField("facID");
|
||||||
//Socket_facMeta = TileSocket.getField("facMeta");
|
// Socket_facMeta = TileSocket.getField("facMeta");
|
||||||
|
|
||||||
SocketsMod = Class.forName("emasher.sockets.SocketsMod");
|
SocketsMod = Class.forName("emasher.sockets.SocketsMod");
|
||||||
module = SocketsMod.getField("module");
|
module = SocketsMod.getField("module");
|
||||||
//module = (Item)SocketsMod.getField("module").get(null);
|
// module = (Item)SocketsMod.getField("module").get(null);
|
||||||
/*
|
/*
|
||||||
if (module == null){
|
* if (module == null){ mod_Waila.log.log(Level.WARNING, "[Engineer Toolbox] module field is null !");
|
||||||
mod_Waila.log.log(Level.WARNING, "[Engineer Toolbox] module field is null !");
|
* return; }
|
||||||
return;
|
*/
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
SideConfig = Class.forName("emasher.api.SideConfig");
|
SideConfig = Class.forName("emasher.api.SideConfig");
|
||||||
SC_tank = SideConfig.getField("tank");
|
SC_tank = SideConfig.getField("tank");
|
||||||
SC_inventory = SideConfig.getField("inventory");
|
SC_inventory = SideConfig.getField("inventory");
|
||||||
SC_rsControl = SideConfig.getField("rsControl");
|
SC_rsControl = SideConfig.getField("rsControl");
|
||||||
SC_rsLatch = SideConfig.getField("rsLatch");
|
SC_rsLatch = SideConfig.getField("rsLatch");
|
||||||
|
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
Waila.log.log(Level.WARN, "[Engineer Toolbox] Class not found. " + e);
|
||||||
|
return;
|
||||||
|
// } catch (NoSuchMethodException e){
|
||||||
|
// Waila.log.log(Level.WARN, "[Engineer Toolbox] Method not found." + e);
|
||||||
|
// return;
|
||||||
|
} catch (NoSuchFieldException e) {
|
||||||
|
Waila.log.log(Level.WARN, "[Engineer Toolbox] Field not found." + e);
|
||||||
|
return;
|
||||||
|
} catch (Exception e) {
|
||||||
|
Waila.log.log(Level.WARN, "[Engineer Toolbox] Unhandled exception." + e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
} catch (ClassNotFoundException e){
|
ModuleRegistrar.instance().addConfig("Engineer Toolbox", "etb.displaydata");
|
||||||
Waila.log.log(Level.WARN, "[Engineer Toolbox] Class not found. " + e);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerSocket(), TileSocket);
|
||||||
return;
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerSocket(), TileSocket);
|
||||||
// } catch (NoSuchMethodException e){
|
}
|
||||||
// Waila.log.log(Level.WARN, "[Engineer Toolbox] Method not found." + e);
|
|
||||||
// return;
|
|
||||||
} catch (NoSuchFieldException e){
|
|
||||||
Waila.log.log(Level.WARN, "[Engineer Toolbox] Field not found." + e);
|
|
||||||
return;
|
|
||||||
} catch (Exception e){
|
|
||||||
Waila.log.log(Level.WARN, "[Engineer Toolbox] Unhandled exception." + e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfig("Engineer Toolbox", "etb.displaydata");
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerSocket(), TileSocket);
|
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerSocket(), TileSocket);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -9,6 +9,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
@@ -16,99 +17,93 @@ import mcp.mobius.waila.utils.WailaExceptionHandler;
|
|||||||
|
|
||||||
public class HUDHandlerSocket implements IWailaDataProvider {
|
public class HUDHandlerSocket implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
if (!config.getConfig("etb.displaydata")) return currenttip;
|
IWailaConfigHandler config) {
|
||||||
|
if (!config.getConfig("etb.displaydata")) return currenttip;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int[] sides = (int[])ETBModule.Socket_sides.get(accessor.getTileEntity());
|
int[] sides = (int[]) ETBModule.Socket_sides.get(accessor.getTileEntity());
|
||||||
Object[] configs = (Object[])ETBModule.Socket_configs.get(accessor.getTileEntity());
|
Object[] configs = (Object[]) ETBModule.Socket_configs.get(accessor.getTileEntity());
|
||||||
Item module = (Item)ETBModule.module.get(null);
|
Item module = (Item) ETBModule.module.get(null);
|
||||||
|
|
||||||
|
for (int s = 0; s < 6; s++) {
|
||||||
|
if (sides[s] != 0) {
|
||||||
|
|
||||||
for( int s = 0; s < 6; s++){
|
int tank = (Integer) ETBModule.SC_tank.get(configs[s]);
|
||||||
if (sides[s] != 0){
|
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]);
|
||||||
|
|
||||||
int tank = (Integer)ETBModule.SC_tank.get(configs[s]);
|
ItemStack stack = new ItemStack(module, 1, sides[s]);
|
||||||
int inventory = (Integer)ETBModule.SC_inventory.get(configs[s]);
|
String tipstr = String
|
||||||
boolean[] rsControl = (boolean[])ETBModule.SC_rsControl.get(configs[s]);
|
.format("%-5s : %s ", ForgeDirection.getOrientation(s), stack.getDisplayName());
|
||||||
boolean[] rsLatch = (boolean[])ETBModule.SC_rsLatch.get(configs[s]);
|
|
||||||
|
|
||||||
|
String configstr = "[ ";
|
||||||
|
|
||||||
ItemStack stack = new ItemStack(module, 1, sides[s]);
|
if (tank != -1) configstr += "\u00a79" + String.valueOf(tank) + " ";
|
||||||
String tipstr = String.format("%-5s : %s ", ForgeDirection.getOrientation(s), stack.getDisplayName());
|
|
||||||
|
|
||||||
String configstr = "[ ";
|
if (inventory != -1) configstr += "\u00a7a" + String.valueOf(inventory) + " ";
|
||||||
|
|
||||||
if (tank != -1)
|
if (rsControl[0] || rsControl[1] || rsControl[2]) {
|
||||||
configstr += "\u00a79" + String.valueOf(tank) + " ";
|
configstr += "\u00a7c";
|
||||||
|
configstr += rsControl[0] ? "1" : "0";
|
||||||
|
configstr += rsControl[1] ? "1" : "0";
|
||||||
|
configstr += rsControl[2] ? "1" : "0";
|
||||||
|
configstr += " ";
|
||||||
|
}
|
||||||
|
|
||||||
if (inventory != -1)
|
if (rsLatch[0] || rsLatch[1] || rsLatch[2]) {
|
||||||
configstr += "\u00a7a" + String.valueOf(inventory) + " ";
|
configstr += "\u00a75";
|
||||||
|
configstr += rsLatch[0] ? "1" : "0";
|
||||||
|
configstr += rsLatch[1] ? "1" : "0";
|
||||||
|
configstr += rsLatch[2] ? "1" : "0";
|
||||||
|
configstr += " ";
|
||||||
|
}
|
||||||
|
|
||||||
if (rsControl[0] || rsControl[1] || rsControl[2]){
|
configstr += "\u00a7r]";
|
||||||
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]){
|
if (!configstr.equals("[ \u00a7r]")) tipstr += " " + configstr;
|
||||||
configstr += "\u00a75";
|
|
||||||
configstr += rsLatch[0] ? "1" : "0";
|
|
||||||
configstr += rsLatch[1] ? "1" : "0";
|
|
||||||
configstr += rsLatch[2] ? "1" : "0";
|
|
||||||
configstr += " ";
|
|
||||||
}
|
|
||||||
|
|
||||||
configstr += "\u00a7r]";
|
/*
|
||||||
|
* 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);
|
||||||
|
*/
|
||||||
|
|
||||||
if (!configstr.equals("[ \u00a7r]"))
|
currenttip.add(tipstr);
|
||||||
tipstr += " " + configstr;
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
} catch (Exception e) {
|
||||||
if ((tank != -1) && (inventory != -1))
|
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||||
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);
|
return currenttip;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
|
IWailaConfigHandler config) {
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
} catch (Exception e) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
int y, int z) {
|
||||||
}
|
if (te != null) te.writeToNBT(tag);
|
||||||
|
return tag;
|
||||||
return currenttip;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
|
||||||
return currenttip;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
|
||||||
if (te != null)
|
|
||||||
te.writeToNBT(tag);
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -7,29 +7,28 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class ExtraUtilitiesModule {
|
public class ExtraUtilitiesModule {
|
||||||
|
|
||||||
public static Class ModExtraUtilities = null;
|
public static Class ModExtraUtilities = null;
|
||||||
public static Class TileEntityDrum = null;
|
public static Class TileEntityDrum = null;
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
|
|
||||||
|
try {
|
||||||
|
Class ModExtraUtilities = Class.forName("com.rwtema.extrautils.ExtraUtils");
|
||||||
|
Waila.log.log(Level.INFO, "ExtraUtilities mod found.");
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
Waila.log.log(Level.INFO, "[ExtraUtilities] ExtraUtilities mod not found.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try{
|
try {
|
||||||
Class ModExtraUtilities = Class.forName("com.rwtema.extrautils.ExtraUtils");
|
TileEntityDrum = Class.forName("com.rwtema.extrautils.tileentity.TileEntityDrum");
|
||||||
Waila.log.log(Level.INFO, "ExtraUtilities mod found.");
|
} catch (ClassNotFoundException e) {
|
||||||
} catch (ClassNotFoundException e){
|
Waila.log.log(Level.WARN, "[ExtraUtilities] Class not found. " + e);
|
||||||
Waila.log.log(Level.INFO, "[ExtraUtilities] ExtraUtilities mod not found.");
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
try{
|
ModuleRegistrar.instance().addConfigRemote("ExtraUtilities", "extrautilities.fluidamount");
|
||||||
TileEntityDrum = Class.forName("com.rwtema.extrautils.tileentity.TileEntityDrum");
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerDrum(), TileEntityDrum);
|
||||||
} catch (ClassNotFoundException e){
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerDrum(), TileEntityDrum);
|
||||||
Waila.log.log(Level.WARN, "[ExtraUtilities] Class not found. " + e);
|
}
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("ExtraUtilities", "extrautilities.fluidamount");
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerDrum(), TileEntityDrum);
|
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerDrum(), TileEntityDrum);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -10,54 +10,57 @@ import net.minecraft.world.World;
|
|||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import net.minecraftforge.fluids.FluidTankInfo;
|
import net.minecraftforge.fluids.FluidTankInfo;
|
||||||
import net.minecraftforge.fluids.IFluidHandler;
|
import net.minecraftforge.fluids.IFluidHandler;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
|
||||||
public class HUDHandlerDrum implements IWailaDataProvider {
|
public class HUDHandlerDrum implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
|
IWailaConfigHandler config) {
|
||||||
|
|
||||||
if (!config.getConfig("extrautilities.fluidamount")) return currenttip;
|
if (!config.getConfig("extrautilities.fluidamount")) return currenttip;
|
||||||
|
|
||||||
int amount = 0;
|
int amount = 0;
|
||||||
|
|
||||||
NBTTagCompound subtag = accessor.getNBTData().getCompoundTag("tank");
|
NBTTagCompound subtag = accessor.getNBTData().getCompoundTag("tank");
|
||||||
if (subtag.hasKey("Amount"))
|
if (subtag.hasKey("Amount")) amount = accessor.getNBTInteger(subtag, "Amount");
|
||||||
amount = accessor.getNBTInteger(subtag, "Amount");
|
|
||||||
|
|
||||||
IFluidHandler handler = (IFluidHandler)accessor.getTileEntity();
|
IFluidHandler handler = (IFluidHandler) accessor.getTileEntity();
|
||||||
if (handler == null) return currenttip;
|
if (handler == null) return currenttip;
|
||||||
|
|
||||||
FluidTankInfo[] tanks = handler.getTankInfo(ForgeDirection.UNKNOWN);
|
FluidTankInfo[] tanks = handler.getTankInfo(ForgeDirection.UNKNOWN);
|
||||||
if (tanks.length != 1) return currenttip;
|
if (tanks.length != 1) return currenttip;
|
||||||
|
|
||||||
currenttip.add(String.format("%d / %d mB", amount, tanks[0].capacity));
|
currenttip.add(String.format("%d / %d mB", amount, tanks[0].capacity));
|
||||||
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
if (te != null)
|
int y, int z) {
|
||||||
te.writeToNBT(tag);
|
if (te != null) te.writeToNBT(tag);
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -7,27 +7,26 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class GravestoneModule {
|
public class GravestoneModule {
|
||||||
|
|
||||||
public static Class BlockGraveStone = null;
|
public static Class BlockGraveStone = null;
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
|
|
||||||
try{
|
try {
|
||||||
Class ModGravestone = Class.forName("GraveStone.ModGraveStone");
|
Class ModGravestone = Class.forName("GraveStone.ModGraveStone");
|
||||||
Waila.log.log(Level.INFO, "GraveStone mod found.");
|
Waila.log.log(Level.INFO, "GraveStone mod found.");
|
||||||
} catch (ClassNotFoundException e){
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[GraveStone] GraveStone mod not found.");
|
Waila.log.log(Level.INFO, "[GraveStone] GraveStone mod not found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
BlockGraveStone = Class.forName("GraveStone.block.BlockGSGraveStone");
|
BlockGraveStone = Class.forName("GraveStone.block.BlockGSGraveStone");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.WARN, "[GraveStone] Class not found. " + e);
|
Waila.log.log(Level.WARN, "[GraveStone] Class not found. " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ModuleRegistrar.instance().registerStackProvider(new HUDHandlerGravestone(), BlockGraveStone);
|
||||||
ModuleRegistrar.instance().registerStackProvider(new HUDHandlerGravestone(), BlockGraveStone);
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerGravestone(), BlockGraveStone);
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerGravestone(), BlockGraveStone);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -7,37 +7,41 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
|
||||||
public class HUDHandlerGravestone implements IWailaDataProvider {
|
public class HUDHandlerGravestone implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return new ItemStack(accessor.getBlock(), 0, accessor.getMetadata());
|
return new ItemStack(accessor.getBlock(), 0, accessor.getMetadata());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
if (te != null)
|
int y, int z) {
|
||||||
te.writeToNBT(tag);
|
if (te != null) te.writeToNBT(tag);
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,54 +2,58 @@ package mcp.mobius.waila.addons.harvestcraft;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
import mcp.mobius.waila.cbcore.LangUtil;
|
||||||
import mcp.mobius.waila.utils.NBTUtil;
|
import mcp.mobius.waila.utils.NBTUtil;
|
||||||
|
|
||||||
public class HUDHandlerPamCrop implements IWailaDataProvider {
|
public class HUDHandlerPamCrop implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
if (!config.getConfig("general.showcrop")) return currenttip;
|
IWailaConfigHandler config) {
|
||||||
|
if (!config.getConfig("general.showcrop")) return currenttip;
|
||||||
|
|
||||||
int growthStage = NBTUtil.getNBTInteger(accessor.getNBTData(), "growthStage");
|
int growthStage = NBTUtil.getNBTInteger(accessor.getNBTData(), "growthStage");
|
||||||
|
|
||||||
float growthValue = (growthStage / 2.0F) * 100.0F;
|
float growthValue = (growthStage / 2.0F) * 100.0F;
|
||||||
if (growthValue < 100.0)
|
if (growthValue < 100.0)
|
||||||
currenttip.add(String.format("%s : %.0f %%", LangUtil.translateG("hud.msg.growth"), growthValue));
|
currenttip.add(String.format("%s : %.0f %%", LangUtil.translateG("hud.msg.growth"), growthValue));
|
||||||
else
|
else currenttip.add(
|
||||||
currenttip.add(String.format("%s : %s", LangUtil.translateG("hud.msg.growth"), LangUtil.translateG("hud.msg.mature")));
|
String.format("%s : %s", LangUtil.translateG("hud.msg.growth"), LangUtil.translateG("hud.msg.mature")));
|
||||||
return currenttip;
|
return currenttip;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
if (te != null)
|
int y, int z) {
|
||||||
te.writeToNBT(tag);
|
if (te != null) te.writeToNBT(tag);
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -6,25 +6,25 @@ import mcp.mobius.waila.Waila;
|
|||||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||||
|
|
||||||
public class HarvestcraftModule {
|
public class HarvestcraftModule {
|
||||||
public static Class TileEntityPamCrop = null;
|
|
||||||
|
|
||||||
|
public static Class TileEntityPamCrop = null;
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
try{
|
try {
|
||||||
Class PamHarvestCraft = Class.forName("assets.pamharvestcraft.PamHarvestCraft");
|
Class PamHarvestCraft = Class.forName("assets.pamharvestcraft.PamHarvestCraft");
|
||||||
Waila.log.log(Level.INFO, "PamHarvestCraft mod found.");
|
Waila.log.log(Level.INFO, "PamHarvestCraft mod found.");
|
||||||
} catch (ClassNotFoundException e){
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[PamHarvestCraft] PamHarvestCraft mod not found.");
|
Waila.log.log(Level.INFO, "[PamHarvestCraft] PamHarvestCraft mod not found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try {
|
||||||
TileEntityPamCrop = Class.forName("assets.pamharvestcraft.TileEntityPamCrop");
|
TileEntityPamCrop = Class.forName("assets.pamharvestcraft.TileEntityPamCrop");
|
||||||
} catch (ClassNotFoundException e){
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.WARN, "[PamHarvestCraft] Class not found. " + e);
|
Waila.log.log(Level.WARN, "[PamHarvestCraft] Class not found. " + e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerPamCrop(), TileEntityPamCrop);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerPamCrop(), TileEntityPamCrop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
package mcp.mobius.waila.addons.ic2;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
|
||||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
|
||||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
|
||||||
import static mcp.mobius.waila.api.SpecialChars.*;
|
|
||||||
|
|
||||||
public class HUDHandlerTEBaseGenerator 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{
|
|
||||||
int storage = -1;
|
|
||||||
int production = -1;
|
|
||||||
|
|
||||||
if (IC2Module.TileEntityBaseGenerator.isInstance(accessor.getTileEntity())){
|
|
||||||
storage = IC2Module.TEBG_MaxStorage.getShort(accessor.getTileEntity());
|
|
||||||
production = IC2Module.TEBG_Production.getInt(accessor.getTileEntity());
|
|
||||||
}
|
|
||||||
else if (IC2Module.TileEntityGeoGenerator.isInstance(accessor.getTileEntity())){
|
|
||||||
storage = IC2Module.TEGG_MaxStorage.getShort(accessor.getTileEntity());
|
|
||||||
production = IC2Module.TEGG_Production.getInt(accessor.getTileEntity());
|
|
||||||
}
|
|
||||||
else if (IC2Module.TileEntitySemifluidGenerator.isInstance(accessor.getTileEntity())){
|
|
||||||
storage = IC2Module.TESG_MaxStorage.getShort(accessor.getTileEntity());
|
|
||||||
production = (int)IC2Module.TESG_Production.getDouble(accessor.getTileEntity());
|
|
||||||
}
|
|
||||||
|
|
||||||
String storedStr = LangUtil.translateG("hud.msg.stored");
|
|
||||||
String outputStr = LangUtil.translateG("hud.msg.output");
|
|
||||||
|
|
||||||
/* EU Storage */
|
|
||||||
if (ConfigHandler.instance().getConfig("ic2.storage")){
|
|
||||||
double stored = IC2Module.getStoredEnergy(accessor);
|
|
||||||
|
|
||||||
if ( stored >= 0.0 && storage > 0)
|
|
||||||
currenttip.add(String.format("%s%s\u00a7f%d\u00a7r / \u00a7f%d\u00a7r EU", storedStr, TAB + ALIGNRIGHT, Math.round(Math.min(stored,storage)), storage));
|
|
||||||
|
|
||||||
//else if (stored >= 0.0)
|
|
||||||
// currenttip.add(String.format("Stored : %d EU", stored));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ConfigHandler.instance().getConfig("ic2.outputeu")){
|
|
||||||
if ( production > 0)
|
|
||||||
currenttip.add(String.format("%s%s\u00a7f%d\u00a7r EU/t", outputStr, TAB + ALIGNRIGHT, production));
|
|
||||||
}
|
|
||||||
|
|
||||||
} 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound getNBTData(TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
|
||||||
if (te != null)
|
|
||||||
te.writeToNBT(tag);
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
package mcp.mobius.waila.addons.ic2;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
|
||||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
|
||||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
|
||||||
import static mcp.mobius.waila.api.SpecialChars.*;
|
|
||||||
|
|
||||||
public class HUDHandlerTEElectricBlock implements IWailaDataProvider {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor,
|
|
||||||
IWailaConfigHandler config) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
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 storedStr = LangUtil.translateG("hud.msg.stored");
|
|
||||||
String outputStr = LangUtil.translateG("hud.msg.output");
|
|
||||||
|
|
||||||
/* EU Storage */
|
|
||||||
if (ConfigHandler.instance().getConfig("ic2.storage")){
|
|
||||||
double stored = IC2Module.getStoredEnergy(accessor);
|
|
||||||
int storage = IC2Module.TEEB_MaxStorage.getInt(accessor.getTileEntity());
|
|
||||||
|
|
||||||
if ( stored >= 0.0 )
|
|
||||||
currenttip.add(String.format("%s%s\u00a7f%d\u00a7r / \u00a7f%d\u00a7r EU", storedStr, TAB + ALIGNRIGHT, Math.round(Math.min(stored,storage)), storage));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ConfigHandler.instance().getConfig("ic2.outputeu")){
|
|
||||||
int production = IC2Module.TEEB_Output.getInt(accessor.getTileEntity());
|
|
||||||
if ( production > 0)
|
|
||||||
currenttip.add(String.format("%s%s\u00a7f%d\u00a7r EU/t", outputStr, TAB + ALIGNRIGHT, production));
|
|
||||||
}
|
|
||||||
|
|
||||||
} 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound getNBTData(TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
|
||||||
if (te != null)
|
|
||||||
te.writeToNBT(tag);
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
package mcp.mobius.waila.addons.ic2;
|
package mcp.mobius.waila.addons.ic2;
|
||||||
|
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.ALIGNRIGHT;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.TAB;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
@@ -8,104 +11,113 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
import mcp.mobius.waila.cbcore.LangUtil;
|
||||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||||
import static mcp.mobius.waila.api.SpecialChars.*;
|
|
||||||
|
|
||||||
public class HUDHandlerTEGenerator implements IWailaDataProvider {
|
public class HUDHandlerTEGenerator implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
try{
|
IWailaConfigHandler config) {
|
||||||
double storage = accessor.getNBTData().getDouble("storage");
|
try {
|
||||||
int production = accessor.getNBTData().getInteger("production");
|
double storage = accessor.getNBTData().getDouble("storage");
|
||||||
long maxStorage = accessor.getNBTData().getLong("maxStorage");
|
int production = accessor.getNBTData().getInteger("production");
|
||||||
|
long maxStorage = accessor.getNBTData().getLong("maxStorage");
|
||||||
|
|
||||||
String storedStr = LangUtil.translateG("hud.msg.stored");
|
String storedStr = LangUtil.translateG("hud.msg.stored");
|
||||||
String outputStr = LangUtil.translateG("hud.msg.output");
|
String outputStr = LangUtil.translateG("hud.msg.output");
|
||||||
|
|
||||||
/* EU Storage */
|
/* EU Storage */
|
||||||
if (ConfigHandler.instance().getConfig("ic2.storage")){
|
if (ConfigHandler.instance().getConfig("ic2.storage")) {
|
||||||
if (maxStorage > 0)
|
if (maxStorage > 0) currenttip.add(
|
||||||
currenttip.add(String.format("%s%s\u00a7f%d\u00a7r / \u00a7f%d\u00a7r EU", storedStr, TAB + ALIGNRIGHT, Math.round(Math.min(storage,maxStorage)), maxStorage));
|
String.format(
|
||||||
}
|
"%s%s\u00a7f%d\u00a7r / \u00a7f%d\u00a7r EU",
|
||||||
|
storedStr,
|
||||||
|
TAB + ALIGNRIGHT,
|
||||||
|
Math.round(Math.min(storage, maxStorage)),
|
||||||
|
maxStorage));
|
||||||
|
}
|
||||||
|
|
||||||
if (ConfigHandler.instance().getConfig("ic2.outputeu")){
|
if (ConfigHandler.instance().getConfig("ic2.outputeu")) {
|
||||||
currenttip.add(String.format("%s%s\u00a7f%d\u00a7r EU/t", outputStr, TAB + ALIGNRIGHT, production));
|
currenttip.add(String.format("%s%s\u00a7f%d\u00a7r EU/t", outputStr, TAB + ALIGNRIGHT, production));
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e){
|
} catch (Exception e) {
|
||||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||||
}
|
}
|
||||||
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
|
int y, int z) {
|
||||||
|
|
||||||
try{
|
try {
|
||||||
double storage = -1;
|
double storage = -1;
|
||||||
long production = -1;
|
long production = -1;
|
||||||
long maxStorage = -1;
|
long maxStorage = -1;
|
||||||
|
|
||||||
if (IC2Module.TileBaseGenerator.isInstance(te)){
|
if (IC2Module.TileBaseGenerator.isInstance(te)) {
|
||||||
storage = IC2Module.TileBaseGenerator_storage.getDouble(te);
|
storage = IC2Module.TileBaseGenerator_storage.getDouble(te);
|
||||||
production = (long)IC2Module.TileBaseGenerator_production.getInt(te);
|
production = (long) IC2Module.TileBaseGenerator_production.getInt(te);
|
||||||
maxStorage = (long)IC2Module.TileBaseGenerator_maxStorage.getShort(te);
|
maxStorage = (long) IC2Module.TileBaseGenerator_maxStorage.getShort(te);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (IC2Module.TileGeoGenerator.isInstance(te)){
|
else if (IC2Module.TileGeoGenerator.isInstance(te)) {
|
||||||
storage = IC2Module.TileGeoGenerator_storage.getDouble(te);
|
storage = IC2Module.TileGeoGenerator_storage.getDouble(te);
|
||||||
production = (long)IC2Module.TileGeoGenerator_production.getInt(te);
|
production = (long) IC2Module.TileGeoGenerator_production.getInt(te);
|
||||||
maxStorage = (long)IC2Module.TileGeoGenerator_maxStorage.getShort(te);
|
maxStorage = (long) IC2Module.TileGeoGenerator_maxStorage.getShort(te);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (IC2Module.TileKineticGenerator.isInstance(te)){
|
else if (IC2Module.TileKineticGenerator.isInstance(te)) {
|
||||||
storage = IC2Module.TileKineticGenerator_storage.getDouble(te);
|
storage = IC2Module.TileKineticGenerator_storage.getDouble(te);
|
||||||
production = MathHelper.floor_double_long(IC2Module.TileKineticGenerator_production.getDouble(te));
|
production = MathHelper.floor_double_long(IC2Module.TileKineticGenerator_production.getDouble(te));
|
||||||
maxStorage = (long)IC2Module.TileKineticGenerator_maxStorage.getInt(te);
|
maxStorage = (long) IC2Module.TileKineticGenerator_maxStorage.getInt(te);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (IC2Module.TileSemifluidGenerator.isInstance(te)){
|
else if (IC2Module.TileSemifluidGenerator.isInstance(te)) {
|
||||||
storage = IC2Module.TileSemifluidGenerator_storage.getDouble(te);
|
storage = IC2Module.TileSemifluidGenerator_storage.getDouble(te);
|
||||||
production = MathHelper.floor_double_long(IC2Module.TileSemifluidGenerator_production.getDouble(te));
|
production = MathHelper.floor_double_long(IC2Module.TileSemifluidGenerator_production.getDouble(te));
|
||||||
maxStorage = (long)IC2Module.TileSemifluidGenerator_maxStorage.getShort(te);
|
maxStorage = (long) IC2Module.TileSemifluidGenerator_maxStorage.getShort(te);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (IC2Module.TileStirlingGenerator.isInstance(te)){
|
else if (IC2Module.TileStirlingGenerator.isInstance(te)) {
|
||||||
storage = IC2Module.TileStirlingGenerator_storage.getDouble(te);
|
storage = IC2Module.TileStirlingGenerator_storage.getDouble(te);
|
||||||
production = MathHelper.floor_double_long(IC2Module.TileStirlingGenerator_production.getDouble(te));
|
production = MathHelper.floor_double_long(IC2Module.TileStirlingGenerator_production.getDouble(te));
|
||||||
maxStorage = (long)IC2Module.TileStirlingGenerator_maxStorage.getShort(te);
|
maxStorage = (long) IC2Module.TileStirlingGenerator_maxStorage.getShort(te);
|
||||||
}
|
}
|
||||||
|
|
||||||
tag.setDouble ("storage", storage);
|
tag.setDouble("storage", storage);
|
||||||
tag.setLong ("production", production);
|
tag.setLong("production", production);
|
||||||
tag.setLong ("maxStorage", maxStorage);
|
tag.setLong("maxStorage", maxStorage);
|
||||||
|
|
||||||
} catch (Exception e){
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
package mcp.mobius.waila.addons.ic2;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
|
||||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
|
||||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
|
||||||
import static mcp.mobius.waila.api.SpecialChars.*;
|
|
||||||
|
|
||||||
public class HUDHandlerTEStandardMachine implements IWailaDataProvider {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor,
|
|
||||||
IWailaConfigHandler config) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
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{
|
|
||||||
|
|
||||||
IC2Upgrades upgrades = IC2Module.getUpgrades(accessor);
|
|
||||||
int baseConsumption = IC2Module.TESM_DefaultEnergyConsume.getInt(accessor.getTileEntity());
|
|
||||||
int baseOpTime = IC2Module.TESM_DefaultOperationLength.getInt(accessor.getTileEntity());
|
|
||||||
int baseStorage = IC2Module.TESM_DefaultEnergyStorage.getInt(accessor.getTileEntity());
|
|
||||||
|
|
||||||
long consumption = Math.round(Math.min(baseConsumption * Math.pow(1.6D, upgrades.overclocker), 2147483647));
|
|
||||||
|
|
||||||
double stackOpLen = baseOpTime * 64.0D * Math.pow(0.7D, upgrades.overclocker);
|
|
||||||
int opPerTick = ((int)Math.min(Math.ceil(64.0D / stackOpLen), 2147483647.0D));
|
|
||||||
int opTime = ((int)Math.round(stackOpLen * opPerTick / 64.0D));
|
|
||||||
|
|
||||||
int storage = Math.round(Math.min(baseStorage + 10000 * upgrades.storage + opTime * consumption, 2147483647));;
|
|
||||||
|
|
||||||
|
|
||||||
int maxinput = (Integer)IC2Module.IES_GetMaxSafeInput.invoke(accessor.getTileEntity()) * (int)Math.pow(4.0D, Math.min(4, upgrades.transform));
|
|
||||||
double stored = IC2Module.getStoredEnergy(accessor);
|
|
||||||
|
|
||||||
String storedStr = LangUtil.translateG("hud.msg.stored");
|
|
||||||
String powerStr = LangUtil.translateG("hud.msg.power");
|
|
||||||
String maxPowerStr = LangUtil.translateG("hud.msg.maxpower");
|
|
||||||
|
|
||||||
/* EU Storage */
|
|
||||||
if (ConfigHandler.instance().getConfig("ic2.storage")){
|
|
||||||
if ( stored >= 0.0 )
|
|
||||||
currenttip.add(String.format("%s%s\u00a7f%d\u00a7r / \u00a7f%d\u00a7r EU", storedStr, TAB + ALIGNRIGHT, Math.round(Math.min(stored,storage)), storage));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ConfigHandler.instance().getConfig("ic2.consump")){
|
|
||||||
if ( consumption > 0)
|
|
||||||
currenttip.add(String.format("%s%s\u00a7f%d\u00a7r EU/t", powerStr, TAB + ALIGNRIGHT, consumption ));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ConfigHandler.instance().getConfig("ic2.inputeu")){
|
|
||||||
if ( maxinput > 0)
|
|
||||||
currenttip.add(String.format("%s%s\u00a7f%d\u00a7r EU/t", maxPowerStr, TAB + ALIGNRIGHT, maxinput ));
|
|
||||||
}
|
|
||||||
|
|
||||||
} 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound getNBTData(TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
|
||||||
if (te != null)
|
|
||||||
te.writeToNBT(tag);
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
package mcp.mobius.waila.addons.ic2;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.nbt.NBTTagList;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
|
||||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
|
||||||
import static mcp.mobius.waila.api.SpecialChars.*;
|
|
||||||
|
|
||||||
public class HUDHandlerTETradeOMat 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 (!ConfigHandler.instance().getConfig("ic2.tradeomat")) return currenttip;
|
|
||||||
|
|
||||||
NBTTagCompound slots = accessor.getNBTData().getCompoundTag("InvSlots");
|
|
||||||
NBTTagList offer = slots.getCompoundTag("offer").getTagList("Contents");
|
|
||||||
NBTTagList demand = slots.getCompoundTag("demand").getTagList("Contents");
|
|
||||||
String offersStr = LangUtil.translateG("hud.msg.offers");
|
|
||||||
String demandsStr = LangUtil.translateG("hud.msg.demands");
|
|
||||||
|
|
||||||
|
|
||||||
if (offer.tagCount() == 1){
|
|
||||||
NBTTagCompound subtag = (NBTTagCompound)offer.tagAt(0);
|
|
||||||
ItemStack is = new ItemStack(subtag.getShort("id"), subtag.getByte("Count"), subtag.getShort("Damage"));
|
|
||||||
currenttip.add(String.format("%s%s\u00a7f%d\u00a7r x \u00a7f%s\u00a7r", offersStr, TAB + ALIGNRIGHT, is.stackSize, is.getDisplayName()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (demand.tagCount() == 1){
|
|
||||||
NBTTagCompound subtag = (NBTTagCompound)demand.tagAt(0);
|
|
||||||
ItemStack is = new ItemStack(subtag.getShort("id"), subtag.getByte("Count"), subtag.getShort("Damage"));
|
|
||||||
currenttip.add(String.format("%s%s\u00a7f%d\u00a7r x \u00a7f%s\u00a7r", demandsStr, TAB + ALIGNRIGHT, is.stackSize, is.getDisplayName()));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
return currenttip;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
|
||||||
return currenttip;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound getNBTData(TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
|
||||||
if (te != null)
|
|
||||||
te.writeToNBT(tag);
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package mcp.mobius.waila.addons.ic2;
|
package mcp.mobius.waila.addons.ic2;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Level;
|
import org.apache.logging.log4j.Level;
|
||||||
|
|
||||||
import mcp.mobius.waila.Waila;
|
import mcp.mobius.waila.Waila;
|
||||||
@@ -8,84 +9,84 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class IC2Module {
|
public class IC2Module {
|
||||||
|
|
||||||
public static Class TileBaseGenerator = null;
|
public static Class TileBaseGenerator = null;
|
||||||
public static Field TileBaseGenerator_storage = null;
|
public static Field TileBaseGenerator_storage = null;
|
||||||
public static Field TileBaseGenerator_maxStorage = null;
|
public static Field TileBaseGenerator_maxStorage = null;
|
||||||
public static Field TileBaseGenerator_production = null;
|
public static Field TileBaseGenerator_production = null;
|
||||||
|
|
||||||
public static Class TileGeoGenerator = null;
|
public static Class TileGeoGenerator = null;
|
||||||
public static Field TileGeoGenerator_storage = null;
|
public static Field TileGeoGenerator_storage = null;
|
||||||
public static Field TileGeoGenerator_maxStorage = null;
|
public static Field TileGeoGenerator_maxStorage = null;
|
||||||
public static Field TileGeoGenerator_production = null;
|
public static Field TileGeoGenerator_production = null;
|
||||||
|
|
||||||
public static Class TileKineticGenerator = null;
|
public static Class TileKineticGenerator = null;
|
||||||
public static Field TileKineticGenerator_storage = null;
|
public static Field TileKineticGenerator_storage = null;
|
||||||
public static Field TileKineticGenerator_maxStorage = null;
|
public static Field TileKineticGenerator_maxStorage = null;
|
||||||
public static Field TileKineticGenerator_production = null;
|
public static Field TileKineticGenerator_production = null;
|
||||||
|
|
||||||
public static Class TileSemifluidGenerator = null;
|
public static Class TileSemifluidGenerator = null;
|
||||||
public static Field TileSemifluidGenerator_storage = null;
|
public static Field TileSemifluidGenerator_storage = null;
|
||||||
public static Field TileSemifluidGenerator_maxStorage = null;
|
public static Field TileSemifluidGenerator_maxStorage = null;
|
||||||
public static Field TileSemifluidGenerator_production = null;
|
public static Field TileSemifluidGenerator_production = null;
|
||||||
|
|
||||||
public static Class TileStirlingGenerator = null;
|
public static Class TileStirlingGenerator = null;
|
||||||
public static Field TileStirlingGenerator_storage = null;
|
public static Field TileStirlingGenerator_storage = null;
|
||||||
public static Field TileStirlingGenerator_maxStorage = null;
|
public static Field TileStirlingGenerator_maxStorage = null;
|
||||||
public static Field TileStirlingGenerator_production = null;
|
public static Field TileStirlingGenerator_production = null;
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
// XXX : We register the Energy interface first
|
// XXX : We register the Energy interface first
|
||||||
try{
|
try {
|
||||||
TileBaseGenerator = Class.forName("ic2.core.block.generator.tileentity.TileEntityBaseGenerator");
|
TileBaseGenerator = Class.forName("ic2.core.block.generator.tileentity.TileEntityBaseGenerator");
|
||||||
TileBaseGenerator_storage = TileBaseGenerator.getDeclaredField("storage");
|
TileBaseGenerator_storage = TileBaseGenerator.getDeclaredField("storage");
|
||||||
TileBaseGenerator_maxStorage = TileBaseGenerator.getDeclaredField("maxStorage");
|
TileBaseGenerator_maxStorage = TileBaseGenerator.getDeclaredField("maxStorage");
|
||||||
TileBaseGenerator_production = TileBaseGenerator.getDeclaredField("production");
|
TileBaseGenerator_production = TileBaseGenerator.getDeclaredField("production");
|
||||||
|
|
||||||
TileGeoGenerator = Class.forName("ic2.core.block.generator.tileentity.TileEntityGeoGenerator");
|
TileGeoGenerator = Class.forName("ic2.core.block.generator.tileentity.TileEntityGeoGenerator");
|
||||||
TileGeoGenerator_storage = TileGeoGenerator.getDeclaredField("storage");
|
TileGeoGenerator_storage = TileGeoGenerator.getDeclaredField("storage");
|
||||||
TileGeoGenerator_maxStorage = TileGeoGenerator.getDeclaredField("maxStorage");
|
TileGeoGenerator_maxStorage = TileGeoGenerator.getDeclaredField("maxStorage");
|
||||||
TileGeoGenerator_production = TileGeoGenerator.getDeclaredField("production");
|
TileGeoGenerator_production = TileGeoGenerator.getDeclaredField("production");
|
||||||
|
|
||||||
TileKineticGenerator = Class.forName("ic2.core.block.generator.tileentity.TileEntityKineticGenerator");
|
TileKineticGenerator = Class.forName("ic2.core.block.generator.tileentity.TileEntityKineticGenerator");
|
||||||
TileKineticGenerator_storage = TileKineticGenerator.getDeclaredField("EUstorage");
|
TileKineticGenerator_storage = TileKineticGenerator.getDeclaredField("EUstorage");
|
||||||
TileKineticGenerator_maxStorage = TileKineticGenerator.getDeclaredField("maxEUStorage");
|
TileKineticGenerator_maxStorage = TileKineticGenerator.getDeclaredField("maxEUStorage");
|
||||||
TileKineticGenerator_production = TileKineticGenerator.getDeclaredField("production");
|
TileKineticGenerator_production = TileKineticGenerator.getDeclaredField("production");
|
||||||
TileKineticGenerator_storage.setAccessible(true);
|
TileKineticGenerator_storage.setAccessible(true);
|
||||||
TileKineticGenerator_maxStorage.setAccessible(true);
|
TileKineticGenerator_maxStorage.setAccessible(true);
|
||||||
TileKineticGenerator_production.setAccessible(true);
|
TileKineticGenerator_production.setAccessible(true);
|
||||||
|
|
||||||
TileSemifluidGenerator = Class.forName("ic2.core.block.generator.tileentity.TileEntitySemifluidGenerator");
|
TileSemifluidGenerator = Class.forName("ic2.core.block.generator.tileentity.TileEntitySemifluidGenerator");
|
||||||
TileSemifluidGenerator_storage = TileSemifluidGenerator.getDeclaredField("storage");
|
TileSemifluidGenerator_storage = TileSemifluidGenerator.getDeclaredField("storage");
|
||||||
TileSemifluidGenerator_maxStorage = TileSemifluidGenerator.getDeclaredField("maxStorage");
|
TileSemifluidGenerator_maxStorage = TileSemifluidGenerator.getDeclaredField("maxStorage");
|
||||||
TileSemifluidGenerator_production = TileSemifluidGenerator.getDeclaredField("production");
|
TileSemifluidGenerator_production = TileSemifluidGenerator.getDeclaredField("production");
|
||||||
TileSemifluidGenerator_storage.setAccessible(true);
|
TileSemifluidGenerator_storage.setAccessible(true);
|
||||||
TileSemifluidGenerator_maxStorage.setAccessible(true);
|
TileSemifluidGenerator_maxStorage.setAccessible(true);
|
||||||
TileSemifluidGenerator_production.setAccessible(true);
|
TileSemifluidGenerator_production.setAccessible(true);
|
||||||
|
|
||||||
TileStirlingGenerator = Class.forName("ic2.core.block.generator.tileentity.TileEntityStirlingGenerator");
|
TileStirlingGenerator = Class.forName("ic2.core.block.generator.tileentity.TileEntityStirlingGenerator");
|
||||||
TileStirlingGenerator_storage = TileStirlingGenerator.getDeclaredField("EUstorage");
|
TileStirlingGenerator_storage = TileStirlingGenerator.getDeclaredField("EUstorage");
|
||||||
TileStirlingGenerator_maxStorage = TileStirlingGenerator.getDeclaredField("maxEUStorage");
|
TileStirlingGenerator_maxStorage = TileStirlingGenerator.getDeclaredField("maxEUStorage");
|
||||||
TileStirlingGenerator_production = TileStirlingGenerator.getDeclaredField("production");
|
TileStirlingGenerator_production = TileStirlingGenerator.getDeclaredField("production");
|
||||||
|
|
||||||
//ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energyhandler");
|
// ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energyhandler");
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEGenerator(), TileBaseGenerator);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEGenerator(), TileBaseGenerator);
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEGenerator(), TileGeoGenerator);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEGenerator(), TileGeoGenerator);
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEGenerator(), TileKineticGenerator);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEGenerator(), TileKineticGenerator);
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEGenerator(), TileSemifluidGenerator);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEGenerator(), TileSemifluidGenerator);
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEGenerator(), TileStirlingGenerator);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEGenerator(), TileStirlingGenerator);
|
||||||
|
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerTEGenerator(), TileBaseGenerator);
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerTEGenerator(), TileBaseGenerator);
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerTEGenerator(), TileGeoGenerator);
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerTEGenerator(), TileGeoGenerator);
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerTEGenerator(), TileKineticGenerator);
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerTEGenerator(), TileKineticGenerator);
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerTEGenerator(), TileSemifluidGenerator);
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerTEGenerator(), TileSemifluidGenerator);
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerTEGenerator(), TileStirlingGenerator);
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerTEGenerator(), TileStirlingGenerator);
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("IndustrialCraft2", "ic2.storage");
|
ModuleRegistrar.instance().addConfigRemote("IndustrialCraft2", "ic2.storage");
|
||||||
ModuleRegistrar.instance().addConfigRemote("IndustrialCraft2", "ic2.outputeu");
|
ModuleRegistrar.instance().addConfigRemote("IndustrialCraft2", "ic2.outputeu");
|
||||||
|
|
||||||
} catch (Exception e){
|
} catch (Exception e) {
|
||||||
Waila.log.log(Level.WARN, "[IndustrialCraft 2] Error while loading generator hooks." + e);
|
Waila.log.log(Level.WARN, "[IndustrialCraft 2] Error while loading generator hooks." + e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,186 +0,0 @@
|
|||||||
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 cpw.mods.fml.common.ObfuscationReflectionHelper;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.nbt.NBTTagList;
|
|
||||||
import mcp.mobius.waila.Waila;
|
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
|
||||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
|
||||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|
||||||
import mcp.mobius.waila.utils.AccessHelper;
|
|
||||||
|
|
||||||
public class IC2Module {
|
|
||||||
|
|
||||||
public static Class TileEntityStandardMachine = null;
|
|
||||||
public static Field TESM_DefaultEnergyStorage = null;
|
|
||||||
public static Field TESM_DefaultEnergyConsume = null;
|
|
||||||
public static Field TESM_DefaultOperationLength = null;
|
|
||||||
public static Field TESM_MaxEnergy = null;
|
|
||||||
|
|
||||||
public static Class TileEntityBaseGenerator = null;
|
|
||||||
public static Field TEBG_MaxStorage = null;
|
|
||||||
public static Field TEBG_Production = null;
|
|
||||||
|
|
||||||
public static Class TileEntitySemifluidGenerator = null;
|
|
||||||
public static Field TESG_MaxStorage = null;
|
|
||||||
public static Field TESG_Production = null;
|
|
||||||
|
|
||||||
public static Class TileEntityGeoGenerator = null;
|
|
||||||
public static Field TEGG_MaxStorage = null;
|
|
||||||
public static Field TEGG_Production = null;
|
|
||||||
|
|
||||||
public static Class TileEntityElectricBlock = null;
|
|
||||||
public static Field TEEB_MaxStorage = null;
|
|
||||||
public static Field TEEB_Output = null;
|
|
||||||
|
|
||||||
public static Class IEnergySink = null;
|
|
||||||
public static Method IES_GetMaxSafeInput = null;
|
|
||||||
|
|
||||||
public static Class TileEntityTradeOMat = null;
|
|
||||||
|
|
||||||
/* Some required items */
|
|
||||||
public static Class IC2Items = null;
|
|
||||||
public static Field TransformerUpgrade = null;
|
|
||||||
public static ItemStack TransformerUpgradeStack = null;
|
|
||||||
public static Field EnergyStorageUpgrade = null;
|
|
||||||
public static ItemStack EnergyStorageUpgradeStack = null;
|
|
||||||
public static Field OverclockerUpgrade = null;
|
|
||||||
public static ItemStack OverclockerUpgradeStack = null;
|
|
||||||
|
|
||||||
public static void register(){
|
|
||||||
/*
|
|
||||||
|
|
||||||
try{
|
|
||||||
TileEntityStandardMachine = Class.forName("ic2.core.block.machine.tileentity.TileEntityStandardMachine");
|
|
||||||
TESM_DefaultEnergyStorage = TileEntityStandardMachine.getField("defaultEnergyStorage");
|
|
||||||
TESM_DefaultEnergyConsume = TileEntityStandardMachine.getField("defaultEnergyConsume");
|
|
||||||
TESM_DefaultOperationLength = TileEntityStandardMachine.getField("defaultOperationLength");
|
|
||||||
TESM_MaxEnergy = TileEntityStandardMachine.getField("maxEnergy");
|
|
||||||
|
|
||||||
TileEntityBaseGenerator = Class.forName("ic2.core.block.generator.tileentity.TileEntityBaseGenerator");
|
|
||||||
TEBG_MaxStorage = TileEntityBaseGenerator.getField("maxStorage");
|
|
||||||
TEBG_Production = TileEntityBaseGenerator.getField("production");
|
|
||||||
|
|
||||||
TileEntitySemifluidGenerator = Class.forName("ic2.core.block.generator.tileentity.TileEntitySemifluidGenerator");
|
|
||||||
TESG_MaxStorage = TileEntitySemifluidGenerator.getDeclaredField("maxStorage");
|
|
||||||
TESG_Production = TileEntitySemifluidGenerator.getDeclaredField("production");
|
|
||||||
TESG_MaxStorage.setAccessible(true);
|
|
||||||
TESG_Production.setAccessible(true);
|
|
||||||
|
|
||||||
TileEntityGeoGenerator = Class.forName("ic2.core.block.generator.tileentity.TileEntityGeoGenerator");
|
|
||||||
TEGG_MaxStorage = TileEntityGeoGenerator.getField("maxStorage");
|
|
||||||
TEGG_Production = TileEntityGeoGenerator.getField("production");
|
|
||||||
|
|
||||||
TileEntityElectricBlock = Class.forName("ic2.core.block.wiring.TileEntityElectricBlock");
|
|
||||||
TEEB_MaxStorage = TileEntityElectricBlock.getField("maxStorage");
|
|
||||||
TEEB_Output = TileEntityElectricBlock.getField("output");
|
|
||||||
|
|
||||||
IEnergySink = Class.forName("ic2.api.energy.tile.IEnergySink");
|
|
||||||
IES_GetMaxSafeInput = IEnergySink.getMethod("getMaxSafeInput");
|
|
||||||
|
|
||||||
IC2Items = Class.forName("ic2.core.Ic2Items");
|
|
||||||
TransformerUpgrade = IC2Items.getField("transformerUpgrade");
|
|
||||||
EnergyStorageUpgrade = IC2Items.getField("energyStorageUpgrade");
|
|
||||||
OverclockerUpgrade = IC2Items.getField("overclockerUpgrade");
|
|
||||||
|
|
||||||
TransformerUpgradeStack = (ItemStack)TransformerUpgrade.get(null);
|
|
||||||
EnergyStorageUpgradeStack = (ItemStack)EnergyStorageUpgrade.get(null);
|
|
||||||
OverclockerUpgradeStack = (ItemStack)OverclockerUpgrade.get(null);
|
|
||||||
|
|
||||||
TileEntityTradeOMat = Class.forName("ic2.core.block.personal.TileEntityTradeOMat");
|
|
||||||
|
|
||||||
} catch (ClassNotFoundException e){
|
|
||||||
//e.printStackTrace();
|
|
||||||
Waila.log.log(Level.WARNING, "[IC2] Class not found. " + e);
|
|
||||||
return;
|
|
||||||
} catch (NoSuchMethodException e){
|
|
||||||
//e.printStackTrace();
|
|
||||||
Waila.log.log(Level.WARNING, "[IC2] Method not found." + e);
|
|
||||||
return;
|
|
||||||
} catch (NoSuchFieldException e){
|
|
||||||
//e.printStackTrace();
|
|
||||||
Waila.log.log(Level.WARNING, "[IC2] Field not found." + e);
|
|
||||||
return;
|
|
||||||
} catch (Exception e){
|
|
||||||
//e.printStackTrace();
|
|
||||||
Waila.log.log(Level.WARNING, "[IC2] Unhandled exception." + e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("IndustrialCraft2", "ic2.storage");
|
|
||||||
ModuleRegistrar.instance().addConfig("IndustrialCraft2", "ic2.outputeu");
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("IndustrialCraft2", "ic2.inputeu");
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("IndustrialCraft2", "ic2.consump");
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("IndustrialCraft2", "ic2.tradeomat");
|
|
||||||
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEStandardMachine(), TileEntityStandardMachine);
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEBaseGenerator(), TileEntityBaseGenerator);
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEBaseGenerator(), TileEntitySemifluidGenerator);
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEBaseGenerator(), TileEntityGeoGenerator);
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTEElectricBlock(), TileEntityElectricBlock);
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTETradeOMat(), TileEntityTradeOMat);
|
|
||||||
|
|
||||||
ModuleRegistrar.instance().registerSyncedNBTKey("*", TileEntityStandardMachine);
|
|
||||||
ModuleRegistrar.instance().registerSyncedNBTKey("*", TileEntityBaseGenerator);
|
|
||||||
ModuleRegistrar.instance().registerSyncedNBTKey("*", TileEntitySemifluidGenerator);
|
|
||||||
ModuleRegistrar.instance().registerSyncedNBTKey("*", TileEntityGeoGenerator);
|
|
||||||
ModuleRegistrar.instance().registerSyncedNBTKey("*", TileEntityElectricBlock);
|
|
||||||
ModuleRegistrar.instance().registerSyncedNBTKey("*", TileEntityTradeOMat);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Retuns the current stored energy if available in the nbt and config is true */
|
|
||||||
public static double getStoredEnergy(IWailaDataAccessor accessor){
|
|
||||||
/*
|
|
||||||
if (ConfigHandler.instance().getConfig("ic2.storage")){
|
|
||||||
if (accessor.getNBTData().hasKey("energy"))
|
|
||||||
return accessor.getNBTData().getDouble("energy");
|
|
||||||
else if (accessor.getNBTData().hasKey("storage"))
|
|
||||||
return accessor.getNBTData().getDouble("storage");
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
return -1.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IC2Upgrades getUpgrades(IWailaDataAccessor accessor){
|
|
||||||
|
|
||||||
NBTTagCompound nbt = accessor.getNBTData();
|
|
||||||
IC2Upgrades upgrades = new IC2Upgrades();
|
|
||||||
|
|
||||||
/*
|
|
||||||
if (!nbt.hasKey("InvSlots")) return null;
|
|
||||||
|
|
||||||
NBTTagCompound inventory = nbt.getCompoundTag("InvSlots");
|
|
||||||
if (!inventory.hasKey("upgrade")) return null;
|
|
||||||
|
|
||||||
NBTTagList nbtupgrades = inventory.getCompoundTag("upgrade").getTagList("Contents");
|
|
||||||
|
|
||||||
//List tagList = (List)AccessHelper.getField("net.minecraft.nbt.NBTTagList", "tagList", nbtupgrades);
|
|
||||||
List tagList = ObfuscationReflectionHelper.getPrivateValue(NBTTagList.class, nbtupgrades, "field_74747_a");
|
|
||||||
|
|
||||||
for (Object subobj : tagList){
|
|
||||||
NBTTagCompound subtag = (NBTTagCompound)subobj;
|
|
||||||
int id = subtag.getShort("id");
|
|
||||||
int meta = subtag.getShort("Damage");
|
|
||||||
int count = subtag.getByte("Count");
|
|
||||||
|
|
||||||
//ItemStack is = new ItemStack(id, 1, count);
|
|
||||||
if (TransformerUpgradeStack.getItemDamage() == meta && TransformerUpgradeStack.itemID == id)
|
|
||||||
upgrades.transform += count;
|
|
||||||
if (EnergyStorageUpgradeStack.getItemDamage() == meta && EnergyStorageUpgradeStack.itemID == id)
|
|
||||||
upgrades.storage += count;
|
|
||||||
if (OverclockerUpgradeStack.getItemDamage() == meta && OverclockerUpgradeStack.itemID == id)
|
|
||||||
upgrades.overclocker += count;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
return upgrades;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package mcp.mobius.waila.addons.ic2;
|
|
||||||
|
|
||||||
public class IC2Upgrades {
|
|
||||||
public int transform = 0;
|
|
||||||
public int storage = 0;
|
|
||||||
public int overclocker = 0;
|
|
||||||
}
|
|
||||||
@@ -2,52 +2,56 @@ package mcp.mobius.waila.addons.magicalcrops;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
import mcp.mobius.waila.cbcore.LangUtil;
|
||||||
|
|
||||||
public class HUDHandlerMagicalCrops implements IWailaDataProvider {
|
public class HUDHandlerMagicalCrops implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
if (!config.getConfig("general.showcrop")) return currenttip;
|
IWailaConfigHandler config) {
|
||||||
|
if (!config.getConfig("general.showcrop")) return currenttip;
|
||||||
|
|
||||||
int growthStage = accessor.getMetadata();
|
int growthStage = accessor.getMetadata();
|
||||||
|
|
||||||
float growthValue = (growthStage / 7.0F) * 100.0F;
|
float growthValue = (growthStage / 7.0F) * 100.0F;
|
||||||
if (growthValue < 100.0)
|
if (growthValue < 100.0)
|
||||||
currenttip.add(String.format("%s : %.0f %%", LangUtil.translateG("hud.msg.growth"), growthValue));
|
currenttip.add(String.format("%s : %.0f %%", LangUtil.translateG("hud.msg.growth"), growthValue));
|
||||||
else
|
else currenttip.add(
|
||||||
currenttip.add(String.format("%s : %s", LangUtil.translateG("hud.msg.growth"), LangUtil.translateG("hud.msg.mature")));
|
String.format("%s : %s", LangUtil.translateG("hud.msg.growth"), LangUtil.translateG("hud.msg.mature")));
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
if (te != null)
|
int y, int z) {
|
||||||
te.writeToNBT(tag);
|
if (te != null) te.writeToNBT(tag);
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -6,25 +6,25 @@ import mcp.mobius.waila.Waila;
|
|||||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||||
|
|
||||||
public class MagicalCropsModule {
|
public class MagicalCropsModule {
|
||||||
public static Class BlockMagicalCrops = null;
|
|
||||||
|
|
||||||
|
public static Class BlockMagicalCrops = null;
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
try{
|
try {
|
||||||
Class MagicalCrops = Class.forName("magicalcrops.mod_sCrops");
|
Class MagicalCrops = Class.forName("magicalcrops.mod_sCrops");
|
||||||
Waila.log.log(Level.INFO, "MagicalCrops mod found.");
|
Waila.log.log(Level.INFO, "MagicalCrops mod found.");
|
||||||
} catch (ClassNotFoundException e){
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[MagicalCrops] MagicalCrops mod not found.");
|
Waila.log.log(Level.INFO, "[MagicalCrops] MagicalCrops mod not found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try {
|
||||||
BlockMagicalCrops = Class.forName("magicalcrops.BlockMagicalCrops");
|
BlockMagicalCrops = Class.forName("magicalcrops.BlockMagicalCrops");
|
||||||
} catch (ClassNotFoundException e){
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.WARN, "[MagicalCrops] Class not found. " + e);
|
Waila.log.log(Level.WARN, "[MagicalCrops] Class not found. " + e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerMagicalCrops(), BlockMagicalCrops);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerMagicalCrops(), BlockMagicalCrops);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
import net.minecraftforge.fluids.FluidTankInfo;
|
import net.minecraftforge.fluids.FluidTankInfo;
|
||||||
import net.minecraftforge.fluids.IFluidHandler;
|
import net.minecraftforge.fluids.IFluidHandler;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
@@ -18,63 +19,65 @@ import mcp.mobius.waila.cbcore.LangUtil;
|
|||||||
|
|
||||||
public class HUDHandlerTank implements IWailaDataProvider {
|
public class HUDHandlerTank implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
if (!config.getConfig("openblocks.fluidamount")) return currenttip;
|
IWailaConfigHandler config) {
|
||||||
|
if (!config.getConfig("openblocks.fluidamount")) return currenttip;
|
||||||
|
|
||||||
IFluidHandler handler = (IFluidHandler)accessor.getTileEntity();
|
IFluidHandler handler = (IFluidHandler) accessor.getTileEntity();
|
||||||
if (handler == null) return currenttip;
|
if (handler == null) return currenttip;
|
||||||
|
|
||||||
FluidTankInfo[] tanks = handler.getTankInfo(ForgeDirection.UNKNOWN);
|
FluidTankInfo[] tanks = handler.getTankInfo(ForgeDirection.UNKNOWN);
|
||||||
if (tanks.length != 1) return currenttip;
|
if (tanks.length != 1) return currenttip;
|
||||||
|
|
||||||
FluidStack fluid = tanks[0].fluid;
|
FluidStack fluid = tanks[0].fluid;
|
||||||
String name = currenttip.get(0);
|
String name = currenttip.get(0);
|
||||||
|
|
||||||
try{
|
try {
|
||||||
name += String.format(" < %s >", fluid.getFluid().getLocalizedName(fluid));
|
name += String.format(" < %s >", fluid.getFluid().getLocalizedName(fluid));
|
||||||
} catch (NullPointerException f){
|
} catch (NullPointerException f) {
|
||||||
name += " " + LangUtil.translateG("hud.msg.empty");
|
name += " " + LangUtil.translateG("hud.msg.empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
currenttip.set(0, name);
|
currenttip.set(0, name);
|
||||||
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
if (!config.getConfig("openblocks.fluidamount")) return currenttip;
|
IWailaConfigHandler config) {
|
||||||
|
if (!config.getConfig("openblocks.fluidamount")) return currenttip;
|
||||||
|
|
||||||
IFluidHandler handler = (IFluidHandler)accessor.getTileEntity();
|
IFluidHandler handler = (IFluidHandler) accessor.getTileEntity();
|
||||||
if (handler == null) return currenttip;
|
if (handler == null) return currenttip;
|
||||||
|
|
||||||
FluidTankInfo[] tanks = handler.getTankInfo(ForgeDirection.UNKNOWN);
|
FluidTankInfo[] tanks = handler.getTankInfo(ForgeDirection.UNKNOWN);
|
||||||
if (tanks.length != 1) return currenttip;
|
if (tanks.length != 1) return currenttip;
|
||||||
|
|
||||||
if(tanks[0].fluid != null)
|
if (tanks[0].fluid != null)
|
||||||
currenttip.add(String.format("%d / %d mB", tanks[0].fluid.amount, tanks[0].capacity));
|
currenttip.add(String.format("%d / %d mB", tanks[0].fluid.amount, tanks[0].capacity));
|
||||||
else
|
else currenttip.add(String.format("0 / %d mB", tanks[0].capacity));
|
||||||
currenttip.add(String.format("0 / %d mB", tanks[0].capacity));
|
|
||||||
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
if (te != null)
|
int y, int z) {
|
||||||
te.writeToNBT(tag);
|
if (te != null) te.writeToNBT(tag);
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -7,28 +7,28 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class OpenBlocksModule {
|
public class OpenBlocksModule {
|
||||||
|
|
||||||
public static Class ModOpenBlocks = null;
|
public static Class ModOpenBlocks = null;
|
||||||
public static Class TileEntityTank = null;
|
public static Class TileEntityTank = null;
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
try{
|
try {
|
||||||
Class ModOpenBlocks = Class.forName("openblocks.OpenBlocks");
|
Class ModOpenBlocks = Class.forName("openblocks.OpenBlocks");
|
||||||
Waila.log.log(Level.INFO, "OpenBlocks mod found.");
|
Waila.log.log(Level.INFO, "OpenBlocks mod found.");
|
||||||
} catch (ClassNotFoundException e){
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[OpenBlocks] OpenBlocks mod not found.");
|
Waila.log.log(Level.INFO, "[OpenBlocks] OpenBlocks mod not found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try {
|
||||||
TileEntityTank = Class.forName("openblocks.common.tileentity.TileEntityTank");
|
TileEntityTank = Class.forName("openblocks.common.tileentity.TileEntityTank");
|
||||||
} catch (ClassNotFoundException e){
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.WARN, "[OpenBlocks] Class not found. " + e);
|
Waila.log.log(Level.WARN, "[OpenBlocks] Class not found. " + e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("OpenBlocks", "openblocks.fluidamount");
|
ModuleRegistrar.instance().addConfigRemote("OpenBlocks", "openblocks.fluidamount");
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTank(), TileEntityTank);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTank(), TileEntityTank);
|
||||||
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerTank(), TileEntityTank);
|
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerTank(), TileEntityTank);
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerTank(), TileEntityTank);
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerTank(), TileEntityTank);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@ package mcp.mobius.waila.addons.projectred;
|
|||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaFMPAccessor;
|
import mcp.mobius.waila.api.IWailaFMPAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaFMPDecorator;
|
import mcp.mobius.waila.api.IWailaFMPDecorator;
|
||||||
@@ -10,201 +11,321 @@ import mcp.mobius.waila.utils.NBTUtil;
|
|||||||
|
|
||||||
public class HUDDecoratorRsGateLogic implements IWailaFMPDecorator {
|
public class HUDDecoratorRsGateLogic implements IWailaFMPDecorator {
|
||||||
|
|
||||||
static byte[][] IOARRAY={
|
static byte[][] IOARRAY = { { 1, 1, 2, 1 } /* OR */, { 1, 1, 2, 1 } /* NOR */, { 1, 2, 2, 2 } /* NOT */,
|
||||||
{1,1,2,1} /* OR */, {1,1,2,1} /* NOR */, {1,2,2,2} /* NOT */, {1,1,2,1} /* AND */,
|
{ 1, 1, 2, 1 } /* AND */, { 1, 1, 2, 1 } /* NAND */, { 0, 1, 2, 1 } /* XOR */, { 0, 1, 2, 1 } /* XNOR */,
|
||||||
{1,1,2,1} /* NAND */, {0,1,2,1} /* XOR */, {0,1,2,1} /* XNOR */, {1,2,2,2} /* Buf */,
|
{ 1, 2, 2, 2 } /* Buf */, { 3, 4, 2, 5 } /* Multi */, { 1, 0, 2, 0 } /* Pulse */,
|
||||||
{3,4,2,5} /* Multi */, {1,0,2,0} /* Pulse */, {1,0,2,0} /* Repeat */, {1,2,2,2} /* Rand */,
|
{ 1, 0, 2, 0 } /* Repeat */, { 1, 2, 2, 2 } /* Rand */, { 2, 1, 2, 1 } /* Latch */,
|
||||||
{2,1,2,1} /* Latch */, {2,1,2,1} /* Toggle*/, {6,1,2,2} /* Transp */, {2,0,0,0} /* Light */,
|
{ 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 */,
|
{ 2, 0, 0, 0 } /* Rain */, { 1, 7, 2, 7 } /* Timer */, { 2, 2, 2, 2 } /* Sequen */,
|
||||||
{1,2,2,6} /* State */, {6,1,2,1} /* Sync */, {10,1,10,1} /* Bus */, {11,12,11,12} /* Null */,
|
{ 2, 9, 2, 8 } /* Count */, { 1, 2, 2, 6 } /* State */, { 6, 1, 2, 1 } /* Sync */,
|
||||||
{11,12,11,12} /* Inver */, {11,12,11,12} /* Buff */, {1,9,2,8} /* Cmp */, {1,12,2,12} /* And */,
|
{ 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 byte[][] IOARRAYALTER = { { 1, 8, 2, 9 } /* Cmp 1 */, { 1, 6, 2, 2 } /* State 1 */,
|
||||||
|
{ 2, 8, 2, 9 } /* Count 1 */, { 6, 2, 2, 1 } /* Transp 1 */, { 2, 1, 2, 1 } /* Latch 1 */,
|
||||||
|
{ 2, 1, 2, 1 } /* Latch 2 */, { 2, 1, 2, 1 } /* Latch 3 */
|
||||||
|
};
|
||||||
|
|
||||||
static byte[][] IOARRAYALTER={
|
static String[] IONAMES = { "", "IN", "OUT", "SWAP", "IN_A", "IN_B", "LOCK", "IO", "POS", "NEG", "BUS", "A", "B" };
|
||||||
{1,8,2,9} /* Cmp 1*/, {1,6,2,2} /* State 1*/, {2,8,2,9} /* Count 1*/, {6,2,2,1} /* Transp 1*/,
|
|
||||||
{2,1,2,1} /* Latch 1*/, {2,1,2,1} /* Latch 2*/, {2,1,2,1} /* Latch 3*/
|
|
||||||
};
|
|
||||||
|
|
||||||
static String[] IONAMES={ "", "IN", "OUT", "SWAP", "IN_A", "IN_B", "LOCK", "IO", "POS", "NEG", "BUS", "A", "B"};
|
@Override
|
||||||
|
public void decorateBlock(ItemStack itemStack, IWailaFMPAccessor accessor, IWailaConfigHandler config) {
|
||||||
|
|
||||||
@Override
|
if (!config.getConfig("pr.showio")) return;
|
||||||
public void decorateBlock(ItemStack itemStack, IWailaFMPAccessor accessor, IWailaConfigHandler config) {
|
|
||||||
|
|
||||||
if (!config.getConfig("pr.showio")) return;
|
int orient = 0;
|
||||||
|
int subID = 0;
|
||||||
|
int shape = 0;
|
||||||
|
|
||||||
|
orient = NBTUtil.getNBTInteger(accessor.getNBTData(), "orient");
|
||||||
|
subID = NBTUtil.getNBTInteger(accessor.getNBTData(), "subID");
|
||||||
|
shape = NBTUtil.getNBTInteger(accessor.getNBTData(), "shape");
|
||||||
|
|
||||||
int orient = 0;
|
// orient = orient - ((orient & 0x10) + (orient & 0x8) + (orient & 0x4));
|
||||||
int subID = 0;
|
int hOrient = orient & 0x3;
|
||||||
int shape = 0;
|
ForgeDirection vOrient = ForgeDirection.getOrientation((orient - (orient & 0x3)) >> 2);
|
||||||
|
|
||||||
orient = NBTUtil.getNBTInteger(accessor.getNBTData(), "orient");
|
// System.out.printf("%s\n", ForgeDirection.getOrientation(vOrient));
|
||||||
subID = NBTUtil.getNBTInteger(accessor.getNBTData(), "subID");
|
|
||||||
shape = NBTUtil.getNBTInteger(accessor.getNBTData(), "shape");
|
|
||||||
|
|
||||||
//orient = orient - ((orient & 0x10) + (orient & 0x8) + (orient & 0x4));
|
if (vOrient == ForgeDirection.EAST) hOrient -= 1;
|
||||||
int hOrient = orient & 0x3;
|
|
||||||
ForgeDirection vOrient = ForgeDirection.getOrientation((orient - (orient & 0x3)) >> 2);
|
|
||||||
|
|
||||||
//System.out.printf("%s\n", ForgeDirection.getOrientation(vOrient));
|
if (vOrient == ForgeDirection.WEST) hOrient += 1;
|
||||||
|
|
||||||
if (vOrient == ForgeDirection.EAST)
|
if (hOrient == -1) hOrient = 3;
|
||||||
hOrient -= 1;
|
|
||||||
|
|
||||||
if (vOrient == ForgeDirection.WEST)
|
String[] IOStr = new String[4];
|
||||||
hOrient += 1;
|
if (shape != 0) {
|
||||||
|
int altIndex = -1;
|
||||||
|
if (subID == 26 && shape == 1) altIndex = 0;
|
||||||
|
if (subID == 20 && shape == 1) altIndex = 1;
|
||||||
|
if (subID == 19 && shape == 1) altIndex = 2;
|
||||||
|
if (subID == 14 && shape == 1) altIndex = 3;
|
||||||
|
if (subID == 12 && shape == 1) altIndex = 4;
|
||||||
|
if (subID == 12 && shape == 2) altIndex = 5;
|
||||||
|
if (subID == 12 && shape == 3) altIndex = 6;
|
||||||
|
|
||||||
if (hOrient == -1)
|
if (altIndex == -1) for (int i = 0; i < 4; i++) IOStr[i] = IONAMES[IOARRAY[subID][i]];
|
||||||
hOrient = 3;
|
else for (int i = 0; i < 4; i++) IOStr[i] = IONAMES[IOARRAYALTER[altIndex][i]];
|
||||||
|
} else {
|
||||||
|
for (int i = 0; i < 4; i++) IOStr[i] = IONAMES[IOARRAY[subID][i]];
|
||||||
|
|
||||||
String[] IOStr = new String[4];
|
}
|
||||||
if (shape != 0){
|
|
||||||
int altIndex = -1;
|
|
||||||
if (subID == 26 && shape == 1) altIndex = 0;
|
|
||||||
if (subID == 20 && shape == 1) altIndex = 1;
|
|
||||||
if (subID == 19 && shape == 1) altIndex = 2;
|
|
||||||
if (subID == 14 && shape == 1) altIndex = 3;
|
|
||||||
if (subID == 12 && shape == 1) altIndex = 4;
|
|
||||||
if (subID == 12 && shape == 2) altIndex = 5;
|
|
||||||
if (subID == 12 && shape == 3) altIndex = 6;
|
|
||||||
|
|
||||||
if (altIndex == -1)
|
String[] IOStrRot = new String[4];
|
||||||
for (int i = 0; i < 4; i++)
|
|
||||||
IOStr[i] = IONAMES[IOARRAY[subID][i]];
|
|
||||||
else
|
|
||||||
for (int i = 0; i < 4; i++)
|
|
||||||
IOStr[i] = IONAMES[IOARRAYALTER[altIndex][i]];
|
|
||||||
} else {
|
|
||||||
for (int i = 0; i < 4; i++)
|
|
||||||
IOStr[i] = IONAMES[IOARRAY[subID][i]];
|
|
||||||
|
|
||||||
}
|
for (int i = 0; i < 4; i++) {
|
||||||
|
int j = i + hOrient;
|
||||||
|
if (j >= 4) j -= 4;
|
||||||
|
IOStrRot[j] = IOStr[i];
|
||||||
|
}
|
||||||
|
|
||||||
String[] IOStrRot = new String[4];
|
switch (vOrient) {
|
||||||
|
case DOWN:
|
||||||
for (int i = 0; i < 4 ; i++){
|
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.5F, 0.2F, 1.4F, 90F, 0F, 0F); // Orient
|
||||||
int j = i + hOrient;
|
// 0
|
||||||
if (j >= 4) j -= 4;
|
UIHelper.drawFloatingText(
|
||||||
IOStrRot[j] = IOStr[i];
|
IOStrRot[1],
|
||||||
}
|
accessor.getRenderingPosition(),
|
||||||
|
-0.4F,
|
||||||
switch(vOrient){
|
0.2F,
|
||||||
case DOWN:
|
0.5F,
|
||||||
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.5F, 0.2F, 1.4F, 90F, 0F, 0F); // Orient 0
|
90F,
|
||||||
UIHelper.drawFloatingText(IOStrRot[1], accessor.getRenderingPosition(), -0.4F, 0.2F, 0.5F, 90F, 270F, 0F); // Orient 1
|
270F,
|
||||||
UIHelper.drawFloatingText(IOStrRot[2], accessor.getRenderingPosition(), 0.5F, 0.2F, -0.4F, 90F, 180F, 0F); // Orient 2
|
0F); // Orient 1
|
||||||
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), 1.4F, 0.2F, 0.5F, 90F, 90F, 0F); // Orient 3
|
UIHelper.drawFloatingText(
|
||||||
break;
|
IOStrRot[2],
|
||||||
case EAST:
|
accessor.getRenderingPosition(),
|
||||||
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.8F, 0.5F, 1.4F, 0F, 90F, 90F);
|
0.5F,
|
||||||
UIHelper.drawFloatingText(IOStrRot[1], accessor.getRenderingPosition(), 0.8F, -0.4F, 0.5F, 0F, 90F, 180F);
|
0.2F,
|
||||||
UIHelper.drawFloatingText(IOStrRot[2], accessor.getRenderingPosition(), 0.8F, 0.5F, -0.4F, 0F, 90F, 270F);
|
-0.4F,
|
||||||
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), 0.8F, 1.4F, 0.5F, 0F, 90F, 0F);
|
90F,
|
||||||
break;
|
180F,
|
||||||
case NORTH:
|
0F); // Orient 2
|
||||||
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.5F, 1.4F, 0.2F, 0F, 180F, 0F);
|
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), 1.4F, 0.2F, 0.5F, 90F, 90F, 0F); // Orient
|
||||||
UIHelper.drawFloatingText(IOStrRot[1], accessor.getRenderingPosition(), 1.4F, 0.5F, 0.2F, 0F, 180F, 90F);
|
// 3
|
||||||
UIHelper.drawFloatingText(IOStrRot[2], accessor.getRenderingPosition(), 0.5F, -0.4F, 0.2F, 0F, 180F, 180F);
|
break;
|
||||||
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), -0.4F, 0.5F, 0.2F, 0F, 180F, 270F);
|
case EAST:
|
||||||
break;
|
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.8F, 0.5F, 1.4F, 0F, 90F, 90F);
|
||||||
case SOUTH:
|
UIHelper.drawFloatingText(
|
||||||
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.5F, 1.4F, 0.8F, 0F, 0F, 0F);
|
IOStrRot[1],
|
||||||
UIHelper.drawFloatingText(IOStrRot[1], accessor.getRenderingPosition(), -0.4F, 0.5F, 0.8F, 0F, 0F, 90F);
|
accessor.getRenderingPosition(),
|
||||||
UIHelper.drawFloatingText(IOStrRot[2], accessor.getRenderingPosition(), 0.5F, -0.4F, 0.8F, 0F, 0F, 180F);
|
0.8F,
|
||||||
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), 1.4F, 0.5F, 0.8F, 0F, 0F, 270F);
|
-0.4F,
|
||||||
break;
|
0.5F,
|
||||||
case UP:
|
0F,
|
||||||
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.5F, 0.8F, 1.4F, 270F, 180F, 0F);
|
90F,
|
||||||
UIHelper.drawFloatingText(IOStrRot[1], accessor.getRenderingPosition(), 1.4F, 0.8F, 0.5F, 270F, 270F, 0F);
|
180F);
|
||||||
UIHelper.drawFloatingText(IOStrRot[2], accessor.getRenderingPosition(), 0.5F, 0.8F, -0.4F, 270F, 0F, 0F);
|
UIHelper.drawFloatingText(
|
||||||
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), -0.4F, 0.8F, 0.5F, 270F, 90F, 0F);
|
IOStrRot[2],
|
||||||
break;
|
accessor.getRenderingPosition(),
|
||||||
case WEST:
|
0.8F,
|
||||||
UIHelper.drawFloatingText(IOStrRot[0], accessor.getRenderingPosition(), 0.2F, 0.5F, 1.4F, 180F, 90F, 90F);
|
0.5F,
|
||||||
UIHelper.drawFloatingText(IOStrRot[1], accessor.getRenderingPosition(), 0.2F, 1.4F, 0.5F, 180F, 90F, 180F);
|
-0.4F,
|
||||||
UIHelper.drawFloatingText(IOStrRot[2], accessor.getRenderingPosition(), 0.2F, 0.5F, -0.4F, 180F, 90F, 270F);
|
0F,
|
||||||
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), 0.2F, -0.4F, 0.5F, 180F, 90F, 0F);
|
90F,
|
||||||
break;
|
270F);
|
||||||
default:
|
UIHelper.drawFloatingText(IOStrRot[3], accessor.getRenderingPosition(), 0.8F, 1.4F, 0.5F, 0F, 90F, 0F);
|
||||||
break;
|
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 x = accessor.getRenderingPosition().xCoord;
|
||||||
double y = accessor.getRenderingPosition().yCoord;
|
double y = accessor.getRenderingPosition().yCoord;
|
||||||
double z = accessor.getRenderingPosition().zCoord;
|
double z = accessor.getRenderingPosition().zCoord;
|
||||||
|
|
||||||
switch(vOrient){
|
switch (vOrient) {
|
||||||
case DOWN:
|
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, 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 - 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, 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 + 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.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.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.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 );
|
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;
|
break;
|
||||||
case EAST:
|
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, 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 + 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, 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.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.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 - 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.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 );
|
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;
|
break;
|
||||||
case NORTH:
|
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, 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 - 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, 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 + 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.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.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.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 );
|
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;
|
break;
|
||||||
case SOUTH:
|
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, 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, 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, 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 + 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 + 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 + 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 + 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 );
|
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;
|
break;
|
||||||
case UP:
|
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, 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, 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, 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 + 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 + 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 + 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 + 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 );
|
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;
|
break;
|
||||||
case WEST:
|
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 + 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 + 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 + 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 + 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.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, 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.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 );
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,82 +1,99 @@
|
|||||||
package mcp.mobius.waila.addons.projectred;
|
package mcp.mobius.waila.addons.projectred;
|
||||||
|
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.ALIGNRIGHT;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.GRAY;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.TAB;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.WHITE;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaFMPAccessor;
|
import mcp.mobius.waila.api.IWailaFMPAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaFMPProvider;
|
import mcp.mobius.waila.api.IWailaFMPProvider;
|
||||||
import mcp.mobius.waila.utils.NBTUtil;
|
import mcp.mobius.waila.utils.NBTUtil;
|
||||||
import static mcp.mobius.waila.api.SpecialChars.*;
|
|
||||||
|
|
||||||
public class HUDFMPGateLogic implements IWailaFMPProvider {
|
public class HUDFMPGateLogic implements IWailaFMPProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor,
|
||||||
if (!config.getConfig("pr.showdata")) return currenttip;
|
IWailaConfigHandler config) {
|
||||||
|
if (!config.getConfig("pr.showdata")) return currenttip;
|
||||||
|
|
||||||
int orient = 0;
|
int orient = 0;
|
||||||
int subID = 0;
|
int subID = 0;
|
||||||
int shape = 0;
|
int shape = 0;
|
||||||
int pmax = 0;
|
int pmax = 0;
|
||||||
int val = 0;
|
int val = 0;
|
||||||
int max = 0;
|
int max = 0;
|
||||||
int dec = 0;
|
int dec = 0;
|
||||||
int inc = 0;
|
int inc = 0;
|
||||||
|
|
||||||
orient = NBTUtil.getNBTInteger(accessor.getNBTData(), "orient");
|
orient = NBTUtil.getNBTInteger(accessor.getNBTData(), "orient");
|
||||||
subID = NBTUtil.getNBTInteger(accessor.getNBTData(), "subID");
|
subID = NBTUtil.getNBTInteger(accessor.getNBTData(), "subID");
|
||||||
shape = NBTUtil.getNBTInteger(accessor.getNBTData(), "shape");
|
shape = NBTUtil.getNBTInteger(accessor.getNBTData(), "shape");
|
||||||
|
|
||||||
if (subID == 17)
|
if (subID == 17) pmax = NBTUtil.getNBTInteger(accessor.getNBTData(), "pmax");
|
||||||
pmax = NBTUtil.getNBTInteger(accessor.getNBTData(), "pmax");
|
|
||||||
|
|
||||||
if (subID == 19){
|
if (subID == 19) {
|
||||||
val = NBTUtil.getNBTInteger(accessor.getNBTData(), "val");
|
val = NBTUtil.getNBTInteger(accessor.getNBTData(), "val");
|
||||||
max = NBTUtil.getNBTInteger(accessor.getNBTData(), "max");
|
max = NBTUtil.getNBTInteger(accessor.getNBTData(), "max");
|
||||||
dec = NBTUtil.getNBTInteger(accessor.getNBTData(), "dec");
|
dec = NBTUtil.getNBTInteger(accessor.getNBTData(), "dec");
|
||||||
inc = NBTUtil.getNBTInteger(accessor.getNBTData(), "inc");
|
inc = NBTUtil.getNBTInteger(accessor.getNBTData(), "inc");
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(subID){
|
switch (subID) {
|
||||||
case 10:
|
case 10:
|
||||||
currenttip.add(String.format("[Repeater]" + TAB + ALIGNRIGHT + WHITE + "%d" + GRAY + " ticks", (int)Math.pow(2, shape)));
|
currenttip.add(
|
||||||
break;
|
String.format(
|
||||||
|
"[Repeater]" + TAB + ALIGNRIGHT + WHITE + "%d" + GRAY + " ticks",
|
||||||
|
(int) Math.pow(2, shape)));
|
||||||
|
break;
|
||||||
|
|
||||||
case 15:
|
case 15:
|
||||||
if (shape == 0)
|
if (shape == 0) currenttip.add("[Sensor]" + TAB + ALIGNRIGHT + WHITE + "Open");
|
||||||
currenttip.add("[Sensor]" + TAB + ALIGNRIGHT + WHITE + "Open");
|
if (shape == 1) currenttip.add("[Sensor]" + TAB + ALIGNRIGHT + WHITE + "Half closed");
|
||||||
if (shape == 1)
|
if (shape == 2) currenttip.add("[Sensor]" + TAB + ALIGNRIGHT + WHITE + "Closed");
|
||||||
currenttip.add("[Sensor]" + TAB + ALIGNRIGHT + WHITE + "Half closed");
|
break;
|
||||||
if (shape == 2)
|
|
||||||
currenttip.add("[Sensor]" + TAB + ALIGNRIGHT + WHITE + "Closed");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 17:
|
case 17:
|
||||||
currenttip.add(String.format("[Timer delay]" + TAB + ALIGNRIGHT + WHITE + "%d " + GRAY + "ms", (pmax + 2) * 50));
|
currenttip.add(
|
||||||
break;
|
String.format(
|
||||||
|
"[Timer delay]" + TAB + ALIGNRIGHT + WHITE + "%d " + GRAY + "ms",
|
||||||
|
(pmax + 2) * 50));
|
||||||
|
break;
|
||||||
|
|
||||||
case 19:
|
case 19:
|
||||||
|
|
||||||
|
currenttip.add(
|
||||||
|
String.format(
|
||||||
|
"[Counter value]" + TAB + ALIGNRIGHT + WHITE + "%d " + GRAY + "/ " + WHITE + "%d",
|
||||||
|
val,
|
||||||
|
max));
|
||||||
|
currenttip.add(
|
||||||
|
String.format(
|
||||||
|
"[Counter step]" + TAB + ALIGNRIGHT + WHITE + "-%d " + GRAY + "/ " + WHITE + "+%d",
|
||||||
|
dec,
|
||||||
|
inc));
|
||||||
|
|
||||||
currenttip.add(String.format("[Counter value]"+ TAB + ALIGNRIGHT + WHITE + "%d " + GRAY + "/ " + WHITE + "%d", val, max));
|
default:
|
||||||
currenttip.add(String.format("[Counter step]" + TAB + ALIGNRIGHT + WHITE + "-%d " + GRAY + "/ " + WHITE + "+%d", dec, inc));
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
return currenttip;
|
||||||
break;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return currenttip;
|
@Override
|
||||||
}
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor,
|
||||||
|
IWailaConfigHandler config) {
|
||||||
@Override
|
return currenttip;
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config) {
|
}
|
||||||
return currenttip;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -7,35 +7,35 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class ProjectRedModule {
|
public class ProjectRedModule {
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
try{
|
try {
|
||||||
Class ModClass = Class.forName("mrtjp.projectred.ProjectRedIntegration");
|
Class ModClass = Class.forName("mrtjp.projectred.ProjectRedIntegration");
|
||||||
Waila.log.log(Level.INFO, "ProjectRed|Integration mod found.");
|
Waila.log.log(Level.INFO, "ProjectRed|Integration mod found.");
|
||||||
} catch (ClassNotFoundException e){
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[ProjectRed] ProjectRed|Integration mod not found.");
|
Waila.log.log(Level.INFO, "[ProjectRed] ProjectRed|Integration mod not found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("Project:Red", "pr.showio");
|
ModuleRegistrar.instance().addConfigRemote("Project:Red", "pr.showio");
|
||||||
ModuleRegistrar.instance().addConfigRemote("Project:Red", "pr.showdata");
|
ModuleRegistrar.instance().addConfigRemote("Project:Red", "pr.showdata");
|
||||||
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPGateLogic(), "pr_sgate");
|
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPGateLogic(), "pr_sgate");
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPGateLogic(), "pr_igate");
|
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPGateLogic(), "pr_igate");
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPGateLogic(), "pr_tgate");
|
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPGateLogic(), "pr_tgate");
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPGateLogic(), "pr_bgate");
|
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPGateLogic(), "pr_bgate");
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPGateLogic(), "pr_agate");
|
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPGateLogic(), "pr_agate");
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPGateLogic(), "pr_rgate");
|
ModuleRegistrar.instance().registerBodyProvider(new HUDFMPGateLogic(), "pr_rgate");
|
||||||
|
|
||||||
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_sgate");
|
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_sgate");
|
||||||
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_igate");
|
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_igate");
|
||||||
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_tgate");
|
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_tgate");
|
||||||
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_bgate");
|
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_bgate");
|
||||||
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_agate");
|
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_agate");
|
||||||
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_rgate");
|
ModuleRegistrar.instance().registerDecorator(new HUDDecoratorRsGateLogic(), "pr_rgate");
|
||||||
|
|
||||||
//ModuleRegistrar.instance().registerBlockDecorator(new HUDDecoratorRsGateLogic(), BlockMultipart);
|
// ModuleRegistrar.instance().registerBlockDecorator(new HUDDecoratorRsGateLogic(), BlockMultipart);
|
||||||
//ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerRsGateLogic(), BlockMultipart);
|
// ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerRsGateLogic(), BlockMultipart);
|
||||||
//ModuleRegistrar.instance().registerSyncedNBTKey("*", BlockMultipart);
|
// ModuleRegistrar.instance().registerSyncedNBTKey("*", BlockMultipart);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,6 @@ package mcp.mobius.waila.addons.railcraft;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
@@ -10,75 +9,80 @@ import net.minecraft.tileentity.TileEntity;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
import net.minecraftforge.fluids.IFluidTank;
|
import net.minecraftforge.fluids.IFluidTank;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
import mcp.mobius.waila.cbcore.LangUtil;
|
||||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||||
|
|
||||||
public class HUDHandlerTank implements IWailaDataProvider {
|
public class HUDHandlerTank implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
if (!config.getConfig("railcraft.fluidamount")) return currenttip;
|
IWailaConfigHandler config) {
|
||||||
try {
|
if (!config.getConfig("railcraft.fluidamount")) return currenttip;
|
||||||
IFluidTank tank = (IFluidTank)RailcraftModule.ITankTile_getTank.invoke(RailcraftModule.ITankTile.cast(accessor.getTileEntity()));
|
try {
|
||||||
if (tank == null) return currenttip;
|
IFluidTank tank = (IFluidTank) RailcraftModule.ITankTile_getTank
|
||||||
|
.invoke(RailcraftModule.ITankTile.cast(accessor.getTileEntity()));
|
||||||
|
if (tank == null) return currenttip;
|
||||||
|
|
||||||
FluidStack fluid = tank.getFluid();
|
FluidStack fluid = tank.getFluid();
|
||||||
|
|
||||||
String name = currenttip.get(0);
|
String name = currenttip.get(0);
|
||||||
|
|
||||||
try{
|
try {
|
||||||
name += String.format(" < %s >", fluid.getFluid().getLocalizedName(fluid));
|
name += String.format(" < %s >", fluid.getFluid().getLocalizedName(fluid));
|
||||||
} catch (NullPointerException f){
|
} catch (NullPointerException f) {
|
||||||
name += " " + LangUtil.translateG("hud.msg.empty");
|
name += " " + LangUtil.translateG("hud.msg.empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
currenttip.set(0, name);
|
currenttip.set(0, name);
|
||||||
|
|
||||||
} catch (Exception e){
|
} catch (Exception e) {
|
||||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||||
}
|
}
|
||||||
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
if (!config.getConfig("railcraft.fluidamount")) return currenttip;
|
IWailaConfigHandler config) {
|
||||||
|
if (!config.getConfig("railcraft.fluidamount")) return currenttip;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
IFluidTank tank = (IFluidTank)RailcraftModule.ITankTile_getTank.invoke(RailcraftModule.ITankTile.cast(accessor.getTileEntity()));
|
IFluidTank tank = (IFluidTank) RailcraftModule.ITankTile_getTank
|
||||||
if (tank == null) return currenttip;
|
.invoke(RailcraftModule.ITankTile.cast(accessor.getTileEntity()));
|
||||||
|
if (tank == null) return currenttip;
|
||||||
|
|
||||||
FluidStack fluid = tank.getFluid();
|
FluidStack fluid = tank.getFluid();
|
||||||
if (fluid != null)
|
if (fluid != null) currenttip.add(String.format("%d / %d mB", fluid.amount, tank.getInfo().capacity));
|
||||||
currenttip.add(String.format("%d / %d mB", fluid.amount, tank.getInfo().capacity));
|
else currenttip.add(String.format("0 / %d mB", tank.getInfo().capacity));
|
||||||
else
|
|
||||||
currenttip.add(String.format("0 / %d mB", tank.getInfo().capacity));
|
|
||||||
|
|
||||||
} catch (Exception e){
|
} catch (Exception e) {
|
||||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||||
}
|
}
|
||||||
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
if (te != null)
|
int y, int z) {
|
||||||
te.writeToNBT(tag);
|
if (te != null) te.writeToNBT(tag);
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,37 +8,38 @@ import mcp.mobius.waila.Waila;
|
|||||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||||
|
|
||||||
public class RailcraftModule {
|
public class RailcraftModule {
|
||||||
public static Class TileTankBase = null;
|
|
||||||
public static Class ITankTile = null;
|
|
||||||
public static Method ITankTile_getTank = null;
|
|
||||||
//public static Class StandardTank = null;
|
|
||||||
|
|
||||||
public static void register(){
|
public static Class TileTankBase = null;
|
||||||
try{
|
public static Class ITankTile = null;
|
||||||
Class ModRailcraft = Class.forName("mods.railcraft.common.core.Railcraft");
|
public static Method ITankTile_getTank = null;
|
||||||
Waila.log.log(Level.INFO, "Railcraft mod found.");
|
// public static Class StandardTank = null;
|
||||||
} catch (ClassNotFoundException e){
|
|
||||||
Waila.log.log(Level.INFO, "[Railcraft] Railcraft mod not found.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try{
|
public static void register() {
|
||||||
TileTankBase = Class.forName("mods.railcraft.common.blocks.machine.beta.TileTankBase");
|
try {
|
||||||
ITankTile = Class.forName("mods.railcraft.common.blocks.machine.ITankTile");
|
Class ModRailcraft = Class.forName("mods.railcraft.common.core.Railcraft");
|
||||||
ITankTile_getTank = ITankTile.getMethod("getTank");
|
Waila.log.log(Level.INFO, "Railcraft mod found.");
|
||||||
//StandardTank = Class.forName("mods.railcraft.common.fluids.tanks.StandardTank");
|
} catch (ClassNotFoundException e) {
|
||||||
|
Waila.log.log(Level.INFO, "[Railcraft] Railcraft mod not found.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
} catch (ClassNotFoundException e){
|
try {
|
||||||
Waila.log.log(Level.WARN, "[Railcraft] Class not found. " + e);
|
TileTankBase = Class.forName("mods.railcraft.common.blocks.machine.beta.TileTankBase");
|
||||||
return;
|
ITankTile = Class.forName("mods.railcraft.common.blocks.machine.ITankTile");
|
||||||
} catch (NoSuchMethodException e){
|
ITankTile_getTank = ITankTile.getMethod("getTank");
|
||||||
Waila.log.log(Level.WARN, "[Railcraft] Method not found." + e);
|
// StandardTank = Class.forName("mods.railcraft.common.fluids.tanks.StandardTank");
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("Railcraft", "railcraft.fluidamount");
|
} catch (ClassNotFoundException e) {
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTank(), TileTankBase);
|
Waila.log.log(Level.WARN, "[Railcraft] Class not found. " + e);
|
||||||
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerTank(), TileTankBase);
|
return;
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerTank(), TileTankBase);
|
} catch (NoSuchMethodException e) {
|
||||||
}
|
Waila.log.log(Level.WARN, "[Railcraft] Method not found." + e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ModuleRegistrar.instance().addConfigRemote("Railcraft", "railcraft.fluidamount");
|
||||||
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTank(), TileTankBase);
|
||||||
|
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerTank(), TileTankBase);
|
||||||
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerTank(), TileTankBase);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -7,94 +7,62 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
|
||||||
public class HUDTileEntityCamo implements IWailaDataProvider {
|
public class HUDTileEntityCamo implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
/*
|
/*
|
||||||
if (!config.getConfig("secretrooms.hide")) return null;
|
* if (!config.getConfig("secretrooms.hide")) return null; if (
|
||||||
|
* SecretRoomsModule.BlockCamoTrapDoor.isInstance(accessor.getBlock()) ){ return
|
||||||
|
* this.getTrapDoorBlock(accessor); } else if (
|
||||||
|
* SecretRoomsModule.BlockTorchLever.isInstance(accessor.getBlock()) ){ return new ItemStack(Blocks.torch); }
|
||||||
|
* else if (accessor.getNBTData() != null){ NBTTagCompound tag = accessor.getNBTData(); if (tag.hasKey("copyID")
|
||||||
|
* && tag.hasKey("copyMeta")){ int copyID = accessor.getNBTInteger(tag, "copyID"); int copyMeta =
|
||||||
|
* accessor.getNBTInteger(tag, "copyMeta"); return new ItemStack(copyID, 1, copyMeta); } }
|
||||||
|
*/
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if ( SecretRoomsModule.BlockCamoTrapDoor.isInstance(accessor.getBlock()) ){
|
@Override
|
||||||
return this.getTrapDoorBlock(accessor);
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
else if ( SecretRoomsModule.BlockTorchLever.isInstance(accessor.getBlock()) ){
|
@Override
|
||||||
return new ItemStack(Blocks.torch);
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
}
|
IWailaConfigHandler config) {
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
else if (accessor.getNBTData() != null){
|
private ItemStack getTrapDoorBlock(IWailaDataAccessor accessor) {
|
||||||
NBTTagCompound tag = accessor.getNBTData();
|
// modify coordinates to get hinge Block.
|
||||||
|
/*
|
||||||
|
* int i = accessor.getMetadata(); int j = accessor.getPosition().blockX; int k = accessor.getPosition().blockZ;
|
||||||
|
* if ((i & 3) == 0) { k++; } if ((i & 3) == 1) { k--; } if ((i & 3) == 2) { j++; } if ((i & 3) == 3) { j--; }
|
||||||
|
* int blockID = accessor.getWorld().getBlockId(j, accessor.getPosition().blockY, k); int blockMeta =
|
||||||
|
* accessor.getWorld().getBlockMetadata(j, accessor.getPosition().blockY, k); return new ItemStack(blockID, 1,
|
||||||
|
* blockMeta);
|
||||||
|
*/
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (tag.hasKey("copyID") && tag.hasKey("copyMeta")){
|
@Override
|
||||||
int copyID = accessor.getNBTInteger(tag, "copyID");
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
int copyMeta = accessor.getNBTInteger(tag, "copyMeta");
|
int y, int z) {
|
||||||
return new ItemStack(copyID, 1, copyMeta);
|
if (te != null) te.writeToNBT(tag);
|
||||||
}
|
return tag;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
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) {
|
|
||||||
return currenttip;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
|
||||||
return currenttip;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ItemStack getTrapDoorBlock(IWailaDataAccessor accessor){
|
|
||||||
// modify coordinates to get hinge Block.
|
|
||||||
/*
|
|
||||||
int i = accessor.getMetadata();
|
|
||||||
int j = accessor.getPosition().blockX;
|
|
||||||
int k = accessor.getPosition().blockZ;
|
|
||||||
|
|
||||||
if ((i & 3) == 0)
|
|
||||||
{
|
|
||||||
k++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((i & 3) == 1)
|
|
||||||
{
|
|
||||||
k--;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((i & 3) == 2)
|
|
||||||
{
|
|
||||||
j++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((i & 3) == 3)
|
|
||||||
{
|
|
||||||
j--;
|
|
||||||
}
|
|
||||||
|
|
||||||
int blockID = accessor.getWorld().getBlockId(j, accessor.getPosition().blockY, k);
|
|
||||||
int blockMeta = accessor.getWorld().getBlockMetadata(j, accessor.getPosition().blockY, k);
|
|
||||||
|
|
||||||
return new ItemStack(blockID, 1, blockMeta);
|
|
||||||
*/
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
|
||||||
if (te != null)
|
|
||||||
te.writeToNBT(tag);
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,40 +2,27 @@ package mcp.mobius.waila.addons.secretrooms;
|
|||||||
|
|
||||||
public class SecretRoomsModule {
|
public class SecretRoomsModule {
|
||||||
|
|
||||||
public static Class TileEntityCamo = null;
|
public static Class TileEntityCamo = null;
|
||||||
public static Class BlockTorchLever = null;
|
public static Class BlockTorchLever = null;
|
||||||
public static Class BlockCamoTrapDoor = null;
|
public static Class BlockCamoTrapDoor = null;
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
/*
|
/*
|
||||||
try{
|
* try{ Class SecretRooms = Class.forName("com.github.AbrarSyed.secretroomsmod.common.SecretRooms");
|
||||||
Class SecretRooms = Class.forName("com.github.AbrarSyed.secretroomsmod.common.SecretRooms");
|
* Waila.log.log(Level.INFO, "SecretRooms mod found."); } catch (ClassNotFoundException e){
|
||||||
Waila.log.log(Level.INFO, "SecretRooms mod found.");
|
* Waila.log.log(Level.INFO, "[SecretRooms] SecretRooms mod not found."); return; } try{ TileEntityCamo =
|
||||||
} catch (ClassNotFoundException e){
|
* Class.forName("com.github.AbrarSyed.secretroomsmod.blocks.TileEntityCamo"); BlockTorchLever =
|
||||||
Waila.log.log(Level.INFO, "[SecretRooms] SecretRooms mod not found.");
|
* Class.forName("com.github.AbrarSyed.secretroomsmod.blocks.BlockTorchLever"); BlockCamoTrapDoor =
|
||||||
return;
|
* Class.forName("com.github.AbrarSyed.secretroomsmod.blocks.BlockCamoTrapDoor"); } catch
|
||||||
}
|
* (ClassNotFoundException e){ Waila.log.log(Level.WARNING, "[SecretRooms] Class not found. " + e); return; }
|
||||||
|
* catch (Exception e) { Waila.log.log(Level.WARNING, "[SecretRooms] Error while loading module. " + e); return;
|
||||||
try{
|
* } ModuleRegistrar.instance().addConfig("SecretRooms", "secretrooms.hide");
|
||||||
TileEntityCamo = Class.forName("com.github.AbrarSyed.secretroomsmod.blocks.TileEntityCamo");
|
* ModuleRegistrar.instance().registerStackProvider(new HUDTileEntityCamo(), TileEntityCamo);
|
||||||
BlockTorchLever = Class.forName("com.github.AbrarSyed.secretroomsmod.blocks.BlockTorchLever");
|
* ModuleRegistrar.instance().registerStackProvider(new HUDTileEntityCamo(), BlockTorchLever);
|
||||||
BlockCamoTrapDoor = Class.forName("com.github.AbrarSyed.secretroomsmod.blocks.BlockCamoTrapDoor");
|
* ModuleRegistrar.instance().registerStackProvider(new HUDTileEntityCamo(), BlockCamoTrapDoor);
|
||||||
|
* ModuleRegistrar.instance().registerSyncedNBTKey("copyID", TileEntityCamo);
|
||||||
} catch (ClassNotFoundException e){
|
* ModuleRegistrar.instance().registerSyncedNBTKey("copyMeta", TileEntityCamo);
|
||||||
Waila.log.log(Level.WARNING, "[SecretRooms] Class not found. " + e);
|
*/
|
||||||
return;
|
}
|
||||||
} catch (Exception e) {
|
|
||||||
Waila.log.log(Level.WARNING, "[SecretRooms] Error while loading module. " + e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfig("SecretRooms", "secretrooms.hide");
|
|
||||||
ModuleRegistrar.instance().registerStackProvider(new HUDTileEntityCamo(), TileEntityCamo);
|
|
||||||
ModuleRegistrar.instance().registerStackProvider(new HUDTileEntityCamo(), BlockTorchLever);
|
|
||||||
ModuleRegistrar.instance().registerStackProvider(new HUDTileEntityCamo(), BlockCamoTrapDoor);
|
|
||||||
ModuleRegistrar.instance().registerSyncedNBTKey("copyID", TileEntityCamo);
|
|
||||||
ModuleRegistrar.instance().registerSyncedNBTKey("copyMeta", TileEntityCamo);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
package mcp.mobius.waila.addons.statues;
|
package mcp.mobius.waila.addons.statues;
|
||||||
|
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.BLUE;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.ITALIC;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.WHITE;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
@@ -7,72 +11,72 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||||
import static mcp.mobius.waila.api.SpecialChars.*;
|
|
||||||
|
|
||||||
public class HUDHandlerStatues implements IWailaDataProvider {
|
public class HUDHandlerStatues implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
try {
|
IWailaConfigHandler config) {
|
||||||
String skinName = (String)StatuesModule.skinName.get(accessor.getTileEntity());
|
try {
|
||||||
if (skinName.equals("")){
|
String skinName = (String) StatuesModule.skinName.get(accessor.getTileEntity());
|
||||||
TileEntity belowEnt = accessor.getWorld().getTileEntity(accessor.getPosition().blockX, accessor.getPosition().blockY - 1, accessor.getPosition().blockZ);
|
if (skinName.equals("")) {
|
||||||
if (StatuesModule.TileEntityStatue.isInstance(belowEnt))
|
TileEntity belowEnt = accessor.getWorld().getTileEntity(
|
||||||
skinName = (String)StatuesModule.skinName.get(belowEnt);
|
accessor.getPosition().blockX,
|
||||||
}
|
accessor.getPosition().blockY - 1,
|
||||||
|
accessor.getPosition().blockZ);
|
||||||
|
if (StatuesModule.TileEntityStatue.isInstance(belowEnt))
|
||||||
|
skinName = (String) StatuesModule.skinName.get(belowEnt);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (skinName.equals("")) {
|
||||||
|
currenttip.clear();
|
||||||
|
currenttip.add(WHITE + "Statue : Unknown");
|
||||||
|
} else {
|
||||||
|
currenttip.clear();
|
||||||
|
currenttip.add(WHITE + "Statue : " + skinName);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||||
|
}
|
||||||
|
|
||||||
if (skinName.equals("")){
|
/*
|
||||||
currenttip.clear();
|
* String skinName = accessor.getNBTData().getString("skin"); if (skinName.equals("")){ if
|
||||||
currenttip.add(WHITE + "Statue : Unknown");
|
* (accessor.getWorld().getBlockTileEntity(accessor.getPosition().blockX, accessor.getPosition().blockY - 1,
|
||||||
} else {
|
* accessor.getPosition().blockZ) != null){ } }
|
||||||
currenttip.clear();
|
*/
|
||||||
currenttip.add(WHITE + "Statue : " + skinName);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
@Override
|
||||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
}
|
IWailaConfigHandler config) {
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
@Override
|
||||||
String skinName = accessor.getNBTData().getString("skin");
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
if (skinName.equals("")){
|
IWailaConfigHandler config) {
|
||||||
if (accessor.getWorld().getBlockTileEntity(accessor.getPosition().blockX, accessor.getPosition().blockY - 1, accessor.getPosition().blockZ) != null){
|
currenttip.add(BLUE + ITALIC + "Statues");
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
@Override
|
||||||
}
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
*/
|
int y, int z) {
|
||||||
|
if (te != null) te.writeToNBT(tag);
|
||||||
return currenttip;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
@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) {
|
|
||||||
currenttip.add(BLUE + ITALIC + "Statues" );
|
|
||||||
return currenttip;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
|
||||||
if (te != null)
|
|
||||||
te.writeToNBT(tag);
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -9,32 +9,32 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class StatuesModule {
|
public class StatuesModule {
|
||||||
|
|
||||||
public static Class TileEntityStatue = null;
|
public static Class TileEntityStatue = null;
|
||||||
public static Field skinName = null;
|
public static Field skinName = null;
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
try{
|
try {
|
||||||
Class Statues = Class.forName("info.jbcs.minecraft.statues.Statues");
|
Class Statues = Class.forName("info.jbcs.minecraft.statues.Statues");
|
||||||
Waila.log.log(Level.INFO, "Statues mod found.");
|
Waila.log.log(Level.INFO, "Statues mod found.");
|
||||||
} catch (ClassNotFoundException e){
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[Statues] Statues mod not found.");
|
Waila.log.log(Level.INFO, "[Statues] Statues mod not found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try {
|
||||||
TileEntityStatue = Class.forName("info.jbcs.minecraft.statues.TileEntityStatue");
|
TileEntityStatue = Class.forName("info.jbcs.minecraft.statues.TileEntityStatue");
|
||||||
skinName = TileEntityStatue.getDeclaredField("skinName");
|
skinName = TileEntityStatue.getDeclaredField("skinName");
|
||||||
} catch (ClassNotFoundException e){
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.WARN, "[Statues] Class not found. " + e);
|
Waila.log.log(Level.WARN, "[Statues] Class not found. " + e);
|
||||||
return;
|
return;
|
||||||
} catch (NoSuchFieldException e){
|
} catch (NoSuchFieldException e) {
|
||||||
Waila.log.log(Level.WARN, "[Statues] Class not found. " + e);
|
Waila.log.log(Level.WARN, "[Statues] Class not found. " + e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerStatues(), TileEntityStatue);
|
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerStatues(), TileEntityStatue);
|
||||||
ModuleRegistrar.instance().registerTailProvider(new HUDHandlerStatues(), TileEntityStatue);
|
ModuleRegistrar.instance().registerTailProvider(new HUDHandlerStatues(), TileEntityStatue);
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerStatues(), TileEntityStatue);
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerStatues(), TileEntityStatue);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,11 @@
|
|||||||
package mcp.mobius.waila.addons.stevescarts;
|
package mcp.mobius.waila.addons.stevescarts;
|
||||||
|
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.ALIGNRIGHT;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.GRAY;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.ITALIC;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.TAB;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.WHITE;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -8,97 +14,105 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||||
import static mcp.mobius.waila.api.SpecialChars.*;
|
|
||||||
|
|
||||||
public class HUDCargoManager implements IWailaDataProvider {
|
public class HUDCargoManager implements IWailaDataProvider {
|
||||||
|
|
||||||
private static String colors[] = {"NA", "Red", "Blue", "Yellow", "Green", "Dis."};
|
private static String colors[] = { "NA", "Red", "Blue", "Yellow", "Green", "Dis." };
|
||||||
private static String sides[] = {"Yellow", "Blue", "Green", "Red"};
|
private static String sides[] = { "Yellow", "Blue", "Green", "Red" };
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
if (!config.getConfig("stevescarts.showall")) return currenttip;
|
IWailaConfigHandler config) {
|
||||||
if (config.getConfig("stevescarts.shifttoggle") && !accessor.getPlayer().isSneaking()){
|
if (!config.getConfig("stevescarts.showall")) return currenttip;
|
||||||
currenttip.add(ITALIC + "Press shift for more data");
|
if (config.getConfig("stevescarts.shifttoggle") && !accessor.getPlayer().isSneaking()) {
|
||||||
return currenttip;
|
currenttip.add(ITALIC + "Press shift for more data");
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
NBTTagCompound tag = accessor.getNBTData();
|
NBTTagCompound tag = accessor.getNBTData();
|
||||||
|
|
||||||
if (config.getConfig("stevescarts.colorblind")){
|
if (config.getConfig("stevescarts.colorblind")) {
|
||||||
int side = accessor.getSide().ordinal() - 2;
|
int side = accessor.getSide().ordinal() - 2;
|
||||||
if (side >= 0)
|
if (side >= 0) currenttip.add("Looking at side " + WHITE + sides[side]);
|
||||||
currenttip.add("Looking at side " + WHITE + sides[side]);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
int layout = accessor.getNBTInteger(tag, "layout");
|
int layout = accessor.getNBTInteger(tag, "layout");
|
||||||
switch(layout){
|
switch (layout) {
|
||||||
case 0:
|
case 0:
|
||||||
currenttip.add("Slots : "+ WHITE + "Shared");
|
currenttip.add("Slots : " + WHITE + "Shared");
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
currenttip.add("Slots : "+ WHITE + "By side");
|
currenttip.add("Slots : " + WHITE + "By side");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
currenttip.add("Slots : "+ WHITE + "By color");
|
currenttip.add("Slots : " + WHITE + "By color");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try {
|
||||||
ArrayList<Object> itemSelection = (ArrayList<Object>) StevesCartsModule.ItemSelections.get(accessor.getTileEntity());
|
ArrayList<Object> itemSelection = (ArrayList<Object>) StevesCartsModule.ItemSelections
|
||||||
|
.get(accessor.getTileEntity());
|
||||||
|
|
||||||
int toCart = accessor.getNBTInteger(tag, "tocart");
|
int toCart = accessor.getNBTInteger(tag, "tocart");
|
||||||
int doReturn = accessor.getNBTInteger(tag, "doReturn");
|
int doReturn = accessor.getNBTInteger(tag, "doReturn");
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++){
|
for (int i = 0; i < 4; i++) {
|
||||||
int target = accessor.getNBTInteger(tag, "target" + String.valueOf(i));
|
int target = accessor.getNBTInteger(tag, "target" + String.valueOf(i));
|
||||||
int color = accessor.getNBTInteger(tag, "color" + String.valueOf(i));
|
int color = accessor.getNBTInteger(tag, "color" + String.valueOf(i));
|
||||||
int amount = accessor.getNBTInteger(tag, "amount" + String.valueOf(i));
|
int amount = accessor.getNBTInteger(tag, "amount" + String.valueOf(i));
|
||||||
if (color == 5) continue;
|
if (color == 5) continue;
|
||||||
|
|
||||||
|
String direction = (toCart & (1 << i)) != 0 ? "Load" : "Unload";
|
||||||
|
String shouldReturn = (doReturn & (1 << i)) != 0 ? "Ret." : "Cont.";
|
||||||
|
String sAmount = amount == 0 ? "All"
|
||||||
|
: String.valueOf(this.getAmount(amount) + " " + this.getAmountType(amount));
|
||||||
|
|
||||||
String direction = (toCart & (1 << i)) != 0 ? "Load" : "Unload";
|
String selection = (String) StevesCartsModule.GetSelectionName
|
||||||
String shouldReturn = (doReturn & (1 << i)) != 0 ? "Ret." : "Cont.";
|
.invoke(StevesCartsModule.CargoItemSelection.cast(itemSelection.get(target)));
|
||||||
String sAmount = amount == 0 ? "All" : String.valueOf(this.getAmount(amount) + " " + this.getAmountType(amount));
|
currenttip.add(
|
||||||
|
String.format(
|
||||||
|
"Side %s %s[ %s ]%s[ %s , %s]%s[ %s ]",
|
||||||
|
WHITE + colors[color] + GRAY,
|
||||||
|
TAB + ALIGNRIGHT,
|
||||||
|
WHITE + selection + GRAY,
|
||||||
|
TAB + ALIGNRIGHT,
|
||||||
|
WHITE + direction + GRAY,
|
||||||
|
TAB + ALIGNRIGHT + WHITE + shouldReturn + GRAY,
|
||||||
|
TAB + ALIGNRIGHT,
|
||||||
|
WHITE + sAmount + GRAY));
|
||||||
|
}
|
||||||
|
|
||||||
String selection = (String) StevesCartsModule.GetSelectionName.invoke(StevesCartsModule.CargoItemSelection.cast(itemSelection.get(target)));
|
} catch (Exception e) {
|
||||||
currenttip.add(String.format("Side %s %s[ %s ]%s[ %s , %s]%s[ %s ]", WHITE + colors[color] + GRAY,
|
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||||
TAB + ALIGNRIGHT, WHITE + selection + GRAY,
|
}
|
||||||
TAB + ALIGNRIGHT, WHITE + direction + GRAY,
|
|
||||||
TAB + ALIGNRIGHT + WHITE + shouldReturn + GRAY,
|
|
||||||
TAB + ALIGNRIGHT, WHITE + sAmount + GRAY));
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
return currenttip;
|
||||||
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;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
public int getAmount(int id) {
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
switch (id) {
|
||||||
return currenttip;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getAmount(int id)
|
|
||||||
{
|
|
||||||
switch (id)
|
|
||||||
{
|
|
||||||
case 1:
|
case 1:
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
@@ -134,26 +148,22 @@ public class HUDCargoManager implements IWailaDataProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//0 - MAX
|
// 0 - MAX
|
||||||
//1 - Items
|
// 1 - Items
|
||||||
//2 - Stacks
|
// 2 - Stacks
|
||||||
public String getAmountType(int id)
|
public String getAmountType(int id) {
|
||||||
{
|
if (id <= 6) {
|
||||||
if (id <= 6)
|
|
||||||
{
|
|
||||||
return "I";
|
return "I";
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
return "S";
|
return "S";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
if (te != null)
|
int y, int z) {
|
||||||
te.writeToNBT(tag);
|
if (te != null) te.writeToNBT(tag);
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -7,80 +7,59 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
|
||||||
public class HUDCartAssembler implements IWailaDataProvider {
|
public class HUDCartAssembler implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
/*
|
IWailaConfigHandler config) {
|
||||||
if (!config.getConfig("stevescarts.showall")) return currenttip;
|
/*
|
||||||
if (config.getConfig("stevescarts.shifttoggle") && !accessor.getPlayer().isSneaking()){
|
* if (!config.getConfig("stevescarts.showall")) return currenttip; if
|
||||||
currenttip.add(ITALIC + "Press shift for more data");
|
* (config.getConfig("stevescarts.shifttoggle") && !accessor.getPlayer().isSneaking()){ currenttip.add(ITALIC +
|
||||||
return currenttip;
|
* "Press shift for more data"); return currenttip; } int currTime =
|
||||||
}
|
* accessor.getNBTInteger(accessor.getNBTData(), "currentTime"); int maxTime =
|
||||||
|
* accessor.getNBTInteger(accessor.getNBTData(), "maxTime"); int isAssembling =
|
||||||
|
* accessor.getNBTInteger(accessor.getNBTData(), "isAssembling"); NBTTagList slots =
|
||||||
|
* accessor.getNBTData().getTagList("Items"); boolean hasOutput = false; Item ItemCartModule = null; try {
|
||||||
|
* ItemCartModule = (Item)StevesCartsModule.ItemCartModule.get(null); } catch (Exception e) { currenttip =
|
||||||
|
* WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip); return
|
||||||
|
* currenttip; } for (int i = 0; i < slots.tagCount(); i++){ NBTTagCompound subtag =
|
||||||
|
* (NBTTagCompound)(slots.tagAt(i)); byte slot = subtag.getByte("Slot"); if (slot == 30) hasOutput = true; } if
|
||||||
|
* (isAssembling == 1){ currenttip.add(String.format("Time remaining : %.1f sec", (maxTime - currTime) /
|
||||||
|
* 20.0f)); NBTTagCompound output = accessor.getNBTData().getCompoundTag("Output"); short outID =
|
||||||
|
* output.getShort("id"); byte[] metas = output.getCompoundTag("tag").getByteArray("Modules"); for (byte b :
|
||||||
|
* metas){ currenttip.add(new ItemStack(ItemCartModule, 1, b).getDisplayName()); } } else if (hasOutput)
|
||||||
|
* currenttip.add(String.format("Time remaining : <Done>")); else
|
||||||
|
* currenttip.add(String.format("Time remaining : <Idle>"));
|
||||||
|
*/
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
int currTime = accessor.getNBTInteger(accessor.getNBTData(), "currentTime");
|
@Override
|
||||||
int maxTime = accessor.getNBTInteger(accessor.getNBTData(), "maxTime");
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
int isAssembling = accessor.getNBTInteger(accessor.getNBTData(), "isAssembling");
|
IWailaConfigHandler config) {
|
||||||
NBTTagList slots = accessor.getNBTData().getTagList("Items");
|
return currenttip;
|
||||||
boolean hasOutput = false;
|
}
|
||||||
Item ItemCartModule = null;
|
|
||||||
try {
|
|
||||||
ItemCartModule = (Item)StevesCartsModule.ItemCartModule.get(null);
|
|
||||||
} catch (Exception e) {
|
|
||||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
|
||||||
return currenttip;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < slots.tagCount(); i++){
|
@Override
|
||||||
NBTTagCompound subtag = (NBTTagCompound)(slots.tagAt(i));
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
byte slot = subtag.getByte("Slot");
|
int y, int z) {
|
||||||
if (slot == 30)
|
if (te != null) te.writeToNBT(tag);
|
||||||
hasOutput = true;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAssembling == 1){
|
|
||||||
currenttip.add(String.format("Time remaining : %.1f sec", (maxTime - currTime) / 20.0f));
|
|
||||||
|
|
||||||
NBTTagCompound output = accessor.getNBTData().getCompoundTag("Output");
|
|
||||||
short outID = output.getShort("id");
|
|
||||||
byte[] metas = output.getCompoundTag("tag").getByteArray("Modules");
|
|
||||||
|
|
||||||
for (byte b : metas){
|
|
||||||
currenttip.add(new ItemStack(ItemCartModule, 1, b).getDisplayName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (hasOutput)
|
|
||||||
currenttip.add(String.format("Time remaining : <Done>"));
|
|
||||||
else
|
|
||||||
currenttip.add(String.format("Time remaining : <Idle>"));
|
|
||||||
*/
|
|
||||||
return currenttip;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
|
||||||
return currenttip;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
|
||||||
if (te != null)
|
|
||||||
te.writeToNBT(tag);
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,11 @@
|
|||||||
package mcp.mobius.waila.addons.stevescarts;
|
package mcp.mobius.waila.addons.stevescarts;
|
||||||
|
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.ALIGNRIGHT;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.GRAY;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.ITALIC;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.TAB;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.WHITE;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
@@ -7,129 +13,135 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
import static mcp.mobius.waila.api.SpecialChars.*;
|
|
||||||
|
|
||||||
|
|
||||||
public class HUDLiquidManager implements IWailaDataProvider {
|
public class HUDLiquidManager implements IWailaDataProvider {
|
||||||
|
|
||||||
private static String colors[] = {"NA", "Red", "Blue", "Yellow", "Green", "Dis."};
|
private static String colors[] = { "NA", "Red", "Blue", "Yellow", "Green", "Dis." };
|
||||||
private static String sides[] = {"Yellow", "Blue", "Green", "Red"};
|
private static String sides[] = { "Yellow", "Blue", "Green", "Red" };
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
if (!config.getConfig("stevescarts.showall")) return currenttip;
|
IWailaConfigHandler config) {
|
||||||
if (config.getConfig("stevescarts.shifttoggle") && !accessor.getPlayer().isSneaking()){
|
if (!config.getConfig("stevescarts.showall")) return currenttip;
|
||||||
currenttip.add(ITALIC + "Press shift for more data");
|
if (config.getConfig("stevescarts.shifttoggle") && !accessor.getPlayer().isSneaking()) {
|
||||||
return currenttip;
|
currenttip.add(ITALIC + "Press shift for more data");
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
NBTTagCompound tag = accessor.getNBTData();
|
NBTTagCompound tag = accessor.getNBTData();
|
||||||
|
|
||||||
if (config.getConfig("stevescarts.colorblind")){
|
if (config.getConfig("stevescarts.colorblind")) {
|
||||||
int side = accessor.getSide().ordinal() - 2;
|
int side = accessor.getSide().ordinal() - 2;
|
||||||
if (side >= 0)
|
if (side >= 0) currenttip.add("Looking at side " + WHITE + sides[side]);
|
||||||
currenttip.add("Looking at side " + WHITE + sides[side]);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
int layout = accessor.getNBTInteger(tag, "layout");
|
int layout = accessor.getNBTInteger(tag, "layout");
|
||||||
switch(layout){
|
switch (layout) {
|
||||||
case 0:
|
case 0:
|
||||||
currenttip.add("Tanks : "+ WHITE + "Shared");
|
currenttip.add("Tanks : " + WHITE + "Shared");
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
currenttip.add("Tanks : "+ WHITE + "By side");
|
currenttip.add("Tanks : " + WHITE + "By side");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
currenttip.add("Tanks : "+ WHITE + "By color");
|
currenttip.add("Tanks : " + WHITE + "By color");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
int toCart = accessor.getNBTInteger(tag, "tocart");
|
int toCart = accessor.getNBTInteger(tag, "tocart");
|
||||||
int doReturn = accessor.getNBTInteger(tag, "doReturn");
|
int doReturn = accessor.getNBTInteger(tag, "doReturn");
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++){
|
for (int i = 0; i < 4; i++) {
|
||||||
int target = accessor.getNBTInteger(tag, "target" + String.valueOf(i));
|
int target = accessor.getNBTInteger(tag, "target" + String.valueOf(i));
|
||||||
int color = accessor.getNBTInteger(tag, "color" + String.valueOf(i));
|
int color = accessor.getNBTInteger(tag, "color" + String.valueOf(i));
|
||||||
int amount = accessor.getNBTInteger(tag, "amount" + String.valueOf(i));
|
int amount = accessor.getNBTInteger(tag, "amount" + String.valueOf(i));
|
||||||
|
|
||||||
String fluidName = "<Empty>";
|
String fluidName = "<Empty>";
|
||||||
int fluidAmount = 0;
|
int fluidAmount = 0;
|
||||||
if (tag.hasKey("Fluid" + i)){
|
if (tag.hasKey("Fluid" + i)) {
|
||||||
fluidName = tag.getCompoundTag("Fluid" + i).getString("FluidName");
|
fluidName = tag.getCompoundTag("Fluid" + i).getString("FluidName");
|
||||||
fluidAmount = tag.getCompoundTag("Fluid" + i).getInteger("Amount");
|
fluidAmount = tag.getCompoundTag("Fluid" + i).getInteger("Amount");
|
||||||
}
|
}
|
||||||
|
|
||||||
String fluidString = fluidAmount == 0 ? "<Empty>" : String.format("%s mB of %s", fluidAmount, fluidName);
|
String fluidString = fluidAmount == 0 ? "<Empty>" : String.format("%s mB of %s", fluidAmount, fluidName);
|
||||||
|
|
||||||
if (color == 5) continue;
|
if (color == 5) continue;
|
||||||
|
|
||||||
|
String direction = (toCart & (1 << i)) != 0 ? "Load" : "Unload";
|
||||||
|
String shouldReturn = (doReturn & (1 << i)) != 0 ? "Ret." : "Cont.";
|
||||||
|
String sAmount = amount == 0 ? "All" : String.valueOf(this.getMaxAmountBuckets(amount)) + " mB";
|
||||||
|
|
||||||
String direction = (toCart & (1 << i)) != 0 ? "Load" : "Unload";
|
// String selection = (String)
|
||||||
String shouldReturn = (doReturn & (1 << i)) != 0 ? "Ret." : "Cont.";
|
// StevesCartsModule.GetSelectionName.invoke(StevesCartsModule.CargoItemSelection.cast(itemSelection.get(target)));
|
||||||
String sAmount = amount == 0 ? "All" : String.valueOf(this.getMaxAmountBuckets(amount)) + " mB";
|
currenttip.add(
|
||||||
|
String.format(
|
||||||
|
"Side %s %s[ %s ]%s[ %s , %s]%s[ %s ]",
|
||||||
|
WHITE + colors[color] + GRAY,
|
||||||
|
TAB + ALIGNRIGHT,
|
||||||
|
WHITE + fluidString + GRAY,
|
||||||
|
TAB + ALIGNRIGHT,
|
||||||
|
WHITE + direction + GRAY,
|
||||||
|
TAB + ALIGNRIGHT + WHITE + shouldReturn + GRAY,
|
||||||
|
TAB + ALIGNRIGHT,
|
||||||
|
WHITE + sAmount + GRAY));
|
||||||
|
|
||||||
//String selection = (String) StevesCartsModule.GetSelectionName.invoke(StevesCartsModule.CargoItemSelection.cast(itemSelection.get(target)));
|
}
|
||||||
currenttip.add(String.format("Side %s %s[ %s ]%s[ %s , %s]%s[ %s ]", WHITE + colors[color] + GRAY,
|
|
||||||
TAB + ALIGNRIGHT, WHITE + fluidString + GRAY,
|
|
||||||
TAB + ALIGNRIGHT, WHITE + direction + GRAY,
|
|
||||||
TAB + ALIGNRIGHT + WHITE + shouldReturn + GRAY,
|
|
||||||
TAB + ALIGNRIGHT, WHITE + sAmount + GRAY));
|
|
||||||
|
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
@Override
|
||||||
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
|
IWailaConfigHandler config) {
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
return currenttip;
|
public int getMaxAmountBuckets(int id) {
|
||||||
}
|
switch (id) {
|
||||||
|
case 1:
|
||||||
|
return 250;
|
||||||
|
case 2:
|
||||||
|
return 500;
|
||||||
|
case 3:
|
||||||
|
return 750;
|
||||||
|
case 4:
|
||||||
|
return 1000;
|
||||||
|
case 5:
|
||||||
|
return 2000;
|
||||||
|
case 6:
|
||||||
|
return 3000;
|
||||||
|
case 7:
|
||||||
|
return 5000;
|
||||||
|
case 8:
|
||||||
|
return 7500;
|
||||||
|
case 9:
|
||||||
|
return 10000;
|
||||||
|
case 10:
|
||||||
|
return 15000;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
return currenttip;
|
int y, int z) {
|
||||||
}
|
if (te != null) te.writeToNBT(tag);
|
||||||
|
return tag;
|
||||||
public int getMaxAmountBuckets(int id) {
|
}
|
||||||
switch(id) {
|
|
||||||
case 1:
|
|
||||||
return 250;
|
|
||||||
case 2:
|
|
||||||
return 500;
|
|
||||||
case 3:
|
|
||||||
return 750;
|
|
||||||
case 4:
|
|
||||||
return 1000;
|
|
||||||
case 5:
|
|
||||||
return 2000;
|
|
||||||
case 6:
|
|
||||||
return 3000;
|
|
||||||
case 7:
|
|
||||||
return 5000;
|
|
||||||
case 8:
|
|
||||||
return 7500;
|
|
||||||
case 9:
|
|
||||||
return 10000;
|
|
||||||
case 10:
|
|
||||||
return 15000;
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
|
||||||
if (te != null)
|
|
||||||
te.writeToNBT(tag);
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,11 @@
|
|||||||
package mcp.mobius.waila.addons.stevescarts;
|
package mcp.mobius.waila.addons.stevescarts;
|
||||||
|
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.ALIGNRIGHT;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.GRAY;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.ITALIC;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.TAB;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.WHITE;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
@@ -8,86 +14,103 @@ import net.minecraft.item.Item;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaEntityAccessor;
|
import mcp.mobius.waila.api.IWailaEntityAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaEntityProvider;
|
import mcp.mobius.waila.api.IWailaEntityProvider;
|
||||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||||
import static mcp.mobius.waila.api.SpecialChars.*;
|
|
||||||
|
|
||||||
public class HUDMinecartModular implements IWailaEntityProvider {
|
public class HUDMinecartModular implements IWailaEntityProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Entity getWailaOverride(IWailaEntityAccessor accessor, IWailaConfigHandler config) {
|
public Entity getWailaOverride(IWailaEntityAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor,
|
||||||
if (currenttip.get(0).contains("entity.StevesCarts.Minecart")){
|
IWailaConfigHandler config) {
|
||||||
currenttip.remove(0);
|
if (currenttip.get(0).contains("entity.StevesCarts.Minecart")) {
|
||||||
currenttip.add(WHITE + "Modular Minecart");
|
currenttip.remove(0);
|
||||||
}
|
currenttip.add(WHITE + "Modular Minecart");
|
||||||
|
}
|
||||||
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor,
|
||||||
if (!config.getConfig("stevescarts.showall")) return currenttip;
|
IWailaConfigHandler config) {
|
||||||
if (config.getConfig("stevescarts.shifttoggle") && !accessor.getPlayer().isSneaking()){
|
if (!config.getConfig("stevescarts.showall")) return currenttip;
|
||||||
currenttip.add(ITALIC + "Press shift for more data");
|
if (config.getConfig("stevescarts.shifttoggle") && !accessor.getPlayer().isSneaking()) {
|
||||||
return currenttip;
|
currenttip.add(ITALIC + "Press shift for more data");
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
Item ItemCartModule = null;
|
Item ItemCartModule = null;
|
||||||
try {
|
try {
|
||||||
ItemCartModule = (Item)StevesCartsModule.ItemCartModule.get(null);
|
ItemCartModule = (Item) StevesCartsModule.ItemCartModule.get(null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getEntity().getClass().getName(), currenttip);
|
currenttip = WailaExceptionHandler.handleErr(e, accessor.getEntity().getClass().getName(), currenttip);
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
NBTTagCompound tag = accessor.getNBTData();
|
NBTTagCompound tag = accessor.getNBTData();
|
||||||
if (tag.hasKey("Modules")){
|
if (tag.hasKey("Modules")) {
|
||||||
byte[] metas = tag.getByteArray("Modules");
|
byte[] metas = tag.getByteArray("Modules");
|
||||||
|
|
||||||
for (int i = 0; i < metas.length; i++){
|
for (int i = 0; i < metas.length; i++) {
|
||||||
if (tag.hasKey("module" + String.valueOf(i) + "Fuel")){
|
if (tag.hasKey("module" + String.valueOf(i) + "Fuel")) {
|
||||||
|
|
||||||
int fuel = accessor.getNBTInteger(tag, "module" + String.valueOf(i) + "Fuel");
|
int fuel = accessor.getNBTInteger(tag, "module" + String.valueOf(i) + "Fuel");
|
||||||
currenttip.add(new ItemStack(ItemCartModule, 1, metas[i]).getDisplayName() + TAB + ALIGNRIGHT + " [ " + WHITE + fuel + GRAY + " POW ]");
|
currenttip.add(
|
||||||
|
new ItemStack(ItemCartModule, 1, metas[i])
|
||||||
|
.getDisplayName() + TAB + ALIGNRIGHT + " [ " + WHITE + fuel + GRAY + " POW ]");
|
||||||
|
|
||||||
} else if (tag.hasKey("module" + String.valueOf(i) + "Fluid")){
|
} else if (tag.hasKey("module" + String.valueOf(i) + "Fluid")) {
|
||||||
|
|
||||||
NBTTagCompound subtag = tag.getCompoundTag("module" + String.valueOf(i) + "Fluid");
|
NBTTagCompound subtag = tag.getCompoundTag("module" + String.valueOf(i) + "Fluid");
|
||||||
if (subtag.hasKey("Amount")){
|
if (subtag.hasKey("Amount")) {
|
||||||
int amount = accessor.getNBTInteger(subtag, "Amount");
|
int amount = accessor.getNBTInteger(subtag, "Amount");
|
||||||
String fluid = subtag.getString("FluidName");
|
String fluid = subtag.getString("FluidName");
|
||||||
currenttip.add(new ItemStack(ItemCartModule, 1, metas[i]).getDisplayName() + TAB + ALIGNRIGHT + " [ " + WHITE + String.valueOf(amount) + GRAY + " mB of " + WHITE + fluid + GRAY + " ]");
|
currenttip.add(
|
||||||
} else {
|
new ItemStack(ItemCartModule, 1, metas[i]).getDisplayName() + TAB
|
||||||
currenttip.add(new ItemStack(ItemCartModule, 1, metas[i]).getDisplayName() + TAB + ALIGNRIGHT + " < " + WHITE + "Empty" + GRAY + " > ");
|
+ ALIGNRIGHT
|
||||||
}
|
+ " [ "
|
||||||
|
+ WHITE
|
||||||
|
+ String.valueOf(amount)
|
||||||
|
+ GRAY
|
||||||
|
+ " mB of "
|
||||||
|
+ WHITE
|
||||||
|
+ fluid
|
||||||
|
+ GRAY
|
||||||
|
+ " ]");
|
||||||
|
} else {
|
||||||
|
currenttip.add(
|
||||||
|
new ItemStack(ItemCartModule, 1, metas[i])
|
||||||
|
.getDisplayName() + TAB + ALIGNRIGHT + " < " + WHITE + "Empty" + GRAY + " > ");
|
||||||
|
}
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
|
|
||||||
currenttip.add(new ItemStack(ItemCartModule, 1, metas[i]).getDisplayName());
|
currenttip.add(new ItemStack(ItemCartModule, 1, metas[i]).getDisplayName());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaTail(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, Entity te, NBTTagCompound tag, World world) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, Entity te, NBTTagCompound tag, World world) {
|
||||||
if (te != null)
|
if (te != null) te.writeToNBT(tag);
|
||||||
te.writeToNBT(tag);
|
return tag;
|
||||||
return tag;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -5,72 +5,50 @@ import java.lang.reflect.Method;
|
|||||||
|
|
||||||
public class StevesCartsModule {
|
public class StevesCartsModule {
|
||||||
|
|
||||||
public static Class TileEntityCartAssembler = null;
|
public static Class TileEntityCartAssembler = null;
|
||||||
public static Class TileEntityCargo = null;
|
public static Class TileEntityCargo = null;
|
||||||
public static Class TileEntityLiquid = null;
|
public static Class TileEntityLiquid = null;
|
||||||
public static Class MinecartModular = null;
|
public static Class MinecartModular = null;
|
||||||
public static Class StevesItems = null;
|
public static Class StevesItems = null;
|
||||||
public static Class CargoItemSelection = null;
|
public static Class CargoItemSelection = null;
|
||||||
|
|
||||||
public static Field ItemCartComponent = null; //Items.component
|
public static Field ItemCartComponent = null; // Items.component
|
||||||
public static Field ItemCartModule = null; //Items.modules
|
public static Field ItemCartModule = null; // Items.modules
|
||||||
public static Field ItemSelections = null; //TileEntityCargo.itemSelections
|
public static Field ItemSelections = null; // TileEntityCargo.itemSelections
|
||||||
|
|
||||||
public static Method GetSelectionName = null; // CargoItemSelection.getName
|
public static Method GetSelectionName = null; // CargoItemSelection.getName
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
/*
|
/*
|
||||||
try{
|
* try{ Class ModStevesCarts = Class.forName("vswe.stevescarts.StevesCarts"); Waila.log.log(Level.INFO,
|
||||||
Class ModStevesCarts = Class.forName("vswe.stevescarts.StevesCarts");
|
* "StevesCarts mod found."); } catch (ClassNotFoundException e){ Waila.log.log(Level.INFO,
|
||||||
Waila.log.log(Level.INFO, "StevesCarts mod found.");
|
* "[StevesCarts] StevesCarts mod not found."); return; } try{ TileEntityCartAssembler =
|
||||||
} catch (ClassNotFoundException e){
|
* Class.forName("vswe.stevescarts.TileEntities.TileEntityCartAssembler"); TileEntityCargo =
|
||||||
Waila.log.log(Level.INFO, "[StevesCarts] StevesCarts mod not found.");
|
* Class.forName("vswe.stevescarts.TileEntities.TileEntityCargo"); TileEntityLiquid =
|
||||||
return;
|
* Class.forName("vswe.stevescarts.TileEntities.TileEntityLiquid"); MinecartModular =
|
||||||
}
|
* Class.forName("vswe.stevescarts.Carts.MinecartModular"); StevesItems =
|
||||||
|
* Class.forName("vswe.stevescarts.Items.Items"); CargoItemSelection =
|
||||||
try{
|
* Class.forName("vswe.stevescarts.Helpers.CargoItemSelection"); ItemCartComponent =
|
||||||
TileEntityCartAssembler = Class.forName("vswe.stevescarts.TileEntities.TileEntityCartAssembler");
|
* StevesItems.getDeclaredField("component"); ItemCartModule = StevesItems.getDeclaredField("modules");
|
||||||
TileEntityCargo = Class.forName("vswe.stevescarts.TileEntities.TileEntityCargo");
|
* ItemSelections = TileEntityCargo.getDeclaredField("itemSelections"); GetSelectionName =
|
||||||
TileEntityLiquid = Class.forName("vswe.stevescarts.TileEntities.TileEntityLiquid");
|
* CargoItemSelection.getDeclaredMethod("getName"); } catch (ClassNotFoundException e){
|
||||||
MinecartModular = Class.forName("vswe.stevescarts.Carts.MinecartModular");
|
* Waila.log.log(Level.WARNING, "[StevesCarts] Class not found. " + e); return; } catch (NoSuchFieldException e)
|
||||||
StevesItems = Class.forName("vswe.stevescarts.Items.Items");
|
* { Waila.log.log(Level.WARNING, "[StevesCarts] Field not found. " + e); return; } catch (NoSuchMethodException
|
||||||
CargoItemSelection = Class.forName("vswe.stevescarts.Helpers.CargoItemSelection");
|
* e) { Waila.log.log(Level.WARNING, "[StevesCarts] Method not found. " + e); return; } catch (Exception e) {
|
||||||
|
* Waila.log.log(Level.WARNING, "[StevesCarts] Error while loading module. " + e); return; }
|
||||||
ItemCartComponent = StevesItems.getDeclaredField("component");
|
* ModuleRegistrar.instance().addConfigRemote("Steve's carts", "stevescarts.showall");
|
||||||
ItemCartModule = StevesItems.getDeclaredField("modules");
|
* ModuleRegistrar.instance().addConfigRemote("Steve's carts", "stevescarts.colorblind");
|
||||||
ItemSelections = TileEntityCargo.getDeclaredField("itemSelections");
|
* ModuleRegistrar.instance().addConfigRemote("Steve's carts", "stevescarts.shifttoggle");
|
||||||
|
* ModuleRegistrar.instance().registerBodyProvider(new HUDCartAssembler(), TileEntityCartAssembler);
|
||||||
GetSelectionName = CargoItemSelection.getDeclaredMethod("getName");
|
* ModuleRegistrar.instance().registerBodyProvider(new HUDCargoManager(), TileEntityCargo);
|
||||||
|
* ModuleRegistrar.instance().registerBodyProvider(new HUDLiquidManager(), TileEntityLiquid);
|
||||||
} catch (ClassNotFoundException e){
|
* ModuleRegistrar.instance().registerHeadProvider(new HUDMinecartModular(), MinecartModular);
|
||||||
Waila.log.log(Level.WARNING, "[StevesCarts] Class not found. " + e);
|
* ModuleRegistrar.instance().registerBodyProvider(new HUDMinecartModular(), MinecartModular);
|
||||||
return;
|
* ModuleRegistrar.instance().registerSyncedNBTKey("*", TileEntityCartAssembler);
|
||||||
} catch (NoSuchFieldException e) {
|
* ModuleRegistrar.instance().registerSyncedNBTKey("*", MinecartModular);
|
||||||
Waila.log.log(Level.WARNING, "[StevesCarts] Field not found. " + e);
|
* ModuleRegistrar.instance().registerSyncedNBTKey("*", TileEntityCargo);
|
||||||
return;
|
* ModuleRegistrar.instance().registerSyncedNBTKey("*", TileEntityLiquid);
|
||||||
} catch (NoSuchMethodException e) {
|
*/
|
||||||
Waila.log.log(Level.WARNING, "[StevesCarts] Method not found. " + e);
|
}
|
||||||
return;
|
|
||||||
} catch (Exception e) {
|
|
||||||
Waila.log.log(Level.WARNING, "[StevesCarts] Error while loading module. " + e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("Steve's carts", "stevescarts.showall");
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("Steve's carts", "stevescarts.colorblind");
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("Steve's carts", "stevescarts.shifttoggle");
|
|
||||||
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDCartAssembler(), TileEntityCartAssembler);
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDCargoManager(), TileEntityCargo);
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDLiquidManager(), TileEntityLiquid);
|
|
||||||
ModuleRegistrar.instance().registerHeadProvider(new HUDMinecartModular(), MinecartModular);
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDMinecartModular(), MinecartModular);
|
|
||||||
|
|
||||||
ModuleRegistrar.instance().registerSyncedNBTKey("*", TileEntityCartAssembler);
|
|
||||||
ModuleRegistrar.instance().registerSyncedNBTKey("*", MinecartModular);
|
|
||||||
ModuleRegistrar.instance().registerSyncedNBTKey("*", TileEntityCargo);
|
|
||||||
ModuleRegistrar.instance().registerSyncedNBTKey("*", TileEntityLiquid);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
package mcp.mobius.waila.addons.thaumcraft;
|
package mcp.mobius.waila.addons.thaumcraft;
|
||||||
|
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.ALIGNRIGHT;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.TAB;
|
||||||
|
import static mcp.mobius.waila.api.SpecialChars.WHITE;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@@ -11,106 +15,113 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||||||
import net.minecraft.nbt.NBTTagList;
|
import net.minecraft.nbt.NBTTagList;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
import static mcp.mobius.waila.api.SpecialChars.*;
|
|
||||||
|
|
||||||
public class HUDHandlerIAspectContainer implements IWailaDataProvider{
|
public class HUDHandlerIAspectContainer implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
|
IWailaConfigHandler config) {
|
||||||
|
|
||||||
if (!config.getConfig("thaumcraft.aspects")) return currenttip;
|
if (!config.getConfig("thaumcraft.aspects")) return currenttip;
|
||||||
|
|
||||||
NBTTagCompound tag = accessor.getNBTData();
|
NBTTagCompound tag = accessor.getNBTData();
|
||||||
if (tag.hasKey("Aspects")){
|
if (tag.hasKey("Aspects")) {
|
||||||
NBTTagList taglist = tag.getTagList("Aspects", 10);
|
NBTTagList taglist = tag.getTagList("Aspects", 10);
|
||||||
|
|
||||||
List<String> unknownAspects = new ArrayList<String>();
|
List<String> unknownAspects = new ArrayList<String>();
|
||||||
|
|
||||||
for (int i = 0; i < taglist.tagCount(); i++){
|
for (int i = 0; i < taglist.tagCount(); i++) {
|
||||||
NBTTagCompound subtag = taglist.getCompoundTagAt(i);
|
NBTTagCompound subtag = taglist.getCompoundTagAt(i);
|
||||||
|
|
||||||
String aspect = Character.toUpperCase(subtag.getString("key").charAt(0)) + subtag.getString("key").substring(1);
|
String aspect = subtag.getString("key");
|
||||||
String amount = String.valueOf(subtag.getInteger("value"));
|
String amount = String.valueOf(subtag.getInteger("value"));
|
||||||
|
|
||||||
if (!aspect.equals("???"))
|
if (!aspect.equals("???"))
|
||||||
currenttip.add(String.format("%s" + TAB + ALIGNRIGHT + WHITE + "%s", aspect, amount));
|
currenttip.add(String.format("%s" + TAB + ALIGNRIGHT + WHITE + "%s", aspect, amount));
|
||||||
else
|
else unknownAspects.add(String.format("%s" + TAB + ALIGNRIGHT + WHITE + "%s", aspect, amount));
|
||||||
unknownAspects.add(String.format("%s" + TAB + ALIGNRIGHT + WHITE + "%s", aspect, amount));
|
}
|
||||||
}
|
|
||||||
|
|
||||||
currenttip.addAll(unknownAspects);
|
currenttip.addAll(unknownAspects);
|
||||||
}
|
}
|
||||||
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@SuppressWarnings("unchecked")
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
@Override
|
||||||
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
|
int y, int z) {
|
||||||
|
|
||||||
try{
|
try {
|
||||||
tag.setTag("Aspects", new NBTTagList());
|
tag.setTag("Aspects", new NBTTagList());
|
||||||
NBTTagList aspects = tag.getTagList("Aspects", 10);
|
NBTTagList aspects = tag.getTagList("Aspects", 10);
|
||||||
|
|
||||||
ItemStack headSlot = player.inventory.armorInventory[3];
|
ItemStack headSlot = player.inventory.armorInventory[3];
|
||||||
if (headSlot == null) return tag;
|
if (headSlot == null) return tag;
|
||||||
boolean hasReveal = ThaumcraftModule.IGoggles.isInstance(headSlot.getItem());
|
boolean hasReveal = ThaumcraftModule.IGoggles.isInstance(headSlot.getItem());
|
||||||
if (!hasReveal) return tag;
|
if (!hasReveal) return tag;
|
||||||
|
|
||||||
HashMap knownAspects = (HashMap) ThaumcraftModule.CommonProxy_getKnownAspects.invoke(ThaumcraftModule.Thaumcraft_proxy.get(null));
|
Map<String, ?> knownAspects = (Map<String, ?>) ThaumcraftModule.CommonProxy_getKnownAspects
|
||||||
LinkedHashMap playerAspects = (LinkedHashMap) ThaumcraftModule.AspectList_aspects.get(knownAspects.get(player.getCommandSenderName()));
|
.invoke(ThaumcraftModule.Thaumcraft_proxy.get(null));
|
||||||
LinkedHashMap tileAspects = new LinkedHashMap();
|
Map<?, Integer> playerAspects = (Map<?, Integer>) ThaumcraftModule.AspectList_aspects
|
||||||
|
.get(knownAspects.get(player.getCommandSenderName()));
|
||||||
|
Map<?, Integer> tileAspects = new LinkedHashMap<>();
|
||||||
|
|
||||||
if (ThaumcraftModule.IAspectContainer.isInstance(te)){
|
if (ThaumcraftModule.IAspectContainer.isInstance(te)) {
|
||||||
tileAspects = (LinkedHashMap) ThaumcraftModule.AspectList_aspects.get(ThaumcraftModule.IAspectContainer_getAspects.invoke(te));
|
tileAspects = (Map<?, Integer>) ThaumcraftModule.AspectList_aspects
|
||||||
} else if (ThaumcraftModule.TileAlchemyFurnace.isInstance(te)){
|
.get(ThaumcraftModule.IAspectContainer_getAspects.invoke(te));
|
||||||
tileAspects = (LinkedHashMap) ThaumcraftModule.AspectList_aspects.get(ThaumcraftModule.TileAlchemyFurnace_aspects.get(te));
|
} else if (ThaumcraftModule.TileAlchemyFurnace.isInstance(te)) {
|
||||||
}
|
tileAspects = (Map<?, Integer>) ThaumcraftModule.AspectList_aspects
|
||||||
|
.get(ThaumcraftModule.TileAlchemyFurnace_aspects.get(te));
|
||||||
|
}
|
||||||
|
|
||||||
for (Object o : tileAspects.keySet()){
|
for (Object o : tileAspects.keySet()) {
|
||||||
if ((Integer) tileAspects.get(o) > 0){
|
if ((Integer) tileAspects.get(o) > 0) {
|
||||||
if (playerAspects.containsKey(o)){
|
if (playerAspects.containsKey(o)) {
|
||||||
NBTTagCompound cmptag = new NBTTagCompound();
|
NBTTagCompound cmptag = new NBTTagCompound();
|
||||||
cmptag.setString ("key", (String)ThaumcraftModule.Aspect_tag.get(o));
|
cmptag.setString("key", (String) ThaumcraftModule.Aspect_getName.invoke(o));
|
||||||
cmptag.setInteger("value", (Integer) tileAspects.get(o));
|
cmptag.setInteger("value", (Integer) tileAspects.get(o));
|
||||||
aspects.appendTag(cmptag);
|
aspects.appendTag(cmptag);
|
||||||
} else {
|
} else {
|
||||||
NBTTagCompound cmptag = new NBTTagCompound();
|
NBTTagCompound cmptag = new NBTTagCompound();
|
||||||
cmptag.setString ("key", "???");
|
cmptag.setString("key", "???");
|
||||||
cmptag.setInteger("value", (Integer) tileAspects.get(o));
|
cmptag.setInteger("value", (Integer) tileAspects.get(o));
|
||||||
aspects.appendTag(cmptag);
|
aspects.appendTag(cmptag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//for (int i = 0; i < aspects.tagCount(); i++){
|
// for (int i = 0; i < aspects.tagCount(); i++){
|
||||||
// System.out.printf("%s : %s\n", aspects.getCompoundTagAt(i).getString("key"), aspects.getCompoundTagAt(i).getString("value"));
|
// System.out.printf("%s : %s\n", aspects.getCompoundTagAt(i).getString("key"),
|
||||||
//}
|
// aspects.getCompoundTagAt(i).getString("value"));
|
||||||
|
// }
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tag;
|
||||||
} catch (Exception e) {
|
}
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,70 +12,69 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class ThaumcraftModule {
|
public class ThaumcraftModule {
|
||||||
|
|
||||||
public static Class Thaumcraft = null;
|
public static Class<?> Thaumcraft = null;
|
||||||
public static Field Thaumcraft_proxy = null;
|
public static Field Thaumcraft_proxy = null;
|
||||||
|
|
||||||
public static Class IAspectContainer = null;
|
public static Class<?> IAspectContainer = null;
|
||||||
public static Method IAspectContainer_getAspects = null;
|
public static Method IAspectContainer_getAspects = null;
|
||||||
|
|
||||||
public static Class AspectList = null;
|
public static Class<?> AspectList = null;
|
||||||
public static Method AspectList_writeToNBT = null;
|
public static Method AspectList_writeToNBT = null;
|
||||||
public static Field AspectList_aspects = null;
|
public static Field AspectList_aspects = null;
|
||||||
|
|
||||||
public static Class TileAlchemyFurnace = null;
|
public static Class<?> TileAlchemyFurnace = null;
|
||||||
public static Field TileAlchemyFurnace_aspects = null;
|
public static Field TileAlchemyFurnace_aspects = null;
|
||||||
|
|
||||||
public static Class Aspect = null;
|
public static Class<?> Aspect = null;
|
||||||
public static Field Aspect_tag = null;
|
public static Field Aspect_tag = null;
|
||||||
|
public static Method Aspect_getName = null;
|
||||||
|
|
||||||
public static Class CommonProxy = null;
|
public static Class<?> CommonProxy = null;
|
||||||
public static Method CommonProxy_getKnownAspects = null;
|
public static Method CommonProxy_getKnownAspects = null;
|
||||||
|
|
||||||
public static Class IGoggles = null;
|
public static Class<?> IGoggles = null;
|
||||||
|
|
||||||
//public static Class TileAlchemyFurnace = null;
|
// public static Class<?> TileAlchemyFurnace = null;
|
||||||
|
|
||||||
|
public static void register() {
|
||||||
|
try {
|
||||||
|
Thaumcraft = Class.forName("thaumcraft.common.Thaumcraft");
|
||||||
|
Thaumcraft_proxy = Thaumcraft.getDeclaredField("proxy");
|
||||||
|
|
||||||
public static void register(){
|
IAspectContainer = Class.forName("thaumcraft.api.aspects.IAspectContainer");
|
||||||
try{
|
IAspectContainer_getAspects = IAspectContainer.getDeclaredMethod("getAspects");
|
||||||
Thaumcraft = Class.forName("thaumcraft.common.Thaumcraft");
|
|
||||||
Thaumcraft_proxy = Thaumcraft.getDeclaredField("proxy");
|
|
||||||
|
|
||||||
IAspectContainer = Class.forName("thaumcraft.api.aspects.IAspectContainer");
|
AspectList = Class.forName("thaumcraft.api.aspects.AspectList");
|
||||||
IAspectContainer_getAspects = IAspectContainer.getDeclaredMethod("getAspects");
|
AspectList_writeToNBT = AspectList.getDeclaredMethod("writeToNBT", NBTTagCompound.class);
|
||||||
|
AspectList_aspects = AspectList.getDeclaredField("aspects");
|
||||||
|
|
||||||
AspectList = Class.forName("thaumcraft.api.aspects.AspectList");
|
TileAlchemyFurnace = Class.forName("thaumcraft.common.tiles.TileAlchemyFurnace");
|
||||||
AspectList_writeToNBT = AspectList.getDeclaredMethod("writeToNBT", NBTTagCompound.class);
|
TileAlchemyFurnace_aspects = TileAlchemyFurnace.getDeclaredField("aspects");
|
||||||
AspectList_aspects = AspectList.getDeclaredField("aspects");
|
|
||||||
|
|
||||||
TileAlchemyFurnace = Class.forName("thaumcraft.common.tiles.TileAlchemyFurnace");
|
Aspect = Class.forName("thaumcraft.api.aspects.Aspect");
|
||||||
TileAlchemyFurnace_aspects = TileAlchemyFurnace.getDeclaredField("aspects");
|
Aspect_tag = Aspect.getDeclaredField("tag");
|
||||||
|
Aspect_tag.setAccessible(true);
|
||||||
|
Aspect_getName = Aspect.getDeclaredMethod("getName");
|
||||||
|
|
||||||
Aspect = Class.forName("thaumcraft.api.aspects.Aspect");
|
CommonProxy = Class.forName("thaumcraft.common.CommonProxy");
|
||||||
Aspect_tag = Aspect.getDeclaredField("tag");
|
CommonProxy_getKnownAspects = CommonProxy.getDeclaredMethod("getKnownAspects");
|
||||||
Aspect_tag.setAccessible(true);
|
|
||||||
|
|
||||||
CommonProxy = Class.forName("thaumcraft.common.CommonProxy");
|
IGoggles = Class.forName("thaumcraft.api.IGoggles");
|
||||||
CommonProxy_getKnownAspects = CommonProxy.getDeclaredMethod("getKnownAspects");
|
|
||||||
|
|
||||||
IGoggles = Class.forName("thaumcraft.api.IGoggles");
|
ModuleRegistrar.instance().addConfigRemote("Thaumcraft", "thaumcraft.aspects");
|
||||||
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIAspectContainer(), IAspectContainer);
|
||||||
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIAspectContainer(), TileAlchemyFurnace);
|
||||||
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerIAspectContainer(), IAspectContainer);
|
||||||
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerIAspectContainer(), TileAlchemyFurnace);
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("Thaumcraft", "thaumcraft.aspects");
|
} catch (ClassNotFoundException e) {
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIAspectContainer(), IAspectContainer);
|
Waila.log.log(Level.WARN, "[Thaumcraft] Class not found. " + e);
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIAspectContainer(), TileAlchemyFurnace);
|
return;
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerIAspectContainer(), IAspectContainer);
|
} catch (Exception e) {
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerIAspectContainer(), TileAlchemyFurnace);
|
Waila.log.log(Level.WARN, "[Thaumcraft] Unhandled exception." + e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
} catch (ClassNotFoundException e){
|
}
|
||||||
Waila.log.log(Level.WARN, "[Thaumcraft] Class not found. " + e);
|
|
||||||
return;
|
|
||||||
} catch (Exception e){
|
|
||||||
Waila.log.log(Level.WARN, "[Thaumcraft] Unhandled exception." + e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
package mcp.mobius.waila.addons.thermaldynamics;
|
package mcp.mobius.waila.addons.thermaldynamics;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import java.util.List;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
@@ -11,7 +9,10 @@ import net.minecraft.tileentity.TileEntity;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
|
||||||
import java.util.List;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
import mcp.mobius.waila.cbcore.LangUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Lordmau5 on 28.02.2015.
|
* Created by Lordmau5 on 28.02.2015.
|
||||||
@@ -19,21 +20,22 @@ import java.util.List;
|
|||||||
public class HUDHandlerDuct implements IWailaDataProvider {
|
public class HUDHandlerDuct implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
|
IWailaConfigHandler config) {
|
||||||
if (!config.getConfig("thermaldynamics.fluiductsFluid")) return currenttip;
|
if (!config.getConfig("thermaldynamics.fluiductsFluid")) return currenttip;
|
||||||
|
|
||||||
FluidStack fluid = FluidStack.loadFluidStackFromNBT(accessor.getNBTData());
|
FluidStack fluid = FluidStack.loadFluidStackFromNBT(accessor.getNBTData());
|
||||||
|
|
||||||
String name = "";
|
String name = "";
|
||||||
|
|
||||||
try{
|
try {
|
||||||
name += String.format(" < %s >", fluid.getFluid().getLocalizedName(fluid));
|
name += String.format(" < %s >", fluid.getFluid().getLocalizedName(fluid));
|
||||||
} catch (NullPointerException f){
|
} catch (NullPointerException f) {
|
||||||
name += " " + LangUtil.translateG("hud.msg.empty");
|
name += " " + LangUtil.translateG("hud.msg.empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,14 +44,14 @@ public class HUDHandlerDuct implements IWailaDataProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
|
IWailaConfigHandler config) {
|
||||||
if (!config.getConfig("thermaldynamics.fluiductsAmount")) return currenttip;
|
if (!config.getConfig("thermaldynamics.fluiductsAmount")) return currenttip;
|
||||||
|
|
||||||
int amount = 0;
|
int amount = 0;
|
||||||
|
|
||||||
NBTTagCompound tag = accessor.getNBTData();
|
NBTTagCompound tag = accessor.getNBTData();
|
||||||
if (tag.hasKey("Amount"))
|
if (tag.hasKey("Amount")) amount = accessor.getNBTInteger(tag, "Amount");
|
||||||
amount = accessor.getNBTInteger(tag, "Amount");
|
|
||||||
|
|
||||||
currenttip.add(String.format(" %d / 1000 mB", amount));
|
currenttip.add(String.format(" %d / 1000 mB", amount));
|
||||||
|
|
||||||
@@ -57,14 +59,15 @@ public class HUDHandlerDuct implements IWailaDataProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
|
IWailaConfigHandler config) {
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
if (te != null)
|
int y, int z) {
|
||||||
te.writeToNBT(tag);
|
if (te != null) te.writeToNBT(tag);
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,44 +1,39 @@
|
|||||||
package mcp.mobius.waila.addons.thermaldynamics;
|
package mcp.mobius.waila.addons.thermaldynamics;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.Level;
|
||||||
|
|
||||||
import mcp.mobius.waila.Waila;
|
import mcp.mobius.waila.Waila;
|
||||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||||
import org.apache.logging.log4j.Level;
|
|
||||||
|
|
||||||
public class ThermalDynamicsModule {
|
public class ThermalDynamicsModule {
|
||||||
|
|
||||||
public static Class TileFluidDuct = null;
|
public static Class TileFluidDuct = null;
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
// XXX : We register the Fluiduct
|
// XXX : We register the Fluiduct
|
||||||
try{
|
try {
|
||||||
TileFluidDuct = Class.forName("cofh.thermaldynamics.ducts.fluid.TileFluidDuct");
|
TileFluidDuct = Class.forName("cofh.thermaldynamics.ducts.fluid.TileFluidDuct");
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("Thermal Dynamics", "thermaldynamics.fluidDuctsFluid");
|
ModuleRegistrar.instance().addConfigRemote("Thermal Dynamics", "thermaldynamics.fluidDuctsFluid");
|
||||||
ModuleRegistrar.instance().addConfigRemote("Thermal Dynamics", "thermaldynamics.fluidDuctsAmount");
|
ModuleRegistrar.instance().addConfigRemote("Thermal Dynamics", "thermaldynamics.fluidDuctsAmount");
|
||||||
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerDuct(), TileFluidDuct);
|
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerDuct(), TileFluidDuct);
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerDuct(), TileFluidDuct);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerDuct(), TileFluidDuct);
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerDuct(), TileFluidDuct);
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerDuct(), TileFluidDuct);
|
||||||
|
|
||||||
} catch (Exception e){
|
} catch (Exception e) {
|
||||||
Waila.log.log(Level.WARN, "[Thermal Dynamics] Error while loading FluidDuct hooks." + e);
|
Waila.log.log(Level.WARN, "[Thermal Dynamics] Error while loading FluidDuct hooks." + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX : We register the IBlockInfo interface
|
// XXX : We register the IBlockInfo interface
|
||||||
/*
|
/*
|
||||||
try{
|
* try{ IBlockInfo = Class.forName("cofh.api.block.IBlockInfo"); IBlockInfo_getBlockInfo =
|
||||||
IBlockInfo = Class.forName("cofh.api.block.IBlockInfo");
|
* IBlockInfo.getMethod("getBlockInfo", IBlockAccess.class, int.class, int.class, int.class,
|
||||||
IBlockInfo_getBlockInfo = IBlockInfo.getMethod("getBlockInfo", IBlockAccess.class, int.class, int.class, int.class, ForgeDirection.class, EntityPlayer.class, List.class, boolean.class);
|
* ForgeDirection.class, EntityPlayer.class, List.class, boolean.class);
|
||||||
|
* //ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energyhandler");
|
||||||
|
* ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIBlockInfo(), IBlockInfo);
|
||||||
//ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energyhandler");
|
* ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerIBlockInfo(), IBlockInfo); } catch (Exception
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIBlockInfo(), IBlockInfo);
|
* e){ Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading IBlockInfo hooks." + e); }
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerIBlockInfo(), IBlockInfo);
|
*/
|
||||||
|
|
||||||
} catch (Exception e){
|
|
||||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading IBlockInfo hooks." + e);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,8 @@
|
|||||||
package mcp.mobius.waila.addons.thermalexpansion;
|
package mcp.mobius.waila.addons.thermalexpansion;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameData;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import java.util.List;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
|
||||||
import mcp.mobius.waila.api.SpecialChars;
|
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@@ -13,34 +10,44 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import cpw.mods.fml.common.registry.GameData;
|
||||||
import java.util.List;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
import mcp.mobius.waila.api.SpecialChars;
|
||||||
|
import mcp.mobius.waila.cbcore.LangUtil;
|
||||||
|
|
||||||
public class HUDHandlerCache implements IWailaDataProvider {
|
public class HUDHandlerCache implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) { return null; }
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
if(!config.getConfig("thermalexpansion.cache"))
|
IWailaConfigHandler config) {
|
||||||
return currenttip;
|
if (!config.getConfig("thermalexpansion.cache")) return currenttip;
|
||||||
try {
|
try {
|
||||||
ItemStack storedItem = null;
|
ItemStack storedItem = null;
|
||||||
if(accessor.getNBTData().hasKey("Item"))
|
if (accessor.getNBTData().hasKey("Item"))
|
||||||
storedItem = readItemStack(accessor.getNBTData().getCompoundTag("Item"));
|
storedItem = readItemStack(accessor.getNBTData().getCompoundTag("Item"));
|
||||||
|
|
||||||
String name = currenttip.get(0);
|
String name = currenttip.get(0);
|
||||||
String color = "";
|
String color = "";
|
||||||
if(name.startsWith("\u00a7"))
|
if (name.startsWith("\u00a7")) color = name.substring(0, 2);
|
||||||
color = name.substring(0, 2);
|
|
||||||
|
|
||||||
if(storedItem != null) {
|
if (storedItem != null) {
|
||||||
String namex = GameData.getItemRegistry().getNameForObject(storedItem.getItem());
|
String namex = GameData.getItemRegistry().getNameForObject(storedItem.getItem());
|
||||||
name += String.format(" < " + SpecialChars.getRenderString("waila.stack", "1", namex, "0", String.valueOf(storedItem.getItemDamage())) + color + " %s >", storedItem.getDisplayName());
|
name += String.format(
|
||||||
}
|
" < " + SpecialChars.getRenderString(
|
||||||
else
|
"waila.stack",
|
||||||
name += " " + LangUtil.translateG("hud.msg.empty");
|
"1",
|
||||||
|
namex,
|
||||||
|
"0",
|
||||||
|
String.valueOf(storedItem.getItemDamage())) + color + " %s >",
|
||||||
|
storedItem.getDisplayName());
|
||||||
|
} else name += " " + LangUtil.translateG("hud.msg.empty");
|
||||||
|
|
||||||
currenttip.set(0, name);
|
currenttip.set(0, name);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -48,44 +55,39 @@ public class HUDHandlerCache implements IWailaDataProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
if (!config.getConfig("thermalexpansion.cache"))
|
IWailaConfigHandler config) {
|
||||||
return currenttip;
|
if (!config.getConfig("thermalexpansion.cache")) return currenttip;
|
||||||
|
|
||||||
NBTTagCompound tag = accessor.getNBTData();
|
NBTTagCompound tag = accessor.getNBTData();
|
||||||
ItemStack storedItem = null;
|
ItemStack storedItem = null;
|
||||||
if(tag.hasKey("Item"))
|
if (tag.hasKey("Item")) storedItem = readItemStack(tag.getCompoundTag("Item"));
|
||||||
storedItem = readItemStack(tag.getCompoundTag("Item"));
|
|
||||||
|
|
||||||
int stored = 0;
|
int stored = 0;
|
||||||
int maxStored = 0;
|
int maxStored = 0;
|
||||||
if(tag.hasKey("Stored"))
|
if (tag.hasKey("Stored")) stored = tag.getInteger("Stored");
|
||||||
stored = tag.getInteger("Stored");
|
if (tag.hasKey("MaxStored")) maxStored = tag.getInteger("MaxStored");
|
||||||
if(tag.hasKey("MaxStored"))
|
|
||||||
maxStored = tag.getInteger("MaxStored");
|
|
||||||
|
|
||||||
if(storedItem != null) {
|
if (storedItem != null) {
|
||||||
currenttip.add("Stored: " + stored + "/" + maxStored);
|
currenttip.add("Stored: " + stored + "/" + maxStored);
|
||||||
}
|
} else currenttip.add("Capacity: " + maxStored);
|
||||||
else
|
|
||||||
currenttip.add("Capacity: " + maxStored);
|
|
||||||
|
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
return currenttip;
|
@Override
|
||||||
}
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
|
IWailaConfigHandler config) {
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
return currenttip;
|
int y, int z) {
|
||||||
}
|
if (te != null) te.writeToNBT(tag);
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
|
||||||
if(te != null)
|
|
||||||
te.writeToNBT(tag);
|
|
||||||
try {
|
try {
|
||||||
tag.setInteger("MaxStored", (Integer) ThermalExpansionModule.TileCache_getMaxStored.invoke(te));
|
tag.setInteger("MaxStored", (Integer) ThermalExpansionModule.TileCache_getMaxStored.invoke(te));
|
||||||
tag.setInteger("Stored", (Integer) ThermalExpansionModule.TileCache_getStored.invoke(te));
|
tag.setInteger("Stored", (Integer) ThermalExpansionModule.TileCache_getStored.invoke(te));
|
||||||
@@ -95,7 +97,7 @@ public class HUDHandlerCache implements IWailaDataProvider {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack readItemStack(NBTTagCompound tag) {
|
public ItemStack readItemStack(NBTTagCompound tag) {
|
||||||
ItemStack is = new ItemStack(Item.getItemById(tag.getShort("id")));
|
ItemStack is = new ItemStack(Item.getItemById(tag.getShort("id")));
|
||||||
|
|||||||
@@ -2,56 +2,67 @@ package mcp.mobius.waila.addons.thermalexpansion;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
import mcp.mobius.waila.cbcore.LangUtil;
|
||||||
|
|
||||||
public class HUDHandlerEnergyCell implements IWailaDataProvider {
|
public class HUDHandlerEnergyCell implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
if (!config.getConfig("thermalexpansion.energycell")) return currenttip;
|
IWailaConfigHandler config) {
|
||||||
|
if (!config.getConfig("thermalexpansion.energycell")) return currenttip;
|
||||||
|
|
||||||
int energyReceive = accessor.getNBTInteger(accessor.getNBTData(), "Recv");
|
int energyReceive = accessor.getNBTInteger(accessor.getNBTData(), "Recv");
|
||||||
int energySend = accessor.getNBTInteger(accessor.getNBTData(), "Send");
|
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));
|
currenttip.add(
|
||||||
|
String.format(
|
||||||
|
"%s/%s : %d / %d RF/t",
|
||||||
|
LangUtil.translateG("hud.msg.in"),
|
||||||
|
LangUtil.translateG("hud.msg.out"),
|
||||||
|
energyReceive,
|
||||||
|
energySend));
|
||||||
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
try {
|
int y, int z) {
|
||||||
int recv = ThermalExpansionModule.TileEnergyCell_Recv.getInt(te);
|
try {
|
||||||
int send = ThermalExpansionModule.TileEnergyCell_Send.getInt(te);
|
int recv = ThermalExpansionModule.TileEnergyCell_Recv.getInt(te);
|
||||||
tag.setInteger("Recv", recv);
|
int send = ThermalExpansionModule.TileEnergyCell_Send.getInt(te);
|
||||||
tag.setInteger("Send", send);
|
tag.setInteger("Recv", recv);
|
||||||
} catch (Exception e) {
|
tag.setInteger("Send", send);
|
||||||
throw new RuntimeException(e);
|
} catch (Exception e) {
|
||||||
}
|
throw new RuntimeException(e);
|
||||||
return tag;
|
}
|
||||||
}
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,51 +8,56 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.IChatComponent;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
|
||||||
public class HUDHandlerIBlockInfo implements IWailaDataProvider {
|
public class HUDHandlerIBlockInfo implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
try{
|
int y, int z) {
|
||||||
List info = new ArrayList();
|
try {
|
||||||
Block block = world.getBlock(x, y, z);
|
List info = new ArrayList();
|
||||||
ThermalExpansionModule.IBlockInfo_getBlockInfo.invoke(block, world, x, y, z, ForgeDirection.UNKNOWN, player, info, false);
|
Block block = world.getBlock(x, y, z);
|
||||||
|
ThermalExpansionModule.IBlockInfo_getBlockInfo
|
||||||
|
.invoke(block, world, x, y, z, ForgeDirection.UNKNOWN, player, info, false);
|
||||||
|
|
||||||
for (Object i : info){
|
for (Object i : info) {
|
||||||
System.out.printf("%s\n", i);
|
System.out.printf("%s\n", i);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e){
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+59
-50
@@ -8,72 +8,81 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import mcp.mobius.waila.api.ITaggedList;
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||||
import mcp.mobius.waila.api.ITaggedList;
|
|
||||||
|
|
||||||
public class HUDHandlerIEnergyHandler implements IWailaDataProvider {
|
public class HUDHandlerIEnergyHandler implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
|
IWailaConfigHandler config) {
|
||||||
|
|
||||||
if (!config.getConfig("thermalexpansion.energyhandler")) return currenttip;
|
if (!config.getConfig("thermalexpansion.energyhandler")) return currenttip;
|
||||||
if (!accessor.getNBTData().hasKey("Energy")) return currenttip;
|
if (!accessor.getNBTData().hasKey("Energy")) return currenttip;
|
||||||
|
|
||||||
int energy = accessor.getNBTInteger(accessor.getNBTData(), "Energy");
|
int energy = accessor.getNBTInteger(accessor.getNBTData(), "Energy");
|
||||||
int maxEnergy = accessor.getNBTInteger(accessor.getNBTData(), "MaxStorage");
|
int maxEnergy = accessor.getNBTInteger(accessor.getNBTData(), "MaxStorage");
|
||||||
try {
|
try {
|
||||||
if ((maxEnergy != 0) && (((ITaggedList)currenttip).getEntries("RFEnergyStorage").size() == 0)){
|
if ((maxEnergy != 0) && (((ITaggedList) currenttip).getEntries("RFEnergyStorage").size() == 0)) {
|
||||||
((ITaggedList)currenttip).add(String.format("%d / %d RF", energy, maxEnergy), "RFEnergyStorage");
|
((ITaggedList) currenttip).add(String.format("%d / %d RF", energy, maxEnergy), "RFEnergyStorage");
|
||||||
}
|
}
|
||||||
} catch (Exception e){
|
} catch (Exception e) {
|
||||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||||
}
|
}
|
||||||
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
try{
|
int y, int z) {
|
||||||
Integer energy = -1;
|
try {
|
||||||
Integer maxsto = -1;
|
Integer energy = -1;
|
||||||
if (ThermalExpansionModule.IEnergyInfo.isInstance(te)){
|
Integer maxsto = -1;
|
||||||
energy = (Integer) ThermalExpansionModule.IEnergyInfo_getCurStorage.invoke(te);
|
if (ThermalExpansionModule.IEnergyInfo.isInstance(te)) {
|
||||||
maxsto = (Integer) ThermalExpansionModule.IEnergyInfo_getMaxStorage.invoke(te);
|
energy = (Integer) ThermalExpansionModule.IEnergyInfo_getCurStorage.invoke(te);
|
||||||
} else if (ThermalExpansionModule.IEnergyProvider.isInstance(te)){
|
maxsto = (Integer) ThermalExpansionModule.IEnergyInfo_getMaxStorage.invoke(te);
|
||||||
energy = (Integer) ThermalExpansionModule.IEnergyProvider_getCurStorage.invoke(te, ForgeDirection.UNKNOWN);
|
} else if (ThermalExpansionModule.IEnergyProvider.isInstance(te)) {
|
||||||
maxsto = (Integer) ThermalExpansionModule.IEnergyProvider_getMaxStorage.invoke(te, ForgeDirection.UNKNOWN);
|
energy = (Integer) ThermalExpansionModule.IEnergyProvider_getCurStorage
|
||||||
} else if (ThermalExpansionModule.IEnergyReceiver.isInstance(te)){
|
.invoke(te, ForgeDirection.UNKNOWN);
|
||||||
energy = (Integer) ThermalExpansionModule.IEnergyReceiver_getCurStorage.invoke(te, ForgeDirection.UNKNOWN);
|
maxsto = (Integer) ThermalExpansionModule.IEnergyProvider_getMaxStorage
|
||||||
maxsto = (Integer) ThermalExpansionModule.IEnergyReceiver_getMaxStorage.invoke(te, ForgeDirection.UNKNOWN);
|
.invoke(te, ForgeDirection.UNKNOWN);
|
||||||
}
|
} else if (ThermalExpansionModule.IEnergyReceiver.isInstance(te)) {
|
||||||
|
energy = (Integer) ThermalExpansionModule.IEnergyReceiver_getCurStorage
|
||||||
|
.invoke(te, ForgeDirection.UNKNOWN);
|
||||||
|
maxsto = (Integer) ThermalExpansionModule.IEnergyReceiver_getMaxStorage
|
||||||
|
.invoke(te, ForgeDirection.UNKNOWN);
|
||||||
|
}
|
||||||
|
|
||||||
tag.setInteger("Energy", energy);
|
tag.setInteger("Energy", energy);
|
||||||
tag.setInteger("MaxStorage", maxsto);
|
tag.setInteger("MaxStorage", maxsto);
|
||||||
|
|
||||||
} catch (Exception e){
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,78 +2,82 @@ package mcp.mobius.waila.addons.thermalexpansion;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
import mcp.mobius.waila.cbcore.LangUtil;
|
||||||
|
|
||||||
public class HUDHandlerISecureTile implements IWailaDataProvider {
|
public class HUDHandlerISecureTile implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
|
IWailaConfigHandler config) {
|
||||||
|
|
||||||
if (config.getConfig("thermalexpansion.owner")){
|
if (config.getConfig("thermalexpansion.owner")) {
|
||||||
|
|
||||||
String owner = accessor.getNBTData().getString("Owner");
|
String owner = accessor.getNBTData().getString("Owner");
|
||||||
int iaccess = accessor.getNBTInteger(accessor.getNBTData(), "Access");
|
int iaccess = accessor.getNBTInteger(accessor.getNBTData(), "Access");
|
||||||
|
|
||||||
if (owner.equals("[None]"))
|
if (owner.equals("[None]")) return currenttip;
|
||||||
return currenttip;
|
|
||||||
|
|
||||||
String access = "INVALID";
|
String access = "INVALID";
|
||||||
switch(iaccess){
|
switch (iaccess) {
|
||||||
case 0:
|
case 0:
|
||||||
access = LangUtil.translateG("hud.msg.public");
|
access = LangUtil.translateG("hud.msg.public");
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
access = LangUtil.translateG("hud.msg.restricted");
|
access = LangUtil.translateG("hud.msg.restricted");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
access = LangUtil.translateG("hud.msg.private");
|
access = LangUtil.translateG("hud.msg.private");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
currenttip.add(String.format("%s : \u00a7f%s\u00a7r [ %s ]", LangUtil.translateG("hud.msg.owner"), owner, access));
|
currenttip.add(
|
||||||
|
String.format("%s : \u00a7f%s\u00a7r [ %s ]", LangUtil.translateG("hud.msg.owner"), owner, access));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
try {
|
int y, int z) {
|
||||||
String owner = (String) ThermalExpansionModule.ISecureTile_getOwnerName.invoke(te);
|
try {
|
||||||
int access = ((Enum) ThermalExpansionModule.ISecureTile_getAccess.invoke(te)).ordinal();
|
String owner = (String) ThermalExpansionModule.ISecureTile_getOwnerName.invoke(te);
|
||||||
|
int access = ((Enum) ThermalExpansionModule.ISecureTile_getAccess.invoke(te)).ordinal();
|
||||||
|
|
||||||
tag.setString("Owner", owner);
|
tag.setString("Owner", owner);
|
||||||
tag.setInteger("Access", access);
|
tag.setInteger("Access", access);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,95 +2,103 @@ package mcp.mobius.waila.addons.thermalexpansion;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
import mcp.mobius.waila.cbcore.LangUtil;
|
||||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||||
|
|
||||||
public class HUDHandlerTank implements IWailaDataProvider {
|
public class HUDHandlerTank implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
if (!config.getConfig("thermalexpansion.fluidtype")) return currenttip;
|
IWailaConfigHandler config) {
|
||||||
|
if (!config.getConfig("thermalexpansion.fluidtype")) return currenttip;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
FluidStack fluid = (FluidStack)ThermalExpansionModule.TileTank_getTankFluid.invoke(accessor.getTileEntity());
|
FluidStack fluid = (FluidStack) ThermalExpansionModule.TileTank_getTankFluid
|
||||||
String name = currenttip.get(0);
|
.invoke(accessor.getTileEntity());
|
||||||
|
String name = currenttip.get(0);
|
||||||
|
|
||||||
try{
|
try {
|
||||||
name += String.format(" < %s >", fluid.getFluid().getLocalizedName(fluid));
|
name += String.format(" < %s >", fluid.getFluid().getLocalizedName(fluid));
|
||||||
} catch (NullPointerException f){
|
} catch (NullPointerException f) {
|
||||||
name += " " + LangUtil.translateG("hud.msg.empty");
|
name += " " + LangUtil.translateG("hud.msg.empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
currenttip.set(0, name);
|
currenttip.set(0, name);
|
||||||
|
|
||||||
} catch (Exception e){
|
} catch (Exception e) {
|
||||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||||
}
|
}
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
try {
|
IWailaConfigHandler config) {
|
||||||
if (config.getConfig("thermalexpansion.fluidamount")){
|
try {
|
||||||
int amount = 0;
|
if (config.getConfig("thermalexpansion.fluidamount")) {
|
||||||
if (accessor.getNBTData().hasKey("Amount"))
|
int amount = 0;
|
||||||
amount = accessor.getNBTInteger(accessor.getNBTData(), "Amount");
|
if (accessor.getNBTData().hasKey("Amount"))
|
||||||
|
amount = accessor.getNBTInteger(accessor.getNBTData(), "Amount");
|
||||||
|
|
||||||
Integer capacity = (Integer)ThermalExpansionModule.TileTank_getTankCapacity.invoke(accessor.getTileEntity());
|
Integer capacity = (Integer) ThermalExpansionModule.TileTank_getTankCapacity
|
||||||
|
.invoke(accessor.getTileEntity());
|
||||||
|
|
||||||
currenttip.add(String.format("%d / %d mB", amount, capacity));
|
currenttip.add(String.format("%d / %d mB", amount, capacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.getConfig("thermalexpansion.tankmode")){
|
if (config.getConfig("thermalexpansion.tankmode")) {
|
||||||
Byte mode = (Byte)ThermalExpansionModule.TileTank_mode.get(accessor.getTileEntity());
|
Byte mode = (Byte) ThermalExpansionModule.TileTank_mode.get(accessor.getTileEntity());
|
||||||
if (mode == 0)
|
if (mode == 0) currenttip.add(
|
||||||
currenttip.add(String.format("%s : \u00a7a%s", LangUtil.translateG("hud.msg.mode"), LangUtil.translateG("hud.msg.input")));
|
String.format(
|
||||||
else if (mode == 1)
|
"%s : \u00a7a%s",
|
||||||
currenttip.add(String.format("%s : \u00a7c%s", LangUtil.translateG("hud.msg.mode"), LangUtil.translateG("hud.msg.output")));
|
LangUtil.translateG("hud.msg.mode"),
|
||||||
else
|
LangUtil.translateG("hud.msg.input")));
|
||||||
currenttip.add(String.format("Mode : Unknown (%d)", mode));
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
} catch (Exception e){
|
@Override
|
||||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
}
|
IWailaConfigHandler config) {
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
return currenttip;
|
int y, int z) {
|
||||||
}
|
try {
|
||||||
|
int amount = (Integer) ThermalExpansionModule.TileTank_getTankAmount.invoke(te);
|
||||||
@Override
|
tag.setInteger("Amount", amount);
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
} catch (Exception e) {
|
||||||
return currenttip;
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
return tag;
|
||||||
@Override
|
}
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
|
||||||
try {
|
|
||||||
int amount = (Integer) ThermalExpansionModule.TileTank_getTankAmount.invoke(te);
|
|
||||||
tag.setInteger("Amount", amount);
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,109 +2,114 @@ package mcp.mobius.waila.addons.thermalexpansion;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import mcp.mobius.waila.cbcore.LangUtil;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
import mcp.mobius.waila.cbcore.LangUtil;
|
||||||
|
|
||||||
public class HUDHandlerTesseract implements IWailaDataProvider {
|
public class HUDHandlerTesseract implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
|
IWailaConfigHandler config) {
|
||||||
|
|
||||||
if (config.getConfig("thermalexpansion.tesssendrecv")){
|
if (config.getConfig("thermalexpansion.tesssendrecv")) {
|
||||||
String send = String.format("%s : ", LangUtil.translateG("hud.msg.send"));
|
String send = String.format("%s : ", LangUtil.translateG("hud.msg.send"));
|
||||||
String recv = String.format("%s : ", LangUtil.translateG("hud.msg.recv"));
|
String recv = String.format("%s : ", LangUtil.translateG("hud.msg.recv"));
|
||||||
String item = String.format("\u00a7a%s ", LangUtil.translateG("hud.msg.item"));
|
String item = String.format("\u00a7a%s ", LangUtil.translateG("hud.msg.item"));
|
||||||
String fluid= String.format("\u00a79%s ", LangUtil.translateG("hud.msg.fluid"));
|
String fluid = String.format("\u00a79%s ", LangUtil.translateG("hud.msg.fluid"));
|
||||||
String energ= String.format("\u00a7c%s ", LangUtil.translateG("hud.msg.energ"));
|
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(), "Item.Mode")){
|
switch (accessor.getNBTInteger(accessor.getNBTData(), "Fluid.Mode")) {
|
||||||
case 0:
|
case 0:
|
||||||
send += item;
|
send += fluid;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
recv += item;
|
recv += fluid;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
send += item;
|
send += fluid;
|
||||||
recv += item;
|
recv += fluid;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (accessor.getNBTInteger(accessor.getNBTData(), "Fluid.Mode")){
|
switch (accessor.getNBTInteger(accessor.getNBTData(), "Energy.Mode")) {
|
||||||
case 0:
|
case 0:
|
||||||
send += fluid;
|
send += energ;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
recv += fluid;
|
recv += energ;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
send += fluid;
|
send += energ;
|
||||||
recv += fluid;
|
recv += energ;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (accessor.getNBTInteger(accessor.getNBTData(), "Energy.Mode")){
|
if (!send.equals(String.format("%s : ", LangUtil.translateG("hud.msg.send")))) currenttip.add(send);
|
||||||
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"))))
|
if (!send.equals(String.format("%s : ", LangUtil.translateG("hud.msg.recv")))) currenttip.add(recv);
|
||||||
currenttip.add(send);
|
}
|
||||||
|
|
||||||
if (!send.equals(String.format("%s : ", LangUtil.translateG("hud.msg.recv"))))
|
if (config.getConfig("thermalexpansion.tessfreq")) currenttip.add(
|
||||||
currenttip.add(recv);
|
String.format(
|
||||||
}
|
"%s : %d",
|
||||||
|
LangUtil.translateG("hud.msg.frequency"),
|
||||||
|
accessor.getNBTInteger(accessor.getNBTData(), "Frequency")));
|
||||||
|
|
||||||
if (config.getConfig("thermalexpansion.tessfreq"))
|
return currenttip;
|
||||||
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;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
return currenttip;
|
int y, int z) {
|
||||||
}
|
try {
|
||||||
|
byte modeItem = ThermalExpansionModule.TileTesseract_Item.getByte(te);
|
||||||
@Override
|
byte modeFluid = ThermalExpansionModule.TileTesseract_Fluid.getByte(te);
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
byte modeEnergy = ThermalExpansionModule.TileTesseract_Energy.getByte(te);
|
||||||
try {
|
tag.setByte("Item.Mode", modeItem);
|
||||||
byte modeItem = ThermalExpansionModule.TileTesseract_Item.getByte(te);
|
tag.setByte("Fluid.Mode", modeFluid);
|
||||||
byte modeFluid = ThermalExpansionModule.TileTesseract_Fluid.getByte(te);
|
tag.setByte("Energy.Mode", modeEnergy);
|
||||||
byte modeEnergy = ThermalExpansionModule.TileTesseract_Energy.getByte(te);
|
} catch (Exception e) {
|
||||||
tag.setByte("Item.Mode", modeItem);
|
throw new RuntimeException(e);
|
||||||
tag.setByte("Fluid.Mode", modeFluid);
|
}
|
||||||
tag.setByte("Energy.Mode", modeEnergy);
|
return tag;
|
||||||
} catch (Exception e) {
|
}
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
+126
-131
@@ -1,181 +1,176 @@
|
|||||||
package mcp.mobius.waila.addons.thermalexpansion;
|
package mcp.mobius.waila.addons.thermalexpansion;
|
||||||
|
|
||||||
import mcp.mobius.waila.Waila;
|
|
||||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
|
||||||
import org.apache.logging.log4j.Level;
|
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.Level;
|
||||||
|
|
||||||
|
import mcp.mobius.waila.Waila;
|
||||||
|
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||||
|
|
||||||
public class ThermalExpansionModule {
|
public class ThermalExpansionModule {
|
||||||
|
|
||||||
public static Class IEnergyProvider = null;
|
public static Class IEnergyProvider = null;
|
||||||
public static Method IEnergyProvider_getMaxStorage = null;
|
public static Method IEnergyProvider_getMaxStorage = null;
|
||||||
public static Method IEnergyProvider_getCurStorage = null;
|
public static Method IEnergyProvider_getCurStorage = null;
|
||||||
|
|
||||||
public static Class IEnergyReceiver = null;
|
public static Class IEnergyReceiver = null;
|
||||||
public static Method IEnergyReceiver_getMaxStorage = null;
|
public static Method IEnergyReceiver_getMaxStorage = null;
|
||||||
public static Method IEnergyReceiver_getCurStorage = null;
|
public static Method IEnergyReceiver_getCurStorage = null;
|
||||||
|
|
||||||
public static Class IEnergyInfo = null;
|
public static Class IEnergyInfo = null;
|
||||||
public static Method IEnergyInfo_getMaxStorage = null;
|
public static Method IEnergyInfo_getMaxStorage = null;
|
||||||
public static Method IEnergyInfo_getCurStorage = null;
|
public static Method IEnergyInfo_getCurStorage = null;
|
||||||
|
|
||||||
public static Class TileEnergyCell = null;
|
public static Class TileEnergyCell = null;
|
||||||
public static Field TileEnergyCell_Recv = null;
|
public static Field TileEnergyCell_Recv = null;
|
||||||
public static Field TileEnergyCell_Send = null;
|
public static Field TileEnergyCell_Send = null;
|
||||||
|
|
||||||
public static Class TileTank = null;
|
public static Class TileTank = null;
|
||||||
public static Method TileTank_getTankFluid = null;
|
public static Method TileTank_getTankFluid = null;
|
||||||
public static Method TileTank_getTankCapacity = null;
|
public static Method TileTank_getTankCapacity = null;
|
||||||
public static Method TileTank_getTankAmount = null;
|
public static Method TileTank_getTankAmount = null;
|
||||||
public static Field TileTank_mode = null;
|
public static Field TileTank_mode = null;
|
||||||
|
|
||||||
public static Class TileTesseract = null;
|
public static Class TileTesseract = null;
|
||||||
public static Field TileTesseract_Item = null;
|
public static Field TileTesseract_Item = null;
|
||||||
public static Field TileTesseract_Fluid = null;
|
public static Field TileTesseract_Fluid = null;
|
||||||
public static Field TileTesseract_Energy = null;
|
public static Field TileTesseract_Energy = null;
|
||||||
|
|
||||||
public static Class ISecureTile = null;
|
public static Class ISecureTile = null;
|
||||||
public static Method ISecureTile_getAccess = null;
|
public static Method ISecureTile_getAccess = null;
|
||||||
public static Method ISecureTile_getOwnerName = null;
|
public static Method ISecureTile_getOwnerName = null;
|
||||||
|
|
||||||
public static Class TileCache = null;
|
public static Class TileCache = null;
|
||||||
public static Method TileCache_getItemStack = null;
|
public static Method TileCache_getItemStack = null;
|
||||||
public static Method TileCache_getMaxStored = null;
|
public static Method TileCache_getMaxStored = null;
|
||||||
public static Method TileCache_getStored = null;
|
public static Method TileCache_getStored = null;
|
||||||
|
|
||||||
public static Class BlockMultipart = null;
|
public static Class BlockMultipart = null;
|
||||||
|
|
||||||
public static Class IBlockInfo = null;
|
public static Class IBlockInfo = null;
|
||||||
public static Method IBlockInfo_getBlockInfo = null;
|
public static Method IBlockInfo_getBlockInfo = null;
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
// XXX : We register the Energy interface first
|
// XXX : We register the Energy interface first
|
||||||
try{
|
try {
|
||||||
IEnergyProvider = Class.forName("cofh.api.energy.IEnergyProvider");
|
IEnergyProvider = Class.forName("cofh.api.energy.IEnergyProvider");
|
||||||
IEnergyProvider_getMaxStorage = IEnergyProvider.getMethod("getMaxEnergyStored", ForgeDirection.class);
|
IEnergyProvider_getMaxStorage = IEnergyProvider.getMethod("getMaxEnergyStored", ForgeDirection.class);
|
||||||
IEnergyProvider_getCurStorage = IEnergyProvider.getMethod("getEnergyStored", ForgeDirection.class);
|
IEnergyProvider_getCurStorage = IEnergyProvider.getMethod("getEnergyStored", ForgeDirection.class);
|
||||||
|
|
||||||
IEnergyReceiver = Class.forName("cofh.api.energy.IEnergyReceiver");
|
IEnergyReceiver = Class.forName("cofh.api.energy.IEnergyReceiver");
|
||||||
IEnergyReceiver_getMaxStorage = IEnergyReceiver.getMethod("getMaxEnergyStored", ForgeDirection.class);
|
IEnergyReceiver_getMaxStorage = IEnergyReceiver.getMethod("getMaxEnergyStored", ForgeDirection.class);
|
||||||
IEnergyReceiver_getCurStorage = IEnergyReceiver.getMethod("getEnergyStored", ForgeDirection.class);
|
IEnergyReceiver_getCurStorage = IEnergyReceiver.getMethod("getEnergyStored", ForgeDirection.class);
|
||||||
|
|
||||||
IEnergyInfo = Class.forName("cofh.api.tileentity.IEnergyInfo");
|
IEnergyInfo = Class.forName("cofh.api.tileentity.IEnergyInfo");
|
||||||
IEnergyInfo_getMaxStorage = IEnergyInfo.getMethod("getInfoMaxEnergyStored");
|
IEnergyInfo_getMaxStorage = IEnergyInfo.getMethod("getInfoMaxEnergyStored");
|
||||||
IEnergyInfo_getCurStorage = IEnergyInfo.getMethod("getInfoEnergyStored");
|
IEnergyInfo_getCurStorage = IEnergyInfo.getMethod("getInfoEnergyStored");
|
||||||
|
|
||||||
|
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energyhandler");
|
||||||
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIEnergyHandler(), IEnergyProvider);
|
||||||
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerIEnergyHandler(), IEnergyProvider);
|
||||||
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIEnergyHandler(), IEnergyReceiver);
|
||||||
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerIEnergyHandler(), IEnergyReceiver);
|
||||||
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIEnergyHandler(), IEnergyInfo);
|
||||||
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerIEnergyHandler(), IEnergyInfo);
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energyhandler");
|
} catch (Exception e) {
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIEnergyHandler(), IEnergyProvider);
|
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Energy hooks." + e);
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerIEnergyHandler(), IEnergyProvider);
|
}
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIEnergyHandler(), IEnergyReceiver);
|
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerIEnergyHandler(), IEnergyReceiver);
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIEnergyHandler(), IEnergyInfo);
|
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerIEnergyHandler(), IEnergyInfo);
|
|
||||||
|
|
||||||
} catch (Exception e){
|
// XXX : We register the energy cell
|
||||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Energy hooks." + e);
|
try {
|
||||||
}
|
TileEnergyCell = Class.forName("cofh.thermalexpansion.block.cell.TileCell");
|
||||||
|
TileEnergyCell_Recv = TileEnergyCell.getDeclaredField("energyReceive");
|
||||||
|
TileEnergyCell_Send = TileEnergyCell.getDeclaredField("energySend");
|
||||||
|
|
||||||
// XXX : We register the energy cell
|
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energycell");
|
||||||
try{
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerEnergyCell(), TileEnergyCell);
|
||||||
TileEnergyCell = Class.forName("cofh.thermalexpansion.block.cell.TileCell");
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerEnergyCell(), TileEnergyCell);
|
||||||
TileEnergyCell_Recv = TileEnergyCell.getDeclaredField("energyReceive");
|
|
||||||
TileEnergyCell_Send = TileEnergyCell.getDeclaredField("energySend");
|
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energycell");
|
} catch (Exception e) {
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerEnergyCell(), TileEnergyCell);
|
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Energy Cell hooks." + e);
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerEnergyCell(), TileEnergyCell);
|
}
|
||||||
|
|
||||||
} catch (Exception e){
|
// XXX : We register the Tank interface
|
||||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Energy Cell hooks." + e);
|
try {
|
||||||
}
|
TileTank = Class.forName("cofh.thermalexpansion.block.tank.TileTank");
|
||||||
|
TileTank_getTankFluid = TileTank.getMethod("getTankFluid");
|
||||||
|
TileTank_getTankCapacity = TileTank.getMethod("getTankCapacity");
|
||||||
|
TileTank_getTankAmount = TileTank.getMethod("getTankFluidAmount");
|
||||||
|
TileTank_mode = TileTank.getField("mode");
|
||||||
|
|
||||||
// XXX : We register the Tank interface
|
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.fluidtype");
|
||||||
try{
|
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.fluidamount");
|
||||||
TileTank = Class.forName("cofh.thermalexpansion.block.tank.TileTank");
|
ModuleRegistrar.instance().addConfig("Thermal Expansion", "thermalexpansion.tankmode");
|
||||||
TileTank_getTankFluid = TileTank.getMethod("getTankFluid");
|
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerTank(), TileTank);
|
||||||
TileTank_getTankCapacity = TileTank.getMethod("getTankCapacity");
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTank(), TileTank);
|
||||||
TileTank_getTankAmount = TileTank.getMethod("getTankFluidAmount");
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerTank(), TileTank);
|
||||||
TileTank_mode = TileTank.getField("mode");
|
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.fluidtype");
|
} catch (Exception e) {
|
||||||
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.fluidamount");
|
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tank hooks." + e);
|
||||||
ModuleRegistrar.instance().addConfig("Thermal Expansion", "thermalexpansion.tankmode");
|
}
|
||||||
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerTank(), TileTank);
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTank(), TileTank);
|
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerTank(), TileTank);
|
|
||||||
|
|
||||||
} catch (Exception e){
|
// XXX : We register the Tesseract interface
|
||||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tank hooks." + e);
|
try {
|
||||||
}
|
TileTesseract = Class.forName("cofh.thermalexpansion.block.ender.TileTesseract");
|
||||||
|
TileTesseract_Item = TileTesseract.getDeclaredField("modeItem");
|
||||||
|
TileTesseract_Fluid = TileTesseract.getDeclaredField("modeFluid");
|
||||||
|
TileTesseract_Energy = TileTesseract.getDeclaredField("modeEnergy");
|
||||||
|
|
||||||
// XXX : We register the Tesseract interface
|
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.tesssendrecv");
|
||||||
try{
|
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.tessfreq");
|
||||||
TileTesseract = Class.forName("cofh.thermalexpansion.block.ender.TileTesseract");
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTesseract(), TileTesseract);
|
||||||
TileTesseract_Item = TileTesseract.getDeclaredField("modeItem");
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerTesseract(), TileTesseract);
|
||||||
TileTesseract_Fluid = TileTesseract.getDeclaredField("modeFluid");
|
|
||||||
TileTesseract_Energy = TileTesseract.getDeclaredField("modeEnergy");
|
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.tesssendrecv");
|
} catch (Exception e) {
|
||||||
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.tessfreq");
|
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tesseract hooks." + e);
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTesseract(), TileTesseract);
|
}
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerTesseract(), TileTesseract);
|
|
||||||
|
|
||||||
} catch (Exception e){
|
// XXX : We register the ISecureTile interface
|
||||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tesseract hooks." + e);
|
try {
|
||||||
}
|
ISecureTile = Class.forName("cofh.api.tileentity.ISecurable");
|
||||||
|
ISecureTile_getAccess = ISecureTile.getDeclaredMethod("getAccess");
|
||||||
|
ISecureTile_getOwnerName = ISecureTile.getDeclaredMethod("getOwnerName");
|
||||||
|
|
||||||
// XXX : We register the ISecureTile interface
|
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.owner");
|
||||||
try{
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerISecureTile(), ISecureTile);
|
||||||
ISecureTile = Class.forName("cofh.api.tileentity.ISecurable");
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerISecureTile(), ISecureTile);
|
||||||
ISecureTile_getAccess = ISecureTile.getDeclaredMethod("getAccess");
|
// ModuleRegistrar.instance().registerSyncedNBTKey("Owner", ISecureTile);
|
||||||
ISecureTile_getOwnerName = ISecureTile.getDeclaredMethod("getOwnerName");
|
// ModuleRegistrar.instance().registerSyncedNBTKey("Access", ISecureTile);
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.owner");
|
} catch (Exception e) {
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerISecureTile(), ISecureTile);
|
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading ISecureTile hooks." + e);
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerISecureTile(), ISecureTile);
|
}
|
||||||
//ModuleRegistrar.instance().registerSyncedNBTKey("Owner", ISecureTile);
|
|
||||||
//ModuleRegistrar.instance().registerSyncedNBTKey("Access", ISecureTile);
|
|
||||||
|
|
||||||
} catch (Exception e){
|
|
||||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading ISecureTile hooks." + e);
|
|
||||||
}
|
|
||||||
|
|
||||||
// XXX : We register the Cache interface
|
// XXX : We register the Cache interface
|
||||||
try{
|
try {
|
||||||
TileCache = Class.forName("cofh.thermalexpansion.block.cache.TileCache");
|
TileCache = Class.forName("cofh.thermalexpansion.block.cache.TileCache");
|
||||||
TileCache_getItemStack = TileCache.getDeclaredMethod("getStoredItemType");
|
TileCache_getItemStack = TileCache.getDeclaredMethod("getStoredItemType");
|
||||||
TileCache_getMaxStored = TileCache.getDeclaredMethod("getMaxStoredCount");
|
TileCache_getMaxStored = TileCache.getDeclaredMethod("getMaxStoredCount");
|
||||||
TileCache_getStored = TileCache.getDeclaredMethod("getStoredCount");
|
TileCache_getStored = TileCache.getDeclaredMethod("getStoredCount");
|
||||||
|
|
||||||
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.cache");
|
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.cache");
|
||||||
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerCache(), TileCache);
|
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerCache(), TileCache);
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerCache(), TileCache);
|
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerCache(), TileCache);
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerCache(), TileCache);
|
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerCache(), TileCache);
|
||||||
|
|
||||||
} catch (Exception e){
|
} catch (Exception e) {
|
||||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tesseract hooks." + e);
|
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tesseract hooks." + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX : We register the IBlockInfo interface
|
// XXX : We register the IBlockInfo interface
|
||||||
/*
|
/*
|
||||||
try{
|
* try{ IBlockInfo = Class.forName("cofh.api.block.IBlockInfo"); IBlockInfo_getBlockInfo =
|
||||||
IBlockInfo = Class.forName("cofh.api.block.IBlockInfo");
|
* IBlockInfo.getMethod("getBlockInfo", IBlockAccess.class, int.class, int.class, int.class,
|
||||||
IBlockInfo_getBlockInfo = IBlockInfo.getMethod("getBlockInfo", IBlockAccess.class, int.class, int.class, int.class, ForgeDirection.class, EntityPlayer.class, List.class, boolean.class);
|
* ForgeDirection.class, EntityPlayer.class, List.class, boolean.class);
|
||||||
|
* //ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energyhandler");
|
||||||
|
* ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIBlockInfo(), IBlockInfo);
|
||||||
//ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energyhandler");
|
* ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerIBlockInfo(), IBlockInfo); } catch (Exception
|
||||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIBlockInfo(), IBlockInfo);
|
* e){ Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading IBlockInfo hooks." + e); }
|
||||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerIBlockInfo(), IBlockInfo);
|
*/
|
||||||
|
}
|
||||||
} catch (Exception e){
|
|
||||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading IBlockInfo hooks." + e);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
+25
-20
@@ -7,34 +7,39 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
|
||||||
public class TwilightForestGenericOverride implements IWailaDataProvider {
|
public class TwilightForestGenericOverride implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return new ItemStack(accessor.getBlock(), 0, accessor.getMetadata());
|
return new ItemStack(accessor.getBlock(), 0, accessor.getMetadata());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
return tag;
|
int y, int z) {
|
||||||
}
|
return tag;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -7,31 +7,30 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|||||||
|
|
||||||
public class TwilightForestModule {
|
public class TwilightForestModule {
|
||||||
|
|
||||||
public static Class BlockTFRoots = null;
|
public static Class BlockTFRoots = null;
|
||||||
public static Class BlockTFPlant = null;
|
public static Class BlockTFPlant = null;
|
||||||
public static Class BlockTFSapling = null;
|
public static Class BlockTFSapling = null;
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
|
|
||||||
try{
|
try {
|
||||||
Class TwilightForestMod = Class.forName("twilightforest.TwilightForestMod");
|
Class TwilightForestMod = Class.forName("twilightforest.TwilightForestMod");
|
||||||
Waila.log.log(Level.INFO, "TwilightForestMod mod found.");
|
Waila.log.log(Level.INFO, "TwilightForestMod mod found.");
|
||||||
} catch (ClassNotFoundException e){
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.INFO, "[TwilightForestMod] TwilightForestMod mod not found.");
|
Waila.log.log(Level.INFO, "[TwilightForestMod] TwilightForestMod mod not found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
BlockTFRoots = Class.forName("twilightforest.block.BlockTFRoots");
|
BlockTFRoots = Class.forName("twilightforest.block.BlockTFRoots");
|
||||||
BlockTFPlant = Class.forName("twilightforest.block.BlockTFPlant");
|
BlockTFPlant = Class.forName("twilightforest.block.BlockTFPlant");
|
||||||
BlockTFSapling = Class.forName("twilightforest.block.BlockTFSapling");
|
BlockTFSapling = Class.forName("twilightforest.block.BlockTFSapling");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Waila.log.log(Level.WARN, "[TwilightForestMod] Class not found. " + e);
|
Waila.log.log(Level.WARN, "[TwilightForestMod] Class not found. " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ModuleRegistrar.instance().registerStackProvider(new TwilightForestGenericOverride(), BlockTFRoots);
|
||||||
ModuleRegistrar.instance().registerStackProvider(new TwilightForestGenericOverride(), BlockTFRoots);
|
ModuleRegistrar.instance().registerStackProvider(new TwilightForestGenericOverride(), BlockTFPlant);
|
||||||
ModuleRegistrar.instance().registerStackProvider(new TwilightForestGenericOverride(), BlockTFPlant);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@ package mcp.mobius.waila.addons.vanillamc;
|
|||||||
|
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaBlockDecorator;
|
import mcp.mobius.waila.api.IWailaBlockDecorator;
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
@@ -9,16 +10,17 @@ import mcp.mobius.waila.gui.helpers.UIHelper;
|
|||||||
|
|
||||||
public class HUDDecoratorVanilla implements IWailaBlockDecorator {
|
public class HUDDecoratorVanilla implements IWailaBlockDecorator {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void decorateBlock(ItemStack itemStack, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public void decorateBlock(ItemStack itemStack, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
|
|
||||||
Tessellator tessellator = Tessellator.instance;
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
//UIHelper.drawBillboardText(itemStack.getDisplayName(), accessor.getRenderingPosition(), 0.5F, 1.5F, 0.5F, accessor.getPartialFrame());
|
// UIHelper.drawBillboardText(itemStack.getDisplayName(), accessor.getRenderingPosition(), 0.5F, 1.5F, 0.5F,
|
||||||
UIHelper.drawFloatingText("IN", accessor.getRenderingPosition(), 0.5F, 0.2F, -0.2F, 90F, 0F, 0F);
|
// accessor.getPartialFrame());
|
||||||
UIHelper.drawFloatingText("OUT", accessor.getRenderingPosition(), -0.2F, 0.2F, 0.5F, 90F, 90F, 0F);
|
UIHelper.drawFloatingText("IN", accessor.getRenderingPosition(), 0.5F, 0.2F, -0.2F, 90F, 0F, 0F);
|
||||||
UIHelper.drawFloatingText("OUT", accessor.getRenderingPosition(), 1.2F, 0.2F, 0.5F, 90F, -90F, 0F);
|
UIHelper.drawFloatingText("OUT", accessor.getRenderingPosition(), -0.2F, 0.2F, 0.5F, 90F, 90F, 0F);
|
||||||
UIHelper.drawFloatingText("OUT", accessor.getRenderingPosition(), 0.5F, 0.2F, 1.2F, 90F, -180F, 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 offset = 0.1;
|
||||||
double delta = 1 + 2 * offset;
|
double delta = 1 + 2 * offset;
|
||||||
@@ -31,49 +33,48 @@ Tessellator tessellator = Tessellator.instance;
|
|||||||
|
|
||||||
tessellator.setColorRGBA(255, 255, 255, 150);
|
tessellator.setColorRGBA(255, 255, 255, 150);
|
||||||
|
|
||||||
tessellator.addVertex(x, y + 0.2 , z);
|
tessellator.addVertex(x, y + 0.2, z);
|
||||||
tessellator.addVertex(x, y + 0.2 , z + delta/2 - 0.1);
|
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 + delta / 2 - 0.1);
|
||||||
tessellator.addVertex(x + offset, y + 0.2, z);
|
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 / 2 + 0.1);
|
||||||
tessellator.addVertex(x, y + 0.2 , z + delta);
|
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);
|
||||||
tessellator.addVertex(x + offset, y + 0.2, z + delta/2 + 0.1);
|
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 + 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 / 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 + delta / 2 - 0.1);
|
||||||
tessellator.addVertex(x + delta + offset - 0.1, y + 0.2, z + 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 / 2 + 0.1);
|
||||||
tessellator.addVertex(x + delta - 0.1, y + 0.2 , z + delta);
|
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);
|
||||||
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 + 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+ 0.1, y + 0.2, z);
|
tessellator.addVertex(x + delta / 2 + 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+ offset);
|
tessellator.addVertex(x + delta, y + 0.2, z + offset);
|
||||||
tessellator.addVertex(x+ delta/2 - 0.1, y + 0.2, z);
|
tessellator.addVertex(x + delta, y + 0.2, z);
|
||||||
|
|
||||||
tessellator.addVertex(x+ delta/2 + 0.1, y + 0.2, z);
|
tessellator.addVertex(x + 0.1, y + 0.2, z + delta - 0.1);
|
||||||
tessellator.addVertex(x+ delta/2 + 0.1, y + 0.2, z+ offset);
|
tessellator.addVertex(x + 0.1, y + 0.2, z + offset + delta - 0.1);
|
||||||
tessellator.addVertex(x+ delta, y + 0.2, z+ offset);
|
tessellator.addVertex(x + delta / 2 - 0.1, y + 0.2, z + offset + delta - 0.1);
|
||||||
tessellator.addVertex(x+ delta, y + 0.2, z);
|
tessellator.addVertex(x + delta / 2 - 0.1, y + 0.2, z + delta - 0.1);
|
||||||
|
|
||||||
tessellator.addVertex(x + 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 + 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+ offset+ delta - 0.1);
|
tessellator.addVertex(x + delta - 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 - 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();
|
tessellator.draw();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,77 +2,93 @@ package mcp.mobius.waila.addons.vanillamc;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameData;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.inventory.ISidedInventory;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.nbt.NBTTagList;
|
import net.minecraft.nbt.NBTTagList;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.tileentity.TileEntityFurnace;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.registry.GameData;
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
import mcp.mobius.waila.api.SpecialChars;
|
import mcp.mobius.waila.api.SpecialChars;
|
||||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
|
||||||
|
|
||||||
public class HUDHandlerFurnace implements IWailaDataProvider {
|
public class HUDHandlerFurnace implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
int cookTime = accessor.getNBTData().getShort("CookTime");
|
IWailaConfigHandler config) {
|
||||||
NBTTagList tag = accessor.getNBTData().getTagList("Items", 10);
|
int cookTime = accessor.getNBTData().getShort("CookTime");
|
||||||
|
NBTTagList tag = accessor.getNBTData().getTagList("Items", 10);
|
||||||
|
|
||||||
String renderStr = "";
|
String renderStr = "";
|
||||||
{
|
{
|
||||||
ItemStack stack = ItemStack.loadItemStackFromNBT(tag.getCompoundTagAt(0));
|
ItemStack stack = ItemStack.loadItemStackFromNBT(tag.getCompoundTagAt(0));
|
||||||
String name = GameData.getItemRegistry().getNameForObject(stack.getItem());
|
String name = GameData.getItemRegistry().getNameForObject(stack.getItem());
|
||||||
renderStr += SpecialChars.getRenderString("waila.stack", "1", name, String.valueOf(stack.stackSize), String.valueOf(stack.getItemDamage()));
|
renderStr += SpecialChars.getRenderString(
|
||||||
}
|
"waila.stack",
|
||||||
{
|
"1",
|
||||||
ItemStack stack = ItemStack.loadItemStackFromNBT(tag.getCompoundTagAt(1));
|
name,
|
||||||
String name = GameData.getItemRegistry().getNameForObject(stack.getItem());
|
String.valueOf(stack.stackSize),
|
||||||
renderStr += SpecialChars.getRenderString("waila.stack", "1", name, String.valueOf(stack.stackSize), String.valueOf(stack.getItemDamage()));
|
String.valueOf(stack.getItemDamage()));
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
ItemStack stack = ItemStack.loadItemStackFromNBT(tag.getCompoundTagAt(1));
|
||||||
|
String name = GameData.getItemRegistry().getNameForObject(stack.getItem());
|
||||||
|
renderStr += SpecialChars.getRenderString(
|
||||||
|
"waila.stack",
|
||||||
|
"1",
|
||||||
|
name,
|
||||||
|
String.valueOf(stack.stackSize),
|
||||||
|
String.valueOf(stack.getItemDamage()));
|
||||||
|
}
|
||||||
|
|
||||||
renderStr += SpecialChars.getRenderString("waila.progress", String.valueOf(cookTime), String.valueOf(200));
|
renderStr += SpecialChars.getRenderString("waila.progress", String.valueOf(cookTime), String.valueOf(200));
|
||||||
|
|
||||||
{
|
{
|
||||||
ItemStack stack = ItemStack.loadItemStackFromNBT(tag.getCompoundTagAt(2));
|
ItemStack stack = ItemStack.loadItemStackFromNBT(tag.getCompoundTagAt(2));
|
||||||
String name = GameData.getItemRegistry().getNameForObject(stack.getItem());
|
String name = GameData.getItemRegistry().getNameForObject(stack.getItem());
|
||||||
renderStr += SpecialChars.getRenderString("waila.stack", "1", name, String.valueOf(stack.stackSize), String.valueOf(stack.getItemDamage()));
|
renderStr += SpecialChars.getRenderString(
|
||||||
}
|
"waila.stack",
|
||||||
|
"1",
|
||||||
|
name,
|
||||||
|
String.valueOf(stack.stackSize),
|
||||||
|
String.valueOf(stack.getItemDamage()));
|
||||||
|
}
|
||||||
|
|
||||||
currenttip.add(renderStr);
|
currenttip.add(renderStr);
|
||||||
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
if (te != null)
|
int y, int z) {
|
||||||
te.writeToNBT(tag);
|
if (te != null) te.writeToNBT(tag);
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
//ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerFurnace(), TileEntityFurnace.class);
|
// ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerFurnace(), TileEntityFurnace.class);
|
||||||
//ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerFurnace(), TileEntityFurnace.class);
|
// ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerFurnace(), TileEntityFurnace.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,6 +12,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.tileentity.TileEntityMobSpawner;
|
import net.minecraft.tileentity.TileEntityMobSpawner;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
@@ -21,271 +22,271 @@ import mcp.mobius.waila.cbcore.LangUtil;
|
|||||||
|
|
||||||
public class HUDHandlerVanilla implements IWailaDataProvider {
|
public class HUDHandlerVanilla implements IWailaDataProvider {
|
||||||
|
|
||||||
static Block mobSpawner = Blocks.mob_spawner;
|
static Block mobSpawner = Blocks.mob_spawner;
|
||||||
static Block crops = Blocks.wheat;
|
static Block crops = Blocks.wheat;
|
||||||
static Block melonStem = Blocks.melon_stem;
|
static Block melonStem = Blocks.melon_stem;
|
||||||
static Block pumpkinStem = Blocks.pumpkin_stem;
|
static Block pumpkinStem = Blocks.pumpkin_stem;
|
||||||
static Block carrot = Blocks.carrots;
|
static Block carrot = Blocks.carrots;
|
||||||
static Block potato = Blocks.potatoes;
|
static Block potato = Blocks.potatoes;
|
||||||
static Block lever = Blocks.lever;
|
static Block lever = Blocks.lever;
|
||||||
static Block repeaterIdle = Blocks.unpowered_repeater;
|
static Block repeaterIdle = Blocks.unpowered_repeater;
|
||||||
static Block repeaterActv = Blocks.powered_repeater;
|
static Block repeaterActv = Blocks.powered_repeater;
|
||||||
static Block comparatorIdl = Blocks.unpowered_comparator;
|
static Block comparatorIdl = Blocks.unpowered_comparator;
|
||||||
static Block comparatorAct = Blocks.powered_comparator;
|
static Block comparatorAct = Blocks.powered_comparator;
|
||||||
static Block redstone = Blocks.redstone_wire;
|
static Block redstone = Blocks.redstone_wire;
|
||||||
static Block jukebox = Blocks.jukebox;
|
static Block jukebox = Blocks.jukebox;
|
||||||
static Block cocoa = Blocks.cocoa;
|
static Block cocoa = Blocks.cocoa;
|
||||||
static Block netherwart = Blocks.nether_wart;
|
static Block netherwart = Blocks.nether_wart;
|
||||||
static Block silverfish = Blocks.monster_egg;
|
static Block silverfish = Blocks.monster_egg;
|
||||||
static Block doubleplant = Blocks.double_plant;
|
static Block doubleplant = Blocks.double_plant;
|
||||||
static Block leave = Blocks.leaves;
|
static Block leave = Blocks.leaves;
|
||||||
static Block leave2 = Blocks.leaves2;
|
static Block leave2 = Blocks.leaves2;
|
||||||
static Block log = Blocks.log;
|
static Block log = Blocks.log;
|
||||||
static Block log2 = Blocks.log2;
|
static Block log2 = Blocks.log2;
|
||||||
static Block quartz = Blocks.quartz_block;
|
static Block quartz = Blocks.quartz_block;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
Block block = accessor.getBlock();
|
Block block = accessor.getBlock();
|
||||||
|
|
||||||
if (block == silverfish && config.getConfig("vanilla.silverfish")){
|
if (block == silverfish && config.getConfig("vanilla.silverfish")) {
|
||||||
int metadata = accessor.getMetadata();
|
int metadata = accessor.getMetadata();
|
||||||
switch(metadata){
|
switch (metadata) {
|
||||||
case 0:
|
case 0:
|
||||||
return new ItemStack(Blocks.stone);
|
return new ItemStack(Blocks.stone);
|
||||||
case 1:
|
case 1:
|
||||||
return new ItemStack(Blocks.cobblestone);
|
return new ItemStack(Blocks.cobblestone);
|
||||||
case 2:
|
case 2:
|
||||||
return new ItemStack(Blocks.brick_block);
|
return new ItemStack(Blocks.brick_block);
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block == redstone){
|
if (block == redstone) {
|
||||||
return new ItemStack(Items.redstone);
|
return new ItemStack(Items.redstone);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block == doubleplant && (accessor.getMetadata() & 8) != 0){
|
if (block == doubleplant && (accessor.getMetadata() & 8) != 0) {
|
||||||
int x = accessor.getPosition().blockX;
|
int x = accessor.getPosition().blockX;
|
||||||
int y = accessor.getPosition().blockY - 1;
|
int y = accessor.getPosition().blockY - 1;
|
||||||
int z = accessor.getPosition().blockZ;
|
int z = accessor.getPosition().blockZ;
|
||||||
int meta = accessor.getWorld().getBlockMetadata(x, y, z);
|
int meta = accessor.getWorld().getBlockMetadata(x, y, z);
|
||||||
|
|
||||||
return new ItemStack(doubleplant, 0, meta);
|
return new ItemStack(doubleplant, 0, meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block instanceof BlockRedstoneOre){
|
if (block instanceof BlockRedstoneOre) {
|
||||||
return new ItemStack(Blocks.redstone_ore);
|
return new ItemStack(Blocks.redstone_ore);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block == crops ){
|
if (block == crops) {
|
||||||
return new ItemStack(Items.wheat);
|
return new ItemStack(Items.wheat);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((block == leave || block == leave2) && (accessor.getMetadata() > 3)){
|
if ((block == leave || block == leave2) && (accessor.getMetadata() > 3)) {
|
||||||
return new ItemStack(block, 1, accessor.getMetadata() - 4);
|
return new ItemStack(block, 1, accessor.getMetadata() - 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block == log || block == log2){
|
if (block == log || block == log2) {
|
||||||
return new ItemStack(block, 1, accessor.getMetadata()%4);
|
return new ItemStack(block, 1, accessor.getMetadata() % 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((block == quartz) && (accessor.getMetadata() > 2)){
|
if ((block == quartz) && (accessor.getMetadata() > 2)) {
|
||||||
return new ItemStack(block, 1, 2);
|
return new ItemStack(block, 1, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
Block block = accessor.getBlock();
|
IWailaConfigHandler config) {
|
||||||
|
Block block = accessor.getBlock();
|
||||||
|
|
||||||
/* Mob spawner handler */
|
/* Mob spawner handler */
|
||||||
if (block == mobSpawner && accessor.getTileEntity() instanceof TileEntityMobSpawner && config.getConfig("vanilla.spawntype")){
|
if (block == mobSpawner && accessor.getTileEntity() instanceof TileEntityMobSpawner
|
||||||
String name = currenttip.get(0);
|
&& config.getConfig("vanilla.spawntype")) {
|
||||||
String mobname = ((TileEntityMobSpawner)accessor.getTileEntity()).func_145881_a().getEntityNameToSpawn();
|
String name = currenttip.get(0);
|
||||||
currenttip.set(0, String.format("%s (%s)", name, mobname));
|
String mobname = ((TileEntityMobSpawner) accessor.getTileEntity()).func_145881_a().getEntityNameToSpawn();
|
||||||
}
|
currenttip.set(0, String.format("%s (%s)", name, mobname));
|
||||||
|
}
|
||||||
|
|
||||||
if (block == redstone){
|
if (block == redstone) {
|
||||||
String name = currenttip.get(0).replaceFirst(String.format(" %s", accessor.getMetadata()), "");
|
String name = currenttip.get(0).replaceFirst(String.format(" %s", accessor.getMetadata()), "");
|
||||||
currenttip.set(0, name);
|
currenttip.set(0, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block == melonStem){
|
if (block == melonStem) {
|
||||||
currenttip.set(0, SpecialChars.WHITE + "Melon stem");
|
currenttip.set(0, SpecialChars.WHITE + "Melon stem");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block == pumpkinStem){
|
if (block == pumpkinStem) {
|
||||||
currenttip.set(0, SpecialChars.WHITE + "Pumpkin stem");
|
currenttip.set(0, SpecialChars.WHITE + "Pumpkin stem");
|
||||||
}
|
}
|
||||||
|
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
Block block = accessor.getBlock();
|
IWailaConfigHandler config) {
|
||||||
/* Crops */
|
Block block = accessor.getBlock();
|
||||||
boolean iscrop = crops.getClass().isInstance(block); //Done to cover all inheriting mods
|
/* Crops */
|
||||||
if (config.getConfig("general.showcrop"))
|
boolean iscrop = crops.getClass().isInstance(block); // Done to cover all inheriting mods
|
||||||
if (iscrop || block == melonStem || block == pumpkinStem || block == carrot || block == potato){
|
if (config.getConfig("general.showcrop"))
|
||||||
float growthValue = (accessor.getMetadata() / 7.0F) * 100.0F;
|
if (iscrop || block == melonStem || block == pumpkinStem || block == carrot || block == potato) {
|
||||||
if (growthValue < 100.0)
|
float growthValue = (accessor.getMetadata() / 7.0F) * 100.0F;
|
||||||
currenttip.add(String.format("%s : %.0f %%", LangUtil.translateG("hud.msg.growth"), growthValue));
|
if (growthValue < 100.0)
|
||||||
else
|
currenttip.add(String.format("%s : %.0f %%", LangUtil.translateG("hud.msg.growth"), growthValue));
|
||||||
currenttip.add(String.format("%s : %s", LangUtil.translateG("hud.msg.growth"), LangUtil.translateG("hud.msg.mature")));
|
else currenttip.add(
|
||||||
return currenttip;
|
String.format(
|
||||||
}
|
"%s : %s",
|
||||||
|
LangUtil.translateG("hud.msg.growth"),
|
||||||
|
LangUtil.translateG("hud.msg.mature")));
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
if (block == cocoa && config.getConfig("general.showcrop")){
|
if (block == cocoa && config.getConfig("general.showcrop")) {
|
||||||
|
|
||||||
float growthValue = ((accessor.getMetadata() >> 2) / 2.0F) * 100.0F;
|
float growthValue = ((accessor.getMetadata() >> 2) / 2.0F) * 100.0F;
|
||||||
if (growthValue < 100.0)
|
if (growthValue < 100.0)
|
||||||
currenttip.add(String.format("%s : %.0f %%", LangUtil.translateG("hud.msg.growth"), growthValue));
|
currenttip.add(String.format("%s : %.0f %%", LangUtil.translateG("hud.msg.growth"), growthValue));
|
||||||
else
|
else currenttip.add(
|
||||||
currenttip.add(String.format("%s : %s", LangUtil.translateG("hud.msg.growth"), LangUtil.translateG("hud.msg.mature")));
|
String.format(
|
||||||
return currenttip;
|
"%s : %s",
|
||||||
}
|
LangUtil.translateG("hud.msg.growth"),
|
||||||
|
LangUtil.translateG("hud.msg.mature")));
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
if (block == netherwart && config.getConfig("general.showcrop")){
|
if (block == netherwart && config.getConfig("general.showcrop")) {
|
||||||
float growthValue = (accessor.getMetadata() / 3.0F) * 100.0F;
|
float growthValue = (accessor.getMetadata() / 3.0F) * 100.0F;
|
||||||
if (growthValue < 100.0)
|
if (growthValue < 100.0)
|
||||||
currenttip.add(String.format("%s : %.0f %%", LangUtil.translateG("hud.msg.growth"), growthValue));
|
currenttip.add(String.format("%s : %.0f %%", LangUtil.translateG("hud.msg.growth"), growthValue));
|
||||||
else
|
else currenttip.add(
|
||||||
currenttip.add(String.format("%s : %s", LangUtil.translateG("hud.msg.growth"), LangUtil.translateG("hud.msg.mature")));
|
String.format(
|
||||||
return currenttip;
|
"%s : %s",
|
||||||
}
|
LangUtil.translateG("hud.msg.growth"),
|
||||||
|
LangUtil.translateG("hud.msg.mature")));
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
if (config.getConfig("vanilla.leverstate"))
|
if (config.getConfig("vanilla.leverstate")) if (block == lever) {
|
||||||
if (block == lever){
|
String redstoneOn = (accessor.getMetadata() & 8) == 0 ? LangUtil.translateG("hud.msg.off")
|
||||||
String redstoneOn = (accessor.getMetadata() & 8) == 0 ? LangUtil.translateG("hud.msg.off") : LangUtil.translateG("hud.msg.on");
|
: LangUtil.translateG("hud.msg.on");
|
||||||
currenttip.add(String.format("%s : %s", LangUtil.translateG("hud.msg.state"), redstoneOn));
|
currenttip.add(String.format("%s : %s", LangUtil.translateG("hud.msg.state"), redstoneOn));
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.getConfig("vanilla.repeater"))
|
if (config.getConfig("vanilla.repeater")) if ((block == repeaterIdle) || (block == repeaterActv)) {
|
||||||
if ((block == repeaterIdle) ||(block == repeaterActv)){
|
int tick = (accessor.getMetadata() >> 2) + 1;
|
||||||
int tick = (accessor.getMetadata() >> 2) + 1 ;
|
if (tick == 1) currenttip.add(String.format("%s : %s tick", LangUtil.translateG("hud.msg.delay"), tick));
|
||||||
if (tick == 1)
|
else currenttip.add(String.format("%s : %s ticks", LangUtil.translateG("hud.msg.delay"), tick));
|
||||||
currenttip.add(String.format("%s : %s tick", LangUtil.translateG("hud.msg.delay"), tick));
|
return currenttip;
|
||||||
else
|
}
|
||||||
currenttip.add(String.format("%s : %s ticks", LangUtil.translateG("hud.msg.delay"), tick));
|
|
||||||
return currenttip;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config.getConfig("vanilla.comparator"))
|
if (config.getConfig("vanilla.comparator")) if ((block == comparatorIdl) || (block == comparatorAct)) {
|
||||||
if ((block == comparatorIdl) ||(block == comparatorAct)){
|
String mode = ((accessor.getMetadata() >> 2) & 1) == 0 ? LangUtil.translateG("hud.msg.comparator")
|
||||||
String mode = ((accessor.getMetadata() >> 2) & 1) == 0 ? LangUtil.translateG("hud.msg.comparator") : LangUtil.translateG("hud.msg.substractor");
|
: LangUtil.translateG("hud.msg.substractor");
|
||||||
//int outputSignal = ((TileEntityComparator)entity).func_96100_a();
|
// int outputSignal = ((TileEntityComparator)entity).func_96100_a();
|
||||||
currenttip.add("Mode : " + mode);
|
currenttip.add("Mode : " + mode);
|
||||||
//currenttip.add(String.format("Out : %s", outputSignal));
|
// currenttip.add(String.format("Out : %s", outputSignal));
|
||||||
return currenttip;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.getConfig("vanilla.redstone"))
|
if (config.getConfig("vanilla.redstone")) if (block == redstone) {
|
||||||
if (block == redstone){
|
currenttip.add(String.format("%s : %s", LangUtil.translateG("hud.msg.power"), accessor.getMetadata()));
|
||||||
currenttip.add(String.format("%s : %s" , LangUtil.translateG("hud.msg.power"), accessor.getMetadata()));
|
return currenttip;
|
||||||
return currenttip;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (config.getConfig("vanilla.jukebox"))
|
* if (config.getConfig("vanilla.jukebox")) if (block == jukebox){ NBTTagCompound tag = accessor.getNBTData();
|
||||||
if (block == jukebox){
|
* Item record = null; if (tag.hasKey("Record")){ record = Item.itemsList[accessor.getNBTInteger(tag,
|
||||||
NBTTagCompound tag = accessor.getNBTData();
|
* "Record")]; currenttip.add(((ItemRecord)record).getRecordTitle()); } else {
|
||||||
Item record = null;
|
* currenttip.add(LangUtil.translateG("hud.msg.empty")); } }
|
||||||
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;
|
return currenttip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
return currenttip;
|
IWailaConfigHandler config) {
|
||||||
}
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||||
if (te != null)
|
int y, int z) {
|
||||||
te.writeToNBT(tag);
|
if (te != null) te.writeToNBT(tag);
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void register(){
|
public static void register() {
|
||||||
ModuleRegistrar.instance().addConfig("VanillaMC", "vanilla.spawntype");
|
ModuleRegistrar.instance().addConfig("VanillaMC", "vanilla.spawntype");
|
||||||
ModuleRegistrar.instance().addConfig("VanillaMC", "vanilla.leverstate");
|
ModuleRegistrar.instance().addConfig("VanillaMC", "vanilla.leverstate");
|
||||||
ModuleRegistrar.instance().addConfig("VanillaMC", "vanilla.repeater");
|
ModuleRegistrar.instance().addConfig("VanillaMC", "vanilla.repeater");
|
||||||
ModuleRegistrar.instance().addConfig("VanillaMC", "vanilla.comparator");
|
ModuleRegistrar.instance().addConfig("VanillaMC", "vanilla.comparator");
|
||||||
ModuleRegistrar.instance().addConfig("VanillaMC", "vanilla.redstone");
|
ModuleRegistrar.instance().addConfig("VanillaMC", "vanilla.redstone");
|
||||||
ModuleRegistrar.instance().addConfig("VanillaMC", "vanilla.silverfish");
|
ModuleRegistrar.instance().addConfig("VanillaMC", "vanilla.silverfish");
|
||||||
ModuleRegistrar.instance().addConfigRemote("VanillaMC", "vanilla.jukebox");
|
ModuleRegistrar.instance().addConfigRemote("VanillaMC", "vanilla.jukebox");
|
||||||
|
|
||||||
IWailaDataProvider provider = new HUDHandlerVanilla();
|
IWailaDataProvider provider = new HUDHandlerVanilla();
|
||||||
|
|
||||||
ModuleRegistrar.instance().registerStackProvider(provider, silverfish.getClass());
|
ModuleRegistrar.instance().registerStackProvider(provider, silverfish.getClass());
|
||||||
ModuleRegistrar.instance().registerStackProvider(provider, redstone.getClass());
|
ModuleRegistrar.instance().registerStackProvider(provider, redstone.getClass());
|
||||||
ModuleRegistrar.instance().registerStackProvider(provider, doubleplant.getClass());
|
ModuleRegistrar.instance().registerStackProvider(provider, doubleplant.getClass());
|
||||||
ModuleRegistrar.instance().registerStackProvider(provider, BlockRedstoneOre.class);
|
ModuleRegistrar.instance().registerStackProvider(provider, BlockRedstoneOre.class);
|
||||||
ModuleRegistrar.instance().registerStackProvider(provider, crops.getClass());
|
ModuleRegistrar.instance().registerStackProvider(provider, crops.getClass());
|
||||||
ModuleRegistrar.instance().registerStackProvider(provider, leave.getClass());
|
ModuleRegistrar.instance().registerStackProvider(provider, leave.getClass());
|
||||||
ModuleRegistrar.instance().registerStackProvider(provider, leave2.getClass());
|
ModuleRegistrar.instance().registerStackProvider(provider, leave2.getClass());
|
||||||
ModuleRegistrar.instance().registerStackProvider(provider, log.getClass());
|
ModuleRegistrar.instance().registerStackProvider(provider, log.getClass());
|
||||||
ModuleRegistrar.instance().registerStackProvider(provider, log2.getClass());
|
ModuleRegistrar.instance().registerStackProvider(provider, log2.getClass());
|
||||||
ModuleRegistrar.instance().registerStackProvider(provider, quartz.getClass());
|
ModuleRegistrar.instance().registerStackProvider(provider, quartz.getClass());
|
||||||
|
|
||||||
//ModuleRegistrar.instance().registerStackProvider(provider, Block.class);
|
// ModuleRegistrar.instance().registerStackProvider(provider, Block.class);
|
||||||
ModuleRegistrar.instance().registerHeadProvider(provider, mobSpawner.getClass());
|
ModuleRegistrar.instance().registerHeadProvider(provider, mobSpawner.getClass());
|
||||||
ModuleRegistrar.instance().registerHeadProvider(provider, melonStem.getClass());
|
ModuleRegistrar.instance().registerHeadProvider(provider, melonStem.getClass());
|
||||||
ModuleRegistrar.instance().registerHeadProvider(provider, pumpkinStem.getClass());
|
ModuleRegistrar.instance().registerHeadProvider(provider, pumpkinStem.getClass());
|
||||||
|
|
||||||
ModuleRegistrar.instance().registerBodyProvider(provider, crops.getClass());
|
ModuleRegistrar.instance().registerBodyProvider(provider, crops.getClass());
|
||||||
ModuleRegistrar.instance().registerBodyProvider(provider, melonStem.getClass());
|
ModuleRegistrar.instance().registerBodyProvider(provider, melonStem.getClass());
|
||||||
ModuleRegistrar.instance().registerBodyProvider(provider, pumpkinStem.getClass());
|
ModuleRegistrar.instance().registerBodyProvider(provider, pumpkinStem.getClass());
|
||||||
//ModuleRegistrar.instance().registerBodyProvider(provider, carrot.getClass());
|
// ModuleRegistrar.instance().registerBodyProvider(provider, carrot.getClass());
|
||||||
//ModuleRegistrar.instance().registerBodyProvider(provider, potato.getClass());
|
// ModuleRegistrar.instance().registerBodyProvider(provider, potato.getClass());
|
||||||
ModuleRegistrar.instance().registerBodyProvider(provider, lever.getClass());
|
ModuleRegistrar.instance().registerBodyProvider(provider, lever.getClass());
|
||||||
ModuleRegistrar.instance().registerBodyProvider(provider, repeaterIdle.getClass());
|
ModuleRegistrar.instance().registerBodyProvider(provider, repeaterIdle.getClass());
|
||||||
ModuleRegistrar.instance().registerBodyProvider(provider, repeaterActv.getClass());
|
ModuleRegistrar.instance().registerBodyProvider(provider, repeaterActv.getClass());
|
||||||
ModuleRegistrar.instance().registerBodyProvider(provider, comparatorIdl.getClass());
|
ModuleRegistrar.instance().registerBodyProvider(provider, comparatorIdl.getClass());
|
||||||
ModuleRegistrar.instance().registerBodyProvider(provider, comparatorAct.getClass());
|
ModuleRegistrar.instance().registerBodyProvider(provider, comparatorAct.getClass());
|
||||||
ModuleRegistrar.instance().registerHeadProvider(provider, redstone.getClass());
|
ModuleRegistrar.instance().registerHeadProvider(provider, redstone.getClass());
|
||||||
ModuleRegistrar.instance().registerBodyProvider(provider, redstone.getClass());
|
ModuleRegistrar.instance().registerBodyProvider(provider, redstone.getClass());
|
||||||
ModuleRegistrar.instance().registerBodyProvider(provider, jukebox.getClass());
|
ModuleRegistrar.instance().registerBodyProvider(provider, jukebox.getClass());
|
||||||
ModuleRegistrar.instance().registerBodyProvider(provider, cocoa.getClass());
|
ModuleRegistrar.instance().registerBodyProvider(provider, cocoa.getClass());
|
||||||
ModuleRegistrar.instance().registerBodyProvider(provider, netherwart.getClass());
|
ModuleRegistrar.instance().registerBodyProvider(provider, netherwart.getClass());
|
||||||
|
|
||||||
ModuleRegistrar.instance().registerNBTProvider(provider, mobSpawner.getClass());
|
ModuleRegistrar.instance().registerNBTProvider(provider, mobSpawner.getClass());
|
||||||
ModuleRegistrar.instance().registerNBTProvider(provider, crops.getClass());
|
ModuleRegistrar.instance().registerNBTProvider(provider, crops.getClass());
|
||||||
ModuleRegistrar.instance().registerNBTProvider(provider, melonStem.getClass());
|
ModuleRegistrar.instance().registerNBTProvider(provider, melonStem.getClass());
|
||||||
ModuleRegistrar.instance().registerNBTProvider(provider, pumpkinStem.getClass());
|
ModuleRegistrar.instance().registerNBTProvider(provider, pumpkinStem.getClass());
|
||||||
ModuleRegistrar.instance().registerNBTProvider(provider, carrot.getClass());
|
ModuleRegistrar.instance().registerNBTProvider(provider, carrot.getClass());
|
||||||
ModuleRegistrar.instance().registerNBTProvider(provider, potato.getClass());
|
ModuleRegistrar.instance().registerNBTProvider(provider, potato.getClass());
|
||||||
ModuleRegistrar.instance().registerNBTProvider(provider, lever.getClass());
|
ModuleRegistrar.instance().registerNBTProvider(provider, lever.getClass());
|
||||||
ModuleRegistrar.instance().registerNBTProvider(provider, repeaterIdle.getClass());
|
ModuleRegistrar.instance().registerNBTProvider(provider, repeaterIdle.getClass());
|
||||||
ModuleRegistrar.instance().registerNBTProvider(provider, repeaterActv.getClass());
|
ModuleRegistrar.instance().registerNBTProvider(provider, repeaterActv.getClass());
|
||||||
ModuleRegistrar.instance().registerNBTProvider(provider, comparatorIdl.getClass());
|
ModuleRegistrar.instance().registerNBTProvider(provider, comparatorIdl.getClass());
|
||||||
ModuleRegistrar.instance().registerNBTProvider(provider, comparatorAct.getClass());
|
ModuleRegistrar.instance().registerNBTProvider(provider, comparatorAct.getClass());
|
||||||
ModuleRegistrar.instance().registerNBTProvider(provider, redstone.getClass());
|
ModuleRegistrar.instance().registerNBTProvider(provider, redstone.getClass());
|
||||||
ModuleRegistrar.instance().registerNBTProvider(provider, jukebox.getClass());
|
ModuleRegistrar.instance().registerNBTProvider(provider, jukebox.getClass());
|
||||||
ModuleRegistrar.instance().registerNBTProvider(provider, cocoa.getClass());
|
ModuleRegistrar.instance().registerNBTProvider(provider, cocoa.getClass());
|
||||||
ModuleRegistrar.instance().registerNBTProvider(provider, netherwart.getClass());
|
ModuleRegistrar.instance().registerNBTProvider(provider, netherwart.getClass());
|
||||||
ModuleRegistrar.instance().registerNBTProvider(provider, silverfish.getClass());
|
ModuleRegistrar.instance().registerNBTProvider(provider, silverfish.getClass());
|
||||||
|
|
||||||
//ModuleRegistrar.instance().registerDocTextFile("/mcp/mobius/waila/addons/vanillamc/WikiData.csv");
|
|
||||||
|
|
||||||
//ExternalModulesHandler.instance().registerBlockDecorator(new HUDDecoratorVanilla(), repeaterIdle);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// ModuleRegistrar.instance().registerDocTextFile("/mcp/mobius/waila/addons/vanillamc/WikiData.csv");
|
||||||
|
|
||||||
|
// ExternalModulesHandler.instance().registerBlockDecorator(new HUDDecoratorVanilla(), repeaterIdle);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,21 +1,30 @@
|
|||||||
package mcp.mobius.waila.api;
|
package mcp.mobius.waila.api;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.Map.Entry;
|
|
||||||
|
|
||||||
public interface ITaggedList<E, T> extends List<E> {
|
public interface ITaggedList<E, T> extends List<E> {
|
||||||
public boolean add(E e, T tag);
|
|
||||||
public boolean add(E e, Collection<? extends T> taglst);
|
public boolean add(E e, T tag);
|
||||||
public Set<T> getTags(E e);
|
|
||||||
public Set<T> getTags(int index);
|
public boolean add(E e, Collection<? extends T> taglst);
|
||||||
public void addTag(E e, T tag);
|
|
||||||
public void addTag(int index, T tag);
|
public Set<T> getTags(E e);
|
||||||
public void removeTag(E e, T tag);
|
|
||||||
public void removeTag(int index, T tag);
|
public Set<T> getTags(int index);
|
||||||
public Set<E> getEntries(T tag);
|
|
||||||
public void removeEntries(T tag);
|
public void addTag(E e, T tag);
|
||||||
public String getTagsAsString(E e);
|
|
||||||
|
public void addTag(int index, T tag);
|
||||||
|
|
||||||
|
public void removeTag(E e, T tag);
|
||||||
|
|
||||||
|
public void removeTag(int index, T tag);
|
||||||
|
|
||||||
|
public Set<E> getEntries(T tag);
|
||||||
|
|
||||||
|
public void removeEntries(T tag);
|
||||||
|
|
||||||
|
public String getTagsAsString(E e);
|
||||||
}
|
}
|
||||||
@@ -6,29 +6,35 @@ import net.minecraft.item.ItemStack;
|
|||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public interface IWailaBlock {
|
public interface IWailaBlock {
|
||||||
/*
|
|
||||||
* Use this method to return an item stack in case the default lookup system fails.
|
|
||||||
* Return null if you want to use the default lookup system.
|
|
||||||
* You get the world, the player and the location of the block. With that, it is easy to gather information & tile entities
|
|
||||||
*/
|
|
||||||
ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config);
|
|
||||||
|
|
||||||
/* Waila HUD is divided into 3 zones. The head corresponds to the item name,
|
/*
|
||||||
* body to where you mostly want to put informations, and I reserve the tail for modname display
|
* Use this method to return an item stack in case the default lookup system fails. Return null if you want to use
|
||||||
*/
|
* the default lookup system. You get the world, the player and the location of the block. With that, it is easy to
|
||||||
|
* gather information & tile entities
|
||||||
|
*/
|
||||||
|
ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config);
|
||||||
|
|
||||||
/* Those 2 methods works exactly the same way, except they are related to a different zone in Waila HUD.
|
/*
|
||||||
* You get in input world, player and the block location. You also get the itemstack as returned by the default lookup system or getWailaStack().
|
* Waila HUD is divided into 3 zones. The head corresponds to the item name, body to where you mostly want to put
|
||||||
* ConfigHandler provides the current Waila config state so you can show/hide elements depending on the configuration. Refer the ConfigHandler class for more info.
|
* informations, and I reserve the tail for modname display
|
||||||
* currenttip represents the current list of text lines in the tooltip zone.
|
*/
|
||||||
* For example, getWailaHead() will have the current item name as currenttip.
|
|
||||||
* You can modify the tips, add more, remove some, etc.
|
|
||||||
* When you are done, just returns the currenttip and it will display in Waila.
|
|
||||||
*
|
|
||||||
* Always return the currenttip is you don't want to modify the current zone.
|
|
||||||
*/
|
|
||||||
|
|
||||||
List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
|
/*
|
||||||
List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
|
* Those 2 methods works exactly the same way, except they are related to a different zone in Waila HUD. You get in
|
||||||
List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
|
* input world, player and the block location. You also get the itemstack as returned by the default lookup system
|
||||||
|
* or getWailaStack(). ConfigHandler provides the current Waila config state so you can show/hide elements depending
|
||||||
|
* on the configuration. Refer the ConfigHandler class for more info. currenttip represents the current list of text
|
||||||
|
* lines in the tooltip zone. For example, getWailaHead() will have the current item name as currenttip. You can
|
||||||
|
* modify the tips, add more, remove some, etc. When you are done, just returns the currenttip and it will display
|
||||||
|
* in Waila. Always return the currenttip is you don't want to modify the current zone.
|
||||||
|
*/
|
||||||
|
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
@@ -7,18 +7,20 @@ import net.minecraft.item.ItemStack;
|
|||||||
* All methods in this interface shouldn't to be called by the implementing mod. An instance of the class is to be
|
* All methods in this interface shouldn't to be called by the implementing mod. An instance of the class is to be
|
||||||
* registered to Waila via the {@link IWailaRegistrar} instance provided in the original registration callback method
|
* registered to Waila via the {@link IWailaRegistrar} instance provided in the original registration callback method
|
||||||
* (cf. {@link IWailaRegistrar} documentation for more information).
|
* (cf. {@link IWailaRegistrar} documentation for more information).
|
||||||
|
*
|
||||||
* @author ProfMobius
|
* @author ProfMobius
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface IWailaBlockDecorator {
|
public interface IWailaBlockDecorator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback for the decorator. It provides a standard GL stack positioned on the block.</br>
|
* Callback for the decorator. It provides a standard GL stack positioned on the block.</br>
|
||||||
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerDecorator}.</br>
|
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerDecorator}.</br>
|
||||||
* @param itemStack Current block scanned, in ItemStack form.
|
*
|
||||||
* @param accessor Contains most of the relevant information about the current environment.
|
* @param itemStack Current block scanned, in ItemStack form.
|
||||||
* @param config Current configuration of Waila.
|
* @param accessor Contains most of the relevant information about the current environment.
|
||||||
*/
|
* @param config Current configuration of Waila.
|
||||||
void decorateBlock(ItemStack itemStack, IWailaDataAccessor accessor, IWailaConfigHandler config);
|
*/
|
||||||
|
void decorateBlock(ItemStack itemStack, IWailaDataAccessor accessor, IWailaConfigHandler config);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,26 +12,42 @@ import net.minecraft.world.World;
|
|||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Accessor is used to get some basic data out of the game without having to request direct access to the game engine.<br>
|
* The Accessor is used to get some basic data out of the game without having to request direct access to the game
|
||||||
|
* engine.<br>
|
||||||
* It will also return things that are unmodified by the overriding systems (like getWailaStack).<br>
|
* It will also return things that are unmodified by the overriding systems (like getWailaStack).<br>
|
||||||
* Common accessor for both Entity and Block/TileEntity.<br>
|
* Common accessor for both Entity and Block/TileEntity.<br>
|
||||||
* Available data depends on what it is called upon (ie : getEntity() will return null if looking at a block, etc).<br>
|
* Available data depends on what it is called upon (ie : getEntity() will return null if looking at a block, etc).<br>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface IWailaCommonAccessor {
|
public interface IWailaCommonAccessor {
|
||||||
World getWorld();
|
|
||||||
EntityPlayer getPlayer();
|
World getWorld();
|
||||||
Block getBlock();
|
|
||||||
int getBlockID();
|
EntityPlayer getPlayer();
|
||||||
String getBlockQualifiedName();
|
|
||||||
int getMetadata();
|
Block getBlock();
|
||||||
TileEntity getTileEntity();
|
|
||||||
Entity getEntity();
|
int getBlockID();
|
||||||
MovingObjectPosition getPosition();
|
|
||||||
Vec3 getRenderingPosition();
|
String getBlockQualifiedName();
|
||||||
NBTTagCompound getNBTData();
|
|
||||||
int getNBTInteger(NBTTagCompound tag, String keyname);
|
int getMetadata();
|
||||||
double getPartialFrame();
|
|
||||||
ForgeDirection getSide();
|
TileEntity getTileEntity();
|
||||||
ItemStack getStack();
|
|
||||||
|
Entity getEntity();
|
||||||
|
|
||||||
|
MovingObjectPosition getPosition();
|
||||||
|
|
||||||
|
Vec3 getRenderingPosition();
|
||||||
|
|
||||||
|
NBTTagCompound getNBTData();
|
||||||
|
|
||||||
|
int getNBTInteger(NBTTagCompound tag, String keyname);
|
||||||
|
|
||||||
|
double getPartialFrame();
|
||||||
|
|
||||||
|
ForgeDirection getSide();
|
||||||
|
|
||||||
|
ItemStack getStack();
|
||||||
}
|
}
|
||||||
@@ -5,40 +5,43 @@ import java.util.Set;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Read-only interface for Waila internal config storage.<br>
|
* Read-only interface for Waila internal config storage.<br>
|
||||||
* An instance of this interface is passed to most of Waila callbacks as a way to change the behavior depending on client settings.
|
* An instance of this interface is passed to most of Waila callbacks as a way to change the behavior depending on
|
||||||
|
* client settings.
|
||||||
*
|
*
|
||||||
* @author ProfMobius
|
* @author ProfMobius
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface IWailaConfigHandler {
|
public interface IWailaConfigHandler {
|
||||||
/** Returns a set of all the currently loaded modules in the config handler.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Set<String> getModuleNames();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all the currently available options for a given module
|
* Returns a set of all the currently loaded modules in the config handler.
|
||||||
*
|
*
|
||||||
* @param modName Module name
|
* @return
|
||||||
* @return
|
*/
|
||||||
*/
|
public Set<String> getModuleNames();
|
||||||
public HashMap<String, String> getConfigKeys(String modName);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current value of an option (true/false) with a default value if not set.
|
* Returns all the currently available options for a given module
|
||||||
*
|
*
|
||||||
* @param key Option to lookup
|
* @param modName Module name
|
||||||
* @param defvalue Default values
|
* @return
|
||||||
* @return Value of the option or defvalue if not set.
|
*/
|
||||||
*/
|
public HashMap<String, String> getConfigKeys(String modName);
|
||||||
public boolean getConfig(String key, boolean defvalue);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current value of an option (true/false) with a default value true if not set
|
* Returns the current value of an option (true/false) with a default value if not set.
|
||||||
*
|
*
|
||||||
* @param key Option to lookup
|
* @param key Option to lookup
|
||||||
* @return Value of the option or true if not set.
|
* @param defvalue Default values
|
||||||
*/
|
* @return Value of the option or defvalue if not set.
|
||||||
public boolean getConfig(String key);
|
*/
|
||||||
|
public boolean getConfig(String key, boolean defvalue);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current value of an option (true/false) with a default value true if not set
|
||||||
|
*
|
||||||
|
* @param key Option to lookup
|
||||||
|
* @return Value of the option or true if not set.
|
||||||
|
*/
|
||||||
|
public boolean getConfig(String key);
|
||||||
}
|
}
|
||||||
@@ -11,27 +11,44 @@ import net.minecraft.world.World;
|
|||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Accessor is used to get some basic data out of the game without having to request direct access to the game engine.<br>
|
* The Accessor is used to get some basic data out of the game without having to request direct access to the game
|
||||||
|
* engine.<br>
|
||||||
* It will also return things that are unmodified by the overriding systems (like getWailaStack).<br>
|
* It will also return things that are unmodified by the overriding systems (like getWailaStack).<br>
|
||||||
* An instance of this interface is passed to most of Waila Block/TileEntity callbacks.
|
* An instance of this interface is passed to most of Waila Block/TileEntity callbacks.
|
||||||
|
*
|
||||||
* @author ProfMobius
|
* @author ProfMobius
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface IWailaDataAccessor{
|
public interface IWailaDataAccessor {
|
||||||
|
|
||||||
World getWorld();
|
World getWorld();
|
||||||
EntityPlayer getPlayer();
|
|
||||||
Block getBlock();
|
EntityPlayer getPlayer();
|
||||||
int getBlockID();
|
|
||||||
String getBlockQualifiedName();
|
Block getBlock();
|
||||||
int getMetadata();
|
|
||||||
TileEntity getTileEntity();
|
int getBlockID();
|
||||||
MovingObjectPosition getPosition();
|
|
||||||
Vec3 getRenderingPosition();
|
String getBlockQualifiedName();
|
||||||
NBTTagCompound getNBTData();
|
|
||||||
int getNBTInteger(NBTTagCompound tag, String keyname);
|
int getMetadata();
|
||||||
double getPartialFrame();
|
|
||||||
ForgeDirection getSide();
|
TileEntity getTileEntity();
|
||||||
ItemStack getStack();
|
|
||||||
|
MovingObjectPosition getPosition();
|
||||||
|
|
||||||
|
Vec3 getRenderingPosition();
|
||||||
|
|
||||||
|
NBTTagCompound getNBTData();
|
||||||
|
|
||||||
|
int getNBTInteger(NBTTagCompound tag, String keyname);
|
||||||
|
|
||||||
|
double getPartialFrame();
|
||||||
|
|
||||||
|
ForgeDirection getSide();
|
||||||
|
|
||||||
|
ItemStack getStack();
|
||||||
|
|
||||||
|
float getBlockBreakDamage();
|
||||||
}
|
}
|
||||||
@@ -13,71 +13,87 @@ import net.minecraft.world.World;
|
|||||||
* All methods in this interface shouldn't to be called by the implementing mod. An instance of the class is to be
|
* All methods in this interface shouldn't to be called by the implementing mod. An instance of the class is to be
|
||||||
* registered to Waila via the {@link IWailaRegistrar} instance provided in the original registration callback method
|
* registered to Waila via the {@link IWailaRegistrar} instance provided in the original registration callback method
|
||||||
* (cf. {@link IWailaRegistrar} documentation for more information).
|
* (cf. {@link IWailaRegistrar} documentation for more information).
|
||||||
|
*
|
||||||
* @author ProfMobius
|
* @author ProfMobius
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface IWailaDataProvider{
|
public interface IWailaDataProvider {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback used to override the default Waila lookup system.</br>
|
* Callback used to override the default Waila lookup system.</br>
|
||||||
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerStackProvider}.</br>
|
* Will be used if the implementing class is registered via
|
||||||
* @param accessor Contains most of the relevant information about the current environment.
|
* {@link IWailaRegistrar}.{@link registerStackProvider}.</br>
|
||||||
* @param config Current configuration of Waila.
|
*
|
||||||
* @return null if override is not required, an ItemStack otherwise.
|
* @param accessor Contains most of the relevant information about the current environment.
|
||||||
*/
|
* @param config Current configuration of Waila.
|
||||||
ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config);
|
* @return null if override is not required, an ItemStack otherwise.
|
||||||
|
*/
|
||||||
|
ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
|
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
|
||||||
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerHeadProvider} client side.</br>
|
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerHeadProvider}
|
||||||
* You are supposed to always return the modified input currenttip.</br>
|
* client side.</br>
|
||||||
*
|
* You are supposed to always return the modified input currenttip.</br>
|
||||||
* @param itemStack Current block scanned, in ItemStack form.
|
*
|
||||||
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers).
|
* @param itemStack Current block scanned, in ItemStack form.
|
||||||
* @param accessor Contains most of the relevant information about the current environment.
|
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be
|
||||||
* @param config Current configuration of Waila.
|
* processed by other providers).
|
||||||
* @return Modified input currenttip
|
* @param accessor Contains most of the relevant information about the current environment.
|
||||||
*/
|
* @param config Current configuration of Waila.
|
||||||
List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
|
* @return Modified input currenttip
|
||||||
|
*/
|
||||||
|
List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
|
IWailaConfigHandler config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
|
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
|
||||||
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerBodyProvider} client side.</br>
|
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerBodyProvider}
|
||||||
* You are supposed to always return the modified input currenttip.</br>
|
* client side.</br>
|
||||||
*
|
* You are supposed to always return the modified input currenttip.</br>
|
||||||
* @param itemStack Current block scanned, in ItemStack form.
|
*
|
||||||
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers).
|
* @param itemStack Current block scanned, in ItemStack form.
|
||||||
* @param accessor Contains most of the relevant information about the current environment.
|
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be
|
||||||
* @param config Current configuration of Waila.
|
* processed by other providers).
|
||||||
* @return Modified input currenttip
|
* @param accessor Contains most of the relevant information about the current environment.
|
||||||
*/
|
* @param config Current configuration of Waila.
|
||||||
List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
|
* @return Modified input currenttip
|
||||||
|
*/
|
||||||
|
List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
|
IWailaConfigHandler config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
|
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
|
||||||
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerTailProvider} client side.</br>
|
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerTailProvider}
|
||||||
* You are supposed to always return the modified input currenttip.</br>
|
* client side.</br>
|
||||||
*
|
* You are supposed to always return the modified input currenttip.</br>
|
||||||
* @param itemStack Current block scanned, in ItemStack form.
|
*
|
||||||
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers).
|
* @param itemStack Current block scanned, in ItemStack form.
|
||||||
* @param accessor Contains most of the relevant information about the current environment.
|
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be
|
||||||
* @param config Current configuration of Waila.
|
* processed by other providers).
|
||||||
* @return Modified input currenttip
|
* @param accessor Contains most of the relevant information about the current environment.
|
||||||
*/
|
* @param config Current configuration of Waila.
|
||||||
List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
|
* @return Modified input currenttip
|
||||||
|
*/
|
||||||
|
List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||||
|
IWailaConfigHandler config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback used server side to return a custom synchronization NBTTagCompound.</br>
|
* Callback used server side to return a custom synchronization NBTTagCompound.</br>
|
||||||
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerNBTProvider} server and client side.</br>
|
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerNBTProvider}
|
||||||
* You are supposed to always return the modified input NBTTagCompound tag.</br>
|
* server and client side.</br>
|
||||||
* @param player The player requesting data synchronization (The owner of the current connection).
|
* You are supposed to always return the modified input NBTTagCompound tag.</br>
|
||||||
* @param te The TileEntity targeted for synchronization.
|
*
|
||||||
* @param tag Current synchronization tag (might have been processed by other providers and might be processed by other providers).
|
* @param player The player requesting data synchronization (The owner of the current connection).
|
||||||
* @param world TileEntity's World.
|
* @param te The TileEntity targeted for synchronization.
|
||||||
* @param x X position of the TileEntity.
|
* @param tag Current synchronization tag (might have been processed by other providers and might be processed by
|
||||||
* @param y Y position of the TileEntity.
|
* other providers).
|
||||||
* @param z Z position of the TileEntity.
|
* @param world TileEntity's World.
|
||||||
* @return Modified input NBTTagCompound tag.
|
* @param x X position of the TileEntity.
|
||||||
*/
|
* @param y Y position of the TileEntity.
|
||||||
NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z);
|
* @param z Z position of the TileEntity.
|
||||||
|
* @return Modified input NBTTagCompound tag.
|
||||||
|
*/
|
||||||
|
NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y,
|
||||||
|
int z);
|
||||||
}
|
}
|
||||||
@@ -8,20 +8,30 @@ import net.minecraft.util.Vec3;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Accessor is used to get some basic data out of the game without having to request direct access to the game engine.<br>
|
* The Accessor is used to get some basic data out of the game without having to request direct access to the game
|
||||||
|
* engine.<br>
|
||||||
* It will also return things that are unmodified by the overriding systems (like getWailaStack).<br>
|
* It will also return things that are unmodified by the overriding systems (like getWailaStack).<br>
|
||||||
* An instance of this interface is passed to most of Waila Entity callbacks.
|
* An instance of this interface is passed to most of Waila Entity callbacks.
|
||||||
|
*
|
||||||
* @author ProfMobius
|
* @author ProfMobius
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface IWailaEntityAccessor {
|
public interface IWailaEntityAccessor {
|
||||||
World getWorld();
|
|
||||||
EntityPlayer getPlayer();
|
World getWorld();
|
||||||
Entity getEntity();
|
|
||||||
MovingObjectPosition getPosition();
|
EntityPlayer getPlayer();
|
||||||
Vec3 getRenderingPosition();
|
|
||||||
NBTTagCompound getNBTData();
|
Entity getEntity();
|
||||||
int getNBTInteger(NBTTagCompound tag, String keyname);
|
|
||||||
double getPartialFrame();
|
MovingObjectPosition getPosition();
|
||||||
|
|
||||||
|
Vec3 getRenderingPosition();
|
||||||
|
|
||||||
|
NBTTagCompound getNBTData();
|
||||||
|
|
||||||
|
int getNBTInteger(NBTTagCompound tag, String keyname);
|
||||||
|
|
||||||
|
double getPartialFrame();
|
||||||
}
|
}
|
||||||
@@ -12,68 +12,83 @@ import net.minecraft.world.World;
|
|||||||
* All methods in this interface shouldn't to be called by the implementing mod. An instance of the class is to be
|
* All methods in this interface shouldn't to be called by the implementing mod. An instance of the class is to be
|
||||||
* registered to Waila via the {@link IWailaRegistrar} instance provided in the original registration callback method
|
* registered to Waila via the {@link IWailaRegistrar} instance provided in the original registration callback method
|
||||||
* (cf. {@link IWailaRegistrar} documentation for more information).
|
* (cf. {@link IWailaRegistrar} documentation for more information).
|
||||||
|
*
|
||||||
* @author ProfMobius
|
* @author ProfMobius
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface IWailaEntityProvider {
|
public interface IWailaEntityProvider {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback used to override the default Waila lookup system.</br>
|
* Callback used to override the default Waila lookup system.</br>
|
||||||
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerOverrideEntityProvider}.</br>
|
* Will be used if the implementing class is registered via
|
||||||
* @param accessor Contains most of the relevant information about the current environment.
|
* {@link IWailaRegistrar}.{@link registerOverrideEntityProvider}.</br>
|
||||||
* @param config Current configuration of Waila.
|
*
|
||||||
* @return null if override is not required, an Entity otherwise.
|
* @param accessor Contains most of the relevant information about the current environment.
|
||||||
*/
|
* @param config Current configuration of Waila.
|
||||||
Entity getWailaOverride(IWailaEntityAccessor accessor, IWailaConfigHandler config);
|
* @return null if override is not required, an Entity otherwise.
|
||||||
|
*/
|
||||||
|
Entity getWailaOverride(IWailaEntityAccessor accessor, IWailaConfigHandler config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
|
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
|
||||||
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerHeadProvider} client side.</br>
|
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerHeadProvider}
|
||||||
* You are supposed to always return the modified input currenttip.</br>
|
* client side.</br>
|
||||||
*
|
* You are supposed to always return the modified input currenttip.</br>
|
||||||
* @param entity Current Entity scanned.
|
*
|
||||||
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers).
|
* @param entity Current Entity scanned.
|
||||||
* @param accessor Contains most of the relevant information about the current environment.
|
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be
|
||||||
* @param config Current configuration of Waila.
|
* processed by other providers).
|
||||||
* @return Modified input currenttip
|
* @param accessor Contains most of the relevant information about the current environment.
|
||||||
*/
|
* @param config Current configuration of Waila.
|
||||||
List<String> getWailaHead(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config);
|
* @return Modified input currenttip
|
||||||
|
*/
|
||||||
|
List<String> getWailaHead(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor,
|
||||||
|
IWailaConfigHandler config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
|
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
|
||||||
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerBodyProvider} client side.</br>
|
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerBodyProvider}
|
||||||
* You are supposed to always return the modified input currenttip.</br>
|
* client side.</br>
|
||||||
*
|
* You are supposed to always return the modified input currenttip.</br>
|
||||||
* @param entity Current Entity scanned.
|
*
|
||||||
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers).
|
* @param entity Current Entity scanned.
|
||||||
* @param accessor Contains most of the relevant information about the current environment.
|
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be
|
||||||
* @param config Current configuration of Waila.
|
* processed by other providers).
|
||||||
* @return Modified input currenttip
|
* @param accessor Contains most of the relevant information about the current environment.
|
||||||
*/
|
* @param config Current configuration of Waila.
|
||||||
List<String> getWailaBody(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config);
|
* @return Modified input currenttip
|
||||||
|
*/
|
||||||
|
List<String> getWailaBody(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor,
|
||||||
|
IWailaConfigHandler config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
|
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
|
||||||
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerTailProvider} client side.</br>
|
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerTailProvider}
|
||||||
* You are supposed to always return the modified input currenttip.</br>
|
* client side.</br>
|
||||||
*
|
* You are supposed to always return the modified input currenttip.</br>
|
||||||
* @param entity Current Entity scanned.
|
*
|
||||||
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers).
|
* @param entity Current Entity scanned.
|
||||||
* @param accessor Contains most of the relevant information about the current environment.
|
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be
|
||||||
* @param config Current configuration of Waila.
|
* processed by other providers).
|
||||||
* @return Modified input currenttip
|
* @param accessor Contains most of the relevant information about the current environment.
|
||||||
*/
|
* @param config Current configuration of Waila.
|
||||||
List<String> getWailaTail(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config);
|
* @return Modified input currenttip
|
||||||
|
*/
|
||||||
|
List<String> getWailaTail(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor,
|
||||||
|
IWailaConfigHandler config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback used server side to return a custom synchronization NBTTagCompound.</br>
|
* Callback used server side to return a custom synchronization NBTTagCompound.</br>
|
||||||
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerNBTProvider} server and client side.</br>
|
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerNBTProvider}
|
||||||
* You are supposed to always return the modified input NBTTagCompound tag.</br>
|
* server and client side.</br>
|
||||||
* @param player The player requesting data synchronization (The owner of the current connection).
|
* You are supposed to always return the modified input NBTTagCompound tag.</br>
|
||||||
* @param ent The Entity targeted for synchronization.
|
*
|
||||||
* @param tag Current synchronization tag (might have been processed by other providers and might be processed by other providers).
|
* @param player The player requesting data synchronization (The owner of the current connection).
|
||||||
* @param world TileEntity's World.
|
* @param ent The Entity targeted for synchronization.
|
||||||
* @return Modified input NBTTagCompound tag.
|
* @param tag Current synchronization tag (might have been processed by other providers and might be processed by
|
||||||
*/
|
* other providers).
|
||||||
NBTTagCompound getNBTData(EntityPlayerMP player, Entity ent, NBTTagCompound tag, World world);
|
* @param world TileEntity's World.
|
||||||
|
* @return Modified input NBTTagCompound tag.
|
||||||
|
*/
|
||||||
|
NBTTagCompound getNBTData(EntityPlayerMP player, Entity ent, NBTTagCompound tag, World world);
|
||||||
}
|
}
|
||||||
@@ -8,22 +8,34 @@ import net.minecraft.util.Vec3;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Accessor is used to get some basic data out of the game without having to request direct access to the game engine.<br>
|
* The Accessor is used to get some basic data out of the game without having to request direct access to the game
|
||||||
|
* engine.<br>
|
||||||
* It will also return things that are unmodified by the overriding systems (like getWailaStack).<br>
|
* It will also return things that are unmodified by the overriding systems (like getWailaStack).<br>
|
||||||
* An instance of this interface is passed to most of Waila FMP callbacks.
|
* An instance of this interface is passed to most of Waila FMP callbacks.
|
||||||
|
*
|
||||||
* @author ProfMobius
|
* @author ProfMobius
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface IWailaFMPAccessor {
|
public interface IWailaFMPAccessor {
|
||||||
World getWorld();
|
|
||||||
EntityPlayer getPlayer();
|
World getWorld();
|
||||||
TileEntity getTileEntity();
|
|
||||||
MovingObjectPosition getPosition();
|
EntityPlayer getPlayer();
|
||||||
NBTTagCompound getNBTData();
|
|
||||||
NBTTagCompound getFullNBTData();
|
TileEntity getTileEntity();
|
||||||
int getNBTInteger(NBTTagCompound tag, String keyname);
|
|
||||||
double getPartialFrame();
|
MovingObjectPosition getPosition();
|
||||||
Vec3 getRenderingPosition();
|
|
||||||
String getID();
|
NBTTagCompound getNBTData();
|
||||||
|
|
||||||
|
NBTTagCompound getFullNBTData();
|
||||||
|
|
||||||
|
int getNBTInteger(NBTTagCompound tag, String keyname);
|
||||||
|
|
||||||
|
double getPartialFrame();
|
||||||
|
|
||||||
|
Vec3 getRenderingPosition();
|
||||||
|
|
||||||
|
String getID();
|
||||||
}
|
}
|
||||||
@@ -7,17 +7,19 @@ import net.minecraft.item.ItemStack;
|
|||||||
* All methods in this interface shouldn't to be called by the implementing mod. An instance of the class is to be
|
* All methods in this interface shouldn't to be called by the implementing mod. An instance of the class is to be
|
||||||
* registered to Waila via the {@link IWailaRegistrar} instance provided in the original registration callback method
|
* registered to Waila via the {@link IWailaRegistrar} instance provided in the original registration callback method
|
||||||
* (cf. {@link IWailaRegistrar} documentation for more information).
|
* (cf. {@link IWailaRegistrar} documentation for more information).
|
||||||
|
*
|
||||||
* @author ProfMobius
|
* @author ProfMobius
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface IWailaFMPDecorator {
|
public interface IWailaFMPDecorator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback for the decorator. It provides a standard GL stack positioned on the block.</br>
|
* Callback for the decorator. It provides a standard GL stack positioned on the block.</br>
|
||||||
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerDecorator}.</br>
|
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerDecorator}.</br>
|
||||||
* @param itemStack Current block scanned, in ItemStack form.
|
*
|
||||||
* @param accessor Contains most of the relevant information about the current environment.
|
* @param itemStack Current block scanned, in ItemStack form.
|
||||||
* @param config Current configuration of Waila.
|
* @param accessor Contains most of the relevant information about the current environment.
|
||||||
*/
|
* @param config Current configuration of Waila.
|
||||||
void decorateBlock(ItemStack itemStack, IWailaFMPAccessor accessor, IWailaConfigHandler config);
|
*/
|
||||||
|
void decorateBlock(ItemStack itemStack, IWailaFMPAccessor accessor, IWailaConfigHandler config);
|
||||||
}
|
}
|
||||||
@@ -9,46 +9,57 @@ import net.minecraft.item.ItemStack;
|
|||||||
* All methods in this interface shouldn't to be called by the implementing mod. An instance of the class is to be
|
* All methods in this interface shouldn't to be called by the implementing mod. An instance of the class is to be
|
||||||
* registered to Waila via the {@link IWailaRegistrar} instance provided in the original registration callback method
|
* registered to Waila via the {@link IWailaRegistrar} instance provided in the original registration callback method
|
||||||
* (cf. {@link IWailaRegistrar} documentation for more information).
|
* (cf. {@link IWailaRegistrar} documentation for more information).
|
||||||
|
*
|
||||||
* @author ProfMobius
|
* @author ProfMobius
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface IWailaFMPProvider {
|
public interface IWailaFMPProvider {
|
||||||
/**
|
|
||||||
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
|
|
||||||
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerHeadProvider} client side.</br>
|
|
||||||
* You are supposed to always return the modified input currenttip.</br>
|
|
||||||
*
|
|
||||||
* @param itemStack Current block scanned, in ItemStack form.
|
|
||||||
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers).
|
|
||||||
* @param accessor Contains most of the relevant information about the current environment.
|
|
||||||
* @param config Current configuration of Waila.
|
|
||||||
* @return Modified input currenttip
|
|
||||||
*/
|
|
||||||
List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
|
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
|
||||||
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerBodyProvider} client side.</br>
|
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerHeadProvider}
|
||||||
* You are supposed to always return the modified input currenttip.</br>
|
* client side.</br>
|
||||||
*
|
* You are supposed to always return the modified input currenttip.</br>
|
||||||
* @param itemStack Current block scanned, in ItemStack form.
|
*
|
||||||
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers).
|
* @param itemStack Current block scanned, in ItemStack form.
|
||||||
* @param accessor Contains most of the relevant information about the current environment.
|
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be
|
||||||
* @param config Current configuration of Waila.
|
* processed by other providers).
|
||||||
* @return Modified input currenttip
|
* @param accessor Contains most of the relevant information about the current environment.
|
||||||
*/
|
* @param config Current configuration of Waila.
|
||||||
List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config);
|
* @return Modified input currenttip
|
||||||
|
*/
|
||||||
|
List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor,
|
||||||
|
IWailaConfigHandler config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
|
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
|
||||||
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerTailProvider} client side.</br>
|
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerBodyProvider}
|
||||||
* You are supposed to always return the modified input currenttip.</br>
|
* client side.</br>
|
||||||
*
|
* You are supposed to always return the modified input currenttip.</br>
|
||||||
* @param itemStack Current block scanned, in ItemStack form.
|
*
|
||||||
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers).
|
* @param itemStack Current block scanned, in ItemStack form.
|
||||||
* @param accessor Contains most of the relevant information about the current environment.
|
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be
|
||||||
* @param config Current configuration of Waila.
|
* processed by other providers).
|
||||||
* @return Modified input currenttip
|
* @param accessor Contains most of the relevant information about the current environment.
|
||||||
*/
|
* @param config Current configuration of Waila.
|
||||||
List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config);
|
* @return Modified input currenttip
|
||||||
|
*/
|
||||||
|
List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor,
|
||||||
|
IWailaConfigHandler config);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
|
||||||
|
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerTailProvider}
|
||||||
|
* client side.</br>
|
||||||
|
* You are supposed to always return the modified input currenttip.</br>
|
||||||
|
*
|
||||||
|
* @param itemStack Current block scanned, in ItemStack form.
|
||||||
|
* @param currenttip Current list of tooltip lines (might have been processed by other providers and might be
|
||||||
|
* processed by other providers).
|
||||||
|
* @param accessor Contains most of the relevant information about the current environment.
|
||||||
|
* @param config Current configuration of Waila.
|
||||||
|
* @return Modified input currenttip
|
||||||
|
*/
|
||||||
|
List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor,
|
||||||
|
IWailaConfigHandler config);
|
||||||
}
|
}
|
||||||
@@ -4,74 +4,90 @@ package mcp.mobius.waila.api;
|
|||||||
* Main registration interface. An instance will be provided to a method specified in an IMC msg formatted as follow<br>
|
* Main registration interface. An instance will be provided to a method specified in an IMC msg formatted as follow<br>
|
||||||
* FMLInterModComms.sendMessage("Waila", "register", "fully.qualified.path.to.registration.method");<br>
|
* FMLInterModComms.sendMessage("Waila", "register", "fully.qualified.path.to.registration.method");<br>
|
||||||
* The registration method need to follow this signature<br>
|
* The registration method need to follow this signature<br>
|
||||||
* public static void callbackRegister({@link IWailaRegistrar} registrar)<p>
|
* public static void callbackRegister({@link IWailaRegistrar} registrar)
|
||||||
* If not specified otherwise, all the registration methods taking a class can take classes as well as interfaces.
|
* <p>
|
||||||
* Waila will do a lookup using instanceof on the registered classes, meaning that if all your targets inherit one interface, you only need
|
* If not specified otherwise, all the registration methods taking a class can take classes as well as interfaces. Waila
|
||||||
* to specify it to cover the whole hierarchy.<br>
|
* will do a lookup using instanceof on the registered classes, meaning that if all your targets inherit one interface,
|
||||||
* For the registration of blocks, both Blocks and TileEntities are accepted.<p>
|
* you only need to specify it to cover the whole hierarchy.<br>
|
||||||
|
* For the registration of blocks, both Blocks and TileEntities are accepted.
|
||||||
|
* <p>
|
||||||
* For the configuration keys :<br>
|
* For the configuration keys :<br>
|
||||||
* modname refers to a String used for display in Waila's config panel.<br>
|
* modname refers to a String used for display in Waila's config panel.<br>
|
||||||
* keyname refers to an unique key used internally for config query (cf {@link IWailaConfigHandler}). Those keys are shared across Waila, keep them unique !<br>
|
* keyname refers to an unique key used internally for config query (cf {@link IWailaConfigHandler}). Those keys are
|
||||||
|
* shared across Waila, keep them unique !<br>
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @author ProfMobius
|
* @author ProfMobius
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface IWailaRegistrar {
|
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 addConfig(String modname, String keyname, String configtext, boolean defvalue);
|
|
||||||
public void addConfigRemote(String modname, String keyname, String configtext);
|
|
||||||
public void addConfigRemote(String modname, String keyname, String configtext, boolean defvalue);
|
|
||||||
public void addConfig(String modname, String keyname);
|
|
||||||
public void addConfig(String modname, String keyname, boolean defvalue);
|
|
||||||
public void addConfigRemote(String modname, String keyname);
|
|
||||||
public void addConfigRemote(String modname, String keyname, boolean defvalue);
|
|
||||||
|
|
||||||
/* Register a stack overrider for the given blockID */
|
/* Add a config option in the section modname with displayed text configtext and access key keyname */
|
||||||
public void registerStackProvider(IWailaDataProvider dataProvider, Class block);
|
public void addConfig(String modname, String keyname, String configtext);
|
||||||
|
|
||||||
/* Same thing, but works on a class hierarchy instead */
|
public void addConfig(String modname, String keyname, String configtext, boolean defvalue);
|
||||||
public void registerHeadProvider (IWailaDataProvider dataProvider, Class block);
|
|
||||||
public void registerBodyProvider (IWailaDataProvider dataProvider, Class block);
|
|
||||||
public void registerTailProvider (IWailaDataProvider dataProvider, Class block);
|
|
||||||
|
|
||||||
/* Registering an NBT Provider provides a way to override the default "writeToNBT" way of doing things. */
|
public void addConfigRemote(String modname, String keyname, String configtext);
|
||||||
public void registerNBTProvider(IWailaDataProvider dataProvider, Class block);
|
|
||||||
|
|
||||||
/* Entity text registration methods */
|
public void addConfigRemote(String modname, String keyname, String configtext, boolean defvalue);
|
||||||
public void registerHeadProvider (IWailaEntityProvider dataProvider, Class entity);
|
|
||||||
public void registerBodyProvider (IWailaEntityProvider dataProvider, Class entity);
|
|
||||||
public void registerTailProvider (IWailaEntityProvider dataProvider, Class entity);
|
|
||||||
public void registerOverrideEntityProvider (IWailaEntityProvider dataProvider, Class entity);
|
|
||||||
|
|
||||||
/* Registering an NBT Provider provides a way to override the default "writeToNBT" way of doing things. */
|
public void addConfig(String modname, String keyname);
|
||||||
public void registerNBTProvider(IWailaEntityProvider dataProvider, Class entity);
|
|
||||||
|
|
||||||
/* FMP Providers */
|
public void addConfig(String modname, String keyname, boolean defvalue);
|
||||||
public void registerHeadProvider(IWailaFMPProvider dataProvider, String name);
|
|
||||||
public void registerBodyProvider(IWailaFMPProvider dataProvider, String name);
|
|
||||||
public void registerTailProvider(IWailaFMPProvider dataProvider, String name);
|
|
||||||
|
|
||||||
/* The block decorators */
|
public void addConfigRemote(String modname, String keyname);
|
||||||
public void registerDecorator (IWailaBlockDecorator decorator, Class block);
|
|
||||||
public void registerDecorator (IWailaFMPDecorator decorator, String name);
|
|
||||||
|
|
||||||
/* Selective NBT key syncing. Will register a key to sync over the network for the given class (block, te or ent).
|
public void addConfigRemote(String modname, String keyname, boolean defvalue);
|
||||||
* Accept * as a ending wildcard
|
|
||||||
* registerNBTKey("bob.*", MyBlock.class)
|
|
||||||
* registerNBTKey("data.life", MyEntity.class)
|
|
||||||
* registerNBTKey("*", MyTileEntity.class) will reproduce the full tag syncing from 1.4.5
|
|
||||||
*
|
|
||||||
* This registration method is deprecated in favor to registerNBTProvider.
|
|
||||||
* It will be removed in MC 1.8 !!!
|
|
||||||
* */
|
|
||||||
@Deprecated
|
|
||||||
public void registerSyncedNBTKey(String key, Class target);
|
|
||||||
|
|
||||||
public void registerTooltipRenderer(String name, IWailaTooltipRenderer renderer);
|
/* Register a stack overrider for the given blockID */
|
||||||
|
public void registerStackProvider(IWailaDataProvider dataProvider, Class block);
|
||||||
|
|
||||||
/* UNUSED FOR NOW (Will be used for the ingame wiki */
|
/* Same thing, but works on a class hierarchy instead */
|
||||||
//public void registerDocTextFile (String filename);
|
public void registerHeadProvider(IWailaDataProvider dataProvider, Class block);
|
||||||
//public void registerShortDataProvider (IWailaSummaryProvider dataProvider, Class item);
|
|
||||||
|
public void registerBodyProvider(IWailaDataProvider dataProvider, Class block);
|
||||||
|
|
||||||
|
public void registerTailProvider(IWailaDataProvider dataProvider, Class block);
|
||||||
|
|
||||||
|
/* Registering an NBT Provider provides a way to override the default "writeToNBT" way of doing things. */
|
||||||
|
public void registerNBTProvider(IWailaDataProvider dataProvider, Class block);
|
||||||
|
|
||||||
|
/* Entity text registration methods */
|
||||||
|
public void registerHeadProvider(IWailaEntityProvider dataProvider, Class entity);
|
||||||
|
|
||||||
|
public void registerBodyProvider(IWailaEntityProvider dataProvider, Class entity);
|
||||||
|
|
||||||
|
public void registerTailProvider(IWailaEntityProvider dataProvider, Class entity);
|
||||||
|
|
||||||
|
public void registerOverrideEntityProvider(IWailaEntityProvider dataProvider, Class entity);
|
||||||
|
|
||||||
|
/* Registering an NBT Provider provides a way to override the default "writeToNBT" way of doing things. */
|
||||||
|
public void registerNBTProvider(IWailaEntityProvider dataProvider, Class entity);
|
||||||
|
|
||||||
|
/* FMP Providers */
|
||||||
|
public void registerHeadProvider(IWailaFMPProvider dataProvider, String name);
|
||||||
|
|
||||||
|
public void registerBodyProvider(IWailaFMPProvider dataProvider, String name);
|
||||||
|
|
||||||
|
public void registerTailProvider(IWailaFMPProvider dataProvider, String name);
|
||||||
|
|
||||||
|
/* The block decorators */
|
||||||
|
public void registerDecorator(IWailaBlockDecorator decorator, Class block);
|
||||||
|
|
||||||
|
public void registerDecorator(IWailaFMPDecorator decorator, String name);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Selective NBT key syncing. Will register a key to sync over the network for the given class (block, te or ent).
|
||||||
|
* Accept * as a ending wildcard registerNBTKey("bob.*", MyBlock.class) registerNBTKey("data.life", MyEntity.class)
|
||||||
|
* registerNBTKey("*", MyTileEntity.class) will reproduce the full tag syncing from 1.4.5 This registration method
|
||||||
|
* is deprecated in favor to registerNBTProvider. It will be removed in MC 1.8 !!!
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public void registerSyncedNBTKey(String key, Class target);
|
||||||
|
|
||||||
|
public void registerTooltipRenderer(String name, IWailaTooltipRenderer renderer);
|
||||||
|
|
||||||
|
/* UNUSED FOR NOW (Will be used for the ingame wiki */
|
||||||
|
// public void registerDocTextFile (String filename);
|
||||||
|
// public void registerShortDataProvider (IWailaSummaryProvider dataProvider, Class item);
|
||||||
}
|
}
|
||||||
@@ -5,17 +5,18 @@ import java.util.LinkedHashMap;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public interface IWailaSummaryProvider {
|
public interface IWailaSummaryProvider {
|
||||||
/* This interface is used to control the display data in the description screen */
|
/* This interface is used to control the display data in the description screen */
|
||||||
|
|
||||||
/* BASIC TOOLS & ITEMS DATA */
|
/* BASIC TOOLS & ITEMS DATA */
|
||||||
//EnumToolMaterial getMaterial(ItemStack stack);
|
// EnumToolMaterial getMaterial(ItemStack stack);
|
||||||
//String getMaterialName(ItemStack stack);
|
// String getMaterialName(ItemStack stack);
|
||||||
//String getEffectiveBlock(ItemStack stack);
|
// String getEffectiveBlock(ItemStack stack);
|
||||||
//int getHarvestLevel(ItemStack stack);
|
// int getHarvestLevel(ItemStack stack);
|
||||||
//float getEfficiencyOnProperMaterial(ItemStack stack);
|
// float getEfficiencyOnProperMaterial(ItemStack stack);
|
||||||
//int getEnchantability(ItemStack stack);
|
// int getEnchantability(ItemStack stack);
|
||||||
//int getDamageVsEntity(ItemStack stack);
|
// int getDamageVsEntity(ItemStack stack);
|
||||||
//int getDurability(ItemStack stack);
|
// int getDurability(ItemStack stack);
|
||||||
|
|
||||||
LinkedHashMap<String, String> getSummary(ItemStack stack, LinkedHashMap<String, String> currentSummary, IWailaConfigHandler config);
|
LinkedHashMap<String, String> getSummary(ItemStack stack, LinkedHashMap<String, String> currentSummary,
|
||||||
|
IWailaConfigHandler config);
|
||||||
}
|
}
|
||||||
@@ -1,24 +1,25 @@
|
|||||||
package mcp.mobius.waila.api;
|
package mcp.mobius.waila.api;
|
||||||
|
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Point;
|
|
||||||
|
|
||||||
|
|
||||||
public interface IWailaTooltipRenderer {
|
public interface IWailaTooltipRenderer {
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param params Array of string parameters as passed to the RENDER arg in the tooltip ({rendername,param1,param2,...})
|
|
||||||
* @param accessor A global accessor for TileEntities and Entities
|
|
||||||
* @return Dimension of the reserved area
|
|
||||||
*/
|
|
||||||
Dimension getSize(String[] params, IWailaCommonAccessor accessor);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw method for the renderer. The GL matrice is automatically moved to the top left of the reserved zone.<br>
|
*
|
||||||
* All calls should be relative to (0,0)
|
* @param params Array of string parameters as passed to the RENDER arg in the tooltip
|
||||||
*
|
* ({rendername,param1,param2,...})
|
||||||
* @param params Array of string parameters as passed to the RENDER arg in the tooltip ({rendername,param1,param2,...})
|
* @param accessor A global accessor for TileEntities and Entities
|
||||||
* @param accessor A global accessor for TileEntities and Entities
|
* @return Dimension of the reserved area
|
||||||
*/
|
*/
|
||||||
void draw (String[] params, IWailaCommonAccessor accessor);
|
Dimension getSize(String[] params, IWailaCommonAccessor accessor);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw method for the renderer. The GL matrice is automatically moved to the top left of the reserved zone.<br>
|
||||||
|
* All calls should be relative to (0,0)
|
||||||
|
*
|
||||||
|
* @param params Array of string parameters as passed to the RENDER arg in the tooltip
|
||||||
|
* ({rendername,param1,param2,...})
|
||||||
|
* @param accessor A global accessor for TileEntities and Entities
|
||||||
|
*/
|
||||||
|
void draw(String[] params, IWailaCommonAccessor accessor);
|
||||||
}
|
}
|
||||||
@@ -1,70 +1,83 @@
|
|||||||
package mcp.mobius.waila.api;
|
package mcp.mobius.waila.api;
|
||||||
|
|
||||||
import static mcp.mobius.waila.api.SpecialChars.RENDER;
|
|
||||||
import static mcp.mobius.waila.api.SpecialChars.WailaStyle;
|
|
||||||
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class SpecialChars {
|
public class SpecialChars {
|
||||||
|
|
||||||
public static String MCStyle = "\u00A7";
|
public static String MCStyle = "\u00A7";
|
||||||
|
|
||||||
public static String BLACK = MCStyle + "0";
|
public static String BLACK = MCStyle + "0";
|
||||||
public static String DBLUE = MCStyle + "1";
|
public static String DBLUE = MCStyle + "1";
|
||||||
public static String DGREEN = MCStyle + "2";
|
public static String DGREEN = MCStyle + "2";
|
||||||
public static String DAQUA = MCStyle + "3";
|
public static String DAQUA = MCStyle + "3";
|
||||||
public static String DRED = MCStyle + "4";
|
public static String DRED = MCStyle + "4";
|
||||||
public static String DPURPLE = MCStyle + "5";
|
public static String DPURPLE = MCStyle + "5";
|
||||||
public static String GOLD = MCStyle + "6";
|
public static String GOLD = MCStyle + "6";
|
||||||
public static String GRAY = MCStyle + "7";
|
public static String GRAY = MCStyle + "7";
|
||||||
public static String DGRAY = MCStyle + "8";
|
public static String DGRAY = MCStyle + "8";
|
||||||
public static String BLUE = MCStyle + "9";
|
public static String BLUE = MCStyle + "9";
|
||||||
public static String GREEN = MCStyle + "a";
|
public static String GREEN = MCStyle + "a";
|
||||||
public static String AQUA = MCStyle + "b";
|
public static String AQUA = MCStyle + "b";
|
||||||
public static String RED = MCStyle + "c";
|
public static String RED = MCStyle + "c";
|
||||||
public static String LPURPLE = MCStyle + "d";
|
public static String LPURPLE = MCStyle + "d";
|
||||||
public static String YELLOW = MCStyle + "e";
|
public static String YELLOW = MCStyle + "e";
|
||||||
public static String WHITE = MCStyle + "f";
|
public static String WHITE = MCStyle + "f";
|
||||||
|
|
||||||
public static String OBF = MCStyle + "k";
|
public static String OBF = MCStyle + "k";
|
||||||
public static String BOLD = MCStyle + "l";
|
public static String BOLD = MCStyle + "l";
|
||||||
public static String STRIKE = MCStyle + "m";
|
public static String STRIKE = MCStyle + "m";
|
||||||
public static String UNDER = MCStyle + "n";
|
public static String UNDER = MCStyle + "n";
|
||||||
public static String ITALIC = MCStyle + "o";
|
public static String ITALIC = MCStyle + "o";
|
||||||
public static String RESET = MCStyle + "r";
|
public static String RESET = MCStyle + "r";
|
||||||
|
|
||||||
public static String WailaStyle = "\u00A4";
|
public static String WailaStyle = "\u00A4";
|
||||||
public static String WailaIcon = "\u00A5";
|
public static String WailaIcon = "\u00A5";
|
||||||
public static String WailaRenderer = "\u00A6";
|
public static String WailaRenderer = "\u00A6";
|
||||||
public static String TAB = WailaStyle + WailaStyle +"a";
|
public static String TAB = WailaStyle + WailaStyle + "a";
|
||||||
public static String ALIGNRIGHT = WailaStyle + WailaStyle +"b";
|
public static String ALIGNRIGHT = WailaStyle + WailaStyle + "b";
|
||||||
public static String ALIGNCENTER = WailaStyle + WailaStyle +"c";
|
public static String ALIGNCENTER = WailaStyle + WailaStyle + "c";
|
||||||
public static String HEART = WailaStyle + WailaIcon +"a";
|
public static String HEART = WailaStyle + WailaIcon + "a";
|
||||||
public static String HHEART = WailaStyle + WailaIcon +"b";
|
public static String HHEART = WailaStyle + WailaIcon + "b";
|
||||||
public static String EHEART = WailaStyle + WailaIcon +"c";
|
public static String EHEART = WailaStyle + WailaIcon + "c";
|
||||||
public static String RENDER = WailaStyle + WailaRenderer +"a";
|
public static String RENDER = WailaStyle + WailaRenderer + "a";
|
||||||
|
|
||||||
public static final Pattern patternMinecraft = Pattern.compile("(?i)" + MCStyle + "[0-9A-FK-OR]");
|
public static final Pattern patternMinecraft = Pattern.compile("(?i)" + MCStyle + "[0-9A-FK-OR]");
|
||||||
public static final Pattern patternWaila = Pattern.compile("(?i)(" + WailaStyle + "(?<type>..))");
|
public static final Pattern patternWaila = Pattern.compile("(?i)(" + WailaStyle + "(?<type>..))");
|
||||||
public static final Pattern patternRender = Pattern.compile("(?i)(" + RENDER + "\\{(?<name>[^,}]*),?(?<args>[^}]*)\\})");
|
public static final Pattern patternRender = Pattern
|
||||||
public static final Pattern patternTab = Pattern.compile("(?i)" + TAB);
|
.compile("(?i)(" + RENDER + "\\{(?<name>[^,}]*),?(?<args>[^}]*)\\})");
|
||||||
public static final Pattern patternRight = Pattern.compile("(?i)" + ALIGNRIGHT);
|
public static final Pattern patternTab = Pattern.compile("(?i)" + TAB);
|
||||||
public static final Pattern patternCenter = Pattern.compile("(?i)" + ALIGNCENTER);
|
public static final Pattern patternRight = Pattern.compile("(?i)" + ALIGNRIGHT);
|
||||||
public static final Pattern patternIcon = Pattern.compile("(?i)(" + WailaStyle + WailaIcon + "(?<type>[0-9a-z]))");
|
public static final Pattern patternCenter = Pattern.compile("(?i)" + ALIGNCENTER);
|
||||||
public static final Pattern patternLineSplit = Pattern.compile("(?i)(" + WailaStyle + WailaStyle + "[^" + WailaStyle + "]+|" + WailaStyle + WailaIcon + "[0-9A-Z]|" + WailaStyle + WailaRenderer + "a\\{([^,}]*),?([^}]*)\\}|[^" + WailaStyle + "]+)");
|
public static final Pattern patternIcon = Pattern.compile("(?i)(" + WailaStyle + WailaIcon + "(?<type>[0-9a-z]))");
|
||||||
|
public static final Pattern patternLineSplit = Pattern.compile(
|
||||||
|
"(?i)(" + WailaStyle
|
||||||
|
+ WailaStyle
|
||||||
|
+ "[^"
|
||||||
|
+ WailaStyle
|
||||||
|
+ "]+|"
|
||||||
|
+ WailaStyle
|
||||||
|
+ WailaIcon
|
||||||
|
+ "[0-9A-Z]|"
|
||||||
|
+ WailaStyle
|
||||||
|
+ WailaRenderer
|
||||||
|
+ "a\\{([^,}]*),?([^}]*)\\}|[^"
|
||||||
|
+ WailaStyle
|
||||||
|
+ "]+)");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper method to get a proper RENDER string. Just put the name of the renderer and the params in, and it will give back a directly usable String for the tooltip.
|
* Helper method to get a proper RENDER string. Just put the name of the renderer and the params in, and it will
|
||||||
* @param name
|
* give back a directly usable String for the tooltip.
|
||||||
* @param params
|
*
|
||||||
* @return
|
* @param name
|
||||||
*/
|
* @param params
|
||||||
public static String getRenderString(String name, String... params){
|
* @return
|
||||||
String result = RENDER + "{" + name;
|
*/
|
||||||
for (String s : params){
|
public static String getRenderString(String name, String... params) {
|
||||||
result += "," + s;
|
String result = RENDER + "{" + name;
|
||||||
}
|
for (String s : params) {
|
||||||
result += "}";
|
result += "," + s;
|
||||||
return result;
|
}
|
||||||
}
|
result += "}";
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -5,171 +5,174 @@ import java.util.HashMap;
|
|||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import net.minecraftforge.common.config.Configuration;
|
||||||
|
import net.minecraftforge.common.config.Property;
|
||||||
|
|
||||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
import mcp.mobius.waila.Waila;
|
import mcp.mobius.waila.Waila;
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.handlers.HUDHandlerEntities;
|
import mcp.mobius.waila.handlers.HUDHandlerEntities;
|
||||||
import mcp.mobius.waila.overlay.OverlayConfig;
|
import mcp.mobius.waila.overlay.OverlayConfig;
|
||||||
import mcp.mobius.waila.utils.Constants;
|
import mcp.mobius.waila.utils.Constants;
|
||||||
import net.minecraftforge.common.config.Configuration;
|
|
||||||
import net.minecraftforge.common.config.Property;
|
|
||||||
|
|
||||||
public class ConfigHandler implements IWailaConfigHandler {
|
public class ConfigHandler implements IWailaConfigHandler {
|
||||||
|
|
||||||
/* SINGLETON */
|
/* SINGLETON */
|
||||||
private static ConfigHandler _instance = null;
|
private static ConfigHandler _instance = null;
|
||||||
private ConfigHandler() { _instance = this; }
|
|
||||||
public static ConfigHandler instance(){ return _instance == null ? new ConfigHandler() : _instance; }
|
|
||||||
/* === */
|
|
||||||
|
|
||||||
private LinkedHashMap<String, ConfigModule> modules = new LinkedHashMap<String, ConfigModule>();
|
private ConfigHandler() {
|
||||||
private ArrayList<String> serverconfigs = new ArrayList<String>();
|
_instance = this;
|
||||||
public HashMap<String, Boolean> forcedConfigs = new HashMap<String, Boolean>();
|
}
|
||||||
public Configuration config = null;
|
|
||||||
|
|
||||||
|
public static ConfigHandler instance() {
|
||||||
|
return _instance == null ? new ConfigHandler() : _instance;
|
||||||
|
}
|
||||||
|
/* === */
|
||||||
|
|
||||||
public void addModule(String modName, HashMap<String, String> options){
|
private LinkedHashMap<String, ConfigModule> modules = new LinkedHashMap<String, ConfigModule>();
|
||||||
this.addModule(modName, new ConfigModule(modName, options));
|
private ArrayList<String> serverconfigs = new ArrayList<String>();
|
||||||
}
|
public HashMap<String, Boolean> forcedConfigs = new HashMap<String, Boolean>();
|
||||||
|
public Configuration config = null;
|
||||||
|
|
||||||
public void addModule(String modName, ConfigModule options){
|
public void addModule(String modName, HashMap<String, String> options) {
|
||||||
this.modules.put(modName, options);
|
this.addModule(modName, new ConfigModule(modName, options));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void addModule(String modName, ConfigModule options) {
|
||||||
public Set<String> getModuleNames(){
|
this.modules.put(modName, options);
|
||||||
return this.modules.keySet();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HashMap<String, String> getConfigKeys(String modName){
|
public Set<String> getModuleNames() {
|
||||||
if (this.modules.containsKey(modName))
|
return this.modules.keySet();
|
||||||
return this.modules.get(modName).options;
|
}
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void saveModuleKey(String modName, String key){
|
@Override
|
||||||
this.saveModuleKey(modName, key, Constants.CFG_DEFAULT_VALUE);
|
public HashMap<String, String> getConfigKeys(String modName) {
|
||||||
}
|
if (this.modules.containsKey(modName)) return this.modules.get(modName).options;
|
||||||
|
else return null;
|
||||||
|
}
|
||||||
|
|
||||||
private void saveModuleKey(String modName, String key, boolean defvalue){
|
private void saveModuleKey(String modName, String key) {
|
||||||
config.get(Constants.CATEGORY_MODULES, key, defvalue);
|
this.saveModuleKey(modName, key, Constants.CFG_DEFAULT_VALUE);
|
||||||
config.get(Constants.CATEGORY_SERVER , key, Constants.SERVER_FREE);
|
}
|
||||||
config.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addConfig(String modName, String key, String name){
|
private void saveModuleKey(String modName, String key, boolean defvalue) {
|
||||||
this.addConfig(modName, key, name, Constants.CFG_DEFAULT_VALUE);
|
config.get(Constants.CATEGORY_MODULES, key, defvalue);
|
||||||
}
|
config.get(Constants.CATEGORY_SERVER, key, Constants.SERVER_FREE);
|
||||||
|
config.save();
|
||||||
|
}
|
||||||
|
|
||||||
public void addConfig(String modName, String key, String name, boolean defvalue){
|
public void addConfig(String modName, String key, String name) {
|
||||||
this.saveModuleKey(modName, key, defvalue);
|
this.addConfig(modName, key, name, Constants.CFG_DEFAULT_VALUE);
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.modules.containsKey(modName))
|
public void addConfig(String modName, String key, String name, boolean defvalue) {
|
||||||
this.modules.put(modName, new ConfigModule(modName));
|
this.saveModuleKey(modName, key, defvalue);
|
||||||
|
|
||||||
this.modules.get(modName).addOption(key, name);
|
if (!this.modules.containsKey(modName)) this.modules.put(modName, new ConfigModule(modName));
|
||||||
}
|
|
||||||
|
|
||||||
public void addConfigServer(String modName, String key, String name){
|
this.modules.get(modName).addOption(key, name);
|
||||||
this.addConfigServer(modName, key, name, Constants.CFG_DEFAULT_VALUE);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void addConfigServer(String modName, String key, String name, boolean defvalue){
|
public void addConfigServer(String modName, String key, String name) {
|
||||||
this.saveModuleKey(modName, key, defvalue);
|
this.addConfigServer(modName, key, name, Constants.CFG_DEFAULT_VALUE);
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.modules.containsKey(modName))
|
public void addConfigServer(String modName, String key, String name, boolean defvalue) {
|
||||||
this.modules.put(modName, new ConfigModule(modName));
|
this.saveModuleKey(modName, key, defvalue);
|
||||||
|
|
||||||
this.modules.get(modName).addOption(key, name);
|
if (!this.modules.containsKey(modName)) this.modules.put(modName, new ConfigModule(modName));
|
||||||
this.serverconfigs.add(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
this.modules.get(modName).addOption(key, name);
|
||||||
public boolean getConfig(String key){
|
this.serverconfigs.add(key);
|
||||||
return this.getConfig(key, Constants.CFG_DEFAULT_VALUE);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getConfig(String key, boolean defvalue){
|
public boolean getConfig(String key) {
|
||||||
if (this.serverconfigs.contains(key) && !Waila.instance.serverPresent)
|
return this.getConfig(key, Constants.CFG_DEFAULT_VALUE);
|
||||||
return false;
|
}
|
||||||
|
|
||||||
if (this.forcedConfigs.containsKey(key))
|
@Override
|
||||||
return this.forcedConfigs.get(key);
|
public boolean getConfig(String key, boolean defvalue) {
|
||||||
|
if (this.serverconfigs.contains(key) && !Waila.instance.serverPresent) return false;
|
||||||
|
|
||||||
Property prop = config.get(Constants.CATEGORY_MODULES, key, defvalue);
|
if (this.forcedConfigs.containsKey(key)) return this.forcedConfigs.get(key);
|
||||||
return prop.getBoolean(defvalue);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isServerRequired(String key){
|
Property prop = config.get(Constants.CATEGORY_MODULES, key, defvalue);
|
||||||
return this.serverconfigs.contains(key);
|
return prop.getBoolean(defvalue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isServerRequired(String key) {
|
||||||
|
return this.serverconfigs.contains(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* GENERAL ACCESS METHODS TO GET/SET VALUES IN THE CONFIG FILE */
|
||||||
|
|
||||||
|
public boolean getConfig(String category, String key, boolean default_) {
|
||||||
|
Property prop = config.get(category, key, default_);
|
||||||
|
return prop.getBoolean(default_);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConfig(String category, String key, boolean state) {
|
||||||
|
config.getCategory(category).put(key, new Property(key, String.valueOf(state), Property.Type.BOOLEAN));
|
||||||
|
config.save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getConfig(String category, String key, int default_) {
|
||||||
|
Property prop = config.get(category, key, default_);
|
||||||
|
return prop.getInt();
|
||||||
|
}
|
||||||
|
|
||||||
/* GENERAL ACCESS METHODS TO GET/SET VALUES IN THE CONFIG FILE */
|
public void setConfig(String category, String key, int state) {
|
||||||
|
config.getCategory(category).put(key, new Property(key, String.valueOf(state), Property.Type.INTEGER));
|
||||||
|
config.save();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean getConfig(String category, String key, boolean default_){
|
/* Some accessor helpers */
|
||||||
Property prop = config.get(category, key, default_);
|
public boolean showTooltip() {
|
||||||
return prop.getBoolean(default_);
|
return getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConfig(String category, String key, boolean state){
|
/* Default config loading */
|
||||||
config.getCategory(category).put(key, new Property(key,String.valueOf(state),Property.Type.BOOLEAN));
|
|
||||||
config.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getConfig(String category, String key, int default_){
|
public void loadDefaultConfig(FMLPreInitializationEvent event) {
|
||||||
Property prop = config.get(category, key, default_);
|
config = new Configuration(event.getSuggestedConfigurationFile());
|
||||||
return prop.getInt();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConfig(String category, String key, int state){
|
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, true);
|
||||||
config.getCategory(category).put(key, new Property(key,String.valueOf(state),Property.Type.INTEGER));
|
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MODE, true);
|
||||||
config.save();
|
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_LIQUID, false);
|
||||||
}
|
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_METADATA, false);
|
||||||
|
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_KEYBIND, true);
|
||||||
|
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_NEWFILTERS, true);
|
||||||
|
|
||||||
|
OverlayConfig.posX = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_POSX, 5000).getInt();
|
||||||
|
OverlayConfig.posY = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_POSY, 100).getInt();
|
||||||
|
|
||||||
/* Some accessor helpers */
|
OverlayConfig.alpha = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_ALPHA, 80).getInt();
|
||||||
public boolean showTooltip(){
|
OverlayConfig.breakprogress = config
|
||||||
return getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, true);
|
.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_BREAK_PROGRESS, true).getBoolean();
|
||||||
}
|
OverlayConfig.bgcolor = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_BGCOLOR, 0x100010)
|
||||||
|
.getInt();
|
||||||
|
OverlayConfig.gradient1 = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_GRADIENT1, 0x5000ff)
|
||||||
|
.getInt();
|
||||||
|
OverlayConfig.gradient2 = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_GRADIENT2, 0x28007f)
|
||||||
|
.getInt();
|
||||||
|
OverlayConfig.fontcolor = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_FONTCOLOR, 0xA0A0A0)
|
||||||
|
.getInt();
|
||||||
|
OverlayConfig.scale = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SCALE, 100).getInt()
|
||||||
|
/ 100.0f;
|
||||||
|
|
||||||
|
HUDHandlerEntities.nhearts = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_NHEARTS, 20)
|
||||||
|
.getInt();
|
||||||
|
HUDHandlerEntities.maxhpfortext = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MAXHP, 40)
|
||||||
|
.getInt();
|
||||||
|
|
||||||
|
config.getCategory(Constants.CATEGORY_MODULES).setComment(
|
||||||
|
"Those are the config keys defined in modules.\nServer side, it is used to enforce keys client side using the next section.");
|
||||||
|
config.getCategory(Constants.CATEGORY_SERVER).setComment(
|
||||||
|
"Any key set to true here will ensure that the client is using the configuration set in the 'module' section above.\nThis is useful for enforcing false to 'cheating' keys like silverfish.");
|
||||||
|
|
||||||
/* Default config loading */
|
config.save();
|
||||||
|
}
|
||||||
public void loadDefaultConfig(FMLPreInitializationEvent event){
|
|
||||||
config = new Configuration(event.getSuggestedConfigurationFile());
|
|
||||||
|
|
||||||
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, true);
|
|
||||||
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MODE, true);
|
|
||||||
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_LIQUID, false);
|
|
||||||
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_METADATA, false);
|
|
||||||
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_KEYBIND, true);
|
|
||||||
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_NEWFILTERS, true);
|
|
||||||
|
|
||||||
OverlayConfig.posX = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_POSX, 5000).getInt();
|
|
||||||
OverlayConfig.posY = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_POSY, 100).getInt();
|
|
||||||
|
|
||||||
OverlayConfig.alpha = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_ALPHA, 80).getInt();
|
|
||||||
OverlayConfig.bgcolor = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_BGCOLOR, 0x100010).getInt();
|
|
||||||
OverlayConfig.gradient1 = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_GRADIENT1, 0x5000ff).getInt();
|
|
||||||
OverlayConfig.gradient2 = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_GRADIENT2, 0x28007f).getInt();
|
|
||||||
OverlayConfig.fontcolor = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_FONTCOLOR, 0xA0A0A0).getInt();
|
|
||||||
OverlayConfig.scale = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SCALE, 100).getInt() / 100.0f;
|
|
||||||
|
|
||||||
HUDHandlerEntities.nhearts = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_NHEARTS, 20).getInt();
|
|
||||||
HUDHandlerEntities.maxhpfortext = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MAXHP, 40).getInt();
|
|
||||||
|
|
||||||
config.getCategory(Constants.CATEGORY_MODULES).setComment("Those are the config keys defined in modules.\nServer side, it is used to enforce keys client side using the next section.");
|
|
||||||
config.getCategory(Constants.CATEGORY_SERVER).setComment("Any key set to true here will ensure that the client is using the configuration set in the 'module' section above.\nThis is useful for enforcing false to 'cheating' keys like silverfish.");
|
|
||||||
|
|
||||||
config.save();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -4,21 +4,21 @@ import java.util.HashMap;
|
|||||||
|
|
||||||
public class ConfigModule {
|
public class ConfigModule {
|
||||||
|
|
||||||
String modName;
|
String modName;
|
||||||
HashMap<String, String> options;
|
HashMap<String, String> options;
|
||||||
|
|
||||||
public ConfigModule(String _modName){
|
public ConfigModule(String _modName) {
|
||||||
this.modName = _modName;
|
this.modName = _modName;
|
||||||
this.options = new HashMap<String, String>();
|
this.options = new HashMap<String, String>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConfigModule(String _modName, HashMap<String, String> _options) {
|
public ConfigModule(String _modName, HashMap<String, String> _options) {
|
||||||
this.modName = _modName;
|
this.modName = _modName;
|
||||||
this.options = _options;
|
this.options = _options;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addOption(String key, String name){
|
public void addOption(String key, String name) {
|
||||||
this.options.put(key,name);
|
this.options.put(key, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package mcp.mobius.waila.api.impl;
|
package mcp.mobius.waila.api.impl;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameData;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
@@ -13,186 +13,212 @@ import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
|||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.registry.GameData;
|
||||||
import mcp.mobius.waila.api.IWailaCommonAccessor;
|
import mcp.mobius.waila.api.IWailaCommonAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaEntityAccessor;
|
import mcp.mobius.waila.api.IWailaEntityAccessor;
|
||||||
import mcp.mobius.waila.utils.NBTUtil;
|
import mcp.mobius.waila.utils.NBTUtil;
|
||||||
|
|
||||||
public class DataAccessorCommon implements IWailaCommonAccessor, IWailaDataAccessor, IWailaEntityAccessor{
|
public class DataAccessorCommon implements IWailaCommonAccessor, IWailaDataAccessor, IWailaEntityAccessor {
|
||||||
|
|
||||||
public World world;
|
private static final Minecraft MC = Minecraft.getMinecraft();
|
||||||
public EntityPlayer player;
|
public World world;
|
||||||
public MovingObjectPosition mop;
|
public EntityPlayer player;
|
||||||
public Vec3 renderingvec = null;
|
public MovingObjectPosition mop;
|
||||||
public Block block;
|
public Vec3 renderingvec = null;
|
||||||
public int blockID;
|
public Block block;
|
||||||
public String blockResource;
|
public int blockID;
|
||||||
public int metadata;
|
public String blockResource;
|
||||||
public TileEntity tileEntity;
|
public int metadata;
|
||||||
public Entity entity;
|
public TileEntity tileEntity;
|
||||||
public NBTTagCompound remoteNbt = null;
|
public Entity entity;
|
||||||
public long timeLastUpdate = System.currentTimeMillis();
|
public NBTTagCompound remoteNbt = null;
|
||||||
public double partialFrame;
|
public long timeLastUpdate = System.currentTimeMillis();
|
||||||
public ItemStack stack;
|
public double partialFrame;
|
||||||
|
public ItemStack stack;
|
||||||
|
|
||||||
public static DataAccessorCommon instance = new DataAccessorCommon();
|
public static DataAccessorCommon instance = new DataAccessorCommon();
|
||||||
|
public float blockBreakDamage;
|
||||||
|
|
||||||
public void set(World _world, EntityPlayer _player, MovingObjectPosition _mop) {
|
public void set(World _world, EntityPlayer _player, MovingObjectPosition _mop) {
|
||||||
this.set(_world, _player, _mop, null, 0.0);
|
this.set(_world, _player, _mop, null, 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void set(World _world, EntityPlayer _player, MovingObjectPosition _mop, EntityLivingBase viewEntity, double partialTicks) {
|
public void set(World _world, EntityPlayer _player, MovingObjectPosition _mop, EntityLivingBase viewEntity,
|
||||||
this.world = _world;
|
double partialTicks) {
|
||||||
this.player = _player;
|
this.world = _world;
|
||||||
this.mop = _mop;
|
this.player = _player;
|
||||||
|
this.mop = _mop;
|
||||||
|
|
||||||
if (this.mop.typeOfHit == MovingObjectType.BLOCK){
|
if (this.mop.typeOfHit == MovingObjectType.BLOCK) {
|
||||||
this.block = world.getBlock(_mop.blockX, _mop.blockY, _mop.blockZ);
|
this.block = world.getBlock(_mop.blockX, _mop.blockY, _mop.blockZ);
|
||||||
this.metadata = world.getBlockMetadata(_mop.blockX, _mop.blockY, _mop.blockZ);
|
this.metadata = world.getBlockMetadata(_mop.blockX, _mop.blockY, _mop.blockZ);
|
||||||
this.tileEntity = world.getTileEntity(_mop.blockX, _mop.blockY, _mop.blockZ);
|
this.tileEntity = world.getTileEntity(_mop.blockX, _mop.blockY, _mop.blockZ);
|
||||||
this.entity = null;
|
this.entity = null;
|
||||||
this.blockID = Block.getIdFromBlock(this.block);
|
this.blockID = Block.getIdFromBlock(this.block);
|
||||||
this.blockResource = GameData.getBlockRegistry().getNameForObject(this.block);
|
this.blockResource = GameData.getBlockRegistry().getNameForObject(this.block);
|
||||||
try{ this.stack = new ItemStack(this.block, 1, this.metadata); } catch (Exception e) {}
|
this.blockBreakDamage = MC.playerController.curBlockDamageMP;
|
||||||
|
try {
|
||||||
|
this.stack = new ItemStack(this.block, 1, this.metadata);
|
||||||
|
} catch (Exception e) {}
|
||||||
|
|
||||||
} else if (this.mop.typeOfHit == MovingObjectType.ENTITY){
|
} else if (this.mop.typeOfHit == MovingObjectType.ENTITY) {
|
||||||
this.block = null;
|
this.block = null;
|
||||||
this.metadata = -1;
|
this.metadata = -1;
|
||||||
this.tileEntity = null;
|
this.tileEntity = null;
|
||||||
this.stack = null;
|
this.stack = null;
|
||||||
this.entity = _mop.entityHit;
|
this.entity = _mop.entityHit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (viewEntity != null){
|
if (viewEntity != null) {
|
||||||
double px = viewEntity.lastTickPosX + (viewEntity.posX - viewEntity.lastTickPosX) * partialTicks;
|
double px = viewEntity.lastTickPosX + (viewEntity.posX - viewEntity.lastTickPosX) * partialTicks;
|
||||||
double py = viewEntity.lastTickPosY + (viewEntity.posY - viewEntity.lastTickPosY) * partialTicks;
|
double py = viewEntity.lastTickPosY + (viewEntity.posY - viewEntity.lastTickPosY) * partialTicks;
|
||||||
double pz = viewEntity.lastTickPosZ + (viewEntity.posZ - viewEntity.lastTickPosZ) * partialTicks;
|
double pz = viewEntity.lastTickPosZ + (viewEntity.posZ - viewEntity.lastTickPosZ) * partialTicks;
|
||||||
this.renderingvec = Vec3.createVectorHelper(_mop.blockX - px, _mop.blockY - py, _mop.blockZ - pz);
|
this.renderingvec = Vec3.createVectorHelper(_mop.blockX - px, _mop.blockY - py, _mop.blockZ - pz);
|
||||||
this.partialFrame = partialTicks;
|
this.partialFrame = partialTicks;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public World getWorld() {return this.world;}
|
public World getWorld() {
|
||||||
|
return this.world;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EntityPlayer getPlayer() {return this.player;}
|
public EntityPlayer getPlayer() {
|
||||||
|
return this.player;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Block getBlock() {return this.block;}
|
public Block getBlock() {
|
||||||
|
return this.block;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getBlockID() {return this.blockID;}
|
public int getBlockID() {
|
||||||
|
return this.blockID;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMetadata() {return this.metadata;}
|
public int getMetadata() {
|
||||||
|
return this.metadata;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity getTileEntity() { return this.tileEntity;}
|
public TileEntity getTileEntity() {
|
||||||
|
return this.tileEntity;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Entity getEntity() {return this.entity;}
|
public Entity getEntity() {
|
||||||
|
return this.entity;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MovingObjectPosition getPosition() {return this.mop;}
|
public MovingObjectPosition getPosition() {
|
||||||
|
return this.mop;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Vec3 getRenderingPosition() {return this.renderingvec;}
|
public Vec3 getRenderingPosition() {
|
||||||
|
return this.renderingvec;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData() {
|
public NBTTagCompound getNBTData() {
|
||||||
if ((this.tileEntity != null) && this.isTagCorrectTileEntity(this.remoteNbt))
|
if ((this.tileEntity != null) && this.isTagCorrectTileEntity(this.remoteNbt)) return remoteNbt;
|
||||||
return remoteNbt;
|
|
||||||
|
|
||||||
if ((this.entity != null) && this.isTagCorrectEntity(this.remoteNbt))
|
if ((this.entity != null) && this.isTagCorrectEntity(this.remoteNbt)) return remoteNbt;
|
||||||
return remoteNbt;
|
|
||||||
|
|
||||||
if (this.tileEntity != null){
|
if (this.tileEntity != null) {
|
||||||
NBTTagCompound tag = new NBTTagCompound();
|
NBTTagCompound tag = new NBTTagCompound();
|
||||||
try{
|
try {
|
||||||
this.tileEntity.writeToNBT(tag);
|
this.tileEntity.writeToNBT(tag);
|
||||||
} catch (Exception e){}
|
} catch (Exception e) {}
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.entity != null){
|
if (this.entity != null) {
|
||||||
NBTTagCompound tag = new NBTTagCompound();
|
NBTTagCompound tag = new NBTTagCompound();
|
||||||
this.entity.writeToNBT(tag);
|
this.entity.writeToNBT(tag);
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNBTData(NBTTagCompound tag){
|
public void setNBTData(NBTTagCompound tag) {
|
||||||
this.remoteNbt = tag;
|
this.remoteNbt = tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isTagCorrectTileEntity(NBTTagCompound tag){
|
private boolean isTagCorrectTileEntity(NBTTagCompound tag) {
|
||||||
if (tag == null || !tag.hasKey("WailaX")){
|
if (tag == null || !tag.hasKey("WailaX")) {
|
||||||
this.timeLastUpdate = System.currentTimeMillis() - 250;
|
this.timeLastUpdate = System.currentTimeMillis() - 250;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int x = tag.getInteger("WailaX");
|
int x = tag.getInteger("WailaX");
|
||||||
int y = tag.getInteger("WailaY");
|
int y = tag.getInteger("WailaY");
|
||||||
int z = tag.getInteger("WailaZ");
|
int z = tag.getInteger("WailaZ");
|
||||||
|
|
||||||
if (x == this.mop.blockX && y == this.mop.blockY && z == this.mop.blockZ)
|
if (x == this.mop.blockX && y == this.mop.blockY && z == this.mop.blockZ) return true;
|
||||||
return true;
|
else {
|
||||||
else {
|
this.timeLastUpdate = System.currentTimeMillis() - 250;
|
||||||
this.timeLastUpdate = System.currentTimeMillis() - 250;
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isTagCorrectEntity(NBTTagCompound tag){
|
private boolean isTagCorrectEntity(NBTTagCompound tag) {
|
||||||
if (tag == null || !tag.hasKey("WailaEntityID")){
|
if (tag == null || !tag.hasKey("WailaEntityID")) {
|
||||||
this.timeLastUpdate = System.currentTimeMillis() - 250;
|
this.timeLastUpdate = System.currentTimeMillis() - 250;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int id = tag.getInteger("WailaEntityID");
|
int id = tag.getInteger("WailaEntityID");
|
||||||
|
|
||||||
if (id == this.entity.getEntityId())
|
if (id == this.entity.getEntityId()) return true;
|
||||||
return true;
|
else {
|
||||||
else {
|
this.timeLastUpdate = System.currentTimeMillis() - 250;
|
||||||
this.timeLastUpdate = System.currentTimeMillis() - 250;
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getNBTInteger(NBTTagCompound tag, String keyname) {
|
public int getNBTInteger(NBTTagCompound tag, String keyname) {
|
||||||
return NBTUtil.getNBTInteger(tag, keyname);
|
return NBTUtil.getNBTInteger(tag, keyname);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getPartialFrame() {
|
public double getPartialFrame() {
|
||||||
return this.partialFrame;
|
return this.partialFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ForgeDirection getSide() {
|
public ForgeDirection getSide() {
|
||||||
return ForgeDirection.getOrientation(this.getPosition().sideHit);
|
return ForgeDirection.getOrientation(this.getPosition().sideHit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getStack() {
|
public ItemStack getStack() {
|
||||||
return this.stack;
|
return this.stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isTimeElapsed(long time){
|
@Override
|
||||||
return System.currentTimeMillis() - this.timeLastUpdate >= time;
|
public float getBlockBreakDamage() {
|
||||||
}
|
return this.blockBreakDamage;
|
||||||
|
}
|
||||||
|
|
||||||
public void resetTimer(){
|
public boolean isTimeElapsed(long time) {
|
||||||
this.timeLastUpdate = System.currentTimeMillis();
|
return System.currentTimeMillis() - this.timeLastUpdate >= time;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void resetTimer() {
|
||||||
public String getBlockQualifiedName() {
|
this.timeLastUpdate = System.currentTimeMillis();
|
||||||
return this.blockResource;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getBlockQualifiedName() {
|
||||||
|
return this.blockResource;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loaded 100 of 212 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user