mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-28 16:06:04 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf12c01b96 | ||
|
|
f28ae4b8e4 | ||
|
|
d9f5acd98a | ||
|
|
4f3c73ee98 | ||
|
|
a14ed03d5e | ||
|
|
a80a7429b1 | ||
|
|
8541ba8e53 | ||
|
|
3d65061055 | ||
|
|
41d1e97d7c | ||
|
|
a811e2b5e4 | ||
|
|
4ba17bf8f3 | ||
|
|
0ae7dcefa3 | ||
|
|
bc95495504 | ||
|
|
004c540346 | ||
|
|
c43f1f05c5 | ||
|
|
3ce7424abc | ||
|
|
5cafd12ce8 | ||
|
|
9a423c4bfd | ||
|
|
e4d248b5a9 | ||
|
|
4520180638 | ||
|
|
7d14960a72 | ||
|
|
66bb31bfa8 | ||
|
|
37bb054dd3 | ||
|
|
0c9ed04ac5 | ||
|
|
c641da2f7f | ||
|
|
c91da9fee9 | ||
|
|
4d67be487a | ||
|
|
60325eeab9 | ||
|
|
8683a345c3 | ||
|
|
e4329e2b8f | ||
|
|
2e193f2b8f | ||
|
|
bc4ec455e5 | ||
|
|
ba9e3ccf3e | ||
|
|
ea417583b6 | ||
|
|
4ffe81967d | ||
|
|
4aaa092db9 | ||
|
|
2f796f4478 | ||
|
|
68fff7161a | ||
|
|
c7b8f2770a | ||
|
|
280ed91925 | ||
|
|
d08ebbde14 | ||
|
|
51d7f51c44 | ||
|
|
b3bf9ea9ac | ||
|
|
0b23dcdb39 | ||
|
|
7553983e28 | ||
|
|
d47246adbe | ||
|
|
91446f7c07 | ||
|
|
c84b8ae033 | ||
|
|
a64ac3e19c | ||
|
|
a24d7a339c | ||
|
|
d92cae88e2 | ||
|
|
7b021331bb | ||
|
|
3a1b633044 | ||
|
|
7b744a3e2c | ||
|
|
de53168447 | ||
|
|
18073d2f76 | ||
|
|
87581cd03b | ||
|
|
6facfe5fa8 | ||
|
|
e32e427f93 | ||
|
|
fe35f8e237 | ||
|
|
4836d89ed9 | ||
|
|
d486b30dff | ||
|
|
1b9212786f | ||
|
|
d8bf61a44e | ||
|
|
bce6c26704 | ||
|
|
a9eb396b7e | ||
|
|
92211ddbf4 | ||
|
|
3c6ab0e052 | ||
|
|
16793c2385 | ||
|
|
9c820bd038 | ||
|
|
f12a75a356 | ||
|
|
74d8810684 | ||
|
|
87ccfb36c4 | ||
|
|
765dade9bd | ||
|
|
b535a7ca46 | ||
|
|
0ff171ba5e | ||
|
|
7946203545 | ||
|
|
a2366fee20 | ||
|
|
aeb03873d8 | ||
|
|
25241cb7e9 | ||
|
|
97e808394f | ||
|
|
3de24b0647 | ||
|
|
cf518d19fb | ||
|
|
7a3ef5ecb2 | ||
|
|
14459ad991 | ||
|
|
2c6273c2d9 | ||
|
|
186a136d9d | ||
|
|
05b0532c05 | ||
|
|
045b228020 | ||
|
|
0a08927302 | ||
|
|
ab0122dda2 | ||
|
|
c0bba17d08 | ||
|
|
28869a08df | ||
|
|
ec2bb33ea0 | ||
|
|
008d290136 | ||
|
|
08404a3dd2 | ||
|
|
5378ff34bf | ||
|
|
33573ba463 | ||
|
|
84b120e89d | ||
|
|
add9f4685d | ||
|
|
75d745b7a0 | ||
|
|
e5bf29dd95 | ||
|
|
de5d902139 | ||
|
|
f3c4551f8a | ||
|
|
00dfeac8cb | ||
|
|
e443efcc5a | ||
|
|
f3c067f503 | ||
|
|
46567817e8 | ||
|
|
23742eab03 | ||
|
|
958a76247d | ||
|
|
31803aa092 | ||
|
|
766c0d5fd3 | ||
|
|
6a411bb607 | ||
|
|
0aa95b495a | ||
|
|
86274906eb | ||
|
|
fc7dc2c14d | ||
|
|
807a8e24ed | ||
|
|
2e74ed4645 | ||
|
|
ebdb282c6b | ||
|
|
d60f070e75 | ||
|
|
0b2e47d88d | ||
|
|
6be0719a9f | ||
|
|
e9ad1bda8e | ||
|
|
a15d297f8a | ||
|
|
2883900b1e | ||
|
|
0444201f7a | ||
|
|
3e9965b750 | ||
|
|
e8d843eb89 | ||
|
|
555f44889d | ||
|
|
4bca0f042d | ||
|
|
dc288141ac | ||
|
|
d26f4816e1 | ||
|
|
79b8e3e6a4 | ||
|
|
5e21a29d3f | ||
|
|
f6e2eec09c | ||
|
|
031b077a4b | ||
|
|
49f4c84b5d | ||
|
|
09b4d5a207 | ||
|
|
68f226e07e | ||
|
|
da6ea7048a | ||
|
|
d721a7e98f | ||
|
|
ce050eaa63 | ||
|
|
0133d143f8 | ||
|
|
7cc917ae76 | ||
|
|
6f1d00e4f5 | ||
|
|
2aa0b9bb8c | ||
|
|
d5d8885850 | ||
|
|
cb6cb3a01f | ||
|
|
cd5c2b3406 | ||
|
|
b1b06753ad | ||
|
|
5846f59d64 | ||
|
|
ec790c9333 | ||
|
|
784fa0ad30 | ||
|
|
3bd8c53273 | ||
|
|
bc10e65feb | ||
|
|
3eaf99a4d1 | ||
|
|
7910cff956 | ||
|
|
4ef9cd6a28 | ||
|
|
60b881810d | ||
|
|
c854f9b489 | ||
|
|
4e9624daab | ||
|
|
fac2008f14 | ||
|
|
2475710a6a | ||
|
|
e83d0e3fa6 | ||
|
|
052997cb09 | ||
|
|
ef372d4f84 | ||
|
|
f215990d8a | ||
|
|
f5a83016f5 | ||
|
|
eab09635e9 | ||
|
|
767ec08795 | ||
|
|
5928473316 | ||
|
|
b5989356ce | ||
|
|
4d1d3d1cca | ||
|
|
0b9b0c0068 | ||
|
|
dccaf6d7d4 | ||
|
|
73edb413f5 | ||
|
|
303c98e443 | ||
|
|
868ef735b0 | ||
|
|
1d4b5f791d | ||
|
|
46140e2e66 | ||
|
|
c2481365b9 | ||
|
|
cc76acbf3d | ||
|
|
8fabf206d9 | ||
|
|
dcd08c4d37 | ||
|
|
7d269684da | ||
|
|
81210e67df | ||
|
|
a66ca598af | ||
|
|
a6faf817f9 | ||
|
|
1992d6e333 | ||
|
|
f4c6c5612a | ||
|
|
8edd40ec8f | ||
|
|
fe56638f16 | ||
|
|
31caf3c4c3 | ||
|
|
bd1e357e40 | ||
|
|
bdd1bbd530 | ||
|
|
51701fd4c3 | ||
|
|
ee467ae88b | ||
|
|
5b12eecc88 | ||
|
|
eaeb6a4db1 | ||
|
|
a7fe4d9579 | ||
|
|
3e19efda01 | ||
|
|
9d84da49fd | ||
|
|
dff9c2f81c | ||
|
|
d30f682523 | ||
|
|
c005bc02b5 | ||
|
|
ce19751ca2 | ||
|
|
5b0f57fa7b | ||
|
|
9569559ec2 | ||
|
|
b1bd4a30f7 | ||
|
|
6fa547c9c3 | ||
|
|
f07ceb948c | ||
|
|
b75a8bbffd | ||
|
|
409061c589 | ||
|
|
445db14b96 | ||
|
|
0e796ab351 | ||
|
|
7146b73a5c | ||
|
|
4bdab6876d | ||
|
|
0441379c1c | ||
|
|
82fab2c1cb | ||
|
|
005d284ddb | ||
|
|
404ba9ce5c | ||
|
|
75df80ae3c | ||
|
|
43211303bb | ||
|
|
42ee61bd72 | ||
|
|
493ef4fdf9 | ||
|
|
1d3b4b7572 | ||
|
|
1f6e6626b1 | ||
|
|
79d46e5cc9 | ||
|
|
25f064df81 | ||
|
|
7a4575e6f8 | ||
|
|
a993d70687 | ||
|
|
3a21b1895e | ||
|
|
32028dc85e | ||
|
|
7d1a0d84d0 | ||
|
|
99998bcfbd | ||
|
|
d8dfb3882b | ||
|
|
bd0dbc3e14 | ||
|
|
1ffaad9fcd | ||
|
|
81301c3bd2 | ||
|
|
e2e6bdc3e0 | ||
|
|
0f9dbfd61b | ||
|
|
a806db3168 | ||
|
|
f564403a98 | ||
|
|
b91615a9a7 | ||
|
|
b244267989 | ||
|
|
83b3016306 | ||
|
|
286137a4d3 | ||
|
|
895dd048f1 | ||
|
|
5cfe0a7d0d | ||
|
|
8a94064606 | ||
|
|
6a8085603b | ||
|
|
68e9fb7c99 | ||
|
|
57088f03d7 | ||
|
|
2f683650c0 | ||
|
|
0c15ee9943 | ||
|
|
b5a6919f7f | ||
|
|
618b291015 | ||
|
|
1ea7b62e5f | ||
|
|
68bbe7710c | ||
|
|
3a389dee6d | ||
|
|
1c53f13250 | ||
|
|
3377ff8382 | ||
|
|
a877002667 | ||
|
|
4ef41b6f62 | ||
|
|
a12ad2eae3 | ||
|
|
338010ffe8 | ||
|
|
47cca224df | ||
|
|
0d8c5b9230 | ||
|
|
c9bc65bde2 | ||
|
|
1ed37f9b8d | ||
|
|
5e35e3c803 | ||
|
|
89f0b94f65 | ||
|
|
263a4f3bfc | ||
|
|
542dbb15b0 | ||
|
|
4337f5521d | ||
|
|
3bafd5974d | ||
|
|
bddd3e69a3 | ||
|
|
5052920d73 | ||
|
|
186cbda444 | ||
|
|
1ffe80b8c9 | ||
|
|
c3d0da2d0a | ||
|
|
8986256b12 | ||
|
|
e896b041f2 | ||
|
|
5e4d271f37 | ||
|
|
7fe97e9323 | ||
|
|
e8802c66d3 | ||
|
|
f6186d3cf3 | ||
|
|
64259e06da | ||
|
|
909ac40320 | ||
|
|
b32ba93404 | ||
|
|
77322d7c45 | ||
|
|
f1fd19df99 | ||
|
|
ecbb1cb8e4 | ||
|
|
9c27918e92 | ||
|
|
e896a31586 | ||
|
|
145e727c38 | ||
|
|
0de5877c0f | ||
|
|
4080dfd9f2 | ||
|
|
4c58bd361d | ||
|
|
96e4814ae3 | ||
|
|
adccdd181a | ||
|
|
c09ad04284 | ||
|
|
b609d6688f | ||
|
|
e05bf8bb7b | ||
|
|
730043ba9c | ||
|
|
856f08b752 | ||
|
|
f402cb155f | ||
|
|
a3c2360ba6 | ||
|
|
c392c3b295 | ||
|
|
d251d83105 | ||
|
|
a610833a24 | ||
|
|
740cea5916 | ||
|
|
765db4853c | ||
|
|
663c41fa40 | ||
|
|
cdda249d31 | ||
|
|
40a2d4b86d | ||
|
|
8f319fa931 |
No files matched your search
@@ -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
|
||||||
Executable
+33
@@ -0,0 +1,33 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
RUNDIR="run"
|
||||||
|
CRASH="crash-reports"
|
||||||
|
SERVERLOG="server.log"
|
||||||
|
|
||||||
|
if [[ -d $RUNDIR/$CRASH ]]; then
|
||||||
|
echo "Crash reports detected:"
|
||||||
|
cat $RUNDIR/$CRASH/crash*.txt
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if grep --quiet "Fatal errors were detected" $SERVERLOG; 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" $SERVERLOG; then
|
||||||
|
echo "Server force stopped:"
|
||||||
|
cat server.log
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! grep --quiet -Po '.+Done \(.+\)\! For help, type "help" or "\?"' $SERVERLOG; 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,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
|
||||||
+28
-5
@@ -1,9 +1,32 @@
|
|||||||
.gradle
|
.gradle
|
||||||
# IntelliJ
|
.settings
|
||||||
/build
|
/.idea/
|
||||||
/run
|
/.vscode/
|
||||||
/out
|
/run/
|
||||||
.idea
|
/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
|
*.iml
|
||||||
*.ipr
|
*.ipr
|
||||||
*.iws
|
*.iws
|
||||||
|
src/main/resources/mixins.*.json
|
||||||
|
*.bat
|
||||||
|
*.DS_Store
|
||||||
|
!gradlew.bat
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# Any Github changes require admin approval
|
||||||
|
/.github/** @GTNewHorizons/admin
|
||||||
|
|
||||||
+1
-676
@@ -1,7 +1,7 @@
|
|||||||
GNU LESSER GENERAL PUBLIC LICENSE
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
Version 3, 29 June 2007
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
@@ -163,678 +163,3 @@ whether future versions of the GNU Lesser General Public License shall
|
|||||||
apply, that proxy's public statement of acceptance of any version is
|
apply, that proxy's public statement of acceptance of any version is
|
||||||
permanent authorization for you to choose that version for the
|
permanent authorization for you to choose that version for the
|
||||||
Library.
|
Library.
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
the GNU General Public License is intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users. We, the Free Software Foundation, use the
|
|
||||||
GNU General Public License for most of our software; it applies also to
|
|
||||||
any other work released this way by its authors. You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
|
||||||
or can get the source code. And you must show them these terms so they
|
|
||||||
know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
|
||||||
that there is no warranty for this free software. For both users' and
|
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
|
||||||
changed, so that their problems will not be attributed erroneously to
|
|
||||||
authors of previous versions.
|
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
|
||||||
modified versions of the software inside them, although the manufacturer
|
|
||||||
can do so. This is fundamentally incompatible with the aim of
|
|
||||||
protecting users' freedom to change the software. The systematic
|
|
||||||
pattern of such abuse occurs in the area of products for individuals to
|
|
||||||
use, which is precisely where it is most unacceptable. Therefore, we
|
|
||||||
have designed this version of the GPL to prohibit the practice for those
|
|
||||||
products. If such problems arise substantially in other domains, we
|
|
||||||
stand ready to extend this provision to those domains in future versions
|
|
||||||
of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish to
|
|
||||||
avoid the special danger that patents applied to a free program could
|
|
||||||
make it effectively proprietary. To prevent this, the GPL assures that
|
|
||||||
patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the special requirements of the GNU Affero General Public License,
|
|
||||||
section 13, concerning interaction through a network will apply to the
|
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
|
||||||
notice like this when it starts in an interactive mode:
|
|
||||||
|
|
||||||
<program> Copyright (C) <year> <name of author>
|
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, your program's commands
|
|
||||||
might be different; for a GUI interface, you would use an "about box".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
|
||||||
<http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
|
||||||
may consider it more useful to permit linking proprietary applications with
|
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
|
||||||
Public License instead of this License. But first, please read
|
|
||||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
[Binnie mods](https://minecraft.curseforge.com/projects/binnies-mods/files)
|
||||||
|
====================================
|
||||||
|
|
||||||
|
### What is it?
|
||||||
|
Binnie’s Mods is a suite of mods designed to expand the [Forestry](https://github.com/ForestryMC/ForestryMC) mod.
|
||||||
|
It both extends the bee and tree breeding aspect by adding many new species with varied products,
|
||||||
|
along with new features such as fully breedable flowers and genetic manipulation.
|
||||||
|
|
||||||
|
### Homepage
|
||||||
|
|
||||||
|
[Wiki](https://binnie.mods.wiki/wiki/Main_Page)
|
||||||
|
|
||||||
|
[Latest Builds for 1.7.10](https://ci.bymarcin.com/job/Binnie-Mods-MC1.7.10/)
|
||||||
|
|
||||||
|
### Mods
|
||||||
|
|
||||||
|
[](https://binnie.mods.wiki/wiki/Extra_Bees)
|
||||||
|
|
||||||
|
Extra Bees expands upon the bee breeding of Forestry by adding 107 new bee species to forestry. These bees cover a large spectrum of different effects and products, giving you the ability to produce everything from dyes to rare metal dusts purely from bees. It also adds the Apiarist Database, a tool to keep track of discovered species, mutations and traits. There are also new alveary components which help improve and streamline bee production.
|
||||||
|
|
||||||
|
|
||||||
|
[](https://binnie.mods.wiki/wiki/Extra_Trees)
|
||||||
|
|
||||||
|
Extra Trees both increases the number of tree species and adds many new aesthetic uses. There are 96 new tree species, such as Banana, Brazil nut and Douglas-fir. This comes with many new fruits as well as 35 new wooden planks. Extra Trees allows these, as well as Forestry and vanilla planks, to be combined to give doors, gates and various designs of fences. The woodworker allows planks to be combined to give patterned tiles, allowing you to build beautiful wooden floors, and the same can be done with stained glass. A group of machines such as the brewery and distillery allow you to use the fruits you grow to make a variety of wines, ciders and spirits.
|
||||||
|
|
||||||
|
|
||||||
|
[](https://binnie.mods.wiki/wiki/Botany)
|
||||||
|
|
||||||
|
Botany adds an entirely new breeding system to Forestry: flowers. There are 46 different species that can be bred, including both vanilla flowers and new ones such as Fuschia and Lilies. The colour of the flowers can be transferred and selectively bred, meaning that each flower can be one of a possible 80 different colours. These new flowers can be bred manually in small gardens using a trowel and fertiliser, with careful care taken to maintain the desired pH or moisture, or grown on the large scale in Forestry farms.
|
||||||
|
|
||||||
|
[](https://binnie.mods.wiki/wiki/Genetics)
|
||||||
|
|
||||||
|
Genetics is for those who want to eschew conventional breeding, and want to enter the realm of genetic manipulation. Here, genes can be isolated, sequenced and then inoculated back into different species, making it easier to obtain the perfect genome. Bees, trees, butterflies and flowers can all be manipulated in this way. They can also be acclimatised to different environments to build tolerance to hostile climates.
|
||||||
|
|
||||||
|
[](https://binnie.mods.wiki/wiki/Binnie_Core)
|
||||||
|
|
||||||
|
Binnie Core is a mod which contains a lot of the core functionality such as networking and GUI's for the other mods. The only in game features it currently contains are the Compartments
|
||||||
|
|
||||||
|
### Warning
|
||||||
|
|
||||||
|
Removed unused (unfinished) items and blocks: Honey Crystal, Alcohol, etc.
|
||||||
|
|
||||||
|
### Building
|
||||||
|
|
||||||
|
The master branch will always contain the latest released version with possibly some bug fixes for that version that will eventually be released.
|
||||||
|
New versions will be created in branched named like {mc_version}-{mod_version}
|
||||||
|
|
||||||
|
#### IntelliJ IDEA
|
||||||
|
|
||||||
|
1. Execute the following gradle command to setup your workspace and create the necessary idea project files:
|
||||||
|
|
||||||
|
```
|
||||||
|
./gradlew setupDecompWorkspace idea genIntellijRuns
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Open the `Binnie*.ipr` project file using IntelliJ IDEA
|
||||||
|
|
||||||
|
3. Select `Minecraft Client` from _Run configurations_ and press the green play button.
|
||||||
|
Minecraft should now launch with Binnie and all of its dependencies loaded :)
|
||||||
+1060
-32
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,8 @@
|
|||||||
|
{{#tags}}
|
||||||
|
<h3>{{name}}</h3>
|
||||||
|
<ul>
|
||||||
|
{{#commits}}
|
||||||
|
<li>{{{message}}} - {{authorName}}</li>
|
||||||
|
{{/commits}}
|
||||||
|
</ul>
|
||||||
|
{{/tags}}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// Add your dependencies here
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile('com.github.GTNewHorizons:ForestryMC:4.4.6:dev')
|
||||||
|
compile('com.github.GTNewHorizons:NotEnoughItems:2.2.17-GTNH:dev')
|
||||||
|
|
||||||
|
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.27:api')
|
||||||
|
|
||||||
|
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
|
||||||
|
compileOnly('curse.maven:cofh-lib-220333:2388748')
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
modName = Binnie Core
|
||||||
|
|
||||||
|
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
|
||||||
|
modId = BinnieCore
|
||||||
|
|
||||||
|
modGroup = binnie
|
||||||
|
|
||||||
|
# WHY is there no version field?
|
||||||
|
# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the
|
||||||
|
# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/
|
||||||
|
|
||||||
|
# Will update your build.gradle automatically whenever an update is available
|
||||||
|
autoUpdateBuildScript = false
|
||||||
|
|
||||||
|
minecraftVersion = 1.7.10
|
||||||
|
forgeVersion = 10.13.4.1614
|
||||||
|
|
||||||
|
# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you
|
||||||
|
# restart Minecraft in development. Choose this dependent on your mod:
|
||||||
|
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
|
||||||
|
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
|
||||||
|
developmentEnvironmentUserName = Developer
|
||||||
|
|
||||||
|
# Define a source file of your project with:
|
||||||
|
# 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 = BinnieCore.java
|
||||||
|
gradleTokenModId =
|
||||||
|
gradleTokenModName =
|
||||||
|
gradleTokenVersion = GRADLETOKEN_VERSION
|
||||||
|
gradleTokenGroupName =
|
||||||
|
|
||||||
|
# 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 =
|
||||||
|
|
||||||
|
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
|
||||||
|
# Example value: mymodid_at.cfg
|
||||||
|
accessTransformersFile =
|
||||||
|
|
||||||
|
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||||
|
usesMixins = false
|
||||||
|
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||||
|
mixinPlugin =
|
||||||
|
# Specify the package that contains all of your Mixins. You may only place Mixins in this package 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
|
||||||
|
|
||||||
|
# If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your
|
||||||
|
# responsibility check the licence and request permission for distribution, if required.
|
||||||
|
usesShadowedDependencies = false
|
||||||
|
|
||||||
|
# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older
|
||||||
|
# projects. New projects should not use this parameter.
|
||||||
|
customArchiveBaseName = binnie-mods
|
||||||
Vendored
BIN
Binary file not shown.
+1
-2
@@ -1,6 +1,5 @@
|
|||||||
#Wed Jul 02 15:54:47 CDT 2014
|
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip
|
|
||||||
@@ -1,4 +1,20 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# Copyright 2015 the original author or 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.
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
##
|
##
|
||||||
@@ -6,47 +22,6 @@
|
|||||||
##
|
##
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
DEFAULT_JVM_OPTS=""
|
|
||||||
|
|
||||||
APP_NAME="Gradle"
|
|
||||||
APP_BASE_NAME=`basename "$0"`
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
||||||
MAX_FD="maximum"
|
|
||||||
|
|
||||||
warn ( ) {
|
|
||||||
echo "$*"
|
|
||||||
}
|
|
||||||
|
|
||||||
die ( ) {
|
|
||||||
echo
|
|
||||||
echo "$*"
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# OS specific support (must be 'true' or 'false').
|
|
||||||
cygwin=false
|
|
||||||
msys=false
|
|
||||||
darwin=false
|
|
||||||
case "`uname`" in
|
|
||||||
CYGWIN* )
|
|
||||||
cygwin=true
|
|
||||||
;;
|
|
||||||
Darwin* )
|
|
||||||
darwin=true
|
|
||||||
;;
|
|
||||||
MINGW* )
|
|
||||||
msys=true
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
|
||||||
if $cygwin ; then
|
|
||||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Attempt to set APP_HOME
|
# Attempt to set APP_HOME
|
||||||
# Resolve links: $0 may be a link
|
# Resolve links: $0 may be a link
|
||||||
PRG="$0"
|
PRG="$0"
|
||||||
@@ -61,9 +36,49 @@ while [ -h "$PRG" ] ; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
SAVED="`pwd`"
|
SAVED="`pwd`"
|
||||||
cd "`dirname \"$PRG\"`/" >&-
|
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||||
APP_HOME="`pwd -P`"
|
APP_HOME="`pwd -P`"
|
||||||
cd "$SAVED" >&-
|
cd "$SAVED" >/dev/null
|
||||||
|
|
||||||
|
APP_NAME="Gradle"
|
||||||
|
APP_BASE_NAME=`basename "$0"`
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD="maximum"
|
||||||
|
|
||||||
|
warn () {
|
||||||
|
echo "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
die () {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# OS specific support (must be 'true' or 'false').
|
||||||
|
cygwin=false
|
||||||
|
msys=false
|
||||||
|
darwin=false
|
||||||
|
nonstop=false
|
||||||
|
case "`uname`" in
|
||||||
|
CYGWIN* )
|
||||||
|
cygwin=true
|
||||||
|
;;
|
||||||
|
Darwin* )
|
||||||
|
darwin=true
|
||||||
|
;;
|
||||||
|
MINGW* )
|
||||||
|
msys=true
|
||||||
|
;;
|
||||||
|
NONSTOP* )
|
||||||
|
nonstop=true
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
@@ -90,7 +105,7 @@ location of your Java installation."
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# Increase the maximum file descriptors if we can.
|
||||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||||
MAX_FD_LIMIT=`ulimit -H -n`
|
MAX_FD_LIMIT=`ulimit -H -n`
|
||||||
if [ $? -eq 0 ] ; then
|
if [ $? -eq 0 ] ; then
|
||||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||||
@@ -110,10 +125,11 @@ if $darwin; then
|
|||||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# For Cygwin, switch paths to Windows format before running java
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
if $cygwin ; then
|
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
|
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||||
|
|
||||||
# We build the pattern for arguments to be converted via cygpath
|
# We build the pattern for arguments to be converted via cygpath
|
||||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||||
@@ -154,11 +170,19 @@ if $cygwin ; then
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
# Escape application args
|
||||||
function splitJvmOpts() {
|
save () {
|
||||||
JVM_OPTS=("$@")
|
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||||
|
echo " "
|
||||||
}
|
}
|
||||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
APP_ARGS=$(save "$@")
|
||||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
|
||||||
|
|
||||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||||
|
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||||
|
|
||||||
|
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||||
|
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec "$JAVACMD" "$@"
|
||||||
Vendored
+20
-10
@@ -1,3 +1,19 @@
|
|||||||
|
@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
|
||||||
|
|
||||||
@if "%DEBUG%" == "" @echo off
|
@if "%DEBUG%" == "" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@@ -8,14 +24,14 @@
|
|||||||
@rem Set local scope for the variables with windows NT shell
|
@rem Set local scope for the variables with windows NT shell
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
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
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
@rem Find java.exe
|
@rem Find java.exe
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
@@ -46,10 +62,9 @@ echo location of your Java installation.
|
|||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:init
|
:init
|
||||||
@rem Get command-line arguments, handling Windowz variants
|
@rem Get command-line arguments, handling Windows variants
|
||||||
|
|
||||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
|
||||||
|
|
||||||
:win9xME_args
|
:win9xME_args
|
||||||
@rem Slurp the command line arguments.
|
@rem Slurp the command line arguments.
|
||||||
@@ -60,11 +75,6 @@ set _SKIP=2
|
|||||||
if "x%~1" == "x" goto execute
|
if "x%~1" == "x" goto execute
|
||||||
|
|
||||||
set CMD_LINE_ARGS=%*
|
set CMD_LINE_ARGS=%*
|
||||||
goto execute
|
|
||||||
|
|
||||||
:4NT_args
|
|
||||||
@rem Get arguments from the 4NT Shell from JP Software
|
|
||||||
set CMD_LINE_ARGS=%$
|
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
before_install:
|
||||||
|
- ./gradlew setupCIWorkspace
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,26 @@
|
|||||||
|
// Add any additional repositories for your dependencies here
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
name 'GTNH Maven'
|
||||||
|
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
|
||||||
|
allowInsecureProtocol
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
name 'ic2'
|
||||||
|
url 'http://maven.ic2.player.to/'
|
||||||
|
metadataSources {
|
||||||
|
mavenPom()
|
||||||
|
artifact()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
url 'https://cursemaven.com'
|
||||||
|
content {
|
||||||
|
includeGroup 'curse.maven'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
url 'https://jitpack.io'
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
plugins {
|
||||||
|
id 'com.diffplug.blowdryerSetup' version '1.6.0'
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'com.diffplug.blowdryerSetup'
|
||||||
|
|
||||||
|
blowdryerSetup {
|
||||||
|
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.1.5')
|
||||||
|
//devLocal '.' // Use this when testing config updates locally
|
||||||
|
}
|
||||||
@@ -1,39 +1,21 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie;
|
package binnie;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import binnie.core.resource.ManagerResource;
|
|
||||||
import binnie.core.item.ManagerItem;
|
|
||||||
import binnie.core.machines.ManagerMachine;
|
|
||||||
import binnie.core.liquid.ManagerLiquid;
|
|
||||||
import binnie.core.mod.config.ManagerConfig;
|
|
||||||
import binnie.core.genetics.ManagerGenetics;
|
|
||||||
import binnie.core.language.ManagerLanguage;
|
|
||||||
import binnie.core.ManagerBase;
|
import binnie.core.ManagerBase;
|
||||||
|
import binnie.core.genetics.ManagerGenetics;
|
||||||
|
import binnie.core.item.ManagerItem;
|
||||||
|
import binnie.core.liquid.ManagerLiquid;
|
||||||
|
import binnie.core.machines.ManagerMachine;
|
||||||
|
import binnie.core.mod.config.ManagerConfig;
|
||||||
|
import binnie.core.resource.ManagerResource;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public final class Binnie
|
public final class Binnie {
|
||||||
{
|
public static List<ManagerBase> Managers = new ArrayList<>();
|
||||||
public static final List<ManagerBase> Managers;
|
public static ManagerGenetics Genetics = new ManagerGenetics();
|
||||||
public static final ManagerLanguage Language;
|
public static ManagerConfig Configuration = new ManagerConfig();
|
||||||
public static final ManagerGenetics Genetics;
|
public static ManagerLiquid Liquid = new ManagerLiquid();
|
||||||
public static final ManagerConfig Configuration;
|
public static ManagerMachine Machine = new ManagerMachine();
|
||||||
public static final ManagerLiquid Liquid;
|
public static ManagerItem Item = new ManagerItem();
|
||||||
public static final ManagerMachine Machine;
|
public static ManagerResource Resource = new ManagerResource();
|
||||||
public static final ManagerItem Item;
|
|
||||||
public static final ManagerResource Resource;
|
|
||||||
|
|
||||||
static {
|
|
||||||
Managers = new ArrayList<ManagerBase>();
|
|
||||||
Language = new ManagerLanguage();
|
|
||||||
Genetics = new ManagerGenetics();
|
|
||||||
Configuration = new ManagerConfig();
|
|
||||||
Liquid = new ManagerLiquid();
|
|
||||||
Machine = new ManagerMachine();
|
|
||||||
Item = new ManagerItem();
|
|
||||||
Resource = new ManagerResource();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie;
|
|
||||||
|
|
||||||
public final class Constants
|
|
||||||
{
|
|
||||||
public static final String LiquidJuice = "juice";
|
|
||||||
public static final String LiquidWater = "water";
|
|
||||||
public static final String LiquidSeedOil = "seedoil";
|
|
||||||
public static final String LiquidCreosote = "Creosote Oil";
|
|
||||||
public static final String LiquidEthanol = "bioethanol";
|
|
||||||
public static final String LiquidHoney = "for.honey";
|
|
||||||
}
|
|
||||||
@@ -1,334 +1,352 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany;
|
package binnie.botany;
|
||||||
|
|
||||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
|
||||||
import cpw.mods.fml.common.eventhandler.Event;
|
|
||||||
import net.minecraftforge.event.entity.player.BonemealEvent;
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import binnie.core.BinnieCore;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.event.world.BlockEvent;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import binnie.botany.api.EnumAcidity;
|
import binnie.botany.api.EnumAcidity;
|
||||||
import binnie.botany.api.EnumSoilType;
|
import binnie.botany.api.EnumSoilType;
|
||||||
import binnie.botany.api.gardening.IBlockSoil;
|
|
||||||
import binnie.botany.gardening.Gardening;
|
|
||||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import binnie.botany.api.IFlower;
|
import binnie.botany.api.IFlower;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import binnie.botany.api.gardening.IBlockSoil;
|
||||||
import forestry.api.genetics.IIndividual;
|
|
||||||
import binnie.botany.core.BotanyCore;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
|
||||||
import binnie.botany.flower.TileEntityFlower;
|
|
||||||
import net.minecraft.init.Items;
|
|
||||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
|
||||||
import binnie.core.network.BinniePacketHandler;
|
|
||||||
import binnie.core.proxy.IProxyCore;
|
|
||||||
import binnie.botany.network.PacketID;
|
|
||||||
import binnie.core.network.IPacketID;
|
|
||||||
import binnie.botany.core.BotanyGUI;
|
|
||||||
import binnie.core.gui.IBinnieGUID;
|
|
||||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
|
||||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
|
||||||
import binnie.botany.gardening.ModuleGardening;
|
|
||||||
import binnie.botany.genetics.ModuleGenetics;
|
|
||||||
import binnie.botany.core.ModuleCore;
|
|
||||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
|
||||||
import binnie.botany.ceramic.BlockCeramicBrick;
|
|
||||||
import binnie.botany.ceramic.BlockStained;
|
|
||||||
import binnie.botany.ceramic.BlockCeramicPatterned;
|
|
||||||
import binnie.botany.ceramic.BlockCeramic;
|
import binnie.botany.ceramic.BlockCeramic;
|
||||||
|
import binnie.botany.ceramic.BlockCeramicBrick;
|
||||||
|
import binnie.botany.ceramic.BlockCeramicPatterned;
|
||||||
|
import binnie.botany.ceramic.BlockStained;
|
||||||
|
import binnie.botany.core.BotanyCore;
|
||||||
|
import binnie.botany.core.BotanyGUI;
|
||||||
|
import binnie.botany.core.ModuleCore;
|
||||||
|
import binnie.botany.flower.BlockFlower;
|
||||||
|
import binnie.botany.flower.ItemFlower;
|
||||||
|
import binnie.botany.flower.ItemInsulatedTube;
|
||||||
|
import binnie.botany.flower.TileEntityFlower;
|
||||||
|
import binnie.botany.gardening.BlockPlant;
|
||||||
|
import binnie.botany.gardening.BlockSoil;
|
||||||
|
import binnie.botany.gardening.Gardening;
|
||||||
|
import binnie.botany.gardening.ItemSoilMeter;
|
||||||
|
import binnie.botany.gardening.ItemTrowel;
|
||||||
|
import binnie.botany.gardening.ModuleGardening;
|
||||||
|
import binnie.botany.genetics.ItemDictionary;
|
||||||
|
import binnie.botany.genetics.ModuleGenetics;
|
||||||
import binnie.botany.items.ItemClay;
|
import binnie.botany.items.ItemClay;
|
||||||
import binnie.botany.items.ItemPigment;
|
import binnie.botany.items.ItemPigment;
|
||||||
import binnie.botany.flower.ItemFlower;
|
import binnie.botany.network.PacketID;
|
||||||
import binnie.botany.genetics.ItemEncyclopedia;
|
|
||||||
import binnie.core.item.ItemMisc;
|
|
||||||
import binnie.botany.gardening.ItemSoilMeter;
|
|
||||||
import binnie.botany.flower.ItemInsulatedTube;
|
|
||||||
import binnie.botany.gardening.BlockSoil;
|
|
||||||
import binnie.botany.gardening.ItemTrowel;
|
|
||||||
import binnie.botany.gardening.BlockPlant;
|
|
||||||
import binnie.botany.genetics.ItemDictionary;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import binnie.botany.flower.BlockFlower;
|
|
||||||
import cpw.mods.fml.common.SidedProxy;
|
|
||||||
import binnie.botany.proxy.Proxy;
|
import binnie.botany.proxy.Proxy;
|
||||||
import cpw.mods.fml.common.Mod;
|
|
||||||
import binnie.core.AbstractMod;
|
import binnie.core.AbstractMod;
|
||||||
|
import binnie.core.BinnieCore;
|
||||||
|
import binnie.core.gui.IBinnieGUID;
|
||||||
|
import binnie.core.item.ItemMisc;
|
||||||
|
import binnie.core.network.BinniePacketHandler;
|
||||||
|
import binnie.core.network.IPacketID;
|
||||||
|
import binnie.core.proxy.IProxyCore;
|
||||||
|
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.eventhandler.Event;
|
||||||
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.event.entity.player.BonemealEvent;
|
||||||
|
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||||
|
import net.minecraftforge.event.world.BlockEvent;
|
||||||
|
|
||||||
@Mod(modid = "Botany", name = "Botany", useMetadata = true, dependencies = "after:BinnieCore")
|
@Mod(
|
||||||
public class Botany extends AbstractMod
|
modid = "Botany",
|
||||||
{
|
name = "Botany",
|
||||||
public static final float AGE_CHANCE = 0.2f;
|
version = BinnieCore.VERSION,
|
||||||
@Mod.Instance("Botany")
|
useMetadata = true,
|
||||||
public static Botany instance;
|
dependencies = "after:BinnieCore")
|
||||||
@SidedProxy(clientSide = "binnie.botany.proxy.ProxyClient", serverSide = "binnie.botany.proxy.ProxyServer")
|
public class Botany extends AbstractMod {
|
||||||
public static Proxy proxy;
|
@Mod.Instance("Botany")
|
||||||
public static BlockFlower flower;
|
public static Botany instance;
|
||||||
public static Item seed;
|
|
||||||
public static Item pollen;
|
|
||||||
public static ItemDictionary database;
|
|
||||||
public static BlockPlant plant;
|
|
||||||
public static ItemTrowel trowelWood;
|
|
||||||
public static ItemTrowel trowelStone;
|
|
||||||
public static ItemTrowel trowelIron;
|
|
||||||
public static ItemTrowel trowelDiamond;
|
|
||||||
public static ItemTrowel trowelGold;
|
|
||||||
public static BlockSoil soil;
|
|
||||||
public static BlockSoil loam;
|
|
||||||
public static BlockSoil flowerbed;
|
|
||||||
public static BlockSoil soilNoWeed;
|
|
||||||
public static BlockSoil loamNoWeed;
|
|
||||||
public static BlockSoil flowerbedNoWeed;
|
|
||||||
public static ItemInsulatedTube insulatedTube;
|
|
||||||
public static ItemSoilMeter soilMeter;
|
|
||||||
public static ItemMisc misc;
|
|
||||||
public static ItemEncyclopedia encyclopedia;
|
|
||||||
public static ItemEncyclopedia encyclopediaIron;
|
|
||||||
public static ItemFlower flowerItem;
|
|
||||||
public static ItemPigment pigment;
|
|
||||||
public static ItemClay clay;
|
|
||||||
public static BlockCeramic ceramic;
|
|
||||||
public static BlockCeramicPatterned ceramicTile;
|
|
||||||
public static BlockStained stained;
|
|
||||||
public static BlockCeramicBrick ceramicBrick;
|
|
||||||
|
|
||||||
@Mod.EventHandler
|
@SidedProxy(clientSide = "binnie.botany.proxy.ProxyClient", serverSide = "binnie.botany.proxy.ProxyServer")
|
||||||
public void preInit(final FMLPreInitializationEvent evt) {
|
public static Proxy proxy;
|
||||||
this.addModule(new ModuleCore());
|
|
||||||
this.addModule(new ModuleGenetics());
|
|
||||||
this.addModule(new ModuleGardening());
|
|
||||||
this.preInit();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Mod.EventHandler
|
public static BlockFlower flower;
|
||||||
public void init(final FMLInitializationEvent evt) {
|
public static Item seed;
|
||||||
this.init();
|
public static Item pollen;
|
||||||
}
|
public static ItemDictionary database;
|
||||||
|
public static BlockPlant plant;
|
||||||
|
public static ItemTrowel trowelWood;
|
||||||
|
public static ItemTrowel trowelStone;
|
||||||
|
public static ItemTrowel trowelIron;
|
||||||
|
public static ItemTrowel trowelDiamond;
|
||||||
|
public static ItemTrowel trowelGold;
|
||||||
|
public static BlockSoil soil;
|
||||||
|
public static BlockSoil loam;
|
||||||
|
public static BlockSoil flowerbed;
|
||||||
|
public static BlockSoil soilNoWeed;
|
||||||
|
public static BlockSoil loamNoWeed;
|
||||||
|
public static BlockSoil flowerbedNoWeed;
|
||||||
|
public static ItemInsulatedTube insulatedTube;
|
||||||
|
public static ItemSoilMeter soilMeter;
|
||||||
|
public static ItemMisc misc;
|
||||||
|
public static ItemFlower flowerItem;
|
||||||
|
public static ItemPigment pigment;
|
||||||
|
public static ItemClay clay;
|
||||||
|
public static BlockCeramic ceramic;
|
||||||
|
public static BlockCeramicPatterned ceramicTile;
|
||||||
|
public static BlockStained stained;
|
||||||
|
public static BlockCeramicBrick ceramicBrick;
|
||||||
|
|
||||||
@Mod.EventHandler
|
public Botany() {
|
||||||
public void postInit(final FMLPostInitializationEvent evt) {
|
Botany.instance = this;
|
||||||
this.postInit();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public Botany() {
|
@Mod.EventHandler
|
||||||
Botany.instance = this;
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
}
|
addModule(new ModuleCore());
|
||||||
|
addModule(new ModuleGenetics());
|
||||||
|
addModule(new ModuleGardening());
|
||||||
|
preInit();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Mod.EventHandler
|
||||||
public IBinnieGUID[] getGUIDs() {
|
public void init(FMLInitializationEvent event) {
|
||||||
return BotanyGUI.values();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Mod.EventHandler
|
||||||
public Class<?>[] getConfigs() {
|
public void postInit(FMLPostInitializationEvent event) {
|
||||||
return new Class[0];
|
postInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPacketID[] getPacketIDs() {
|
public IBinnieGUID[] getGUIDs() {
|
||||||
return PacketID.values();
|
return BotanyGUI.values();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IProxyCore getProxy() {
|
public Class<?>[] getConfigs() {
|
||||||
return Botany.proxy;
|
return new Class[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getChannel() {
|
public IPacketID[] getPacketIDs() {
|
||||||
return "BOT";
|
return PacketID.values();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getModID() {
|
public IProxyCore getProxy() {
|
||||||
return "botany";
|
return Botany.proxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BinniePacketHandler> getPacketHandler() {
|
public String getChannel() {
|
||||||
return PacketHandler.class;
|
return "BOT";
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@Override
|
||||||
public void onShearFlower(final PlayerInteractEvent event) {
|
public String getModID() {
|
||||||
if (event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
|
return "botany";
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
if (event.entityPlayer != null && event.entityPlayer.getHeldItem() != null && event.entityPlayer.getHeldItem().getItem() == Items.shears) {
|
|
||||||
final TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z);
|
|
||||||
if (tile instanceof TileEntityFlower) {
|
|
||||||
final TileEntityFlower flower = (TileEntityFlower) tile;
|
|
||||||
flower.onShear();
|
|
||||||
event.entityPlayer.getHeldItem().damageItem(1, event.entityPlayer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (event.entityPlayer != null && event.entityPlayer.getHeldItem() != null && event.entityPlayer.getHeldItem().getItem() == Botany.pollen) {
|
|
||||||
final TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z);
|
|
||||||
if (tile instanceof TileEntityFlower) {
|
|
||||||
final TileEntityFlower flower = (TileEntityFlower) tile;
|
|
||||||
final IFlower pollen = BotanyCore.getFlowerRoot().getMember(event.entityPlayer.getHeldItem());
|
|
||||||
if (pollen != null && flower.canMateWith(pollen)) {
|
|
||||||
flower.mateWith(pollen);
|
|
||||||
if (!event.entityPlayer.capabilities.isCreativeMode) {
|
|
||||||
final ItemStack heldItem = event.entityPlayer.getHeldItem();
|
|
||||||
--heldItem.stackSize;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SubscribeEvent
|
@Override
|
||||||
public void onFertiliseSoil(final PlayerInteractEvent event) {
|
protected Class<? extends BinniePacketHandler> getPacketHandler() {
|
||||||
if (event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
|
return PacketHandler.class;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
if (event.world == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (event.entityPlayer != null && event.entityPlayer.getHeldItem() != null) {
|
|
||||||
int y = event.y;
|
|
||||||
Block block = event.world.getBlock(event.x, y, event.z);
|
|
||||||
if (block == null || !Gardening.isSoil(block)) {
|
|
||||||
block = event.world.getBlock(event.x, --y, event.z);
|
|
||||||
}
|
|
||||||
if (block == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (Gardening.isSoil(block)) {
|
|
||||||
final IBlockSoil soil = (IBlockSoil) block;
|
|
||||||
if (Gardening.isNutrientFertiliser(event.entityPlayer.getHeldItem()) && soil.getType(event.world, event.x, y, event.z) != EnumSoilType.FLOWERBED) {
|
|
||||||
final EnumSoilType type = soil.getType(event.world, event.x, y, event.z);
|
|
||||||
final int next = Math.min(type.ordinal() + Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 2);
|
|
||||||
if (soil.fertilise(event.world, event.x, y, event.z, EnumSoilType.values()[next]) && !event.entityPlayer.capabilities.isCreativeMode) {
|
|
||||||
final ItemStack heldItem = event.entityPlayer.getHeldItem();
|
|
||||||
--heldItem.stackSize;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (Gardening.isAcidFertiliser(event.entityPlayer.getHeldItem()) && soil.getPH(event.world, event.x, y, event.z) != EnumAcidity.Acid) {
|
|
||||||
final EnumAcidity pH = soil.getPH(event.world, event.x, y, event.z);
|
|
||||||
final int next = Math.max(pH.ordinal() - Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 0);
|
|
||||||
if (soil.setPH(event.world, event.x, y, event.z, EnumAcidity.values()[next]) && !event.entityPlayer.capabilities.isCreativeMode) {
|
|
||||||
final ItemStack heldItem2 = event.entityPlayer.getHeldItem();
|
|
||||||
--heldItem2.stackSize;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (Gardening.isAlkalineFertiliser(event.entityPlayer.getHeldItem()) && soil.getPH(event.world, event.x, y, event.z) != EnumAcidity.Alkaline) {
|
|
||||||
final EnumAcidity pH = soil.getPH(event.world, event.x, y, event.z);
|
|
||||||
final int next = Math.min(pH.ordinal() + Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 2);
|
|
||||||
if (soil.setPH(event.world, event.x, y, event.z, EnumAcidity.values()[next]) && !event.entityPlayer.capabilities.isCreativeMode) {
|
|
||||||
final ItemStack heldItem3 = event.entityPlayer.getHeldItem();
|
|
||||||
--heldItem3.stackSize;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (Gardening.isWeedkiller(event.entityPlayer.getHeldItem()) && Gardening.addWeedKiller(event.world, event.x, y, event.z) && !event.entityPlayer.capabilities.isCreativeMode) {
|
|
||||||
final ItemStack heldItem4 = event.entityPlayer.getHeldItem();
|
|
||||||
--heldItem4.stackSize;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void plantVanilla(final BlockEvent.PlaceEvent event) {
|
public void onShearFlower(PlayerInteractEvent event) {
|
||||||
final World world = event.world;
|
if (event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
|
||||||
final int x = event.x;
|
return;
|
||||||
final int y = event.y;
|
}
|
||||||
final int z = event.z;
|
|
||||||
final Block block = world.getBlock(x, y - 1, z);
|
|
||||||
if (!(block instanceof IBlockSoil)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final IFlower flower = BotanyCore.getFlowerRoot().getConversion(event.itemInHand);
|
|
||||||
if (flower != null) {
|
|
||||||
Gardening.plant(world, x, y, z, flower, event.player.getGameProfile());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
if (event.entityPlayer != null
|
||||||
public void onPlantVanilla(final PlayerInteractEvent event) {
|
&& event.entityPlayer.getHeldItem() != null
|
||||||
if (!BinnieCore.proxy.isSimulating(event.world)) {
|
&& event.entityPlayer.getHeldItem().getItem() == Items.shears) {
|
||||||
return;
|
TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z);
|
||||||
}
|
if (tile instanceof TileEntityFlower) {
|
||||||
if (event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
|
TileEntityFlower flower = (TileEntityFlower) tile;
|
||||||
return;
|
flower.onShear();
|
||||||
}
|
event.entityPlayer.getHeldItem().damageItem(1, event.entityPlayer);
|
||||||
if (event.entityPlayer != null && event.entityPlayer.getHeldItem() != null) {
|
}
|
||||||
final World world = event.world;
|
}
|
||||||
final int x = event.x;
|
|
||||||
final int y = event.y;
|
|
||||||
final int z = event.z;
|
|
||||||
final Block block = world.getBlock(x, y, z);
|
|
||||||
int py = -1;
|
|
||||||
if (block instanceof IBlockSoil && (world.isAirBlock(x, y + 1, z) || world.getBlock(x, y, z).isReplaceable(world, x, y, z))) {
|
|
||||||
py = 1;
|
|
||||||
}
|
|
||||||
if (py >= 0) {
|
|
||||||
final IFlower flower = BotanyCore.getFlowerRoot().getConversion(event.entityPlayer.getHeldItem());
|
|
||||||
if (flower != null && Gardening.plant(world, x, y + py, z, flower, event.entityPlayer.getGameProfile()) && !event.entityPlayer.capabilities.isCreativeMode) {
|
|
||||||
final ItemStack heldItem = event.entityPlayer.getHeldItem();
|
|
||||||
--heldItem.stackSize;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SubscribeEvent
|
if (event.entityPlayer != null
|
||||||
public void onBonemeal(final BonemealEvent event) {
|
&& event.entityPlayer.getHeldItem() != null
|
||||||
final Block block = event.world.getBlock(event.x, event.y, event.z);
|
&& event.entityPlayer.getHeldItem().getItem() == Botany.pollen) {
|
||||||
if (Gardening.isSoil(block)) {
|
TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z);
|
||||||
final IBlockSoil soil = (IBlockSoil) block;
|
if (tile instanceof TileEntityFlower) {
|
||||||
if (soil.fertilise(event.world, event.x, event.y, event.z, EnumSoilType.LOAM)) {
|
TileEntityFlower flower = (TileEntityFlower) tile;
|
||||||
event.setResult(Event.Result.ALLOW);
|
IFlower pollen = BotanyCore.getFlowerRoot().getMember(event.entityPlayer.getHeldItem());
|
||||||
}
|
if (pollen != null && flower.canMateWith(pollen)) {
|
||||||
}
|
flower.mateWith(pollen);
|
||||||
final TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z);
|
if (!event.entityPlayer.capabilities.isCreativeMode) {
|
||||||
if (tile instanceof TileEntityFlower && ((TileEntityFlower) tile).onBonemeal()) {
|
ItemStack heldItem = event.entityPlayer.getHeldItem();
|
||||||
event.setResult(Event.Result.ALLOW);
|
heldItem.stackSize--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@SubscribeEvent
|
||||||
public boolean isActive() {
|
public void onFertiliseSoil(PlayerInteractEvent event) {
|
||||||
return BinnieCore.isBotanyActive();
|
if (event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK || event.world == null) {
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
@Mod.EventHandler
|
if (event.entityPlayer == null || event.entityPlayer.getHeldItem() == null) {
|
||||||
public void onIMC(final FMLInterModComms.IMCEvent event) {
|
return;
|
||||||
for (final FMLInterModComms.IMCMessage message : event.getMessages()) {
|
}
|
||||||
if (message.key.equals("add-nutrient-fertiliser-1")) {
|
|
||||||
ModuleGardening.queuedNutrientFertilisers.put(message.getItemStackValue(), 1);
|
|
||||||
}
|
|
||||||
if (message.key.equals("add-nutrient-fertiliser-2")) {
|
|
||||||
ModuleGardening.queuedNutrientFertilisers.put(message.getItemStackValue(), 2);
|
|
||||||
}
|
|
||||||
if (message.key.equals("add-acid-fertiliser-1")) {
|
|
||||||
ModuleGardening.queuedAcidFertilisers.put(message.getItemStackValue(), 1);
|
|
||||||
}
|
|
||||||
if (message.key.equals("add-acid-fertiliser-2")) {
|
|
||||||
ModuleGardening.queuedAcidFertilisers.put(message.getItemStackValue(), 2);
|
|
||||||
}
|
|
||||||
if (message.key.equals("add-alkaline-fertiliser-1")) {
|
|
||||||
ModuleGardening.queuedAlkalineFertilisers.put(message.getItemStackValue(), 1);
|
|
||||||
}
|
|
||||||
if (message.key.equals("add-alkaline-fertiliser-2")) {
|
|
||||||
ModuleGardening.queuedAlkalineFertilisers.put(message.getItemStackValue(), 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class PacketHandler extends BinniePacketHandler
|
int y = event.y;
|
||||||
{
|
Block block = event.world.getBlock(event.x, y, event.z);
|
||||||
public PacketHandler() {
|
if (block == null || !Gardening.isSoil(block)) {
|
||||||
super(Botany.instance);
|
block = event.world.getBlock(event.x, --y, event.z);
|
||||||
}
|
}
|
||||||
}
|
if (block == null || !Gardening.isSoil(block)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
IBlockSoil soil = (IBlockSoil) block;
|
||||||
|
if (Gardening.isNutrientFertiliser(event.entityPlayer.getHeldItem())
|
||||||
|
&& soil.getType(event.world, event.x, y, event.z) != EnumSoilType.FLOWERBED) {
|
||||||
|
EnumSoilType type = soil.getType(event.world, event.x, y, event.z);
|
||||||
|
int next = Math.min(type.ordinal() + Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 2);
|
||||||
|
if (soil.fertilise(event.world, event.x, y, event.z, EnumSoilType.values()[next])
|
||||||
|
&& !event.entityPlayer.capabilities.isCreativeMode) {
|
||||||
|
ItemStack heldItem = event.entityPlayer.getHeldItem();
|
||||||
|
heldItem.stackSize--;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Gardening.isAcidFertiliser(event.entityPlayer.getHeldItem())
|
||||||
|
&& soil.getPH(event.world, event.x, y, event.z) != EnumAcidity.ACID) {
|
||||||
|
EnumAcidity pH = soil.getPH(event.world, event.x, y, event.z);
|
||||||
|
int next = Math.max(pH.ordinal() - Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 0);
|
||||||
|
if (soil.setPH(event.world, event.x, y, event.z, EnumAcidity.values()[next])
|
||||||
|
&& !event.entityPlayer.capabilities.isCreativeMode) {
|
||||||
|
ItemStack heldItem2 = event.entityPlayer.getHeldItem();
|
||||||
|
heldItem2.stackSize--;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Gardening.isAlkalineFertiliser(event.entityPlayer.getHeldItem())
|
||||||
|
&& soil.getPH(event.world, event.x, y, event.z) != EnumAcidity.ALKALINE) {
|
||||||
|
EnumAcidity pH = soil.getPH(event.world, event.x, y, event.z);
|
||||||
|
int next = Math.min(pH.ordinal() + Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 2);
|
||||||
|
if (soil.setPH(event.world, event.x, y, event.z, EnumAcidity.values()[next])
|
||||||
|
&& !event.entityPlayer.capabilities.isCreativeMode) {
|
||||||
|
ItemStack heldItem3 = event.entityPlayer.getHeldItem();
|
||||||
|
heldItem3.stackSize--;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Gardening.isWeedkiller(event.entityPlayer.getHeldItem())
|
||||||
|
&& Gardening.addWeedKiller(event.world, event.x, y, event.z)
|
||||||
|
&& !event.entityPlayer.capabilities.isCreativeMode) {
|
||||||
|
ItemStack heldItem4 = event.entityPlayer.getHeldItem();
|
||||||
|
heldItem4.stackSize--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void plantVanilla(BlockEvent.PlaceEvent event) {
|
||||||
|
World world = event.world;
|
||||||
|
int x = event.x;
|
||||||
|
int y = event.y;
|
||||||
|
int z = event.z;
|
||||||
|
Block block = world.getBlock(x, y - 1, z);
|
||||||
|
if (!(block instanceof IBlockSoil)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
IFlower flower = BotanyCore.getFlowerRoot().getConversion(event.itemInHand);
|
||||||
|
if (flower != null) {
|
||||||
|
Gardening.plant(world, x, y, z, flower, event.player.getGameProfile());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public void onPlantVanilla(PlayerInteractEvent event) {
|
||||||
|
if (!BinnieCore.proxy.isSimulating(event.world)
|
||||||
|
|| event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (event.entityPlayer == null || event.entityPlayer.getHeldItem() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
World world = event.world;
|
||||||
|
int x = event.x;
|
||||||
|
int y = event.y;
|
||||||
|
int z = event.z;
|
||||||
|
Block block = world.getBlock(x, y, z);
|
||||||
|
int py = -1;
|
||||||
|
if (block instanceof IBlockSoil
|
||||||
|
&& (world.isAirBlock(x, y + 1, z) || world.getBlock(x, y, z).isReplaceable(world, x, y, z))) {
|
||||||
|
py = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (py < 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
IFlower flower = BotanyCore.getFlowerRoot().getConversion(event.entityPlayer.getHeldItem());
|
||||||
|
if (flower != null
|
||||||
|
&& Gardening.plant(world, x, y + py, z, flower, event.entityPlayer.getGameProfile())
|
||||||
|
&& !event.entityPlayer.capabilities.isCreativeMode) {
|
||||||
|
ItemStack heldItem = event.entityPlayer.getHeldItem();
|
||||||
|
heldItem.stackSize--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onBonemeal(BonemealEvent event) {
|
||||||
|
Block block = event.world.getBlock(event.x, event.y, event.z);
|
||||||
|
if (Gardening.isSoil(block)) {
|
||||||
|
IBlockSoil soil = (IBlockSoil) block;
|
||||||
|
if (soil.fertilise(event.world, event.x, event.y, event.z, EnumSoilType.LOAM)) {
|
||||||
|
event.setResult(Event.Result.ALLOW);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z);
|
||||||
|
if (tile instanceof TileEntityFlower && ((TileEntityFlower) tile).onBonemeal()) {
|
||||||
|
event.setResult(Event.Result.ALLOW);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isActive() {
|
||||||
|
return BinnieCore.isBotanyActive();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Mod.EventHandler
|
||||||
|
public void onIMC(FMLInterModComms.IMCEvent event) {
|
||||||
|
for (FMLInterModComms.IMCMessage message : event.getMessages()) {
|
||||||
|
if (message.key.equals("add-nutrient-fertiliser-1")) {
|
||||||
|
ModuleGardening.queuedNutrientFertilisers.put(message.getItemStackValue(), 1);
|
||||||
|
}
|
||||||
|
if (message.key.equals("add-nutrient-fertiliser-2")) {
|
||||||
|
ModuleGardening.queuedNutrientFertilisers.put(message.getItemStackValue(), 2);
|
||||||
|
}
|
||||||
|
if (message.key.equals("add-acid-fertiliser-1")) {
|
||||||
|
ModuleGardening.queuedAcidFertilisers.put(message.getItemStackValue(), 1);
|
||||||
|
}
|
||||||
|
if (message.key.equals("add-acid-fertiliser-2")) {
|
||||||
|
ModuleGardening.queuedAcidFertilisers.put(message.getItemStackValue(), 2);
|
||||||
|
}
|
||||||
|
if (message.key.equals("add-alkaline-fertiliser-1")) {
|
||||||
|
ModuleGardening.queuedAlkalineFertilisers.put(message.getItemStackValue(), 1);
|
||||||
|
}
|
||||||
|
if (message.key.equals("add-alkaline-fertiliser-2")) {
|
||||||
|
ModuleGardening.queuedAlkalineFertilisers.put(message.getItemStackValue(), 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class PacketHandler extends BinniePacketHandler {
|
||||||
|
public PacketHandler() {
|
||||||
|
super(Botany.instance);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,48 +1,39 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany;
|
package binnie.botany;
|
||||||
|
|
||||||
import net.minecraft.item.Item;
|
import binnie.core.util.I18N;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class CreativeTabBotany extends CreativeTabs
|
public class CreativeTabBotany extends CreativeTabs {
|
||||||
{
|
public static CreativeTabs instance = new CreativeTabBotany();
|
||||||
public static CreativeTabs instance;
|
|
||||||
|
|
||||||
@Override
|
public CreativeTabBotany() {
|
||||||
public ItemStack getIconItemStack() {
|
super("Botany");
|
||||||
return new ItemStack(Blocks.red_flower, 1, 5);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public CreativeTabBotany() {
|
@Override
|
||||||
super("Botany");
|
public ItemStack getIconItemStack() {
|
||||||
}
|
return new ItemStack(Blocks.red_flower, 1, 5);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTranslatedTabLabel() {
|
public String getTranslatedTabLabel() {
|
||||||
return this.getTabLabel();
|
return getTabLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public String getTabLabel() {
|
public String getTabLabel() {
|
||||||
return Botany.proxy.localise("tab.botany");
|
return I18N.localise("botany.tab.botany");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public Item getTabIconItem() {
|
public Item getTabIconItem() {
|
||||||
return Item.getItemFromBlock(Blocks.yellow_flower);
|
return Item.getItemFromBlock(Blocks.yellow_flower);
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
|
||||||
CreativeTabBotany.instance = new CreativeTabBotany();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,11 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.api;
|
package binnie.botany.api;
|
||||||
|
|
||||||
public enum EnumAcidity
|
public enum EnumAcidity {
|
||||||
{
|
ACID,
|
||||||
Acid,
|
NEUTRAL,
|
||||||
Neutral,
|
ALKALINE;
|
||||||
Alkaline;
|
|
||||||
|
|
||||||
public String getID() {
|
public String getID() {
|
||||||
return this.name().toLowerCase();
|
return name().toLowerCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,51 +1,46 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.api;
|
package binnie.botany.api;
|
||||||
|
|
||||||
import forestry.api.genetics.IAlleleFloat;
|
|
||||||
import forestry.api.genetics.IAlleleTolerance;
|
|
||||||
import forestry.api.genetics.IAlleleArea;
|
|
||||||
import forestry.api.genetics.IAlleleInteger;
|
|
||||||
import forestry.api.genetics.AlleleManager;
|
import forestry.api.genetics.AlleleManager;
|
||||||
import forestry.api.genetics.ISpeciesRoot;
|
|
||||||
import forestry.api.genetics.IAllele;
|
import forestry.api.genetics.IAllele;
|
||||||
|
import forestry.api.genetics.IAlleleArea;
|
||||||
|
import forestry.api.genetics.IAlleleFloat;
|
||||||
|
import forestry.api.genetics.IAlleleInteger;
|
||||||
|
import forestry.api.genetics.IAlleleTolerance;
|
||||||
import forestry.api.genetics.IChromosomeType;
|
import forestry.api.genetics.IChromosomeType;
|
||||||
|
import forestry.api.genetics.ISpeciesRoot;
|
||||||
|
|
||||||
public enum EnumFlowerChromosome implements IChromosomeType
|
public enum EnumFlowerChromosome implements IChromosomeType {
|
||||||
{
|
SPECIES(IAlleleFlowerSpecies.class),
|
||||||
SPECIES(IAlleleFlowerSpecies.class),
|
PRIMARY(IAlleleInteger.class),
|
||||||
PRIMARY(IAlleleInteger.class),
|
SECONDARY(IAlleleInteger.class),
|
||||||
SECONDARY(IAlleleInteger.class),
|
FERTILITY(IAlleleInteger.class),
|
||||||
FERTILITY(IAlleleInteger.class),
|
TERRITORY(IAlleleArea.class),
|
||||||
TERRITORY(IAlleleArea.class),
|
EFFECT(IAlleleFlowerEffect.class),
|
||||||
EFFECT(IAlleleFlowerEffect.class),
|
LIFESPAN(IAlleleInteger.class),
|
||||||
LIFESPAN(IAlleleInteger.class),
|
TEMPERATURE_TOLERANCE(IAlleleTolerance.class),
|
||||||
TEMPERATURE_TOLERANCE(IAlleleTolerance.class),
|
HUMIDITY_TOLERANCE(IAlleleTolerance.class),
|
||||||
HUMIDITY_TOLERANCE(IAlleleTolerance.class),
|
PH_TOLERANCE(IAlleleTolerance.class),
|
||||||
PH_TOLERANCE(IAlleleTolerance.class),
|
SAPPINESS(IAlleleFloat.class),
|
||||||
SAPPINESS(IAlleleFloat.class),
|
STEM(IAlleleInteger.class);
|
||||||
STEM(IAlleleInteger.class);
|
|
||||||
|
|
||||||
private Class<? extends IAllele> cls;
|
private Class<? extends IAllele> cls;
|
||||||
|
|
||||||
private EnumFlowerChromosome(final Class<? extends IAllele> cls) {
|
EnumFlowerChromosome(Class<? extends IAllele> cls) {
|
||||||
this.cls = cls;
|
this.cls = cls;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends IAllele> getAlleleClass() {
|
public Class<? extends IAllele> getAlleleClass() {
|
||||||
return this.cls;
|
return cls;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return this.toString().toLowerCase();
|
return toString().toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ISpeciesRoot getSpeciesRoot() {
|
public ISpeciesRoot getSpeciesRoot() {
|
||||||
return AlleleManager.alleleRegistry.getSpeciesRoot("rootFlowers");
|
return AlleleManager.alleleRegistry.getSpeciesRoot("rootFlowers");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,28 +1,18 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.api;
|
package binnie.botany.api;
|
||||||
|
|
||||||
public enum EnumFlowerStage
|
public enum EnumFlowerStage {
|
||||||
{
|
FLOWER("Flower"),
|
||||||
FLOWER("Flower"),
|
SEED("Seed"),
|
||||||
SEED("Seed"),
|
POLLEN("Pollen"),
|
||||||
POLLEN("Pollen"),
|
NONE("NONE");
|
||||||
NONE("NONE");
|
|
||||||
|
|
||||||
public static final EnumFlowerStage[] VALUES;
|
protected String name;
|
||||||
String name;
|
|
||||||
|
|
||||||
private EnumFlowerStage(final String name) {
|
EnumFlowerStage(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return this.name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
|
||||||
VALUES = values();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,11 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.api;
|
package binnie.botany.api;
|
||||||
|
|
||||||
public enum EnumMoisture
|
public enum EnumMoisture {
|
||||||
{
|
DRY,
|
||||||
Dry,
|
NORMAL,
|
||||||
Normal,
|
DAMP;
|
||||||
Damp;
|
|
||||||
|
|
||||||
public String getID() {
|
public String getID() {
|
||||||
return this.name().toLowerCase();
|
return name().toLowerCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,11 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.api;
|
package binnie.botany.api;
|
||||||
|
|
||||||
public enum EnumSoilType
|
public enum EnumSoilType {
|
||||||
{
|
SOIL,
|
||||||
SOIL,
|
LOAM,
|
||||||
LOAM,
|
FLOWERBED;
|
||||||
FLOWERBED;
|
|
||||||
|
|
||||||
public String getID() {
|
public String getID() {
|
||||||
return this.name().toLowerCase();
|
return name().toLowerCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,9 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.api;
|
package binnie.botany.api;
|
||||||
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import forestry.api.genetics.IEffectData;
|
|
||||||
import forestry.api.genetics.IAlleleEffect;
|
import forestry.api.genetics.IAlleleEffect;
|
||||||
|
import forestry.api.genetics.IEffectData;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public interface IAlleleFlowerEffect extends IAlleleEffect
|
public interface IAlleleFlowerEffect extends IAlleleEffect {
|
||||||
{
|
IEffectData doEffect(IFlowerGenome genome, IEffectData storedData, World world, int x, int y, int z);
|
||||||
IEffectData doEffect(final IFlowerGenome p0, final IEffectData p1, final World p2, final int p3, final int p4, final int p5);
|
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,11 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.api;
|
package binnie.botany.api;
|
||||||
|
|
||||||
import forestry.api.genetics.IAlleleSpecies;
|
import forestry.api.genetics.IAlleleSpecies;
|
||||||
|
|
||||||
public interface IAlleleFlowerSpecies extends IAlleleSpecies
|
public interface IAlleleFlowerSpecies extends IAlleleSpecies {
|
||||||
{
|
IFlowerType getType();
|
||||||
IFlowerType getType();
|
|
||||||
|
|
||||||
EnumAcidity getPH();
|
EnumAcidity getPH();
|
||||||
|
|
||||||
EnumMoisture getMoisture();
|
EnumMoisture getMoisture();
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,5 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.api;
|
package binnie.botany.api;
|
||||||
|
|
||||||
import forestry.api.genetics.IBreedingTracker;
|
import forestry.api.genetics.IBreedingTracker;
|
||||||
|
|
||||||
public interface IBotanistTracker extends IBreedingTracker
|
public interface IBotanistTracker extends IBreedingTracker {}
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -1,18 +1,13 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.api;
|
package binnie.botany.api;
|
||||||
|
|
||||||
public interface IColourMix
|
public interface IColourMix {
|
||||||
{
|
IFlowerColor getColor1();
|
||||||
IFlowerColour getColour1();
|
|
||||||
|
|
||||||
IFlowerColour getColour2();
|
IFlowerColor getColor2();
|
||||||
|
|
||||||
boolean isMutation(final IFlowerColour p0, final IFlowerColour p1);
|
boolean isMutation(IFlowerColor color1, IFlowerColor color2);
|
||||||
|
|
||||||
int getChance();
|
int getChance();
|
||||||
|
|
||||||
IFlowerColour getResult();
|
IFlowerColor getResult();
|
||||||
}
|
}
|
||||||
@@ -1,38 +1,33 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.api;
|
package binnie.botany.api;
|
||||||
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import forestry.api.genetics.IIndividual;
|
import forestry.api.genetics.IIndividual;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public interface IFlower extends IIndividual
|
public interface IFlower extends IIndividual {
|
||||||
{
|
@Override
|
||||||
@Override
|
IFlowerGenome getGenome();
|
||||||
IFlowerGenome getGenome();
|
|
||||||
|
|
||||||
IFlowerGenome getMate();
|
IFlowerGenome getMate();
|
||||||
|
|
||||||
void mate(final IFlower p0);
|
void mate(IFlower other);
|
||||||
|
|
||||||
int getAge();
|
int getAge();
|
||||||
|
|
||||||
void age();
|
void setAge(int age);
|
||||||
|
|
||||||
void setAge(final int p0);
|
void age();
|
||||||
|
|
||||||
IFlower getOffspring(final World p0);
|
IFlower getOffspring(World world);
|
||||||
|
|
||||||
int getMaxAge();
|
int getMaxAge();
|
||||||
|
|
||||||
boolean isWilted();
|
boolean isWilted();
|
||||||
|
|
||||||
void setWilted(final boolean p0);
|
void setWilted(boolean value);
|
||||||
|
|
||||||
boolean hasFlowered();
|
boolean hasFlowered();
|
||||||
|
|
||||||
void setFlowered(final boolean p0);
|
void setFlowered(boolean value);
|
||||||
|
|
||||||
void removeMate();
|
void removeMate();
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package binnie.botany.api;
|
||||||
|
|
||||||
|
import forestry.api.genetics.IAlleleInteger;
|
||||||
|
|
||||||
|
public interface IFlowerColor {
|
||||||
|
int getColor(boolean dis);
|
||||||
|
|
||||||
|
IAlleleInteger getAllele();
|
||||||
|
|
||||||
|
int getID();
|
||||||
|
|
||||||
|
String getName();
|
||||||
|
}
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.api;
|
|
||||||
|
|
||||||
import forestry.api.genetics.IAlleleInteger;
|
|
||||||
|
|
||||||
public interface IFlowerColour
|
|
||||||
{
|
|
||||||
int getColor(final boolean p0);
|
|
||||||
|
|
||||||
IAlleleInteger getAllele();
|
|
||||||
|
|
||||||
int getID();
|
|
||||||
|
|
||||||
String getName();
|
|
||||||
}
|
|
||||||
@@ -1,46 +1,41 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.api;
|
package binnie.botany.api;
|
||||||
|
|
||||||
import forestry.api.core.EnumTemperature;
|
import forestry.api.core.EnumTemperature;
|
||||||
import forestry.api.genetics.EnumTolerance;
|
import forestry.api.genetics.EnumTolerance;
|
||||||
import forestry.api.genetics.IGenome;
|
import forestry.api.genetics.IGenome;
|
||||||
|
|
||||||
public interface IFlowerGenome extends IGenome
|
public interface IFlowerGenome extends IGenome {
|
||||||
{
|
@Override
|
||||||
@Override
|
IAlleleFlowerSpecies getPrimary();
|
||||||
IAlleleFlowerSpecies getPrimary();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
IAlleleFlowerSpecies getSecondary();
|
IAlleleFlowerSpecies getSecondary();
|
||||||
|
|
||||||
IFlowerColour getPrimaryColor();
|
IFlowerColor getPrimaryColor();
|
||||||
|
|
||||||
IFlowerColour getSecondaryColor();
|
IFlowerColor getSecondaryColor();
|
||||||
|
|
||||||
IFlowerColour getStemColor();
|
IFlowerColor getStemColor();
|
||||||
|
|
||||||
int getFertility();
|
int getFertility();
|
||||||
|
|
||||||
int getLifespan();
|
int getLifespan();
|
||||||
|
|
||||||
IFlowerType getType();
|
IFlowerType getType();
|
||||||
|
|
||||||
EnumTolerance getToleranceTemperature();
|
EnumTolerance getToleranceTemperature();
|
||||||
|
|
||||||
EnumTolerance getToleranceMoisture();
|
EnumTolerance getToleranceMoisture();
|
||||||
|
|
||||||
EnumTolerance getTolerancePH();
|
EnumTolerance getTolerancePH();
|
||||||
|
|
||||||
float getAgeChance();
|
float getAgeChance();
|
||||||
|
|
||||||
float getSappiness();
|
float getSappiness();
|
||||||
|
|
||||||
boolean canTolerate(final EnumAcidity p0);
|
boolean canTolerate(EnumAcidity pH);
|
||||||
|
|
||||||
boolean canTolerate(final EnumMoisture p0);
|
boolean canTolerate(EnumMoisture moisture);
|
||||||
|
|
||||||
boolean canTolerate(final EnumTemperature p0);
|
boolean canTolerate(EnumTemperature temp);
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,9 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.api;
|
package binnie.botany.api;
|
||||||
|
|
||||||
import forestry.api.genetics.IGenome;
|
|
||||||
import forestry.api.genetics.IAllele;
|
import forestry.api.genetics.IAllele;
|
||||||
|
import forestry.api.genetics.IGenome;
|
||||||
import forestry.api.genetics.IMutation;
|
import forestry.api.genetics.IMutation;
|
||||||
|
|
||||||
public interface IFlowerMutation extends IMutation
|
public interface IFlowerMutation extends IMutation {
|
||||||
{
|
float getChance(IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1);
|
||||||
float getChance(final IAllele p0, final IAllele p1, final IGenome p2, final IGenome p3);
|
|
||||||
}
|
}
|
||||||
@@ -1,48 +1,43 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.api;
|
package binnie.botany.api;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
import net.minecraft.world.World;
|
|
||||||
import forestry.api.genetics.IAllele;
|
import forestry.api.genetics.IAllele;
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import forestry.api.genetics.ISpeciesRoot;
|
import forestry.api.genetics.ISpeciesRoot;
|
||||||
|
import java.util.Collection;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public interface IFlowerRoot extends ISpeciesRoot
|
public interface IFlowerRoot extends ISpeciesRoot {
|
||||||
{
|
@Override
|
||||||
@Override
|
IFlower getMember(ItemStack stack);
|
||||||
IFlower getMember(final ItemStack p0);
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
IFlower templateAsIndividual(final IAllele[] p0);
|
IFlower templateAsIndividual(IAllele[] template);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
IFlower templateAsIndividual(final IAllele[] p0, final IAllele[] p1);
|
IFlower templateAsIndividual(IAllele[] templateActive, IAllele[] templateInactive);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
IFlowerGenome templateAsGenome(final IAllele[] p0);
|
IFlowerGenome templateAsGenome(IAllele[] template);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
IFlowerGenome templateAsGenome(final IAllele[] p0, final IAllele[] p1);
|
IFlowerGenome templateAsGenome(IAllele[] templateActive, IAllele[] templateInactive);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
IBotanistTracker getBreedingTracker(final World p0, final GameProfile p1);
|
IBotanistTracker getBreedingTracker(World world, GameProfile player);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
Collection<IFlowerMutation> getMutations(final boolean p0);
|
Collection<IFlowerMutation> getMutations(boolean shuffle);
|
||||||
|
|
||||||
EnumFlowerStage getStageType(final ItemStack p0);
|
EnumFlowerStage getStageType(ItemStack stack);
|
||||||
|
|
||||||
IFlower getFlower(final World p0, final IFlowerGenome p1);
|
IFlower getFlower(World world, IFlowerGenome genome);
|
||||||
|
|
||||||
void addConversion(final ItemStack p0, final IAllele[] p1);
|
void addConversion(ItemStack stack, IAllele[] template);
|
||||||
|
|
||||||
IFlower getConversion(final ItemStack p0);
|
IFlower getConversion(ItemStack stack);
|
||||||
|
|
||||||
Collection<IColourMix> getColourMixes(final boolean p0);
|
Collection<IColourMix> getColourMixes(boolean shuffle);
|
||||||
|
|
||||||
void registerColourMix(final IColourMix p0);
|
void registerColourMix(IColourMix colorMix);
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,17 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.api;
|
package binnie.botany.api;
|
||||||
|
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
public interface IFlowerType
|
public interface IFlowerType {
|
||||||
{
|
IIcon getStem(EnumFlowerStage stage, boolean flowered, int section);
|
||||||
IIcon getStem(final EnumFlowerStage p0, final boolean p1, final int p2);
|
|
||||||
|
|
||||||
IIcon getPetalIcon(final EnumFlowerStage p0, final boolean p1, final int p2);
|
IIcon getPetalIcon(EnumFlowerStage stage, boolean flowered, int section);
|
||||||
|
|
||||||
IIcon getVariantIcon(final EnumFlowerStage p0, final boolean p1, final int p2);
|
IIcon getVariantIcon(EnumFlowerStage stage, boolean flowered, int section);
|
||||||
|
|
||||||
int getID();
|
int getID();
|
||||||
|
|
||||||
int getSections();
|
int getSections();
|
||||||
|
|
||||||
int ordinal();
|
int ordinal();
|
||||||
}
|
}
|
||||||
@@ -1,29 +1,24 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.api.gardening;
|
package binnie.botany.api.gardening;
|
||||||
|
|
||||||
import binnie.botany.api.EnumSoilType;
|
|
||||||
import binnie.botany.api.EnumMoisture;
|
|
||||||
import binnie.botany.api.EnumAcidity;
|
import binnie.botany.api.EnumAcidity;
|
||||||
|
import binnie.botany.api.EnumMoisture;
|
||||||
|
import binnie.botany.api.EnumSoilType;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public interface IBlockSoil
|
public interface IBlockSoil {
|
||||||
{
|
EnumAcidity getPH(World world, int x, int y, int z);
|
||||||
EnumAcidity getPH(final World p0, final int p1, final int p2, final int p3);
|
|
||||||
|
|
||||||
EnumMoisture getMoisture(final World p0, final int p1, final int p2, final int p3);
|
EnumMoisture getMoisture(World world, int x, int y, int z);
|
||||||
|
|
||||||
EnumSoilType getType(final World p0, final int p1, final int p2, final int p3);
|
EnumSoilType getType(World world, int x, int y, int z);
|
||||||
|
|
||||||
boolean fertilise(final World p0, final int p1, final int p2, final int p3, final EnumSoilType p4);
|
boolean fertilise(World world, int x, int y, int z, EnumSoilType maxLevel);
|
||||||
|
|
||||||
boolean degrade(final World p0, final int p1, final int p2, final int p3, final EnumSoilType p4);
|
boolean degrade(World world, int x, int y, int z, EnumSoilType minLevel);
|
||||||
|
|
||||||
boolean setPH(final World p0, final int p1, final int p2, final int p3, final EnumAcidity p4);
|
boolean setPH(World world, int x, int y, int z, EnumAcidity pH);
|
||||||
|
|
||||||
boolean setMoisture(final World p0, final int p1, final int p2, final int p3, final EnumMoisture p4);
|
boolean setMoisture(World world, int x, int y, int z, EnumMoisture p4);
|
||||||
|
|
||||||
boolean resistsWeeds(final World p0, final int p1, final int p2, final int p3);
|
boolean resistsWeeds(World world, int x, int y, int z);
|
||||||
}
|
}
|
||||||
@@ -1,147 +1,145 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.ceramic;
|
package binnie.botany.ceramic;
|
||||||
|
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
|
||||||
import binnie.botany.Botany;
|
import binnie.botany.Botany;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import binnie.botany.CreativeTabBotany;
|
||||||
|
import binnie.botany.genetics.EnumFlowerColor;
|
||||||
|
import binnie.core.block.BlockMetadata;
|
||||||
|
import binnie.core.block.IBlockMetadata;
|
||||||
|
import binnie.core.block.TileEntityMetadata;
|
||||||
|
import binnie.core.util.I18N;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import java.util.List;
|
|
||||||
import binnie.botany.genetics.EnumFlowerColor;
|
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
|
||||||
import binnie.core.block.TileEntityMetadata;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import binnie.core.block.BlockMetadata;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import net.minecraft.world.World;
|
import java.util.List;
|
||||||
import binnie.botany.CreativeTabBotany;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import binnie.core.block.IBlockMetadata;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class BlockCeramic extends Block implements IBlockMetadata
|
public class BlockCeramic extends Block implements IBlockMetadata {
|
||||||
{
|
public BlockCeramic() {
|
||||||
public BlockCeramic() {
|
super(Material.rock);
|
||||||
super(Material.rock);
|
setHardness(1.0f);
|
||||||
this.setHardness(1.0f);
|
setResistance(5.0f);
|
||||||
this.setResistance(5.0f);
|
setBlockName("ceramic");
|
||||||
this.setBlockName("ceramic");
|
setCreativeTab(CreativeTabBotany.instance);
|
||||||
this.setCreativeTab(CreativeTabBotany.instance);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int blockMeta, final int fortune) {
|
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, final int z) {
|
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(final World var1, final int i) {
|
public TileEntity createNewTileEntity(World var1, int i) {
|
||||||
return new TileEntityMetadata();
|
return new TileEntityMetadata();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasTileEntity(final int meta) {
|
public boolean hasTileEntity(int meta) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockEventReceived(final World par1World, final int par2, final int par3, final int par4, final int par5, final int par6) {
|
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||||
super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6);
|
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||||
final TileEntity tileentity = par1World.getTileEntity(par2, par3, par4);
|
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||||
return tileentity != null && tileentity.receiveClientEvent(par5, par6);
|
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getPlacedMeta(final ItemStack stack, final World world, final int x, final int y, final int z, final ForgeDirection clickedBlock) {
|
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||||
return TileEntityMetadata.getItemDamage(stack);
|
return TileEntityMetadata.getItemDamage(itemStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
|
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||||
return tileMeta;
|
return tileMeta;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBlockName(final ItemStack par1ItemStack) {
|
public String getBlockName(ItemStack itemStack) {
|
||||||
final int meta = TileEntityMetadata.getItemDamage(par1ItemStack);
|
return I18N.localise("botany.ceramicBlock");
|
||||||
return EnumFlowerColor.get(meta).getName() + " Ceramic Block";
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getBlockTooltip(final ItemStack par1ItemStack, final List par3List) {
|
public void addBlockTooltip(ItemStack stack, List tooltip) {
|
||||||
}
|
int meta = TileEntityMetadata.getItemDamage(stack);
|
||||||
|
tooltip.add(EnumChatFormatting.GRAY + EnumFlowerColor.get(meta).getName());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dropAsStack(final World world, final int x, final int y, final int z, final ItemStack drop) {
|
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||||
this.dropBlockAsItem(world, x, y, z, drop);
|
dropBlockAsItem(world, x, y, z, itemStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
|
public void getSubBlocks(Item item, CreativeTabs tabs, List itemList) {
|
||||||
for (final EnumFlowerColor c : EnumFlowerColor.values()) {
|
for (EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||||
itemList.add(TileEntityMetadata.getItemStack(this, c.ordinal()));
|
itemList.add(TileEntityMetadata.getItemStack(this, c.ordinal()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side) {
|
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||||
final TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||||
if (tile != null) {
|
if (tile != null) {
|
||||||
return this.getIcon(side, tile.getTileMetadata());
|
return getIcon(side, tile.getTileMetadata());
|
||||||
}
|
}
|
||||||
return super.getIcon(world, x, y, z, side);
|
return super.getIcon(world, x, y, z, side);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(final int side, final int meta) {
|
public IIcon getIcon(int side, int meta) {
|
||||||
return this.blockIcon;
|
return blockIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(final IIconRegister register) {
|
public void registerBlockIcons(IIconRegister register) {
|
||||||
this.blockIcon = Botany.proxy.getIcon(register, "ceramic");
|
blockIcon = Botany.proxy.getIcon(register, "ceramic");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public int colorMultiplier(final IBlockAccess world, final int x, final int y, final int z) {
|
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
|
||||||
final TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||||
if (tile != null) {
|
if (tile != null) {
|
||||||
return this.getRenderColor(tile.getTileMetadata());
|
return getRenderColor(tile.getTileMetadata());
|
||||||
}
|
}
|
||||||
return 16777215;
|
return 0xffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(final World par1World, final int par2, final int par3, final int par4, final Block par5, final int par6) {
|
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||||
super.breakBlock(par1World, par2, par3, par4, par5, par6);
|
super.breakBlock(world, x, y, z, block, side);
|
||||||
par1World.removeTileEntity(par2, par3, par4);
|
world.removeTileEntity(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, final int z) {
|
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public int getRenderColor(final int meta) {
|
public int getRenderColor(int meta) {
|
||||||
return EnumFlowerColor.get(meta).getColor(false);
|
return EnumFlowerColor.get(meta).getColor(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1,35 +1,42 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.ceramic;
|
package binnie.botany.ceramic;
|
||||||
|
|
||||||
|
import binnie.botany.CreativeTabBotany;
|
||||||
|
import binnie.botany.genetics.EnumFlowerColor;
|
||||||
|
import binnie.core.block.TileEntityMetadata;
|
||||||
|
import binnie.core.util.I18N;
|
||||||
|
import binnie.extratrees.api.IDesign;
|
||||||
|
import binnie.extratrees.carpentry.BlockDesign;
|
||||||
import binnie.extratrees.carpentry.DesignBlock;
|
import binnie.extratrees.carpentry.DesignBlock;
|
||||||
import binnie.extratrees.carpentry.ModuleCarpentry;
|
import binnie.extratrees.carpentry.ModuleCarpentry;
|
||||||
import binnie.botany.genetics.EnumFlowerColor;
|
import java.util.List;
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import binnie.extratrees.api.IDesign;
|
|
||||||
import binnie.botany.CreativeTabBotany;
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import binnie.extratrees.carpentry.BlockDesign;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
|
||||||
public class BlockCeramicPatterned extends BlockDesign
|
public class BlockCeramicPatterned extends BlockDesign {
|
||||||
{
|
public BlockCeramicPatterned() {
|
||||||
public BlockCeramicPatterned() {
|
super(CeramicDesignSystem.instance, Material.rock);
|
||||||
super(CeramicDesignSystem.instance, Material.rock);
|
setHardness(1.0f);
|
||||||
this.setHardness(1.0f);
|
setResistance(5.0f);
|
||||||
this.setResistance(5.0f);
|
setCreativeTab(CreativeTabBotany.instance);
|
||||||
this.setCreativeTab(CreativeTabBotany.instance);
|
setBlockName("ceramicPattern");
|
||||||
this.setBlockName("ceramicPattern");
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getCreativeStack(final IDesign design) {
|
public ItemStack getCreativeStack(IDesign design) {
|
||||||
return ModuleCarpentry.getItemStack(this, CeramicColor.get(EnumFlowerColor.White), CeramicColor.get(EnumFlowerColor.Black), design);
|
return ModuleCarpentry.getItemStack(
|
||||||
}
|
this, CeramicColor.get(EnumFlowerColor.WHITE), CeramicColor.get(EnumFlowerColor.BLACK), design);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBlockName(final DesignBlock design) {
|
public String getBlockName(DesignBlock design) {
|
||||||
return design.getDesign().getName() + " Ceramic Block";
|
return I18N.localise("botany.ceramicBlock");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addBlockTooltip(ItemStack stack, List tooltip) {
|
||||||
|
super.addBlockTooltip(stack, tooltip);
|
||||||
|
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||||
|
tooltip.add(EnumChatFormatting.GRAY + block.getDesign().getName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,197 +1,195 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.ceramic;
|
package binnie.botany.ceramic;
|
||||||
|
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
|
||||||
import binnie.botany.Botany;
|
import binnie.botany.Botany;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import binnie.botany.CreativeTabBotany;
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import java.util.List;
|
|
||||||
import binnie.botany.genetics.EnumFlowerColor;
|
import binnie.botany.genetics.EnumFlowerColor;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
|
||||||
import binnie.core.block.TileEntityMetadata;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import binnie.core.block.BlockMetadata;
|
import binnie.core.block.BlockMetadata;
|
||||||
import net.minecraft.item.ItemStack;
|
import binnie.core.block.IBlockMetadata;
|
||||||
import java.util.ArrayList;
|
import binnie.core.block.TileEntityMetadata;
|
||||||
import net.minecraft.world.World;
|
import binnie.core.util.I18N;
|
||||||
import binnie.extratrees.ExtraTrees;
|
import binnie.extratrees.ExtraTrees;
|
||||||
import net.minecraft.util.Facing;
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import binnie.botany.CreativeTabBotany;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import binnie.core.block.IBlockMetadata;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class BlockStained extends Block implements IBlockMetadata
|
public class BlockStained extends Block implements IBlockMetadata {
|
||||||
{
|
public BlockStained() {
|
||||||
public BlockStained() {
|
super(Material.glass);
|
||||||
super(Material.glass);
|
setCreativeTab(CreativeTabBotany.instance);
|
||||||
this.setCreativeTab(CreativeTabBotany.instance);
|
setBlockName("stained");
|
||||||
this.setBlockName("stained");
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int quantityDropped(final Random p_149745_1_) {
|
public int quantityDropped(Random rand) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube() {
|
public boolean isOpaqueCube() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock() {
|
public boolean renderAsNormalBlock() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public int getRenderBlockPass() {
|
public int getRenderBlockPass() {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public boolean shouldSideBeRendered(final IBlockAccess p_149646_1_, final int p_149646_2_, final int p_149646_3_, final int p_149646_4_, final int p_149646_5_) {
|
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||||
final Block block2 = p_149646_1_.getBlock(p_149646_2_ - Facing.offsetsXForSide[p_149646_5_], p_149646_3_ - Facing.offsetsYForSide[p_149646_5_], p_149646_4_ - Facing.offsetsZForSide[p_149646_5_]);
|
// Block block2 = world.getBlock(x - Facing.offsetsXForSide[side], y - Facing.offsetsYForSide[side], z -
|
||||||
final Block block3 = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_);
|
// Facing.offsetsZForSide[side]);
|
||||||
return block3 != this && block3 != ExtraTrees.blockStained && super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
|
Block block = world.getBlock(x, y, z);
|
||||||
}
|
return block != this && block != ExtraTrees.blockStained && super.shouldSideBeRendered(world, x, y, z, side);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int blockMeta, final int fortune) {
|
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, final int z) {
|
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(final World var1, final int i) {
|
public TileEntity createNewTileEntity(World var1, int i) {
|
||||||
return new TileEntityMetadata();
|
return new TileEntityMetadata();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasTileEntity(final int meta) {
|
public boolean hasTileEntity(int meta) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockEventReceived(final World par1World, final int par2, final int par3, final int par4, final int par5, final int par6) {
|
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||||
super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6);
|
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||||
final TileEntity tileentity = par1World.getTileEntity(par2, par3, par4);
|
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||||
return tileentity != null && tileentity.receiveClientEvent(par5, par6);
|
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getPlacedMeta(final ItemStack stack, final World world, final int x, final int y, final int z, final ForgeDirection clickedBlock) {
|
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||||
return TileEntityMetadata.getItemDamage(stack);
|
return TileEntityMetadata.getItemDamage(itemStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
|
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||||
return tileMeta;
|
return tileMeta;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBlockName(final ItemStack par1ItemStack) {
|
public String getBlockName(ItemStack itemStack) {
|
||||||
final int meta = TileEntityMetadata.getItemDamage(par1ItemStack);
|
return I18N.localise("botany.pigmentedGlass");
|
||||||
return EnumFlowerColor.get(meta).getName() + " Pigmented Glass";
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getBlockTooltip(final ItemStack par1ItemStack, final List par3List) {
|
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||||
}
|
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||||
|
tooltip.add(EnumChatFormatting.GRAY + EnumFlowerColor.get(meta).getName());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dropAsStack(final World world, final int x, final int y, final int z, final ItemStack drop) {
|
public void dropAsStack(World world, int x, int y, int z, ItemStack stack) {
|
||||||
this.dropBlockAsItem(world, x, y, z, drop);
|
dropBlockAsItem(world, x, y, z, stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
|
public void getSubBlocks(Item item, CreativeTabs tab, List itemList) {
|
||||||
for (final EnumFlowerColor c : EnumFlowerColor.values()) {
|
for (EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||||
itemList.add(TileEntityMetadata.getItemStack(this, c.ordinal()));
|
itemList.add(TileEntityMetadata.getItemStack(this, c.ordinal()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side) {
|
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||||
final TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||||
if (tile != null) {
|
if (tile != null) {
|
||||||
return this.getIcon(side, tile.getTileMetadata());
|
return getIcon(side, tile.getTileMetadata());
|
||||||
}
|
}
|
||||||
return super.getIcon(world, x, y, z, side);
|
return super.getIcon(world, x, y, z, side);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(final int side, final int meta) {
|
public IIcon getIcon(int side, int meta) {
|
||||||
return this.blockIcon;
|
return blockIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(final IIconRegister register) {
|
public void registerBlockIcons(IIconRegister register) {
|
||||||
this.blockIcon = Botany.proxy.getIcon(register, "stained");
|
blockIcon = Botany.proxy.getIcon(register, "stained");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public int colorMultiplier(final IBlockAccess world, final int x, final int y, final int z) {
|
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
|
||||||
final TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||||
if (tile != null) {
|
if (tile != null) {
|
||||||
return this.getRenderColor(tile.getTileMetadata());
|
return getRenderColor(tile.getTileMetadata());
|
||||||
}
|
}
|
||||||
return 16777215;
|
return 0xffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(final World par1World, final int par2, final int par3, final int par4, final Block par5, final int par6) {
|
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||||
super.breakBlock(par1World, par2, par3, par4, par5, par6);
|
super.breakBlock(world, x, y, z, block, side);
|
||||||
par1World.removeTileEntity(par2, par3, par4);
|
world.removeTileEntity(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isWood(final IBlockAccess world, final int x, final int y, final int z) {
|
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||||
return 20;
|
return 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isFlammable(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, final int z) {
|
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public int getRenderColor(final int meta) {
|
public int getRenderColor(int meta) {
|
||||||
return EnumFlowerColor.get(meta).getColor(false);
|
return EnumFlowerColor.get(meta).getColor(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,49 +1,45 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.ceramic;
|
package binnie.botany.ceramic;
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import binnie.core.block.TileEntityMetadata;
|
|
||||||
import binnie.botany.Botany;
|
import binnie.botany.Botany;
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import java.util.Map;
|
|
||||||
import binnie.botany.genetics.EnumFlowerColor;
|
import binnie.botany.genetics.EnumFlowerColor;
|
||||||
|
import binnie.core.block.TileEntityMetadata;
|
||||||
import binnie.extratrees.api.IDesignMaterial;
|
import binnie.extratrees.api.IDesignMaterial;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class CeramicColor implements IDesignMaterial
|
public class CeramicColor implements IDesignMaterial {
|
||||||
{
|
private static Map<EnumFlowerColor, CeramicColor> map;
|
||||||
EnumFlowerColor color;
|
|
||||||
static Map<EnumFlowerColor, CeramicColor> map;
|
|
||||||
|
|
||||||
CeramicColor(final EnumFlowerColor color) {
|
static {
|
||||||
this.color = color;
|
CeramicColor.map = new LinkedHashMap<>();
|
||||||
}
|
for (EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||||
|
CeramicColor.map.put(c, new CeramicColor(c));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static CeramicColor get(final EnumFlowerColor c) {
|
protected EnumFlowerColor color;
|
||||||
return CeramicColor.map.get(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
CeramicColor(EnumFlowerColor color) {
|
||||||
public ItemStack getStack() {
|
this.color = color;
|
||||||
return TileEntityMetadata.getItemStack(Botany.ceramic, this.color.ordinal());
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public static CeramicColor get(EnumFlowerColor c) {
|
||||||
public String getName() {
|
return CeramicColor.map.get(c);
|
||||||
return this.color.getName();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getColour() {
|
public ItemStack getStack() {
|
||||||
return this.color.getColor(false);
|
return TileEntityMetadata.getItemStack(Botany.ceramic, color.ordinal());
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
@Override
|
||||||
CeramicColor.map = new LinkedHashMap<EnumFlowerColor, CeramicColor>();
|
public String getName() {
|
||||||
for (final EnumFlowerColor c : EnumFlowerColor.values()) {
|
return color.getName();
|
||||||
CeramicColor.map.put(c, new CeramicColor(c));
|
}
|
||||||
}
|
|
||||||
}
|
@Override
|
||||||
|
public int getColor() {
|
||||||
|
return color.getColor(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,102 +1,103 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.ceramic;
|
package binnie.botany.ceramic;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import binnie.botany.items.BotanyItems;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import binnie.botany.Botany;
|
import binnie.botany.Botany;
|
||||||
|
import binnie.botany.genetics.EnumFlowerColor;
|
||||||
|
import binnie.botany.items.BotanyItems;
|
||||||
import binnie.core.AbstractMod;
|
import binnie.core.AbstractMod;
|
||||||
import binnie.core.BinnieCore;
|
import binnie.core.BinnieCore;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
||||||
import binnie.extratrees.carpentry.EnumPattern;
|
|
||||||
import binnie.extratrees.api.IPattern;
|
|
||||||
import binnie.botany.genetics.EnumFlowerColor;
|
|
||||||
import binnie.extratrees.api.IDesignMaterial;
|
import binnie.extratrees.api.IDesignMaterial;
|
||||||
import binnie.extratrees.carpentry.DesignerManager;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
import java.util.Map;
|
|
||||||
import binnie.extratrees.api.IDesignSystem;
|
import binnie.extratrees.api.IDesignSystem;
|
||||||
|
import binnie.extratrees.api.IPattern;
|
||||||
|
import binnie.extratrees.carpentry.DesignerManager;
|
||||||
|
import binnie.extratrees.carpentry.EnumPattern;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
public class CeramicDesignSystem implements IDesignSystem
|
public class CeramicDesignSystem implements IDesignSystem {
|
||||||
{
|
public static CeramicDesignSystem instance = new CeramicDesignSystem();
|
||||||
public static CeramicDesignSystem instance;
|
|
||||||
Map<Integer, IIcon> primary;
|
|
||||||
Map<Integer, IIcon> secondary;
|
|
||||||
|
|
||||||
CeramicDesignSystem() {
|
protected Map<Integer, IIcon> primary;
|
||||||
this.primary = new HashMap<Integer, IIcon>();
|
protected Map<Integer, IIcon> secondary;
|
||||||
this.secondary = new HashMap<Integer, IIcon>();
|
|
||||||
DesignerManager.instance.registerDesignSystem(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
CeramicDesignSystem() {
|
||||||
public IDesignMaterial getDefaultMaterial() {
|
primary = new HashMap<>();
|
||||||
return CeramicColor.get(EnumFlowerColor.White);
|
secondary = new HashMap<>();
|
||||||
}
|
DesignerManager.instance.registerDesignSystem(this);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IDesignMaterial getDefaultMaterial2() {
|
public IDesignMaterial getDefaultMaterial() {
|
||||||
return CeramicColor.get(EnumFlowerColor.Black);
|
return CeramicColor.get(EnumFlowerColor.WHITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IDesignMaterial getMaterial(final int id) {
|
public IDesignMaterial getDefaultMaterial2() {
|
||||||
return CeramicColor.get(EnumFlowerColor.get(id));
|
return CeramicColor.get(EnumFlowerColor.BLACK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaterialIndex(final IDesignMaterial id) {
|
public IDesignMaterial getMaterial(int id) {
|
||||||
return ((CeramicColor) id).color.ordinal();
|
return CeramicColor.get(EnumFlowerColor.get(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTexturePath() {
|
@Override
|
||||||
return "ceramic";
|
public int getMaterialIndex(IDesignMaterial id) {
|
||||||
}
|
return ((CeramicColor) id).color.ordinal();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
public String getTexturePath() {
|
||||||
public IIcon getPrimaryIcon(final IPattern pattern) {
|
return "ceramic";
|
||||||
if (pattern instanceof EnumPattern) {
|
}
|
||||||
return this.primary.get(((EnumPattern) pattern).ordinal());
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getSecondaryIcon(final IPattern pattern) {
|
public IIcon getPrimaryIcon(IPattern pattern) {
|
||||||
if (pattern instanceof EnumPattern) {
|
if (pattern instanceof EnumPattern) {
|
||||||
return this.secondary.get(((EnumPattern) pattern).ordinal());
|
return primary.get(((EnumPattern) pattern).ordinal());
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(final IIconRegister register) {
|
public IIcon getSecondaryIcon(IPattern pattern) {
|
||||||
for (final EnumPattern pattern : EnumPattern.values()) {
|
if (pattern instanceof EnumPattern) {
|
||||||
this.primary.put(pattern.ordinal(), BinnieCore.proxy.getIcon(register, this.getMod().getModID(), this.getTexturePath() + "/" + pattern.toString().toLowerCase() + ".0"));
|
return secondary.get(((EnumPattern) pattern).ordinal());
|
||||||
this.secondary.put(pattern.ordinal(), BinnieCore.proxy.getIcon(register, this.getMod().getModID(), this.getTexturePath() + "/" + pattern.toString().toLowerCase() + ".1"));
|
}
|
||||||
}
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AbstractMod getMod() {
|
@Override
|
||||||
return Botany.instance;
|
public void registerIcons(IIconRegister register) {
|
||||||
}
|
for (EnumPattern pattern : EnumPattern.values()) {
|
||||||
|
primary.put(
|
||||||
|
pattern.ordinal(),
|
||||||
|
BinnieCore.proxy.getIcon(
|
||||||
|
register,
|
||||||
|
getMod().getModID(),
|
||||||
|
getTexturePath() + "/" + pattern.toString().toLowerCase() + ".0"));
|
||||||
|
secondary.put(
|
||||||
|
pattern.ordinal(),
|
||||||
|
BinnieCore.proxy.getIcon(
|
||||||
|
register,
|
||||||
|
getMod().getModID(),
|
||||||
|
getTexturePath() + "/" + pattern.toString().toLowerCase() + ".1"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
public AbstractMod getMod() {
|
||||||
public ItemStack getAdhesive() {
|
return Botany.instance;
|
||||||
return BotanyItems.Mortar.get(1);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IDesignMaterial getMaterial(final ItemStack itemStack) {
|
public ItemStack getAdhesive() {
|
||||||
return (itemStack.getItem() == Item.getItemFromBlock(Botany.ceramic)) ? this.getMaterial(itemStack.getItemDamage()) : null;
|
return BotanyItems.Mortar.get(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
@Override
|
||||||
CeramicDesignSystem.instance = new CeramicDesignSystem();
|
public IDesignMaterial getMaterial(ItemStack stack) {
|
||||||
}
|
return (stack.getItem() == Item.getItemFromBlock(Botany.ceramic)) ? getMaterial(stack.getItemDamage()) : null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,72 +1,70 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.ceramic;
|
package binnie.botany.ceramic;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import binnie.botany.Botany;
|
import binnie.botany.Botany;
|
||||||
import net.minecraft.world.World;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import net.minecraft.inventory.InventoryCrafting;
|
import net.minecraft.inventory.InventoryCrafting;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.IRecipe;
|
import net.minecraft.item.crafting.IRecipe;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class CeramicTileRecipe implements IRecipe
|
public class CeramicTileRecipe implements IRecipe {
|
||||||
{
|
protected ItemStack cached;
|
||||||
ItemStack cached;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(final InventoryCrafting inv, final World world) {
|
public boolean matches(InventoryCrafting crafting, World world) {
|
||||||
this.cached = this.getCraftingResult(inv);
|
cached = getCraftingResult(crafting);
|
||||||
return this.cached != null;
|
return cached != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getCraftingResult(final InventoryCrafting inv) {
|
public ItemStack getCraftingResult(InventoryCrafting inv) {
|
||||||
final Item ceramicBlock = Item.getItemFromBlock(Botany.ceramic);
|
Item ceramicBlock = Item.getItemFromBlock(Botany.ceramic);
|
||||||
final Item ceramicTile = Item.getItemFromBlock(Botany.ceramicTile);
|
Item ceramicTile = Item.getItemFromBlock(Botany.ceramicTile);
|
||||||
final Item ceramicBrick = Item.getItemFromBlock(Botany.ceramicBrick);
|
Item ceramicBrick = Item.getItemFromBlock(Botany.ceramicBrick);
|
||||||
final Item mortar = Botany.misc;
|
Item mortar = Botany.misc;
|
||||||
final List<ItemStack> stacks = new ArrayList<ItemStack>();
|
List<ItemStack> stacks = new ArrayList<>();
|
||||||
int ix = -1;
|
int ix = -1;
|
||||||
int iy = -1;
|
int iy = -1;
|
||||||
for (int i = 0; i < inv.getSizeInventory(); ++i) {
|
|
||||||
final ItemStack stack = inv.getStackInSlot(i);
|
|
||||||
if (stack != null) {
|
|
||||||
final int x = i / 3;
|
|
||||||
final int y = i % 3;
|
|
||||||
if (ix == -1) {
|
|
||||||
ix = x;
|
|
||||||
iy = y;
|
|
||||||
}
|
|
||||||
if (x - ix >= 2 || y - iy >= 2 || y < iy || x < ix) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (stack.getItem() != ceramicBlock && stack.getItem() != ceramicTile && stack.getItem() != ceramicBrick && stack.getItem() != mortar) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
stacks.add(stack);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (final BlockCeramicBrick.TileType type : BlockCeramicBrick.TileType.values()) {
|
|
||||||
final ItemStack stack2 = type.getRecipe(stacks);
|
|
||||||
if (stack2 != null) {
|
|
||||||
return stack2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
for (int i = 0; i < inv.getSizeInventory(); ++i) {
|
||||||
public int getRecipeSize() {
|
ItemStack stack = inv.getStackInSlot(i);
|
||||||
return 2;
|
if (stack != null) {
|
||||||
}
|
int x = i / 3;
|
||||||
|
int y = i % 3;
|
||||||
|
if (ix == -1) {
|
||||||
|
ix = x;
|
||||||
|
iy = y;
|
||||||
|
}
|
||||||
|
if (x - ix >= 2 || y - iy >= 2 || y < iy || x < ix) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
Item item = stack.getItem();
|
||||||
public ItemStack getRecipeOutput() {
|
if (item != ceramicBlock && item != ceramicTile && item != ceramicBrick && item != mortar) {
|
||||||
return this.cached;
|
return null;
|
||||||
}
|
}
|
||||||
|
stacks.add(stack);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (BlockCeramicBrick.TileType type : BlockCeramicBrick.TileType.values()) {
|
||||||
|
ItemStack stack2 = type.getRecipe(stacks);
|
||||||
|
if (stack2 != null) {
|
||||||
|
return stack2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRecipeSize() {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getRecipeOutput() {
|
||||||
|
return cached;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.ceramic;
|
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import binnie.core.block.ItemMetadata;
|
|
||||||
|
|
||||||
public class ItemCeramic extends ItemMetadata
|
|
||||||
{
|
|
||||||
public ItemCeramic(final Block block) {
|
|
||||||
super(block);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public int getColorFromItemStack(final ItemStack stack, final int p_82790_2_) {
|
|
||||||
return 16711935;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,62 +1,62 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.ceramic;
|
package binnie.botany.ceramic;
|
||||||
|
|
||||||
import binnie.botany.api.IFlower;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import binnie.botany.Botany;
|
|
||||||
import binnie.Binnie;
|
import binnie.Binnie;
|
||||||
import net.minecraft.world.World;
|
import binnie.botany.Botany;
|
||||||
|
import binnie.botany.api.IFlower;
|
||||||
import net.minecraft.inventory.InventoryCrafting;
|
import net.minecraft.inventory.InventoryCrafting;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.IRecipe;
|
import net.minecraft.item.crafting.IRecipe;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class PigmentRecipe implements IRecipe
|
public class PigmentRecipe implements IRecipe {
|
||||||
{
|
protected ItemStack cached;
|
||||||
private final ItemStack unknown;
|
|
||||||
ItemStack cached;
|
|
||||||
|
|
||||||
public PigmentRecipe() {
|
private ItemStack unknown;
|
||||||
this.unknown = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public PigmentRecipe() {
|
||||||
public boolean matches(final InventoryCrafting crafting, final World world) {
|
unknown = null;
|
||||||
return this.getCraftingResult(crafting) != null;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getRecipeOutput() {
|
public boolean matches(InventoryCrafting crafting, World world) {
|
||||||
if (this.cached != null) {
|
return getCraftingResult(crafting) != null;
|
||||||
return this.cached;
|
}
|
||||||
}
|
|
||||||
return this.unknown;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getCraftingResult(final InventoryCrafting crafting) {
|
public ItemStack getRecipeOutput() {
|
||||||
int n = 0;
|
if (cached != null) {
|
||||||
ItemStack stack = null;
|
return cached;
|
||||||
for (int i = 0; i < crafting.getSizeInventory(); ++i) {
|
}
|
||||||
if (crafting.getStackInSlot(i) != null) {
|
return unknown;
|
||||||
if (++n > 1) {
|
}
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (Binnie.Genetics.getFlowerRoot().isMember(crafting.getStackInSlot(i))) {
|
|
||||||
final IFlower flower = Binnie.Genetics.getFlowerRoot().getMember(crafting.getStackInSlot(i));
|
|
||||||
if (flower.getAge() >= 1) {
|
|
||||||
stack = new ItemStack(Botany.pigment, 1, flower.getGenome().getPrimaryColor().getID());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return stack;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRecipeSize() {
|
public ItemStack getCraftingResult(InventoryCrafting crafting) {
|
||||||
return 1;
|
int n = 0;
|
||||||
}
|
ItemStack stack = null;
|
||||||
|
for (int i = 0; i < crafting.getSizeInventory(); ++i) {
|
||||||
|
if (crafting.getStackInSlot(i) != null) {
|
||||||
|
if (++n > 1) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (!Binnie.Genetics.getFlowerRoot().isMember(crafting.getStackInSlot(i))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
IFlower flower = Binnie.Genetics.getFlowerRoot().getMember(crafting.getStackInSlot(i));
|
||||||
|
if (flower.getAge() >= 1) {
|
||||||
|
stack = new ItemStack(
|
||||||
|
Botany.pigment,
|
||||||
|
1,
|
||||||
|
flower.getGenome().getPrimaryColor().getID());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRecipeSize() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,12 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.core;
|
package binnie.botany.core;
|
||||||
|
|
||||||
import binnie.botany.genetics.FlowerHelper;
|
|
||||||
import binnie.botany.api.IFlowerRoot;
|
import binnie.botany.api.IFlowerRoot;
|
||||||
|
import binnie.botany.genetics.FlowerHelper;
|
||||||
|
|
||||||
public class BotanyCore
|
public class BotanyCore {
|
||||||
{
|
public static IFlowerRoot speciesRoot = new FlowerHelper();
|
||||||
public static final int CHANCE_INTERPOLLINATION = 20;
|
|
||||||
public static IFlowerRoot speciesRoot;
|
|
||||||
|
|
||||||
public static IFlowerRoot getFlowerRoot() {
|
public static IFlowerRoot getFlowerRoot() {
|
||||||
return BotanyCore.speciesRoot;
|
return BotanyCore.speciesRoot;
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
|
||||||
BotanyCore.speciesRoot = new FlowerHelper();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,38 +1,26 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.core;
|
package binnie.botany.core;
|
||||||
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import binnie.botany.craftgui.WindowBotanistDatabase;
|
||||||
import binnie.craftgui.botany.WindowBotanistDatabase;
|
import binnie.core.craftgui.minecraft.Window;
|
||||||
import net.minecraft.inventory.IInventory;
|
|
||||||
import binnie.craftgui.minecraft.Window;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import binnie.core.gui.IBinnieGUID;
|
import binnie.core.gui.IBinnieGUID;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public enum BotanyGUI implements IBinnieGUID
|
public enum BotanyGUI implements IBinnieGUID {
|
||||||
{
|
Database,
|
||||||
Database,
|
DatabaseNEI;
|
||||||
DatabaseNEI;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Window getWindow(final EntityPlayer player, final World world, final int x, final int y, final int z, final Side side) {
|
public Window getWindow(EntityPlayer player, World world, int x, int y, int z, Side side) {
|
||||||
Window window = null;
|
Window window = null;
|
||||||
final TileEntity tileEntity = world.getTileEntity(x, y, z);
|
switch (this) {
|
||||||
IInventory object = null;
|
case Database:
|
||||||
if (tileEntity instanceof IInventory) {
|
case DatabaseNEI: {
|
||||||
object = (IInventory) tileEntity;
|
window = WindowBotanistDatabase.create(player, side, this != BotanyGUI.Database);
|
||||||
}
|
break;
|
||||||
switch (this) {
|
}
|
||||||
case Database:
|
}
|
||||||
case DatabaseNEI: {
|
return window;
|
||||||
window = WindowBotanistDatabase.create(player, side, this != BotanyGUI.Database);
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return window;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.core;
|
|
||||||
|
|
||||||
import binnie.extrabees.ExtraBees;
|
|
||||||
import binnie.Binnie;
|
|
||||||
import binnie.core.resource.BinnieResource;
|
|
||||||
import binnie.core.resource.ResourceType;
|
|
||||||
import binnie.core.resource.IBinnieTexture;
|
|
||||||
|
|
||||||
public enum BotanyTexture implements IBinnieTexture
|
|
||||||
{
|
|
||||||
;
|
|
||||||
String texture;
|
|
||||||
ResourceType type;
|
|
||||||
|
|
||||||
private BotanyTexture(final ResourceType base, final String texture) {
|
|
||||||
this.texture = texture;
|
|
||||||
this.type = base;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BinnieResource getTexture() {
|
|
||||||
return Binnie.Resource.getPNG(ExtraBees.instance, this.type, this.texture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,36 +1,20 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.core;
|
package binnie.botany.core;
|
||||||
|
|
||||||
import binnie.botany.api.EnumSoilType;
|
|
||||||
import binnie.botany.api.EnumMoisture;
|
|
||||||
import binnie.botany.Botany;
|
|
||||||
import binnie.Binnie;
|
|
||||||
import binnie.botany.api.EnumAcidity;
|
|
||||||
import binnie.core.IInitializable;
|
import binnie.core.IInitializable;
|
||||||
|
|
||||||
public class ModuleCore implements IInitializable
|
public class ModuleCore implements IInitializable {
|
||||||
{
|
@Override
|
||||||
@Override
|
public void preInit() {
|
||||||
public void preInit() {
|
// ignored
|
||||||
for (final EnumAcidity pH : EnumAcidity.values()) {
|
}
|
||||||
Binnie.Language.addObjectName(pH, Binnie.Language.unlocalised(Botany.instance, "ph." + pH.getID()));
|
|
||||||
}
|
|
||||||
for (final EnumMoisture pH2 : EnumMoisture.values()) {
|
|
||||||
Binnie.Language.addObjectName(pH2, Binnie.Language.unlocalised(Botany.instance, "moisture." + pH2.getID()));
|
|
||||||
}
|
|
||||||
for (final EnumSoilType pH3 : EnumSoilType.values()) {
|
|
||||||
Binnie.Language.addObjectName(pH3, Binnie.Language.unlocalised(Botany.instance, "soil." + pH3.getID()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
}
|
// ignored
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void postInit() {
|
public void postInit() {
|
||||||
}
|
// ignored
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package binnie.botany.craftgui;
|
||||||
|
|
||||||
|
import binnie.botany.api.IFlowerColor;
|
||||||
|
import binnie.core.craftgui.CraftGUI;
|
||||||
|
import binnie.core.craftgui.ITooltip;
|
||||||
|
import binnie.core.craftgui.IWidget;
|
||||||
|
import binnie.core.craftgui.Tooltip;
|
||||||
|
import binnie.core.craftgui.WidgetAttribute;
|
||||||
|
import binnie.core.craftgui.controls.core.Control;
|
||||||
|
import binnie.core.craftgui.controls.core.IControlValue;
|
||||||
|
import binnie.core.craftgui.geometry.IArea;
|
||||||
|
|
||||||
|
public class ControlColorDisplay extends Control implements IControlValue<IFlowerColor>, ITooltip {
|
||||||
|
private IFlowerColor value;
|
||||||
|
|
||||||
|
public ControlColorDisplay(IWidget parent, float x, float y) {
|
||||||
|
super(parent, x, y, 16.0f, 16.0f);
|
||||||
|
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IFlowerColor getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setValue(IFlowerColor value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRenderBackground() {
|
||||||
|
IArea area = getArea();
|
||||||
|
CraftGUI.render.solid(area, -1);
|
||||||
|
CraftGUI.render.solid(area.inset(1), 0xff000000 + getValue().getColor(false));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getTooltip(Tooltip tooltip) {
|
||||||
|
super.getTooltip(tooltip);
|
||||||
|
tooltip.add(value.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package binnie.botany.craftgui;
|
||||||
|
|
||||||
|
import binnie.botany.api.IColourMix;
|
||||||
|
import binnie.core.craftgui.IWidget;
|
||||||
|
import binnie.core.craftgui.controls.listbox.ControlListBox;
|
||||||
|
|
||||||
|
public class ControlColorMixBox extends ControlListBox<IColourMix> {
|
||||||
|
private Type type;
|
||||||
|
|
||||||
|
public ControlColorMixBox(IWidget parent, int x, int y, int width, int height, Type type) {
|
||||||
|
super(parent, x, y, width, height, 12.0f);
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IWidget createOption(IColourMix value, int y) {
|
||||||
|
return new ControlColorMixItem(getContent(), value, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Type {
|
||||||
|
Resultant,
|
||||||
|
Further
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package binnie.botany.craftgui;
|
||||||
|
|
||||||
|
import binnie.botany.api.IColourMix;
|
||||||
|
import binnie.core.craftgui.controls.listbox.ControlList;
|
||||||
|
import binnie.core.craftgui.controls.listbox.ControlOption;
|
||||||
|
|
||||||
|
public class ControlColorMixItem extends ControlOption<IColourMix> {
|
||||||
|
protected ControlColorDisplay itemWidget1;
|
||||||
|
protected ControlColorDisplay itemWidget2;
|
||||||
|
protected ControlColorDisplay itemWidget3;
|
||||||
|
protected ControlColourMixSymbol addSymbol;
|
||||||
|
protected ControlColourMixSymbol arrowSymbol;
|
||||||
|
|
||||||
|
public ControlColorMixItem(ControlList<IColourMix> controlList, IColourMix option, int y) {
|
||||||
|
super(controlList, option, y);
|
||||||
|
itemWidget1 = new ControlColorDisplay(this, 4.0f, 4.0f);
|
||||||
|
itemWidget2 = new ControlColorDisplay(this, 44.0f, 4.0f);
|
||||||
|
itemWidget3 = new ControlColorDisplay(this, 104.0f, 4.0f);
|
||||||
|
addSymbol = new ControlColourMixSymbol(this, 24, 4, 0);
|
||||||
|
arrowSymbol = new ControlColourMixSymbol(this, 64, 4, 1);
|
||||||
|
|
||||||
|
if (getValue() != null) {
|
||||||
|
itemWidget1.setValue(getValue().getColor1());
|
||||||
|
itemWidget2.setValue(getValue().getColor2());
|
||||||
|
itemWidget3.setValue(getValue().getResult());
|
||||||
|
addSymbol.setValue(getValue());
|
||||||
|
arrowSymbol.setValue(getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package binnie.botany.craftgui;
|
||||||
|
|
||||||
|
import binnie.botany.api.IFlowerColor;
|
||||||
|
import binnie.core.craftgui.CraftGUI;
|
||||||
|
import binnie.core.craftgui.WidgetAttribute;
|
||||||
|
import binnie.core.craftgui.controls.listbox.ControlList;
|
||||||
|
import binnie.core.craftgui.controls.listbox.ControlTextOption;
|
||||||
|
import binnie.core.craftgui.geometry.CraftGUIUtil;
|
||||||
|
import binnie.core.craftgui.geometry.IPoint;
|
||||||
|
|
||||||
|
public class ControlColorOption extends ControlTextOption<IFlowerColor> {
|
||||||
|
protected ControlColorDisplay controlBee;
|
||||||
|
protected IPoint boxPosition;
|
||||||
|
|
||||||
|
public ControlColorOption(ControlList<IFlowerColor> controlList, IFlowerColor option, int y) {
|
||||||
|
super(controlList, option, option.getName(), y);
|
||||||
|
setSize(new IPoint(getSize().x(), 20.0f));
|
||||||
|
(controlBee = new ControlColorDisplay(this, 2.0f, 2.0f)).setValue(option);
|
||||||
|
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||||
|
CraftGUIUtil.moveWidget(textWidget, new IPoint(22.0f, 0.0f));
|
||||||
|
textWidget.setSize(textWidget.getSize().sub(new IPoint(24.0f, 0.0f)));
|
||||||
|
int th = (int) CraftGUI.render.textHeight(
|
||||||
|
textWidget.getValue(), textWidget.getSize().x());
|
||||||
|
int height = Math.max(20, th + 6);
|
||||||
|
setSize(new IPoint(size().x(), height));
|
||||||
|
textWidget.setSize(new IPoint(textWidget.getSize().x(), height));
|
||||||
|
boxPosition = new IPoint(2.0f, (height - 18) / 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package binnie.botany.craftgui;
|
||||||
|
|
||||||
|
import binnie.botany.api.IColourMix;
|
||||||
|
import binnie.core.craftgui.CraftGUI;
|
||||||
|
import binnie.core.craftgui.ITooltip;
|
||||||
|
import binnie.core.craftgui.IWidget;
|
||||||
|
import binnie.core.craftgui.Tooltip;
|
||||||
|
import binnie.core.craftgui.WidgetAttribute;
|
||||||
|
import binnie.core.craftgui.controls.core.Control;
|
||||||
|
import binnie.core.craftgui.geometry.IPoint;
|
||||||
|
import binnie.core.craftgui.resource.Texture;
|
||||||
|
import binnie.core.craftgui.resource.minecraft.CraftGUITextureSheet;
|
||||||
|
import binnie.core.craftgui.resource.minecraft.StandardTexture;
|
||||||
|
import binnie.core.util.I18N;
|
||||||
|
|
||||||
|
public class ControlColourMixSymbol extends Control implements ITooltip {
|
||||||
|
protected static Texture MutationPlus = new StandardTexture(2, 94, 16, 16, CraftGUITextureSheet.Controls2);
|
||||||
|
protected static Texture MutationArrow = new StandardTexture(20, 94, 32, 16, CraftGUITextureSheet.Controls2);
|
||||||
|
|
||||||
|
protected IColourMix value;
|
||||||
|
protected int type;
|
||||||
|
|
||||||
|
protected ControlColourMixSymbol(IWidget parent, int x, int y, int type) {
|
||||||
|
super(parent, x, y, 16 + type * 16, 16.0f);
|
||||||
|
this.type = type;
|
||||||
|
value = null;
|
||||||
|
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRenderBackground() {
|
||||||
|
super.onRenderBackground();
|
||||||
|
if (type == 0) {
|
||||||
|
CraftGUI.render.texture(ControlColourMixSymbol.MutationPlus, IPoint.ZERO);
|
||||||
|
} else {
|
||||||
|
CraftGUI.render.texture(ControlColourMixSymbol.MutationArrow, IPoint.ZERO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValue(IColourMix value) {
|
||||||
|
this.value = value;
|
||||||
|
setColor(0xffffff);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getTooltip(Tooltip tooltip) {
|
||||||
|
if (type == 1) {
|
||||||
|
float chance = value.getChance();
|
||||||
|
tooltip.add(I18N.localise("botany.gui.controls.colorMixSymbol.chance", chance));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package binnie.botany.craftgui;
|
||||||
|
|
||||||
|
import binnie.botany.api.IColourMix;
|
||||||
|
import binnie.botany.api.IFlowerColor;
|
||||||
|
import binnie.botany.core.BotanyCore;
|
||||||
|
import binnie.core.craftgui.IWidget;
|
||||||
|
import binnie.core.craftgui.controls.ControlText;
|
||||||
|
import binnie.core.craftgui.controls.ControlTextCentered;
|
||||||
|
import binnie.core.craftgui.database.DatabaseTab;
|
||||||
|
import binnie.core.craftgui.database.PageAbstract;
|
||||||
|
import binnie.core.util.I18N;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class PageColorMix extends PageAbstract<IFlowerColor> {
|
||||||
|
ControlText title;
|
||||||
|
ControlColorMixBox list;
|
||||||
|
|
||||||
|
public PageColorMix(IWidget parent, DatabaseTab tab) {
|
||||||
|
super(parent, tab);
|
||||||
|
title = new ControlTextCentered(this, 8.0f, I18N.localise("botany.gui.controls.pageColorFurtherTitle"));
|
||||||
|
list = new ControlColorMixBox(this, 4, 20, 136, 152, ControlColorMixBox.Type.Further);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onValueChanged(IFlowerColor colour) {
|
||||||
|
List<IColourMix> mixes = new ArrayList<>();
|
||||||
|
for (IColourMix mix : BotanyCore.getFlowerRoot().getColourMixes(false)) {
|
||||||
|
if (mix.getColor1() == colour || mix.getColor2() == colour) {
|
||||||
|
mixes.add(mix);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
list.setOptions(mixes);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package binnie.botany.craftgui;
|
||||||
|
|
||||||
|
import binnie.botany.api.IColourMix;
|
||||||
|
import binnie.botany.api.IFlowerColor;
|
||||||
|
import binnie.botany.core.BotanyCore;
|
||||||
|
import binnie.core.craftgui.IWidget;
|
||||||
|
import binnie.core.craftgui.controls.ControlText;
|
||||||
|
import binnie.core.craftgui.controls.ControlTextCentered;
|
||||||
|
import binnie.core.craftgui.database.DatabaseTab;
|
||||||
|
import binnie.core.craftgui.database.PageAbstract;
|
||||||
|
import binnie.core.util.I18N;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class PageColorMixResultant extends PageAbstract<IFlowerColor> {
|
||||||
|
protected ControlText title;
|
||||||
|
protected ControlColorMixBox list;
|
||||||
|
|
||||||
|
public PageColorMixResultant(IWidget parent, DatabaseTab tab) {
|
||||||
|
super(parent, tab);
|
||||||
|
title = new ControlTextCentered(this, 8.0f, I18N.localise("botany.gui.controls.pageSpeciesFurtherTitle"));
|
||||||
|
list = new ControlColorMixBox(this, 4, 20, 136, 152, ControlColorMixBox.Type.Resultant);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onValueChanged(IFlowerColor color) {
|
||||||
|
List<IColourMix> mixes = new ArrayList<>();
|
||||||
|
for (IColourMix mix : BotanyCore.getFlowerRoot().getColourMixes(false)) {
|
||||||
|
if (mix.getResult() == color) {
|
||||||
|
mixes.add(mix);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
list.setOptions(mixes);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
package binnie.botany.craftgui;
|
||||||
|
|
||||||
|
import binnie.Binnie;
|
||||||
|
import binnie.botany.api.EnumFlowerChromosome;
|
||||||
|
import binnie.botany.api.EnumFlowerStage;
|
||||||
|
import binnie.botany.api.IAlleleFlowerSpecies;
|
||||||
|
import binnie.botany.api.IFlower;
|
||||||
|
import binnie.botany.api.IFlowerGenome;
|
||||||
|
import binnie.botany.core.BotanyCore;
|
||||||
|
import binnie.core.craftgui.IWidget;
|
||||||
|
import binnie.core.craftgui.controls.ControlText;
|
||||||
|
import binnie.core.craftgui.controls.core.Control;
|
||||||
|
import binnie.core.craftgui.controls.scroll.ControlScrollableContent;
|
||||||
|
import binnie.core.craftgui.database.DatabaseTab;
|
||||||
|
import binnie.core.craftgui.database.PageSpecies;
|
||||||
|
import binnie.core.craftgui.geometry.IArea;
|
||||||
|
import binnie.core.craftgui.geometry.IPoint;
|
||||||
|
import binnie.core.craftgui.geometry.TextJustification;
|
||||||
|
import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
|
||||||
|
import binnie.core.util.I18N;
|
||||||
|
import binnie.genetics.genetics.AlleleHelper;
|
||||||
|
import forestry.api.genetics.IAllele;
|
||||||
|
import forestry.api.genetics.IAlleleSpecies;
|
||||||
|
import forestry.api.genetics.IIndividual;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class PageSpeciesFlowerGenome extends PageSpecies {
|
||||||
|
public PageSpeciesFlowerGenome(IWidget parent, DatabaseTab tab) {
|
||||||
|
super(parent, tab);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onValueChanged(IAlleleSpecies species) {
|
||||||
|
deleteAllChildren();
|
||||||
|
IAllele[] template = Binnie.Genetics.getFlowerRoot().getTemplate(species.getUID());
|
||||||
|
if (template == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
IFlower tree = Binnie.Genetics.getFlowerRoot().templateAsIndividual(template);
|
||||||
|
if (tree == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
IFlowerGenome genome = tree.getGenome();
|
||||||
|
IAlleleFlowerSpecies treeSpecies = genome.getPrimary();
|
||||||
|
int w = 144;
|
||||||
|
int h = 176;
|
||||||
|
|
||||||
|
new ControlText(
|
||||||
|
this,
|
||||||
|
new IArea(0.0f, 4.0f, w, 16.0f),
|
||||||
|
I18N.localise("botany.gui.database.tab.genome"),
|
||||||
|
TextJustification.MIDDLE_CENTER);
|
||||||
|
ControlScrollableContent scrollable = new ControlScrollableContent(this, 4.0f, 20.0f, w - 8, h - 8 - 16, 12.0f);
|
||||||
|
Control contents = new Control(scrollable, 0.0f, 0.0f, w - 8 - 12, h - 8 - 16);
|
||||||
|
|
||||||
|
int tw = w - 8 - 12;
|
||||||
|
int w2 = 55;
|
||||||
|
int w3 = tw - 50;
|
||||||
|
int y = 0;
|
||||||
|
int th = 14;
|
||||||
|
int valueX = w2 + 4;
|
||||||
|
new ControlText(
|
||||||
|
contents,
|
||||||
|
new IArea(0.0f, y, w2, th),
|
||||||
|
I18N.localise("botany.gui.database.tab.genome.temp"),
|
||||||
|
TextJustification.MIDDLE_RIGHT);
|
||||||
|
new ControlText(
|
||||||
|
contents,
|
||||||
|
new IArea(valueX, y, w3, th),
|
||||||
|
AlleleHelper.toDisplay(treeSpecies.getTemperature()),
|
||||||
|
TextJustification.MIDDLE_LEFT);
|
||||||
|
y += th;
|
||||||
|
|
||||||
|
new ControlText(
|
||||||
|
contents,
|
||||||
|
new IArea(0.0f, y, w2, th),
|
||||||
|
I18N.localise("botany.gui.database.tab.genome.moist"),
|
||||||
|
TextJustification.MIDDLE_RIGHT);
|
||||||
|
new ControlText(
|
||||||
|
contents,
|
||||||
|
new IArea(valueX, y, w3, th),
|
||||||
|
AlleleHelper.toDisplay(treeSpecies.getMoisture()),
|
||||||
|
TextJustification.MIDDLE_LEFT);
|
||||||
|
y += th;
|
||||||
|
|
||||||
|
new ControlText(
|
||||||
|
contents,
|
||||||
|
new IArea(0.0f, y, w2, th),
|
||||||
|
I18N.localise("botany.gui.database.tab.genome.ph"),
|
||||||
|
TextJustification.MIDDLE_RIGHT);
|
||||||
|
new ControlText(
|
||||||
|
contents,
|
||||||
|
new IArea(valueX, y, w3, th),
|
||||||
|
AlleleHelper.toDisplay(treeSpecies.getPH()),
|
||||||
|
TextJustification.MIDDLE_LEFT);
|
||||||
|
y += th;
|
||||||
|
|
||||||
|
new ControlText(
|
||||||
|
contents,
|
||||||
|
new IArea(0.0f, y, w2, th),
|
||||||
|
I18N.localise("botany.gui.database.tab.genome.fertility"),
|
||||||
|
TextJustification.MIDDLE_RIGHT);
|
||||||
|
new ControlText(
|
||||||
|
contents, new IArea(valueX, y, w3, th), genome.getFertility() + "x", TextJustification.MIDDLE_LEFT);
|
||||||
|
y += th;
|
||||||
|
|
||||||
|
float lifespan = genome.getLifespan() * 68.27f / genome.getAgeChance() / 24000.0f;
|
||||||
|
String lifespanValue = String.format("%.2f", lifespan);
|
||||||
|
new ControlText(
|
||||||
|
contents,
|
||||||
|
new IArea(0.0f, y, w2, th),
|
||||||
|
I18N.localise("botany.gui.database.tab.genome.lifespan"),
|
||||||
|
TextJustification.MIDDLE_RIGHT);
|
||||||
|
new ControlText(
|
||||||
|
contents,
|
||||||
|
new IArea(valueX, y, w3, th),
|
||||||
|
I18N.localise("botany.gui.database.tab.genome.lifespan.value", lifespanValue),
|
||||||
|
TextJustification.MIDDLE_LEFT);
|
||||||
|
y += th;
|
||||||
|
|
||||||
|
new ControlText(
|
||||||
|
contents,
|
||||||
|
new IArea(0.0f, y, w2, th),
|
||||||
|
I18N.localise("botany.gui.database.tab.genome.nectar"),
|
||||||
|
TextJustification.MIDDLE_RIGHT);
|
||||||
|
new ControlText(
|
||||||
|
contents,
|
||||||
|
new IArea(valueX, y, w3, th),
|
||||||
|
genome.getActiveAllele(EnumFlowerChromosome.SAPPINESS).getName(),
|
||||||
|
TextJustification.MIDDLE_LEFT);
|
||||||
|
y += th;
|
||||||
|
|
||||||
|
int x = w2;
|
||||||
|
int tot = 0;
|
||||||
|
for (IIndividual vid : BotanyCore.getFlowerRoot().getIndividualTemplates()) {
|
||||||
|
if (vid.getGenome().getPrimary() == treeSpecies) {
|
||||||
|
if (tot > 0 && tot % 3 == 0) {
|
||||||
|
x -= 54;
|
||||||
|
y += 18;
|
||||||
|
}
|
||||||
|
ItemStack stack = BotanyCore.getFlowerRoot().getMemberStack(vid, EnumFlowerStage.FLOWER.ordinal());
|
||||||
|
ControlItemDisplay display = new ControlItemDisplay(contents, x, y);
|
||||||
|
display.setItemStack(stack);
|
||||||
|
tot++;
|
||||||
|
x += 18;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int numOfLines = 1 + (tot - 1) / 3;
|
||||||
|
new ControlText(
|
||||||
|
contents,
|
||||||
|
new IArea(0.0f, y - (numOfLines - 1) * 18, w2, 4 + 18 * numOfLines),
|
||||||
|
I18N.localise("botany.gui.database.tab.genome.varieties"),
|
||||||
|
TextJustification.MIDDLE_RIGHT);
|
||||||
|
y += th;
|
||||||
|
contents.setSize(new IPoint(contents.size().x(), y));
|
||||||
|
scrollable.setScrollableContent(contents);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
package binnie.botany.craftgui;
|
||||||
|
|
||||||
|
import binnie.Binnie;
|
||||||
|
import binnie.botany.Botany;
|
||||||
|
import binnie.botany.api.IFlowerColor;
|
||||||
|
import binnie.botany.genetics.EnumFlowerColor;
|
||||||
|
import binnie.core.AbstractMod;
|
||||||
|
import binnie.core.craftgui.IWidget;
|
||||||
|
import binnie.core.craftgui.controls.listbox.ControlListBox;
|
||||||
|
import binnie.core.craftgui.database.DatabaseTab;
|
||||||
|
import binnie.core.craftgui.database.IDatabaseMode;
|
||||||
|
import binnie.core.craftgui.database.PageBranchOverview;
|
||||||
|
import binnie.core.craftgui.database.PageBranchSpecies;
|
||||||
|
import binnie.core.craftgui.database.PageBreeder;
|
||||||
|
import binnie.core.craftgui.database.PageSpeciesClassification;
|
||||||
|
import binnie.core.craftgui.database.PageSpeciesMutations;
|
||||||
|
import binnie.core.craftgui.database.PageSpeciesOverview;
|
||||||
|
import binnie.core.craftgui.database.PageSpeciesResultant;
|
||||||
|
import binnie.core.craftgui.database.WindowAbstractDatabase;
|
||||||
|
import binnie.core.craftgui.geometry.IArea;
|
||||||
|
import binnie.core.craftgui.minecraft.Window;
|
||||||
|
import binnie.core.util.I18N;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
|
||||||
|
public class WindowBotanistDatabase extends WindowAbstractDatabase {
|
||||||
|
public WindowBotanistDatabase(EntityPlayer player, Side side, boolean nei) {
|
||||||
|
super(player, side, nei, Binnie.Genetics.flowerBreedingSystem, 130.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Window create(EntityPlayer player, Side side, boolean nei) {
|
||||||
|
return new WindowBotanistDatabase(player, side, nei);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addTabs() {
|
||||||
|
new PageSpeciesOverview(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.overview"));
|
||||||
|
new PageSpeciesFlowerGenome(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "genome"));
|
||||||
|
new PageSpeciesClassification(
|
||||||
|
getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.classification"));
|
||||||
|
new PageSpeciesResultant(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.resultant"));
|
||||||
|
new PageSpeciesMutations(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.further"));
|
||||||
|
new PageBranchOverview(getInfoPages(Mode.Branches), new DatabaseTab(Botany.instance, "branches.overview"));
|
||||||
|
new PageBranchSpecies(getInfoPages(Mode.Branches), new DatabaseTab(Botany.instance, "branches.species"));
|
||||||
|
createMode(FlowerMode.COLOR, new ColorModeWidget());
|
||||||
|
new PageColorMixResultant(getInfoPages(FlowerMode.COLOR), new DatabaseTab(Botany.instance, "colour.resultant"));
|
||||||
|
new PageColorMix(getInfoPages(FlowerMode.COLOR), new DatabaseTab(Botany.instance, "colour.further"));
|
||||||
|
new PageBreeder(getInfoPages(Mode.Breeder), getUsername(), new DatabaseTab(Botany.instance, "breeder"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected AbstractMod getMod() {
|
||||||
|
return Botany.instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getName() {
|
||||||
|
return I18N.localise("botany.gui.database.name");
|
||||||
|
}
|
||||||
|
|
||||||
|
enum FlowerMode implements IDatabaseMode {
|
||||||
|
COLOR;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return I18N.localise("botany.gui.database.tab." + name().toLowerCase());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ColorModeWidget extends ModeWidgets {
|
||||||
|
public ColorModeWidget() {
|
||||||
|
super(FlowerMode.COLOR, WindowBotanistDatabase.this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void createListBox(IArea area) {
|
||||||
|
listBox = new ControlListBox<IFlowerColor>(modePage, area.x(), area.y(), area.w(), area.h(), 12.0f) {
|
||||||
|
@Override
|
||||||
|
public IWidget createOption(IFlowerColor value, int y) {
|
||||||
|
return new ControlColorOption(getContent(), value, y);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
List<IFlowerColor> colors = new ArrayList<>();
|
||||||
|
Collections.addAll(colors, EnumFlowerColor.values());
|
||||||
|
listBox.setOptions(colors);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,99 +1,110 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.farm;
|
package binnie.botany.farm;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
import forestry.api.circuits.ChipsetManager;
|
|
||||||
import forestry.api.farming.FarmDirection;
|
|
||||||
import forestry.api.farming.IFarmHousing;
|
|
||||||
import forestry.api.farming.IFarmLogic;
|
|
||||||
import binnie.Binnie;
|
|
||||||
import binnie.botany.api.EnumAcidity;
|
import binnie.botany.api.EnumAcidity;
|
||||||
import binnie.botany.api.EnumMoisture;
|
import binnie.botany.api.EnumMoisture;
|
||||||
import binnie.core.circuits.BinnieCircuit;
|
import binnie.core.circuits.BinnieCircuit;
|
||||||
|
import binnie.core.util.I18N;
|
||||||
|
import forestry.api.circuits.ChipsetManager;
|
||||||
|
import forestry.api.farming.FarmDirection;
|
||||||
|
import forestry.api.farming.IFarmHousing;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
|
||||||
public class CircuitGarden extends BinnieCircuit
|
public class CircuitGarden extends BinnieCircuit {
|
||||||
{
|
private boolean isManual;
|
||||||
private Class<? extends FarmLogic> logicClass;
|
private boolean isFertilised;
|
||||||
private boolean isManual;
|
private ItemStack icon;
|
||||||
private boolean isFertilised;
|
private EnumMoisture moisture;
|
||||||
private ItemStack icon;
|
private EnumAcidity acidity;
|
||||||
private EnumMoisture moisture;
|
|
||||||
private EnumAcidity acidity;
|
|
||||||
|
|
||||||
public CircuitGarden(final EnumMoisture moisture, final EnumAcidity ph, final boolean manual, final boolean fertilised, final ItemStack recipe, final ItemStack icon) {
|
public CircuitGarden(
|
||||||
super("garden." + moisture.getID() + ((ph != null) ? ("." + ph.getID()) : "") + (manual ? ".manual" : "") + (fertilised ? ".fert" : ""), 4, manual ? ChipsetManager.circuitRegistry.getLayout("forestry.farms.manual") : ChipsetManager.circuitRegistry.getLayout("forestry.farms.managed"), recipe);
|
EnumMoisture moisture,
|
||||||
this.isManual = false;
|
EnumAcidity ph,
|
||||||
this.isFertilised = false;
|
boolean manual,
|
||||||
this.isManual = manual;
|
boolean fertilised,
|
||||||
this.isFertilised = fertilised;
|
ItemStack recipe,
|
||||||
this.moisture = moisture;
|
ItemStack icon) {
|
||||||
this.acidity = ph;
|
super(
|
||||||
this.icon = icon;
|
"garden." + moisture.getID() + ((ph != null) ? ("." + ph.getID()) : "") + (manual ? ".manual" : "")
|
||||||
String info = "";
|
+ (fertilised ? ".fert" : ""),
|
||||||
if (moisture == EnumMoisture.Dry) {
|
4,
|
||||||
info += "§eDry§f";
|
manual
|
||||||
}
|
? ChipsetManager.circuitRegistry.getLayout("forestry.farms.manual")
|
||||||
if (moisture == EnumMoisture.Damp) {
|
: ChipsetManager.circuitRegistry.getLayout("forestry.farms.managed"),
|
||||||
info += "§9Damp§f";
|
recipe);
|
||||||
}
|
this.moisture = moisture;
|
||||||
if (this.acidity == EnumAcidity.Acid) {
|
this.icon = icon;
|
||||||
if (info.length() > 0) {
|
isManual = manual;
|
||||||
info += ", ";
|
isFertilised = fertilised;
|
||||||
}
|
acidity = ph;
|
||||||
info += "§cAcidic§f";
|
String info = "";
|
||||||
}
|
|
||||||
if (this.acidity == EnumAcidity.Neutral) {
|
|
||||||
if (info.length() > 0) {
|
|
||||||
info += ", ";
|
|
||||||
}
|
|
||||||
info += "§aNeutral§f";
|
|
||||||
}
|
|
||||||
if (this.acidity == EnumAcidity.Alkaline) {
|
|
||||||
if (info.length() > 0) {
|
|
||||||
info += ", ";
|
|
||||||
}
|
|
||||||
info += "§bAlkaline§f";
|
|
||||||
}
|
|
||||||
if (info.length() > 0) {
|
|
||||||
info = " (" + info + "§f)";
|
|
||||||
}
|
|
||||||
this.addTooltipString("Flowers" + info);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
if (moisture == EnumMoisture.DRY) {
|
||||||
public boolean isCircuitable(Object tile) {
|
info += EnumChatFormatting.YELLOW + I18N.localise("botany.moisture.dry") + EnumChatFormatting.RESET;
|
||||||
return tile instanceof IFarmHousing;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
if (moisture == EnumMoisture.DAMP) {
|
||||||
public void onInsertion(int slot, Object tile) {
|
info += EnumChatFormatting.YELLOW + I18N.localise("botany.moisture.damp") + EnumChatFormatting.RESET;
|
||||||
if (!this.isCircuitable(tile)) {
|
}
|
||||||
return;
|
|
||||||
}
|
|
||||||
final GardenLogic logic = new GardenLogic((IFarmHousing) tile);
|
|
||||||
logic.setData(this.moisture, this.acidity, this.isManual, this.isFertilised, this.icon, Binnie.Language.localise(this.getName()));
|
|
||||||
((IFarmHousing) tile).setFarmLogic(FarmDirection.values()[slot], logic);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
if (acidity == EnumAcidity.ACID) {
|
||||||
public void onLoad(int slot, Object tile) {
|
if (info.length() > 0) {
|
||||||
this.onInsertion(slot, tile);
|
info += ", ";
|
||||||
}
|
}
|
||||||
|
info += EnumChatFormatting.RED + I18N.localise("botany.ph.acid") + EnumChatFormatting.RESET;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
if (acidity == EnumAcidity.NEUTRAL) {
|
||||||
public void onRemoval(int slot, Object tile) {
|
if (info.length() > 0) {
|
||||||
if (!this.isCircuitable(tile)) {
|
info += ", ";
|
||||||
return;
|
}
|
||||||
}
|
info += EnumChatFormatting.GREEN + I18N.localise("botany.ph.neutral") + EnumChatFormatting.RESET;
|
||||||
((IFarmHousing) tile).resetFarmLogic(FarmDirection.values()[slot]);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
if (acidity == EnumAcidity.ALKALINE) {
|
||||||
public void onTick(int arg0, Object arg1) {
|
if (info.length() > 0) {
|
||||||
}
|
info += ", ";
|
||||||
|
}
|
||||||
|
info += EnumChatFormatting.AQUA + I18N.localise("botany.ph.alkaline") + EnumChatFormatting.RESET;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (info.length() > 0) {
|
||||||
|
info = " (" + info + EnumChatFormatting.RESET + ")";
|
||||||
|
}
|
||||||
|
addTooltipString(I18N.localise("botany.circuit.flowers") + info);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCircuitable(Object tile) {
|
||||||
|
return tile instanceof IFarmHousing;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInsertion(int slot, Object tile) {
|
||||||
|
if (!isCircuitable(tile)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
GardenLogic logic = new GardenLogic((IFarmHousing) tile);
|
||||||
|
logic.setData(moisture, acidity, isManual, isFertilised, icon, I18N.localise(getName()));
|
||||||
|
((IFarmHousing) tile).setFarmLogic(FarmDirection.values()[slot], logic);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoad(int slot, Object tile) {
|
||||||
|
onInsertion(slot, tile);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRemoval(int slot, Object tile) {
|
||||||
|
if (!isCircuitable(tile)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
((IFarmHousing) tile).resetFarmLogic(FarmDirection.values()[slot]);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTick(int arg0, Object arg1) {
|
||||||
|
// ignored
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,61 +1,57 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.farm;
|
package binnie.botany.farm;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
|
|
||||||
import forestry.api.farming.FarmDirection;
|
import forestry.api.farming.FarmDirection;
|
||||||
import forestry.api.farming.IFarmHousing;
|
import forestry.api.farming.IFarmHousing;
|
||||||
|
import forestry.api.farming.IFarmLogic;
|
||||||
|
import forestry.core.utils.vect.Vect;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import forestry.api.farming.IFarmLogic;
|
public abstract class FarmLogic implements IFarmLogic {
|
||||||
|
protected World world;
|
||||||
|
protected IFarmHousing housing;
|
||||||
|
protected boolean isManual;
|
||||||
|
|
||||||
public abstract class FarmLogic implements IFarmLogic
|
public FarmLogic(IFarmHousing housing) {
|
||||||
{
|
this.housing = housing;
|
||||||
World world;
|
}
|
||||||
IFarmHousing housing;
|
|
||||||
boolean isManual;
|
|
||||||
|
|
||||||
public FarmLogic(final IFarmHousing housing) {
|
@Override
|
||||||
this.housing = housing;
|
public IFarmLogic setManual(boolean flag) {
|
||||||
}
|
isManual = flag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
protected boolean isAirBlock(Vect position) {
|
||||||
public IFarmLogic setManual(final boolean flag) {
|
return world.isAirBlock(position.x, position.y, position.z);
|
||||||
this.isManual = flag;
|
}
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected final boolean isAirBlock(final Vect position) {
|
protected boolean isWaterBlock(Vect position) {
|
||||||
return this.world.isAirBlock(position.x, position.y, position.z);
|
return world.getBlock(position.x, position.y, position.z) == Blocks.water;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final boolean isWaterBlock(final Vect position) {
|
protected Block getBlock(Vect position) {
|
||||||
return this.world.getBlock(position.x, position.y, position.z) == Blocks.water;
|
return world.getBlock(position.x, position.y, position.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final Block getBlock(final Vect position) {
|
protected int getBlockMeta(Vect position) {
|
||||||
return this.world.getBlock(position.x, position.y, position.z);
|
return world.getBlockMetadata(position.x, position.y, position.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final int getBlockMeta(final Vect position) {
|
protected ItemStack getAsItemStack(Vect position) {
|
||||||
return this.world.getBlockMetadata(position.x, position.y, position.z);
|
return new ItemStack(getBlock(position), 1, getBlockMeta(position));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final ItemStack getAsItemStack(final Vect position) {
|
protected Vect translateWithOffset(int x, int y, int z, FarmDirection direction, int step) {
|
||||||
return new ItemStack(this.getBlock(position), 1, this.getBlockMeta(position));
|
return new Vect(
|
||||||
}
|
x + direction.getForgeDirection().offsetX * step,
|
||||||
|
y + direction.getForgeDirection().offsetY * step,
|
||||||
|
z + direction.getForgeDirection().offsetZ * step);
|
||||||
|
}
|
||||||
|
|
||||||
protected final Vect translateWithOffset(final int x, final int y, final int z, final FarmDirection direction, final int step) {
|
protected void setBlock(Vect position, Block block, int meta) {
|
||||||
return new Vect(x + direction.getForgeDirection().offsetX * step, y + direction.getForgeDirection().offsetY * step, z + direction.getForgeDirection().offsetZ * step);
|
world.setBlock(position.x, position.y, position.z, block, meta, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final void setBlock(final Vect position, final Block block, final int meta) {
|
|
||||||
this.world.setBlock(position.x, position.y, position.z, block, meta, 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,47 +1,42 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.farm;
|
package binnie.botany.farm;
|
||||||
|
|
||||||
import binnie.botany.api.IFlower;
|
|
||||||
import binnie.botany.gardening.Gardening;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import binnie.botany.api.EnumFlowerStage;
|
|
||||||
import binnie.botany.core.BotanyCore;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import forestry.api.farming.ICrop;
|
|
||||||
import binnie.botany.Botany;
|
import binnie.botany.Botany;
|
||||||
import net.minecraft.world.World;
|
import binnie.botany.api.EnumFlowerStage;
|
||||||
|
import binnie.botany.api.IFlower;
|
||||||
|
import binnie.botany.core.BotanyCore;
|
||||||
|
import binnie.botany.gardening.Gardening;
|
||||||
|
import forestry.api.farming.ICrop;
|
||||||
import forestry.api.farming.IFarmable;
|
import forestry.api.farming.IFarmable;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class FarmableFlower implements IFarmable
|
public class FarmableFlower implements IFarmable {
|
||||||
{
|
@Override
|
||||||
@Override
|
public boolean isSaplingAt(World world, int x, int y, int z) {
|
||||||
public boolean isSaplingAt(final World world, final int x, final int y, final int z) {
|
return world.getBlock(x, y, z) == Botany.flower;
|
||||||
return world.getBlock(x, y, z) == Botany.flower;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ICrop getCropAt(final World world, final int x, final int y, final int z) {
|
public ICrop getCropAt(World world, int x, int y, int z) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isGermling(final ItemStack itemstack) {
|
public boolean isGermling(ItemStack itemstack) {
|
||||||
final EnumFlowerStage stage = BotanyCore.speciesRoot.getStageType(itemstack);
|
EnumFlowerStage stage = BotanyCore.speciesRoot.getStageType(itemstack);
|
||||||
return stage == EnumFlowerStage.FLOWER || stage == EnumFlowerStage.SEED;
|
return stage == EnumFlowerStage.FLOWER || stage == EnumFlowerStage.SEED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isWindfall(final ItemStack itemstack) {
|
public boolean isWindfall(ItemStack itemstack) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean plantSaplingAt(final EntityPlayer player, final ItemStack germling, final World world, final int x, final int y, final int z) {
|
public boolean plantSaplingAt(EntityPlayer player, ItemStack germling, World world, int x, int y, int z) {
|
||||||
final IFlower flower = BotanyCore.getFlowerRoot().getMember(germling);
|
IFlower flower = BotanyCore.getFlowerRoot().getMember(germling);
|
||||||
Gardening.plant(world, x, y, z, flower, player.getGameProfile());
|
Gardening.plant(world, x, y, z, flower, player.getGameProfile());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,26 +1,21 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.farm;
|
package binnie.botany.farm;
|
||||||
|
|
||||||
import binnie.botany.api.IFlower;
|
import binnie.botany.api.IFlower;
|
||||||
import binnie.botany.gardening.Gardening;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import binnie.botany.core.BotanyCore;
|
import binnie.botany.core.BotanyCore;
|
||||||
|
import binnie.botany.gardening.Gardening;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class FarmableVanillaFlower extends FarmableFlower
|
public class FarmableVanillaFlower extends FarmableFlower {
|
||||||
{
|
@Override
|
||||||
@Override
|
public boolean isGermling(ItemStack itemstack) {
|
||||||
public boolean isGermling(final ItemStack itemstack) {
|
return BotanyCore.getFlowerRoot().getConversion(itemstack) != null;
|
||||||
return BotanyCore.getFlowerRoot().getConversion(itemstack) != null;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean plantSaplingAt(final EntityPlayer player, final ItemStack germling, final World world, final int x, final int y, final int z) {
|
public boolean plantSaplingAt(EntityPlayer player, ItemStack germling, World world, int x, int y, int z) {
|
||||||
final IFlower flower = BotanyCore.getFlowerRoot().getConversion(germling);
|
IFlower flower = BotanyCore.getFlowerRoot().getConversion(germling);
|
||||||
return Gardening.plant(world, x, y, z, flower, player.getGameProfile());
|
return Gardening.plant(world, x, y, z, flower, player.getGameProfile());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,370 +1,419 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.farm;
|
package binnie.botany.farm;
|
||||||
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
|
|
||||||
import com.mojang.authlib.GameProfile;
|
|
||||||
|
|
||||||
import binnie.core.Mods;
|
|
||||||
import binnie.botany.flower.TileEntityFlower;
|
|
||||||
import forestry.core.access.IOwnable;
|
|
||||||
|
|
||||||
import net.minecraft.client.renderer.texture.TextureMap;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
|
|
||||||
import forestry.api.farming.ICrop;
|
|
||||||
|
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
|
||||||
|
|
||||||
import binnie.Binnie;
|
import binnie.Binnie;
|
||||||
|
|
||||||
import net.minecraft.item.ItemBlock;
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
|
|
||||||
import binnie.botany.Botany;
|
import binnie.botany.Botany;
|
||||||
import binnie.botany.api.EnumSoilType;
|
|
||||||
import binnie.botany.api.gardening.IBlockSoil;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
|
|
||||||
import binnie.botany.gardening.Gardening;
|
|
||||||
import forestry.api.farming.FarmDirection;
|
|
||||||
import forestry.api.farming.IFarmHousing;
|
|
||||||
import forestry.api.farming.IFarmable;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import binnie.botany.api.EnumAcidity;
|
import binnie.botany.api.EnumAcidity;
|
||||||
import binnie.botany.api.EnumMoisture;
|
import binnie.botany.api.EnumMoisture;
|
||||||
|
import binnie.botany.api.EnumSoilType;
|
||||||
|
import binnie.botany.api.gardening.IBlockSoil;
|
||||||
|
import binnie.botany.flower.TileEntityFlower;
|
||||||
|
import binnie.botany.gardening.Gardening;
|
||||||
|
import com.mojang.authlib.GameProfile;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import forestry.api.farming.FarmDirection;
|
||||||
|
import forestry.api.farming.ICrop;
|
||||||
|
import forestry.api.farming.IFarmHousing;
|
||||||
|
import forestry.api.farming.IFarmable;
|
||||||
|
import forestry.core.access.IOwnable;
|
||||||
|
import forestry.core.utils.vect.Vect;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.texture.TextureMap;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
|
||||||
public class GardenLogic extends FarmLogic
|
public class GardenLogic extends FarmLogic {
|
||||||
{
|
protected EnumMoisture moisture;
|
||||||
EnumMoisture moisture;
|
protected EnumAcidity acidity;
|
||||||
EnumAcidity acidity;
|
protected boolean fertilised;
|
||||||
boolean fertilised;
|
protected String name;
|
||||||
String name;
|
protected ArrayList<ItemStack> produce;
|
||||||
ArrayList<ItemStack> produce;
|
protected List<IFarmable> farmables;
|
||||||
private ItemStack icon;
|
|
||||||
List<IFarmable> farmables;
|
|
||||||
|
|
||||||
public GardenLogic(final IFarmHousing housing) {
|
private ItemStack icon;
|
||||||
super(housing);
|
|
||||||
this.produce = new ArrayList<ItemStack>();
|
|
||||||
(this.farmables = new ArrayList<IFarmable>()).add(new FarmableFlower());
|
|
||||||
this.farmables.add(new FarmableVanillaFlower());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public GardenLogic(IFarmHousing housing) {
|
||||||
public int getFertilizerConsumption() {
|
super(housing);
|
||||||
return this.fertilised ? 8 : 2;
|
produce = new ArrayList<>();
|
||||||
}
|
farmables = new ArrayList<>();
|
||||||
|
farmables.add(new FarmableFlower());
|
||||||
|
farmables.add(new FarmableVanillaFlower());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getWaterConsumption(final float hydrationModifier) {
|
public int getFertilizerConsumption() {
|
||||||
return (int) (this.moisture.ordinal() * 40 * hydrationModifier);
|
return fertilised ? 8 : 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAcceptedResource(final ItemStack itemstack) {
|
public int getWaterConsumption(float hydrationModifier) {
|
||||||
return Gardening.isSoil(itemstack.getItem()) || itemstack.getItem() == Item.getItemFromBlock(Blocks.sand) || itemstack.getItem() == Item.getItemFromBlock(Blocks.dirt) || Gardening.isAcidFertiliser(itemstack) || Gardening.isAlkalineFertiliser(itemstack);
|
return (int) (moisture.ordinal() * 40 * hydrationModifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ItemStack> collect() {
|
public boolean isAcceptedResource(ItemStack stack) {
|
||||||
final Collection<ItemStack> products = this.produce;
|
Item item = stack.getItem();
|
||||||
this.produce = new ArrayList<ItemStack>();
|
return Gardening.isSoil(item)
|
||||||
return products;
|
|| item == Item.getItemFromBlock(Blocks.sand)
|
||||||
}
|
|| item == Item.getItemFromBlock(Blocks.dirt)
|
||||||
|
|| Gardening.isAcidFertiliser(stack)
|
||||||
|
|| Gardening.isAlkalineFertiliser(stack);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean cultivate(final int x, final int y, final int z, final FarmDirection direction, final int extent) {
|
public Collection<ItemStack> collect() {
|
||||||
this.world = this.housing.getWorld();
|
Collection<ItemStack> products = produce;
|
||||||
return this.maintainSoil(x, y, z, direction, extent) || (!this.isManual && this.maintainWater(x, y, z, direction, extent)) || this.maintainCrops(x, y + 1, z, direction, extent);
|
produce = new ArrayList<>();
|
||||||
}
|
return products;
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isWaste(final ItemStack stack) {
|
@Override
|
||||||
return stack.getItem() == Item.getItemFromBlock(Blocks.dirt);
|
public boolean cultivate(int x, int y, int z, FarmDirection direction, int extent) {
|
||||||
}
|
world = housing.getWorld();
|
||||||
|
return maintainSoil(x, y, z, direction, extent)
|
||||||
|
|| !isManual && maintainWater(x, y, z, direction, extent)
|
||||||
|
|| maintainCrops(x, y + 1, z, direction, extent);
|
||||||
|
}
|
||||||
|
|
||||||
private boolean maintainSoil(final int x2, final int y2, final int z2, final FarmDirection direction, final int extent) {
|
private boolean isWaste(ItemStack stack) {
|
||||||
for (int i = 0; i < extent; ++i) {
|
return stack.getItem() == Item.getItemFromBlock(Blocks.dirt);
|
||||||
final Vect position = this.translateWithOffset(x2, y2, z2, direction, i);
|
}
|
||||||
if (this.fertilised && Gardening.isSoil(this.world.getBlock(position.x, position.y, position.z))) {
|
|
||||||
final IBlockSoil soil = (IBlockSoil) this.world.getBlock(position.x, position.y, position.z);
|
|
||||||
if (soil.fertilise(this.world, position.x, position.y, position.z, EnumSoilType.FLOWERBED)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.world.getBlock(position.x, position.y + 1, position.z) == Botany.plant) {
|
|
||||||
this.world.setBlockToAir(position.x, position.y + 1, position.z);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (this.acidity != null && Gardening.isSoil(this.world.getBlock(position.x, position.y, position.z))) {
|
|
||||||
final IBlockSoil soil = (IBlockSoil) this.world.getBlock(position.x, position.y, position.z);
|
|
||||||
final EnumAcidity pH = soil.getPH(this.world, position.x, position.y, position.z);
|
|
||||||
if (pH.ordinal() < this.acidity.ordinal()) {
|
|
||||||
final ItemStack stack = this.getAvailableAlkaline();
|
|
||||||
if (stack != null && soil.setPH(this.world, position.x, position.y, position.z, EnumAcidity.values()[pH.ordinal() + 1])) {
|
|
||||||
this.housing.getFarmInventory().removeResources(new ItemStack[] { stack });
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (pH.ordinal() > this.acidity.ordinal()) {
|
|
||||||
final ItemStack stack = this.getAvailableAcid();
|
|
||||||
if (stack != null && soil.setPH(this.world, position.x, position.y, position.z, EnumAcidity.values()[pH.ordinal() - 1])) {
|
|
||||||
this.housing.getFarmInventory().removeResources(new ItemStack[] { stack });
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!this.isAirBlock(position) && !this.world.getBlock(position.x, position.y, position.z).isReplaceable(this.world, position.x, position.y, position.z)) {
|
|
||||||
final ItemStack block = this.getAsItemStack(position);
|
|
||||||
final ItemStack loam = this.getAvailableLoam();
|
|
||||||
if (this.isWaste(block) && loam != null) {
|
|
||||||
this.produce.addAll(Blocks.dirt.getDrops(this.world, position.x, position.y, position.z, block.getItemDamage(), 0));
|
|
||||||
this.setBlock(position, Blocks.air, 0);
|
|
||||||
return this.trySetSoil(position, loam);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (!this.isManual) {
|
|
||||||
if (!this.isWaterBlock(position)) {
|
|
||||||
if (i % 2 == 0) {
|
|
||||||
return this.trySetSoil(position);
|
|
||||||
}
|
|
||||||
FarmDirection cclock = FarmDirection.EAST;
|
|
||||||
if (direction == FarmDirection.EAST) {
|
|
||||||
cclock = FarmDirection.SOUTH;
|
|
||||||
}
|
|
||||||
else if (direction == FarmDirection.SOUTH) {
|
|
||||||
cclock = FarmDirection.EAST;
|
|
||||||
}
|
|
||||||
else if (direction == FarmDirection.WEST) {
|
|
||||||
cclock = FarmDirection.SOUTH;
|
|
||||||
}
|
|
||||||
final Vect previous = this.translateWithOffset(position.x, position.y, position.z, cclock, 1);
|
|
||||||
final ItemStack soil2 = this.getAsItemStack(previous);
|
|
||||||
if (!Gardening.isSoil(soil2.getItem())) {
|
|
||||||
this.trySetSoil(position);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean maintainWater(final int x, final int y, final int z, final FarmDirection direction, final int extent) {
|
private boolean maintainSoil(int x, int y, int z, FarmDirection direction, int extent) {
|
||||||
for (int i = 0; i < extent; ++i) {
|
for (int i = 0; i < extent; ++i) {
|
||||||
final Vect position = this.translateWithOffset(x, y, z, direction, i);
|
Vect position = translateWithOffset(x, y, z, direction, i);
|
||||||
if (this.isAirBlock(position) || this.world.getBlock(x, y, z).isReplaceable(this.world, position.x, position.y, position.z)) {
|
boolean isSoil = Gardening.isSoil(world.getBlock(position.x, position.y, position.z));
|
||||||
if (!this.isWaterBlock(position)) {
|
|
||||||
boolean isEnclosed = true;
|
|
||||||
if (this.world.isAirBlock(position.x + 1, position.y, position.z)) {
|
|
||||||
isEnclosed = false;
|
|
||||||
}
|
|
||||||
else if (this.world.isAirBlock(position.x - 1, position.y, position.z)) {
|
|
||||||
isEnclosed = false;
|
|
||||||
}
|
|
||||||
else if (this.world.isAirBlock(position.x, position.y, position.z + 1)) {
|
|
||||||
isEnclosed = false;
|
|
||||||
}
|
|
||||||
else if (this.world.isAirBlock(position.x, position.y, position.z - 1)) {
|
|
||||||
isEnclosed = false;
|
|
||||||
}
|
|
||||||
isEnclosed = (isEnclosed || this.moisture != EnumMoisture.Damp);
|
|
||||||
if (isEnclosed) {
|
|
||||||
return this.trySetWater(position);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ItemStack getAvailableLoam() {
|
// remove unnecessary blocks
|
||||||
EnumMoisture[] moistures;
|
if (!isManual && !isSoil && !isAirBlock(position)) {
|
||||||
if (this.moisture == EnumMoisture.Damp) {
|
Block block = world.getBlock(position.x, position.y, position.z);
|
||||||
moistures = new EnumMoisture[] { EnumMoisture.Damp, EnumMoisture.Normal, EnumMoisture.Dry };
|
if (moisture == EnumMoisture.DAMP) {
|
||||||
}
|
if (block != Blocks.water) {
|
||||||
else if (this.moisture == EnumMoisture.Damp) {
|
dropBlockAsProduction(position);
|
||||||
moistures = new EnumMoisture[] { EnumMoisture.Dry, EnumMoisture.Damp, EnumMoisture.Dry };
|
}
|
||||||
}
|
} else if (moisture == EnumMoisture.DRY) {
|
||||||
else {
|
if (block != Blocks.sand) {
|
||||||
moistures = new EnumMoisture[] { EnumMoisture.Dry, EnumMoisture.Normal, EnumMoisture.Damp };
|
dropBlockAsProduction(position);
|
||||||
}
|
}
|
||||||
final EnumAcidity[] acidities = { EnumAcidity.Neutral, EnumAcidity.Acid, EnumAcidity.Alkaline };
|
} else {
|
||||||
for (final EnumMoisture moist : moistures) {
|
dropBlockAsProduction(position);
|
||||||
for (final EnumAcidity acid : acidities) {
|
}
|
||||||
for (final Block type : new Block[] { Botany.flowerbed, Botany.loam, Botany.soil }) {
|
}
|
||||||
final int meta = acid.ordinal() * 3 + moist.ordinal();
|
|
||||||
final ItemStack[] resource = { new ItemStack(type, 1, meta) };
|
|
||||||
if (this.housing.getFarmInventory().hasResources(resource)) {
|
|
||||||
return resource[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.housing.getFarmInventory().hasResources(new ItemStack[] { new ItemStack(Blocks.dirt) })) {
|
|
||||||
return new ItemStack(Blocks.dirt);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean trySetSoil(final Vect position) {
|
if (fertilised && isSoil) {
|
||||||
return this.trySetSoil(position, this.getAvailableLoam());
|
IBlockSoil soil = (IBlockSoil) world.getBlock(position.x, position.y, position.z);
|
||||||
}
|
if (soil.fertilise(world, position.x, position.y, position.z, EnumSoilType.FLOWERBED)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private boolean trySetSoil(final Vect position, ItemStack loam) {
|
if (world.getBlock(position.x, position.y + 1, position.z) == Botany.plant) {
|
||||||
ItemStack copy = loam;
|
world.setBlockToAir(position.x, position.y + 1, position.z);
|
||||||
if (loam != null) {
|
continue;
|
||||||
if (loam.getItem() == Item.getItemFromBlock(Blocks.dirt)) {
|
}
|
||||||
loam = new ItemStack(Botany.soil, 0, 4);
|
|
||||||
}
|
|
||||||
this.setBlock(position, ((ItemBlock) loam.getItem()).field_150939_a, loam.getItemDamage());
|
|
||||||
this.housing.getFarmInventory().removeResources(new ItemStack[] { copy });
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean trySetWater(final Vect position) {
|
if (acidity != null && isSoil) {
|
||||||
final FluidStack water = Binnie.Liquid.getLiquidStack("water", 1000);
|
IBlockSoil soil = (IBlockSoil) world.getBlock(position.x, position.y, position.z);
|
||||||
if (this.moisture == EnumMoisture.Damp) {
|
EnumAcidity pH = soil.getPH(world, position.x, position.y, position.z);
|
||||||
if (!this.housing.hasLiquid(water)) {
|
if (pH.ordinal() < acidity.ordinal()) {
|
||||||
return false;
|
ItemStack stack = getAvailableAlkaline();
|
||||||
}
|
if (stack != null
|
||||||
this.setBlock(position, Blocks.water, 0);
|
&& soil.setPH(
|
||||||
this.housing.removeLiquid(water);
|
world,
|
||||||
return true;
|
position.x,
|
||||||
}
|
position.y,
|
||||||
else {
|
position.z,
|
||||||
if (this.moisture != EnumMoisture.Dry) {
|
EnumAcidity.values()[pH.ordinal() + 1])) {
|
||||||
return this.trySetSoil(position);
|
housing.getFarmInventory().removeResources(new ItemStack[] {stack});
|
||||||
}
|
continue;
|
||||||
final ItemStack[] sand = { new ItemStack(Blocks.sand, 1) };
|
}
|
||||||
if (!this.housing.getFarmInventory().hasResources(sand)) {
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
this.setBlock(position, Blocks.sand, 0);
|
|
||||||
this.housing.getFarmInventory().removeResources(sand);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIcon(final ItemStack icon) {
|
if (pH.ordinal() > acidity.ordinal()) {
|
||||||
this.icon = icon;
|
ItemStack stack = getAvailableAcid();
|
||||||
}
|
if (stack != null
|
||||||
|
&& soil.setPH(
|
||||||
|
world,
|
||||||
|
position.x,
|
||||||
|
position.y,
|
||||||
|
position.z,
|
||||||
|
EnumAcidity.values()[pH.ordinal() - 1])) {
|
||||||
|
housing.getFarmInventory().removeResources(new ItemStack[] {stack});
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
if (!isAirBlock(position)
|
||||||
public boolean isAcceptedGermling(final ItemStack itemstack) {
|
&& !world.getBlock(position.x, position.y, position.z)
|
||||||
for (final IFarmable farmable : this.farmables) {
|
.isReplaceable(world, position.x, position.y, position.z)) {
|
||||||
if (farmable.isGermling(itemstack)) {
|
ItemStack block = getAsItemStack(position);
|
||||||
return true;
|
ItemStack loam = getAvailableLoam();
|
||||||
}
|
if (isWaste(block) && loam != null) {
|
||||||
}
|
produce.addAll(
|
||||||
return false;
|
Blocks.dirt.getDrops(world, position.x, position.y, position.z, block.getItemDamage(), 0));
|
||||||
}
|
setBlock(position, Blocks.air, 0);
|
||||||
|
return trySetSoil(position, loam);
|
||||||
|
}
|
||||||
|
} else if (!isManual) {
|
||||||
|
if (!isWaterBlock(position)) {
|
||||||
|
if (i % 2 == 0) {
|
||||||
|
return trySetSoil(position);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
FarmDirection cclock = FarmDirection.EAST;
|
||||||
public Collection<ICrop> harvest(final int x, final int y, final int z, final FarmDirection direction, final int extent) {
|
if (direction == FarmDirection.EAST) {
|
||||||
return null;
|
cclock = FarmDirection.SOUTH;
|
||||||
}
|
} else if (direction == FarmDirection.SOUTH) {
|
||||||
|
cclock = FarmDirection.EAST;
|
||||||
|
} else if (direction == FarmDirection.WEST) {
|
||||||
|
cclock = FarmDirection.SOUTH;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
Vect previous = translateWithOffset(position.x, position.y, position.z, cclock, 1);
|
||||||
@SideOnly(Side.CLIENT)
|
ItemStack soil2 = getAsItemStack(previous);
|
||||||
public IIcon getIcon() {
|
if (!Gardening.isSoil(soil2.getItem())) {
|
||||||
return this.icon.getIconIndex();
|
trySetSoil(position);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
private boolean maintainWater(int x, int y, int z, FarmDirection direction, int extent) {
|
||||||
public ResourceLocation getSpriteSheet() {
|
for (int i = 0; i < extent; ++i) {
|
||||||
return TextureMap.locationBlocksTexture;
|
Vect position = translateWithOffset(x, y, z, direction, i);
|
||||||
}
|
if (!isAirBlock(position)
|
||||||
|
&& !world.getBlock(x, y, z).isReplaceable(world, position.x, position.y, position.z)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
if (isWaterBlock(position)) {
|
||||||
public String getName() {
|
continue;
|
||||||
return this.name;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean maintainCrops(final int x, final int y, final int z, final FarmDirection direction, final int extent) {
|
boolean isEnclosed = true;
|
||||||
for (int i = 0; i < extent; ++i) {
|
if (world.isAirBlock(position.x + 1, position.y, position.z)) {
|
||||||
final Vect position = this.translateWithOffset(x, y, z, direction, i);
|
isEnclosed = false;
|
||||||
if (this.isAirBlock(position) || this.world.getBlock(x, y, z).isReplaceable(this.world, position.x, position.y, position.z)) {
|
} else if (world.isAirBlock(position.x - 1, position.y, position.z)) {
|
||||||
final ItemStack below = this.getAsItemStack(position.add(new Vect(0, -1, 0)));
|
isEnclosed = false;
|
||||||
if (Gardening.isSoil(below.getItem())) {
|
} else if (world.isAirBlock(position.x, position.y, position.z + 1)) {
|
||||||
return this.trySetCrop(position);
|
isEnclosed = false;
|
||||||
}
|
} else if (world.isAirBlock(position.x, position.y, position.z - 1)) {
|
||||||
}
|
isEnclosed = false;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean trySetCrop(final Vect position) {
|
isEnclosed = (isEnclosed || moisture != EnumMoisture.DAMP);
|
||||||
for (final IFarmable farmable : this.farmables) {
|
if (isEnclosed) {
|
||||||
final boolean success = this.housing.plantGermling(farmable, this.world, position.x, position.y, position.z);
|
return trySetWater(position);
|
||||||
if (success && this.housing instanceof IOwnable) {
|
}
|
||||||
final TileEntity tile = this.housing.getWorld().getTileEntity(position.x, position.y, position.z);
|
}
|
||||||
if (tile instanceof TileEntityFlower) {
|
return false;
|
||||||
try {
|
}
|
||||||
final IOwnable housing2 = (IOwnable) this.housing;
|
|
||||||
GameProfile prof = null;
|
|
||||||
if (Mods.Forestry.dev()) {
|
|
||||||
prof = (GameProfile) IOwnable.class.getMethod("getOwner", new Class[0]).invoke(housing2, new Object[0]);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
prof = (GameProfile) IOwnable.class.getMethod("getOwnerProfile", new Class[0]).invoke(housing2, new Object[0]);
|
|
||||||
}
|
|
||||||
((TileEntityFlower) tile).setOwner(prof);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack getAvailableAcid() {
|
private ItemStack getAvailableLoam() {
|
||||||
for (final ItemStack stack : Gardening.getAcidFertilisers()) {
|
EnumMoisture[] moistures;
|
||||||
if (stack != null && stack.getItem() != null && this.housing.getFarmInventory().hasResources(new ItemStack[] { stack })) {
|
if (moisture == EnumMoisture.DAMP) {
|
||||||
return stack;
|
moistures = new EnumMoisture[] {EnumMoisture.DAMP, EnumMoisture.NORMAL, EnumMoisture.DRY};
|
||||||
}
|
} else if (moisture == EnumMoisture.DRY) {
|
||||||
}
|
moistures = new EnumMoisture[] {EnumMoisture.DRY, EnumMoisture.DAMP, EnumMoisture.DRY};
|
||||||
return null;
|
} else {
|
||||||
}
|
moistures = new EnumMoisture[] {EnumMoisture.DRY, EnumMoisture.NORMAL, EnumMoisture.DAMP};
|
||||||
|
}
|
||||||
|
|
||||||
public ItemStack getAvailableAlkaline() {
|
EnumAcidity[] acidities = {EnumAcidity.NEUTRAL, EnumAcidity.ACID, EnumAcidity.ALKALINE};
|
||||||
for (final ItemStack stack : Gardening.getAlkalineFertilisers()) {
|
|
||||||
if (stack != null && stack.getItem() != null && this.housing.getFarmInventory().hasResources(new ItemStack[] { stack })) {
|
|
||||||
return stack;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setData(final EnumMoisture moisture2, final EnumAcidity acidity2, final boolean isManual, final boolean isFertilised, final ItemStack icon2, final String name2) {
|
for (EnumMoisture moist : moistures) {
|
||||||
this.moisture = moisture2;
|
for (EnumAcidity acid : acidities) {
|
||||||
this.acidity = acidity2;
|
for (Block type : new Block[] {Botany.flowerbed, Botany.loam, Botany.soil}) {
|
||||||
this.isManual = isManual;
|
int meta = acid.ordinal() * 3 + moist.ordinal();
|
||||||
this.fertilised = isFertilised;
|
ItemStack[] resource = {new ItemStack(type, 1, meta)};
|
||||||
this.icon = icon2;
|
if (housing.getFarmInventory().hasResources(resource)) {
|
||||||
this.name = name2;
|
return resource[0];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (housing.getFarmInventory().hasResources(new ItemStack[] {new ItemStack(Blocks.dirt)})) {
|
||||||
|
return new ItemStack(Blocks.dirt);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean trySetSoil(Vect position) {
|
||||||
|
return trySetSoil(position, getAvailableLoam());
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean trySetSoil(Vect position, ItemStack loam) {
|
||||||
|
ItemStack copy = loam;
|
||||||
|
if (loam == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (loam.getItem() == Item.getItemFromBlock(Blocks.dirt)) {
|
||||||
|
loam = new ItemStack(Botany.soil, 0, 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
setBlock(position, ((ItemBlock) loam.getItem()).field_150939_a, loam.getItemDamage());
|
||||||
|
housing.getFarmInventory().removeResources(new ItemStack[] {copy});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean trySetWater(Vect position) {
|
||||||
|
FluidStack water = Binnie.Liquid.getLiquidStack("water", 1000);
|
||||||
|
if (moisture == EnumMoisture.DAMP) {
|
||||||
|
if (!housing.hasLiquid(water)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
setBlock(position, Blocks.water, 0);
|
||||||
|
housing.removeLiquid(water);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (moisture != EnumMoisture.DRY) {
|
||||||
|
return trySetSoil(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemStack[] sand = {new ItemStack(Blocks.sand, 1)};
|
||||||
|
if (!housing.getFarmInventory().hasResources(sand)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
setBlock(position, Blocks.sand, 0);
|
||||||
|
housing.getFarmInventory().removeResources(sand);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dropBlockAsProduction(Vect position) {
|
||||||
|
ItemStack stack = new ItemStack(world.getBlock(position.x, position.y, position.z));
|
||||||
|
if (stack.getItem() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
produce.add(stack);
|
||||||
|
world.setBlockToAir(position.x, position.y, position.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAcceptedGermling(ItemStack stack) {
|
||||||
|
for (IFarmable farmable : farmables) {
|
||||||
|
if (farmable.isGermling(stack)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<ICrop> harvest(int x, int y, int z, FarmDirection direction, int extent) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIcon() {
|
||||||
|
return icon.getIconIndex();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIcon(ItemStack icon) {
|
||||||
|
this.icon = icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResourceLocation getSpriteSheet() {
|
||||||
|
return TextureMap.locationBlocksTexture;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean maintainCrops(int x, int y, int z, FarmDirection direction, int extent) {
|
||||||
|
for (int i = 0; i < extent; ++i) {
|
||||||
|
Vect position = translateWithOffset(x, y, z, direction, i);
|
||||||
|
if (isAirBlock(position)
|
||||||
|
|| world.getBlock(x, y, z).isReplaceable(world, position.x, position.y, position.z)) {
|
||||||
|
ItemStack below = getAsItemStack(position.add(new Vect(0, -1, 0)));
|
||||||
|
if (Gardening.isSoil(below.getItem())) {
|
||||||
|
return trySetCrop(position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean trySetCrop(Vect position) {
|
||||||
|
for (IFarmable farmable : farmables) {
|
||||||
|
boolean success = housing.plantGermling(farmable, world, position.x, position.y, position.z);
|
||||||
|
if (!success || !(housing instanceof IOwnable)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
TileEntity tile = housing.getWorld().getTileEntity(position.x, position.y, position.z);
|
||||||
|
if (!(tile instanceof TileEntityFlower)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
IOwnable housing2 = (IOwnable) housing;
|
||||||
|
GameProfile prof = (GameProfile) IOwnable.class
|
||||||
|
.getMethod("getOwnerProfile", new Class[0])
|
||||||
|
.invoke(housing2);
|
||||||
|
((TileEntityFlower) tile).setOwner(prof);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
// ignored
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getAvailableAcid() {
|
||||||
|
for (ItemStack stack : Gardening.getAcidFertilisers()) {
|
||||||
|
if (stack != null
|
||||||
|
&& stack.getItem() != null
|
||||||
|
&& housing.getFarmInventory().hasResources(new ItemStack[] {stack})) {
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getAvailableAlkaline() {
|
||||||
|
for (ItemStack stack : Gardening.getAlkalineFertilisers()) {
|
||||||
|
if (stack != null
|
||||||
|
&& stack.getItem() != null
|
||||||
|
&& housing.getFarmInventory().hasResources(new ItemStack[] {stack})) {
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(
|
||||||
|
EnumMoisture moisture,
|
||||||
|
EnumAcidity acidity,
|
||||||
|
boolean isManual,
|
||||||
|
boolean fertilised,
|
||||||
|
ItemStack icon,
|
||||||
|
String name) {
|
||||||
|
this.moisture = moisture;
|
||||||
|
this.acidity = acidity;
|
||||||
|
this.isManual = isManual;
|
||||||
|
this.fertilised = fertilised;
|
||||||
|
this.icon = icon;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.farm;
|
|
||||||
|
|
||||||
public class Vect
|
|
||||||
{
|
|
||||||
public int x;
|
|
||||||
public int y;
|
|
||||||
public int z;
|
|
||||||
|
|
||||||
public Vect(final int[] dim) {
|
|
||||||
if (dim.length != 3) {
|
|
||||||
throw new RuntimeException("Cannot instantiate a vector with less or more than 3 points.");
|
|
||||||
}
|
|
||||||
this.x = dim[0];
|
|
||||||
this.y = dim[1];
|
|
||||||
this.z = dim[2];
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vect(final int x, final int y, final int z) {
|
|
||||||
this.x = x;
|
|
||||||
this.y = y;
|
|
||||||
this.z = z;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vect add(final Vect other) {
|
|
||||||
final Vect vect;
|
|
||||||
final Vect result = vect = new Vect(this.x, this.y, this.z);
|
|
||||||
vect.x += other.x;
|
|
||||||
final Vect vect2 = result;
|
|
||||||
vect2.y += other.y;
|
|
||||||
final Vect vect3 = result;
|
|
||||||
vect3.z += other.z;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vect multiply(final float factor) {
|
|
||||||
final Vect vect;
|
|
||||||
final Vect result = vect = new Vect(this.x, this.y, this.z);
|
|
||||||
vect.x *= (int) factor;
|
|
||||||
final Vect vect2 = result;
|
|
||||||
vect2.y *= (int) factor;
|
|
||||||
final Vect vect3 = result;
|
|
||||||
vect3.z *= (int) factor;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return String.format("%sx%sx%s;", this.x, this.y, this.z);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
final int prime = 31;
|
|
||||||
int result = 1;
|
|
||||||
result = 31 * result + this.x;
|
|
||||||
result = 31 * result + this.y;
|
|
||||||
result = 31 * result + this.z;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(final Object obj) {
|
|
||||||
if (this == obj) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (obj == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (this.getClass() != obj.getClass()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final Vect other = (Vect) obj;
|
|
||||||
return this.x == other.x && this.y == other.y && this.z == other.z;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,202 +1,228 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.flower;
|
package binnie.botany.flower;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Random;
|
|
||||||
import binnie.botany.Botany;
|
import binnie.botany.Botany;
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import binnie.botany.api.IFlowerType;
|
|
||||||
import binnie.botany.api.EnumFlowerStage;
|
import binnie.botany.api.EnumFlowerStage;
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import com.mojang.authlib.GameProfile;
|
|
||||||
import binnie.botany.api.IFlower;
|
import binnie.botany.api.IFlower;
|
||||||
import binnie.botany.gardening.Gardening;
|
import binnie.botany.api.IFlowerType;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import binnie.botany.core.BotanyCore;
|
import binnie.botany.core.BotanyCore;
|
||||||
|
import binnie.botany.gardening.Gardening;
|
||||||
|
import binnie.botany.genetics.EnumFlowerType;
|
||||||
import binnie.core.BinnieCore;
|
import binnie.core.BinnieCore;
|
||||||
import net.minecraft.item.ItemStack;
|
import com.mojang.authlib.GameProfile;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import binnie.botany.genetics.EnumFlowerType;
|
import java.util.ArrayList;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockContainer;
|
import net.minecraft.block.BlockContainer;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockFlower extends BlockContainer
|
public class BlockFlower extends BlockContainer {
|
||||||
{
|
public BlockFlower() {
|
||||||
@Override
|
super(Material.plants);
|
||||||
public int getRenderType() {
|
float f = 0.2f;
|
||||||
return RendererBotany.renderID;
|
setBlockBounds(0.5f - f, 0.0f, 0.5f - f, 0.5f + f, f * 3.0f, 0.5f + f);
|
||||||
}
|
setTickRandomly(true);
|
||||||
|
setBlockName("flower");
|
||||||
|
setStepSound(Block.soundTypeGrass);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public String getUnlocalizedName() {
|
||||||
public void registerBlockIcons(final IIconRegister par1IconRegister) {
|
return "botany.flower";
|
||||||
for (final EnumFlowerType type : EnumFlowerType.values()) {
|
}
|
||||||
type.registerIcons(par1IconRegister);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockFlower() {
|
@Override
|
||||||
super(Material.plants);
|
public int getRenderType() {
|
||||||
final float f = 0.2f;
|
return RendererBotany.renderID;
|
||||||
this.setBlockBounds(0.5f - f, 0.0f, 0.5f - f, 0.5f + f, f * 3.0f, 0.5f + f);
|
}
|
||||||
this.setTickRandomly(true);
|
|
||||||
this.setBlockName("flower");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(final World var1, final int i) {
|
@SideOnly(Side.CLIENT)
|
||||||
return new TileEntityFlower();
|
public void registerBlockIcons(IIconRegister register) {
|
||||||
}
|
for (EnumFlowerType type : EnumFlowerType.values()) {
|
||||||
|
type.registerIcons(register);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(final World par1World, final int par2, final int par3, final int par4) {
|
public TileEntity createNewTileEntity(World world, int meta) {
|
||||||
return null;
|
return new TileEntityFlower();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube() {
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock() {
|
public boolean isOpaqueCube() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase living, final ItemStack stack) {
|
public boolean renderAsNormalBlock() {
|
||||||
super.onBlockPlacedBy(world, x, y, z, living, stack);
|
return false;
|
||||||
final TileEntity flower = world.getTileEntity(x, y, z);
|
}
|
||||||
if (!BinnieCore.proxy.isSimulating(world)) {
|
|
||||||
if (flower != null && flower instanceof TileEntityFlower) {
|
|
||||||
final IFlower f = BotanyCore.getFlowerRoot().getMember(stack);
|
|
||||||
((TileEntityFlower) flower).setRender(new TileEntityFlower.RenderInfo(f, (TileEntityFlower) flower));
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final TileEntity below = world.getTileEntity(x, y - 1, z);
|
|
||||||
if (flower != null && flower instanceof TileEntityFlower) {
|
|
||||||
if (below instanceof TileEntityFlower) {
|
|
||||||
((TileEntityFlower) flower).setSection(((TileEntityFlower) below).getSection());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
final GameProfile owner = (living instanceof EntityPlayer) ? ((EntityPlayer) living).getGameProfile() : null;
|
|
||||||
((TileEntityFlower) flower).create(stack, owner);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Gardening.tryGrowSection(world, x, y, z);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) {
|
||||||
public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side) {
|
super.onBlockPlacedBy(world, x, y, z, entity, stack);
|
||||||
final TileEntity tile = world.getTileEntity(x, y, z);
|
TileEntity flower = world.getTileEntity(x, y, z);
|
||||||
if (tile instanceof TileEntityFlower) {
|
if (!BinnieCore.proxy.isSimulating(world)) {
|
||||||
final TileEntityFlower f = (TileEntityFlower) tile;
|
if (flower != null && flower instanceof TileEntityFlower) {
|
||||||
final EnumFlowerStage stage = (f.getAge() == 0) ? EnumFlowerStage.SEED : EnumFlowerStage.FLOWER;
|
IFlower f = BotanyCore.getFlowerRoot().getMember(stack);
|
||||||
final IFlowerType flower = f.getType();
|
((TileEntityFlower) flower).setRender(new TileEntityFlower.RenderInfo(f, (TileEntityFlower) flower));
|
||||||
final int section = f.getRenderSection();
|
}
|
||||||
final boolean flowered = f.isFlowered();
|
return;
|
||||||
return (RendererBotany.pass == 0) ? flower.getStem(stage, flowered, section) : ((RendererBotany.pass == 1) ? flower.getPetalIcon(stage, flowered, section) : flower.getVariantIcon(stage, flowered, section));
|
}
|
||||||
}
|
|
||||||
return super.getIcon(world, x, y, z, side);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
TileEntity below = world.getTileEntity(x, y - 1, z);
|
||||||
@SideOnly(Side.CLIENT)
|
if (flower != null && flower instanceof TileEntityFlower) {
|
||||||
public int colorMultiplier(final IBlockAccess world, final int x, final int y, final int z) {
|
if (below instanceof TileEntityFlower) {
|
||||||
final TileEntity tile = world.getTileEntity(x, y, z);
|
((TileEntityFlower) flower).setSection(((TileEntityFlower) below).getSection());
|
||||||
if (tile instanceof TileEntityFlower) {
|
} else {
|
||||||
final TileEntityFlower f = (TileEntityFlower) tile;
|
GameProfile owner = (entity instanceof EntityPlayer) ? ((EntityPlayer) entity).getGameProfile() : null;
|
||||||
return (RendererBotany.pass == 0) ? f.getStemColour() : ((RendererBotany.pass == 1) ? f.getPrimaryColour() : f.getSecondaryColour());
|
((TileEntityFlower) flower).create(stack, owner);
|
||||||
}
|
}
|
||||||
return 16777215;
|
}
|
||||||
}
|
Gardening.tryGrowSection(world, x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlaceBlockAt(final World world, final int x, final int y, final int z) {
|
@SideOnly(Side.CLIENT)
|
||||||
return super.canPlaceBlockAt(world, x, y, z) && this.canBlockStay(world, x, y, z);
|
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||||
}
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
|
if (!(tile instanceof TileEntityFlower)) {
|
||||||
|
return super.getIcon(world, x, y, z, side);
|
||||||
|
}
|
||||||
|
|
||||||
protected boolean canPlaceBlockOn(final Block block) {
|
TileEntityFlower f = (TileEntityFlower) tile;
|
||||||
return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || Gardening.isSoil(block);
|
EnumFlowerStage stage = (f.getAge() == 0) ? EnumFlowerStage.SEED : EnumFlowerStage.FLOWER;
|
||||||
}
|
IFlowerType flower = f.getType();
|
||||||
|
int section = f.getRenderSection();
|
||||||
|
boolean flowered = f.isFlowered();
|
||||||
|
if (RendererBotany.pass == 0) {
|
||||||
|
return flower.getStem(stage, flowered, section);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
return (RendererBotany.pass == 1)
|
||||||
public void onNeighborBlockChange(final World world, final int x, final int y, final int z, final Block block) {
|
? flower.getPetalIcon(stage, flowered, section)
|
||||||
super.onNeighborBlockChange(world, x, y, z, block);
|
: flower.getVariantIcon(stage, flowered, section);
|
||||||
this.checkAndDropBlock(world, x, y, z);
|
}
|
||||||
final TileEntity tile = world.getTileEntity(x, y, z);
|
|
||||||
if (tile instanceof TileEntityFlower) {
|
|
||||||
final TileEntityFlower flower = (TileEntityFlower) tile;
|
|
||||||
if (flower.getSection() == 0 && flower.getFlower() != null && flower.getFlower().getAge() > 0 && flower.getFlower().getGenome().getPrimary().getType().getSections() > 1 && world.getBlock(x, y + 1, z) != Botany.flower) {
|
|
||||||
this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
|
||||||
world.setBlockToAir(x, y, z);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateTick(final World world, final int x, final int y, final int z, final Random rand) {
|
@SideOnly(Side.CLIENT)
|
||||||
final TileEntity tile = world.getTileEntity(x, y, z);
|
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
|
||||||
if (tile instanceof TileEntityFlower) {
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
((TileEntityFlower) tile).randomUpdate(rand);
|
if (tile instanceof TileEntityFlower) {
|
||||||
this.checkAndDropBlock(world, x, y, z);
|
TileEntityFlower f = (TileEntityFlower) tile;
|
||||||
return;
|
if (RendererBotany.pass == 0) {
|
||||||
}
|
return f.getStemColour();
|
||||||
world.setBlockToAir(x, y, z);
|
}
|
||||||
}
|
return (RendererBotany.pass == 1) ? f.getPrimaryColor() : f.getSecondaryColor();
|
||||||
|
}
|
||||||
|
return 0xffffff;
|
||||||
|
}
|
||||||
|
|
||||||
protected void checkAndDropBlock(final World world, final int x, final int y, final int z) {
|
@Override
|
||||||
if (!this.canBlockStay(world, x, y, z)) {
|
public boolean canPlaceBlockAt(World world, int x, int y, int z) {
|
||||||
this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
return super.canPlaceBlockAt(world, x, y, z) && canBlockStay(world, x, y, z);
|
||||||
world.setBlockToAir(x, y, z);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
protected boolean canPlaceBlockOn(Block block) {
|
||||||
public boolean canBlockStay(final World world, final int x, final int y, final int z) {
|
return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || Gardening.isSoil(block);
|
||||||
final TileEntity tile = world.getTileEntity(x, y, z);
|
}
|
||||||
if (tile instanceof TileEntityFlower && ((TileEntityFlower) tile).getSection() > 0) {
|
|
||||||
return world.getBlock(x, y - 1, z) == Botany.flower;
|
|
||||||
}
|
|
||||||
return this.canPlaceBlockOn(world.getBlock(x, y - 1, z));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int blockMeta, final int fortune) {
|
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||||
final ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
super.onNeighborBlockChange(world, x, y, z, block);
|
||||||
final TileEntity tile = world.getTileEntity(x, y, z);
|
checkAndDropBlock(world, x, y, z);
|
||||||
if (tile instanceof TileEntityFlower && ((TileEntityFlower) tile).getSection() == 0) {
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
final ItemStack flower = ((TileEntityFlower) tile).getItemStack();
|
if (!(tile instanceof TileEntityFlower)) {
|
||||||
if (flower != null) {
|
return;
|
||||||
drops.add(flower);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return drops;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
TileEntityFlower flower = (TileEntityFlower) tile;
|
||||||
public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, final int z) {
|
if (flower.getSection() == 0
|
||||||
final List<ItemStack> drops = this.getDrops(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
&& flower.getFlower() != null
|
||||||
final boolean hasBeenBroken = world.setBlockToAir(x, y, z);
|
&& flower.getFlower().getAge() > 0
|
||||||
if (hasBeenBroken && BinnieCore.proxy.isSimulating(world) && drops.size() > 0 && (player == null || !player.capabilities.isCreativeMode)) {
|
&& flower.getFlower().getGenome().getPrimary().getType().getSections() > 1
|
||||||
for (final ItemStack drop : drops) {
|
&& world.getBlock(x, y + 1, z) != Botany.flower) {
|
||||||
this.dropBlockAsItem(world, x, y, z, drop);
|
dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
||||||
}
|
world.setBlockToAir(x, y, z);
|
||||||
}
|
}
|
||||||
return hasBeenBroken;
|
}
|
||||||
}
|
|
||||||
|
@Override
|
||||||
|
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||||
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
|
if (tile instanceof TileEntityFlower) {
|
||||||
|
((TileEntityFlower) tile).randomUpdate(rand);
|
||||||
|
checkAndDropBlock(world, x, y, z);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
world.setBlockToAir(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void checkAndDropBlock(World world, int x, int y, int z) {
|
||||||
|
if (!canBlockStay(world, x, y, z)) {
|
||||||
|
dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
||||||
|
world.setBlockToAir(x, y, z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canBlockStay(World world, int x, int y, int z) {
|
||||||
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
|
if (tile instanceof TileEntityFlower && ((TileEntityFlower) tile).getSection() > 0) {
|
||||||
|
return world.getBlock(x, y - 1, z) == Botany.flower;
|
||||||
|
}
|
||||||
|
return canPlaceBlockOn(world.getBlock(x, y - 1, z));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||||
|
ArrayList<ItemStack> drops = new ArrayList<>();
|
||||||
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
|
if (tile instanceof TileEntityFlower && ((TileEntityFlower) tile).getSection() == 0) {
|
||||||
|
ItemStack flower = ((TileEntityFlower) tile).getItemStack();
|
||||||
|
if (flower != null) {
|
||||||
|
drops.add(flower);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return drops;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||||
|
List<ItemStack> drops = getDrops(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
||||||
|
boolean hasBeenBroken = world.setBlockToAir(x, y, z);
|
||||||
|
if (hasBeenBroken
|
||||||
|
&& BinnieCore.proxy.isSimulating(world)
|
||||||
|
&& drops.size() > 0
|
||||||
|
&& (player == null || !player.capabilities.isCreativeMode)) {
|
||||||
|
for (ItemStack drop : drops) {
|
||||||
|
dropBlockAsItem(world, x, y, z, drop);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return hasBeenBroken;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIcon(int meta, int side) {
|
||||||
|
return Blocks.yellow_flower.getIcon(0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,288 +1,325 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.flower;
|
package binnie.botany.flower;
|
||||||
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import binnie.botany.Botany;
|
|
||||||
import forestry.api.genetics.IPollinatable;
|
|
||||||
import binnie.Binnie;
|
import binnie.Binnie;
|
||||||
import binnie.botany.api.EnumFlowerStage;
|
import binnie.botany.Botany;
|
||||||
import net.minecraft.world.World;
|
|
||||||
import binnie.botany.api.IFlowerType;
|
|
||||||
import binnie.botany.genetics.EnumFlowerType;
|
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
import forestry.core.config.Config;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import binnie.botany.api.EnumFlowerChromosome;
|
|
||||||
import binnie.botany.core.BotanyCore;
|
|
||||||
import binnie.botany.api.IAlleleFlowerSpecies;
|
|
||||||
import binnie.botany.genetics.Flower;
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
||||||
import binnie.core.BinnieCore;
|
|
||||||
import binnie.botany.api.IFlower;
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import forestry.api.genetics.IIndividual;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import binnie.botany.CreativeTabBotany;
|
import binnie.botany.CreativeTabBotany;
|
||||||
|
import binnie.botany.api.EnumFlowerStage;
|
||||||
|
import binnie.botany.api.IFlower;
|
||||||
|
import binnie.botany.api.IFlowerColor;
|
||||||
|
import binnie.botany.api.IFlowerGenome;
|
||||||
|
import binnie.botany.api.IFlowerType;
|
||||||
|
import binnie.botany.core.BotanyCore;
|
||||||
|
import binnie.botany.genetics.EnumFlowerType;
|
||||||
|
import binnie.botany.genetics.Flower;
|
||||||
|
import binnie.core.BinnieCore;
|
||||||
|
import binnie.core.util.I18N;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import forestry.api.genetics.IIndividual;
|
||||||
|
import forestry.api.genetics.IPollinatable;
|
||||||
|
import forestry.core.config.Config;
|
||||||
|
import java.util.List;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public abstract class ItemBotany extends Item
|
public abstract class ItemBotany extends Item {
|
||||||
{
|
public ItemBotany(String name) {
|
||||||
@Override
|
setCreativeTab(CreativeTabBotany.instance);
|
||||||
@SideOnly(Side.CLIENT)
|
setUnlocalizedName(name);
|
||||||
public int getSpriteNumber() {
|
hasSubtypes = true;
|
||||||
return 0;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public ItemBotany(final String name) {
|
@Override
|
||||||
this.setCreativeTab(CreativeTabBotany.instance);
|
@SideOnly(Side.CLIENT)
|
||||||
this.setUnlocalizedName(name);
|
public int getSpriteNumber() {
|
||||||
this.hasSubtypes = true;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isDamageable() {
|
public boolean isDamageable() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isRepairable() {
|
public boolean isRepairable() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getShareTag() {
|
public boolean getShareTag() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasEffect(final ItemStack itemstack) {
|
public boolean hasEffect(ItemStack stack, int pass) {
|
||||||
if (!itemstack.hasTagCompound()) {
|
if (!stack.hasTagCompound()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final IIndividual individual = this.getIndividual(itemstack);
|
|
||||||
return individual != null && individual.getGenome() != null && individual.hasEffect();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
IIndividual individual = getIndividual(stack);
|
||||||
public void addInformation(final ItemStack itemstack, final EntityPlayer player, final List list, final boolean flag) {
|
return individual != null && individual.getGenome() != null && individual.hasEffect();
|
||||||
if (!itemstack.hasTagCompound()) {
|
}
|
||||||
return;
|
|
||||||
}
|
|
||||||
final IFlower individual = (IFlower) this.getIndividual(itemstack);
|
|
||||||
if (individual == null) {
|
|
||||||
list.add("This item is bugged. Destroy it!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
list.add("§e" + individual.getGenome().getPrimaryColor().getName() + ((individual.getGenome().getPrimaryColor() == individual.getGenome().getSecondaryColor()) ? "" : (" and " + individual.getGenome().getSecondaryColor().getName())) + ", " + individual.getGenome().getStemColor().getName() + " Stem");
|
|
||||||
if (individual.isAnalyzed()) {
|
|
||||||
if (BinnieCore.proxy.isShiftDown()) {
|
|
||||||
individual.addTooltip(list);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
list.add("§o<Hold shift for details>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
list.add("<Unknown>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public void addInformation(ItemStack itemstack, EntityPlayer player, List tooltip, boolean flag) {
|
||||||
public void registerIcons(final IIconRegister par1IconRegister) {
|
if (!itemstack.hasTagCompound()) {
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
IFlower individual = (IFlower) getIndividual(itemstack);
|
||||||
|
if (individual == null) {
|
||||||
|
tooltip.add(I18N.localise("botany.item.tooltip.bugged"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
protected IIndividual getIndividual(final ItemStack itemstack) {
|
IFlowerGenome genome = individual.getGenome();
|
||||||
return new Flower(itemstack.getTagCompound());
|
IFlowerColor primaryColor = genome.getPrimaryColor();
|
||||||
}
|
IFlowerColor secondColor = genome.getSecondaryColor();
|
||||||
|
IFlowerColor stemColor = genome.getStemColor();
|
||||||
|
|
||||||
private IAlleleFlowerSpecies getPrimarySpecies(final ItemStack itemstack) {
|
if (primaryColor == secondColor) {
|
||||||
final IFlower tree = BotanyCore.speciesRoot.getMember(itemstack);
|
tooltip.add(EnumChatFormatting.YELLOW
|
||||||
if (tree == null) {
|
+ I18N.localise("botany.item.tooltip.flowerColor1", primaryColor.getName(), stemColor.getName()));
|
||||||
return (IAlleleFlowerSpecies) BotanyCore.speciesRoot.getDefaultTemplate()[EnumFlowerChromosome.SPECIES.ordinal()];
|
} else {
|
||||||
}
|
tooltip.add(EnumChatFormatting.YELLOW
|
||||||
return tree.getGenome().getPrimary();
|
+ I18N.localise(
|
||||||
}
|
"botany.item.tooltip.flowerColor2",
|
||||||
|
primaryColor.getName(),
|
||||||
|
secondColor.getName(),
|
||||||
|
stemColor.getName()));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
if (individual.isAnalyzed()) {
|
||||||
public String getItemStackDisplayName(final ItemStack itemstack) {
|
if (BinnieCore.proxy.isShiftDown()) {
|
||||||
if (!itemstack.hasTagCompound()) {
|
individual.addTooltip(tooltip);
|
||||||
return "Unknown";
|
} else {
|
||||||
}
|
tooltip.add(EnumChatFormatting.GRAY + I18N.localise("botany.item.tooltip.holdMore"));
|
||||||
final IIndividual individual = this.getIndividual(itemstack);
|
}
|
||||||
return (individual != null && individual.getGenome() != null) ? (individual.getDisplayName() + this.getTag()) : "Corrupted Flower";
|
} else {
|
||||||
}
|
tooltip.add(I18N.localise("botany.item.tooltip.unknownGenome"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getSubItems(final Item item, final CreativeTabs par2CreativeTabs, final List itemList) {
|
@SideOnly(Side.CLIENT)
|
||||||
this.addCreativeItems(itemList, true);
|
public void registerIcons(IIconRegister par1IconRegister) {}
|
||||||
}
|
|
||||||
|
|
||||||
public void addCreativeItems(final List itemList, final boolean hideSecrets) {
|
protected IIndividual getIndividual(ItemStack itemstack) {
|
||||||
for (final IIndividual individual : BotanyCore.speciesRoot.getIndividualTemplates()) {
|
return new Flower(itemstack.getTagCompound());
|
||||||
if (hideSecrets && individual.isSecret() && !Config.isDebug) {
|
}
|
||||||
continue;
|
|
||||||
}
|
|
||||||
itemList.add(BotanyCore.speciesRoot.getMemberStack(individual.copy(), this.getStage().ordinal()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getColorFromItemStack(final ItemStack itemstack, final int renderPass) {
|
public String getItemStackDisplayName(ItemStack itemstack) {
|
||||||
final IFlower flower = BotanyCore.speciesRoot.getMember(itemstack);
|
if (!itemstack.hasTagCompound()) {
|
||||||
if (flower == null || flower.getGenome() == null) {
|
return I18N.localise("botany.item.tooltip.unknown");
|
||||||
return 16777215;
|
}
|
||||||
}
|
|
||||||
return (renderPass == 0) ? flower.getGenome().getStemColor().getColor(flower.isWilted()) : ((renderPass == 1) ? flower.getGenome().getPrimaryColor().getColor(flower.isWilted()) : flower.getGenome().getSecondaryColor().getColor(flower.isWilted()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
IIndividual individual = getIndividual(itemstack);
|
||||||
public boolean requiresMultipleRenderPasses() {
|
if (individual != null && individual.getGenome() != null) {
|
||||||
return true;
|
String tag = getTag();
|
||||||
}
|
if (tag == null || tag.isEmpty()) {
|
||||||
|
return individual.getDisplayName();
|
||||||
|
}
|
||||||
|
return I18N.localise("botany.item.botany.name", individual.getDisplayName(), tag);
|
||||||
|
}
|
||||||
|
return I18N.localise("botany.item.flowerCorrupted.name");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRenderPasses(final int metadata) {
|
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||||
return 3;
|
addCreativeItems(itemList, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void addCreativeItems(List itemList, boolean hideSecrets) {
|
||||||
@SideOnly(Side.CLIENT)
|
for (IIndividual individual : BotanyCore.speciesRoot.getIndividualTemplates()) {
|
||||||
public IIcon getIcon(final ItemStack itemstack, final int renderPass) {
|
if (hideSecrets && individual.isSecret() && !Config.isDebug) {
|
||||||
final IFlower flower = BotanyCore.speciesRoot.getMember(itemstack);
|
continue;
|
||||||
if (flower == null || flower.getGenome() == null || flower.getGenome().getPrimary() == null) {
|
}
|
||||||
return EnumFlowerType.Allium.getBlank();
|
itemList.add(BotanyCore.speciesRoot.getMemberStack(
|
||||||
}
|
individual.copy(), getStage().ordinal()));
|
||||||
final IFlowerType type = flower.getGenome().getPrimary().getType();
|
}
|
||||||
if (renderPass == 0) {
|
}
|
||||||
return type.getStem(this.getStage(), flower.hasFlowered(), type.getSections() - 1);
|
|
||||||
}
|
|
||||||
if (renderPass == 1) {
|
|
||||||
return type.getPetalIcon(this.getStage(), flower.hasFlowered(), type.getSections() - 1);
|
|
||||||
}
|
|
||||||
return type.getVariantIcon(this.getStage(), flower.hasFlowered(), type.getSections() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemUse(final ItemStack itemstack, final EntityPlayer player, final World world, int x, int y, int z, int side, final float px, final float py, final float pz) {
|
public int getColorFromItemStack(ItemStack itemstack, int renderPass) {
|
||||||
if (this.getStage() == EnumFlowerStage.POLLEN) {
|
IFlower flower = BotanyCore.speciesRoot.getMember(itemstack);
|
||||||
final IFlower flower = Binnie.Genetics.getFlowerRoot().getMember(itemstack);
|
if (flower == null || flower.getGenome() == null) {
|
||||||
final TileEntity target = world.getTileEntity(x, y, z);
|
return 0xffffff;
|
||||||
if (!(target instanceof IPollinatable)) {
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final IPollinatable pollinatable = (IPollinatable) target;
|
|
||||||
if (!pollinatable.canMateWith(flower)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
pollinatable.mateWith(flower);
|
|
||||||
if (!player.capabilities.isCreativeMode) {
|
|
||||||
--itemstack.stackSize;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
final Block blockFlower = Botany.flower;
|
|
||||||
final Block blockAlreadyThere = world.getBlock(x, y, z);
|
|
||||||
if (blockAlreadyThere == Blocks.snow_layer && (world.getBlockMetadata(x, y, z) & 0x7) < 1) {
|
|
||||||
side = 1;
|
|
||||||
}
|
|
||||||
else if (blockAlreadyThere != Blocks.vine && blockAlreadyThere != Blocks.tallgrass && blockAlreadyThere != Blocks.deadbush && !blockAlreadyThere.isReplaceable(world, x, y, z)) {
|
|
||||||
if (side == 0) {
|
|
||||||
--y;
|
|
||||||
}
|
|
||||||
if (side == 1) {
|
|
||||||
++y;
|
|
||||||
}
|
|
||||||
if (side == 2) {
|
|
||||||
--z;
|
|
||||||
}
|
|
||||||
if (side == 3) {
|
|
||||||
++z;
|
|
||||||
}
|
|
||||||
if (side == 4) {
|
|
||||||
--x;
|
|
||||||
}
|
|
||||||
if (side == 5) {
|
|
||||||
++x;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (itemstack.stackSize == 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!player.canPlayerEdit(x, y, z, side, itemstack)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (y == 255 && blockFlower.getMaterial().isSolid()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (world.canPlaceEntityOnSide(blockFlower, x, y, z, false, side, player, itemstack)) {
|
|
||||||
final int i1 = this.getMetadata(itemstack.getItemDamage());
|
|
||||||
final int j1 = blockFlower.onBlockPlaced(world, x, y, z, side, px, py, pz, i1);
|
|
||||||
if (this.placeBlockAt(itemstack, player, world, x, y, z, side, px, py, pz, j1)) {
|
|
||||||
world.playSoundEffect(x + 0.5f, y + 0.5f, z + 0.5f, blockFlower.stepSound.func_150496_b(), (blockFlower.stepSound.getVolume() + 1.0f) / 2.0f, blockFlower.stepSound.getPitch() * 0.8f);
|
|
||||||
--itemstack.stackSize;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
if (renderPass == 0) {
|
||||||
public boolean func_150936_a(final World p_150936_1_, int p_150936_2_, int p_150936_3_, int p_150936_4_, int p_150936_5_, final EntityPlayer p_150936_6_, final ItemStack p_150936_7_) {
|
return flower.getGenome().getStemColor().getColor(flower.isWilted());
|
||||||
final Block field_150939_a = Botany.flower;
|
}
|
||||||
final Block block = p_150936_1_.getBlock(p_150936_2_, p_150936_3_, p_150936_4_);
|
return (renderPass == 1)
|
||||||
if (block == Blocks.snow_layer) {
|
? flower.getGenome().getPrimaryColor().getColor(flower.isWilted())
|
||||||
p_150936_5_ = 1;
|
: flower.getGenome().getSecondaryColor().getColor(flower.isWilted());
|
||||||
}
|
}
|
||||||
else if (block != Blocks.vine && block != Blocks.tallgrass && block != Blocks.deadbush && !block.isReplaceable(p_150936_1_, p_150936_2_, p_150936_3_, p_150936_4_)) {
|
|
||||||
if (p_150936_5_ == 0) {
|
|
||||||
--p_150936_3_;
|
|
||||||
}
|
|
||||||
if (p_150936_5_ == 1) {
|
|
||||||
++p_150936_3_;
|
|
||||||
}
|
|
||||||
if (p_150936_5_ == 2) {
|
|
||||||
--p_150936_4_;
|
|
||||||
}
|
|
||||||
if (p_150936_5_ == 3) {
|
|
||||||
++p_150936_4_;
|
|
||||||
}
|
|
||||||
if (p_150936_5_ == 4) {
|
|
||||||
--p_150936_2_;
|
|
||||||
}
|
|
||||||
if (p_150936_5_ == 5) {
|
|
||||||
++p_150936_2_;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return p_150936_1_.canPlaceEntityOnSide(field_150939_a, p_150936_2_, p_150936_3_, p_150936_4_, false, p_150936_5_, (Entity) null, p_150936_7_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean placeBlockAt(final ItemStack stack, final EntityPlayer player, final World world, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ, final int metadata) {
|
@Override
|
||||||
final Block field_150939_a = Botany.flower;
|
public boolean requiresMultipleRenderPasses() {
|
||||||
if (!world.setBlock(x, y, z, field_150939_a, metadata, 3)) {
|
return true;
|
||||||
return false;
|
}
|
||||||
}
|
|
||||||
if (world.getBlock(x, y, z) == field_150939_a) {
|
|
||||||
field_150939_a.onBlockPlacedBy(world, x, y, z, player, stack);
|
|
||||||
field_150939_a.onPostBlockPlaced(world, x, y, z, metadata);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract EnumFlowerStage getStage();
|
@Override
|
||||||
|
public int getRenderPasses(int metadata) {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
public abstract String getTag();
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIcon(ItemStack itemstack, int renderPass) {
|
||||||
|
IFlower flower = BotanyCore.speciesRoot.getMember(itemstack);
|
||||||
|
if (flower == null || flower.getGenome() == null || flower.getGenome().getPrimary() == null) {
|
||||||
|
return EnumFlowerType.ALLIUM.getBlank();
|
||||||
|
}
|
||||||
|
|
||||||
|
IFlowerType type = flower.getGenome().getPrimary().getType();
|
||||||
|
if (renderPass == 0) {
|
||||||
|
return type.getStem(getStage(), flower.hasFlowered(), type.getSections() - 1);
|
||||||
|
}
|
||||||
|
if (renderPass == 1) {
|
||||||
|
return type.getPetalIcon(getStage(), flower.hasFlowered(), type.getSections() - 1);
|
||||||
|
}
|
||||||
|
return type.getVariantIcon(getStage(), flower.hasFlowered(), type.getSections() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onItemUse(
|
||||||
|
ItemStack itemstack,
|
||||||
|
EntityPlayer player,
|
||||||
|
World world,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int z,
|
||||||
|
int side,
|
||||||
|
float px,
|
||||||
|
float py,
|
||||||
|
float pz) {
|
||||||
|
if (getStage() == EnumFlowerStage.POLLEN) {
|
||||||
|
IFlower flower = Binnie.Genetics.getFlowerRoot().getMember(itemstack);
|
||||||
|
TileEntity target = world.getTileEntity(x, y, z);
|
||||||
|
if (!(target instanceof IPollinatable)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
IPollinatable pollinatable = (IPollinatable) target;
|
||||||
|
if (!pollinatable.canMateWith(flower)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
pollinatable.mateWith(flower);
|
||||||
|
if (!player.capabilities.isCreativeMode) {
|
||||||
|
itemstack.stackSize--;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Block blockFlower = Botany.flower;
|
||||||
|
Block blockAlreadyThere = world.getBlock(x, y, z);
|
||||||
|
if (blockAlreadyThere == Blocks.snow_layer && (world.getBlockMetadata(x, y, z) & 0x7) < 1) {
|
||||||
|
side = 1;
|
||||||
|
} else if (blockAlreadyThere != Blocks.vine
|
||||||
|
&& blockAlreadyThere != Blocks.tallgrass
|
||||||
|
&& blockAlreadyThere != Blocks.deadbush
|
||||||
|
&& !blockAlreadyThere.isReplaceable(world, x, y, z)) {
|
||||||
|
if (side == 0) {
|
||||||
|
y--;
|
||||||
|
} else if (side == 1) {
|
||||||
|
y++;
|
||||||
|
} else if (side == 2) {
|
||||||
|
z--;
|
||||||
|
} else if (side == 3) {
|
||||||
|
z++;
|
||||||
|
} else if (side == 4) {
|
||||||
|
x--;
|
||||||
|
} else if (side == 5) {
|
||||||
|
x++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemstack.stackSize == 0 || !player.canPlayerEdit(x, y, z, side, itemstack)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (y == 255 && blockFlower.getMaterial().isSolid()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (world.canPlaceEntityOnSide(blockFlower, x, y, z, false, side, player, itemstack)) {
|
||||||
|
int i1 = getMetadata(itemstack.getItemDamage());
|
||||||
|
int j1 = blockFlower.onBlockPlaced(world, x, y, z, side, px, py, pz, i1);
|
||||||
|
if (placeBlockAt(itemstack, player, world, x, y, z, side, px, py, pz, j1)) {
|
||||||
|
world.playSoundEffect(
|
||||||
|
x + 0.5f,
|
||||||
|
y + 0.5f,
|
||||||
|
z + 0.5f,
|
||||||
|
blockFlower.stepSound.func_150496_b(),
|
||||||
|
(blockFlower.stepSound.getVolume() + 1.0f) / 2.0f,
|
||||||
|
blockFlower.stepSound.getPitch() * 0.8f);
|
||||||
|
itemstack.stackSize--;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public boolean func_150936_a(World world, int x, int y, int z, int side, EntityPlayer player, ItemStack stack) {
|
||||||
|
Block field_150939_a = Botany.flower;
|
||||||
|
Block block = world.getBlock(x, y, z);
|
||||||
|
if (block == Blocks.snow_layer) {
|
||||||
|
side = 1;
|
||||||
|
} else if (block != Blocks.vine
|
||||||
|
&& block != Blocks.tallgrass
|
||||||
|
&& block != Blocks.deadbush
|
||||||
|
&& !block.isReplaceable(world, x, y, z)) {
|
||||||
|
if (side == 0) {
|
||||||
|
y--;
|
||||||
|
} else if (side == 1) {
|
||||||
|
y++;
|
||||||
|
} else if (side == 2) {
|
||||||
|
z--;
|
||||||
|
} else if (side == 3) {
|
||||||
|
z++;
|
||||||
|
} else if (side == 4) {
|
||||||
|
x--;
|
||||||
|
} else if (side == 5) {
|
||||||
|
x++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return world.canPlaceEntityOnSide(field_150939_a, x, y, z, false, side, null, stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean placeBlockAt(
|
||||||
|
ItemStack stack,
|
||||||
|
EntityPlayer player,
|
||||||
|
World world,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int z,
|
||||||
|
int side,
|
||||||
|
float hitX,
|
||||||
|
float hitY,
|
||||||
|
float hitZ,
|
||||||
|
int metadata) {
|
||||||
|
Block block = Botany.flower;
|
||||||
|
if (!world.setBlock(x, y, z, block, metadata, 3)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (world.getBlock(x, y, z) == block) {
|
||||||
|
block.onBlockPlacedBy(world, x, y, z, player, stack);
|
||||||
|
block.onPostBlockPlaced(world, x, y, z, metadata);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract EnumFlowerStage getStage();
|
||||||
|
|
||||||
|
public abstract String getTag();
|
||||||
}
|
}
|
||||||
@@ -1,24 +1,19 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.flower;
|
package binnie.botany.flower;
|
||||||
|
|
||||||
import binnie.botany.api.EnumFlowerStage;
|
import binnie.botany.api.EnumFlowerStage;
|
||||||
|
|
||||||
public class ItemFlower extends ItemBotany
|
public class ItemFlower extends ItemBotany {
|
||||||
{
|
public ItemFlower() {
|
||||||
public ItemFlower() {
|
super("itemFlower");
|
||||||
super("itemFlower");
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumFlowerStage getStage() {
|
public EnumFlowerStage getStage() {
|
||||||
return EnumFlowerStage.FLOWER;
|
return EnumFlowerStage.FLOWER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTag() {
|
public String getTag() {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,173 +1,165 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.flower;
|
package binnie.botany.flower;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import binnie.botany.CreativeTabBotany;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import binnie.botany.Botany;
|
import binnie.botany.Botany;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import binnie.botany.CreativeTabBotany;
|
||||||
|
import binnie.core.util.I18N;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
public class ItemInsulatedTube extends Item
|
public class ItemInsulatedTube extends Item {
|
||||||
{
|
IIcon[] icons;
|
||||||
IIcon[] icons;
|
|
||||||
|
|
||||||
@Override
|
public ItemInsulatedTube() {
|
||||||
@SideOnly(Side.CLIENT)
|
icons = new IIcon[3];
|
||||||
public void getSubItems(final Item p_150895_1_, final CreativeTabs p_150895_2_, final List p_150895_3_) {
|
setUnlocalizedName("insulatedTube");
|
||||||
for (final Material mat : Material.values()) {
|
setCreativeTab(CreativeTabBotany.instance);
|
||||||
for (final Insulate ins : Insulate.values()) {
|
setHasSubtypes(true);
|
||||||
p_150895_3_.add(new ItemStack(this, 1, mat.ordinal() + ins.ordinal() * 128));
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public static ItemStack getInsulateStack(ItemStack stack) {
|
||||||
@SideOnly(Side.CLIENT)
|
return Insulate.get(stack.getItemDamage()).getStack();
|
||||||
public void registerIcons(final IIconRegister p_94581_1_) {
|
}
|
||||||
for (int i = 0; i < 3; ++i) {
|
|
||||||
this.icons[i] = Botany.proxy.getIcon(p_94581_1_, "insulatedTube." + i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public int getColorFromItemStack(final ItemStack stack, final int pass) {
|
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||||
return (pass == 0) ? 16777215 : ((pass == 1) ? Material.get(stack.getItemDamage()).getColor() : Insulate.get(stack.getItemDamage()).getColor());
|
for (Material mat : Material.values()) {
|
||||||
}
|
for (Insulate ins : Insulate.values()) {
|
||||||
|
list.add(new ItemStack(this, 1, mat.ordinal() + ins.ordinal() * 128));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(final ItemStack p_77624_1_, final EntityPlayer p_77624_2_, final List p_77624_3_, final boolean p_77624_4_) {
|
public void registerIcons(IIconRegister register) {
|
||||||
super.addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_);
|
for (int i = 0; i < 3; ++i) {
|
||||||
p_77624_3_.add(Insulate.get(p_77624_1_.getItemDamage()).getName());
|
icons[i] = Botany.proxy.getIcon(register, "insulatedTube." + i);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getItemStackDisplayName(final ItemStack p_77653_1_) {
|
@SideOnly(Side.CLIENT)
|
||||||
return Material.get(p_77653_1_.getItemDamage()).getName() + " Insulated Tube";
|
public int getColorFromItemStack(ItemStack stack, int pass) {
|
||||||
}
|
if (pass == 0) {
|
||||||
|
return 0xffffff;
|
||||||
|
}
|
||||||
|
return (pass == 1)
|
||||||
|
? Material.get(stack.getItemDamage()).getColor()
|
||||||
|
: Insulate.get(stack.getItemDamage()).getColor();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRenderPasses(final int metadata) {
|
@SideOnly(Side.CLIENT)
|
||||||
return 3;
|
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||||
}
|
super.addInformation(stack, player, tooltip, advanced);
|
||||||
|
tooltip.add(Insulate.get(stack.getItemDamage()).getName());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(final ItemStack stack, final int pass) {
|
public String getItemStackDisplayName(ItemStack stack) {
|
||||||
return this.icons[pass % 3];
|
return Material.get(stack.getItemDamage()).getName() + " " + I18N.localise("botany.tube.name");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requiresMultipleRenderPasses() {
|
public int getRenderPasses(int metadata) {
|
||||||
return true;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemInsulatedTube() {
|
@Override
|
||||||
this.icons = new IIcon[3];
|
public IIcon getIcon(ItemStack stack, int pass) {
|
||||||
this.setUnlocalizedName("insulatedTube");
|
return icons[pass % 3];
|
||||||
this.setCreativeTab(CreativeTabBotany.instance);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static String getInsulate(final ItemStack stack) {
|
@Override
|
||||||
return Insulate.get(stack.getItemDamage()).getName();
|
public boolean requiresMultipleRenderPasses() {
|
||||||
}
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public static ItemStack getInsulateStack(final ItemStack stack) {
|
enum Material {
|
||||||
return Insulate.get(stack.getItemDamage()).getStack();
|
Copper(0xe3b78e, "cooper"),
|
||||||
}
|
Tin(0xe1eef4, "tin"),
|
||||||
|
Bronze(0xddc276, "bronze"),
|
||||||
|
Iron(0xd8d8d8, "iron");
|
||||||
|
|
||||||
enum Material
|
protected int color;
|
||||||
{
|
protected String name;
|
||||||
Copper(14923662, "Copper"),
|
|
||||||
Tin(14806772, "Tin"),
|
|
||||||
Bronze(14533238, "Bronze"),
|
|
||||||
Iron(14211288, "Iron");
|
|
||||||
|
|
||||||
int color;
|
Material(int color, String name) {
|
||||||
String name;
|
this.color = color;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
public int getColor() {
|
public static Material get(int i) {
|
||||||
return this.color;
|
return values()[i % values().length];
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public int getColor() {
|
||||||
return this.name;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Material(final int color, final String name) {
|
public String getName() {
|
||||||
this.color = color;
|
return I18N.localise("botany.tube." + name);
|
||||||
this.name = name;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Material get(final int i) {
|
enum Insulate {
|
||||||
return values()[i % values().length];
|
Clay(0xa1aacc, "clay"),
|
||||||
}
|
Cobble(0x7b7b7b, "cobblestone"),
|
||||||
}
|
Sand(0xefeab5, "sand"),
|
||||||
|
HardenedClay(0x935c43, "hardenedClay"),
|
||||||
|
Stone(0x6d6d6d, "smoothStone"),
|
||||||
|
Sandstone(0xc1b989, "sandstone");
|
||||||
|
|
||||||
enum Insulate
|
protected int color;
|
||||||
{
|
protected String name;
|
||||||
Clay(10595020, "Clay"),
|
|
||||||
Cobble(8092539, "Cobblestone"),
|
|
||||||
Sand(15723189, "Sand"),
|
|
||||||
HardenedClay(9657411, "Hardened Clay"),
|
|
||||||
Stone(7171437, "Smooth Stone"),
|
|
||||||
Sandstone(12695945, "Sandstone");
|
|
||||||
|
|
||||||
int color;
|
Insulate(int color, String name) {
|
||||||
String name;
|
this.color = color;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
public int getColor() {
|
public static Insulate get(int i) {
|
||||||
return this.color;
|
return values()[i / 128 % values().length];
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public int getColor() {
|
||||||
return this.name;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Insulate(final int color, final String name) {
|
public String getName() {
|
||||||
this.color = color;
|
return I18N.localise("botany.tube.insulate." + name);
|
||||||
this.name = name;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static Insulate get(final int i) {
|
public ItemStack getStack() {
|
||||||
return values()[i / 128 % values().length];
|
switch (this) {
|
||||||
}
|
case Clay:
|
||||||
|
return new ItemStack(Blocks.clay);
|
||||||
|
|
||||||
public ItemStack getStack() {
|
case Cobble:
|
||||||
switch (this) {
|
return new ItemStack(Blocks.cobblestone);
|
||||||
case Clay: {
|
|
||||||
return new ItemStack(Blocks.clay);
|
case HardenedClay:
|
||||||
}
|
return new ItemStack(Blocks.hardened_clay);
|
||||||
case Cobble: {
|
|
||||||
return new ItemStack(Blocks.cobblestone);
|
case Sand:
|
||||||
}
|
return new ItemStack(Blocks.sand);
|
||||||
case HardenedClay: {
|
|
||||||
return new ItemStack(Blocks.hardened_clay);
|
case Sandstone:
|
||||||
}
|
return new ItemStack(Blocks.sandstone);
|
||||||
case Sand: {
|
|
||||||
return new ItemStack(Blocks.sand);
|
case Stone:
|
||||||
}
|
return new ItemStack(Blocks.stone);
|
||||||
case Sandstone: {
|
}
|
||||||
return new ItemStack(Blocks.sandstone);
|
return null;
|
||||||
}
|
}
|
||||||
case Stone: {
|
}
|
||||||
return new ItemStack(Blocks.stone);
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,24 +1,20 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.flower;
|
package binnie.botany.flower;
|
||||||
|
|
||||||
import binnie.botany.api.EnumFlowerStage;
|
import binnie.botany.api.EnumFlowerStage;
|
||||||
|
import binnie.core.util.I18N;
|
||||||
|
|
||||||
public class ItemPollen extends ItemBotany
|
public class ItemPollen extends ItemBotany {
|
||||||
{
|
public ItemPollen() {
|
||||||
public ItemPollen() {
|
super("pollen");
|
||||||
super("pollen");
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumFlowerStage getStage() {
|
public EnumFlowerStage getStage() {
|
||||||
return EnumFlowerStage.POLLEN;
|
return EnumFlowerStage.POLLEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTag() {
|
public String getTag() {
|
||||||
return " Pollen";
|
return I18N.localise("botany.item.pollen.tag.name");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,24 +1,20 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.flower;
|
package binnie.botany.flower;
|
||||||
|
|
||||||
import binnie.botany.api.EnumFlowerStage;
|
import binnie.botany.api.EnumFlowerStage;
|
||||||
|
import binnie.core.util.I18N;
|
||||||
|
|
||||||
public class ItemSeed extends ItemBotany
|
public class ItemSeed extends ItemBotany {
|
||||||
{
|
public ItemSeed() {
|
||||||
public ItemSeed() {
|
super("seed");
|
||||||
super("seed");
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumFlowerStage getStage() {
|
public EnumFlowerStage getStage() {
|
||||||
return EnumFlowerStage.SEED;
|
return EnumFlowerStage.SEED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTag() {
|
public String getTag() {
|
||||||
return " Germling";
|
return I18N.localise("botany.item.germling.tag.name");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,66 +1,61 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.flower;
|
package binnie.botany.flower;
|
||||||
|
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
import net.minecraft.client.renderer.EntityRenderer;
|
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.client.renderer.RenderBlocks;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.EntityRenderer;
|
||||||
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
public class RendererBotany implements ISimpleBlockRenderingHandler
|
public class RendererBotany implements ISimpleBlockRenderingHandler {
|
||||||
{
|
public static int renderID;
|
||||||
public static int renderID;
|
public static int pass;
|
||||||
public static int pass;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventoryBlock(final Block block, final int metadata, final int modelID, final RenderBlocks renderer) {
|
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||||
}
|
// ignored
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderWorldBlock(final IBlockAccess world, final int x, final int y, final int z, final Block block, final int modelId, final RenderBlocks renderer) {
|
public boolean renderWorldBlock(
|
||||||
final Tessellator tessellator = Tessellator.instance;
|
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z));
|
Tessellator tessellator = Tessellator.instance;
|
||||||
double d1 = x;
|
tessellator.setBrightness(block.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z));
|
||||||
final double d2 = y;
|
double d1 = x;
|
||||||
double d3 = z;
|
double d2 = y;
|
||||||
long i1 = x * 3129871 ^ z * 116129781L;
|
double d3 = z;
|
||||||
i1 = i1 * i1 * 42317861L + i1 * 11L;
|
long i1 = x * 3129871 ^ z * 116129781L;
|
||||||
d1 += ((i1 >> 16 & 0xFL) / 15.0f - 0.5) * 0.3;
|
i1 = i1 * i1 * 42317861L + i1 * 11L;
|
||||||
d3 += ((i1 >> 24 & 0xFL) / 15.0f - 0.5) * 0.3;
|
d1 += ((i1 >> 16 & 0xFL) / 15.0f - 0.5) * 0.3;
|
||||||
final int rot = (int) (i1 % 4L);
|
d3 += ((i1 >> 24 & 0xFL) / 15.0f - 0.5) * 0.3;
|
||||||
for (int j = 0; j < 3; ++j) {
|
|
||||||
RendererBotany.pass = j;
|
|
||||||
final int l = block.colorMultiplier(renderer.blockAccess, x, y, z);
|
|
||||||
float f = (l >> 16 & 0xFF) / 255.0f;
|
|
||||||
float f2 = (l >> 8 & 0xFF) / 255.0f;
|
|
||||||
float f3 = (l & 0xFF) / 255.0f;
|
|
||||||
if (EntityRenderer.anaglyphEnable) {
|
|
||||||
final float f4 = (f * 30.0f + f2 * 59.0f + f3 * 11.0f) / 100.0f;
|
|
||||||
final float f5 = (f * 30.0f + f2 * 70.0f) / 100.0f;
|
|
||||||
final float f6 = (f * 30.0f + f3 * 70.0f) / 100.0f;
|
|
||||||
f = f4;
|
|
||||||
f2 = f5;
|
|
||||||
f3 = f6;
|
|
||||||
}
|
|
||||||
tessellator.setColorOpaque_F(f, f2, f3);
|
|
||||||
final IIcon iicon = block.getIcon(world, x, y, z, 0);
|
|
||||||
renderer.drawCrossedSquares(iicon, d1, d2, d3, 1.0f);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
for (int j = 0; j < 3; ++j) {
|
||||||
public boolean shouldRender3DInInventory(final int i) {
|
RendererBotany.pass = j;
|
||||||
return false;
|
int l = block.colorMultiplier(renderer.blockAccess, x, y, z);
|
||||||
}
|
float f = (l >> 16 & 0xFF) / 255.0f;
|
||||||
|
float f2 = (l >> 8 & 0xFF) / 255.0f;
|
||||||
|
float f3 = (l & 0xFF) / 255.0f;
|
||||||
|
|
||||||
@Override
|
if (EntityRenderer.anaglyphEnable) {
|
||||||
public int getRenderId() {
|
f = (f * 30.0f + f2 * 59.0f + f3 * 11.0f) / 100.0f;
|
||||||
return RendererBotany.renderID;
|
f2 = (f * 30.0f + f2 * 70.0f) / 100.0f;
|
||||||
}
|
f3 = (f * 30.0f + f3 * 70.0f) / 100.0f;
|
||||||
|
}
|
||||||
|
tessellator.setColorOpaque_F(f, f2, f3);
|
||||||
|
IIcon iicon = block.getIcon(world, x, y, z, 0);
|
||||||
|
renderer.drawCrossedSquares(iicon, d1, d2, d3, 1.0f);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldRender3DInInventory(int i) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRenderId() {
|
||||||
|
return RendererBotany.renderID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1,156 +1,154 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.gardening;
|
package binnie.botany.gardening;
|
||||||
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
import binnie.botany.Botany;
|
||||||
|
import binnie.botany.CreativeTabBotany;
|
||||||
import binnie.botany.api.EnumSoilType;
|
import binnie.botany.api.EnumSoilType;
|
||||||
import binnie.botany.api.gardening.IBlockSoil;
|
import binnie.botany.api.gardening.IBlockSoil;
|
||||||
import java.util.Random;
|
import binnie.core.util.I18N;
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import binnie.botany.CreativeTabBotany;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import binnie.botany.Botany;
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import net.minecraft.world.World;
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockBush;
|
import net.minecraft.block.BlockBush;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockPlant extends BlockBush
|
public class BlockPlant extends BlockBush {
|
||||||
{
|
public BlockPlant() {
|
||||||
@Override
|
setBlockName("plant");
|
||||||
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int metadata, final int fortune) {
|
setCreativeTab(CreativeTabBotany.instance);
|
||||||
return new ArrayList<ItemStack>();
|
setTickRandomly(true);
|
||||||
}
|
setStepSound(Block.soundTypeGrass);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
public static boolean isWeed(IBlockAccess world, int x, int y, int z) {
|
||||||
@SideOnly(Side.CLIENT)
|
if (!(world.getBlock(x, y, z) instanceof BlockPlant)) {
|
||||||
public void registerBlockIcons(final IIconRegister p_149651_1_) {
|
return false;
|
||||||
for (final Type t : Type.values()) {
|
}
|
||||||
t.icon = Botany.proxy.getIcon(p_149651_1_, t.name().toLowerCase());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockPlant() {
|
Type type = Type.get(world.getBlockMetadata(x, y, z));
|
||||||
this.setBlockName("plant");
|
return type == Type.Weeds || type == Type.WeedsLong || type == Type.WeedsVeryLong;
|
||||||
this.setCreativeTab(CreativeTabBotany.instance);
|
}
|
||||||
this.setTickRandomly(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean canPlaceBlockOn(final Block p_149854_1_) {
|
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||||
return super.canPlaceBlockOn(p_149854_1_) || Gardening.isSoil(p_149854_1_);
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(final int side, final int meta) {
|
public void registerBlockIcons(IIconRegister register) {
|
||||||
return Type.values()[meta % Type.values().length].icon;
|
for (Type t : Type.values()) {
|
||||||
}
|
t.icon = Botany.proxy.getIcon(register, t.name().toLowerCase());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int damageDropped(final int p_149692_1_) {
|
protected boolean canPlaceBlockOn(Block block) {
|
||||||
return p_149692_1_;
|
return super.canPlaceBlockOn(block) || Gardening.isSoil(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubBlocks(final Item p_149666_1_, final CreativeTabs p_149666_2_, final List p_149666_3_) {
|
public IIcon getIcon(int side, int meta) {
|
||||||
for (final Type type : Type.values()) {
|
return Type.values()[meta % Type.values().length].icon;
|
||||||
p_149666_3_.add(type.get());
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateTick(final World world, final int x, final int y, final int z, final Random random) {
|
public int damageDropped(int damage) {
|
||||||
final Type type = Type.get(world.getBlockMetadata(x, y, z));
|
return damage;
|
||||||
if (random.nextInt(4) == 0) {
|
}
|
||||||
if (type == Type.Weeds) {
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, Type.WeedsLong.ordinal(), 2);
|
|
||||||
}
|
|
||||||
else if (type == Type.WeedsLong) {
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, Type.WeedsVeryLong.ordinal(), 2);
|
|
||||||
}
|
|
||||||
else if (type == Type.DeadFlower) {
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, Type.DecayingFlower.ordinal(), 2);
|
|
||||||
}
|
|
||||||
else if (type == Type.DecayingFlower) {
|
|
||||||
world.setBlockToAir(x, y, z);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (random.nextInt(6) == 0) {
|
|
||||||
if (type == Type.Weeds) {
|
|
||||||
world.setBlockToAir(x, y, z);
|
|
||||||
}
|
|
||||||
else if (type == Type.WeedsLong) {
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, Type.Weeds.ordinal(), 2);
|
|
||||||
}
|
|
||||||
else if (type == Type.WeedsVeryLong) {
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, Type.WeedsLong.ordinal(), 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
final Block below = world.getBlock(x, y - 1, z);
|
|
||||||
if (Gardening.isSoil(below)) {
|
|
||||||
final IBlockSoil soil = (IBlockSoil) below;
|
|
||||||
if (random.nextInt(3) == 0) {
|
|
||||||
if (type == Type.Weeds || type == Type.WeedsLong || type == Type.WeedsVeryLong) {
|
|
||||||
if (!soil.degrade(world, x, y - 1, z, EnumSoilType.LOAM)) {
|
|
||||||
soil.degrade(world, x, y - 1, z, EnumSoilType.SOIL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (type == Type.DecayingFlower && !soil.fertilise(world, x, y - 1, z, EnumSoilType.LOAM)) {
|
|
||||||
soil.fertilise(world, x, y - 1, z, EnumSoilType.FLOWERBED);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isReplaceable(final IBlockAccess world, final int x, final int y, final int z) {
|
@SideOnly(Side.CLIENT)
|
||||||
return true;
|
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||||
}
|
for (Type type : Type.values()) {
|
||||||
|
list.add(type.get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isWeed(final IBlockAccess world, final int x, final int y, final int z) {
|
@Override
|
||||||
if (!(world.getBlock(x, y, z) instanceof BlockPlant)) {
|
public void updateTick(World world, int x, int y, int z, Random random) {
|
||||||
return false;
|
Type type = Type.get(world.getBlockMetadata(x, y, z));
|
||||||
}
|
if (random.nextInt(4) == 0) {
|
||||||
final Type type = Type.get(world.getBlockMetadata(x, y, z));
|
if (type == Type.Weeds) {
|
||||||
return type == Type.Weeds || type == Type.WeedsLong || type == Type.WeedsVeryLong;
|
world.setBlockMetadataWithNotify(x, y, z, Type.WeedsLong.ordinal(), 2);
|
||||||
}
|
} else if (type == Type.WeedsLong) {
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, Type.WeedsVeryLong.ordinal(), 2);
|
||||||
|
} else if (type == Type.DeadFlower) {
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, Type.DecayingFlower.ordinal(), 2);
|
||||||
|
} else if (type == Type.DecayingFlower) {
|
||||||
|
world.setBlockToAir(x, y, z);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public enum Type
|
if (random.nextInt(6) == 0) {
|
||||||
{
|
if (type == Type.Weeds) {
|
||||||
Weeds("Weeds"),
|
world.setBlockToAir(x, y, z);
|
||||||
WeedsLong("Long Weeds"),
|
} else if (type == Type.WeedsLong) {
|
||||||
WeedsVeryLong("Very Long Weeds"),
|
world.setBlockMetadataWithNotify(x, y, z, Type.Weeds.ordinal(), 2);
|
||||||
DeadFlower("Dead Flower"),
|
} else if (type == Type.WeedsVeryLong) {
|
||||||
DecayingFlower("Decaying Flower");
|
world.setBlockMetadataWithNotify(x, y, z, Type.WeedsLong.ordinal(), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public IIcon icon;
|
Block below = world.getBlock(x, y - 1, z);
|
||||||
String name;
|
if (!Gardening.isSoil(below)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
private Type(final String name) {
|
IBlockSoil soil = (IBlockSoil) below;
|
||||||
this.name = name;
|
if (random.nextInt(3) != 0) {
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
public ItemStack get() {
|
if (type == Type.Weeds || type == Type.WeedsLong || type == Type.WeedsVeryLong) {
|
||||||
return new ItemStack(Botany.plant, 1, this.ordinal());
|
if (!soil.degrade(world, x, y - 1, z, EnumSoilType.LOAM)) {
|
||||||
}
|
soil.degrade(world, x, y - 1, z, EnumSoilType.SOIL);
|
||||||
|
}
|
||||||
|
} else if (type == Type.DecayingFlower && !soil.fertilise(world, x, y - 1, z, EnumSoilType.LOAM)) {
|
||||||
|
soil.fertilise(world, x, y - 1, z, EnumSoilType.FLOWERBED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static Type get(final int id) {
|
@Override
|
||||||
return values()[id % values().length];
|
public boolean isReplaceable(IBlockAccess world, int x, int y, int z) {
|
||||||
}
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public String getName() {
|
public enum Type {
|
||||||
return this.name;
|
Weeds("weeds"),
|
||||||
}
|
WeedsLong("longWeeds"),
|
||||||
}
|
WeedsVeryLong("veryLongWeeds"),
|
||||||
|
DeadFlower("deadFlower"),
|
||||||
|
DecayingFlower("decayingFlower");
|
||||||
|
|
||||||
|
public IIcon icon;
|
||||||
|
|
||||||
|
protected String name;
|
||||||
|
|
||||||
|
Type(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Type get(int id) {
|
||||||
|
return values()[id % values().length];
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack get() {
|
||||||
|
return new ItemStack(Botany.plant, 1, ordinal());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return I18N.localise("botany.plant." + name);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,220 +1,215 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.gardening;
|
package binnie.botany.gardening;
|
||||||
|
|
||||||
import net.minecraftforge.common.IPlantable;
|
|
||||||
import binnie.Binnie;
|
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
|
||||||
import java.util.Random;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import binnie.botany.CreativeTabBotany;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import binnie.botany.Botany;
|
import binnie.botany.Botany;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import binnie.botany.CreativeTabBotany;
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import binnie.botany.api.EnumAcidity;
|
import binnie.botany.api.EnumAcidity;
|
||||||
import binnie.botany.api.EnumMoisture;
|
import binnie.botany.api.EnumMoisture;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import binnie.botany.api.EnumSoilType;
|
||||||
|
import binnie.botany.api.gardening.IBlockSoil;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import java.util.Random;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import binnie.botany.api.EnumSoilType;
|
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
import binnie.botany.api.gardening.IBlockSoil;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.IPlantable;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class BlockSoil extends Block implements IBlockSoil
|
public class BlockSoil extends Block implements IBlockSoil {
|
||||||
{
|
protected boolean weedKilled;
|
||||||
boolean weedKilled;
|
protected IIcon[] iconsTop;
|
||||||
IIcon[] iconsTop;
|
protected IIcon[] iconsSide;
|
||||||
IIcon[] iconsSide;
|
protected IIcon[] iconsNoWeed;
|
||||||
IIcon[] iconsNoWeed;
|
protected EnumSoilType type;
|
||||||
EnumSoilType type;
|
|
||||||
|
|
||||||
@Override
|
public BlockSoil(EnumSoilType type, String blockName, boolean weedKilled) {
|
||||||
@SideOnly(Side.CLIENT)
|
super(Material.ground);
|
||||||
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
|
this.type = type;
|
||||||
for (int i = 0; i < 9; ++i) {
|
this.weedKilled = weedKilled;
|
||||||
par3List.add(new ItemStack(this, 1, i));
|
iconsTop = new IIcon[9];
|
||||||
}
|
iconsSide = new IIcon[9];
|
||||||
}
|
iconsNoWeed = new IIcon[9];
|
||||||
|
setCreativeTab(CreativeTabBotany.instance);
|
||||||
|
setBlockName(blockName);
|
||||||
|
setTickRandomly(true);
|
||||||
|
setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.9375f, 1.0f);
|
||||||
|
setLightOpacity(255);
|
||||||
|
setHardness(0.5f);
|
||||||
|
setStepSound(Block.soundTypeGravel);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
public static int getMeta(EnumAcidity acid, EnumMoisture moisture) {
|
||||||
@SideOnly(Side.CLIENT)
|
return acid.ordinal() * 3 + moisture.ordinal();
|
||||||
public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side) {
|
}
|
||||||
return this.getIcon(side, world.getBlockMetadata(x, y, z));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(final int side, int meta) {
|
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||||
meta = ((meta >= 9) ? 8 : meta);
|
for (int i = 0; i < 9; ++i) {
|
||||||
final EnumMoisture moisture = EnumMoisture.values()[meta % 3];
|
list.add(new ItemStack(this, 1, i));
|
||||||
final EnumAcidity acidity = EnumAcidity.values()[meta / 3];
|
}
|
||||||
return (side == 1) ? (this.weedKilled ? this.iconsNoWeed[meta] : this.iconsTop[meta]) : ((side == 0) ? Blocks.dirt.getIcon(side, 0) : this.iconsSide[meta]);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(final IIconRegister register) {
|
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||||
for (final EnumMoisture moisture : EnumMoisture.values()) {
|
return getIcon(side, world.getBlockMetadata(x, y, z));
|
||||||
for (final EnumAcidity pH : EnumAcidity.values()) {
|
}
|
||||||
this.iconsTop[moisture.ordinal() + pH.ordinal() * 3] = Botany.proxy.getIcon(register, "soil/" + this.getType().getID() + "." + pH.getID() + "." + moisture.getID() + ".0");
|
|
||||||
this.iconsSide[moisture.ordinal() + pH.ordinal() * 3] = Botany.proxy.getIcon(register, "soil/" + this.getType().getID() + "." + pH.getID() + "." + moisture.getID() + ".1");
|
|
||||||
this.iconsNoWeed[moisture.ordinal() + pH.ordinal() * 3] = Botany.proxy.getIcon(register, "soil/" + this.getType().getID() + "." + pH.getID() + "." + moisture.getID() + ".2");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public EnumSoilType getType() {
|
@Override
|
||||||
return this.type;
|
@SideOnly(Side.CLIENT)
|
||||||
}
|
public IIcon getIcon(int side, int meta) {
|
||||||
|
meta = ((meta >= 9) ? 8 : meta);
|
||||||
|
if (side == 1) {
|
||||||
|
return weedKilled ? iconsNoWeed[meta] : iconsTop[meta];
|
||||||
|
}
|
||||||
|
return (side == 0) ? Blocks.dirt.getIcon(side, 0) : iconsSide[meta];
|
||||||
|
}
|
||||||
|
|
||||||
public BlockSoil(final EnumSoilType type, final String blockName, final boolean weedKilled) {
|
@Override
|
||||||
super(Material.ground);
|
@SideOnly(Side.CLIENT)
|
||||||
this.weedKilled = false;
|
public void registerBlockIcons(IIconRegister register) {
|
||||||
this.iconsTop = new IIcon[9];
|
for (EnumMoisture moisture : EnumMoisture.values()) {
|
||||||
this.iconsSide = new IIcon[9];
|
for (EnumAcidity pH : EnumAcidity.values()) {
|
||||||
this.iconsNoWeed = new IIcon[9];
|
int index = moisture.ordinal() + pH.ordinal() * 3;
|
||||||
this.weedKilled = weedKilled;
|
String id = "soil/" + getType().getID() + "." + pH.getID() + "." + moisture.getID();
|
||||||
this.setCreativeTab(CreativeTabBotany.instance);
|
iconsTop[index] = Botany.proxy.getIcon(register, id + ".0");
|
||||||
this.setBlockName(blockName);
|
iconsSide[index] = Botany.proxy.getIcon(register, id + ".1");
|
||||||
this.setTickRandomly(true);
|
iconsNoWeed[index] = Botany.proxy.getIcon(register, id + ".2");
|
||||||
this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.9375f, 1.0f);
|
}
|
||||||
this.setLightOpacity(255);
|
}
|
||||||
this.setHardness(0.5f);
|
}
|
||||||
this.setStepSound(Block.soundTypeGravel);
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public EnumSoilType getType() {
|
||||||
public int damageDropped(final int p_149692_1_) {
|
return type;
|
||||||
return p_149692_1_;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateTick(final World world, final int x, final int y, final int z, final Random random) {
|
public int damageDropped(int damage) {
|
||||||
final int meta = world.getBlockMetadata(x, y, z);
|
return damage;
|
||||||
EnumMoisture moisture = EnumMoisture.values()[meta % 3];
|
}
|
||||||
final EnumAcidity acidity = EnumAcidity.values()[meta / 3];
|
|
||||||
final EnumMoisture desiredMoisture = Gardening.getNaturalMoisture(world, x, y, z);
|
|
||||||
if (desiredMoisture.ordinal() > moisture.ordinal()) {
|
|
||||||
moisture = ((moisture == EnumMoisture.Dry) ? EnumMoisture.Normal : EnumMoisture.Damp);
|
|
||||||
}
|
|
||||||
if (desiredMoisture.ordinal() < moisture.ordinal()) {
|
|
||||||
moisture = ((moisture == EnumMoisture.Damp) ? EnumMoisture.Normal : EnumMoisture.Dry);
|
|
||||||
}
|
|
||||||
final int meta2 = getMeta(acidity, moisture);
|
|
||||||
if (meta != meta2) {
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, meta2, 2);
|
|
||||||
}
|
|
||||||
if (!this.weedKilled && random.nextInt(5 - this.getType(world, x, y, z).ordinal()) == 0 && world.getBlock(x, y + 1, z) == Blocks.air) {
|
|
||||||
world.setBlock(x, y + 1, z, Botany.plant, BlockPlant.Type.Weeds.ordinal(), 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(final World p_149668_1_, final int p_149668_2_, final int p_149668_3_, final int p_149668_4_) {
|
public void updateTick(World world, int x, int y, int z, Random random) {
|
||||||
return AxisAlignedBB.getBoundingBox(p_149668_2_ + 0, p_149668_3_ + 0, p_149668_4_ + 0, p_149668_2_ + 1, p_149668_3_ + 1, p_149668_4_ + 1);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
}
|
EnumMoisture moisture = EnumMoisture.values()[meta % 3];
|
||||||
|
EnumAcidity acidity = EnumAcidity.values()[meta / 3];
|
||||||
|
EnumMoisture desiredMoisture = Gardening.getNaturalMoisture(world, x, y, z);
|
||||||
|
if (desiredMoisture.ordinal() > moisture.ordinal()) {
|
||||||
|
moisture = ((moisture == EnumMoisture.DRY) ? EnumMoisture.NORMAL : EnumMoisture.DAMP);
|
||||||
|
}
|
||||||
|
if (desiredMoisture.ordinal() < moisture.ordinal()) {
|
||||||
|
moisture = ((moisture == EnumMoisture.DAMP) ? EnumMoisture.NORMAL : EnumMoisture.DRY);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
int meta2 = getMeta(acidity, moisture);
|
||||||
public boolean isOpaqueCube() {
|
if (meta != meta2) {
|
||||||
return false;
|
world.setBlockMetadataWithNotify(x, y, z, meta2, 2);
|
||||||
}
|
}
|
||||||
|
if (!weedKilled
|
||||||
|
&& random.nextInt(5 - getType(world, x, y, z).ordinal()) == 0
|
||||||
|
&& world.getBlock(x, y + 1, z) == Blocks.air) {
|
||||||
|
world.setBlock(x, y + 1, z, Botany.plant, BlockPlant.Type.Weeds.ordinal(), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderAsNormalBlock() {
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||||
return false;
|
return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumAcidity getPH(final World world, final int x, final int y, final int z) {
|
public boolean isOpaqueCube() {
|
||||||
return EnumAcidity.values()[world.getBlockMetadata(x, y, z) / 3];
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumMoisture getMoisture(final World world, final int x, final int y, final int z) {
|
public boolean renderAsNormalBlock() {
|
||||||
return EnumMoisture.values()[world.getBlockMetadata(x, y, z) % 3];
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumSoilType getType(final World world, final int x, final int y, final int z) {
|
public EnumAcidity getPH(World world, int x, int y, int z) {
|
||||||
return this.type;
|
return EnumAcidity.values()[world.getBlockMetadata(x, y, z) / 3];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean fertilise(final World world, final int x, final int y, final int z, final EnumSoilType maxLevel) {
|
public EnumMoisture getMoisture(World world, int x, int y, int z) {
|
||||||
final EnumSoilType type = this.getType(world, x, y, z);
|
return EnumMoisture.values()[world.getBlockMetadata(x, y, z) % 3];
|
||||||
if (type.ordinal() >= maxLevel.ordinal()) {
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final int meta = world.getBlockMetadata(x, y, z);
|
|
||||||
return world.setBlock(x, y, z, Gardening.getSoilBlock(maxLevel, this.weedKilled), meta, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean degrade(final World world, final int x, final int y, final int z, final EnumSoilType minLevel) {
|
public EnumSoilType getType(World world, int x, int y, int z) {
|
||||||
final EnumSoilType type = this.getType(world, x, y, z);
|
return type;
|
||||||
if (type.ordinal() <= minLevel.ordinal()) {
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final int meta = world.getBlockMetadata(x, y, z);
|
|
||||||
return world.setBlock(x, y, z, Gardening.getSoilBlock(minLevel, this.weedKilled), meta, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setPH(final World world, final int x, final int y, final int z, final EnumAcidity pH) {
|
public boolean fertilise(World world, int x, int y, int z, EnumSoilType maxLevel) {
|
||||||
final int meta = getMeta(pH, this.getMoisture(world, x, y, z));
|
EnumSoilType type = getType(world, x, y, z);
|
||||||
return world.setBlockMetadataWithNotify(x, y, z, meta, 2);
|
if (type.ordinal() >= maxLevel.ordinal()) {
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
public boolean setMoisture(final World world, final int x, final int y, final int z, final EnumMoisture moisture) {
|
return world.setBlock(x, y, z, Gardening.getSoilBlock(maxLevel, weedKilled), meta, 2);
|
||||||
final int meta = getMeta(this.getPH(world, x, y, z), moisture);
|
}
|
||||||
return world.setBlockMetadataWithNotify(x, y, z, meta, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getMeta(final EnumAcidity acid, final EnumMoisture moisture) {
|
@Override
|
||||||
return acid.ordinal() * 3 + moisture.ordinal();
|
public boolean degrade(World world, int x, int y, int z, EnumSoilType minLevel) {
|
||||||
}
|
EnumSoilType type = getType(world, x, y, z);
|
||||||
|
if (type.ordinal() <= minLevel.ordinal()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
public void onNeighborBlockChange(final World world, final int x, final int y, final int z, final Block p_149695_5_) {
|
return world.setBlock(x, y, z, Gardening.getSoilBlock(minLevel, weedKilled), meta, 2);
|
||||||
super.onNeighborBlockChange(world, x, y, z, p_149695_5_);
|
}
|
||||||
if (world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN, false)) {
|
|
||||||
world.setBlock(x, y, z, Blocks.dirt, 0, 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getPH(final ItemStack stack) {
|
@Override
|
||||||
return Binnie.Language.localise(EnumAcidity.values()[stack.getItemDamage() / 3]);
|
public boolean setPH(World world, int x, int y, int z, EnumAcidity pH) {
|
||||||
}
|
int meta = getMeta(pH, getMoisture(world, x, y, z));
|
||||||
|
return world.setBlockMetadataWithNotify(x, y, z, meta, 2);
|
||||||
|
}
|
||||||
|
|
||||||
public static String getMoisture(final ItemStack stack) {
|
@Override
|
||||||
return Binnie.Language.localise(EnumMoisture.values()[stack.getItemDamage() % 3]);
|
public boolean setMoisture(World world, int x, int y, int z, EnumMoisture moisture) {
|
||||||
}
|
int meta = getMeta(getPH(world, x, y, z), moisture);
|
||||||
|
return world.setBlockMetadataWithNotify(x, y, z, meta, 2);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canSustainPlant(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection direction, final IPlantable plantable) {
|
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||||
final Block plant = plantable.getPlant(world, x, y + 1, z);
|
super.onNeighborBlockChange(world, x, y, z, block);
|
||||||
if (plant == Botany.flower) {
|
if (world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN, false)) {
|
||||||
return true;
|
world.setBlock(x, y, z, Blocks.dirt, 0, 2);
|
||||||
}
|
}
|
||||||
if (plant == Botany.plant) {
|
}
|
||||||
return !this.weedKilled || !BlockPlant.isWeed(world, x, y, z);
|
|
||||||
}
|
|
||||||
return world instanceof World && Blocks.dirt.canSustainPlant(world, x, y, z, direction, plantable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean resistsWeeds(final World world, final int x, final int y, final int z) {
|
public boolean canSustainPlant(
|
||||||
return this.weedKilled;
|
IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
|
||||||
}
|
Block plant = plantable.getPlant(world, x, y + 1, z);
|
||||||
|
if (plant == Botany.flower) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (plant == Botany.plant) {
|
||||||
|
return !weedKilled || !BlockPlant.isWeed(world, x, y, z);
|
||||||
|
}
|
||||||
|
return world instanceof World && Blocks.dirt.canSustainPlant(world, x, y, z, direction, plantable);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean resistsWeeds(World world, int x, int y, int z) {
|
||||||
|
return weedKilled;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,264 +1,282 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.gardening;
|
package binnie.botany.gardening;
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
import binnie.botany.Botany;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import binnie.botany.api.EnumAcidity;
|
||||||
|
import binnie.botany.api.EnumMoisture;
|
||||||
|
import binnie.botany.api.EnumSoilType;
|
||||||
|
import binnie.botany.api.IFlower;
|
||||||
|
import binnie.botany.api.gardening.IBlockSoil;
|
||||||
|
import binnie.botany.flower.TileEntityFlower;
|
||||||
import binnie.botany.items.BotanyItems;
|
import binnie.botany.items.BotanyItems;
|
||||||
|
import binnie.core.BinnieCore;
|
||||||
|
import com.mojang.authlib.GameProfile;
|
||||||
import forestry.api.core.EnumTemperature;
|
import forestry.api.core.EnumTemperature;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import binnie.core.BinnieCore;
|
import java.util.LinkedHashMap;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import binnie.botany.flower.TileEntityFlower;
|
|
||||||
import binnie.botany.Botany;
|
|
||||||
import com.mojang.authlib.GameProfile;
|
|
||||||
import binnie.botany.api.IFlower;
|
|
||||||
import binnie.botany.api.EnumSoilType;
|
|
||||||
import net.minecraft.world.biome.BiomeGenBase;
|
|
||||||
import binnie.botany.api.EnumAcidity;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import binnie.botany.api.EnumMoisture;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.item.ItemBlock;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import binnie.botany.api.gardening.IBlockSoil;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
|
||||||
public class Gardening
|
public class Gardening {
|
||||||
{
|
public static Map<ItemStack, Integer> fertiliserAcid = new LinkedHashMap<>();
|
||||||
public static Map<ItemStack, Integer> fertiliserAcid;
|
public static Map<ItemStack, Integer> fertiliserAlkaline = new LinkedHashMap<>();
|
||||||
public static Map<ItemStack, Integer> fertiliserAlkaline;
|
public static Map<ItemStack, Integer> fertiliserNutrient = new LinkedHashMap<>();
|
||||||
public static Map<ItemStack, Integer> fertiliserNutrient;
|
|
||||||
|
|
||||||
public static boolean isSoil(final Block block) {
|
public static boolean isSoil(Block block) {
|
||||||
return block instanceof IBlockSoil;
|
return block instanceof IBlockSoil;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isSoil(final Item item) {
|
public static boolean isSoil(Item item) {
|
||||||
return item instanceof ItemBlock && isSoil(((ItemBlock) item).field_150939_a);
|
return item instanceof ItemBlock && isSoil(((ItemBlock) item).field_150939_a);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isSoil(final ItemStack item) {
|
public static EnumMoisture getNaturalMoisture(World world, int x, int y, int z) {
|
||||||
return isSoil(item.getItem());
|
float bias = getBiomeMoisture(world.getBiomeGenForCoords(x, z), y);
|
||||||
}
|
for (int dx = -1; dx < 2; ++dx) {
|
||||||
|
for (int dz = -1; dz < 2; ++dz) {
|
||||||
|
if (dx != 0 || dz != 0) {
|
||||||
|
if (world.getBlock(x + dx, y, z + dz) == Blocks.sand) {
|
||||||
|
bias -= 1.5;
|
||||||
|
} else if (world.getBlock(x + dx, y, z + dz) == Blocks.water) {
|
||||||
|
bias += 1.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static EnumMoisture getNaturalMoisture(final World world, final int x, final int y, final int z) {
|
if (world.isRaining() && world.canBlockSeeTheSky(x, y + 1, z) && world.getPrecipitationHeight(x, z) <= y + 1) {
|
||||||
float bias = getBiomeMoisture(world.getBiomeGenForCoords(x, z), y);
|
bias += 1.5;
|
||||||
for (int dx = -1; dx < 2; ++dx) {
|
}
|
||||||
for (int dz = -1; dz < 2; ++dz) {
|
|
||||||
if (dx != 0 || dz != 0) {
|
|
||||||
if (world.getBlock(x + dx, y, z + dz) == Blocks.sand) {
|
|
||||||
bias -= 1.5;
|
|
||||||
}
|
|
||||||
else if (world.getBlock(x + dx, y, z + dz) == Blocks.water) {
|
|
||||||
bias += 1.5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (world.isRaining() && world.canBlockSeeTheSky(x, y + 1, z) && world.getPrecipitationHeight(x, z) <= y + 1) {
|
|
||||||
bias += 1.5;
|
|
||||||
}
|
|
||||||
for (int dx = -1; dx < 2; ++dx) {
|
|
||||||
for (int dz = -1; dz < 2; ++dz) {
|
|
||||||
if (dx != 0 || dz != 0) {
|
|
||||||
if (world.getBlock(x + dx, y, z + dz) == Blocks.gravel && bias > 0.0f) {
|
|
||||||
bias *= 0.4f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return (bias <= -1.0f) ? EnumMoisture.Dry : ((bias >= 1.0f) ? EnumMoisture.Damp : EnumMoisture.Normal);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static EnumAcidity getNaturalPH(final World world, final int x, final int y, final int z) {
|
for (int dx = -1; dx < 2; ++dx) {
|
||||||
final float bias = getBiomePH(world.getBiomeGenForCoords(x, z), y);
|
for (int dz = -1; dz < 2; ++dz) {
|
||||||
return (bias <= -1.0f) ? EnumAcidity.Acid : ((bias >= 1.0f) ? EnumAcidity.Alkaline : EnumAcidity.Neutral);
|
if (dx != 0 || dz != 0) {
|
||||||
}
|
if (world.getBlock(x + dx, y, z + dz) == Blocks.gravel && bias > 0.0f) {
|
||||||
|
bias *= 0.4f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static float getBiomeMoisture(final BiomeGenBase biome, final int H) {
|
if (bias <= -1.0f) {
|
||||||
final double R = biome.rainfall;
|
return EnumMoisture.DRY;
|
||||||
final double T = biome.temperature;
|
}
|
||||||
final double m = 3.2 * (R - 0.5) - 0.4 * (1.0 + T + 0.5 * T * T) + 1.1 - 1.6 * (T - 0.9) * (T - 0.9) - 0.002 * (H - 64);
|
return (bias >= 1.0f) ? EnumMoisture.DAMP : EnumMoisture.NORMAL;
|
||||||
return (float) ((m == 0.0) ? m : ((m < 0.0) ? (-Math.sqrt(m * m)) : Math.sqrt(m * m)));
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static float getBiomePH(final BiomeGenBase biome, final int H) {
|
public static EnumAcidity getNaturalPH(World world, int x, int y, int z) {
|
||||||
final double R = biome.rainfall;
|
float bias = getBiomePH(world.getBiomeGenForCoords(x, z), y);
|
||||||
final double T = biome.temperature;
|
if (bias <= -1.0f) {
|
||||||
return (float) (-3.0 * (R - 0.5) + 0.5 * (T - 0.699999988079071) * (T - 0.699999988079071) + 0.02f * (H - 64) - 0.15000000596046448);
|
return EnumAcidity.ACID;
|
||||||
}
|
}
|
||||||
|
return (bias >= 1.0f) ? EnumAcidity.ALKALINE : EnumAcidity.NEUTRAL;
|
||||||
|
}
|
||||||
|
|
||||||
public static void createSoil(final World world, final int x, final int y, final int z, final EnumSoilType soil, final EnumMoisture moisture, final EnumAcidity acidity) {
|
public static float getBiomeMoisture(BiomeGenBase biome, int H) {
|
||||||
final int meta = moisture.ordinal() + acidity.ordinal() * 3;
|
double R = biome.rainfall;
|
||||||
world.setBlock(x, y, z, getSoilBlock(soil), meta, 2);
|
double T = biome.temperature;
|
||||||
}
|
double m =
|
||||||
|
3.2 * (R - 0.5) - 0.4 * (1.0 + T + 0.5 * T * T) + 1.1 - 1.6 * (T - 0.9) * (T - 0.9) - 0.002 * (H - 64);
|
||||||
|
if (m == 0.0) {
|
||||||
|
return (float) m;
|
||||||
|
}
|
||||||
|
if (m < 0.0) {
|
||||||
|
return (float) -Math.sqrt(m * m);
|
||||||
|
}
|
||||||
|
return (float) Math.sqrt(m * m);
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean plant(final World world, final int x, final int y, final int z, final IFlower flower, final GameProfile owner) {
|
public static float getBiomePH(BiomeGenBase biome, int H) {
|
||||||
final boolean set = world.setBlock(x, y, z, Botany.flower, 0, 2);
|
double R = biome.rainfall;
|
||||||
if (!set) {
|
double T = biome.temperature;
|
||||||
return false;
|
return (float) (-3.0 * (R - 0.5)
|
||||||
}
|
+ 0.5 * (T - 0.699999988079071) * (T - 0.699999988079071)
|
||||||
final TileEntity tileFlower = world.getTileEntity(x, y, z);
|
+ 0.02f * (H - 64)
|
||||||
final TileEntity below = world.getTileEntity(x, y - 1, z);
|
- 0.15000000596046448);
|
||||||
if (tileFlower != null && tileFlower instanceof TileEntityFlower) {
|
}
|
||||||
if (below instanceof TileEntityFlower) {
|
|
||||||
((TileEntityFlower) tileFlower).setSection(((TileEntityFlower) below).getSection());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
((TileEntityFlower) tileFlower).create(flower, owner);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tryGrowSection(world, x, y, z);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void tryGrowSection(final World world, final int x, final int y, final int z) {
|
public static void createSoil(
|
||||||
if (!BinnieCore.proxy.isSimulating(world)) {
|
World world, int x, int y, int z, EnumSoilType soil, EnumMoisture moisture, EnumAcidity acidity) {
|
||||||
return;
|
int meta = moisture.ordinal() + acidity.ordinal() * 3;
|
||||||
}
|
world.setBlock(x, y, z, getSoilBlock(soil), meta, 2);
|
||||||
final TileEntity flower = world.getTileEntity(x, y, z);
|
}
|
||||||
if (flower != null && flower instanceof TileEntityFlower) {
|
|
||||||
final IFlower iflower = ((TileEntityFlower) flower).getFlower();
|
|
||||||
final int section = ((TileEntityFlower) flower).getSection();
|
|
||||||
if (iflower != null && section < iflower.getGenome().getPrimary().getType().getSections() - 1 && iflower.getAge() > 0) {
|
|
||||||
world.setBlock(x, y + 1, z, Botany.flower, 0, 2);
|
|
||||||
final TileEntity tileFlower = world.getTileEntity(x, y + 1, z);
|
|
||||||
if (tileFlower != null && tileFlower instanceof TileEntityFlower) {
|
|
||||||
((TileEntityFlower) tileFlower).setSection(section + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onGrowFromSeed(final World world, final int x, final int y, final int z) {
|
public static boolean plant(World world, int x, int y, int z, IFlower flower, GameProfile owner) {
|
||||||
tryGrowSection(world, x, y, z);
|
boolean set = world.setBlock(x, y, z, Botany.flower, 0, 2);
|
||||||
}
|
if (!set) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static Collection<ItemStack> getAcidFertilisers() {
|
TileEntity tileFlower = world.getTileEntity(x, y, z);
|
||||||
return Gardening.fertiliserAcid.keySet();
|
TileEntity below = world.getTileEntity(x, y - 1, z);
|
||||||
}
|
if (tileFlower != null && tileFlower instanceof TileEntityFlower) {
|
||||||
|
if (below instanceof TileEntityFlower) {
|
||||||
|
((TileEntityFlower) tileFlower).setSection(((TileEntityFlower) below).getSection());
|
||||||
|
} else {
|
||||||
|
((TileEntityFlower) tileFlower).create(flower, owner);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static Collection<ItemStack> getAlkalineFertilisers() {
|
tryGrowSection(world, x, y, z);
|
||||||
return Gardening.fertiliserAlkaline.keySet();
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Collection<ItemStack> getNutrientFertilisers() {
|
public static void tryGrowSection(World world, int x, int y, int z) {
|
||||||
return Gardening.fertiliserNutrient.keySet();
|
if (!BinnieCore.proxy.isSimulating(world)) {
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isAcidFertiliser(final ItemStack itemstack) {
|
TileEntity flower = world.getTileEntity(x, y, z);
|
||||||
for (final ItemStack stack : getAcidFertilisers()) {
|
if (flower == null || !(flower instanceof TileEntityFlower)) {
|
||||||
if (stack != null && stack.isItemEqual(itemstack)) {
|
return;
|
||||||
return true;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isAlkalineFertiliser(final ItemStack itemstack) {
|
IFlower iflower = ((TileEntityFlower) flower).getFlower();
|
||||||
for (final ItemStack stack : getAlkalineFertilisers()) {
|
int section = ((TileEntityFlower) flower).getSection();
|
||||||
if (stack != null && stack.isItemEqual(itemstack)) {
|
if (iflower == null
|
||||||
return true;
|
|| section >= iflower.getGenome().getPrimary().getType().getSections() - 1
|
||||||
}
|
|| iflower.getAge() <= 0) {
|
||||||
}
|
return;
|
||||||
return false;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isNutrientFertiliser(final ItemStack itemstack) {
|
world.setBlock(x, y + 1, z, Botany.flower, 0, 2);
|
||||||
for (final ItemStack stack : getNutrientFertilisers()) {
|
TileEntity tileFlower = world.getTileEntity(x, y + 1, z);
|
||||||
if (stack != null && stack.isItemEqual(itemstack)) {
|
if (tileFlower != null && tileFlower instanceof TileEntityFlower) {
|
||||||
return true;
|
((TileEntityFlower) tileFlower).setSection(section + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getFertiliserStrength(final ItemStack stack) {
|
public static void onGrowFromSeed(World world, int x, int y, int z) {
|
||||||
if (stack == null) {
|
tryGrowSection(world, x, y, z);
|
||||||
return 1;
|
}
|
||||||
}
|
|
||||||
for (final Map.Entry<ItemStack, Integer> entry : Gardening.fertiliserAcid.entrySet()) {
|
|
||||||
if (entry.getKey().isItemEqual(stack)) {
|
|
||||||
return entry.getValue();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (final Map.Entry<ItemStack, Integer> entry : Gardening.fertiliserAlkaline.entrySet()) {
|
|
||||||
if (entry.getKey().isItemEqual(stack)) {
|
|
||||||
return entry.getValue();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (final Map.Entry<ItemStack, Integer> entry : Gardening.fertiliserNutrient.entrySet()) {
|
|
||||||
if (entry.getKey().isItemEqual(stack)) {
|
|
||||||
return entry.getValue();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean canTolerate(final IFlower flower, final World world, final int x, final int y, final int z) {
|
public static Collection<ItemStack> getAcidFertilisers() {
|
||||||
if (flower == null || flower.getGenome() == null) {
|
return Gardening.fertiliserAcid.keySet();
|
||||||
return false;
|
}
|
||||||
}
|
|
||||||
final Block soil = world.getBlock(x, y - 1, z);
|
|
||||||
final int soilMeta = world.getBlockMetadata(x, y - 1, z);
|
|
||||||
final BiomeGenBase biome = world.getBiomeGenForCoords(x, z);
|
|
||||||
return canTolerate(flower, EnumAcidity.values()[soilMeta / 3 % 3], EnumMoisture.values()[soilMeta % 3], EnumTemperature.getFromValue(biome.temperature));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static EnumSoilType getSoilType(final World world, final int x, final int y, final int z) {
|
public static Collection<ItemStack> getAlkalineFertilisers() {
|
||||||
if (world.getBlock(x, y, z) instanceof IBlockSoil) {
|
return Gardening.fertiliserAlkaline.keySet();
|
||||||
return ((IBlockSoil) world.getBlock(x, y, z)).getType(world, x, y, z);
|
}
|
||||||
}
|
|
||||||
return EnumSoilType.SOIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Block getSoilBlock(final EnumSoilType type) {
|
public static Collection<ItemStack> getNutrientFertilisers() {
|
||||||
return getSoilBlock(type, false);
|
return Gardening.fertiliserNutrient.keySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Block getSoilBlock(final EnumSoilType type, final boolean weedkill) {
|
public static boolean isAcidFertiliser(ItemStack itemstack) {
|
||||||
switch (type) {
|
for (ItemStack stack : getAcidFertilisers()) {
|
||||||
case FLOWERBED: {
|
if (stack != null && stack.isItemEqual(itemstack)) {
|
||||||
return weedkill ? Botany.flowerbedNoWeed : Botany.flowerbed;
|
return true;
|
||||||
}
|
}
|
||||||
case LOAM: {
|
}
|
||||||
return weedkill ? Botany.loamNoWeed : Botany.loam;
|
return false;
|
||||||
}
|
}
|
||||||
default: {
|
|
||||||
return weedkill ? Botany.soilNoWeed : Botany.soil;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean canTolerate(final IFlower flower, final EnumAcidity ePH, final EnumMoisture eMoisture, final EnumTemperature eTemp) {
|
public static boolean isAlkalineFertiliser(ItemStack itemstack) {
|
||||||
return flower.getGenome().canTolerate(ePH) && flower.getGenome().canTolerate(eMoisture) && flower.getGenome().canTolerate(eTemp);
|
for (ItemStack stack : getAlkalineFertilisers()) {
|
||||||
}
|
if (stack != null && stack.isItemEqual(itemstack)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isWeedkiller(final ItemStack heldItem) {
|
public static boolean isNutrientFertiliser(ItemStack itemstack) {
|
||||||
return heldItem != null && heldItem.isItemEqual(BotanyItems.Weedkiller.get(1));
|
for (ItemStack stack : getNutrientFertilisers()) {
|
||||||
}
|
if (stack != null && stack.isItemEqual(itemstack)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean addWeedKiller(final World world, final int x, final int y, final int z) {
|
public static int getFertiliserStrength(ItemStack stack) {
|
||||||
if (!(world.getBlock(x, y, z) instanceof IBlockSoil)) {
|
if (stack == null) {
|
||||||
return false;
|
return 1;
|
||||||
}
|
}
|
||||||
final EnumSoilType type = getSoilType(world, x, y, z);
|
|
||||||
final Block block = getSoilBlock(type, true);
|
|
||||||
final boolean done = world.setBlock(x, y, z, block, world.getBlockMetadata(x, y, z), 2);
|
|
||||||
if (done && BlockPlant.isWeed(world, x, y + 1, z)) {
|
|
||||||
world.setBlockToAir(x, y + 1, z);
|
|
||||||
}
|
|
||||||
return done;
|
|
||||||
}
|
|
||||||
|
|
||||||
static {
|
for (Map.Entry<ItemStack, Integer> entry : Gardening.fertiliserAcid.entrySet()) {
|
||||||
Gardening.fertiliserAcid = new LinkedHashMap<ItemStack, Integer>();
|
if (entry.getKey().isItemEqual(stack)) {
|
||||||
Gardening.fertiliserAlkaline = new LinkedHashMap<ItemStack, Integer>();
|
return entry.getValue();
|
||||||
Gardening.fertiliserNutrient = new LinkedHashMap<ItemStack, Integer>();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (Map.Entry<ItemStack, Integer> entry : Gardening.fertiliserAlkaline.entrySet()) {
|
||||||
|
if (entry.getKey().isItemEqual(stack)) {
|
||||||
|
return entry.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Map.Entry<ItemStack, Integer> entry : Gardening.fertiliserNutrient.entrySet()) {
|
||||||
|
if (entry.getKey().isItemEqual(stack)) {
|
||||||
|
return entry.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean canTolerate(IFlower flower, World world, int x, int y, int z) {
|
||||||
|
if (flower == null || flower.getGenome() == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int soilMeta = world.getBlockMetadata(x, y - 1, z);
|
||||||
|
BiomeGenBase biome = world.getBiomeGenForCoords(x, z);
|
||||||
|
return canTolerate(
|
||||||
|
flower,
|
||||||
|
EnumAcidity.values()[soilMeta / 3 % 3],
|
||||||
|
EnumMoisture.values()[soilMeta % 3],
|
||||||
|
EnumTemperature.getFromValue(biome.temperature));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EnumSoilType getSoilType(World world, int x, int y, int z) {
|
||||||
|
if (world.getBlock(x, y, z) instanceof IBlockSoil) {
|
||||||
|
return ((IBlockSoil) world.getBlock(x, y, z)).getType(world, x, y, z);
|
||||||
|
}
|
||||||
|
return EnumSoilType.SOIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Block getSoilBlock(EnumSoilType type) {
|
||||||
|
return getSoilBlock(type, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Block getSoilBlock(EnumSoilType type, boolean weedkill) {
|
||||||
|
switch (type) {
|
||||||
|
case FLOWERBED:
|
||||||
|
return weedkill ? Botany.flowerbedNoWeed : Botany.flowerbed;
|
||||||
|
|
||||||
|
case LOAM:
|
||||||
|
return weedkill ? Botany.loamNoWeed : Botany.loam;
|
||||||
|
}
|
||||||
|
return weedkill ? Botany.soilNoWeed : Botany.soil;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean canTolerate(IFlower flower, EnumAcidity ePH, EnumMoisture eMoisture, EnumTemperature eTemp) {
|
||||||
|
return flower.getGenome().canTolerate(ePH)
|
||||||
|
&& flower.getGenome().canTolerate(eMoisture)
|
||||||
|
&& flower.getGenome().canTolerate(eTemp);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isWeedkiller(ItemStack heldItem) {
|
||||||
|
return heldItem != null && heldItem.isItemEqual(BotanyItems.Weedkiller.get(1));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean addWeedKiller(World world, int x, int y, int z) {
|
||||||
|
if (!(world.getBlock(x, y, z) instanceof IBlockSoil)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
EnumSoilType type = getSoilType(world, x, y, z);
|
||||||
|
Block block = getSoilBlock(type, true);
|
||||||
|
boolean done = world.setBlock(x, y, z, block, world.getBlockMetadata(x, y, z), 2);
|
||||||
|
if (done && BlockPlant.isWeed(world, x, y + 1, z)) {
|
||||||
|
world.setBlockToAir(x, y + 1, z);
|
||||||
|
}
|
||||||
|
return done;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,72 +1,77 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.gardening;
|
package binnie.botany.gardening;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import binnie.botany.api.EnumAcidity;
|
import binnie.botany.api.EnumAcidity;
|
||||||
import binnie.botany.api.EnumMoisture;
|
import binnie.botany.api.EnumMoisture;
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import binnie.botany.api.EnumSoilType;
|
import binnie.botany.api.EnumSoilType;
|
||||||
|
import binnie.core.util.I18N;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
|
||||||
public class ItemSoil extends ItemBlock
|
public class ItemSoil extends ItemBlock {
|
||||||
{
|
protected EnumSoilType type;
|
||||||
EnumSoilType type;
|
|
||||||
private boolean noWeed;
|
|
||||||
|
|
||||||
@Override
|
private boolean noWeed;
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void addInformation(final ItemStack stack, final EntityPlayer p_77624_2_, final List p_77624_3_, final boolean p_77624_4_) {
|
|
||||||
super.addInformation(stack, p_77624_2_, p_77624_3_, p_77624_4_);
|
|
||||||
final EnumMoisture moisture = EnumMoisture.values()[stack.getItemDamage() % 3];
|
|
||||||
final EnumAcidity acidity = EnumAcidity.values()[stack.getItemDamage() / 3];
|
|
||||||
String info = "";
|
|
||||||
if (moisture == EnumMoisture.Dry) {
|
|
||||||
info += "§eDry§f";
|
|
||||||
}
|
|
||||||
if (moisture == EnumMoisture.Damp) {
|
|
||||||
info += "§9Damp§f";
|
|
||||||
}
|
|
||||||
if (acidity == EnumAcidity.Acid) {
|
|
||||||
if (info.length() > 0) {
|
|
||||||
info += ", ";
|
|
||||||
}
|
|
||||||
info += "§cAcidic§f";
|
|
||||||
}
|
|
||||||
if (acidity == EnumAcidity.Alkaline) {
|
|
||||||
if (info.length() > 0) {
|
|
||||||
info += ", ";
|
|
||||||
}
|
|
||||||
info += "§bAlkaline§f";
|
|
||||||
}
|
|
||||||
if (info.length() > 0) {
|
|
||||||
p_77624_3_.add(info);
|
|
||||||
}
|
|
||||||
if (this.noWeed) {
|
|
||||||
p_77624_3_.add("Weedkiller");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemSoil(final Block p_i45328_1_) {
|
public ItemSoil(Block block) {
|
||||||
super(p_i45328_1_);
|
super(block);
|
||||||
this.type = ((BlockSoil) this.field_150939_a).getType();
|
type = ((BlockSoil) field_150939_a).getType();
|
||||||
this.noWeed = ((BlockSoil) this.field_150939_a).weedKilled;
|
noWeed = ((BlockSoil) field_150939_a).weedKilled;
|
||||||
this.hasSubtypes = true;
|
hasSubtypes = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getItemStackDisplayName(final ItemStack stack) {
|
@SideOnly(Side.CLIENT)
|
||||||
return this.type.name().substring(0, 1) + this.type.name().toLowerCase().substring(1);
|
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||||
}
|
super.addInformation(stack, player, tooltip, advanced);
|
||||||
|
EnumMoisture moisture = EnumMoisture.values()[stack.getItemDamage() % 3];
|
||||||
|
EnumAcidity acidity = EnumAcidity.values()[stack.getItemDamage() / 3];
|
||||||
|
String info = "";
|
||||||
|
|
||||||
@Override
|
if (moisture == EnumMoisture.DRY) {
|
||||||
public int getMetadata(final int p_77647_1_) {
|
info += EnumChatFormatting.YELLOW + I18N.localise("botany.moisture.dry") + EnumChatFormatting.RESET;
|
||||||
return p_77647_1_;
|
}
|
||||||
}
|
if (moisture == EnumMoisture.DAMP) {
|
||||||
|
info += EnumChatFormatting.YELLOW + I18N.localise("botany.moisture.damp") + EnumChatFormatting.RESET;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (acidity == EnumAcidity.ACID) {
|
||||||
|
if (info.length() > 0) {
|
||||||
|
info += ", ";
|
||||||
|
}
|
||||||
|
info += EnumChatFormatting.YELLOW + I18N.localise("botany.ph.acid") + EnumChatFormatting.RESET;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (acidity == EnumAcidity.ALKALINE) {
|
||||||
|
if (info.length() > 0) {
|
||||||
|
info += ", ";
|
||||||
|
}
|
||||||
|
info += EnumChatFormatting.YELLOW + I18N.localise("botany.ph.alkaline") + EnumChatFormatting.RESET;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (info.length() > 0) {
|
||||||
|
tooltip.add(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (noWeed) {
|
||||||
|
tooltip.add(I18N.localise("botany.soil.weedkiller"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getItemStackDisplayName(ItemStack stack) {
|
||||||
|
String soilName = type.name().toLowerCase(Locale.ENGLISH);
|
||||||
|
return I18N.localise("botany.soil." + soilName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int meta) {
|
||||||
|
return meta;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,68 +1,88 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.gardening;
|
package binnie.botany.gardening;
|
||||||
|
|
||||||
import binnie.botany.CreativeTabBotany;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import binnie.botany.Botany;
|
import binnie.botany.Botany;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import binnie.botany.CreativeTabBotany;
|
||||||
import net.minecraft.util.IChatComponent;
|
|
||||||
import binnie.botany.api.EnumAcidity;
|
import binnie.botany.api.EnumAcidity;
|
||||||
import binnie.botany.api.EnumMoisture;
|
import binnie.botany.api.EnumMoisture;
|
||||||
import binnie.botany.api.EnumSoilType;
|
import binnie.botany.api.EnumSoilType;
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.util.ChatComponentText;
|
|
||||||
import binnie.Binnie;
|
|
||||||
import binnie.botany.api.gardening.IBlockSoil;
|
import binnie.botany.api.gardening.IBlockSoil;
|
||||||
import binnie.core.BinnieCore;
|
import binnie.core.BinnieCore;
|
||||||
import net.minecraft.world.World;
|
import binnie.core.util.I18N;
|
||||||
|
import binnie.genetics.genetics.AlleleHelper;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.ChatComponentText;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.util.IChatComponent;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class ItemSoilMeter extends Item
|
public class ItemSoilMeter extends Item {
|
||||||
{
|
public ItemSoilMeter() {
|
||||||
@Override
|
setCreativeTab(CreativeTabBotany.instance);
|
||||||
public boolean onItemUse(final ItemStack stack, final EntityPlayer player, final World world, final int x, int y, final int z, final int p_77648_7_, final float p_77648_8_, final float p_77648_9_, final float p_77648_10_) {
|
setUnlocalizedName("soilMeter");
|
||||||
Block block = world.getBlock(x, y, z);
|
setMaxStackSize(1);
|
||||||
if (!Gardening.isSoil(block)) {
|
}
|
||||||
--y;
|
|
||||||
block = world.getBlock(x, y, z);
|
|
||||||
}
|
|
||||||
if (Gardening.isSoil(block) && !BinnieCore.proxy.isSimulating(world)) {
|
|
||||||
final IBlockSoil soil = (IBlockSoil) block;
|
|
||||||
final EnumSoilType type = soil.getType(world, x, y, z);
|
|
||||||
final EnumMoisture moisture = soil.getMoisture(world, x, y, z);
|
|
||||||
final EnumAcidity pH = soil.getPH(world, x, y, z);
|
|
||||||
String info = "Type: ";
|
|
||||||
info = info + "§" + (new char[] { '8', '6', 'd' })[type.ordinal()] + Binnie.Language.localise(type) + "§f";
|
|
||||||
info += ", Moisture: ";
|
|
||||||
info = info + "§" + (new char[] { 'e', '7', '9' })[moisture.ordinal()] + Binnie.Language.localise(moisture) + "§f";
|
|
||||||
info += ", pH: ";
|
|
||||||
info = info + "§" + (new char[] { 'c', 'a', 'b' })[pH.ordinal()] + Binnie.Language.localise(pH) + "§f";
|
|
||||||
final IChatComponent chat = new ChatComponentText(info);
|
|
||||||
player.addChatMessage(chat);
|
|
||||||
}
|
|
||||||
return super.onItemUse(stack, player, world, x, y, z, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public boolean onItemUse(
|
||||||
public void registerIcons(final IIconRegister register) {
|
ItemStack stack,
|
||||||
this.itemIcon = Botany.proxy.getIcon(register, "soilMeter");
|
EntityPlayer player,
|
||||||
}
|
World world,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int z,
|
||||||
|
int side,
|
||||||
|
float blockX,
|
||||||
|
float blockY,
|
||||||
|
float blockZ) {
|
||||||
|
Block block = world.getBlock(x, y, z);
|
||||||
|
if (!Gardening.isSoil(block)) {
|
||||||
|
y--;
|
||||||
|
block = world.getBlock(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
public ItemSoilMeter() {
|
if (Gardening.isSoil(block) && !BinnieCore.proxy.isSimulating(world)) {
|
||||||
this.setCreativeTab(CreativeTabBotany.instance);
|
IBlockSoil soil = (IBlockSoil) block;
|
||||||
this.setUnlocalizedName("soilMeter");
|
EnumSoilType type = soil.getType(world, x, y, z);
|
||||||
this.setMaxStackSize(1);
|
EnumMoisture moisture = soil.getMoisture(world, x, y, z);
|
||||||
}
|
EnumAcidity pH = soil.getPH(world, x, y, z);
|
||||||
|
|
||||||
@Override
|
EnumChatFormatting[] colors = new EnumChatFormatting[] {
|
||||||
public String getItemStackDisplayName(final ItemStack i) {
|
EnumChatFormatting.DARK_GRAY, EnumChatFormatting.GOLD, EnumChatFormatting.LIGHT_PURPLE,
|
||||||
return "Soil Meter";
|
};
|
||||||
}
|
String info = I18N.localise("botany.soil.tooltip.type") + " ";
|
||||||
|
info += colors[type.ordinal()] + AlleleHelper.toDisplay(type) + EnumChatFormatting.RESET;
|
||||||
|
|
||||||
|
colors = new EnumChatFormatting[] {
|
||||||
|
EnumChatFormatting.YELLOW, EnumChatFormatting.GRAY, EnumChatFormatting.BLUE,
|
||||||
|
};
|
||||||
|
info += ", " + I18N.localise("botany.soil.tooltip.moisture") + " ";
|
||||||
|
info += colors[moisture.ordinal()] + AlleleHelper.toDisplay(moisture) + EnumChatFormatting.RESET;
|
||||||
|
|
||||||
|
colors = new EnumChatFormatting[] {
|
||||||
|
EnumChatFormatting.RED, EnumChatFormatting.GREEN, EnumChatFormatting.AQUA,
|
||||||
|
};
|
||||||
|
info += ", " + I18N.localise("botany.soil.tooltip.pH") + " ";
|
||||||
|
info += colors[pH.ordinal()] + AlleleHelper.toDisplay(pH) + EnumChatFormatting.RESET;
|
||||||
|
IChatComponent chat = new ChatComponentText(info);
|
||||||
|
player.addChatMessage(chat);
|
||||||
|
}
|
||||||
|
return super.onItemUse(stack, player, world, x, y, z, side, blockX, blockY, blockZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister register) {
|
||||||
|
itemIcon = Botany.proxy.getIcon(register, "soilMeter");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getItemStackDisplayName(ItemStack stack) {
|
||||||
|
return I18N.localise("botany.item.soilMeter.name");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,74 +1,84 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.gardening;
|
package binnie.botany.gardening;
|
||||||
|
|
||||||
|
import binnie.botany.Botany;
|
||||||
|
import binnie.botany.CreativeTabBotany;
|
||||||
import binnie.botany.api.EnumAcidity;
|
import binnie.botany.api.EnumAcidity;
|
||||||
import binnie.botany.api.EnumMoisture;
|
import binnie.botany.api.EnumMoisture;
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
|
||||||
import binnie.botany.api.EnumSoilType;
|
import binnie.botany.api.EnumSoilType;
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import binnie.botany.Botany;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import binnie.botany.CreativeTabBotany;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class ItemTrowel extends Item
|
public class ItemTrowel extends Item {
|
||||||
{
|
protected Item.ToolMaterial theToolMaterial;
|
||||||
protected Item.ToolMaterial theToolMaterial;
|
String locName;
|
||||||
String locName;
|
|
||||||
|
|
||||||
public ItemTrowel(final Item.ToolMaterial p_i45343_1_, final String material) {
|
public ItemTrowel(Item.ToolMaterial toolMaterial, String material) {
|
||||||
this.theToolMaterial = p_i45343_1_;
|
theToolMaterial = toolMaterial;
|
||||||
this.maxStackSize = 1;
|
maxStackSize = 1;
|
||||||
this.setMaxDamage(p_i45343_1_.getMaxUses());
|
setMaxDamage(toolMaterial.getMaxUses());
|
||||||
this.setCreativeTab(CreativeTabBotany.instance);
|
setCreativeTab(CreativeTabBotany.instance);
|
||||||
this.setUnlocalizedName("trowel" + material);
|
setUnlocalizedName("trowel" + material);
|
||||||
this.locName = "trowel" + material;
|
locName = "trowel" + material;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(final IIconRegister p_94581_1_) {
|
public void registerIcons(IIconRegister register) {
|
||||||
this.itemIcon = Botany.proxy.getIcon(p_94581_1_, "tools/" + this.locName);
|
itemIcon = Botany.proxy.getIcon(register, "tools/" + locName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemUse(final ItemStack stack, final EntityPlayer player, final World world, final int x, final int y, final int z, final int p_77648_7_, final float p_77648_8_, final float p_77648_9_, final float p_77648_10_) {
|
public boolean onItemUse(
|
||||||
if (!player.canPlayerEdit(x, y, z, p_77648_7_, stack)) {
|
ItemStack stack,
|
||||||
return false;
|
EntityPlayer player,
|
||||||
}
|
World world,
|
||||||
final Block block = world.getBlock(x, y, z);
|
int x,
|
||||||
if (p_77648_7_ == 0 || (!world.getBlock(x, y + 1, z).isAir(world, x, y + 1, z) && world.getBlock(x, y + 1, z) != Botany.flower) || (block != Blocks.grass && block != Blocks.dirt)) {
|
int y,
|
||||||
return false;
|
int z,
|
||||||
}
|
int side,
|
||||||
final Block block2 = Botany.soil;
|
float blockX,
|
||||||
world.playSoundEffect(x + 0.5f, y + 0.5f, z + 0.5f, block2.stepSound.getStepResourcePath(), (block2.stepSound.getVolume() + 1.0f) / 2.0f, block2.stepSound.getPitch() * 0.8f);
|
float blockY,
|
||||||
if (world.isRemote) {
|
float blockZ) {
|
||||||
return true;
|
if (!player.canPlayerEdit(x, y, z, side, stack)) {
|
||||||
}
|
return false;
|
||||||
final EnumMoisture moisture = Gardening.getNaturalMoisture(world, x, y, z);
|
}
|
||||||
final EnumAcidity acidity = Gardening.getNaturalPH(world, x, y, z);
|
Block block = world.getBlock(x, y, z);
|
||||||
Gardening.createSoil(world, x, y, z, EnumSoilType.SOIL, moisture, acidity);
|
if (side == 0
|
||||||
stack.damageItem(1, player);
|
|| (!world.getBlock(x, y + 1, z).isAir(world, x, y + 1, z)
|
||||||
return true;
|
&& world.getBlock(x, y + 1, z) != Botany.flower)
|
||||||
}
|
|| (block != Blocks.grass && block != Blocks.dirt)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
Block block2 = Botany.soil;
|
||||||
@SideOnly(Side.CLIENT)
|
world.playSoundEffect(
|
||||||
public boolean isFull3D() {
|
x + 0.5f,
|
||||||
return true;
|
y + 0.5f,
|
||||||
}
|
z + 0.5f,
|
||||||
|
block2.stepSound.getStepResourcePath(),
|
||||||
|
(block2.stepSound.getVolume() + 1.0f) / 2.0f,
|
||||||
|
block2.stepSound.getPitch() * 0.8f);
|
||||||
|
if (world.isRemote) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public String getToolMaterialName() {
|
EnumMoisture moisture = Gardening.getNaturalMoisture(world, x, y, z);
|
||||||
return this.theToolMaterial.toString();
|
EnumAcidity acidity = Gardening.getNaturalPH(world, x, y, z);
|
||||||
}
|
Gardening.createSoil(world, x, y, z, EnumSoilType.SOIL, moisture, acidity);
|
||||||
|
stack.damageItem(1, player);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public boolean isFull3D() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,37 +1,32 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.gardening;
|
package binnie.botany.gardening;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
public class ItemWeed extends ItemBlock
|
public class ItemWeed extends ItemBlock {
|
||||||
{
|
public ItemWeed(Block block) {
|
||||||
public ItemWeed(final Block p_i45328_1_) {
|
super(block);
|
||||||
super(p_i45328_1_);
|
setHasSubtypes(true);
|
||||||
this.setHasSubtypes(true);
|
hasSubtypes = true;
|
||||||
this.hasSubtypes = true;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getItemStackDisplayName(final ItemStack stack) {
|
public String getItemStackDisplayName(ItemStack stack) {
|
||||||
return BlockPlant.Type.values()[stack.getItemDamage()].getName();
|
return BlockPlant.Type.values()[stack.getItemDamage()].getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMetadata(final int p_77647_1_) {
|
public int getMetadata(int meta) {
|
||||||
return p_77647_1_;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIconFromDamage(final int p_77617_1_) {
|
public IIcon getIconFromDamage(int damage) {
|
||||||
return this.field_150939_a.getIcon(2, p_77617_1_);
|
return field_150939_a.getIcon(2, damage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,274 +1,353 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.gardening;
|
package binnie.botany.gardening;
|
||||||
|
|
||||||
import binnie.core.block.TileEntityMetadata;
|
import binnie.Binnie;
|
||||||
import java.util.Map;
|
import binnie.botany.Botany;
|
||||||
import binnie.botany.genetics.EnumFlowerColor;
|
import binnie.botany.CreativeTabBotany;
|
||||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
|
||||||
import net.minecraft.init.Items;
|
|
||||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
|
||||||
import binnie.core.Mods;
|
|
||||||
import net.minecraft.item.crafting.IRecipe;
|
|
||||||
import binnie.botany.api.EnumAcidity;
|
import binnie.botany.api.EnumAcidity;
|
||||||
import binnie.botany.farm.CircuitGarden;
|
|
||||||
import binnie.botany.api.EnumMoisture;
|
import binnie.botany.api.EnumMoisture;
|
||||||
import net.minecraft.init.Blocks;
|
import binnie.botany.api.EnumSoilType;
|
||||||
import binnie.botany.ceramic.PigmentRecipe;
|
import binnie.botany.ceramic.BlockCeramic;
|
||||||
import net.minecraftforge.oredict.RecipeSorter;
|
|
||||||
import binnie.botany.ceramic.CeramicTileRecipe;
|
|
||||||
import binnie.core.block.MultipassItemRenderer;
|
|
||||||
import binnie.botany.ceramic.BlockCeramicBrick;
|
import binnie.botany.ceramic.BlockCeramicBrick;
|
||||||
import binnie.botany.ceramic.BlockCeramicPatterned;
|
import binnie.botany.ceramic.BlockCeramicPatterned;
|
||||||
import net.minecraftforge.client.IItemRenderer;
|
|
||||||
import binnie.core.block.ItemMetadataRenderer;
|
|
||||||
import binnie.core.BinnieCore;
|
|
||||||
import binnie.core.block.ItemMetadata;
|
|
||||||
import binnie.botany.ceramic.BlockStained;
|
import binnie.botany.ceramic.BlockStained;
|
||||||
import binnie.botany.ceramic.BlockCeramic;
|
import binnie.botany.ceramic.CeramicTileRecipe;
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
import binnie.botany.ceramic.PigmentRecipe;
|
||||||
|
import binnie.botany.farm.CircuitGarden;
|
||||||
|
import binnie.botany.flower.ItemInsulatedTube;
|
||||||
|
import binnie.botany.genetics.EnumFlowerColor;
|
||||||
|
import binnie.botany.items.BotanyItems;
|
||||||
import binnie.botany.items.ItemClay;
|
import binnie.botany.items.ItemClay;
|
||||||
import binnie.botany.items.ItemPigment;
|
import binnie.botany.items.ItemPigment;
|
||||||
import binnie.botany.CreativeTabBotany;
|
import binnie.core.BinnieCore;
|
||||||
import binnie.botany.items.BotanyItems;
|
|
||||||
import binnie.Binnie;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import binnie.botany.flower.ItemInsulatedTube;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
|
||||||
import binnie.botany.Botany;
|
|
||||||
import binnie.botany.api.EnumSoilType;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import binnie.core.IInitializable;
|
import binnie.core.IInitializable;
|
||||||
|
import binnie.core.Mods;
|
||||||
|
import binnie.core.block.ItemMetadata;
|
||||||
|
import binnie.core.block.ItemMetadataRenderer;
|
||||||
|
import binnie.core.block.MultipassItemRenderer;
|
||||||
|
import binnie.core.block.TileEntityMetadata;
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
import net.minecraftforge.oredict.RecipeSorter;
|
||||||
|
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||||
|
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||||
|
|
||||||
public class ModuleGardening implements IInitializable
|
public class ModuleGardening implements IInitializable {
|
||||||
{
|
public static HashMap<ItemStack, Integer> queuedAcidFertilisers = new HashMap<>();
|
||||||
public static HashMap<ItemStack, Integer> queuedAcidFertilisers;
|
public static HashMap<ItemStack, Integer> queuedAlkalineFertilisers = new HashMap<>();
|
||||||
public static HashMap<ItemStack, Integer> queuedAlkalineFertilisers;
|
public static HashMap<ItemStack, Integer> queuedNutrientFertilisers = new HashMap<>();
|
||||||
public static HashMap<ItemStack, Integer> queuedNutrientFertilisers;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void preInit() {
|
public void preInit() {
|
||||||
Botany.soil = new BlockSoil(EnumSoilType.SOIL, "soil", false);
|
Botany.plant = new BlockPlant();
|
||||||
Botany.loam = new BlockSoil(EnumSoilType.LOAM, "loam", false);
|
GameRegistry.registerBlock(Botany.plant, ItemWeed.class, "plant");
|
||||||
Botany.flowerbed = new BlockSoil(EnumSoilType.FLOWERBED, "flowerbed", false);
|
|
||||||
Botany.soilNoWeed = new BlockSoil(EnumSoilType.SOIL, "soilNoWeed", true);
|
|
||||||
Botany.loamNoWeed = new BlockSoil(EnumSoilType.LOAM, "loamNoWeed", true);
|
|
||||||
Botany.flowerbedNoWeed = new BlockSoil(EnumSoilType.FLOWERBED, "flowerbedNoWeed", true);
|
|
||||||
GameRegistry.registerBlock(Botany.plant = new BlockPlant(), ItemWeed.class, "plant");
|
|
||||||
GameRegistry.registerBlock(Botany.soil, ItemSoil.class, "soil");
|
|
||||||
GameRegistry.registerBlock(Botany.loam, ItemSoil.class, "loam");
|
|
||||||
GameRegistry.registerBlock(Botany.flowerbed, ItemSoil.class, "flowerbed");
|
|
||||||
GameRegistry.registerBlock(Botany.soilNoWeed, ItemSoil.class, "soilNoWeed");
|
|
||||||
GameRegistry.registerBlock(Botany.loamNoWeed, ItemSoil.class, "loamNoWeed");
|
|
||||||
GameRegistry.registerBlock(Botany.flowerbedNoWeed, ItemSoil.class, "flowerbedNoWeed");
|
|
||||||
Botany.soilMeter = new ItemSoilMeter();
|
|
||||||
Botany.insulatedTube = new ItemInsulatedTube();
|
|
||||||
Botany.trowelWood = new ItemTrowel(Item.ToolMaterial.WOOD, "Wood");
|
|
||||||
Botany.trowelStone = new ItemTrowel(Item.ToolMaterial.STONE, "Stone");
|
|
||||||
Botany.trowelIron = new ItemTrowel(Item.ToolMaterial.IRON, "Iron");
|
|
||||||
Botany.trowelDiamond = new ItemTrowel(Item.ToolMaterial.EMERALD, "Diamond");
|
|
||||||
Botany.trowelGold = new ItemTrowel(Item.ToolMaterial.GOLD, "Gold");
|
|
||||||
Botany.misc = Binnie.Item.registerMiscItems(BotanyItems.values(), CreativeTabBotany.instance);
|
|
||||||
Botany.pigment = new ItemPigment();
|
|
||||||
Botany.clay = new ItemClay();
|
|
||||||
Botany.ceramic = new BlockCeramic();
|
|
||||||
Botany.stained = new BlockStained();
|
|
||||||
GameRegistry.registerBlock(Botany.ceramic, ItemMetadata.class, "ceramic");
|
|
||||||
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(Botany.ceramic), new ItemMetadataRenderer());
|
|
||||||
GameRegistry.registerBlock(Botany.stained, ItemMetadata.class, "stained");
|
|
||||||
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(Botany.stained), new ItemMetadataRenderer());
|
|
||||||
Botany.ceramicTile = new BlockCeramicPatterned();
|
|
||||||
Botany.ceramicBrick = new BlockCeramicBrick();
|
|
||||||
GameRegistry.registerBlock(Botany.ceramicTile, ItemMetadata.class, "ceramicPattern");
|
|
||||||
GameRegistry.registerBlock(Botany.ceramicBrick, ItemMetadata.class, "ceramicBrick");
|
|
||||||
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(Botany.ceramicTile), new MultipassItemRenderer());
|
|
||||||
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(Botany.ceramicBrick), new MultipassItemRenderer());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
Botany.soil = new BlockSoil(EnumSoilType.SOIL, "soil", false);
|
||||||
public void init() {
|
GameRegistry.registerBlock(Botany.soil, ItemSoil.class, "soil");
|
||||||
OreDictionary.registerOre("pigment", Botany.pigment);
|
|
||||||
RecipeSorter.register("botany:ceramictile", CeramicTileRecipe.class, RecipeSorter.Category.SHAPED, "");
|
|
||||||
RecipeSorter.register("botany:pigment", PigmentRecipe.class, RecipeSorter.Category.SHAPED, "");
|
|
||||||
final ItemStack yellow = new ItemStack(Blocks.yellow_flower, 1);
|
|
||||||
final ItemStack red = new ItemStack(Blocks.red_flower, 1);
|
|
||||||
final ItemStack blue = new ItemStack(Blocks.red_flower, 1, 7);
|
|
||||||
for (final boolean manual : new boolean[] { true, false }) {
|
|
||||||
for (final boolean fertilised : new boolean[] { true, false }) {
|
|
||||||
for (final EnumMoisture moist : EnumMoisture.values()) {
|
|
||||||
final ItemStack icon = (moist == EnumMoisture.Dry) ? yellow : ((moist == EnumMoisture.Normal) ? red : blue);
|
|
||||||
int insulate = 2 - moist.ordinal();
|
|
||||||
if (fertilised) {
|
|
||||||
insulate += 3;
|
|
||||||
}
|
|
||||||
new CircuitGarden(moist, null, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 0 + 128 * insulate), icon);
|
|
||||||
new CircuitGarden(moist, EnumAcidity.Acid, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 1 + 128 * insulate), icon);
|
|
||||||
new CircuitGarden(moist, EnumAcidity.Neutral, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 2 + 128 * insulate), icon);
|
|
||||||
new CircuitGarden(moist, EnumAcidity.Alkaline, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 3 + 128 * insulate), icon);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
Botany.loam = new BlockSoil(EnumSoilType.LOAM, "loam", false);
|
||||||
public void postInit() {
|
GameRegistry.registerBlock(Botany.loam, ItemSoil.class, "loam");
|
||||||
GameRegistry.addRecipe(new CeramicTileRecipe());
|
|
||||||
for (int mat = 0; mat < 4; ++mat) {
|
|
||||||
for (int insulate = 0; insulate < 6; ++insulate) {
|
|
||||||
final ItemStack tubes = new ItemStack(Botany.insulatedTube, 2, mat + 128 * insulate);
|
|
||||||
final ItemStack insulateStack = ItemInsulatedTube.getInsulateStack(tubes);
|
|
||||||
final ItemStack forestryTube = new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, mat);
|
|
||||||
GameRegistry.addShapelessRecipe(tubes, new Object[] { forestryTube, forestryTube, insulateStack });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe((Item) Botany.trowelWood, new Object[] { "d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "plankWood" }));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe((Item) Botany.trowelStone, new Object[] { "d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "cobblestone" }));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe((Item) Botany.trowelIron, new Object[] { "d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "ingotIron" }));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe((Item) Botany.trowelGold, new Object[] { "d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "ingotGold" }));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe((Item) Botany.trowelDiamond, new Object[] { "d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "gemDiamond" }));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe((Item) Botany.soilMeter, new Object[] { " gg", " rg", "i ", 'g', "ingotGold", 'r', "dustRedstone", 'i', "ingotIron" }));
|
|
||||||
GameRegistry.addShapelessRecipe(BotanyItems.Weedkiller.get(4), new Object[] { new ItemStack(Items.spider_eye), new ItemStack(Items.wheat_seeds), new ItemStack(Items.wheat_seeds), new ItemStack(Items.wheat_seeds) });
|
|
||||||
GameRegistry.addShapelessRecipe(BotanyItems.AshPowder.get(4), new Object[] { Mods.Forestry.stack("ash") });
|
|
||||||
GameRegistry.addShapelessRecipe(BotanyItems.MulchPowder.get(4), new Object[] { Mods.Forestry.stack("mulch") });
|
|
||||||
GameRegistry.addShapelessRecipe(BotanyItems.CompostPowder.get(4), new Object[] { Mods.Forestry.stack("fertilizerBio") });
|
|
||||||
GameRegistry.addShapelessRecipe(BotanyItems.FertiliserPowder.get(4), new Object[] { Mods.Forestry.stack("fertilizerCompound") });
|
|
||||||
GameRegistry.addShapelessRecipe(BotanyItems.PulpPowder.get(4), new Object[] { Mods.Forestry.stack("woodPulp") });
|
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(BotanyItems.SulphurPowder.get(4), new Object[] { "dustSulphur" }));
|
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Botany.pigment, 2, EnumFlowerColor.Black.ordinal()), new Object[] { "pigment", "pigment", "dyeBlack" }));
|
|
||||||
ModuleGardening.queuedAcidFertilisers.put(BotanyItems.SulphurPowder.get(1), 1);
|
|
||||||
ModuleGardening.queuedAcidFertilisers.put(BotanyItems.MulchPowder.get(1), 1);
|
|
||||||
ModuleGardening.queuedAcidFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "mulch")), 2);
|
|
||||||
for (final ItemStack stack : OreDictionary.getOres("dustSulfur")) {
|
|
||||||
ModuleGardening.queuedAcidFertilisers.put(stack, 2);
|
|
||||||
}
|
|
||||||
ModuleGardening.queuedAlkalineFertilisers.put(BotanyItems.AshPowder.get(1), 1);
|
|
||||||
ModuleGardening.queuedAlkalineFertilisers.put(BotanyItems.PulpPowder.get(1), 1);
|
|
||||||
ModuleGardening.queuedAlkalineFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "ash")), 2);
|
|
||||||
ModuleGardening.queuedAlkalineFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "woodPulp")), 2);
|
|
||||||
ModuleGardening.queuedNutrientFertilisers.put(BotanyItems.CompostPowder.get(1), 1);
|
|
||||||
ModuleGardening.queuedNutrientFertilisers.put(BotanyItems.FertiliserPowder.get(1), 1);
|
|
||||||
ModuleGardening.queuedNutrientFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "fertilizerBio")), 2);
|
|
||||||
ModuleGardening.queuedNutrientFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "fertilizerCompound")), 2);
|
|
||||||
for (final Map.Entry<ItemStack, Integer> entry : ModuleGardening.queuedAcidFertilisers.entrySet()) {
|
|
||||||
this.addAcidFertiliser(entry.getKey(), entry.getValue());
|
|
||||||
}
|
|
||||||
for (final Map.Entry<ItemStack, Integer> entry : ModuleGardening.queuedAlkalineFertilisers.entrySet()) {
|
|
||||||
this.addAlkalineFertiliser(entry.getKey(), entry.getValue());
|
|
||||||
}
|
|
||||||
for (final Map.Entry<ItemStack, Integer> entry : ModuleGardening.queuedNutrientFertilisers.entrySet()) {
|
|
||||||
this.addNutrientFertiliser(entry.getKey(), entry.getValue());
|
|
||||||
}
|
|
||||||
GameRegistry.addRecipe(BotanyItems.Mortar.get(6), new Object[] { " c ", "cgc", " c ", 'c', Items.clay_ball, 'g', Blocks.gravel });
|
|
||||||
for (final EnumFlowerColor c : EnumFlowerColor.values()) {
|
|
||||||
final ItemStack clay = new ItemStack(Botany.clay, 1, c.ordinal());
|
|
||||||
final ItemStack pigment = new ItemStack(Botany.pigment, 1, c.ordinal());
|
|
||||||
GameRegistry.addShapelessRecipe(clay, new Object[] { Items.clay_ball, Items.clay_ball, Items.clay_ball, pigment });
|
|
||||||
GameRegistry.addSmelting(clay, TileEntityMetadata.getItemStack(Botany.ceramic, c.ordinal()), 0.0f);
|
|
||||||
final ItemStack glass = TileEntityMetadata.getItemStack(Botany.stained, c.ordinal());
|
|
||||||
glass.stackSize = 4;
|
|
||||||
GameRegistry.addShapedRecipe(glass, new Object[] { " g ", "gpg", " g ", 'g', Blocks.glass, 'p', pigment });
|
|
||||||
}
|
|
||||||
GameRegistry.addRecipe(new PigmentRecipe());
|
|
||||||
}
|
|
||||||
|
|
||||||
private ItemStack getStack(final int type, final int pH, final int moisture) {
|
Botany.flowerbed = new BlockSoil(EnumSoilType.FLOWERBED, "flowerbed", false);
|
||||||
if (type < 0 || type > 2 || pH < 0 || pH > 2 || moisture < 0 || moisture > 2) {
|
GameRegistry.registerBlock(Botany.flowerbed, ItemSoil.class, "flowerbed");
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return new ItemStack(Gardening.getSoilBlock(EnumSoilType.values()[type]), 1, BlockSoil.getMeta(EnumAcidity.values()[pH], EnumMoisture.values()[moisture]));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addAcidFertiliser(final ItemStack stack, final int strengthMax) {
|
Botany.soilNoWeed = new BlockSoil(EnumSoilType.SOIL, "soilNoWeed", true);
|
||||||
if (stack == null) {
|
GameRegistry.registerBlock(Botany.soilNoWeed, ItemSoil.class, "soilNoWeed");
|
||||||
return;
|
|
||||||
}
|
|
||||||
Gardening.fertiliserAcid.put(stack, strengthMax);
|
|
||||||
for (int moisture = 0; moisture < 3; ++moisture) {
|
|
||||||
for (int pH = 0; pH < 3; ++pH) {
|
|
||||||
for (int type = 0; type < 3; ++type) {
|
|
||||||
int numOfBlocks = strengthMax * strengthMax;
|
|
||||||
for (int strength = 1; strength < strengthMax; ++strength) {
|
|
||||||
final ItemStack start = this.getStack(type, pH, moisture);
|
|
||||||
final ItemStack end = this.getStack(type, pH - strength, moisture);
|
|
||||||
if (end != null) {
|
|
||||||
end.stackSize = numOfBlocks;
|
|
||||||
final Object[] stacks = new Object[numOfBlocks + 1];
|
|
||||||
for (int i = 0; i < numOfBlocks; ++i) {
|
|
||||||
stacks[i] = start;
|
|
||||||
}
|
|
||||||
stacks[numOfBlocks] = stack.copy();
|
|
||||||
GameRegistry.addShapelessRecipe(end, stacks);
|
|
||||||
}
|
|
||||||
numOfBlocks /= 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addAlkalineFertiliser(final ItemStack stack, final int strengthMax) {
|
Botany.loamNoWeed = new BlockSoil(EnumSoilType.LOAM, "loamNoWeed", true);
|
||||||
if (stack == null) {
|
GameRegistry.registerBlock(Botany.loamNoWeed, ItemSoil.class, "loamNoWeed");
|
||||||
return;
|
|
||||||
}
|
|
||||||
Gardening.fertiliserAlkaline.put(stack, strengthMax);
|
|
||||||
for (int moisture = 0; moisture < 3; ++moisture) {
|
|
||||||
for (int pH = 0; pH < 3; ++pH) {
|
|
||||||
for (int type = 0; type < 3; ++type) {
|
|
||||||
int numOfBlocks = strengthMax * strengthMax;
|
|
||||||
for (int strength = 1; strength < strengthMax; ++strength) {
|
|
||||||
final ItemStack start = this.getStack(type, pH, moisture);
|
|
||||||
final ItemStack end = this.getStack(type, pH + strength, moisture);
|
|
||||||
if (end != null) {
|
|
||||||
end.stackSize = numOfBlocks;
|
|
||||||
final Object[] stacks = new Object[numOfBlocks + 1];
|
|
||||||
for (int i = 0; i < numOfBlocks; ++i) {
|
|
||||||
stacks[i] = start;
|
|
||||||
}
|
|
||||||
stacks[numOfBlocks] = stack.copy();
|
|
||||||
GameRegistry.addShapelessRecipe(end, stacks);
|
|
||||||
}
|
|
||||||
numOfBlocks /= 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addNutrientFertiliser(final ItemStack stack, final int strengthMax) {
|
Botany.flowerbedNoWeed = new BlockSoil(EnumSoilType.FLOWERBED, "flowerbedNoWeed", true);
|
||||||
if (stack == null) {
|
GameRegistry.registerBlock(Botany.flowerbedNoWeed, ItemSoil.class, "flowerbedNoWeed");
|
||||||
return;
|
|
||||||
}
|
|
||||||
Gardening.fertiliserNutrient.put(stack, strengthMax);
|
|
||||||
for (int moisture = 0; moisture < 3; ++moisture) {
|
|
||||||
for (int pH = 0; pH < 3; ++pH) {
|
|
||||||
for (int type = 0; type < 3; ++type) {
|
|
||||||
int numOfBlocks = strengthMax * strengthMax;
|
|
||||||
for (int strength = 1; strength < strengthMax; ++strength) {
|
|
||||||
final ItemStack start = this.getStack(type, pH, moisture);
|
|
||||||
final ItemStack end = this.getStack(type + strength, pH, moisture);
|
|
||||||
if (end != null) {
|
|
||||||
end.stackSize = numOfBlocks;
|
|
||||||
final Object[] stacks = new Object[numOfBlocks + 1];
|
|
||||||
for (int i = 0; i < numOfBlocks; ++i) {
|
|
||||||
stacks[i] = start;
|
|
||||||
}
|
|
||||||
stacks[numOfBlocks] = stack.copy();
|
|
||||||
GameRegistry.addShapelessRecipe(end, stacks);
|
|
||||||
}
|
|
||||||
numOfBlocks /= 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static {
|
Botany.soilMeter = new ItemSoilMeter();
|
||||||
ModuleGardening.queuedAcidFertilisers = new HashMap<ItemStack, Integer>();
|
Botany.insulatedTube = new ItemInsulatedTube();
|
||||||
ModuleGardening.queuedAlkalineFertilisers = new HashMap<ItemStack, Integer>();
|
Botany.trowelWood = new ItemTrowel(Item.ToolMaterial.WOOD, "Wood");
|
||||||
ModuleGardening.queuedNutrientFertilisers = new HashMap<ItemStack, Integer>();
|
Botany.trowelStone = new ItemTrowel(Item.ToolMaterial.STONE, "Stone");
|
||||||
}
|
Botany.trowelIron = new ItemTrowel(Item.ToolMaterial.IRON, "Iron");
|
||||||
|
Botany.trowelDiamond = new ItemTrowel(Item.ToolMaterial.EMERALD, "Diamond");
|
||||||
|
Botany.trowelGold = new ItemTrowel(Item.ToolMaterial.GOLD, "Gold");
|
||||||
|
Botany.misc = Binnie.Item.registerMiscItems(BotanyItems.values(), CreativeTabBotany.instance);
|
||||||
|
Botany.pigment = new ItemPigment();
|
||||||
|
Botany.clay = new ItemClay();
|
||||||
|
|
||||||
|
Botany.ceramic = new BlockCeramic();
|
||||||
|
GameRegistry.registerBlock(Botany.ceramic, ItemMetadata.class, "ceramic");
|
||||||
|
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(Botany.ceramic), new ItemMetadataRenderer());
|
||||||
|
|
||||||
|
Botany.stained = new BlockStained();
|
||||||
|
GameRegistry.registerBlock(Botany.stained, ItemMetadata.class, "stained");
|
||||||
|
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(Botany.stained), new ItemMetadataRenderer());
|
||||||
|
|
||||||
|
Botany.ceramicTile = new BlockCeramicPatterned();
|
||||||
|
GameRegistry.registerBlock(Botany.ceramicTile, ItemMetadata.class, "ceramicPattern");
|
||||||
|
BinnieCore.proxy.registerCustomItemRenderer(
|
||||||
|
Item.getItemFromBlock(Botany.ceramicTile), new MultipassItemRenderer());
|
||||||
|
|
||||||
|
Botany.ceramicBrick = new BlockCeramicBrick();
|
||||||
|
GameRegistry.registerBlock(Botany.ceramicBrick, ItemMetadata.class, "ceramicBrick");
|
||||||
|
BinnieCore.proxy.registerCustomItemRenderer(
|
||||||
|
Item.getItemFromBlock(Botany.ceramicBrick), new MultipassItemRenderer());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() {
|
||||||
|
OreDictionary.registerOre("pigment", Botany.pigment);
|
||||||
|
RecipeSorter.register("botany:ceramictile", CeramicTileRecipe.class, RecipeSorter.Category.SHAPED, "");
|
||||||
|
RecipeSorter.register("botany:pigment", PigmentRecipe.class, RecipeSorter.Category.SHAPED, "");
|
||||||
|
ItemStack yellow = new ItemStack(Blocks.yellow_flower, 1);
|
||||||
|
ItemStack red = new ItemStack(Blocks.red_flower, 1);
|
||||||
|
ItemStack blue = new ItemStack(Blocks.red_flower, 1, 7);
|
||||||
|
|
||||||
|
for (boolean manual : new boolean[] {true, false}) {
|
||||||
|
for (boolean fertilised : new boolean[] {true, false}) {
|
||||||
|
for (EnumMoisture moist : EnumMoisture.values()) {
|
||||||
|
ItemStack icon =
|
||||||
|
(moist == EnumMoisture.DRY) ? yellow : ((moist == EnumMoisture.NORMAL) ? red : blue);
|
||||||
|
int insulate = 2 - moist.ordinal();
|
||||||
|
if (fertilised) {
|
||||||
|
insulate += 3;
|
||||||
|
}
|
||||||
|
new CircuitGarden(
|
||||||
|
moist,
|
||||||
|
null,
|
||||||
|
manual,
|
||||||
|
fertilised,
|
||||||
|
new ItemStack(Botany.insulatedTube, 1, 128 * insulate),
|
||||||
|
icon);
|
||||||
|
new CircuitGarden(
|
||||||
|
moist,
|
||||||
|
EnumAcidity.ACID,
|
||||||
|
manual,
|
||||||
|
fertilised,
|
||||||
|
new ItemStack(Botany.insulatedTube, 1, 1 + 128 * insulate),
|
||||||
|
icon);
|
||||||
|
new CircuitGarden(
|
||||||
|
moist,
|
||||||
|
EnumAcidity.NEUTRAL,
|
||||||
|
manual,
|
||||||
|
fertilised,
|
||||||
|
new ItemStack(Botany.insulatedTube, 1, 2 + 128 * insulate),
|
||||||
|
icon);
|
||||||
|
new CircuitGarden(
|
||||||
|
moist,
|
||||||
|
EnumAcidity.ALKALINE,
|
||||||
|
manual,
|
||||||
|
fertilised,
|
||||||
|
new ItemStack(Botany.insulatedTube, 1, 3 + 128 * insulate),
|
||||||
|
icon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void postInit() {
|
||||||
|
GameRegistry.addRecipe(new CeramicTileRecipe());
|
||||||
|
for (int mat = 0; mat < 4; ++mat) {
|
||||||
|
for (int insulate = 0; insulate < 6; ++insulate) {
|
||||||
|
ItemStack tubes = new ItemStack(Botany.insulatedTube, 2, mat + 128 * insulate);
|
||||||
|
ItemStack insulateStack = ItemInsulatedTube.getInsulateStack(tubes);
|
||||||
|
ItemStack forestryTube = new ItemStack(Mods.forestry.item("thermionicTubes"), 1, mat);
|
||||||
|
GameRegistry.addShapelessRecipe(tubes, forestryTube, forestryTube, insulateStack);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GameRegistry.addShapelessRecipe(
|
||||||
|
new ItemStack(Blocks.dirt), new ItemStack(Botany.soil, 1, OreDictionary.WILDCARD_VALUE));
|
||||||
|
GameRegistry.addShapelessRecipe(
|
||||||
|
new ItemStack(Blocks.dirt), new ItemStack(Botany.loam, 1, OreDictionary.WILDCARD_VALUE));
|
||||||
|
GameRegistry.addShapelessRecipe(
|
||||||
|
new ItemStack(Blocks.dirt), new ItemStack(Botany.flowerbed, 1, OreDictionary.WILDCARD_VALUE));
|
||||||
|
GameRegistry.addShapelessRecipe(
|
||||||
|
new ItemStack(Blocks.dirt), new ItemStack(Botany.soilNoWeed, 1, OreDictionary.WILDCARD_VALUE));
|
||||||
|
GameRegistry.addShapelessRecipe(
|
||||||
|
new ItemStack(Blocks.dirt), new ItemStack(Botany.loamNoWeed, 1, OreDictionary.WILDCARD_VALUE));
|
||||||
|
GameRegistry.addShapelessRecipe(
|
||||||
|
new ItemStack(Blocks.dirt), new ItemStack(Botany.flowerbedNoWeed, 1, OreDictionary.WILDCARD_VALUE));
|
||||||
|
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||||
|
Botany.trowelWood,
|
||||||
|
new Object[] {"d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "plankWood"}));
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||||
|
Botany.trowelStone,
|
||||||
|
new Object[] {"d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "cobblestone"}));
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||||
|
Botany.trowelIron,
|
||||||
|
new Object[] {"d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "ingotIron"}));
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||||
|
Botany.trowelGold,
|
||||||
|
new Object[] {"d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "ingotGold"}));
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||||
|
Botany.trowelDiamond,
|
||||||
|
new Object[] {"d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "gemDiamond"}));
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||||
|
Botany.soilMeter,
|
||||||
|
new Object[] {" gg", " rg", "i ", 'g', "ingotGold", 'r', "dustRedstone", 'i', "ingotIron"}));
|
||||||
|
GameRegistry.addShapelessRecipe(
|
||||||
|
BotanyItems.Weedkiller.get(4),
|
||||||
|
new ItemStack(Items.spider_eye),
|
||||||
|
new ItemStack(Items.wheat_seeds),
|
||||||
|
new ItemStack(Items.wheat_seeds),
|
||||||
|
new ItemStack(Items.wheat_seeds));
|
||||||
|
|
||||||
|
GameRegistry.addShapelessRecipe(BotanyItems.AshPowder.get(4), Mods.forestry.stack("ash"));
|
||||||
|
GameRegistry.addShapelessRecipe(BotanyItems.MulchPowder.get(4), Mods.forestry.stack("mulch"));
|
||||||
|
GameRegistry.addShapelessRecipe(BotanyItems.CompostPowder.get(4), Mods.forestry.stack("fertilizerBio"));
|
||||||
|
GameRegistry.addShapelessRecipe(BotanyItems.FertiliserPowder.get(4), Mods.forestry.stack("fertilizerCompound"));
|
||||||
|
GameRegistry.addShapelessRecipe(BotanyItems.PulpPowder.get(4), Mods.forestry.stack("woodPulp"));
|
||||||
|
GameRegistry.addRecipe(new ShapelessOreRecipe(BotanyItems.SulphurPowder.get(4), new Object[] {"dustSulphur"}));
|
||||||
|
|
||||||
|
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
||||||
|
new ItemStack(Botany.pigment, 2, EnumFlowerColor.BLACK.ordinal()),
|
||||||
|
new Object[] {"pigment", "pigment", "dyeBlack"}));
|
||||||
|
|
||||||
|
ModuleGardening.queuedAcidFertilisers.put(BotanyItems.SulphurPowder.get(1), 1);
|
||||||
|
ModuleGardening.queuedAcidFertilisers.put(BotanyItems.MulchPowder.get(1), 1);
|
||||||
|
ModuleGardening.queuedAcidFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "mulch")), 2);
|
||||||
|
|
||||||
|
for (ItemStack stack : OreDictionary.getOres("dustSulfur")) {
|
||||||
|
ModuleGardening.queuedAcidFertilisers.put(stack, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
ModuleGardening.queuedAlkalineFertilisers.put(BotanyItems.AshPowder.get(1), 1);
|
||||||
|
ModuleGardening.queuedAlkalineFertilisers.put(BotanyItems.PulpPowder.get(1), 1);
|
||||||
|
ModuleGardening.queuedAlkalineFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "ash")), 2);
|
||||||
|
ModuleGardening.queuedAlkalineFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "woodPulp")), 2);
|
||||||
|
ModuleGardening.queuedNutrientFertilisers.put(BotanyItems.CompostPowder.get(1), 1);
|
||||||
|
ModuleGardening.queuedNutrientFertilisers.put(BotanyItems.FertiliserPowder.get(1), 1);
|
||||||
|
ModuleGardening.queuedNutrientFertilisers.put(
|
||||||
|
new ItemStack(GameRegistry.findItem("Forestry", "fertilizerBio")), 2);
|
||||||
|
ModuleGardening.queuedNutrientFertilisers.put(
|
||||||
|
new ItemStack(GameRegistry.findItem("Forestry", "fertilizerCompound")), 2);
|
||||||
|
|
||||||
|
for (Map.Entry<ItemStack, Integer> entry : ModuleGardening.queuedAcidFertilisers.entrySet()) {
|
||||||
|
addAcidFertiliser(entry.getKey(), entry.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Map.Entry<ItemStack, Integer> entry : ModuleGardening.queuedAlkalineFertilisers.entrySet()) {
|
||||||
|
addAlkalineFertiliser(entry.getKey(), entry.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Map.Entry<ItemStack, Integer> entry : ModuleGardening.queuedNutrientFertilisers.entrySet()) {
|
||||||
|
addNutrientFertiliser(entry.getKey(), entry.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
GameRegistry.addRecipe(
|
||||||
|
BotanyItems.Mortar.get(6), " c ", "cgc", " c ", 'c', Items.clay_ball, 'g', Blocks.gravel);
|
||||||
|
|
||||||
|
for (EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||||
|
ItemStack clay = new ItemStack(Botany.clay, 1, c.ordinal());
|
||||||
|
ItemStack pigment = new ItemStack(Botany.pigment, 1, c.ordinal());
|
||||||
|
GameRegistry.addShapelessRecipe(clay, Items.clay_ball, Items.clay_ball, Items.clay_ball, pigment);
|
||||||
|
GameRegistry.addSmelting(clay, TileEntityMetadata.getItemStack(Botany.ceramic, c.ordinal()), 0.0f);
|
||||||
|
ItemStack glass = TileEntityMetadata.getItemStack(Botany.stained, c.ordinal());
|
||||||
|
glass.stackSize = 4;
|
||||||
|
GameRegistry.addShapedRecipe(glass, " g ", "gpg", " g ", 'g', Blocks.glass, 'p', pigment);
|
||||||
|
}
|
||||||
|
|
||||||
|
GameRegistry.addRecipe(new PigmentRecipe());
|
||||||
|
}
|
||||||
|
|
||||||
|
private ItemStack getStack(int type, int pH, int moisture) {
|
||||||
|
if (type < 0 || type > 2 || pH < 0 || pH > 2 || moisture < 0 || moisture > 2) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new ItemStack(
|
||||||
|
Gardening.getSoilBlock(EnumSoilType.values()[type]),
|
||||||
|
1,
|
||||||
|
BlockSoil.getMeta(EnumAcidity.values()[pH], EnumMoisture.values()[moisture]));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addAcidFertiliser(ItemStack stack, int strengthMax) {
|
||||||
|
if (stack == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Gardening.fertiliserAcid.put(stack, strengthMax);
|
||||||
|
for (int moisture = 0; moisture < 3; ++moisture) {
|
||||||
|
for (int pH = 0; pH < 3; ++pH) {
|
||||||
|
for (int type = 0; type < 3; ++type) {
|
||||||
|
int numOfBlocks = strengthMax * strengthMax;
|
||||||
|
for (int strength = 1; strength < strengthMax; ++strength) {
|
||||||
|
ItemStack start = getStack(type, pH, moisture);
|
||||||
|
ItemStack end = getStack(type, pH - strength, moisture);
|
||||||
|
if (end != null) {
|
||||||
|
end.stackSize = numOfBlocks;
|
||||||
|
Object[] stacks = new Object[numOfBlocks + 1];
|
||||||
|
for (int i = 0; i < numOfBlocks; ++i) {
|
||||||
|
stacks[i] = start;
|
||||||
|
}
|
||||||
|
stacks[numOfBlocks] = stack.copy();
|
||||||
|
GameRegistry.addShapelessRecipe(end, stacks);
|
||||||
|
}
|
||||||
|
numOfBlocks /= 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addAlkalineFertiliser(ItemStack stack, int strengthMax) {
|
||||||
|
if (stack == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Gardening.fertiliserAlkaline.put(stack, strengthMax);
|
||||||
|
for (int moisture = 0; moisture < 3; ++moisture) {
|
||||||
|
for (int pH = 0; pH < 3; ++pH) {
|
||||||
|
for (int type = 0; type < 3; ++type) {
|
||||||
|
int numOfBlocks = strengthMax * strengthMax;
|
||||||
|
for (int strength = 1; strength < strengthMax; ++strength) {
|
||||||
|
ItemStack start = getStack(type, pH, moisture);
|
||||||
|
ItemStack end = getStack(type, pH + strength, moisture);
|
||||||
|
if (end != null) {
|
||||||
|
end.stackSize = numOfBlocks;
|
||||||
|
Object[] stacks = new Object[numOfBlocks + 1];
|
||||||
|
for (int i = 0; i < numOfBlocks; ++i) {
|
||||||
|
stacks[i] = start;
|
||||||
|
}
|
||||||
|
stacks[numOfBlocks] = stack.copy();
|
||||||
|
GameRegistry.addShapelessRecipe(end, stacks);
|
||||||
|
}
|
||||||
|
numOfBlocks /= 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addNutrientFertiliser(ItemStack stack, int strengthMax) {
|
||||||
|
if (stack == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Gardening.fertiliserNutrient.put(stack, strengthMax);
|
||||||
|
for (int moisture = 0; moisture < 3; ++moisture) {
|
||||||
|
for (int pH = 0; pH < 3; ++pH) {
|
||||||
|
for (int type = 0; type < 3; ++type) {
|
||||||
|
int numOfBlocks = strengthMax * strengthMax;
|
||||||
|
for (int strength = 1; strength < strengthMax; ++strength) {
|
||||||
|
ItemStack start = getStack(type, pH, moisture);
|
||||||
|
ItemStack end = getStack(type + strength, pH, moisture);
|
||||||
|
if (end != null) {
|
||||||
|
end.stackSize = numOfBlocks;
|
||||||
|
Object[] stacks = new Object[numOfBlocks + 1];
|
||||||
|
for (int i = 0; i < numOfBlocks; ++i) {
|
||||||
|
stacks[i] = start;
|
||||||
|
}
|
||||||
|
stacks[numOfBlocks] = stack.copy();
|
||||||
|
GameRegistry.addShapelessRecipe(end, stacks);
|
||||||
|
}
|
||||||
|
numOfBlocks /= 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,52 +1,45 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.genetics;
|
package binnie.botany.genetics;
|
||||||
|
|
||||||
import forestry.api.genetics.IAlleleInteger;
|
import forestry.api.genetics.IAlleleInteger;
|
||||||
|
|
||||||
public class AlleleColor implements IAlleleInteger
|
public class AlleleColor implements IAlleleInteger {
|
||||||
{
|
private String uid;
|
||||||
String uid;
|
private int value;
|
||||||
boolean dominant;
|
private EnumFlowerColor color;
|
||||||
String name;
|
private boolean dominant = true;
|
||||||
int value;
|
|
||||||
EnumFlowerColor color;
|
|
||||||
|
|
||||||
public AlleleColor(final EnumFlowerColor color, final String uid, final String name, final int value) {
|
public AlleleColor(EnumFlowerColor color, String uid, int value) {
|
||||||
this.color = color;
|
this.color = color;
|
||||||
this.uid = uid;
|
this.uid = uid;
|
||||||
this.name = name;
|
this.value = value;
|
||||||
this.value = value;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUID() {
|
public String getUID() {
|
||||||
return this.uid;
|
return uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isDominant() {
|
public boolean isDominant() {
|
||||||
return true;
|
return dominant;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return this.color.getName();
|
return color.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getValue() {
|
public int getValue() {
|
||||||
return this.value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public EnumFlowerColor getColor() {
|
public EnumFlowerColor getColor() {
|
||||||
return this.color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName() {
|
public String getUnlocalizedName() {
|
||||||
return this.getUID();
|
return getUID();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,48 +1,44 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.genetics;
|
package binnie.botany.genetics;
|
||||||
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import binnie.botany.api.IFlowerGenome;
|
|
||||||
import forestry.api.genetics.IEffectData;
|
|
||||||
import binnie.botany.api.IAlleleFlowerEffect;
|
import binnie.botany.api.IAlleleFlowerEffect;
|
||||||
|
import binnie.botany.api.IFlowerGenome;
|
||||||
|
import binnie.core.util.I18N;
|
||||||
|
import forestry.api.genetics.IEffectData;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class AlleleEffectNone implements IAlleleFlowerEffect
|
public class AlleleEffectNone implements IAlleleFlowerEffect {
|
||||||
{
|
@Override
|
||||||
@Override
|
public boolean isCombinable() {
|
||||||
public boolean isCombinable() {
|
return true;
|
||||||
return true;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IEffectData validateStorage(final IEffectData storedData) {
|
public IEffectData validateStorage(IEffectData storedData) {
|
||||||
return storedData;
|
return storedData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUID() {
|
public String getUID() {
|
||||||
return "binnie.flowerEffectNone";
|
return "binnie.flowerEffectNone";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isDominant() {
|
public boolean isDominant() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "None";
|
return I18N.localise("forestry.allele.effect.none");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IEffectData doEffect(final IFlowerGenome genome, final IEffectData storedData, final World world, final int x, final int y, final int z) {
|
public IEffectData doEffect(IFlowerGenome genome, IEffectData storedData, World world, int x, int y, int z) {
|
||||||
return storedData;
|
return storedData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName() {
|
public String getUnlocalizedName() {
|
||||||
return this.getUID();
|
return getUID();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,35 +1,29 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.genetics;
|
package binnie.botany.genetics;
|
||||||
|
|
||||||
import binnie.Binnie;
|
import binnie.Binnie;
|
||||||
import forestry.api.genetics.IBreedingTracker;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import forestry.api.genetics.IIndividual;
|
|
||||||
|
|
||||||
import binnie.botany.api.IBotanistTracker;
|
import binnie.botany.api.IBotanistTracker;
|
||||||
|
import forestry.api.genetics.IBreedingTracker;
|
||||||
|
import forestry.api.genetics.IIndividual;
|
||||||
import forestry.core.genetics.BreedingTracker;
|
import forestry.core.genetics.BreedingTracker;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
|
||||||
public class BotanistTracker extends BreedingTracker implements IBotanistTracker
|
public class BotanistTracker extends BreedingTracker implements IBotanistTracker {
|
||||||
{
|
public BotanistTracker(String s) {
|
||||||
public BotanistTracker(final String s) {
|
super(s);
|
||||||
super(s);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerPickup(final IIndividual individual) {
|
public void registerPickup(IIndividual individual) {
|
||||||
}
|
// ignored
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected IBreedingTracker getBreedingTracker(final EntityPlayer player) {
|
protected IBreedingTracker getBreedingTracker(EntityPlayer player) {
|
||||||
return Binnie.Genetics.getFlowerRoot().getBreedingTracker(player.worldObj, player.getGameProfile());
|
return Binnie.Genetics.getFlowerRoot().getBreedingTracker(player.worldObj, player.getGameProfile());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String speciesRootUID() {
|
protected String speciesRootUID() {
|
||||||
return "rootFlowers";
|
return "rootFlowers";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package binnie.botany.genetics;
|
||||||
|
|
||||||
|
import binnie.botany.api.IColourMix;
|
||||||
|
import binnie.botany.api.IFlowerColor;
|
||||||
|
|
||||||
|
public class ColorMix implements IColourMix {
|
||||||
|
protected IFlowerColor color1;
|
||||||
|
protected IFlowerColor color2;
|
||||||
|
protected IFlowerColor result;
|
||||||
|
protected int chance;
|
||||||
|
|
||||||
|
public ColorMix(IFlowerColor color1, IFlowerColor color2, IFlowerColor result, int chance) {
|
||||||
|
this.color1 = color1;
|
||||||
|
this.color2 = color2;
|
||||||
|
this.result = result;
|
||||||
|
this.chance = chance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IFlowerColor getColor1() {
|
||||||
|
return color1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IFlowerColor getColor2() {
|
||||||
|
return color2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isMutation(IFlowerColor color1, IFlowerColor color2) {
|
||||||
|
return (color1 == this.color1 && color2 == this.color2) || (color1 == this.color2 && color2 == this.color1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getChance() {
|
||||||
|
return chance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IFlowerColor getResult() {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.genetics;
|
|
||||||
|
|
||||||
import binnie.botany.api.IFlowerColour;
|
|
||||||
import binnie.botany.api.IColourMix;
|
|
||||||
|
|
||||||
public class ColourMix implements IColourMix
|
|
||||||
{
|
|
||||||
IFlowerColour colour1;
|
|
||||||
IFlowerColour colour2;
|
|
||||||
IFlowerColour result;
|
|
||||||
int chance;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IFlowerColour getColour1() {
|
|
||||||
return this.colour1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IFlowerColour getColour2() {
|
|
||||||
return this.colour2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isMutation(final IFlowerColour a, final IFlowerColour b) {
|
|
||||||
return (a == this.colour1 && b == this.colour2) || (a == this.colour2 && b == this.colour1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getChance() {
|
|
||||||
return this.chance;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IFlowerColour getResult() {
|
|
||||||
return this.result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ColourMix(final IFlowerColour colour1, final IFlowerColour colour2, final IFlowerColour result, final int chance) {
|
|
||||||
this.colour1 = colour1;
|
|
||||||
this.colour2 = colour2;
|
|
||||||
this.result = result;
|
|
||||||
this.chance = chance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1,135 +1,152 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.genetics;
|
package binnie.botany.genetics;
|
||||||
|
|
||||||
import binnie.botany.Botany;
|
import binnie.botany.Botany;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
||||||
import binnie.botany.api.EnumFlowerStage;
|
import binnie.botany.api.EnumFlowerStage;
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
import binnie.botany.api.IFlowerType;
|
import binnie.botany.api.IFlowerType;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
public enum EnumFlowerType implements IFlowerType
|
public enum EnumFlowerType implements IFlowerType {
|
||||||
{
|
DANDELION,
|
||||||
Dandelion,
|
POPPY,
|
||||||
Poppy,
|
ORCHID,
|
||||||
Orchid,
|
ALLIUM,
|
||||||
Allium,
|
BLUET,
|
||||||
Bluet,
|
TULIP,
|
||||||
Tulip,
|
DAISY,
|
||||||
Daisy,
|
CORNFLOWER,
|
||||||
Cornflower,
|
PANSY,
|
||||||
Pansy,
|
IRIS,
|
||||||
Iris,
|
LAVENDER(2),
|
||||||
Lavender(2),
|
VIOLA,
|
||||||
Viola,
|
DAFFODIL,
|
||||||
Daffodil,
|
DAHLIA,
|
||||||
Dahlia,
|
PEONY(2),
|
||||||
Peony(2),
|
ROSE(2),
|
||||||
Rose(2),
|
LILAC(2),
|
||||||
Lilac(2),
|
HYDRANGEA(2),
|
||||||
Hydrangea(2),
|
FOXGLOVE(2),
|
||||||
Foxglove(2),
|
ZINNIA,
|
||||||
Zinnia,
|
MUMS,
|
||||||
Mums,
|
MARIGOLD,
|
||||||
Marigold,
|
GERANIUM,
|
||||||
Geranium,
|
AZALEA,
|
||||||
Azalea,
|
PRIMROSE,
|
||||||
Primrose,
|
ASTER,
|
||||||
Aster,
|
CARNATION,
|
||||||
Carnation,
|
LILY,
|
||||||
Lily,
|
YARROW,
|
||||||
Yarrow,
|
PETUNIA,
|
||||||
Petunia,
|
AGAPANTHUS,
|
||||||
Agapanthus,
|
FUCHSIA,
|
||||||
Fuchsia,
|
DIANTHUS,
|
||||||
Dianthus,
|
FORGET,
|
||||||
Forget,
|
ANEMONE,
|
||||||
Anemone,
|
AQUILEGIA,
|
||||||
Aquilegia,
|
EDELWEISS,
|
||||||
Edelweiss,
|
SCABIOUS,
|
||||||
Scabious,
|
CONEFLOWER,
|
||||||
Coneflower,
|
GAILLARDIA,
|
||||||
Gaillardia,
|
AURICULA,
|
||||||
Auricula,
|
CAMELLIA(2),
|
||||||
Camellia(2),
|
GOLDENROD(2),
|
||||||
Goldenrod(2),
|
ALTHEA(2),
|
||||||
Althea(2),
|
PENSTEMON(2),
|
||||||
Penstemon(2),
|
DELPHINIUM(2),
|
||||||
Delphinium(2),
|
HOLLYHOCK(2);
|
||||||
Hollyhock(2);
|
|
||||||
|
|
||||||
int sections;
|
protected int sections;
|
||||||
IIcon[] stem;
|
protected IIcon[] stem;
|
||||||
IIcon[] petal;
|
protected IIcon[] petal;
|
||||||
IIcon[] variant;
|
protected IIcon[] variant;
|
||||||
IIcon[] unflowered;
|
protected IIcon[] unflowered;
|
||||||
IIcon seedStem;
|
protected IIcon seedStem;
|
||||||
IIcon seedPetal;
|
protected IIcon seedPetal;
|
||||||
IIcon seedVariant;
|
protected IIcon seedVariant;
|
||||||
IIcon pollenStem;
|
protected IIcon pollenStem;
|
||||||
IIcon pollenPetal;
|
protected IIcon pollenPetal;
|
||||||
IIcon pollenVariant;
|
protected IIcon pollenVariant;
|
||||||
IIcon blank;
|
protected IIcon blank;
|
||||||
|
|
||||||
private EnumFlowerType() {
|
EnumFlowerType() {
|
||||||
this(1);
|
this(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private EnumFlowerType(final int sections) {
|
EnumFlowerType(int sections) {
|
||||||
this.sections = 1;
|
this.sections = sections;
|
||||||
this.sections = sections;
|
stem = new IIcon[sections];
|
||||||
this.stem = new IIcon[sections];
|
petal = new IIcon[sections];
|
||||||
this.petal = new IIcon[sections];
|
variant = new IIcon[sections];
|
||||||
this.variant = new IIcon[sections];
|
unflowered = new IIcon[sections];
|
||||||
this.unflowered = new IIcon[sections];
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getStem(final EnumFlowerStage stage, final boolean flowered, final int section) {
|
public IIcon getStem(EnumFlowerStage stage, boolean flowered, int section) {
|
||||||
return (stage == EnumFlowerStage.SEED) ? this.seedStem : ((stage == EnumFlowerStage.POLLEN) ? this.pollenStem : this.stem[section % this.sections]);
|
if (stage == EnumFlowerStage.SEED) {
|
||||||
}
|
return seedStem;
|
||||||
|
}
|
||||||
|
if (stage == EnumFlowerStage.POLLEN) {
|
||||||
|
return pollenStem;
|
||||||
|
}
|
||||||
|
return stem[section % sections];
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getPetalIcon(final EnumFlowerStage stage, final boolean flowered, final int section) {
|
public IIcon getPetalIcon(EnumFlowerStage stage, boolean flowered, int section) {
|
||||||
return (stage == EnumFlowerStage.SEED) ? this.seedPetal : ((stage == EnumFlowerStage.POLLEN) ? this.pollenPetal : (flowered ? this.petal[section % this.sections] : this.unflowered[section % this.sections]));
|
if (stage == EnumFlowerStage.SEED) {
|
||||||
}
|
return seedPetal;
|
||||||
|
}
|
||||||
|
if (stage == EnumFlowerStage.POLLEN) {
|
||||||
|
return pollenPetal;
|
||||||
|
}
|
||||||
|
if (flowered) {
|
||||||
|
return petal[section % sections];
|
||||||
|
}
|
||||||
|
return unflowered[section % sections];
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getVariantIcon(final EnumFlowerStage stage, final boolean flowered, final int section) {
|
public IIcon getVariantIcon(EnumFlowerStage stage, boolean flowered, int section) {
|
||||||
return (stage == EnumFlowerStage.SEED) ? this.seedVariant : ((stage == EnumFlowerStage.POLLEN) ? this.pollenVariant : (flowered ? this.variant[section % this.sections] : this.blank));
|
if (stage == EnumFlowerStage.SEED) {
|
||||||
}
|
return seedVariant;
|
||||||
|
}
|
||||||
|
if (stage == EnumFlowerStage.POLLEN) {
|
||||||
|
return pollenVariant;
|
||||||
|
}
|
||||||
|
return flowered ? variant[section % sections] : blank;
|
||||||
|
}
|
||||||
|
|
||||||
public void registerIcons(final IIconRegister register) {
|
public void registerIcons(IIconRegister register) {
|
||||||
for (int i = 0; i < this.sections; ++i) {
|
for (int i = 0; i < sections; ++i) {
|
||||||
final String suf = (i == 0) ? "" : ("" + (i + 1));
|
String suf = (i == 0) ? "" : ("" + (i + 1));
|
||||||
final String pre = (this.sections == 1) ? "" : "double/";
|
String pre = (sections == 1) ? "" : "double/";
|
||||||
this.stem[i] = Botany.proxy.getIcon(register, "flowers/" + pre + this.toString().toLowerCase() + suf + ".0");
|
String id = pre + toString().toLowerCase() + suf;
|
||||||
this.petal[i] = Botany.proxy.getIcon(register, "flowers/" + pre + this.toString().toLowerCase() + suf + ".1");
|
stem[i] = Botany.proxy.getIcon(register, "flowers/" + id + ".0");
|
||||||
this.variant[i] = Botany.proxy.getIcon(register, "flowers/" + pre + this.toString().toLowerCase() + suf + ".2");
|
petal[i] = Botany.proxy.getIcon(register, "flowers/" + id + ".1");
|
||||||
this.unflowered[i] = Botany.proxy.getIcon(register, "flowers/" + pre + this.toString().toLowerCase() + suf + ".3");
|
variant[i] = Botany.proxy.getIcon(register, "flowers/" + id + ".2");
|
||||||
}
|
unflowered[i] = Botany.proxy.getIcon(register, "flowers/" + id + ".3");
|
||||||
this.blank = Botany.proxy.getIcon(register, "flowers/blank");
|
}
|
||||||
this.seedStem = Botany.proxy.getIcon(register, "flowers/seed.0");
|
|
||||||
this.seedPetal = Botany.proxy.getIcon(register, "flowers/seed.1");
|
|
||||||
this.seedVariant = Botany.proxy.getIcon(register, "flowers/seed.2");
|
|
||||||
this.pollenStem = Botany.proxy.getIcon(register, "flowers/pollen.0");
|
|
||||||
this.pollenPetal = Botany.proxy.getIcon(register, "flowers/pollen.1");
|
|
||||||
this.pollenVariant = Botany.proxy.getIcon(register, "flowers/pollen.2");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
blank = Botany.proxy.getIcon(register, "flowers/blank");
|
||||||
public int getID() {
|
seedStem = Botany.proxy.getIcon(register, "flowers/seed.0");
|
||||||
return this.ordinal();
|
seedPetal = Botany.proxy.getIcon(register, "flowers/seed.1");
|
||||||
}
|
seedVariant = Botany.proxy.getIcon(register, "flowers/seed.2");
|
||||||
|
pollenStem = Botany.proxy.getIcon(register, "flowers/pollen.0");
|
||||||
|
pollenPetal = Botany.proxy.getIcon(register, "flowers/pollen.1");
|
||||||
|
pollenVariant = Botany.proxy.getIcon(register, "flowers/pollen.2");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSections() {
|
public int getID() {
|
||||||
return this.sections;
|
return ordinal();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IIcon getBlank() {
|
@Override
|
||||||
return this.blank;
|
public int getSections() {
|
||||||
}
|
return sections;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IIcon getBlank() {
|
||||||
|
return blank;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,290 +1,279 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.genetics;
|
package binnie.botany.genetics;
|
||||||
|
|
||||||
import binnie.botany.api.IFlowerColour;
|
|
||||||
import forestry.api.genetics.IGenome;
|
|
||||||
import binnie.botany.api.IFlowerMutation;
|
|
||||||
import binnie.botany.api.IColourMix;
|
|
||||||
import forestry.api.arboriculture.EnumTreeChromosome;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import forestry.api.genetics.IAllele;
|
|
||||||
import forestry.core.genetics.Chromosome;
|
|
||||||
import forestry.api.genetics.IChromosome;
|
|
||||||
import java.util.Random;
|
|
||||||
import net.minecraft.nbt.NBTBase;
|
|
||||||
import binnie.botany.core.BotanyCore;
|
|
||||||
import forestry.api.genetics.IChromosomeType;
|
|
||||||
import binnie.botany.api.EnumFlowerChromosome;
|
import binnie.botany.api.EnumFlowerChromosome;
|
||||||
import java.util.List;
|
|
||||||
import binnie.botany.api.IAlleleFlowerSpecies;
|
import binnie.botany.api.IAlleleFlowerSpecies;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import binnie.botany.api.IColourMix;
|
||||||
import binnie.botany.api.IFlowerGenome;
|
|
||||||
import binnie.botany.api.IFlower;
|
import binnie.botany.api.IFlower;
|
||||||
|
import binnie.botany.api.IFlowerColor;
|
||||||
|
import binnie.botany.api.IFlowerGenome;
|
||||||
|
import binnie.botany.api.IFlowerMutation;
|
||||||
|
import binnie.botany.core.BotanyCore;
|
||||||
|
import binnie.core.util.I18N;
|
||||||
|
import binnie.genetics.genetics.AlleleHelper;
|
||||||
|
import forestry.api.arboriculture.EnumTreeChromosome;
|
||||||
|
import forestry.api.genetics.IAllele;
|
||||||
|
import forestry.api.genetics.IChromosome;
|
||||||
|
import forestry.core.genetics.Chromosome;
|
||||||
import forestry.core.genetics.Individual;
|
import forestry.core.genetics.Individual;
|
||||||
|
import java.util.List;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class Flower extends Individual implements IFlower
|
public class Flower extends Individual implements IFlower {
|
||||||
{
|
public IFlowerGenome genome;
|
||||||
public IFlowerGenome genome;
|
public IFlowerGenome mate;
|
||||||
public IFlowerGenome mate;
|
|
||||||
int age;
|
|
||||||
boolean wilting;
|
|
||||||
boolean flowered;
|
|
||||||
|
|
||||||
public Flower(final NBTTagCompound nbttagcompound) {
|
protected int age;
|
||||||
this.age = 0;
|
protected boolean wilting;
|
||||||
this.wilting = false;
|
protected boolean flowered;
|
||||||
this.readFromNBT(nbttagcompound);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Flower(final IFlowerGenome genome, final int age) {
|
public Flower(NBTTagCompound nbttagcompound) {
|
||||||
this.age = 0;
|
age = 0;
|
||||||
this.wilting = false;
|
wilting = false;
|
||||||
this.genome = genome;
|
readFromNBT(nbttagcompound);
|
||||||
this.age = age;
|
}
|
||||||
if (age > 0) {
|
|
||||||
this.flowered = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.flowered = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public Flower(IFlowerGenome genome, int age) {
|
||||||
public String getDisplayName() {
|
this.genome = genome;
|
||||||
final IAlleleFlowerSpecies species = this.getGenome().getPrimary();
|
this.age = age;
|
||||||
String name = "";
|
wilting = false;
|
||||||
if (species != null) {
|
flowered = age > 0;
|
||||||
name += species.getName();
|
}
|
||||||
}
|
|
||||||
if (this.age == 0) {
|
|
||||||
name += "";
|
|
||||||
}
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addTooltip(final List<String> list) {
|
public String getDisplayName() {
|
||||||
final IAlleleFlowerSpecies primary = this.genome.getPrimary();
|
IAlleleFlowerSpecies species = getGenome().getPrimary();
|
||||||
final IAlleleFlowerSpecies secondary = this.genome.getSecondary();
|
String name = "";
|
||||||
if (!this.isPureBred(EnumFlowerChromosome.SPECIES)) {
|
if (species != null) {
|
||||||
list.add("§9" + primary.getName() + "-" + secondary.getName() + " Hybrid");
|
name += species.getName();
|
||||||
}
|
}
|
||||||
list.add("§6Age: " + this.getAge());
|
return name;
|
||||||
list.add("§6T: " + this.getGenome().getPrimary().getTemperature() + " / " + this.getGenome().getToleranceTemperature());
|
}
|
||||||
list.add("§6M: " + this.getGenome().getPrimary().getMoisture() + " / " + this.getGenome().getToleranceMoisture());
|
|
||||||
list.add("§6pH: " + this.getGenome().getPrimary().getHumidity() + " / " + this.getGenome().getTolerancePH());
|
|
||||||
list.add("§6Fert: " + this.getGenome().getFertility() + "x");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getIdent() {
|
public void addTooltip(List<String> list) {
|
||||||
return this.getGenome().getPrimary().getUID();
|
IAlleleFlowerSpecies primary = genome.getPrimary();
|
||||||
}
|
IAlleleFlowerSpecies secondary = genome.getSecondary();
|
||||||
|
if (!isPureBred(EnumFlowerChromosome.SPECIES)) {
|
||||||
|
list.add(EnumChatFormatting.BLUE
|
||||||
|
+ I18N.localise("botany.item.tooltip.hybrid", primary.getName(), secondary.getName()));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
list.add(EnumChatFormatting.GRAY + I18N.localise("botany.item.tooltip.age", getAge()));
|
||||||
public void readFromNBT(final NBTTagCompound nbttagcompound) {
|
list.add(EnumChatFormatting.GREEN
|
||||||
super.readFromNBT(nbttagcompound);
|
+ I18N.localise(
|
||||||
if (nbttagcompound == null) {
|
"botany.item.tooltip.temperature",
|
||||||
this.genome = BotanyCore.getFlowerRoot().templateAsGenome(BotanyCore.getFlowerRoot().getDefaultTemplate());
|
AlleleHelper.toDisplay(primary.getTemperature()),
|
||||||
return;
|
AlleleHelper.toDisplay(genome.getToleranceTemperature())));
|
||||||
}
|
list.add(EnumChatFormatting.GREEN
|
||||||
this.age = nbttagcompound.getInteger("Age");
|
+ I18N.localise(
|
||||||
this.wilting = nbttagcompound.getBoolean("Wilt");
|
"botany.item.tooltip.moisture",
|
||||||
this.flowered = nbttagcompound.getBoolean("Flowered");
|
AlleleHelper.toDisplay(primary.getMoisture()),
|
||||||
if (nbttagcompound.hasKey("Genome")) {
|
AlleleHelper.toDisplay(genome.getToleranceMoisture())));
|
||||||
this.genome = new FlowerGenome(nbttagcompound.getCompoundTag("Genome"));
|
list.add(EnumChatFormatting.GREEN
|
||||||
}
|
+ I18N.localise(
|
||||||
if (nbttagcompound.hasKey("Mate")) {
|
"botany.item.tooltip.pH",
|
||||||
this.mate = new FlowerGenome(nbttagcompound.getCompoundTag("Mate"));
|
AlleleHelper.toDisplay(primary.getHumidity()),
|
||||||
}
|
AlleleHelper.toDisplay(genome.getTolerancePH())));
|
||||||
}
|
list.add(EnumChatFormatting.GRAY + I18N.localise("botany.item.tooltip.fertility", genome.getFertility()));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeToNBT(final NBTTagCompound nbttagcompound) {
|
public String getIdent() {
|
||||||
super.writeToNBT(nbttagcompound);
|
return getGenome().getPrimary().getUID();
|
||||||
nbttagcompound.setInteger("Age", this.age);
|
}
|
||||||
nbttagcompound.setBoolean("Wilt", this.wilting);
|
|
||||||
nbttagcompound.setBoolean("Flowered", this.flowered);
|
|
||||||
if (this.genome != null) {
|
|
||||||
final NBTTagCompound NBTmachine = new NBTTagCompound();
|
|
||||||
this.genome.writeToNBT(NBTmachine);
|
|
||||||
nbttagcompound.setTag("Genome", NBTmachine);
|
|
||||||
}
|
|
||||||
if (this.mate != null) {
|
|
||||||
final NBTTagCompound NBTmachine = new NBTTagCompound();
|
|
||||||
this.mate.writeToNBT(NBTmachine);
|
|
||||||
nbttagcompound.setTag("Mate", NBTmachine);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMetadata() {
|
@Override
|
||||||
return 0;
|
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||||
}
|
super.readFromNBT(nbttagcompound);
|
||||||
|
if (nbttagcompound == null) {
|
||||||
|
genome = BotanyCore.getFlowerRoot()
|
||||||
|
.templateAsGenome(BotanyCore.getFlowerRoot().getDefaultTemplate());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
age = nbttagcompound.getInteger("Age");
|
||||||
public IFlowerGenome getGenome() {
|
wilting = nbttagcompound.getBoolean("Wilt");
|
||||||
return this.genome;
|
flowered = nbttagcompound.getBoolean("Flowered");
|
||||||
}
|
if (nbttagcompound.hasKey("Genome")) {
|
||||||
|
genome = new FlowerGenome(nbttagcompound.getCompoundTag("Genome"));
|
||||||
|
}
|
||||||
|
if (nbttagcompound.hasKey("Mate")) {
|
||||||
|
mate = new FlowerGenome(nbttagcompound.getCompoundTag("Mate"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private IChromosome inheritChromosome(final Random rand, final IChromosome parent1, final IChromosome parent2) {
|
@Override
|
||||||
IAllele choice1;
|
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||||
if (rand.nextBoolean()) {
|
super.writeToNBT(nbttagcompound);
|
||||||
choice1 = parent1.getPrimaryAllele();
|
nbttagcompound.setInteger("Age", age);
|
||||||
}
|
nbttagcompound.setBoolean("Wilt", wilting);
|
||||||
else {
|
nbttagcompound.setBoolean("Flowered", flowered);
|
||||||
choice1 = parent1.getSecondaryAllele();
|
|
||||||
}
|
|
||||||
IAllele choice2;
|
|
||||||
if (rand.nextBoolean()) {
|
|
||||||
choice2 = parent2.getPrimaryAllele();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
choice2 = parent2.getSecondaryAllele();
|
|
||||||
}
|
|
||||||
if (rand.nextBoolean()) {
|
|
||||||
return new Chromosome(choice1, choice2);
|
|
||||||
}
|
|
||||||
return new Chromosome(choice2, choice1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
if (genome != null) {
|
||||||
public void mate(final IFlower other) {
|
NBTTagCompound NBTmachine = new NBTTagCompound();
|
||||||
this.mate = new FlowerGenome(other.getGenome().getChromosomes());
|
genome.writeToNBT(NBTmachine);
|
||||||
}
|
nbttagcompound.setTag("Genome", NBTmachine);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
if (mate != null) {
|
||||||
public IFlowerGenome getMate() {
|
NBTTagCompound NBTmachine = new NBTTagCompound();
|
||||||
return this.mate;
|
mate.writeToNBT(NBTmachine);
|
||||||
}
|
nbttagcompound.setTag("Mate", NBTmachine);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
public int getMetadata() {
|
||||||
public IFlower copy() {
|
return 0;
|
||||||
final NBTTagCompound nbttagcompound = new NBTTagCompound();
|
}
|
||||||
this.writeToNBT(nbttagcompound);
|
|
||||||
return new Flower(nbttagcompound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAge() {
|
public IFlowerGenome getGenome() {
|
||||||
return this.age;
|
return genome;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void age() {
|
public void mate(IFlower other) {
|
||||||
if (this.age < 15) {
|
mate = new FlowerGenome(other.getGenome().getChromosomes());
|
||||||
++this.age;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setAge(final int i) {
|
public IFlowerGenome getMate() {
|
||||||
this.age = i;
|
return mate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxAge() {
|
public IFlower copy() {
|
||||||
return this.getGenome().getLifespan();
|
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||||
}
|
writeToNBT(nbttagcompound);
|
||||||
|
return new Flower(nbttagcompound);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isWilted() {
|
public int getAge() {
|
||||||
return this.wilting;
|
return age;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setWilted(final boolean wilted) {
|
public void setAge(int age) {
|
||||||
this.wilting = wilted;
|
this.age = age;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasFlowered() {
|
public void age() {
|
||||||
return this.flowered;
|
if (age < 15) {
|
||||||
}
|
age++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setFlowered(final boolean flowered) {
|
public int getMaxAge() {
|
||||||
this.flowered = flowered;
|
return getGenome().getLifespan();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeMate() {
|
public boolean isWilted() {
|
||||||
this.mate = null;
|
return wilting;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IFlower getOffspring(final World world) {
|
public void setWilted(boolean value) {
|
||||||
final IChromosome[] chromosomes = new IChromosome[this.genome.getChromosomes().length];
|
wilting = value;
|
||||||
IChromosome[] parent1 = this.genome.getChromosomes();
|
}
|
||||||
IChromosome[] parent2 = this.mate.getChromosomes();
|
|
||||||
parent1 = this.mutateSpecies(world, this.genome, this.mate);
|
|
||||||
parent2 = this.mutateSpecies(world, this.mate, this.genome);
|
|
||||||
for (int i = 0; i < parent1.length; ++i) {
|
|
||||||
if (parent1[i] != null && parent2[i] != null) {
|
|
||||||
chromosomes[i] = Chromosome.inheritChromosome(world.rand, parent1[i], parent2[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new Flower(new FlowerGenome(chromosomes), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
private IChromosome[] mutateSpecies(final World world, final IFlowerGenome genomeOne, final IFlowerGenome genomeTwo) {
|
@Override
|
||||||
IChromosome[] parent1 = genomeOne.getChromosomes();
|
public boolean hasFlowered() {
|
||||||
final IChromosome[] parent2 = genomeTwo.getChromosomes();
|
return flowered;
|
||||||
IAllele allele0;
|
}
|
||||||
IAllele allele2;
|
|
||||||
IFlowerGenome genome0;
|
@Override
|
||||||
IFlowerGenome genome2;
|
public void setFlowered(boolean value) {
|
||||||
if (world.rand.nextBoolean()) {
|
flowered = value;
|
||||||
allele0 = parent1[EnumTreeChromosome.SPECIES.ordinal()].getPrimaryAllele();
|
}
|
||||||
allele2 = parent2[EnumTreeChromosome.SPECIES.ordinal()].getSecondaryAllele();
|
|
||||||
genome0 = genomeOne;
|
@Override
|
||||||
genome2 = genomeTwo;
|
public void removeMate() {
|
||||||
}
|
mate = null;
|
||||||
else {
|
}
|
||||||
allele0 = parent2[EnumTreeChromosome.SPECIES.ordinal()].getPrimaryAllele();
|
|
||||||
allele2 = parent1[EnumTreeChromosome.SPECIES.ordinal()].getSecondaryAllele();
|
@Override
|
||||||
genome0 = genomeTwo;
|
public IFlower getOffspring(World world) {
|
||||||
genome2 = genomeOne;
|
IChromosome[] chromosomes = new IChromosome[genome.getChromosomes().length];
|
||||||
}
|
IChromosome[] parent1 = mutateSpecies(world, genome, mate);
|
||||||
IFlowerColour colour1 = genome0.getPrimaryColor();
|
IChromosome[] parent2 = mutateSpecies(world, mate, genome);
|
||||||
IFlowerColour colour2 = genome2.getPrimaryColor();
|
for (int i = 0; i < parent1.length; ++i) {
|
||||||
if (colour1 != colour2) {
|
if (parent1[i] != null && parent2[i] != null) {
|
||||||
for (final IColourMix mutation : BotanyCore.getFlowerRoot().getColourMixes(true)) {
|
chromosomes[i] = Chromosome.inheritChromosome(world.rand, parent1[i], parent2[i]);
|
||||||
if (mutation.isMutation(colour1, colour2) && world.rand.nextFloat() * 100.0f < mutation.getChance()) {
|
}
|
||||||
parent1[EnumFlowerChromosome.PRIMARY.ordinal()] = new Chromosome(mutation.getResult().getAllele());
|
}
|
||||||
}
|
return new Flower(new FlowerGenome(chromosomes), 0);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
colour1 = genome0.getSecondaryColor();
|
private IChromosome[] mutateSpecies(World world, IFlowerGenome genomeOne, IFlowerGenome genomeTwo) {
|
||||||
colour2 = genome2.getSecondaryColor();
|
IChromosome[] parent1 = genomeOne.getChromosomes();
|
||||||
if (colour1 != colour2) {
|
IChromosome[] parent2 = genomeTwo.getChromosomes();
|
||||||
for (final IColourMix mutation : BotanyCore.getFlowerRoot().getColourMixes(true)) {
|
IAllele allele0;
|
||||||
if (mutation.isMutation(colour1, colour2) && world.rand.nextFloat() * 100.0f < mutation.getChance()) {
|
IAllele allele2;
|
||||||
parent1[EnumFlowerChromosome.SECONDARY.ordinal()] = new Chromosome(mutation.getResult().getAllele());
|
IFlowerGenome genome0;
|
||||||
}
|
IFlowerGenome genome2;
|
||||||
}
|
|
||||||
}
|
if (world.rand.nextBoolean()) {
|
||||||
colour1 = genome0.getStemColor();
|
allele0 = parent1[EnumTreeChromosome.SPECIES.ordinal()].getPrimaryAllele();
|
||||||
colour2 = genome2.getStemColor();
|
allele2 = parent2[EnumTreeChromosome.SPECIES.ordinal()].getSecondaryAllele();
|
||||||
if (colour1 != colour2) {
|
genome0 = genomeOne;
|
||||||
for (final IColourMix mutation : BotanyCore.getFlowerRoot().getColourMixes(true)) {
|
genome2 = genomeTwo;
|
||||||
if (mutation.isMutation(colour1, colour2) && world.rand.nextFloat() * 100.0f < mutation.getChance()) {
|
} else {
|
||||||
parent1[EnumFlowerChromosome.STEM.ordinal()] = new Chromosome(mutation.getResult().getAllele());
|
allele0 = parent2[EnumTreeChromosome.SPECIES.ordinal()].getPrimaryAllele();
|
||||||
}
|
allele2 = parent1[EnumTreeChromosome.SPECIES.ordinal()].getSecondaryAllele();
|
||||||
}
|
genome0 = genomeTwo;
|
||||||
}
|
genome2 = genomeOne;
|
||||||
IChromosome[] template = null;
|
}
|
||||||
for (final IFlowerMutation mutation2 : BotanyCore.getFlowerRoot().getMutations(true)) {
|
|
||||||
final float chance = mutation2.getChance(allele0, allele2, genome0, genome2);
|
IFlowerColor colour1 = genome0.getPrimaryColor();
|
||||||
if (chance > 0.0f && world.rand.nextFloat() * 100.0f < chance && template == null) {
|
IFlowerColor colour2 = genome2.getPrimaryColor();
|
||||||
template = BotanyCore.getFlowerRoot().templateAsChromosomes(mutation2.getTemplate());
|
if (colour1 != colour2) {
|
||||||
}
|
for (IColourMix mutation : BotanyCore.getFlowerRoot().getColourMixes(true)) {
|
||||||
}
|
if (mutation.isMutation(colour1, colour2) && world.rand.nextFloat() * 100.0f < mutation.getChance()) {
|
||||||
if (template != null) {
|
parent1[EnumFlowerChromosome.PRIMARY.ordinal()] =
|
||||||
parent1 = template;
|
new Chromosome(mutation.getResult().getAllele());
|
||||||
}
|
}
|
||||||
return parent1;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
colour1 = genome0.getSecondaryColor();
|
||||||
|
colour2 = genome2.getSecondaryColor();
|
||||||
|
if (colour1 != colour2) {
|
||||||
|
for (IColourMix mutation : BotanyCore.getFlowerRoot().getColourMixes(true)) {
|
||||||
|
if (mutation.isMutation(colour1, colour2) && world.rand.nextFloat() * 100.0f < mutation.getChance()) {
|
||||||
|
parent1[EnumFlowerChromosome.SECONDARY.ordinal()] =
|
||||||
|
new Chromosome(mutation.getResult().getAllele());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
colour1 = genome0.getStemColor();
|
||||||
|
colour2 = genome2.getStemColor();
|
||||||
|
if (colour1 != colour2) {
|
||||||
|
for (IColourMix mutation : BotanyCore.getFlowerRoot().getColourMixes(true)) {
|
||||||
|
if (mutation.isMutation(colour1, colour2) && world.rand.nextFloat() * 100.0f < mutation.getChance()) {
|
||||||
|
parent1[EnumFlowerChromosome.STEM.ordinal()] =
|
||||||
|
new Chromosome(mutation.getResult().getAllele());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IChromosome[] template = null;
|
||||||
|
for (IFlowerMutation mutation2 : BotanyCore.getFlowerRoot().getMutations(true)) {
|
||||||
|
float chance = mutation2.getChance(allele0, allele2, genome0, genome2);
|
||||||
|
if (chance > 0.0f && world.rand.nextFloat() * 100.0f < chance && template == null) {
|
||||||
|
template = BotanyCore.getFlowerRoot().templateAsChromosomes(mutation2.getTemplate());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (template != null) {
|
||||||
|
parent1 = template;
|
||||||
|
}
|
||||||
|
return parent1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,134 +1,128 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.genetics;
|
package binnie.botany.genetics;
|
||||||
|
|
||||||
import forestry.api.core.EnumTemperature;
|
|
||||||
import binnie.botany.api.EnumMoisture;
|
|
||||||
import binnie.Binnie;
|
import binnie.Binnie;
|
||||||
import binnie.botany.api.EnumAcidity;
|
import binnie.botany.api.EnumAcidity;
|
||||||
import forestry.api.genetics.IAlleleFloat;
|
|
||||||
import forestry.api.genetics.IAlleleTolerance;
|
|
||||||
import forestry.api.genetics.EnumTolerance;
|
|
||||||
import binnie.botany.api.IFlowerType;
|
|
||||||
import forestry.api.genetics.IAlleleInteger;
|
|
||||||
import forestry.api.genetics.IChromosomeType;
|
|
||||||
import binnie.botany.core.BotanyCore;
|
|
||||||
import forestry.api.genetics.ISpeciesRoot;
|
|
||||||
import binnie.botany.api.EnumFlowerChromosome;
|
import binnie.botany.api.EnumFlowerChromosome;
|
||||||
|
import binnie.botany.api.EnumMoisture;
|
||||||
import binnie.botany.api.IAlleleFlowerSpecies;
|
import binnie.botany.api.IAlleleFlowerSpecies;
|
||||||
import forestry.api.genetics.IChromosome;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import binnie.botany.api.IFlowerGenome;
|
import binnie.botany.api.IFlowerGenome;
|
||||||
|
import binnie.botany.api.IFlowerType;
|
||||||
|
import binnie.botany.core.BotanyCore;
|
||||||
|
import forestry.api.core.EnumTemperature;
|
||||||
|
import forestry.api.genetics.EnumTolerance;
|
||||||
|
import forestry.api.genetics.IAlleleFloat;
|
||||||
|
import forestry.api.genetics.IAlleleInteger;
|
||||||
|
import forestry.api.genetics.IAlleleTolerance;
|
||||||
|
import forestry.api.genetics.IChromosome;
|
||||||
|
import forestry.api.genetics.ISpeciesRoot;
|
||||||
import forestry.core.genetics.Genome;
|
import forestry.core.genetics.Genome;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
|
||||||
public class FlowerGenome extends Genome implements IFlowerGenome
|
public class FlowerGenome extends Genome implements IFlowerGenome {
|
||||||
{
|
public FlowerGenome(NBTTagCompound nbttagcompound) {
|
||||||
public FlowerGenome(final NBTTagCompound nbttagcompound) {
|
super(nbttagcompound);
|
||||||
super(nbttagcompound);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public FlowerGenome(final IChromosome[] chromosomes) {
|
public FlowerGenome(IChromosome[] chromosomes) {
|
||||||
super(chromosomes);
|
super(chromosomes);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IAlleleFlowerSpecies getPrimary() {
|
public IAlleleFlowerSpecies getPrimary() {
|
||||||
return (IAlleleFlowerSpecies) this.getChromosomes()[EnumFlowerChromosome.SPECIES.ordinal()].getPrimaryAllele();
|
return (IAlleleFlowerSpecies) getChromosomes()[EnumFlowerChromosome.SPECIES.ordinal()].getPrimaryAllele();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IAlleleFlowerSpecies getSecondary() {
|
public IAlleleFlowerSpecies getSecondary() {
|
||||||
return (IAlleleFlowerSpecies) this.getChromosomes()[EnumFlowerChromosome.SPECIES.ordinal()].getSecondaryAllele();
|
return (IAlleleFlowerSpecies) getChromosomes()[EnumFlowerChromosome.SPECIES.ordinal()].getSecondaryAllele();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ISpeciesRoot getSpeciesRoot() {
|
public ISpeciesRoot getSpeciesRoot() {
|
||||||
return BotanyCore.getFlowerRoot();
|
return BotanyCore.getFlowerRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumFlowerColor getPrimaryColor() {
|
public EnumFlowerColor getPrimaryColor() {
|
||||||
return ((AlleleColor) this.getActiveAllele(EnumFlowerChromosome.PRIMARY)).getColor();
|
return ((AlleleColor) getActiveAllele(EnumFlowerChromosome.PRIMARY)).getColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumFlowerColor getSecondaryColor() {
|
public EnumFlowerColor getSecondaryColor() {
|
||||||
return ((AlleleColor) this.getActiveAllele(EnumFlowerChromosome.SECONDARY)).getColor();
|
return ((AlleleColor) getActiveAllele(EnumFlowerChromosome.SECONDARY)).getColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumFlowerColor getStemColor() {
|
public EnumFlowerColor getStemColor() {
|
||||||
return ((AlleleColor) this.getActiveAllele(EnumFlowerChromosome.STEM)).getColor();
|
return ((AlleleColor) getActiveAllele(EnumFlowerChromosome.STEM)).getColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getFertility() {
|
public int getFertility() {
|
||||||
return ((IAlleleInteger) this.getActiveAllele(EnumFlowerChromosome.FERTILITY)).getValue();
|
return ((IAlleleInteger) getActiveAllele(EnumFlowerChromosome.FERTILITY)).getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getLifespan() {
|
public int getLifespan() {
|
||||||
return ((IAlleleInteger) this.getActiveAllele(EnumFlowerChromosome.LIFESPAN)).getValue() / 5;
|
return ((IAlleleInteger) getActiveAllele(EnumFlowerChromosome.LIFESPAN)).getValue() / 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IFlowerType getType() {
|
public IFlowerType getType() {
|
||||||
return this.getPrimary().getType();
|
return getPrimary().getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumTolerance getToleranceTemperature() {
|
public EnumTolerance getToleranceTemperature() {
|
||||||
return ((IAlleleTolerance) this.getActiveAllele(EnumFlowerChromosome.TEMPERATURE_TOLERANCE)).getValue();
|
return ((IAlleleTolerance) getActiveAllele(EnumFlowerChromosome.TEMPERATURE_TOLERANCE)).getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumTolerance getToleranceMoisture() {
|
public EnumTolerance getToleranceMoisture() {
|
||||||
return ((IAlleleTolerance) this.getActiveAllele(EnumFlowerChromosome.HUMIDITY_TOLERANCE)).getValue();
|
return ((IAlleleTolerance) getActiveAllele(EnumFlowerChromosome.HUMIDITY_TOLERANCE)).getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumTolerance getTolerancePH() {
|
public EnumTolerance getTolerancePH() {
|
||||||
return ((IAlleleTolerance) this.getActiveAllele(EnumFlowerChromosome.PH_TOLERANCE)).getValue();
|
return ((IAlleleTolerance) getActiveAllele(EnumFlowerChromosome.PH_TOLERANCE)).getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFromNBT(final NBTTagCompound nbttagcompound) {
|
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||||
super.readFromNBT(nbttagcompound);
|
super.readFromNBT(nbttagcompound);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getAgeChance() {
|
public float getAgeChance() {
|
||||||
return 1.0f * (float) Math.sqrt(2.0f / this.getLifespan());
|
return 1.0f * (float) Math.sqrt(2.0f / getLifespan());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getSappiness() {
|
public float getSappiness() {
|
||||||
return ((IAlleleFloat) this.getActiveAllele(EnumFlowerChromosome.SAPPINESS)).getValue();
|
return ((IAlleleFloat) getActiveAllele(EnumFlowerChromosome.SAPPINESS)).getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canTolerate(final EnumAcidity ePH) {
|
public boolean canTolerate(EnumAcidity ePH) {
|
||||||
final int pH = ePH.ordinal();
|
int pH = ePH.ordinal();
|
||||||
final int[] pHTol = Binnie.Genetics.getTolerance(this.getTolerancePH());
|
int[] pHTol = Binnie.Genetics.getTolerance(getTolerancePH());
|
||||||
final int fPH = this.getPrimary().getPH().ordinal();
|
int fPH = getPrimary().getPH().ordinal();
|
||||||
return pH >= fPH + pHTol[0] && pH <= fPH + pHTol[1];
|
return pH >= fPH + pHTol[0] && pH <= fPH + pHTol[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canTolerate(final EnumMoisture eMoisture) {
|
public boolean canTolerate(EnumMoisture eMoisture) {
|
||||||
final int moisture = eMoisture.ordinal();
|
int moisture = eMoisture.ordinal();
|
||||||
final int[] moistTol = Binnie.Genetics.getTolerance(this.getToleranceMoisture());
|
int[] moistTol = Binnie.Genetics.getTolerance(getToleranceMoisture());
|
||||||
final int fMoisture = this.getPrimary().getMoisture().ordinal();
|
int fMoisture = getPrimary().getMoisture().ordinal();
|
||||||
return moisture >= fMoisture + moistTol[0] && moisture <= fMoisture + moistTol[1];
|
return moisture >= fMoisture + moistTol[0] && moisture <= fMoisture + moistTol[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canTolerate(final EnumTemperature eTemp) {
|
public boolean canTolerate(EnumTemperature eTemp) {
|
||||||
final int temp = eTemp.ordinal();
|
int temp = eTemp.ordinal();
|
||||||
final int[] tempTol = Binnie.Genetics.getTolerance(this.getToleranceTemperature());
|
int[] tempTol = Binnie.Genetics.getTolerance(getToleranceTemperature());
|
||||||
final int fTemp = this.getPrimary().getTemperature().ordinal();
|
int fTemp = getPrimary().getTemperature().ordinal();
|
||||||
return temp >= fTemp + tempTol[0] && temp <= fTemp + tempTol[1];
|
return temp >= fTemp + tempTol[0] && temp <= fTemp + tempTol[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,286 +1,278 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.genetics;
|
package binnie.botany.genetics;
|
||||||
|
|
||||||
import forestry.api.genetics.ISpeciesType;
|
|
||||||
import binnie.botany.api.EnumFlowerChromosome;
|
|
||||||
import forestry.api.genetics.IChromosomeType;
|
|
||||||
|
|
||||||
import net.minecraft.world.WorldSavedData;
|
|
||||||
|
|
||||||
import binnie.botany.api.IBotanistTracker;
|
|
||||||
|
|
||||||
import com.mojang.authlib.GameProfile;
|
|
||||||
|
|
||||||
import forestry.api.genetics.IMutation;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import binnie.botany.api.IFlowerGenome;
|
|
||||||
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
|
|
||||||
import binnie.botany.Botany;
|
import binnie.botany.Botany;
|
||||||
import forestry.api.genetics.IIndividual;
|
import binnie.botany.api.EnumFlowerChromosome;
|
||||||
import binnie.botany.api.EnumFlowerStage;
|
import binnie.botany.api.EnumFlowerStage;
|
||||||
|
|
||||||
import binnie.botany.api.IAlleleFlowerSpecies;
|
import binnie.botany.api.IAlleleFlowerSpecies;
|
||||||
import forestry.api.genetics.IAllele;
|
import binnie.botany.api.IBotanistTracker;
|
||||||
import forestry.api.genetics.AlleleManager;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
import binnie.botany.api.IColourMix;
|
import binnie.botany.api.IColourMix;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import binnie.botany.api.IFlowerMutation;
|
|
||||||
import binnie.botany.api.IFlower;
|
import binnie.botany.api.IFlower;
|
||||||
|
import binnie.botany.api.IFlowerGenome;
|
||||||
import java.util.ArrayList;
|
import binnie.botany.api.IFlowerMutation;
|
||||||
|
|
||||||
import binnie.botany.api.IFlowerRoot;
|
import binnie.botany.api.IFlowerRoot;
|
||||||
|
import com.mojang.authlib.GameProfile;
|
||||||
|
import forestry.api.genetics.AlleleManager;
|
||||||
|
import forestry.api.genetics.IAllele;
|
||||||
|
import forestry.api.genetics.IChromosomeType;
|
||||||
|
import forestry.api.genetics.IIndividual;
|
||||||
|
import forestry.api.genetics.IMutation;
|
||||||
|
import forestry.api.genetics.ISpeciesType;
|
||||||
import forestry.core.genetics.SpeciesRoot;
|
import forestry.core.genetics.SpeciesRoot;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Random;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class FlowerHelper extends SpeciesRoot implements IFlowerRoot
|
public class FlowerHelper extends SpeciesRoot implements IFlowerRoot {
|
||||||
{
|
public static int flowerSpeciesCount = -1;
|
||||||
public static int flowerSpeciesCount;
|
public static ArrayList<IFlower> flowerTemplates = new ArrayList<>();
|
||||||
static final String UID = "rootFlowers";
|
|
||||||
public static ArrayList<IFlower> flowerTemplates;
|
|
||||||
private static ArrayList<IFlowerMutation> flowerMutations;
|
|
||||||
Map<ItemStack, IFlower> conversions;
|
|
||||||
private static ArrayList<IColourMix> colourMixes;
|
|
||||||
|
|
||||||
public FlowerHelper() {
|
protected static String UID = "rootFlowers";
|
||||||
this.conversions = new HashMap<ItemStack, IFlower>();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
private static ArrayList<IFlowerMutation> flowerMutations = new ArrayList<>();
|
||||||
public String getUID() {
|
private static ArrayList<IColourMix> colourMixes = new ArrayList<>();
|
||||||
return "rootFlowers";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
protected Map<ItemStack, IFlower> conversions;
|
||||||
public int getSpeciesCount() {
|
|
||||||
if (FlowerHelper.flowerSpeciesCount < 0) {
|
|
||||||
FlowerHelper.flowerSpeciesCount = 0;
|
|
||||||
for (final Map.Entry<String, IAllele> entry : AlleleManager.alleleRegistry.getRegisteredAlleles().entrySet()) {
|
|
||||||
if (entry.getValue() instanceof IAlleleFlowerSpecies && ((IAlleleFlowerSpecies) entry.getValue()).isCounted()) {
|
|
||||||
++FlowerHelper.flowerSpeciesCount;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return FlowerHelper.flowerSpeciesCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public FlowerHelper() {
|
||||||
public boolean isMember(final ItemStack stack) {
|
conversions = new HashMap<>();
|
||||||
return stack != null && this.getStageType(stack) != EnumFlowerStage.NONE;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isMember(final ItemStack stack, final int type) {
|
public String getUID() {
|
||||||
return this.getStageType(stack).ordinal() == type;
|
return UID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isMember(final IIndividual individual) {
|
public int getSpeciesCount() {
|
||||||
return individual instanceof IFlower;
|
if (FlowerHelper.flowerSpeciesCount < 0) {
|
||||||
}
|
FlowerHelper.flowerSpeciesCount = 0;
|
||||||
|
for (Map.Entry<String, IAllele> entry :
|
||||||
|
AlleleManager.alleleRegistry.getRegisteredAlleles().entrySet()) {
|
||||||
|
if (entry.getValue() instanceof IAlleleFlowerSpecies
|
||||||
|
&& ((IAlleleFlowerSpecies) entry.getValue()).isCounted()) {
|
||||||
|
FlowerHelper.flowerSpeciesCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FlowerHelper.flowerSpeciesCount;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getMemberStack(final IIndividual flower, final int type) {
|
public boolean isMember(ItemStack stack) {
|
||||||
if (!this.isMember(flower)) {
|
return stack != null && getStageType(stack) != EnumFlowerStage.NONE;
|
||||||
return null;
|
}
|
||||||
}
|
|
||||||
Item flowerItem = Botany.flowerItem;
|
|
||||||
if (type == EnumFlowerStage.SEED.ordinal()) {
|
|
||||||
flowerItem = Botany.seed;
|
|
||||||
}
|
|
||||||
if (type == EnumFlowerStage.POLLEN.ordinal()) {
|
|
||||||
flowerItem = Botany.pollen;
|
|
||||||
}
|
|
||||||
if (flowerItem != Botany.flowerItem) {
|
|
||||||
((IFlower) flower).setAge(0);
|
|
||||||
}
|
|
||||||
final NBTTagCompound nbttagcompound = new NBTTagCompound();
|
|
||||||
flower.writeToNBT(nbttagcompound);
|
|
||||||
final ItemStack flowerStack = new ItemStack(flowerItem);
|
|
||||||
flowerStack.setTagCompound(nbttagcompound);
|
|
||||||
return flowerStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumFlowerStage getStageType(final ItemStack stack) {
|
public boolean isMember(ItemStack stack, int type) {
|
||||||
return (stack == null) ? EnumFlowerStage.NONE : ((stack.getItem() == Botany.flowerItem) ? EnumFlowerStage.FLOWER : ((stack.getItem() == Botany.pollen) ? EnumFlowerStage.POLLEN : ((stack.getItem() == Botany.seed) ? EnumFlowerStage.SEED : EnumFlowerStage.NONE)));
|
return getStageType(stack).ordinal() == type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IFlower getMember(final ItemStack stack) {
|
public boolean isMember(IIndividual individual) {
|
||||||
if (!this.isMember(stack)) {
|
return individual instanceof IFlower;
|
||||||
return null;
|
}
|
||||||
}
|
|
||||||
return new Flower(stack.getTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IFlower getFlower(final World world, final IFlowerGenome genome) {
|
public ItemStack getMemberStack(IIndividual flower, int type) {
|
||||||
return new Flower(genome, 2);
|
if (!isMember(flower)) {
|
||||||
}
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
Item flowerItem = Botany.flowerItem;
|
||||||
public IFlowerGenome templateAsGenome(final IAllele[] template) {
|
if (type == EnumFlowerStage.SEED.ordinal()) {
|
||||||
return new FlowerGenome(this.templateAsChromosomes(template));
|
flowerItem = Botany.seed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
if (type == EnumFlowerStage.POLLEN.ordinal()) {
|
||||||
public IFlowerGenome templateAsGenome(final IAllele[] templateActive, final IAllele[] templateInactive) {
|
flowerItem = Botany.pollen;
|
||||||
return new FlowerGenome(this.templateAsChromosomes(templateActive, templateInactive));
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
if (flowerItem != Botany.flowerItem) {
|
||||||
public IFlower templateAsIndividual(final IAllele[] template) {
|
((IFlower) flower).setAge(0);
|
||||||
return new Flower(this.templateAsGenome(template), 2);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||||
public IFlower templateAsIndividual(final IAllele[] templateActive, final IAllele[] templateInactive) {
|
flower.writeToNBT(nbttagcompound);
|
||||||
return new Flower(this.templateAsGenome(templateActive, templateInactive), 2);
|
ItemStack flowerStack = new ItemStack(flowerItem);
|
||||||
}
|
flowerStack.setTagCompound(nbttagcompound);
|
||||||
|
return flowerStack;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ArrayList<IFlower> getIndividualTemplates() {
|
public EnumFlowerStage getStageType(ItemStack stack) {
|
||||||
return FlowerHelper.flowerTemplates;
|
if (stack == null) {
|
||||||
}
|
return EnumFlowerStage.NONE;
|
||||||
|
}
|
||||||
|
if (stack.getItem() == Botany.flowerItem) {
|
||||||
|
return EnumFlowerStage.FLOWER;
|
||||||
|
}
|
||||||
|
if (stack.getItem() == Botany.pollen) {
|
||||||
|
return EnumFlowerStage.POLLEN;
|
||||||
|
}
|
||||||
|
if (stack.getItem() == Botany.seed) {
|
||||||
|
return EnumFlowerStage.SEED;
|
||||||
|
}
|
||||||
|
return EnumFlowerStage.NONE;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerTemplate(final IAllele[] template) {
|
public IFlower getMember(ItemStack stack) {
|
||||||
this.registerTemplate(template[0].getUID(), template);
|
if (!isMember(stack)) {
|
||||||
}
|
return null;
|
||||||
|
}
|
||||||
|
return new Flower(stack.getTagCompound());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerTemplate(final String identifier, final IAllele[] template) {
|
public IFlower getFlower(World world, IFlowerGenome genome) {
|
||||||
FlowerHelper.flowerTemplates.add(new Flower(this.templateAsGenome(template), 2));
|
return new Flower(genome, 2);
|
||||||
if (!this.speciesTemplates.containsKey(identifier)) {
|
}
|
||||||
this.speciesTemplates.put(identifier, template);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IAllele[] getTemplate(final String identifier) {
|
public IFlowerGenome templateAsGenome(IAllele[] template) {
|
||||||
return this.speciesTemplates.get(identifier);
|
return new FlowerGenome(templateAsChromosomes(template));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IAllele[] getDefaultTemplate() {
|
public IFlowerGenome templateAsGenome(IAllele[] templateActive, IAllele[] templateInactive) {
|
||||||
return FlowerTemplates.getDefaultTemplate();
|
return new FlowerGenome(templateAsChromosomes(templateActive, templateInactive));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IAllele[] getRandomTemplate(final Random rand) {
|
public IFlower templateAsIndividual(IAllele[] template) {
|
||||||
return this.speciesTemplates.values().toArray(new IAllele[0][])[rand.nextInt(this.speciesTemplates.values().size())];
|
return new Flower(templateAsGenome(template), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<IFlowerMutation> getMutations(final boolean shuffle) {
|
public IFlower templateAsIndividual(IAllele[] templateActive, IAllele[] templateInactive) {
|
||||||
if (shuffle) {
|
return new Flower(templateAsGenome(templateActive, templateInactive), 2);
|
||||||
Collections.shuffle(FlowerHelper.flowerMutations);
|
}
|
||||||
}
|
|
||||||
return FlowerHelper.flowerMutations;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerMutation(final IMutation mutation) {
|
public ArrayList<IFlower> getIndividualTemplates() {
|
||||||
if (AlleleManager.alleleRegistry.isBlacklisted(mutation.getTemplate()[0].getUID())) {
|
return FlowerHelper.flowerTemplates;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
if (AlleleManager.alleleRegistry.isBlacklisted(mutation.getAllele0().getUID())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (AlleleManager.alleleRegistry.isBlacklisted(mutation.getAllele1().getUID())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
FlowerHelper.flowerMutations.add((IFlowerMutation) mutation);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBotanistTracker getBreedingTracker(final World world, final GameProfile player) {
|
public void registerTemplate(IAllele[] template) {
|
||||||
final String filename = "BotanistTracker." + ((player == null) ? "common" : player.getId());
|
registerTemplate(template[0].getUID(), template);
|
||||||
BotanistTracker tracker = (BotanistTracker) world.loadItemData(BotanistTracker.class, filename);
|
}
|
||||||
if (tracker == null) {
|
|
||||||
tracker = new BotanistTracker(filename);
|
|
||||||
world.setItemData(filename, tracker);
|
|
||||||
}
|
|
||||||
return tracker;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIndividual getMember(final NBTTagCompound compound) {
|
public void registerTemplate(String identifier, IAllele[] template) {
|
||||||
return new Flower(compound);
|
FlowerHelper.flowerTemplates.add(new Flower(templateAsGenome(template), 2));
|
||||||
}
|
if (!speciesTemplates.containsKey(identifier)) {
|
||||||
|
speciesTemplates.put(identifier, template);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class getMemberClass() {
|
public IAllele[] getTemplate(String identifier) {
|
||||||
return IFlower.class;
|
return speciesTemplates.get(identifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IChromosomeType[] getKaryotype() {
|
public IAllele[] getDefaultTemplate() {
|
||||||
return EnumFlowerChromosome.values();
|
return FlowerTemplates.getDefaultTemplate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IChromosomeType getKaryotypeKey() {
|
public IAllele[] getRandomTemplate(Random rand) {
|
||||||
return EnumFlowerChromosome.SPECIES;
|
return speciesTemplates.values()
|
||||||
}
|
.toArray(new IAllele[0][])[
|
||||||
|
rand.nextInt(speciesTemplates.values().size())];
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addConversion(final ItemStack itemstack, final IAllele[] template) {
|
public Collection<IFlowerMutation> getMutations(boolean shuffle) {
|
||||||
final IFlower flower = this.getFlower(null, this.templateAsGenome(template));
|
if (shuffle) {
|
||||||
this.conversions.put(itemstack, flower);
|
Collections.shuffle(FlowerHelper.flowerMutations);
|
||||||
}
|
}
|
||||||
|
return FlowerHelper.flowerMutations;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IFlower getConversion(final ItemStack itemstack) {
|
public void registerMutation(IMutation mutation) {
|
||||||
for (final Map.Entry<ItemStack, IFlower> entry : this.conversions.entrySet()) {
|
if (AlleleManager.alleleRegistry.isBlacklisted(mutation.getTemplate()[0].getUID())
|
||||||
if (entry.getKey().isItemEqual(itemstack)) {
|
|| AlleleManager.alleleRegistry.isBlacklisted(
|
||||||
return (IFlower) entry.getValue().copy();
|
mutation.getAllele0().getUID())
|
||||||
}
|
|| AlleleManager.alleleRegistry.isBlacklisted(
|
||||||
}
|
mutation.getAllele1().getUID())) {
|
||||||
return null;
|
return;
|
||||||
}
|
}
|
||||||
|
FlowerHelper.flowerMutations.add((IFlowerMutation) mutation);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerColourMix(final IColourMix colourMix) {
|
public IBotanistTracker getBreedingTracker(World world, GameProfile player) {
|
||||||
FlowerHelper.colourMixes.add(colourMix);
|
String filename = "BotanistTracker." + ((player == null) ? "common" : player.getId());
|
||||||
}
|
BotanistTracker tracker = (BotanistTracker) world.loadItemData(BotanistTracker.class, filename);
|
||||||
|
if (tracker == null) {
|
||||||
|
tracker = new BotanistTracker(filename);
|
||||||
|
world.setItemData(filename, tracker);
|
||||||
|
}
|
||||||
|
return tracker;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<IColourMix> getColourMixes(final boolean shuffle) {
|
public IIndividual getMember(NBTTagCompound compound) {
|
||||||
if (shuffle) {
|
return new Flower(compound);
|
||||||
Collections.shuffle(FlowerHelper.colourMixes);
|
}
|
||||||
}
|
|
||||||
return FlowerHelper.colourMixes;
|
|
||||||
}
|
|
||||||
|
|
||||||
static {
|
@Override
|
||||||
FlowerHelper.flowerSpeciesCount = -1;
|
public Class getMemberClass() {
|
||||||
FlowerHelper.flowerTemplates = new ArrayList<IFlower>();
|
return IFlower.class;
|
||||||
FlowerHelper.flowerMutations = new ArrayList<IFlowerMutation>();
|
}
|
||||||
FlowerHelper.colourMixes = new ArrayList<IColourMix>();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ??
|
@Override
|
||||||
@Override
|
public IChromosomeType[] getKaryotype() {
|
||||||
public ISpeciesType getType(ItemStack itemstack) {
|
return EnumFlowerChromosome.values();
|
||||||
return null;
|
}
|
||||||
}
|
|
||||||
|
@Override
|
||||||
|
public IChromosomeType getKaryotypeKey() {
|
||||||
|
return EnumFlowerChromosome.SPECIES;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addConversion(ItemStack stack, IAllele[] template) {
|
||||||
|
IFlower flower = getFlower(null, templateAsGenome(template));
|
||||||
|
conversions.put(stack, flower);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IFlower getConversion(ItemStack stack) {
|
||||||
|
for (Map.Entry<ItemStack, IFlower> entry : conversions.entrySet()) {
|
||||||
|
if (entry.getKey().isItemEqual(stack)) {
|
||||||
|
return (IFlower) entry.getValue().copy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerColourMix(IColourMix colorMix) {
|
||||||
|
FlowerHelper.colourMixes.add(colorMix);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<IColourMix> getColourMixes(boolean shuffle) {
|
||||||
|
if (shuffle) {
|
||||||
|
Collections.shuffle(FlowerHelper.colourMixes);
|
||||||
|
}
|
||||||
|
return FlowerHelper.colourMixes;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ??
|
||||||
|
@Override
|
||||||
|
public ISpeciesType getType(ItemStack stack) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,89 +1,85 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.genetics;
|
package binnie.botany.genetics;
|
||||||
|
|
||||||
|
import binnie.botany.api.IAlleleFlowerSpecies;
|
||||||
|
import binnie.botany.api.IFlowerMutation;
|
||||||
|
import binnie.botany.core.BotanyCore;
|
||||||
|
import forestry.api.genetics.IAllele;
|
||||||
|
import forestry.api.genetics.IGenome;
|
||||||
|
import forestry.api.genetics.ISpeciesRoot;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import binnie.botany.core.BotanyCore;
|
public class FlowerMutation implements IFlowerMutation {
|
||||||
import forestry.api.genetics.ISpeciesRoot;
|
protected IAlleleFlowerSpecies allele0;
|
||||||
import forestry.api.genetics.IGenome;
|
protected IAlleleFlowerSpecies allele1;
|
||||||
import forestry.api.genetics.IAllele;
|
protected IAllele[] template;
|
||||||
import binnie.botany.api.IAlleleFlowerSpecies;
|
protected int chance;
|
||||||
import binnie.botany.api.IFlowerMutation;
|
|
||||||
|
|
||||||
public class FlowerMutation implements IFlowerMutation
|
FlowerMutation(IAlleleFlowerSpecies allele0, IAlleleFlowerSpecies allele1, IAllele[] template, int chance) {
|
||||||
{
|
this.allele0 = allele0;
|
||||||
IAlleleFlowerSpecies allele0;
|
this.allele1 = allele1;
|
||||||
IAlleleFlowerSpecies allele1;
|
this.template = template;
|
||||||
IAllele[] template;
|
this.chance = chance;
|
||||||
int chance;
|
}
|
||||||
|
|
||||||
FlowerMutation(final IAlleleFlowerSpecies allele0, final IAlleleFlowerSpecies allele1, final IAllele[] template, final int chance) {
|
@Override
|
||||||
this.allele0 = allele0;
|
public IAlleleFlowerSpecies getAllele0() {
|
||||||
this.allele1 = allele1;
|
return allele0;
|
||||||
this.template = template;
|
}
|
||||||
this.chance = chance;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IAlleleFlowerSpecies getAllele0() {
|
public IAlleleFlowerSpecies getAllele1() {
|
||||||
return this.allele0;
|
return allele1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IAlleleFlowerSpecies getAllele1() {
|
public IAllele[] getTemplate() {
|
||||||
return this.allele1;
|
return template;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IAllele[] getTemplate() {
|
public float getBaseChance() {
|
||||||
return this.template;
|
return chance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getBaseChance() {
|
public boolean isPartner(IAllele allele) {
|
||||||
return this.chance;
|
return allele.getUID().equals(allele0.getUID()) || allele.getUID().equals(allele1.getUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isPartner(final IAllele allele) {
|
public IAllele getPartner(IAllele allele) {
|
||||||
return allele.getUID().equals(this.allele0.getUID()) || allele.getUID().equals(this.allele1.getUID());
|
return allele.getUID().equals(allele0.getUID()) ? allele1 : allele0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IAllele getPartner(final IAllele allele) {
|
public boolean isSecret() {
|
||||||
return allele.getUID().equals(this.allele0.getUID()) ? this.allele1 : this.allele0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSecret() {
|
public float getChance(IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) {
|
||||||
return false;
|
if (allele0 == null || allele1 == null) {
|
||||||
}
|
return 0.0f;
|
||||||
|
}
|
||||||
|
if (this.allele0.getUID().equals(allele0.getUID())
|
||||||
|
&& this.allele1.getUID().equals(allele1.getUID())) {
|
||||||
|
return getBaseChance();
|
||||||
|
}
|
||||||
|
if (this.allele1.getUID().equals(allele0.getUID())
|
||||||
|
&& this.allele0.getUID().equals(allele1.getUID())) {
|
||||||
|
return getBaseChance();
|
||||||
|
}
|
||||||
|
return 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getChance(final IAllele allele0, final IAllele allele1, final IGenome genome0, final IGenome genome1) {
|
public ISpeciesRoot getRoot() {
|
||||||
if (allele0 == null || allele1 == null) {
|
return BotanyCore.getFlowerRoot();
|
||||||
return 0.0f;
|
}
|
||||||
}
|
|
||||||
if (this.allele0.getUID().equals(allele0.getUID()) && this.allele1.getUID().equals(allele1.getUID())) {
|
|
||||||
return this.getBaseChance();
|
|
||||||
}
|
|
||||||
if (this.allele1.getUID().equals(allele0.getUID()) && this.allele0.getUID().equals(allele1.getUID())) {
|
|
||||||
return this.getBaseChance();
|
|
||||||
}
|
|
||||||
return 0.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ISpeciesRoot getRoot() {
|
public Collection<String> getSpecialConditions() {
|
||||||
return BotanyCore.getFlowerRoot();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Collection<String> getSpecialConditions() {
|
|
||||||
return new ArrayList<String>();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1,29 +1,26 @@
|
|||||||
//
|
|
||||||
// Decompiled by Procyon v0.5.30
|
|
||||||
//
|
|
||||||
|
|
||||||
package binnie.botany.genetics;
|
package binnie.botany.genetics;
|
||||||
|
|
||||||
import forestry.api.genetics.AlleleManager;
|
|
||||||
import binnie.botany.api.EnumFlowerChromosome;
|
import binnie.botany.api.EnumFlowerChromosome;
|
||||||
|
import binnie.genetics.genetics.AlleleHelper;
|
||||||
|
import forestry.api.genetics.EnumTolerance;
|
||||||
import forestry.api.genetics.IAllele;
|
import forestry.api.genetics.IAllele;
|
||||||
|
import forestry.core.genetics.alleles.EnumAllele;
|
||||||
|
|
||||||
public class FlowerTemplates
|
public class FlowerTemplates {
|
||||||
{
|
public static IAllele[] getDefaultTemplate() {
|
||||||
public static IAllele[] getDefaultTemplate() {
|
IAllele[] alleles = new IAllele[EnumFlowerChromosome.values().length];
|
||||||
final IAllele[] alleles = new IAllele[EnumFlowerChromosome.values().length];
|
alleles[EnumFlowerChromosome.SPECIES.ordinal()] = FlowerSpecies.POPPY;
|
||||||
alleles[EnumFlowerChromosome.SPECIES.ordinal()] = FlowerSpecies.Poppy;
|
alleles[EnumFlowerChromosome.PRIMARY.ordinal()] = AlleleHelper.getAllele(EnumFlowerColor.RED);
|
||||||
alleles[EnumFlowerChromosome.PRIMARY.ordinal()] = EnumFlowerColor.Red.getAllele();
|
alleles[EnumFlowerChromosome.SECONDARY.ordinal()] = AlleleHelper.getAllele(EnumFlowerColor.RED);
|
||||||
alleles[EnumFlowerChromosome.SECONDARY.ordinal()] = EnumFlowerColor.Red.getAllele();
|
alleles[EnumFlowerChromosome.FERTILITY.ordinal()] = AlleleHelper.getAllele(EnumAllele.Fertility.NORMAL);
|
||||||
alleles[EnumFlowerChromosome.FERTILITY.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.fertilityNormal");
|
alleles[EnumFlowerChromosome.TERRITORY.ordinal()] = AlleleHelper.getAllele(EnumAllele.Territory.AVERAGE);
|
||||||
alleles[EnumFlowerChromosome.TERRITORY.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.territoryDefault");
|
alleles[EnumFlowerChromosome.EFFECT.ordinal()] = ModuleGenetics.alleleEffectNone;
|
||||||
alleles[EnumFlowerChromosome.EFFECT.ordinal()] = ModuleGenetics.alleleEffectNone;
|
alleles[EnumFlowerChromosome.LIFESPAN.ordinal()] = AlleleHelper.getAllele(EnumAllele.Lifespan.NORMAL);
|
||||||
alleles[EnumFlowerChromosome.LIFESPAN.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.lifespanNormal");
|
alleles[EnumFlowerChromosome.TEMPERATURE_TOLERANCE.ordinal()] = AlleleHelper.getAllele(EnumTolerance.NONE);
|
||||||
alleles[EnumFlowerChromosome.TEMPERATURE_TOLERANCE.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.toleranceNone");
|
alleles[EnumFlowerChromosome.HUMIDITY_TOLERANCE.ordinal()] = AlleleHelper.getAllele(EnumTolerance.NONE);
|
||||||
alleles[EnumFlowerChromosome.HUMIDITY_TOLERANCE.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.toleranceNone");
|
alleles[EnumFlowerChromosome.PH_TOLERANCE.ordinal()] = AlleleHelper.getAllele(EnumTolerance.NONE);
|
||||||
alleles[EnumFlowerChromosome.PH_TOLERANCE.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.toleranceNone");
|
alleles[EnumFlowerChromosome.SAPPINESS.ordinal()] = AlleleHelper.getAllele(EnumAllele.Sappiness.AVERAGE);
|
||||||
alleles[EnumFlowerChromosome.SAPPINESS.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.sappinessAverage");
|
alleles[EnumFlowerChromosome.STEM.ordinal()] = AlleleHelper.getAllele(EnumFlowerColor.GREEN);
|
||||||
alleles[EnumFlowerChromosome.STEM.ordinal()] = EnumFlowerColor.Green.getAllele();
|
return alleles;
|
||||||
return alleles;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Loaded 100 of 1252 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user