mirror of
https://github.com/GTNewHorizons/Draconic-Evolution.git
synced 2026-10-26 22:33:58 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cdc57215e3 | ||
|
|
9f42531f37 | ||
|
|
95453b430e | ||
|
|
3635266bd5 | ||
|
|
fedee1ba43 | ||
|
|
6f183b615e | ||
|
|
15b257d120 | ||
|
|
4ead9f53fb | ||
|
|
305e09ae4f | ||
|
|
9009b1372a | ||
|
|
8dc27474ec | ||
|
|
4c016707a4 | ||
|
|
abbe4c1017 | ||
|
|
c067e59981 | ||
|
|
7f87295901 | ||
|
|
e564437ed7 | ||
|
|
f483529855 | ||
|
|
da451de69f | ||
|
|
8b8082cd7b | ||
|
|
92c2bacc74 | ||
|
|
7620d7ff02 | ||
|
|
bd995e6d5a | ||
|
|
05ebbf6936 | ||
|
|
51b047c1eb | ||
|
|
245b5c7b06 | ||
|
|
7ada07b5ac | ||
|
|
62e5e74f95 | ||
|
|
1517f9fdfb | ||
|
|
b433ac3c44 | ||
|
|
0937d7b2d6 | ||
|
|
99c3fb0b74 | ||
|
|
04c781df16 | ||
|
|
7fb5b8d3c7 | ||
|
|
8fc59e271e | ||
|
|
1ca5aff7d9 | ||
|
|
0e4101e4e5 | ||
|
|
c21e389db2 | ||
|
|
499dca4a7b | ||
|
|
dd9d3146ec | ||
|
|
6bb77d71b9 | ||
|
|
1515ce27d1 | ||
|
|
bc7929de29 | ||
|
|
c8dcdce141 | ||
|
|
95a25957d4 | ||
|
|
d7d6c4e0c0 | ||
|
|
b0bc154516 | ||
|
|
333fb4e274 | ||
|
|
5e504c7c10 | ||
|
|
b7bf08a178 | ||
|
|
a671627f0b | ||
|
|
40c064b8c7 | ||
|
|
8e9e1e98d7 | ||
|
|
a755869dbd | ||
|
|
0f3e15ce25 | ||
|
|
18cda6a4ee | ||
|
|
565fc72d24 | ||
|
|
e039519acf | ||
|
|
bf5f0bcb5b | ||
|
|
7bca3009b6 | ||
|
|
f7cac98ad5 | ||
|
|
07ed88515e | ||
|
|
46e5d8a785 | ||
|
|
2835b7a54e | ||
|
|
2331e33ebb | ||
|
|
1fa9420ec2 | ||
|
|
ee65279d0b | ||
|
|
8efee8630a | ||
|
|
740ceb9857 | ||
|
|
041fefe81a | ||
|
|
d829c2f95f | ||
|
|
101a1d46a8 | ||
|
|
ab82b92ae2 | ||
|
|
7e69b4b728 | ||
|
|
69115e24dc | ||
|
|
3e062858c8 | ||
|
|
ea03519563 | ||
|
|
9a0231257c | ||
|
|
0b4a807bea | ||
|
|
9780cd92b4 | ||
|
|
8e8a3b2f64 | ||
|
|
7691b37d60 | ||
|
|
f0d331970f | ||
|
|
41b0e600fa | ||
|
|
8858c596fd | ||
|
|
6c48064031 | ||
|
|
0bf760cca3 | ||
|
|
76406d2d78 | ||
|
|
d71e388119 | ||
|
|
5252678a45 | ||
|
|
c4a653f187 | ||
|
|
04cf0c0239 | ||
|
|
565de0de03 | ||
|
|
cac90210c3 | ||
|
|
c0a58239a5 | ||
|
|
a534ca2432 | ||
|
|
c7e5643fcd | ||
|
|
1d54fb5779 | ||
|
|
b2bc93ec18 | ||
|
|
2aad40ebe0 | ||
|
|
398786a179 | ||
|
|
1ed0354744 | ||
|
|
17c352895c | ||
|
|
65490f6c83 | ||
|
|
0da29db9be | ||
|
|
f54c69738e | ||
|
|
adf73c81f4 | ||
|
|
276b17fc9d | ||
|
|
7ab6b187c1 | ||
|
|
e96dc8d558 | ||
|
|
7286d30c26 | ||
|
|
6986bbcf0e | ||
|
|
089a43ce68 | ||
|
|
165cc7e77d | ||
|
|
508fced1ae | ||
|
|
335927954f | ||
|
|
eba5e16f16 | ||
|
|
be1f68f9c8 | ||
|
|
a8c12123e9 | ||
|
|
9bb9bf4fd7 | ||
|
|
747b616165 | ||
|
|
d31dde29cf | ||
|
|
fc14d0d593 | ||
|
|
5b110be984 | ||
|
|
8c9161dc83 | ||
|
|
7e1fe75c55 | ||
|
|
823c54284d | ||
|
|
d032759ea7 | ||
|
|
25cd9fe361 | ||
|
|
07f477b898 | ||
|
|
fe4ab6a67a | ||
|
|
5333c14329 | ||
|
|
5dd720fbab | ||
|
|
6121b635ad | ||
|
|
78f4ca4b62 | ||
|
|
e8a6bcca07 | ||
|
|
ad254fbded | ||
|
|
d01d10f25e | ||
|
|
a8478c00dc | ||
|
|
1f144067a9 | ||
|
|
9d2c64c34c | ||
|
|
37fbe0a668 | ||
|
|
1eba34b256 | ||
|
|
d5b4687dbf | ||
|
|
7cf2bcca38 | ||
|
|
cef6034f0d | ||
|
|
505da020e4 | ||
|
|
7ca87b36cd |
No files matched your search
@@ -0,0 +1,2 @@
|
||||
# Ignore spotlessApply reformat
|
||||
eba5e16f166817931ec95948a8938cc9c4fdc722
|
||||
@@ -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
|
||||
@@ -0,0 +1,27 @@
|
||||
if [[ -d "run/crash-reports" ]]; then
|
||||
echo "Crash reports detected:"
|
||||
cat $directory/*
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep --quiet "Fatal errors were detected" server.log; then
|
||||
echo "Fatal errors detected:"
|
||||
cat server.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep --quiet "The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED" server.log; then
|
||||
echo "Server force stopped:"
|
||||
cat server.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep --quiet 'Done .+ For help, type "help" or "?"' server.log; then
|
||||
echo "Server didn't finish startup:"
|
||||
cat server.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "No crash reports detected"
|
||||
exit 0
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
name: Build and test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, main ]
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master
|
||||
secrets: inherit
|
||||
@@ -0,0 +1,17 @@
|
||||
name: Optimize images
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, main, release/** ]
|
||||
paths:
|
||||
- "**/*.png"
|
||||
|
||||
push:
|
||||
branches: [ master, main, release/** ]
|
||||
paths:
|
||||
- "**/*.png"
|
||||
|
||||
jobs:
|
||||
optimize-images:
|
||||
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/optimize-images.yml@master
|
||||
secrets: inherit
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
name: Release tagged build
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: [ '*' ]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
release-tags:
|
||||
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/release-tags.yml@master
|
||||
secrets: inherit
|
||||
+31
-29
@@ -1,30 +1,32 @@
|
||||
# Exclude Everything!!!
|
||||
|
||||
/*
|
||||
|
||||
# Linux temporary files
|
||||
|
||||
/*~
|
||||
|
||||
# Except the stuff i want to keep
|
||||
|
||||
# Gradle Stuff
|
||||
!gradle/
|
||||
!gradlew
|
||||
.gradle
|
||||
.settings
|
||||
/.idea/
|
||||
/run/
|
||||
/build/
|
||||
/eclipse/
|
||||
.classpath
|
||||
.project
|
||||
/bin/
|
||||
/config/
|
||||
/crash-reports/
|
||||
/logs/
|
||||
options.txt
|
||||
/saves/
|
||||
usernamecache.json
|
||||
banned-ips.json
|
||||
banned-players.json
|
||||
eula.txt
|
||||
ops.json
|
||||
server.properties
|
||||
servers.dat
|
||||
usercache.json
|
||||
whitelist.json
|
||||
/out/
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
src/main/resources/mixins.*.json
|
||||
*.bat
|
||||
*.DS_Store
|
||||
!gradlew.bat
|
||||
!build.gradle
|
||||
!build.properties
|
||||
!settings.gradle
|
||||
|
||||
# Git Stuff
|
||||
!.gitignore
|
||||
|
||||
# Other Important Files
|
||||
!LICENSE
|
||||
!README.md
|
||||
!Change Log.txt
|
||||
!VERSION.txt
|
||||
|
||||
# Other Important Folders
|
||||
!src/
|
||||
|
||||
layout.json
|
||||
@@ -0,0 +1,3 @@
|
||||
# Any Github changes require admin approval
|
||||
/.github/** @GTNewHorizons/admin
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
## Description
|
||||
|
||||
## Base information
|
||||
* Minecraft version:
|
||||
* Minecraft Forge version:
|
||||
* Draconic Evolution version:
|
||||
|
||||
## Mod List or Mod Pack (include version)
|
||||
...
|
||||
list other mods being used
|
||||
...
|
||||
|
||||
## Crash report
|
||||
```
|
||||
CRASH REPORT HERE
|
||||
```
|
||||
@@ -1,19 +0,0 @@
|
||||
Copyright (c) 2013-2016 brandon3055
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
+165
@@ -0,0 +1,165 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
@@ -1,7 +1,23 @@
|
||||
Draconic-Evolution
|
||||
==================
|
||||
|
||||
Draconic Evolution adds powerful new tools, Items, weapons and Armor. The premise is the enigmatic ore - Draconium. As you progress you find it has many uses from the mundane such as machines and items, to the near-mystical at the top with Awakened Draconium to make extremely powerful armor and tools.
|
||||
Forked and maintained by the GTNH Team for 1.7.10.
|
||||
|
||||
Draconic Evolution adds powerful new tools, Items, weapons and Armor. The premise is the enigmatic ore - Draconium.
|
||||
As you progress you find it has many uses from the mundane such as machines and items, to the near-mystical at the
|
||||
top with Awakened Draconium to make extremely powerful armor and tools.
|
||||
|
||||
## License / Use in Modpacks
|
||||
This mod is [licensed under the **MIT license**](https://github.com/brandon3055/Draconic-Evolution/blob/master/LICENSE). All **assets are public domain**, unless otherwise stated; all are free to be distributed as long as the license / source credits are kept. This means you can use this mod in any mod pack **as you please**.
|
||||
This mod is [licensed under the **LGPL license**](https://github.com/GTNewHorizons/Draconic-Evolution/blob/master/LICENSE.txt).
|
||||
All **assets are public domain**, unless otherwise stated; all are free to be distributed as long as the license / source credits are kept.
|
||||
This means you can use this mod in any mod pack **as you please**; however if you make any changes you must make the source available!
|
||||
|
||||
Original code Copyright (c) 2013-2016 brandon3055 and was licensed MIT
|
||||
|
||||
GTNH Modifications:
|
||||
|
||||
Copyright (c) 2021 GTNH Team
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
|
||||
Use this however you want, but please give back any modifications!
|
||||
@@ -1,3 +0,0 @@
|
||||
Version:1.0.2h
|
||||
Snapshot:0
|
||||
ReleaseNote:Fixed issue with charging bows.
|
||||
+3
-99
@@ -1,101 +1,5 @@
|
||||
//version: 1707058017
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
}
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
||||
}
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhconvention'
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name 'CB Maven FS'
|
||||
url "http://chickenbones.net/maven/"
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
// Define properties file
|
||||
ext.configFile = file "build.properties"
|
||||
|
||||
configFile.withReader {
|
||||
// Load config. It shall from now be referenced as simply config or project.config
|
||||
def prop = new Properties()
|
||||
prop.load(it)
|
||||
project.ext.config = new ConfigSlurper().parse prop
|
||||
}
|
||||
|
||||
version = "${config.minecraft_version}-${config.mod_version}"
|
||||
group = "com.brandon3055.draconicevolution"
|
||||
archivesBaseName = "Draconic-Evolution"
|
||||
|
||||
minecraft {
|
||||
version = config.minecraft_version + "-" + config.forge_version
|
||||
runDir = "run"
|
||||
}
|
||||
|
||||
|
||||
|
||||
dependencies {
|
||||
compile "codechicken:CodeChickenLib:${config.minecraft_version}-${config.CCLIB_version}:dev"
|
||||
compile "codechicken:CodeChickenCore:${config.minecraft_version}-${config.ccc_version}:dev"
|
||||
compile "codechicken:NotEnoughItems:${config.minecraft_version}-${config.NEI_version}:dev"
|
||||
|
||||
if (file('../BrandonsCore/').exists()) compile project('../BrandonsCore')
|
||||
}
|
||||
|
||||
processResources
|
||||
{
|
||||
// this will ensure that this task is redone when the versions change.
|
||||
inputs.property "version", project.version
|
||||
inputs.property "mcversion", project.minecraft.version
|
||||
|
||||
// replace stuff in mcmod.info, nothing else
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include 'mcmod.info'
|
||||
|
||||
// replace version and mcversion
|
||||
expand 'version':project.version, 'mcversion':project.minecraft.version
|
||||
}
|
||||
|
||||
// copy everything else, thats not the mcmod.info
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude 'mcmod.info'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'idea'
|
||||
idea {
|
||||
module {
|
||||
inheritOutputDirs = true
|
||||
}
|
||||
}
|
||||
|
||||
task deobfJar(type: Jar) { // Generate deobfuscated
|
||||
from sourceSets.main.output
|
||||
classifier = 'deobf'
|
||||
}
|
||||
|
||||
task sourceJar(type: Jar) { // Generate sources
|
||||
from sourceSets.main.allSource
|
||||
classifier = 'sources'
|
||||
}
|
||||
|
||||
tasks.build.dependsOn('sourceJar', 'deobfJar')
|
||||
|
||||
artifacts {
|
||||
archives deobfJar
|
||||
archives sourceJar
|
||||
archives jar
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
minecraft_version=1.7.10
|
||||
mod_version=1.0.2l
|
||||
forge_version=10.13.4.1614-1.7.10
|
||||
CCLIB_version=1.1.3.140
|
||||
NEI_version=1.0.5.120
|
||||
ccc_version=1.0.7.47
|
||||
|
||||
|
||||
//Version System A.B.CD A=Minecraft version (increments with each new minecraft version) B=Major mod change (May break saves) C=Release Number (Increments with each public release) D=Bugfix version (a-z)
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api("curse.maven:cofh-lib-220333:2388748")
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.9.53:dev")
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:ForestryMC:4.11.14:api") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:OpenComputers:1.12.38-GTNH:api") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.8.93-GTNH:dev") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:CodeChickenCore:1.4.12:dev") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:inventory-tweaks:1.7.1:dev") {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.11-GTNH:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:Botania:1.13.36-GTNH:dev") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.461:dev") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:Backhand:1.8.8:dev") {transitive = false}
|
||||
|
||||
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") {transitive = false}
|
||||
compileOnly("curse.maven:computercraft-67504:2269339") {transitive = false}
|
||||
|
||||
compileOnly('curse.maven:automagy-222153:2285272')
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.25:dev')
|
||||
runtimeOnly("com.github.GTNewHorizons:NotEnoughItems:2.8.118-GTNH:dev")
|
||||
}
|
||||
@@ -0,0 +1,243 @@
|
||||
# ExampleMod tag to use as Blowdryer (Spotless, etc.) settings version, leave empty to disable.
|
||||
# LOCAL to test local config updates.
|
||||
gtnh.settings.blowdryerTag = 0.2.0
|
||||
|
||||
# Human-readable mod name, available for mcmod.info population.
|
||||
modName = Draconic Evolution
|
||||
|
||||
# Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation.
|
||||
# Conventionally lowercase.
|
||||
modId = DraconicEvolution
|
||||
|
||||
# Root package of the mod, used to find various classes in other properties,
|
||||
# mcmod.info substitution, enabling assertions in run tasks, etc.
|
||||
modGroup = com.brandon3055.draconicevolution
|
||||
|
||||
# Whether to use modGroup as the maven publishing group.
|
||||
# When false, com.github.GTNewHorizons is used.
|
||||
useModGroupForPublishing = false
|
||||
|
||||
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
|
||||
autoUpdateBuildScript = false
|
||||
|
||||
# Version of Minecraft to target
|
||||
minecraftVersion = 1.7.10
|
||||
|
||||
# Version of Minecraft Forge to target
|
||||
forgeVersion = 10.13.4.1614
|
||||
|
||||
# Specify an MCP channel for dependency deobfuscation and the deobfParams task.
|
||||
channel = stable
|
||||
|
||||
# Specify an MCP mappings version for dependency deobfuscation and the deobfParams task.
|
||||
mappingsVersion = 12
|
||||
|
||||
# Defines other MCP mappings for dependency deobfuscation.
|
||||
remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
|
||||
|
||||
# Select a default username for testing your mod. You can always override this per-run by running
|
||||
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
|
||||
developmentEnvironmentUserName = Developer
|
||||
|
||||
# Enables modern Java syntax support. Valid values:
|
||||
# - false: No modern syntax, Java 8 only
|
||||
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
|
||||
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
|
||||
# - modern: Native modern Java bytecode, no downgrading
|
||||
enableModernJavaSyntax = jabel
|
||||
|
||||
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
|
||||
# and should *not* be used in most situations. -1 disables this.
|
||||
# forceToolchainVersion = -1
|
||||
|
||||
# Target JVM version for JVM Downgrader bytecode downgrading.
|
||||
# Only used when enableModernJavaSyntax = jvmDowngrader
|
||||
# downgradeTargetVersion = 8
|
||||
|
||||
# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
|
||||
# Classes will be available in META-INF/versions/N/ for each version N in this list.
|
||||
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
|
||||
# jvmDowngraderMultiReleaseVersions = 21,25
|
||||
|
||||
# Specifies how JVM Downgrader API stubs are provided. Options:
|
||||
# - shade: Shade minimized stubs into the jar
|
||||
# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint)
|
||||
# - external: Another dependency provides stubs (no constraint, no warning)
|
||||
# - (empty): Warning reminding you to configure stubs
|
||||
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
|
||||
# jvmDowngraderStubsProvider =
|
||||
|
||||
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
||||
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
||||
enableGenericInjection = false
|
||||
|
||||
# Generate a class with a String field for the mod version named as defined below.
|
||||
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
|
||||
# If gradleTokenVersion is empty or missing, the field will not be present in the class.
|
||||
generateGradleTokenClass = com.brandon3055.draconicevolution.DETags
|
||||
|
||||
# Name of the token containing the project's current version to generate/replace.
|
||||
gradleTokenVersion = VERSION
|
||||
|
||||
# [DEPRECATED] Mod ID replacement token.
|
||||
gradleTokenModId =
|
||||
|
||||
# [DEPRECATED] Mod name replacement token.
|
||||
gradleTokenModName =
|
||||
|
||||
# [DEPRECATED] Mod Group replacement token.
|
||||
gradleTokenGroupName =
|
||||
|
||||
# [DEPRECATED]
|
||||
# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java
|
||||
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
# 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, [...]).
|
||||
# Leave these properties empty to skip individual token replacements.
|
||||
replaceGradleTokenInFile =
|
||||
|
||||
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
|
||||
# leave this property empty.
|
||||
# Example value: (apiPackage = api) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.api
|
||||
apiPackage = api
|
||||
|
||||
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
|
||||
# There can be multiple files in a space-separated list.
|
||||
# Example value: mymodid_at.cfg nei_at.cfg
|
||||
accessTransformersFile =
|
||||
|
||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||
usesMixins = false
|
||||
|
||||
# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
|
||||
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
|
||||
# Mixin classes will have access to "main" classes, but not the other way around.
|
||||
separateMixinSourceSet =
|
||||
|
||||
# Adds some debug arguments like verbose output and class export.
|
||||
usesMixinDebug = false
|
||||
|
||||
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||
mixinPlugin =
|
||||
|
||||
# Specify the package that contains all of your Mixins. The package must exist or
|
||||
# the build will fail. If you have a package property defined in your mixins.<modid>.json,
|
||||
# it must match with this or the build will fail.
|
||||
mixinsPackage =
|
||||
|
||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||
# This parameter is for legacy compatibility only
|
||||
# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin
|
||||
coreModClass =
|
||||
|
||||
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
|
||||
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
|
||||
containsMixinsAndOrCoreModOnly = false
|
||||
|
||||
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
|
||||
forceEnableMixins = false
|
||||
|
||||
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated into your jar. It is your
|
||||
# responsibility to check the license and request permission for distribution if required.
|
||||
usesShadowedDependencies = false
|
||||
|
||||
# If disabled, won't remove unused classes from shadowed dependencies. Some libraries use reflection to access
|
||||
# their own classes, making the minimization unreliable.
|
||||
minimizeShadowedDependencies = true
|
||||
|
||||
# If disabled, won't rename the shadowed classes.
|
||||
relocateShadowedDependencies = true
|
||||
|
||||
# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
|
||||
includeWellKnownRepositories = true
|
||||
|
||||
# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated
|
||||
# list of strings, with the acceptable keys being(case does not matter):
|
||||
# cursemaven
|
||||
# modrinth
|
||||
excludeWellKnownRepositories =
|
||||
|
||||
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
|
||||
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
|
||||
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
|
||||
usesMavenPublishing = true
|
||||
|
||||
# Maven repository to publish the mod to.
|
||||
# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/
|
||||
|
||||
# Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token.
|
||||
#
|
||||
# The project's ID on Modrinth. Can be either the slug or the ID.
|
||||
# Leave this empty if you don't want to publish to Modrinth.
|
||||
modrinthProjectId =
|
||||
|
||||
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
|
||||
# Syntax: scope1-type1:name1;scope2-type2:name2;...
|
||||
# Where scope can be one of [required, optional, incompatible, embedded],
|
||||
# type can be one of [project, version],
|
||||
# and the name is the Modrinth project or version slug/id of the other mod.
|
||||
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
|
||||
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
|
||||
modrinthRelations =
|
||||
|
||||
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
|
||||
#
|
||||
# The project's numeric ID on CurseForge. You can find this in the About Project box.
|
||||
# Leave this empty if you don't want to publish on CurseForge.
|
||||
curseForgeProjectId =
|
||||
|
||||
# Comma-separated supported CurseForge environments: client, server (case-insensitive).
|
||||
# Use client or server for mods that only support one environment. Defaults to client,server.
|
||||
# These tags describe where the mod can run, not whether installation is required on both sides.
|
||||
curseForgeEnvironments = client,server
|
||||
|
||||
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
|
||||
# Syntax: type1:name1;type2:name2;...
|
||||
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
||||
# and the name is the CurseForge project slug of the other mod.
|
||||
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
|
||||
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
|
||||
curseForgeRelations =
|
||||
|
||||
# Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older
|
||||
# projects. New projects should not use this parameter.
|
||||
customArchiveBaseName = Draconic-Evolution
|
||||
|
||||
# Optional parameter to customize the default working directory used by the runClient* tasks. Relative to the project directory.
|
||||
# runClientWorkingDirectory = run/client
|
||||
|
||||
# Optional parameter to customize the default working directory used by the runServer* tasks. Relative to the project directory.
|
||||
# runServerWorkingDirectory = run/server
|
||||
|
||||
# Optional parameter to have the build automatically fail if an illegal version is used.
|
||||
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
|
||||
# The check is ONLY performed if the version is a git tag.
|
||||
# Note: the specified string must be escaped, so e.g. 1\\.1\\.\\d+ instead of 1\.1\.\d+
|
||||
# versionPattern =
|
||||
|
||||
# Uncomment to prevent the source code from being published.
|
||||
# noPublishedSources = true
|
||||
|
||||
# Uncomment this to disable Spotless checks.
|
||||
# This should only be uncommented to keep it easier to sync with upstream/other forks.
|
||||
# That is, if there is no other active fork/upstream, NEVER change this.
|
||||
# disableSpotless = true
|
||||
|
||||
# Uncomment this to disable Checkstyle checks (currently wildcard import check).
|
||||
# disableCheckstyle = true
|
||||
|
||||
# Override the IDEA build type. Valid values are: "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle"
|
||||
# (force use delegated build).
|
||||
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||
# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be native build.
|
||||
# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want!
|
||||
# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you.
|
||||
# ideaOverrideBuildType = idea
|
||||
|
||||
# Whether IDEA should run spotless checks when pressing the Build button.
|
||||
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||
# ideaCheckSpotlessOnBuild = true
|
||||
|
||||
# Non-GTNH properties
|
||||
org.gradle.configuration-cache = true
|
||||
org.gradle.parallel = true
|
||||
@@ -0,0 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9064f22734b42ac03e85df04b632e167/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/4d0277c49991306ac78048580fe34bcf/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a9fa3b809e484a1e1ac4308a5dda661a/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/aa99913fa6d767d899ffc96082da01ca/redirect
|
||||
toolchainVersion=25
|
||||
Vendored
BIN
Binary file not shown.
+3
-2
@@ -1,6 +1,7 @@
|
||||
#Fri Feb 20 03:02:45 EST 2015
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip
|
||||
@@ -1,79 +1,128 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## 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/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
MAX_FD=maximum
|
||||
|
||||
warn ( ) {
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
} >&2
|
||||
|
||||
die ( ) {
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||
if $cygwin ; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
fi
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# 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\"`/" >&-
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >&-
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
@@ -82,83 +131,118 @@ Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
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.
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# 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, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
# 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" ;;
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
Vendored
+46
-43
@@ -1,4 +1,22 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@@ -8,26 +26,30 @@
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
@@ -35,54 +57,35 @@ goto fail
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@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%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
before_install:
|
||||
- ./gradlew setupCIWorkspace
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
// Add any additional repositories for your dependencies here
|
||||
|
||||
repositories {
|
||||
}
|
||||
+23
-1
@@ -1 +1,23 @@
|
||||
if(file('../BrandonsCore/').exists()) { include '../BrandonsCore' }
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven {
|
||||
// RetroFuturaGradle
|
||||
name "GTNH Maven"
|
||||
url "https://nexus.gtnewhorizons.com/repository/public/"
|
||||
mavenContent {
|
||||
includeGroup("com.gtnewhorizons")
|
||||
includeGroupByRegex("com\\.gtnewhorizons\\..+")
|
||||
}
|
||||
}
|
||||
gradlePluginPortal()
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.34'
|
||||
}
|
||||
|
||||
|
||||
@@ -1,81 +1,99 @@
|
||||
package com.brandon3055.draconicevolution;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.ClientProxy;
|
||||
import com.brandon3055.draconicevolution.client.creativetab.DETab;
|
||||
import com.brandon3055.draconicevolution.common.CommonProxy;
|
||||
import com.brandon3055.draconicevolution.common.lib.OreDoublingRegistry;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppedEvent;
|
||||
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
|
||||
@Mod(modid = References.MODID, name = References.MODNAME, version = References.VERSION, canBeDeactivated = false, guiFactory = References.GUIFACTORY, dependencies = "after:NotEnoughItems;" +
|
||||
"after:NotEnoughItems;" +
|
||||
"after:ThermalExpansion;" +
|
||||
"after:ThermalFoundation;" +
|
||||
"required-after:BrandonsCore@[1.0.0.11,);")
|
||||
@Mod(
|
||||
modid = References.MODID,
|
||||
name = References.MODNAME,
|
||||
version = References.VERSION,
|
||||
canBeDeactivated = false,
|
||||
guiFactory = References.GUIFACTORY,
|
||||
dependencies = "after:NotEnoughItems;" + "after:ThermalExpansion;"
|
||||
+ "after:ThermalFoundation;"
|
||||
+ "required-after:gtnhlib@[0.9.47,);")
|
||||
public class DraconicEvolution {
|
||||
|
||||
@Mod.Instance(References.MODID)
|
||||
public static DraconicEvolution instance;
|
||||
|
||||
@SidedProxy(clientSide = References.CLIENTPROXYLOCATION, serverSide = References.SERVERPROXYLOCATION)
|
||||
@SidedProxy(
|
||||
clientSide = "com.brandon3055.draconicevolution.client.ClientProxy",
|
||||
serverSide = "com.brandon3055.draconicevolution.common.CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
|
||||
public static CreativeTabs tabToolsWeapons = new DETab(CreativeTabs.getNextID(), References.MODID, "toolsAndWeapons", 0);
|
||||
public static CreativeTabs tabBlocksItems = new DETab(CreativeTabs.getNextID(), References.MODID, "blocksAndItems", 1);
|
||||
public static CreativeTabs tabToolsWeapons = new DETab(
|
||||
CreativeTabs.getNextID(),
|
||||
References.MODID,
|
||||
"toolsAndWeapons",
|
||||
0);
|
||||
public static CreativeTabs tabBlocksItems = new DETab(
|
||||
CreativeTabs.getNextID(),
|
||||
References.MODID,
|
||||
"blocksAndItems",
|
||||
1);
|
||||
|
||||
public static final String networkChannelName = "DEvolutionNC";
|
||||
public static SimpleNetworkWrapper network;
|
||||
|
||||
public static boolean debug = false;//todo
|
||||
public static boolean debug = false; // todo
|
||||
|
||||
public static Enchantment reaperEnchant;
|
||||
|
||||
public static final boolean isAutomagyLoaded = Loader.isModLoaded("Automagy");
|
||||
public static final boolean isEioLoaded = Loader.isModLoaded("EnderIO");
|
||||
|
||||
public DraconicEvolution() {
|
||||
LogHelper.info("Hello Minecraft!!!");
|
||||
}
|
||||
|
||||
public static ClientProxy clientProxy() {
|
||||
if (proxy.isClient()) {
|
||||
return ((ClientProxy) proxy);
|
||||
}
|
||||
throw new IllegalStateException("Accessed ClientProxy from dedicated server");
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public static void preInit(final FMLPreInitializationEvent event) {
|
||||
if (debug) LogHelper.info("Initialization");
|
||||
|
||||
// event.getModMetadata().autogenerated = false;
|
||||
// event.getModMetadata().credits = "";
|
||||
// event.getModMetadata().description = "This is a mod originally made for the Tolkiencraft mod pack";
|
||||
// event.getModMetadata().authorList = Arrays.asList("brandon3055");
|
||||
// event.getModMetadata().logoFile = "banner.png";
|
||||
// event.getModMetadata().url = "http://www.brandon3055.com/";
|
||||
// event.getModMetadata().version = References.VERSION + "-MC1.7.10";
|
||||
|
||||
proxy.preInit(event);
|
||||
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void init(final FMLInitializationEvent event) {
|
||||
if (debug) System.out.println("init()");
|
||||
proxy.init(event);
|
||||
|
||||
// ===
|
||||
|
||||
// ===
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void postInit(final FMLPostInitializationEvent event) {
|
||||
if (debug) System.out.println("postInit()");
|
||||
|
||||
proxy.postInit(event);
|
||||
}
|
||||
|
||||
//FMLInterModComms.sendMessage("DraconicEvolution", "addChestRecipe:item.coal", new ItemStack(Items.diamond, 2));
|
||||
@Mod.EventHandler
|
||||
public void onServerStopped(final FMLServerStoppedEvent event) {
|
||||
if (debug) System.out.println("onServerStopped()");
|
||||
proxy.onServerStopped(event);
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void processMessage(FMLInterModComms.IMCEvent event) {
|
||||
for (FMLInterModComms.IMCMessage m : event.getMessages()) {
|
||||
@@ -87,4 +105,4 @@ public class DraconicEvolution {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,18 @@
|
||||
package com.brandon3055.draconicevolution.api;
|
||||
|
||||
import com.brandon3055.brandonscore.common.utills.DataUtills;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.utils.DataUtils;
|
||||
import com.brandon3055.draconicevolution.common.world.ChaosWorldGenHandler;
|
||||
import com.brandon3055.draconicevolution.common.world.DraconicWorldGenerator;
|
||||
import com.brandon3055.draconicevolution.common.world.WorldGenEnderComet;
|
||||
import com.brandon3055.draconicevolution.common.world.WorldGenEnderIsland;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 11/7/2015.
|
||||
@@ -30,9 +35,9 @@ public class GeneratorOverride {
|
||||
}
|
||||
|
||||
/**
|
||||
* This can be used to generate a chaos island at a given set of coordinates
|
||||
* This method needs to be called foe every chunk in a 360 x 360 block area.
|
||||
* Its ok to run it on a larger area it just wont do anything to chunks outside that area.
|
||||
* This can be used to generate a chaos island at a given set of coordinates This method needs to be called foe
|
||||
* every chunk in a 360 x 360 block area. Its ok to run it on a larger area it just wont do anything to chunks
|
||||
* outside that area.
|
||||
*
|
||||
* @param chunkX the x pos of the chunk being generated (this is the xCoord divided by 16 not the xCoord itself)
|
||||
* @param chunkZ the z pos of the chunk being generated (this is the zCoord divided by 16 not the zCoord itself)
|
||||
@@ -40,8 +45,10 @@ public class GeneratorOverride {
|
||||
* @param centerZ this should be the center of the area you are spawning the island it (this is the actual zCoord)
|
||||
* @param random a random
|
||||
*/
|
||||
public static void generateChaosChunk(World world, int chunkX, int chunkZ, int centerX, int centerZ, Random random) {
|
||||
ChaosWorldGenHandler.generateChunk(world, chunkX, chunkZ, new DataUtills.XZPair<Integer, Integer>(centerX, centerZ), random);
|
||||
public static void generateChaosChunk(World world, int chunkX, int chunkZ, int centerX, int centerZ,
|
||||
Random random) {
|
||||
ChaosWorldGenHandler
|
||||
.generateChunk(world, chunkX, chunkZ, new DataUtils.XZPair<Integer, Integer>(centerX, centerZ), random);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,4 +71,25 @@ public class GeneratorOverride {
|
||||
public static void setOreEnabledInEnd(boolean cometsEnabled) {
|
||||
DraconicWorldGenerator.oreEnabledInEnd = cometsEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns coordinates of the nearest chaos island for the given chunk, or {@code null}
|
||||
* <p>
|
||||
* This is for mods who need to know where chaos islands generate, for example to avoid overlapping their own world
|
||||
* features.
|
||||
*
|
||||
* @param chunkX chunk X position
|
||||
* @param chunkZ chunk Z position
|
||||
* @return Chaos Island Center coordinates, or {@code null} if none generates for that cell
|
||||
*/
|
||||
public static @Nullable ChunkCoordinates getNearestChaosIslandCenter(int chunkX, int chunkZ) {
|
||||
if (!DraconicWorldGenerator.chaosIslandsEnabled || !ConfigHandler.generateChaosIslands) return null;
|
||||
|
||||
DataUtils.XZPair<Integer, Integer> center = ChaosWorldGenHandler.getClosestChaosSpawn(chunkX, chunkZ);
|
||||
|
||||
// tHe island in (0, 0) is never generated
|
||||
if (center.x == 0 && center.z == 0) return null;
|
||||
|
||||
return new ChunkCoordinates(center.x, 80, center.z);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ package com.brandon3055.draconicevolution.api;
|
||||
* Created by Brandon on 6/03/2015.
|
||||
*/
|
||||
public interface IExtendedRFStorage {
|
||||
|
||||
/**
|
||||
* I will probably leave these here forever but i highly recommend switching as i may remove then at some point.
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/**
|
||||
* Created by Brandon on 19/03/2015.
|
||||
*/
|
||||
@API(apiVersion = "1.2", owner = "DraconicEvolution", provides = "DraconicEvolution|API") package com.brandon3055.draconicevolution.api;
|
||||
@API(apiVersion = "1.2", owner = "DraconicEvolution", provides = "DraconicEvolution|API")
|
||||
package com.brandon3055.draconicevolution.api;
|
||||
|
||||
import cpw.mods.fml.common.API;
|
||||
import cpw.mods.fml.common.API;
|
||||
@@ -1,37 +1,110 @@
|
||||
package com.brandon3055.draconicevolution.client;
|
||||
|
||||
import static com.brandon3055.draconicevolution.integration.nei.IMCForNEI.IMCSender;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.ISound;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.client.handler.ClientEventHandler;
|
||||
import com.brandon3055.draconicevolution.client.handler.HudHandler;
|
||||
import com.brandon3055.draconicevolution.client.handler.ItemDisplayManager;
|
||||
import com.brandon3055.draconicevolution.client.handler.ParticleHandler;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.keybinding.KeyBindings;
|
||||
import com.brandon3055.draconicevolution.client.handler.ShieldRenderHandler;
|
||||
import com.brandon3055.draconicevolution.client.keybinding.KeyInputHandler;
|
||||
import com.brandon3055.draconicevolution.client.render.IRenderTweak;
|
||||
import com.brandon3055.draconicevolution.client.render.block.*;
|
||||
import com.brandon3055.draconicevolution.client.render.entity.*;
|
||||
import com.brandon3055.draconicevolution.client.render.item.*;
|
||||
import com.brandon3055.draconicevolution.client.render.block.RenderCrystal;
|
||||
import com.brandon3055.draconicevolution.client.render.block.RenderDraconiumChest;
|
||||
import com.brandon3055.draconicevolution.client.render.block.RenderEarthItem;
|
||||
import com.brandon3055.draconicevolution.client.render.block.RenderEnergyInfuser;
|
||||
import com.brandon3055.draconicevolution.client.render.block.RenderParticleGen;
|
||||
import com.brandon3055.draconicevolution.client.render.block.RenderPortal;
|
||||
import com.brandon3055.draconicevolution.client.render.block.RenderReactorCore;
|
||||
import com.brandon3055.draconicevolution.client.render.block.RenderReactorEnergyInjector;
|
||||
import com.brandon3055.draconicevolution.client.render.block.RenderReactorStabilizer;
|
||||
import com.brandon3055.draconicevolution.client.render.block.RenderTeleporterStand;
|
||||
import com.brandon3055.draconicevolution.client.render.block.RenderUpgradeModifier;
|
||||
import com.brandon3055.draconicevolution.client.render.entity.RenderChaosCrystal;
|
||||
import com.brandon3055.draconicevolution.client.render.entity.RenderDragon;
|
||||
import com.brandon3055.draconicevolution.client.render.entity.RenderDragonHeart;
|
||||
import com.brandon3055.draconicevolution.client.render.entity.RenderDragonProjectile;
|
||||
import com.brandon3055.draconicevolution.client.render.entity.RenderEntityChaosVortex;
|
||||
import com.brandon3055.draconicevolution.client.render.entity.RenderEntityCustomArrow;
|
||||
import com.brandon3055.draconicevolution.client.render.item.RenderArmor;
|
||||
import com.brandon3055.draconicevolution.client.render.item.RenderBow;
|
||||
import com.brandon3055.draconicevolution.client.render.item.RenderBowModel;
|
||||
import com.brandon3055.draconicevolution.client.render.item.RenderChaosFragment;
|
||||
import com.brandon3055.draconicevolution.client.render.item.RenderChaosShard;
|
||||
import com.brandon3055.draconicevolution.client.render.item.RenderMobSoul;
|
||||
import com.brandon3055.draconicevolution.client.render.item.RenderStabilizerPart;
|
||||
import com.brandon3055.draconicevolution.client.render.item.RenderTool;
|
||||
import com.brandon3055.draconicevolution.client.render.particle.ParticleEnergyBeam;
|
||||
import com.brandon3055.draconicevolution.client.render.particle.ParticleEnergyField;
|
||||
import com.brandon3055.draconicevolution.client.render.particle.ParticleReactorBeam;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.*;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.RenderTileChaosShard;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.RenderTileCrystal;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.RenderTileCustomSpawner;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.RenderTileDissEnchanter;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.RenderTileDraconiumChest;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.RenderTileEarth;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.RenderTileEnergyInfiser;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.RenderTileEnergyPylon;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.RenderTileEnergyStorageCore;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.RenderTileParticleGen;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.RenderTilePlacedItem;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.RenderTileReactorCore;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.RenderTileReactorEnergyInjector;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.RenderTileReactorStabilizer;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.RenderTileTeleporterStand;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.RenderTileUpgradeModifier;
|
||||
import com.brandon3055.draconicevolution.common.CommonProxy;
|
||||
import com.brandon3055.draconicevolution.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.blocks.multiblock.IReactorPart;
|
||||
import com.brandon3055.draconicevolution.common.entity.*;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityChaosCrystal;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityChaosGuardian;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityChaosVortex;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityCustomArrow;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityCustomDragon;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityDragonHeart;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityDragonProjectile;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.*;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileChaosShard;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileCustomSpawner;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDislocatorInhibitor;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDissEnchanter;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDraconiumChest;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileEnergyInfuser;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileParticleGenerator;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TilePlacedItem;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileTeleporterStand;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileUpgradeModifier;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileEnergyRelay;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileEnergyTransceiver;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileWirelessEnergyTransceiver;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEarth;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyPylon;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyStorageCore;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorEnergyInjector;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorStabilizer;
|
||||
import com.brandon3055.draconicevolution.common.utills.UpdateChecker;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
@@ -39,18 +112,22 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.ISound;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
private final static boolean debug = DraconicEvolution.debug;
|
||||
public static String downloadLocation;
|
||||
public final class ClientProxy extends CommonProxy {
|
||||
|
||||
private static final boolean debug = DraconicEvolution.debug;
|
||||
|
||||
private final Map<World, List<TileDislocatorInhibitor>> clientInhibitorsMap = new HashMap<>();
|
||||
private ClientEventHandler clientHandler;
|
||||
private KeyInputHandler keybindHandler;
|
||||
private ItemDisplayManager itemDisplay;
|
||||
private ShieldRenderHandler shieldRenderer;
|
||||
|
||||
public ClientProxy() {
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
@@ -58,68 +135,29 @@ public class ClientProxy extends CommonProxy {
|
||||
super.preInit(event);
|
||||
|
||||
ResourceHandler.init(event);
|
||||
|
||||
// downloadLocation = event.getModConfigurationDirectory().getParentFile().getAbsolutePath() + "/mods/derspack";
|
||||
// downloadLocation = downloadLocation.replaceAll("\\\\", "/");
|
||||
//
|
||||
// File rescourcePack = new File(event.getModConfigurationDirectory().getParentFile(), "/mods/derspack");
|
||||
//
|
||||
//
|
||||
// //File file = new File(downloadLocation);
|
||||
// if (!rescourcePack.exists()) rescourcePack.mkdir();
|
||||
//
|
||||
// LogHelper.info("Downloading Images");
|
||||
//
|
||||
// try {
|
||||
// URL url = new URL("http://i.imgur.com/oHRx1yQ.jpg");
|
||||
// String fileName = url.getFile();
|
||||
// //String destName = downloadLocation + fileName.substring(fileName.lastIndexOf("/"));
|
||||
// File dll = new File(rescourcePack, fileName.substring(fileName.lastIndexOf("/")));
|
||||
//
|
||||
// InputStream is = url.openStream();
|
||||
// OutputStream os = new FileOutputStream(dll);
|
||||
//
|
||||
// ByteStreams.copy(is, os);
|
||||
//
|
||||
// is.close();
|
||||
// os.close();
|
||||
// }catch (IOException e){
|
||||
// LogHelper.info(e);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// List defaultResourcePacks = Lists.newArrayList();
|
||||
// Field f = ReflectionHelper.findField(Minecraft.class, "defaultResourcePacks", "field_110449_ao");
|
||||
// f.setAccessible(true);
|
||||
// try {
|
||||
// defaultResourcePacks = (List)f.get(Minecraft.getMinecraft());
|
||||
// defaultResourcePacks.add(new FolderResourcePack(rescourcePack));
|
||||
// for (Object o : defaultResourcePacks){
|
||||
// if (o instanceof FolderResourcePack) LogHelper.info(((FolderResourcePack) o).getPackName());
|
||||
// if (o instanceof FileResourcePack) LogHelper.info(((FileResourcePack)o).getPackName());
|
||||
// }
|
||||
//
|
||||
// f.set(Minecraft.getMinecraft(), defaultResourcePacks);
|
||||
// }
|
||||
// catch (IllegalAccessException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
super.init(event);
|
||||
FMLCommonHandler.instance().bus().register(new KeyInputHandler());
|
||||
FMLCommonHandler.instance().bus().register(new ClientEventHandler());
|
||||
if (ConfigHandler.enableVersionChecker) FMLCommonHandler.instance().bus().register(new UpdateChecker());
|
||||
MinecraftForge.EVENT_BUS.register(new HudHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new ClientEventHandler());
|
||||
KeyBindings.init();
|
||||
this.keybindHandler = new KeyInputHandler();
|
||||
FMLCommonHandler.instance().bus().register(this.keybindHandler);
|
||||
this.clientHandler = new ClientEventHandler();
|
||||
FMLCommonHandler.instance().bus().register(this.clientHandler);
|
||||
MinecraftForge.EVENT_BUS.register(this.clientHandler);
|
||||
final HudHandler hudHandler = new HudHandler();
|
||||
FMLCommonHandler.instance().bus().register(hudHandler);
|
||||
MinecraftForge.EVENT_BUS.register(hudHandler);
|
||||
registerRenderIDs();
|
||||
registerRendering();
|
||||
ResourceHandler.instance.tick(null);
|
||||
IMCSender();
|
||||
this.itemDisplay = new ItemDisplayManager(60);
|
||||
FMLCommonHandler.instance().bus().register(this.itemDisplay);
|
||||
MinecraftForge.EVENT_BUS.register(this.itemDisplay);
|
||||
this.shieldRenderer = new ShieldRenderHandler();
|
||||
FMLCommonHandler.instance().bus().register(this.shieldRenderer);
|
||||
MinecraftForge.EVENT_BUS.register(this.shieldRenderer);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -128,8 +166,25 @@ public class ClientProxy extends CommonProxy {
|
||||
ResourceHandler.instance.tick(null);
|
||||
}
|
||||
|
||||
public void registerRendering() {
|
||||
//Item Renderers
|
||||
@SubscribeEvent
|
||||
public void onClientDisconnect(final FMLNetworkEvent.ClientDisconnectionFromServerEvent event) {
|
||||
this.clientInhibitorsMap.clear();
|
||||
this.itemDisplay.startDrawing(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SubscribeEvent
|
||||
public void onWorldUnload(WorldEvent.Unload event) {
|
||||
if (event.world.isRemote) {
|
||||
this.clientInhibitorsMap.remove(event.world);
|
||||
} else {
|
||||
super.onWorldUnload(event);
|
||||
}
|
||||
}
|
||||
|
||||
private void registerRendering() {
|
||||
// spotless:off
|
||||
// Item Renderers
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernBow, new RenderBow());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.draconicBow, new RenderBow());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.mobSoul, new RenderMobSoul());
|
||||
@@ -169,19 +224,21 @@ public class ClientProxy extends CommonProxy {
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.reactorStabilizer), new RenderReactorStabilizer());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.reactorEnergyInjector), new RenderReactorEnergyInjector());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.reactorCore), new RenderReactorCore());
|
||||
if (ModBlocks.earthBlock != null) MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.earthBlock), new RenderEarthItem());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.chaosCrystal), new RenderChaosShard());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.upgradeModifier), new RenderUpgradeModifier());
|
||||
|
||||
//ISimpleBlockRendering
|
||||
// ISimpleBlockRendering
|
||||
RenderingRegistry.registerBlockHandler(new RenderTeleporterStand());
|
||||
RenderingRegistry.registerBlockHandler(new RenderPortal());
|
||||
|
||||
//TileEntitySpecialRenderers
|
||||
// TileEntitySpecialRenderers
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileParticleGenerator.class, new RenderTileParticleGen());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyInfuser.class, new RenderTileEnergyInfiser());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileCustomSpawner.class, new RenderTileCustomSpawner());
|
||||
//ClientRegistry.bindTileEntitySpecialRenderer(TileTestBlock.class, new RenderTileCrystal());
|
||||
// ClientRegistry.bindTileEntitySpecialRenderer(TileTestBlock.class, new RenderTileCrystal());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyStorageCore.class, new RenderTileEnergyStorageCore());
|
||||
if (ModBlocks.earthBlock != null) ClientRegistry.bindTileEntitySpecialRenderer(TileEarth.class, new RenderTileEarth());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyPylon.class, new RenderTileEnergyPylon());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TilePlacedItem.class, new RenderTilePlacedItem());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileDissEnchanter.class, new RenderTileDissEnchanter());
|
||||
@@ -196,7 +253,7 @@ public class ClientProxy extends CommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileChaosShard.class, new RenderTileChaosShard());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileUpgradeModifier.class, new RenderTileUpgradeModifier());
|
||||
|
||||
//Entitys
|
||||
// Entitys
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCustomDragon.class, new RenderDragon());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChaosGuardian.class, new RenderDragon());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityDragonHeart.class, new RenderDragonHeart());
|
||||
@@ -204,15 +261,16 @@ public class ClientProxy extends CommonProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChaosCrystal.class, new RenderChaosCrystal());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChaosVortex.class, new RenderEntityChaosVortex());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCustomArrow.class, new RenderEntityCustomArrow());
|
||||
// spotless:on
|
||||
}
|
||||
|
||||
public void registerRenderIDs() {
|
||||
private void registerRenderIDs() {
|
||||
References.idTeleporterStand = RenderingRegistry.getNextAvailableRenderId();
|
||||
References.idPortal = RenderingRegistry.getNextAvailableRenderId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParticleEnergyBeam energyBeam(World worldObj, double x, double y, double z, double tx, double ty, double tz, int powerFlow, boolean advanced, ParticleEnergyBeam oldBeam, boolean render, int beamType) {
|
||||
public ParticleEnergyBeam energyBeam(World worldObj, double x, double y, double z, double tx, double ty, double tz,
|
||||
int powerFlow, boolean advanced, ParticleEnergyBeam oldBeam, boolean render, int beamType) {
|
||||
if (!worldObj.isRemote) return null;
|
||||
ParticleEnergyBeam beam = oldBeam;
|
||||
boolean inRange = ParticleHandler.isInRange(x, y, z, 50) || ParticleHandler.isInRange(tx, ty, tz, 50);
|
||||
@@ -232,8 +290,8 @@ public class ClientProxy extends CommonProxy {
|
||||
return beam;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParticleEnergyField energyField(World worldObj, double x, double y, double z, int type, boolean advanced, ParticleEnergyField oldBeam, boolean render) {
|
||||
public ParticleEnergyField energyField(World worldObj, double x, double y, double z, int type, boolean advanced,
|
||||
ParticleEnergyField oldBeam, boolean render) {
|
||||
if (!worldObj.isRemote) return null;
|
||||
ParticleEnergyField beam = oldBeam;
|
||||
boolean inRange = ParticleHandler.isInRange(x, y, z, 50);
|
||||
@@ -253,7 +311,6 @@ public class ClientProxy extends CommonProxy {
|
||||
return beam;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParticleReactorBeam reactorBeam(TileEntity tile, ParticleReactorBeam oldBeam, boolean render) {
|
||||
if (!tile.getWorldObj().isRemote || !(tile instanceof IReactorPart)) return null;
|
||||
ParticleReactorBeam beam = oldBeam;
|
||||
@@ -269,25 +326,106 @@ public class ClientProxy extends CommonProxy {
|
||||
beam.setDead();
|
||||
return null;
|
||||
} else {
|
||||
beam.update(render);
|
||||
beam.update();
|
||||
}
|
||||
return beam;
|
||||
}
|
||||
|
||||
|
||||
public boolean isOp(String paramString) {
|
||||
return Minecraft.getMinecraft().theWorld.getWorldInfo().getGameType().isCreative();
|
||||
public void spawnParticle(EntityFX particle, int range) {
|
||||
if (particle.worldObj.isRemote) {
|
||||
ParticleHandler.spawnCustomParticle(particle, range);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnParticle(Object particle, int range) {
|
||||
if (particle instanceof EntityFX && ((EntityFX) particle).worldObj.isRemote)
|
||||
ParticleHandler.spawnCustomParticle((EntityFX) particle, range);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ISound playISound(ISound sound) {
|
||||
FMLClientHandler.instance().getClient().getSoundHandler().playSound(sound);
|
||||
return sound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDedicatedServer() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getClientWorld() {
|
||||
return Minecraft.getMinecraft().theWorld;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSpaceDown() {
|
||||
return Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShiftDown() {
|
||||
return Minecraft.getMinecraft().gameSettings.keyBindSneak.getIsKeyPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCtrlDown() {
|
||||
return Minecraft.getMinecraft().gameSettings.keyBindSprint.getIsKeyPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityPlayer getClientPlayer() {
|
||||
return Minecraft.getMinecraft().thePlayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClient() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public KeyInputHandler getKeybindHandler() {
|
||||
return keybindHandler;
|
||||
}
|
||||
|
||||
public void displayItem(ItemStack stack) {
|
||||
this.itemDisplay.startDrawing(stack);
|
||||
}
|
||||
|
||||
public int getElapsedTicks() {
|
||||
return this.clientHandler.getElapsedTicks();
|
||||
}
|
||||
|
||||
public float getEnergyCrystalAlpha() {
|
||||
return this.clientHandler.getEnergyCrystalAlpha();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tryRepositionPlayerOnMount(int entityId) {
|
||||
this.clientHandler.tryRepositionPlayerOnMount(entityId);
|
||||
}
|
||||
|
||||
public void renderShield(EntityPlayer player, float shieldPowerF) {
|
||||
this.shieldRenderer.renderShield(player, shieldPowerF);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerInhibitor(TileDislocatorInhibitor tile) {
|
||||
if (tile.hasWorldObj() && tile.getWorldObj().isRemote) {
|
||||
registerInhibitor(this.clientInhibitorsMap, tile);
|
||||
} else {
|
||||
super.registerInhibitor(tile);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterInhibitor(TileDislocatorInhibitor tile) {
|
||||
if (tile.hasWorldObj() && tile.getWorldObj().isRemote) {
|
||||
unregisterInhibitor(this.clientInhibitorsMap, tile);
|
||||
} else {
|
||||
super.unregisterInhibitor(tile);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlockedByInhibitor(World world, EntityItem item) {
|
||||
if (world.isRemote) {
|
||||
return isBlockedByInhibitor(this.clientInhibitorsMap, world, item);
|
||||
} else {
|
||||
return super.isBlockedByInhibitor(world, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,52 +1,55 @@
|
||||
package com.brandon3055.draconicevolution.client;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore;
|
||||
import net.minecraft.client.audio.ITickableSound;
|
||||
import net.minecraft.client.audio.PositionedSound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore;
|
||||
|
||||
/**
|
||||
* Created by brandon3055 on 4/10/2015.
|
||||
*/
|
||||
public class ReactorSound extends PositionedSound implements ITickableSound {
|
||||
private static ResourceLocation sound = new ResourceLocation(References.RESOURCESPREFIX + "coreSound");
|
||||
public boolean donePlaying = false;
|
||||
private TileReactorCore tile;
|
||||
|
||||
public ReactorSound(TileReactorCore tile) {
|
||||
private static final ResourceLocation sound = new ResourceLocation(References.RESOURCESPREFIX + "coreSound");
|
||||
public boolean isDonePlaying = false;
|
||||
private final TileReactorCore core;
|
||||
|
||||
public ReactorSound(TileReactorCore core) {
|
||||
super(sound);
|
||||
this.tile = tile;
|
||||
this.xPosF = (float) tile.xCoord + 0.5F;
|
||||
this.yPosF = (float) tile.yCoord + 0.5F;
|
||||
this.zPosF = (float) tile.zCoord + 0.5F;
|
||||
this.core = core;
|
||||
this.xPosF = (float) core.xCoord + 0.5F;
|
||||
this.yPosF = (float) core.yCoord + 0.5F;
|
||||
this.zPosF = (float) core.zCoord + 0.5F;
|
||||
this.repeat = true;
|
||||
this.volume = 1.5F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDonePlaying() {
|
||||
return donePlaying;
|
||||
return isDonePlaying;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
|
||||
volume = (tile.renderSpeed - 0.5F) * 2F;
|
||||
if (tile.reactionTemperature > 8000) {
|
||||
volume += (float) ((tile.reactionTemperature - 8000D) / 1000D);
|
||||
volume = (core.renderSpeed - 0.5F) * 2F;
|
||||
if (core.reactionTemperature > 8000) {
|
||||
volume += (float) ((core.reactionTemperature - 8000D) / 1000D);
|
||||
}
|
||||
if (tile.reactionTemperature > 2000 && tile.maxFieldCharge > 0 && tile.fieldCharge < (tile.maxFieldCharge * 0.2D)) {
|
||||
volume += 2D - ((tile.fieldCharge / tile.maxFieldCharge) * 10D);
|
||||
if (core.reactionTemperature > 2000 && core.maxFieldCharge > 0
|
||||
&& core.fieldCharge < (core.maxFieldCharge * 0.2D)) {
|
||||
volume += 2D - ((core.fieldCharge / core.maxFieldCharge) * 10D);
|
||||
}
|
||||
if (tile.reactionTemperature > 2000 && tile.reactorFuel + tile.convertedFuel > 0 && tile.reactorFuel < (double) (tile.reactorFuel + tile.convertedFuel) * 0.2D) {
|
||||
volume += 2D - ((tile.reactorFuel / (tile.reactorFuel + tile.convertedFuel)) * 10D);
|
||||
if (core.reactionTemperature > 2000 && core.reactorFuel + core.convertedFuel > 0
|
||||
&& core.reactorFuel < (double) (core.reactorFuel + core.convertedFuel) * 0.2D) {
|
||||
volume += 2D - ((float) core.reactorFuel / (core.reactorFuel + core.convertedFuel)) * 10D;
|
||||
}
|
||||
|
||||
field_147663_c = 0.5F + volume / 2F;
|
||||
|
||||
if (tile.isInvalid() || !tile.getWorldObj().getChunkFromBlockCoords(tile.xCoord, tile.zCoord).isChunkLoaded) {// || player == null || tile.getDistanceFrom(player.posX, player.posY, player.posZ) > 512){
|
||||
donePlaying = true;
|
||||
if (core.isInvalid() || !core.getWorldObj().getChunkFromBlockCoords(core.xCoord, core.zCoord).isChunkLoaded) {
|
||||
isDonePlaying = true;
|
||||
repeat = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,27 @@
|
||||
package com.brandon3055.draconicevolution.client.creativetab;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.ModBlocks;
|
||||
import com.brandon3055.brandonscore.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class DETab extends CreativeTabs {
|
||||
|
||||
private String label;
|
||||
private int tab;
|
||||
|
||||
static ItemStack iconStackStaff;
|
||||
|
||||
public static void initialize() {
|
||||
if (ModItems.isEnabled(ModItems.draconicDestructionStaff))
|
||||
iconStackStaff = ItemNBTHelper.setInteger(new ItemStack(ModItems.draconicDestructionStaff), "Energy", 30000000);
|
||||
if (ModItems.isEnabled(ModItems.draconicDestructionStaff)) iconStackStaff = ItemNBTHelper
|
||||
.setInteger(new ItemStack(ModItems.draconicDestructionStaff), "Energy", 30000000);
|
||||
else iconStackStaff = new ItemStack(Items.stick);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +1,29 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import cpw.mods.fml.client.config.GuiConfig;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraftforge.common.config.ConfigElement;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
|
||||
import cpw.mods.fml.client.config.GuiConfig;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 6/08/2014.
|
||||
*/
|
||||
public class ConfigGUI extends GuiConfig {
|
||||
|
||||
public ConfigGUI(GuiScreen parent) {
|
||||
super(parent, new ConfigElement(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), References.MODID, false, false, GuiConfig.getAbridgedConfigPath(ConfigHandler.config.toString()));
|
||||
super(
|
||||
parent,
|
||||
new ConfigElement(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(),
|
||||
References.MODID,
|
||||
false,
|
||||
false,
|
||||
GuiConfig.getAbridgedConfigPath(ConfigHandler.config.toString()));
|
||||
configElements.addAll(new ConfigElement(ConfigHandler.config.getCategory("spawner")).getChildElements());
|
||||
configElements.addAll(new ConfigElement(ConfigHandler.config.getCategory("long range dislocator")).getChildElements());
|
||||
configElements.addAll(
|
||||
new ConfigElement(ConfigHandler.config.getCategory("long range dislocator")).getChildElements());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class CustomGuiButton extends GuiButton {
|
||||
|
||||
public CustomGuiButton(int id, int left, int top, int width, int hight, String text) {
|
||||
@@ -18,13 +18,21 @@ public class CustomGuiButton extends GuiButton {
|
||||
FontRenderer fontrenderer = minecraft.fontRenderer;
|
||||
minecraft.getTextureManager().bindTexture(buttonTextures);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.field_146123_n = p_146112_2_ >= this.xPosition && p_146112_3_ >= this.yPosition && p_146112_2_ < this.xPosition + this.width && p_146112_3_ < this.yPosition + this.height;
|
||||
this.field_146123_n = p_146112_2_ >= this.xPosition && p_146112_3_ >= this.yPosition
|
||||
&& p_146112_2_ < this.xPosition + this.width
|
||||
&& p_146112_3_ < this.yPosition + this.height;
|
||||
int k = this.getHoverState(this.field_146123_n);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + k * 20, this.width / 2, this.height);
|
||||
this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + k * 20, this.width / 2, this.height);
|
||||
this.drawTexturedModalRect(
|
||||
this.xPosition + this.width / 2,
|
||||
this.yPosition,
|
||||
200 - this.width / 2,
|
||||
46 + k * 20,
|
||||
this.width / 2,
|
||||
this.height);
|
||||
this.mouseDragged(minecraft, p_146112_2_, p_146112_3_);
|
||||
int l = 14737632;
|
||||
|
||||
@@ -36,8 +44,12 @@ public class CustomGuiButton extends GuiButton {
|
||||
l = 16777120;
|
||||
}
|
||||
|
||||
this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, l);
|
||||
this.drawCenteredString(
|
||||
fontrenderer,
|
||||
this.displayString,
|
||||
this.xPosition + this.width / 2,
|
||||
this.yPosition + (this.height - 8) / 2,
|
||||
l);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +1,19 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import cpw.mods.fml.client.IModGuiFactory;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
import java.util.Set;
|
||||
import cpw.mods.fml.client.IModGuiFactory;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 6/08/2014.
|
||||
*/
|
||||
public class DEGUIFactory implements IModGuiFactory {
|
||||
@Override
|
||||
public void initialize(Minecraft minecraftInstance) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public void initialize(Minecraft minecraftInstance) {}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiScreen> mainConfigGuiClass() {
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerTemplate;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileContainerTemplate;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GUIContainerTemplate extends GuiContainer {
|
||||
|
||||
public EntityPlayer player;
|
||||
private TileContainerTemplate tile;
|
||||
|
||||
public GUIContainerTemplate(InventoryPlayer invPlayer, TileContainerTemplate tile) {
|
||||
super(new ContainerTemplate(invPlayer, tile));
|
||||
|
||||
xSize = 176;
|
||||
ySize = 140;
|
||||
|
||||
this.tile = tile;
|
||||
this.player = invPlayer.player;
|
||||
}
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/.png");
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
fontRendererObj.drawStringWithShadow("Energy Infuser", 49, -9, 0x00FFFF);
|
||||
//bindTexture(texture);
|
||||
|
||||
//fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
|
||||
//drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
|
||||
//drawCenteredString(fontRendererObj, "Weather Controller", xSize/2, -15, 0x2a4ed0);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
super.updateScreen();
|
||||
|
||||
}
|
||||
}
|
||||
+241
@@ -0,0 +1,241 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerDislocatorInhibitor;
|
||||
import com.brandon3055.draconicevolution.common.inventory.SlotFakeItem;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.network.DislocatorInhibitorButtonPacket;
|
||||
import com.brandon3055.draconicevolution.common.network.SlotFakeClickPacket;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDislocatorInhibitor;
|
||||
|
||||
import codechicken.nei.VisiblityData;
|
||||
import codechicken.nei.api.INEIGuiHandler;
|
||||
import codechicken.nei.api.TaggedInventoryArea;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Optional.Interface(iface = "codechicken.nei.api.INEIGuiHandler", modid = "NotEnoughItems")
|
||||
public class GUIDislocatorInhibitor extends GuiContainer implements INEIGuiHandler {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
References.MODID.toLowerCase(),
|
||||
"textures/gui/Inhibitor.png");
|
||||
private int range = 5;
|
||||
private TileDislocatorInhibitor.ActivityControlType activityControlType = TileDislocatorInhibitor.ActivityControlType.ALWAYS_ACTIVE;
|
||||
private boolean whitelist = false;
|
||||
|
||||
private final ContainerDislocatorInhibitor container;
|
||||
|
||||
public GUIDislocatorInhibitor(InventoryPlayer playerInventory, TileDislocatorInhibitor inhibitor) {
|
||||
super(inhibitor.getGuiContainer(playerInventory));
|
||||
this.container = (ContainerDislocatorInhibitor) inventorySlots;
|
||||
|
||||
xSize = 176;
|
||||
ySize = 150;
|
||||
|
||||
syncWithServer();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
buttonList.clear();
|
||||
buttonList.add(new GuiButtonAHeight(0, guiLeft + 7, guiTop + 19, 18, 18, "-"));
|
||||
buttonList.add(new GuiButtonAHeight(1, guiLeft + 97, guiTop + 19, 18, 18, "+"));
|
||||
buttonList.add(new GuiButtonAHeight(2, guiLeft + 151, guiTop + 19, 18, 18, ""));
|
||||
buttonList.add(new GuiButtonAHeight(3, guiLeft + 151, guiTop + 41, 18, 18, ""));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
fontRendererObj
|
||||
.drawString(StatCollector.translateToLocal("gui.de.dislocatorInhibitor.main.title"), 7, 5, 0x222222);
|
||||
drawGuiText();
|
||||
drawGreyOutSlots();
|
||||
drawButtonIcons();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
||||
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int x, int y, float partialTicks) {
|
||||
super.drawScreen(x, y, partialTicks);
|
||||
ArrayList<String> lines = new ArrayList<>();
|
||||
if (isButtonHovered(x, y, 7, 19, 18, 18)) {
|
||||
lines.add(StatCollector.translateToLocal("gui.de.dislocatorInhibitor.tooltip.range.decrease.txt"));
|
||||
} else if (isButtonHovered(x, y, 97, 19, 18, 18)) {
|
||||
lines.add(StatCollector.translateToLocal("gui.de.dislocatorInhibitor.tooltip.range.increase.txt"));
|
||||
} else if (isButtonHovered(x, y, 151, 19, 18, 18)) {
|
||||
switch (activityControlType) {
|
||||
case ALWAYS_ACTIVE -> lines
|
||||
.add(StatCollector.translateToLocal("gui.de.dislocatorInhibitor.tooltip.activity.always.txt"));
|
||||
case WITH_REDSTONE -> lines
|
||||
.add(StatCollector.translateToLocal("gui.de.dislocatorInhibitor.tooltip.activity.with.txt"));
|
||||
case WITHOUT_REDSTONE -> lines
|
||||
.add(StatCollector.translateToLocal("gui.de.dislocatorInhibitor.tooltip.activity.without.txt"));
|
||||
case NEVER_ACTIVE -> lines
|
||||
.add(StatCollector.translateToLocal("gui.de.dislocatorInhibitor.tooltip.activity.never.txt"));
|
||||
}
|
||||
lines.add(StatCollector.translateToLocal("gui.de.dislocatorInhibitor.tooltip.activity.cycle.txt"));
|
||||
} else if (isButtonHovered(x, y, 151, 41, 18, 18)) {
|
||||
if (whitelist) {
|
||||
lines.add(StatCollector.translateToLocal("gui.de.dislocatorInhibitor.tooltip.whitelist.txt"));
|
||||
} else {
|
||||
lines.add(StatCollector.translateToLocal("gui.de.dislocatorInhibitor.tooltip.blacklist.txt"));
|
||||
}
|
||||
}
|
||||
if (!lines.isEmpty()) {
|
||||
drawHoveringText(lines, x, y, fontRendererObj);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isButtonHovered(int mouseX, int mouseY, int buttonX, int buttonY, int width, int height) {
|
||||
return (mouseX >= buttonX + guiLeft && mouseX < buttonX + width + guiLeft)
|
||||
&& (mouseY >= buttonY + guiTop && mouseY < buttonY + height + guiTop);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleMouseClick(Slot slotIn, int slotId, int clickedButton, int clickType) {
|
||||
if (slotIn instanceof SlotFakeItem sfi) {
|
||||
DraconicEvolution.network.sendToServer(
|
||||
new SlotFakeClickPacket((byte) sfi.getSlotIndex(), this.mc.thePlayer.inventory.getItemStack()));
|
||||
} else {
|
||||
super.handleMouseClick(slotIn, slotId, clickedButton, clickType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
switch (button.id) {
|
||||
case 0 -> { // Range -
|
||||
range = Math.max(range - 1, TileDislocatorInhibitor.MINIMUM_RANGE);
|
||||
DraconicEvolution.network.sendToServer(new DislocatorInhibitorButtonPacket((byte) 0, (byte) range));
|
||||
}
|
||||
case 1 -> { // Range +
|
||||
range = Math.min(range + 1, TileDislocatorInhibitor.MAXIMUM_RANGE);
|
||||
DraconicEvolution.network.sendToServer(new DislocatorInhibitorButtonPacket((byte) 0, (byte) range));
|
||||
}
|
||||
case 2 -> { // Cycle Activity control
|
||||
activityControlType = activityControlType.getNext();
|
||||
byte controlMode = (byte) (activityControlType.ordinal());
|
||||
DraconicEvolution.network.sendToServer(new DislocatorInhibitorButtonPacket((byte) 1, controlMode));
|
||||
}
|
||||
case 3 -> { // Toggle Whitelist/Blacklist mode
|
||||
whitelist = !whitelist;
|
||||
byte whitelistMode = (byte) (whitelist ? 1 : 0);
|
||||
DraconicEvolution.network.sendToServer(new DislocatorInhibitorButtonPacket((byte) 2, whitelistMode));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public VisiblityData modifyVisiblity(GuiContainer gui, VisiblityData currentVisibility) {
|
||||
return currentVisibility;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<Integer> getItemSpawnSlots(GuiContainer gui, ItemStack item) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaggedInventoryArea> getInventoryAreas(GuiContainer gui) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleDragNDrop(GuiContainer gui, int mousex, int mousey, ItemStack draggedStack, int button) {
|
||||
if (gui instanceof GUIDislocatorInhibitor) {
|
||||
for (var slot : container.inventorySlots) {
|
||||
if (slot instanceof SlotFakeItem sfi) {
|
||||
if (sfi.isOverSlot(mousex - this.guiLeft, mousey - this.guiTop)) {
|
||||
draggedStack.stackSize = 0;
|
||||
DraconicEvolution.network
|
||||
.sendToServer(new SlotFakeClickPacket((byte) sfi.getSlotIndex(), draggedStack));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int w, int h) {
|
||||
return false;
|
||||
}
|
||||
|
||||
private void drawGuiText() {
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocal("gui.de.dislocatorInhibitor.range.txt"),
|
||||
40,
|
||||
25,
|
||||
0x000000,
|
||||
false);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.numbers", range),
|
||||
range < 10 ? 78 : 75,
|
||||
25,
|
||||
0x000000,
|
||||
false);
|
||||
}
|
||||
|
||||
private void drawButtonIcons() {
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
|
||||
// activity control button
|
||||
drawTexturedModalRect(151, 19, 0, 150 + (18 * activityControlType.ordinal()), 18, 18);
|
||||
|
||||
// whitelist button
|
||||
drawTexturedModalRect(151, 41, 18, 150 + (whitelist ? 0 : 18), 18, 18);
|
||||
}
|
||||
|
||||
private void drawGreyOutSlots() {
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5f);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
for (int i = 0; i < 8; i++) {
|
||||
drawTexturedModalRect(7 + i * 18, 41, 36, 150, 18, 18);
|
||||
}
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
private void syncWithServer() {
|
||||
TileDislocatorInhibitor inhibitor = container.getTileEntity();
|
||||
whitelist = inhibitor.isWhitelist();
|
||||
range = inhibitor.getRange();
|
||||
activityControlType = inhibitor.getActivityControlType();
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,5 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerDissEnchanter;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.network.ButtonPacket;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDissEnchanter;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
@@ -14,8 +7,18 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerDissEnchanter;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.network.ButtonPacket;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDissEnchanter;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GUIDissEnchanter extends GuiContainer {
|
||||
|
||||
@@ -34,25 +37,35 @@ public class GUIDissEnchanter extends GuiContainer {
|
||||
this.player = invPlayer.player;
|
||||
}
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/DissEnchanter.png");
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
References.MODID.toLowerCase(),
|
||||
"textures/gui/DissEnchanter.png");
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("tile.draconicevolution:dissEnchanter.name"), 88, 4, 0x00FFFF);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("gui.de.dissEnchanter.main.title"),
|
||||
88,
|
||||
4,
|
||||
0x00FFFF);
|
||||
|
||||
fontRendererObj.drawString("Item", 5, 40, 0x0000ff);
|
||||
fontRendererObj.drawString("Damage: " + (40 - tile.bookPower) + "%", 5, 49, 0x0000ff);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.dissEnchanter.itemDamage1"), 5, 40, 0x0000ff);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector
|
||||
.translateToLocalFormatted("gui.de.dissEnchanter.itemDamage2", (40 - tile.bookPower) + "%"),
|
||||
5,
|
||||
49,
|
||||
0x0000ff);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
@@ -86,6 +99,7 @@ public class GUIDissEnchanter extends GuiContainer {
|
||||
if (flag && player.experienceLevel < tile.dissenchantCost && !player.capabilities.isCreativeMode) flag = false;
|
||||
((GuiButtonAHeight) buttonList.get(0)).enabled = flag;
|
||||
((GuiButtonAHeight) buttonList.get(0)).packedFGColour = cachRecipeValid ? 0x000000 : 0xdf0000;
|
||||
((GuiButtonAHeight) buttonList.get(0)).displayString = "Cost: " + tile.dissenchantCost;
|
||||
((GuiButtonAHeight) buttonList.get(0)).displayString = StatCollector
|
||||
.translateToLocalFormatted("gui.de.dissEnchanter.cost", tile.dissenchantCost);
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,9 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import codechicken.nei.VisiblityData;
|
||||
import codechicken.nei.api.INEIGuiHandler;
|
||||
import codechicken.nei.api.TaggedInventoryArea;
|
||||
import com.brandon3055.brandonscore.client.utills.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerDraconiumChest;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.network.ButtonPacket;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDraconiumChest;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
@@ -23,19 +14,36 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerDraconiumChest;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.network.ButtonPacket;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDraconiumChest;
|
||||
|
||||
import codechicken.nei.VisiblityData;
|
||||
import codechicken.nei.api.INEIGuiHandler;
|
||||
import codechicken.nei.api.TaggedInventoryArea;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Optional.Interface(iface = "codechicken.nei.api.INEIGuiHandler", modid = "NotEnoughItems")
|
||||
public class GUIDraconiumChest extends GuiContainer implements INEIGuiHandler {
|
||||
|
||||
public EntityPlayer player;
|
||||
private TileDraconiumChest tile;
|
||||
private static final ResourceLocation textureLeft = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/DraconicChestLeft.png");
|
||||
private static final ResourceLocation textureRight = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/DraconicChestRight.png");
|
||||
private static final ResourceLocation textureLeft = new ResourceLocation(
|
||||
References.MODID.toLowerCase(),
|
||||
"textures/gui/DraconicChestLeft.png");
|
||||
private static final ResourceLocation textureRight = new ResourceLocation(
|
||||
References.MODID.toLowerCase(),
|
||||
"textures/gui/DraconicChestRight.png");
|
||||
private int lastAutoFeed = -1;
|
||||
|
||||
public GUIDraconiumChest(InventoryPlayer invPlayer, TileDraconiumChest tile) {
|
||||
@@ -67,24 +75,35 @@ public class GUIDraconiumChest extends GuiContainer implements INEIGuiHandler {
|
||||
}
|
||||
|
||||
int arrowHight = (int) (((float) tile.smeltingProgressTime / (float) tile.smeltingCompleateTime) * 22f);
|
||||
drawTexturedModalRect(guiLeft + 140, guiTop + 192 + 22 - arrowHight, 140, 216 + 22 - arrowHight, 16, arrowHight);
|
||||
drawTexturedModalRect(
|
||||
guiLeft + 140,
|
||||
guiTop + 192 + 22 - arrowHight,
|
||||
140,
|
||||
216 + 22 - arrowHight,
|
||||
16,
|
||||
arrowHight);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(textureRight);
|
||||
int energyWidth = (int) (((float) tile.getEnergyStored(ForgeDirection.DOWN) / (float) tile.getMaxEnergyStored(ForgeDirection.DOWN)) * 90f);
|
||||
int energyWidth = (int) (((float) tile.getEnergyStored(ForgeDirection.DOWN)
|
||||
/ (float) tile.getMaxEnergyStored(ForgeDirection.DOWN)) * 90f);
|
||||
drawTexturedModalRect(guiLeft + 44, guiTop + 235, 131, 236, energyWidth, 16);
|
||||
|
||||
int flameHight = (int) (((float) tile.smeltingBurnSpeed / (float) tile.smeltingMaxBurnSpeed) * 13f);
|
||||
//flameHight = tile.smeltingProgressTime <= 0 ? 0 : Math.min(flameHight, 13);
|
||||
// flameHight = tile.smeltingProgressTime <= 0 ? 0 : Math.min(flameHight, 13);
|
||||
drawTexturedModalRect(guiLeft + 45, guiTop + 217 + 13 - flameHight, 132, 180 + 13 - flameHight, 88, flameHight);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
fontRendererObj.drawString(tile.getInventoryName(), 4, 4, 0x222222);
|
||||
//fontRendererObj.drawStringWithShadow(StatCollector.translateToLocal("button.de.chestAutoFeed.txt"), 4, 180, 0x00FFFF);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.draconiumChest.main.title"), 4, 4, 0x222222);
|
||||
// fontRendererObj.drawStringWithShadow(StatCollector.translateToLocal("button.de.chestAutoFeed.txt"), 4, 180,
|
||||
// 0x00FFFF);
|
||||
|
||||
ArrayList<String> list = new ArrayList<String>();
|
||||
list.add(String.valueOf(tile.getEnergyStored(ForgeDirection.DOWN)) + "/" + String.valueOf(tile.getMaxEnergyStored(ForgeDirection.DOWN)) + "RF");
|
||||
list.add(
|
||||
String.valueOf(tile.getEnergyStored(ForgeDirection.DOWN)) + "/"
|
||||
+ String.valueOf(tile.getMaxEnergyStored(ForgeDirection.DOWN))
|
||||
+ "RF");
|
||||
if (GuiHelper.isInRect(44, 235, 90, 16, x - guiLeft, y - guiTop))
|
||||
drawHoveringText(list, x - guiLeft, y - guiTop, fontRendererObj);
|
||||
list.clear();
|
||||
@@ -117,7 +136,6 @@ public class GUIDraconiumChest extends GuiContainer implements INEIGuiHandler {
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import com.brandon3055.brandonscore.client.utills.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerEnergyInfuser;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileEnergyInfuser;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
@@ -15,10 +13,17 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerEnergyInfuser;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileEnergyInfuser;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GUIEnergyInfuser extends GuiContainer {
|
||||
@@ -37,24 +42,40 @@ public class GUIEnergyInfuser extends GuiContainer {
|
||||
this.player = invPlayer.player;
|
||||
}
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/EnergyInfuser.png");
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
References.MODID.toLowerCase(),
|
||||
"textures/gui/EnergyInfuser.png");
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
if (tile.getStackInSlot(0) == null)
|
||||
drawTexturedModalRect(guiLeft + 63, guiTop + 34, 36, ySize, 18, 18);//fuel box
|
||||
|
||||
if (tile.getStackInSlot(0) == null) drawTexturedModalRect(guiLeft + 63, guiTop + 34, 36, ySize, 18, 18); // fuel
|
||||
// box
|
||||
|
||||
float power = (float) tile.energy.getEnergyStored() / (float) tile.energy.getMaxEnergyStored() * -1F + 1F;
|
||||
drawTexturedModalRect(guiLeft + 49, guiTop + 7 + (int) (power * 45), xSize, (int) (power * 45), 8, 45 - (int) (power * 45));//Power bar
|
||||
drawTexturedModalRect(
|
||||
guiLeft + 49,
|
||||
guiTop + 7 + (int) (power * 45),
|
||||
xSize,
|
||||
(int) (power * 45),
|
||||
8,
|
||||
45 - (int) (power * 45)); // Power bar
|
||||
|
||||
if (tile.running && tile.getStackInSlot(0) != null && tile.getStackInSlot(0).getItem() instanceof IEnergyContainerItem) {
|
||||
if (tile.running && tile.getStackInSlot(0) != null
|
||||
&& tile.getStackInSlot(0).getItem() instanceof IEnergyContainerItem) {
|
||||
IEnergyContainerItem item = (IEnergyContainerItem) tile.getStackInSlot(0).getItem();
|
||||
float charge = (float) item.getEnergyStored(tile.getStackInSlot(0)) / (float) item.getMaxEnergyStored(tile.getStackInSlot(0)) * -1F + 1F;
|
||||
drawTexturedModalRect(guiLeft + 119, guiTop + 7 + (int) (charge * 45), xSize, (int) (charge * 45), 8, 45 - (int) (charge * 45));//Item Power bar
|
||||
float charge = (float) item.getEnergyStored(tile.getStackInSlot(0))
|
||||
/ (float) item.getMaxEnergyStored(tile.getStackInSlot(0))
|
||||
* -1F + 1F;
|
||||
drawTexturedModalRect(
|
||||
guiLeft + 119,
|
||||
guiTop + 7 + (int) (charge * 45),
|
||||
xSize,
|
||||
(int) (charge * 45),
|
||||
8,
|
||||
45 - (int) (charge * 45)); // Item Power bar
|
||||
}
|
||||
|
||||
drawAnimatedParts();
|
||||
@@ -62,14 +83,17 @@ public class GUIEnergyInfuser extends GuiContainer {
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
fontRendererObj.drawStringWithShadow("Energy Infuser", 49, -9, 0x00FFFF);
|
||||
fontRendererObj.drawStringWithShadow(
|
||||
StatCollector.translateToLocal("gui.de.energyInfuser.main.title"),
|
||||
49,
|
||||
-9,
|
||||
0x00FFFF);
|
||||
|
||||
// bindTexture(texture);
|
||||
|
||||
//bindTexture(texture);
|
||||
|
||||
//fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
|
||||
//drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
|
||||
//drawCenteredString(fontRendererObj, "Weather Controller", xSize/2, -15, 0x2a4ed0);
|
||||
// fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
|
||||
// drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
|
||||
// drawCenteredString(fontRendererObj, "Weather Controller", xSize/2, -15, 0x2a4ed0);
|
||||
|
||||
}
|
||||
|
||||
@@ -83,37 +107,41 @@ public class GUIEnergyInfuser extends GuiContainer {
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
//ID
|
||||
//buttonList.add(new GuiButton(0, guiLeft + 85, guiTop , 85, 20, text));
|
||||
// ID
|
||||
// buttonList.add(new GuiButton(0, guiLeft + 85, guiTop , 85, 20, text));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
|
||||
|
||||
}
|
||||
protected void actionPerformed(GuiButton button) {}
|
||||
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
super.updateScreen();
|
||||
|
||||
}
|
||||
|
||||
private void drawEnergyBarHoverText(int x, int y) {
|
||||
if (GuiHelper.isInRect(48, 6, 9, 46, x, y)) {
|
||||
ArrayList<String> internal = new ArrayList<String>();
|
||||
internal.add(StatCollector.translateToLocal("gui.de.internalStorage.txt"));
|
||||
internal.add("" + EnumChatFormatting.DARK_BLUE + tile.energy.getEnergyStored() + "/" + tile.energy.getMaxEnergyStored());
|
||||
internal.add(
|
||||
EnumChatFormatting.DARK_BLUE + formatNumber(tile.energy.getEnergyStored())
|
||||
+ "/"
|
||||
+ formatNumber(tile.energy.getMaxEnergyStored()));
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj);
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
if (GuiHelper.isInRect(118, 6, 10, 46, x, y) && tile.running && tile.getStackInSlot(0) != null && tile.getStackInSlot(0).getItem() instanceof IEnergyContainerItem) {
|
||||
if (GuiHelper.isInRect(118, 6, 10, 46, x, y) && tile.running
|
||||
&& tile.getStackInSlot(0) != null
|
||||
&& tile.getStackInSlot(0).getItem() instanceof IEnergyContainerItem) {
|
||||
IEnergyContainerItem item = (IEnergyContainerItem) tile.getStackInSlot(0).getItem();
|
||||
ArrayList<String> internal = new ArrayList<String>();
|
||||
internal.add(StatCollector.translateToLocal("gui.de.itemStorage.txt"));
|
||||
internal.add("" + EnumChatFormatting.DARK_BLUE + item.getEnergyStored(tile.getStackInSlot(0)) + "/" + item.getMaxEnergyStored(tile.getStackInSlot(0)));
|
||||
internal.add(
|
||||
EnumChatFormatting.DARK_BLUE + formatNumber(item.getEnergyStored(tile.getStackInSlot(0)))
|
||||
+ "/"
|
||||
+ formatNumber(item.getMaxEnergyStored(tile.getStackInSlot(0))));
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj);
|
||||
GL11.glPopAttrib();
|
||||
@@ -126,7 +154,7 @@ public class GUIEnergyInfuser extends GuiContainer {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glTranslatef(guiLeft + 62, guiTop + 4, 0);
|
||||
{//Draw Ring
|
||||
{ // Draw Ring
|
||||
GL11.glTranslatef(26, 26, 0);
|
||||
GL11.glRotatef(rotation, 0, 0, 1);
|
||||
GL11.glTranslatef(-26, -26, 0);
|
||||
@@ -169,12 +197,9 @@ public class GUIEnergyInfuser extends GuiContainer {
|
||||
drawTexturedModalRect(0, 0, 0, 173, 26, 8);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,18 +1,21 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import com.brandon3055.brandonscore.client.utills.GuiHelper;
|
||||
import com.brandon3055.brandonscore.common.utills.Utills;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.gates.TileGate;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.gates.TileGate;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 30/6/2015.
|
||||
*/
|
||||
@@ -45,25 +48,62 @@ public class GUIFlowGate extends GuiScreen {
|
||||
|
||||
drawDefaultBackground();
|
||||
ResourceHandler.bindResource("textures/gui/ToolConfig.png");
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, 197, 88);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.flowGate.name"), guiCrt - (fontRendererObj.getStringWidth(StatCollector.translateToLocal("gui.de.flowGate.name")) / 2), guiTop + 5, 0x2c2c2c);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, 198, 89);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocal("gui.de.flowGate.name"),
|
||||
guiCrt - (fontRendererObj.getStringWidth(StatCollector.translateToLocal("gui.de.flowGate.name")) / 2),
|
||||
guiTop + 5,
|
||||
0x2c2c2c);
|
||||
|
||||
if (!tile.flowOverridden) {
|
||||
String flowRSLow = tile.getFlowSetting(0);
|
||||
String flowRSHeigh = tile.getFlowSetting(1);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.flowGateRSHigh.name"), guiCrt - (fontRendererObj.getStringWidth(StatCollector.translateToLocal("gui.de.flowGateRSHigh.name")) / 2), guiTop + 20, 0xff0000);
|
||||
fontRendererObj.drawString(flowRSHeigh, guiCrt - (fontRendererObj.getStringWidth(flowRSHeigh) / 2), guiTop + 31, 0x2c2c2c);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.flowGateRSLow.name"), guiCrt - (fontRendererObj.getStringWidth(StatCollector.translateToLocal("gui.de.flowGateRSLow.name")) / 2), guiTop + 50, 0x660000);
|
||||
fontRendererObj.drawString(flowRSLow, guiCrt - (fontRendererObj.getStringWidth(flowRSLow) / 2), guiTop + 61, 0x2c2c2c);
|
||||
} else
|
||||
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("gui.de.flowGateOverridden.txt"), width / 2, height / 2 - 30, 0x00FF00);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocal("gui.de.flowGateRSHigh.name"),
|
||||
guiCrt - (fontRendererObj
|
||||
.getStringWidth(StatCollector.translateToLocal("gui.de.flowGateRSHigh.name")) / 2),
|
||||
guiTop + 20,
|
||||
0xff0000);
|
||||
fontRendererObj.drawString(
|
||||
flowRSHeigh,
|
||||
guiCrt - (fontRendererObj.getStringWidth(flowRSHeigh) / 2),
|
||||
guiTop + 31,
|
||||
0x2c2c2c);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocal("gui.de.flowGateRSLow.name"),
|
||||
guiCrt - (fontRendererObj
|
||||
.getStringWidth(StatCollector.translateToLocal("gui.de.flowGateRSLow.name")) / 2),
|
||||
guiTop + 50,
|
||||
0x660000);
|
||||
fontRendererObj.drawString(
|
||||
flowRSLow,
|
||||
guiCrt - (fontRendererObj.getStringWidth(flowRSLow) / 2),
|
||||
guiTop + 61,
|
||||
0x2c2c2c);
|
||||
} else drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("gui.de.flowGateOverridden.txt"),
|
||||
width / 2,
|
||||
height / 2 - 30,
|
||||
0x00FF00);
|
||||
|
||||
String flow = StatCollector.translateToLocal("gui.de.flowGateCurrentFlow.name") + ": " + Utills.addCommas(tile.getActualFlow());
|
||||
String flow = StatCollector.translateToLocal("gui.de.flowGateCurrentFlow.name") + ": "
|
||||
+ formatNumber(tile.getActualFlow());
|
||||
fontRendererObj.drawString(flow, guiCrt - (fontRendererObj.getStringWidth(flow) / 2), guiTop + 76, 0x2c2c2c);
|
||||
|
||||
if (!tile.flowOverridden) {
|
||||
fontRendererObj.drawSplitString(StatCollector.translateToLocal("gui.de.flowGatePartialSignal.name"), guiLeft + 5, guiTop + 90, 197, 0xFFFFFF);
|
||||
fontRendererObj.drawSplitString(StatCollector.translateToLocal("gui.de.ctrlAndShift.name"), guiLeft + 200, guiTop + 5, 100, 0xFFFFFF);
|
||||
fontRendererObj.drawSplitString(
|
||||
StatCollector.translateToLocal("gui.de.flowGatePartialSignal.name"),
|
||||
guiLeft + 5,
|
||||
guiTop + 90,
|
||||
197,
|
||||
0xFFFFFF);
|
||||
fontRendererObj.drawSplitString(
|
||||
StatCollector.translateToLocal("gui.de.ctrlAndShift.name"),
|
||||
guiLeft + 200,
|
||||
guiTop + 5,
|
||||
100,
|
||||
0xFFFFFF);
|
||||
|
||||
ResourceHandler.bindResource("textures/gui/Widgets.png");
|
||||
super.drawScreen(x, y, pt);
|
||||
@@ -73,22 +113,37 @@ public class GUIFlowGate extends GuiScreen {
|
||||
boolean ctrl = Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL);
|
||||
|
||||
if (GuiHelper.isInRect(guiLeft + 20, guiTop + 20, 18, 18, x, y)) {
|
||||
hoverText.add(StatCollector.translateToLocal("gui.de.decrement.name") + " " + tile.getToolTip(1, shift, ctrl));
|
||||
hoverText.add(
|
||||
StatCollector.translateToLocal("gui.de.decrement.name") + " "
|
||||
+ tile.getToolTip(1, shift, ctrl));
|
||||
}
|
||||
if (GuiHelper.isInRect(guiLeft + 159, guiTop + 20, 18, 18, x, y)) {
|
||||
hoverText.add(StatCollector.translateToLocal("gui.de.increment.name") + " " + tile.getToolTip(1, shift, ctrl));
|
||||
hoverText.add(
|
||||
StatCollector.translateToLocal("gui.de.increment.name") + " "
|
||||
+ tile.getToolTip(1, shift, ctrl));
|
||||
}
|
||||
|
||||
if (GuiHelper.isInRect(guiLeft + 20, guiTop + 50, 18, 18, x, y)) {
|
||||
hoverText.add(StatCollector.translateToLocal("gui.de.decrement.name") + " " + tile.getToolTip(0, shift, ctrl));
|
||||
hoverText.add(
|
||||
StatCollector.translateToLocal("gui.de.decrement.name") + " "
|
||||
+ tile.getToolTip(0, shift, ctrl));
|
||||
}
|
||||
if (GuiHelper.isInRect(guiLeft + 159, guiTop + 50, 18, 18, x, y)) {
|
||||
hoverText.add(StatCollector.translateToLocal("gui.de.increment.name") + " " + tile.getToolTip(0, shift, ctrl));
|
||||
hoverText.add(
|
||||
StatCollector.translateToLocal("gui.de.increment.name") + " "
|
||||
+ tile.getToolTip(0, shift, ctrl));
|
||||
}
|
||||
|
||||
if (!hoverText.isEmpty()) {
|
||||
hoverText.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("gui.de.pressOrScroll.name"));
|
||||
drawHoveringText(hoverText, x - (x < width / 2 ? fontRendererObj.getStringWidth(StatCollector.translateToLocal("gui.de.decrement.name") + " " + tile.getToolTip(1, shift, ctrl)) + 25 : 0), y, fontRendererObj);
|
||||
drawHoveringText(
|
||||
hoverText,
|
||||
x - (x < width / 2 ? fontRendererObj.getStringWidth(
|
||||
StatCollector.translateToLocal("gui.de.decrement.name") + " "
|
||||
+ tile.getToolTip(1, shift, ctrl))
|
||||
+ 25 : 0),
|
||||
y,
|
||||
fontRendererObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -155,5 +210,4 @@ public class GUIFlowGate extends GuiScreen {
|
||||
this.mc.setIngameFocus();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,22 +1,27 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerGenerator;
|
||||
import com.brandon3055.brandonscore.client.utills.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileGenerator;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerGenerator;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileGenerator;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GUIGenerator extends GuiContainer {
|
||||
@@ -35,7 +40,9 @@ public class GUIGenerator extends GuiContainer {
|
||||
this.player = invPlayer.player;
|
||||
}
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/GGrinder.png");
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
References.MODID.toLowerCase(),
|
||||
"textures/gui/GGrinder.png");
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int X, int Y) {
|
||||
@@ -43,55 +50,53 @@ public class GUIGenerator extends GuiContainer {
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
drawTexturedModalRect(guiLeft + 63, guiTop + 34, 0, ySize, 18, 18);//fuel box
|
||||
drawTexturedModalRect(guiLeft + 97, guiTop + 34, 18, ySize, 18, 18);//flame box
|
||||
if (tile.getStackInSlot(0) == null)
|
||||
drawTexturedModalRect(guiLeft + 63, guiTop + 34, 36, ySize, 18, 18);//fuel box
|
||||
drawTexturedModalRect(guiLeft + 63, guiTop + 34, 0, ySize, 18, 18); // fuel box
|
||||
drawTexturedModalRect(guiLeft + 97, guiTop + 34, 18, ySize, 18, 18); // flame box
|
||||
if (tile.getStackInSlot(0) == null) drawTexturedModalRect(guiLeft + 63, guiTop + 34, 36, ySize, 18, 18); // fuel
|
||||
// box
|
||||
|
||||
float power = (float) tile.getEnergyStored(ForgeDirection.DOWN) / (float) tile.getMaxEnergyStored(ForgeDirection.DOWN) * -1 + 1;
|
||||
float power = (float) tile.getEnergyStored(ForgeDirection.DOWN)
|
||||
/ (float) tile.getMaxEnergyStored(ForgeDirection.DOWN)
|
||||
* -1 + 1;
|
||||
float fuel = tile.burnTimeRemaining / ((float) tile.burnTime) * -1 + 1;
|
||||
|
||||
drawTexturedModalRect(guiLeft + 83, guiTop + 11 + (int) (power * 40), xSize, 0 + (int) (power * 40), 12, 40 - (int) (power * 40));//Power bar
|
||||
drawTexturedModalRect(guiLeft + 100, guiTop + 37 + (int) (fuel * 13), xSize, 40 + (int) (fuel * 13), 18, 18 - (int) (fuel * 13));//Power bar
|
||||
drawTexturedModalRect(
|
||||
guiLeft + 83,
|
||||
guiTop + 11 + (int) (power * 40),
|
||||
xSize,
|
||||
0 + (int) (power * 40),
|
||||
12,
|
||||
40 - (int) (power * 40)); // Power bar
|
||||
drawTexturedModalRect(
|
||||
guiLeft + 100,
|
||||
guiTop + 37 + (int) (fuel * 13),
|
||||
xSize,
|
||||
40 + (int) (fuel * 13),
|
||||
18,
|
||||
18 - (int) (fuel * 13)); // Power bar
|
||||
|
||||
fontRendererObj.drawStringWithShadow("Generator", guiLeft + 64, guiTop + 0, 0x00FFFF);
|
||||
fontRendererObj.drawStringWithShadow(
|
||||
StatCollector.translateToLocal("gui.de.generator.main.title"),
|
||||
guiLeft + 64,
|
||||
guiTop,
|
||||
0x00FFFF);
|
||||
|
||||
int x = X - guiLeft;
|
||||
int y = Y - guiTop;
|
||||
if (GuiHelper.isInRect(83, 10, 12, 40, x, y)) {
|
||||
ArrayList<String> internal = new ArrayList<String>();
|
||||
internal.add("Internal Storage");
|
||||
internal.add("" + EnumChatFormatting.DARK_BLUE + tile.getEnergyStored(ForgeDirection.UP) + "/" + tile.getMaxEnergyStored(ForgeDirection.UP));
|
||||
internal.add(StatCollector.translateToLocal("gui.de.internalStorage.txt"));
|
||||
internal.add(
|
||||
EnumChatFormatting.DARK_BLUE + formatNumber(tile.getEnergyStored(ForgeDirection.UP))
|
||||
+ "/"
|
||||
+ formatNumber(tile.getMaxEnergyStored(ForgeDirection.UP)));
|
||||
drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int X, int Y) {
|
||||
|
||||
int x = X - guiLeft;
|
||||
int y = Y - guiTop;
|
||||
/* if (GuiHelper.isInRect(83, 10, 95, 50, x, y)) {
|
||||
ArrayList<String> internal = new ArrayList<String>();
|
||||
internal.add("Internal Storage");
|
||||
internal.add("" + EnumChatFormatting.DARK_BLUE + tile.getEnergyStored(ForgeDirection.UP) + "/" + tile.getMaxEnergyStored(ForgeDirection.UP));
|
||||
drawHoveringText(internal, x, y, fontRendererObj);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
//ID
|
||||
//buttonList.add(new GuiButton(0, guiLeft + 85, guiTop , 85, 20, text));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -102,9 +107,6 @@ public class GUIGenerator extends GuiContainer {
|
||||
guiUpdateTick = 0;
|
||||
}
|
||||
super.updateScreen();
|
||||
|
||||
}
|
||||
|
||||
// ####Draw at############ read from size
|
||||
//drawTexturedModalRect(guiLeft + 37, guiTop + 4, 0, 143, 37, 38);
|
||||
}
|
||||
@@ -1,22 +1,27 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerGrinder;
|
||||
import com.brandon3055.brandonscore.client.utills.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileGrinder;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerGrinder;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileGrinder;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GUIGrinder extends GuiContainer {
|
||||
@@ -35,7 +40,9 @@ public class GUIGrinder extends GuiContainer {
|
||||
this.player = invPlayer.player;
|
||||
}
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/GGrinder.png");
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
References.MODID.toLowerCase(),
|
||||
"textures/gui/GGrinder.png");
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int X, int Y) {
|
||||
@@ -43,24 +50,44 @@ public class GUIGrinder extends GuiContainer {
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
if (!tile.isExternallyPowered()) drawTexturedModalRect(guiLeft + 63, guiTop + 34, 0, ySize, 18, 18);//fuel box
|
||||
drawTexturedModalRect(guiLeft + 97, guiTop + 34, 18, ySize, 18, 18);//flame box
|
||||
if (!tile.isExternallyPowered()) drawTexturedModalRect(guiLeft + 63, guiTop + 34, 0, ySize, 18, 18); // fuel box
|
||||
drawTexturedModalRect(guiLeft + 97, guiTop + 34, 18, ySize, 18, 18); // flame box
|
||||
if (tile.getStackInSlot(0) == null && !tile.isExternallyPowered())
|
||||
drawTexturedModalRect(guiLeft + 63, guiTop + 34, 36, ySize, 18, 18);//fuel box
|
||||
drawTexturedModalRect(guiLeft + 63, guiTop + 34, 36, ySize, 18, 18); // fuel box
|
||||
|
||||
float power;
|
||||
if (tile.isExternallyPowered()) {
|
||||
power = (float) tile.getEnergyStored(ForgeDirection.DOWN) / (float) tile.getMaxEnergyStored(ForgeDirection.DOWN) * -1 + 1;
|
||||
power = (float) tile.getEnergyStored(ForgeDirection.DOWN)
|
||||
/ (float) tile.getMaxEnergyStored(ForgeDirection.DOWN)
|
||||
* -1 + 1;
|
||||
} else {
|
||||
power = (float) tile.getInternalBuffer().getEnergyStored() / (float) tile.getInternalBuffer().getMaxEnergyStored() * -1 + 1;
|
||||
power = (float) tile.getInternalBuffer().getEnergyStored()
|
||||
/ (float) tile.getInternalBuffer().getMaxEnergyStored()
|
||||
* -1 + 1;
|
||||
}
|
||||
float fuel = tile.burnTimeRemaining / ((float) tile.burnTime) * -1 + 1;
|
||||
|
||||
drawTexturedModalRect(guiLeft + 83, guiTop + 11 + (int) (power * 40), xSize, 0 + (int) (power * 40), 12, 40 - (int) (power * 40));//Power bar
|
||||
drawTexturedModalRect(guiLeft + 100, guiTop + 37 + (int) (fuel * 13), xSize, 40 + (int) (fuel * 13), 18, 18 - (int) (fuel * 13));//Power bar
|
||||
drawTexturedModalRect(
|
||||
guiLeft + 83,
|
||||
guiTop + 11 + (int) (power * 40),
|
||||
xSize,
|
||||
(int) (power * 40),
|
||||
12,
|
||||
40 - (int) (power * 40)); // Power bar
|
||||
drawTexturedModalRect(
|
||||
guiLeft + 100,
|
||||
guiTop + 37 + (int) (fuel * 13),
|
||||
xSize,
|
||||
40 + (int) (fuel * 13),
|
||||
18,
|
||||
18 - (int) (fuel * 13)); // Power bar
|
||||
if (tile.isExternallyPowered()) drawTexturedModalRect(guiLeft + 100, guiTop + 37, xSize, 66, 13, 13);
|
||||
|
||||
fontRendererObj.drawStringWithShadow("Grinder", guiLeft + 71, guiTop + 0, 0x00FFFF);
|
||||
fontRendererObj.drawStringWithShadow(
|
||||
StatCollector.translateToLocal("gui.de.grinder.main.title"),
|
||||
guiLeft + 71,
|
||||
guiTop,
|
||||
0x00FFFF);
|
||||
|
||||
int x = X - guiLeft;
|
||||
int y = Y - guiTop;
|
||||
@@ -68,34 +95,25 @@ public class GUIGrinder extends GuiContainer {
|
||||
ArrayList<String> internal = new ArrayList<String>();
|
||||
internal.add("Energy Buffer");
|
||||
if (tile.isExternallyPowered()) {
|
||||
internal.add("" + EnumChatFormatting.DARK_BLUE + tile.getEnergyStored(ForgeDirection.UP) + "/" + tile.getMaxEnergyStored(ForgeDirection.UP));
|
||||
internal.add(
|
||||
"" + EnumChatFormatting.DARK_BLUE
|
||||
+ formatNumber(tile.getEnergyStored(ForgeDirection.UP))
|
||||
+ "/"
|
||||
+ formatNumber(tile.getMaxEnergyStored(ForgeDirection.UP)));
|
||||
} else {
|
||||
internal.add("" + EnumChatFormatting.DARK_BLUE + tile.getInternalBuffer().getEnergyStored() + "/" + tile.getInternalBuffer().getMaxEnergyStored());
|
||||
internal.add(
|
||||
"" + EnumChatFormatting.DARK_BLUE
|
||||
+ formatNumber(tile.getInternalBuffer().getEnergyStored())
|
||||
+ "/"
|
||||
+ formatNumber(tile.getInternalBuffer().getMaxEnergyStored()));
|
||||
}
|
||||
drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
//fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
|
||||
//drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
|
||||
//drawCenteredString(fontRendererObj, "Weather Controller", xSize/2, -15, 0x2a4ed0);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
//ID
|
||||
//buttonList.add(new GuiButton(0, guiLeft + 85, guiTop , 85, 20, text));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -106,9 +124,6 @@ public class GUIGrinder extends GuiContainer {
|
||||
guiUpdateTick = 0;
|
||||
}
|
||||
super.updateScreen();
|
||||
|
||||
}
|
||||
|
||||
// ####Draw at############ read from size
|
||||
//drawTexturedModalRect(guiLeft + 37, guiTop + 4, 0, 143, 37, 38);
|
||||
}
|
||||
+510
-751
File diff suppressed because it is too large.
Load diff
+184
-140
@@ -1,104 +1,118 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerPlayerDetector;
|
||||
import com.brandon3055.draconicevolution.common.network.PlayerDetectorButtonPacket;
|
||||
import com.brandon3055.draconicevolution.common.network.PlayerDetectorStringPacket;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TilePlayerDetectorAdvanced;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerPlayerDetector;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.network.PlayerDetectorButtonPacket;
|
||||
import com.brandon3055.draconicevolution.common.network.PlayerDetectorStringPacket;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TilePlayerDetectorAdvanced;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GUIPlayerDetector extends GuiContainer {
|
||||
|
||||
public EntityPlayer player;
|
||||
private TilePlayerDetectorAdvanced detector;
|
||||
public boolean showInvSlots = true;
|
||||
private boolean editMode = false;
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
References.MODID.toLowerCase(),
|
||||
"textures/gui/PlayerDetector.png");
|
||||
|
||||
private final ContainerPlayerDetector container;
|
||||
private boolean isInEditMode = false;
|
||||
private int range = 0;
|
||||
private int maxRange = 20;
|
||||
private boolean whitelist = false;
|
||||
private boolean initScedualed = false;
|
||||
private boolean isInWhitelistMode = false;
|
||||
private boolean isOutputInverted = false;
|
||||
private boolean isInitScheduled = false;
|
||||
private int initTick = 0;
|
||||
private String[] names = new String[42];
|
||||
private final String[] names = new String[42];
|
||||
private GuiTextField selectedNameText;
|
||||
private int selected = -1;
|
||||
private boolean outputInverted = false;
|
||||
private int selectedMameIndex = -1;
|
||||
|
||||
public GUIPlayerDetector(InventoryPlayer invPlayer, TilePlayerDetectorAdvanced detector) {
|
||||
super(detector.getGuiContainer(invPlayer));
|
||||
this.inventorySlots = new ContainerPlayerDetector(invPlayer, detector, this);
|
||||
|
||||
for (int i = 0; i < names.length; i++)
|
||||
names[i] = "";
|
||||
public GUIPlayerDetector(InventoryPlayer playerInventory, TilePlayerDetectorAdvanced detector) {
|
||||
super(detector.getGuiContainer(playerInventory));
|
||||
container = (ContainerPlayerDetector) inventorySlots;
|
||||
Arrays.fill(names, "");
|
||||
|
||||
xSize = 176;
|
||||
ySize = 198;
|
||||
|
||||
this.detector = detector;
|
||||
this.player = invPlayer.player;
|
||||
syncWithServer();
|
||||
}
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/PlayerDetector.png");
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int x, int y) {
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
if (editMode) {
|
||||
if (isInEditMode) {
|
||||
drawTexturedModalRect(guiLeft + 3, guiTop + ySize / 2, 3, 3, xSize - 6, (ySize / 2) - 3);
|
||||
drawNameChart(x, y);
|
||||
}
|
||||
|
||||
if (showInvSlots) drawTexturedModalRect(guiLeft + 142, guiTop + 19, xSize, 0, 23, 41);
|
||||
|
||||
if (container.shouldShowInventory()) {
|
||||
drawTexturedModalRect(guiLeft + 142, guiTop + 19, xSize, 0, 23, 41);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
drawGuiText(x, y);
|
||||
|
||||
|
||||
drawGuiText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int x, int y, float p_73863_3_) {
|
||||
super.drawScreen(x, y, p_73863_3_);
|
||||
ArrayList<String> lines = new ArrayList<String>();
|
||||
lines.add("Camouflage");
|
||||
if ((x - guiLeft > 142 && x - guiLeft < 160) && (y - guiTop > 19 && y - guiTop < 37) && showInvSlots)
|
||||
public void drawScreen(int x, int y, float partialTicks) {
|
||||
super.drawScreen(x, y, partialTicks);
|
||||
ArrayList<String> lines = new ArrayList<>();
|
||||
lines.add(StatCollector.translateToLocal("gui.de.playerDetector.camouflage"));
|
||||
if ((x - guiLeft > 142 && x - guiLeft < 160) && (y - guiTop > 19 && y - guiTop < 37)
|
||||
&& container.shouldShowInventory()) {
|
||||
drawHoveringText(lines, x, y, fontRendererObj);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
buttonList.clear();
|
||||
if (!editMode) {
|
||||
String wt = whitelist ? "White List" : "Black List";
|
||||
int centre = width / 2;
|
||||
buttonList.add(new GuiButton(0, centre - 20 - 20, guiTop + 20, 20, 20, "+"));
|
||||
buttonList.add(new GuiButton(1, centre + 20, guiTop + 20, 20, 20, "-"));
|
||||
buttonList.add(new GuiButton(3, centre - 40, guiTop + 45, 60, 20, wt));
|
||||
buttonList.add(new GuiButton(4, centre + 20, guiTop + 45, 20, 20, "!"));
|
||||
buttonList.add(new GuiButton(6, centre - 40, guiTop + 70, 80, 20, "Invert Output"));
|
||||
if (!isInEditMode) {
|
||||
String mode = isInWhitelistMode ? StatCollector.translateToLocal("gui.de.playerDetector.whiteList")
|
||||
: StatCollector.translateToLocal("gui.de.playerDetector.blackList");
|
||||
int center = width / 2;
|
||||
buttonList.add(new GuiButton(0, center - 20 - 20, guiTop + 20, 20, 20, "+"));
|
||||
buttonList.add(new GuiButton(1, center + 20, guiTop + 20, 20, 20, "-"));
|
||||
buttonList.add(new GuiButton(3, center - 40, guiTop + 45, 60, 20, mode));
|
||||
buttonList.add(new GuiButton(4, center + 20, guiTop + 45, 20, 20, "!"));
|
||||
buttonList.add(
|
||||
new GuiButton(
|
||||
6,
|
||||
center - 40,
|
||||
guiTop + 70,
|
||||
80,
|
||||
20,
|
||||
StatCollector.translateToLocal("gui.de.playerDetector.invertOutput")));
|
||||
} else {
|
||||
buttonList.add(new GuiButton(5, guiLeft - 40, guiTop + ySize - 20, 40, 20, "Back"));
|
||||
buttonList.add(
|
||||
new GuiButton(
|
||||
5,
|
||||
guiLeft - 40,
|
||||
guiTop + ySize - 20,
|
||||
40,
|
||||
20,
|
||||
StatCollector.translateToLocal("gui.de.playerDetector.back")));
|
||||
}
|
||||
|
||||
selectedNameText = new GuiTextField(fontRendererObj, 4, -12, 168, 12);
|
||||
@@ -106,111 +120,133 @@ public class GUIPlayerDetector extends GuiContainer {
|
||||
selectedNameText.setDisabledTextColour(-1);
|
||||
selectedNameText.setEnableBackgroundDrawing(true);
|
||||
selectedNameText.setMaxStringLength(40);
|
||||
selectedNameText.setVisible(editMode);
|
||||
|
||||
//ID
|
||||
//buttonList.add(new GuiButton(0, guiLeft + 85, guiTop , 85, 20, "sgASGgs"));
|
||||
|
||||
//syncWithServer();
|
||||
selectedNameText.setVisible(isInEditMode);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
switch (button.id) {
|
||||
case 0: //Range +
|
||||
range = (range < maxRange) ? range + 1 : maxRange;
|
||||
case 0 -> { // Range +
|
||||
range = Math.min(range + 1, TilePlayerDetectorAdvanced.MAXIMUM_RANGE);
|
||||
DraconicEvolution.network.sendToServer(new PlayerDetectorButtonPacket((byte) 0, (byte) range));
|
||||
break;
|
||||
case 1: //Range -
|
||||
range = (range > 1) ? range - 1 : 1;
|
||||
}
|
||||
case 1 -> { // Range -
|
||||
range = Math.max(range - 1, TilePlayerDetectorAdvanced.MINIMUM_RANGE);
|
||||
DraconicEvolution.network.sendToServer(new PlayerDetectorButtonPacket((byte) 0, (byte) range));
|
||||
break;
|
||||
case 3: //White List -
|
||||
initScedualed = true;
|
||||
editMode = true;
|
||||
showInvSlots = false;
|
||||
((ContainerPlayerDetector) this.inventorySlots).updateContainerSlots();
|
||||
break;
|
||||
case 4: //Toggle White List -
|
||||
whitelist = !whitelist;
|
||||
initScedualed = true;
|
||||
byte val = (byte) (whitelist ? 1 : 0);
|
||||
DraconicEvolution.network.sendToServer(new PlayerDetectorButtonPacket((byte) 1, val));
|
||||
break;
|
||||
case 5: //Back -
|
||||
editMode = false;
|
||||
showInvSlots = true;
|
||||
((ContainerPlayerDetector) this.inventorySlots).updateContainerSlots();
|
||||
initScedualed = true;
|
||||
break;
|
||||
case 6: //Back -
|
||||
outputInverted = !outputInverted;
|
||||
initScedualed = true;
|
||||
byte val2 = (byte) (outputInverted ? 1 : 0);
|
||||
DraconicEvolution.network.sendToServer(new PlayerDetectorButtonPacket((byte) 2, val2));
|
||||
break;
|
||||
}
|
||||
case 3 -> { // Edit Whitelist/Blacklist
|
||||
isInitScheduled = true;
|
||||
isInEditMode = true;
|
||||
container.setShouldShowInventory(false);
|
||||
}
|
||||
case 4 -> { // Toggle Whitelist/Blacklist mode
|
||||
isInitScheduled = true;
|
||||
isInWhitelistMode = !isInWhitelistMode;
|
||||
byte whitelistMode = (byte) (isInWhitelistMode ? 1 : 0);
|
||||
DraconicEvolution.network.sendToServer(new PlayerDetectorButtonPacket((byte) 1, whitelistMode));
|
||||
}
|
||||
case 5 -> { // Back
|
||||
isInitScheduled = true;
|
||||
isInEditMode = false;
|
||||
container.setShouldShowInventory(true);
|
||||
}
|
||||
case 6 -> { // Invert Output
|
||||
isInitScheduled = true;
|
||||
isOutputInverted = !isOutputInverted;
|
||||
byte outputMode = (byte) (isOutputInverted ? 1 : 0);
|
||||
DraconicEvolution.network.sendToServer(new PlayerDetectorButtonPacket((byte) 2, outputMode));
|
||||
}
|
||||
}
|
||||
|
||||
//DraconicEvolution.channelHandler.sendToServer(new ButtonPacket((byte) 0, true));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char par1, int par2) {
|
||||
if (this.selectedNameText.textboxKeyTyped(par1, par2)) return;
|
||||
else if (par2 == 28) {
|
||||
protected void keyTyped(char typedChar, int keyCode) {
|
||||
if (this.selectedNameText.textboxKeyTyped(typedChar, keyCode)) {
|
||||
return;
|
||||
}
|
||||
if (keyCode == 28) {
|
||||
if (selectedNameText.isFocused()) {
|
||||
names[selected] = selectedNameText.getText();
|
||||
names[selectedMameIndex] = selectedNameText.getText();
|
||||
selectedNameText.setText("");
|
||||
selectedNameText.setFocused(false);
|
||||
DraconicEvolution.network.sendToServer(new PlayerDetectorStringPacket((byte) selected, names[selected]));
|
||||
selected = -1;
|
||||
DraconicEvolution.network.sendToServer(
|
||||
new PlayerDetectorStringPacket((byte) selectedMameIndex, names[selectedMameIndex]));
|
||||
selectedMameIndex = -1;
|
||||
}
|
||||
} else super.keyTyped(par1, par2);
|
||||
} else {
|
||||
super.keyTyped(typedChar, keyCode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
if (initScedualed) initTick++;
|
||||
if (isInitScheduled) {
|
||||
initTick++;
|
||||
}
|
||||
if (initTick > 1) {
|
||||
initTick = 0;
|
||||
initScedualed = false;
|
||||
isInitScheduled = false;
|
||||
initGui();
|
||||
}
|
||||
super.updateScreen();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int x, int y, int par3) {
|
||||
super.mouseClicked(x, y, par3);
|
||||
|
||||
if (editMode) selectName(x - guiLeft, y - guiTop);
|
||||
|
||||
//this.selectedNameText.mouseClicked(x - guiLeft, y - guiTop, par3);
|
||||
protected void mouseClicked(int x, int y, int mouseButton) {
|
||||
super.mouseClicked(x, y, mouseButton);
|
||||
if (isInEditMode) {
|
||||
selectName(x - guiLeft, y - guiTop);
|
||||
}
|
||||
}
|
||||
|
||||
private void drawGuiText(int rawX, int rawY) {
|
||||
if (!editMode) {
|
||||
drawCenteredString(fontRendererObj, "Advanced Player Detector", xSize / 2, 5, 0x00FFFF);
|
||||
|
||||
fontRendererObj.drawString("Range:", 73, 21, 0x000000, false);
|
||||
fontRendererObj.drawString("Output Inverted: " + String.valueOf(outputInverted), 33, 97, 0x000000, false);
|
||||
if (range < 10) fontRendererObj.drawString("" + range, 85, 31, 0x000000, false);
|
||||
else fontRendererObj.drawString("" + range, 82, 31, 0x000000, false);
|
||||
} else {
|
||||
if (selected != -1) drawCenteredString(fontRendererObj, "Press Enter to save", xSize / 2, -22, 0xFF0000);
|
||||
|
||||
for (int i = 0; i < 21; i++) {
|
||||
for (int j = 0; j < 2; j++) {
|
||||
if (i + j * 21 != selected) {
|
||||
String s = names[i + j * 21];
|
||||
if (s.length() > 13) s = s.substring(0, 13) + "...";
|
||||
fontRendererObj.drawString(s, 5 + j * 84, 6 + i * 9, 0x980000);
|
||||
private void drawGuiText() {
|
||||
if (isInEditMode) {
|
||||
if (selectedMameIndex != -1) {
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("gui.de.playerDetector.pressEnter"),
|
||||
xSize / 2,
|
||||
-22,
|
||||
0xFF0000);
|
||||
}
|
||||
for (int row = 0; row < 21; row++) {
|
||||
for (int column = 0; column < 2; column++) {
|
||||
if (row + column * 21 != selectedMameIndex) {
|
||||
String name = names[row + column * 21];
|
||||
if (name.length() > 13) {
|
||||
name = name.substring(0, 13) + "...";
|
||||
}
|
||||
fontRendererObj.drawString(name, 5 + column * 84, 6 + row * 9, 0x980000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("gui.de.playerDetector.main.title"),
|
||||
xSize / 2,
|
||||
5,
|
||||
0x00FFFF);
|
||||
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocal("gui.de.playerDetector.range") + ":",
|
||||
73,
|
||||
21,
|
||||
0x000000,
|
||||
false);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.playerDetector.outputInvert", isOutputInverted),
|
||||
33,
|
||||
97,
|
||||
0x000000,
|
||||
false);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.numbers", range),
|
||||
range < 10 ? 85 : 82,
|
||||
31,
|
||||
0x000000,
|
||||
false);
|
||||
}
|
||||
selectedNameText.drawTextBox();
|
||||
}
|
||||
|
||||
@@ -218,38 +254,46 @@ public class GUIPlayerDetector extends GuiContainer {
|
||||
int x = rawX - guiLeft;
|
||||
int y = rawY - guiTop;
|
||||
|
||||
for (int i = 0; i < 21; i++) {
|
||||
drawTexturedModalRect(guiLeft + 4, guiTop + 4 + i * 9, 0, ySize, 186, 10);
|
||||
for (int row = 0; row < 21; row++) {
|
||||
drawTexturedModalRect(guiLeft + 4, guiTop + 4 + row * 9, 0, ySize, 186, 10);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 21; i++) {
|
||||
for (int j = 0; j < 2; j++) {
|
||||
if ((x > 4 + j * 84 && x < (xSize / 2) - 1 + j * 82) && (y > 4 + i * 9 && y < 13 + i * 9) || i + j * 21 == selected)
|
||||
drawTexturedModalRect(guiLeft + 5 + j * 84, guiTop + 5 + i * 9, 0, ySize + 10, 82, 8);
|
||||
for (int row = 0; row < 21; row++) {
|
||||
for (int column = 0; column < 2; column++) {
|
||||
if ((x > 4 + column * 84 && x < (xSize / 2) - 1 + column * 82) && (y > 4 + row * 9 && y < 13 + row * 9)
|
||||
|| row + column * 21 == selectedMameIndex)
|
||||
drawTexturedModalRect(guiLeft + 5 + column * 84, guiTop + 5 + row * 9, 0, ySize + 10, 82, 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void selectName(int x, int y) {
|
||||
if (initScedualed) return;
|
||||
if (isInitScheduled) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 21; i++) {
|
||||
for (int j = 0; j < 2; j++) {
|
||||
if ((x > 4 + j * 84 && x < (xSize / 2) - 1 + j * 82) && (y > 4 + i * 9 && y < 13 + i * 9)) {
|
||||
selected = i + j * 21;
|
||||
selectedNameText.setText(names[i + j * 21]);
|
||||
for (int row = 0; row < 21; row++) {
|
||||
for (int column = 0; column < 2; column++) {
|
||||
if ((x > 4 + column * 84 && x < (xSize / 2) - 1 + column * 82)
|
||||
&& (y > 4 + row * 9 && y < 13 + row * 9)) {
|
||||
selectedMameIndex = row + column * 21;
|
||||
selectedNameText.setText(names[row + column * 21]);
|
||||
selectedNameText.setFocused(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void syncWithServer() {
|
||||
this.whitelist = detector.whiteList;
|
||||
TilePlayerDetectorAdvanced detector = container.getDetector();
|
||||
isInWhitelistMode = detector.isInWhiteListMode;
|
||||
for (int i = 0; i < detector.names.length; i++) {
|
||||
if (detector.names[i] != null) names[i] = detector.names[i];
|
||||
if (detector.names[i] != null) {
|
||||
names[i] = detector.names[i];
|
||||
}
|
||||
}
|
||||
range = detector.range;
|
||||
outputInverted = detector.outputInverted;
|
||||
isOutputInverted = detector.isOutputInverted;
|
||||
}
|
||||
}
|
||||
@@ -8,14 +8,15 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerSunDial;
|
||||
import com.brandon3055.draconicevolution.common.network.TeleporterPacket;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.network.TeleporterPacket;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileSunDial;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GUISunDial extends GuiContainer {
|
||||
|
||||
@@ -26,7 +27,6 @@ public class GUISunDial extends GuiContainer {
|
||||
|
||||
xSize = 176;
|
||||
ySize = 90;
|
||||
|
||||
}
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(References.MODID, "textures/gui/SunDial.png");
|
||||
@@ -37,22 +37,20 @@ public class GUISunDial extends GuiContainer {
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
//fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
|
||||
//drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
|
||||
//drawCenteredString(fontRendererObj, "Weather Controller", xSize/2, -15, 0x2a4ed0);
|
||||
// fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
|
||||
// drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
|
||||
// drawCenteredString(fontRendererObj, "Weather Controller", xSize/2, -15, 0x2a4ed0);
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
//ID
|
||||
// ID
|
||||
buttonList.add(new GuiButton(0, guiLeft + 10, guiTop + 10, 85, 20, ""));
|
||||
}
|
||||
|
||||
@@ -61,7 +59,6 @@ public class GUISunDial extends GuiContainer {
|
||||
if (button.id == 0) {
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -73,6 +70,4 @@ public class GUISunDial extends GuiContainer {
|
||||
}
|
||||
super.updateScreen();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,15 +1,8 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import com.brandon3055.brandonscore.client.utills.GuiHelper;
|
||||
import com.brandon3055.brandonscore.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.brandonscore.common.utills.Teleporter.TeleportLocation;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.network.TeleporterPacket;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
@@ -23,19 +16,34 @@ import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.network.TeleporterPacket;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.Teleporter;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GUITeleporter extends GuiScreen {
|
||||
|
||||
private static final int PEARLS_WITH_SHIFT = Loader.isModLoaded("dreamcraft") ? 64 : 16;
|
||||
private final int xSize = 182;
|
||||
private final int ySize = 141;
|
||||
private ResourceLocation guiTexture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/TeleporterMKII.png");
|
||||
private ResourceLocation guiTexture = new ResourceLocation(
|
||||
References.MODID.toLowerCase(),
|
||||
"textures/gui/TeleporterMKII.png");
|
||||
private ItemStack teleporterItem;
|
||||
protected List<TeleportLocation> locations = new ArrayList<TeleportLocation>(0);
|
||||
protected List<Teleporter.TeleportLocation> locations = new ArrayList<>(0);
|
||||
|
||||
private int selected = 0;
|
||||
private int selectionOffset = 0;
|
||||
@@ -52,7 +60,8 @@ public class GUITeleporter extends GuiScreen {
|
||||
public GUITeleporter(EntityPlayer player) {
|
||||
super();
|
||||
this.player = player;
|
||||
if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().isItemEqual(new ItemStack(ModItems.teleporterMKII))) {
|
||||
if (player.getCurrentEquippedItem() != null
|
||||
&& player.getCurrentEquippedItem().isItemEqual(new ItemStack(ModItems.teleporterMKII))) {
|
||||
this.teleporterItem = player.getCurrentEquippedItem();
|
||||
readDataFromItem(teleporterItem);
|
||||
}
|
||||
@@ -82,7 +91,11 @@ public class GUITeleporter extends GuiScreen {
|
||||
String colour = EnumChatFormatting.GREEN + "";
|
||||
if (fuel < 10) colour = EnumChatFormatting.YELLOW + "";
|
||||
if (fuel == 0) colour = EnumChatFormatting.DARK_RED + "";
|
||||
fontRendererObj.drawString(colour + StatCollector.translateToLocal("info.teleporterInfFuel.txt") + " " + fuel, posX + 115, posY + 87, 0x000000);
|
||||
fontRendererObj.drawString(
|
||||
colour + StatCollector.translateToLocal("info.teleporterInfFuel.txt") + " " + fuel,
|
||||
posX + 115,
|
||||
posY + 87,
|
||||
0x000000);
|
||||
|
||||
super.drawScreen(x, y, f);
|
||||
|
||||
@@ -162,10 +175,26 @@ public class GUITeleporter extends GuiScreen {
|
||||
int posX = (this.width - xSize) / 2;
|
||||
int posY = (this.height - ySize) / 2;
|
||||
if (locations.size() <= 0) return;
|
||||
fontRendererObj.drawString(EnumChatFormatting.GOLD + "X: " + (int) getLocationSafely(selected + selectionOffset).getXCoord(), posX + 114, posY + 7, 0x000000);
|
||||
fontRendererObj.drawString(EnumChatFormatting.GOLD + "Y: " + (int) getLocationSafely(selected + selectionOffset).getYCoord(), posX + 114, posY + 16, 0x000000);
|
||||
fontRendererObj.drawString(EnumChatFormatting.GOLD + "Z: " + (int) getLocationSafely(selected + selectionOffset).getZCoord(), posX + 114, posY + 25, 0x000000);
|
||||
fontRendererObj.drawString(EnumChatFormatting.GOLD + "" + getLocationSafely(selected + selectionOffset).getDimensionName(), posX + 114, posY + 34, 0x000000);
|
||||
fontRendererObj.drawString(
|
||||
EnumChatFormatting.GOLD + "X: " + (int) getLocationSafely(selected + selectionOffset).getXCoord(),
|
||||
posX + 114,
|
||||
posY + 7,
|
||||
0x000000);
|
||||
fontRendererObj.drawString(
|
||||
EnumChatFormatting.GOLD + "Y: " + (int) getLocationSafely(selected + selectionOffset).getYCoord(),
|
||||
posX + 114,
|
||||
posY + 16,
|
||||
0x000000);
|
||||
fontRendererObj.drawString(
|
||||
EnumChatFormatting.GOLD + "Z: " + (int) getLocationSafely(selected + selectionOffset).getZCoord(),
|
||||
posX + 114,
|
||||
posY + 25,
|
||||
0x000000);
|
||||
fontRendererObj.drawString(
|
||||
EnumChatFormatting.GOLD + "" + getLocationSafely(selected + selectionOffset).getDimensionName(),
|
||||
posX + 114,
|
||||
posY + 34,
|
||||
0x000000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -178,7 +207,7 @@ public class GUITeleporter extends GuiScreen {
|
||||
|
||||
if (textBeingEdited.getVisible()) textBeingEdited.mouseClicked(x, y, button);
|
||||
|
||||
//Check for arrow click
|
||||
// Check for arrow click
|
||||
if (selectionOffset > 0 && GuiHelper.isInRect(3, 5, 13, 15, x - posX, y - posY)) {
|
||||
selectionOffset--;
|
||||
offsetChanged = true;
|
||||
@@ -196,7 +225,7 @@ public class GUITeleporter extends GuiScreen {
|
||||
}
|
||||
}
|
||||
|
||||
//Check for location or lock clicked
|
||||
// Check for location or lock clicked
|
||||
for (int i = 0; i < Math.min(12, locations.size()); i++) {
|
||||
if (GuiHelper.isInRect(17, 6 + i * 11, 80, 10, x - posX, y - posY)) {
|
||||
if (!(getLocationSafely(i + selectionOffset).getWriteProtected() && editingExisting) && button == 0) {
|
||||
@@ -212,22 +241,27 @@ public class GUITeleporter extends GuiScreen {
|
||||
|
||||
if (player.capabilities.isCreativeMode || fuel > 0) {
|
||||
if (!player.capabilities.isCreativeMode) fuel--;
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.TELEPORT, i + selectionOffset, false));
|
||||
DraconicEvolution.network.sendToServer(
|
||||
new TeleporterPacket(TeleporterPacket.TELEPORT, i + selectionOffset, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (GuiHelper.isInRect(99, 8 + i * 11, 8, 7, x - posX, y - posY)) {
|
||||
getLocationSafely(i + selectionOffset).setWriteProtected(!getLocationSafely(i + selectionOffset).getWriteProtected());
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.UPDATELOCK, i + selectionOffset, getLocationSafely(i + selectionOffset).getWriteProtected()));
|
||||
getLocationSafely(i + selectionOffset)
|
||||
.setWriteProtected(!getLocationSafely(i + selectionOffset).getWriteProtected());
|
||||
DraconicEvolution.network.sendToServer(
|
||||
new TeleporterPacket(
|
||||
TeleporterPacket.UPDATELOCK,
|
||||
i + selectionOffset,
|
||||
getLocationSafely(i + selectionOffset).getWriteProtected()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (selectionChanged)
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.CHANGESELECTION, selected, false));
|
||||
if (offsetChanged)
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.UPDATEOFFSET, selectionOffset, false));
|
||||
if (selectionChanged) DraconicEvolution.network
|
||||
.sendToServer(new TeleporterPacket(TeleporterPacket.CHANGESELECTION, selected, false));
|
||||
if (offsetChanged) DraconicEvolution.network
|
||||
.sendToServer(new TeleporterPacket(TeleporterPacket.UPDATEOFFSET, selectionOffset, false));
|
||||
|
||||
updateButtons();
|
||||
super.mouseClicked(x, y, button);
|
||||
@@ -262,10 +296,10 @@ public class GUITeleporter extends GuiScreen {
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
if (selectionChanged)
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.CHANGESELECTION, selected, false));
|
||||
if (offsetChanged)
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.UPDATEOFFSET, selectionOffset, false));
|
||||
if (selectionChanged) DraconicEvolution.network
|
||||
.sendToServer(new TeleporterPacket(TeleporterPacket.CHANGESELECTION, selected, false));
|
||||
if (offsetChanged) DraconicEvolution.network
|
||||
.sendToServer(new TeleporterPacket(TeleporterPacket.UPDATEOFFSET, selectionOffset, false));
|
||||
|
||||
super.handleMouseInput();
|
||||
}
|
||||
@@ -278,8 +312,10 @@ public class GUITeleporter extends GuiScreen {
|
||||
if ((selected + selectionOffset) + 1 > locations.size()) {
|
||||
selected = 0;
|
||||
selectionOffset = 0;
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.CHANGESELECTION, selected, false));
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.UPDATEOFFSET, selectionOffset, false));
|
||||
DraconicEvolution.network
|
||||
.sendToServer(new TeleporterPacket(TeleporterPacket.CHANGESELECTION, selected, false));
|
||||
DraconicEvolution.network
|
||||
.sendToServer(new TeleporterPacket(TeleporterPacket.UPDATEOFFSET, selectionOffset, false));
|
||||
}
|
||||
if (locations.size() == 0 || getLocationSafely(selected + selectionOffset).getWriteProtected()) {
|
||||
((GuiButton) buttonList.get(0)).enabled = false;
|
||||
@@ -302,26 +338,81 @@ public class GUITeleporter extends GuiScreen {
|
||||
else if (!editingNew) ((GuiButton) buttonList.get(4)).enabled = true;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui() {
|
||||
buttonList.clear();
|
||||
int posX = (this.width - xSize) / 2;
|
||||
int posY = (this.height - ySize) / 2;
|
||||
|
||||
//updateTeleporter();
|
||||
// updateTeleporter();
|
||||
|
||||
buttonList.add(new GuiButtonAHeight(0, posX + 112, posY + 45, 66, 12, StatCollector.translateToLocal("button.de.rename.txt")));
|
||||
buttonList.add(new GuiButtonAHeight(1, posX + 112, posY + 58, 66, 12, StatCollector.translateToLocal("button.de.setHere.txt")));
|
||||
buttonList.add(new GuiButtonAHeight(2, posX + 112, posY + 71, 66, 12, StatCollector.translateToLocal("button.de.remove.txt")));
|
||||
buttonList.add(
|
||||
new GuiButtonAHeight(
|
||||
0,
|
||||
posX + 112,
|
||||
posY + 45,
|
||||
66,
|
||||
12,
|
||||
StatCollector.translateToLocal("button.de.rename.txt")));
|
||||
buttonList.add(
|
||||
new GuiButtonAHeight(
|
||||
1,
|
||||
posX + 112,
|
||||
posY + 58,
|
||||
66,
|
||||
12,
|
||||
StatCollector.translateToLocal("button.de.setHere.txt")));
|
||||
buttonList.add(
|
||||
new GuiButtonAHeight(
|
||||
2,
|
||||
posX + 112,
|
||||
posY + 71,
|
||||
66,
|
||||
12,
|
||||
StatCollector.translateToLocal("button.de.remove.txt")));
|
||||
|
||||
buttonList.add(new GuiButtonAHeight(3, posX + 112, posY + 99, 33, 12, StatCollector.translateToLocal("button.de.UP.txt")));
|
||||
buttonList.add(
|
||||
new GuiButtonAHeight(
|
||||
3,
|
||||
posX + 112,
|
||||
posY + 99,
|
||||
33,
|
||||
12,
|
||||
StatCollector.translateToLocal("button.de.UP.txt")));
|
||||
|
||||
buttonList.add(new GuiButtonAHeight(4, posX + 112, posY + 112, 66, 12, StatCollector.translateToLocal("button.de.addNew.txt")));
|
||||
buttonList.add(new GuiButtonAHeight(5, posX + 112, posY + 125, 66, 12, StatCollector.translateToLocal("button.de.addFuel.txt")));
|
||||
buttonList.add(new GuiButtonAHeight(6, posX + xSize - 63, posY - 15, 60, 15, StatCollector.translateToLocal("button.de.cancel.txt")));
|
||||
buttonList.add(
|
||||
new GuiButtonAHeight(
|
||||
4,
|
||||
posX + 112,
|
||||
posY + 112,
|
||||
66,
|
||||
12,
|
||||
StatCollector.translateToLocal("button.de.addNew.txt")));
|
||||
buttonList.add(
|
||||
new GuiButtonAHeight(
|
||||
5,
|
||||
posX + 112,
|
||||
posY + 125,
|
||||
66,
|
||||
12,
|
||||
StatCollector.translateToLocal("button.de.addFuel.txt")));
|
||||
buttonList.add(
|
||||
new GuiButtonAHeight(
|
||||
6,
|
||||
posX + xSize - 63,
|
||||
posY - 15,
|
||||
60,
|
||||
15,
|
||||
StatCollector.translateToLocal("button.de.cancel.txt")));
|
||||
|
||||
buttonList.add(new GuiButtonAHeight(7, posX + 112 + 34, posY + 99, 33, 12, StatCollector.translateToLocal("button.de.DOWN.txt")));
|
||||
buttonList.add(
|
||||
new GuiButtonAHeight(
|
||||
7,
|
||||
posX + 112 + 34,
|
||||
posY + 99,
|
||||
33,
|
||||
12,
|
||||
StatCollector.translateToLocal("button.de.DOWN.txt")));
|
||||
((GuiButton) buttonList.get(6)).visible = false;
|
||||
|
||||
textBeingEdited = new GuiTextField(fontRendererObj, posX + 3, posY - 14, xSize - 67, 12);
|
||||
@@ -355,10 +446,12 @@ public class GUITeleporter extends GuiScreen {
|
||||
} else {
|
||||
if (!textBeingEdited.getText().isEmpty()) {
|
||||
getLocationSafely(selected + selectionOffset).setName(textBeingEdited.getText());
|
||||
TeleportLocation location = new TeleportLocation();
|
||||
Teleporter.TeleportLocation location = new Teleporter.TeleportLocation();
|
||||
location.setName(textBeingEdited.getText());
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(location, TeleporterPacket.UPDATENAME, selected + selectionOffset));
|
||||
((GuiButton) buttonList.get(0)).displayString = StatCollector.translateToLocal("button.de.rename.txt");
|
||||
DraconicEvolution.network.sendToServer(
|
||||
new TeleporterPacket(location, TeleporterPacket.UPDATENAME, selected + selectionOffset));
|
||||
((GuiButton) buttonList.get(0)).displayString = StatCollector
|
||||
.translateToLocal("button.de.rename.txt");
|
||||
editingExisting = false;
|
||||
textBeingEdited.setVisible(false);
|
||||
((GuiButton) buttonList.get(6)).visible = false;
|
||||
@@ -367,13 +460,22 @@ public class GUITeleporter extends GuiScreen {
|
||||
}
|
||||
|
||||
if (button.id == 1) {
|
||||
TeleportLocation location = new TeleportLocation(player.posX, player.posY - 1.62, player.posZ, player.dimension, player.rotationPitch, player.rotationYaw, getLocationSafely(selected + selectionOffset).getName());
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(location, TeleporterPacket.UPDATEDESTINATION, selected + selectionOffset));
|
||||
Teleporter.TeleportLocation location = new Teleporter.TeleportLocation(
|
||||
player.posX,
|
||||
player.posY - 1.62,
|
||||
player.posZ,
|
||||
player.dimension,
|
||||
player.rotationPitch,
|
||||
player.rotationYaw,
|
||||
getLocationSafely(selected + selectionOffset).getName());
|
||||
DraconicEvolution.network.sendToServer(
|
||||
new TeleporterPacket(location, TeleporterPacket.UPDATEDESTINATION, selected + selectionOffset));
|
||||
locations.set(selected + selectionOffset, location);
|
||||
}
|
||||
|
||||
if (button.id == 2) {
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.REMOVEDESTINATION, selected + selectionOffset, false));
|
||||
DraconicEvolution.network.sendToServer(
|
||||
new TeleporterPacket(TeleporterPacket.REMOVEDESTINATION, selected + selectionOffset, false));
|
||||
locations.remove(selected + selectionOffset);
|
||||
if (selectionOffset > 0) selectionOffset--;
|
||||
if (selected >= locations.size()) selected--;
|
||||
@@ -382,21 +484,22 @@ public class GUITeleporter extends GuiScreen {
|
||||
if (button.id == 3 || button.id == 7) {
|
||||
if (button.id == 3) {
|
||||
if (selected > 0) {
|
||||
TeleportLocation temp = getLocationSafely(selected + selectionOffset);
|
||||
Teleporter.TeleportLocation temp = getLocationSafely(selected + selectionOffset);
|
||||
locations.set(selected + selectionOffset, getLocationSafely(selected + selectionOffset - 1));
|
||||
locations.set(selected + selectionOffset - 1, temp);
|
||||
selected--;
|
||||
}
|
||||
} else {
|
||||
if (selected < Math.min(11, locations.size() - 1)) {
|
||||
TeleportLocation temp = getLocationSafely(selected + selectionOffset);
|
||||
Teleporter.TeleportLocation temp = getLocationSafely(selected + selectionOffset);
|
||||
locations.set(selected + selectionOffset, getLocationSafely(selected + selectionOffset + 1));
|
||||
locations.set(selected + selectionOffset + 1, temp);
|
||||
selected++;
|
||||
}
|
||||
}
|
||||
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.MOVELOCATION, selected + selectionOffset, button.id == 3));
|
||||
DraconicEvolution.network.sendToServer(
|
||||
new TeleporterPacket(TeleporterPacket.MOVELOCATION, selected + selectionOffset, button.id == 3));
|
||||
}
|
||||
|
||||
if (button.id == 4 || button.id == 6 && !editingExisting) {
|
||||
@@ -418,7 +521,8 @@ public class GUITeleporter extends GuiScreen {
|
||||
} else {
|
||||
if (!textBeingEdited.getText().isEmpty()) {
|
||||
addCurrentLocationToList(textBeingEdited.getText());
|
||||
((GuiButton) buttonList.get(4)).displayString = StatCollector.translateToLocal("button.de.addNew.txt");
|
||||
((GuiButton) buttonList.get(4)).displayString = StatCollector
|
||||
.translateToLocal("button.de.addNew.txt");
|
||||
editingNew = false;
|
||||
textBeingEdited.setVisible(false);
|
||||
((GuiButton) buttonList.get(6)).visible = false;
|
||||
@@ -431,9 +535,10 @@ public class GUITeleporter extends GuiScreen {
|
||||
if ((!Keyboard.isKeyDown(42)) && (!Keyboard.isKeyDown(54))) {
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.ADDFUEL, 1, false));
|
||||
this.fuel += ConfigHandler.teleporterUsesPerPearl;
|
||||
} else if (hasPearls(16)) {
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.ADDFUEL, 16, false));
|
||||
this.fuel += ConfigHandler.teleporterUsesPerPearl * 16;
|
||||
} else if (hasPearls(PEARLS_WITH_SHIFT)) {
|
||||
DraconicEvolution.network
|
||||
.sendToServer(new TeleporterPacket(TeleporterPacket.ADDFUEL, PEARLS_WITH_SHIFT, false));
|
||||
this.fuel += ConfigHandler.teleporterUsesPerPearl * PEARLS_WITH_SHIFT;
|
||||
} else player.addChatMessage(new ChatComponentTranslation("msg.teleporterOutOfPearls.txt"));
|
||||
} else player.addChatMessage(new ChatComponentTranslation("msg.teleporterOutOfPearls.txt"));
|
||||
}
|
||||
@@ -477,12 +582,17 @@ public class GUITeleporter extends GuiScreen {
|
||||
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
if (player.getCurrentEquippedItem() == null || !player.getCurrentEquippedItem().isItemEqual(new ItemStack(ModItems.teleporterMKII)) || player.isDead) {
|
||||
if (player.getCurrentEquippedItem() == null
|
||||
|| !player.getCurrentEquippedItem().isItemEqual(new ItemStack(ModItems.teleporterMKII))
|
||||
|| player.isDead) {
|
||||
this.mc.displayGuiScreen(null);
|
||||
this.mc.setIngameFocus();
|
||||
}
|
||||
|
||||
if (tick % 5 == 0 && locations.size() > 0 && getLocationSafely(selected + selectionOffset).getDimensionName().equals("") && player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.teleporterMKII)
|
||||
if (tick % 5 == 0 && locations.size() > 0
|
||||
&& getLocationSafely(selected + selectionOffset).getDimensionName().equals("")
|
||||
&& player.getHeldItem() != null
|
||||
&& player.getHeldItem().getItem() == ModItems.teleporterMKII)
|
||||
readDataFromItem(player.getHeldItem());
|
||||
|
||||
tick++;
|
||||
@@ -511,8 +621,10 @@ public class GUITeleporter extends GuiScreen {
|
||||
|
||||
for (int i = 0; i < list.tagCount(); i++) {
|
||||
NBTTagCompound tagLocation = list.getCompoundTagAt(i);
|
||||
//TeleportLocation location = new TeleportLocation(tagLocation.getDouble("X"), tagLocation.getDouble("Y"), tagLocation.getDouble("Z"), tagLocation.getInteger("Dimension"), tagLocation.getFloat("Pitch"), tagLocation.getFloat("Yaw"), tagLocation.getString("Name"));
|
||||
TeleportLocation location = new TeleportLocation();
|
||||
// TeleportLocation location = new TeleportLocation(tagLocation.getDouble("X"), tagLocation.getDouble("Y"),
|
||||
// tagLocation.getDouble("Z"), tagLocation.getInteger("Dimension"), tagLocation.getFloat("Pitch"),
|
||||
// tagLocation.getFloat("Yaw"), tagLocation.getString("Name"));
|
||||
Teleporter.TeleportLocation location = new Teleporter.TeleportLocation();
|
||||
location.readFromNBT(tagLocation);
|
||||
location.setWriteProtected(tagLocation.getBoolean("WP"));
|
||||
locations.add(location);
|
||||
@@ -520,13 +632,20 @@ public class GUITeleporter extends GuiScreen {
|
||||
}
|
||||
|
||||
private void addCurrentLocationToList(String name) {
|
||||
TeleportLocation currentLocation = new TeleportLocation(player.posX, player.posY - 1.62, player.posZ, player.dimension, player.rotationPitch, player.rotationYaw, name);
|
||||
Teleporter.TeleportLocation currentLocation = new Teleporter.TeleportLocation(
|
||||
player.posX,
|
||||
player.posY - 1.62,
|
||||
player.posZ,
|
||||
player.dimension,
|
||||
player.rotationPitch,
|
||||
player.rotationYaw,
|
||||
name);
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(currentLocation, TeleporterPacket.ADDDESTINATION));
|
||||
locations.add(currentLocation);
|
||||
}
|
||||
|
||||
private TeleportLocation getLocationSafely(int index) {
|
||||
private Teleporter.TeleportLocation getLocationSafely(int index) {
|
||||
if (index < locations.size() && index >= 0) return locations.get(index);
|
||||
return new TeleportLocation(0, 0, 0, 0, 0, 0, EnumChatFormatting.DARK_RED + "[Index Error]");
|
||||
return new Teleporter.TeleportLocation(0, 0, 0, 0, 0, 0, EnumChatFormatting.DARK_RED + "[Index Error]");
|
||||
}
|
||||
}
|
||||
+111
-52
@@ -3,15 +3,6 @@ package com.brandon3055.draconicevolution.client.gui;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.brandon3055.brandonscore.client.utills.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerUpgradeModifier;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileUpgradeModifier;
|
||||
import com.brandon3055.draconicevolution.common.utills.IUpgradableItem;
|
||||
import com.brandon3055.draconicevolution.common.utills.IUpgradableItem.EnumUpgrade;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -21,8 +12,20 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerUpgradeModifier;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileUpgradeModifier;
|
||||
import com.brandon3055.draconicevolution.common.utils.IUpgradableItem;
|
||||
import com.brandon3055.draconicevolution.common.utils.IUpgradableItem.EnumUpgrade;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GUIUpgradeModifier extends GuiContainer {
|
||||
|
||||
@@ -35,11 +38,11 @@ public class GUIUpgradeModifier extends GuiContainer {
|
||||
private List<EnumUpgrade> itemUpgrades = new ArrayList<EnumUpgrade>();
|
||||
private ContainerUpgradeModifier containerEM;
|
||||
|
||||
public GUIUpgradeModifier(InventoryPlayer invPlayer, TileUpgradeModifier tile, ContainerUpgradeModifier containerEM) {
|
||||
public GUIUpgradeModifier(InventoryPlayer invPlayer, TileUpgradeModifier tile,
|
||||
ContainerUpgradeModifier containerEM) {
|
||||
super(containerEM);
|
||||
this.containerEM = containerEM;
|
||||
|
||||
|
||||
xSize = 176;
|
||||
ySize = 190;
|
||||
|
||||
@@ -47,7 +50,6 @@ public class GUIUpgradeModifier extends GuiContainer {
|
||||
this.player = invPlayer.player;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
@@ -84,20 +86,21 @@ public class GUIUpgradeModifier extends GuiContainer {
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
drawCenteredString(fontRendererObj, tile.getBlockType().getLocalizedName(), xSize / 2, -9, 0x00FFFF);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("gui.de.upgradeModifier.main.title"),
|
||||
xSize / 2,
|
||||
-9,
|
||||
0x00FFFF);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
|
||||
|
||||
}
|
||||
protected void actionPerformed(GuiButton button) {}
|
||||
|
||||
private int coreSlots = 0;
|
||||
private int coreTier = 0;
|
||||
@@ -159,24 +162,29 @@ public class GUIUpgradeModifier extends GuiContainer {
|
||||
int[] appliedCores = upgrade.getCoresApplied(tile.getStackInSlot(0));
|
||||
|
||||
for (int i = 0; i <= coreTier; i++) {
|
||||
//Check + buttons
|
||||
if (coreInInventory[i] && coreSlots > usedSlots && GuiHelper.isInRect(xPos, yPos + 33 + i * 18, 8, 8, x, y) && upgrade.getUpgradePoints(stack) < upgradableItem.getMaxUpgradePoints(upgrade.index, stack)) {
|
||||
// Check + buttons
|
||||
if (coreInInventory[i] && coreSlots > usedSlots
|
||||
&& GuiHelper.isInRect(xPos, yPos + 33 + i * 18, 8, 8, x, y)
|
||||
&& upgrade.getUpgradePoints(stack) < upgradableItem.getMaxUpgradePoints(upgrade.index, stack)) {
|
||||
containerEM.sendObjectToServer(null, upgrade.index, i * 2);
|
||||
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(ResourceHandler.getResourceWOP("gui.button.press"), 1.0F));
|
||||
Minecraft.getMinecraft().getSoundHandler().playSound(
|
||||
PositionedSoundRecord
|
||||
.func_147674_a(ResourceHandler.getResourceWOP("gui.button.press"), 1.0F));
|
||||
}
|
||||
|
||||
//Check - buttons
|
||||
// Check - buttons
|
||||
if (appliedCores[i] > 0 && GuiHelper.isInRect(xPos + 16, yPos + 33 + i * 18, 8, 8, x, y)) {
|
||||
containerEM.sendObjectToServer(null, upgrade.index, 1 + i * 2);
|
||||
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(ResourceHandler.getResourceWOP("gui.button.press"), 1.0F));
|
||||
Minecraft.getMinecraft().getSoundHandler().playSound(
|
||||
PositionedSoundRecord
|
||||
.func_147674_a(ResourceHandler.getResourceWOP("gui.button.press"), 1.0F));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void renderUpgrades(int x, int y) {
|
||||
//First Draw
|
||||
// First Draw
|
||||
for (EnumUpgrade upgrade : itemUpgrades) {
|
||||
int xIndex = itemUpgrades.indexOf(upgrade);
|
||||
int spacing = (xSize - 6) / itemUpgrades.size();
|
||||
@@ -202,42 +210,66 @@ public class GUIUpgradeModifier extends GuiContainer {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
//Draw + buttons
|
||||
if (coreSlots > usedSlots && upgrade.getUpgradePoints(stack) < upgradableItem.getMaxUpgradePoints(upgrade.index, stack)) {
|
||||
// Draw + buttons
|
||||
if (coreSlots > usedSlots
|
||||
&& upgrade.getUpgradePoints(stack) < upgradableItem.getMaxUpgradePoints(upgrade.index, stack)) {
|
||||
boolean hovering = GuiHelper.isInRect(xPos, yPos + 33 + i * 18, 8, 8, x, y);
|
||||
if (!coreInInventory[i]) drawTexturedModalRect(xPos, yPos + 33 + i * 18, 24, 208, 8, 8);
|
||||
else drawTexturedModalRect(xPos, yPos + 33 + i * 18, 32 + (hovering ? 8 : 0), 208, 8, 8);
|
||||
}
|
||||
|
||||
//Draw - buttons
|
||||
// Draw - buttons
|
||||
if (appliedCores[i] > 0) {
|
||||
boolean hovering = GuiHelper.isInRect(xPos + 16, yPos + 33 + i * 18, 8, 8, x, y);
|
||||
drawTexturedModalRect(xPos + 16, yPos + 33 + i * 18, 56 + (hovering ? 8 : 0), 208, 8, 8);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
for (int i = 0; i <= coreTier; i++)
|
||||
fontRendererObj.drawString(String.valueOf(appliedCores[i]), xPos + 12 - fontRendererObj.getStringWidth(String.valueOf(appliedCores[i])) / 2, yPos + 29 + i * 18, 0xFFFFFF);
|
||||
fontRendererObj.drawString(String.valueOf(upgrade.getUpgradePoints(stack)), xPos + 12 - fontRendererObj.getStringWidth(String.valueOf(upgrade.getUpgradePoints(stack))) / 2, yPos - 8, 0xFFFFFF);
|
||||
for (int i = 0; i <= coreTier; i++) fontRendererObj.drawString(
|
||||
String.valueOf(appliedCores[i]),
|
||||
xPos + 12 - fontRendererObj.getStringWidth(String.valueOf(appliedCores[i])) / 2,
|
||||
yPos + 29 + i * 18,
|
||||
0xFFFFFF);
|
||||
fontRendererObj.drawString(
|
||||
String.valueOf(upgrade.getUpgradePoints(stack)),
|
||||
xPos + 12 - fontRendererObj.getStringWidth(String.valueOf(upgrade.getUpgradePoints(stack))) / 2,
|
||||
yPos - 8,
|
||||
0xFFFFFF);
|
||||
}
|
||||
|
||||
fontRendererObj.drawStringWithShadow(StatCollector.translateToLocal("gui.de.cores.txt"), guiLeft + 4, guiTop + 4, 0x00ff00);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.cap.txt"), guiLeft + 4, guiTop + 16, 0x000000);
|
||||
fontRendererObj.drawString(">" + coreSlots, guiLeft + 4, guiTop + 25, 0x000000);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.installed.txt"), guiLeft + 4, guiTop + 37, 0x000000);
|
||||
fontRendererObj.drawString(">" + usedSlots, guiLeft + 4, guiTop + 46, 0x000000);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.free.txt"), guiLeft + 4, guiTop + 58, 0x000000);
|
||||
fontRendererObj.drawString(">" + (coreSlots - usedSlots), guiLeft + 4, guiTop + 67, 0x000000);
|
||||
fontRendererObj.drawStringWithShadow(
|
||||
StatCollector.translateToLocal("gui.de.cores.txt"),
|
||||
guiLeft + 4,
|
||||
guiTop + 4,
|
||||
0x00ff00);
|
||||
fontRendererObj
|
||||
.drawString(StatCollector.translateToLocal("gui.de.cap.txt"), guiLeft + 4, guiTop + 16, 0x000000);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.numbers", ">" + coreSlots),
|
||||
guiLeft + 4,
|
||||
guiTop + 25,
|
||||
0x000000);
|
||||
fontRendererObj
|
||||
.drawString(StatCollector.translateToLocal("gui.de.installed.txt"), guiLeft + 4, guiTop + 37, 0x000000);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.numbers", ">" + usedSlots),
|
||||
guiLeft + 4,
|
||||
guiTop + 46,
|
||||
0x000000);
|
||||
fontRendererObj
|
||||
.drawString(StatCollector.translateToLocal("gui.de.free.txt"), guiLeft + 4, guiTop + 58, 0x000000);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.numbers", ">" + (coreSlots - usedSlots)),
|
||||
guiLeft + 4,
|
||||
guiTop + 67,
|
||||
0x000000);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void drawScreen(int x, int y, float f) {
|
||||
super.drawScreen(x, y, f);
|
||||
|
||||
if (!inUse) return;
|
||||
//Second Draw
|
||||
// Second Draw
|
||||
for (EnumUpgrade upgrade : itemUpgrades) {
|
||||
int xIndex = itemUpgrades.indexOf(upgrade);
|
||||
int spacing = (xSize - 6) / itemUpgrades.size();
|
||||
@@ -253,8 +285,12 @@ public class GUIUpgradeModifier extends GuiContainer {
|
||||
|
||||
if (GuiHelper.isInRect(xPos + 3, yPos - 9, 18, 8, x, y)) {
|
||||
List list = new ArrayList();
|
||||
list.add(StatCollector.translateToLocal("gui.de.basePoints.txt") + ": " + upgradableItem.getBaseUpgradePoints(upgrade.index));
|
||||
list.add(StatCollector.translateToLocal("gui.de.maxPoints.txt") + ": " + upgradableItem.getMaxUpgradePoints(upgrade.index, stack));
|
||||
list.add(
|
||||
StatCollector.translateToLocal("gui.de.basePoints.txt") + ": "
|
||||
+ upgradableItem.getBaseUpgradePoints(upgrade.index));
|
||||
list.add(
|
||||
StatCollector.translateToLocal("gui.de.maxPoints.txt") + ": "
|
||||
+ upgradableItem.getMaxUpgradePoints(upgrade.index, stack));
|
||||
list.add(StatCollector.translateToLocal("gui.de.pointCost.txt") + ": " + upgrade.pointConversion);
|
||||
drawHoveringText(list, x, y, fontRendererObj);
|
||||
}
|
||||
@@ -263,12 +299,16 @@ public class GUIUpgradeModifier extends GuiContainer {
|
||||
if (GuiHelper.isInRect(xPos + 9, yPos + 25 + i * 18, 6, 15, x, y)) {
|
||||
List list = new ArrayList();
|
||||
double value = Math.pow(2, i) / upgrade.pointConversion;
|
||||
String string = StatCollector.translateToLocal("gui.de.value.txt") + ": " + value + " " + (value == 1 ? StatCollector.translateToLocal("gui.de.point.txt") : StatCollector.translateToLocal("gui.de.points.txt"));
|
||||
String string = StatCollector.translateToLocal("gui.de.value.txt") + ": "
|
||||
+ value
|
||||
+ " "
|
||||
+ (value == 1 ? StatCollector.translateToLocal("gui.de.point.txt")
|
||||
: StatCollector.translateToLocal("gui.de.points.txt"));
|
||||
list.add(string.replace(".0", ""));
|
||||
drawHoveringText(list, x, y, fontRendererObj);
|
||||
}
|
||||
|
||||
//Draw Button Text (add)
|
||||
// Draw Button Text (add)
|
||||
if (coreSlots > usedSlots && GuiHelper.isInRect(xPos, yPos + 33 + i * 18, 8, 8, x, y)) {
|
||||
List list = new ArrayList<String>();
|
||||
if (coreInInventory[i]) list.add(StatCollector.translateToLocal("gui.de.addCore.txt"));
|
||||
@@ -276,7 +316,7 @@ public class GUIUpgradeModifier extends GuiContainer {
|
||||
drawHoveringText(list, x, y, fontRendererObj);
|
||||
}
|
||||
|
||||
//Draw Button Text (remove)
|
||||
// Draw Button Text (remove)
|
||||
if (appliedCores[i] > 0 && GuiHelper.isInRect(xPos + 16, yPos + 33 + i * 18, 8, 8, x, y)) {
|
||||
List list = new ArrayList<String>();
|
||||
if (coreInInventory[i]) list.add(StatCollector.translateToLocal("gui.de.removeCore.txt"));
|
||||
@@ -284,7 +324,6 @@ public class GUIUpgradeModifier extends GuiContainer {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void drawFlippedTexturedModalRect(int xPos, int yPos, int texXPos, int texYPos, int xSize, int ySize) {
|
||||
@@ -292,10 +331,30 @@ public class GUIUpgradeModifier extends GuiContainer {
|
||||
float f1 = 0.00390625F;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV((double) (xPos), (double) (yPos + ySize), (double) this.zLevel, (double) ((float) (texXPos + xSize) * f), (double) ((float) (texYPos + ySize) * f1));
|
||||
tessellator.addVertexWithUV((double) (xPos + xSize), (double) (yPos + ySize), (double) this.zLevel, (double) ((float) (texXPos) * f), (double) ((float) (texYPos + ySize) * f1));
|
||||
tessellator.addVertexWithUV((double) (xPos + xSize), (double) (yPos), (double) this.zLevel, (double) ((float) (texXPos) * f), (double) ((float) (texYPos) * f1));
|
||||
tessellator.addVertexWithUV((double) (xPos), (double) (yPos), (double) this.zLevel, (double) ((float) (texXPos + xSize) * f), (double) ((float) (texYPos) * f1));
|
||||
tessellator.addVertexWithUV(
|
||||
(double) (xPos),
|
||||
(double) (yPos + ySize),
|
||||
(double) this.zLevel,
|
||||
(double) ((float) (texXPos + xSize) * f),
|
||||
(double) ((float) (texYPos + ySize) * f1));
|
||||
tessellator.addVertexWithUV(
|
||||
(double) (xPos + xSize),
|
||||
(double) (yPos + ySize),
|
||||
(double) this.zLevel,
|
||||
(double) ((float) (texXPos) * f),
|
||||
(double) ((float) (texYPos + ySize) * f1));
|
||||
tessellator.addVertexWithUV(
|
||||
(double) (xPos + xSize),
|
||||
(double) (yPos),
|
||||
(double) this.zLevel,
|
||||
(double) ((float) (texXPos) * f),
|
||||
(double) ((float) (texYPos) * f1));
|
||||
tessellator.addVertexWithUV(
|
||||
(double) (xPos),
|
||||
(double) (yPos),
|
||||
(double) this.zLevel,
|
||||
(double) ((float) (texXPos + xSize) * f),
|
||||
(double) ((float) (texYPos) * f1));
|
||||
tessellator.draw();
|
||||
}
|
||||
}
|
||||
+29
-22
@@ -6,17 +6,19 @@ import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerWeatherController;
|
||||
import com.brandon3055.draconicevolution.common.network.ButtonPacket;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.network.ButtonPacket;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileWeatherController;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GUIWeatherController extends GuiContainer {
|
||||
|
||||
@@ -36,7 +38,9 @@ public class GUIWeatherController extends GuiContainer {
|
||||
this.player = invPlayer.player;
|
||||
}
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/WeatherController.png");
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
References.MODID.toLowerCase(),
|
||||
"textures/gui/WeatherController.png");
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
|
||||
@@ -50,26 +54,33 @@ public class GUIWeatherController extends GuiContainer {
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
|
||||
//drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
|
||||
drawCenteredString(fontRendererObj, "Weather Controller", xSize / 2, -15, 0x2a4ed0);
|
||||
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.charges") + ": " + charges, 90, 25, 0x000000);
|
||||
// drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("gui.de.weatherController.main.title"),
|
||||
xSize / 2,
|
||||
-15,
|
||||
0x2a4ed0);
|
||||
}
|
||||
|
||||
public static final String RAIN_ON_TEXT = "Turn rain on";
|
||||
public static final String RAIN_OFF_TEXT = "Turn rain off";
|
||||
public static final String STORM_TEXT = "Thunder Storm";
|
||||
public static final String RAIN_ON_TEXT = "gui.de.rain.on";
|
||||
public static final String RAIN_OFF_TEXT = "gui.de.rain.off";
|
||||
public static final String STORM_TEXT = "gui.de.rain.storm";
|
||||
public static String text;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private String getModeText(int mode) {
|
||||
if (mode == 0) return StatCollector.translateToLocal(RAIN_OFF_TEXT);
|
||||
else if (mode == 1) return StatCollector.translateToLocal(RAIN_ON_TEXT);
|
||||
else return StatCollector.translateToLocal(STORM_TEXT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
buttonList.clear();
|
||||
if (tileWC.mode == 0) text = RAIN_OFF_TEXT;
|
||||
else if (tileWC.mode == 1) text = RAIN_ON_TEXT;
|
||||
else text = STORM_TEXT;
|
||||
//ID
|
||||
text = getModeText(tileWC.mode);
|
||||
// ID
|
||||
buttonList.add(new GuiButton(0, guiLeft + 85, guiTop, 85, 20, text));
|
||||
}
|
||||
|
||||
@@ -77,11 +88,9 @@ public class GUIWeatherController extends GuiContainer {
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
if (button.id == 0) {
|
||||
DraconicEvolution.network.sendToServer(new ButtonPacket((byte) 0, true));
|
||||
if (button.displayString.equals(STORM_TEXT)) button.displayString = RAIN_OFF_TEXT;
|
||||
else if (button.displayString.equals(RAIN_OFF_TEXT)) button.displayString = RAIN_ON_TEXT;
|
||||
else button.displayString = STORM_TEXT;
|
||||
tileWC.mode = (tileWC.mode + 1) % 3;
|
||||
button.displayString = getModeText(tileWC.mode);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -94,6 +103,4 @@ public class GUIWeatherController extends GuiContainer {
|
||||
super.updateScreen();
|
||||
this.charges = tileWC.charges;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
@@ -21,17 +22,43 @@ public class GuiButtonAHeight extends GuiButton {
|
||||
FontRenderer fontrenderer = minecraft.fontRenderer;
|
||||
minecraft.getTextureManager().bindTexture(buttonTextures);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
||||
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition
|
||||
&& mouseX < this.xPosition + this.width
|
||||
&& mouseY < this.yPosition + this.height;
|
||||
int k = this.getHoverState(this.field_146123_n);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + k * 20, width % 2 + this.width / 2, this.height);
|
||||
this.drawTexturedModalRect(width % 2 + this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + k * 20, this.width / 2, this.height);
|
||||
this.drawTexturedModalRect(
|
||||
this.xPosition,
|
||||
this.yPosition,
|
||||
0,
|
||||
46 + k * 20,
|
||||
width % 2 + this.width / 2,
|
||||
this.height);
|
||||
this.drawTexturedModalRect(
|
||||
width % 2 + this.xPosition + this.width / 2,
|
||||
this.yPosition,
|
||||
200 - this.width / 2,
|
||||
46 + k * 20,
|
||||
this.width / 2,
|
||||
this.height);
|
||||
if (this.height < 20) {
|
||||
|
||||
this.drawTexturedModalRect(xPosition, yPosition + 3, 0, (46 + k * 20) + 20 - height + 3, width % 2 + width / 2, height - 3);
|
||||
this.drawTexturedModalRect(width % 2 + xPosition + width / 2, yPosition + 3, 200 - width / 2, (46 + k * 20) + 20 - height + 3, width / 2, height - 3);
|
||||
this.drawTexturedModalRect(
|
||||
xPosition,
|
||||
yPosition + 3,
|
||||
0,
|
||||
(46 + k * 20) + 20 - height + 3,
|
||||
width % 2 + width / 2,
|
||||
height - 3);
|
||||
this.drawTexturedModalRect(
|
||||
width % 2 + xPosition + width / 2,
|
||||
yPosition + 3,
|
||||
200 - width / 2,
|
||||
(46 + k * 20) + 20 - height + 3,
|
||||
width / 2,
|
||||
height - 3);
|
||||
}
|
||||
this.mouseDragged(minecraft, mouseX, mouseY);
|
||||
int l = 14737632;
|
||||
@@ -43,7 +70,12 @@ public class GuiButtonAHeight extends GuiButton {
|
||||
} else if (this.field_146123_n) {
|
||||
l = 16777120;
|
||||
}
|
||||
this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, l);
|
||||
this.drawCenteredString(
|
||||
fontrenderer,
|
||||
this.displayString,
|
||||
this.xPosition + this.width / 2,
|
||||
this.yPosition + (this.height - 8) / 2,
|
||||
l);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,16 +5,19 @@ import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 17/09/2014.
|
||||
*/
|
||||
public class GuiButtonTextOnly extends GuiButton {
|
||||
|
||||
public String LINKED_PAGE;
|
||||
public int textColour;
|
||||
|
||||
public GuiButtonTextOnly(int id, int xPos, int yPos, int width, int hight, String displayString, String linkedPage, int colour) {
|
||||
public GuiButtonTextOnly(int id, int xPos, int yPos, int width, int hight, String displayString, String linkedPage,
|
||||
int colour) {
|
||||
super(id, xPos, yPos, width, hight, displayString);
|
||||
this.LINKED_PAGE = linkedPage;
|
||||
this.textColour = colour;
|
||||
@@ -26,7 +29,9 @@ public class GuiButtonTextOnly extends GuiButton {
|
||||
FontRenderer fontrenderer = minecraft.fontRenderer;
|
||||
minecraft.getTextureManager().bindTexture(buttonTextures);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
||||
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition
|
||||
&& mouseX < this.xPosition + this.width
|
||||
&& mouseY < this.yPosition + this.height;
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
@@ -48,12 +53,22 @@ public class GuiButtonTextOnly extends GuiButton {
|
||||
trimmedDisplayString = EnumChatFormatting.BOLD + "" + EnumChatFormatting.ITALIC + trimmedDisplayString;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor4f(0f, 0f, 0f, 1f);
|
||||
drawTexturedModalRect(xPosition + (int) (xPosition * 0.01), yPosition + (int) (yPosition * 0.01), 0, 46, (int) (fontrenderer.getStringWidth(trimmedDisplayString) * 0.72) + 2, 8);
|
||||
drawTexturedModalRect(
|
||||
xPosition + (int) (xPosition * 0.01),
|
||||
yPosition + (int) (yPosition * 0.01),
|
||||
0,
|
||||
46,
|
||||
(int) (fontrenderer.getStringWidth(trimmedDisplayString) * 0.72) + 2,
|
||||
8);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(0.7F, 0.7F, 1);
|
||||
fontrenderer.drawString(trimmedDisplayString, (int) (xPosition * 1.45), (int) ((yPosition + (height - 8) / 2) * 1.45), textColour);
|
||||
fontrenderer.drawString(
|
||||
trimmedDisplayString,
|
||||
(int) (xPosition * 1.45),
|
||||
(int) ((yPosition + (height - 8) / 2) * 1.45),
|
||||
textColour);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,42 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.client.gui.componentguis.GUIManual;
|
||||
import com.brandon3055.draconicevolution.client.gui.componentguis.GUIReactor;
|
||||
import com.brandon3055.draconicevolution.client.gui.componentguis.GUIToolConfig;
|
||||
import com.brandon3055.draconicevolution.common.container.*;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerAdvTool;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerDislocatorInhibitor;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerDissEnchanter;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerDraconiumChest;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerEnergyInfuser;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerGenerator;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerGrinder;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerPlayerDetector;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerReactor;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerSunDial;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerUpgradeModifier;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerWeatherController;
|
||||
import com.brandon3055.draconicevolution.common.inventory.InventoryTool;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.*;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDislocatorInhibitor;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDissEnchanter;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDraconiumChest;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileEnergyInfuser;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileGenerator;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileGrinder;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileParticleGenerator;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TilePlayerDetectorAdvanced;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileSunDial;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileUpgradeModifier;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileWeatherController;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.gates.TileGate;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore;
|
||||
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class GuiHandler implements IGuiHandler {
|
||||
|
||||
@@ -32,6 +55,7 @@ public class GuiHandler implements IGuiHandler {
|
||||
public static final int GUIID_FLOW_GATE = 13;
|
||||
public static final int GUIID_REACTOR = 14;
|
||||
public static final int GUIID_UPGRADE_MODIFIER = 15;
|
||||
public static final int GUIID_DISLOCATOR_INHIBITOR = 16;
|
||||
public static final int GUIID_CONTAINER_TEMPLATE = 100;
|
||||
|
||||
public GuiHandler() {
|
||||
@@ -39,167 +63,157 @@ public class GuiHandler implements IGuiHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
switch (ID) {
|
||||
case GUIID_WEATHER_CONTROLLER:
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te != null && te instanceof TileWeatherController) {
|
||||
return new ContainerWeatherController(player.inventory, (TileWeatherController) te);
|
||||
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
switch (id) {
|
||||
case GUIID_WEATHER_CONTROLLER -> {
|
||||
if (tile instanceof TileWeatherController weatherController) {
|
||||
return new ContainerWeatherController(player.inventory, weatherController);
|
||||
}
|
||||
break;
|
||||
case GUIID_SUN_DIAL:
|
||||
TileEntity te1 = world.getTileEntity(x, y, z);
|
||||
if (te1 != null && te1 instanceof TileSunDial) {
|
||||
return new ContainerSunDial(player.inventory, (TileSunDial) te1);
|
||||
}
|
||||
case GUIID_SUN_DIAL -> {
|
||||
if (tile instanceof TileSunDial sunDial) {
|
||||
return new ContainerSunDial(player.inventory, sunDial);
|
||||
}
|
||||
break;
|
||||
case GUIID_GRINDER:
|
||||
TileEntity te2 = world.getTileEntity(x, y, z);
|
||||
if (te2 != null && te2 instanceof TileGrinder) {
|
||||
return new ContainerGrinder(player.inventory, (TileGrinder) te2);
|
||||
}
|
||||
case GUIID_GRINDER -> {
|
||||
if (tile instanceof TileGrinder grinder) {
|
||||
return new ContainerGrinder(player.inventory, grinder);
|
||||
}
|
||||
break;
|
||||
case GUIID_PLAYERDETECTOR:
|
||||
TileEntity detector = world.getTileEntity(x, y, z);
|
||||
if (detector != null && detector instanceof TilePlayerDetectorAdvanced) {
|
||||
return new ContainerPlayerDetector(player.inventory, (TilePlayerDetectorAdvanced) detector);
|
||||
}
|
||||
case GUIID_PLAYERDETECTOR -> {
|
||||
if (tile instanceof TilePlayerDetectorAdvanced detector) {
|
||||
return new ContainerPlayerDetector(player.inventory, detector);
|
||||
}
|
||||
break;
|
||||
case GUIID_ENERGY_INFUSER:
|
||||
TileEntity infuser = world.getTileEntity(x, y, z);
|
||||
if (infuser != null && infuser instanceof TileEnergyInfuser) {
|
||||
return new ContainerEnergyInfuser(player.inventory, (TileEnergyInfuser) infuser);
|
||||
}
|
||||
case GUIID_ENERGY_INFUSER -> {
|
||||
if (tile instanceof TileEnergyInfuser infuser) {
|
||||
return new ContainerEnergyInfuser(player.inventory, infuser);
|
||||
}
|
||||
break;
|
||||
case GUIID_GENERATOR:
|
||||
TileEntity generator = world.getTileEntity(x, y, z);
|
||||
if (generator != null && generator instanceof TileGenerator) {
|
||||
return new ContainerGenerator(player.inventory, (TileGenerator) generator);
|
||||
}
|
||||
case GUIID_GENERATOR -> {
|
||||
if (tile instanceof TileGenerator generator) {
|
||||
return new ContainerGenerator(player.inventory, generator);
|
||||
}
|
||||
break;
|
||||
case GUIID_DISSENCHANTER:
|
||||
TileEntity dissenchanter = world.getTileEntity(x, y, z);
|
||||
if (dissenchanter != null && dissenchanter instanceof TileDissEnchanter) {
|
||||
return new ContainerDissEnchanter(player.inventory, (TileDissEnchanter) dissenchanter);
|
||||
}
|
||||
case GUIID_DISSENCHANTER -> {
|
||||
if (tile instanceof TileDissEnchanter dissenchanter) {
|
||||
return new ContainerDissEnchanter(player.inventory, dissenchanter);
|
||||
}
|
||||
break;
|
||||
case GUIID_DRACONIC_CHEST:
|
||||
TileEntity containerChest = world.getTileEntity(x, y, z);
|
||||
if (containerChest != null && containerChest instanceof TileDraconiumChest) {
|
||||
return new ContainerDraconiumChest(player.inventory, (TileDraconiumChest) containerChest);
|
||||
}
|
||||
case GUIID_DRACONIC_CHEST -> {
|
||||
if (tile instanceof TileDraconiumChest draconiumChest) {
|
||||
return new ContainerDraconiumChest(player.inventory, draconiumChest);
|
||||
}
|
||||
break;
|
||||
case GUIID_REACTOR:
|
||||
TileEntity reactor = world.getTileEntity(x, y, z);
|
||||
if (reactor != null && reactor instanceof TileReactorCore) {
|
||||
return new ContainerReactor(player, (TileReactorCore) reactor);
|
||||
}
|
||||
case GUIID_REACTOR -> {
|
||||
if (tile instanceof TileReactorCore reactorCore) {
|
||||
return new ContainerReactor(player, reactorCore);
|
||||
}
|
||||
break;
|
||||
case GUIID_TOOL_CONFIG:
|
||||
}
|
||||
case GUIID_TOOL_CONFIG -> {
|
||||
return new ContainerAdvTool(player.inventory, new InventoryTool(player, null));
|
||||
case GUIID_UPGRADE_MODIFIER:
|
||||
TileEntity containerTemp = world.getTileEntity(x, y, z);
|
||||
if (containerTemp != null && containerTemp instanceof TileUpgradeModifier) {
|
||||
return new ContainerUpgradeModifier(player.inventory, (TileUpgradeModifier) containerTemp);
|
||||
}
|
||||
case GUIID_UPGRADE_MODIFIER -> {
|
||||
if (tile instanceof TileUpgradeModifier upgradeModifier) {
|
||||
return new ContainerUpgradeModifier(player.inventory, upgradeModifier);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
// case GUIID_CONTAINER_TEMPLATE:
|
||||
// TileEntity containerTemp = world.getTileEntity(x, y, z);
|
||||
// if (containerTemp != null && containerTemp instanceof TileContainerTemplate) {
|
||||
// return new ContainerTemplate(player.inventory, (TileContainerTemplate) containerTemp);
|
||||
// }
|
||||
// break;
|
||||
}
|
||||
case GUIID_DISLOCATOR_INHIBITOR -> {
|
||||
if (tile instanceof TileDislocatorInhibitor inhibitor) {
|
||||
return new ContainerDislocatorInhibitor(player.inventory, inhibitor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
switch (ID) {
|
||||
case GUIID_WEATHER_CONTROLLER:
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te != null && te instanceof TileWeatherController) {
|
||||
return new GUIWeatherController(player.inventory, (TileWeatherController) te);
|
||||
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
switch (id) {
|
||||
case GUIID_WEATHER_CONTROLLER -> {
|
||||
if (tile instanceof TileWeatherController weatherController) {
|
||||
return new GUIWeatherController(player.inventory, weatherController);
|
||||
}
|
||||
break;
|
||||
case GUIID_SUN_DIAL:
|
||||
TileEntity te1 = world.getTileEntity(x, y, z);
|
||||
if (te1 != null && te1 instanceof TileSunDial) {
|
||||
return new GUISunDial(player.inventory, (TileSunDial) te1);
|
||||
}
|
||||
case GUIID_SUN_DIAL -> {
|
||||
if (tile instanceof TileSunDial sunDial) {
|
||||
return new GUISunDial(player.inventory, sunDial);
|
||||
}
|
||||
break;
|
||||
case GUIID_TELEPORTER:
|
||||
}
|
||||
case GUIID_TELEPORTER -> {
|
||||
return new GUITeleporter(player);
|
||||
case GUIID_GRINDER:
|
||||
TileEntity te2 = world.getTileEntity(x, y, z);
|
||||
if (te2 != null && te2 instanceof TileGrinder) {
|
||||
return new GUIGrinder(player.inventory, (TileGrinder) te2);
|
||||
}
|
||||
case GUIID_GRINDER -> {
|
||||
if (tile instanceof TileGrinder grinder) {
|
||||
return new GUIGrinder(player.inventory, grinder);
|
||||
}
|
||||
break;
|
||||
case GUIID_PARTICLEGEN:
|
||||
TileEntity gen = world.getTileEntity(x, y, z);
|
||||
return (gen != null && gen instanceof TileParticleGenerator) ? new GUIParticleGenerator((TileParticleGenerator) gen, player) : null;
|
||||
case GUIID_PLAYERDETECTOR:
|
||||
TileEntity detector = world.getTileEntity(x, y, z);
|
||||
if (detector != null && detector instanceof TilePlayerDetectorAdvanced) {
|
||||
return new GUIPlayerDetector(player.inventory, (TilePlayerDetectorAdvanced) detector);
|
||||
}
|
||||
case GUIID_PARTICLEGEN -> {
|
||||
if (tile instanceof TileParticleGenerator particleGenerator) {
|
||||
return new GUIParticleGenerator(particleGenerator);
|
||||
}
|
||||
break;
|
||||
case GUIID_ENERGY_INFUSER:
|
||||
TileEntity infuser = world.getTileEntity(x, y, z);
|
||||
if (infuser != null && infuser instanceof TileEnergyInfuser) {
|
||||
return new GUIEnergyInfuser(player.inventory, (TileEnergyInfuser) infuser);
|
||||
}
|
||||
case GUIID_PLAYERDETECTOR -> {
|
||||
if (tile instanceof TilePlayerDetectorAdvanced detector) {
|
||||
return new GUIPlayerDetector(player.inventory, detector);
|
||||
}
|
||||
break;
|
||||
case GUIID_GENERATOR:
|
||||
TileEntity generator = world.getTileEntity(x, y, z);
|
||||
if (generator != null && generator instanceof TileGenerator) {
|
||||
return new GUIGenerator(player.inventory, (TileGenerator) generator);
|
||||
}
|
||||
case GUIID_ENERGY_INFUSER -> {
|
||||
if (tile instanceof TileEnergyInfuser infuser) {
|
||||
return new GUIEnergyInfuser(player.inventory, infuser);
|
||||
}
|
||||
break;
|
||||
case GUIID_MANUAL:
|
||||
}
|
||||
case GUIID_GENERATOR -> {
|
||||
if (tile instanceof TileGenerator generator) {
|
||||
return new GUIGenerator(player.inventory, generator);
|
||||
}
|
||||
}
|
||||
case GUIID_MANUAL -> {
|
||||
return new GUIManual();
|
||||
case GUIID_DISSENCHANTER:
|
||||
TileEntity dissenchanter = world.getTileEntity(x, y, z);
|
||||
if (dissenchanter != null && dissenchanter instanceof TileDissEnchanter) {
|
||||
return new GUIDissEnchanter(player.inventory, (TileDissEnchanter) dissenchanter);
|
||||
}
|
||||
case GUIID_DISSENCHANTER -> {
|
||||
if (tile instanceof TileDissEnchanter dissenchanter) {
|
||||
return new GUIDissEnchanter(player.inventory, dissenchanter);
|
||||
}
|
||||
break;
|
||||
case GUIID_DRACONIC_CHEST:
|
||||
TileEntity containerChest = world.getTileEntity(x, y, z);
|
||||
if (containerChest != null && containerChest instanceof TileDraconiumChest) {
|
||||
return new GUIDraconiumChest(player.inventory, (TileDraconiumChest) containerChest);
|
||||
}
|
||||
case GUIID_DRACONIC_CHEST -> {
|
||||
if (tile instanceof TileDraconiumChest draconiumChest) {
|
||||
return new GUIDraconiumChest(player.inventory, draconiumChest);
|
||||
}
|
||||
break;
|
||||
case GUIID_REACTOR:
|
||||
TileEntity reactor = world.getTileEntity(x, y, z);
|
||||
if (reactor != null && reactor instanceof TileReactorCore) {
|
||||
return new GUIReactor(player, (TileReactorCore) reactor, new ContainerReactor(player, (TileReactorCore) reactor));
|
||||
}
|
||||
case GUIID_REACTOR -> {
|
||||
if (tile instanceof TileReactorCore reactorCore) {
|
||||
return new GUIReactor(reactorCore, new ContainerReactor(player, reactorCore));
|
||||
}
|
||||
break;
|
||||
case GUIID_TOOL_CONFIG:
|
||||
return new GUIToolConfig(player, new ContainerAdvTool(player.inventory, new InventoryTool(player, null)));
|
||||
case GUIID_FLOW_GATE:
|
||||
return world.getTileEntity(x, y, z) instanceof TileGate ? new GUIFlowGate((TileGate) world.getTileEntity(x, y, z)) : null;
|
||||
case GUIID_UPGRADE_MODIFIER:
|
||||
TileEntity containerTemp = world.getTileEntity(x, y, z);
|
||||
if (containerTemp != null && containerTemp instanceof TileUpgradeModifier) {
|
||||
return new GUIUpgradeModifier(player.inventory, (TileUpgradeModifier) containerTemp, new ContainerUpgradeModifier(player.inventory, (TileUpgradeModifier) containerTemp));
|
||||
}
|
||||
case GUIID_TOOL_CONFIG -> {
|
||||
return new GUIToolConfig(
|
||||
player,
|
||||
new ContainerAdvTool(player.inventory, new InventoryTool(player, null)));
|
||||
}
|
||||
case GUIID_FLOW_GATE -> {
|
||||
if (tile instanceof TileGate gate) {
|
||||
return new GUIFlowGate(gate);
|
||||
}
|
||||
break;
|
||||
|
||||
// case GUIID_CONTAINER_TEMPLATE:
|
||||
// TileEntity containerTemp = world.getTileEntity(x, y, z);
|
||||
// if (containerTemp != null && containerTemp instanceof TileContainerTemplate) {
|
||||
// return new GUIContainerTemplate(player.inventory, (TileContainerTemplate) containerTemp);
|
||||
// }
|
||||
// break;
|
||||
}
|
||||
case GUIID_UPGRADE_MODIFIER -> {
|
||||
if (tile instanceof TileUpgradeModifier upgradeModifier) {
|
||||
return new GUIUpgradeModifier(
|
||||
player.inventory,
|
||||
upgradeModifier,
|
||||
new ContainerUpgradeModifier(player.inventory, upgradeModifier));
|
||||
}
|
||||
}
|
||||
case GUIID_DISLOCATOR_INHIBITOR -> {
|
||||
if (tile instanceof TileDislocatorInhibitor inhibitor) {
|
||||
return new GUIDislocatorInhibitor(player.inventory, inhibitor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,22 +1,25 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import com.brandon3055.brandonscore.client.gui.guicomponents.GUIBase;
|
||||
import com.brandon3055.brandonscore.client.utills.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.GUIBase;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
|
||||
/**
|
||||
* Created by brandon3055 on 11/2/2016.
|
||||
*/
|
||||
public class GuiHudConfig extends GuiScreen {
|
||||
|
||||
private GUIBase parent;
|
||||
private GuiButton buttonHudFade;
|
||||
private GuiButton buttonArmorFade;
|
||||
@@ -30,7 +33,6 @@ public class GuiHudConfig extends GuiScreen {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
@@ -41,24 +43,77 @@ public class GuiHudConfig extends GuiScreen {
|
||||
|
||||
buttonList.add(new GuiButtonAHeight(0, x - 35, y + 95, 70, 15, StatCollector.translateToLocal("gui.back")));
|
||||
|
||||
buttonList.add(new GuiButtonAHeight(1, x + 2, y - 37, 80, 15, StatCollector.translateToLocal("button.de.scaleUp.txt")));
|
||||
buttonList.add(new GuiButtonAHeight(2, x - 81, y - 37, 80, 15, StatCollector.translateToLocal("button.de.scaleDown.txt")));
|
||||
buttonList.add(
|
||||
new GuiButtonAHeight(
|
||||
1,
|
||||
x + 2,
|
||||
y - 37,
|
||||
80,
|
||||
15,
|
||||
StatCollector.translateToLocal("button.de.scaleUp.txt")));
|
||||
buttonList.add(
|
||||
new GuiButtonAHeight(
|
||||
2,
|
||||
x - 81,
|
||||
y - 37,
|
||||
80,
|
||||
15,
|
||||
StatCollector.translateToLocal("button.de.scaleDown.txt")));
|
||||
buttonList.add(buttonHudFade = new GuiButtonAHeight(3, x - 81, y - 20, 163, 15, ""));
|
||||
buttonList.add(new GuiButtonAHeight(9, x - 81, y - 3, 163, 15, StatCollector.translateToLocal("button.de.toggleHidden.txt")));
|
||||
buttonList.add(
|
||||
new GuiButtonAHeight(
|
||||
9,
|
||||
x - 81,
|
||||
y - 3,
|
||||
163,
|
||||
15,
|
||||
StatCollector.translateToLocal("button.de.toggleHidden.txt")));
|
||||
|
||||
buttonList.add(new GuiButtonAHeight(4, x + 2, y + 25, 80, 15, StatCollector.translateToLocal("button.de.scaleUp.txt")));
|
||||
buttonList.add(new GuiButtonAHeight(5, x - 81, y + 25, 80, 15, StatCollector.translateToLocal("button.de.scaleDown.txt")));
|
||||
buttonList.add(
|
||||
new GuiButtonAHeight(
|
||||
4,
|
||||
x + 2,
|
||||
y + 25,
|
||||
80,
|
||||
15,
|
||||
StatCollector.translateToLocal("button.de.scaleUp.txt")));
|
||||
buttonList.add(
|
||||
new GuiButtonAHeight(
|
||||
5,
|
||||
x - 81,
|
||||
y + 25,
|
||||
80,
|
||||
15,
|
||||
StatCollector.translateToLocal("button.de.scaleDown.txt")));
|
||||
buttonList.add(buttonArmorFade = new GuiButtonAHeight(6, x - 81, y + 42, 163, 15, ""));
|
||||
buttonList.add(buttonArmorNumeric = new GuiButtonAHeight(7, x + 2, y + 59, 80, 15, ""));
|
||||
buttonList.add(new GuiButtonAHeight(8, x - 81, y + 59, 80, 15, StatCollector.translateToLocal("button.de.rotate.txt")));
|
||||
buttonList.add(new GuiButtonAHeight(10, x - 81, y + 76, 163, 15, StatCollector.translateToLocal("button.de.toggleHidden.txt")));
|
||||
buttonList.add(
|
||||
new GuiButtonAHeight(
|
||||
8,
|
||||
x - 81,
|
||||
y + 59,
|
||||
80,
|
||||
15,
|
||||
StatCollector.translateToLocal("button.de.rotate.txt")));
|
||||
buttonList.add(
|
||||
new GuiButtonAHeight(
|
||||
10,
|
||||
x - 81,
|
||||
y + 76,
|
||||
163,
|
||||
15,
|
||||
StatCollector.translateToLocal("button.de.toggleHidden.txt")));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
buttonHudFade.displayString = StatCollector.translateToLocal("button.de.fadeMode" + ConfigHandler.hudSettings[6] + ".txt");
|
||||
buttonArmorFade.displayString = StatCollector.translateToLocal("button.de.fadeMode" + ConfigHandler.hudSettings[7] + ".txt");
|
||||
buttonArmorNumeric.displayString = StatCollector.translateToLocal("button.de.numeric.txt") + " " + (ConfigHandler.hudSettings[9] == 0 ? StatCollector.translateToLocal("gui.de.off.txt") : StatCollector.translateToLocal("gui.de.on.txt"));
|
||||
buttonHudFade.displayString = StatCollector
|
||||
.translateToLocal("button.de.fadeMode" + ConfigHandler.hudSettings[6] + ".txt");
|
||||
buttonArmorFade.displayString = StatCollector
|
||||
.translateToLocal("button.de.fadeMode" + ConfigHandler.hudSettings[7] + ".txt");
|
||||
buttonArmorNumeric.displayString = StatCollector.translateToLocal("button.de.numeric.txt") + " "
|
||||
+ (ConfigHandler.hudSettings[9] == 0 ? StatCollector.translateToLocal("gui.de.off.txt")
|
||||
: StatCollector.translateToLocal("gui.de.on.txt"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -94,7 +149,15 @@ public class GuiHudConfig extends GuiScreen {
|
||||
else ConfigHandler.hudSettings[11] = 0;
|
||||
}
|
||||
|
||||
ConfigHandler.config.get("Gui Stuff", "HUD Settings", new int[]{7, 874, 100, 100, 100, 100, 0, 0, 0, 0, 1, 1}, "Used to store the position of the armor ant tool HUD's. This should not be modified", Integer.MIN_VALUE, Integer.MAX_VALUE, true, 12).set(ConfigHandler.hudSettings);
|
||||
ConfigHandler.config.get(
|
||||
"Gui Stuff",
|
||||
"HUD Settings",
|
||||
new int[] { 7, 874, 100, 100, 100, 100, 0, 0, 0, 0, 1, 1 },
|
||||
"Used to store the position of the armor ant tool HUD's. This should not be modified",
|
||||
Integer.MIN_VALUE,
|
||||
Integer.MAX_VALUE,
|
||||
true,
|
||||
12).set(ConfigHandler.hudSettings);
|
||||
ConfigHandler.config.save();
|
||||
}
|
||||
|
||||
@@ -106,13 +169,43 @@ public class GuiHudConfig extends GuiScreen {
|
||||
int armorX = (int) ((pos[2] / 1000D) * width);
|
||||
int armorY = (int) ((pos[3] / 1000D) * height);
|
||||
|
||||
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("gui.de.configureGuiElements.txt"), width / 2, height / 2 - 90, 0x00FFFF);
|
||||
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("gui.de.hudDisplaySettings.txt"), width / 2, height / 2 - 77, 0xFFFFFF);
|
||||
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("gui.de.shieldDisplaySettings.txt"), width / 2, height / 2 - 15, 0xFFFFFF);
|
||||
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("gui.de.clickAndDragPurpleBoxes.txt"), width / 2, height / 2 + 85, 0xFFFFFF);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("gui.de.configureGuiElements.txt"),
|
||||
width / 2,
|
||||
height / 2 - 90,
|
||||
0x00FFFF);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("gui.de.hudDisplaySettings.txt"),
|
||||
width / 2,
|
||||
height / 2 - 77,
|
||||
0xFFFFFF);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("gui.de.shieldDisplaySettings.txt"),
|
||||
width / 2,
|
||||
height / 2 - 15,
|
||||
0xFFFFFF);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("gui.de.clickAndDragPurpleBoxes.txt"),
|
||||
width / 2,
|
||||
height / 2 + 85,
|
||||
0xFFFFFF);
|
||||
|
||||
drawCenteredString(fontRendererObj, ConfigHandler.hudSettings[4] + "%", width / 2 + 97, height / 2 - 63, 0xFFFFFF);
|
||||
drawCenteredString(fontRendererObj, ConfigHandler.hudSettings[5] + "%", width / 2 + 97, height / 2 - 1, 0xFFFFFF);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
ConfigHandler.hudSettings[4] + "%",
|
||||
width / 2 + 97,
|
||||
height / 2 - 63,
|
||||
0xFFFFFF);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
ConfigHandler.hudSettings[5] + "%",
|
||||
width / 2 + 97,
|
||||
height / 2 - 1,
|
||||
0xFFFFFF);
|
||||
super.drawScreen(x, y, partial);
|
||||
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
@@ -141,12 +234,15 @@ public class GuiHudConfig extends GuiScreen {
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
if (GuiHelper.isInRect(armorX - 19, armorY - 19, 39, 39, x, y) || GuiHelper.isInRect(hudX - 19, hudY - 19, 39, 39, x, y)) {
|
||||
drawHoveringText(new ArrayList<String>() {{
|
||||
add(StatCollector.translateToLocal("info.de.hudDisplayConfigTxt2.txt"));
|
||||
}}, x, y, fontRendererObj);
|
||||
}
|
||||
if (GuiHelper.isInRect(armorX - 19, armorY - 19, 39, 39, x, y)
|
||||
|| GuiHelper.isInRect(hudX - 19, hudY - 19, 39, 39, x, y)) {
|
||||
drawHoveringText(new ArrayList<String>() {
|
||||
|
||||
{
|
||||
add(StatCollector.translateToLocal("info.de.hudDisplayConfigTxt2.txt"));
|
||||
}
|
||||
}, x, y, fontRendererObj);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -176,7 +272,15 @@ public class GuiHudConfig extends GuiScreen {
|
||||
protected void mouseMovedOrUp(int x, int y, int action) {
|
||||
super.mouseMovedOrUp(x, y, action);
|
||||
draggingHud = draggingArmor = false;
|
||||
ConfigHandler.config.get("Gui Stuff", "HUD Settings", new int[]{7, 874, 100, 100, 100, 100, 0, 0, 0, 0, 1, 1}, "Used to store the position of the armor ant tool HUD's. This should not be modified", Integer.MIN_VALUE, Integer.MAX_VALUE, true, 12).set(ConfigHandler.hudSettings);
|
||||
ConfigHandler.config.get(
|
||||
"Gui Stuff",
|
||||
"HUD Settings",
|
||||
new int[] { 7, 874, 100, 100, 100, 100, 0, 0, 0, 0, 1, 1 },
|
||||
"Used to store the position of the armor ant tool HUD's. This should not be modified",
|
||||
Integer.MIN_VALUE,
|
||||
Integer.MAX_VALUE,
|
||||
true,
|
||||
12).set(ConfigHandler.hudSettings);
|
||||
ConfigHandler.config.save();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,16 +4,19 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 30/6/2015.
|
||||
*/
|
||||
public class GuiTextureButton extends GuiButton {
|
||||
|
||||
public int textureXPos;
|
||||
public int textureYPos;
|
||||
|
||||
public GuiTextureButton(int id, int xPos, int yPos, int textureXPos, int textureYPos, int xSise, int ySise, String text) {
|
||||
public GuiTextureButton(int id, int xPos, int yPos, int textureXPos, int textureYPos, int xSise, int ySise,
|
||||
String text) {
|
||||
super(id, xPos, yPos, xSise, ySise, text);
|
||||
this.textureXPos = textureXPos;
|
||||
this.textureYPos = textureYPos;
|
||||
@@ -24,12 +27,20 @@ public class GuiTextureButton extends GuiButton {
|
||||
if (this.visible) {
|
||||
FontRenderer fontrenderer = mc.fontRenderer;
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.field_146123_n = x >= this.xPosition && y >= this.yPosition && x < this.xPosition + this.width && y < this.yPosition + this.height;
|
||||
this.field_146123_n = x >= this.xPosition && y >= this.yPosition
|
||||
&& x < this.xPosition + this.width
|
||||
&& y < this.yPosition + this.height;
|
||||
int k = this.getHoverState(this.field_146123_n);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
this.drawTexturedModalRect(this.xPosition, this.yPosition, textureXPos, textureYPos + k * height, this.width, this.height);
|
||||
this.drawTexturedModalRect(
|
||||
this.xPosition,
|
||||
this.yPosition,
|
||||
textureXPos,
|
||||
textureYPos + k * height,
|
||||
this.width,
|
||||
this.height);
|
||||
|
||||
this.mouseDragged(mc, x, y);
|
||||
int l = 14737632;
|
||||
@@ -42,9 +53,12 @@ public class GuiTextureButton extends GuiButton {
|
||||
l = 16777120;
|
||||
}
|
||||
|
||||
this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, l);
|
||||
this.drawCenteredString(
|
||||
fontrenderer,
|
||||
this.displayString,
|
||||
this.xPosition + this.width / 2,
|
||||
this.yPosition + (this.height - 8) / 2,
|
||||
l);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+201
-89
@@ -1,18 +1,16 @@
|
||||
package com.brandon3055.draconicevolution.client.gui.componentguis;
|
||||
|
||||
import com.brandon3055.brandonscore.client.gui.guicomponents.*;
|
||||
import com.brandon3055.brandonscore.client.utills.ClientUtills;
|
||||
import com.brandon3055.brandonscore.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentContributorsPage;
|
||||
import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentIndexButton;
|
||||
import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentManualPage;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.common.container.DummyContainer;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.handler.ContributorHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.gui.GuiConfirmOpenLink;
|
||||
@@ -22,13 +20,29 @@ import net.minecraft.client.resources.IResource;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentContributorsPage;
|
||||
import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentIndexButton;
|
||||
import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentManualPage;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.utils.ClientUtils;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentBase;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentButton;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentCollection;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentTextureButton;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentTexturedRect;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.GUIScrollingBase;
|
||||
import com.brandon3055.draconicevolution.common.container.DummyContainer;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.handler.ContributorHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utils.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 6/03/2015.
|
||||
@@ -42,17 +56,25 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
|
||||
private int worldUpdateIn = -1;
|
||||
private static String lang;
|
||||
|
||||
|
||||
public GUIManual() {
|
||||
super(new DummyContainer(), 255, 325);
|
||||
if (currentPage != null) {
|
||||
collection.addComponent(new ComponentManualPage(0, 0, this, currentPage)).setGroup(GR_PAGE);
|
||||
collection.addComponent(new ComponentButton(102, 314, 50, 12, 1, this, StatCollector.translateToLocal("button.de.back.txt"))).setGroup(GR_PAGE);
|
||||
collection.addComponent(
|
||||
new ComponentButton(
|
||||
102,
|
||||
314,
|
||||
50,
|
||||
12,
|
||||
1,
|
||||
this,
|
||||
StatCollector.translateToLocal("button.de.back.txt")))
|
||||
.setGroup(GR_PAGE);
|
||||
collection.setOnlyGroupEnabled(GR_BACKGROUND);
|
||||
collection.setGroupEnabled(GR_PAGE, true);
|
||||
}
|
||||
|
||||
//mc.gameSettings.guiScale
|
||||
// mc.gameSettings.guiScale
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -119,19 +141,76 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
|
||||
protected ComponentCollection assembleComponents() {
|
||||
collection = new ComponentCollection(0, 0, xSize, ySize, this);
|
||||
|
||||
collection.addComponent(new ComponentTexturedRect(0, 0, 255, 255, ResourceHandler.getResource("textures/gui/manualTop.png"))).setGroup(GR_BACKGROUND);
|
||||
collection.addComponent(new ComponentTexturedRect(0, 255, 255, 69, ResourceHandler.getResource("textures/gui/manualBottom.png"))).setGroup(GR_BACKGROUND);
|
||||
collection.addComponent(
|
||||
new ComponentTexturedRect(0, 0, 255, 255, ResourceHandler.getResource("textures/gui/manualTop.png")))
|
||||
.setGroup(GR_BACKGROUND);
|
||||
collection.addComponent(
|
||||
new ComponentTexturedRect(
|
||||
0,
|
||||
255,
|
||||
255,
|
||||
69,
|
||||
ResourceHandler.getResource("textures/gui/manualBottom.png")))
|
||||
.setGroup(GR_BACKGROUND);
|
||||
|
||||
collection.addComponent(new ComponentTexturedRect(7, 100, 0, 0, 255, 255, ResourceHandler.getResource("textures/gui/images/debanner.png"), true)).setGroup(GR_INTRO).setName("BANNER");
|
||||
collection.addComponent(
|
||||
new ComponentTexturedRect(
|
||||
7,
|
||||
100,
|
||||
0,
|
||||
0,
|
||||
255,
|
||||
255,
|
||||
ResourceHandler.getResource("textures/gui/images/debanner.png"),
|
||||
true))
|
||||
.setGroup(GR_INTRO).setName("BANNER");
|
||||
|
||||
collection.addComponent(new ComponentButton(75, 260, 100, 20, 0, this, StatCollector.translateToLocal("info.de.manual.indexButton.txt"), StatCollector.translateToLocal("info.de.manual.indexButtonTip.txt"))).setGroup(GR_INTRO);
|
||||
collection.addComponent(new ComponentButton(75, 285, 100, 20, 2, this, StatCollector.translateToLocal("info.de.manual.contributorsButton.txt"), StatCollector.translateToLocal("info.de.manual.contributorsButtonInfo.txt"))).setGroup(GR_INTRO);
|
||||
collection.addComponent(new ComponentContributorsPage(0, 0, this)).setGroup(GR_CONTRIBUTORS).setName("CONTRIBUTORS");
|
||||
collection
|
||||
.addComponent(
|
||||
new ComponentButton(
|
||||
75,
|
||||
260,
|
||||
100,
|
||||
20,
|
||||
0,
|
||||
this,
|
||||
StatCollector.translateToLocal("info.de.manual.indexButton.txt"),
|
||||
StatCollector.translateToLocal("info.de.manual.indexButtonTip.txt")))
|
||||
.setGroup(GR_INTRO);
|
||||
collection
|
||||
.addComponent(
|
||||
new ComponentButton(
|
||||
75,
|
||||
285,
|
||||
100,
|
||||
20,
|
||||
2,
|
||||
this,
|
||||
StatCollector.translateToLocal("info.de.manual.contributorsButton.txt"),
|
||||
StatCollector.translateToLocal("info.de.manual.contributorsButtonInfo.txt")))
|
||||
.setGroup(GR_INTRO);
|
||||
collection.addComponent(new ComponentContributorsPage(0, 0, this)).setGroup(GR_CONTRIBUTORS)
|
||||
.setName("CONTRIBUTORS");
|
||||
|
||||
collection.addComponent(new ComponentTextureButton(140, 290, 0, 0, 100, 30, 10, this, "", "", ResourceHandler.getResource("textures/gui/patreon.png")).forceFullRender()).setGroup(GR_CONTRIBUTORS);
|
||||
collection
|
||||
.addComponent(
|
||||
new ComponentTextureButton(
|
||||
140,
|
||||
290,
|
||||
0,
|
||||
0,
|
||||
100,
|
||||
30,
|
||||
10,
|
||||
this,
|
||||
"",
|
||||
"",
|
||||
ResourceHandler.getResource("textures/gui/patreon.png")).forceFullRender())
|
||||
.setGroup(GR_CONTRIBUTORS);
|
||||
|
||||
for (int i = 0; i < pageList.size(); i++) {
|
||||
collection.addComponent(new ComponentIndexButton(20, 20 + i * 20, this, pageList.get(i))).setGroup(GR_INDEX).setName("INDEX_BUTTON_" + i);
|
||||
collection.addComponent(new ComponentIndexButton(20, 20 + i * 20, this, pageList.get(i))).setGroup(GR_INDEX)
|
||||
.setName("INDEX_BUTTON_" + i);
|
||||
pageLength += 20;
|
||||
}
|
||||
|
||||
@@ -144,7 +223,8 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
|
||||
|
||||
@Override
|
||||
public void handleScrollInput(int direction) {
|
||||
if (collection.getComponent("INDEX_BUTTON_0") != null && collection.getComponent("INDEX_BUTTON_0").isEnabled()) {
|
||||
if (collection.getComponent("INDEX_BUTTON_0") != null
|
||||
&& collection.getComponent("INDEX_BUTTON_0").isEnabled()) {
|
||||
|
||||
if (currentPage != null) return;
|
||||
scrollOffset += direction * (InfoHelper.isShiftKeyDown() ? 30 : 10);
|
||||
@@ -153,15 +233,16 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
|
||||
if (pageLength + 40 <= ySize) scrollOffset = 0;
|
||||
|
||||
barPosition = (int) (((double) scrollOffset / scrollLimit) * 247D);
|
||||
} else if (collection.getComponent("CONTRIBUTORS") != null && collection.getComponent("CONTRIBUTORS").isEnabled()) {
|
||||
ComponentContributorsPage page = (ComponentContributorsPage) collection.getComponent("CONTRIBUTORS");
|
||||
barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D);
|
||||
} else if (collection.getComponent("OPEN_PAGE") != null && collection.getComponent("OPEN_PAGE").isEnabled()) {
|
||||
ComponentManualPage page = (ComponentManualPage) collection.getComponent("OPEN_PAGE");
|
||||
barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D);
|
||||
}
|
||||
|
||||
|
||||
} else if (collection.getComponent("CONTRIBUTORS") != null
|
||||
&& collection.getComponent("CONTRIBUTORS").isEnabled()) {
|
||||
ComponentContributorsPage page = (ComponentContributorsPage) collection
|
||||
.getComponent("CONTRIBUTORS");
|
||||
barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D);
|
||||
} else
|
||||
if (collection.getComponent("OPEN_PAGE") != null && collection.getComponent("OPEN_PAGE").isEnabled()) {
|
||||
ComponentManualPage page = (ComponentManualPage) collection.getComponent("OPEN_PAGE");
|
||||
barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -170,7 +251,12 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
|
||||
int posX = (this.width - xSize) / 2;
|
||||
int posY = (this.height - ySize) / 2;
|
||||
if (collection.getComponent("BANNER") != null && collection.getComponent("BANNER").isEnabled())
|
||||
fontRendererObj.drawSplitString(StatCollector.translateToLocal("info.de.manual.introTxt.txt"), posX + 20, posY + 190, 150, 0x000000);
|
||||
fontRendererObj.drawSplitString(
|
||||
StatCollector.translateToLocal("info.de.manual.introTxt.txt"),
|
||||
posX + 20,
|
||||
posY + 190,
|
||||
150,
|
||||
0x000000);
|
||||
|
||||
if (collection.getComponent("BANNER") != null && collection.getComponent("BANNER").isEnabled()) return;
|
||||
ResourceHandler.bindResource("textures/gui/Widgets.png");
|
||||
@@ -193,15 +279,20 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
|
||||
|
||||
disableScrollBar = collection.getComponent("BANNER") != null && collection.getComponent("BANNER").isEnabled();
|
||||
|
||||
if (!scrollPressed && collection.getComponent("INDEX_BUTTON_0") != null && collection.getComponent("INDEX_BUTTON_0").isEnabled()) {
|
||||
if (!scrollPressed && collection.getComponent("INDEX_BUTTON_0") != null
|
||||
&& collection.getComponent("INDEX_BUTTON_0").isEnabled()) {
|
||||
barPosition = (int) (((double) scrollOffset / scrollLimit) * 247D);
|
||||
} else if (!scrollPressed && collection.getComponent("CONTRIBUTORS") != null && collection.getComponent("CONTRIBUTORS").isEnabled()) {
|
||||
ComponentContributorsPage page = (ComponentContributorsPage) collection.getComponent("CONTRIBUTORS");
|
||||
barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D);
|
||||
} else if (!scrollPressed && collection.getComponent("OPEN_PAGE") != null && collection.getComponent("OPEN_PAGE").isEnabled()) {
|
||||
ComponentManualPage page = (ComponentManualPage) collection.getComponent("OPEN_PAGE");
|
||||
barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D);
|
||||
}
|
||||
} else if (!scrollPressed && collection.getComponent("CONTRIBUTORS") != null
|
||||
&& collection.getComponent("CONTRIBUTORS").isEnabled()) {
|
||||
ComponentContributorsPage page = (ComponentContributorsPage) collection
|
||||
.getComponent("CONTRIBUTORS");
|
||||
barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D);
|
||||
} else
|
||||
if (!scrollPressed && collection.getComponent("OPEN_PAGE") != null
|
||||
&& collection.getComponent("OPEN_PAGE").isEnabled()) {
|
||||
ComponentManualPage page = (ComponentManualPage) collection.getComponent("OPEN_PAGE");
|
||||
barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D);
|
||||
}
|
||||
|
||||
if (worldUpdateIn > -1) worldUpdateIn--;
|
||||
if (worldUpdateIn == 0) collection.setWorldAndResolution(mc, width, height);
|
||||
@@ -229,7 +320,6 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
|
||||
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||
if (disableScrollBar) return;
|
||||
|
||||
|
||||
ResourceHandler.bindResource("textures/gui/manualBottom.png");
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
drawTexturedModalRect(guiLeft - 16, guiTop + 10, 0, 146, 15, 100);
|
||||
@@ -280,13 +370,13 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
|
||||
public static void loadPages() {
|
||||
lang = Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode();
|
||||
|
||||
ResourceLocation rsLocation = new ResourceLocation(References.RESOURCESPREFIX + "manual/manual-" + lang + ".json");
|
||||
ResourceLocation rsLocation = new ResourceLocation(
|
||||
References.RESOURCESPREFIX + "manual/manual-" + lang + ".json");
|
||||
IResource resource = null;
|
||||
|
||||
try {
|
||||
resource = Minecraft.getMinecraft().getResourceManager().getResource(rsLocation);
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
LogHelper.warn("##################################################################################");
|
||||
LogHelper.warn("");
|
||||
LogHelper.warn("Info Tablet language localisation is not available for the selected language: " + lang);
|
||||
@@ -297,8 +387,7 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
|
||||
rsLocation = new ResourceLocation(References.RESOURCESPREFIX + "manual/manual-en_US.json");
|
||||
try {
|
||||
resource = Minecraft.getMinecraft().getResourceManager().getResource(rsLocation);
|
||||
}
|
||||
catch (IOException e1) {
|
||||
} catch (IOException e1) {
|
||||
LogHelper.error("Well that didn't work... ");
|
||||
e1.printStackTrace();
|
||||
}
|
||||
@@ -309,7 +398,6 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
File manualJSON = new File(ResourceHandler.getConfigFolder(), "manual.json");
|
||||
|
||||
@@ -319,14 +407,14 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
|
||||
is.close();
|
||||
os.close();
|
||||
|
||||
JsonReader reader = new JsonReader(new InputStreamReader(new FileInputStream(manualJSON), "utf-8"));
|
||||
|
||||
JsonReader reader = new JsonReader(new FileReader(manualJSON));
|
||||
List<String> images;
|
||||
List<String> content;
|
||||
|
||||
reader.beginArray();
|
||||
|
||||
//Read next page
|
||||
// Read next page
|
||||
while (reader.hasNext()) {
|
||||
String name;
|
||||
String nameL = null;
|
||||
@@ -336,14 +424,17 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
|
||||
|
||||
reader.beginObject();
|
||||
|
||||
//Read page name
|
||||
// Read page name
|
||||
String s = reader.nextName();
|
||||
if (s.equals("name")) {
|
||||
name = reader.nextString();
|
||||
} else
|
||||
throw new IOException("Error reading manual.json (invalid name in place of \"name\" [Found:\"" + s + "\"])");
|
||||
} else {
|
||||
reader.close();
|
||||
throw new IOException(
|
||||
"Error reading manual.json (invalid name in place of \"name\" [Found:\"" + s + "\"])");
|
||||
}
|
||||
|
||||
//Read page images
|
||||
// Read page images
|
||||
s = reader.nextName();
|
||||
if (s.equals("nameL")) {
|
||||
nameL = reader.nextString();
|
||||
@@ -362,10 +453,12 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
|
||||
if (!imageURLs.contains(url)) imageURLs.add(url);
|
||||
}
|
||||
reader.endArray();
|
||||
} else
|
||||
throw new IOException("Error reading manual.json (invalid name in place of \"images\" [Found:\"" + s + "\"])");
|
||||
|
||||
//Read page content
|
||||
} else {
|
||||
reader.close();
|
||||
throw new IOException(
|
||||
"Error reading manual.json (invalid name in place of \"name\" [Found:\"" + s + "\"])");
|
||||
}
|
||||
// Read page content
|
||||
s = reader.nextName();
|
||||
if (s.equals("content")) {
|
||||
reader.beginArray();
|
||||
@@ -373,22 +466,26 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
|
||||
content.add(reader.nextString());
|
||||
}
|
||||
reader.endArray();
|
||||
} else
|
||||
throw new IOException("Error reading manual.json (invalid name in place of \"content\" [Found:\"" + s + "\"])");
|
||||
|
||||
} else {
|
||||
reader.close();
|
||||
throw new IOException(
|
||||
"Error reading manual.json (invalid name in place of \"name\" [Found:\"" + s + "\"])");
|
||||
}
|
||||
reader.endObject();
|
||||
|
||||
if (isValidPage(name))
|
||||
pageList.add(new ManualPage(name, images.toArray(new String[images.size()]), content.toArray(new String[content.size()]), nameL, meta));
|
||||
if (isValidPage(name)) pageList.add(
|
||||
new ManualPage(
|
||||
name,
|
||||
images.toArray(new String[images.size()]),
|
||||
content.toArray(new String[content.size()]),
|
||||
nameL,
|
||||
meta));
|
||||
}
|
||||
|
||||
reader.endArray();
|
||||
|
||||
}
|
||||
catch (FileNotFoundException e) {
|
||||
reader.close();
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -399,11 +496,24 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
|
||||
if (buttonPressed) return;
|
||||
|
||||
for (ComponentBase c : collection.getComponents()) {
|
||||
if (c instanceof ComponentIndexButton && c.isEnabled() && ((ComponentIndexButton) c).isOnScreen() && c.isMouseOver(x - guiLeft, y - guiTop)) {
|
||||
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
if (c instanceof ComponentIndexButton && c.isEnabled()
|
||||
&& ((ComponentIndexButton) c).isOnScreen()
|
||||
&& c.isMouseOver(x - guiLeft, y - guiTop)) {
|
||||
Minecraft.getMinecraft().getSoundHandler()
|
||||
.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
currentPage = ((ComponentIndexButton) c).getPage();
|
||||
collection.addComponent(new ComponentManualPage(0, 0, this, currentPage)).setGroup(GR_PAGE).setName("OPEN_PAGE");
|
||||
collection.addComponent(new ComponentButton(102, 314, 50, 12, 1, this, StatCollector.translateToLocal("button.de.back.txt"))).setGroup(GR_PAGE);
|
||||
collection.addComponent(new ComponentManualPage(0, 0, this, currentPage)).setGroup(GR_PAGE)
|
||||
.setName("OPEN_PAGE");
|
||||
collection.addComponent(
|
||||
new ComponentButton(
|
||||
102,
|
||||
314,
|
||||
50,
|
||||
12,
|
||||
1,
|
||||
this,
|
||||
StatCollector.translateToLocal("button.de.back.txt")))
|
||||
.setGroup(GR_PAGE);
|
||||
collection.setOnlyGroupEnabled(GR_BACKGROUND);
|
||||
collection.setGroupEnabled(GR_PAGE, true);
|
||||
break;
|
||||
@@ -415,15 +525,18 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
|
||||
public void barMoved(double position) {
|
||||
if (collection.getComponent("INDEX_BUTTON_0") != null && collection.getComponent("INDEX_BUTTON_0").isEnabled())
|
||||
scrollOffset = (int) (position * scrollLimit);
|
||||
else if (collection.getComponent("CONTRIBUTORS") != null && collection.getComponent("CONTRIBUTORS").isEnabled()) {
|
||||
ComponentContributorsPage page = (ComponentContributorsPage) collection.getComponent("CONTRIBUTORS");
|
||||
if (page.scrollLimit < 0) return;
|
||||
page.scrollOffset = (int) (position * page.scrollLimit);
|
||||
} else if (collection.getComponent("OPEN_PAGE") != null && collection.getComponent("OPEN_PAGE").isEnabled()) {
|
||||
ComponentManualPage page = (ComponentManualPage) collection.getComponent("OPEN_PAGE");
|
||||
if (page.scrollLimit < 0) return;
|
||||
page.scrollOffset = (int) (position * page.scrollLimit);
|
||||
}
|
||||
else if (collection.getComponent("CONTRIBUTORS") != null
|
||||
&& collection.getComponent("CONTRIBUTORS").isEnabled()) {
|
||||
ComponentContributorsPage page = (ComponentContributorsPage) collection
|
||||
.getComponent("CONTRIBUTORS");
|
||||
if (page.scrollLimit < 0) return;
|
||||
page.scrollOffset = (int) (position * page.scrollLimit);
|
||||
} else
|
||||
if (collection.getComponent("OPEN_PAGE") != null && collection.getComponent("OPEN_PAGE").isEnabled()) {
|
||||
ComponentManualPage page = (ComponentManualPage) collection.getComponent("OPEN_PAGE");
|
||||
if (page.scrollLimit < 0) return;
|
||||
page.scrollOffset = (int) (position * page.scrollLimit);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isValidPage(String name) {
|
||||
@@ -434,8 +547,7 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
|
||||
|
||||
@Override
|
||||
public void confirmClicked(boolean confirmed, int id) {
|
||||
if (confirmed) ClientUtills.openLink("https://www.patreon.com/brandon3055");
|
||||
if (confirmed) ClientUtils.openLink("https://www.patreon.com/brandon3055");
|
||||
mc.displayGuiScreen(this);
|
||||
}
|
||||
}
|
||||
|
||||
+204
-92
@@ -1,60 +1,126 @@
|
||||
package com.brandon3055.draconicevolution.client.gui.componentguis;
|
||||
|
||||
import com.brandon3055.brandonscore.client.gui.guicomponents.*;
|
||||
import com.brandon3055.brandonscore.client.utills.GuiHelper;
|
||||
import com.brandon3055.brandonscore.common.utills.Utills;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerReactor;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentButton;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentCollection;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentTextureButton;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentTexturedRect;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.GUIBase;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerReactor;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore.ReactorState;
|
||||
import com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
|
||||
/**
|
||||
* Created by brandon3055 on 30/7/2015.
|
||||
*/
|
||||
public class GUIReactor extends GUIBase {
|
||||
private TileReactorCore reactor;
|
||||
private ContainerReactor container;
|
||||
private static boolean showStats = false;
|
||||
|
||||
public GUIReactor(EntityPlayer player, TileReactorCore reactor, ContainerReactor container) {
|
||||
private static boolean showStatistics = false;
|
||||
private final TileReactorCore core;
|
||||
private final ContainerReactor container;
|
||||
|
||||
public GUIReactor(TileReactorCore core, ContainerReactor container) {
|
||||
super(container, 248, 222);
|
||||
this.reactor = reactor;
|
||||
this.core = core;
|
||||
this.container = container;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ComponentCollection assembleComponents() {
|
||||
final ResourceLocation widgets = ResourceHandler.getResource("textures/gui/Widgets.png");
|
||||
collection = new ComponentCollection(0, 0, 248, 222, this);
|
||||
collection.addComponent(new ComponentTexturedRect(0, 0, xSize, ySize, ResourceHandler.getResource("textures/gui/Reactor.png")));
|
||||
collection.addComponent(new ComponentTextureButton(14, 190, 18, 162, 18, 18, 0, this, "", StatCollector.translateToLocal("button.de.reactorCharge.txt"), ResourceHandler.getResource("textures/gui/Widgets.png"))).setName("CHARGE");
|
||||
collection.addComponent(new ComponentTextureButton(14, 190, 18, 54, 18, 18, 1, this, "", StatCollector.translateToLocal("button.de.reactorStart.txt"), ResourceHandler.getResource("textures/gui/Widgets.png"))).setName("ACTIVATE");
|
||||
collection.addComponent(new ComponentTextureButton(216, 190, 18, 108, 18, 18, 2, this, "", StatCollector.translateToLocal("button.de.reactorStop.txt"), ResourceHandler.getResource("textures/gui/Widgets.png"))).setName("DEACTIVATE");
|
||||
collection.addComponent(new ComponentButton(9, 120, 43, 15, 3, this, StatCollector.translateToLocal("button.de.stats.txt"), StatCollector.translateToLocal("button.de.statsShow.txt"))).setName("STATS");
|
||||
collection.addComponent(
|
||||
new ComponentTexturedRect(0, 0, xSize, ySize, ResourceHandler.getResource("textures/gui/Reactor.png")));
|
||||
collection.addComponent(
|
||||
new ComponentTextureButton(
|
||||
14,
|
||||
190,
|
||||
18,
|
||||
162,
|
||||
18,
|
||||
18,
|
||||
0,
|
||||
this,
|
||||
"",
|
||||
StatCollector.translateToLocal("button.de.reactorCharge.txt"),
|
||||
widgets))
|
||||
.setName("CHARGE");
|
||||
collection.addComponent(
|
||||
new ComponentTextureButton(
|
||||
14,
|
||||
190,
|
||||
18,
|
||||
54,
|
||||
18,
|
||||
18,
|
||||
1,
|
||||
this,
|
||||
"",
|
||||
StatCollector.translateToLocal("button.de.reactorStart.txt"),
|
||||
widgets))
|
||||
.setName("ACTIVATE");
|
||||
collection.addComponent(
|
||||
new ComponentTextureButton(
|
||||
216,
|
||||
190,
|
||||
18,
|
||||
108,
|
||||
18,
|
||||
18,
|
||||
2,
|
||||
this,
|
||||
"",
|
||||
StatCollector.translateToLocal("button.de.reactorStop.txt"),
|
||||
widgets))
|
||||
.setName("DEACTIVATE");
|
||||
collection.addComponent(
|
||||
new ComponentButton(
|
||||
9,
|
||||
120,
|
||||
43,
|
||||
15,
|
||||
3,
|
||||
this,
|
||||
StatCollector.translateToLocal("button.de.stats.txt"),
|
||||
StatCollector.translateToLocal("button.de.statsShow.txt")))
|
||||
.setName("STATS");
|
||||
return collection;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
|
||||
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||
//Draw I/O Slots
|
||||
if (reactor.reactorState == TileReactorCore.STATE_OFFLINE) {
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
||||
super.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY);
|
||||
// Draw I/O Slots
|
||||
if (core.reactorState == ReactorState.OFFLINE) {
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
drawTexturedModalRect(guiLeft + 14, guiTop + 139, 14, ySize, 18, 18);
|
||||
drawTexturedModalRect(guiLeft + 216, guiTop + 139, 32, ySize, 18, 18);
|
||||
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.insert.txt"), guiLeft + 8, guiTop + 159, 0);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.fuel.txt"), guiLeft + 13, guiTop + 168, 0);
|
||||
fontRendererObj
|
||||
.drawString(StatCollector.translateToLocal("gui.de.insert.txt"), guiLeft + 8, guiTop + 159, 0);
|
||||
fontRendererObj
|
||||
.drawString(StatCollector.translateToLocal("gui.de.fuel.txt"), guiLeft + 13, guiTop + 168, 0);
|
||||
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.extract.txt"), guiLeft + 206, guiTop + 159, 0);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.fuel.txt"), guiLeft + 215, guiTop + 168, 0);
|
||||
fontRendererObj
|
||||
.drawString(StatCollector.translateToLocal("gui.de.extract.txt"), guiLeft + 206, guiTop + 159, 0);
|
||||
fontRendererObj
|
||||
.drawString(StatCollector.translateToLocal("gui.de.fuel.txt"), guiLeft + 215, guiTop + 168, 0);
|
||||
}
|
||||
drawCenteredString(fontRendererObj, "Draconic Reactor", guiLeft + xSize / 2, guiTop + 4, 0x00FFFF);
|
||||
}
|
||||
@@ -65,136 +131,182 @@ public class GUIReactor extends GUIBase {
|
||||
ResourceHandler.bindResource("textures/gui/Reactor.png");
|
||||
|
||||
GL11.glColor4f(1f, 1f, 1f, 1f);
|
||||
//Draw Indicators
|
||||
double value = Math.min(reactor.reactionTemperature, reactor.maxReactTemperature) / reactor.maxReactTemperature;
|
||||
// Draw Indicators
|
||||
double value = Math.min(core.reactionTemperature, core.maxReactTemperature) / core.maxReactTemperature;
|
||||
int pixOffset = (int) (value * 108);
|
||||
drawTexturedModalRect(11, 112 - pixOffset, 0, 222, 14, 5);
|
||||
|
||||
value = reactor.fieldCharge / reactor.maxFieldCharge;
|
||||
value = core.fieldCharge / core.maxFieldCharge;
|
||||
pixOffset = (int) (value * 108);
|
||||
drawTexturedModalRect(35, 112 - pixOffset, 0, 222, 14, 5);
|
||||
|
||||
value = (double) reactor.energySaturation / (double) reactor.maxEnergySaturation;
|
||||
value = (double) core.energySaturation / (double) core.maxEnergySaturation;
|
||||
pixOffset = (int) (value * 108);
|
||||
drawTexturedModalRect(199, 112 - pixOffset, 0, 222, 14, 5);
|
||||
|
||||
value = ((double) reactor.convertedFuel) / ((double) reactor.reactorFuel + (double) reactor.convertedFuel);
|
||||
value = ((double) core.convertedFuel) / ((double) core.reactorFuel + (double) core.convertedFuel);
|
||||
pixOffset = (int) (value * 108);
|
||||
drawTexturedModalRect(223, 112 - pixOffset, 0, 222, 14, 5);
|
||||
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
if (!showStats) {
|
||||
|
||||
if (showStatistics) {
|
||||
ResourceHandler.bindResource("textures/gui/Reactor.png");
|
||||
for (int i = 1; i <= 10; i++) {
|
||||
drawTexturedModalRect(63, i * 12, 0, 240, 122, 16);
|
||||
}
|
||||
drawStatistics();
|
||||
} else {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
GL11.glTranslated(124, 71, 100);
|
||||
double scale = 100 / (reactor.getCoreDiameter());
|
||||
double scale = 100 / (core.getCoreDiameter());
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
|
||||
TileEntityRendererDispatcher.instance.renderTileEntityAt(reactor, -0.5D, -0.5D, -0.5D, 0.0F);
|
||||
TileEntityRendererDispatcher.instance.renderTileEntityAt(core, -0.5D, -0.5D, -0.5D, 0.0F);
|
||||
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
} else {
|
||||
ResourceHandler.bindResource("textures/gui/Reactor.png");
|
||||
for (int i = 1; i <= 10; i++) drawTexturedModalRect(63, i * 12, 0, 240, 122, 16);
|
||||
drawStats();
|
||||
drawStatus();
|
||||
}
|
||||
|
||||
String status = StatCollector.translateToLocal("gui.de.status.txt") + ": " + (reactor.reactorState == 0 ? EnumChatFormatting.DARK_GRAY : reactor.reactorState == 1 ? EnumChatFormatting.RED : reactor.reactorState == 2 ? EnumChatFormatting.DARK_GREEN : EnumChatFormatting.RED) + StatCollector.translateToLocal("gui.de.status" + reactor.reactorState + ".txt");
|
||||
if (reactor.reactorState == 1 && reactor.canStart())
|
||||
status = StatCollector.translateToLocal("gui.de.status.txt") + ": " + EnumChatFormatting.DARK_GREEN + StatCollector.translateToLocal("gui.de.status1_5.txt");
|
||||
if (!showStats) fontRendererObj.drawString(status, xSize - 5 - fontRendererObj.getStringWidth(status), 125, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float par3) {
|
||||
super.drawScreen(mouseX, mouseY, par3);
|
||||
List<String> text = new ArrayList<String>();
|
||||
@SuppressWarnings("unchecked")
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
List<String> text = new ArrayList<>();
|
||||
if (GuiHelper.isInRect(9, 4, 18, 114, mouseX - guiLeft, mouseY - guiTop)) {
|
||||
text.add(StatCollector.translateToLocal("gui.de.reactionTemp.txt"));
|
||||
text.add((int) reactor.reactionTemperature + "C");
|
||||
text.add((int) core.reactionTemperature + "C");
|
||||
drawHoveringText(text, mouseX, mouseY, fontRendererObj);
|
||||
} else if (GuiHelper.isInRect(33, 4, 18, 114, mouseX - guiLeft, mouseY - guiTop)) {
|
||||
text.add(StatCollector.translateToLocal("gui.de.fieldStrength.txt"));
|
||||
if (reactor.maxFieldCharge > 0)
|
||||
text.add(Utills.round(reactor.fieldCharge / reactor.maxFieldCharge * 100D, 100D) + "%");
|
||||
text.add(Utills.addCommas((int) reactor.fieldCharge) + " / " + Utills.addCommas((int) reactor.maxFieldCharge)); //todo refine or remove
|
||||
if (core.maxFieldCharge > 0) {
|
||||
text.add(Utils.round(core.fieldCharge / core.maxFieldCharge * 100D, 100D) + "%");
|
||||
}
|
||||
text.add(formatNumber((int) core.fieldCharge) + " / " + formatNumber((int) core.maxFieldCharge));
|
||||
drawHoveringText(text, mouseX, mouseY, fontRendererObj);
|
||||
} else if (GuiHelper.isInRect(197, 4, 18, 114, mouseX - guiLeft, mouseY - guiTop)) {
|
||||
text.add(StatCollector.translateToLocal("gui.de.energySaturation.txt"));
|
||||
if (reactor.maxEnergySaturation > 0)
|
||||
text.add(Utills.round((double) reactor.energySaturation / (double) reactor.maxEnergySaturation * 100D, 100D) + "%");
|
||||
text.add(Utills.addCommas(reactor.energySaturation) + " / " + Utills.addCommas(reactor.maxEnergySaturation)); //todo refine or remove
|
||||
if (core.maxEnergySaturation > 0) {
|
||||
text.add(
|
||||
Utils.round((double) core.energySaturation / (double) core.maxEnergySaturation * 100D, 100D)
|
||||
+ "%");
|
||||
}
|
||||
text.add(formatNumber(core.energySaturation) + " / " + formatNumber(core.maxEnergySaturation));
|
||||
drawHoveringText(text, mouseX, mouseY, fontRendererObj);
|
||||
} else if (GuiHelper.isInRect(221, 4, 18, 114, mouseX - guiLeft, mouseY - guiTop)) {
|
||||
text.add(StatCollector.translateToLocal("gui.de.fuelConversion.txt"));
|
||||
if (reactor.reactorFuel + reactor.convertedFuel > 0)
|
||||
text.add(Utills.round(((double) reactor.convertedFuel + reactor.conversionUnit) / ((double) reactor.convertedFuel + (double) reactor.reactorFuel) * 100D, 100D) + "%");
|
||||
text.add(reactor.convertedFuel + " / " + (reactor.convertedFuel + reactor.reactorFuel)); //todo refine or remove
|
||||
if (core.reactorFuel + core.convertedFuel > 0) {
|
||||
text.add(
|
||||
Utils.round(
|
||||
((double) core.convertedFuel + core.conversionUnit)
|
||||
/ ((double) core.convertedFuel + (double) core.reactorFuel)
|
||||
* 100D,
|
||||
100D) + "%");
|
||||
}
|
||||
text.add(core.convertedFuel + " / " + (core.convertedFuel + core.reactorFuel));
|
||||
text.add(
|
||||
"Full: " + (Utils.round(
|
||||
(float) (core.convertedFuel + core.reactorFuel) / ConfigHandler.reactorFuelStorage * 100,
|
||||
1000)) + "%");
|
||||
drawHoveringText(text, mouseX, mouseY, fontRendererObj);
|
||||
}
|
||||
|
||||
if (showStats) {
|
||||
if (showStatistics) {
|
||||
if (GuiHelper.isInRect(53, 15, 140, 18, mouseX - guiLeft, mouseY - guiTop)) {
|
||||
text.addAll(fontRendererObj.listFormattedStringToWidth(StatCollector.translateToLocal("gui.de.reacTempLoadFactor.txt"), 200));
|
||||
text.addAll(
|
||||
fontRendererObj.listFormattedStringToWidth(
|
||||
StatCollector.translateToLocal("gui.de.reacTempLoadFactor.txt"),
|
||||
200));
|
||||
drawHoveringText(text, mouseX, mouseY, fontRendererObj);
|
||||
} else if (GuiHelper.isInRect(53, 40, 140, 18, mouseX - guiLeft, mouseY - guiTop)) {
|
||||
text.addAll(fontRendererObj.listFormattedStringToWidth(StatCollector.translateToLocal("gui.de.reacCoreMass.txt"), 200));
|
||||
text.addAll(
|
||||
fontRendererObj.listFormattedStringToWidth(
|
||||
StatCollector.translateToLocal("gui.de.reacCoreMass.txt"),
|
||||
200));
|
||||
drawHoveringText(text, mouseX, mouseY, fontRendererObj);
|
||||
} else if (GuiHelper.isInRect(53, 65, 140, 18, mouseX - guiLeft, mouseY - guiTop)) {
|
||||
text.addAll(fontRendererObj.listFormattedStringToWidth(StatCollector.translateToLocal("gui.de.reacGenRate.txt"), 200));
|
||||
text.addAll(
|
||||
fontRendererObj.listFormattedStringToWidth(
|
||||
StatCollector.translateToLocal("gui.de.reacGenRate.txt"),
|
||||
200));
|
||||
drawHoveringText(text, mouseX, mouseY, fontRendererObj);
|
||||
} else if (GuiHelper.isInRect(53, 88, 140, 18, mouseX - guiLeft, mouseY - guiTop)) {
|
||||
text.addAll(fontRendererObj.listFormattedStringToWidth(StatCollector.translateToLocal("gui.de.reacInputRate.txt"), 200));
|
||||
text.addAll(
|
||||
fontRendererObj.listFormattedStringToWidth(
|
||||
StatCollector.translateToLocal("gui.de.reacInputRate.txt"),
|
||||
200));
|
||||
drawHoveringText(text, mouseX, mouseY, fontRendererObj);
|
||||
} else if (GuiHelper.isInRect(53, 113, 140, 18, mouseX - guiLeft, mouseY - guiTop)) {
|
||||
text.addAll(fontRendererObj.listFormattedStringToWidth(StatCollector.translateToLocal("gui.de.reacConversionRate.txt"), 200));
|
||||
text.addAll(
|
||||
fontRendererObj.listFormattedStringToWidth(
|
||||
StatCollector.translateToLocal("gui.de.reacConversionRate.txt"),
|
||||
200));
|
||||
drawHoveringText(text, mouseX, mouseY, fontRendererObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void drawStats() {
|
||||
|
||||
double inputRate = reactor.fieldDrain / (1D - (reactor.fieldCharge / reactor.maxFieldCharge));
|
||||
private void drawStatistics() {
|
||||
double inputRate = core.fieldDrain / (1D - (core.fieldCharge / core.maxFieldCharge));
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.tempLoad.name"), 55, 16, 0x0000FF);
|
||||
fontRendererObj.drawString(Utills.round(reactor.tempDrainFactor * 100D, 1D) + "%", 60, 2 + 24, 0);
|
||||
fontRendererObj.drawString(Utils.round(core.tempDrainFactor * 100D, 1D) + "%", 60, 2 + 24, 0);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.mass.name"), 55, 16 + 24, 0x0000FF);
|
||||
fontRendererObj.drawString(Utills.round((reactor.reactorFuel + reactor.convertedFuel) / 1296D, 100) + "m^3", 60, 2 + 2 * 24, 0);
|
||||
fontRendererObj.drawString(
|
||||
Utils.round((core.reactorFuel + core.convertedFuel) / 1296D, 100) + "m^3",
|
||||
60,
|
||||
2 + 2 * 24,
|
||||
0);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.genRate.name"), 55, 16 + 2 * 24, 0x0000FF);
|
||||
fontRendererObj.drawString(Utills.addCommas((int) reactor.generationRate) + "RF/t", 60, 2 + 3 * 24, 0);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.fieldInputRate.name"), 55, 16 + 3 * 24, 0x0000FF);
|
||||
fontRendererObj.drawString(Utills.addCommas((int) Math.min(inputRate, Integer.MAX_VALUE)) + "RF/t", 60, 2 + 4 * 24, 0);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.fuelConversion.name"), 55, 16 + 4 * 24, 0x0000FF);
|
||||
fontRendererObj.drawString(Utills.addCommas((int) Math.round(reactor.fuelUseRate * 1000000D)) + "nb/t", 60, 2 + 5 * 24, 0);
|
||||
fontRendererObj.drawString(formatNumber((int) core.generationRate) + "RF/t", 60, 2 + 3 * 24, 0);
|
||||
fontRendererObj
|
||||
.drawString(StatCollector.translateToLocal("gui.de.fieldInputRate.name"), 55, 16 + 3 * 24, 0x0000FF);
|
||||
fontRendererObj
|
||||
.drawString(formatNumber((int) Math.min(inputRate, Integer.MAX_VALUE)) + "RF/t", 60, 2 + 4 * 24, 0);
|
||||
fontRendererObj
|
||||
.drawString(StatCollector.translateToLocal("gui.de.fuelConversion.name"), 55, 16 + 4 * 24, 0x0000FF);
|
||||
fontRendererObj
|
||||
.drawString(formatNumber((int) Math.round(core.fuelUseRate * 1000000D)) + "nb/t", 60, 2 + 5 * 24, 0);
|
||||
}
|
||||
|
||||
private void drawStatus() {
|
||||
String status = StatCollector.translateToLocal("gui.de.status.txt") + ": ";
|
||||
switch (core.reactorState) {
|
||||
case OFFLINE -> status += EnumChatFormatting.DARK_GRAY;
|
||||
case STARTING, STOPPING -> status += EnumChatFormatting.RED;
|
||||
case ONLINE -> status += EnumChatFormatting.DARK_GREEN;
|
||||
case INVALID -> status += EnumChatFormatting.DARK_RED;
|
||||
}
|
||||
status += core.reactorState.toLocalizedString(core.canStart());
|
||||
fontRendererObj.drawString(status, xSize - 5 - fontRendererObj.getStringWidth(status), 125, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
|
||||
if (reactor.reactorState == TileReactorCore.STATE_INVALID || reactor.reactorState == TileReactorCore.STATE_OFFLINE || reactor.reactorState == TileReactorCore.STATE_STOP)
|
||||
collection.getComponent("DEACTIVATE").setEnabled(false);
|
||||
else collection.getComponent("DEACTIVATE").setEnabled(true);
|
||||
if ((reactor.reactorState == TileReactorCore.STATE_OFFLINE || (reactor.reactorState == TileReactorCore.STATE_STOP && !reactor.canStart())) && reactor.canCharge())
|
||||
collection.getComponent("CHARGE").setEnabled(true);
|
||||
else collection.getComponent("CHARGE").setEnabled(false);
|
||||
if ((reactor.reactorState == TileReactorCore.STATE_START || reactor.reactorState == TileReactorCore.STATE_STOP) && reactor.canStart())
|
||||
collection.getComponent("ACTIVATE").setEnabled(true);
|
||||
else collection.getComponent("ACTIVATE").setEnabled(false);
|
||||
collection.getComponent("DEACTIVATE")
|
||||
.setEnabled(core.reactorState == ReactorState.STARTING || core.reactorState == ReactorState.ONLINE);
|
||||
collection.getComponent("CHARGE").setEnabled(
|
||||
(core.reactorState == ReactorState.OFFLINE
|
||||
|| (core.reactorState == ReactorState.STOPPING && !core.canStart())) && core.canCharge());
|
||||
collection.getComponent("ACTIVATE").setEnabled(
|
||||
(core.reactorState == ReactorState.STARTING || core.reactorState == ReactorState.STOPPING)
|
||||
&& core.canStart());
|
||||
super.updateScreen();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buttonClicked(int id, int button) {
|
||||
super.buttonClicked(id, button);
|
||||
if (id < 3) container.sendObjectToServer(null, 20, id);
|
||||
else if (id == 3) {
|
||||
showStats = !showStats;
|
||||
((ComponentButton) collection.getComponent("STATS")).hoverText = showStats ? StatCollector.translateToLocal("button.de.statsHide.txt") : StatCollector.translateToLocal("button.de.statsShow.txt");
|
||||
if (id < 3) {
|
||||
container.sendObjectToServer(null, 20, id);
|
||||
} else if (id == 3) {
|
||||
showStatistics = !showStatistics;
|
||||
((ComponentButton) collection.getComponent("STATS")).hoverText = showStatistics
|
||||
? StatCollector.translateToLocal("button.de.statsHide.txt")
|
||||
: StatCollector.translateToLocal("button.de.statsShow.txt");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+126
-57
@@ -1,22 +1,10 @@
|
||||
package com.brandon3055.draconicevolution.client.gui.componentguis;
|
||||
|
||||
import com.brandon3055.brandonscore.client.gui.guicomponents.*;
|
||||
import com.brandon3055.brandonscore.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.brandonscore.common.utills.Utills;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.client.gui.GuiHudConfig;
|
||||
import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentConfigItemButton;
|
||||
import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentFieldAdjuster;
|
||||
import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentFieldButton;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerAdvTool;
|
||||
import com.brandon3055.draconicevolution.common.handler.ContributorHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.weapons.BowHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.network.ContributorPacket;
|
||||
import com.brandon3055.draconicevolution.common.network.ItemConfigPacket;
|
||||
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utills.IInventoryTool;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemConfigField;
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -25,8 +13,29 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.client.gui.GuiHudConfig;
|
||||
import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentConfigItemButton;
|
||||
import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentFieldAdjuster;
|
||||
import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentFieldButton;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentBase;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentButton;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentCollection;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentItemRenderer;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentTextField;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentTexturedRect;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.GUIBase;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerAdvTool;
|
||||
import com.brandon3055.draconicevolution.common.handler.ContributorHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.weapons.BowHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.weapons.IEnergyContainerBowItem;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.network.ContributorPacket;
|
||||
import com.brandon3055.draconicevolution.common.network.ItemConfigPacket;
|
||||
import com.brandon3055.draconicevolution.common.utils.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utils.IInventoryTool;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemConfigField;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 26/12/2014.
|
||||
@@ -34,7 +43,8 @@ import java.util.List;
|
||||
public class GUIToolConfig extends GUIBase {
|
||||
|
||||
public EntityPlayer player;
|
||||
private static final ResourceLocation inventoryTexture = new ResourceLocation(References.RESOURCESPREFIX + "textures/gui/ToolConfig.png");
|
||||
private static final ResourceLocation inventoryTexture = new ResourceLocation(
|
||||
References.RESOURCESPREFIX + "textures/gui/ToolConfig.png");
|
||||
private int screenLevel = 0;
|
||||
private ItemStack editingItem;
|
||||
private ContainerAdvTool container;
|
||||
@@ -48,20 +58,32 @@ public class GUIToolConfig extends GUIBase {
|
||||
addDependentComponents();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
if (ContributorHandler.contributors.containsKey(player.getCommandSenderName())) {
|
||||
ContributorHandler.Contributor contributor = ContributorHandler.contributors.get(player.getCommandSenderName());
|
||||
ContributorHandler.Contributor contributor = ContributorHandler.contributors
|
||||
.get(player.getCommandSenderName());
|
||||
if (!contributor.isUserValid(player)) return;
|
||||
|
||||
buttonList.clear();
|
||||
|
||||
if (contributor.contributionLevel >= 1)
|
||||
buttonList.add(new GuiButton(0, guiLeft - 150, guiTop, 150, 20, "Contributor Wings: " + (contributor.contributorWingsEnabled ? "Enabled" : "Disabled")));
|
||||
if (contributor.contribution.toLowerCase().contains("patreon"))
|
||||
buttonList.add(new GuiButton(1, guiLeft - 150, guiTop + 22, 150, 20, "Patreon Badge: " + (contributor.patreonBadgeEnabled ? "Enabled" : "Disabled")));
|
||||
if (contributor.contributionLevel >= 1) buttonList.add(
|
||||
new GuiButton(
|
||||
0,
|
||||
guiLeft - 150,
|
||||
guiTop,
|
||||
150,
|
||||
20,
|
||||
"Contributor Wings: " + (contributor.contributorWingsEnabled ? "Enabled" : "Disabled")));
|
||||
if (contributor.contribution.toLowerCase().contains("patreon")) buttonList.add(
|
||||
new GuiButton(
|
||||
1,
|
||||
guiLeft - 150,
|
||||
guiTop + 22,
|
||||
150,
|
||||
20,
|
||||
"Patreon Badge: " + (contributor.patreonBadgeEnabled ? "Enabled" : "Disabled")));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,20 +91,25 @@ public class GUIToolConfig extends GUIBase {
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
super.actionPerformed(button);
|
||||
if (ContributorHandler.contributors.containsKey(player.getCommandSenderName())) {
|
||||
ContributorHandler.Contributor contributor = ContributorHandler.contributors.get(player.getCommandSenderName());
|
||||
ContributorHandler.Contributor contributor = ContributorHandler.contributors
|
||||
.get(player.getCommandSenderName());
|
||||
if (!contributor.isUserValid(player)) return;
|
||||
|
||||
if (button.id == 0) {
|
||||
contributor.contributorWingsEnabled = !contributor.contributorWingsEnabled;
|
||||
button.displayString = "Contributor Wings: " + (contributor.contributorWingsEnabled ? "Enabled" : "Disabled");
|
||||
button.displayString = "Contributor Wings: "
|
||||
+ (contributor.contributorWingsEnabled ? "Enabled" : "Disabled");
|
||||
} else if (button.id == 1) {
|
||||
contributor.patreonBadgeEnabled = !contributor.patreonBadgeEnabled;
|
||||
button.displayString = "Patreon Badge: " + (contributor.patreonBadgeEnabled ? "Enabled" : "Disabled");
|
||||
}
|
||||
|
||||
DraconicEvolution.network.sendToServer(new ContributorPacket(player.getCommandSenderName(), contributor.contributorWingsEnabled, contributor.patreonBadgeEnabled));
|
||||
DraconicEvolution.network.sendToServer(
|
||||
new ContributorPacket(
|
||||
player.getCommandSenderName(),
|
||||
contributor.contributorWingsEnabled,
|
||||
contributor.patreonBadgeEnabled));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -90,13 +117,36 @@ public class GUIToolConfig extends GUIBase {
|
||||
ComponentCollection c = new ComponentCollection(0, 0, xSize, ySize, this).setOpenBoarders();
|
||||
c.addComponent(new ComponentTexturedRect(0, -15, 198, 20, inventoryTexture)).setGroup("TEXT_TAB");
|
||||
c.addComponent(new ComponentTexturedRect(0, 0, 198, 89, inventoryTexture)).setGroup("BACKGROUND");
|
||||
c.addComponent(new ComponentTexturedRect(0, 13, 0, 9, 198, 80, inventoryTexture, false)).setGroup("BACKGROUND_EXTENSION");
|
||||
c.addComponent(new ComponentButton(3, 26, 20, 12, 0, this, "<=", StatCollector.translateToLocal("gui.back"))).setGroup("BUTTONS").setName("BACK_BUTTON");
|
||||
c.addComponent(new ComponentButton(3, 39, 20, 12, 1, this, "Inv", StatCollector.translateToLocal("gui.de.itemInventory.txt"))).setGroup("BUTTONS").setName("INVENTORY_BUTTON");
|
||||
c.addComponent(new ComponentFieldAdjuster(4, 34, null, this)).setGroup("FIELD_BUTTONS").setName("FIELD_CONFIG_BUTTON_ARRAY");
|
||||
c.addComponent(new ComponentButton(0, ySize, xSize, 14, 2, this, StatCollector.translateToLocal("gui.de.configureGuiElements.txt")).setGroup("INV_SCREEN"));
|
||||
c.addComponent(new ComponentTexturedRect(0, 13, 0, 9, 198, 80, inventoryTexture, false))
|
||||
.setGroup("BACKGROUND_EXTENSION");
|
||||
c.addComponent(new ComponentButton(3, 26, 20, 12, 0, this, "<=", StatCollector.translateToLocal("gui.back")))
|
||||
.setGroup("BUTTONS").setName("BACK_BUTTON");
|
||||
c.addComponent(
|
||||
new ComponentButton(
|
||||
3,
|
||||
39,
|
||||
20,
|
||||
12,
|
||||
1,
|
||||
this,
|
||||
"Inv",
|
||||
StatCollector.translateToLocal("gui.de.itemInventory.txt")))
|
||||
.setGroup("BUTTONS").setName("INVENTORY_BUTTON");
|
||||
c.addComponent(new ComponentFieldAdjuster(4, 34, null, this)).setGroup("FIELD_BUTTONS")
|
||||
.setName("FIELD_CONFIG_BUTTON_ARRAY");
|
||||
c.addComponent(
|
||||
new ComponentButton(
|
||||
0,
|
||||
ySize,
|
||||
xSize,
|
||||
14,
|
||||
2,
|
||||
this,
|
||||
StatCollector.translateToLocal("gui.de.configureGuiElements.txt")).setGroup("INV_SCREEN"));
|
||||
|
||||
ComponentTextField textField = (ComponentTextField) new ComponentTextField(this, 3, -12, 191, 12).setLabel(StatCollector.translateToLocal("gui.de.profile.txt") + ":", 0xE0E0E0).setGroup("TEXT_TAB").setName("PROFILE_TEXT_FIELD");
|
||||
ComponentTextField textField = (ComponentTextField) new ComponentTextField(this, 3, -12, 191, 12)
|
||||
.setLabel(StatCollector.translateToLocal("gui.de.profile.txt") + ":", 0xE0E0E0).setGroup("TEXT_TAB")
|
||||
.setName("PROFILE_TEXT_FIELD");
|
||||
c.addComponent(textField);
|
||||
return c;
|
||||
}
|
||||
@@ -108,12 +158,14 @@ public class GUIToolConfig extends GUIBase {
|
||||
|
||||
for (int y = 0; y < 3; y++) {
|
||||
for (int x = 0; x < 9; x++) {
|
||||
collection.addComponent(new ComponentConfigItemButton(29 + 18 * x, 7 + y * 18, x + y * 9 + 9, player)).setGroup("INV_SCREEN");
|
||||
collection.addComponent(new ComponentConfigItemButton(29 + 18 * x, 7 + y * 18, x + y * 9 + 9, player))
|
||||
.setGroup("INV_SCREEN");
|
||||
}
|
||||
}
|
||||
|
||||
for (int y = 0; y < 4; y++) {
|
||||
collection.addComponent(new ComponentConfigItemButton(6, 7 + y * 19, 39 - y, player)).setGroup("INV_SCREEN");
|
||||
collection.addComponent(new ComponentConfigItemButton(6, 7 + y * 19, 39 - y, player))
|
||||
.setGroup("INV_SCREEN");
|
||||
}
|
||||
|
||||
setLevel(0);
|
||||
@@ -137,7 +189,9 @@ public class GUIToolConfig extends GUIBase {
|
||||
int fieldOffsetY = 5;
|
||||
|
||||
for (ComponentBase component : collection.getComponents()) {
|
||||
if (component.isEnabled() && component instanceof ComponentConfigItemButton && component.isMouseOver(x - this.guiLeft, y - this.guiTop) && ((ComponentConfigItemButton) component).hasValidItem) {
|
||||
if (component.isEnabled() && component instanceof ComponentConfigItemButton
|
||||
&& component.isMouseOver(x - this.guiLeft, y - this.guiTop)
|
||||
&& ((ComponentConfigItemButton) component).hasValidItem) {
|
||||
ItemStack stack = player.inventory.getStackInSlot(((ComponentConfigItemButton) component).slot);
|
||||
if (stack == null || !(stack.getItem() instanceof IConfigurableItem)) return;
|
||||
buttonPressed = true;
|
||||
@@ -146,7 +200,8 @@ public class GUIToolConfig extends GUIBase {
|
||||
setEditingItem(stack, ((ComponentConfigItemButton) component).slot);
|
||||
setLevel(1);
|
||||
for (ItemConfigField field : item.getFields(stack, ((ComponentConfigItemButton) component).slot)) {
|
||||
collection.addComponent(new ComponentFieldButton(fieldOffsetX, fieldOffsetY, player, field, this)).setGroup("LIST_SCREEN");
|
||||
collection.addComponent(new ComponentFieldButton(fieldOffsetX, fieldOffsetY, player, field, this))
|
||||
.setGroup("LIST_SCREEN");
|
||||
fieldOffsetY += 12;
|
||||
}
|
||||
|
||||
@@ -161,7 +216,8 @@ public class GUIToolConfig extends GUIBase {
|
||||
}
|
||||
}
|
||||
|
||||
if (collection.getComponent("PROFILE_TEXT_FIELD") instanceof ComponentTextField && !collection.getComponent("PROFILE_TEXT_FIELD").isMouseOver(x - guiLeft, y - guiTop)) {
|
||||
if (collection.getComponent("PROFILE_TEXT_FIELD") instanceof ComponentTextField
|
||||
&& !collection.getComponent("PROFILE_TEXT_FIELD").isMouseOver(x - guiLeft, y - guiTop)) {
|
||||
((ComponentTextField) collection.getComponent("PROFILE_TEXT_FIELD")).textField.setFocused(false);
|
||||
}
|
||||
}
|
||||
@@ -170,13 +226,13 @@ public class GUIToolConfig extends GUIBase {
|
||||
public void buttonClicked(int id, int button) {
|
||||
super.buttonClicked(id, button);
|
||||
|
||||
if (id == 0 && screenLevel > 0) {//button back
|
||||
if (id == 0 && screenLevel > 0) { // button back
|
||||
setLevel(screenLevel - 1);
|
||||
} else if (id == 1 && editingItem != null) {//inventory button
|
||||
} else if (id == 1 && editingItem != null) { // inventory button
|
||||
setLevel(3);
|
||||
Minecraft.getMinecraft().displayGuiScreen(new GUIToolInventory(player, container, this));
|
||||
// LogHelper.info("Pre send container " + Minecraft.getMinecraft().thePlayer.openContainer);
|
||||
// DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOLINVENTORY, false));
|
||||
// LogHelper.info("Pre send container " + Minecraft.getMinecraft().thePlayer.openContainer);
|
||||
// DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOLINVENTORY, false));
|
||||
} else if (id == 2) {
|
||||
Minecraft.getMinecraft().displayGuiScreen(new GuiHudConfig(this));
|
||||
}
|
||||
@@ -185,29 +241,30 @@ public class GUIToolConfig extends GUIBase {
|
||||
public void setLevel(int level) {
|
||||
this.screenLevel = level;
|
||||
|
||||
if (level == 0) {//inv screen
|
||||
if (level == 0) { // inv screen
|
||||
collection.schedulRemoval("LIST_SCREEN");
|
||||
collection.setOnlyGroupEnabled("INV_SCREEN");
|
||||
collection.setGroupEnabled("BACKGROUND", true);
|
||||
collection.setComponentEnabled("BACK_BUTTON", false);
|
||||
slot = -1;
|
||||
} else if (level == 1) {//list screen
|
||||
} else if (level == 1) { // list screen
|
||||
collection.setOnlyGroupEnabled("LIST_SCREEN");
|
||||
collection.setGroupEnabled("BACKGROUND", true);
|
||||
collection.setGroupEnabled("BACKGROUND_EXTENSION", true);
|
||||
if (editingItem != null && editingItem.getItem() instanceof IConfigurableItem && ((IConfigurableItem) editingItem.getItem()).hasProfiles())
|
||||
if (editingItem != null && editingItem.getItem() instanceof IConfigurableItem
|
||||
&& ((IConfigurableItem) editingItem.getItem()).hasProfiles())
|
||||
collection.setGroupEnabled("TEXT_TAB", true);
|
||||
collection.setComponentEnabled("BACK_BUTTON", true);
|
||||
if (editingItem != null && editingItem.getItem() instanceof IInventoryTool)
|
||||
collection.setComponentEnabled("INVENTORY_BUTTON", true);
|
||||
if (collection.getComponent("BACK_BUTTON") != null) collection.getComponent("BACK_BUTTON").setY(26);
|
||||
} else if (level == 2) {//field screen
|
||||
} else if (level == 2) { // field screen
|
||||
collection.setOnlyGroupEnabled("FIELD_BUTTONS");
|
||||
collection.setGroupEnabled("BACKGROUND", true);
|
||||
collection.setComponentEnabled("BACK_BUTTON", true);
|
||||
if (collection.getComponent("BACK_BUTTON") != null) collection.getComponent("BACK_BUTTON").setY(3);
|
||||
// slot = -1;
|
||||
} else if (level == 3) {//inventory screen
|
||||
// slot = -1;
|
||||
} else if (level == 3) { // inventory screen
|
||||
|
||||
}
|
||||
}
|
||||
@@ -230,7 +287,9 @@ public class GUIToolConfig extends GUIBase {
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char par1, int par2) {
|
||||
if (collection.getComponent("PROFILE_TEXT_FIELD") instanceof ComponentTextField && ((ComponentTextField) collection.getComponent("PROFILE_TEXT_FIELD")).isFocused() && par2 != 1) {
|
||||
if (collection.getComponent("PROFILE_TEXT_FIELD") instanceof ComponentTextField
|
||||
&& ((ComponentTextField) collection.getComponent("PROFILE_TEXT_FIELD")).isFocused()
|
||||
&& par2 != 1) {
|
||||
collection.keyTyped(par1, par2);
|
||||
return;
|
||||
}
|
||||
@@ -252,16 +311,26 @@ public class GUIToolConfig extends GUIBase {
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
|
||||
if (slot > -1) editingItem = player.inventory.getStackInSlot(slot);
|
||||
if (slot > -1 && editingItem != null && editingItem.getUnlocalizedName().toLowerCase().contains("bow")) {
|
||||
if (slot > -1 && editingItem != null && editingItem.getItem() instanceof IEnergyContainerBowItem) {
|
||||
BowHandler.BowProperties properties = new BowHandler.BowProperties(editingItem, player);
|
||||
|
||||
if (!properties.canFire() && properties.cantFireMessage != null && !properties.cantFireMessage.equals("msg.de.outOfArrows.name")) {
|
||||
fontRendererObj.drawSplitString(StatCollector.translateToLocal(properties.cantFireMessage), 0, ySize + 5, xSize, 0xFF0000);
|
||||
if (!properties.canFire() && properties.cantFireMessage != null
|
||||
&& !properties.cantFireMessage.equals("msg.de.outOfArrows.txt")) {
|
||||
fontRendererObj.drawSplitString(
|
||||
StatCollector.translateToLocal(properties.cantFireMessage),
|
||||
0,
|
||||
ySize + 5,
|
||||
xSize,
|
||||
0xFF0000);
|
||||
}
|
||||
|
||||
List<String> list = new ArrayList<String>();
|
||||
list.add(StatCollector.translateToLocal("gui.de.rfPerShot.txt") + ": " + Utills.addCommas(properties.calculateEnergyCost()));
|
||||
list.add(StatCollector.translateToLocal("gui.de.maxDamage.txt") + ": " + properties.arrowDamage * (properties.arrowSpeed * 3));
|
||||
list.add(
|
||||
StatCollector.translateToLocal("gui.de.rfPerShot.txt") + ": "
|
||||
+ formatNumber(properties.calculateEnergyCost()));
|
||||
list.add(
|
||||
StatCollector.translateToLocal("gui.de.maxDamage.txt") + ": "
|
||||
+ properties.arrowDamage * (properties.arrowSpeed * 3));
|
||||
drawHoveringText(list, xSize - 8, 0, fontRendererObj);
|
||||
}
|
||||
}
|
||||
|
||||
+16
-6
@@ -1,19 +1,27 @@
|
||||
package com.brandon3055.draconicevolution.client.gui.componentguis;
|
||||
|
||||
import com.brandon3055.brandonscore.client.gui.guicomponents.*;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerAdvTool;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentButton;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentCollection;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentItemRenderer;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentSlotBackground;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentTexturedRect;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.GUIBase;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerAdvTool;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 13/01/2015.
|
||||
*/
|
||||
public class GUIToolInventory extends GUIBase {
|
||||
|
||||
private static final ResourceLocation inventoryTexture = new ResourceLocation(References.RESOURCESPREFIX + "textures/gui/ToolConfig.png");
|
||||
private static final ResourceLocation inventoryTexture = new ResourceLocation(
|
||||
References.RESOURCESPREFIX + "textures/gui/ToolConfig.png");
|
||||
|
||||
private ContainerAdvTool container;
|
||||
private String inventoryName;
|
||||
@@ -43,7 +51,8 @@ public class GUIToolInventory extends GUIBase {
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
c.addComponent(new ComponentSlotBackground(172, 18 + i * 21)).setGroup("INVENTORY");
|
||||
c.addComponent(new ComponentTexturedRect(173, 20 + i * 21, 0, 89, 16, 14, inventoryTexture, true)).setGroup("INVENTORY");
|
||||
c.addComponent(new ComponentTexturedRect(173, 20 + i * 21, 0, 89, 16, 14, inventoryTexture, true))
|
||||
.setGroup("INVENTORY");
|
||||
}
|
||||
return c;
|
||||
}
|
||||
@@ -64,7 +73,8 @@ public class GUIToolInventory extends GUIBase {
|
||||
collection.addComponent(new ComponentSlotBackground(7 + x * 18, 18)).setGroup("INVENTORY");
|
||||
ComponentSlotBackground.addInventorySlots(collection, 7, 44, container.inventoryItemSlot);
|
||||
if (container.inventoryItemSlot > 35)
|
||||
collection.addComponent(new ComponentItemRenderer(6, 18, container.inventoryTool.inventoryItem)).setGroup("INVENTORY");
|
||||
collection.addComponent(new ComponentItemRenderer(6, 18, container.inventoryTool.inventoryItem))
|
||||
.setGroup("INVENTORY");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+15
-14
@@ -1,9 +1,11 @@
|
||||
package com.brandon3055.draconicevolution.client.gui.componentguis;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 7/03/2015.
|
||||
*/
|
||||
@@ -29,24 +31,23 @@ public class ManualPage {
|
||||
}
|
||||
|
||||
public String getImageResourceName(String url) {
|
||||
// try
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
LogHelper.info(url);
|
||||
return FilenameUtils.getName(url);
|
||||
//String fileName = new URL(url).getFile();
|
||||
//return fileName.substring(fileName.indexOf("/") + 1);
|
||||
// }
|
||||
// catch (MalformedURLException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// return "";
|
||||
// }
|
||||
// String fileName = new URL(url).getFile();
|
||||
// return fileName.substring(fileName.indexOf("/") + 1);
|
||||
// }
|
||||
// catch (MalformedURLException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// return "";
|
||||
// }
|
||||
}
|
||||
|
||||
public String getLocalizedName() {
|
||||
if (nameL != null) return nameL;
|
||||
return (name.contains("item.") || name.contains("tile.")) ? StatCollector.translateToLocal(name + ".name") : name.contains("info.") ? name.substring(name.indexOf("info.") + 5) : "Invalid Name Data";
|
||||
return (name.contains("item.") || name.contains("tile.")) ? StatCollector.translateToLocal(name + ".name")
|
||||
: name.contains("info.") ? name.substring(name.indexOf("info.") + 5) : "Invalid Name Data";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+20
-15
@@ -1,25 +1,27 @@
|
||||
package com.brandon3055.draconicevolution.client.gui.guicomponents;
|
||||
|
||||
import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentBase;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utills.IInventoryTool;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemConfigField;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentBase;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utils.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utils.IInventoryTool;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemConfigField;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 29/12/2014.
|
||||
*/
|
||||
public class ComponentConfigItemButton extends ComponentBase {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(References.RESOURCESPREFIX + "textures/gui/Widgets.png");
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
References.RESOURCESPREFIX + "textures/gui/Widgets.png");
|
||||
public int slot;
|
||||
private InventoryPlayer inventory;
|
||||
public boolean hasValidItem = false;
|
||||
@@ -32,7 +34,11 @@ public class ComponentConfigItemButton extends ComponentBase {
|
||||
}
|
||||
|
||||
public void refreshState() {
|
||||
hasValidItem = (inventory.getStackInSlot(slot) != null && ((inventory.getStackInSlot(slot).getItem() instanceof IConfigurableItem && !((IConfigurableItem) inventory.getStackInSlot(slot).getItem()).getFields(inventory.getStackInSlot(slot), slot).isEmpty()) || inventory.getStackInSlot(slot).getItem() instanceof IInventoryTool));
|
||||
hasValidItem = (inventory.getStackInSlot(slot) != null
|
||||
&& ((inventory.getStackInSlot(slot).getItem() instanceof IConfigurableItem
|
||||
&& !((IConfigurableItem) inventory.getStackInSlot(slot).getItem())
|
||||
.getFields(inventory.getStackInSlot(slot), slot).isEmpty())
|
||||
|| inventory.getStackInSlot(slot).getItem() instanceof IInventoryTool));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -58,18 +64,16 @@ public class ComponentConfigItemButton extends ComponentBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
|
||||
}
|
||||
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {}
|
||||
|
||||
@Override
|
||||
public void renderFinal(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
if (isMouseOver(mouseX, mouseY) && hasValidItem) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
List<ItemConfigField> fields = ((IConfigurableItem) inventory.getStackInSlot(slot).getItem()).getFields(inventory.getStackInSlot(slot), slot);
|
||||
List<ItemConfigField> fields = ((IConfigurableItem) inventory.getStackInSlot(slot).getItem())
|
||||
.getFields(inventory.getStackInSlot(slot), slot);
|
||||
for (ItemConfigField field : fields) {
|
||||
list.add(field.getLocalizedName() + ": " + field.getFormattedValue());
|
||||
|
||||
}
|
||||
drawHoveringText(list, mouseX + offsetX, mouseY + offsetY + 10, fontRendererObj);
|
||||
}
|
||||
@@ -78,7 +82,8 @@ public class ComponentConfigItemButton extends ComponentBase {
|
||||
@Override
|
||||
public void mouseClicked(int x, int y, int button) {
|
||||
if (hasValidItem) {
|
||||
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
Minecraft.getMinecraft().getSoundHandler()
|
||||
.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
}
|
||||
}
|
||||
}
|
||||
+43
-27
@@ -1,12 +1,10 @@
|
||||
package com.brandon3055.draconicevolution.client.gui.guicomponents;
|
||||
|
||||
import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentScrollingBase;
|
||||
import com.brandon3055.brandonscore.client.gui.guicomponents.GUIScrollingBase;
|
||||
import com.brandon3055.brandonscore.client.utills.ClientUtills;
|
||||
import com.brandon3055.brandonscore.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.handler.ContributorHandler;
|
||||
import com.brandon3055.draconicevolution.common.handler.ContributorHandler.Contributor;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.gui.GuiConfirmOpenLink;
|
||||
@@ -16,12 +14,16 @@ import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.StringUtils;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.utils.ClientUtils;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentScrollingBase;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.GUIScrollingBase;
|
||||
import com.brandon3055.draconicevolution.common.handler.ContributorHandler;
|
||||
import com.brandon3055.draconicevolution.common.handler.ContributorHandler.Contributor;
|
||||
import com.brandon3055.draconicevolution.common.utils.InfoHelper;
|
||||
|
||||
/**
|
||||
* Created by brandon3055 on 5/11/2015.
|
||||
@@ -41,12 +43,11 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
|
||||
|
||||
@Override
|
||||
public void handleScrollInput(int direction) {
|
||||
// page.scrollOffset += direction * 10;
|
||||
// page.scrollOffset += direction * 10;
|
||||
scrollOffset += direction * (InfoHelper.isShiftKeyDown() ? 30 : 10);
|
||||
if (scrollOffset < 0) scrollOffset = 0;
|
||||
if (scrollOffset > pageLength - getHeight()) scrollOffset = pageLength - getHeight();
|
||||
if (pageLength <= getHeight()) scrollOffset = 0;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -66,7 +67,12 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
|
||||
yOffset += 20;
|
||||
|
||||
if (yOffset > 0) {
|
||||
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("info.de.manual.contributors.txt"), getWidth() / 2, yOffset, 0x00FFFF);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("info.de.manual.contributors.txt"),
|
||||
getWidth() / 2,
|
||||
yOffset,
|
||||
0x00FFFF);
|
||||
}
|
||||
|
||||
yOffset += 10;
|
||||
@@ -79,7 +85,10 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
|
||||
|
||||
if (!(yOffset > 25 && yOffset < 324)) continue;
|
||||
|
||||
if (mouseX > 15 && mouseX < 245 && mouseY < yOffset + 5 && mouseY > yOffset - 25 && !patreonButtonHighlighted) {
|
||||
if (mouseX > 15 && mouseX < 245
|
||||
&& mouseY < yOffset + 5
|
||||
&& mouseY > yOffset - 25
|
||||
&& !patreonButtonHighlighted) {
|
||||
ResourceHandler.bindResource("textures/gui/manualTop.png");
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glColor4f(0F, 0F, 0F, 0.4F);
|
||||
@@ -94,8 +103,10 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
|
||||
renderPlayer(contributor.ign);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
fontRendererObj.drawStringWithShadow(EnumChatFormatting.GOLD + contributor.name, 50, yOffset - 20, 0x000000);
|
||||
fontRendererObj.drawString(EnumChatFormatting.DARK_BLUE + contributor.contribution, 50, yOffset - 10, 0x000000);
|
||||
fontRendererObj
|
||||
.drawStringWithShadow(EnumChatFormatting.GOLD + contributor.name, 50, yOffset - 20, 0x000000);
|
||||
fontRendererObj
|
||||
.drawString(EnumChatFormatting.DARK_BLUE + contributor.contribution, 50, yOffset - 10, 0x000000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +122,10 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
|
||||
|
||||
if (!(yOffset > 20 && yOffset < 330)) continue;
|
||||
|
||||
if (mouseX > 15 && mouseX < 245 && mouseY < yOffset + 5 && mouseY > yOffset - 25 && !patreonButtonHighlighted) {
|
||||
if (mouseX > 15 && mouseX < 245
|
||||
&& mouseY < yOffset + 5
|
||||
&& mouseY > yOffset - 25
|
||||
&& !patreonButtonHighlighted) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
list.add(EnumChatFormatting.GOLD + contributor.contribution);
|
||||
|
||||
@@ -129,21 +143,21 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
|
||||
if (!StringUtils.isNullOrEmpty(contributor.website)) {
|
||||
list.add("");
|
||||
list.add("Website: " + EnumChatFormatting.BLUE + contributor.website);
|
||||
list.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("info.de.manual.clickToGoToSite.txt"));
|
||||
list.add(
|
||||
EnumChatFormatting.GRAY
|
||||
+ StatCollector.translateToLocal("info.de.manual.clickToGoToSite.txt"));
|
||||
}
|
||||
|
||||
drawHoveringText(list, offsetX - 7, offsetY + yOffset + 20, fontRendererObj);
|
||||
}
|
||||
}
|
||||
|
||||
if (!ContributorHandler.successfulLoad)
|
||||
fontRendererObj.drawString("[Error] Failed to download contributors list", offsetX + 20, offsetY + 40, 0xFF0000);
|
||||
if (!ContributorHandler.successfulLoad) fontRendererObj
|
||||
.drawString("[Error] Failed to download contributors list", offsetX + 20, offsetY + 40, 0xFF0000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
|
||||
}
|
||||
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {}
|
||||
|
||||
private String lastClickURL = "";
|
||||
|
||||
@@ -161,7 +175,10 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
|
||||
|
||||
if (!(yOffset > 20 && yOffset < 330) || patreonButtonHighlighted) continue;
|
||||
|
||||
if (x > 15 && x < 245 && y < yOffset + 5 && y > yOffset - 25 && !StringUtils.isNullOrEmpty(contributor.website)) {
|
||||
if (x > 15 && x < 245
|
||||
&& y < yOffset + 5
|
||||
&& y > yOffset - 25
|
||||
&& !StringUtils.isNullOrEmpty(contributor.website)) {
|
||||
lastClickURL = contributor.website;
|
||||
mc.displayGuiScreen(new GuiConfirmOpenLink(this, contributor.website, 0, true));
|
||||
}
|
||||
@@ -171,7 +188,7 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
|
||||
@Override
|
||||
public void confirmClicked(boolean confirmed, int button) {
|
||||
mc.displayGuiScreen(this.gui);
|
||||
if (confirmed) ClientUtills.openLink(lastClickURL);
|
||||
if (confirmed) ClientUtils.openLink(lastClickURL);
|
||||
}
|
||||
|
||||
private static ModelBiped modelBiped = new ModelBiped(0.0265F);
|
||||
@@ -200,5 +217,4 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
|
||||
if (!skinCache.containsKey(username)) return AbstractClientPlayer.locationStevePng;
|
||||
return skinCache.get(username);
|
||||
}
|
||||
|
||||
}
|
||||
+92
-33
@@ -1,23 +1,26 @@
|
||||
package com.brandon3055.draconicevolution.client.gui.guicomponents;
|
||||
|
||||
import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentBase;
|
||||
import com.brandon3055.brandonscore.client.utills.GuiHelper;
|
||||
import com.brandon3055.brandonscore.common.utills.DataUtills;
|
||||
import com.brandon3055.draconicevolution.client.gui.componentguis.GUIToolConfig;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemConfigField;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.gui.componentguis.GUIToolConfig;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentBase;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utils.DataUtils;
|
||||
import com.brandon3055.draconicevolution.common.utils.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemConfigField;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 1/01/2015.
|
||||
*/
|
||||
public class ComponentFieldAdjuster extends ComponentBase {
|
||||
private static final ResourceLocation widgets = new ResourceLocation(References.RESOURCESPREFIX + "textures/gui/Widgets.png");
|
||||
|
||||
private static final ResourceLocation widgets = new ResourceLocation(
|
||||
References.RESOURCESPREFIX + "textures/gui/Widgets.png");
|
||||
protected static final ResourceLocation buttonTextures = new ResourceLocation("textures/gui/widgets.png");
|
||||
|
||||
public ItemConfigField field;
|
||||
@@ -45,15 +48,50 @@ public class ComponentFieldAdjuster extends ComponentBase {
|
||||
minecraft.getTextureManager().bindTexture(buttonTextures);
|
||||
|
||||
if (isBoolean()) {
|
||||
renderButton((getWidth() / 2) - 30, 0, 60, 20, GuiHelper.isInRect(x + (getWidth() / 2) - 30, y, 60, 20, mouseX - offsetX, mouseY - offsetY));
|
||||
renderButton(
|
||||
(getWidth() / 2) - 30,
|
||||
0,
|
||||
60,
|
||||
20,
|
||||
GuiHelper.isInRect(x + (getWidth() / 2) - 30, y, 60, 20, mouseX - offsetX, mouseY - offsetY));
|
||||
} else if (isDecimal() || isNonDecimal()) {
|
||||
renderButton((getWidth() / 2) - 43, 3, 24, 14, GuiHelper.isInRect(x + (getWidth() / 2) - 43, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
|
||||
renderButton((getWidth() / 2) - 69, 3, 24, 14, GuiHelper.isInRect(x + (getWidth() / 2) - 69, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
|
||||
renderButton((getWidth() / 2) - 95, 3, 24, 14, GuiHelper.isInRect(x + (getWidth() / 2) - 95, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
|
||||
renderButton(
|
||||
(getWidth() / 2) - 43,
|
||||
3,
|
||||
24,
|
||||
14,
|
||||
GuiHelper.isInRect(x + (getWidth() / 2) - 43, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
|
||||
renderButton(
|
||||
(getWidth() / 2) - 69,
|
||||
3,
|
||||
24,
|
||||
14,
|
||||
GuiHelper.isInRect(x + (getWidth() / 2) - 69, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
|
||||
renderButton(
|
||||
(getWidth() / 2) - 95,
|
||||
3,
|
||||
24,
|
||||
14,
|
||||
GuiHelper.isInRect(x + (getWidth() / 2) - 95, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
|
||||
|
||||
renderButton((getWidth() / 2) + 19, 3, 24, 14, GuiHelper.isInRect(x + (getWidth() / 2) + 19, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
|
||||
renderButton((getWidth() / 2) + 45, 3, 24, 14, GuiHelper.isInRect(x + (getWidth() / 2) + 45, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
|
||||
renderButton((getWidth() / 2) + 71, 3, 24, 14, GuiHelper.isInRect(x + (getWidth() / 2) + 71, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
|
||||
renderButton(
|
||||
(getWidth() / 2) + 19,
|
||||
3,
|
||||
24,
|
||||
14,
|
||||
GuiHelper.isInRect(x + (getWidth() / 2) + 19, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
|
||||
renderButton(
|
||||
(getWidth() / 2) + 45,
|
||||
3,
|
||||
24,
|
||||
14,
|
||||
GuiHelper.isInRect(x + (getWidth() / 2) + 45, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
|
||||
renderButton(
|
||||
(getWidth() / 2) + 71,
|
||||
3,
|
||||
24,
|
||||
14,
|
||||
GuiHelper.isInRect(x + (getWidth() / 2) + 71, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,16 +104,20 @@ public class ComponentFieldAdjuster extends ComponentBase {
|
||||
double d = (Double) field.value;
|
||||
fieldValue = String.valueOf((double) Math.round(d * 100f) / 100D);
|
||||
}
|
||||
//if (field.datatype == References.FLOAT_ID) {
|
||||
// float d = (Float)field.value;
|
||||
// fieldValue = String.valueOf((double)Math.round((double)(d*100f)) / 100D);
|
||||
//}
|
||||
// if (field.datatype == References.FLOAT_ID) {
|
||||
// float d = (Float)field.value;
|
||||
// fieldValue = String.valueOf((double)Math.round((double)(d*100f)) / 100D);
|
||||
// }
|
||||
|
||||
int centre = fontRendererObj.getStringWidth(fieldName) / 2;
|
||||
fontRendererObj.drawString(fieldName, x + getWidth() / 2 - centre, y - 12, 0x00000);
|
||||
drawCenteredString(fontRendererObj, fieldValue, x + getWidth() / 2, y + 6, 0xffffff);
|
||||
if (field.modifier == null || field.modifier.equals("AOE"))
|
||||
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("gui.de.max.txt") + " " + field.getMaxFormattedValue(), x + getWidth() / 2, y + 20, 0xFFFFFF);
|
||||
if (field.modifier == null || field.modifier.equals("AOE")) drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("gui.de.max.txt") + " " + field.getMaxFormattedValue(),
|
||||
x + getWidth() / 2,
|
||||
y + 20,
|
||||
0xFFFFFF);
|
||||
|
||||
if (isDecimal() || isNonDecimal()) {
|
||||
fontRendererObj.drawString("---", 7, y + 6, 0x000000);
|
||||
@@ -84,7 +126,6 @@ public class ComponentFieldAdjuster extends ComponentBase {
|
||||
fontRendererObj.drawString("+", 127, y + 6, 0x000000);
|
||||
fontRendererObj.drawString("++", 151, y + 6, 0x000000);
|
||||
fontRendererObj.drawString("+++", 174, y + 6, 0x000000);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,17 +139,17 @@ public class ComponentFieldAdjuster extends ComponentBase {
|
||||
if (field == null) return;
|
||||
|
||||
if (!isBoolean()) {
|
||||
if (GuiHelper.isInRect(this.x + (getWidth() / 2) - 43, this.y + 3, 26, 14, x, y)) {//-
|
||||
if (GuiHelper.isInRect(this.x + (getWidth() / 2) - 43, this.y + 3, 26, 14, x, y)) { // -
|
||||
incroment(-1);
|
||||
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) - 69, this.y + 3, 26, 14, x, y)) {//--
|
||||
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) - 69, this.y + 3, 26, 14, x, y)) { // --
|
||||
incroment(-10);
|
||||
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) - 95, this.y + 3, 26, 14, x, y)) {//---
|
||||
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) - 95, this.y + 3, 26, 14, x, y)) { // ---
|
||||
incroment(-100);
|
||||
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) + 19, this.y + 3, 26, 14, x, y)) {//+
|
||||
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) + 19, this.y + 3, 26, 14, x, y)) { // +
|
||||
incroment(1);
|
||||
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) + 45, this.y + 3, 26, 14, x, y)) {//++
|
||||
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) + 45, this.y + 3, 26, 14, x, y)) { // ++
|
||||
incroment(10);
|
||||
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) + 71, this.y + 3, 26, 14, x, y)) {//+++
|
||||
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) + 71, this.y + 3, 26, 14, x, y)) { // +++
|
||||
incroment(100);
|
||||
}
|
||||
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) - 30, this.y, 60, 20, x, y)) {
|
||||
@@ -167,10 +208,15 @@ public class ComponentFieldAdjuster extends ComponentBase {
|
||||
field.value = !(Boolean) field.value;
|
||||
break;
|
||||
}
|
||||
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
Minecraft.getMinecraft().getSoundHandler()
|
||||
.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
ItemStack stack = gui.player.inventory.getStackInSlot(field.slot);
|
||||
if (stack != null && stack.getItem() instanceof IConfigurableItem) {
|
||||
DataUtills.writeObjectToCompound(IConfigurableItem.ProfileHelper.getProfileCompound(stack), field.value, field.datatype, field.name);
|
||||
DataUtils.writeObjectToCompound(
|
||||
IConfigurableItem.ProfileHelper.getProfileCompound(stack),
|
||||
field.value,
|
||||
field.datatype,
|
||||
field.name);
|
||||
}
|
||||
field.sendChanges();
|
||||
}
|
||||
@@ -181,11 +227,23 @@ public class ComponentFieldAdjuster extends ComponentBase {
|
||||
int y = this.y + offsetY;
|
||||
|
||||
this.drawTexturedModalRect(x, y, 0, 46 + k * 20, xSize / 2, 20 - Math.max(0, 20 - ySize));
|
||||
this.drawTexturedModalRect(x + xSize / 2, y, 200 - xSize / 2, 46 + k * 20, xSize / 2, 20 - Math.max(0, 20 - ySize));
|
||||
this.drawTexturedModalRect(
|
||||
x + xSize / 2,
|
||||
y,
|
||||
200 - xSize / 2,
|
||||
46 + k * 20,
|
||||
xSize / 2,
|
||||
20 - Math.max(0, 20 - ySize));
|
||||
|
||||
if (ySize < 20) {
|
||||
this.drawTexturedModalRect(x, y + 3, 0, (46 + k * 20) + 20 - ySize + 3, xSize - 1, ySize - 3);
|
||||
this.drawTexturedModalRect(x + xSize / 2, y + 3, 200 - xSize / 2, (46 + k * 20) + 20 - ySize + 3, xSize / 2, ySize - 3);
|
||||
this.drawTexturedModalRect(
|
||||
x + xSize / 2,
|
||||
y + 3,
|
||||
200 - xSize / 2,
|
||||
(46 + k * 20) + 20 - ySize + 3,
|
||||
xSize / 2,
|
||||
ySize - 3);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +252,8 @@ public class ComponentFieldAdjuster extends ComponentBase {
|
||||
}
|
||||
|
||||
private boolean isNonDecimal() {
|
||||
return field.datatype == References.INT_ID || field.datatype == References.SHORT_ID || field.datatype == References.BYTE_ID;
|
||||
return field.datatype == References.INT_ID || field.datatype == References.SHORT_ID
|
||||
|| field.datatype == References.BYTE_ID;
|
||||
}
|
||||
|
||||
private boolean isDecimal() {
|
||||
|
||||
+24
-13
@@ -1,26 +1,28 @@
|
||||
package com.brandon3055.draconicevolution.client.gui.guicomponents;
|
||||
|
||||
import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentBase;
|
||||
import com.brandon3055.draconicevolution.client.gui.componentguis.GUIToolConfig;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.brandonscore.common.utills.DataUtills;
|
||||
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemConfigField;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.brandon3055.draconicevolution.client.gui.componentguis.GUIToolConfig;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentBase;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utils.DataUtils;
|
||||
import com.brandon3055.draconicevolution.common.utils.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemConfigField;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 31/12/2014.
|
||||
*/
|
||||
public class ComponentFieldButton extends ComponentBase {
|
||||
|
||||
private static final ResourceLocation widgets = new ResourceLocation(References.RESOURCESPREFIX + "textures/gui/Widgets.png");
|
||||
private static final ResourceLocation widgets = new ResourceLocation(
|
||||
References.RESOURCESPREFIX + "textures/gui/Widgets.png");
|
||||
|
||||
public EntityPlayer player;
|
||||
public int slot;
|
||||
@@ -68,10 +70,14 @@ public class ComponentFieldButton extends ComponentBase {
|
||||
|
||||
@Override
|
||||
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
drawString(fontRendererObj, field.getLocalizedName(), x + offsetX + 2, y + offsetY + (getHeight() / 2) - (fontRendererObj.FONT_HEIGHT / 2), 0xffffff);
|
||||
drawString(
|
||||
fontRendererObj,
|
||||
field.getLocalizedName(),
|
||||
x + offsetX + 2,
|
||||
y + offsetY + (getHeight() / 2) - (fontRendererObj.FONT_HEIGHT / 2),
|
||||
0xffffff);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void renderFinal(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
if (isMouseOver(mouseX, mouseY)) {
|
||||
@@ -83,13 +89,18 @@ public class ComponentFieldButton extends ComponentBase {
|
||||
|
||||
@Override
|
||||
public void mouseClicked(int x, int y, int button) {
|
||||
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
Minecraft.getMinecraft().getSoundHandler()
|
||||
.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
if (field.datatype == References.BOOLEAN_ID) {
|
||||
field.value = !(Boolean) field.value;
|
||||
field.sendChanges();
|
||||
ItemStack stack = gui.player.inventory.getStackInSlot(field.slot);
|
||||
if (stack != null && stack.getItem() instanceof IConfigurableItem) {
|
||||
DataUtills.writeObjectToCompound(IConfigurableItem.ProfileHelper.getProfileCompound(stack), field.value, field.datatype, field.name);
|
||||
DataUtils.writeObjectToCompound(
|
||||
IConfigurableItem.ProfileHelper.getProfileCompound(stack),
|
||||
field.value,
|
||||
field.datatype,
|
||||
field.name);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
+10
-11
@@ -1,15 +1,17 @@
|
||||
package com.brandon3055.draconicevolution.client.gui.guicomponents;
|
||||
|
||||
import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentScrollingBase;
|
||||
import com.brandon3055.brandonscore.client.gui.guicomponents.GUIScrollingBase;
|
||||
import com.brandon3055.draconicevolution.client.gui.componentguis.ManualPage;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.brandonscore.common.utills.Utills;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.gui.componentguis.ManualPage;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentScrollingBase;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.GUIScrollingBase;
|
||||
import com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 7/03/2015.
|
||||
*/
|
||||
@@ -21,12 +23,12 @@ public class ComponentIndexButton extends ComponentScrollingBase {
|
||||
public ComponentIndexButton(int x, int y, GUIScrollingBase gui, ManualPage page) {
|
||||
super(x, y, gui);
|
||||
this.page = page;
|
||||
stack = Utills.getStackFromName(page.name, page.meta);
|
||||
stack = Utils.getStackFromName(page.name, page.meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleScrollInput(int direction) {
|
||||
//this.y += direction * 10;
|
||||
// this.y += direction * 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,7 +50,6 @@ public class ComponentIndexButton extends ComponentScrollingBase {
|
||||
fontRendererObj.drawString(page.getLocalizedName(), x + 19, sy, mouseOver ? 0xdd00ff : 0x000000);
|
||||
ResourceHandler.bindResource("textures/gui/Widgets.png");
|
||||
|
||||
|
||||
GL11.glColor4f(1f, 1f, 1f, 1f);
|
||||
if (mouseOver) {
|
||||
GL11.glColor4f(0f, 1f, 1f, 1f);
|
||||
@@ -57,7 +58,6 @@ public class ComponentIndexButton extends ComponentScrollingBase {
|
||||
|
||||
if (stack != null && stack.getItem() != null) drawItemStack(stack, x, sy, "");
|
||||
else drawItemStack(new ItemStack(Items.writable_book), x, sy, "");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,8 +67,7 @@ public class ComponentIndexButton extends ComponentScrollingBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
}
|
||||
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {}
|
||||
|
||||
public ManualPage getPage() {
|
||||
return page;
|
||||
|
||||
+67
-40
@@ -1,33 +1,40 @@
|
||||
package com.brandon3055.draconicevolution.client.gui.guicomponents;
|
||||
|
||||
import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentScrollingBase;
|
||||
import com.brandon3055.brandonscore.client.gui.guicomponents.GUIScrollingBase;
|
||||
import com.brandon3055.brandonscore.client.utills.GuiHelper;
|
||||
import com.brandon3055.brandonscore.common.utills.InfoHelper;
|
||||
import com.brandon3055.brandonscore.common.utills.Utills;
|
||||
import com.brandon3055.draconicevolution.client.gui.componentguis.ManualPage;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.utill.CustomResourceLocation;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.*;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.ShapedRecipes;
|
||||
import net.minecraft.item.crafting.ShapelessRecipes;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.gui.componentguis.ManualPage;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.utils.CustomResourceLocation;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentScrollingBase;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.GUIScrollingBase;
|
||||
import com.brandon3055.draconicevolution.common.utils.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 19/03/2015.
|
||||
*/
|
||||
public class ComponentManualPage extends ComponentScrollingBase {
|
||||
|
||||
public ManualPage page;
|
||||
public List<ContentComponent> contentList = new ArrayList<ContentComponent>();
|
||||
private int pageLength = 0;
|
||||
@@ -41,7 +48,7 @@ public class ComponentManualPage extends ComponentScrollingBase {
|
||||
super(x, y, gui);
|
||||
this.page = page;
|
||||
pageLength = 25;
|
||||
stack = Utills.getStackFromName(page.name, page.meta);
|
||||
stack = Utils.getStackFromName(page.name, page.meta);
|
||||
ContentComponent title = new ContentComponent("title." + page.getLocalizedName(), pageLength, this);
|
||||
pageLength += title.getHeight();
|
||||
contentList.add(title);
|
||||
@@ -57,7 +64,7 @@ public class ComponentManualPage extends ComponentScrollingBase {
|
||||
|
||||
@Override
|
||||
public void handleScrollInput(int direction) {
|
||||
// scrollOffset += direction * 10;
|
||||
// scrollOffset += direction * 10;
|
||||
scrollOffset += direction * (InfoHelper.isShiftKeyDown() ? 30 : 10);
|
||||
if (scrollOffset < 0) scrollOffset = 0;
|
||||
if (scrollOffset > pageLength - getHeight()) scrollOffset = pageLength - getHeight();
|
||||
@@ -83,13 +90,10 @@ public class ComponentManualPage extends ComponentScrollingBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderFinal(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
}
|
||||
public void renderFinal(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {}
|
||||
|
||||
@Override
|
||||
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
|
||||
}
|
||||
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {}
|
||||
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
@@ -104,6 +108,7 @@ public class ComponentManualPage extends ComponentScrollingBase {
|
||||
* 0 = text, 1 = image, 2 = crafting
|
||||
*/
|
||||
private int type;
|
||||
|
||||
public int yPos;
|
||||
private ComponentManualPage page;
|
||||
private String[] textLines;
|
||||
@@ -152,7 +157,7 @@ public class ComponentManualPage extends ComponentScrollingBase {
|
||||
} else if (type == 2) {
|
||||
String s = content.substring(content.indexOf("[c]") + 3);
|
||||
String name = s.substring(0, s.lastIndexOf(":"));
|
||||
ItemStack stack = Utills.getStackFromName(name, Integer.parseInt(s.substring(s.lastIndexOf(":") + 1)));
|
||||
ItemStack stack = Utils.getStackFromName(name, Integer.parseInt(s.substring(s.lastIndexOf(":") + 1)));
|
||||
result = stack;
|
||||
|
||||
if (stack != null) {
|
||||
@@ -183,14 +188,18 @@ public class ComponentManualPage extends ComponentScrollingBase {
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
if (type == 1 && (ResourceHandler.downloadedImages.containsKey(FilenameUtils.getName(content)) || (slide && ResourceHandler.downloadedImages.containsKey(FilenameUtils.getName(content))))) {
|
||||
CustomResourceLocation texture = slide ? ResourceHandler.downloadedImages.get(FilenameUtils.getName(content)) : ResourceHandler.downloadedImages.get(FilenameUtils.getName(content));
|
||||
if (type == 1 && (ResourceHandler.downloadedImages.containsKey(FilenameUtils.getName(content))
|
||||
|| (slide && ResourceHandler.downloadedImages.containsKey(FilenameUtils.getName(content))))) {
|
||||
CustomResourceLocation texture = slide
|
||||
? ResourceHandler.downloadedImages.get(FilenameUtils.getName(content))
|
||||
: ResourceHandler.downloadedImages.get(FilenameUtils.getName(content));
|
||||
return (int) ((double) texture.getHeight() / (double) texture.getWidth() * 220D) + 5;
|
||||
} else if (type == 2) {
|
||||
return (recipes.size() + smeltingRecipes.size()) * 57;
|
||||
}
|
||||
|
||||
return ((textLines != null ? textLines.length * 10 : 10) + 5) + ((isTitle && (page.page.name.contains("tile.") || page.page.name.contains("item."))) ? 18 : 0);
|
||||
return ((textLines != null ? textLines.length * 10 : 10) + 5)
|
||||
+ ((isTitle && (page.page.name.contains("tile.") || page.page.name.contains("item."))) ? 18 : 0);
|
||||
}
|
||||
|
||||
public void render(int mouseX, int mouseY) {
|
||||
@@ -203,7 +212,12 @@ public class ComponentManualPage extends ComponentScrollingBase {
|
||||
} else if (isTitle) {
|
||||
int y = yPos - page.scrollOffset;
|
||||
if (y > 310 || y < 5) return;
|
||||
page.drawCenteredString(page.fontRendererObj, content.substring(content.indexOf("title.") + 6), 128, y, 0x00ffff);
|
||||
page.drawCenteredString(
|
||||
page.fontRendererObj,
|
||||
content.substring(content.indexOf("title.") + 6),
|
||||
128,
|
||||
y,
|
||||
0x00ffff);
|
||||
|
||||
if ((page.page.name.contains("tile.") || page.page.name.contains("item.")) && page.stack != null) {
|
||||
ResourceHandler.bindResource("textures/gui/Widgets.png");
|
||||
@@ -221,17 +235,21 @@ public class ComponentManualPage extends ComponentScrollingBase {
|
||||
}
|
||||
|
||||
private void renderImage() {
|
||||
CustomResourceLocation image = null;//slide ? ResourceHandler.downloadedImages.get(slides.get(page.slideTick % slides.size() - 1)) : ResourceHandler.downloadedImages.get(content);
|
||||
CustomResourceLocation image = null; // slide ?
|
||||
// ResourceHandler.downloadedImages.get(slides.get(page.slideTick %
|
||||
// slides.size() -
|
||||
// 1)) : ResourceHandler.downloadedImages.get(content);
|
||||
if (slide) {
|
||||
int index = (page.slideTick / 20) % (slides.size());
|
||||
image = (slides.size() > index) ? ResourceHandler.downloadedImages.get(FilenameUtils.getName(slides.get(index))) : null;
|
||||
image = (slides.size() > index)
|
||||
? ResourceHandler.downloadedImages.get(FilenameUtils.getName(slides.get(index)))
|
||||
: null;
|
||||
} else if (ResourceHandler.downloadedImages.containsKey(FilenameUtils.getName(content))) {
|
||||
image = ResourceHandler.downloadedImages.get(FilenameUtils.getName(content));
|
||||
}
|
||||
|
||||
|
||||
if (image != null) {
|
||||
//CustomResourceLocation image = ResourceHandler.downloadedImages.get(content);
|
||||
// CustomResourceLocation image = ResourceHandler.downloadedImages.get(content);
|
||||
image.bind();
|
||||
Tessellator tess = Tessellator.instance;
|
||||
|
||||
@@ -286,7 +304,13 @@ public class ComponentManualPage extends ComponentScrollingBase {
|
||||
|
||||
if (y + yDown + posY < 0 || y + yDown + posY > 305) continue;
|
||||
page.drawTexturedModalRect(x + posX, y + yDown + posY, 138, 0, 18, 18);
|
||||
ItemStack stack = (ItemStack) (getRecipeInput(recipe).length > i && getRecipeInput(recipe)[i] instanceof ItemStack ? getRecipeInput(recipe)[i] : getRecipeInput(recipe).length > i && getRecipeInput(recipe)[i] instanceof ArrayList ? ((ArrayList) getRecipeInput(recipe)[i]).get(0) : null);
|
||||
ItemStack stack = (ItemStack) (getRecipeInput(recipe).length > i
|
||||
&& getRecipeInput(recipe)[i] instanceof ItemStack
|
||||
? getRecipeInput(recipe)[i]
|
||||
: getRecipeInput(recipe).length > i
|
||||
&& getRecipeInput(recipe)[i] instanceof ArrayList
|
||||
? ((ArrayList) getRecipeInput(recipe)[i]).get(0)
|
||||
: null);
|
||||
|
||||
if (stack != null) {
|
||||
if (stack.getItemDamage() == OreDictionary.WILDCARD_VALUE) stack.setItemDamage(0);
|
||||
@@ -301,7 +325,6 @@ public class ComponentManualPage extends ComponentScrollingBase {
|
||||
if (recipe.getRecipeOutput() != null)
|
||||
page.drawItemStack(recipe.getRecipeOutput(), 5 + 90 + posX, 5 + 14 + yDown + posY, "");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (IRecipe recipe : recipes) {
|
||||
@@ -325,7 +348,13 @@ public class ComponentManualPage extends ComponentScrollingBase {
|
||||
int y = i / 3 * 18;
|
||||
|
||||
if (y + yDown + posY < 0 || y + yDown + posY > 305) continue;
|
||||
ItemStack stack = (ItemStack) (getRecipeInput(recipe).length > i && getRecipeInput(recipe)[i] instanceof ItemStack ? getRecipeInput(recipe)[i] : getRecipeInput(recipe).length > i && getRecipeInput(recipe)[i] instanceof ArrayList ? ((ArrayList) getRecipeInput(recipe)[i]).get(0) : null);
|
||||
ItemStack stack = (ItemStack) (getRecipeInput(recipe).length > i
|
||||
&& getRecipeInput(recipe)[i] instanceof ItemStack
|
||||
? getRecipeInput(recipe)[i]
|
||||
: getRecipeInput(recipe).length > i
|
||||
&& getRecipeInput(recipe)[i] instanceof ArrayList
|
||||
? ((ArrayList) getRecipeInput(recipe)[i]).get(0)
|
||||
: null);
|
||||
|
||||
if (stack != null) {
|
||||
if (GuiHelper.isInRect(1 + x + posX, 1 + y + yDown + posY, 18, 18, mouseX, mouseY)) {
|
||||
@@ -380,7 +409,6 @@ public class ComponentManualPage extends ComponentScrollingBase {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Object[] getRecipeInput(IRecipe recipe) {
|
||||
if (recipe instanceof ShapelessOreRecipe) return ((ShapelessOreRecipe) recipe).getInput().toArray();
|
||||
else if (recipe instanceof ShapedOreRecipe) return getShapedOreRecipe((ShapedOreRecipe) recipe);
|
||||
@@ -410,8 +438,7 @@ public class ComponentManualPage extends ComponentScrollingBase {
|
||||
}
|
||||
return grid;
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
|
||||
+58
-127
@@ -1,136 +1,104 @@
|
||||
package com.brandon3055.draconicevolution.client.handler;
|
||||
|
||||
import com.brandon3055.brandonscore.common.utills.DataUtills.XZPair;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.IAttributeInstance;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.FOVUpdateEvent;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.handler.ContributorHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.CustomArmorHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.ArmorSummary;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.DraconicArmor;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.WyvernArmor;
|
||||
import com.brandon3055.draconicevolution.common.items.weapons.BowHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.weapons.DraconicBow;
|
||||
import com.brandon3055.draconicevolution.common.items.weapons.WyvernBow;
|
||||
import com.brandon3055.draconicevolution.common.network.MountUpdatePacket;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.IAttributeInstance;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraftforge.client.event.FOVUpdateEvent;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 28/10/2014.
|
||||
*/
|
||||
public class ClientEventHandler {
|
||||
public static Map<EntityPlayer, XZPair<Float, Integer>> playerShieldStatus = new HashMap<EntityPlayer, XZPair<Float, Integer>>();
|
||||
public final class ClientEventHandler {
|
||||
|
||||
public static int elapsedTicks;
|
||||
private static float previousFOB = 0f;
|
||||
public static float previousSensitivity = 0;
|
||||
public static boolean bowZoom = false;
|
||||
public static boolean lastTickBowZoom = false;
|
||||
public static int tickSet = 0;
|
||||
private static int remountTicksRemaining = 0;
|
||||
private static int remountEntityID = 0;
|
||||
public static float energyCrystalAlphaValue = 0f;
|
||||
public static float energyCrystalAlphaTarget = 0f;
|
||||
public static boolean playerHoldingWrench = false;
|
||||
public static Minecraft mc;
|
||||
private static Random rand = new Random();
|
||||
private static IModelCustom shieldSphere;
|
||||
private static final Random RANDOM = new Random();
|
||||
|
||||
public ClientEventHandler() {
|
||||
shieldSphere = AdvancedModelLoader.loadModel(ResourceHandler.getResource("models/shieldSphere.obj"));
|
||||
}
|
||||
private int elapsedTicks;
|
||||
private int remountTicksRemaining = 0;
|
||||
private int remountEntityID = 0;
|
||||
private float energyCrystalAlphaValue = 0f;
|
||||
private float energyCrystalAlphaTarget = 0f;
|
||||
|
||||
@SubscribeEvent
|
||||
public void tickEnd(TickEvent.ClientTickEvent event) {
|
||||
if (event.phase != TickEvent.Phase.START || event.type != TickEvent.Type.CLIENT || event.side != Side.CLIENT)
|
||||
if (event.phase != TickEvent.Phase.START) {
|
||||
return;
|
||||
|
||||
for (Iterator<Map.Entry<EntityPlayer, XZPair<Float, Integer>>> i = playerShieldStatus.entrySet().iterator(); i.hasNext(); ) {
|
||||
Map.Entry<EntityPlayer, XZPair<Float, Integer>> entry = i.next();
|
||||
if (elapsedTicks - entry.getValue().getValue() > 5) i.remove();
|
||||
}
|
||||
|
||||
|
||||
if (mc == null) mc = Minecraft.getMinecraft();
|
||||
else if (mc.theWorld != null) {
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
if (mc.theWorld != null) {
|
||||
elapsedTicks++;
|
||||
HudHandler.clientTick();
|
||||
|
||||
if (bowZoom && !lastTickBowZoom) {
|
||||
previousSensitivity = Minecraft.getMinecraft().gameSettings.mouseSensitivity;
|
||||
Minecraft.getMinecraft().gameSettings.mouseSensitivity = previousSensitivity / 3;
|
||||
} else if (!bowZoom && lastTickBowZoom) {
|
||||
Minecraft.getMinecraft().gameSettings.mouseSensitivity = previousSensitivity;
|
||||
}
|
||||
|
||||
lastTickBowZoom = bowZoom;
|
||||
if (elapsedTicks - tickSet > 10) bowZoom = false;
|
||||
|
||||
if (energyCrystalAlphaValue < energyCrystalAlphaTarget) energyCrystalAlphaValue += 0.01f;
|
||||
if (energyCrystalAlphaValue > energyCrystalAlphaTarget) energyCrystalAlphaValue -= 0.01f;
|
||||
|
||||
if (Math.abs(energyCrystalAlphaTarget - energyCrystalAlphaValue) <= 0.02f)
|
||||
energyCrystalAlphaTarget = rand.nextFloat();
|
||||
|
||||
playerHoldingWrench = mc.thePlayer.getHeldItem() != null && mc.thePlayer.getHeldItem().getItem() == ModItems.wrench;
|
||||
if (Math.abs(energyCrystalAlphaTarget - energyCrystalAlphaValue) <= 0.02f) {
|
||||
energyCrystalAlphaTarget = RANDOM.nextFloat();
|
||||
}
|
||||
|
||||
searchForPlayerMount();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.LOW)
|
||||
public void fovUpdate(FOVUpdateEvent event) {
|
||||
|
||||
//region Bow FOV Update
|
||||
if (event.entity.getHeldItem() != null && (event.entity.getHeldItem().getItem() instanceof WyvernBow || event.entity.getHeldItem().getItem() instanceof DraconicBow) && Minecraft.getMinecraft().gameSettings.keyBindUseItem.getIsKeyPressed()) {
|
||||
// region Bow FOV Update
|
||||
final ItemStack heldItem = event.entity.getHeldItem();
|
||||
if (heldItem != null && (heldItem.getItem() instanceof WyvernBow || heldItem.getItem() instanceof DraconicBow)
|
||||
&& Minecraft.getMinecraft().gameSettings.keyBindUseItem.getIsKeyPressed()) {
|
||||
|
||||
BowHandler.BowProperties properties = new BowHandler.BowProperties(event.entity.getHeldItem(), event.entity);
|
||||
BowHandler.BowProperties properties = new BowHandler.BowProperties(heldItem, event.entity);
|
||||
|
||||
event.newfov = ((6 - properties.zoomModifier) / 6) * event.fov;
|
||||
|
||||
// if (ItemNBTHelper.getString(event.entity.getItemInUse(), "mode", "").equals("sharpshooter")){
|
||||
// if (event.entity.getItemInUse().getItem() instanceof WyvernBow) zMax = 1.35f;
|
||||
// else if (event.entity.getItemInUse().getItem() instanceof DraconicBow) zMax = 2.5f;
|
||||
// bowZoom = true;
|
||||
// tickSet = elapsedTicks;
|
||||
// }
|
||||
// if (ItemNBTHelper.getString(event.entity.getItemInUse(), "mode", "").equals("sharpshooter")){
|
||||
// if (event.entity.getItemInUse().getItem() instanceof WyvernBow) zMax = 1.35f;
|
||||
// else if (event.entity.getItemInUse().getItem() instanceof DraconicBow) zMax = 2.5f;
|
||||
// bowZoom = true;
|
||||
// tickSet = elapsedTicks;
|
||||
// }
|
||||
|
||||
}
|
||||
//endregion
|
||||
// endregion
|
||||
|
||||
//region Armor move speed FOV effect cancellation
|
||||
CustomArmorHandler.ArmorSummery summery = new CustomArmorHandler.ArmorSummery().getSummery(event.entity);
|
||||
// region Armor move speed FOV effect cancellation
|
||||
final ArmorSummary summary = ArmorSummary.get(event.entity);
|
||||
|
||||
if (summery != null && summery.speedModifier > 0) {
|
||||
IAttributeInstance iattributeinstance = event.entity.getEntityAttribute(SharedMonsterAttributes.movementSpeed);
|
||||
float f = (float) ((iattributeinstance.getAttributeValue() / (double) event.entity.capabilities.getWalkSpeed() + 1.0D) / 2.0D);
|
||||
if (summary != null && summary.speedModifier > 0) {
|
||||
IAttributeInstance iattributeinstance = event.entity
|
||||
.getEntityAttribute(SharedMonsterAttributes.movementSpeed);
|
||||
float f = (float) ((iattributeinstance.getAttributeValue()
|
||||
/ (double) event.entity.capabilities.getWalkSpeed() + 1.0D) / 2.0D);
|
||||
event.newfov /= f;
|
||||
}
|
||||
|
||||
//endregion
|
||||
// endregion
|
||||
}
|
||||
|
||||
|
||||
private void searchForPlayerMount() {
|
||||
if (remountTicksRemaining > 0) {
|
||||
Entity e = Minecraft.getMinecraft().theWorld.getEntityByID(remountEntityID);
|
||||
@@ -148,7 +116,7 @@ public class ClientEventHandler {
|
||||
}
|
||||
}
|
||||
|
||||
public static void tryRepositionPlayerOnMount(int id) {
|
||||
public void tryRepositionPlayerOnMount(int id) {
|
||||
if (remountTicksRemaining == 500) return;
|
||||
remountTicksRemaining = 500;
|
||||
remountEntityID = id;
|
||||
@@ -162,8 +130,9 @@ public class ClientEventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void renderArmorEvent(RenderPlayerEvent.SetArmorModel event) {
|
||||
if (ConfigHandler.useOriginal3DArmorModel || ConfigHandler.useOldArmorModel || event.isCanceled()) return;
|
||||
if (event.stack != null && (event.stack.getItem() instanceof DraconicArmor || event.stack.getItem() instanceof WyvernArmor)) {
|
||||
if (ConfigHandler.useOriginal3DArmorModel || ConfigHandler.useOldArmorModel) return;
|
||||
if (event.stack != null
|
||||
&& (event.stack.getItem() instanceof DraconicArmor || event.stack.getItem() instanceof WyvernArmor)) {
|
||||
ItemArmor itemarmor = (ItemArmor) event.stack.getItem();
|
||||
ModelBiped modelbiped = itemarmor.getArmorModel(event.entityPlayer, event.stack, event.slot);
|
||||
event.renderer.setRenderPassModel(modelbiped);
|
||||
@@ -174,49 +143,11 @@ public class ClientEventHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void renderPlayerEvent(RenderPlayerEvent.Post event) {
|
||||
if (playerShieldStatus.containsKey(event.entityPlayer)) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
ResourceHandler.bindResource("textures/models/shieldSphere.png");
|
||||
public int getElapsedTicks() {
|
||||
return elapsedTicks;
|
||||
}
|
||||
|
||||
float p = playerShieldStatus.get(event.entityPlayer).getKey();
|
||||
|
||||
EntityPlayer viewingPlayer = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
int i = 5 - (elapsedTicks - playerShieldStatus.get(event.entityPlayer).getValue());
|
||||
|
||||
GL11.glColor4f(1F - p, 0F, p, i / 5F);
|
||||
|
||||
if (viewingPlayer != event.entityPlayer) {
|
||||
double translationXLT = event.entityPlayer.prevPosX - viewingPlayer.prevPosX;
|
||||
double translationYLT = event.entityPlayer.prevPosY - viewingPlayer.prevPosY;
|
||||
double translationZLT = event.entityPlayer.prevPosZ - viewingPlayer.prevPosZ;
|
||||
|
||||
double translationX = translationXLT + (((event.entityPlayer.posX - viewingPlayer.posX) - translationXLT) * event.partialRenderTick);
|
||||
double translationY = translationYLT + (((event.entityPlayer.posY - viewingPlayer.posY) - translationYLT) * event.partialRenderTick);
|
||||
double translationZ = translationZLT + (((event.entityPlayer.posZ - viewingPlayer.posZ) - translationZLT) * event.partialRenderTick);
|
||||
|
||||
GL11.glTranslated(translationX, translationY + 1.1, translationZ);
|
||||
} else {
|
||||
GL11.glTranslated(0, -0.5, 0);
|
||||
}
|
||||
|
||||
GL11.glScaled(1, 1.5, 1);
|
||||
|
||||
shieldSphere.renderAll();
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
public float getEnergyCrystalAlpha() {
|
||||
return energyCrystalAlphaValue;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,10 @@
|
||||
package com.brandon3055.draconicevolution.client.handler;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.brandon3055.brandonscore.client.utills.GuiHelper;
|
||||
import com.brandon3055.brandonscore.common.utills.Utills;
|
||||
import com.brandon3055.draconicevolution.client.gui.GuiHudConfig;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.CustomArmorHandler;
|
||||
import com.brandon3055.draconicevolution.common.utills.IHudDisplayBlock;
|
||||
import com.brandon3055.draconicevolution.common.utills.IHudDisplayItem;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiChat;
|
||||
@@ -21,38 +13,47 @@ import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.gui.GuiHudConfig;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.ArmorSummary;
|
||||
import com.brandon3055.draconicevolution.common.utils.IHudDisplayBlock;
|
||||
import com.brandon3055.draconicevolution.common.utils.IHudDisplayItem;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 26/01/2015.
|
||||
*/
|
||||
public class HudHandler {
|
||||
public final class HudHandler {
|
||||
|
||||
private static List<String> hudList = null;
|
||||
private static List<String> ltHudList = null;
|
||||
private static float toolTipFadeOut = 0F;
|
||||
private static float armorStatsFadeOut = 0F;
|
||||
private static boolean showShieldHud = false;
|
||||
private static int shieldPercentCharge = 0;
|
||||
private static float shieldPoints = 0F;
|
||||
private static float maxShieldPoints = 0F;
|
||||
private static float shieldEntropy = 0F;
|
||||
private static int rfCharge = 0;
|
||||
private static long rfTotal = 0;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
private List<String> hudList = null;
|
||||
private List<String> ltHudList = null;
|
||||
private float toolTipFadeOut = 0F;
|
||||
private float armorStatsFadeOut = 0F;
|
||||
private boolean showShieldHud = false;
|
||||
private int shieldPercentCharge = 0;
|
||||
private float shieldPoints = 0F;
|
||||
private float maxShieldPoints = 0F;
|
||||
private float shieldEntropy = 0F;
|
||||
private int rfCharge = 0;
|
||||
private long rfTotal = 0;
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void drawHUD(RenderGameOverlayEvent.Post event) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if (event.type != RenderGameOverlayEvent.ElementType.ALL || mc.gameSettings.showDebugInfo || mc.currentScreen instanceof GuiChat)
|
||||
if (event.type != RenderGameOverlayEvent.ElementType.ALL || mc.gameSettings.showDebugInfo
|
||||
|| mc.currentScreen instanceof GuiChat) {
|
||||
return;
|
||||
}
|
||||
|
||||
ScaledResolution resolution = event.resolution;
|
||||
width = resolution.getScaledWidth();
|
||||
height = resolution.getScaledHeight();
|
||||
final int width = resolution.getScaledWidth();
|
||||
final int height = resolution.getScaledHeight();
|
||||
FontRenderer fontRenderer = mc.fontRenderer;
|
||||
|
||||
if (ConfigHandler.hudSettings[10] == 1 && hudList != null && toolTipFadeOut > 0) {
|
||||
@@ -60,7 +61,15 @@ public class HudHandler {
|
||||
int y = (int) (((float) ConfigHandler.hudSettings[1] / 1000F) * (float) height);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GuiHelper.drawHoveringText(hudList, x, y, fontRenderer, toolTipFadeOut > 1 ? 1 : toolTipFadeOut, ConfigHandler.hudSettings[4] / 100D, width, height);
|
||||
GuiHelper.drawHoveringText(
|
||||
hudList,
|
||||
x,
|
||||
y,
|
||||
fontRenderer,
|
||||
toolTipFadeOut > 1 ? 1 : toolTipFadeOut,
|
||||
ConfigHandler.hudSettings[4] / 100D,
|
||||
width,
|
||||
height);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
@@ -73,14 +82,22 @@ public class HudHandler {
|
||||
}
|
||||
}
|
||||
|
||||
//x, y, x, y, scale, scale, fademode, fademode, rotateArmor, armorText
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void clientTick() {
|
||||
@SubscribeEvent
|
||||
public void tickEnd(TickEvent.ClientTickEvent event) {
|
||||
if (event.phase == TickEvent.Phase.END && Minecraft.getMinecraft().theWorld != null) {
|
||||
this.clientTick();
|
||||
}
|
||||
}
|
||||
|
||||
private void clientTick() {
|
||||
if (ConfigHandler.hudSettings[6] > 0 && toolTipFadeOut > 1F - ((float) ConfigHandler.hudSettings[6] * 0.25F)) {
|
||||
toolTipFadeOut -= 0.1F;
|
||||
}
|
||||
if (hudList != null && (ltHudList == null || !hudList.equals(ltHudList))) toolTipFadeOut = 5F;
|
||||
if (ConfigHandler.hudSettings[7] > 0 && armorStatsFadeOut > 1F - ((float) ConfigHandler.hudSettings[7] * 0.25F)) {
|
||||
if (hudList != null && !hudList.equals(ltHudList)) {
|
||||
toolTipFadeOut = 5F;
|
||||
}
|
||||
if (ConfigHandler.hudSettings[7] > 0
|
||||
&& armorStatsFadeOut > 1F - ((float) ConfigHandler.hudSettings[7] * 0.25F)) {
|
||||
armorStatsFadeOut -= 0.1F;
|
||||
if (armorStatsFadeOut < 0) armorStatsFadeOut = 0;
|
||||
}
|
||||
@@ -94,7 +111,7 @@ public class HudHandler {
|
||||
|
||||
if (mc.currentScreen != null) {
|
||||
if (mc.currentScreen instanceof GuiHudConfig) {
|
||||
hudList = new ArrayList<String>();
|
||||
hudList = new ArrayList<>();
|
||||
hudList.add(StatCollector.translateToLocal("info.de.hudDisplayConfigTxt1.txt"));
|
||||
hudList.add("");
|
||||
hudList.add("");
|
||||
@@ -103,34 +120,55 @@ public class HudHandler {
|
||||
toolTipFadeOut = 1F;
|
||||
armorStatsFadeOut = 1F;
|
||||
}
|
||||
} else if (mc.thePlayer.getHeldItem() != null && mc.thePlayer.getHeldItem().getItem() instanceof IHudDisplayItem) {
|
||||
hudList = ((IHudDisplayItem) mc.thePlayer.getHeldItem().getItem()).getDisplayData(mc.thePlayer.getHeldItem());
|
||||
}
|
||||
} else
|
||||
if (mc.thePlayer.getHeldItem() != null && mc.thePlayer.getHeldItem().getItem() instanceof IHudDisplayItem) {
|
||||
hudList = ((IHudDisplayItem) mc.thePlayer.getHeldItem().getItem())
|
||||
.getDisplayData(mc.thePlayer.getHeldItem());
|
||||
}
|
||||
|
||||
MovingObjectPosition mop = mc.thePlayer.rayTrace(5, 0);
|
||||
if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && mc.theWorld.getBlock(mop.blockX, mop.blockY, mop.blockZ) instanceof IHudDisplayBlock) {
|
||||
hudList = ((IHudDisplayBlock) mc.theWorld.getBlock(mop.blockX, mop.blockY, mop.blockZ)).getDisplayData(mc.theWorld, mop.blockX, mop.blockY, mop.blockZ);
|
||||
if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK
|
||||
&& mc.theWorld.getBlock(mop.blockX, mop.blockY, mop.blockZ) instanceof IHudDisplayBlock) {
|
||||
hudList = ((IHudDisplayBlock) mc.theWorld.getBlock(mop.blockX, mop.blockY, mop.blockZ))
|
||||
.getDisplayData(mc.theWorld, mop.blockX, mop.blockY, mop.blockZ);
|
||||
}
|
||||
|
||||
CustomArmorHandler.ArmorSummery summery = new CustomArmorHandler.ArmorSummery().getSummery(mc.thePlayer);
|
||||
final ArmorSummary summary = ArmorSummary.get(mc.thePlayer);
|
||||
|
||||
if (summery == null) {
|
||||
if (summary == null) {
|
||||
showShieldHud = false;
|
||||
return;
|
||||
}
|
||||
if (!shouldDisplayArmorHud(summary)) {
|
||||
showShieldHud = false;
|
||||
armorStatsFadeOut = 0F;
|
||||
maxShieldPoints = 0F;
|
||||
shieldPoints = 0F;
|
||||
shieldPercentCharge = 0;
|
||||
shieldEntropy = 0F;
|
||||
rfCharge = 0;
|
||||
rfTotal = 0;
|
||||
return;
|
||||
}
|
||||
showShieldHud = armorStatsFadeOut > 0F;
|
||||
|
||||
if (maxShieldPoints != summery.maxProtectionPoints || shieldPoints != summery.protectionPoints || shieldEntropy != summery.entropy || rfTotal != summery.totalEnergyStored)
|
||||
if (maxShieldPoints != summary.maxProtectionPoints || shieldPoints != summary.protectionPoints
|
||||
|| shieldEntropy != summary.entropy
|
||||
|| rfTotal != summary.totalEnergyStored)
|
||||
armorStatsFadeOut = 5F;
|
||||
|
||||
maxShieldPoints = summery.maxProtectionPoints;
|
||||
shieldPoints = summery.protectionPoints;
|
||||
shieldPercentCharge = (int) (summery.protectionPoints / summery.maxProtectionPoints * 100D);
|
||||
shieldEntropy = summery.entropy;
|
||||
rfCharge = (int) ((double) summery.totalEnergyStored / Math.max((double) summery.maxTotalEnergyStorage, 1D) * 100D);
|
||||
rfTotal = summery.totalEnergyStored;
|
||||
maxShieldPoints = summary.maxProtectionPoints;
|
||||
shieldPoints = summary.protectionPoints;
|
||||
shieldPercentCharge = (int) (summary.protectionPoints / summary.maxProtectionPoints * 100D);
|
||||
shieldEntropy = summary.entropy;
|
||||
rfCharge = (int) ((double) summary.totalEnergyStored / Math.max((double) summary.maxTotalEnergyStorage, 1D)
|
||||
* 100D);
|
||||
rfTotal = summary.totalEnergyStored;
|
||||
}
|
||||
|
||||
private boolean shouldDisplayArmorHud(ArmorSummary summary) {
|
||||
return summary.maxProtectionPoints > 0F || summary.maxTotalEnergyStorage > 0;
|
||||
}
|
||||
|
||||
private void drawArmorHUD(int x, int y, boolean rotated, double scale) {
|
||||
GL11.glPushMatrix();
|
||||
@@ -153,10 +191,39 @@ public class HudHandler {
|
||||
} else GuiHelper.drawTexturedRect(x + 1, y + 105, 15, 17, 2, 0, 13, 15, 0, GuiHelper.PXL128);
|
||||
|
||||
GuiHelper.drawTexturedRect(x, y, 17, 104, 0, 15, 17, 104, 0, GuiHelper.PXL128);
|
||||
GuiHelper.drawTexturedRect(x + 2, y + 2 + (100 - shieldPercentCharge), 7, shieldPercentCharge, 17, 100 - shieldPercentCharge, 7, shieldPercentCharge, 0, GuiHelper.PXL128);
|
||||
GuiHelper.drawTexturedRect(x + 10, y + 2 + 100 - (int) shieldEntropy, 2, (int) shieldEntropy, 25, 100 - (int) shieldEntropy, 2, (int) shieldEntropy, 0, GuiHelper.PXL128);
|
||||
GuiHelper.drawTexturedRect(x + 13, y + 2 + 100 - rfCharge, 2, rfCharge, 28, 100 - rfCharge, 2, rfCharge, 0, GuiHelper.PXL128);
|
||||
|
||||
GuiHelper.drawTexturedRect(
|
||||
x + 2,
|
||||
y + 2 + (100 - shieldPercentCharge),
|
||||
7,
|
||||
shieldPercentCharge,
|
||||
17,
|
||||
100 - shieldPercentCharge,
|
||||
7,
|
||||
shieldPercentCharge,
|
||||
0,
|
||||
GuiHelper.PXL128);
|
||||
GuiHelper.drawTexturedRect(
|
||||
x + 10,
|
||||
y + 2 + 100 - (int) shieldEntropy,
|
||||
2,
|
||||
(int) shieldEntropy,
|
||||
25,
|
||||
100 - (int) shieldEntropy,
|
||||
2,
|
||||
(int) shieldEntropy,
|
||||
0,
|
||||
GuiHelper.PXL128);
|
||||
GuiHelper.drawTexturedRect(
|
||||
x + 13,
|
||||
y + 2 + 100 - rfCharge,
|
||||
2,
|
||||
rfCharge,
|
||||
28,
|
||||
100 - rfCharge,
|
||||
2,
|
||||
rfCharge,
|
||||
0,
|
||||
GuiHelper.PXL128);
|
||||
|
||||
if (ConfigHandler.hudSettings[9] == 1) {
|
||||
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
|
||||
@@ -165,16 +232,28 @@ public class HudHandler {
|
||||
GL11.glTranslated(-x, -y, 0);
|
||||
String shield = Math.round(shieldPoints) + "/" + (int) maxShieldPoints;
|
||||
String entropy = "EN: " + (int) shieldEntropy + "%";
|
||||
String energy = "RF: " + Utills.formatNumber(rfTotal);
|
||||
String energy = "RF: " + formatNumber(rfTotal);
|
||||
float fade = Math.min(armorStatsFadeOut, 1F);
|
||||
if (!rotated) {
|
||||
fontRenderer.drawStringWithShadow(shield, x + 18, y + 74, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
|
||||
fontRenderer.drawStringWithShadow(energy, x + 18, y + 84, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
|
||||
fontRenderer.drawStringWithShadow(entropy, x + 18, y + 94, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
|
||||
fontRenderer
|
||||
.drawStringWithShadow(shield, x + 18, y + 74, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
|
||||
fontRenderer
|
||||
.drawStringWithShadow(energy, x + 18, y + 84, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
|
||||
fontRenderer
|
||||
.drawStringWithShadow(entropy, x + 18, y + 94, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
|
||||
} else {
|
||||
fontRenderer.drawString(shield, x - 52 - fontRenderer.getStringWidth(shield) / 2, y + 2, ((int) (fade * 240F) + 0x10 << 24) | 0x000000FF);
|
||||
fontRenderer.drawStringWithShadow(entropy, x - fontRenderer.getStringWidth(entropy), y + 18, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
|
||||
fontRenderer.drawStringWithShadow(energy, x - 102, y + 18, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
|
||||
fontRenderer.drawString(
|
||||
shield,
|
||||
x - 52 - fontRenderer.getStringWidth(shield) / 2,
|
||||
y + 2,
|
||||
((int) (fade * 240F) + 0x10 << 24) | 0x000000FF);
|
||||
fontRenderer.drawStringWithShadow(
|
||||
entropy,
|
||||
x - fontRenderer.getStringWidth(entropy),
|
||||
y + 18,
|
||||
((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
|
||||
fontRenderer
|
||||
.drawStringWithShadow(energy, x - 102, y + 18, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,39 +265,43 @@ public class HudHandler {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//GL11.glPushMatrix();
|
||||
// GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
// ResourceHandler.bindResource("textures/gui/HUD.png");
|
||||
// GL11.glPushMatrix();
|
||||
// GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
// ResourceHandler.bindResource("textures/gui/HUD.png");
|
||||
//
|
||||
// if (rotated){
|
||||
// GuiHelper.drawTexturedRect(x-(12*scale), y+scale, (int)(11*scale), (int)(13*scale), 2, 0, 11, 13, 0, GuiHelper.PXL128);
|
||||
// x+=(104*scale);
|
||||
// GL11.glTranslated(x, y, 0);
|
||||
// GL11.glRotated(-90, 0, 0, -1);
|
||||
// GL11.glTranslated(-x, -y, 0);
|
||||
// }
|
||||
// else GuiHelper.drawTexturedRect(x+(1*scale), y+(104*scale)+1, (int)(13*scale), (int)(15*scale), 2, 0, 11, 13, 0, GuiHelper.PXL128);
|
||||
// if (rotated){
|
||||
// GuiHelper.drawTexturedRect(x-(12*scale), y+scale, (int)(11*scale), (int)(13*scale), 2, 0, 11, 13, 0,
|
||||
// GuiHelper.PXL128);
|
||||
// x+=(104*scale);
|
||||
// GL11.glTranslated(x, y, 0);
|
||||
// GL11.glRotated(-90, 0, 0, -1);
|
||||
// GL11.glTranslated(-x, -y, 0);
|
||||
// }
|
||||
// else GuiHelper.drawTexturedRect(x+(1*scale), y+(104*scale)+1, (int)(13*scale), (int)(15*scale), 2, 0, 11, 13, 0,
|
||||
// GuiHelper.PXL128);
|
||||
//
|
||||
// GuiHelper.drawTexturedRect(x, y, (int)(17*scale), (int)(104*scale), 0, 15, 17, 104, 0, GuiHelper.PXL128);
|
||||
// GuiHelper.drawTexturedRect(x+(2*scale), y+(2*scale)+(100-shieldPercentCharge), (int)(7*scale), shieldPercentCharge *scale, 17, 100-shieldPercentCharge, 7, shieldPercentCharge, 0, GuiHelper.PXL128);
|
||||
// GuiHelper.drawTexturedRect(x+(10*scale), y+(2+(100-(int)shieldEntropy) * scale), (int)(2*scale), (int)shieldEntropy * scale, 25, 100-(int)shieldEntropy, 2, (int)shieldEntropy, 0, GuiHelper.PXL128);
|
||||
// GuiHelper.drawTexturedRect(x, y, (int)(17*scale), (int)(104*scale), 0, 15, 17, 104, 0, GuiHelper.PXL128);
|
||||
// GuiHelper.drawTexturedRect(x+(2*scale), y+(2*scale)+(100-shieldPercentCharge), (int)(7*scale), shieldPercentCharge
|
||||
// *scale, 17, 100-shieldPercentCharge, 7, shieldPercentCharge, 0, GuiHelper.PXL128);
|
||||
// GuiHelper.drawTexturedRect(x+(10*scale), y+(2+(100-(int)shieldEntropy) * scale), (int)(2*scale), (int)shieldEntropy
|
||||
// * scale, 25, 100-(int)shieldEntropy, 2, (int)shieldEntropy, 0, GuiHelper.PXL128);
|
||||
//
|
||||
// if (ConfigHandler.hudSettings[9] == 1) {
|
||||
// FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
|
||||
// GL11.glTranslated(x, y, 0);
|
||||
// GL11.glScaled(scale, scale, 1);
|
||||
// if (rotated) GL11.glRotated(90, 0, 0, -1);
|
||||
// GL11.glTranslated(-x, -y, 0);
|
||||
// if (!rotated) {
|
||||
// fontRenderer.drawStringWithShadow(Math.round(shieldPoints) + "/" + (int)maxShieldPoints, x + 16, y + 84, 0xFFFFFF);
|
||||
// fontRenderer.drawStringWithShadow((int)shieldEntropy + "%", x + 16, y + 94, 0xFFFFFF);
|
||||
// }else {
|
||||
// fontRenderer.drawStringWithShadow(Math.round(shieldPoints) + "/" + (int)maxShieldPoints, x - 102, y + 16, 0xFFFFFF);
|
||||
// fontRenderer.drawStringWithShadow((int)shieldEntropy + "%", x - fontRenderer.getStringWidth((int)shieldEntropy + "%"), y + 16, 0xFFFFFF);
|
||||
// }
|
||||
// }
|
||||
// if (ConfigHandler.hudSettings[9] == 1) {
|
||||
// FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
|
||||
// GL11.glTranslated(x, y, 0);
|
||||
// GL11.glScaled(scale, scale, 1);
|
||||
// if (rotated) GL11.glRotated(90, 0, 0, -1);
|
||||
// GL11.glTranslated(-x, -y, 0);
|
||||
// if (!rotated) {
|
||||
// fontRenderer.drawStringWithShadow(Math.round(shieldPoints) + "/" + (int)maxShieldPoints, x + 16, y + 84, 0xFFFFFF);
|
||||
// fontRenderer.drawStringWithShadow((int)shieldEntropy + "%", x + 16, y + 94, 0xFFFFFF);
|
||||
// }else {
|
||||
// fontRenderer.drawStringWithShadow(Math.round(shieldPoints) + "/" + (int)maxShieldPoints, x - 102, y + 16, 0xFFFFFF);
|
||||
// fontRenderer.drawStringWithShadow((int)shieldEntropy + "%", x - fontRenderer.getStringWidth((int)shieldEntropy +
|
||||
// "%"), y + 16, 0xFFFFFF);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// ResourceHandler.bindTexture(ResourceHandler.getResourceWOP("minecraft:textures/gui/icons.png"));
|
||||
// GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
// GL11.glPopMatrix();
|
||||
// ResourceHandler.bindTexture(ResourceHandler.getResourceWOP("minecraft:textures/gui/icons.png"));
|
||||
// GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
// GL11.glPopMatrix();
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package com.brandon3055.draconicevolution.client.handler;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
|
||||
public final class ItemDisplayManager {
|
||||
|
||||
private static final RenderItem renderItem = new RenderItem();
|
||||
private static final FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
|
||||
private static final TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
|
||||
|
||||
private final int ticks;
|
||||
private ItemStack itemStack;
|
||||
private int ticksCounter;
|
||||
|
||||
public ItemDisplayManager(int ticks) {
|
||||
this.ticks = ticks;
|
||||
}
|
||||
|
||||
public void startDrawing(ItemStack itemStack) {
|
||||
this.itemStack = itemStack == null ? null : itemStack.copy();
|
||||
ticksCounter = ticks;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void tickEnd(TickEvent.ClientTickEvent event) {
|
||||
if (event.phase == TickEvent.Phase.END) {
|
||||
if (--ticksCounter == 0) {
|
||||
itemStack = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void renderGameOverlayEvent(RenderGameOverlayEvent.Post event) {
|
||||
if (event.type == RenderGameOverlayEvent.ElementType.ALL) {
|
||||
if (ticksCounter > 0 && itemStack != null && itemStack.getItem() != null) {
|
||||
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
final int y = event.resolution.getScaledHeight();
|
||||
GL11.glTranslatef(7.0f, y * 0.25f, 0);
|
||||
renderItem.renderItemAndEffectIntoGUI(fontRenderer, textureManager, itemStack, 0, 0);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+24
-16
@@ -1,21 +1,22 @@
|
||||
package com.brandon3055.draconicevolution.client.handler;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.render.particle.ParticleDistortion;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.render.particle.ParticleDistortion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ParticleHandler {
|
||||
private static Minecraft mc = Minecraft.getMinecraft();
|
||||
private static World theWorld = mc.theWorld;
|
||||
public final class ParticleHandler {
|
||||
|
||||
public static EntityFX spawnParticle(String particleName, double x, double y, double z, double motionX, double motionY, double motionZ, float scale) {
|
||||
public static EntityFX spawnParticle(String particleName, double x, double y, double z, double motionX,
|
||||
double motionY, double motionZ, float scale) {
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
if (mc != null && mc.renderViewEntity != null && mc.effectRenderer != null) {
|
||||
int var14 = mc.gameSettings.particleSetting;
|
||||
if (var14 == 1 && theWorld.rand.nextInt(3) == 0) {
|
||||
if (var14 == 1 && mc.theWorld.rand.nextInt(3) == 0) {
|
||||
var14 = 2;
|
||||
}
|
||||
double var15 = mc.renderViewEntity.posX - x;
|
||||
@@ -29,7 +30,15 @@ public class ParticleHandler {
|
||||
return null;
|
||||
} else {
|
||||
if (particleName.equals("distortionParticle")) {
|
||||
var21 = new ParticleDistortion(theWorld, x, y, z, (float) motionX, (float) motionY, (float) motionZ, scale);
|
||||
var21 = new ParticleDistortion(
|
||||
mc.theWorld,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
(float) motionX,
|
||||
(float) motionY,
|
||||
(float) motionZ,
|
||||
scale);
|
||||
}
|
||||
|
||||
mc.effectRenderer.addEffect(var21);
|
||||
@@ -44,9 +53,10 @@ public class ParticleHandler {
|
||||
}
|
||||
|
||||
public static EntityFX spawnCustomParticle(EntityFX particle, double vewRange) {
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
if (mc != null && mc.renderViewEntity != null && mc.effectRenderer != null) {
|
||||
int var14 = mc.gameSettings.particleSetting;
|
||||
if (var14 == 1 && theWorld.rand.nextInt(3) == 0) {
|
||||
if (var14 == 1 && mc.theWorld.rand.nextInt(3) == 0) {
|
||||
var14 = 2;
|
||||
}
|
||||
if (!isInRange(particle.posX, particle.posY, particle.posZ, vewRange)) {
|
||||
@@ -62,14 +72,12 @@ public class ParticleHandler {
|
||||
}
|
||||
|
||||
public static boolean isInRange(double x, double y, double z, double vewRange) {
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
if (mc == null || mc.renderViewEntity == null || mc.effectRenderer == null) return false;
|
||||
|
||||
double var15 = mc.renderViewEntity.posX - x;
|
||||
double var17 = mc.renderViewEntity.posY - y;
|
||||
double var19 = mc.renderViewEntity.posZ - z;
|
||||
if (var15 * var15 + var17 * var17 + var19 * var19 > vewRange * vewRange) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return !(var15 * var15 + var17 * var17 + var19 * var19 > vewRange * vewRange);
|
||||
}
|
||||
}
|
||||
}
|
||||
+59
-49
@@ -1,40 +1,55 @@
|
||||
package com.brandon3055.draconicevolution.client.handler;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EffectRenderer;
|
||||
import net.minecraft.client.resources.FolderResourcePack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.gui.componentguis.GUIManual;
|
||||
import com.brandon3055.draconicevolution.client.utill.CustomResourceLocation;
|
||||
import com.brandon3055.draconicevolution.client.utils.CustomResourceLocation;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
import com.google.common.io.ByteStreams;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EffectRenderer;
|
||||
import net.minecraft.client.resources.FolderResourcePack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 8/02/2015.
|
||||
*/
|
||||
public class ResourceHandler {
|
||||
|
||||
public static ResourceHandler instance = new ResourceHandler();
|
||||
private static ResourceLocation defaultParticles;
|
||||
private static ResourceLocation particles = new ResourceLocation(References.RESOURCESPREFIX + "textures/particle/particles.png");
|
||||
private static ResourceLocation particles = new ResourceLocation(
|
||||
References.RESOURCESPREFIX + "textures/particle/particles.png");
|
||||
private static Map<String, ResourceLocation> cachedResources = new HashMap<String, ResourceLocation>();
|
||||
public static Map<String, CustomResourceLocation> downloadedImages = new HashMap<String, CustomResourceLocation>();
|
||||
|
||||
public static Map<String, CustomResourceLocation> downloadedImages = new ConcurrentHashMap<>();
|
||||
|
||||
private static String savePath;
|
||||
private static File saveFolder;
|
||||
@@ -42,8 +57,7 @@ public class ResourceHandler {
|
||||
private static DownloadThread downloadThread;
|
||||
public static int downloadStatus = 0;
|
||||
|
||||
|
||||
//-------------------- File Handling -----------------------//
|
||||
// -------------------- File Handling -----------------------//
|
||||
|
||||
@SubscribeEvent
|
||||
public void tick(TickEvent.ClientTickEvent event) {
|
||||
@@ -51,7 +65,6 @@ public class ResourceHandler {
|
||||
if (downloadThread.isReloadRequired()) LogHelper.info("Image Download Finished");
|
||||
downloadStatus = downloadThread.wasSuccessful ? 1 : 2;
|
||||
FMLCommonHandler.instance().bus().unregister(this);
|
||||
addRSPack(event != null);
|
||||
downloadThread = null;
|
||||
}
|
||||
}
|
||||
@@ -59,18 +72,22 @@ public class ResourceHandler {
|
||||
public static void init(FMLPreInitializationEvent event) {
|
||||
FMLCommonHandler.instance().bus().register(instance);
|
||||
|
||||
if (event != null)
|
||||
savePath = event.getModConfigurationDirectory().getParentFile().getAbsolutePath() + "/config/draconicevolution";
|
||||
if (event != null) savePath = event.getModConfigurationDirectory().getParentFile().getAbsolutePath()
|
||||
+ "/config/draconicevolution";
|
||||
|
||||
// Register the namespace before FML's final reload; folder-pack files are resolved on demand.
|
||||
getImagesFolder();
|
||||
addRSPack();
|
||||
GUIManual.loadPages();
|
||||
|
||||
downloadThread = new DownloadThread(GUIManual.imageURLs);
|
||||
downloadThread.start();
|
||||
}
|
||||
|
||||
|
||||
public static class DownloadThread extends Thread {
|
||||
|
||||
private List<String> imageURLs;
|
||||
private boolean isFinished = false;
|
||||
private volatile boolean isFinished = false;
|
||||
private boolean wasSuccessful = true;
|
||||
private boolean reloadRequired = false;
|
||||
|
||||
@@ -89,13 +106,16 @@ public class ResourceHandler {
|
||||
String fileName = url.getFile();
|
||||
|
||||
BufferedImage bi = ImageIO.read(new File(getImagesFolder(), FilenameUtils.getName(fileName)));
|
||||
downloadedImages.put(FilenameUtils.getName(fileName), new CustomResourceLocation(FilenameUtils.getName(fileName), bi.getWidth(), bi.getHeight()));
|
||||
}
|
||||
catch (MalformedURLException e) {
|
||||
downloadedImages.put(
|
||||
FilenameUtils.getName(fileName),
|
||||
new CustomResourceLocation(
|
||||
FilenameUtils.getName(fileName),
|
||||
bi.getWidth(),
|
||||
bi.getHeight()));
|
||||
} catch (MalformedURLException e) {
|
||||
LogHelper.error("Image Read Failed");
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
LogHelper.error("Image Read Failed");
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -122,8 +142,7 @@ public class ResourceHandler {
|
||||
is.close();
|
||||
os.close();
|
||||
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
LogHelper.error("Download Failed");
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
@@ -136,8 +155,7 @@ public class ResourceHandler {
|
||||
URL url = new URL(urlS);
|
||||
String fileName = url.getFile();
|
||||
return Arrays.asList(getImagesFolder().list()).contains(FilenameUtils.getName(fileName));
|
||||
}
|
||||
catch (MalformedURLException e) {
|
||||
} catch (MalformedURLException e) {
|
||||
LogHelper.error("Unable to check files existence. Invalid URL: " + urlS);
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
@@ -157,8 +175,7 @@ public class ResourceHandler {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static void addRSPack(boolean refreash) {
|
||||
private static void addRSPack() {
|
||||
File rspack = new File(getConfigFolder(), "/resources");
|
||||
if (!rspack.exists()) return;
|
||||
|
||||
@@ -173,8 +190,7 @@ public class ResourceHandler {
|
||||
writer.endObject();
|
||||
writer.endObject();
|
||||
writer.close();
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
LogHelper.error("Error creating pack.mcmeta");
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -188,9 +204,7 @@ public class ResourceHandler {
|
||||
|
||||
f.set(Minecraft.getMinecraft(), defaultResourcePacks);
|
||||
LogHelper.info("RS Added");
|
||||
if (refreash) Minecraft.getMinecraft().refreshResources();
|
||||
}
|
||||
catch (IllegalAccessException e) {
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -213,8 +227,7 @@ public class ResourceHandler {
|
||||
return imagesFolder;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------//
|
||||
|
||||
// ----------------------------------------------------------//
|
||||
|
||||
public static void bindTexture(ResourceLocation texture) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
@@ -226,10 +239,9 @@ public class ResourceHandler {
|
||||
public static void bindDefaultParticles() {
|
||||
if (defaultParticles == null) {
|
||||
try {
|
||||
defaultParticles = (ResourceLocation) ReflectionHelper.getPrivateValue(EffectRenderer.class, null, "particleTextures", "field_110737_b");
|
||||
}
|
||||
catch (Exception e) {
|
||||
}
|
||||
defaultParticles = (ResourceLocation) ReflectionHelper
|
||||
.getPrivateValue(EffectRenderer.class, null, "particleTextures", "field_110737_b");
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
if (defaultParticles != null) bindTexture(defaultParticles);
|
||||
}
|
||||
@@ -252,6 +264,4 @@ public class ResourceHandler {
|
||||
public static void bindResource(String rs) {
|
||||
bindTexture(ResourceHandler.getResource(rs));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
package com.brandon3055.draconicevolution.client.handler;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.utils.DataUtils;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public final class ShieldRenderHandler {
|
||||
|
||||
private static final IModelCustom SHIELD_SPHERE = AdvancedModelLoader
|
||||
.loadModel(ResourceHandler.getResource("models/shieldSphere.obj"));
|
||||
|
||||
private final HashMap<EntityPlayer, DataUtils.XZPair<Float, Integer>> shieldStatus = new HashMap<>();
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldUnload(WorldEvent.Unload event) {
|
||||
if (event.world.isRemote) {
|
||||
this.shieldStatus.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void tickEnd(TickEvent.ClientTickEvent event) {
|
||||
if (event.phase == TickEvent.Phase.END && !shieldStatus.isEmpty()) {
|
||||
final int ticks = DraconicEvolution.clientProxy().getElapsedTicks();
|
||||
shieldStatus.entrySet().removeIf(entry -> ticks - entry.getValue().getValue() > 5);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void renderPlayerEvent(RenderPlayerEvent.Post event) {
|
||||
final DataUtils.XZPair<Float, Integer> pair = shieldStatus.get(event.entityPlayer);
|
||||
if (pair != null) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
ResourceHandler.bindResource("textures/models/shieldSphere.png");
|
||||
|
||||
final float p = pair.getKey();
|
||||
final EntityPlayer viewingPlayer = Minecraft.getMinecraft().thePlayer;
|
||||
final int ticks = DraconicEvolution.clientProxy().getElapsedTicks();
|
||||
final int i = 5 - (ticks - pair.getValue());
|
||||
|
||||
GL11.glColor4f(1F - p, 0F, p, i / 5F);
|
||||
|
||||
if (viewingPlayer != event.entityPlayer) {
|
||||
double translationXLT = event.entityPlayer.prevPosX - viewingPlayer.prevPosX;
|
||||
double translationYLT = event.entityPlayer.prevPosY - viewingPlayer.prevPosY;
|
||||
double translationZLT = event.entityPlayer.prevPosZ - viewingPlayer.prevPosZ;
|
||||
|
||||
double translationX = translationXLT
|
||||
+ (((event.entityPlayer.posX - viewingPlayer.posX) - translationXLT) * event.partialRenderTick);
|
||||
double translationY = translationYLT
|
||||
+ (((event.entityPlayer.posY - viewingPlayer.posY) - translationYLT) * event.partialRenderTick);
|
||||
double translationZ = translationZLT
|
||||
+ (((event.entityPlayer.posZ - viewingPlayer.posZ) - translationZLT) * event.partialRenderTick);
|
||||
|
||||
GL11.glTranslated(translationX, translationY + 1.1, translationZ);
|
||||
} else {
|
||||
GL11.glTranslated(0, -0.5, 0);
|
||||
}
|
||||
|
||||
GL11.glScaled(1, 1.5, 1);
|
||||
|
||||
SHIELD_SPHERE.renderAll();
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
public void renderShield(EntityPlayer player, float shieldPowerF) {
|
||||
final int ticks = DraconicEvolution.clientProxy().getElapsedTicks();
|
||||
this.shieldStatus.put(player, new DataUtils.XZPair<>(shieldPowerF, ticks));
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.brandon3055.draconicevolution.client.keybinding;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 14/08/2014.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class KeyBindings {
|
||||
public static KeyBinding placeItem;
|
||||
public static KeyBinding toolConfig;
|
||||
public static KeyBinding toolProfileChange;
|
||||
public static KeyBinding toggleFlight;
|
||||
|
||||
public static void init() {
|
||||
placeItem = new KeyBinding("key.placeItem", Keyboard.KEY_P, References.MODNAME);
|
||||
toolConfig = new KeyBinding("key.toolConfig", Keyboard.KEY_C, References.MODNAME);
|
||||
toolProfileChange = new KeyBinding("key.toolProfileChange", Keyboard.KEY_BACKSLASH, References.MODNAME);
|
||||
toggleFlight = new KeyBinding("key.toggleFlight", Keyboard.KEY_NONE, References.MODNAME);
|
||||
ClientRegistry.registerKeyBinding(placeItem);
|
||||
ClientRegistry.registerKeyBinding(toolConfig);
|
||||
ClientRegistry.registerKeyBinding(toolProfileChange);
|
||||
ClientRegistry.registerKeyBinding(toggleFlight);
|
||||
}
|
||||
}
|
||||
+162
-72
@@ -1,113 +1,203 @@
|
||||
package com.brandon3055.draconicevolution.client.keybinding;
|
||||
|
||||
import com.brandon3055.brandonscore.common.utills.ItemNBTHelper;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.Magnet;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.baseclasses.ToolHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.network.ButtonPacket;
|
||||
import com.brandon3055.draconicevolution.common.network.MagnetTogglePacket;
|
||||
import com.brandon3055.draconicevolution.common.network.MagnetToggleSelfPickupPacket;
|
||||
import com.brandon3055.draconicevolution.common.network.PlacedItemPacket;
|
||||
import com.brandon3055.draconicevolution.common.network.TeleporterPacket;
|
||||
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utils.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utils.InventoryUtils;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.integration.ModHelper;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 14/08/2014.
|
||||
*/
|
||||
public class KeyInputHandler {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public final class KeyInputHandler {
|
||||
|
||||
private final KeyBinding placeItem;
|
||||
private final KeyBinding toolConfig;
|
||||
private final KeyBinding toolProfileChange;
|
||||
private final KeyBinding toggleFlight;
|
||||
private final KeyBinding toggleMagnet;
|
||||
private final KeyBinding toggleMagnetSelfPickup;
|
||||
|
||||
public KeyInputHandler() {
|
||||
placeItem = new KeyBinding("key.placeItem", Keyboard.KEY_V, References.MODNAME);
|
||||
toolConfig = new KeyBinding("key.toolConfig", Keyboard.KEY_NONE, References.MODNAME);
|
||||
toolProfileChange = new KeyBinding("key.toolProfileChange", Keyboard.KEY_NONE, References.MODNAME);
|
||||
toggleFlight = new KeyBinding("key.toggleFlight", Keyboard.KEY_NONE, References.MODNAME);
|
||||
toggleMagnet = new KeyBinding("key.toggleMagnet", Keyboard.KEY_NONE, References.MODNAME);
|
||||
if (ModHelper.isHodgepodgeLoaded) {
|
||||
toggleMagnetSelfPickup = new KeyBinding(
|
||||
"key.toggleMagnetSelfPickup",
|
||||
Keyboard.KEY_NONE,
|
||||
References.MODNAME);
|
||||
} else {
|
||||
toggleMagnetSelfPickup = null;
|
||||
}
|
||||
ClientRegistry.registerKeyBinding(placeItem);
|
||||
ClientRegistry.registerKeyBinding(toolConfig);
|
||||
ClientRegistry.registerKeyBinding(toolProfileChange);
|
||||
ClientRegistry.registerKeyBinding(toggleFlight);
|
||||
ClientRegistry.registerKeyBinding(toggleMagnet);
|
||||
if (toggleMagnetSelfPickup != null) {
|
||||
ClientRegistry.registerKeyBinding(toggleMagnetSelfPickup);
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void onKeyInput(InputEvent.KeyInputEvent event) {
|
||||
if (KeyBindings.placeItem.isPressed()) handlePlaceItemKey();
|
||||
else if (KeyBindings.toolConfig.isPressed()) {
|
||||
DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOLCONFIG, false));
|
||||
} else if (KeyBindings.toolProfileChange.isPressed() && Minecraft.getMinecraft().thePlayer != null && Minecraft.getMinecraft().thePlayer.getItemInUse() == null) {
|
||||
DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOL_PROFILE_CHANGE, false));
|
||||
|
||||
ItemStack stack = Minecraft.getMinecraft().thePlayer.getHeldItem();
|
||||
if (stack != null && stack.getItem() instanceof IConfigurableItem && ((IConfigurableItem) stack.getItem()).hasProfiles()) {
|
||||
int preset = ItemNBTHelper.getInteger(stack, "ConfigProfile", 0);
|
||||
if (++preset >= 5) preset = 0;
|
||||
ItemNBTHelper.setInteger(stack, "ConfigProfile", preset);
|
||||
}
|
||||
} else if (KeyBindings.toggleFlight.isPressed()) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
if (player.capabilities.allowFlying) {
|
||||
if (player.capabilities.isFlying) {
|
||||
player.capabilities.isFlying = false;
|
||||
player.sendPlayerAbilities();
|
||||
} else {
|
||||
player.capabilities.isFlying = true;
|
||||
if (player.onGround) {
|
||||
player.setPosition(player.posX, player.posY + 0.05D, player.posZ);
|
||||
player.motionY = 0;
|
||||
}
|
||||
player.sendPlayerAbilities();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void handlePlaceItemKey() {
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
WorldClient world = Minecraft.getMinecraft().theWorld;
|
||||
MovingObjectPosition mop = ToolHandler.raytraceFromEntity(world, player, 4.5D);
|
||||
if (mop != null)
|
||||
DraconicEvolution.network.sendToServer(new PlacedItemPacket((byte) mop.sideHit, mop.blockX, mop.blockY, mop.blockZ));
|
||||
|
||||
if (this.placeItem.isPressed()) {
|
||||
handlePlaceItemKey();
|
||||
} else if (this.toolConfig.isPressed()) {
|
||||
handleToolConfigKey();
|
||||
} else if (this.toolProfileChange.isPressed() && player != null && player.getItemInUse() == null) {
|
||||
handleToolProfileChangeKey(player);
|
||||
} else if (this.toggleFlight.isPressed() && player != null) {
|
||||
handleToggleFlightKey(player);
|
||||
} else if (this.toggleMagnet.isPressed()) {
|
||||
handleToggleMagnetKey(player);
|
||||
} else if (this.toggleMagnetSelfPickup != null && this.toggleMagnetSelfPickup.isPressed()) {
|
||||
handleToggleMagnetSelfPickup(player);
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void onMouseInput(InputEvent.MouseInputEvent event) {
|
||||
if (KeyBindings.placeItem.isPressed()) handlePlaceItemKey();
|
||||
else if (KeyBindings.toolConfig.isPressed()) {
|
||||
DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOLCONFIG, false));
|
||||
} else if (KeyBindings.toolProfileChange.isPressed() && Minecraft.getMinecraft().thePlayer != null) {
|
||||
DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOL_PROFILE_CHANGE, false));
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
ItemStack stack = Minecraft.getMinecraft().thePlayer.getHeldItem();
|
||||
if (stack != null && stack.getItem() instanceof IConfigurableItem && ((IConfigurableItem) stack.getItem()).hasProfiles()) {
|
||||
int preset = ItemNBTHelper.getInteger(stack, "ConfigProfile", 0);
|
||||
if (++preset >= 5) preset = 0;
|
||||
ItemNBTHelper.setInteger(stack, "ConfigProfile", preset);
|
||||
}
|
||||
if (this.placeItem.isPressed()) {
|
||||
handlePlaceItemKey();
|
||||
} else if (this.toolConfig.isPressed()) {
|
||||
handleToolConfigKey();
|
||||
} else if (this.toolProfileChange.isPressed() && player != null) {
|
||||
handleToolProfileChangeKey(player);
|
||||
} else if (this.toggleFlight.isPressed() && player != null) {
|
||||
handleToggleFlightKey(player);
|
||||
} else if (this.toggleMagnet.isPressed()) {
|
||||
handleToggleMagnetKey(player);
|
||||
} else if (this.toggleMagnetSelfPickup != null && this.toggleMagnetSelfPickup.isPressed()) {
|
||||
handleToggleMagnetSelfPickup(player);
|
||||
}
|
||||
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
int change = Mouse.getEventDWheel();
|
||||
if (change == 0 || !player.isSneaking()) return;
|
||||
if (player != null) {
|
||||
int change = Mouse.getEventDWheel();
|
||||
if (change == 0 || !player.isSneaking()) return;
|
||||
|
||||
if (change > 0) {
|
||||
ItemStack item = player.inventory.getStackInSlot(previouseSlot(1, player.inventory.currentItem));
|
||||
if (item != null && item.getItem().equals(ModItems.teleporterMKII)) {
|
||||
player.inventory.currentItem = previouseSlot(1, player.inventory.currentItem);
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.SCROLL, -1, false));
|
||||
}
|
||||
} else if (change < 0) {
|
||||
ItemStack item = player.inventory.getStackInSlot(previouseSlot(-1, player.inventory.currentItem));
|
||||
if (item != null && item.getItem().equals(ModItems.teleporterMKII)) {
|
||||
player.inventory.currentItem = previouseSlot(-1, player.inventory.currentItem);
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.SCROLL, 1, false));
|
||||
if (change > 0) {
|
||||
ItemStack item = player.inventory.getStackInSlot(previousSlot(1, player.inventory.currentItem));
|
||||
if (item != null && Objects.equals(item.getItem(), ModItems.teleporterMKII)) {
|
||||
player.inventory.currentItem = previousSlot(1, player.inventory.currentItem);
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.SCROLL, -1, false));
|
||||
}
|
||||
} else {
|
||||
ItemStack item = player.inventory.getStackInSlot(previousSlot(-1, player.inventory.currentItem));
|
||||
if (item != null && Objects.equals(item.getItem(), ModItems.teleporterMKII)) {
|
||||
player.inventory.currentItem = previousSlot(-1, player.inventory.currentItem);
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.SCROLL, 1, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int previouseSlot(int i, int c) {
|
||||
private void handlePlaceItemKey() {
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
WorldClient world = Minecraft.getMinecraft().theWorld;
|
||||
MovingObjectPosition mop = ToolHandler.raytraceFromEntity(world, player, 4.5D);
|
||||
if (mop != null) {
|
||||
DraconicEvolution.network
|
||||
.sendToServer(new PlacedItemPacket((byte) mop.sideHit, mop.blockX, mop.blockY, mop.blockZ));
|
||||
}
|
||||
}
|
||||
|
||||
private void handleToolConfigKey() {
|
||||
DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOLCONFIG, false));
|
||||
}
|
||||
|
||||
private void handleToolProfileChangeKey(@Nonnull EntityClientPlayerMP player) {
|
||||
DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOL_PROFILE_CHANGE, false));
|
||||
|
||||
ItemStack stack = player.getHeldItem();
|
||||
if (stack != null && stack.getItem() instanceof IConfigurableItem
|
||||
&& ((IConfigurableItem) stack.getItem()).hasProfiles()) {
|
||||
int preset = ItemNBTHelper.getInteger(stack, "ConfigProfile", 0);
|
||||
if (++preset >= 5) preset = 0;
|
||||
ItemNBTHelper.setInteger(stack, "ConfigProfile", preset);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleToggleFlightKey(@Nonnull EntityClientPlayerMP player) {
|
||||
if (player.capabilities.allowFlying) {
|
||||
if (player.capabilities.isFlying) {
|
||||
player.capabilities.isFlying = false;
|
||||
} else {
|
||||
player.capabilities.isFlying = true;
|
||||
if (player.onGround) {
|
||||
player.setPosition(player.posX, player.posY + 0.05D, player.posZ);
|
||||
player.motionY = 0;
|
||||
}
|
||||
}
|
||||
player.sendPlayerAbilities();
|
||||
}
|
||||
}
|
||||
|
||||
private void handleToggleMagnetKey(EntityClientPlayerMP player) {
|
||||
Optional<ItemStack> magnetOptional = InventoryUtils.getItemInAnyPlayerInventory(player, Magnet.class);
|
||||
|
||||
if (magnetOptional.isPresent()) {
|
||||
DraconicEvolution.network.sendToServer(new MagnetTogglePacket());
|
||||
}
|
||||
}
|
||||
|
||||
private void handleToggleMagnetSelfPickup(EntityClientPlayerMP player) {
|
||||
Optional<ItemStack> magnetOptional = InventoryUtils.getItemInAnyPlayerInventory(player, Magnet.class);
|
||||
|
||||
if (magnetOptional.isPresent()) {
|
||||
DraconicEvolution.network.sendToServer(new MagnetToggleSelfPickupPacket());
|
||||
}
|
||||
}
|
||||
|
||||
private int previousSlot(int i, int c) {
|
||||
if (c > 0 && c < 8) return c + i;
|
||||
if (c == 0 && i < 0) return 8;
|
||||
if (c == 8 && i > 0) return 0;
|
||||
if (c == 150 && i < 0) return 152;
|
||||
return c + i;
|
||||
}
|
||||
|
||||
public int toolConfigKeycode() {
|
||||
return this.toolConfig.getKeyCode();
|
||||
}
|
||||
}
|
||||
@@ -3,13 +3,14 @@ package com.brandon3055.draconicevolution.client.model;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
* ModelChaosCrystal - Mojang-(Original) modified by brandon3055
|
||||
* Created using Tabula 5.0.0
|
||||
* ModelChaosCrystal - Mojang-(Original) modified by brandon3055 Created using Tabula 5.0.0
|
||||
*/
|
||||
public class ModelChaosCrystal extends ModelBase {
|
||||
|
||||
public ModelRenderer base;
|
||||
public ModelRenderer glass;
|
||||
public ModelRenderer cube;
|
||||
|
||||
+61
-14
@@ -1,10 +1,14 @@
|
||||
package com.brandon3055.draconicevolution.client.model;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.integration.ModHelper;
|
||||
|
||||
import xonin.backhand.api.core.BackhandUtils;
|
||||
|
||||
public class ModelDraconicArmor extends ModelBiped {
|
||||
|
||||
@@ -45,16 +49,42 @@ public class ModelDraconicArmor extends ModelBiped {
|
||||
this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F, 0.0F);
|
||||
this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F);
|
||||
|
||||
|
||||
this.head = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/DraconicHelmet.obj"), ResourceHandler.getResource("textures/models/armor/DraconicHelmet.png"));
|
||||
this.body = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/DraconicBody.obj"), ResourceHandler.getResource("textures/models/armor/DraconicBody.png"));
|
||||
this.rightArm = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/DraconicRightArm.obj"), ResourceHandler.getResource("textures/models/armor/DraconicRightArm.png"));
|
||||
this.leftArm = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/DraconicLeftArm.obj"), ResourceHandler.getResource("textures/models/armor/DraconicLeftArm.png"));
|
||||
this.belt = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/DraconicBelt.obj"), ResourceHandler.getResource("textures/models/armor/DraconicBelt.png"));
|
||||
this.rightLeg = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/DraconicRightLeg.obj"), ResourceHandler.getResource("textures/models/armor/DraconicRightLeg.png"));
|
||||
this.leftLeg = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/DraconicLeftLeg.obj"), ResourceHandler.getResource("textures/models/armor/DraconicLeftLeg.png"));
|
||||
this.rightBoot = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/DraconicRightBoot.obj"), ResourceHandler.getResource("textures/models/armor/DraconicRightBoot.png"));
|
||||
this.leftBoot = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/DraconicLeftBoot.obj"), ResourceHandler.getResource("textures/models/armor/DraconicLeftBoot.png"));
|
||||
this.head = new ModelRenderOBJ(
|
||||
this,
|
||||
ResourceHandler.getResource("models/armor/DraconicHelmet.obj"),
|
||||
ResourceHandler.getResource("textures/models/armor/DraconicHelmet.png"));
|
||||
this.body = new ModelRenderOBJ(
|
||||
this,
|
||||
ResourceHandler.getResource("models/armor/DraconicBody.obj"),
|
||||
ResourceHandler.getResource("textures/models/armor/DraconicBody.png"));
|
||||
this.rightArm = new ModelRenderOBJ(
|
||||
this,
|
||||
ResourceHandler.getResource("models/armor/DraconicRightArm.obj"),
|
||||
ResourceHandler.getResource("textures/models/armor/DraconicRightArm.png"));
|
||||
this.leftArm = new ModelRenderOBJ(
|
||||
this,
|
||||
ResourceHandler.getResource("models/armor/DraconicLeftArm.obj"),
|
||||
ResourceHandler.getResource("textures/models/armor/DraconicLeftArm.png"));
|
||||
this.belt = new ModelRenderOBJ(
|
||||
this,
|
||||
ResourceHandler.getResource("models/armor/DraconicBelt.obj"),
|
||||
ResourceHandler.getResource("textures/models/armor/DraconicBelt.png"));
|
||||
this.rightLeg = new ModelRenderOBJ(
|
||||
this,
|
||||
ResourceHandler.getResource("models/armor/DraconicRightLeg.obj"),
|
||||
ResourceHandler.getResource("textures/models/armor/DraconicRightLeg.png"));
|
||||
this.leftLeg = new ModelRenderOBJ(
|
||||
this,
|
||||
ResourceHandler.getResource("models/armor/DraconicLeftLeg.obj"),
|
||||
ResourceHandler.getResource("textures/models/armor/DraconicLeftLeg.png"));
|
||||
this.rightBoot = new ModelRenderOBJ(
|
||||
this,
|
||||
ResourceHandler.getResource("models/armor/DraconicRightBoot.obj"),
|
||||
ResourceHandler.getResource("textures/models/armor/DraconicRightBoot.png"));
|
||||
this.leftBoot = new ModelRenderOBJ(
|
||||
this,
|
||||
ResourceHandler.getResource("models/armor/DraconicLeftBoot.obj"),
|
||||
ResourceHandler.getResource("textures/models/armor/DraconicLeftBoot.png"));
|
||||
|
||||
this.bipedHead.cubeList.clear();
|
||||
this.bipedHeadwear.cubeList.clear();
|
||||
@@ -113,7 +143,6 @@ public class ModelDraconicArmor extends ModelBiped {
|
||||
this.bipedLeftLeg.addChild(leftBoot);
|
||||
this.bipedRightLeg.addChild(rightBoot);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -148,7 +177,14 @@ public class ModelDraconicArmor extends ModelBiped {
|
||||
bipedRightLeg.rotateAngleZ = 0F;
|
||||
|
||||
setRotationAngles(0, 0, 0, 0, 0, 0, null);
|
||||
} else super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
} else {
|
||||
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
if (entity instanceof EntityPlayer) {
|
||||
if (ModHelper.isBackhandLoaded) {
|
||||
BackhandHelper.applyFix(this, (EntityPlayer) entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.bipedHead.render(1F / 13F);
|
||||
this.bipedRightArm.render(1F / 15F);
|
||||
@@ -158,7 +194,8 @@ public class ModelDraconicArmor extends ModelBiped {
|
||||
this.bipedLeftLeg.render(1F / 16F);
|
||||
}
|
||||
|
||||
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) {
|
||||
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_,
|
||||
float p_78087_5_, float p_78087_6_, Entity p_78087_7_) {
|
||||
this.bipedRightArm.rotateAngleZ = 0.0F;
|
||||
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
||||
this.bipedRightArm.rotationPointZ = 0.0F;
|
||||
@@ -179,4 +216,14 @@ public class ModelDraconicArmor extends ModelBiped {
|
||||
this.bipedRightArm.rotateAngleZ = 0.0F;
|
||||
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
||||
}
|
||||
|
||||
private static class BackhandHelper {
|
||||
|
||||
public static void applyFix(ModelDraconicArmor model, EntityPlayer player) {
|
||||
if (BackhandUtils.getOffhandItem(player) != null) {
|
||||
model.bipedLeftArm.rotateAngleX = model.bipedLeftArm.rotateAngleX * 0.5F - ((float) Math.PI / 10F);
|
||||
model.bipedLeftArm.rotateAngleY = 0.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+29
-30
@@ -5,16 +5,16 @@ import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
/**
|
||||
* Draconic Armor.tcn - TechneToTabulaImporter
|
||||
* Created using Tabula 5.0.0
|
||||
* Draconic Armor.tcn - TechneToTabulaImporter Created using Tabula 5.0.0
|
||||
*/
|
||||
public class ModelDraconicArmorOld extends ModelBiped {//
|
||||
// public ModelRenderer bipedHead;
|
||||
// public ModelRenderer bipedBody;
|
||||
// public ModelRenderer bipedRightArm;
|
||||
// public ModelRenderer bipedLeftArm;
|
||||
// public ModelRenderer bipedRightLeg;/
|
||||
// public ModelRenderer bipedLeftLeg;
|
||||
public class ModelDraconicArmorOld extends ModelBiped { //
|
||||
// public ModelRenderer bipedHead;
|
||||
// public ModelRenderer bipedBody;
|
||||
// public ModelRenderer bipedRightArm;
|
||||
// public ModelRenderer bipedLeftArm;
|
||||
// public ModelRenderer bipedRightLeg;/
|
||||
// public ModelRenderer bipedLeftLeg;
|
||||
|
||||
public ModelRenderer MainHelmPieceRight1;
|
||||
public ModelRenderer MainHelmPieceRight2;
|
||||
public ModelRenderer MainHelmPieceLeft1;
|
||||
@@ -84,7 +84,7 @@ public class ModelDraconicArmorOld extends ModelBiped {//
|
||||
public ModelRenderer BootPieceRight4;
|
||||
public ModelRenderer LeggsTop;
|
||||
|
||||
//Draconic Specific
|
||||
// Draconic Specific
|
||||
public ModelRenderer DrMainChestPieceTop;
|
||||
public ModelRenderer DrMainChestPieceMid;
|
||||
public ModelRenderer DrChestDecorationPiece1;
|
||||
@@ -94,7 +94,7 @@ public class ModelDraconicArmorOld extends ModelBiped {//
|
||||
public ModelRenderer BeltLeft;
|
||||
public ModelRenderer BeltRight;
|
||||
public ModelRenderer BeltBuckle;
|
||||
//Wyvern Specific
|
||||
// Wyvern Specific
|
||||
public ModelRenderer WyHelmPieceTop1;
|
||||
public ModelRenderer WyHelmPieceTop2;
|
||||
public ModelRenderer WyHelmPieceTop3;
|
||||
@@ -108,13 +108,14 @@ public class ModelDraconicArmorOld extends ModelBiped {//
|
||||
|
||||
private boolean isDraconic;
|
||||
|
||||
public ModelDraconicArmorOld(float f, boolean isHelmet, boolean isChestPiece, boolean isLeggings, boolean isdBoots, boolean isDraconic) {
|
||||
public ModelDraconicArmorOld(float f, boolean isHelmet, boolean isChestPiece, boolean isLeggings, boolean isdBoots,
|
||||
boolean isDraconic) {
|
||||
super(f, 0.0f, 128, 128);
|
||||
this.textureWidth = 256;
|
||||
this.textureHeight = 128;
|
||||
this.isDraconic = isDraconic;
|
||||
|
||||
/* Helm */
|
||||
/* Helm */
|
||||
{
|
||||
this.bipedHead = new ModelRenderer(this, 0, 0);
|
||||
this.bipedHead.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
@@ -178,7 +179,6 @@ public class ModelDraconicArmorOld extends ModelBiped {//
|
||||
this.MainHelmPieceFrontTop.setRotationPoint(-4.0F, -8.0F, -5.0F);
|
||||
this.MainHelmPieceFrontTop.addBox(0.0F, 0.0F, 0.0F, 8, 2, 1, 0.0F);
|
||||
|
||||
|
||||
this.HornPieceLeft1 = new ModelRenderer(this, 182, 40);
|
||||
this.HornPieceLeft1.setRotationPoint(4.0F, -7.5F, -1.0F);
|
||||
this.HornPieceLeft1.addBox(0.0F, 0.0F, 0.0F, 1, 4, 4, 0.0F);
|
||||
@@ -238,7 +238,7 @@ public class ModelDraconicArmorOld extends ModelBiped {//
|
||||
this.setRotateAngle(WyHelmPieceTop4, -0.20943951023931953F, -0.0F, 0.0F);
|
||||
}
|
||||
|
||||
/* Chest */
|
||||
/* Chest */
|
||||
{
|
||||
this.bipedBody = new ModelRenderer(this, 16, 16);
|
||||
this.bipedBody.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
@@ -270,7 +270,11 @@ public class ModelDraconicArmorOld extends ModelBiped {//
|
||||
this.DrChestDecorationPiece1 = new ModelRenderer(this, 244, 38);
|
||||
this.DrChestDecorationPiece1.setRotationPoint(0.0F, -0.5F, -4.0F);
|
||||
this.DrChestDecorationPiece1.addBox(0.0F, 0.0F, -0.5F, 5, 5, 1, 0.0F);
|
||||
this.setRotateAngle(DrChestDecorationPiece1, 0.1426609064282019F, -0.13533507716461618F, 0.7946695004338321F);
|
||||
this.setRotateAngle(
|
||||
DrChestDecorationPiece1,
|
||||
0.1426609064282019F,
|
||||
-0.13533507716461618F,
|
||||
0.7946695004338321F);
|
||||
|
||||
this.ChestDecorationPiece2 = new ModelRenderer(this, 229, 38);
|
||||
this.ChestDecorationPiece2.setRotationPoint(-3.0F, 7.0F, -3.0F);
|
||||
@@ -325,7 +329,7 @@ public class ModelDraconicArmorOld extends ModelBiped {//
|
||||
this.BeltLeft.setRotationPoint(3.7F, 10.01F, -2.2F);
|
||||
this.BeltLeft.addBox(0.0F, 0.0F, -0.3F, 1, 2, 5, 0.0F);
|
||||
|
||||
//Left
|
||||
// Left
|
||||
this.bipedLeftArm = new ModelRenderer(this, 40, 16);
|
||||
this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F);
|
||||
this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F);
|
||||
@@ -382,8 +386,7 @@ public class ModelDraconicArmorOld extends ModelBiped {//
|
||||
this.ArmStrapLeftBottom.setRotationPoint(-1.5F, 7.0F, -2.5F);
|
||||
this.ArmStrapLeftBottom.addBox(0.0F, 0.0F, 0.0F, 2, 1, 5, 0.0F);
|
||||
|
||||
|
||||
//Right
|
||||
// Right
|
||||
this.MainArmGuardRight = new ModelRenderer(this, 240, 72);
|
||||
this.MainArmGuardRight.setRotationPoint(-3.5F, 3.0F, -2.5F);
|
||||
this.MainArmGuardRight.addBox(0.0F, 0.0F, 0.0F, 3, 5, 5, 0.0F);
|
||||
@@ -440,12 +443,12 @@ public class ModelDraconicArmorOld extends ModelBiped {//
|
||||
this.ArmStrapRightBottom.addBox(0.0F, 0.0F, 0.0F, 2, 1, 5, 0.0F);
|
||||
}
|
||||
|
||||
/* Leggs */
|
||||
/* Leggs */
|
||||
{
|
||||
this.LeggsTop = new ModelRenderer(this, 121, 15);
|
||||
this.LeggsTop.setRotationPoint(0.5F, 8.0F, -2.4F);
|
||||
this.LeggsTop.addBox(-5.0F, 0.0F, 0.0F, 9, 4, 5, 0.0F);
|
||||
//Left
|
||||
// Left
|
||||
this.bipedLeftLeg = new ModelRenderer(this, 0, 16);
|
||||
this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F, 0.0F);
|
||||
this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F);
|
||||
@@ -471,7 +474,7 @@ public class ModelDraconicArmorOld extends ModelBiped {//
|
||||
this.KneePieceLeft1.setRotationPoint(-0.5F, 2.0F, -2.7F);
|
||||
this.KneePieceLeft1.addBox(0.0F, 0.0F, 0.0F, 1, 4, 1, 0.0F);
|
||||
|
||||
//Right
|
||||
// Right
|
||||
this.bipedRightLeg = new ModelRenderer(this, 0, 16);
|
||||
this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F, 0.0F);
|
||||
this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F);
|
||||
@@ -496,12 +499,11 @@ public class ModelDraconicArmorOld extends ModelBiped {//
|
||||
this.KneePieceRight1 = new ModelRenderer(this, 156, 15);
|
||||
this.KneePieceRight1.setRotationPoint(-0.5F, 2.0F, -2.7F);
|
||||
this.KneePieceRight1.addBox(0.0F, 0.0F, 0.0F, 1, 4, 1, 0.0F);
|
||||
|
||||
}
|
||||
|
||||
/* Boots */
|
||||
/* Boots */
|
||||
{
|
||||
//Left
|
||||
// Left
|
||||
this.MainBootPieceLeft = new ModelRenderer(this, 119, 0);
|
||||
this.MainBootPieceLeft.setRotationPoint(-2.0F, 9.1F, -2.5F);
|
||||
this.MainBootPieceLeft.addBox(0.0F, 0.0F, 0.0F, 4, 3, 5, 0.0F);
|
||||
@@ -523,7 +525,7 @@ public class ModelDraconicArmorOld extends ModelBiped {//
|
||||
this.BootPieceLeft4.setRotationPoint(-2.5F, 9.05F, -2.0F);
|
||||
this.BootPieceLeft4.addBox(0.0F, 0.0F, 0.0F, 1, 3, 4, 0.0F);
|
||||
|
||||
//Right
|
||||
// Right
|
||||
this.MainBootPieceRight = new ModelRenderer(this, 119, 0);
|
||||
this.MainBootPieceRight.setRotationPoint(-2.0F, 9.1F, -2.5F);
|
||||
this.MainBootPieceRight.addBox(0.0F, 0.0F, 0.0F, 4, 3, 5, 0.0F);
|
||||
@@ -546,7 +548,6 @@ public class ModelDraconicArmorOld extends ModelBiped {//
|
||||
this.BootPieceRight4.addBox(0.0F, 0.0F, 0.0F, 1, 3, 4, 0.0F);
|
||||
}
|
||||
|
||||
|
||||
this.bipedHead.cubeList.clear();
|
||||
this.bipedHeadwear.cubeList.clear();
|
||||
if (isHelmet) {
|
||||
@@ -659,7 +660,6 @@ public class ModelDraconicArmorOld extends ModelBiped {//
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isdBoots) {
|
||||
this.bipedLeftLeg.addChild(this.MainBootPieceLeft);
|
||||
this.bipedLeftLeg.addChild(this.BootPieceLeft2);
|
||||
@@ -673,14 +673,13 @@ public class ModelDraconicArmorOld extends ModelBiped {//
|
||||
this.bipedRightLeg.addChild(this.BootPieceRight3);
|
||||
this.bipedRightLeg.addChild(this.BootPieceRight4);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
this.bipedRightLeg.render(f5);
|
||||
this.bipedBody.render(f5 * 1.05F);// * 1.1F);
|
||||
this.bipedBody.render(f5 * 1.05F); // * 1.1F);
|
||||
this.bipedLeftArm.render(f5);
|
||||
this.bipedRightArm.render(f5);
|
||||
this.bipedLeftLeg.render(f5);
|
||||
|
||||
+8
-4
@@ -4,13 +4,14 @@ import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
* ModelReactorPowerInjector - brandon3055
|
||||
* Created using Tabula 5.0.0
|
||||
* ModelReactorPowerInjector - brandon3055 Created using Tabula 5.0.0
|
||||
*/
|
||||
public class ModelReactorEnergyInjector extends ModelBase {
|
||||
|
||||
public ModelRenderer BasePlate;
|
||||
public ModelRenderer shape14;
|
||||
public ModelRenderer coreSupports;
|
||||
@@ -158,7 +159,7 @@ public class ModelReactorEnergyInjector extends ModelBase {
|
||||
public void render(Entity entity, float brightness, float f1, float f2, float f3, float f4, float f5) {
|
||||
this.support1.render(f5);
|
||||
this.BasePlate.render(f5);
|
||||
//this.coreSupports.render(f5);
|
||||
// this.coreSupports.render(f5);
|
||||
|
||||
float lastBrightnessX = OpenGlHelper.lastBrightnessX;
|
||||
float lastBrightnessY = OpenGlHelper.lastBrightnessY;
|
||||
@@ -166,7 +167,10 @@ public class ModelReactorEnergyInjector extends ModelBase {
|
||||
float b = brightness * 200F;
|
||||
float colour = Math.min(2F, (brightness * 2F) + 0.5F);
|
||||
if (brightness > 0F) GL11.glDisable(GL11.GL_LIGHTING);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, Math.min(200F, lastBrightnessX + b), Math.min(200F, lastBrightnessY + b));
|
||||
OpenGlHelper.setLightmapTextureCoords(
|
||||
OpenGlHelper.lightmapTexUnit,
|
||||
Math.min(200F, lastBrightnessX + b),
|
||||
Math.min(200F, lastBrightnessY + b));
|
||||
GL11.glColor4f(colour, colour, colour, 1F);
|
||||
this.element1.render(f5);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
|
||||
+7
-3
@@ -4,13 +4,14 @@ import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
* ReactorStabilizerCore - brandon3055
|
||||
* Created using Tabula 5.0.0
|
||||
* ReactorStabilizerCore - brandon3055 Created using Tabula 5.0.0
|
||||
*/
|
||||
public class ModelReactorStabilizerCore extends ModelBase {
|
||||
|
||||
public ModelRenderer hub1;
|
||||
public ModelRenderer hub2;
|
||||
public ModelRenderer rotor1R;
|
||||
@@ -269,7 +270,10 @@ public class ModelReactorStabilizerCore extends ModelBase {
|
||||
float colour = Math.min(2F, (brightness * 2F) + 0.1F);
|
||||
if (brightness > 0F) GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, Math.min(200F, lastBrightnessX + b), Math.min(200F, lastBrightnessY + b));
|
||||
OpenGlHelper.setLightmapTextureCoords(
|
||||
OpenGlHelper.lightmapTexUnit,
|
||||
Math.min(200F, lastBrightnessX + b),
|
||||
Math.min(200F, lastBrightnessY + b));
|
||||
GL11.glColor4f(colour, colour, colour, 1F);
|
||||
this.rotor2R.render(f5);
|
||||
GL11.glRotatef(rotation * 2F, 0F, 0F, 1F);
|
||||
|
||||
+76
-25
@@ -4,13 +4,14 @@ import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
* EnergyStabilizer - brandon3055
|
||||
* Created using Tabula 5.0.0
|
||||
* EnergyStabilizer - brandon3055 Created using Tabula 5.0.0
|
||||
*/
|
||||
public class ModelReactorStabilizerRing extends ModelBase {
|
||||
|
||||
public ModelRenderer ringElement1;
|
||||
public ModelRenderer ringElement2;
|
||||
public ModelRenderer ringElement3;
|
||||
@@ -114,7 +115,8 @@ public class ModelReactorStabilizerRing extends ModelBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float embitterRotation, float brightness, float f2, float f3, float f4, float scale) {
|
||||
public void render(Entity entity, float embitterRotation, float brightness, float f2, float f3, float f4,
|
||||
float scale) {
|
||||
|
||||
this.ringElement1.render(scale);
|
||||
this.ringElement2.render(scale);
|
||||
@@ -131,84 +133,135 @@ public class ModelReactorStabilizerRing extends ModelBase {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(this.hing1.offsetX, this.hing1.offsetY, this.hing1.offsetZ);
|
||||
GL11.glTranslated(this.hing1.rotationPointX * scale, this.hing1.rotationPointY * scale, this.hing1.rotationPointZ * scale);
|
||||
GL11.glTranslated(
|
||||
this.hing1.rotationPointX * scale,
|
||||
this.hing1.rotationPointY * scale,
|
||||
this.hing1.rotationPointZ * scale);
|
||||
GL11.glScaled(0.5D, 0.5D, 0.5D);
|
||||
GL11.glTranslated(-this.hing1.offsetX, -this.hing1.offsetY, -this.hing1.offsetZ);
|
||||
GL11.glTranslated(-this.hing1.rotationPointX * scale, -this.hing1.rotationPointY * scale, -this.hing1.rotationPointZ * scale);
|
||||
GL11.glTranslated(
|
||||
-this.hing1.rotationPointX * scale,
|
||||
-this.hing1.rotationPointY * scale,
|
||||
-this.hing1.rotationPointZ * scale);
|
||||
this.hing1.render(scale);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(this.hing2.offsetX, this.hing2.offsetY, this.hing2.offsetZ);
|
||||
GL11.glTranslated(this.hing2.rotationPointX * scale, this.hing2.rotationPointY * scale, this.hing2.rotationPointZ * scale);
|
||||
GL11.glTranslated(
|
||||
this.hing2.rotationPointX * scale,
|
||||
this.hing2.rotationPointY * scale,
|
||||
this.hing2.rotationPointZ * scale);
|
||||
GL11.glScaled(0.5D, 0.5D, 0.5D);
|
||||
GL11.glTranslated(-this.hing2.offsetX, -this.hing2.offsetY, -this.hing2.offsetZ);
|
||||
GL11.glTranslated(-this.hing2.rotationPointX * scale, -this.hing2.rotationPointY * scale, -this.hing2.rotationPointZ * scale);
|
||||
GL11.glTranslated(
|
||||
-this.hing2.rotationPointX * scale,
|
||||
-this.hing2.rotationPointY * scale,
|
||||
-this.hing2.rotationPointZ * scale);
|
||||
this.hing2.render(scale);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(this.hing3.offsetX, this.hing3.offsetY, this.hing3.offsetZ);
|
||||
GL11.glTranslated(this.hing3.rotationPointX * scale, this.hing3.rotationPointY * scale, this.hing3.rotationPointZ * scale);
|
||||
GL11.glTranslated(
|
||||
this.hing3.rotationPointX * scale,
|
||||
this.hing3.rotationPointY * scale,
|
||||
this.hing3.rotationPointZ * scale);
|
||||
GL11.glScaled(0.5D, 0.5D, 0.5D);
|
||||
GL11.glTranslated(-this.hing3.offsetX, -this.hing3.offsetY, -this.hing3.offsetZ);
|
||||
GL11.glTranslated(-this.hing3.rotationPointX * scale, -this.hing3.rotationPointY * scale, -this.hing3.rotationPointZ * scale);
|
||||
GL11.glTranslated(
|
||||
-this.hing3.rotationPointX * scale,
|
||||
-this.hing3.rotationPointY * scale,
|
||||
-this.hing3.rotationPointZ * scale);
|
||||
this.hing3.render(scale);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(this.hing4.offsetX, this.hing4.offsetY, this.hing4.offsetZ);
|
||||
GL11.glTranslated(this.hing4.rotationPointX * scale, this.hing4.rotationPointY * scale, this.hing4.rotationPointZ * scale);
|
||||
GL11.glTranslated(
|
||||
this.hing4.rotationPointX * scale,
|
||||
this.hing4.rotationPointY * scale,
|
||||
this.hing4.rotationPointZ * scale);
|
||||
GL11.glScaled(0.5D, 0.5D, 0.5D);
|
||||
GL11.glTranslated(-this.hing4.offsetX, -this.hing4.offsetY, -this.hing4.offsetZ);
|
||||
GL11.glTranslated(-this.hing4.rotationPointX * scale, -this.hing4.rotationPointY * scale, -this.hing4.rotationPointZ * scale);
|
||||
GL11.glTranslated(
|
||||
-this.hing4.rotationPointX * scale,
|
||||
-this.hing4.rotationPointY * scale,
|
||||
-this.hing4.rotationPointZ * scale);
|
||||
this.hing4.render(scale);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
// float lastBrightnessX = OpenGlHelper.lastBrightnessX;
|
||||
// float lastBrightnessY = OpenGlHelper.lastBrightnessY;
|
||||
// OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200F, 200F);
|
||||
// float lastBrightnessX = OpenGlHelper.lastBrightnessX;
|
||||
// float lastBrightnessY = OpenGlHelper.lastBrightnessY;
|
||||
// OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200F, 200F);
|
||||
float lastBrightnessX = OpenGlHelper.lastBrightnessX;
|
||||
float lastBrightnessY = OpenGlHelper.lastBrightnessY;
|
||||
|
||||
float b = brightness * 200F;
|
||||
float colour = Math.min(2F, (brightness * 2F) + 0.1F);
|
||||
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, Math.min(200F, lastBrightnessX + b), Math.min(200F, lastBrightnessY + b));
|
||||
OpenGlHelper.setLightmapTextureCoords(
|
||||
OpenGlHelper.lightmapTexUnit,
|
||||
Math.min(200F, lastBrightnessX + b),
|
||||
Math.min(200F, lastBrightnessY + b));
|
||||
GL11.glColor4f(colour, colour, colour, 1F);
|
||||
if (brightness > 0F) GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(this.emitter1.offsetX, this.emitter1.offsetY, this.emitter1.offsetZ);
|
||||
GL11.glTranslated(this.emitter1.rotationPointX * scale, this.emitter1.rotationPointY * scale, this.emitter1.rotationPointZ * scale);
|
||||
GL11.glTranslated(
|
||||
this.emitter1.rotationPointX * scale,
|
||||
this.emitter1.rotationPointY * scale,
|
||||
this.emitter1.rotationPointZ * scale);
|
||||
GL11.glRotatef(embitterRotation, 0, 0, 1);
|
||||
GL11.glScaled(0.5D, 0.5D, 0.5D);
|
||||
GL11.glTranslated(-this.emitter1.offsetX, -this.emitter1.offsetY, -this.emitter1.offsetZ);
|
||||
GL11.glTranslated(-this.emitter1.rotationPointX * scale, -this.emitter1.rotationPointY * scale, -this.emitter1.rotationPointZ * scale);
|
||||
GL11.glTranslated(
|
||||
-this.emitter1.rotationPointX * scale,
|
||||
-this.emitter1.rotationPointY * scale,
|
||||
-this.emitter1.rotationPointZ * scale);
|
||||
this.emitter1.render(scale);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(this.emitter2.offsetX, this.emitter2.offsetY, this.emitter2.offsetZ);
|
||||
GL11.glTranslated(this.emitter2.rotationPointX * scale, this.emitter2.rotationPointY * scale, this.emitter2.rotationPointZ * scale);
|
||||
GL11.glTranslated(
|
||||
this.emitter2.rotationPointX * scale,
|
||||
this.emitter2.rotationPointY * scale,
|
||||
this.emitter2.rotationPointZ * scale);
|
||||
GL11.glRotatef(embitterRotation, 0, 0, -1);
|
||||
GL11.glScaled(0.5D, 0.5D, 0.5D);
|
||||
GL11.glTranslated(-this.emitter2.offsetX, -this.emitter2.offsetY, -this.emitter2.offsetZ);
|
||||
GL11.glTranslated(-this.emitter2.rotationPointX * scale, -this.emitter2.rotationPointY * scale, -this.emitter2.rotationPointZ * scale);
|
||||
GL11.glTranslated(
|
||||
-this.emitter2.rotationPointX * scale,
|
||||
-this.emitter2.rotationPointY * scale,
|
||||
-this.emitter2.rotationPointZ * scale);
|
||||
this.emitter2.render(scale);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(this.emitter3.offsetX, this.emitter3.offsetY, this.emitter3.offsetZ);
|
||||
GL11.glTranslated(this.emitter3.rotationPointX * scale, this.emitter3.rotationPointY * scale, this.emitter3.rotationPointZ * scale);
|
||||
GL11.glTranslated(
|
||||
this.emitter3.rotationPointX * scale,
|
||||
this.emitter3.rotationPointY * scale,
|
||||
this.emitter3.rotationPointZ * scale);
|
||||
GL11.glRotatef(embitterRotation, 1, 0, 0);
|
||||
GL11.glScaled(0.5D, 0.5D, 0.5D);
|
||||
GL11.glTranslated(-this.emitter3.offsetX, -this.emitter3.offsetY, -this.emitter3.offsetZ);
|
||||
GL11.glTranslated(-this.emitter3.rotationPointX * scale, -this.emitter3.rotationPointY * scale, -this.emitter3.rotationPointZ * scale);
|
||||
GL11.glTranslated(
|
||||
-this.emitter3.rotationPointX * scale,
|
||||
-this.emitter3.rotationPointY * scale,
|
||||
-this.emitter3.rotationPointZ * scale);
|
||||
this.emitter3.render(scale);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(this.emitter4.offsetX, this.emitter4.offsetY, this.emitter4.offsetZ);
|
||||
GL11.glTranslated(this.emitter4.rotationPointX * scale, this.emitter4.rotationPointY * scale, this.emitter4.rotationPointZ * scale);
|
||||
GL11.glTranslated(
|
||||
this.emitter4.rotationPointX * scale,
|
||||
this.emitter4.rotationPointY * scale,
|
||||
this.emitter4.rotationPointZ * scale);
|
||||
GL11.glRotatef(embitterRotation, -1, 0, 0);
|
||||
GL11.glScaled(0.5D, 0.5D, 0.5D);
|
||||
GL11.glTranslated(-this.emitter4.offsetX, -this.emitter4.offsetY, -this.emitter4.offsetZ);
|
||||
GL11.glTranslated(-this.emitter4.rotationPointX * scale, -this.emitter4.rotationPointY * scale, -this.emitter4.rotationPointZ * scale);
|
||||
GL11.glTranslated(
|
||||
-this.emitter4.rotationPointX * scale,
|
||||
-this.emitter4.rotationPointY * scale,
|
||||
-this.emitter4.rotationPointZ * scale);
|
||||
this.emitter4.render(scale);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -226,6 +279,4 @@ public class ModelReactorStabilizerRing extends ModelBase {
|
||||
modelRenderer.rotateAngleY = y;
|
||||
modelRenderer.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,18 +1,21 @@
|
||||
package com.brandon3055.draconicevolution.client.model;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
|
||||
/**
|
||||
* Created by brandon3055 on 16/9/2015.
|
||||
*/
|
||||
public class ModelRenderOBJ extends ModelRenderer {
|
||||
|
||||
private IModelCustom model;
|
||||
private ResourceLocation texture;
|
||||
private int displayList;
|
||||
@@ -32,19 +35,29 @@ public class ModelRenderOBJ extends ModelRenderer {
|
||||
this.compileDisplayList(scale);
|
||||
}
|
||||
|
||||
ResourceHandler.bindTexture(texture);
|
||||
GL11.glTranslatef(this.offsetX, this.offsetY, this.offsetZ);
|
||||
|
||||
if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) {
|
||||
if (this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F) {
|
||||
GL11.glCallList(this.displayList);
|
||||
} else {
|
||||
GL11.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
|
||||
GL11.glTranslatef(
|
||||
this.rotationPointX * scale,
|
||||
this.rotationPointY * scale,
|
||||
this.rotationPointZ * scale);
|
||||
GL11.glCallList(this.displayList);
|
||||
GL11.glTranslatef(-this.rotationPointX * scale, -this.rotationPointY * scale, -this.rotationPointZ * scale);
|
||||
GL11.glTranslatef(
|
||||
-this.rotationPointX * scale,
|
||||
-this.rotationPointY * scale,
|
||||
-this.rotationPointZ * scale);
|
||||
}
|
||||
} else {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
|
||||
GL11.glTranslatef(
|
||||
this.rotationPointX * scale,
|
||||
this.rotationPointY * scale,
|
||||
this.rotationPointZ * scale);
|
||||
if (this.rotateAngleZ != 0.0F) {
|
||||
GL11.glRotatef(this.rotateAngleZ * 57.295776F, 0.0F, 0.0F, 1.0F);
|
||||
}
|
||||
@@ -63,7 +76,6 @@ public class ModelRenderOBJ extends ModelRenderer {
|
||||
|
||||
GL11.glTranslatef(-this.offsetX, -this.offsetY, -this.offsetZ);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void compileDisplayList(float scale) {
|
||||
@@ -73,8 +85,7 @@ public class ModelRenderOBJ extends ModelRenderer {
|
||||
GL11.glNewList(this.displayList, GL11.GL_COMPILE);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
ResourceHandler.bindTexture(texture);
|
||||
//scale = 1F/15F;
|
||||
// scale = 1F/15F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
GL11.glRotatef(180, -1, 0, 1);
|
||||
model.renderAll();
|
||||
@@ -91,6 +102,7 @@ public class ModelRenderOBJ extends ModelRenderer {
|
||||
this.compileDisplayList(scale);
|
||||
}
|
||||
|
||||
ResourceHandler.bindTexture(texture);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
|
||||
if (this.rotateAngleY != 0.0F) {
|
||||
@@ -108,22 +120,27 @@ public class ModelRenderOBJ extends ModelRenderer {
|
||||
GL11.glCallList(this.displayList);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postRender(float scale) {
|
||||
if (!this.isHidden && this.showModel) {
|
||||
// if(!this.compiled) {
|
||||
// this.compileDisplayList(scale);
|
||||
// }
|
||||
// if(!this.compiled) {
|
||||
// this.compileDisplayList(scale);
|
||||
// }
|
||||
|
||||
if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) {
|
||||
if (this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F) {
|
||||
GL11.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
|
||||
GL11.glTranslatef(
|
||||
this.rotationPointX * scale,
|
||||
this.rotationPointY * scale,
|
||||
this.rotationPointZ * scale);
|
||||
}
|
||||
} else {
|
||||
GL11.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
|
||||
GL11.glTranslatef(
|
||||
this.rotationPointX * scale,
|
||||
this.rotationPointY * scale,
|
||||
this.rotationPointZ * scale);
|
||||
if (this.rotateAngleZ != 0.0F) {
|
||||
GL11.glRotatef(this.rotateAngleZ * 57.295776F, 0.0F, 0.0F, 1.0F);
|
||||
}
|
||||
@@ -137,6 +154,5 @@ public class ModelRenderOBJ extends ModelRenderer {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,6 @@ public class ModelTeleporterStand extends ModelBase {
|
||||
baseBottom.setRotationPoint(-5F, 7F, -5F);
|
||||
baseBottom.setTextureSize(64, 64);
|
||||
setRotationDegree(baseBottom, 0, 0, 0);
|
||||
|
||||
}
|
||||
|
||||
public void render() {
|
||||
|
||||
+39
-13
@@ -1,10 +1,10 @@
|
||||
package com.brandon3055.draconicevolution.client.model;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
|
||||
public class ModelWyvernArmor extends ModelBiped {
|
||||
|
||||
@@ -45,16 +45,42 @@ public class ModelWyvernArmor extends ModelBiped {
|
||||
this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F, 0.0F);
|
||||
this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F);
|
||||
|
||||
|
||||
this.head = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/WyvernHelmet.obj"), ResourceHandler.getResource("textures/models/armor/WyvernHelmet.png"));
|
||||
this.body = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/WyvernBody.obj"), ResourceHandler.getResource("textures/models/armor/WyvernBody.png"));
|
||||
this.rightArm = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/WyvernRightArm.obj"), ResourceHandler.getResource("textures/models/armor/WyvernRightArm.png"));
|
||||
this.leftArm = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/WyvernLeftArm.obj"), ResourceHandler.getResource("textures/models/armor/WyvernLeftArm.png"));
|
||||
this.belt = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/WyvernBelt.obj"), ResourceHandler.getResource("textures/models/armor/WyvernBelt.png"));
|
||||
this.rightLeg = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/WyvernRightLeg.obj"), ResourceHandler.getResource("textures/models/armor/WyvernRightLeg.png"));
|
||||
this.leftLeg = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/WyvernLeftLeg.obj"), ResourceHandler.getResource("textures/models/armor/WyvernLeftLeg.png"));
|
||||
this.rightBoot = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/WyvernRightBoot.obj"), ResourceHandler.getResource("textures/models/armor/WyvernRightBoot.png"));
|
||||
this.leftBoot = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/WyvernLeftBoot.obj"), ResourceHandler.getResource("textures/models/armor/WyvernLeftBoot.png"));
|
||||
this.head = new ModelRenderOBJ(
|
||||
this,
|
||||
ResourceHandler.getResource("models/armor/WyvernHelmet.obj"),
|
||||
ResourceHandler.getResource("textures/models/armor/WyvernHelmet.png"));
|
||||
this.body = new ModelRenderOBJ(
|
||||
this,
|
||||
ResourceHandler.getResource("models/armor/WyvernBody.obj"),
|
||||
ResourceHandler.getResource("textures/models/armor/WyvernBody.png"));
|
||||
this.rightArm = new ModelRenderOBJ(
|
||||
this,
|
||||
ResourceHandler.getResource("models/armor/WyvernRightArm.obj"),
|
||||
ResourceHandler.getResource("textures/models/armor/WyvernRightArm.png"));
|
||||
this.leftArm = new ModelRenderOBJ(
|
||||
this,
|
||||
ResourceHandler.getResource("models/armor/WyvernLeftArm.obj"),
|
||||
ResourceHandler.getResource("textures/models/armor/WyvernLeftArm.png"));
|
||||
this.belt = new ModelRenderOBJ(
|
||||
this,
|
||||
ResourceHandler.getResource("models/armor/WyvernBelt.obj"),
|
||||
ResourceHandler.getResource("textures/models/armor/WyvernBelt.png"));
|
||||
this.rightLeg = new ModelRenderOBJ(
|
||||
this,
|
||||
ResourceHandler.getResource("models/armor/WyvernRightLeg.obj"),
|
||||
ResourceHandler.getResource("textures/models/armor/WyvernRightLeg.png"));
|
||||
this.leftLeg = new ModelRenderOBJ(
|
||||
this,
|
||||
ResourceHandler.getResource("models/armor/WyvernLeftLeg.obj"),
|
||||
ResourceHandler.getResource("textures/models/armor/WyvernLeftLeg.png"));
|
||||
this.rightBoot = new ModelRenderOBJ(
|
||||
this,
|
||||
ResourceHandler.getResource("models/armor/WyvernRightBoot.obj"),
|
||||
ResourceHandler.getResource("textures/models/armor/WyvernRightBoot.png"));
|
||||
this.leftBoot = new ModelRenderOBJ(
|
||||
this,
|
||||
ResourceHandler.getResource("models/armor/WyvernLeftBoot.obj"),
|
||||
ResourceHandler.getResource("textures/models/armor/WyvernLeftBoot.png"));
|
||||
|
||||
this.bipedHead.cubeList.clear();
|
||||
this.bipedHeadwear.cubeList.clear();
|
||||
@@ -110,7 +136,6 @@ public class ModelWyvernArmor extends ModelBiped {
|
||||
this.bipedLeftLeg.addChild(leftBoot);
|
||||
this.bipedRightLeg.addChild(rightBoot);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -155,7 +180,8 @@ public class ModelWyvernArmor extends ModelBiped {
|
||||
this.bipedLeftLeg.render(1F / 16F);
|
||||
}
|
||||
|
||||
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float scale, Entity p_78087_7_) {
|
||||
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_,
|
||||
float p_78087_5_, float scale, Entity p_78087_7_) {
|
||||
this.bipedRightArm.rotateAngleZ = 0.0F;
|
||||
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
||||
this.bipedRightArm.rotationPointZ = 0.0F;
|
||||
|
||||
+7
-4
@@ -1,16 +1,18 @@
|
||||
package com.brandon3055.draconicevolution.client.model.special;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ClientEventHandler;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
|
||||
/**
|
||||
* DragonWings - brandon3055
|
||||
* Created using Tabula 5.0.0
|
||||
* DragonWings - brandon3055 Created using Tabula 5.0.0
|
||||
*/
|
||||
public class ModelContributorWings extends ModelBase {
|
||||
|
||||
public ModelRenderer rightBaseStem;
|
||||
public ModelRenderer leftBaseStem;
|
||||
public ModelRenderer rightOuterStem;
|
||||
@@ -68,7 +70,8 @@ public class ModelContributorWings extends ModelBase {
|
||||
float baseRot = 0.45906584F;
|
||||
float outerRot = 0.61086524F;
|
||||
|
||||
float animation = (float) Math.sin(((float) ClientEventHandler.elapsedTicks + partialTick) / 20);
|
||||
final int ticks = DraconicEvolution.clientProxy().getElapsedTicks();
|
||||
float animation = (float) Math.sin(((float) ticks + partialTick) / 20);
|
||||
|
||||
if (entity.isSneaking()) {
|
||||
this.leftBaseStem.rotateAngleX = 0.5F;
|
||||
|
||||
+612
-155
File diff suppressed because it is too large.
Load diff
+15
-5
@@ -1,14 +1,16 @@
|
||||
package com.brandon3055.draconicevolution.client.render.block;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileEnergyRelay;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileEnergyTransceiver;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileWirelessEnergyTransceiver;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileEnergyRelay;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileEnergyTransceiver;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileWirelessEnergyTransceiver;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 16/02/2015.
|
||||
*/
|
||||
@@ -32,7 +34,6 @@ public class RenderCrystal implements IItemRenderer {
|
||||
transceiver2.facing = 1;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
return true;
|
||||
@@ -55,7 +56,16 @@ public class RenderCrystal implements IItemRenderer {
|
||||
else GL11.glTranslatef(0.0F, -0.6F, 0.0F);
|
||||
}
|
||||
int meta = item.getItemDamage();
|
||||
TileEntityRendererDispatcher.instance.renderTileEntityAt(meta == 0 ? relay1 : meta == 1 ? relay2 : meta == 2 ? transceiver1 : meta == 3 ? transceiver2 : meta == 4 ? wirelessTransceiver1 : wirelessTransceiver2, 0.0D, 0.0D, 0.0D, 0.0F);
|
||||
TileEntityRendererDispatcher.instance.renderTileEntityAt(
|
||||
meta == 0 ? relay1
|
||||
: meta == 1 ? relay2
|
||||
: meta == 2 ? transceiver1
|
||||
: meta == 3 ? transceiver2
|
||||
: meta == 4 ? wirelessTransceiver1 : wirelessTransceiver2,
|
||||
0.0D,
|
||||
0.0D,
|
||||
0.0D,
|
||||
0.0F);
|
||||
GL11.glPopMatrix();
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
}
|
||||
|
||||
+4
-2
@@ -1,13 +1,15 @@
|
||||
package com.brandon3055.draconicevolution.client.render.block;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDraconiumChest;
|
||||
import com.brandon3055.draconicevolution.common.utills.ICustomItemData;
|
||||
import net.minecraft.client.model.ModelChest;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDraconiumChest;
|
||||
import com.brandon3055.draconicevolution.common.utils.ICustomItemData;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 16/11/2014.
|
||||
*/
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.brandon3055.draconicevolution.client.render.block;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.RenderTileEarth;
|
||||
|
||||
/**
|
||||
* Created by brandon3055 on 30/7/2015.
|
||||
*/
|
||||
public class RenderEarthItem implements IItemRenderer {
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
if (type == ItemRenderType.INVENTORY) GL11.glRotated(180, 0, 1, 0);
|
||||
else if (type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
|
||||
GL11.glTranslated(0.5, 0.5, 0.5);
|
||||
if (type == ItemRenderType.EQUIPPED) GL11.glRotated(90, 0, 1, 0);
|
||||
}
|
||||
|
||||
ResourceHandler.bindResource("textures/models/Earth.png");
|
||||
GL11.glScaled(0.01, 0.01, 0.01);
|
||||
GL11.glRotatef(-180, 1F, 0F, 1F);
|
||||
GL11.glRotatef(90, 1F, 0F, 0F);
|
||||
GL11.glRotatef((System.currentTimeMillis() / 64) % 360, 0F, 0F, 1F);
|
||||
RenderTileEarth.modelCustom.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
+4
-1
@@ -1,12 +1,15 @@
|
||||
package com.brandon3055.draconicevolution.client.render.block;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileEnergyInfuser;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileEnergyInfuser;
|
||||
|
||||
public class RenderEnergyInfuser implements IItemRenderer {
|
||||
|
||||
private TileEnergyInfuser tile;
|
||||
|
||||
public RenderEnergyInfuser() {
|
||||
|
||||
+4
-5
@@ -1,14 +1,16 @@
|
||||
package com.brandon3055.draconicevolution.client.render.block;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileParticleGenerator;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileParticleGenerator;
|
||||
|
||||
public class RenderParticleGen implements IItemRenderer {
|
||||
|
||||
private TileEntity tile;
|
||||
|
||||
public RenderParticleGen() {
|
||||
@@ -31,10 +33,7 @@ public class RenderParticleGen implements IItemRenderer {
|
||||
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
|
||||
if (type == IItemRenderer.ItemRenderType.ENTITY) GL11.glTranslatef(-0.5F, 0.0F, -0.5F);
|
||||
TileEntityRendererDispatcher.instance.renderTileEntityAt(tile, 0.0D, 0.0D, 0.0D, 0.0F);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+10
-8
@@ -1,8 +1,5 @@
|
||||
package com.brandon3055.draconicevolution.client.render.block;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
@@ -10,17 +7,22 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 25/5/2015.
|
||||
*/
|
||||
public class RenderPortal implements ISimpleBlockRenderingHandler {
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
Tessellator tess = Tessellator.instance;
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
+5
-3
@@ -1,10 +1,12 @@
|
||||
package com.brandon3055.draconicevolution.client.render.block;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.RenderTileReactorCore;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
* Created by brandon3055 on 30/7/2015.
|
||||
|
||||
+5
-3
@@ -1,10 +1,12 @@
|
||||
package com.brandon3055.draconicevolution.client.render.block;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.RenderTileReactorEnergyInjector;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
* Created by brandon3055 on 30/7/2015.
|
||||
|
||||
Loaded 100 of 692 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user