mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-26 06:43:01 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b16109fd9d | ||
|
|
1087b3dda0 | ||
|
|
9f6aac9db0 | ||
|
|
b4f208eca7 | ||
|
|
f26bd2c290 | ||
|
|
6fea13084d | ||
|
|
5074d8ba1d | ||
|
|
74d1aced60 | ||
|
|
547db6d7d0 | ||
|
|
93dd3c91c2 | ||
|
|
f7a608bf2b | ||
|
|
787bed088f | ||
|
|
d57ee09abf | ||
|
|
6a7262c066 | ||
|
|
31cf03db4e | ||
|
|
224ae70609 | ||
|
|
4d2d360be2 | ||
|
|
eed4618ace | ||
|
|
f3e84bcda0 | ||
|
|
c7e649e292 | ||
|
|
e41e40f425 | ||
|
|
bbd05762d7 | ||
|
|
39f6a92404 | ||
|
|
37ec69859d | ||
|
|
f84acae4c4 | ||
|
|
8541c421eb | ||
|
|
68351caa3f | ||
|
|
cecd0b34ea | ||
|
|
37aac854b5 | ||
|
|
e6fe00e986 | ||
|
|
bf496967aa | ||
|
|
5e1a996798 | ||
|
|
29144cfe3e | ||
|
|
78b68dec47 | ||
|
|
5053be782b | ||
|
|
c5a72c0dff | ||
|
|
e20ae4f103 | ||
|
|
fe84247b9e | ||
|
|
0a55e842b1 | ||
|
|
89154325ee | ||
|
|
f93be63ac7 | ||
|
|
09ed4db5b4 | ||
|
|
6bdb2c0b96 | ||
|
|
c312069d28 | ||
|
|
43c4963f3a | ||
|
|
2690cd2cd8 | ||
|
|
92b3fb8388 | ||
|
|
ef5a92448c | ||
|
|
d21ba33277 | ||
|
|
ab58fc5890 | ||
|
|
6ee77f5da4 | ||
|
|
d798f5df68 | ||
|
|
f3de9f25a5 | ||
|
|
a26415bf6e | ||
|
|
93ba5763f6 | ||
|
|
4f43009e93 | ||
|
|
341935663a | ||
|
|
6d1f3974be | ||
|
|
d70b4032b4 | ||
|
|
c040ccbb4f | ||
|
|
73c043f3a8 | ||
|
|
299fa969ac | ||
|
|
d86ea1bbca | ||
|
|
53616d5ba6 | ||
|
|
c07eb27064 | ||
|
|
dcb7f23091 | ||
|
|
1715092471 | ||
|
|
f751c778a2 | ||
|
|
4721422366 | ||
|
|
90a3beba5a | ||
|
|
3363828714 | ||
|
|
2e0cbf8148 | ||
|
|
77d4c8514b | ||
|
|
cbb3d5d863 | ||
|
|
34353e21dd | ||
|
|
d7cbcd2676 | ||
|
|
ce418f0af3 | ||
|
|
bb64220950 | ||
|
|
b1b2de44f4 | ||
|
|
09bd6e60a8 | ||
|
|
023ce67a09 | ||
|
|
b895140eaa | ||
|
|
f5010bcdf9 | ||
|
|
0fd4499a3b | ||
|
|
83266a6153 | ||
|
|
fc1a7e9e9f | ||
|
|
070a86e9ea | ||
|
|
0b869f1dbf | ||
|
|
67b9369cd5 | ||
|
|
1e17a18e3f | ||
|
|
c7c7596370 | ||
|
|
fca0feb92a | ||
|
|
ba203f4a57 | ||
|
|
f1c08b6f5f | ||
|
|
b4d4246577 | ||
|
|
49652c32e5 | ||
|
|
2a98bb16ff | ||
|
|
301cdce23c | ||
|
|
708b3bcae1 | ||
|
|
be88ceed7b | ||
|
|
ff25437d14 | ||
|
|
69b43d2874 | ||
|
|
aae438a098 | ||
|
|
97dcff302c | ||
|
|
57b7e8e841 | ||
|
|
e4df980eac | ||
|
|
632f0fb2f7 | ||
|
|
dfb6ca1735 | ||
|
|
77dc95d4d5 | ||
|
|
f3ef2a4244 | ||
|
|
a332cabdf7 | ||
|
|
69b64368f8 | ||
|
|
ccfc699180 | ||
|
|
6c5443c859 | ||
|
|
b4c34554c2 | ||
|
|
1f1795e635 | ||
|
|
9bf423b0da | ||
|
|
e97b70cab5 | ||
|
|
b6a965af46 | ||
|
|
584f5bd4f6 | ||
|
|
eea1549684 | ||
|
|
8246b036f3 | ||
|
|
228508a755 | ||
|
|
0e26ab800f | ||
|
|
281ab32e95 | ||
|
|
399cbe76aa | ||
|
|
25077b70c0 | ||
|
|
0ca43106f3 | ||
|
|
28acd83b5b | ||
|
|
b14153f46b | ||
|
|
b46d49e269 | ||
|
|
619c585fa2 | ||
|
|
0fecf28b65 | ||
|
|
980df8516a | ||
|
|
cddada359b | ||
|
|
9b30535265 | ||
|
|
7456c20fb5 | ||
|
|
73bbe09c6b | ||
|
|
bb0db68866 | ||
|
|
c781dd4231 | ||
|
|
91e7a95fbc | ||
|
|
6ce578c7cb | ||
|
|
7cac8bdd7d | ||
|
|
e77a74544d | ||
|
|
6ec2fe0d3d | ||
|
|
80cb4c94d6 | ||
|
|
2f971ac8e3 | ||
|
|
7d63503645 | ||
|
|
42d1bd07e1 | ||
|
|
6d05bc4dfe | ||
|
|
028f5ef031 | ||
|
|
805553e04e | ||
|
|
facff8752d | ||
|
|
63f04556e2 | ||
|
|
d229201b90 | ||
|
|
5869418115 | ||
|
|
2e2b2ef941 | ||
|
|
be6fc768f8 | ||
|
|
9a1a1bbf3f | ||
|
|
a97a032210 | ||
|
|
956fb3dca8 | ||
|
|
cf16727366 | ||
|
|
93a0751493 | ||
|
|
14115778d0 | ||
|
|
cb5ba100bf | ||
|
|
6c0f4cffa0 | ||
|
|
91fb7afded | ||
|
|
96d86b67f9 | ||
|
|
0e82f8617b | ||
|
|
cb086bbb11 | ||
|
|
3fa79927a4 | ||
|
|
9ad8b01686 | ||
|
|
3467c41bef | ||
|
|
ac7b3e0b7d | ||
|
|
31cd1cb543 | ||
|
|
860162cb6f | ||
|
|
16c7a830a6 | ||
|
|
dccd62b33a | ||
|
|
03e9deebdc | ||
|
|
62438e890a | ||
|
|
37bb2991a3 | ||
|
|
d4ec5b5ec3 | ||
|
|
56e8993f03 | ||
|
|
e2f20373e6 | ||
|
|
b7d30223a0 | ||
|
|
7b5782af5d | ||
|
|
6378580b31 | ||
|
|
108966a079 | ||
|
|
8724b77039 | ||
|
|
5c7d87498c | ||
|
|
2f9c2746b4 | ||
|
|
e91f77ca96 | ||
|
|
d18f9730a8 | ||
|
|
cbbd68031b | ||
|
|
47942e17e3 | ||
|
|
6ab4c94ed8 | ||
|
|
3f724c34ad | ||
|
|
38d769e384 | ||
|
|
9048436bf1 | ||
|
|
3ac6826e6c | ||
|
|
be9af968b9 | ||
|
|
30d0534377 | ||
|
|
9c4f0034fb | ||
|
|
b97d3e1d27 | ||
|
|
28535c1d72 | ||
|
|
44114660b1 | ||
|
|
f2e17fab72 | ||
|
|
21ce8e85c6 | ||
|
|
501360c92b | ||
|
|
022137be62 | ||
|
|
4d98a5691a | ||
|
|
3fcf1a13f4 | ||
|
|
5cc45ee0cb | ||
|
|
a37234c719 | ||
|
|
bc0f99cd33 | ||
|
|
0166b8b26c | ||
|
|
2c7c28bbc3 | ||
|
|
8ee577a958 | ||
|
|
c2dee6e1c1 | ||
|
|
3aef354b3a | ||
|
|
0b8b56a74b | ||
|
|
58e387e761 | ||
|
|
3fdaf92d12 | ||
|
|
f2fb61feb0 | ||
|
|
381896031b | ||
|
|
6a5fc496df | ||
|
|
7b6ec78cd7 | ||
|
|
a39ac3bd74 | ||
|
|
ba138b6eb2 | ||
|
|
17dc565ece | ||
|
|
93d5267079 | ||
|
|
eacb287f6b | ||
|
|
a0eb5802bd | ||
|
|
296c45f510 | ||
|
|
427c2ce5d1 | ||
|
|
797bde4868 | ||
|
|
bb33f0b7d2 | ||
|
|
bcc6623337 | ||
|
|
3dcd5c43b6 | ||
|
|
8a0861589b | ||
|
|
170a499cab | ||
|
|
68c9653932 | ||
|
|
7c36996fe3 | ||
|
|
38e1e81049 | ||
|
|
c80a774da7 | ||
|
|
2b38ed2f2b | ||
|
|
42340fde1c | ||
|
|
9bdb607fb4 | ||
|
|
e34b5adec6 | ||
|
|
3f8d860b95 | ||
|
|
4cbc62afb0 | ||
|
|
e5d1f1637c | ||
|
|
a499a47d9f | ||
|
|
bcc09e1a0e | ||
|
|
051b799fe8 | ||
|
|
a5fe149a4c | ||
|
|
5dedb54b26 | ||
|
|
0f669ce9fd | ||
|
|
b5349fccbe | ||
|
|
084d48e1a4 | ||
|
|
e4930a84b7 | ||
|
|
48176bc708 | ||
|
|
5e20f177f1 | ||
|
|
25e64459bb | ||
|
|
7d8c08bf72 | ||
|
|
a402869c01 | ||
|
|
2fd7805c10 | ||
|
|
e9e8ef2455 | ||
|
|
9868d18c75 | ||
|
|
9e39c63627 | ||
|
|
277677837e | ||
|
|
04b332bd07 | ||
|
|
d51d4aa2c4 | ||
|
|
ece4c4dd4d | ||
|
|
34b6134c4c | ||
|
|
fe5478af8b | ||
|
|
bab27d6189 | ||
|
|
ba22dbb69b | ||
|
|
3e46e3df5c | ||
|
|
be2e78d2e0 | ||
|
|
eda4cb5f59 | ||
|
|
e737d8d212 | ||
|
|
9a17e25da6 | ||
|
|
0fd5269d7b | ||
|
|
96ebbf9d05 | ||
|
|
5419892c90 | ||
|
|
48d007250b | ||
|
|
e418bbe173 | ||
|
|
5443c00f58 | ||
|
|
013408588e | ||
|
|
5a279266e1 | ||
|
|
96ba092c53 | ||
|
|
c057c4c88a | ||
|
|
727ab4820e |
No files matched your search
@@ -0,0 +1,19 @@
|
|||||||
|
# This is the universal Text Editor Configuration
|
||||||
|
# for all GTNewHorizons projects
|
||||||
|
# See: https://editorconfig.org/
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.{bat,ini}]
|
||||||
|
end_of_line = crlf
|
||||||
|
|
||||||
|
[*.{dtd,json,info,mcmeta,md,sh,svg,xml,xsd,xsl,yaml,yml}]
|
||||||
|
indent_size = 2
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
# Ignore spotlessApply reformat
|
||||||
|
6bdb2c0b96290f05da0233ac9f564fc35a9722b2
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
* text eol=lf
|
||||||
|
|
||||||
|
*.[jJ][aA][rR] binary
|
||||||
|
|
||||||
|
*.[pP][nN][gG] binary
|
||||||
|
*.[jJ][pP][gG] binary
|
||||||
|
*.[jJ][pP][eE][gG] binary
|
||||||
|
*.[gG][iI][fF] binary
|
||||||
|
*.[tT][iI][fF] binary
|
||||||
|
*.[tT][iI][fF][fF] binary
|
||||||
|
*.[iI][cC][oO] binary
|
||||||
|
*.[sS][vV][gG] text
|
||||||
|
*.[eE][pP][sS] binary
|
||||||
|
*.[xX][cC][fF] binary
|
||||||
|
|
||||||
|
*.[kK][aA][rR] binary
|
||||||
|
*.[mM]4[aA] binary
|
||||||
|
*.[mM][iI][dD] binary
|
||||||
|
*.[mM][iI][dD][iI] binary
|
||||||
|
*.[mM][pP]3 binary
|
||||||
|
*.[oO][gG][gG] binary
|
||||||
|
*.[rR][aA] binary
|
||||||
|
|
||||||
|
*.7[zZ] binary
|
||||||
|
*.[gG][zZ] binary
|
||||||
|
*.[tT][aA][rR] binary
|
||||||
|
*.[tT][gG][zZ] binary
|
||||||
|
*.[zZ][iI][pP] binary
|
||||||
|
|
||||||
|
*.[tT][cC][nN] binary
|
||||||
|
*.[sS][oO] binary
|
||||||
|
*.[dD][lL][lL] binary
|
||||||
|
*.[dD][yY][lL][iI][bB] binary
|
||||||
|
*.[pP][sS][dD] binary
|
||||||
|
*.[tT][tT][fF] binary
|
||||||
|
*.[oO][tT][fF] binary
|
||||||
|
|
||||||
|
*.[pP][aA][tT][cC][hH] -text
|
||||||
|
|
||||||
|
*.[bB][aA][tT] text eol=crlf
|
||||||
|
*.[cC][mM][dD] text eol=crlf
|
||||||
|
*.[pP][sS]1 text eol=crlf
|
||||||
|
|
||||||
|
*[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary
|
||||||
@@ -0,0 +1,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
|
||||||
+30
-20
@@ -1,23 +1,33 @@
|
|||||||
#General use .gitignore for Minecraft modding.
|
.gradle
|
||||||
|
.settings
|
||||||
#Folders
|
/.idea/
|
||||||
/.gradle/*
|
/.vscode/
|
||||||
/build/*
|
/run/
|
||||||
/eclipse/*
|
/build/
|
||||||
/run/*
|
/eclipse/
|
||||||
/out/*
|
.classpath
|
||||||
/asm/*
|
.project
|
||||||
/bin/*
|
/bin/
|
||||||
/libs/*
|
/config/
|
||||||
|
/crash-reports/
|
||||||
#File Extensions
|
/logs/
|
||||||
*.psd
|
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
|
||||||
*.classpath
|
src/main/resources/mixins.*.json
|
||||||
*.project
|
*.bat
|
||||||
|
*.DS_Store
|
||||||
#Specific files
|
!gradlew.bat
|
||||||
MCFPost.txt
|
layout.json
|
||||||
Thumbs.db
|
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
|
||||||
|
# Electro-Magic-Tools
|
||||||
|
|
||||||
|
Changelog of Electro-Magic-Tools.
|
||||||
|
|
||||||
|
|
||||||
|
### [#22 fix(textures): deprecated use of CASING_BLOCKS](https://github.com/GTNewHorizons/Electro-Magic-Tools/pull/22)
|
||||||
|
**Merge pull request #22 from GTNewHorizons/fix_CASING_BLOCKS**
|
||||||
|
* fix(textures): deprecated use of CASING_BLOCKS
|
||||||
|
|
||||||
|
[69b43d28740ac13](https://github.com/GTNewHorizons/Electro-Magic-Tools/commit/69b43d28740ac13)
|
||||||
|
by Léa Gris *2021-05-22 21:45:02*
|
||||||
|
### No issue
|
||||||
|
**bump version**
|
||||||
|
|
||||||
|
[ff25437d148f471](https://github.com/GTNewHorizons/Electro-Magic-Tools/commit/ff25437d148f471)
|
||||||
|
by DreamMasterXXL *2021-06-15 19:54:07*
|
||||||
|
|
||||||
|
**fix(textures): deprecated use of CASING_BLOCKS**
|
||||||
|
|
||||||
|
[aae438a09871b7d](https://github.com/GTNewHorizons/Electro-Magic-Tools/commit/aae438a09871b7d)
|
||||||
|
by Léa Gris *2021-05-22 19:49:01*
|
||||||
|
|
||||||
|
### [#19 Essentia gen fixes](https://github.com/GTNewHorizons/Electro-Magic-Tools/pull/19)
|
||||||
|
**Merge pull request #19 from GTNewHorizons/essentiaGenFix**
|
||||||
|
* Essentia gen fixes
|
||||||
|
|
||||||
|
[e4df980eacf77fa](https://github.com/GTNewHorizons/Electro-Magic-Tools/commit/e4df980eacf77fa)
|
||||||
|
by Martin Robertz *2021-01-10 14:17:56*
|
||||||
|
### [#20 fixed gens outputting their amps up to 6 times](https://github.com/GTNewHorizons/Electro-Magic-Tools/pull/20)
|
||||||
|
**fixed gens outputting their amps up to 6 times (#20)**
|
||||||
|
* fixed gens outputting their amps up to 6 times
|
||||||
|
* change according to review
|
||||||
|
|
||||||
|
[57b7e8e84176818](https://github.com/GTNewHorizons/Electro-Magic-Tools/commit/57b7e8e84176818)
|
||||||
|
by KiloJoel *2021-02-12 16:58:07*
|
||||||
|
### No issue
|
||||||
|
**bump version**
|
||||||
|
|
||||||
|
[97dcff302ca936e](https://github.com/GTNewHorizons/Electro-Magic-Tools/commit/97dcff302ca936e)
|
||||||
|
by DreamMasterXXL *2021-02-26 06:23:40*
|
||||||
|
|
||||||
|
**fixed essentia gens accepting essentia when full**
|
||||||
|
|
||||||
|
[632f0fb2f74fcac](https://github.com/GTNewHorizons/Electro-Magic-Tools/commit/632f0fb2f74fcac)
|
||||||
|
by KiloJoel *2021-01-10 08:16:36*
|
||||||
|
|
||||||
|
**fixed other server-client problems**
|
||||||
|
|
||||||
|
[dfb6ca173567017](https://github.com/GTNewHorizons/Electro-Magic-Tools/commit/dfb6ca173567017)
|
||||||
|
by KiloJoel *2021-01-10 07:44:38*
|
||||||
|
|
||||||
|
**fixed log spam from essentia gens**
|
||||||
|
|
||||||
|
[77dc95d4d5c51d7](https://github.com/GTNewHorizons/Electro-Magic-Tools/commit/77dc95d4d5c51d7)
|
||||||
|
by KiloJoel *2021-01-10 07:33:58*
|
||||||
|
|
||||||
|
**updated gradle wrapper**
|
||||||
|
|
||||||
|
[f3ef2a42440344a](https://github.com/GTNewHorizons/Electro-Magic-Tools/commit/f3ef2a42440344a)
|
||||||
|
by KiloJoel *2021-01-10 07:27:39*
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# Any Github changes require admin approval
|
||||||
|
/.github/** @GTNewHorizons/admin
|
||||||
|
|
||||||
-133
@@ -1,133 +0,0 @@
|
|||||||
Changelog of the mod : Electric Magic Tools, a Thaumcraft 4/Industrial-Craft 2 addon
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
Version 2.0.0Alpha-Build 29:
|
|
||||||
Hopefully no more duplicate packages or stuff. I hope.
|
|
||||||
|
|
||||||
Version 2.0.0Alpha-Build 28:
|
|
||||||
Started updating changelog again. Oops :p
|
|
||||||
Fixed the TileEntities not getting registered.
|
|
||||||
|
|
||||||
Version 2.0.0Alpa5:
|
|
||||||
Wild Material Shards have appeared! They are used in the tools' crafting recipes :D.
|
|
||||||
And here come the carvers!
|
|
||||||
|
|
||||||
Version 2.0.0Alpha4:
|
|
||||||
Added some items to the vanilla module of the mod: Wooden, Stone, Iron, Golden and Diamond Drills.
|
|
||||||
Added Wooden, Stone, Iron, Golden and Diamond Chainsaws.
|
|
||||||
Added Iron, Golden and Diamond Omnitools.
|
|
||||||
Removed stuff from capes, it's not needed anymore.
|
|
||||||
|
|
||||||
Version 2.0.0Alpha3:
|
|
||||||
Fixed the UU-Matter infusion research page crash. But the recipes aren't viable anymore, I'll get to fixing that ASAP.
|
|
||||||
Added a few Base tools, just for later purposes.
|
|
||||||
Added an interface for using in said tools, for later purposes too
|
|
||||||
|
|
||||||
Version 2.0.0Aplha2:
|
|
||||||
Fixed the Electric/Nano/Qunatum Boots of the Traveller not preventing fall damage. They now drain energy when doing so.
|
|
||||||
Fixed the Wings not preventing fall damage. They just do it.
|
|
||||||
Fixed the Wings model being derpy (Finally, huzza!)
|
|
||||||
|
|
||||||
Version 2.0.0Alpha1:
|
|
||||||
Since SOMEONE decided to change the modid, and almost everything else, this is now EMT 2.0.0. Hurray, and all that stuff.
|
|
||||||
Fixed the Essentia Generators crashing when placed in world. Oops.
|
|
||||||
And, well, as you can see, resumed the work on EMT. Sorry for the delay! :p
|
|
||||||
|
|
||||||
Version 1.1.4 :
|
|
||||||
Updated to Minecraft version 1.7.10.
|
|
||||||
Rewrote and improved the Essentia Generator code. It's now very easy to add new ones.
|
|
||||||
Rewrote and improved the Solar Panel code. It's now very easy to add new ones.
|
|
||||||
Rewrote and improved the Drill, Chainsaw, Omnitool, Boot, Goggle and Wing code. It's now very easy to add new ones, as well as way more efficient.
|
|
||||||
Refactored a lot of the code in preparation for the modules.
|
|
||||||
Added a new Essentia Generator, the Aer Generator.
|
|
||||||
Added a tooltip to the current Essentia Generators, saying they will be removed in future versions.
|
|
||||||
Added an Essentia Generator, alongisde with a dynamic system calculating outputs linked to different essentias. Change the values of the primals in the config, and there is even a maximum cap!
|
|
||||||
Added localization text for almost everything. (TehNut)
|
|
||||||
Added config GUI for in game config changes. (Implemented by Tombenpotter, fixed by TehNut)
|
|
||||||
Fixed Charged Creepers and Tainted Chickens not dropping things. (TehNut)
|
|
||||||
Organized creative tab to make it look nicer (TehNut)
|
|
||||||
Compressed Solar Panel tooltips are now easier to read. (TehNut)
|
|
||||||
|
|
||||||
Version 1.1.3 :
|
|
||||||
Added a logo to the mcmod.info, and fixed the version tag.
|
|
||||||
|
|
||||||
Version 1.1.2 :
|
|
||||||
Fixed the Shield Block being broken by the wither.
|
|
||||||
Added Config GUIs. Regenerating the config file is HIGLY reccomended.
|
|
||||||
Moved the baubles API to package it with EMT, along with the @API annotation to prevent any issues.
|
|
||||||
|
|
||||||
Version 1.1.1 :
|
|
||||||
Fixed a bug with The One Ring where mobs attacked you when you removed it while in creative.
|
|
||||||
New Thaumonomicon entries for a couple of things, thanks to Professor29.
|
|
||||||
Forgot to mention it, new Nanosuit Boots of the Traveller texture thanks to TehNut.
|
|
||||||
Removed Thaumium Plate and Lightning Summoner, and moved them to use other ids. This will delete existing ones.
|
|
||||||
Moved all the Solar Panels tooltips to require the use of the shift key to show themselves.
|
|
||||||
Adding wings, my take at the mix of Magic and Jetpacks.
|
|
||||||
Blacklist of the Etheral Processor now extends to anything containing armor, armour, helm, chestp, legging, boot, sword, shovel, axe or pick in its unlocalized name.
|
|
||||||
Added a drop to the Tainted Chicken, the Tainted Feather. Also added a crafting recipe for it.
|
|
||||||
Added a couple of crating components, used in the making of the wings.
|
|
||||||
Added a bunch of console outputs on the starting of the game so that I know exactly when it crashed if it died at startup.
|
|
||||||
Fixed a bug with the drill of the Rockbreaker that would make it use durability and eventually break when shift-breaking a block.
|
|
||||||
Added a different texture file for each solar panel, so that it can be changed more easily.
|
|
||||||
|
|
||||||
CyanideX remade all the EMT textures! Finally featuring cool looking stuff! Yey, thanks a lot to him!
|
|
||||||
|
|
||||||
Version 1.1.0 :
|
|
||||||
Updating to MC 1.7.2.
|
|
||||||
Added an Inventory Charging Bauble and an Armor Charging Bauble.
|
|
||||||
Added The One Ring, available only through dungeon loot.
|
|
||||||
Added a Wand Charging wand focus.
|
|
||||||
|
|
||||||
Versions 1.0.9a, 1.0.9b, 1.0.9c, 1.0.9d :
|
|
||||||
Added a blacklist for the Ethereal Processor to anything that has "dust" in its OreDict entry.
|
|
||||||
Mainly bugfixes.
|
|
||||||
|
|
||||||
Version 1.0.9 :
|
|
||||||
Fixed the bug with the Drill of the Rockbreaker.
|
|
||||||
Added UU-Matter Infusion Recipes.
|
|
||||||
Fixed the recipe for the Quantum Solar Helmet of Revealing.
|
|
||||||
Added the Wand Focus: Charging.
|
|
||||||
Added a cool particle effect existing when the Electric/Nano/Quantum boots of the traveller are worn (you an disable it in the config).
|
|
||||||
Added a portable node, and an Elecric Hoe of Growth.
|
|
||||||
|
|
||||||
Version 1.0.8 :
|
|
||||||
Added some magical solar panels, different tiers and special abilities to all of them.
|
|
||||||
|
|
||||||
Version 1.0.7 :
|
|
||||||
Updated to Thaumcraft 4.1.0x.
|
|
||||||
|
|
||||||
Version 1.0.6 :
|
|
||||||
Added an Industrial Wand Charging Station.
|
|
||||||
Added some legendary tools.
|
|
||||||
A couple of other things.
|
|
||||||
Code wise, switching to Forge Gradle (#964).
|
|
||||||
Added some enhanced boots of the traveller, and capes for some friends and I.
|
|
||||||
|
|
||||||
Version 1.0.5 :
|
|
||||||
Added some Ignis/Potentia/Auram generators.
|
|
||||||
Added Electric Goggles of revealing.
|
|
||||||
Added a Chainsaw of the Stream.
|
|
||||||
Added a Drill of the Rockbreaker.
|
|
||||||
|
|
||||||
Version 1.0.4 :
|
|
||||||
Added the Kris-tmas Focus.
|
|
||||||
Added the Shield Focus
|
|
||||||
|
|
||||||
Version 1.0.3b :
|
|
||||||
Second attempt to fix the server crash, it is again working in SMP.
|
|
||||||
|
|
||||||
Version 1.0.3 :
|
|
||||||
Attempt to fix the server crash of the mod. Attempt failed.
|
|
||||||
|
|
||||||
Version 1.0.2 :
|
|
||||||
Adds the Wand Focus : Laser.
|
|
||||||
Added a christmas easter egg.
|
|
||||||
Does not work on servers.
|
|
||||||
|
|
||||||
Version 1.0.1 :
|
|
||||||
Fixes a crash due to the Omnitools.
|
|
||||||
|
|
||||||
Version 1.0.0 :
|
|
||||||
First release of the mod.
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
+674
@@ -0,0 +1,674 @@
|
|||||||
|
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,30 @@
|
|||||||
|

|
||||||
|
|
||||||
|
#Electro-Magic Tools
|
||||||
|
|
||||||
|
Electro-Magic Tools is a Minecraft mod which integrates Thaumcraft 4 with IndustrialCraft 2 by adding cross-mod tools and items, such as magic solar panels, essentia generators and legendary items.
|
||||||
|
|
||||||
|
|
||||||
|
# Fork
|
||||||
|
This mod was forked by the GTNH Team to continue the development of the 1.7.10 Branch.
|
||||||
|
The up-to-date Master branch can be found on our Jenkins:
|
||||||
|
http://jenkins.usrv.de
|
||||||
|
|
||||||
|
# Issues
|
||||||
|
|
||||||
|
Before posting to the issue tracker, make sure you meet the following criteria:
|
||||||
|
|
||||||
|
- You're using the latest version of EMT.
|
||||||
|
- You've made sure the version of Forge you're using is the one EMT has been compiled for. (Newer is usually OK, but be careful!)
|
||||||
|
- You've gone through the effort to isolate EMT from other mods that aren't related to the issue.
|
||||||
|
- You've gone through the effort to find what conditions are necessary to reproduce the issue.
|
||||||
|
- The issue is subtle enough and has been around long enough that you think we might have missed it.
|
||||||
|
- You speak English or Russian well enough to explain yourself without wondering whether you will be understood.
|
||||||
|
|
||||||
|
# Upstream
|
||||||
|
|
||||||
|
[CurseForge](http://minecraft.curseforge.com/projects/electro-magic-tools)
|
||||||
|
|
||||||
|
# License
|
||||||
|
|
||||||
|
Electro-Magic-Tools is licensed under the GPL 3
|
||||||
+4
-115
@@ -1,116 +1,5 @@
|
|||||||
buildscript {
|
//version: 1707058017
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
plugins {
|
||||||
maven { url = "http://files.minecraftforge.net/maven" }
|
id 'com.gtnewhorizons.gtnhconvention'
|
||||||
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
|
||||||
classpath 'org.ajoberstar:gradle-git:0.10.1'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'forge'
|
|
||||||
apply plugin: 'maven-publish'
|
|
||||||
|
|
||||||
ext.configFile = file "build.properties"
|
|
||||||
configFile.withReader {
|
|
||||||
def prop = new Properties()
|
|
||||||
prop.load(it)
|
|
||||||
project.ext.config = new ConfigSlurper().parse prop
|
|
||||||
}
|
|
||||||
|
|
||||||
def build_number = 'CUSTOM'
|
|
||||||
|
|
||||||
if (System.getenv('BUILD_NUMBER') != null)
|
|
||||||
build_number = System.getenv('BUILD_NUMBER')
|
|
||||||
|
|
||||||
version = config.mc_version + "-" + config.mod_version + "-${build_number}"
|
|
||||||
group= config.package_group
|
|
||||||
archivesBaseName = config.mod_name
|
|
||||||
|
|
||||||
import org.ajoberstar.grgit.Grgit
|
|
||||||
|
|
||||||
def gitHash = 'unknown'
|
|
||||||
if (new File(projectDir, '.git').exists()) {
|
|
||||||
def repo = Grgit.open(project.file('.'))
|
|
||||||
gitHash = repo.log().find().abbreviatedId
|
|
||||||
}
|
|
||||||
|
|
||||||
minecraft {
|
|
||||||
version = config.mc_version + "-" + config.forge_version + "-" + config.mc_version
|
|
||||||
runDir = "run"
|
|
||||||
|
|
||||||
if (project.hasProperty('mappings_version'))
|
|
||||||
mappings = project.mappings_version
|
|
||||||
}
|
|
||||||
|
|
||||||
processResources {
|
|
||||||
inputs.property "version", project.version
|
|
||||||
inputs.property "mcversion", project.minecraft.version
|
|
||||||
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
|
||||||
include '**/*.info'
|
|
||||||
include '**/*.properties'
|
|
||||||
|
|
||||||
expand 'version': project.version, 'mcversion': project.minecraft.version
|
|
||||||
}
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
|
||||||
exclude '**/*.info'
|
|
||||||
exclude '**/*.properties'
|
|
||||||
exclude '**/*.db'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
jar {
|
|
||||||
manifest.mainAttributes(
|
|
||||||
"Built-By": System.getProperty('user.name'),
|
|
||||||
"Created-By": "${System.getProperty('java.vm.version')} + (${System.getProperty('java.vm.vendor')})",
|
|
||||||
"Implementation-Title": project.name,
|
|
||||||
"Implementation-Version": project.version,
|
|
||||||
"Git-Hash": gitHash
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
// add a source jar
|
|
||||||
task sourceJar(type: Jar) {
|
|
||||||
from sourceSets.main.allSource
|
|
||||||
classifier = 'sources'
|
|
||||||
}
|
|
||||||
|
|
||||||
// add a javadoc jar
|
|
||||||
task javadocJar(type: Jar) {
|
|
||||||
from javadoc.destinationDir
|
|
||||||
classifier = 'javadoc'
|
|
||||||
}
|
|
||||||
|
|
||||||
// because the normal output has been made to be obfuscated
|
|
||||||
task deobfJar(type: Jar) {
|
|
||||||
from sourceSets.main.output
|
|
||||||
classifier = 'deobf'
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.build.dependsOn sourceJar, javadocJar, deobfJar
|
|
||||||
|
|
||||||
tasks.withType(JavaCompile) { task ->
|
|
||||||
task.options.encoding = 'UTF-8'
|
|
||||||
}
|
|
||||||
|
|
||||||
publishing {
|
|
||||||
tasks.publish.dependsOn 'build'
|
|
||||||
publications {
|
|
||||||
mavenJava(MavenPublication) {
|
|
||||||
from components.java
|
|
||||||
artifact sourceJar
|
|
||||||
//artifact javadocJar
|
|
||||||
artifact deobfJar
|
|
||||||
}
|
|
||||||
}
|
|
||||||
repositories {
|
|
||||||
if (project.hasProperty('maven_repo')) {
|
|
||||||
maven { url maven_repo }
|
|
||||||
} else {
|
|
||||||
mavenLocal()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#
|
|
||||||
#Wed Feb 24 14:31:53 PDT 2015
|
|
||||||
package_group=com.tombenpotter.emt
|
|
||||||
mc_version=1.7.10
|
|
||||||
forge_version=10.13.2.1307
|
|
||||||
mod_version=2.0.0Alpha2
|
|
||||||
mod_name=ElectroMagicTools
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
// Add your dependencies here
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compileOnly 'com.github.GTNewHorizons:GT5-Unofficial:5.09.48.123:dev'
|
||||||
|
api 'com.github.GTNewHorizons:Baubles:1.0.4:dev'
|
||||||
|
api 'com.github.GTNewHorizons:ModularUI:1.2.0:dev'
|
||||||
|
api ('com.github.GTNewHorizons:ThaumicBoots:1.3.7:dev'){
|
||||||
|
exclude group: 'com.github.GTNewHorizons', module: 'Electro-Magic-Tools'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
api 'net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev'
|
||||||
|
api 'thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev'
|
||||||
|
}
|
||||||
@@ -0,0 +1,203 @@
|
|||||||
|
# ExampleMod tag to use as Blowdryer (Spotless, etc.) settings version, leave empty to disable.
|
||||||
|
# LOCAL to test local config updates.
|
||||||
|
gtnh.settings.blowdryerTag = 0.2.0
|
||||||
|
|
||||||
|
# Human-readable mod name, available for mcmod.info population.
|
||||||
|
modName = Electro-Magic Tools
|
||||||
|
|
||||||
|
# Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation.
|
||||||
|
# Conventionally lowercase.
|
||||||
|
modId = EMT
|
||||||
|
|
||||||
|
# Root package of the mod, used to find various classes in other properties,
|
||||||
|
# mcmod.info substitution, enabling assertions in run tasks, etc.
|
||||||
|
modGroup = emt
|
||||||
|
|
||||||
|
# Whether to use modGroup as the maven publishing group.
|
||||||
|
# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods.
|
||||||
|
useModGroupForPublishing = false
|
||||||
|
|
||||||
|
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
|
||||||
|
autoUpdateBuildScript = false
|
||||||
|
|
||||||
|
# Version of Minecraft to target
|
||||||
|
minecraftVersion = 1.7.10
|
||||||
|
|
||||||
|
# Version of Minecraft Forge to target
|
||||||
|
forgeVersion = 10.13.4.1614
|
||||||
|
|
||||||
|
# Specify an MCP channel for dependency deobfuscation and the deobfParams task.
|
||||||
|
channel = stable
|
||||||
|
|
||||||
|
# Specify an MCP mappings version for dependency deobfuscation and the deobfParams task.
|
||||||
|
mappingsVersion = 12
|
||||||
|
|
||||||
|
# Defines other MCP mappings for dependency deobfuscation.
|
||||||
|
remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
|
||||||
|
|
||||||
|
# Select a default username for testing your mod. You can always override this per-run by running
|
||||||
|
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
|
||||||
|
developmentEnvironmentUserName = Developer
|
||||||
|
|
||||||
|
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
|
||||||
|
# See https://github.com/bsideup/jabel for details on how this works.
|
||||||
|
enableModernJavaSyntax = true
|
||||||
|
|
||||||
|
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
||||||
|
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
||||||
|
enableGenericInjection = true
|
||||||
|
|
||||||
|
# Generate a class with a String field for the mod version named as defined below.
|
||||||
|
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
|
||||||
|
# If gradleTokenVersion is empty or missing, the field will not be present in the class.
|
||||||
|
generateGradleTokenClass =
|
||||||
|
|
||||||
|
# Name of the token containing the project's current version to generate/replace.
|
||||||
|
gradleTokenVersion = GRADLETOKEN_VERSION
|
||||||
|
|
||||||
|
# [DEPRECATED] Mod ID replacement token.
|
||||||
|
gradleTokenModId =
|
||||||
|
|
||||||
|
# [DEPRECATED] Mod name replacement token.
|
||||||
|
gradleTokenModName =
|
||||||
|
|
||||||
|
# [DEPRECATED] Mod Group replacement token.
|
||||||
|
gradleTokenGroupName =
|
||||||
|
|
||||||
|
# [DEPRECATED]
|
||||||
|
# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java
|
||||||
|
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||||
|
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
|
||||||
|
# version in @Mod([...], version = VERSION, [...]).
|
||||||
|
# Leave these properties empty to skip individual token replacements.
|
||||||
|
replaceGradleTokenInFile = EMT.java
|
||||||
|
|
||||||
|
# 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/
|
||||||
|
# There can be multiple files in a space-separated list.
|
||||||
|
# Example value: mymodid_at.cfg nei_at.cfg
|
||||||
|
accessTransformersFile =
|
||||||
|
|
||||||
|
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||||
|
usesMixins = false
|
||||||
|
|
||||||
|
# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
|
||||||
|
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
|
||||||
|
# Mixin classes will have access to "main" classes, but not the other way around.
|
||||||
|
separateMixinSourceSet =
|
||||||
|
|
||||||
|
# Adds some debug arguments like verbose output and class export.
|
||||||
|
usesMixinDebug = false
|
||||||
|
|
||||||
|
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||||
|
mixinPlugin =
|
||||||
|
|
||||||
|
# Specify the package that contains all of your Mixins. 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
|
||||||
|
|
||||||
|
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
|
||||||
|
forceEnableMixins = false
|
||||||
|
|
||||||
|
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated into your jar. It is your
|
||||||
|
# responsibility to check the license and request permission for distribution if required.
|
||||||
|
usesShadowedDependencies = false
|
||||||
|
|
||||||
|
# If disabled, won't remove unused classes from shadowed dependencies. Some libraries use reflection to access
|
||||||
|
# their own classes, making the minimization unreliable.
|
||||||
|
minimizeShadowedDependencies = true
|
||||||
|
|
||||||
|
# If disabled, won't rename the shadowed classes.
|
||||||
|
relocateShadowedDependencies = true
|
||||||
|
|
||||||
|
# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
|
||||||
|
includeWellKnownRepositories = true
|
||||||
|
|
||||||
|
# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated
|
||||||
|
# list of strings, with the acceptable keys being(case does not matter):
|
||||||
|
# cursemaven
|
||||||
|
# modrinth
|
||||||
|
excludeWellKnownRepositories =
|
||||||
|
|
||||||
|
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
|
||||||
|
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
|
||||||
|
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
|
||||||
|
usesMavenPublishing = true
|
||||||
|
|
||||||
|
# Maven repository to publish the mod to.
|
||||||
|
# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/
|
||||||
|
|
||||||
|
# Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token.
|
||||||
|
#
|
||||||
|
# The project's ID on Modrinth. Can be either the slug or the ID.
|
||||||
|
# Leave this empty if you don't want to publish to Modrinth.
|
||||||
|
modrinthProjectId =
|
||||||
|
|
||||||
|
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
|
||||||
|
# Syntax: scope1-type1:name1;scope2-type2:name2;...
|
||||||
|
# Where scope can be one of [required, optional, incompatible, embedded],
|
||||||
|
# type can be one of [project, version],
|
||||||
|
# and the name is the Modrinth project or version slug/id of the other mod.
|
||||||
|
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
|
||||||
|
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
|
||||||
|
modrinthRelations =
|
||||||
|
|
||||||
|
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
|
||||||
|
#
|
||||||
|
# The project's numeric ID on CurseForge. You can find this in the About Project box.
|
||||||
|
# Leave this empty if you don't want to publish on CurseForge.
|
||||||
|
curseForgeProjectId =
|
||||||
|
|
||||||
|
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
|
||||||
|
# Syntax: type1:name1;type2:name2;...
|
||||||
|
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
||||||
|
# and the name is the CurseForge project slug of the other mod.
|
||||||
|
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
|
||||||
|
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
|
||||||
|
curseForgeRelations =
|
||||||
|
|
||||||
|
# Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older
|
||||||
|
# projects. New projects should not use this parameter.
|
||||||
|
# customArchiveBaseName =
|
||||||
|
|
||||||
|
# Optional parameter to have the build automatically fail if an illegal version is used.
|
||||||
|
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
|
||||||
|
# The check is ONLY performed if the version is a git tag.
|
||||||
|
# Note: the specified string must be escaped, so e.g. 1\\.1\\.\\d+ instead of 1\.1\.\d+
|
||||||
|
# versionPattern =
|
||||||
|
|
||||||
|
# Uncomment to prevent the source code from being published.
|
||||||
|
# noPublishedSources = true
|
||||||
|
|
||||||
|
# Uncomment this to disable Spotless checks.
|
||||||
|
# This should only be uncommented to keep it easier to sync with upstream/other forks.
|
||||||
|
# That is, if there is no other active fork/upstream, NEVER change this.
|
||||||
|
# disableSpotless = true
|
||||||
|
|
||||||
|
# Uncomment this to disable Checkstyle checks (currently wildcard import check).
|
||||||
|
# disableCheckstyle = true
|
||||||
|
|
||||||
|
# Override the IDEA build type. Valid values are: "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle"
|
||||||
|
# (force use delegated build).
|
||||||
|
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||||
|
# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be native build.
|
||||||
|
# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want!
|
||||||
|
# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you.
|
||||||
|
# ideaOverrideBuildType = idea
|
||||||
|
|
||||||
|
# Whether IDEA should run spotless checks when pressing the Build button.
|
||||||
|
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||||
|
# ideaCheckSpotlessOnBuild = true
|
||||||
|
|
||||||
Vendored
BIN
Binary file not shown.
+3
-2
@@ -1,6 +1,7 @@
|
|||||||
#Fri Sep 26 11:20:52 CDT 2014
|
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-bin.zip
|
|
||||||
@@ -1,79 +1,130 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# Copyright © 2015-2021 the original authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
##
|
#
|
||||||
## Gradle start up script for UN*X
|
# Gradle start up script for POSIX generated by Gradle.
|
||||||
##
|
#
|
||||||
|
# Important for running:
|
||||||
|
#
|
||||||
|
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||||
|
# noncompliant, but you have some other compliant shell such as ksh or
|
||||||
|
# bash, then to run this script, type that shell name before the whole
|
||||||
|
# command line, like:
|
||||||
|
#
|
||||||
|
# ksh Gradle
|
||||||
|
#
|
||||||
|
# Busybox and similar reduced shells will NOT work, because this script
|
||||||
|
# requires all of these POSIX shell features:
|
||||||
|
# * functions;
|
||||||
|
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||||
|
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||||
|
# * compound commands having a testable exit status, especially «case»;
|
||||||
|
# * various built-in commands including «command», «set», and «ulimit».
|
||||||
|
#
|
||||||
|
# Important for patching:
|
||||||
|
#
|
||||||
|
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||||
|
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||||
|
#
|
||||||
|
# The "traditional" practice of packing multiple parameters into a
|
||||||
|
# space-separated string is a well documented source of bugs and security
|
||||||
|
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||||
|
# options in "$@", and eventually passing that to Java.
|
||||||
|
#
|
||||||
|
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||||
|
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||||
|
# see the in-line comments for details.
|
||||||
|
#
|
||||||
|
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||||
|
# Darwin, MinGW, and NonStop.
|
||||||
|
#
|
||||||
|
# (3) This script is generated from the Groovy template
|
||||||
|
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
|
# within the Gradle project.
|
||||||
|
#
|
||||||
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Attempt to set APP_HOME
|
||||||
DEFAULT_JVM_OPTS=""
|
|
||||||
|
|
||||||
APP_NAME="Gradle"
|
# Resolve links: $0 may be a link
|
||||||
APP_BASE_NAME=`basename "$0"`
|
app_path=$0
|
||||||
|
|
||||||
|
# Need this for daisy-chained symlinks.
|
||||||
|
while
|
||||||
|
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||||
|
[ -h "$app_path" ]
|
||||||
|
do
|
||||||
|
ls=$( ls -ld "$app_path" )
|
||||||
|
link=${ls#*' -> '}
|
||||||
|
case $link in #(
|
||||||
|
/*) app_path=$link ;; #(
|
||||||
|
*) app_path=$APP_HOME$link ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# This is normally unused
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
APP_BASE_NAME=${0##*/}
|
||||||
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||||
|
' "$PWD" ) || exit
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD="maximum"
|
MAX_FD=maximum
|
||||||
|
|
||||||
warn ( ) {
|
warn () {
|
||||||
echo "$*"
|
echo "$*"
|
||||||
}
|
} >&2
|
||||||
|
|
||||||
die ( ) {
|
die () {
|
||||||
echo
|
echo
|
||||||
echo "$*"
|
echo "$*"
|
||||||
echo
|
echo
|
||||||
exit 1
|
exit 1
|
||||||
}
|
} >&2
|
||||||
|
|
||||||
# OS specific support (must be 'true' or 'false').
|
# OS specific support (must be 'true' or 'false').
|
||||||
cygwin=false
|
cygwin=false
|
||||||
msys=false
|
msys=false
|
||||||
darwin=false
|
darwin=false
|
||||||
case "`uname`" in
|
nonstop=false
|
||||||
CYGWIN* )
|
case "$( uname )" in #(
|
||||||
cygwin=true
|
CYGWIN* ) cygwin=true ;; #(
|
||||||
;;
|
Darwin* ) darwin=true ;; #(
|
||||||
Darwin* )
|
MSYS* | MINGW* ) msys=true ;; #(
|
||||||
darwin=true
|
NONSTOP* ) nonstop=true ;;
|
||||||
;;
|
|
||||||
MINGW* )
|
|
||||||
msys=true
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
|
||||||
if $cygwin ; then
|
|
||||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Attempt to set APP_HOME
|
|
||||||
# Resolve links: $0 may be a link
|
|
||||||
PRG="$0"
|
|
||||||
# Need this for relative symlinks.
|
|
||||||
while [ -h "$PRG" ] ; do
|
|
||||||
ls=`ls -ld "$PRG"`
|
|
||||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
||||||
if expr "$link" : '/.*' > /dev/null; then
|
|
||||||
PRG="$link"
|
|
||||||
else
|
|
||||||
PRG=`dirname "$PRG"`"/$link"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
SAVED="`pwd`"
|
|
||||||
cd "`dirname \"$PRG\"`/" >&-
|
|
||||||
APP_HOME="`pwd -P`"
|
|
||||||
cd "$SAVED" >&-
|
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
if [ -n "$JAVA_HOME" ] ; then
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
# IBM's JDK on AIX uses strange locations for the executables
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||||
else
|
else
|
||||||
JAVACMD="$JAVA_HOME/bin/java"
|
JAVACMD=$JAVA_HOME/bin/java
|
||||||
fi
|
fi
|
||||||
if [ ! -x "$JAVACMD" ] ; then
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
@@ -82,83 +133,120 @@ Please set the JAVA_HOME variable in your environment to match the
|
|||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
JAVACMD="java"
|
JAVACMD=java
|
||||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
if ! command -v java >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
|
fi
|
||||||
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" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
MAX_FD_LIMIT=`ulimit -H -n`
|
case $MAX_FD in #(
|
||||||
if [ $? -eq 0 ] ; then
|
max*)
|
||||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
MAX_FD="$MAX_FD_LIMIT"
|
# shellcheck disable=SC2039,SC3045
|
||||||
fi
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
ulimit -n $MAX_FD
|
warn "Could not query maximum file descriptor limit"
|
||||||
if [ $? -ne 0 ] ; then
|
esac
|
||||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
case $MAX_FD in #(
|
||||||
fi
|
'' | soft) :;; #(
|
||||||
else
|
*)
|
||||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
fi
|
# shellcheck disable=SC2039,SC3045
|
||||||
fi
|
ulimit -n "$MAX_FD" ||
|
||||||
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
# For Darwin, add options to specify how the application appears in the dock
|
|
||||||
if $darwin; then
|
|
||||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
||||||
fi
|
|
||||||
|
|
||||||
# For Cygwin, switch paths to Windows format before running java
|
|
||||||
if $cygwin ; then
|
|
||||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
||||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
||||||
|
|
||||||
# We build the pattern for arguments to be converted via cygpath
|
|
||||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
||||||
SEP=""
|
|
||||||
for dir in $ROOTDIRSRAW ; do
|
|
||||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
||||||
SEP="|"
|
|
||||||
done
|
|
||||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
||||||
# Add a user-defined pattern to the cygpath arguments
|
|
||||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
||||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
||||||
fi
|
|
||||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
||||||
i=0
|
|
||||||
for arg in "$@" ; do
|
|
||||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
|
||||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
|
||||||
|
|
||||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
|
||||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
|
||||||
else
|
|
||||||
eval `echo args$i`="\"$arg\""
|
|
||||||
fi
|
|
||||||
i=$((i+1))
|
|
||||||
done
|
|
||||||
case $i in
|
|
||||||
(0) set -- ;;
|
|
||||||
(1) set -- "$args0" ;;
|
|
||||||
(2) set -- "$args0" "$args1" ;;
|
|
||||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
|
||||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
||||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
||||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
||||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
||||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
||||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
# Collect all arguments for the java command, stacking in reverse order:
|
||||||
function splitJvmOpts() {
|
# * args from the command line
|
||||||
JVM_OPTS=("$@")
|
# * the main class name
|
||||||
}
|
# * -classpath
|
||||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
# * -D...appname settings
|
||||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
# * --module-path (only if needed)
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||||
|
|
||||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
|
if "$cygwin" || "$msys" ; then
|
||||||
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
|
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||||
|
|
||||||
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
|
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
for arg do
|
||||||
|
if
|
||||||
|
case $arg in #(
|
||||||
|
-*) false ;; # don't mess with options #(
|
||||||
|
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||||
|
[ -e "$t" ] ;; #(
|
||||||
|
*) false ;;
|
||||||
|
esac
|
||||||
|
then
|
||||||
|
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||||
|
fi
|
||||||
|
# Roll the args list around exactly as many times as the number of
|
||||||
|
# args, so each arg winds up back in the position where it started, but
|
||||||
|
# possibly modified.
|
||||||
|
#
|
||||||
|
# NB: a `for` loop captures its iteration list before it begins, so
|
||||||
|
# changing the positional parameters here affects neither the number of
|
||||||
|
# iterations, nor the values presented in `arg`.
|
||||||
|
shift # remove old arg
|
||||||
|
set -- "$@" "$arg" # push replacement arg
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
|
# Collect all arguments for the java command:
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
|
# and any embedded shellness will be escaped.
|
||||||
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
|
set -- \
|
||||||
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
-classpath "$CLASSPATH" \
|
||||||
|
org.gradle.wrapper.GradleWrapperMain \
|
||||||
|
"$@"
|
||||||
|
|
||||||
|
# Stop when "xargs" is not available.
|
||||||
|
if ! command -v xargs >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "xargs is not available"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use "xargs" to parse quoted args.
|
||||||
|
#
|
||||||
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
#
|
||||||
|
# In Bash we could simply go:
|
||||||
|
#
|
||||||
|
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||||
|
# set -- "${ARGS[@]}" "$@"
|
||||||
|
#
|
||||||
|
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||||
|
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||||
|
# character that might be a shell metacharacter, then use eval to reverse
|
||||||
|
# that process (while maintaining the separation between arguments), and wrap
|
||||||
|
# the whole thing up as a single "set" statement.
|
||||||
|
#
|
||||||
|
# This will of course break if any of these variables contains a newline or
|
||||||
|
# an unmatched quote.
|
||||||
|
#
|
||||||
|
|
||||||
|
eval "set -- $(
|
||||||
|
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||||
|
xargs -n1 |
|
||||||
|
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||||
|
tr '\n' ' '
|
||||||
|
)" '"$@"'
|
||||||
|
|
||||||
|
exec "$JAVACMD" "$@"
|
||||||
Vendored
+46
-42
@@ -1,4 +1,22 @@
|
|||||||
@if "%DEBUG%" == "" @echo off
|
@rem
|
||||||
|
@rem Copyright 2015 the original author or authors.
|
||||||
|
@rem
|
||||||
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@rem you may not use this file except in compliance with the License.
|
||||||
|
@rem You may obtain a copy of the License at
|
||||||
|
@rem
|
||||||
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@rem
|
||||||
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@rem See the License for the specific language governing permissions and
|
||||||
|
@rem limitations under the License.
|
||||||
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem Gradle startup script for Windows
|
@rem Gradle startup script for Windows
|
||||||
@@ -8,26 +26,30 @@
|
|||||||
@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=.
|
||||||
|
@rem This is normally unused
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
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
|
||||||
|
|
||||||
set JAVA_EXE=java.exe
|
set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if "%ERRORLEVEL%" == "0" goto init
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@@ -35,54 +57,36 @@ goto fail
|
|||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto init
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:init
|
|
||||||
@rem Get command-line arguments, handling Windowz variants
|
|
||||||
|
|
||||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
|
||||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
|
||||||
|
|
||||||
:win9xME_args
|
|
||||||
@rem Slurp the command line arguments.
|
|
||||||
set CMD_LINE_ARGS=
|
|
||||||
set _SKIP=2
|
|
||||||
|
|
||||||
:win9xME_args_slurp
|
|
||||||
if "x%~1" == "x" goto execute
|
|
||||||
|
|
||||||
set CMD_LINE_ARGS=%*
|
|
||||||
goto execute
|
|
||||||
|
|
||||||
:4NT_args
|
|
||||||
@rem Get arguments from the 4NT Shell from JP Software
|
|
||||||
set CMD_LINE_ARGS=%$
|
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||||
|
|
||||||
:fail
|
:fail
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
rem the _cmd.exe /c_ return code!
|
rem the _cmd.exe /c_ return code!
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
set EXIT_CODE=%ERRORLEVEL%
|
||||||
exit /b 1
|
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||||
|
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||||
|
exit /b %EXIT_CODE%
|
||||||
|
|
||||||
:mainEnd
|
:mainEnd
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
// Add any additional repositories for your dependencies here
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
}
|
||||||
+23
-1
@@ -1 +1,23 @@
|
|||||||
rootProject.name = 'ElectroMagicTools'
|
|
||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
// RetroFuturaGradle
|
||||||
|
name "GTNH Maven"
|
||||||
|
url "https://nexus.gtnewhorizons.com/repository/public/"
|
||||||
|
mavenContent {
|
||||||
|
includeGroup("com.gtnewhorizons")
|
||||||
|
includeGroupByRegex("com\\.gtnewhorizons\\..+")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gradlePluginPortal()
|
||||||
|
mavenCentral()
|
||||||
|
mavenLocal()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.25'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package baubles.api;
|
|
||||||
|
|
||||||
public enum BaubleType {
|
|
||||||
RING,
|
|
||||||
AMULET,
|
|
||||||
BELT
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
package baubles.api;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.FMLLog;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.inventory.IInventory;
|
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Azanor
|
|
||||||
*/
|
|
||||||
public class BaublesApi {
|
|
||||||
static Method getBaubles;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves the baubles inventory for the supplied player
|
|
||||||
*/
|
|
||||||
public static IInventory getBaubles(EntityPlayer player) {
|
|
||||||
IInventory ot = null;
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (getBaubles == null) {
|
|
||||||
Class<?> fake = Class.forName("baubles.common.lib.PlayerHandler");
|
|
||||||
getBaubles = fake.getMethod("getPlayerBaubles", EntityPlayer.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
ot = (IInventory) getBaubles.invoke(null, player);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
FMLLog.warning("[Baubles API] Could not invoke baubles.common.lib.PlayerHandler method getPlayerBaubles");
|
|
||||||
}
|
|
||||||
|
|
||||||
return ot;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
package baubles.api;
|
|
||||||
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Azanor
|
|
||||||
* <p/>
|
|
||||||
* This interface should be extended by items that can be worn in bauble slots
|
|
||||||
*/
|
|
||||||
|
|
||||||
public interface IBauble {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method return the type of bauble this is.
|
|
||||||
* Type is used to determine the slots it can go into.
|
|
||||||
*/
|
|
||||||
public BaubleType getBaubleType(ItemStack itemstack);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method is called once per tick if the bauble is being worn by a player
|
|
||||||
*/
|
|
||||||
public void onWornTick(ItemStack itemstack, EntityLivingBase player);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method is called when the bauble is equipped by a player
|
|
||||||
*/
|
|
||||||
public void onEquipped(ItemStack itemstack, EntityLivingBase player);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method is called when the bauble is unequipped by a player
|
|
||||||
*/
|
|
||||||
public void onUnequipped(ItemStack itemstack, EntityLivingBase player);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* can this bauble be placed in a bauble slot
|
|
||||||
*/
|
|
||||||
public boolean canEquip(ItemStack itemstack, EntityLivingBase player);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Can this bauble be removed from a bauble slot
|
|
||||||
*/
|
|
||||||
public boolean canUnequip(ItemStack itemstack, EntityLivingBase player);
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
@API(apiVersion = "1.7.10-1.0.1.5", owner = "Baubles", provides = "Baubles|API") package baubles.api;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.API;
|
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
package emt;
|
||||||
|
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
|
import cpw.mods.fml.common.Loader;
|
||||||
|
import cpw.mods.fml.common.Mod;
|
||||||
|
import cpw.mods.fml.common.SidedProxy;
|
||||||
|
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||||
|
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||||
|
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import emt.command.CommandOutputs;
|
||||||
|
import emt.init.EMTEntities;
|
||||||
|
import emt.init.Registry;
|
||||||
|
import emt.network.PacketEMTKeys;
|
||||||
|
import emt.network.PacketNodeInfo;
|
||||||
|
import emt.proxy.CommonProxy;
|
||||||
|
import emt.tile.solar.Solars;
|
||||||
|
import emt.util.EMTClientEventHandler;
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import emt.util.EMTCreativeTab;
|
||||||
|
import emt.util.EMTDungeonChestGenerator;
|
||||||
|
import emt.util.EMTEssentiasOutputs;
|
||||||
|
import emt.util.EMTEventHandler;
|
||||||
|
|
||||||
|
@Mod(
|
||||||
|
modid = EMT.MOD_ID,
|
||||||
|
name = EMT.NAME,
|
||||||
|
version = EMT.VERSION,
|
||||||
|
guiFactory = EMT.GUI_FACTORY,
|
||||||
|
dependencies = EMT.DEPENDS)
|
||||||
|
public class EMT {
|
||||||
|
|
||||||
|
public static final String NAME = "Electro-Magic Tools";
|
||||||
|
public static final String MOD_ID = "EMT";
|
||||||
|
public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||||
|
public static final String TEXTURE_PATH = "emt";
|
||||||
|
public static final String GUI_FACTORY = "emt.client.gui.config.EMTGuiFactory";
|
||||||
|
public static final String CLIENT_PROXY = "emt.proxy.ClientProxy";
|
||||||
|
public static final String COMMON_PROXY = "emt.proxy.CommonProxy";
|
||||||
|
public static final String CHANNEL = "EMT";
|
||||||
|
public static final String DEPENDS = """
|
||||||
|
required-after:Thaumcraft;\
|
||||||
|
required-after:IC2;\
|
||||||
|
required-after:modularui;\
|
||||||
|
after:gregtech;\
|
||||||
|
after:Avaritia;\
|
||||||
|
after:MagicBees;\
|
||||||
|
after:ForbiddenMagic;\
|
||||||
|
after:dreamcraft""";
|
||||||
|
public static final CreativeTabs TAB = new EMTCreativeTab("EMT.creativeTab");
|
||||||
|
public static final Logger LOGGER = LogManager.getLogger("Electro-Magic Tools");
|
||||||
|
public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel("EMT");
|
||||||
|
|
||||||
|
@SidedProxy(clientSide = "emt.proxy.ClientProxy", serverSide = "emt.proxy.CommonProxy")
|
||||||
|
public static CommonProxy proxy;
|
||||||
|
|
||||||
|
@Mod.Instance("EMT")
|
||||||
|
public static EMT instance;
|
||||||
|
|
||||||
|
public static boolean isBootsActive = false;
|
||||||
|
public static final String BOOTS = "thaumicboots";
|
||||||
|
|
||||||
|
public boolean isSimulating() {
|
||||||
|
return !FMLCommonHandler.instance().getEffectiveSide().isClient();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Mod.EventHandler
|
||||||
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
|
if (Loader.isModLoaded(BOOTS)) {
|
||||||
|
isBootsActive = true;
|
||||||
|
}
|
||||||
|
EMTConfigHandler.init(event.getSuggestedConfigurationFile());
|
||||||
|
FMLCommonHandler.instance().bus().register(new EMTEventHandler());
|
||||||
|
if (FMLCommonHandler.instance().getSide().isClient()) {
|
||||||
|
FMLCommonHandler.instance().bus().register(new EMTClientEventHandler());
|
||||||
|
}
|
||||||
|
Registry.registerPreInit();
|
||||||
|
EMTEssentiasOutputs.addPrimalOutputs();
|
||||||
|
registerPackets();
|
||||||
|
if (Registry.enableGTCompat) {
|
||||||
|
Solars.populateCache();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Mod.EventHandler
|
||||||
|
public void load(FMLInitializationEvent event) {
|
||||||
|
Registry.registerInit();
|
||||||
|
proxy.load();
|
||||||
|
MinecraftForge.EVENT_BUS.register(new EMTEventHandler());
|
||||||
|
if (FMLCommonHandler.instance().getSide().isClient()) {
|
||||||
|
MinecraftForge.EVENT_BUS.register(new EMTClientEventHandler());
|
||||||
|
}
|
||||||
|
EMTDungeonChestGenerator.generateLoot();
|
||||||
|
EMTEntities.registerEMTEntities();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Mod.EventHandler
|
||||||
|
public void postInit(FMLPostInitializationEvent event) {
|
||||||
|
Registry.registerLate();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Mod.EventHandler
|
||||||
|
public void onFMLServerStart(FMLServerStartingEvent event) {
|
||||||
|
event.registerServerCommand(new CommandOutputs());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void registerPackets() {
|
||||||
|
INSTANCE.registerMessage(PacketEMTKeys.class, PacketEMTKeys.class, 0, Side.SERVER);
|
||||||
|
if (Registry.enableGTCompat) {
|
||||||
|
INSTANCE.registerMessage(PacketNodeInfo.class, PacketNodeInfo.class, 1, Side.CLIENT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package emt.block;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
|
import emt.EMT;
|
||||||
|
|
||||||
|
public abstract class BlockBase extends Block {
|
||||||
|
|
||||||
|
public final String name;
|
||||||
|
|
||||||
|
public BlockBase(String unlocName, Material material, String textureName, SoundType soundType, float hardness) {
|
||||||
|
super(material);
|
||||||
|
name = unlocName;
|
||||||
|
setBlockName(EMT.MOD_ID + ".block." + unlocName);
|
||||||
|
if (textureName != null) {
|
||||||
|
setBlockTextureName(EMT.TEXTURE_PATH + ":" + textureName);
|
||||||
|
}
|
||||||
|
setCreativeTab(EMT.TAB);
|
||||||
|
setStepSound(soundType);
|
||||||
|
setHardness(hardness);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockBase(String unlocName, Material material, SoundType soundType, float hardness) {
|
||||||
|
this(unlocName, material, null, soundType, hardness);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,160 @@
|
|||||||
|
package emt.block;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockContainer;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.tile.TileEntityEMT;
|
||||||
|
|
||||||
|
public abstract class BlockBaseContainer extends BlockContainer {
|
||||||
|
|
||||||
|
public int instance;
|
||||||
|
public int countOfMetas;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
IconSet[] iconSets;
|
||||||
|
|
||||||
|
public BlockBaseContainer(String unlocName, Material material, SoundType soundType, float hardness) {
|
||||||
|
this(unlocName, material, soundType, 1, hardness);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockBaseContainer(String unlocName, Material material, SoundType soundType, int countOfMetas,
|
||||||
|
float hardness) {
|
||||||
|
this(unlocName, material, soundType, countOfMetas, 0, hardness);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockBaseContainer(String unlocName, Material material, SoundType soundType, int countOfMetas,
|
||||||
|
int curInstance, float hardness) {
|
||||||
|
super(material);
|
||||||
|
this.setBlockName(EMT.MOD_ID + "." + unlocName);
|
||||||
|
this.setCreativeTab(EMT.TAB);
|
||||||
|
this.setStepSound(soundType);
|
||||||
|
this.setHardness(hardness);
|
||||||
|
|
||||||
|
this.countOfMetas = countOfMetas;
|
||||||
|
this.instance = curInstance;
|
||||||
|
|
||||||
|
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
|
||||||
|
iconSets = new IconSet[countOfMetas];
|
||||||
|
|
||||||
|
for (int meta = 0; meta < countOfMetas; meta++) {
|
||||||
|
iconSets[meta] = new IconSet();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public IconSet[] getIconSets() {
|
||||||
|
return iconSets;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world, int meta) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIcon(IBlockAccess access, int x, int y, int z, int side) {
|
||||||
|
TileEntityEMT tile = (TileEntityEMT) access.getTileEntity(x, y, z);
|
||||||
|
int meta = access.getBlockMetadata(x, y, z);
|
||||||
|
|
||||||
|
if (meta >= countOfMetas) return null;
|
||||||
|
|
||||||
|
IconSet set = iconSets[meta];
|
||||||
|
|
||||||
|
if (side == 0) {
|
||||||
|
return set.bottom;
|
||||||
|
} else if (side == 1) {
|
||||||
|
return set.top;
|
||||||
|
} else if (side != tile.facing) {
|
||||||
|
return set.side;
|
||||||
|
} else if (tile.isOn) {
|
||||||
|
if (set.frontOn != null) {
|
||||||
|
return set.frontOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (set.frontOff != null) {
|
||||||
|
return set.frontOff;
|
||||||
|
}
|
||||||
|
|
||||||
|
return set.side;
|
||||||
|
} else {
|
||||||
|
if (set.frontOff != null) {
|
||||||
|
return set.frontOff;
|
||||||
|
}
|
||||||
|
|
||||||
|
return set.side;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int meta) {
|
||||||
|
|
||||||
|
if (meta >= countOfMetas) return null;
|
||||||
|
|
||||||
|
IconSet set = iconSets[meta];
|
||||||
|
|
||||||
|
if (side < 1) {
|
||||||
|
return set.bottom;
|
||||||
|
}
|
||||||
|
if (side == 1) {
|
||||||
|
return set.top;
|
||||||
|
}
|
||||||
|
if (side == 3) {
|
||||||
|
return set.frontOff;
|
||||||
|
}
|
||||||
|
|
||||||
|
return set.side;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) {
|
||||||
|
int facing = MathHelper.floor_double(entity.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||||
|
TileEntityEMT tile = (TileEntityEMT) world.getTileEntity(x, y, z);
|
||||||
|
|
||||||
|
if (tile == null) return;
|
||||||
|
|
||||||
|
switch (facing) {
|
||||||
|
case 0:
|
||||||
|
tile.facing = 2;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
tile.facing = 5;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
tile.facing = 3;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
tile.facing = 4;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int damageDropped(int meta) {
|
||||||
|
return meta;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public static class IconSet {
|
||||||
|
|
||||||
|
public IIcon top;
|
||||||
|
public IIcon bottom;
|
||||||
|
public IIcon side;
|
||||||
|
public IIcon frontOff;
|
||||||
|
public IIcon frontOn;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
package emt.block;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
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;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.tile.TileElectricCloud;
|
||||||
|
import thaumcraft.client.fx.ParticleEngine;
|
||||||
|
import thaumcraft.client.fx.particles.FXSparkle;
|
||||||
|
|
||||||
|
public class BlockElectricCloud extends BlockBase {
|
||||||
|
|
||||||
|
public IIcon icon;
|
||||||
|
|
||||||
|
public BlockElectricCloud(String unlocName) {
|
||||||
|
super(unlocName, Material.cloth, soundTypeCloth, 0.1f);
|
||||||
|
setBlockBounds(0.3f, 0.3f, 0.3f, 0.7f, 0.7f, 0.7f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void randomDisplayTick(World world, int x, int y, int z, Random rnd) {
|
||||||
|
FXSparkle ef = new FXSparkle(
|
||||||
|
world,
|
||||||
|
x + 0.5F,
|
||||||
|
y + 0.5F,
|
||||||
|
z + 0.5F,
|
||||||
|
x + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F,
|
||||||
|
y + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F,
|
||||||
|
z + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F,
|
||||||
|
1.0F,
|
||||||
|
6,
|
||||||
|
3);
|
||||||
|
ef.setGravity(0.05F);
|
||||||
|
ParticleEngine.instance.addEffect(world, ef);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createTileEntity(World world, int metadata) {
|
||||||
|
return new TileElectricCloud();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName() {
|
||||||
|
return "tile.EMT." + super.getUnlocalizedName().substring(15);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerBlockIcons(IIconRegister ir) {
|
||||||
|
icon = ir.registerIcon(EMT.TEXTURE_PATH + ":empty");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int meta) {
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getLightValue() {
|
||||||
|
return 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAir(IBlockAccess world, int x, int y, int z) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasTileEntity() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasTileEntity(int metadata) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRenderType() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
package emt.block;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.particle.EntitySmokeFX;
|
||||||
|
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.world.World;
|
||||||
|
|
||||||
|
import com.gtnewhorizons.modularui.api.UIInfos;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.tile.generator.TileEntityBaseGenerator;
|
||||||
|
|
||||||
|
public class BlockEssentiaGenerators extends BlockBaseContainer {
|
||||||
|
|
||||||
|
private static int subtypes = 6;
|
||||||
|
|
||||||
|
public BlockEssentiaGenerators(String name) {
|
||||||
|
super(name, Material.iron, soundTypeMetal, subtypes, 4.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister ir) {
|
||||||
|
super.registerBlockIcons(ir);
|
||||||
|
this.blockIcon = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/top");
|
||||||
|
|
||||||
|
for (int meta = 0; meta < subtypes; meta++) {
|
||||||
|
iconSets[meta].top = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/top");
|
||||||
|
iconSets[meta].bottom = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/top");
|
||||||
|
iconSets[meta].side = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/side");
|
||||||
|
}
|
||||||
|
|
||||||
|
iconSets[0].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/potentiafront");
|
||||||
|
iconSets[1].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/ignisfront");
|
||||||
|
iconSets[2].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/auramfront");
|
||||||
|
iconSets[3].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/arborfront");
|
||||||
|
iconSets[4].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/aerfront");
|
||||||
|
iconSets[5].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/aerfront");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubBlocks(Item id, CreativeTabs tab, List<ItemStack> list) {
|
||||||
|
list.add(new ItemStack(id, 1, 0));
|
||||||
|
list.add(new ItemStack(id, 1, 1));
|
||||||
|
list.add(new ItemStack(id, 1, 2));
|
||||||
|
list.add(new ItemStack(id, 1, 3));
|
||||||
|
list.add(new ItemStack(id, 1, 4));
|
||||||
|
list.add(new ItemStack(id, 1, 5));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createTileEntity(World world, int meta) {
|
||||||
|
return new TileEntityBaseGenerator(meta);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
|
||||||
|
TileEntityBaseGenerator te = (TileEntityBaseGenerator) world.getTileEntity(x, y, z);
|
||||||
|
if (te.isActive) {
|
||||||
|
int color = te.aspect.getColor();
|
||||||
|
float r = (float) (color >> 16 & 0xff) / 255F;
|
||||||
|
float g = (float) (color >> 8 & 0xff) / 255F;
|
||||||
|
float b = (float) (color & 0xff) / 255F;
|
||||||
|
|
||||||
|
EntitySmokeFX fx = new EntitySmokeFX(world, x + 0.5f, y + 1.1, z + 0.5f, 0, 0.1, 0, 3);
|
||||||
|
fx.setRBGColorF(r, g, b);
|
||||||
|
Minecraft.getMinecraft().effectRenderer.addEffect(fx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int s, float f1, float f2,
|
||||||
|
float f3) {
|
||||||
|
if (player.isSneaking()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (world.isRemote) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
TileEntity tileentity = world.getTileEntity(i, j, k);
|
||||||
|
if (tileentity != null) {
|
||||||
|
UIInfos.TILE_MODULAR_UI.open(player, world, i, j, k);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,140 @@
|
|||||||
|
package emt.block;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
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.item.EntityItem;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import com.gtnewhorizons.modularui.api.UIInfos;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.tile.TileEntityEtherealMacerator;
|
||||||
|
import emt.tile.TileEntityIndustrialWandRecharge;
|
||||||
|
import ic2.api.item.IC2Items;
|
||||||
|
|
||||||
|
public class BlockMachines extends BlockBaseContainer {
|
||||||
|
|
||||||
|
public BlockMachines(String name) {
|
||||||
|
super(name, Material.iron, soundTypeMetal, 3, 4.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister ir) {
|
||||||
|
super.registerBlockIcons(ir);
|
||||||
|
|
||||||
|
this.blockIcon = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/top");
|
||||||
|
|
||||||
|
iconSets[0].top = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/top");
|
||||||
|
iconSets[1].top = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||||
|
iconSets[2].top = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||||
|
|
||||||
|
iconSets[0].bottom = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/side");
|
||||||
|
iconSets[1].bottom = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmacerator");
|
||||||
|
iconSets[2].bottom = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||||
|
|
||||||
|
iconSets[0].side = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/side");
|
||||||
|
iconSets[1].side = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmacerator");
|
||||||
|
iconSets[2].side = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||||
|
|
||||||
|
iconSets[0].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/wandcharger");
|
||||||
|
iconSets[1].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratorfront");
|
||||||
|
iconSets[2].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||||
|
|
||||||
|
iconSets[0].frontOn = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/wandcharger");
|
||||||
|
iconSets[1].frontOn = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratorfrontactive");
|
||||||
|
iconSets[2].frontOn = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubBlocks(Item id, CreativeTabs tab, List<ItemStack> list) {
|
||||||
|
list.add(new ItemStack(id, 1, 0));
|
||||||
|
list.add(new ItemStack(id, 1, 1));
|
||||||
|
list.add(new ItemStack(id, 1, 2));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createTileEntity(World world, int meta) {
|
||||||
|
if (meta == 0) {
|
||||||
|
return new TileEntityIndustrialWandRecharge();
|
||||||
|
} else if (meta == 1) {
|
||||||
|
return new TileEntityEtherealMacerator();
|
||||||
|
}
|
||||||
|
return super.createTileEntity(world, meta);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7,
|
||||||
|
float par8, float par9) {
|
||||||
|
if (!world.isRemote) {
|
||||||
|
TileEntity te = world.getTileEntity(x, y, z);
|
||||||
|
if (te instanceof TileEntityIndustrialWandRecharge || te instanceof TileEntityEtherealMacerator) {
|
||||||
|
UIInfos.TILE_MODULAR_UI.open(player, world, x, y, z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Item getItemDropped(int meta, Random random, int fortune) {
|
||||||
|
return IC2Items.getItem("machine").getItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||||
|
dropItems(world, x, y, z);
|
||||||
|
world.removeTileEntity(x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, meta);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dropItems(World world, int x, int y, int z) {
|
||||||
|
Random rand = world.rand;
|
||||||
|
|
||||||
|
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||||
|
if (!(tileEntity instanceof IInventory)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
IInventory inventory = (IInventory) tileEntity;
|
||||||
|
|
||||||
|
for (int i = 0; i < inventory.getSizeInventory(); i++) {
|
||||||
|
ItemStack item = inventory.getStackInSlot(i);
|
||||||
|
|
||||||
|
if (item != null && item.stackSize > 0) {
|
||||||
|
float rx = rand.nextFloat() * 0.8F + 0.1F;
|
||||||
|
float ry = rand.nextFloat() * 0.8F + 0.1F;
|
||||||
|
float rz = rand.nextFloat() * 0.8F + 0.1F;
|
||||||
|
|
||||||
|
EntityItem entityItem = new EntityItem(
|
||||||
|
world,
|
||||||
|
x + rx,
|
||||||
|
y + ry,
|
||||||
|
z + rz,
|
||||||
|
new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
|
||||||
|
|
||||||
|
if (item.hasTagCompound()) {
|
||||||
|
entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy());
|
||||||
|
}
|
||||||
|
|
||||||
|
float factor = 0.05F;
|
||||||
|
entityItem.motionX = rand.nextGaussian() * factor;
|
||||||
|
entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
|
||||||
|
entityItem.motionZ = rand.nextGaussian() * factor;
|
||||||
|
world.spawnEntityInWorld(entityItem);
|
||||||
|
item.stackSize = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+17
-38
@@ -1,43 +1,28 @@
|
|||||||
/*******************************************************************************
|
package emt.block;
|
||||||
* Copyright (c) 2014 Tombenpotter.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
|
||||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
|
||||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
|
||||||
* http://www.minecraftforum.net/topic/1585216-
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
package tombenpotter.emt.common.blocks;
|
import java.util.Random;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.Explosion;
|
import net.minecraft.world.Explosion;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import thaumcraft.common.blocks.BlockAiry;
|
|
||||||
import tombenpotter.emt.ElectroMagicTools;
|
|
||||||
import tombenpotter.emt.ModInformation;
|
|
||||||
import tombenpotter.emt.common.tile.TileEntityPortableNode;
|
|
||||||
|
|
||||||
import java.util.List;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import java.util.Random;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.tile.TileEntityPortableNode;
|
||||||
|
import thaumcraft.common.blocks.BlockAiry;
|
||||||
|
|
||||||
public class BlockPortableNode extends BlockAiry {
|
public class BlockPortableNode extends BlockAiry {
|
||||||
|
|
||||||
public IIcon[] texture = new IIcon[1];
|
public IIcon texture;
|
||||||
|
|
||||||
public BlockPortableNode() {
|
public BlockPortableNode(String name) {
|
||||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
this.setCreativeTab(EMT.TAB);
|
||||||
|
setBlockName(EMT.MOD_ID + "." + name);
|
||||||
setBlockUnbreakable();
|
setBlockUnbreakable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,28 +55,22 @@ public class BlockPortableNode extends BlockAiry {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {
|
public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {}
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void registerBlockIcons(IIconRegister ri) {
|
public void registerBlockIcons(IIconRegister ri) {
|
||||||
this.texture[0] = ri.registerIcon(ModInformation.texturePath + ":portablenode");
|
texture = ri.registerIcon(EMT.TEXTURE_PATH + ":portablenode");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(int side, int meta) {
|
public IIcon getIcon(int side, int meta) {
|
||||||
return this.texture[0];
|
return texture;
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
|
||||||
list.add(new ItemStack(id, 1, 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) {
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7,
|
||||||
|
float par8, float par9) {
|
||||||
if (!world.isRemote && player.isSneaking() && player.getHeldItem() == null) {
|
if (!world.isRemote && player.isSneaking() && player.getHeldItem() == null) {
|
||||||
world.setBlockToAir(x, y, z);
|
world.setBlockToAir(x, y, z);
|
||||||
world.removeTileEntity(x, y, z);
|
world.removeTileEntity(x, y, z);
|
||||||
@@ -100,7 +79,7 @@ public class BlockPortableNode extends BlockAiry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
public TileEntity createNewTileEntity(World worldIn, int meta) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+10
-22
@@ -1,19 +1,7 @@
|
|||||||
/*******************************************************************************
|
package emt.block;
|
||||||
* Copyright (c) 2014 Tombenpotter.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
|
||||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
|
||||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
|
||||||
* http://www.minecraftforum.net/topic/1585216-
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
package tombenpotter.emt.common.blocks;
|
import java.util.Random;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
@@ -22,16 +10,17 @@ import net.minecraft.entity.EnumCreatureType;
|
|||||||
import net.minecraft.world.Explosion;
|
import net.minecraft.world.Explosion;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import tombenpotter.emt.ElectroMagicTools;
|
|
||||||
import tombenpotter.emt.ModInformation;
|
|
||||||
|
|
||||||
import java.util.Random;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
|
||||||
public class BlockShield extends Block {
|
public class BlockShield extends Block {
|
||||||
|
|
||||||
public BlockShield() {
|
public BlockShield(String name) {
|
||||||
super(Material.rock);
|
super(Material.rock);
|
||||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
setBlockName(EMT.MOD_ID + "." + name);
|
||||||
|
this.setCreativeTab(EMT.TAB);
|
||||||
this.setHardness(1F);
|
this.setHardness(1F);
|
||||||
this.setResistance(10000000000000000000000000000000000000F);
|
this.setResistance(10000000000000000000000000000000000000F);
|
||||||
}
|
}
|
||||||
@@ -50,7 +39,7 @@ public class BlockShield extends Block {
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||||
this.blockIcon = iconRegister.registerIcon(ModInformation.texturePath + ":shield");
|
this.blockIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":shield");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -84,6 +73,5 @@ public class BlockShield extends Block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {
|
public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,155 @@
|
|||||||
|
package emt.block;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
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.IIcon;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import com.gtnewhorizons.modularui.api.UIInfos;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.tile.solar.Solars;
|
||||||
|
|
||||||
|
public class BlockSolars extends BlockBaseContainer {
|
||||||
|
|
||||||
|
public BlockSolars(String name, int countOfMetas, int instance) {
|
||||||
|
super(name, Material.iron, soundTypeMetal, countOfMetas, instance, 4.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister ir) {
|
||||||
|
IIcon solarTop = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/solartop");
|
||||||
|
IIcon doubleSolarTop = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/doublesolartop");
|
||||||
|
IIcon tripleSolarTop = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/triplesolartop");
|
||||||
|
|
||||||
|
IIcon bottom = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||||
|
|
||||||
|
IIcon side = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/side");
|
||||||
|
IIcon waterSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/water/waterside");
|
||||||
|
IIcon darkSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/dark/darkside");
|
||||||
|
IIcon orderSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/order/orderside");
|
||||||
|
IIcon fireSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/fire/fireside");
|
||||||
|
IIcon airSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/air/airside");
|
||||||
|
IIcon earthSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/earth/earthside");
|
||||||
|
|
||||||
|
IIcon[] sides = { side, orderSide, darkSide, airSide, earthSide, waterSide, fireSide };
|
||||||
|
|
||||||
|
if (instance != 1 && instance != 0) for (int i = 0; i < countOfMetas; i++) {
|
||||||
|
iconSets[i].bottom = bottom;
|
||||||
|
iconSets[i].side = sides[(Objects.requireNonNull(Solars.getTileEntitySolarBase(instance, i)).aspect)];
|
||||||
|
iconSets[i].top = tripleSolarTop;
|
||||||
|
}
|
||||||
|
else if (instance == 0) {
|
||||||
|
for (int i = 0; i < countOfMetas; i++) {
|
||||||
|
iconSets[i].bottom = bottom;
|
||||||
|
}
|
||||||
|
iconSets[0].top = solarTop;
|
||||||
|
iconSets[1].top = doubleSolarTop;
|
||||||
|
iconSets[2].top = tripleSolarTop;
|
||||||
|
iconSets[3].top = solarTop;
|
||||||
|
iconSets[4].top = doubleSolarTop;
|
||||||
|
iconSets[5].top = tripleSolarTop;
|
||||||
|
iconSets[6].top = solarTop;
|
||||||
|
iconSets[7].top = doubleSolarTop;
|
||||||
|
iconSets[8].top = tripleSolarTop;
|
||||||
|
iconSets[9].top = solarTop;
|
||||||
|
iconSets[10].top = doubleSolarTop;
|
||||||
|
iconSets[11].top = tripleSolarTop;
|
||||||
|
iconSets[12].top = solarTop;
|
||||||
|
iconSets[13].top = doubleSolarTop;
|
||||||
|
iconSets[14].top = tripleSolarTop;
|
||||||
|
iconSets[15].top = solarTop;
|
||||||
|
iconSets[0].side = side;
|
||||||
|
iconSets[1].side = side;
|
||||||
|
iconSets[2].side = side;
|
||||||
|
iconSets[3].side = waterSide;
|
||||||
|
iconSets[4].side = waterSide;
|
||||||
|
iconSets[5].side = waterSide;
|
||||||
|
iconSets[6].side = darkSide;
|
||||||
|
iconSets[7].side = darkSide;
|
||||||
|
iconSets[8].side = darkSide;
|
||||||
|
iconSets[9].side = orderSide;
|
||||||
|
iconSets[10].side = orderSide;
|
||||||
|
iconSets[11].side = orderSide;
|
||||||
|
iconSets[12].side = fireSide;
|
||||||
|
iconSets[13].side = fireSide;
|
||||||
|
iconSets[14].side = fireSide;
|
||||||
|
iconSets[15].side = airSide;
|
||||||
|
} else {
|
||||||
|
iconSets[0].top = doubleSolarTop;
|
||||||
|
iconSets[1].top = tripleSolarTop;
|
||||||
|
iconSets[2].top = solarTop;
|
||||||
|
iconSets[3].top = doubleSolarTop;
|
||||||
|
iconSets[4].top = tripleSolarTop;
|
||||||
|
for (int i = 0; i < countOfMetas; i++) {
|
||||||
|
iconSets[i].bottom = bottom;
|
||||||
|
}
|
||||||
|
iconSets[0].side = airSide;
|
||||||
|
iconSets[1].side = airSide;
|
||||||
|
iconSets[2].side = earthSide;
|
||||||
|
iconSets[3].side = earthSide;
|
||||||
|
iconSets[4].side = earthSide;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubBlocks(Item id, CreativeTabs tab, List<ItemStack> list) {
|
||||||
|
for (int meta = 0; meta < countOfMetas; meta++) {
|
||||||
|
list.add(new ItemStack(id, 1, meta));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int meta) {
|
||||||
|
|
||||||
|
if (meta >= countOfMetas) return null;
|
||||||
|
|
||||||
|
if (side < 1) {
|
||||||
|
return iconSets[meta].bottom;
|
||||||
|
}
|
||||||
|
if (side == 1) {
|
||||||
|
return iconSets[meta].top;
|
||||||
|
}
|
||||||
|
|
||||||
|
return iconSets[meta].side;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createTileEntity(World world, int meta) {
|
||||||
|
return Solars.getTileEntitySolarBase(instance, meta);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||||
|
world.removeTileEntity(x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, meta);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int s, float f1, float f2,
|
||||||
|
float f3) {
|
||||||
|
if (player.isSneaking()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (world.isRemote) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
TileEntity tileentity = world.getTileEntity(i, j, k);
|
||||||
|
if (tileentity != null) {
|
||||||
|
UIInfos.TILE_MODULAR_UI.open(player, world, i, j, k);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package emt.client;
|
||||||
|
|
||||||
|
import net.minecraft.client.settings.KeyBinding;
|
||||||
|
|
||||||
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTTextHelper;
|
||||||
|
|
||||||
|
public class EMTKeys {
|
||||||
|
|
||||||
|
public static KeyBinding keyUnequip;
|
||||||
|
|
||||||
|
public static void registerKeys() {
|
||||||
|
keyUnequip = new KeyBinding(EMTTextHelper.localize("gui.EMT.key.unequip"), Keyboard.KEY_NONE, EMT.NAME);
|
||||||
|
ClientRegistry.registerKeyBinding(keyUnequip);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package emt.client.gui;
|
||||||
|
|
||||||
|
import static emt.EMT.TEXTURE_PATH;
|
||||||
|
|
||||||
|
import com.gtnewhorizons.modularui.api.drawable.UITexture;
|
||||||
|
|
||||||
|
public class EMT_UITextures {
|
||||||
|
|
||||||
|
public static final UITexture OVERLAY_SLOT_FUSION_CRAFTING = UITexture
|
||||||
|
.fullImage(TEXTURE_PATH, "guis/overlay_slot/fusion_crafter");
|
||||||
|
public static final UITexture OVERLAY_SLOT_WAND = UITexture.fullImage(TEXTURE_PATH, "guis/overlay_slot/wand");
|
||||||
|
|
||||||
|
public static final UITexture PICTURE_GAUGE_EMPTY_25 = UITexture
|
||||||
|
.fullImage(TEXTURE_PATH, "guis/picture/gauge_empty_25");
|
||||||
|
public static final UITexture PICTURE_GAUGE_GENERATOR = UITexture
|
||||||
|
.fullImage(TEXTURE_PATH, "guis/picture/gauge_generator");
|
||||||
|
public static final UITexture PICTURE_GAUGE_SOLAR = UITexture.fullImage(TEXTURE_PATH, "guis/picture/gauge_solar");
|
||||||
|
public static final UITexture PICTURE_GAUGE_EMPTY_11 = UITexture
|
||||||
|
.fullImage(TEXTURE_PATH, "guis/picture/gauge_empty_11");
|
||||||
|
public static final UITexture PICTURE_SOLAR_INDICATOR = UITexture
|
||||||
|
.fullImage(TEXTURE_PATH, "guis/picture/solar_indicator");
|
||||||
|
}
|
||||||
+21
-14
@@ -1,33 +1,40 @@
|
|||||||
package tombenpotter.emt.client.gui.config;
|
package emt.client.gui.config;
|
||||||
|
|
||||||
|
import static emt.util.EMTConfigHandler.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import cpw.mods.fml.client.config.GuiConfig;
|
|
||||||
import cpw.mods.fml.client.config.IConfigElement;
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.util.StatCollector;
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraftforge.common.config.ConfigCategory;
|
import net.minecraftforge.common.config.ConfigCategory;
|
||||||
import net.minecraftforge.common.config.ConfigElement;
|
import net.minecraftforge.common.config.ConfigElement;
|
||||||
import tombenpotter.emt.ModInformation;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import cpw.mods.fml.client.config.GuiConfig;
|
||||||
import java.util.List;
|
import cpw.mods.fml.client.config.IConfigElement;
|
||||||
|
import emt.EMT;
|
||||||
import static tombenpotter.emt.common.util.ConfigHandler.*;
|
|
||||||
|
|
||||||
public class EMTGuiConfig extends GuiConfig {
|
public class EMTGuiConfig extends GuiConfig {
|
||||||
|
|
||||||
public EMTGuiConfig(GuiScreen parentScreen) {
|
public EMTGuiConfig(GuiScreen parentScreen) {
|
||||||
super(parentScreen, getConfigElements(parentScreen), ModInformation.modid, false, false, StatCollector.translateToLocal("gui." + ModInformation.modid + ".config.title"));
|
super(
|
||||||
|
parentScreen,
|
||||||
|
getConfigElements(parentScreen),
|
||||||
|
EMT.MOD_ID,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
StatCollector.translateToLocal("gui." + EMT.MOD_ID + ".config.title"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
private static List<IConfigElement> getConfigElements(GuiScreen parent) {
|
private static List<IConfigElement> getConfigElements(GuiScreen parent) {
|
||||||
List<IConfigElement> list = new ArrayList<IConfigElement>();
|
List<IConfigElement> list = new ArrayList<IConfigElement>();
|
||||||
|
|
||||||
list.add(new ConfigElement<ConfigCategory>(config.getCategory(CATEGORY_RANDOM.toLowerCase())));
|
list.add(new ConfigElement<ConfigCategory>(config.getCategory(RANDOM.toLowerCase(Locale.US))));
|
||||||
list.add(new ConfigElement<ConfigCategory>(config.getCategory(CATEGORY_VALUES.toLowerCase())));
|
list.add(new ConfigElement<ConfigCategory>(config.getCategory(VALUES.toLowerCase(Locale.US))));
|
||||||
list.add(new ConfigElement<ConfigCategory>(config.getCategory(CATEGORY_RESEARCH.toLowerCase())));
|
list.add(new ConfigElement<ConfigCategory>(config.getCategory(RESEARCH.toLowerCase(Locale.US))));
|
||||||
list.add(new ConfigElement<ConfigCategory>(config.getCategory(CATEGORY_OUTPUTS.toLowerCase())));
|
list.add(new ConfigElement<ConfigCategory>(config.getCategory(OUTPUTS.toLowerCase(Locale.US))));
|
||||||
list.add(new ConfigElement<ConfigCategory>(config.getCategory(CATEGORY_MODULES.toLowerCase())));
|
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
+5
-6
@@ -1,17 +1,16 @@
|
|||||||
package tombenpotter.emt.client.gui.config;
|
package emt.client.gui.config;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import cpw.mods.fml.client.IModGuiFactory;
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
|
|
||||||
import java.util.Set;
|
import cpw.mods.fml.client.IModGuiFactory;
|
||||||
|
|
||||||
public class EMTGuiFactory implements IModGuiFactory {
|
public class EMTGuiFactory implements IModGuiFactory {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize(Minecraft minecraftInstance) {
|
public void initialize(Minecraft minecraftInstance) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends GuiScreen> mainConfigGuiClass() {
|
public Class<? extends GuiScreen> mainConfigGuiClass() {
|
||||||
@@ -0,0 +1,142 @@
|
|||||||
|
package emt.client.model;
|
||||||
|
|
||||||
|
import net.minecraft.client.model.ModelBiped;
|
||||||
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumAction;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public class ModelSpecialArmor extends ModelBiped {
|
||||||
|
|
||||||
|
private static ModelSpecialArmor instance;
|
||||||
|
|
||||||
|
public ModelRenderer rightWing;
|
||||||
|
public ModelRenderer leftWing;
|
||||||
|
public ModelRenderer center;
|
||||||
|
public ModelRenderer jetpack;
|
||||||
|
public boolean isJumping;
|
||||||
|
public int type = 0; // 0 - Nothing, 1 - Jetpack, 2 - Wings
|
||||||
|
|
||||||
|
public ModelSpecialArmor() {
|
||||||
|
this(1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ModelSpecialArmor(float scale, int type) {
|
||||||
|
this(scale, 0.0F, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ModelSpecialArmor(float scale, float offset, int type) {
|
||||||
|
super(scale, offset, type == 1 ? 128 : 64, type == 0 ? 32 : type == 1 ? 96 : 64);
|
||||||
|
this.type = type;
|
||||||
|
|
||||||
|
this.textureWidth = 128;
|
||||||
|
this.textureHeight = 96;
|
||||||
|
this.jetpack = new ModelRenderer(this, 16, 69);
|
||||||
|
this.jetpack.setTextureSize(64, 48);
|
||||||
|
this.jetpack.addBox(-4.0F, -12.0F, -2.0F, 8, 12 * 2, 4, scale * 2);
|
||||||
|
this.jetpack.setRotationPoint(0.0F, 0.0F + offset, 0.0F);
|
||||||
|
|
||||||
|
this.textureWidth = 64;
|
||||||
|
this.textureHeight = 64;
|
||||||
|
rightWing = new ModelRenderer(this, 24, 0 + 32);
|
||||||
|
rightWing.addBox(-11F, -1F, 0F, 11, 13, 1);
|
||||||
|
rightWing.setRotationPoint(-2F, 0F, 3F);
|
||||||
|
rightWing.setTextureSize(64, 32);
|
||||||
|
rightWing.mirror = false;
|
||||||
|
setRotation(rightWing, 0F, 0.1570796F, 0F);
|
||||||
|
|
||||||
|
leftWing = new ModelRenderer(this, 0, 0 + 32);
|
||||||
|
leftWing.addBox(0F, -1F, 0F, 11, 13, 1);
|
||||||
|
leftWing.setRotationPoint(2F, 0F, 3F);
|
||||||
|
leftWing.setTextureSize(64, 32);
|
||||||
|
leftWing.mirror = true;
|
||||||
|
setRotation(leftWing, 0F, -0.1570796F, 0F);
|
||||||
|
|
||||||
|
center = new ModelRenderer(this, 0, 14 + 32);
|
||||||
|
center.addBox(0F, 0F, 1F, 8, 14, 1);
|
||||||
|
center.setRotationPoint(-4F, 0F, 3F);
|
||||||
|
center.setTextureSize(64, 32);
|
||||||
|
center.mirror = true;
|
||||||
|
setRotation(center, 0F, 0F, 0F);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ModelSpecialArmor getInstance() {
|
||||||
|
if (instance == null) instance = new ModelSpecialArmor();
|
||||||
|
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||||
|
model.rotateAngleX = x;
|
||||||
|
model.rotateAngleY = y;
|
||||||
|
model.rotateAngleZ = z;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render(Entity entity, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_,
|
||||||
|
float p_78088_6_, float scale) {
|
||||||
|
EntityPlayer player = (EntityPlayer) entity;
|
||||||
|
this.heldItemRight = player.inventory.getCurrentItem() != null ? 1 : 0;
|
||||||
|
this.isRiding = player.isRiding();
|
||||||
|
this.isSneak = player.isSneaking();
|
||||||
|
this.aimedBow = player.inventory.getCurrentItem() != null
|
||||||
|
&& player.inventory.getCurrentItem().getItem().getItemUseAction(player.inventory.getCurrentItem())
|
||||||
|
== EnumAction.bow
|
||||||
|
&& player.isUsingItem();
|
||||||
|
this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entity);
|
||||||
|
|
||||||
|
this.bipedBody.render(scale);
|
||||||
|
this.bipedRightArm.render(scale);
|
||||||
|
this.bipedLeftArm.render(scale);
|
||||||
|
switch (this.type) {
|
||||||
|
case 1:
|
||||||
|
this.jetpack.render(scale);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
this.center.render(scale);
|
||||||
|
this.leftWing.render(scale);
|
||||||
|
this.rightWing.render(scale);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_,
|
||||||
|
float p_78087_5_, float p_78087_6_, Entity entity) {
|
||||||
|
super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, entity);
|
||||||
|
if (this.isJumping) {
|
||||||
|
this.rightWing.rotateAngleY = 0.5f;
|
||||||
|
this.leftWing.rotateAngleY = -0.5f;
|
||||||
|
} else {
|
||||||
|
this.rightWing.rotateAngleY = 0.1570796F;
|
||||||
|
this.leftWing.rotateAngleY = -0.1570796F;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.isSneak) {
|
||||||
|
switch (this.type) {
|
||||||
|
case 1:
|
||||||
|
this.jetpack.rotateAngleX = 0.5F;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
this.center.rotateAngleX = 0.5F;
|
||||||
|
this.rightWing.rotateAngleX = 0.5F;
|
||||||
|
this.leftWing.rotateAngleX = 0.5F;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
switch (this.type) {
|
||||||
|
case 1:
|
||||||
|
this.jetpack.rotateAngleX = 0F;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
this.center.rotateAngleX = 0F;
|
||||||
|
this.rightWing.rotateAngleX = 0F;
|
||||||
|
this.leftWing.rotateAngleX = 0F;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+33
-18
@@ -1,13 +1,18 @@
|
|||||||
package tombenpotter.emt.client.model;
|
package emt.client.model;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.model.ModelBiped;
|
import net.minecraft.client.model.ModelBiped;
|
||||||
import net.minecraft.client.model.ModelRenderer;
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ModelWings extends ModelBiped {
|
public class ModelWings extends ModelBiped {
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private static ModelWings instance = null;
|
||||||
|
|
||||||
|
public boolean isJumping = false;
|
||||||
ModelRenderer rightWing;
|
ModelRenderer rightWing;
|
||||||
ModelRenderer leftWing;
|
ModelRenderer leftWing;
|
||||||
ModelRenderer center;
|
ModelRenderer center;
|
||||||
@@ -42,6 +47,12 @@ public class ModelWings extends ModelBiped {
|
|||||||
this.bipedBody.addChild(center);
|
this.bipedBody.addChild(center);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ModelWings getInstance() {
|
||||||
|
if (instance == null) instance = new ModelWings();
|
||||||
|
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||||
@@ -50,27 +61,31 @@ public class ModelWings extends ModelBiped {
|
|||||||
center.render(f5);
|
center.render(f5);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setRotation (ModelRenderer model, float x, float y, float z)
|
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||||
{
|
|
||||||
model.rotateAngleX = x;
|
model.rotateAngleX = x;
|
||||||
model.rotateAngleY = y;
|
model.rotateAngleY = y;
|
||||||
model.rotateAngleZ = z;
|
model.rotateAngleZ = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRotationAngles(float f, float f1, float pt, float f3, float f4, float f5, Entity entity){
|
public void setRotationAngles(float limbSwing, float limbSwingAmount, float playerTicksExisted,
|
||||||
|
float playerRotationYawHead, float playerRotationPitch, float f5, Entity entity) {
|
||||||
|
|
||||||
if(Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed()){
|
if (isJumping) {
|
||||||
this.rightWing.rotateAngleY = 0.5f;
|
this.rightWing.rotateAngleY = 0.5f;
|
||||||
this.leftWing.rotateAngleY = -0.5f;
|
this.leftWing.rotateAngleY = -0.5f;
|
||||||
}
|
} else {
|
||||||
|
this.rightWing.rotateAngleY = 0.1570796F;
|
||||||
|
this.leftWing.rotateAngleY = -0.1570796F;
|
||||||
|
}
|
||||||
|
|
||||||
if(entity.isSneaking()){
|
if (entity.isSneaking()) {
|
||||||
this.center.offsetY -= 0.1;
|
this.center.rotateAngleX = 0.5F;
|
||||||
this.rightWing.offsetY -= 0.1;
|
this.rightWing.rotateAngleX = 0.5F;
|
||||||
this.leftWing.offsetY -= 0.1;
|
this.leftWing.rotateAngleX = 0.5F;
|
||||||
this.center.rotateAngleX = 0.5F;
|
} else {
|
||||||
this.rightWing.rotateAngleX = 0.5F;
|
this.center.rotateAngleX = 0.0F;
|
||||||
this.leftWing.rotateAngleX = 0.5F;
|
this.rightWing.rotateAngleX = 0;
|
||||||
}
|
this.leftWing.rotateAngleX = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package emt.client.renderer;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.client.renderer.entity.Render;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import org.lwjgl.opengl.GL12;
|
||||||
|
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.entity.EntityLaser;
|
||||||
|
|
||||||
|
public class RenderLaser extends Render {
|
||||||
|
|
||||||
|
private static final ResourceLocation laserTexture = new ResourceLocation(
|
||||||
|
EMT.TEXTURE_PATH,
|
||||||
|
"textures/models/lasermodel.png");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doRender(Entity entityLaser, double x, double y, double z, float par8, float pTick) {
|
||||||
|
this.bindEntityTexture(entityLaser);
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glTranslated(x, y, z);
|
||||||
|
GL11.glRotatef(entityLaser.rotationYaw - 90, 0, 1, 0);
|
||||||
|
GL11.glRotatef(entityLaser.rotationPitch, 0, 0, 1);
|
||||||
|
Tessellator tess = Tessellator.instance;
|
||||||
|
byte b0 = 0;
|
||||||
|
float f2 = 0.4f;
|
||||||
|
float f3 = 0.7f;
|
||||||
|
float f4 = (float) (0 + b0 * 10) / 32f;
|
||||||
|
float f5 = (float) (5 + b0 * 10) / 32f;
|
||||||
|
float f10 = 0.05625F;
|
||||||
|
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||||
|
|
||||||
|
GL11.glRotatef(45, 1, 0, 0);
|
||||||
|
GL11.glScalef(f10, f10, f10);
|
||||||
|
GL11.glTranslatef(-4, 0, 0);
|
||||||
|
GL11.glPushAttrib(GL11.GL_LIGHTING);
|
||||||
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; ++i) {
|
||||||
|
GL11.glRotatef(90, 1, 0, 0);
|
||||||
|
GL11.glNormal3f(0, 0, f10);
|
||||||
|
tess.startDrawingQuads();
|
||||||
|
tess.addVertexWithUV(-8, 0, 0, f2, f4);
|
||||||
|
tess.addVertexWithUV(8, 0, 0, f3, f4);
|
||||||
|
tess.addVertexWithUV(8, 4, 0, f3, f5);
|
||||||
|
tess.addVertexWithUV(-8, 4, 0, f2, f5);
|
||||||
|
tess.draw();
|
||||||
|
|
||||||
|
tess.startDrawingQuads();
|
||||||
|
tess.addVertexWithUV(8, 0, 0, f2, f4);
|
||||||
|
tess.addVertexWithUV(-8, 0, 0, f3, f4);
|
||||||
|
tess.addVertexWithUV(-8, 4, 0, f3, f5);
|
||||||
|
tess.addVertexWithUV(8, 4, 0, f2, f5);
|
||||||
|
tess.draw();
|
||||||
|
}
|
||||||
|
GL11.glPopAttrib();
|
||||||
|
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ResourceLocation getArrowTextures(EntityLaser entityLaser) {
|
||||||
|
return laserTexture;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ResourceLocation getEntityTexture(Entity entity) {
|
||||||
|
return this.getArrowTextures((EntityLaser) entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
package emt.client.renderer;
|
||||||
|
|
||||||
|
import static org.lwjgl.opengl.GL11.*;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.GLAllocation;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.client.renderer.entity.Render;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import org.lwjgl.opengl.GL12;
|
||||||
|
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.entity.EntityShield;
|
||||||
|
|
||||||
|
public class RenderShield extends Render {
|
||||||
|
|
||||||
|
private static final ResourceLocation shieldTexture = new ResourceLocation(
|
||||||
|
EMT.TEXTURE_PATH,
|
||||||
|
"textures/models/shield.png");
|
||||||
|
static int glCallList;
|
||||||
|
|
||||||
|
static {
|
||||||
|
glCallList = GLAllocation.generateDisplayLists(3);
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glNewList(glCallList, GL11.GL_COMPILE);
|
||||||
|
|
||||||
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
|
float sin1;
|
||||||
|
float cos1;
|
||||||
|
|
||||||
|
float sin2;
|
||||||
|
float cos2;
|
||||||
|
|
||||||
|
float hsin1 = -1;
|
||||||
|
float hcos1 = 0;
|
||||||
|
|
||||||
|
float hsin2;
|
||||||
|
float hcos2;
|
||||||
|
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
for (float h = -90; h < 90; h += 15) {
|
||||||
|
sin1 = 0;
|
||||||
|
cos1 = 1;
|
||||||
|
|
||||||
|
hsin2 = MathHelper.sin((float) Math.toRadians(h + 15));
|
||||||
|
hcos2 = MathHelper.cos((float) Math.toRadians(h + 15));
|
||||||
|
|
||||||
|
for (float angle = 0; angle < 360; angle += 15) {
|
||||||
|
sin2 = MathHelper.sin((float) Math.toRadians(angle + 15));
|
||||||
|
cos2 = MathHelper.cos((float) Math.toRadians(angle + 15));
|
||||||
|
|
||||||
|
tessellator.addVertexWithUV(sin1 * hcos1 * 2, hsin1 * 2, cos1 * hcos1 * 2, 1, 1);
|
||||||
|
tessellator.addVertexWithUV(sin1 * hcos2 * 2, hsin2 * 2, cos1 * hcos2 * 2, 1, 0);
|
||||||
|
tessellator.addVertexWithUV(sin2 * hcos2 * 2, hsin2 * 2, cos2 * hcos2 * 2, 0, 0);
|
||||||
|
tessellator.addVertexWithUV(sin2 * hcos1 * 2, hsin1 * 2, cos2 * hcos1 * 2, 0, 1);
|
||||||
|
|
||||||
|
sin1 = sin2;
|
||||||
|
cos1 = cos2;
|
||||||
|
}
|
||||||
|
|
||||||
|
hsin1 = hsin2;
|
||||||
|
hcos1 = hcos2;
|
||||||
|
}
|
||||||
|
tessellator.draw();
|
||||||
|
|
||||||
|
GL11.glEndList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doRender(Entity entityShield, double x, double y, double z, float par8, float par9) {
|
||||||
|
this.bindEntityTexture(entityShield);
|
||||||
|
|
||||||
|
glEnable(GL_ALPHA_TEST);
|
||||||
|
glAlphaFunc(GL_GREATER, 0);
|
||||||
|
glEnable(GL_BLEND);
|
||||||
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
glPushAttrib(GL_LIGHTING);
|
||||||
|
glDisable(GL_LIGHTING);
|
||||||
|
glDisable(GL_CULL_FACE);
|
||||||
|
|
||||||
|
glPushMatrix();
|
||||||
|
if (((EntityShield) entityShield).owner != null && !Minecraft.getMinecraft().thePlayer.getDisplayName()
|
||||||
|
.equals(((EntityShield) entityShield).owner.getDisplayName())) {
|
||||||
|
glTranslated(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
glCallList(glCallList);
|
||||||
|
|
||||||
|
glPopMatrix();
|
||||||
|
glPopAttrib();
|
||||||
|
glDisable(GL12.GL_RESCALE_NORMAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ResourceLocation getEntityTexture(Entity texture) {
|
||||||
|
return shieldTexture;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
package emt.command;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.command.CommandBase;
|
||||||
|
import net.minecraft.command.ICommand;
|
||||||
|
import net.minecraft.command.ICommandSender;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.nbt.NBTTagList;
|
||||||
|
import net.minecraft.nbt.NBTTagString;
|
||||||
|
|
||||||
|
import emt.util.EMTEssentiasOutputs;
|
||||||
|
import emt.util.EMTTextHelper;
|
||||||
|
import thaumcraft.api.aspects.Aspect;
|
||||||
|
|
||||||
|
public class CommandOutputs extends CommandBase {
|
||||||
|
|
||||||
|
public static ItemStack mkbook() {
|
||||||
|
String text = EMTTextHelper.localize("gui.EMT.book.aspect.output.essentia.eu") + ": \n";
|
||||||
|
String text2 = EMTTextHelper.localize("gui.EMT.book.aspect.output.essentia.eu") + " /t: \n";
|
||||||
|
String text3 = EMTTextHelper.localize("gui.EMT.book.aspect.output.essentia.eu") + " /t singleblock: \n";
|
||||||
|
|
||||||
|
final String title = EMTTextHelper.localize("gui.EMT.book.aspect.output.eu.title");
|
||||||
|
|
||||||
|
final ArrayList<String> singleblock = new ArrayList<String>();
|
||||||
|
final ArrayList<String> bookL = new ArrayList<String>();
|
||||||
|
final ArrayList<String> bookL2 = new ArrayList<String>();
|
||||||
|
|
||||||
|
byte counter = 0;
|
||||||
|
|
||||||
|
for (final Aspect aspect : Aspect.aspects.values()) {
|
||||||
|
++counter;
|
||||||
|
|
||||||
|
if (aspect.equals(Aspect.ENERGY) || aspect.equals(Aspect.TREE)
|
||||||
|
|| aspect.equals(Aspect.FIRE)
|
||||||
|
|| aspect.equals(Aspect.AURA)
|
||||||
|
|| aspect.equals(Aspect.GREED)
|
||||||
|
|| aspect.equals(Aspect.AIR))
|
||||||
|
text3 += aspect.getTag() + ": "
|
||||||
|
+ String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()) / 20D / 20D)
|
||||||
|
+ "EU\n";
|
||||||
|
|
||||||
|
if (counter < 12) {
|
||||||
|
text2 += aspect.getTag() + ": "
|
||||||
|
+ String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()) / 20D)
|
||||||
|
+ "EU/t\n";
|
||||||
|
text += aspect.getTag() + ": "
|
||||||
|
+ String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()))
|
||||||
|
+ "EU\n";
|
||||||
|
} else {
|
||||||
|
text2 += aspect.getTag() + ": "
|
||||||
|
+ String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()) / 20D)
|
||||||
|
+ "EU\n";
|
||||||
|
text += aspect.getTag() + ": "
|
||||||
|
+ String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()))
|
||||||
|
+ "EU\n";
|
||||||
|
bookL.add(text);
|
||||||
|
bookL2.add(text2);
|
||||||
|
text2 = "";
|
||||||
|
text = "";
|
||||||
|
counter = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
singleblock.add(text3);
|
||||||
|
|
||||||
|
if (counter != 0) {
|
||||||
|
bookL.add(text);
|
||||||
|
bookL2.add(text2);
|
||||||
|
}
|
||||||
|
|
||||||
|
final ItemStack book = new ItemStack(Items.written_book);
|
||||||
|
book.setTagInfo("author", new NBTTagString("Tombenpotter, bartimaeusnek"));
|
||||||
|
book.setTagInfo("title", new NBTTagString(title));
|
||||||
|
final NBTTagCompound nbttagcompound = book.getTagCompound();
|
||||||
|
final NBTTagList bookPages = new NBTTagList();
|
||||||
|
|
||||||
|
for (int i = 0; i < singleblock.size(); i++) {
|
||||||
|
bookPages.appendTag(new NBTTagString(singleblock.get(i)));
|
||||||
|
}
|
||||||
|
for (int i = 0; i < bookL.size(); i++) {
|
||||||
|
bookPages.appendTag(new NBTTagString(bookL.get(i)));
|
||||||
|
}
|
||||||
|
for (int i = 0; i < bookL2.size(); i++) {
|
||||||
|
bookPages.appendTag(new NBTTagString(bookL2.get(i)));
|
||||||
|
}
|
||||||
|
nbttagcompound.setTag("pages", bookPages);
|
||||||
|
return book;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCommandName() {
|
||||||
|
return "emt_outputs";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCommandUsage(ICommandSender sender) {
|
||||||
|
return "/emt_outputs";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canCommandSenderUseCommand(ICommandSender par1iCommandSender) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> addTabCompletionOptions(ICommandSender command, String[] stringArray) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(Object object) {
|
||||||
|
if (object instanceof ICommand) {
|
||||||
|
return this.compareTo((ICommand) object);
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void processCommand(ICommandSender command, String[] astring) {
|
||||||
|
ItemStack book = mkbook();
|
||||||
|
|
||||||
|
if (!command.getEntityWorld().getPlayerEntityByName(command.getCommandSenderName()).inventory
|
||||||
|
.addItemStackToInventory(book))
|
||||||
|
command.getEntityWorld().getPlayerEntityByName(command.getCommandSenderName()).entityDropItem(book, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
+35
-40
@@ -1,16 +1,4 @@
|
|||||||
/*******************************************************************************
|
package emt.entity;
|
||||||
* Copyright (c) 2014 Tombenpotter.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
|
||||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
|
||||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
|
||||||
* http://www.minecraftforum.net/topic/1585216-
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
package tombenpotter.emt.common.entities;
|
|
||||||
|
|
||||||
import net.minecraft.enchantment.Enchantment;
|
import net.minecraft.enchantment.Enchantment;
|
||||||
import net.minecraft.enchantment.EnchantmentHelper;
|
import net.minecraft.enchantment.EnchantmentHelper;
|
||||||
@@ -26,7 +14,6 @@ import net.minecraft.entity.monster.EntitySnowman;
|
|||||||
import net.minecraft.entity.monster.IMob;
|
import net.minecraft.entity.monster.IMob;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.projectile.EntityArrow;
|
import net.minecraft.entity.projectile.EntityArrow;
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@@ -37,25 +24,29 @@ import net.minecraftforge.common.IExtendedEntityProperties;
|
|||||||
|
|
||||||
public class EntityArcher extends EntitySnowman implements IExtendedEntityProperties {
|
public class EntityArcher extends EntitySnowman implements IExtendedEntityProperties {
|
||||||
|
|
||||||
public EntityArcher(World par1World) {
|
public EntityArcher(World world) {
|
||||||
super(par1World);
|
super(world);
|
||||||
this.isImmuneToFire = true;
|
|
||||||
this.tasks.addTask(1, new EntityAISwimming(this));
|
this.tasks.addTask(1, new EntityAISwimming(this));
|
||||||
this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
|
this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
|
||||||
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector));
|
this.targetTasks.addTask(
|
||||||
|
3,
|
||||||
|
new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector));
|
||||||
this.tasks.addTask(4, new EntityAIWander(this, 0.30D));
|
this.tasks.addTask(4, new EntityAIWander(this, 0.30D));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void applyEntityAttributes() {
|
protected void applyEntityAttributes() {
|
||||||
super.applyEntityAttributes();
|
super.applyEntityAttributes();
|
||||||
|
|
||||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30D);
|
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30D);
|
||||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D);
|
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDeath(DamageSource par1DamageSource) {
|
public void onDeath(DamageSource damageSource) {
|
||||||
super.onDeath(par1DamageSource);
|
super.onDeath(damageSource);
|
||||||
|
|
||||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1, true);
|
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1, true);
|
||||||
this.setDead();
|
this.setDead();
|
||||||
}
|
}
|
||||||
@@ -66,16 +57,16 @@ public class EntityArcher extends EntitySnowman implements IExtendedEntityProper
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dropFewItems(boolean par1, int par2) {
|
protected void dropFewItems(boolean hitByPlayer, int levelOfLooting) {
|
||||||
int j;
|
int j;
|
||||||
int k;
|
int k;
|
||||||
|
|
||||||
j = this.rand.nextInt(3 + par2);
|
j = this.rand.nextInt(3 + levelOfLooting);
|
||||||
|
|
||||||
for (k = 0; k < j; ++k) {
|
for (k = 0; k < j; ++k) {
|
||||||
this.dropItem(Items.arrow, 1);
|
this.dropItem(Items.arrow, 1);
|
||||||
}
|
}
|
||||||
j = this.rand.nextInt(3 + par2);
|
j = this.rand.nextInt(3 + levelOfLooting);
|
||||||
|
|
||||||
for (k = 0; k < j; ++k) {
|
for (k = 0; k < j; ++k) {
|
||||||
this.dropItem(Items.bone, 1);
|
this.dropItem(Items.bone, 1);
|
||||||
@@ -83,8 +74,8 @@ public class EntityArcher extends EntitySnowman implements IExtendedEntityProper
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dropRareDrop(int par1) {
|
protected void dropRareDrop(int ch) {
|
||||||
this.entityDropItem(new ItemStack(Blocks.web, 1, 1), 0.0F);
|
this.entityDropItem(new ItemStack(Items.snowball, 1, 1), 0.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addRandomArmor() {
|
protected void addRandomArmor() {
|
||||||
@@ -93,18 +84,25 @@ public class EntityArcher extends EntitySnowman implements IExtendedEntityProper
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) {
|
public void attackEntityWithRangedAttack(EntityLivingBase entity, float par2) {
|
||||||
EntityArrow entityarrow = new EntityArrow(this.worldObj, this, par1EntityLivingBase, 1.6F, (float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4));
|
EntityArrow entityarrow = new EntityArrow(
|
||||||
int i = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem());
|
this.worldObj,
|
||||||
int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem());
|
this,
|
||||||
entityarrow.setDamage((double) (par2 * 2.0F) + this.rand.nextGaussian() * 0.25D + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F));
|
entity,
|
||||||
|
1.6F,
|
||||||
|
(float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4));
|
||||||
|
int powerLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem());
|
||||||
|
int punchLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem());
|
||||||
|
entityarrow.setDamage(
|
||||||
|
(double) (par2 * 2.0F) + this.rand.nextGaussian() * 0.25D
|
||||||
|
+ (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F));
|
||||||
|
|
||||||
if (i > 0) {
|
if (powerLevel > 0) {
|
||||||
entityarrow.setDamage(entityarrow.getDamage() + (double) i * 0.5D + 0.5D);
|
entityarrow.setDamage(entityarrow.getDamage() + (double) powerLevel * 0.5D + 0.5D);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (j > 0) {
|
if (punchLevel > 0) {
|
||||||
entityarrow.setKnockbackStrength(j);
|
entityarrow.setKnockbackStrength(punchLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0) {
|
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0) {
|
||||||
@@ -116,14 +114,11 @@ public class EntityArcher extends EntitySnowman implements IExtendedEntityProper
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveNBTData(NBTTagCompound compound) {
|
public void saveNBTData(NBTTagCompound compound) {}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadNBTData(NBTTagCompound compound) {
|
public void loadNBTData(NBTTagCompound compound) {}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Entity entity, World world) {
|
public void init(Entity entity, World world) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,243 @@
|
|||||||
|
package emt.entity;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.IProjectile;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.nbt.NBTTagList;
|
||||||
|
import net.minecraft.util.DamageSource;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.chunk.Chunk;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import io.netty.buffer.ByteBuf;
|
||||||
|
import thaumcraft.common.Thaumcraft;
|
||||||
|
|
||||||
|
public class EntityEnergyBall extends Entity implements IProjectile, IEntityAdditionalSpawnData {
|
||||||
|
|
||||||
|
public static final int RADIUS = 8;
|
||||||
|
public static final int MAX_TICKS_IN_TILE = 60;
|
||||||
|
|
||||||
|
public EntityLivingBase shootingEntity;
|
||||||
|
|
||||||
|
public boolean inTile = false;
|
||||||
|
public int ticksAlive = 1;
|
||||||
|
/**
|
||||||
|
* Pls, don't ask me why 1 =)
|
||||||
|
**/
|
||||||
|
public int ticksInAir = 1;
|
||||||
|
|
||||||
|
public double accelerationX = 0;
|
||||||
|
public double accelerationY = 0;
|
||||||
|
public double accelerationZ = 0;
|
||||||
|
|
||||||
|
public EntityEnergyBall(World world, EntityLivingBase shootingEntity, double rotX, double rotY, double rotZ) {
|
||||||
|
this(world, shootingEntity);
|
||||||
|
|
||||||
|
rotX += this.rand.nextGaussian() * 0.4D;
|
||||||
|
rotY += this.rand.nextGaussian() * 0.4D;
|
||||||
|
rotZ += this.rand.nextGaussian() * 0.4D;
|
||||||
|
double len = (double) MathHelper.sqrt_double((rotX * rotX) + (rotY * rotY) + (rotZ * rotZ));
|
||||||
|
this.accelerationX = rotX / len * 0.1D;
|
||||||
|
this.accelerationY = rotY / len * 0.1D;
|
||||||
|
this.accelerationZ = rotZ / len * 0.1D;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityEnergyBall(World world, EntityLivingBase shootingEntity) {
|
||||||
|
this(world);
|
||||||
|
|
||||||
|
this.shootingEntity = shootingEntity;
|
||||||
|
this.setLocationAndAngles(
|
||||||
|
shootingEntity.posX,
|
||||||
|
shootingEntity.posY + shootingEntity.getEyeHeight(),
|
||||||
|
shootingEntity.posZ,
|
||||||
|
shootingEntity.rotationYaw,
|
||||||
|
shootingEntity.rotationPitch);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityEnergyBall(World world) {
|
||||||
|
super(world);
|
||||||
|
|
||||||
|
this.setSize(1.0F, 1.0F);
|
||||||
|
this.ignoreFrustumCheck = true;
|
||||||
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
|
this.yOffset = 0.0F;
|
||||||
|
this.motionX = this.motionY = this.motionZ = 0.0D;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeSpawnData(ByteBuf buffer) {
|
||||||
|
buffer.writeDouble(accelerationX);
|
||||||
|
buffer.writeDouble(accelerationY);
|
||||||
|
buffer.writeDouble(accelerationZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readSpawnData(ByteBuf buffer) {
|
||||||
|
accelerationX = buffer.readDouble();
|
||||||
|
accelerationY = buffer.readDouble();
|
||||||
|
accelerationZ = buffer.readDouble();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
super.onUpdate();
|
||||||
|
|
||||||
|
/** If in Tile **/
|
||||||
|
if (this.inTile) {
|
||||||
|
this.ticksAlive++;
|
||||||
|
|
||||||
|
if (this.ticksAlive >= MAX_TICKS_IN_TILE) {
|
||||||
|
this.setDead();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Generating Coords for every Entity **/
|
||||||
|
ArrayList<Entity> entities = new ArrayList<>();
|
||||||
|
|
||||||
|
int chunkSize = ((RADIUS - 1) >> 4) + 2;
|
||||||
|
|
||||||
|
for (int chX = -chunkSize; chX < chunkSize; chX++) {
|
||||||
|
for (int chZ = -chunkSize; chZ < chunkSize; chZ++) {
|
||||||
|
Chunk chunk = worldObj
|
||||||
|
.getChunkFromChunkCoords(chX + (int) (this.posX / 16), chZ + (int) (this.posZ / 16));
|
||||||
|
|
||||||
|
if (chunk.isChunkLoaded && chunk.hasEntities) {
|
||||||
|
for (int i = 0; i < chunk.entityLists.length; i++) {
|
||||||
|
for (int k = 0; k < chunk.entityLists[i].size(); k++) {
|
||||||
|
Entity entity = (Entity) chunk.entityLists[i].get(k);
|
||||||
|
double width = entity.posX - this.posX;
|
||||||
|
double height = entity.posY - this.posY;
|
||||||
|
double length = entity.posZ - this.posZ;
|
||||||
|
double hyp = MathHelper
|
||||||
|
.sqrt_double((width * width) + (length * length) + (height * height));
|
||||||
|
|
||||||
|
if (hyp <= RADIUS) {
|
||||||
|
entities.add(entity);
|
||||||
|
/** Closer - Harder */
|
||||||
|
entity.attackEntityFrom(DamageSource.magic, (float) (RADIUS - hyp));
|
||||||
|
|
||||||
|
if (worldObj.isRemote) {
|
||||||
|
Thaumcraft.proxy.bolt(worldObj, this, entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/************************************************************************/
|
||||||
|
}
|
||||||
|
/** If not in Tile **/
|
||||||
|
else {
|
||||||
|
/** Collision detection **/
|
||||||
|
Vec3 vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
|
||||||
|
Vec3 vec3next = Vec3
|
||||||
|
.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
MovingObjectPosition mop = this.worldObj.rayTraceBlocks(vec3, vec3next);
|
||||||
|
|
||||||
|
this.ticksInAir++;
|
||||||
|
if (mop != null) {
|
||||||
|
inTile = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Updating position */
|
||||||
|
this.posX += this.motionX;
|
||||||
|
this.posY += this.motionY;
|
||||||
|
this.posZ += this.motionZ;
|
||||||
|
float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
|
this.rotationYaw = (float) (Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F;
|
||||||
|
|
||||||
|
for (this.rotationPitch = (float) (Math.atan2((double) f1, this.motionY) * 180.0D / Math.PI)
|
||||||
|
- 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (this.rotationPitch - this.prevRotationPitch >= 180.0F) {
|
||||||
|
this.prevRotationPitch += 360.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (this.rotationYaw - this.prevRotationYaw < -180.0F) {
|
||||||
|
this.prevRotationYaw -= 360.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (this.rotationYaw - this.prevRotationYaw >= 180.0F) {
|
||||||
|
this.prevRotationYaw += 360.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
|
||||||
|
this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
|
||||||
|
|
||||||
|
double factor = this.getMotionFactor();
|
||||||
|
this.motionX += this.accelerationX;
|
||||||
|
this.motionY += this.accelerationY;
|
||||||
|
this.motionZ += this.accelerationZ;
|
||||||
|
this.motionX *= factor;
|
||||||
|
this.motionY *= factor;
|
||||||
|
this.motionZ *= factor;
|
||||||
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
|
/************************************************************************/
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < 3 && worldObj.isRemote; i++) {
|
||||||
|
float rndX = (float) ((((worldObj.rand.nextFloat() - 0.5f) * 2) * (RADIUS - 4)) + posX);
|
||||||
|
float rndY = (float) ((((worldObj.rand.nextFloat() - 0.5f) * 2) * (RADIUS - 4)) + posY);
|
||||||
|
float rndZ = (float) ((((worldObj.rand.nextFloat() - 0.5f) * 2) * (RADIUS - 4)) + posZ);
|
||||||
|
Thaumcraft.proxy.nodeBolt(worldObj, (float) posX, (float) posY, (float) posZ, rndX, rndY, rndZ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected float getMotionFactor() {
|
||||||
|
return 0.85F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canBeCollidedWith() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getBrightnessForRender(float p_70070_1_) {
|
||||||
|
return 240;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public boolean isInRangeToRender3d(double x, double y, double z) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void entityInit() {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeEntityToNBT(NBTTagCompound nbt) {
|
||||||
|
nbt.setByte("inTile", (byte) (this.inTile ? 1 : 0));
|
||||||
|
nbt.setTag("direction", this.newDoubleNBTList(new double[] { this.motionX, this.motionY, this.motionZ }));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readEntityFromNBT(NBTTagCompound nbt) {
|
||||||
|
if (!inTile) {
|
||||||
|
this.inTile = nbt.getByte("inTile") == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nbt.hasKey("direction", 9)) {
|
||||||
|
NBTTagList nbttaglist = nbt.getTagList("direction", 6);
|
||||||
|
this.motionX = nbttaglist.func_150309_d(0);
|
||||||
|
this.motionY = nbttaglist.func_150309_d(1);
|
||||||
|
this.motionZ = nbttaglist.func_150309_d(2);
|
||||||
|
} else {
|
||||||
|
this.setDead();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setThrowableHeading(double x, double y, double z, float p1, float p2) {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,326 @@
|
|||||||
|
package emt.entity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.IProjectile;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.registry.IThrowableEntity;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
public class EntityLaser extends Entity implements IThrowableEntity, IProjectile {
|
||||||
|
|
||||||
|
public Entity shootingEntity;
|
||||||
|
private Block inTile;
|
||||||
|
private int xTile;
|
||||||
|
private int yTile;
|
||||||
|
private int zTile;
|
||||||
|
private int meta;
|
||||||
|
private boolean inGround = false;
|
||||||
|
private int ticksInGround;
|
||||||
|
private int ticksInAir;
|
||||||
|
private float explosionStrength = 2f;
|
||||||
|
|
||||||
|
public EntityLaser(World world) {
|
||||||
|
super(world);
|
||||||
|
|
||||||
|
this.renderDistanceWeight = 10.0D;
|
||||||
|
this.setSize(0.5F, 0.5F);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityLaser(World world, EntityLivingBase entity, float speed) {
|
||||||
|
super(world);
|
||||||
|
this.renderDistanceWeight = 10.0D;
|
||||||
|
this.shootingEntity = entity;
|
||||||
|
|
||||||
|
this.setSize(0.5F, 0.5F);
|
||||||
|
this.setLocationAndAngles(
|
||||||
|
entity.posX,
|
||||||
|
entity.posY + (double) entity.getEyeHeight(),
|
||||||
|
entity.posZ,
|
||||||
|
entity.rotationYaw,
|
||||||
|
entity.rotationPitch);
|
||||||
|
this.posX -= (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F);
|
||||||
|
this.posY -= 0.10000000149011612D;
|
||||||
|
this.posZ -= (double) (MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F);
|
||||||
|
this.yOffset = 0.0F;
|
||||||
|
|
||||||
|
this.motionX = (double) (-MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI)
|
||||||
|
* MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI));
|
||||||
|
this.motionZ = (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI)
|
||||||
|
* MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI));
|
||||||
|
this.motionY = (double) (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI));
|
||||||
|
|
||||||
|
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, speed, 1.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExplosionStrengthModifier(float f) {
|
||||||
|
explosionStrength = f;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void entityInit() {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setThrowableHeading(double x, double y, double z, float speed, float scale) {
|
||||||
|
this.motionX = x * speed;
|
||||||
|
this.motionY = y * speed;
|
||||||
|
this.motionZ = z * speed;
|
||||||
|
this.ticksInGround = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void setPositionAndRotation2(double x, double y, double z, float rotX, float rotY, int rotZ) {
|
||||||
|
this.setPosition(x, y, z);
|
||||||
|
this.setRotation(rotX, rotY);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void setVelocity(double velX, double velY, double velZ) {
|
||||||
|
this.motionX = velX;
|
||||||
|
this.motionY = velY;
|
||||||
|
this.motionZ = velZ;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
super.onUpdate();
|
||||||
|
|
||||||
|
Block block = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile);
|
||||||
|
|
||||||
|
if (block.getMaterial() != Material.air) {
|
||||||
|
block.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile);
|
||||||
|
AxisAlignedBB axisalignedbb = block
|
||||||
|
.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);
|
||||||
|
|
||||||
|
if (axisalignedbb != null
|
||||||
|
&& axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) {
|
||||||
|
this.inGround = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
block.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile);
|
||||||
|
AxisAlignedBB axisalignedbb = block
|
||||||
|
.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);
|
||||||
|
|
||||||
|
if (axisalignedbb != null
|
||||||
|
&& axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) {
|
||||||
|
this.inGround = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.inGround) {
|
||||||
|
int k = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile);
|
||||||
|
if (!this.worldObj.isRemote) {
|
||||||
|
this.worldObj.createExplosion(
|
||||||
|
this,
|
||||||
|
(int) this.posX,
|
||||||
|
(int) this.posY,
|
||||||
|
(int) this.posZ,
|
||||||
|
explosionStrength,
|
||||||
|
true);
|
||||||
|
this.setDead();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (block == this.inTile && k == this.meta) {
|
||||||
|
++this.ticksInGround;
|
||||||
|
|
||||||
|
if (this.ticksInGround == 1200) {
|
||||||
|
this.setDead();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.inGround = false;
|
||||||
|
this.motionX *= (double) (this.rand.nextFloat() * 0.2F);
|
||||||
|
this.motionY *= (double) (this.rand.nextFloat() * 0.2F);
|
||||||
|
this.motionZ *= (double) (this.rand.nextFloat() * 0.2F);
|
||||||
|
this.ticksInGround = 0;
|
||||||
|
this.ticksInAir = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
++this.ticksInAir;
|
||||||
|
Vec3 vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
|
||||||
|
Vec3 vec3next = Vec3
|
||||||
|
.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec3, vec3next, false, true, false);
|
||||||
|
vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
|
||||||
|
vec3next = Vec3
|
||||||
|
.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
|
||||||
|
if (movingobjectposition != null) {
|
||||||
|
vec3next = Vec3.createVectorHelper(
|
||||||
|
movingobjectposition.hitVec.xCoord,
|
||||||
|
movingobjectposition.hitVec.yCoord,
|
||||||
|
movingobjectposition.hitVec.zCoord);
|
||||||
|
}
|
||||||
|
|
||||||
|
Entity entity = null;
|
||||||
|
List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(
|
||||||
|
this,
|
||||||
|
this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
|
||||||
|
double d0 = 0.0D;
|
||||||
|
int l;
|
||||||
|
float down;
|
||||||
|
|
||||||
|
for (l = 0; l < list.size(); ++l) {
|
||||||
|
Entity entity1 = list.get(l);
|
||||||
|
|
||||||
|
if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) {
|
||||||
|
down = 0.3F;
|
||||||
|
AxisAlignedBB axisalignedbb1 = entity1.boundingBox
|
||||||
|
.expand((double) down, (double) down, (double) down);
|
||||||
|
MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3next, vec3);
|
||||||
|
|
||||||
|
if (movingobjectposition1 != null) {
|
||||||
|
double d1 = vec3next.distanceTo(movingobjectposition1.hitVec);
|
||||||
|
|
||||||
|
if (d1 < d0 || d0 == 0.0D) {
|
||||||
|
entity = entity1;
|
||||||
|
d0 = d1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity != null) {
|
||||||
|
movingobjectposition = new MovingObjectPosition(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (movingobjectposition != null && movingobjectposition.entityHit != null
|
||||||
|
&& movingobjectposition.entityHit instanceof EntityPlayer) {
|
||||||
|
EntityPlayer entityplayer = (EntityPlayer) movingobjectposition.entityHit;
|
||||||
|
|
||||||
|
if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer
|
||||||
|
&& !((EntityPlayer) this.shootingEntity).canAttackPlayer(entityplayer)) {
|
||||||
|
movingobjectposition = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
float f2;
|
||||||
|
float f3;
|
||||||
|
|
||||||
|
if (movingobjectposition != null) {
|
||||||
|
if (movingobjectposition.entityHit != null) {
|
||||||
|
f2 = MathHelper.sqrt_double(
|
||||||
|
this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
|
||||||
|
if (!this.worldObj.isRemote) {
|
||||||
|
this.worldObj.createExplosion(
|
||||||
|
this,
|
||||||
|
(int) this.posX,
|
||||||
|
(int) this.posY,
|
||||||
|
(int) this.posZ,
|
||||||
|
explosionStrength,
|
||||||
|
true);
|
||||||
|
this.setDead();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.xTile = movingobjectposition.blockX;
|
||||||
|
this.yTile = movingobjectposition.blockY;
|
||||||
|
this.zTile = movingobjectposition.blockZ;
|
||||||
|
this.inTile = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile);
|
||||||
|
this.meta = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile);
|
||||||
|
this.motionX = movingobjectposition.hitVec.xCoord - this.posX;
|
||||||
|
this.motionY = movingobjectposition.hitVec.yCoord - this.posY;
|
||||||
|
this.motionZ = movingobjectposition.hitVec.zCoord - this.posZ;
|
||||||
|
f2 = MathHelper.sqrt_double(
|
||||||
|
this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
|
||||||
|
this.posX -= this.motionX / (double) f2 * 0.05000000074505806D;
|
||||||
|
this.posY -= this.motionY / (double) f2 * 0.05000000074505806D;
|
||||||
|
this.posZ -= this.motionZ / (double) f2 * 0.05000000074505806D;
|
||||||
|
this.inGround = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.posX += this.motionX;
|
||||||
|
this.posY += this.motionY;
|
||||||
|
this.posZ += this.motionZ;
|
||||||
|
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
|
this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||||
|
|
||||||
|
for (this.rotationPitch = (float) (Math.atan2(this.motionY, (double) f2) * 180.0D
|
||||||
|
/ Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
|
||||||
|
;
|
||||||
|
|
||||||
|
while (this.rotationPitch - this.prevRotationPitch >= 180.0F) {
|
||||||
|
this.prevRotationPitch += 360.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (this.rotationYaw - this.prevRotationYaw < -180.0F) {
|
||||||
|
this.prevRotationYaw -= 360.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (this.rotationYaw - this.prevRotationYaw >= 180.0F) {
|
||||||
|
this.prevRotationYaw += 360.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.isInWater()) {
|
||||||
|
for (int j1 = 0; j1 < 4; ++j1) {
|
||||||
|
f3 = 0.25F;
|
||||||
|
this.worldObj.spawnParticle(
|
||||||
|
"bubble",
|
||||||
|
this.posX - this.motionX * (double) f3,
|
||||||
|
this.posY - this.motionY * (double) f3,
|
||||||
|
this.posZ - this.motionZ * (double) f3,
|
||||||
|
this.motionX,
|
||||||
|
this.motionY,
|
||||||
|
this.motionZ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeEntityToNBT(NBTTagCompound nbt) {
|
||||||
|
nbt.setShort("xTile", (short) this.xTile);
|
||||||
|
nbt.setShort("yTile", (short) this.yTile);
|
||||||
|
nbt.setShort("zTile", (short) this.zTile);
|
||||||
|
nbt.setShort("inTile", (short) Block.getIdFromBlock(this.inTile));
|
||||||
|
nbt.setByte("inData", (byte) this.meta);
|
||||||
|
nbt.setBoolean("inGround", this.inGround);
|
||||||
|
nbt.setFloat("explosionStrength", this.explosionStrength);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readEntityFromNBT(NBTTagCompound nbt) {
|
||||||
|
this.xTile = nbt.getShort("xTile");
|
||||||
|
this.yTile = nbt.getShort("yTile");
|
||||||
|
this.zTile = nbt.getShort("zTile");
|
||||||
|
this.inTile = Block.getBlockById(nbt.getShort("inTile"));
|
||||||
|
this.meta = nbt.getByte("inData") & 255;
|
||||||
|
this.inGround = nbt.getBoolean("inGround");
|
||||||
|
this.explosionStrength = nbt.getFloat("explosionStrength");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onCollide(Entity entity) {
|
||||||
|
if (!this.worldObj.isRemote) {
|
||||||
|
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, explosionStrength, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public float getShadowSize() {
|
||||||
|
return 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Entity getThrower() {
|
||||||
|
return shootingEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setThrower(Entity entity) {
|
||||||
|
shootingEntity = entity;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
package emt.entity;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
public class EntityShield extends Entity {
|
||||||
|
|
||||||
|
public EntityPlayer owner;
|
||||||
|
|
||||||
|
public boolean needCheck = true;
|
||||||
|
|
||||||
|
public EntityShield(World world) {
|
||||||
|
super(world);
|
||||||
|
this.ignoreFrustumCheck = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityShield(World world, EntityPlayer player) {
|
||||||
|
super(world);
|
||||||
|
this.setSize(4, 4);
|
||||||
|
owner = player;
|
||||||
|
this.dataWatcher.updateObject(11, owner.getDisplayName());
|
||||||
|
this.setPosition(player.posX, player.posY, player.posZ);
|
||||||
|
this.ignoreFrustumCheck = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void entityInit() {
|
||||||
|
this.dataWatcher.addObject(11, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void readEntityFromNBT(NBTTagCompound nbt) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void writeEntityToNBT(NBTTagCompound nbt) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AxisAlignedBB getBoundingBox() {
|
||||||
|
return this.boundingBox;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canBePushed() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canBeCollidedWith() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setPosition(double x, double y, double z) {
|
||||||
|
this.posX = x;
|
||||||
|
this.posY = y + 0.5f;
|
||||||
|
this.posZ = z;
|
||||||
|
float f = this.width / 2.0F;
|
||||||
|
float f1 = this.height;
|
||||||
|
this.boundingBox.setBounds(
|
||||||
|
x - (double) f,
|
||||||
|
y - (double) this.yOffset - 2 + (double) this.ySize,
|
||||||
|
z - (double) f,
|
||||||
|
x + (double) f,
|
||||||
|
y - (double) this.yOffset - 2 + (double) this.ySize + (double) f1,
|
||||||
|
z + (double) f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
super.onUpdate();
|
||||||
|
|
||||||
|
if (needCheck && owner == null) {
|
||||||
|
owner = this.worldObj.getPlayerEntityByName(dataWatcher.getWatchableObjectString(11));
|
||||||
|
needCheck = false;
|
||||||
|
}
|
||||||
|
if (!needCheck && owner == null) {
|
||||||
|
this.setDead();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.worldObj.isRemote && owner != null) {
|
||||||
|
this.setPosition(owner.posX, owner.posY, owner.posZ);
|
||||||
|
if (!owner.isUsingItem()) {
|
||||||
|
this.setDead();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getBrightnessForRender(float p_70070_1_) {
|
||||||
|
return 240;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void applyEntityCollision(Entity entity) {
|
||||||
|
if (entity.riddenByEntity != this && entity.ridingEntity != this) {
|
||||||
|
double ePosX = entity.posX - this.posX;
|
||||||
|
double ePosZ = entity.posZ - this.posZ;
|
||||||
|
entity.addVelocity(ePosX / 5D, 0.0D, ePosZ / 5D);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public boolean isInRangeToRender3d(double x, double y, double z) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package emt.gthandler.common.loader;
|
||||||
|
|
||||||
|
import static emt.command.CommandOutputs.mkbook;
|
||||||
|
import static gregtech.api.recipe.RecipeMaps.assemblerRecipes;
|
||||||
|
import static gregtech.api.util.GT_RecipeBuilder.SECONDS;
|
||||||
|
|
||||||
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
|
import emt.tile.GT_MetaTileEntity_ResearchCompleter;
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import gregtech.api.enums.GT_Values;
|
||||||
|
import gregtech.api.enums.Materials;
|
||||||
|
import gregtech.api.enums.OrePrefixes;
|
||||||
|
import gregtech.api.enums.TierEU;
|
||||||
|
import gregtech.api.util.GT_OreDictUnificator;
|
||||||
|
import thaumcraft.common.config.ConfigItems;
|
||||||
|
|
||||||
|
public class EMT_GT_Loader {
|
||||||
|
|
||||||
|
public static ItemStack ResearchMultiblock;
|
||||||
|
|
||||||
|
public static void run() {
|
||||||
|
ResearchMultiblock = new GT_MetaTileEntity_ResearchCompleter(
|
||||||
|
EMTConfigHandler.aIDoffset + GT_Values.VN.length + 2,
|
||||||
|
"Research Completer",
|
||||||
|
"Research Completer").getStackForm(1L);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void runlate() {
|
||||||
|
GT_Values.RA.stdBuilder()
|
||||||
|
.itemInputs(
|
||||||
|
new ItemStack(Items.book),
|
||||||
|
GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L),
|
||||||
|
new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE))
|
||||||
|
.itemOutputs(mkbook()).duration(6 * SECONDS).eut(TierEU.RECIPE_MV / 2).addTo(assemblerRecipes);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
package emt.init;
|
||||||
|
|
||||||
|
import static thaumcraft.api.ThaumcraftApi.registerObjectTag;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
import emt.block.BlockElectricCloud;
|
||||||
|
import emt.block.BlockEssentiaGenerators;
|
||||||
|
import emt.block.BlockMachines;
|
||||||
|
import emt.block.BlockPortableNode;
|
||||||
|
import emt.block.BlockShield;
|
||||||
|
import emt.item.block.ItemBlockElectricCloud;
|
||||||
|
import emt.item.block.ItemBlockEssentiaGenerators;
|
||||||
|
import emt.item.block.ItemBlockMachines;
|
||||||
|
import emt.tile.solar.Solars;
|
||||||
|
import ic2.api.item.IC2Items;
|
||||||
|
import thaumcraft.api.aspects.Aspect;
|
||||||
|
import thaumcraft.api.aspects.AspectList;
|
||||||
|
|
||||||
|
public class EMTBlocks {
|
||||||
|
|
||||||
|
public static Block portableNode, essentiaGens, shield, emtMachines, electricCloud;
|
||||||
|
|
||||||
|
public static Block[] solars = new Block[0];
|
||||||
|
|
||||||
|
public static void registerBlocks() {
|
||||||
|
portableNode = new BlockPortableNode("portablenode");
|
||||||
|
GameRegistry.registerBlock(portableNode, "PortableNode");
|
||||||
|
|
||||||
|
shield = new BlockShield("shield");
|
||||||
|
GameRegistry.registerBlock(shield, "ShieldBlock");
|
||||||
|
|
||||||
|
if (Registry.enableGTCompat) {
|
||||||
|
solars = Solars.registerBlocks();
|
||||||
|
}
|
||||||
|
|
||||||
|
emtMachines = new BlockMachines("machine");
|
||||||
|
GameRegistry.registerBlock(emtMachines, ItemBlockMachines.class, "EMTMachines");
|
||||||
|
|
||||||
|
if (Registry.enableGTCompat) {
|
||||||
|
essentiaGens = new BlockEssentiaGenerators("essentia");
|
||||||
|
GameRegistry.registerBlock(essentiaGens, ItemBlockEssentiaGenerators.class, "EssentiaGenerators");
|
||||||
|
}
|
||||||
|
electricCloud = new BlockElectricCloud("electricCloud");
|
||||||
|
GameRegistry.registerBlock(electricCloud, ItemBlockElectricCloud.class, "electricCloud");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addAspects() {
|
||||||
|
registerObjectTag(IC2Items.getItem("rubberTrampoline"), new AspectList().add(Aspect.AIR, 5));
|
||||||
|
registerObjectTag(
|
||||||
|
IC2Items.getItem("ironFence"),
|
||||||
|
new AspectList().add(Aspect.ENERGY, 1).add(Aspect.METAL, 2).add(Aspect.WEATHER, 1));
|
||||||
|
registerObjectTag(
|
||||||
|
IC2Items.getItem("reinforcedGlass"),
|
||||||
|
new AspectList().add(Aspect.METAL, 2).add(Aspect.COLD, 2));
|
||||||
|
registerObjectTag(IC2Items.getItem("scaffold"), new AspectList().add(Aspect.TREE, 4));
|
||||||
|
registerObjectTag(IC2Items.getItem("ironScaffold"), new AspectList().add(Aspect.METAL, 4));
|
||||||
|
registerObjectTag(
|
||||||
|
IC2Items.getItem("generator"),
|
||||||
|
new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 2).add(Aspect.MECHANISM, 1));
|
||||||
|
registerObjectTag(
|
||||||
|
IC2Items.getItem("waterMill"),
|
||||||
|
new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.WATER, 2)
|
||||||
|
.add(Aspect.MECHANISM, 1));
|
||||||
|
registerObjectTag(
|
||||||
|
IC2Items.getItem("solarPanel"),
|
||||||
|
new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 1).add(Aspect.LIGHT, 2)
|
||||||
|
.add(Aspect.MECHANISM, 1));
|
||||||
|
registerObjectTag(
|
||||||
|
IC2Items.getItem("windMill"),
|
||||||
|
new AspectList().add(Aspect.ENERGY, 1).add(Aspect.WEATHER, 3).add(Aspect.MECHANISM, 1));
|
||||||
|
registerObjectTag(
|
||||||
|
IC2Items.getItem("batBox"),
|
||||||
|
new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 3).add(Aspect.MECHANISM, 1));
|
||||||
|
registerObjectTag(
|
||||||
|
IC2Items.getItem("cesuUnit"),
|
||||||
|
new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 4).add(Aspect.MECHANISM, 1));
|
||||||
|
registerObjectTag(
|
||||||
|
IC2Items.getItem("mfeUnit"),
|
||||||
|
new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 5).add(Aspect.MECHANISM, 1));
|
||||||
|
registerObjectTag(
|
||||||
|
IC2Items.getItem("mfsUnit"),
|
||||||
|
new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 7).add(Aspect.MECHANISM, 1));
|
||||||
|
registerObjectTag(
|
||||||
|
IC2Items.getItem("ironFurnace"),
|
||||||
|
new AspectList().add(Aspect.METAL, 2).add(Aspect.FIRE, 2).add(Aspect.MECHANISM, 1));
|
||||||
|
registerObjectTag(
|
||||||
|
IC2Items.getItem("electroFurnace"),
|
||||||
|
new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.FIRE, 3)
|
||||||
|
.add(Aspect.MECHANISM, 1));
|
||||||
|
registerObjectTag(
|
||||||
|
IC2Items.getItem("macerator"),
|
||||||
|
new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 2).add(Aspect.MINE, 2)
|
||||||
|
.add(Aspect.MECHANISM, 1));
|
||||||
|
registerObjectTag(
|
||||||
|
IC2Items.getItem("extractor"),
|
||||||
|
new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.CRAFT, 2)
|
||||||
|
.add(Aspect.MECHANISM, 1));
|
||||||
|
registerObjectTag(
|
||||||
|
IC2Items.getItem("compressor"),
|
||||||
|
new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 2).add(Aspect.VOID, 3)
|
||||||
|
.add(Aspect.MECHANISM, 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package emt.init;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityList;
|
||||||
|
import net.minecraft.entity.EntityList.EntityEggInfo;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.entity.EntityArcher;
|
||||||
|
import emt.entity.EntityEnergyBall;
|
||||||
|
import emt.entity.EntityLaser;
|
||||||
|
import emt.entity.EntityShield;
|
||||||
|
|
||||||
|
public class EMTEntities {
|
||||||
|
|
||||||
|
private static int startEID = 300;
|
||||||
|
private static int entityIDs = 0;
|
||||||
|
|
||||||
|
private static int getUniqueEntityID() {
|
||||||
|
do {
|
||||||
|
startEID++;
|
||||||
|
} while (EntityList.getStringFromID(startEID) != null);
|
||||||
|
return startEID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerEntityEgg(Class<? extends Entity> entity, int colPrim, int colSec) {
|
||||||
|
int id = getUniqueEntityID();
|
||||||
|
EntityList.IDtoClassMapping.put(id, entity);
|
||||||
|
EntityList.entityEggs.put(id, new EntityEggInfo(id, colPrim, colSec));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerEMTEntities() {
|
||||||
|
EntityRegistry.registerModEntity(EntityLaser.class, "laser", entityIDs++, EMT.instance, 80, 3, true);
|
||||||
|
EntityRegistry.registerModEntity(EntityArcher.class, "archer", entityIDs++, EMT.instance, 80, 3, true);
|
||||||
|
registerEntityEgg(EntityArcher.class, 0x99111F, 0xE5685);
|
||||||
|
EntityRegistry.registerModEntity(EntityShield.class, "shield", entityIDs++, EMT.instance, 80, 3, true);
|
||||||
|
EntityRegistry.registerModEntity(EntityEnergyBall.class, "energyBall", entityIDs++, EMT.instance, 80, 60, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,211 @@
|
|||||||
|
package emt.init;
|
||||||
|
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemArmor;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.common.util.EnumHelper;
|
||||||
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.item.ItemElectricScribingTools;
|
||||||
|
import emt.item.ItemIC2Baubles;
|
||||||
|
import emt.item.ItemMaterials;
|
||||||
|
import emt.item.ItemOneRing;
|
||||||
|
import emt.item.armor.boots.ItemElectricBootsTraveller;
|
||||||
|
import emt.item.armor.boots.ItemNanoBootsTraveller;
|
||||||
|
import emt.item.armor.boots.ItemQuantumBootsTraveller;
|
||||||
|
import emt.item.armor.chestplate.ItemInfusedQuantumChestplate;
|
||||||
|
import emt.item.armor.goggles.ItemElectricGoggles;
|
||||||
|
import emt.item.armor.goggles.ItemNanoGoggles;
|
||||||
|
import emt.item.armor.goggles.ItemQuantumGoggles;
|
||||||
|
import emt.item.armor.goggles.ItemSolarHelmetRevealing;
|
||||||
|
import emt.item.armor.wings.ItemFeatherWing;
|
||||||
|
import emt.item.armor.wings.ItemNanoWing;
|
||||||
|
import emt.item.armor.wings.ItemQuantumWing;
|
||||||
|
import emt.item.armor.wings.ItemThaumiumReinforcedWing;
|
||||||
|
import emt.item.focus.ItemChargeFocus;
|
||||||
|
import emt.item.focus.ItemChristmasFocus;
|
||||||
|
import emt.item.focus.ItemEnergyBallFocus;
|
||||||
|
import emt.item.focus.ItemExplosionFocus;
|
||||||
|
import emt.item.focus.ItemMaintenanceFocus;
|
||||||
|
import emt.item.focus.ItemShieldFocus;
|
||||||
|
import emt.item.focus.ItemWandChargingFocus;
|
||||||
|
import emt.item.tool.ItemElectricHoeGrowth;
|
||||||
|
import emt.item.tool.ItemElectricThorHammer;
|
||||||
|
import emt.item.tool.ItemThorHammer;
|
||||||
|
import emt.item.tool.ItemThorHammerBroken;
|
||||||
|
import emt.item.tool.chainsaw.ItemDiamondChainsaw;
|
||||||
|
import emt.item.tool.chainsaw.ItemStreamChainsaw;
|
||||||
|
import emt.item.tool.chainsaw.ItemThaumiumChainsaw;
|
||||||
|
import emt.item.tool.drill.ItemRockbreakerDrill;
|
||||||
|
import emt.item.tool.drill.ItemThaumiumDrill;
|
||||||
|
import emt.item.tool.omnitool.ItemOmnitoolDiamond;
|
||||||
|
import emt.item.tool.omnitool.ItemOmnitoolIron;
|
||||||
|
import emt.item.tool.omnitool.ItemOmnitoolThaumium;
|
||||||
|
import ic2.core.init.InternalName;
|
||||||
|
import thaumcraft.api.ThaumcraftApi;
|
||||||
|
|
||||||
|
public class EMTItems {
|
||||||
|
|
||||||
|
public static Item onering;
|
||||||
|
public static Item materials;
|
||||||
|
public static Item craftingComponents;
|
||||||
|
public static Item focusChristmas;
|
||||||
|
public static Item thaumiumDrill;
|
||||||
|
public static Item thaumiumChainsaw;
|
||||||
|
public static Item quantumThaumicHelmet;
|
||||||
|
public static Item diamondChainsaw;
|
||||||
|
public static Item ironOmnitool;
|
||||||
|
public static Item diamondOmnitool;
|
||||||
|
public static Item thaumiumOmnitool;
|
||||||
|
public static Item nanoThaumicHelmet;
|
||||||
|
public static Item explosionFocus;
|
||||||
|
public static Item christmasFocus;
|
||||||
|
public static Item shieldFocus;
|
||||||
|
public static Item energyBallFocus;
|
||||||
|
public static Item maintenanceFocus;
|
||||||
|
public static Item electricGoggles;
|
||||||
|
public static Item streamChainsaw;
|
||||||
|
public static Item rockbreakerDrill;
|
||||||
|
public static Item solarHelmetRevealing;
|
||||||
|
public static Item thorHammer;
|
||||||
|
public static Item taintedThorHammer;
|
||||||
|
public static Item electricThorHammer;
|
||||||
|
public static Item electricBootsTraveller;
|
||||||
|
public static Item quantumBootsTraveller;
|
||||||
|
public static Item nanoBootsTraveller;
|
||||||
|
public static Item electricScribingTools;
|
||||||
|
public static Item itemEMTItems;
|
||||||
|
public static Item electricHoeGrowth;
|
||||||
|
public static Item chargeFocus;
|
||||||
|
public static Item emtBauble;
|
||||||
|
public static Item wandChargeFocus;
|
||||||
|
public static Item featherWing;
|
||||||
|
public static Item thaumiumWing;
|
||||||
|
public static Item nanoWing;
|
||||||
|
public static Item quantumWing;
|
||||||
|
public static Item quantumArmor;
|
||||||
|
public static ItemArmor.ArmorMaterial featherWingMaterial = EnumHelper
|
||||||
|
.addArmorMaterial("FEATEHRWiNG", 1, new int[] { 2, 2, 2, 2 }, 6);
|
||||||
|
|
||||||
|
public static void registerItems() {
|
||||||
|
itemEMTItems = new ItemMaterials();
|
||||||
|
GameRegistry.registerItem(itemEMTItems, "EMTItems");
|
||||||
|
OreDictionary.registerOre("plateThaumium", new ItemStack(itemEMTItems, 1, 5));
|
||||||
|
OreDictionary.registerOre("slimeball", new ItemStack(itemEMTItems, 1, 8));
|
||||||
|
|
||||||
|
emtBauble = new ItemIC2Baubles().setUnlocalizedName(EMT.MOD_ID + ".bauble");
|
||||||
|
GameRegistry.registerItem(emtBauble, "EMTBaubles");
|
||||||
|
|
||||||
|
onering = new ItemOneRing();
|
||||||
|
GameRegistry.registerItem(onering, "BaseBaubles");
|
||||||
|
|
||||||
|
quantumArmor = new ItemInfusedQuantumChestplate(InternalName.itemArmorQuantumChestplate, 1)
|
||||||
|
.setUnlocalizedName(EMT.MOD_ID + ".quantum");
|
||||||
|
|
||||||
|
electricGoggles = new ItemElectricGoggles(ItemArmor.ArmorMaterial.IRON, 3, 0)
|
||||||
|
.setUnlocalizedName(EMT.MOD_ID + ".goggles.electric");
|
||||||
|
GameRegistry.registerItem(electricGoggles, "ElectricGogglesRevealing");
|
||||||
|
|
||||||
|
nanoThaumicHelmet = new ItemNanoGoggles(ItemArmor.ArmorMaterial.DIAMOND, 3, 0)
|
||||||
|
.setUnlocalizedName(EMT.MOD_ID + ".goggles.nano");
|
||||||
|
GameRegistry.registerItem(nanoThaumicHelmet, "NanosuitGogglesRevealing");
|
||||||
|
|
||||||
|
quantumThaumicHelmet = new ItemQuantumGoggles(ItemArmor.ArmorMaterial.DIAMOND, 3, 0)
|
||||||
|
.setUnlocalizedName(EMT.MOD_ID + ".goggles.quantum");
|
||||||
|
GameRegistry.registerItem(quantumThaumicHelmet, "QuantumGogglesRevealing");
|
||||||
|
|
||||||
|
solarHelmetRevealing = new ItemSolarHelmetRevealing(ItemArmor.ArmorMaterial.DIAMOND, 3, 0)
|
||||||
|
.setUnlocalizedName(EMT.MOD_ID + ".goggles.solar");
|
||||||
|
GameRegistry.registerItem(solarHelmetRevealing, "SolarHelmetRevealing");
|
||||||
|
|
||||||
|
electricBootsTraveller = new ItemElectricBootsTraveller(ItemArmor.ArmorMaterial.IRON, 3, 3)
|
||||||
|
.setUnlocalizedName(EMT.MOD_ID + ".boots.traveller.electric");
|
||||||
|
GameRegistry.registerItem(electricBootsTraveller, "ElectricBootsTraveller");
|
||||||
|
|
||||||
|
nanoBootsTraveller = new ItemNanoBootsTraveller(ItemArmor.ArmorMaterial.DIAMOND, 3, 3)
|
||||||
|
.setUnlocalizedName(EMT.MOD_ID + ".boots.traveller.nano");
|
||||||
|
GameRegistry.registerItem(nanoBootsTraveller, "NanoBootsTraveller");
|
||||||
|
|
||||||
|
quantumBootsTraveller = new ItemQuantumBootsTraveller(ItemArmor.ArmorMaterial.DIAMOND, 3, 3)
|
||||||
|
.setUnlocalizedName(EMT.MOD_ID + ".boots.traveller.quantum");
|
||||||
|
GameRegistry.registerItem(quantumBootsTraveller, "QuantumBootsTraveller");
|
||||||
|
|
||||||
|
electricScribingTools = new ItemElectricScribingTools()
|
||||||
|
.setUnlocalizedName(EMT.MOD_ID + ".scribingtools.electric");
|
||||||
|
GameRegistry.registerItem(electricScribingTools, "ElectricScribingTools");
|
||||||
|
|
||||||
|
featherWing = new ItemFeatherWing(featherWingMaterial, 7, 1).setUnlocalizedName(EMT.MOD_ID + ".wing.feather");
|
||||||
|
GameRegistry.registerItem(featherWing, "FeatherWing");
|
||||||
|
|
||||||
|
thaumiumWing = new ItemThaumiumReinforcedWing(ThaumcraftApi.armorMatThaumium, 7, 1)
|
||||||
|
.setUnlocalizedName(EMT.MOD_ID + ".wing.thaumium");
|
||||||
|
GameRegistry.registerItem(thaumiumWing, "ThaumiumWing");
|
||||||
|
|
||||||
|
nanoWing = new ItemNanoWing(ItemArmor.ArmorMaterial.DIAMOND, 7, 1)
|
||||||
|
.setUnlocalizedName(EMT.MOD_ID + ".wing.nano");
|
||||||
|
GameRegistry.registerItem(nanoWing, "NanosuitWing");
|
||||||
|
|
||||||
|
quantumWing = new ItemQuantumWing(ItemArmor.ArmorMaterial.DIAMOND, 7, 1)
|
||||||
|
.setUnlocalizedName(EMT.MOD_ID + ".wing.quantum");
|
||||||
|
GameRegistry.registerItem(quantumWing, "QuantumWing");
|
||||||
|
|
||||||
|
thorHammer = new ItemThorHammer().setUnlocalizedName(EMT.MOD_ID + ".hammer");
|
||||||
|
GameRegistry.registerItem(thorHammer, "Mjolnir");
|
||||||
|
|
||||||
|
taintedThorHammer = new ItemThorHammerBroken().setUnlocalizedName(EMT.MOD_ID + ".hammer.broken");
|
||||||
|
GameRegistry.registerItem(taintedThorHammer, "TaintedMjolnir");
|
||||||
|
|
||||||
|
electricThorHammer = new ItemElectricThorHammer().setUnlocalizedName(EMT.MOD_ID + ".hammer.electric");
|
||||||
|
GameRegistry.registerItem(electricThorHammer, "SuperchargedMjolnir");
|
||||||
|
|
||||||
|
thaumiumDrill = new ItemThaumiumDrill().setUnlocalizedName(EMT.MOD_ID + ".drill.thaumium");
|
||||||
|
GameRegistry.registerItem(thaumiumDrill, "ThaumiumDrill");
|
||||||
|
|
||||||
|
diamondChainsaw = new ItemDiamondChainsaw().setUnlocalizedName(EMT.MOD_ID + ".chainsaw.diamond");
|
||||||
|
GameRegistry.registerItem(diamondChainsaw, "DiamondChainsaw");
|
||||||
|
|
||||||
|
thaumiumChainsaw = new ItemThaumiumChainsaw().setUnlocalizedName(EMT.MOD_ID + ".chainsaw.thaumium");
|
||||||
|
GameRegistry.registerItem(thaumiumChainsaw, "ThaumiumChainsaw");
|
||||||
|
|
||||||
|
ironOmnitool = new ItemOmnitoolIron().setUnlocalizedName(EMT.MOD_ID + ".omnitool.iron");
|
||||||
|
GameRegistry.registerItem(ironOmnitool, "Omnitool");
|
||||||
|
|
||||||
|
diamondOmnitool = new ItemOmnitoolDiamond().setUnlocalizedName(EMT.MOD_ID + ".omnitool.diamond");
|
||||||
|
GameRegistry.registerItem(diamondOmnitool, "Diamond Omnitool");
|
||||||
|
|
||||||
|
thaumiumOmnitool = new ItemOmnitoolThaumium().setUnlocalizedName(EMT.MOD_ID + ".omnitool.thaumium");
|
||||||
|
GameRegistry.registerItem(thaumiumOmnitool, "ThaumiumOmnitool");
|
||||||
|
|
||||||
|
streamChainsaw = new ItemStreamChainsaw().setUnlocalizedName(EMT.MOD_ID + ".chainsaw.stream");
|
||||||
|
GameRegistry.registerItem(streamChainsaw, "ChainsawStream");
|
||||||
|
|
||||||
|
rockbreakerDrill = new ItemRockbreakerDrill().setUnlocalizedName(EMT.MOD_ID + ".drill.rockbreaker");
|
||||||
|
GameRegistry.registerItem(rockbreakerDrill, "DrillRockbreaker");
|
||||||
|
|
||||||
|
electricHoeGrowth = new ItemElectricHoeGrowth().setUnlocalizedName(EMT.MOD_ID + ".hoeofgrowth.electric");
|
||||||
|
GameRegistry.registerItem(electricHoeGrowth, "ElectricHoeGrowth");
|
||||||
|
|
||||||
|
explosionFocus = new ItemExplosionFocus();
|
||||||
|
GameRegistry.registerItem(explosionFocus, "ExplosionFocus");
|
||||||
|
|
||||||
|
christmasFocus = new ItemChristmasFocus();
|
||||||
|
GameRegistry.registerItem(christmasFocus, "ChristmasFocus");
|
||||||
|
|
||||||
|
shieldFocus = new ItemShieldFocus();
|
||||||
|
GameRegistry.registerItem(shieldFocus, "ShieldFocus");
|
||||||
|
|
||||||
|
chargeFocus = new ItemChargeFocus();
|
||||||
|
GameRegistry.registerItem(chargeFocus, "ChargingFocus");
|
||||||
|
|
||||||
|
wandChargeFocus = new ItemWandChargingFocus();
|
||||||
|
GameRegistry.registerItem(wandChargeFocus, "WandChargingFocus");
|
||||||
|
|
||||||
|
energyBallFocus = new ItemEnergyBallFocus();
|
||||||
|
GameRegistry.registerItem(energyBallFocus, "EnergyBallFocus");
|
||||||
|
|
||||||
|
maintenanceFocus = new ItemMaintenanceFocus();
|
||||||
|
GameRegistry.registerItem(maintenanceFocus, "MaintenanceFocus");
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,725 @@
|
|||||||
|
package emt.init;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import emt.util.EMTResearchAspects;
|
||||||
|
import emt.util.EMTResearchItem;
|
||||||
|
import ic2.api.item.IC2Items;
|
||||||
|
import thaumcraft.api.research.ResearchCategories;
|
||||||
|
import thaumcraft.api.research.ResearchPage;
|
||||||
|
|
||||||
|
public class EMTResearches {
|
||||||
|
|
||||||
|
public static void register() {
|
||||||
|
addResearchTab();
|
||||||
|
addResearch();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addResearchTab() {
|
||||||
|
ResourceLocation background = new ResourceLocation(EMT.TEXTURE_PATH, "textures/misc/background.png");
|
||||||
|
ResearchCategories
|
||||||
|
.registerCategory("EMT", new ResourceLocation(EMT.TEXTURE_PATH, "textures/misc/emt.png"), background);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addResearch() {
|
||||||
|
/** Research that can't be disabled **/
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Electric Magic Tools",
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
new ResourceLocation(EMT.TEXTURE_PATH, "textures/misc/emt.png")).setRound().setAutoUnlock()
|
||||||
|
.registerResearchItem().setPages(new ResearchPage(""));
|
||||||
|
new EMTResearchItem("Diamond Chainsaw", 5, -6, 0, new ItemStack(EMTItems.diamondChainsaw)).setRound()
|
||||||
|
.setAutoUnlock().registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.diamondChainsaw));
|
||||||
|
new EMTResearchItem("Thaumium Plate", 6, -6, 0, new ItemStack(EMTItems.itemEMTItems, 1, 5)).setRound()
|
||||||
|
.setAutoUnlock().registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumiumPlate));
|
||||||
|
new EMTResearchItem("Macerating Native Ore Clusters", 5, -7, 0, IC2Items.getItem("smallGoldDust")).setRound()
|
||||||
|
.setAutoUnlock().registerResearchItem().setPages(new ResearchPage(""));
|
||||||
|
new EMTResearchItem("The Legend", 5, -5, 0, new ItemStack(EMTItems.taintedThorHammer)).setRound()
|
||||||
|
.setAutoUnlock().registerResearchItem().setPages(new ResearchPage(""));
|
||||||
|
new EMTResearchItem("Lightning Summoner", 6, -5, 0, new ItemStack(EMTItems.itemEMTItems, 1, 6)).setRound()
|
||||||
|
.setAutoUnlock().registerResearchItem().setPages(new ResearchPage(""));
|
||||||
|
new EMTResearchItem("The One Ring", 6, -7, 0, new ItemStack(EMTItems.onering)).setRound().setAutoUnlock()
|
||||||
|
.registerResearchItem().setPages(new ResearchPage(""));
|
||||||
|
new EMTResearchItem("Electric Cloud", 4, -7, 0, new ItemStack(EMTBlocks.electricCloud)).setRound()
|
||||||
|
.setAutoUnlock().registerResearchItem().setPages(new ResearchPage("1"), new ResearchPage("2"));
|
||||||
|
new EMTResearchItem("Feather Wings", 0, 2, 0, new ItemStack(EMTItems.featherWing))
|
||||||
|
.setParents("Electric Magic Tools").setRound().setAutoUnlock().registerResearchItem().setPages(
|
||||||
|
new ResearchPage(EMTRecipes.cardboard),
|
||||||
|
new ResearchPage(EMTRecipes.featherWing),
|
||||||
|
new ResearchPage(EMTRecipes.featherWings));
|
||||||
|
// new EMTResearchItem("ResearchCompleter", EMTResearchAspects.researchCompleter, -4, -2, 0, new
|
||||||
|
// ItemStack(GregTech_API.sBlockMachines, 1, 13001)).setParents("Electric Magic
|
||||||
|
// Tools").setParentsHidden("WANDPED", "WARDEDARCANA").registerResearchItem().setPages(new ResearchPage(""), new
|
||||||
|
// ResearchPage(EMTRecipes.magicalMachineCasing), new ResearchPage(EMTRecipes.researchCompleter));
|
||||||
|
/*************************************/
|
||||||
|
|
||||||
|
/** Research that can be disabled **/
|
||||||
|
if (!EMTConfigHandler.thaumiumDrillResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Thaumium Drill",
|
||||||
|
EMTResearchAspects.thaumiumDrillResearch,
|
||||||
|
-1,
|
||||||
|
-2,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTItems.thaumiumDrill)).setSecondary().setParents("Electric Magic Tools")
|
||||||
|
.setConcealed().registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumiumDrill));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.thaumiumChainsawResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Thaumium Chainsaw",
|
||||||
|
EMTResearchAspects.thaumiumChainsawResearch,
|
||||||
|
-2,
|
||||||
|
-2,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTItems.thaumiumChainsaw)).setSecondary().setParents("Electric Magic Tools")
|
||||||
|
.setConcealed().registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumiumChainsaw));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.electricGooglesResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Electric Goggles",
|
||||||
|
EMTResearchAspects.electricGogglesResearch,
|
||||||
|
1,
|
||||||
|
-2,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTItems.electricGoggles)).setSecondary().setParents("Electric Magic Tools")
|
||||||
|
.setConcealed().registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.electricGoggles));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.electricGooglesResearch) {
|
||||||
|
if (!EMTConfigHandler.nanoGooglesResearch) {
|
||||||
|
;
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Nanosuit Goggles of Revealing",
|
||||||
|
EMTResearchAspects.thaumicNanoHelmet,
|
||||||
|
2,
|
||||||
|
-2,
|
||||||
|
2,
|
||||||
|
new ItemStack(EMTItems.nanoThaumicHelmet)).setParents("Electric Goggles").setConcealed()
|
||||||
|
.registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumicNanoHelmet));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.electricGooglesResearch) {
|
||||||
|
if (!EMTConfigHandler.nanoGooglesResearch) {
|
||||||
|
if (!EMTConfigHandler.quantumGooglesResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Quantum Goggles of Revealing",
|
||||||
|
EMTResearchAspects.thaumicQuantumHelmet,
|
||||||
|
3,
|
||||||
|
-2,
|
||||||
|
3,
|
||||||
|
new ItemStack(EMTItems.quantumThaumicHelmet)).setParents("Nanosuit Goggles of Revealing")
|
||||||
|
.setConcealed().registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumicQuantumHelmet));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.ironOmnitoolResearch) {
|
||||||
|
new EMTResearchItem("Iron Omnitool", -2, 0, 0, new ItemStack(EMTItems.ironOmnitool))
|
||||||
|
.setParents("Electric Magic Tools").setRound().setAutoUnlock().registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.ironOmnitool));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.ironOmnitoolResearch) {
|
||||||
|
if (!EMTConfigHandler.diamondOmnitoolResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Diamond Omnitool",
|
||||||
|
EMTResearchAspects.diamondOmnitoolResearch,
|
||||||
|
-4,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTItems.diamondOmnitool)).setSecondary().setParents("Iron Omnitool")
|
||||||
|
.setConcealed().registerResearchItem().setPages(
|
||||||
|
new ResearchPage(""),
|
||||||
|
new ResearchPage(EMTRecipes.diamondOmnitool),
|
||||||
|
new ResearchPage(EMTRecipes.ironOmnitoolToDiamond));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.thaumiumDrillResearch && !EMTConfigHandler.thaumiumChainsawResearch) {
|
||||||
|
if (!EMTConfigHandler.thaumiumOmnitoolResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Thaumium Omnitool",
|
||||||
|
EMTResearchAspects.thaumiumOmnitoolResearch,
|
||||||
|
-6,
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
new ItemStack(EMTItems.thaumiumOmnitool))
|
||||||
|
.setParentsHidden("Thaumium Drill", "Thaumium Chainsaw").setParents("Diamond Omnitool")
|
||||||
|
.setConcealed().registerResearchItem().setPages(
|
||||||
|
new ResearchPage(""),
|
||||||
|
new ResearchPage(EMTRecipes.thaumiumOmnitool),
|
||||||
|
new ResearchPage(EMTRecipes.diamondOmnitoolToThaumium));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.explosionFocusResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Explosion Focus",
|
||||||
|
EMTResearchAspects.laserFocusResearch,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
2,
|
||||||
|
new ItemStack(EMTItems.explosionFocus)).setParents("Electric Magic Tools").setConcealed()
|
||||||
|
.registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.explosionFocus));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.christmasFocusResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Kris-tmas Focus",
|
||||||
|
EMTResearchAspects.christmasFocusResearch,
|
||||||
|
3,
|
||||||
|
3,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTItems.christmasFocus)).setSecondary().setParents("Electric Magic Tools")
|
||||||
|
.setConcealed().registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.christmasFocus));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.shieldFocusResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Shield Focus",
|
||||||
|
EMTResearchAspects.shieldFocusResearch,
|
||||||
|
4,
|
||||||
|
3,
|
||||||
|
2,
|
||||||
|
new ItemStack(EMTItems.shieldFocus)).setParents("Electric Magic Tools").setConcealed()
|
||||||
|
.registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.shieldFocus));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.energyBallFocusResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Energy Ball Focus",
|
||||||
|
EMTResearchAspects.energyBallFocusResearch,
|
||||||
|
1,
|
||||||
|
3,
|
||||||
|
2,
|
||||||
|
new ItemStack(EMTItems.energyBallFocus)).setParents("Electric Magic Tools").setConcealed()
|
||||||
|
.registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.energyBallFocus));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.shieldFocusResearch) {
|
||||||
|
if (!EMTConfigHandler.shieldBlockResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Shield Block",
|
||||||
|
EMTResearchAspects.shieldBlockResearch,
|
||||||
|
4,
|
||||||
|
5,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTBlocks.shield)).setSecondary().setParents("Shield Focus").setConcealed()
|
||||||
|
.registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.shieldBlock));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Registry.enableGTCompat && !EMTConfigHandler.potentiaGeneratorResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Potentia Generator",
|
||||||
|
EMTResearchAspects.potentiaGeneratorResearch,
|
||||||
|
-2,
|
||||||
|
3,
|
||||||
|
3,
|
||||||
|
new ItemStack(EMTBlocks.essentiaGens, 1, 0)).setParents("Electric Magic Tools").setConcealed()
|
||||||
|
.registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.potentiaGenerator));
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.ignisGeneratorResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Ignis Generator",
|
||||||
|
EMTResearchAspects.ignisGeneratorResearch,
|
||||||
|
-3,
|
||||||
|
4,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTBlocks.essentiaGens, 1, 1)).setSecondary().setParents("Potentia Generator")
|
||||||
|
.setConcealed().registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.ignisGenerator));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.auramGeneratorResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Auram Generator",
|
||||||
|
EMTResearchAspects.auramGeneratorResearch,
|
||||||
|
-1,
|
||||||
|
4,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTBlocks.essentiaGens, 1, 2)).setSecondary().setParents("Potentia Generator")
|
||||||
|
.setConcealed().registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.auramGenerator));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.arborGeneratorResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Arbor Generator",
|
||||||
|
EMTResearchAspects.arborGeneratorResearch,
|
||||||
|
-2,
|
||||||
|
5,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTBlocks.essentiaGens, 1, 3)).setSecondary().setParents("Potentia Generator")
|
||||||
|
.setConcealed().registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.arborGenerator));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.lucrumGeneratorResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Lucrum Generator",
|
||||||
|
EMTResearchAspects.lucrumGeneratorResearch,
|
||||||
|
-2,
|
||||||
|
2,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTBlocks.essentiaGens, 1, 5)).setSecondary().setParents("Potentia Generator")
|
||||||
|
.setConcealed().registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.lucrumGenerator));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.aerGeneratorResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Aer Generator",
|
||||||
|
EMTResearchAspects.aerGenerator,
|
||||||
|
-2,
|
||||||
|
6,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTBlocks.essentiaGens, 1, 4)).setSecondary().setParents("Potentia Generator")
|
||||||
|
.setConcealed().registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.aerGenerator));
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.wandChargingSationResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Industrial Wand Charging Station",
|
||||||
|
EMTResearchAspects.wandCharger,
|
||||||
|
-4,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
new ItemStack(EMTBlocks.emtMachines, 1, 0)).setParents("Potentia Generator")
|
||||||
|
.registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.wandRecharger));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!EMTConfigHandler.thaumiumChainsawResearch) {
|
||||||
|
if (!EMTConfigHandler.streamChainsawResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Chainsaw of the Stream",
|
||||||
|
EMTResearchAspects.streamChainsawResearch,
|
||||||
|
-3,
|
||||||
|
-4,
|
||||||
|
3,
|
||||||
|
new ItemStack(EMTItems.streamChainsaw)).setParents("Thaumium Chainsaw").registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.streamChainsaw));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.thaumiumDrillResearch) {
|
||||||
|
if (!EMTConfigHandler.rockbreakerDrillResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Drill of the Rockbreaker",
|
||||||
|
EMTResearchAspects.rockbreakerDrillResearch,
|
||||||
|
0,
|
||||||
|
-4,
|
||||||
|
3,
|
||||||
|
new ItemStack(EMTItems.rockbreakerDrill)).setParents("Thaumium Drill").registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.rockbreakerDrill));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.tinyUraniumResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Tiny Uranium",
|
||||||
|
EMTResearchAspects.tinyUraniumResearch,
|
||||||
|
-5,
|
||||||
|
-5,
|
||||||
|
1,
|
||||||
|
IC2Items.getItem("Uran238")).setSecondary().setParentsHidden("Electric Magic Tools").setConcealed()
|
||||||
|
.registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.tinyUranium));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.thorHammerResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Mjolnir",
|
||||||
|
EMTResearchAspects.thorHammerResearch,
|
||||||
|
-5,
|
||||||
|
5,
|
||||||
|
3,
|
||||||
|
new ItemStack(EMTItems.thorHammer)).setParentsHidden("Electric Magic Tools").setConcealed()
|
||||||
|
.registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thorHammer));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.thorHammerResearch) {
|
||||||
|
if (!EMTConfigHandler.superchargedThorHammerResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Supercharged Mjolnir",
|
||||||
|
EMTResearchAspects.superchargedThorHammerResearch,
|
||||||
|
-6,
|
||||||
|
6,
|
||||||
|
3,
|
||||||
|
new ItemStack(EMTItems.electricThorHammer)).setParents("Mjolnir").registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.superchargedThorHammer));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Registry.enableGTCompat && !EMTConfigHandler.compressedSolarsResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Compressed Solars",
|
||||||
|
EMTResearchAspects.compressedSolars,
|
||||||
|
-4,
|
||||||
|
-5,
|
||||||
|
2,
|
||||||
|
new ItemStack(EMTBlocks.solars[0])).setParentsHidden("Potentia Generator").setConcealed()
|
||||||
|
.registerResearchItem().setPages(
|
||||||
|
new ResearchPage(""),
|
||||||
|
new ResearchPage(EMTRecipes.compressedSolar),
|
||||||
|
new ResearchPage(EMTRecipes.doubleCompressedSolar),
|
||||||
|
new ResearchPage(EMTRecipes.tripleCompressedSolar));
|
||||||
|
if (!EMTConfigHandler.solarHelmetResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Solar Helmet of Revealing",
|
||||||
|
EMTResearchAspects.solarHelmetRevealing,
|
||||||
|
-2,
|
||||||
|
-5,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTItems.solarHelmetRevealing)).setSecondary().setParents("Compressed Solars")
|
||||||
|
.setParentsHidden("Quantum Goggles of Revealing").registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.solarHelmetRevealing));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!EMTConfigHandler.electricBootsResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Electric Boots of the Traveller",
|
||||||
|
EMTResearchAspects.electricBootsTravel,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTItems.electricBootsTraveller)).setSecondary().setParents("Electric Magic Tools")
|
||||||
|
.setConcealed().registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.electricBootsTravel));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.electricBootsResearch) {
|
||||||
|
if (!EMTConfigHandler.nanoBootsResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Nano Boots of the Traveller",
|
||||||
|
EMTResearchAspects.nanoBootsTravel,
|
||||||
|
4,
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
new ItemStack(EMTItems.nanoBootsTraveller)).setParents("Electric Boots of the Traveller")
|
||||||
|
.setConcealed().registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.nanoBootsTravel));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.electricBootsResearch) {
|
||||||
|
if (!EMTConfigHandler.nanoBootsResearch) {
|
||||||
|
if (!EMTConfigHandler.quantumBootsResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Quantum Boots of the Traveller",
|
||||||
|
EMTResearchAspects.quantumBootsTravel,
|
||||||
|
6,
|
||||||
|
0,
|
||||||
|
3,
|
||||||
|
new ItemStack(EMTItems.quantumBootsTraveller)).setParents("Nano Boots of the Traveller")
|
||||||
|
.setConcealed().registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.quantumBootsTravel));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.electricScribingToolsResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Electric Scribing Tools",
|
||||||
|
EMTResearchAspects.electricScribingTools,
|
||||||
|
-6,
|
||||||
|
-5,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTItems.electricScribingTools)).setSecondary()
|
||||||
|
.setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.electricScribingTools));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.etherealProcessorResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Etheral Processor",
|
||||||
|
EMTResearchAspects.etherealProcessor,
|
||||||
|
-1,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
new ItemStack(EMTBlocks.emtMachines, 1, 1)).setParents("Electric Magic Tools").setConcealed()
|
||||||
|
.registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.etheralProcessor));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Registry.enableGTCompat && !EMTConfigHandler.compressedSolarsResearch) {
|
||||||
|
if (!EMTConfigHandler.waterSolarsResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Water Infused Solar Panels",
|
||||||
|
EMTResearchAspects.waterSolars,
|
||||||
|
-7,
|
||||||
|
-7,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTBlocks.solars[0], 1, 3)).setSecondary().setParents("Compressed Solars")
|
||||||
|
.registerResearchItem().setPages(
|
||||||
|
new ResearchPage(""),
|
||||||
|
new ResearchPage(EMTRecipes.waterSolar),
|
||||||
|
new ResearchPage(EMTRecipes.doubleWaterSolar),
|
||||||
|
new ResearchPage(EMTRecipes.tripleWaterSolar));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.darkSolarsResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Entropy Infused Solar Panels",
|
||||||
|
EMTResearchAspects.darkSolars,
|
||||||
|
-8,
|
||||||
|
-6,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTBlocks.solars[0], 1, 6)).setSecondary().setParents("Compressed Solars")
|
||||||
|
.registerResearchItem().setPages(
|
||||||
|
new ResearchPage(""),
|
||||||
|
new ResearchPage(EMTRecipes.darkSolar),
|
||||||
|
new ResearchPage(EMTRecipes.doubleDarkSolar),
|
||||||
|
new ResearchPage(EMTRecipes.tripleDarkSolar));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.orderSolarsResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Order Infused Solar Panels",
|
||||||
|
EMTResearchAspects.orderSolars,
|
||||||
|
-6,
|
||||||
|
-8,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTBlocks.solars[0], 1, 9)).setSecondary().setParents("Compressed Solars")
|
||||||
|
.registerResearchItem().setPages(
|
||||||
|
new ResearchPage(""),
|
||||||
|
new ResearchPage(EMTRecipes.orderSolar),
|
||||||
|
new ResearchPage(EMTRecipes.doubleOrderSolar),
|
||||||
|
new ResearchPage(EMTRecipes.tripleOrderSolar));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.fireSolarsResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Fire Infused Solar Panels",
|
||||||
|
EMTResearchAspects.fireSolars,
|
||||||
|
-5,
|
||||||
|
-7,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTBlocks.solars[0], 1, 12)).setSecondary().setParents("Compressed Solars")
|
||||||
|
.registerResearchItem().setPages(
|
||||||
|
new ResearchPage(""),
|
||||||
|
new ResearchPage(EMTRecipes.fireSolar),
|
||||||
|
new ResearchPage(EMTRecipes.doubleFireSolar),
|
||||||
|
new ResearchPage(EMTRecipes.tripleFireSolar));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.airSolarsResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Air Infused Solar Panels",
|
||||||
|
EMTResearchAspects.airSolars,
|
||||||
|
-4,
|
||||||
|
-6,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTBlocks.solars[0], 1, 15)).setSecondary().setParents("Compressed Solars")
|
||||||
|
.registerResearchItem().setPages(
|
||||||
|
new ResearchPage(""),
|
||||||
|
new ResearchPage(EMTRecipes.airSolar),
|
||||||
|
new ResearchPage(EMTRecipes.doubleAirSolar),
|
||||||
|
new ResearchPage(EMTRecipes.tripleAirSolar));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.earthSolarsResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Earth Infused Solar Panels",
|
||||||
|
EMTResearchAspects.earthSolars,
|
||||||
|
-6,
|
||||||
|
-7,
|
||||||
|
1,
|
||||||
|
new ItemStack(EMTBlocks.solars[1], 1, 2)).setSecondary().setParents("Compressed Solars")
|
||||||
|
.registerResearchItem().setPages(
|
||||||
|
new ResearchPage(""),
|
||||||
|
new ResearchPage(EMTRecipes.earthSolar),
|
||||||
|
new ResearchPage(EMTRecipes.doubleEarthSolar),
|
||||||
|
new ResearchPage(EMTRecipes.tripleEarthSolar));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.uuMInfusionResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"UU-Matter Infusion",
|
||||||
|
EMTResearchAspects.uuMInfusion,
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
3,
|
||||||
|
new ItemStack(EMTItems.itemEMTItems, 1, 15)).setParentsHidden("Electric Magic Tools").setConcealed()
|
||||||
|
.registerResearchItem().setPages(
|
||||||
|
new ResearchPage(""),
|
||||||
|
new ResearchPage(EMTRecipes.uuMCrystal),
|
||||||
|
new ResearchPage(EMTRecipes.charcoalToCoal),
|
||||||
|
new ResearchPage(EMTRecipes.glowstoneDustToBlock),
|
||||||
|
new ResearchPage(EMTRecipes.stoneBricksToIronOre),
|
||||||
|
new ResearchPage(EMTRecipes.arcaneStoneToCopperOre),
|
||||||
|
new ResearchPage(EMTRecipes.arcaneStoneBricksToTinOre),
|
||||||
|
new ResearchPage(EMTRecipes.amberBlockToLeadOre),
|
||||||
|
new ResearchPage(EMTRecipes.amberBricksToUraniumOre),
|
||||||
|
new ResearchPage(EMTRecipes.shardToResin),
|
||||||
|
new ResearchPage(EMTRecipes.shardToRedstone),
|
||||||
|
new ResearchPage(EMTRecipes.shardToLapis),
|
||||||
|
new ResearchPage(EMTRecipes.ironToGold),
|
||||||
|
new ResearchPage(EMTRecipes.goldToDiamond),
|
||||||
|
new ResearchPage(EMTRecipes.diamondToUranium),
|
||||||
|
new ResearchPage(EMTRecipes.uraniumToIridium));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.portableNodeResarch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Portable Node",
|
||||||
|
EMTResearchAspects.portableNode,
|
||||||
|
2,
|
||||||
|
5,
|
||||||
|
3,
|
||||||
|
new ItemStack(EMTBlocks.portableNode)).setParents("Electric Magic Tools").setConcealed()
|
||||||
|
.registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.portableNode));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.electricHoeGrowthResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Electric Hoe of Growth",
|
||||||
|
EMTResearchAspects.electricHoeGrowth,
|
||||||
|
-1,
|
||||||
|
-4,
|
||||||
|
2,
|
||||||
|
new ItemStack(EMTItems.electricHoeGrowth)).setParents("Electric Magic Tools").setConcealed()
|
||||||
|
.registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.electricHoeGrowth));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.chargeFocusResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Wand Focus: Charging",
|
||||||
|
EMTResearchAspects.chargeFocus,
|
||||||
|
5,
|
||||||
|
3,
|
||||||
|
2,
|
||||||
|
new ItemStack(EMTItems.chargeFocus)).setParents("Electric Magic Tools").setConcealed()
|
||||||
|
.registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.chargeFocus));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Registry.enableGTCompat && !EMTConfigHandler.maintenanceFocusResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Wand Focus: Maintenance",
|
||||||
|
EMTResearchAspects.maintenanceFocus,
|
||||||
|
7,
|
||||||
|
4,
|
||||||
|
4,
|
||||||
|
new ItemStack(EMTItems.maintenanceFocus)).setParents("Wand Focus: Charging").setConcealed()
|
||||||
|
.registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.maintenanceFocus));
|
||||||
|
}
|
||||||
|
if (!EMTConfigHandler.wandChargeFocusResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Wand Focus: Wand Charging",
|
||||||
|
EMTResearchAspects.wandChargeFocus,
|
||||||
|
7,
|
||||||
|
3,
|
||||||
|
3,
|
||||||
|
new ItemStack(EMTItems.wandChargeFocus)).setParents("Wand Focus: Charging").setConcealed()
|
||||||
|
.registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.wandChargeFocus));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.inventoryChargingRing) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Inventory Charging Ring",
|
||||||
|
EMTResearchAspects.inventoryChargingRing,
|
||||||
|
0,
|
||||||
|
-5,
|
||||||
|
3,
|
||||||
|
new ItemStack(EMTItems.emtBauble, 1, 1)).setParentsHidden("Electric Magic Tools").setConcealed()
|
||||||
|
.registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.inventoryChargingRing));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.armorChargingRing) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Armor Charging Ring",
|
||||||
|
EMTResearchAspects.armorChargingRing,
|
||||||
|
0,
|
||||||
|
-7,
|
||||||
|
3,
|
||||||
|
new ItemStack(EMTItems.emtBauble, 1, 0)).setSecondary().setParents("Inventory Charging Ring")
|
||||||
|
.setConcealed().registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.armorChargingRing));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.thaumiumWingResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Thaumium Reinforced Wings",
|
||||||
|
EMTResearchAspects.thaumiumWing,
|
||||||
|
0,
|
||||||
|
4,
|
||||||
|
0,
|
||||||
|
new ItemStack(EMTItems.thaumiumWing)).setSecondary().setParents("Feather Wings").setConcealed()
|
||||||
|
.registerResearchItem().setPages(
|
||||||
|
new ResearchPage(""),
|
||||||
|
new ResearchPage(EMTRecipes.thaumiumWing),
|
||||||
|
new ResearchPage(EMTRecipes.thaumiumWings));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.nanoWingResearch && !EMTConfigHandler.thaumiumWingResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Nanosuit Wings",
|
||||||
|
EMTResearchAspects.nanoWing,
|
||||||
|
0,
|
||||||
|
6,
|
||||||
|
2,
|
||||||
|
new ItemStack(EMTItems.nanoWing)).setParents("Thaumium Reinforced Wings").setConcealed()
|
||||||
|
.registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.nanoWings));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.quantumWingsResearch && !EMTConfigHandler.thaumiumWingResearch
|
||||||
|
&& !EMTConfigHandler.nanoWingResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Quantum Wings",
|
||||||
|
EMTResearchAspects.quantumWing,
|
||||||
|
0,
|
||||||
|
8,
|
||||||
|
3,
|
||||||
|
new ItemStack(EMTItems.quantumWing)).setParents("Nanosuit Wings").setConcealed()
|
||||||
|
.registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.quantumWings));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EMTConfigHandler.infusedQuantumChestplate && !EMTConfigHandler.thaumiumWingResearch
|
||||||
|
&& !EMTConfigHandler.nanoWingResearch
|
||||||
|
&& !EMTConfigHandler.quantumWingsResearch) {
|
||||||
|
new EMTResearchItem(
|
||||||
|
"Infused Quantum Armor",
|
||||||
|
EMTResearchAspects.quantumWing,
|
||||||
|
0,
|
||||||
|
10,
|
||||||
|
4,
|
||||||
|
new ItemStack(EMTItems.quantumArmor)).setParents("Quantum Wings").setConcealed()
|
||||||
|
.registerResearchItem()
|
||||||
|
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.infusedQuantumArmor));
|
||||||
|
}
|
||||||
|
/***********************************/
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package emt.init;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
import emt.tile.TileElectricCloud;
|
||||||
|
import emt.tile.TileEntityEtherealMacerator;
|
||||||
|
import emt.tile.TileEntityIndustrialWandRecharge;
|
||||||
|
import emt.tile.TileEntityPortableNode;
|
||||||
|
import emt.tile.generator.TileEntityBaseGenerator;
|
||||||
|
import emt.tile.solar.TileEntitySolarBase;
|
||||||
|
|
||||||
|
public class EMTTiles {
|
||||||
|
|
||||||
|
public static void registerTileEntities() {
|
||||||
|
|
||||||
|
if (Registry.enableGTCompat) {
|
||||||
|
// Essentia Gens
|
||||||
|
// legacy support
|
||||||
|
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentitypotentiagenerator");
|
||||||
|
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityignisgenerator");
|
||||||
|
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityauramgenerator");
|
||||||
|
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityarborgenerator");
|
||||||
|
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityaergenerator");
|
||||||
|
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentitylucrumgenerator");
|
||||||
|
|
||||||
|
// new TEs will be called TileEntityEssentiaGenerator
|
||||||
|
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "TileEntityEssentiaGenerator");
|
||||||
|
|
||||||
|
// Solars
|
||||||
|
// legacy support
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitycompressedsolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoublecompressedsolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytriplecompressedsolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitywatersolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoublewatersolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytriplewatersolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydarksolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubledarksolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripledarksolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityordersolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubleordersolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripleordersolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityfiresolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoublefiresolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytriplefiresolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityairsolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubleairsolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripleairsolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityearthsolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubleearthsolar");
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripleearthsolar");
|
||||||
|
|
||||||
|
// new TEs will be called TileEntityXCompressedSolar
|
||||||
|
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "TileEntityXCompressedSolar");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Machinery
|
||||||
|
GameRegistry.registerTileEntity(TileEntityIndustrialWandRecharge.class, "tileentityindustrialwandrecharge");
|
||||||
|
GameRegistry.registerTileEntity(TileEntityEtherealMacerator.class, "tileentityetherealmacerator");
|
||||||
|
|
||||||
|
// Random Stuff
|
||||||
|
GameRegistry.registerTileEntity(TileEntityPortableNode.class, "tileentityportablenode");
|
||||||
|
GameRegistry.registerTileEntity(TileElectricCloud.class, "tileEntityElectricCloud");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,234 @@
|
|||||||
|
package emt.init;
|
||||||
|
|
||||||
|
import static thaumcraft.api.aspects.Aspect.*;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTResearchItem;
|
||||||
|
import gregtech.api.enums.ItemList;
|
||||||
|
import gregtech.api.enums.Materials;
|
||||||
|
import gregtech.api.enums.OrePrefixes;
|
||||||
|
import gregtech.api.util.GT_OreDictUnificator;
|
||||||
|
import gregtech.api.util.GT_Utility;
|
||||||
|
import thaumcraft.api.ThaumcraftApi;
|
||||||
|
import thaumcraft.api.ThaumcraftApiHelper;
|
||||||
|
import thaumcraft.api.aspects.AspectList;
|
||||||
|
import thaumcraft.api.crafting.IArcaneRecipe;
|
||||||
|
import thaumcraft.api.crafting.ShapedArcaneRecipe;
|
||||||
|
import thaumcraft.api.research.ResearchItem;
|
||||||
|
import thaumcraft.api.research.ResearchPage;
|
||||||
|
|
||||||
|
public class EMT_GTNH_Recipes_And_Researches implements Runnable {
|
||||||
|
|
||||||
|
private static LinkedHashMap<String, IArcaneRecipe> arcaneRecipeLinkedHashMap = new LinkedHashMap<>();
|
||||||
|
|
||||||
|
private static AspectList getPrimals(int amount) {
|
||||||
|
return new AspectList().add(ORDER, amount).add(ENTROPY, amount).add(AIR, amount).add(EARTH, amount)
|
||||||
|
.add(WATER, amount).add(FIRE, amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
EMTResearches.addResearchTab();
|
||||||
|
runArcaneRecipes();
|
||||||
|
runResreaches();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
private void runArcaneRecipes() {
|
||||||
|
arcaneRecipeLinkedHashMap.put(
|
||||||
|
"DiamondChainsaw",
|
||||||
|
new ShapedArcaneRecipe(
|
||||||
|
"DiamondChainsaw",
|
||||||
|
new ItemStack(EMTItems.diamondChainsaw),
|
||||||
|
getPrimals(35),
|
||||||
|
"sts",
|
||||||
|
"pmp",
|
||||||
|
"pbp",
|
||||||
|
's',
|
||||||
|
GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Diamond, 1),
|
||||||
|
'p',
|
||||||
|
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Diamond, 1),
|
||||||
|
't',
|
||||||
|
GT_OreDictUnificator.get(OrePrefixes.toolHeadChainsaw, Materials.Thaumium, 1),
|
||||||
|
'b',
|
||||||
|
ItemList.Battery_RE_LV_Sodium.get(1),
|
||||||
|
'm',
|
||||||
|
ItemList.Electric_Motor_MV.get(1)));
|
||||||
|
arcaneRecipeLinkedHashMap.put(
|
||||||
|
"ThaumiumChainsaw",
|
||||||
|
new ShapedArcaneRecipe(
|
||||||
|
"ThaumiumChainsaw",
|
||||||
|
new ItemStack(EMTItems.thaumiumChainsaw),
|
||||||
|
getPrimals(35),
|
||||||
|
"sps",
|
||||||
|
"pmp",
|
||||||
|
"ppp",
|
||||||
|
's',
|
||||||
|
GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Thaumium, 1),
|
||||||
|
'p',
|
||||||
|
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Thaumium, 1),
|
||||||
|
'b',
|
||||||
|
ItemList.Battery_RE_LV_Sodium.get(1),
|
||||||
|
'm',
|
||||||
|
new ItemStack(EMTItems.diamondChainsaw)));
|
||||||
|
|
||||||
|
for (IArcaneRecipe recipe : arcaneRecipeLinkedHashMap.values()) {
|
||||||
|
ThaumcraftApi.getCraftingRecipes().add(recipe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void runResreaches() {
|
||||||
|
HashSet<ResearchItem> researches = new HashSet<>();
|
||||||
|
researches.add(
|
||||||
|
new EMTResearchItem(
|
||||||
|
"ElectricMagicTools",
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
new ResourceLocation(EMT.TEXTURE_PATH, "textures/misc/emt.png")).setSpecial().setAutoUnlock()
|
||||||
|
.setPages(new ResearchPage("")));
|
||||||
|
researches.add(
|
||||||
|
new EMTResearchItem(
|
||||||
|
"DiamondChainsaw",
|
||||||
|
new AspectList().add(GREED, 12).add(FIRE, 9).add(METAL, 6).add(EARTH, 3),
|
||||||
|
0,
|
||||||
|
-2,
|
||||||
|
2,
|
||||||
|
new ItemStack(EMTItems.diamondChainsaw))
|
||||||
|
.setPages(new ResearchPage(arcaneRecipeLinkedHashMap.get("DiamondChainsaw"))).setRound()
|
||||||
|
.setParentsHidden("ElectricMagicTools"));
|
||||||
|
// researches.add(new EMTResearchItem("DiamondChainsaw",new
|
||||||
|
// AspectList().add(GREED,12).add(FIRE,9).add(METAL,6).add(EARTH,3),0,-2,2,new
|
||||||
|
// ItemStack(EMTItems.diamondChainsaw)).setRound());
|
||||||
|
researches.forEach(ResearchItem::registerResearchItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
class ShapedArcaneRecipeIgnoresNBT extends ShapedArcaneRecipe {
|
||||||
|
|
||||||
|
protected String research;
|
||||||
|
protected ItemStack result;
|
||||||
|
protected AspectList aspects;
|
||||||
|
protected Object[] recipe;
|
||||||
|
protected LinkedHashMap<Character, Object> translation = new LinkedHashMap<>();
|
||||||
|
int[] rowcolm;
|
||||||
|
|
||||||
|
public ShapedArcaneRecipeIgnoresNBT(String research, ItemStack result, AspectList aspects, Object... recipe) {
|
||||||
|
super(research, result, aspects, recipe);
|
||||||
|
this.research = research;
|
||||||
|
this.result = result;
|
||||||
|
this.aspects = aspects;
|
||||||
|
this.recipe = recipe;
|
||||||
|
int rows = 0;
|
||||||
|
int colums = 0;
|
||||||
|
if (!(recipe[0] instanceof String)) throw new UnsupportedOperationException(
|
||||||
|
"The Recipe must start with at least one String for the first row!");
|
||||||
|
int i = 0;
|
||||||
|
rowcolm = new int[3];
|
||||||
|
do {
|
||||||
|
rows++;
|
||||||
|
colums = Math.max(colums, ((String) recipe[i]).length());
|
||||||
|
rowcolm[i] = colums;
|
||||||
|
i = rows;
|
||||||
|
} while (recipe[i] instanceof String);
|
||||||
|
if (rows > 3 || colums > 3)
|
||||||
|
throw new UnsupportedOperationException("The Recipe must fit in a 3x3 crafting field!");
|
||||||
|
rowcolm = Arrays.copyOf(rowcolm, rows);
|
||||||
|
|
||||||
|
for (int j = i; j < recipe.length; j += 2) {
|
||||||
|
if (recipe[j] instanceof Character) translation.put((Character) recipe[j], recipe[j + 1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean matches(IInventory inv, World world, EntityPlayer player) {
|
||||||
|
if (this.research.length() > 0
|
||||||
|
&& !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), this.research))
|
||||||
|
return false;
|
||||||
|
else {
|
||||||
|
for (int y = 0; y < rowcolm.length; y++) {
|
||||||
|
String rowAsString = ((String) recipe[y]);
|
||||||
|
for (int x = 0; x < rowcolm[y]; x++) {
|
||||||
|
Object itemReplacement = translation.get(rowAsString.toCharArray()[x]);
|
||||||
|
ItemStack slot = ThaumcraftApiHelper.getStackInRowAndColumn(inv, x, y);
|
||||||
|
if (itemReplacement != null && slot == null) {
|
||||||
|
return false;
|
||||||
|
} else if (itemReplacement instanceof String) {
|
||||||
|
if (!GT_Utility.areStacksEqual(
|
||||||
|
GT_OreDictUnificator.getFirstOre(itemReplacement, 1),
|
||||||
|
GT_OreDictUnificator.get(slot),
|
||||||
|
true))
|
||||||
|
if (!OreDictionary.getOres((String) itemReplacement).contains(slot)) return false;
|
||||||
|
} else if (itemReplacement instanceof ItemStack) {
|
||||||
|
if (!GT_Utility.isStackValid((ItemStack) itemReplacement)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!GT_Utility.areStacksEqual((ItemStack) itemReplacement, slot, true))
|
||||||
|
if (!GT_Utility.areUnificationsEqual((ItemStack) itemReplacement, slot, true))
|
||||||
|
if (!(((ItemStack) itemReplacement).getItem().equals(slot.getItem())
|
||||||
|
&& ((ItemStack) itemReplacement).getItemDamage()
|
||||||
|
== OreDictionary.WILDCARD_VALUE))
|
||||||
|
return false;
|
||||||
|
} else if (itemReplacement instanceof Collection) {
|
||||||
|
boolean hit = false;
|
||||||
|
for (Object o : (Collection<?>) itemReplacement) {
|
||||||
|
if (GT_Utility.areStacksEqual((ItemStack) o, slot, true)
|
||||||
|
|| GT_Utility.areUnificationsEqual((ItemStack) o, slot, true)
|
||||||
|
|| (((ItemStack) o).getItem().equals(slot.getItem())
|
||||||
|
&& ((ItemStack) itemReplacement).getItemDamage()
|
||||||
|
== OreDictionary.WILDCARD_VALUE))
|
||||||
|
hit = true;
|
||||||
|
}
|
||||||
|
if (!hit) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getCraftingResult(IInventory iInventory) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRecipeSize() {
|
||||||
|
return recipe.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getRecipeOutput() {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AspectList getAspects() {
|
||||||
|
return aspects;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AspectList getAspects(IInventory iInventory) {
|
||||||
|
return aspects;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getResearch() {
|
||||||
|
return research;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package emt.init;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.Loader;
|
||||||
|
import emt.gthandler.common.loader.EMT_GT_Loader;
|
||||||
|
import emt.tile.solar.Solars;
|
||||||
|
import emt.util.EMTEssentiasOutputs;
|
||||||
|
|
||||||
|
public class Registry {
|
||||||
|
|
||||||
|
public static boolean enableGTCompat;
|
||||||
|
|
||||||
|
public static void registerPreInit() {
|
||||||
|
enableGTCompat = Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi");
|
||||||
|
EMTBlocks.registerBlocks();
|
||||||
|
EMTItems.registerItems();
|
||||||
|
EMTTiles.registerTileEntities();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerInit() {
|
||||||
|
if (enableGTCompat) {
|
||||||
|
EMT_GT_Loader.run();
|
||||||
|
}
|
||||||
|
EMTRecipes.registerEarlyRecipes();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerLate() {
|
||||||
|
EMTEssentiasOutputs.addOutputs();
|
||||||
|
EMTBlocks.addAspects();
|
||||||
|
if (enableGTCompat) {
|
||||||
|
EMT_GT_Loader.runlate();
|
||||||
|
}
|
||||||
|
EMTRecipes.registerLateRecipes();
|
||||||
|
// new EMT_GTNH_Recipes_And_Researches().run();
|
||||||
|
EMTRecipes.registerUUMInfusionRecipes();
|
||||||
|
EMTResearches.register();
|
||||||
|
if (enableGTCompat) {
|
||||||
|
Solars.registerReverseRecipes();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package emt.item;
|
||||||
|
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTTextHelper;
|
||||||
|
|
||||||
|
public class ItemBase extends Item {
|
||||||
|
|
||||||
|
public ItemBase(String unlocName, String textureName) {
|
||||||
|
super();
|
||||||
|
setUnlocalizedName(EMT.MOD_ID + unlocName);
|
||||||
|
setTextureName(EMT.TEXTURE_PATH + ":" + textureName);
|
||||||
|
setCreativeTab(EMT.TAB);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemBase(String unlocName) {
|
||||||
|
super();
|
||||||
|
setUnlocalizedName(EMT.MOD_ID + ".item." + unlocName);
|
||||||
|
setCreativeTab(EMT.TAB);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getItemStackDisplayName(ItemStack stack) {
|
||||||
|
return (EMTTextHelper.GREEN
|
||||||
|
+ StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
+17
-22
@@ -1,40 +1,36 @@
|
|||||||
/*******************************************************************************
|
package emt.item;
|
||||||
* Copyright (c) 2014 Tombenpotter.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
|
||||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
|
||||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
|
||||||
* http://www.minecraftforum.net/topic/1585216-
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
package tombenpotter.emt.common.items;
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
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 emt.EMT;
|
||||||
import ic2.api.item.ElectricItem;
|
import ic2.api.item.ElectricItem;
|
||||||
import ic2.api.item.IElectricItem;
|
import ic2.api.item.IElectricItem;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import thaumcraft.api.IScribeTools;
|
import thaumcraft.api.IScribeTools;
|
||||||
import thaumcraft.common.items.ItemInkwell;
|
import thaumcraft.common.items.ItemInkwell;
|
||||||
import tombenpotter.emt.ElectroMagicTools;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class ItemElectricScribingTools extends ItemInkwell implements IElectricItem, IScribeTools {
|
public class ItemElectricScribingTools extends ItemInkwell implements IElectricItem, IScribeTools {
|
||||||
|
|
||||||
public static int maxCharge = 400;
|
public static int maxCharge = 400;
|
||||||
|
|
||||||
public ItemElectricScribingTools() {
|
public ItemElectricScribingTools() {
|
||||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
this.setCreativeTab(EMT.TAB);
|
||||||
this.setMaxDamage(400);
|
this.setMaxDamage(400);
|
||||||
this.setMaxStackSize(1);
|
this.setMaxStackSize(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||||
|
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||||
return false;
|
return false;
|
||||||
@@ -47,7 +43,7 @@ public class ItemElectricScribingTools extends ItemInkwell implements IElectricI
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getTier(ItemStack itemStack) {
|
public int getTier(ItemStack itemStack) {
|
||||||
return 1;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -55,9 +51,8 @@ public class ItemElectricScribingTools extends ItemInkwell implements IElectricI
|
|||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||||
ItemStack itemStack = new ItemStack(this, 1);
|
ItemStack itemStack = new ItemStack(this, 1);
|
||||||
if (getChargedItem(itemStack) == this) {
|
if (getChargedItem(itemStack) == this) {
|
||||||
ItemStack charged = new ItemStack(this, 1);
|
ItemStack charged = new ItemStack(this, 1);
|
||||||
@@ -0,0 +1,154 @@
|
|||||||
|
package emt.item;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
|
import baubles.api.BaubleType;
|
||||||
|
import baubles.api.IBauble;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
|
import ic2.api.item.IElectricItem;
|
||||||
|
import thaumcraft.api.IRunicArmor;
|
||||||
|
|
||||||
|
public class ItemIC2Baubles extends ItemBase implements IBauble, IRunicArmor {
|
||||||
|
|
||||||
|
public static int wornTick;
|
||||||
|
public IIcon[] icon = new IIcon[16];
|
||||||
|
public Random random = new Random();
|
||||||
|
|
||||||
|
public ItemIC2Baubles() {
|
||||||
|
super("bauble");
|
||||||
|
this.setHasSubtypes(true);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
this.setMaxStackSize(1);
|
||||||
|
|
||||||
|
wornTick = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack itemstack) {
|
||||||
|
String name = "";
|
||||||
|
switch (itemstack.getItemDamage()) {
|
||||||
|
case 0: {
|
||||||
|
name = "euMaker.armor";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1: {
|
||||||
|
name = "euMaker.inventory";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
name = "nothing";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return getUnlocalizedName() + "." + name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister ri) {
|
||||||
|
this.icon[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":armoreumaker");
|
||||||
|
this.icon[1] = ri.registerIcon(EMT.TEXTURE_PATH + ":inventoryeumaker");
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIconFromDamage(int meta) {
|
||||||
|
return this.icon[meta];
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> list) {
|
||||||
|
list.add(new ItemStack(this, 1, 0));
|
||||||
|
list.add(new ItemStack(this, 1, 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BaubleType getBaubleType(ItemStack stack) {
|
||||||
|
if (stack.getItemDamage() <= 1) {
|
||||||
|
return BaubleType.RING;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onWornTick(ItemStack stack, EntityLivingBase player) {
|
||||||
|
if (!player.worldObj.isRemote) {
|
||||||
|
if (stack != null) {
|
||||||
|
if (stack.getItemDamage() == 0) {
|
||||||
|
if (player instanceof EntityPlayer) {
|
||||||
|
int energyLeft = EMTConfigHandler.armorBaubleProduction;
|
||||||
|
for (int i = 0; i < ((EntityPlayer) player).inventory.armorInventory.length; i++) {
|
||||||
|
if (energyLeft > 0) {
|
||||||
|
if ((((EntityPlayer) player).inventory.armorInventory[i] != null)
|
||||||
|
&& (((EntityPlayer) player).inventory.armorInventory[i]
|
||||||
|
.getItem() instanceof IElectricItem)) {
|
||||||
|
double sentPacket = ElectricItem.manager.charge(
|
||||||
|
((EntityPlayer) player).inventory.armorInventory[i],
|
||||||
|
energyLeft,
|
||||||
|
4,
|
||||||
|
false,
|
||||||
|
false);
|
||||||
|
energyLeft -= sentPacket;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (stack != null) {
|
||||||
|
if (stack.getItemDamage() == 1) {
|
||||||
|
if (player instanceof EntityPlayer) {
|
||||||
|
int energyLeft = EMTConfigHandler.inventoryBaubleProdution;
|
||||||
|
for (int i = 0; i < ((EntityPlayer) player).inventory.mainInventory.length; i++) {
|
||||||
|
if (energyLeft > 0) {
|
||||||
|
if ((((EntityPlayer) player).inventory.mainInventory[i] != null)
|
||||||
|
&& (((EntityPlayer) player).inventory.mainInventory[i]
|
||||||
|
.getItem() instanceof IElectricItem)) {
|
||||||
|
double sentPacket = ElectricItem.manager.charge(
|
||||||
|
((EntityPlayer) player).inventory.mainInventory[i],
|
||||||
|
energyLeft,
|
||||||
|
4,
|
||||||
|
false,
|
||||||
|
false);
|
||||||
|
energyLeft -= sentPacket;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEquipped(ItemStack stack, EntityLivingBase player) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUnequipped(ItemStack stack, EntityLivingBase player) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canEquip(ItemStack stack, EntityLivingBase player) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canUnequip(ItemStack stack, EntityLivingBase player) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRunicCharge(ItemStack itemStack) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,239 @@
|
|||||||
|
package emt.item;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumAction;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
import net.minecraftforge.event.entity.player.ArrowNockEvent;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import thaumcraft.common.config.Config;
|
||||||
|
import thaumcraft.common.lib.utils.InventoryUtils;
|
||||||
|
|
||||||
|
public class ItemMaterials extends Item {
|
||||||
|
|
||||||
|
public IIcon[] icon = new IIcon[20];
|
||||||
|
|
||||||
|
public ItemMaterials() {
|
||||||
|
this.setCreativeTab(EMT.TAB);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
this.setMaxStackSize(64);
|
||||||
|
setHasSubtypes(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack itemstack) {
|
||||||
|
String name = null;
|
||||||
|
switch (itemstack.getItemDamage()) {
|
||||||
|
case 0:
|
||||||
|
name = "oreClusterUranium";
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
name = "crushedOreAmber";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
name = "purifiedOreAmber";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
name = "crushedOreCinnabar";
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
name = "purifiedOreCinnabar";
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
name = "thaumiumPlate";
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
name = "lightningSummoner";
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
name = "featherMesh";
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
name = "glue";
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
name = "ductTape";
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
name = "rubberBall";
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
name = "cardboard";
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
name = "featherGluedCardboardWing";
|
||||||
|
break;
|
||||||
|
case 13:
|
||||||
|
name = "taintedFeather";
|
||||||
|
break;
|
||||||
|
case 14:
|
||||||
|
name = "thaumiumWing";
|
||||||
|
break;
|
||||||
|
case 15:
|
||||||
|
name = "uumatterDrop";
|
||||||
|
break;
|
||||||
|
case 16:
|
||||||
|
name = "draconicSchematic";
|
||||||
|
break;
|
||||||
|
case 17:
|
||||||
|
name = "wyvernSchematic";
|
||||||
|
break;
|
||||||
|
case 18:
|
||||||
|
name = "awakenedSchematic";
|
||||||
|
break;
|
||||||
|
case 19:
|
||||||
|
name = "chaoticSchematic";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
name = "nothing";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return "item." + EMT.MOD_ID + "." + name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List<String> result, boolean advanced) {
|
||||||
|
switch (stack.getItemDamage()) {
|
||||||
|
case 16:
|
||||||
|
case 17:
|
||||||
|
case 18:
|
||||||
|
case 19:
|
||||||
|
result.add(EnumChatFormatting.RED + "[DEPRECATED] Please put in the crafting table to get back!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister ri) {
|
||||||
|
this.icon[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/clusteruranium");
|
||||||
|
this.icon[1] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/crushedamber");
|
||||||
|
this.icon[2] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/purifiedamber");
|
||||||
|
this.icon[3] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/crushedcinnabar");
|
||||||
|
this.icon[4] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/purifiedcinnabar");
|
||||||
|
this.icon[5] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/thaumiumplate");
|
||||||
|
this.icon[6] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/lightningsummoner");
|
||||||
|
this.icon[7] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/feathermesh");
|
||||||
|
this.icon[8] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/glue");
|
||||||
|
this.icon[9] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/ducttape");
|
||||||
|
this.icon[10] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/rubberball");
|
||||||
|
this.icon[11] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/cardboard");
|
||||||
|
this.icon[12] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/cardboardsheet");
|
||||||
|
this.icon[13] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/taintedfeather");
|
||||||
|
this.icon[14] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/thaumiumWing");
|
||||||
|
this.icon[15] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/uumatterdrop");
|
||||||
|
this.icon[16] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/draconicSchematic");
|
||||||
|
this.icon[17] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/wyvernSchematic");
|
||||||
|
this.icon[18] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/awakenedSchematic");
|
||||||
|
this.icon[19] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/chaoticSchematic");
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIconFromDamage(int meta) {
|
||||||
|
return this.icon[meta];
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> list) {
|
||||||
|
for (int i = 1; i <= 19; i++) {
|
||||||
|
list.add(new ItemStack(this, 1, i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onUsingTick(ItemStack stack, EntityPlayer player, int count) {
|
||||||
|
if (stack != null && stack.getItemDamage() == 6 && this.getMaxItemUseDuration(stack) - count >= 40) {
|
||||||
|
World world = player.worldObj;
|
||||||
|
player.swingItem();
|
||||||
|
float f = 1.0F;
|
||||||
|
float f1 = player.prevRotationPitch + ((player.rotationPitch - player.prevRotationPitch) * f);
|
||||||
|
float f2 = player.prevRotationYaw + ((player.rotationYaw - player.prevRotationYaw) * f);
|
||||||
|
double playerX = player.prevPosX + ((player.posX - player.prevPosX) * f);
|
||||||
|
double playerY = (player.prevPosY + ((player.posY - player.prevPosY) * f) + 1.6200000000000001D)
|
||||||
|
- player.yOffset;
|
||||||
|
double playerZ = player.prevPosZ + ((player.posZ - player.prevPosZ) * f);
|
||||||
|
Vec3 playerLoc = Vec3.createVectorHelper(playerX, playerY, playerZ);
|
||||||
|
float f3 = MathHelper.cos((-f2 * 0.01745329F) - (float) Math.PI);
|
||||||
|
float f4 = MathHelper.sin((-f2 * 0.01745329F) - (float) Math.PI);
|
||||||
|
float f5 = -MathHelper.cos(-f1 * 0.01745329F);
|
||||||
|
float f6 = MathHelper.sin(-f1 * 0.01745329F);
|
||||||
|
float f7 = f4 * f5;
|
||||||
|
float f8 = f6;
|
||||||
|
float f9 = f3 * f5;
|
||||||
|
float d3 = 5000;
|
||||||
|
Vec3 vec3d1 = playerLoc.addVector(f7 * d3, f8 * d3, f9 * d3);
|
||||||
|
MovingObjectPosition movingobjectposition = player.worldObj.rayTraceBlocks(playerLoc, vec3d1, true);
|
||||||
|
if (movingobjectposition != null) {
|
||||||
|
if (movingobjectposition.typeOfHit == MovingObjectType.BLOCK) {
|
||||||
|
int x2 = movingobjectposition.blockX;
|
||||||
|
int y2 = movingobjectposition.blockY;
|
||||||
|
int z2 = movingobjectposition.blockZ;
|
||||||
|
world.spawnEntityInWorld(new EntityLightningBolt(world, x2, y2, z2));
|
||||||
|
} else if (movingobjectposition.typeOfHit == MovingObjectType.ENTITY) {
|
||||||
|
Entity entityhit = movingobjectposition.entityHit;
|
||||||
|
double x = entityhit.posX;
|
||||||
|
double y = entityhit.posY;
|
||||||
|
double z = entityhit.posZ;
|
||||||
|
world.spawnEntityInWorld(new EntityLightningBolt(world, x, y, z));
|
||||||
|
}
|
||||||
|
if (!player.capabilities.isCreativeMode) {
|
||||||
|
player.inventory.consumeInventoryItem(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
player.stopUsingItem();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||||
|
if (stack.getItemDamage() == 6) {
|
||||||
|
ArrowNockEvent event = new ArrowNockEvent(player, stack);
|
||||||
|
MinecraftForge.EVENT_BUS.post(event);
|
||||||
|
if (event.isCanceled()) {
|
||||||
|
return event.result;
|
||||||
|
}
|
||||||
|
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
|
||||||
|
}
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxItemUseDuration(ItemStack stack) {
|
||||||
|
if (stack.getItemDamage() == 6) return 72000;
|
||||||
|
return super.getMaxItemUseDuration(stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnumAction getItemUseAction(ItemStack stack) {
|
||||||
|
if (stack.getItemDamage() == 6) return EnumAction.bow;
|
||||||
|
return EnumAction.none;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
|
||||||
|
super.onUpdate(stack, world, entity, par4, par5);
|
||||||
|
if ((!entity.worldObj.isRemote) && ((stack.getItemDamage() == 13))
|
||||||
|
&& ((entity instanceof EntityLivingBase))
|
||||||
|
&& (!((EntityLivingBase) entity).isEntityUndead())
|
||||||
|
&& (!((EntityLivingBase) entity).isPotionActive(Config.potionTaintPoisonID))
|
||||||
|
&& (world.rand.nextInt(4321) <= stack.stackSize)) {
|
||||||
|
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Config.potionTaintPoisonID, 120, 0, false));
|
||||||
|
if ((entity instanceof EntityPlayer)) {
|
||||||
|
InventoryUtils.consumeInventoryItem((EntityPlayer) entity, stack.getItem(), stack.getItemDamage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,284 @@
|
|||||||
|
package emt.item;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.potion.Potion;
|
||||||
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
import net.minecraft.util.ChatComponentText;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
|
import baubles.api.BaubleType;
|
||||||
|
import baubles.api.IBauble;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTTextHelper;
|
||||||
|
import thaumcraft.api.IRunicArmor;
|
||||||
|
import thaumcraft.api.IWarpingGear;
|
||||||
|
import thaumcraft.api.ThaumcraftApiHelper;
|
||||||
|
|
||||||
|
public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRunicArmor {
|
||||||
|
|
||||||
|
private static final String NBT_TAG_FORGE_DATA = "EMT";
|
||||||
|
private static final String NBT_TAG_MIND_CORRUPTION = "MindCorruption";
|
||||||
|
private static final String NBT_TAG_WARP = "warp";
|
||||||
|
public IIcon[] icon = new IIcon[16];
|
||||||
|
public Random random = new Random();
|
||||||
|
|
||||||
|
public ItemOneRing() {
|
||||||
|
super("bauble");
|
||||||
|
this.setHasSubtypes(true);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
this.setMaxStackSize(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getWarp(ItemStack itemstack, EntityPlayer player) {
|
||||||
|
return getItemWarpLevel(itemstack, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack itemstack) {
|
||||||
|
String name = "";
|
||||||
|
switch (itemstack.getItemDamage()) {
|
||||||
|
case 0: {
|
||||||
|
name = "oneRing";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
name = "nothing";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return "item." + EMT.MOD_ID + ".bauble." + name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack itemStack, EntityPlayer player, List<String> list, boolean par4) {
|
||||||
|
String colourCode = "" + EnumChatFormatting.DARK_RED;
|
||||||
|
list.add(
|
||||||
|
colourCode
|
||||||
|
+ "The Ring whispers to you, promising power. But at what cost? Long-term usage is NOT advised.");
|
||||||
|
list.add(colourCode + "Can RUIN your game if you don't understand what this does. READ THE QUEST!!");
|
||||||
|
super.addInformation(itemStack, player, list, par4);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister ri) {
|
||||||
|
this.icon[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":onering");
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIconFromDamage(int meta) {
|
||||||
|
return this.icon[meta];
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> list) {
|
||||||
|
list.add(new ItemStack(this, 1, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BaubleType getBaubleType(ItemStack stack) {
|
||||||
|
if (stack.getItemDamage() <= 0) {
|
||||||
|
return BaubleType.RING;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private NBTTagCompound getOrSetForgeTag(EntityPlayer pPlayer) {
|
||||||
|
NBTTagCompound tPlayerNBT = pPlayer.getEntityData();
|
||||||
|
NBTTagCompound forgeTag = new NBTTagCompound();
|
||||||
|
|
||||||
|
// getCompoundTag already returns the contents of "ForgeData" TagCompound. Changed this to
|
||||||
|
// save our value in EMT Sub-Tag
|
||||||
|
if (tPlayerNBT.hasKey(NBT_TAG_FORGE_DATA)) forgeTag = tPlayerNBT.getCompoundTag(NBT_TAG_FORGE_DATA);
|
||||||
|
else tPlayerNBT.setTag(NBT_TAG_FORGE_DATA, forgeTag);
|
||||||
|
|
||||||
|
return forgeTag;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getItemWarpLevel(ItemStack stack, boolean increment) {
|
||||||
|
NBTTagCompound tWarpTag = new NBTTagCompound();
|
||||||
|
int tWarpLevel = 0;
|
||||||
|
if (stack.hasTagCompound()) {
|
||||||
|
if (stack.getTagCompound().hasKey(NBT_TAG_WARP)) {
|
||||||
|
tWarpLevel = stack.getTagCompound().getInteger(NBT_TAG_WARP);
|
||||||
|
if (increment) stack.getTagCompound().setInteger(NBT_TAG_WARP, ++tWarpLevel);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
tWarpTag.setInteger(NBT_TAG_WARP, 0);
|
||||||
|
stack.setTagCompound(tWarpTag);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tWarpLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onWornTick(ItemStack stack, EntityLivingBase player) {
|
||||||
|
if (!player.isInvisible()) {
|
||||||
|
player.setInvisible(true);
|
||||||
|
((EntityPlayer) player).capabilities.disableDamage = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Stop doing this 20 times per second...
|
||||||
|
if (random.nextInt(20) > 0) return;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Why dump to a new tag when you can just grab the tag and work with it? NBTTagCompound tag = new
|
||||||
|
* NBTTagCompound(); ((EntityPlayer) player).writeToNBT(tag); NBTTagCompound forgeTag =
|
||||||
|
* tag.getCompoundTag("ForgeData");
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Retrieve Players NBT Data
|
||||||
|
|
||||||
|
NBTTagCompound forgeTag = getOrSetForgeTag((EntityPlayer) player);
|
||||||
|
|
||||||
|
int corruption = 0;
|
||||||
|
|
||||||
|
// get corruption levels, init to 0 if not existing yet
|
||||||
|
if (forgeTag.hasKey(NBT_TAG_MIND_CORRUPTION)) corruption = forgeTag.getInteger(NBT_TAG_MIND_CORRUPTION);
|
||||||
|
else forgeTag.setInteger(NBT_TAG_MIND_CORRUPTION, 0);
|
||||||
|
|
||||||
|
if (!player.worldObj.isRemote) {
|
||||||
|
// EMT.LOGGER.info( String.format( "Total Corruption: %d ItemWarpLevel: %d", corruption, getItemWarpLevel(
|
||||||
|
// stack, false ) ));
|
||||||
|
|
||||||
|
if (corruption == 0) {
|
||||||
|
((EntityPlayer) player).addChatMessage(
|
||||||
|
new ChatComponentText(
|
||||||
|
EMTTextHelper.PURPLE + "You have worn the Ring. Your soul has now been forever "
|
||||||
|
+ EMTTextHelper.PURPLE
|
||||||
|
+ "tainted. "
|
||||||
|
+ EMTTextHelper.RED
|
||||||
|
+ EMTTextHelper.ITALIC
|
||||||
|
+ "Beware of wearing the ring. The tainting will only "
|
||||||
|
+ EMTTextHelper.RED
|
||||||
|
+ EMTTextHelper.ITALIC
|
||||||
|
+ "increase, and strange things will start happening."));
|
||||||
|
}
|
||||||
|
// First effect should become active after ~5 Minutes
|
||||||
|
else if (corruption > 300 && corruption < 1400 && random.nextInt(100) == 0) {
|
||||||
|
((EntityPlayer) player)
|
||||||
|
.addChatMessage(new ChatComponentText(EMTTextHelper.PURPLE + "The Ring somehow feels heavy"));
|
||||||
|
if (random.nextBoolean()) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 500, 2, false));
|
||||||
|
else player.addPotionEffect(new PotionEffect(Potion.confusion.id, 500, 2, false));
|
||||||
|
} else if (corruption >= 1400 && corruption < 3800 && random.nextInt(100) == 0) {
|
||||||
|
((EntityPlayer) player).capabilities.disableDamage = false;
|
||||||
|
player.addPotionEffect(new PotionEffect(Potion.poison.id, 500, 2, false));
|
||||||
|
} else if (corruption >= 3800 && corruption < 6500 && random.nextInt(100) == 0) {
|
||||||
|
((EntityPlayer) player).capabilities.disableDamage = false;
|
||||||
|
player.motionY += 2d;
|
||||||
|
} else if (corruption >= 6500 && random.nextInt(10000) == 0) {
|
||||||
|
((EntityPlayer) player).capabilities.disableDamage = false;
|
||||||
|
player.addPotionEffect(new PotionEffect(Potion.wither.id, 100, 4, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (corruption >= 300) { // worn more than 5 minutes
|
||||||
|
if (random.nextInt(100) == 0) { // every 100 seconds
|
||||||
|
getItemWarpLevel(stack, true);
|
||||||
|
((EntityPlayer) player).addChatMessage(
|
||||||
|
new ChatComponentText(EMTTextHelper.PURPLE + "The Ring suddenly starts to glow purple"));
|
||||||
|
}
|
||||||
|
if (random.nextInt(300) == 0) { // randomly every 5 minutes
|
||||||
|
ThaumcraftApiHelper.addWarpToPlayer((EntityPlayer) player, 1, false); // adds 1 perm warp
|
||||||
|
ThaumcraftApiHelper.addStickyWarpToPlayer((EntityPlayer) player, random.nextInt(1)); // adds 0-1
|
||||||
|
// sticky warp
|
||||||
|
((EntityPlayer) player).addChatMessage(
|
||||||
|
new ChatComponentText(EMTTextHelper.PURPLE + "Your body suddenly starts to glow purple"));
|
||||||
|
}
|
||||||
|
if (corruption >= 3600) { // if you wear it for more than an hour total
|
||||||
|
if (random.nextInt(300) == 0) {
|
||||||
|
ThaumcraftApiHelper.addWarpToPlayer((EntityPlayer) player, 5 + random.nextInt(5), false); // adds
|
||||||
|
// 5-10
|
||||||
|
// perm
|
||||||
|
// warp
|
||||||
|
ThaumcraftApiHelper.addStickyWarpToPlayer((EntityPlayer) player, 5 + random.nextInt(5)); // adds
|
||||||
|
// 5-10
|
||||||
|
// sticky
|
||||||
|
// warp
|
||||||
|
ThaumcraftApiHelper.addWarpToPlayer((EntityPlayer) player, 10 + random.nextInt(40), true); // adds
|
||||||
|
// 10-50
|
||||||
|
// temp
|
||||||
|
// warp,
|
||||||
|
// but
|
||||||
|
// this
|
||||||
|
// is
|
||||||
|
// ultra
|
||||||
|
// easy
|
||||||
|
// to
|
||||||
|
// remove
|
||||||
|
((EntityPlayer) player).addChatMessage(
|
||||||
|
new ChatComponentText(
|
||||||
|
EMTTextHelper.PURPLE
|
||||||
|
+ "Your body resonates with the Ring and suddenly starts to glow purple ominously"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
forgeTag.setInteger(NBT_TAG_MIND_CORRUPTION, ++corruption);
|
||||||
|
// tag.setTag( NBT_TAG_FORGE_DATA, forgeTag);
|
||||||
|
// ((EntityPlayer) player).readFromNBT(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEquipped(ItemStack stack, EntityLivingBase player) {
|
||||||
|
// This purges all corruption once the ring is put on / a second ring is equipped?
|
||||||
|
/*
|
||||||
|
* NBTTagCompound tag = new NBTTagCompound(); ((EntityPlayer) player).writeToNBT(tag); tag.getCompoundTag(
|
||||||
|
* NBT_TAG_FORGE_DATA ).setInteger( NBT_TAG_MIND_CORRUPTION, 0); ((EntityPlayer) player).readFromNBT(tag);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUnequipped(ItemStack stack, EntityLivingBase player) {
|
||||||
|
player.setInvisible(false);
|
||||||
|
if (!((EntityPlayer) player).capabilities.isCreativeMode)
|
||||||
|
((EntityPlayer) player).capabilities.disableDamage = false;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Wtf? Remove ForgeData tag? There are more mods using this tag than just emt! ((EntityPlayer)
|
||||||
|
* player).writeToNBT(tag); tag.removeTag( NBT_TAG_FORGE_DATA ); ((EntityPlayer) player).readFromNBT(tag);
|
||||||
|
*/
|
||||||
|
player.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 1, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canEquip(ItemStack stack, EntityLivingBase player) {
|
||||||
|
return stack.getItemDamage() == 0 && player instanceof EntityPlayer;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canUnequip(ItemStack stack, EntityLivingBase player) {
|
||||||
|
// So, how this was written, you basically could not unequip the ring for 600 ticks after you equipped it, but
|
||||||
|
// afterwards you could?
|
||||||
|
// Let's make it a random chance to remove it instead...
|
||||||
|
|
||||||
|
// NBTTagCompound tag = getOrSetForgeTag((EntityPlayer) player);
|
||||||
|
// return (tag.getCompoundTag( NBT_TAG_FORGE_DATA ).getInteger( NBT_TAG_MIND_CORRUPTION ) > 600);
|
||||||
|
boolean tRet = false;
|
||||||
|
if (random.nextInt(5) == 0) {
|
||||||
|
tRet = true;
|
||||||
|
((EntityPlayer) player).addChatMessage(
|
||||||
|
new ChatComponentText(
|
||||||
|
EMTTextHelper.GREEN
|
||||||
|
+ "You removed the Ring. Maybe you should think twice before using it next time?"));
|
||||||
|
} else((EntityPlayer) player).addChatMessage(
|
||||||
|
new ChatComponentText(EMTTextHelper.PURPLE + "Nooo, don't remove me! I give you great power!"));
|
||||||
|
|
||||||
|
return tRet;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRunicCharge(ItemStack itemStack) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,344 @@
|
|||||||
|
package emt.item.armor.boots;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemArmor;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.DamageSource;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.ISpecialArmor;
|
||||||
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||||
|
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.Optional;
|
||||||
|
import cpw.mods.fml.common.Optional.Interface;
|
||||||
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.init.EMTItems;
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import emt.util.EMTTextHelper;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
|
import ic2.api.item.IElectricItem;
|
||||||
|
import ic2.api.item.IMetalArmor;
|
||||||
|
import thaumcraft.api.IRunicArmor;
|
||||||
|
import thaumcraft.api.IVisDiscountGear;
|
||||||
|
import thaumcraft.api.aspects.Aspect;
|
||||||
|
import thaumcraft.common.Thaumcraft;
|
||||||
|
import thaumcraft.common.items.armor.Hover;
|
||||||
|
import thaumicboots.api.IBoots;
|
||||||
|
|
||||||
|
@Interface(iface = "thaumicboots.api.IBoots", modid = "thaumicboots")
|
||||||
|
public class ItemElectricBootsTraveller extends ItemArmor
|
||||||
|
implements IRunicArmor, IElectricItem, IVisDiscountGear, IMetalArmor, ISpecialArmor, IBoots {
|
||||||
|
|
||||||
|
public int maxCharge = 100000;
|
||||||
|
public int energyPerDamage = 1000;
|
||||||
|
public int visDiscount = 2;
|
||||||
|
public float speedBonus = 0.055F;
|
||||||
|
// constant from Thaumcraft's EventHandlerEntity#playerJumps for basic Traveller Boots
|
||||||
|
public float jumpBonus = 0.2750000059604645F;
|
||||||
|
public double transferLimit = 100;
|
||||||
|
|
||||||
|
public ItemElectricBootsTraveller(ArmorMaterial material, int par3, int par4) {
|
||||||
|
super(material, par3, par4);
|
||||||
|
this.setMaxDamage(27);
|
||||||
|
this.setMaxStackSize(1);
|
||||||
|
this.setCreativeTab(EMT.TAB);
|
||||||
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||||
|
ItemStack itemStack = new ItemStack(this, 1);
|
||||||
|
if (getChargedItem(itemStack) == this) {
|
||||||
|
ItemStack charged = new ItemStack(this, 1);
|
||||||
|
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||||
|
itemList.add(charged);
|
||||||
|
}
|
||||||
|
if (getEmptyItem(itemStack) == this) {
|
||||||
|
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/boots_electric");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage,
|
||||||
|
int slot) {
|
||||||
|
if (source.isUnblockable()) {
|
||||||
|
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 0);
|
||||||
|
} else {
|
||||||
|
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
|
||||||
|
int energyPerDamage = getEnergyPerDamage();
|
||||||
|
double damageLimit = energyPerDamage <= 0 ? 0
|
||||||
|
: (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
|
||||||
|
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, absorptionRatio, (int) damageLimit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
|
||||||
|
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) {
|
||||||
|
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
||||||
|
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getDamageAbsorptionRatio() {
|
||||||
|
return 0.5D;
|
||||||
|
}
|
||||||
|
|
||||||
|
private double getBaseAbsorptionRatio() {
|
||||||
|
return 0.15D;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||||
|
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
|
||||||
|
list.add(EMTTextHelper.PURPLE + EMTTextHelper.localize("tooltip.EMT.visDiscount") + ": " + visDiscount + "%");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||||
|
return visDiscount;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||||
|
if (getIntertialState(itemStack) && player.moveForward == 0
|
||||||
|
&& player.moveStrafing == 0
|
||||||
|
&& player.capabilities.isFlying) {
|
||||||
|
player.motionX *= 0.5;
|
||||||
|
player.motionZ *= 0.5;
|
||||||
|
}
|
||||||
|
boolean omniMode = false;
|
||||||
|
if (EMT.isBootsActive) {
|
||||||
|
omniMode = isOmniEnabled(itemStack);
|
||||||
|
if ((player.moveForward == 0F && player.moveStrafing == 0F && omniMode)
|
||||||
|
|| (player.moveForward <= 0F && !omniMode)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (player.moveForward != 0.0F || player.moveStrafing != 0.0F) {
|
||||||
|
if (player.worldObj.isRemote && !player.isSneaking()) {
|
||||||
|
if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(player.getEntityId())) {
|
||||||
|
Thaumcraft.instance.entityEventHandler.prevStep.put(player.getEntityId(), player.stepHeight);
|
||||||
|
}
|
||||||
|
player.stepHeight = 1.0F;
|
||||||
|
}
|
||||||
|
float speedMod = (float) getSpeedModifier(itemStack);
|
||||||
|
if (player.onGround || player.isOnLadder() || player.capabilities.isFlying) {
|
||||||
|
float bonus = speedBonus;
|
||||||
|
if (player.isInWater()) {
|
||||||
|
bonus /= 4.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.isSneaking()) {
|
||||||
|
bonus /= 2.0F;
|
||||||
|
}
|
||||||
|
bonus *= speedMod;
|
||||||
|
if (EMT.isBootsActive) {
|
||||||
|
applyOmniState(player, bonus, itemStack);
|
||||||
|
} else if (player.moveForward > 0.0) {
|
||||||
|
player.moveFlying(0.0F, player.moveForward, bonus);
|
||||||
|
}
|
||||||
|
} else if (Hover.getHover(player.getEntityId())) {
|
||||||
|
// Base ItemBootsTraveller jumpBonus equals to jumpBonus of Electric Boots,
|
||||||
|
// so any other boots factor can be calculated via proportion method
|
||||||
|
player.jumpMovementFactor = 0.03F
|
||||||
|
/ ((ItemElectricBootsTraveller) EMTItems.electricBootsTraveller).jumpBonus
|
||||||
|
* jumpBonus
|
||||||
|
* speedMod;
|
||||||
|
} else {
|
||||||
|
player.jumpMovementFactor = 0.05F
|
||||||
|
/ ((ItemElectricBootsTraveller) EMTItems.electricBootsTraveller).jumpBonus
|
||||||
|
* jumpBonus
|
||||||
|
* speedMod;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Optional.Method(modid = "thaumicboots")
|
||||||
|
public void applyOmniState(EntityPlayer player, float bonus, ItemStack itemStack) {
|
||||||
|
if (player.moveForward != 0.0) {
|
||||||
|
player.moveFlying(0.0F, player.moveForward, bonus);
|
||||||
|
}
|
||||||
|
if (player.moveStrafing != 0.0 && getOmniState(itemStack)) {
|
||||||
|
player.moveFlying(player.moveStrafing, 0.0F, bonus);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onPlayerJump(LivingEvent.LivingJumpEvent event) {
|
||||||
|
if (event.entityLiving instanceof EntityPlayer) {
|
||||||
|
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||||
|
ItemStack boots = player.getCurrentArmor(0);
|
||||||
|
boolean hasArmor = boots != null && boots.getItem() == this;
|
||||||
|
|
||||||
|
if (hasArmor) player.motionY += jumpBonus * (float) getJumpModifier(boots);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// make the boots worth upgrading
|
||||||
|
public float getMaxHealthyDropDist() {
|
||||||
|
return 20.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getMinimumDropDist() {
|
||||||
|
return 4.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onLivingFall(LivingFallEvent event) {
|
||||||
|
if ((EMT.instance.isSimulating()) && ((event.entity instanceof EntityLivingBase))) {
|
||||||
|
if (event.entity instanceof EntityPlayer) {
|
||||||
|
EntityPlayer entity = (EntityPlayer) event.entity;
|
||||||
|
if ((entity.inventory.armorInventory[0] != null)
|
||||||
|
&& (entity.inventory.armorInventory[0].getItem() instanceof ItemElectricBootsTraveller)) {
|
||||||
|
ItemElectricBootsTraveller tUsedBoots = (ItemElectricBootsTraveller) entity.inventory.armorInventory[0]
|
||||||
|
.getItem();
|
||||||
|
ItemStack stack = entity.inventory.armorInventory[0];
|
||||||
|
|
||||||
|
// Check if we dropped the minimum amount; To cover the jump-boost bonus without penalty
|
||||||
|
if (tUsedBoots.getMinimumDropDist() > event.distance) {
|
||||||
|
event.setCanceled(true);
|
||||||
|
} else {
|
||||||
|
float tEnergyDemand = tUsedBoots.energyPerDamage
|
||||||
|
* (((event.distance > tUsedBoots.getMaxHealthyDropDist()) ? event.distance * 3
|
||||||
|
: event.distance) - 4.0F);
|
||||||
|
if (tEnergyDemand <= ElectricItem.manager.getCharge(stack)) {
|
||||||
|
// EMT.LOGGER.info( String.format("FD: %f DMG: %f EPD: %d HDD: %f", event.distance,
|
||||||
|
// tEnergyDemand, tUsedBoots.energyPerDamage, tUsedBoots.getMaxHealthyDropDist() ));
|
||||||
|
ElectricItem.manager.discharge(stack, tEnergyDemand, Integer.MAX_VALUE, true, false, false);
|
||||||
|
event.setCanceled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||||
|
return EMT.TEXTURE_PATH + ":textures/models/electricboots.png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isRepairable() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemEnchantability() {
|
||||||
|
if (EMTConfigHandler.enchanting == false) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||||
|
if (EMTConfigHandler.enchanting == false) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getEnergyPerDamage() {
|
||||||
|
return energyPerDamage;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IC2 API METHODS */
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getMaxCharge(ItemStack itemStack) {
|
||||||
|
return maxCharge;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getTier(ItemStack itemStack) {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getTransferLimit(ItemStack itemStack) {
|
||||||
|
return transferLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Item getChargedItem(ItemStack itemStack) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Item getEmptyItem(ItemStack itemStack) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRunicCharge(ItemStack itemStack) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Avoid NSM Exception when ThaumicBoots is not present.
|
||||||
|
public double getSpeedModifier(ItemStack stack) {
|
||||||
|
if (stack.stackTagCompound != null) {
|
||||||
|
return stack.stackTagCompound.getDouble("speed");
|
||||||
|
}
|
||||||
|
return 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getJumpModifier(ItemStack stack) {
|
||||||
|
if (stack.stackTagCompound != null) {
|
||||||
|
return stack.stackTagCompound.getDouble("jump");
|
||||||
|
}
|
||||||
|
return 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getOmniState(ItemStack stack) {
|
||||||
|
if (stack.stackTagCompound != null) {
|
||||||
|
return stack.stackTagCompound.getBoolean("omni");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getIntertialState(ItemStack stack) {
|
||||||
|
if (stack.stackTagCompound != null) {
|
||||||
|
return stack.stackTagCompound.getBoolean("inertiacanceling");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package emt.item.armor.boots;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
|
||||||
|
public class ItemNanoBootsTraveller extends ItemElectricBootsTraveller {
|
||||||
|
|
||||||
|
public ItemNanoBootsTraveller(ArmorMaterial material, int par3, int par4) {
|
||||||
|
super(material, par3, par4);
|
||||||
|
maxCharge = 1000000;
|
||||||
|
speedBonus = (float) EMTConfigHandler.nanoBootsSpeed;
|
||||||
|
jumpBonus = (float) EMTConfigHandler.nanoBootsJump;
|
||||||
|
visDiscount = 4;
|
||||||
|
transferLimit = 1600;
|
||||||
|
energyPerDamage = 5000;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getMaxHealthyDropDist() {
|
||||||
|
return (float) EMTConfigHandler.nanoBootsMaxDrop;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getMinimumDropDist() {
|
||||||
|
return (float) EMTConfigHandler.nanoBootsMinDrop;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getDamageAbsorptionRatio() {
|
||||||
|
return 0.9D;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getTier(ItemStack itemStack) {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/boots_nano");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||||
|
return EMT.TEXTURE_PATH + ":textures/models/nanobootstravel.png";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package emt.item.armor.boots;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
|
||||||
|
public class ItemQuantumBootsTraveller extends ItemElectricBootsTraveller {
|
||||||
|
|
||||||
|
public ItemQuantumBootsTraveller(ArmorMaterial material, int par3, int par4) {
|
||||||
|
super(material, par3, par4);
|
||||||
|
maxCharge = 10000000;
|
||||||
|
speedBonus = (float) EMTConfigHandler.quantumBootsSpeed;
|
||||||
|
jumpBonus = (float) EMTConfigHandler.quantumBootsJump;
|
||||||
|
visDiscount = 5;
|
||||||
|
transferLimit = 12000;
|
||||||
|
energyPerDamage = 20000;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getMaxHealthyDropDist() {
|
||||||
|
return (float) EMTConfigHandler.quantumBootsMaxDrop;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getMinimumDropDist() {
|
||||||
|
return (float) EMTConfigHandler.quantumBootsMinDrop;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getDamageAbsorptionRatio() {
|
||||||
|
return 1D;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getTier(ItemStack itemStack) {
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/boots_quantum");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||||
|
return EMT.TEXTURE_PATH + ":textures/models/quantumbootstravel.png";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,569 @@
|
|||||||
|
package emt.item.armor.chestplate;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.client.model.ModelBiped;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumRarity;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.client.model.ModelSpecialArmor;
|
||||||
|
import emt.init.EMTItems;
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
|
import ic2.api.item.IC2Items;
|
||||||
|
import ic2.core.IC2;
|
||||||
|
import ic2.core.audio.AudioSource;
|
||||||
|
import ic2.core.audio.PositionSpec;
|
||||||
|
import ic2.core.init.InternalName;
|
||||||
|
import ic2.core.item.armor.ItemArmorElectric;
|
||||||
|
import ic2.core.util.StackUtil;
|
||||||
|
import thaumcraft.api.IRunicArmor;
|
||||||
|
|
||||||
|
public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements IRunicArmor {
|
||||||
|
|
||||||
|
public static AudioSource audioSource;
|
||||||
|
protected static ArrayList<Integer> potionRemovalCost = new ArrayList<Integer>();
|
||||||
|
private static boolean lastJetpackUsed = false;
|
||||||
|
public final byte NONE = 0;
|
||||||
|
public final byte JETPACK = 1;
|
||||||
|
public final byte THAUMIUM = 2;
|
||||||
|
public final byte NANO = 3;
|
||||||
|
public final byte QUANTUM = 4;
|
||||||
|
private IIcon iconNONE;
|
||||||
|
private IIcon iconJETPACK;
|
||||||
|
private IIcon iconTHAUMIUM;
|
||||||
|
private IIcon iconNANO;
|
||||||
|
private IIcon iconQUANTUM;
|
||||||
|
|
||||||
|
public ItemInfusedQuantumChestplate(InternalName internalName, int armorType) {
|
||||||
|
super(internalName, InternalName.quantum, armorType, 20000000D, 18000.0D, 4);
|
||||||
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
|
this.setCreativeTab(EMT.TAB);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
|
iconNONE = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/armor_quantum_chest");
|
||||||
|
iconJETPACK = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/armor_quantum_chest_jetpack");
|
||||||
|
iconTHAUMIUM = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/armor_quantum_chest_wing_t");
|
||||||
|
iconNANO = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/armor_quantum_chest_wing_n");
|
||||||
|
iconQUANTUM = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/armor_quantum_chest_wing_q");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack itemstack) {
|
||||||
|
return "item." + EMT.MOD_ID + ".chestplates.infusedQuantum";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getItemStackDisplayName(ItemStack stack) {
|
||||||
|
return (StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onEntityLivingFallEvent(LivingFallEvent event) {
|
||||||
|
if (IC2.platform.isSimulating() && (event.entity instanceof EntityLivingBase)) {
|
||||||
|
EntityLivingBase entity = (EntityLivingBase) event.entity;
|
||||||
|
ItemStack armor = entity.getEquipmentInSlot(1);
|
||||||
|
|
||||||
|
if ((armor != null) && (armor.getItem() == this)) {
|
||||||
|
int fallDamage = Math.max((int) event.distance - 10, 0);
|
||||||
|
double energyCost = getEnergyPerDamage() * fallDamage;
|
||||||
|
|
||||||
|
if (energyCost <= ElectricItem.manager.getCharge(armor)) {
|
||||||
|
ElectricItem.manager.discharge(armor, energyCost, Integer.MAX_VALUE, true, false, false);
|
||||||
|
event.setCanceled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getDamageAbsorptionRatio() {
|
||||||
|
return 1.1D;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getEnergyPerDamage() {
|
||||||
|
return 20000;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack) {
|
||||||
|
return EnumRarity.rare;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||||
|
NBTTagCompound nbt = StackUtil.getOrCreateNbtData(itemStack);
|
||||||
|
|
||||||
|
byte toggleTimer = nbt.getByte("toggleTimer");
|
||||||
|
boolean ret = false;
|
||||||
|
boolean hoverMode = nbt.getBoolean("hoverMode");
|
||||||
|
boolean jetpackUsed = false;
|
||||||
|
byte wing = nbt.getByte("wing");
|
||||||
|
|
||||||
|
if (!world.isRemote) {
|
||||||
|
|
||||||
|
for (PotionEffect effect : (Collection<PotionEffect>) player.getActivePotionEffects()) {
|
||||||
|
if (potionRemovalCost.contains(effect.getPotionID())) {
|
||||||
|
IC2.platform.removePotion(player, effect.getPotionID());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemStack currentStack = player.inventory.getCurrentItem();
|
||||||
|
Item currentItem = currentStack == null ? null : currentStack.getItem();
|
||||||
|
|
||||||
|
if (nbt.hasKey("useother")) {
|
||||||
|
String useother = nbt.getString("useother");
|
||||||
|
if (useother.equals("Jetpack")) {
|
||||||
|
nbt.setByte("wing", JETPACK);
|
||||||
|
}
|
||||||
|
if (useother.equals("TW")) {
|
||||||
|
nbt.setByte("wing", THAUMIUM);
|
||||||
|
}
|
||||||
|
if (useother.equals("NW")) {
|
||||||
|
nbt.setByte("wing", NANO);
|
||||||
|
}
|
||||||
|
if (useother.equals("QW")) {
|
||||||
|
nbt.setByte("wing", QUANTUM);
|
||||||
|
}
|
||||||
|
wing = nbt.getByte("wing");
|
||||||
|
nbt.removeTag("useother");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wing == NONE) {
|
||||||
|
nbt.setByte("wing", NONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IC2.keyboard.isJumpKeyDown(player) && IC2.keyboard.isModeSwitchKeyDown(player) && toggleTimer == 0) {
|
||||||
|
toggleTimer = 30;
|
||||||
|
hoverMode = !hoverMode;
|
||||||
|
if (IC2.platform.isSimulating()) {
|
||||||
|
nbt.setBoolean("hoverMode", hoverMode);
|
||||||
|
if (hoverMode) {
|
||||||
|
IC2.platform.messagePlayer(player, "Hover Mode enabled.", new Object[0]);
|
||||||
|
} else {
|
||||||
|
IC2.platform.messagePlayer(player, "Hover Mode disabled.", new Object[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentStack != null && player.isSneaking() && toggleTimer == 0 && wing == NONE) {
|
||||||
|
if (currentItem == IC2Items.getItem("electricJetpack").getItem()) {
|
||||||
|
IC2.platform.messagePlayer(player, "Jetpack enabled.", new Object[0]);
|
||||||
|
nbt.setByte("wing", JETPACK);
|
||||||
|
// int charge = (int) ElectricItem.manager.getCharge(itemStack);
|
||||||
|
// if (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) < 30000) {
|
||||||
|
// ElectricItem.manager.use(itemStack, 30000 - ElectricItem.manager.getCharge(currentStack),
|
||||||
|
// player);
|
||||||
|
// }
|
||||||
|
nbt.setInteger(
|
||||||
|
"jetpackCharge",
|
||||||
|
(int) (ElectricItem.manager.getCharge(
|
||||||
|
currentStack) /* + charge - (int) ElectricItem.manager.getCharge(itemStack)) */));
|
||||||
|
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||||
|
} else if (currentItem == EMTItems.thaumiumWing) {
|
||||||
|
IC2.platform.messagePlayer(player, "Thaumium wings enabled.", new Object[0]);
|
||||||
|
nbt.setByte("wing", THAUMIUM);
|
||||||
|
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||||
|
} else if (currentItem == EMTItems.nanoWing) {
|
||||||
|
IC2.platform.messagePlayer(player, "Nano wings enabled.", new Object[0]);
|
||||||
|
nbt.setByte("wing", NANO);
|
||||||
|
// int charge = (int) ElectricItem.manager.getCharge(itemStack);
|
||||||
|
// if (ElectricItem.manager.getCharge(currentStack) < ItemNanoWing.maxCharge) {
|
||||||
|
// ElectricItem.manager.use(itemStack, ItemNanoWing.maxCharge -
|
||||||
|
// ElectricItem.manager.getCharge(currentStack), player);
|
||||||
|
// }
|
||||||
|
nbt.setInteger(
|
||||||
|
"NWCharge",
|
||||||
|
(int) (ElectricItem.manager.getCharge(
|
||||||
|
player.inventory.getCurrentItem()) /*
|
||||||
|
* + charge - (int)
|
||||||
|
* ElectricItem.manager.getCharge(itemStack)
|
||||||
|
*/));
|
||||||
|
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||||
|
} else if (currentItem == EMTItems.quantumWing) {
|
||||||
|
IC2.platform.messagePlayer(player, "Quantum wings enabled.", new Object[0]);
|
||||||
|
nbt.setByte("wing", QUANTUM);
|
||||||
|
// int charge = (int) ElectricItem.manager.getCharge(itemStack);
|
||||||
|
// if (ElectricItem.manager.getCharge(currentStack) < ItemQuantumWing.maxCharge) {
|
||||||
|
// ElectricItem.manager.use(itemStack, ItemQuantumWing.maxCharge -
|
||||||
|
// ElectricItem.manager.getCharge(currentStack), player);
|
||||||
|
// }
|
||||||
|
nbt.setInteger(
|
||||||
|
"QWCharge",
|
||||||
|
(int) (ElectricItem.manager.getCharge(
|
||||||
|
currentStack) /* + charge - (int) ElectricItem.manager.getCharge(itemStack) */));
|
||||||
|
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentStack == null && nbt.getBoolean("unequip") && player.isSneaking()) {
|
||||||
|
toggleTimer = 30;
|
||||||
|
|
||||||
|
if (wing == JETPACK) {
|
||||||
|
IC2.platform.messagePlayer(player, "Jetpack disabled.", new Object[0]);
|
||||||
|
nbt.setByte("wing", NONE);
|
||||||
|
ItemStack charged = new ItemStack(IC2Items.getItem("electricJetpack").getItem());
|
||||||
|
if (nbt.getInteger("jetpackCharge") > 0)
|
||||||
|
ElectricItem.manager.charge(charged, nbt.getInteger("jetpackCharge"), 1, true, false);
|
||||||
|
else ElectricItem.manager.charge(charged, 0, 1, true, false);
|
||||||
|
player.inventory.setInventorySlotContents(player.inventory.currentItem, charged);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wing == THAUMIUM) {
|
||||||
|
IC2.platform.messagePlayer(player, "Thaumium wings disabled.", new Object[0]);
|
||||||
|
nbt.setByte("wing", NONE);
|
||||||
|
player.inventory.setInventorySlotContents(
|
||||||
|
player.inventory.currentItem,
|
||||||
|
new ItemStack(EMTItems.thaumiumWing));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wing == NANO) {
|
||||||
|
IC2.platform.messagePlayer(player, "Nano wings disabled.", new Object[0]);
|
||||||
|
nbt.setByte("wing", NONE);
|
||||||
|
ItemStack charged = new ItemStack(EMTItems.nanoWing);
|
||||||
|
if (nbt.getInteger("NWCharge") > 0)
|
||||||
|
ElectricItem.manager.charge(charged, nbt.getInteger("NWCharge"), 3, true, false);
|
||||||
|
else ElectricItem.manager.charge(charged, 0, 3, true, false);
|
||||||
|
player.inventory.setInventorySlotContents(player.inventory.currentItem, charged);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wing == QUANTUM) {
|
||||||
|
IC2.platform.messagePlayer(player, "Quantum wings disabled.", new Object[0]);
|
||||||
|
nbt.setByte("wing", NONE);
|
||||||
|
ItemStack charged = new ItemStack(EMTItems.quantumWing);
|
||||||
|
if (nbt.getInteger("QWCharge") > 0)
|
||||||
|
ElectricItem.manager.charge(charged, nbt.getInteger("QWCharge"), 3, true, false);
|
||||||
|
else ElectricItem.manager.charge(charged, 0, 3, true, false);
|
||||||
|
player.inventory.setInventorySlotContents(player.inventory.currentItem, charged);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
nbt.setBoolean("unequip", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((IC2.keyboard.isJumpKeyDown(player) && wing == JETPACK)
|
||||||
|
|| (hoverMode && player.motionY < -0.029999999329447746D)) {
|
||||||
|
jetpackUsed = useJetpack(player, hoverMode, itemStack);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wing == THAUMIUM) useWings(player, itemStack, world, 0.15f, 0.7f, 0.5f, 0, false);
|
||||||
|
if (wing == NANO) useWings(player, itemStack, world, 0.25f, 0.6f, 0.3f, 5, true);
|
||||||
|
if (wing == QUANTUM) useWings(player, itemStack, world, 0.33f, 0.5f, 0.2f, 7, true);
|
||||||
|
|
||||||
|
if (IC2.platform.isSimulating() && toggleTimer > 0) {
|
||||||
|
toggleTimer = (byte) (toggleTimer - 1);
|
||||||
|
nbt.setByte("toggleTimer", toggleTimer);
|
||||||
|
}
|
||||||
|
if (IC2.platform.isRendering() && player == IC2.platform.getPlayerInstance()) {
|
||||||
|
if (lastJetpackUsed != jetpackUsed) {
|
||||||
|
if (jetpackUsed) {
|
||||||
|
if (audioSource == null) {
|
||||||
|
audioSource = IC2.audioManager.createSource(
|
||||||
|
player,
|
||||||
|
PositionSpec.Backpack,
|
||||||
|
"Tools/Jetpack/JetpackLoop.ogg",
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
IC2.audioManager.getDefaultVolume());
|
||||||
|
}
|
||||||
|
if (audioSource != null) {
|
||||||
|
audioSource.play();
|
||||||
|
}
|
||||||
|
} else if (audioSource != null) {
|
||||||
|
audioSource.remove();
|
||||||
|
audioSource = null;
|
||||||
|
}
|
||||||
|
lastJetpackUsed = jetpackUsed;
|
||||||
|
}
|
||||||
|
if (audioSource != null) {
|
||||||
|
audioSource.updatePosition();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = jetpackUsed;
|
||||||
|
|
||||||
|
player.extinguish();
|
||||||
|
|
||||||
|
if (ret) {
|
||||||
|
player.inventoryContainer.detectAndSendChanges();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public IIcon getIconIndex(ItemStack stack) {
|
||||||
|
try {
|
||||||
|
byte wing = stack.stackTagCompound.getByte("wing");
|
||||||
|
|
||||||
|
switch (wing) {
|
||||||
|
case JETPACK:
|
||||||
|
return iconJETPACK;
|
||||||
|
case THAUMIUM:
|
||||||
|
return iconTHAUMIUM;
|
||||||
|
case NANO:
|
||||||
|
return iconNANO;
|
||||||
|
case QUANTUM:
|
||||||
|
return iconQUANTUM;
|
||||||
|
default:
|
||||||
|
return iconNONE;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
return iconNONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||||
|
try {
|
||||||
|
byte wing = stack.stackTagCompound.getByte("wing");
|
||||||
|
|
||||||
|
switch (wing) {
|
||||||
|
case JETPACK:
|
||||||
|
return iconJETPACK;
|
||||||
|
case THAUMIUM:
|
||||||
|
return iconTHAUMIUM;
|
||||||
|
case NANO:
|
||||||
|
return iconNANO;
|
||||||
|
case QUANTUM:
|
||||||
|
return iconQUANTUM;
|
||||||
|
default:
|
||||||
|
return iconNONE;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
return iconNONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemEnchantability() {
|
||||||
|
if (EMTConfigHandler.enchanting == false) return 0;
|
||||||
|
else return 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||||
|
byte wing = stack.stackTagCompound.getByte("wing");
|
||||||
|
|
||||||
|
switch (wing) {
|
||||||
|
case JETPACK:
|
||||||
|
return EMT.TEXTURE_PATH + ":textures/models/quantum_jetpack.png";
|
||||||
|
case THAUMIUM:
|
||||||
|
return EMT.TEXTURE_PATH + ":textures/models/quantum_wings_t.png";
|
||||||
|
case NANO:
|
||||||
|
return EMT.TEXTURE_PATH + ":textures/models/quantum_wings_n.png";
|
||||||
|
case QUANTUM:
|
||||||
|
return EMT.TEXTURE_PATH + ":textures/models/quantum_wings_q.png";
|
||||||
|
default:
|
||||||
|
return EMT.TEXTURE_PATH + ":textures/models/quantum.png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getTier(ItemStack itemStack) {
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public ModelBiped getArmorModel(EntityLivingBase entity, ItemStack stack, int armorSlot) {
|
||||||
|
if (entity instanceof EntityPlayer && stack != null && stack.stackTagCompound != null) {
|
||||||
|
byte wing = stack.stackTagCompound.getByte("wing");
|
||||||
|
if (wing == JETPACK) {
|
||||||
|
ModelSpecialArmor.getInstance().type = 1;
|
||||||
|
} else if (wing != 0) {
|
||||||
|
ModelSpecialArmor.getInstance().type = 2;
|
||||||
|
if (stack.stackTagCompound.hasKey("isJumping")) {
|
||||||
|
ModelSpecialArmor.getInstance().isJumping = stack.stackTagCompound.getBoolean("isJumping");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ModelSpecialArmor.getInstance().type = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ModelSpecialArmor.getInstance().type = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ModelSpecialArmor.getInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, @SuppressWarnings("rawtypes") List list,
|
||||||
|
boolean par4) {
|
||||||
|
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean useJetpack(EntityPlayer player, boolean hoverMode, ItemStack stack) {
|
||||||
|
int jetpackMaxCharge = 30000;
|
||||||
|
float power = 1.0F;
|
||||||
|
float dropPercentage = 0.05F;
|
||||||
|
|
||||||
|
if (ElectricItem.manager.getCharge(stack) <= 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (((float) ElectricItem.manager.getCharge(stack) / (float) jetpackMaxCharge) <= dropPercentage) {
|
||||||
|
power = (float) (power * (ElectricItem.manager.getCharge(stack) / (float) jetpackMaxCharge)
|
||||||
|
* dropPercentage);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IC2.keyboard.isForwardKeyDown(player)) {
|
||||||
|
float retruster = 3.5F;
|
||||||
|
|
||||||
|
if (hoverMode) {
|
||||||
|
retruster = 0.5F;
|
||||||
|
}
|
||||||
|
|
||||||
|
float forwardpower = power * retruster * 2.0F;
|
||||||
|
|
||||||
|
if (forwardpower > 0.0F) {
|
||||||
|
player.moveFlying(0.0F, 0.4F * forwardpower, 0.02F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int worldHeight = IC2.getWorldHeight(player.worldObj);
|
||||||
|
|
||||||
|
double y = player.posY;
|
||||||
|
|
||||||
|
if (y > worldHeight - 25) {
|
||||||
|
if (y > worldHeight) {
|
||||||
|
y = worldHeight;
|
||||||
|
}
|
||||||
|
power = (float) (power * ((worldHeight - y) / 25.0D));
|
||||||
|
}
|
||||||
|
|
||||||
|
double prevmotion = player.motionY;
|
||||||
|
player.motionY = Math.min(player.motionY + power * 0.2F, 0.6000000238418579D);
|
||||||
|
|
||||||
|
if (hoverMode) {
|
||||||
|
float maxHoverY = -0.025F;
|
||||||
|
if (IC2.keyboard.isSneakKeyDown(player)) {
|
||||||
|
maxHoverY = -0.1F;
|
||||||
|
}
|
||||||
|
if (IC2.keyboard.isJumpKeyDown(player)) {
|
||||||
|
maxHoverY = 0.1F;
|
||||||
|
}
|
||||||
|
if (player.motionY > maxHoverY) {
|
||||||
|
player.motionY = maxHoverY;
|
||||||
|
if (prevmotion > player.motionY) {
|
||||||
|
player.motionY = prevmotion;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
double consume = 8.0D;
|
||||||
|
if (hoverMode) {
|
||||||
|
consume = 10.0D;
|
||||||
|
}
|
||||||
|
ElectricItem.manager.use(stack, consume, player);
|
||||||
|
player.fallDistance = 0.0F;
|
||||||
|
player.distanceWalkedModified = 0.0F;
|
||||||
|
IC2.platform.resetPlayerInAirTime(player);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void useWings(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1,
|
||||||
|
int amount, boolean isElectric) {
|
||||||
|
NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
|
||||||
|
boolean isJumping = IC2.keyboard.isJumpKeyDown(player);
|
||||||
|
nbt.setBoolean("isJumping", isJumping);
|
||||||
|
|
||||||
|
if (isJumping) {
|
||||||
|
byte f = nbt.getByte("f");
|
||||||
|
|
||||||
|
nbt.setBoolean("isHolding", true);
|
||||||
|
if (IC2.keyboard.isSneakKeyDown(player)) nbt.setByte("f", (byte) (0));
|
||||||
|
else nbt.setByte("f", (byte) (f + 1));
|
||||||
|
|
||||||
|
if (f > 7) {
|
||||||
|
nbt.setByte("f", (byte) 7);
|
||||||
|
}
|
||||||
|
} else if (nbt.getBoolean("isHolding")) {
|
||||||
|
byte f = nbt.getByte("f");
|
||||||
|
nbt.setBoolean("isHolding", false);
|
||||||
|
if (!IC2.keyboard.isSneakKeyDown(player)) {
|
||||||
|
player.motionY = motionY * f;
|
||||||
|
|
||||||
|
if (isElectric) {
|
||||||
|
ElectricItem.manager.use(stack, ((motionY * f) * 10) * amount, player);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.motionX < 0.5 && player.motionZ < 0.5 && player.motionX > -0.5 && player.motionZ > -0.5) {
|
||||||
|
player.motionX /= motionXZ;
|
||||||
|
player.motionZ /= motionXZ;
|
||||||
|
}
|
||||||
|
|
||||||
|
world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.ghast.fireball", 1, 1);
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
world.spawnParticle(
|
||||||
|
"cloud",
|
||||||
|
player.posX - 1 + (world.rand.nextInt(100) / 50d),
|
||||||
|
player.posY - 1,
|
||||||
|
player.posZ - 1 + (world.rand.nextInt(100) / 50d),
|
||||||
|
0,
|
||||||
|
-0.5,
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
nbt.setByte("f", (byte) 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isJumping && !player.onGround && player.motionY < 0) {
|
||||||
|
player.motionY *= f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.isInWater() && !player.capabilities.isCreativeMode) {
|
||||||
|
player.motionY += -0.05;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EMTConfigHandler.impactOfRain) {
|
||||||
|
int playerX = MathHelper.floor_double(player.posX);
|
||||||
|
int playerY = MathHelper.floor_double(player.posY);
|
||||||
|
int playerZ = MathHelper.floor_double(player.posZ);
|
||||||
|
|
||||||
|
if ((world.getBiomeGenForCoords(playerX, playerZ)).canSpawnLightningBolt()
|
||||||
|
&& world.canBlockSeeTheSky(playerX, playerY, playerZ)
|
||||||
|
&& world.isRaining()
|
||||||
|
&& !player.capabilities.isCreativeMode) {
|
||||||
|
player.motionY += -0.05;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.isSneaking() && !player.onGround && player.motionY < 0) {
|
||||||
|
player.motionY *= 0.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.fallDistance > 0.0F) {
|
||||||
|
player.fallDistance = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRunicCharge(ItemStack itemStack) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
+40
-44
@@ -1,22 +1,7 @@
|
|||||||
/*******************************************************************************
|
package emt.item.armor.goggles;
|
||||||
* Copyright (c) 2014 Tombenpotter.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
|
||||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
|
||||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
|
||||||
* http://www.minecraftforum.net/topic/1585216-
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
package tombenpotter.emt.common.items.armor.goggles;
|
import java.util.List;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import ic2.api.item.ElectricItem;
|
|
||||||
import ic2.api.item.IElectricItem;
|
|
||||||
import ic2.api.item.IMetalArmor;
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
@@ -26,50 +11,54 @@ import net.minecraft.item.Item;
|
|||||||
import net.minecraft.item.ItemArmor;
|
import net.minecraft.item.ItemArmor;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.ISpecialArmor;
|
import net.minecraftforge.common.ISpecialArmor;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import emt.util.EMTTextHelper;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
|
import ic2.api.item.IElectricItem;
|
||||||
|
import ic2.api.item.IMetalArmor;
|
||||||
import thaumcraft.api.IGoggles;
|
import thaumcraft.api.IGoggles;
|
||||||
|
import thaumcraft.api.IRunicArmor;
|
||||||
import thaumcraft.api.IVisDiscountGear;
|
import thaumcraft.api.IVisDiscountGear;
|
||||||
import thaumcraft.api.aspects.Aspect;
|
import thaumcraft.api.aspects.Aspect;
|
||||||
import thaumcraft.api.nodes.IRevealer;
|
import thaumcraft.api.nodes.IRevealer;
|
||||||
import tombenpotter.emt.ElectroMagicTools;
|
|
||||||
import tombenpotter.emt.ModInformation;
|
|
||||||
import tombenpotter.emt.common.util.ConfigHandler;
|
|
||||||
import tombenpotter.emt.common.util.TextHelper;
|
|
||||||
|
|
||||||
import java.util.List;
|
public class ItemElectricGoggles extends ItemArmor
|
||||||
|
implements IRunicArmor, IElectricItem, IVisDiscountGear, IGoggles, IRevealer, IMetalArmor, ISpecialArmor {
|
||||||
|
|
||||||
public class ItemElectricGoggles extends ItemArmor implements IElectricItem, IVisDiscountGear, IGoggles, IRevealer, IMetalArmor, ISpecialArmor {
|
public double maxCharge = 100000;
|
||||||
|
public double transferLimit = 100;
|
||||||
public double maxCharge = 10000;
|
|
||||||
public double transferLimit = 10;
|
|
||||||
public int tier = 2;
|
public int tier = 2;
|
||||||
public int energyPerDamage = 100;
|
public int energyPerDamage = 1000;
|
||||||
public int visDiscount = 5;
|
public int visDiscount = 5;
|
||||||
|
|
||||||
public ItemElectricGoggles(ArmorMaterial material, int par3, int par4) {
|
public ItemElectricGoggles(ArmorMaterial material, int par3, int par4) {
|
||||||
super(material, par3, par4);
|
super(material, par3, par4);
|
||||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
this.setCreativeTab(EMT.TAB);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/goggles_electric");
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/goggles_electric");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||||
return ModInformation.texturePath + ":textures/models/electricgoggles.png";
|
return EMT.TEXTURE_PATH + ":textures/models/electricgoggles.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {}
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||||
ItemStack itemStack = new ItemStack(this, 1);
|
ItemStack itemStack = new ItemStack(this, 1);
|
||||||
if (getChargedItem(itemStack) == this) {
|
if (getChargedItem(itemStack) == this) {
|
||||||
ItemStack charged = new ItemStack(this, 1);
|
ItemStack charged = new ItemStack(this, 1);
|
||||||
@@ -88,7 +77,7 @@ public class ItemElectricGoggles extends ItemArmor implements IElectricItem, IVi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemEnchantability() {
|
public int getItemEnchantability() {
|
||||||
if (ConfigHandler.enchanting == false) {
|
if (EMTConfigHandler.enchanting == false) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return 4;
|
return 4;
|
||||||
@@ -97,7 +86,7 @@ public class ItemElectricGoggles extends ItemArmor implements IElectricItem, IVi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||||
if (ConfigHandler.enchanting == false) {
|
if (EMTConfigHandler.enchanting == false) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
@@ -125,13 +114,15 @@ public class ItemElectricGoggles extends ItemArmor implements IElectricItem, IVi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
|
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage,
|
||||||
|
int slot) {
|
||||||
if (source.isUnblockable()) {
|
if (source.isUnblockable()) {
|
||||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 0);
|
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 0);
|
||||||
} else {
|
} else {
|
||||||
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
|
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
|
||||||
int energyPerDamage = getEnergyPerDamage();
|
int energyPerDamage = getEnergyPerDamage();
|
||||||
double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
|
double damageLimit = energyPerDamage <= 0 ? 0
|
||||||
|
: (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
|
||||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, absorptionRatio, (int) damageLimit);
|
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, absorptionRatio, (int) damageLimit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -145,10 +136,10 @@ public class ItemElectricGoggles extends ItemArmor implements IElectricItem, IVi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||||
list.add(TextHelper.localize("tooltip.EMT.visDiscount") + ": " + String.valueOf(visDiscount) + "%");
|
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
|
||||||
|
list.add(EMTTextHelper.PURPLE + EMTTextHelper.localize("tooltip.EMT.visDiscount") + ": " + visDiscount + "%");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -157,7 +148,7 @@ public class ItemElectricGoggles extends ItemArmor implements IElectricItem, IVi
|
|||||||
}
|
}
|
||||||
|
|
||||||
public double getDamageAbsorptionRatio() {
|
public double getDamageAbsorptionRatio() {
|
||||||
return 1.1000000000000001D;
|
return 0.5D;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getEnergyPerDamage() {
|
public int getEnergyPerDamage() {
|
||||||
@@ -165,10 +156,10 @@ public class ItemElectricGoggles extends ItemArmor implements IElectricItem, IVi
|
|||||||
}
|
}
|
||||||
|
|
||||||
private double getBaseAbsorptionRatio() {
|
private double getBaseAbsorptionRatio() {
|
||||||
return 0.14999999999999999D;
|
return 0.15D;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* IC2 API METHODS */
|
/* IC2 API METHODS */
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||||
@@ -199,4 +190,9 @@ public class ItemElectricGoggles extends ItemArmor implements IElectricItem, IVi
|
|||||||
public Item getEmptyItem(ItemStack itemStack) {
|
public Item getEmptyItem(ItemStack itemStack) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRunicCharge(ItemStack itemStack) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package emt.item.armor.goggles;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import ic2.api.item.IC2Items;
|
||||||
|
|
||||||
|
public class ItemNanoGoggles extends ItemElectricGoggles {
|
||||||
|
|
||||||
|
public ItemNanoGoggles(ArmorMaterial material, int renderIndex, int armorType) {
|
||||||
|
super(material, renderIndex, armorType);
|
||||||
|
this.setCreativeTab(EMT.TAB);
|
||||||
|
this.setMaxDamage(27);
|
||||||
|
this.setMaxStackSize(1);
|
||||||
|
visDiscount = 6;
|
||||||
|
tier = 3;
|
||||||
|
maxCharge = 1000000;
|
||||||
|
energyPerDamage = 5000;
|
||||||
|
transferLimit = 1600;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/goggles_nano");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||||
|
return EMT.TEXTURE_PATH + ":textures/models/thaumicnanohelmet.png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getDamageAbsorptionRatio() {
|
||||||
|
return 0.9D;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getTier(ItemStack itemStack) {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||||
|
IC2Items.getItem("nightvisionGoggles").getItem().onArmorTick(world, player, itemStack);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
package emt.item.armor.goggles;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.potion.Potion;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import ic2.api.item.IC2Items;
|
||||||
|
import ic2.core.IC2;
|
||||||
|
import ic2.core.util.Keyboard;
|
||||||
|
|
||||||
|
public class ItemQuantumGoggles extends ItemNanoGoggles {
|
||||||
|
|
||||||
|
private static final Map<Integer, Integer> potionCost = new HashMap<>();
|
||||||
|
|
||||||
|
public ItemQuantumGoggles(ArmorMaterial material, int renderIndex, int armorType) {
|
||||||
|
super(material, renderIndex, armorType);
|
||||||
|
this.setCreativeTab(EMT.TAB);
|
||||||
|
this.setMaxDamage(27);
|
||||||
|
this.setMaxStackSize(1);
|
||||||
|
maxCharge = 10000000;
|
||||||
|
tier = 4;
|
||||||
|
visDiscount = 7;
|
||||||
|
transferLimit = 12000;
|
||||||
|
energyPerDamage = 20000;
|
||||||
|
|
||||||
|
potionCost.put(Integer.valueOf(Potion.poison.id), Integer.valueOf(10000));
|
||||||
|
potionCost.put(Integer.valueOf(Potion.wither.id), Integer.valueOf(15000));
|
||||||
|
potionCost.put(Integer.valueOf(Potion.confusion.id), Integer.valueOf(5000));
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/goggles_quantum");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||||
|
return EMT.TEXTURE_PATH + ":textures/models/thaumicquantumhelmet.png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getDamageAbsorptionRatio() {
|
||||||
|
return 1D;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getTier(ItemStack itemStack) {
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MUAHAHAHA
|
||||||
|
@Override
|
||||||
|
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||||
|
try {
|
||||||
|
Field f;
|
||||||
|
f = Keyboard.class.getDeclaredField("playerKeys");
|
||||||
|
f.setAccessible(true);
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
Map<EntityPlayer, Set<Enum<?>>> playerKeys = (Map<EntityPlayer, Set<Enum<?>>>) f.get(IC2.keyboard);
|
||||||
|
|
||||||
|
Enum<?> hub = null;
|
||||||
|
Set<Enum<?>> set = playerKeys.get(player);
|
||||||
|
|
||||||
|
if (set != null) {
|
||||||
|
for (Enum<?> e : set) {
|
||||||
|
if (e.ordinal() == 6) {
|
||||||
|
hub = e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set.remove(hub);
|
||||||
|
}
|
||||||
|
|
||||||
|
IC2Items.getItem("quantumHelmet").getItem().onArmorTick(world, player, itemStack);
|
||||||
|
|
||||||
|
if (hub != null) {
|
||||||
|
set.add(hub);
|
||||||
|
}
|
||||||
|
} catch (NoSuchFieldException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package emt.item.armor.goggles;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.potion.Potion;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
|
import ic2.api.item.IElectricItem;
|
||||||
|
|
||||||
|
public class ItemSolarHelmetRevealing extends ItemQuantumGoggles {
|
||||||
|
|
||||||
|
private static final Map<Integer, Integer> potionCost = new HashMap<>();
|
||||||
|
/*
|
||||||
|
* private int ticker; private int generating; private boolean sunIsUp; private boolean skyIsVisible; private
|
||||||
|
* boolean noSunWorld; private boolean dampPlace;
|
||||||
|
*/
|
||||||
|
private int genDay;
|
||||||
|
private int genNight;
|
||||||
|
|
||||||
|
public ItemSolarHelmetRevealing(ArmorMaterial material, int par3, int par4) {
|
||||||
|
super(material, par3, par4);
|
||||||
|
this.setMaxDamage(27);
|
||||||
|
this.setMaxStackSize(1);
|
||||||
|
this.setCreativeTab(EMT.TAB);
|
||||||
|
// this.maxCharge = 20000000; //REALLY?
|
||||||
|
this.genDay = 2048;
|
||||||
|
this.genNight = 128;
|
||||||
|
maxCharge = 20000000;
|
||||||
|
visDiscount = 8;
|
||||||
|
tier = 4;
|
||||||
|
transferLimit = 18000;
|
||||||
|
energyPerDamage = 20000;
|
||||||
|
|
||||||
|
potionCost.put(Integer.valueOf(Potion.poison.id), Integer.valueOf(10000));
|
||||||
|
potionCost.put(Integer.valueOf(Potion.wither.id), Integer.valueOf(15000));
|
||||||
|
potionCost.put(Integer.valueOf(Potion.confusion.id), Integer.valueOf(5000));
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/goggles_solar");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layerType) {
|
||||||
|
return EMT.TEXTURE_PATH + ":textures/models/solarrevealinghelmet.png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getDamageAbsorptionRatio() {
|
||||||
|
return 1D;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getTier(ItemStack itemStack) {
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onArmorTick(World worldObj, EntityPlayer player, ItemStack itemStack) {
|
||||||
|
super.onArmorTick(worldObj, player, itemStack);
|
||||||
|
|
||||||
|
if (worldObj.isRemote) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (worldObj.canBlockSeeTheSky((int) player.posX, (int) player.posY + 1, (int) player.posZ)
|
||||||
|
&& !worldObj.isRaining()) {
|
||||||
|
double enerj = worldObj.isDaytime() ? (double) genDay : (double) genNight;
|
||||||
|
|
||||||
|
for (int i = 0; i < player.inventory.armorInventory.length; i++) {
|
||||||
|
if (enerj > 0) {
|
||||||
|
if ((player.inventory.armorInventory[i] != null)
|
||||||
|
&& (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) {
|
||||||
|
double sentPacket = ElectricItem.manager
|
||||||
|
.charge(player.inventory.armorInventory[i], enerj, 4, false, false);
|
||||||
|
enerj -= sentPacket;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int j = 0; j < player.inventory.mainInventory.length; j++) {
|
||||||
|
if (enerj > 0) {
|
||||||
|
if ((player.inventory.mainInventory[j] != null)
|
||||||
|
&& (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) {
|
||||||
|
double sentPacket = ElectricItem.manager
|
||||||
|
.charge(player.inventory.mainInventory[j], enerj, 4, false, false);
|
||||||
|
enerj -= sentPacket;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
package emt.item.armor.wings;
|
||||||
|
|
||||||
|
import net.minecraft.client.model.ModelBiped;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemArmor;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.client.model.ModelWings;
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
|
import ic2.core.IC2;
|
||||||
|
import ic2.core.util.StackUtil;
|
||||||
|
import thaumcraft.api.IRunicArmor;
|
||||||
|
|
||||||
|
public class ItemFeatherWing extends ItemArmor implements IRunicArmor {
|
||||||
|
|
||||||
|
public int visDiscount = 0;
|
||||||
|
|
||||||
|
public ItemFeatherWing(ArmorMaterial material, int par3, int par4) {
|
||||||
|
super(material, par3, par4);
|
||||||
|
this.setMaxStackSize(1);
|
||||||
|
this.setMaxDamage(120);
|
||||||
|
this.setCreativeTab(EMT.TAB);
|
||||||
|
this.isDamageable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getFallDamageMult() {
|
||||||
|
return 0.75F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/wing_feather");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||||
|
return EMT.TEXTURE_PATH + ":textures/models/featherwing.png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public ModelBiped getArmorModel(EntityLivingBase entity, ItemStack stack, int armorSlot) {
|
||||||
|
if (entity instanceof EntityPlayer && stack != null
|
||||||
|
&& stack.stackTagCompound != null
|
||||||
|
&& stack.stackTagCompound.hasKey("isJumping")) {
|
||||||
|
ModelWings.getInstance().isJumping = stack.stackTagCompound.getBoolean("isJumping");
|
||||||
|
}
|
||||||
|
|
||||||
|
return ModelWings.getInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||||
|
useWings(player, stack, world, 0.11f, 0.9f, 0.9f, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void useWings(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1,
|
||||||
|
int amount) {
|
||||||
|
NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
|
||||||
|
|
||||||
|
boolean isJumping = nbtData.getBoolean("isJumping");
|
||||||
|
boolean isHolding = nbtData.getBoolean("isHolding");
|
||||||
|
|
||||||
|
nbtData.setBoolean("isJumping", IC2.keyboard.isJumpKeyDown(player));
|
||||||
|
|
||||||
|
if (isJumping) {
|
||||||
|
byte f = nbtData.getByte("f");
|
||||||
|
nbtData.setBoolean("isHolding", true);
|
||||||
|
if (IC2.keyboard.isSneakKeyDown(player)) nbtData.setByte("f", (byte) (0));
|
||||||
|
else nbtData.setByte("f", (byte) (f + 1));
|
||||||
|
if (f > 7) nbtData.setByte("f", (byte) 7);
|
||||||
|
} else if (isHolding) {
|
||||||
|
byte f = nbtData.getByte("f");
|
||||||
|
nbtData.setBoolean("isHolding", false);
|
||||||
|
if (!IC2.keyboard.isSneakKeyDown(player)) {
|
||||||
|
player.motionY = motionY * f;
|
||||||
|
ElectricItem.manager.use(stack, ((motionY * f) * 10) * amount, player);
|
||||||
|
if (player.motionX < 0.5 && player.motionZ < 0.5 && player.motionX > -0.5 && player.motionZ > -0.5) {
|
||||||
|
player.motionX /= motionXZ;
|
||||||
|
player.motionZ /= motionXZ;
|
||||||
|
}
|
||||||
|
world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.ghast.fireball", 1, 1);
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
world.spawnParticle(
|
||||||
|
"cloud",
|
||||||
|
player.posX - 1 + (world.rand.nextInt(100) / 50d),
|
||||||
|
player.posY - 1,
|
||||||
|
player.posZ - 1 + (world.rand.nextInt(100) / 50d),
|
||||||
|
0,
|
||||||
|
-0.5,
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nbtData.setByte("f", (byte) 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isJumping && !player.onGround && player.motionY < 0) {
|
||||||
|
player.motionY *= f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.isInWater() && !player.capabilities.isCreativeMode) {
|
||||||
|
player.motionY += -0.03;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EMTConfigHandler.impactOfRain) {
|
||||||
|
if ((world.getBiomeGenForCoords((int) player.posX, (int) player.posZ)).canSpawnLightningBolt()
|
||||||
|
&& world.canBlockSeeTheSky((int) player.posX, (int) player.posY, (int) player.posZ)
|
||||||
|
&& world.isRaining()
|
||||||
|
&& !player.capabilities.isCreativeMode) {
|
||||||
|
player.motionY += -0.03;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.isSneaking() && !player.onGround && player.motionY < 0) {
|
||||||
|
player.motionY *= 0.6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRunicCharge(ItemStack itemStack) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
+38
-57
@@ -1,11 +1,7 @@
|
|||||||
package tombenpotter.emt.common.items.armor.wings;
|
package emt.item.armor.wings;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import ic2.api.item.ElectricItem;
|
|
||||||
import ic2.api.item.IElectricItem;
|
|
||||||
import ic2.api.item.IMetalArmor;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
@@ -14,39 +10,46 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.ISpecialArmor;
|
import net.minecraftforge.common.ISpecialArmor;
|
||||||
import tombenpotter.emt.ElectroMagicTools;
|
|
||||||
import tombenpotter.emt.ModInformation;
|
|
||||||
import tombenpotter.emt.common.items.armor.wings.ItemThaumiumReinforcedWing;
|
|
||||||
import tombenpotter.emt.common.util.ConfigHandler;
|
|
||||||
|
|
||||||
import java.util.List;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
|
import ic2.api.item.IElectricItem;
|
||||||
|
import ic2.api.item.IMetalArmor;
|
||||||
|
|
||||||
public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectricItem, ISpecialArmor, IMetalArmor {
|
public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectricItem, ISpecialArmor, IMetalArmor {
|
||||||
|
|
||||||
public int maxCharge = 100000;
|
public static int maxCharge = 1000000;
|
||||||
public int tier = 3;
|
public int tier = 3;
|
||||||
public double transferLimit = 1000;
|
public double transferLimit = 1600;
|
||||||
public int energyPerDamage = 100;
|
public int energyPerDamage = 5000;
|
||||||
|
|
||||||
public ItemNanoWing(ArmorMaterial material, int par3, int par4) {
|
public ItemNanoWing(ArmorMaterial material, int par3, int par4) {
|
||||||
super(material, par3, par4);
|
super(material, par3, par4);
|
||||||
this.setMaxStackSize(1);
|
this.setMaxStackSize(1);
|
||||||
this.setMaxDamage(27);
|
this.setMaxDamage(27);
|
||||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
this.setCreativeTab(EMT.TAB);
|
||||||
visDiscount = 5;
|
visDiscount = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getFallDamageMult() {
|
||||||
|
return 0.2F;
|
||||||
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/wing_nano");
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/wing_nano");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||||
ItemStack itemStack = new ItemStack(this, 1);
|
ItemStack itemStack = new ItemStack(this, 1);
|
||||||
if (getChargedItem(itemStack) == this) {
|
if (getChargedItem(itemStack) == this) {
|
||||||
ItemStack charged = new ItemStack(this, 1);
|
ItemStack charged = new ItemStack(this, 1);
|
||||||
@@ -61,41 +64,12 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||||
return ModInformation.texturePath + ":textures/models/nanowing.png";
|
return EMT.TEXTURE_PATH + ":textures/models/nanowing.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||||
if (world.isRemote) {
|
this.useWings(player, stack, world, 0.25f, 0.6f, 0.3f, 5);
|
||||||
boolean isJumping = Minecraft.getMinecraft().gameSettings.keyBindJump.isPressed();
|
|
||||||
boolean isHoldingJump = Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed();
|
|
||||||
|
|
||||||
if(isHoldingJump){
|
|
||||||
isHolding = true;
|
|
||||||
f += 1;
|
|
||||||
if(f > 7) f = 7;
|
|
||||||
}
|
|
||||||
else if(isHolding){
|
|
||||||
isHolding = false;
|
|
||||||
player.motionY = 0.25 * f;
|
|
||||||
player.motionX /= 0.7;
|
|
||||||
player.motionZ /= 0.7;
|
|
||||||
f = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isHoldingJump && !player.onGround && player.motionY < 0 && !player.capabilities.isCreativeMode)
|
|
||||||
player.motionY *= 0.3;
|
|
||||||
|
|
||||||
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY += -0.2;
|
|
||||||
|
|
||||||
if(ConfigHandler.impactOfRain){
|
|
||||||
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
|
|
||||||
player.motionY = -0.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player.isSneaking() && !player.onGround) player.motionY = -0.6;
|
|
||||||
}
|
|
||||||
if (player.fallDistance > 0.0F) player.fallDistance = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -110,7 +84,7 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemEnchantability() {
|
public int getItemEnchantability() {
|
||||||
if (ConfigHandler.enchanting == false) {
|
if (EMTConfigHandler.enchanting == false) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return 4;
|
return 4;
|
||||||
@@ -119,7 +93,7 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||||
if (ConfigHandler.enchanting == false) {
|
if (EMTConfigHandler.enchanting == false) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
@@ -131,13 +105,15 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
|
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage,
|
||||||
|
int slot) {
|
||||||
if (source.isUnblockable()) {
|
if (source.isUnblockable()) {
|
||||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 3);
|
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 3);
|
||||||
} else {
|
} else {
|
||||||
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
|
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
|
||||||
int energyPerDamage = getEnergyPerDamage();
|
int energyPerDamage = getEnergyPerDamage();
|
||||||
double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
|
double damageLimit = energyPerDamage <= 0 ? 0
|
||||||
|
: (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
|
||||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(3, absorptionRatio, (int) damageLimit);
|
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(3, absorptionRatio, (int) damageLimit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -156,12 +132,17 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
|
|||||||
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
|
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||||
|
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
|
||||||
|
}
|
||||||
|
|
||||||
public double getDamageAbsorptionRatio() {
|
public double getDamageAbsorptionRatio() {
|
||||||
return 1.1000000000000001D;
|
return 0.9D;
|
||||||
}
|
}
|
||||||
|
|
||||||
private double getBaseAbsorptionRatio() {
|
private double getBaseAbsorptionRatio() {
|
||||||
return 0.14999999999999999D;
|
return 0.25D;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* IC2 API METHODS */
|
/* IC2 API METHODS */
|
||||||
@@ -178,7 +159,7 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getTier(ItemStack itemStack) {
|
public int getTier(ItemStack itemStack) {
|
||||||
return 2;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package emt.item.armor.wings;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
|
||||||
|
public class ItemQuantumWing extends ItemNanoWing {
|
||||||
|
|
||||||
|
public static int maxCharge = 10000000;
|
||||||
|
public int tier = 4;
|
||||||
|
|
||||||
|
public ItemQuantumWing(ArmorMaterial material, int par3, int par4) {
|
||||||
|
super(material, par3, par4);
|
||||||
|
this.setMaxStackSize(1);
|
||||||
|
this.setMaxDamage(27);
|
||||||
|
this.setCreativeTab(EMT.TAB);
|
||||||
|
visDiscount = 6;
|
||||||
|
transferLimit = 12000;
|
||||||
|
energyPerDamage = 20000;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getFallDamageMult() {
|
||||||
|
return 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/wing_quantum");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||||
|
return EMT.TEXTURE_PATH + ":textures/models/quantumwing.png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||||
|
this.useWings(player, stack, world, 0.33f, 0.5f, 0.2f, 7);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getMaxCharge(ItemStack itemStack) {
|
||||||
|
return maxCharge;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getTier(ItemStack itemStack) {
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getDamageAbsorptionRatio() {
|
||||||
|
return 1D;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package emt.item.armor.wings;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTTextHelper;
|
||||||
|
import thaumcraft.api.IRepairable;
|
||||||
|
import thaumcraft.api.IVisDiscountGear;
|
||||||
|
import thaumcraft.api.aspects.Aspect;
|
||||||
|
|
||||||
|
public class ItemThaumiumReinforcedWing extends ItemFeatherWing implements IVisDiscountGear, IRepairable {
|
||||||
|
|
||||||
|
public ItemThaumiumReinforcedWing(ArmorMaterial material, int par3, int par4) {
|
||||||
|
super(material, par3, par4);
|
||||||
|
this.setMaxStackSize(1);
|
||||||
|
this.setMaxDamage(250);
|
||||||
|
this.setCreativeTab(EMT.TAB);
|
||||||
|
this.isDamageable();
|
||||||
|
visDiscount = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getFallDamageMult() {
|
||||||
|
return 0.5F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||||
|
return visDiscount;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/wing_thaumium");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||||
|
return EMT.TEXTURE_PATH + ":textures/models/thaumiumwing.png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||||
|
list.add(EMTTextHelper.PURPLE + EMTTextHelper.localize("tooltip.EMT.visDiscount") + ": " + visDiscount + "%");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||||
|
this.useWings(player, stack, world, 0.15f, 0.7f, 0.5f, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package emt.item.block;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTTextHelper;
|
||||||
|
|
||||||
|
public class ItemBlockElectricCloud extends ItemBlock {
|
||||||
|
|
||||||
|
public IIcon icon;
|
||||||
|
|
||||||
|
public ItemBlockElectricCloud(Block block) {
|
||||||
|
super(block);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIconFromDamage(int meta) {
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IIconRegister ir) {
|
||||||
|
icon = ir.registerIcon(EMT.TEXTURE_PATH + ":" + "electric_cloud");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getItemStackDisplayName(ItemStack stack) {
|
||||||
|
return EMTTextHelper.PURPLE + EMTTextHelper.BOLD
|
||||||
|
+ StatCollector.translateToLocal(getUnlocalizedName() + ".name");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,208 @@
|
|||||||
|
package emt.item.block;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import emt.util.EMTEssentiasOutputs;
|
||||||
|
import emt.util.EMTTextHelper;
|
||||||
|
import thaumcraft.api.aspects.Aspect;
|
||||||
|
|
||||||
|
public class ItemBlockEssentiaGenerators extends ItemBlock {
|
||||||
|
|
||||||
|
public ItemBlockEssentiaGenerators(Block block) {
|
||||||
|
super(block);
|
||||||
|
setHasSubtypes(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack itemstack) {
|
||||||
|
String name = "";
|
||||||
|
switch (itemstack.getItemDamage()) {
|
||||||
|
case 0:
|
||||||
|
name = "potentia";
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
name = "ignis";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
name = "auram";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
name = "arbor";
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
name = "aer";
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
name = "lucrum";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
name = "nothing";
|
||||||
|
}
|
||||||
|
return getUnlocalizedName() + "." + name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int meta) {
|
||||||
|
return meta;
|
||||||
|
}
|
||||||
|
|
||||||
|
private long getOutputAmperage(double EU) {
|
||||||
|
return 1L + (long) (EU * 1.953125e-5); // EU/(20 * 20 * 128)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack is, EntityPlayer player, List<String> list, boolean flag) {
|
||||||
|
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
|
||||||
|
switch (is.getItemDamage()) {
|
||||||
|
case 0:
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ Integer.toString(
|
||||||
|
(int) (EMTEssentiasOutputs.outputs.get(Aspect.ENERGY.getTag()) / 20 / 20))
|
||||||
|
+ " EU/t");
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ "128 EU/t @ "
|
||||||
|
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.ENERGY.getTag()))
|
||||||
|
+ " A");
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN
|
||||||
|
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.ENERGY.getTag())))
|
||||||
|
+ " EU");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ Integer.toString(
|
||||||
|
(int) (EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag()) / 20 / 20))
|
||||||
|
+ " EU/t");
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ "128 EU/t @ "
|
||||||
|
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag()))
|
||||||
|
+ " A");
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN
|
||||||
|
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag())))
|
||||||
|
+ " EU");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ Integer.toString(
|
||||||
|
(int) (EMTEssentiasOutputs.outputs.get(Aspect.AURA.getTag()) / 20 / 20))
|
||||||
|
+ " EU/t");
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ "128 EU/t @ "
|
||||||
|
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.AURA.getTag()))
|
||||||
|
+ " A");
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN
|
||||||
|
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.AURA.getTag())))
|
||||||
|
+ " EU");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ Integer.toString(
|
||||||
|
(int) (EMTEssentiasOutputs.outputs.get(Aspect.TREE.getTag()) / 20 / 20))
|
||||||
|
+ " EU/t");
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ "128 EU/t @ "
|
||||||
|
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.TREE.getTag()))
|
||||||
|
+ " A");
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN
|
||||||
|
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag())))
|
||||||
|
+ " EU");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 4:
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ Integer.toString(
|
||||||
|
(int) (EMTEssentiasOutputs.outputs.get(Aspect.AIR.getTag()) / 20 / 20))
|
||||||
|
+ " EU/t");
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ "128 EU/t @ "
|
||||||
|
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.AIR.getTag()))
|
||||||
|
+ " A");
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN
|
||||||
|
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.AIR.getTag())))
|
||||||
|
+ " EU");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 5:
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ Integer.toString(
|
||||||
|
(int) (EMTEssentiasOutputs.outputs.get(Aspect.GREED.getTag()) / 20 / 20))
|
||||||
|
+ " EU/t");
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ "128 EU/t @ "
|
||||||
|
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.GREED.getTag()))
|
||||||
|
+ " A");
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN
|
||||||
|
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.GREED.getTag())))
|
||||||
|
+ " EU");
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.YELLOW + StatCollector.translateToLocal("emt.Storage")
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ Double.toString(EMTConfigHandler.EssentiaGeneratorStorage)
|
||||||
|
+ " EU");
|
||||||
|
} else list.add(StatCollector.translateToLocal("emt.PressShift"));
|
||||||
|
}
|
||||||
|
}
|
||||||
+21
-14
@@ -1,24 +1,15 @@
|
|||||||
/*******************************************************************************
|
package emt.item.block;
|
||||||
* Copyright (c) 2014 Tombenpotter.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
|
||||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
|
||||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
|
||||||
* http://www.minecraftforum.net/topic/1585216-
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
package tombenpotter.emt.common.items.blocks;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
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.item.ItemStack;
|
||||||
|
|
||||||
public class ItemBlockEMTMachines extends ItemBlock {
|
public class ItemBlockMachines extends ItemBlock {
|
||||||
|
|
||||||
public ItemBlockEMTMachines(Block id) {
|
public ItemBlockMachines(Block id) {
|
||||||
super(id);
|
super(id);
|
||||||
setHasSubtypes(true);
|
setHasSubtypes(true);
|
||||||
}
|
}
|
||||||
@@ -36,6 +27,10 @@ public class ItemBlockEMTMachines extends ItemBlock {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2: {
|
case 2: {
|
||||||
|
name = "essentiafiller";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 3: {
|
||||||
name = "raindispeller";
|
name = "raindispeller";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -49,4 +44,16 @@ public class ItemBlockEMTMachines extends ItemBlock {
|
|||||||
public int getMetadata(int par1) {
|
public int getMetadata(int par1) {
|
||||||
return par1;
|
return par1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List<String> p_77624_3_,
|
||||||
|
boolean p_77624_4_) {
|
||||||
|
switch (p_77624_1_.getItemDamage()) {
|
||||||
|
case 2: {
|
||||||
|
p_77624_3_.add("Connects between Essentia Hatches and the Pipe Network");
|
||||||
|
p_77624_3_.add("Looses its Essentia on Restart");
|
||||||
|
p_77624_3_.add("Added by bartimaeusnek");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,641 @@
|
|||||||
|
package emt.item.block;
|
||||||
|
|
||||||
|
import static emt.util.EMTTextHelper.localize;
|
||||||
|
import static gregtech.api.util.GT_Utility.formatNumbers;
|
||||||
|
|
||||||
|
import java.io.StringReader;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
import net.minecraft.util.StringTranslate;
|
||||||
|
|
||||||
|
import org.apache.commons.io.input.ReaderInputStream;
|
||||||
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.block.BlockBaseContainer;
|
||||||
|
import emt.tile.solar.Solars;
|
||||||
|
import emt.tile.solar.TileEntitySolarBase;
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import emt.util.EMTTextHelper;
|
||||||
|
|
||||||
|
public class ItemBlockSolars extends ItemBlock {
|
||||||
|
|
||||||
|
int instance;
|
||||||
|
|
||||||
|
public ItemBlockSolars(Block block) {
|
||||||
|
super(block);
|
||||||
|
setHasSubtypes(true);
|
||||||
|
instance = ((BlockBaseContainer) block).instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack itemstack) {
|
||||||
|
final String solarName = Solars.getNameFromSolar(this.instance, itemstack.getItemDamage());
|
||||||
|
final String unlocalizedName = "tile." + EMT.MOD_ID
|
||||||
|
+ "."
|
||||||
|
+ Solars.getUnlocalizedName(this.instance, itemstack.getItemDamage());
|
||||||
|
final String unlocalizedKey = unlocalizedName + ".name";
|
||||||
|
if (!StatCollector.canTranslate(unlocalizedKey))
|
||||||
|
StringTranslate.inject(new ReaderInputStream(new StringReader(unlocalizedKey + "=" + solarName)));
|
||||||
|
return unlocalizedName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int meta) {
|
||||||
|
return meta;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack itemstack, EntityPlayer player, List<String> list,
|
||||||
|
boolean advancedItemTooltips) {
|
||||||
|
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
|
||||||
|
TileEntitySolarBase te = Solars.getTileEntitySolarBase(instance, itemstack.getItemDamage());
|
||||||
|
if (instance == 0) {
|
||||||
|
switch (itemstack.getItemDamage()) {
|
||||||
|
case 0: {
|
||||||
|
list.add(
|
||||||
|
formatNumbers(EMTConfigHandler.compressedSolarOutput)
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1: {
|
||||||
|
list.add(
|
||||||
|
formatNumbers(EMTConfigHandler.doubleCompressedSolarOutput)
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2: {
|
||||||
|
list.add(
|
||||||
|
formatNumbers(EMTConfigHandler.tripleCompressedSolarOutput)
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 3: { // aqua
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(EMTConfigHandler.compressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(2F * EMTConfigHandler.compressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.underwater"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(3F * EMTConfigHandler.compressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.raining"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(6F * EMTConfigHandler.compressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.thunder"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 4: {
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(EMTConfigHandler.doubleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(2F * EMTConfigHandler.doubleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.underwater"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(3F * EMTConfigHandler.doubleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.raining"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(6F * EMTConfigHandler.doubleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.thunder"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 5: {
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(EMTConfigHandler.tripleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(2F * EMTConfigHandler.tripleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.underwater"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(3F * EMTConfigHandler.tripleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.raining"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(6F * EMTConfigHandler.tripleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.thunder"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 6: { // dark
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(0.75F * EMTConfigHandler.compressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.day"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(2F * EMTConfigHandler.compressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.night"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 7: {
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(0.75F * EMTConfigHandler.doubleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.day"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(2F * EMTConfigHandler.doubleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.night"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 8: {
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(0.75F * EMTConfigHandler.tripleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.day"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(2F * EMTConfigHandler.tripleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.night"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 9: { // ordo
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(2F * EMTConfigHandler.compressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.day"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(0.75F * EMTConfigHandler.compressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.night"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 10: {
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(2F * EMTConfigHandler.doubleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.day"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(0.75F * EMTConfigHandler.doubleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.night"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 11: {
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(2F * EMTConfigHandler.tripleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.day"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(0.75F * EMTConfigHandler.tripleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.night"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 12: { // fire
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(EMTConfigHandler.compressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ localize("tooltip.EMT.output.triple")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.output.double.lava"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ localize("tooltip.EMT.output.double")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.output.double.nether"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 13: {
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(EMTConfigHandler.doubleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ localize("tooltip.EMT.output.triple")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.output.double.lava"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ localize("tooltip.EMT.output.double")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.output.double.nether"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 14: {
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(EMTConfigHandler.tripleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ localize("tooltip.EMT.output.triple")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.output.double.lava"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ localize("tooltip.EMT.output.double")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.output.double.nether"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 15: { // aer
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(EMTConfigHandler.compressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ localize("tooltip.EMT.output.double.half.height"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
list.add(localize("tooltip.EMT.forget"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (instance == 1) {
|
||||||
|
switch (itemstack.getItemDamage()) {
|
||||||
|
case 0: {
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(EMTConfigHandler.doubleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ localize("tooltip.EMT.output.double.half.height"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1: {
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(EMTConfigHandler.tripleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ localize("tooltip.EMT.output.double.half.height"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2: { // terra
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(EMTConfigHandler.compressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ localize("tooltip.EMT.output.double.half.low"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 3: {
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(EMTConfigHandler.doubleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ localize("tooltip.EMT.output.double.half.low"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 4: {
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(EMTConfigHandler.tripleCompressedSolarOutput)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ localize("tooltip.EMT.output.double.half.low"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
list.add(localize("tooltip.EMT.forget"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
switch (te.aspect) {
|
||||||
|
case 1:
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(2F * te.output)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.day"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(0.75F * te.output)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.night"));
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(0.75F * te.output)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.day"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(2F * te.output)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.night"));
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(te.output)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ localize("tooltip.EMT.output.double.half.height"));
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(te.output)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ localize("tooltip.EMT.output.double.half.low"));
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(te.output)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(2F * te.output)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.underwater"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(3F * te.output)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.raining"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(6F * te.output)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.thunder"));
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(te.output)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ localize("tooltip.EMT.output.triple")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.output.double.lava"));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ localize("tooltip.EMT.output.double")
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.output.double.nether"));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
|
||||||
|
+ ": "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(te.output)
|
||||||
|
+ " "
|
||||||
|
+ localize("tooltip.EMT.euPerTick"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.OutputMax")
|
||||||
|
+ " "
|
||||||
|
+ EMTTextHelper.LIGHT_GRAY
|
||||||
|
+ formatNumbers(te.calculateMaxVoltAmp()[0])
|
||||||
|
+ "EU/t @ "
|
||||||
|
+ formatNumbers(te.calculateMaxVoltAmp()[1])
|
||||||
|
+ "A");
|
||||||
|
} else list.add(StatCollector.translateToLocal("emt.PressShift"));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
package emt.item.focus;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumRarity;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import thaumcraft.api.aspects.Aspect;
|
||||||
|
import thaumcraft.api.aspects.AspectList;
|
||||||
|
import thaumcraft.api.wands.ItemFocusBasic;
|
||||||
|
|
||||||
|
public abstract class ItemBaseFocus extends ItemFocusBasic {
|
||||||
|
|
||||||
|
public IIcon ornament;
|
||||||
|
String textureName = "";
|
||||||
|
|
||||||
|
public ItemBaseFocus(String unlocName) {
|
||||||
|
super();
|
||||||
|
setUnlocalizedName(EMT.MOD_ID + ".focus." + unlocName);
|
||||||
|
setCreativeTab(EMT.TAB);
|
||||||
|
setMaxDamage(1);
|
||||||
|
setNoRepair();
|
||||||
|
setMaxStackSize(1);
|
||||||
|
this.textureName = unlocName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister ir) {
|
||||||
|
this.icon = ir.registerIcon(EMT.TEXTURE_PATH + ":" + "focus_" + textureName);
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean hasDepth() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getFocusColor(ItemStack stack) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isItemTool(ItemStack par1ItemStack) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack itemstack) {
|
||||||
|
return EnumRarity.rare;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getOrnament(ItemStack focusstack) {
|
||||||
|
return ornament;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AspectList getVisCost(ItemStack focusstack) {
|
||||||
|
return new AspectList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUseItem(ItemStack stack) {
|
||||||
|
return isVisCostPerTick(stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isVisCostPerTick() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack onFocusRightClick(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer,
|
||||||
|
MovingObjectPosition paramMovingObjectPosition) {
|
||||||
|
if (isUseItem(paramItemStack)) paramEntityPlayer.setItemInUse(paramItemStack, Integer.MAX_VALUE);
|
||||||
|
return paramItemStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int count) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPlayerStoppedUsingFocus(ItemStack itemstack, World world, EntityPlayer player, int count) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSortingHelper(ItemStack itemstack) {
|
||||||
|
return "00";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onFocusBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemEnchantability() {
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, @SuppressWarnings("rawtypes") List list,
|
||||||
|
boolean par4) {
|
||||||
|
AspectList cost = getVisCost(stack);
|
||||||
|
if (cost != null && cost.size() > 0) {
|
||||||
|
list.add(StatCollector.translateToLocal(isVisCostPerTick() ? "item.Focus.cost2" : "item.Focus.cost1"));
|
||||||
|
for (Aspect aspect : cost.getAspectsSorted()) {
|
||||||
|
float amount = cost.getAmount(aspect) / 100.0F;
|
||||||
|
list.add(" " + '\u00a7' + aspect.getChatcolor() + aspect.getName() + '\u00a7' + "r x " + amount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+36
-25
@@ -1,35 +1,27 @@
|
|||||||
/*******************************************************************************
|
package emt.item.focus;
|
||||||
* Copyright (c) 2014 Tombenpotter.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
|
||||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
|
||||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
|
||||||
* http://www.minecraftforum.net/topic/1585216-
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
package tombenpotter.emt.common.items.foci;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import ic2.api.item.ElectricItem;
|
|
||||||
import ic2.api.item.IElectricItem;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
|
import ic2.api.item.IElectricItem;
|
||||||
import thaumcraft.api.aspects.Aspect;
|
import thaumcraft.api.aspects.Aspect;
|
||||||
import thaumcraft.api.aspects.AspectList;
|
import thaumcraft.api.aspects.AspectList;
|
||||||
|
import thaumcraft.api.wands.FocusUpgradeType;
|
||||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||||
import tombenpotter.emt.common.items.foci.ItemBaseFocus;
|
|
||||||
import tombenpotter.emt.common.util.ConfigHandler;
|
|
||||||
|
|
||||||
public class ItemChargeFocus extends ItemBaseFocus {
|
public class ItemChargeFocus extends ItemBaseFocus {
|
||||||
|
|
||||||
private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10).add(Aspect.EARTH, 10).add(Aspect.ORDER, 10).add(Aspect.ENTROPY, 10);
|
private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 10).add(Aspect.WATER, 10)
|
||||||
|
.add(Aspect.AIR, 10).add(Aspect.EARTH, 10).add(Aspect.ORDER, 10).add(Aspect.ENTROPY, 10);
|
||||||
|
|
||||||
public ItemChargeFocus() {
|
public ItemChargeFocus() {
|
||||||
super("ic2.focus.charge", "focus_charge");
|
super("charge");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -39,6 +31,10 @@ public class ItemChargeFocus extends ItemBaseFocus {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AspectList getVisCost(ItemStack stack) {
|
public AspectList getVisCost(ItemStack stack) {
|
||||||
|
AspectList actualCost = new AspectList();
|
||||||
|
for (Entry<Aspect, Integer> e : visCost.aspects.entrySet()) actualCost.add(
|
||||||
|
e.getKey(),
|
||||||
|
(int) (e.getValue() * Math.pow(1.1, getUpgradeLevel(stack, FocusUpgradeType.potency))));
|
||||||
return visCost;
|
return visCost;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,17 +43,30 @@ public class ItemChargeFocus extends ItemBaseFocus {
|
|||||||
return "WANDCHARGING";
|
return "WANDCHARGING";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
|
||||||
|
return new FocusUpgradeType[] { FocusUpgradeType.potency, FocusUpgradeType.frugal };
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean canApplyUpgrade(ItemStack focusstack, EntityPlayer player, FocusUpgradeType type, int rank) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) {
|
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player,
|
||||||
|
MovingObjectPosition movingobjectposition) {
|
||||||
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
||||||
if (wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|
if (player.capabilities.isCreativeMode
|
||||||
|
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
|
|
||||||
int energyLeft = ConfigHandler.chargeFocusProduction;
|
int energyLeft = (int) (EMTConfigHandler.chargeFocusProduction
|
||||||
|
* Math.pow(1.1, getUpgradeLevel(itemstack, FocusUpgradeType.potency)));
|
||||||
for (int i = 0; i < player.inventory.armorInventory.length; i++) {
|
for (int i = 0; i < player.inventory.armorInventory.length; i++) {
|
||||||
if (energyLeft > 0) {
|
if (energyLeft > 0) {
|
||||||
if ((player.inventory.armorInventory[i] != null) && (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) {
|
if ((player.inventory.armorInventory[i] != null)
|
||||||
double sentPacket = ElectricItem.manager.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false);
|
&& (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) {
|
||||||
|
double sentPacket = ElectricItem.manager
|
||||||
|
.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false);
|
||||||
energyLeft -= sentPacket;
|
energyLeft -= sentPacket;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -66,8 +75,10 @@ public class ItemChargeFocus extends ItemBaseFocus {
|
|||||||
}
|
}
|
||||||
for (int j = 0; j < player.inventory.mainInventory.length; j++) {
|
for (int j = 0; j < player.inventory.mainInventory.length; j++) {
|
||||||
if (energyLeft > 0) {
|
if (energyLeft > 0) {
|
||||||
if ((player.inventory.mainInventory[j] != null) && (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) {
|
if ((player.inventory.mainInventory[j] != null)
|
||||||
double sentPacket = ElectricItem.manager.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false);
|
&& (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) {
|
||||||
|
double sentPacket = ElectricItem.manager
|
||||||
|
.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false);
|
||||||
energyLeft -= sentPacket;
|
energyLeft -= sentPacket;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
+7
-23
@@ -1,39 +1,21 @@
|
|||||||
/*******************************************************************************
|
package emt.item.focus;
|
||||||
* Copyright (c) 2014 Tombenpotter.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
|
||||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
|
||||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
|
||||||
* http://www.minecraftforum.net/topic/1585216-
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
package tombenpotter.emt.common.items.foci;
|
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
||||||
import net.minecraft.entity.monster.EntitySnowman;
|
import net.minecraft.entity.monster.EntitySnowman;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import thaumcraft.api.aspects.Aspect;
|
import thaumcraft.api.aspects.Aspect;
|
||||||
import thaumcraft.api.aspects.AspectList;
|
import thaumcraft.api.aspects.AspectList;
|
||||||
import thaumcraft.api.wands.ItemFocusBasic;
|
|
||||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||||
import tombenpotter.emt.ElectroMagicTools;
|
|
||||||
import tombenpotter.emt.ModInformation;
|
|
||||||
|
|
||||||
public class ItemChristmasFocus extends ItemBaseFocus {
|
public class ItemChristmasFocus extends ItemBaseFocus {
|
||||||
|
|
||||||
private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 500).add(Aspect.AIR, 500);
|
private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 500).add(Aspect.AIR, 500);
|
||||||
|
|
||||||
public ItemChristmasFocus() {
|
public ItemChristmasFocus() {
|
||||||
super("base.focus.christmas", "focus_christmas" );
|
super("christmas");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -52,13 +34,15 @@ public class ItemChristmasFocus extends ItemBaseFocus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition mop) {
|
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player,
|
||||||
|
MovingObjectPosition mop) {
|
||||||
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
||||||
if ((mop != null) && (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)) {
|
if ((mop != null) && (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)) {
|
||||||
int x = mop.blockX;
|
int x = mop.blockX;
|
||||||
int y = mop.blockY + 1;
|
int y = mop.blockY + 1;
|
||||||
int z = mop.blockZ;
|
int z = mop.blockZ;
|
||||||
if (wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|
if (player.capabilities.isCreativeMode
|
||||||
|
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
EntitySnowman snowman;
|
EntitySnowman snowman;
|
||||||
snowman = new EntitySnowman(world);
|
snowman = new EntitySnowman(world);
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package emt.item.focus;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import emt.entity.EntityEnergyBall;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
|
|
||||||
|
public class ItemEnergyBallFocus extends ItemBaseFocus {
|
||||||
|
|
||||||
|
public ItemEnergyBallFocus() {
|
||||||
|
super("energyBall");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getFocusColor(ItemStack stack) {
|
||||||
|
return 0x0000FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSortingHelper(ItemStack itemstack) {
|
||||||
|
return "ENERGYBALL";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack onFocusRightClick(ItemStack stack, World world, EntityPlayer player, MovingObjectPosition mop) {
|
||||||
|
if (world.isRemote) {
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemStack armor = player.inventory.armorInventory[2];
|
||||||
|
if (armor == null) {
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
double val = ElectricItem.manager.discharge(armor, 5120, 4, true, false, false);
|
||||||
|
|
||||||
|
if (val < 5120) {
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
float rotX = (-MathHelper.sin(player.rotationYaw / 180.0F * (float) Math.PI)
|
||||||
|
* MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)) * 100;
|
||||||
|
float rotY = (-MathHelper.sin(player.rotationPitch / 180.0F * (float) Math.PI)) * 100;
|
||||||
|
float rotZ = (MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI)
|
||||||
|
* MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)) * 100;
|
||||||
|
world.spawnEntityInWorld(new EntityEnergyBall(world, player, rotX, rotY, rotZ));
|
||||||
|
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package emt.item.focus;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import emt.entity.EntityLaser;
|
||||||
|
import thaumcraft.api.aspects.Aspect;
|
||||||
|
import thaumcraft.api.aspects.AspectList;
|
||||||
|
import thaumcraft.api.wands.FocusUpgradeType;
|
||||||
|
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||||
|
|
||||||
|
public class ItemExplosionFocus extends ItemBaseFocus {
|
||||||
|
|
||||||
|
private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 200).add(Aspect.ENTROPY, 200);
|
||||||
|
|
||||||
|
public ItemExplosionFocus() {
|
||||||
|
super("explosion");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getFocusColor(ItemStack stack) {
|
||||||
|
return 0x8B0000;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AspectList getVisCost(ItemStack focusstack) {
|
||||||
|
return visCost;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSortingHelper(ItemStack itemstack) {
|
||||||
|
return "EXPLOSION";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player,
|
||||||
|
MovingObjectPosition movingobjectposition) {
|
||||||
|
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
||||||
|
if (player.capabilities.isCreativeMode
|
||||||
|
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|
||||||
|
if (!world.isRemote) {
|
||||||
|
EntityLaser laser;
|
||||||
|
laser = new EntityLaser(world, player, 1);
|
||||||
|
laser.setExplosionStrengthModifier(getUpgradeLevel(itemstack, FocusUpgradeType.potency) * 0.5f + 1);
|
||||||
|
world.spawnEntityInWorld(laser);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return itemstack;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
|
||||||
|
return new FocusUpgradeType[] { FocusUpgradeType.potency, FocusUpgradeType.frugal };
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use this method to define custom logic about which upgrades can be applied. This can be used to set up upgrade
|
||||||
|
* "trees" that make certain upgrades available only when others are unlocked first, when certain research is
|
||||||
|
* completed, or similar logic.
|
||||||
|
*/
|
||||||
|
public boolean canApplyUpgrade(ItemStack focusstack, EntityPlayer player, FocusUpgradeType type, int rank) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package emt.item.focus;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
|
||||||
|
import gregtech.api.metatileentity.BaseMetaTileEntity;
|
||||||
|
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
|
||||||
|
import thaumcraft.api.aspects.Aspect;
|
||||||
|
import thaumcraft.api.aspects.AspectList;
|
||||||
|
import thaumcraft.api.wands.FocusUpgradeType;
|
||||||
|
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||||
|
|
||||||
|
public class ItemMaintenanceFocus extends ItemBaseFocus {
|
||||||
|
|
||||||
|
private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 2500).add(Aspect.EARTH, 2500)
|
||||||
|
.add(Aspect.ORDER, 2500);
|
||||||
|
|
||||||
|
public ItemMaintenanceFocus() {
|
||||||
|
super("maintenance");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getFocusColor(ItemStack stack) {
|
||||||
|
return 0xC0C0C0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AspectList getVisCost(ItemStack focusstack) {
|
||||||
|
return visCost;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSortingHelper(ItemStack itemstack) {
|
||||||
|
return "MAINTENANCE";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
|
||||||
|
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack onFocusRightClick(ItemStack itemStack, World world, EntityPlayer player,
|
||||||
|
MovingObjectPosition mop) {
|
||||||
|
if (mop == null) return itemStack;
|
||||||
|
|
||||||
|
ItemWandCasting wand = (ItemWandCasting) itemStack.getItem();
|
||||||
|
|
||||||
|
if (!world.isRemote) {
|
||||||
|
if (!player.isSneaking()) {
|
||||||
|
return itemStack;
|
||||||
|
}
|
||||||
|
TileEntity hatchCandidateTile = world.getTileEntity(mop.blockX, mop.blockY, mop.blockZ);
|
||||||
|
if (hatchCandidateTile instanceof BaseMetaTileEntity) {
|
||||||
|
IMetaTileEntity hatchCandidateMetaTile = ((BaseMetaTileEntity) hatchCandidateTile).getMetaTileEntity();
|
||||||
|
if (hatchCandidateMetaTile instanceof GT_MetaTileEntity_Hatch_Maintenance) {
|
||||||
|
GT_MetaTileEntity_Hatch_Maintenance hatch = (GT_MetaTileEntity_Hatch_Maintenance) hatchCandidateMetaTile;
|
||||||
|
if (player.capabilities.isCreativeMode
|
||||||
|
|| wand.consumeAllVis(itemStack, player, getVisCost(itemStack), true, true)) {
|
||||||
|
hatch.mCrowbar = true;
|
||||||
|
hatch.mScrewdriver = true;
|
||||||
|
hatch.mHardHammer = true;
|
||||||
|
hatch.mSolderingTool = true;
|
||||||
|
hatch.mWrench = true;
|
||||||
|
hatch.mSoftHammer = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
player.swingItem();
|
||||||
|
return itemStack;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package emt.item.focus;
|
||||||
|
|
||||||
|
import java.util.LinkedList;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import emt.entity.EntityShield;
|
||||||
|
import ic2.core.IC2;
|
||||||
|
import thaumcraft.api.aspects.Aspect;
|
||||||
|
import thaumcraft.api.aspects.AspectList;
|
||||||
|
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||||
|
|
||||||
|
public class ItemShieldFocus extends ItemBaseFocus {
|
||||||
|
|
||||||
|
private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5)
|
||||||
|
.add(Aspect.AIR, 5);
|
||||||
|
|
||||||
|
public ItemShieldFocus() {
|
||||||
|
super("shield");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getFocusColor(ItemStack stack) {
|
||||||
|
return 0x1E90FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AspectList getVisCost(ItemStack stack) {
|
||||||
|
return visCost;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSortingHelper(ItemStack itemstack) {
|
||||||
|
return "SHIELD";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isUseItem(ItemStack stack) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int count) {
|
||||||
|
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
||||||
|
for (PotionEffect effect : new LinkedList<PotionEffect>(player.getActivePotionEffects())) {
|
||||||
|
IC2.platform.removePotion(player, effect.getPotionID());
|
||||||
|
}
|
||||||
|
if (!player.capabilities.isCreativeMode
|
||||||
|
&& !wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|
||||||
|
player.stopUsingItem();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player,
|
||||||
|
MovingObjectPosition paramMovingObjectPosition) {
|
||||||
|
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
||||||
|
player.setItemInUse(itemstack, Integer.MAX_VALUE);
|
||||||
|
if (!world.isRemote && (player.capabilities.isCreativeMode
|
||||||
|
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true))) {
|
||||||
|
EntityShield shield = new EntityShield(world, player);
|
||||||
|
world.spawnEntityInWorld(shield);
|
||||||
|
}
|
||||||
|
return itemstack;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package emt.item.focus;
|
||||||
|
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
|
import thaumcraft.api.aspects.Aspect;
|
||||||
|
import thaumcraft.api.aspects.AspectList;
|
||||||
|
import thaumcraft.api.wands.FocusUpgradeType;
|
||||||
|
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||||
|
|
||||||
|
public class ItemWandChargingFocus extends ItemBaseFocus {
|
||||||
|
|
||||||
|
AspectList visCost = new AspectList().add(Aspect.FIRE, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10)
|
||||||
|
.add(Aspect.EARTH, 10).add(Aspect.ORDER, 10).add(Aspect.ENTROPY, 10);
|
||||||
|
|
||||||
|
public ItemWandChargingFocus() {
|
||||||
|
super("chargeWand");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getFocusColor(ItemStack stack) {
|
||||||
|
return 0xFFFF450;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSortingHelper(ItemStack itemstack) {
|
||||||
|
return "ELECTRICCHARGING";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isVisCostPerTick(ItemStack focusstack) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AspectList getVisCost(ItemStack stack) {
|
||||||
|
AspectList actualCost = new AspectList();
|
||||||
|
for (Entry<Aspect, Integer> e : visCost.aspects.entrySet()) actualCost.add(
|
||||||
|
e.getKey(),
|
||||||
|
(int) (e.getValue() * Math.pow(1.1, getUpgradeLevel(stack, FocusUpgradeType.potency))));
|
||||||
|
return visCost;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
|
||||||
|
return new FocusUpgradeType[] { FocusUpgradeType.potency, FocusUpgradeType.frugal };
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean canApplyUpgrade(ItemStack focusstack, EntityPlayer player, FocusUpgradeType type, int rank) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int integer) {
|
||||||
|
|
||||||
|
if (!player.worldObj.isRemote) {
|
||||||
|
ItemWandCasting wandItem = (ItemWandCasting) itemstack.getItem();
|
||||||
|
|
||||||
|
ItemStack armor = player.inventory.armorInventory[1];
|
||||||
|
if (armor != null) {
|
||||||
|
if ((ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player)
|
||||||
|
&& (ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player))
|
||||||
|
&& (ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player))
|
||||||
|
&& (ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player)))) {
|
||||||
|
int amount = (int) (100 * Math.pow(1.1, getUpgradeLevel(itemstack, FocusUpgradeType.potency)));
|
||||||
|
wandItem.addRealVis(itemstack, Aspect.ORDER, amount, true);
|
||||||
|
wandItem.addRealVis(itemstack, Aspect.FIRE, amount, true);
|
||||||
|
wandItem.addRealVis(itemstack, Aspect.ENTROPY, amount, true);
|
||||||
|
wandItem.addRealVis(itemstack, Aspect.WATER, amount, true);
|
||||||
|
wandItem.addRealVis(itemstack, Aspect.EARTH, amount, true);
|
||||||
|
wandItem.addRealVis(itemstack, Aspect.AIR, amount, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,157 @@
|
|||||||
|
package emt.item.tool;
|
||||||
|
|
||||||
|
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.item.Item;
|
||||||
|
import net.minecraft.item.ItemHoe;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
|
import ic2.api.item.IElectricItem;
|
||||||
|
import thaumcraft.common.Thaumcraft;
|
||||||
|
import thaumcraft.common.blocks.BlockCustomPlant;
|
||||||
|
import thaumcraft.common.config.ConfigBlocks;
|
||||||
|
import thaumcraft.common.lib.utils.Utils;
|
||||||
|
|
||||||
|
public class ItemElectricHoeGrowth extends ItemHoe implements IElectricItem {
|
||||||
|
|
||||||
|
public IIcon icon;
|
||||||
|
public int maxCharge = 200000;
|
||||||
|
public int growthCost = 500;
|
||||||
|
public int tillCost = 100;
|
||||||
|
|
||||||
|
public ItemElectricHoeGrowth() {
|
||||||
|
super(ToolMaterial.EMERALD);
|
||||||
|
this.setCreativeTab(EMT.TAB);
|
||||||
|
this.setMaxStackSize(1);
|
||||||
|
this.growthCost = 10000;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
|
this.icon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/hoe_growth");
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||||
|
ItemStack itemStack = new ItemStack(this, 1);
|
||||||
|
if (getChargedItem(itemStack) == this) {
|
||||||
|
ItemStack charged = new ItemStack(this, 1);
|
||||||
|
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||||
|
itemList.add(charged);
|
||||||
|
}
|
||||||
|
if (getEmptyItem(itemStack) == this) {
|
||||||
|
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIconFromDamage(int par1) {
|
||||||
|
return this.icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isRepairable() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7,
|
||||||
|
float par8, float par9, float par10) {
|
||||||
|
if (stack.hasTagCompound()) {
|
||||||
|
stack.stackTagCompound.setBoolean("Unbreakable", true);
|
||||||
|
}
|
||||||
|
boolean did = false;
|
||||||
|
for (int x1 = -1; x1 <= 1; x1++) {
|
||||||
|
for (int z1 = -1; z1 <= 1; z1++) {
|
||||||
|
if (ElectricItem.manager.canUse(stack, 25)
|
||||||
|
&& super.onItemUse(stack, player, world, x + x1, y, z + z1, par7, par8, par9, par10)) {
|
||||||
|
ElectricItem.manager.use(stack, 25, player);
|
||||||
|
Thaumcraft.proxy.blockSparkle(world, x + x1, y, z + z1, 8401408, 2);
|
||||||
|
if (!did) {
|
||||||
|
did = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!did && ElectricItem.manager.canUse(stack, 250)) {
|
||||||
|
did = Utils.useBonemealAtLoc(world, player, x, y, z);
|
||||||
|
if (!did) {
|
||||||
|
Block block = world.getBlock(x, y, z);
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
if ((block == ConfigBlocks.blockCustomPlant) && (meta == 0)) {
|
||||||
|
((BlockCustomPlant) block).growGreatTree(world, x, y, z, world.rand);
|
||||||
|
Thaumcraft.proxy.blockSparkle(world, x, y, z, 0, 2);
|
||||||
|
did = true;
|
||||||
|
} else if ((block == ConfigBlocks.blockCustomPlant) && (meta == 1)) {
|
||||||
|
((BlockCustomPlant) block).growSilverTree(world, x, y, z, world.rand);
|
||||||
|
Thaumcraft.proxy.blockSparkle(world, x, y, z, 0, 2);
|
||||||
|
did = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ElectricItem.manager.use(stack, 250, player);
|
||||||
|
Thaumcraft.proxy.blockSparkle(world, x, y, z, 0, 3);
|
||||||
|
}
|
||||||
|
if (did) {
|
||||||
|
world.playSoundEffect(
|
||||||
|
x + 0.5D,
|
||||||
|
y + 0.5D,
|
||||||
|
z + 0.5D,
|
||||||
|
"thaumcraft:wand",
|
||||||
|
0.75F,
|
||||||
|
0.9F + world.rand.nextFloat() * 0.2F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (stack.hasTagCompound()) {
|
||||||
|
stack.stackTagCompound.setBoolean("Unbreakable", false);
|
||||||
|
}
|
||||||
|
return did;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||||
|
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IC2 API METHODS */
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getMaxCharge(ItemStack itemStack) {
|
||||||
|
return maxCharge;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getTier(ItemStack itemStack) {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getTransferLimit(ItemStack itemStack) {
|
||||||
|
return 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Item getChargedItem(ItemStack itemStack) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Item getEmptyItem(ItemStack itemStack) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
+23
-34
@@ -1,21 +1,7 @@
|
|||||||
/*******************************************************************************
|
package emt.item.tool;
|
||||||
* Copyright (c) 2014 Tombenpotter.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
|
||||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
|
||||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
|
||||||
* http://www.minecraftforum.net/topic/1585216-
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
package tombenpotter.emt.common.items.tools;
|
import java.util.List;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import ic2.api.item.ElectricItem;
|
|
||||||
import ic2.api.item.IElectricItem;
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
@@ -27,38 +13,39 @@ import net.minecraft.item.ItemSword;
|
|||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
import net.minecraft.potion.PotionEffect;
|
import net.minecraft.potion.PotionEffect;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import tombenpotter.emt.ElectroMagicTools;
|
|
||||||
import tombenpotter.emt.ModInformation;
|
|
||||||
import tombenpotter.emt.common.entities.EntityArcher;
|
|
||||||
import tombenpotter.emt.common.util.ConfigHandler;
|
|
||||||
import tombenpotter.emt.common.util.TextHelper;
|
|
||||||
|
|
||||||
import java.util.List;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.entity.EntityArcher;
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import emt.util.EMTTextHelper;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
|
import ic2.api.item.IElectricItem;
|
||||||
|
|
||||||
public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
|
public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
|
||||||
|
|
||||||
public int maxCharge = 1000000;
|
|
||||||
private final int hitCost = 5000;
|
private final int hitCost = 5000;
|
||||||
private final int lightningCost = 75000;
|
private final int lightningCost = 75000;
|
||||||
|
public int maxCharge = 2000000;
|
||||||
|
|
||||||
public ItemElectricThorHammer() {
|
public ItemElectricThorHammer() {
|
||||||
super(ToolMaterial.EMERALD);
|
super(ToolMaterial.EMERALD);
|
||||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
this.setCreativeTab(EMT.TAB);
|
||||||
this.setMaxDamage(27);
|
this.setMaxDamage(27);
|
||||||
this.setMaxStackSize(1);
|
this.setMaxStackSize(1);
|
||||||
// OreDictionary.registerOre("craftingToolForgeHammer", this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":hammer/electricthorhammer");
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":hammer/electricthorhammer");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||||
ItemStack itemStack = new ItemStack(this, 1);
|
ItemStack itemStack = new ItemStack(this, 1);
|
||||||
if (getChargedItem(itemStack) == this) {
|
if (getChargedItem(itemStack) == this) {
|
||||||
ItemStack charged = new ItemStack(this, 1);
|
ItemStack charged = new ItemStack(this, 1);
|
||||||
@@ -78,10 +65,12 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
public void addInformation(ItemStack stack, EntityPlayer player, List<String> list, boolean par4) {
|
||||||
list.add(TextHelper.localize("tooltip.EMT.hammer.electric").replace("%player%", player.getCommandSenderName()));
|
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
|
||||||
|
list.add(
|
||||||
|
EMTTextHelper.localize("tooltip.EMT.hammer.electric")
|
||||||
|
.replace("%player%", player.getCommandSenderName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -158,7 +147,7 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemEnchantability() {
|
public int getItemEnchantability() {
|
||||||
if (ConfigHandler.enchanting == false) {
|
if (EMTConfigHandler.enchanting == false) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return 4;
|
return 4;
|
||||||
@@ -167,7 +156,7 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||||
return ConfigHandler.enchanting;
|
return EMTConfigHandler.enchanting;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* IC2 API METHODS */
|
/* IC2 API METHODS */
|
||||||
@@ -194,7 +183,7 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getTier(ItemStack itemStack) {
|
public int getTier(ItemStack itemStack) {
|
||||||
return 2;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
+13
-26
@@ -1,19 +1,7 @@
|
|||||||
/*******************************************************************************
|
package emt.item.tool;
|
||||||
* Copyright (c) 2014 Tombenpotter.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
|
||||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
|
||||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
|
||||||
* http://www.minecraftforum.net/topic/1585216-
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
package tombenpotter.emt.common.items.tools;
|
import java.util.List;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
@@ -27,26 +15,25 @@ import net.minecraft.util.MovingObjectPosition;
|
|||||||
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import thaumcraft.api.IRepairable;
|
|
||||||
import tombenpotter.emt.ElectroMagicTools;
|
|
||||||
import tombenpotter.emt.ModInformation;
|
|
||||||
import tombenpotter.emt.common.util.TextHelper;
|
|
||||||
|
|
||||||
import java.util.List;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTTextHelper;
|
||||||
|
import thaumcraft.api.IRepairable;
|
||||||
|
|
||||||
public class ItemThorHammer extends ItemSword implements IRepairable {
|
public class ItemThorHammer extends ItemSword implements IRepairable {
|
||||||
|
|
||||||
public ItemThorHammer() {
|
public ItemThorHammer() {
|
||||||
super(ToolMaterial.EMERALD);
|
super(ToolMaterial.EMERALD);
|
||||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
this.setCreativeTab(EMT.TAB);
|
||||||
this.setMaxDamage(2000);
|
this.setMaxDamage(2000);
|
||||||
// OreDictionary.registerOre("craftingToolForgeHammer", this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":hammer/thorhammer");
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":hammer/thorhammer");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -59,8 +46,8 @@ public class ItemThorHammer extends ItemSword implements IRepairable {
|
|||||||
double d1 = (player.prevPosY + ((player.posY - player.prevPosY) * f) + 1.6200000000000001D) - player.yOffset;
|
double d1 = (player.prevPosY + ((player.posY - player.prevPosY) * f) + 1.6200000000000001D) - player.yOffset;
|
||||||
double d2 = player.prevPosZ + ((player.posZ - player.prevPosZ) * f);
|
double d2 = player.prevPosZ + ((player.posZ - player.prevPosZ) * f);
|
||||||
Vec3 vec3d = Vec3.createVectorHelper(d, d1, d2);
|
Vec3 vec3d = Vec3.createVectorHelper(d, d1, d2);
|
||||||
float f3 = MathHelper.cos((-f2 * 0.01745329F) - 3.141593F);
|
float f3 = MathHelper.cos((-f2 * 0.01745329F) - (float) Math.PI);
|
||||||
float f4 = MathHelper.sin((-f2 * 0.01745329F) - 3.141593F);
|
float f4 = MathHelper.sin((-f2 * 0.01745329F) - (float) Math.PI);
|
||||||
float f5 = -MathHelper.cos(-f1 * 0.01745329F);
|
float f5 = -MathHelper.cos(-f1 * 0.01745329F);
|
||||||
float f6 = MathHelper.sin(-f1 * 0.01745329F);
|
float f6 = MathHelper.sin(-f1 * 0.01745329F);
|
||||||
float f7 = f4 * f5;
|
float f7 = f4 * f5;
|
||||||
@@ -100,7 +87,7 @@ public class ItemThorHammer extends ItemSword implements IRepairable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||||
list.add(TextHelper.localize("tooltip.EMT.hammer.broken.The Hammer of Thor"));
|
list.add(EMTTextHelper.localize("tooltip.EMT.hammer.broken.The Hammer of Thor"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+16
-33
@@ -1,50 +1,36 @@
|
|||||||
/*******************************************************************************
|
package emt.item.tool;
|
||||||
* Copyright (c) 2014 Tombenpotter.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
|
||||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
|
||||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
|
||||||
* http://www.minecraftforum.net/topic/1585216-
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
package tombenpotter.emt.common.items.tools;
|
import java.util.List;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.Item.ToolMaterial;
|
|
||||||
import net.minecraft.item.ItemSword;
|
import net.minecraft.item.ItemSword;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTTextHelper;
|
||||||
import thaumcraft.api.IRepairable;
|
import thaumcraft.api.IRepairable;
|
||||||
import thaumcraft.common.entities.projectile.EntityAlumentum;
|
import thaumcraft.common.entities.projectile.EntityAlumentum;
|
||||||
import tombenpotter.emt.ElectroMagicTools;
|
|
||||||
import tombenpotter.emt.ModInformation;
|
|
||||||
import tombenpotter.emt.common.util.TextHelper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class ItemThorHammerBroken extends ItemSword implements IRepairable {
|
public class ItemThorHammerBroken extends ItemSword implements IRepairable {
|
||||||
|
|
||||||
public ItemThorHammerBroken() {
|
public ItemThorHammerBroken() {
|
||||||
super(ToolMaterial.EMERALD);
|
super(ToolMaterial.EMERALD);
|
||||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
this.setCreativeTab(EMT.TAB);
|
||||||
this.setMaxDamage(1000);
|
this.setMaxDamage(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":hammer/taintedthorhammer");
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":hammer/taintedthorhammer");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -57,12 +43,10 @@ public class ItemThorHammerBroken extends ItemSword implements IRepairable {
|
|||||||
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX, player.posY + 4, player.posZ));
|
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX, player.posY + 4, player.posZ));
|
||||||
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX, player.posY + 8, player.posZ));
|
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX, player.posY + 8, player.posZ));
|
||||||
|
|
||||||
if (player.capabilities.isCreativeMode) {
|
if (!player.capabilities.isCreativeMode) {
|
||||||
return itemstack;
|
|
||||||
} else {
|
|
||||||
itemstack.damageItem(20, player);
|
itemstack.damageItem(20, player);
|
||||||
return itemstack;
|
|
||||||
}
|
}
|
||||||
|
return itemstack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -72,15 +56,14 @@ public class ItemThorHammerBroken extends ItemSword implements IRepairable {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack stack, EntityPlayer entityPlayer, List list, boolean par4) {
|
public void addInformation(ItemStack stack, EntityPlayer entityPlayer, List<String> list, boolean par4) {
|
||||||
list.add(TextHelper.localize("tooltip.EMT.hammer.broken.thor"));
|
list.add(EMTTextHelper.localize("tooltip.EMT.hammer.broken.thor"));
|
||||||
list.add(TextHelper.localize("tooltip.EMT.hammer.broken.danger"));
|
list.add(EMTTextHelper.localize("tooltip.EMT.hammer.broken.danger"));
|
||||||
if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
||||||
list.add(TextHelper.localize("tooltip.EMT.hammer.broken.plsNoRightClick"));
|
list.add(EMTTextHelper.localize("tooltip.EMT.hammer.broken.plsNoRightClick"));
|
||||||
} else {
|
} else {
|
||||||
list.add(TextHelper.localize("tooltip.EMT.hammer.broken.plsRightClick"));
|
list.add(EMTTextHelper.localize("tooltip.EMT.hammer.broken.plsRightClick"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,309 @@
|
|||||||
|
package emt.item.tool.chainsaw;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockTorch;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.enchantment.Enchantment;
|
||||||
|
import net.minecraft.enchantment.EnchantmentHelper;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.item.EntityItem;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemAxe;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.stats.StatList;
|
||||||
|
import net.minecraft.util.DamageSource;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.IShearable;
|
||||||
|
import net.minecraftforge.event.ForgeEventFactory;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
|
import ic2.api.item.IElectricItem;
|
||||||
|
import ic2.core.IC2;
|
||||||
|
import ic2.core.util.StackUtil;
|
||||||
|
|
||||||
|
public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
|
||||||
|
|
||||||
|
public int maxCharge = 50000;
|
||||||
|
public int cost = 200;
|
||||||
|
public int hitCost = 300;
|
||||||
|
public int tier = 2;
|
||||||
|
|
||||||
|
public ItemDiamondChainsaw() {
|
||||||
|
super(ToolMaterial.EMERALD);
|
||||||
|
this.efficiencyOnProperMaterial = 16F;
|
||||||
|
this.setCreativeTab(EMT.TAB);
|
||||||
|
this.setMaxDamage(27);
|
||||||
|
this.setMaxStackSize(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/chainsaw_diamond");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6,
|
||||||
|
EntityLivingBase entityLiving) {
|
||||||
|
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canHarvestBlock(Block block, ItemStack stack) {
|
||||||
|
return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack)
|
||||||
|
|| Items.shears.canHarvestBlock(block, stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getDigSpeed(ItemStack stack, Block block, int meta) {
|
||||||
|
if (!ElectricItem.manager.canUse(stack, cost)) {
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F
|
||||||
|
|| Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F) {
|
||||||
|
return efficiencyOnProperMaterial;
|
||||||
|
} else {
|
||||||
|
return super.getDigSpeed(stack, block, meta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||||
|
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
|
||||||
|
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||||
|
ItemStack itemStack = new ItemStack(this, 1);
|
||||||
|
if (getChargedItem(itemStack) == this) {
|
||||||
|
ItemStack charged = new ItemStack(this, 1);
|
||||||
|
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||||
|
itemList.add(charged);
|
||||||
|
}
|
||||||
|
if (getEmptyItem(itemStack) == this) {
|
||||||
|
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||||
|
float xOffset, float yOffset, float zOffset) {
|
||||||
|
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
|
||||||
|
ItemStack torchStack = player.inventory.mainInventory[i];
|
||||||
|
if (torchStack == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Item item = torchStack.getItem();
|
||||||
|
if (!(item instanceof ItemBlock)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!(Block.getBlockFromItem(item) instanceof BlockTorch)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
int oldMeta = torchStack.getItemDamage();
|
||||||
|
int oldSize = torchStack.stackSize;
|
||||||
|
boolean result = torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||||
|
if (player.capabilities.isCreativeMode) {
|
||||||
|
torchStack.setItemDamage(oldMeta);
|
||||||
|
torchStack.stackSize = oldSize;
|
||||||
|
} else if (torchStack.stackSize <= 0) {
|
||||||
|
ForgeEventFactory.onPlayerDestroyItem(player, torchStack);
|
||||||
|
player.inventory.mainInventory[i] = null;
|
||||||
|
}
|
||||||
|
if (result) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||||
|
if (!IC2.platform.isSimulating()) {
|
||||||
|
return super.onItemRightClick(stack, world, player);
|
||||||
|
}
|
||||||
|
if (IC2.keyboard.isModeSwitchKeyDown(player)) {
|
||||||
|
NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
|
||||||
|
if (!nbt.hasKey("shearsMode")) {
|
||||||
|
nbt.setBoolean("shearsMode", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!nbt.getBoolean("shearsMode")) {
|
||||||
|
nbt.setBoolean("shearsMode", true);
|
||||||
|
|
||||||
|
IC2.platform.messagePlayer(player, "ic2.tooltip.mode", "ic2.tooltip.mode.normal");
|
||||||
|
} else {
|
||||||
|
nbt.setBoolean("shearsMode", false);
|
||||||
|
IC2.platform.messagePlayer(player, "ic2.tooltip.mode", "ic2.tooltip.mode.noShear");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return super.onItemRightClick(stack, world, player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) {
|
||||||
|
NBTTagCompound nbt = StackUtil.getOrCreateNbtData(itemstack);
|
||||||
|
if (!nbt.hasKey("shearsMode")) {
|
||||||
|
nbt.setBoolean("shearsMode", true);
|
||||||
|
}
|
||||||
|
if (!nbt.getBoolean("shearsMode") || player.worldObj.isRemote) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Block block = player.worldObj.getBlock(x, y, z);
|
||||||
|
if (block instanceof IShearable) {
|
||||||
|
IShearable target = (IShearable) block;
|
||||||
|
if (target.isShearable(itemstack, player.worldObj, x, y, z)) {
|
||||||
|
ArrayList<ItemStack> drops = target.onSheared(
|
||||||
|
itemstack,
|
||||||
|
player.worldObj,
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
z,
|
||||||
|
EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
|
||||||
|
Random rand = new Random();
|
||||||
|
|
||||||
|
for (ItemStack stack : drops) {
|
||||||
|
float f = 0.7F;
|
||||||
|
double xOffset = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
|
||||||
|
double yOffset = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
|
||||||
|
double zOffset = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
|
||||||
|
EntityItem entityitem = new EntityItem(
|
||||||
|
player.worldObj,
|
||||||
|
(double) x + xOffset,
|
||||||
|
(double) y + yOffset,
|
||||||
|
(double) z + zOffset,
|
||||||
|
stack);
|
||||||
|
entityitem.delayBeforeCanPickup = 10;
|
||||||
|
player.worldObj.spawnEntityInWorld(entityitem);
|
||||||
|
}
|
||||||
|
|
||||||
|
player.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(block)], 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity) {
|
||||||
|
NBTTagCompound nbt = StackUtil.getOrCreateNbtData(itemstack);
|
||||||
|
if (!nbt.hasKey("shearsMode")) {
|
||||||
|
nbt.setBoolean("shearsMode", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!nbt.getBoolean("shearsMode") || entity.worldObj.isRemote) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (entity instanceof IShearable) {
|
||||||
|
IShearable target = (IShearable) entity;
|
||||||
|
if (target
|
||||||
|
.isShearable(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) {
|
||||||
|
ArrayList<ItemStack> drops = target.onSheared(
|
||||||
|
itemstack,
|
||||||
|
entity.worldObj,
|
||||||
|
(int) entity.posX,
|
||||||
|
(int) entity.posY,
|
||||||
|
(int) entity.posZ,
|
||||||
|
EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
|
||||||
|
|
||||||
|
Random rand = new Random();
|
||||||
|
for (ItemStack stack : drops) {
|
||||||
|
EntityItem ent = entity.entityDropItem(stack, 1.0F);
|
||||||
|
ent.motionY += rand.nextFloat() * 0.05F;
|
||||||
|
ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
|
||||||
|
ent.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate(ItemStack stack, World world, Entity entity, int i, boolean flag) {
|
||||||
|
if (entity instanceof EntityLivingBase) {
|
||||||
|
|
||||||
|
NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
|
||||||
|
if (!nbt.hasKey("shearsMode")) {
|
||||||
|
nbt.setBoolean("shearsMode", true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isRepairable() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemEnchantability() {
|
||||||
|
if (EMTConfigHandler.enchanting == false) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||||
|
return EMTConfigHandler.enchanting;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||||
|
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IC2 API METHODS */
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Item getChargedItem(ItemStack itemStack) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Item getEmptyItem(ItemStack itemStack) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getMaxCharge(ItemStack itemStack) {
|
||||||
|
return maxCharge;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getTier(ItemStack itemStack) {
|
||||||
|
return tier;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getTransferLimit(ItemStack itemStack) {
|
||||||
|
return 300;
|
||||||
|
}
|
||||||
|
}
|
||||||
+20
-31
@@ -1,54 +1,39 @@
|
|||||||
/*******************************************************************************
|
package emt.item.tool.chainsaw;
|
||||||
* Copyright (c) 2014 Tombenpotter.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
|
||||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
|
||||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
|
||||||
* http://www.minecraftforum.net/topic/1585216-
|
|
||||||
*
|
|
||||||
* This class originally belongs to Azanor, but with his permission I took it, and modified it to make it work as I wanted to.
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
package tombenpotter.emt.common.items.tools.chainsaws;
|
import java.awt.Color;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import ic2.api.item.ElectricItem;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.EnumAction;
|
import net.minecraft.item.EnumAction;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
import thaumcraft.common.lib.network.PacketHandler;
|
import thaumcraft.common.lib.network.PacketHandler;
|
||||||
import thaumcraft.common.lib.network.fx.PacketFXBlockBubble;
|
import thaumcraft.common.lib.network.fx.PacketFXBlockBubble;
|
||||||
import thaumcraft.common.lib.utils.BlockUtils;
|
import thaumcraft.common.lib.utils.BlockUtils;
|
||||||
import thaumcraft.common.lib.utils.Utils;
|
import thaumcraft.common.lib.utils.Utils;
|
||||||
import tombenpotter.emt.ElectroMagicTools;
|
|
||||||
import tombenpotter.emt.ModInformation;
|
|
||||||
|
|
||||||
import java.awt.*;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class ItemStreamChainsaw extends ItemThaumiumChainsaw {
|
public class ItemStreamChainsaw extends ItemThaumiumChainsaw {
|
||||||
|
|
||||||
|
public static ArrayList<?> oreDictLogs = new ArrayList<>();
|
||||||
boolean alternateServer;
|
boolean alternateServer;
|
||||||
boolean alternateClient;
|
boolean alternateClient;
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
public static ArrayList oreDictLogs = new ArrayList();
|
|
||||||
|
|
||||||
public ItemStreamChainsaw() {
|
public ItemStreamChainsaw() {
|
||||||
this.efficiencyOnProperMaterial = 25F;
|
this.efficiencyOnProperMaterial = 25F;
|
||||||
alternateServer = false;
|
alternateServer = false;
|
||||||
alternateClient = false;
|
alternateClient = false;
|
||||||
setCreativeTab(ElectroMagicTools.tabEMT);
|
setCreativeTab(EMT.TAB);
|
||||||
this.maxStackSize = 1;
|
this.maxStackSize = 1;
|
||||||
this.setMaxDamage(27);
|
this.setMaxDamage(27);
|
||||||
maxCharge = 900000;
|
maxCharge = 1000000;
|
||||||
cost = 400;
|
cost = 400;
|
||||||
hitCost = 500;
|
hitCost = 500;
|
||||||
tier = 3;
|
tier = 3;
|
||||||
@@ -57,7 +42,7 @@ public class ItemStreamChainsaw extends ItemThaumiumChainsaw {
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/chainsaw_stream");
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/chainsaw_stream");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -66,9 +51,11 @@ public class ItemStreamChainsaw extends ItemThaumiumChainsaw {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) {
|
public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int par7,
|
||||||
|
float par8, float par9, float par10) {
|
||||||
Block bi = world.getBlock(x, y, z);
|
Block bi = world.getBlock(x, y, z);
|
||||||
if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))) {
|
if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))
|
||||||
|
&& ElectricItem.manager.getCharge(itemstack) > cost) {
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
if (BlockUtils.breakFurthestBlock(world, x, y, z, bi, player)) {
|
if (BlockUtils.breakFurthestBlock(world, x, y, z, bi, player)) {
|
||||||
world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F);
|
world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F);
|
||||||
@@ -91,7 +78,9 @@ public class ItemStreamChainsaw extends ItemThaumiumChainsaw {
|
|||||||
if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))) {
|
if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))) {
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
BlockUtils.breakFurthestBlock(world, x, y, z, bi, player);
|
BlockUtils.breakFurthestBlock(world, x, y, z, bi, player);
|
||||||
PacketHandler.INSTANCE.sendToAllAround(new PacketFXBlockBubble(x, y, z, new Color(0.33F, 0.33F, 1.0F).getRGB()), new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32.0D));
|
PacketHandler.INSTANCE.sendToAllAround(
|
||||||
|
new PacketFXBlockBubble(x, y, z, new Color(0.33F, 0.33F, 1.0F).getRGB()),
|
||||||
|
new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32.0D));
|
||||||
|
|
||||||
world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F);
|
world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F);
|
||||||
}
|
}
|
||||||
+11
-23
@@ -1,20 +1,5 @@
|
|||||||
/*******************************************************************************
|
package emt.item.tool.chainsaw;
|
||||||
* Copyright (c) 2014 Tombenpotter.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
|
||||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
|
||||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
|
||||||
* http://www.minecraftforum.net/topic/1585216-
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
package tombenpotter.emt.common.items.tools.chainsaws;
|
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import ic2.api.item.ElectricItem;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
@@ -22,17 +7,20 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import tombenpotter.emt.ElectroMagicTools;
|
|
||||||
import tombenpotter.emt.ModInformation;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
|
|
||||||
public class ItemThaumiumChainsaw extends ItemDiamondChainsaw {
|
public class ItemThaumiumChainsaw extends ItemDiamondChainsaw {
|
||||||
|
|
||||||
public ItemThaumiumChainsaw() {
|
public ItemThaumiumChainsaw() {
|
||||||
this.efficiencyOnProperMaterial = 21F;
|
this.efficiencyOnProperMaterial = 21F;
|
||||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
this.setCreativeTab(EMT.TAB);
|
||||||
this.setMaxDamage(27);
|
this.setMaxDamage(27);
|
||||||
this.setMaxStackSize(1);
|
this.setMaxStackSize(1);
|
||||||
maxCharge = 60000;
|
maxCharge = 100000;
|
||||||
cost = 250;
|
cost = 250;
|
||||||
hitCost = 350;
|
hitCost = 350;
|
||||||
}
|
}
|
||||||
@@ -40,11 +28,12 @@ public class ItemThaumiumChainsaw extends ItemDiamondChainsaw {
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/chainsaw_thaumium");
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/chainsaw_thaumium");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
|
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6,
|
||||||
|
EntityLivingBase entityLiving) {
|
||||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -57,7 +46,6 @@ public class ItemThaumiumChainsaw extends ItemDiamondChainsaw {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* IC2 API METHODS */
|
|
||||||
@Override
|
@Override
|
||||||
public double getTransferLimit(ItemStack itemStack) {
|
public double getTransferLimit(ItemStack itemStack) {
|
||||||
return 600;
|
return 600;
|
||||||
+55
-47
@@ -1,24 +1,10 @@
|
|||||||
/*******************************************************************************
|
package emt.item.tool.drill;
|
||||||
* Copyright (c) 2014 Tombenpotter.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
|
||||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
|
||||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
|
||||||
* http://www.minecraftforum.net/topic/1585216-
|
|
||||||
*
|
|
||||||
* This class originally belongs to Azanor, but with his permission I took it, and modified it to make it work as I wanted to.
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
package tombenpotter.emt.common.items.tools.drills;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import ic2.api.item.ElectricItem;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.enchantment.EnchantmentHelper;
|
import net.minecraft.enchantment.EnchantmentHelper;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
@@ -35,44 +21,48 @@ import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
import net.minecraftforge.event.ForgeEventFactory;
|
import net.minecraftforge.event.ForgeEventFactory;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
import thaumcraft.common.Thaumcraft;
|
import thaumcraft.common.Thaumcraft;
|
||||||
import thaumcraft.common.entities.EntityFollowingItem;
|
import thaumcraft.common.entities.EntityFollowingItem;
|
||||||
import thaumcraft.common.lib.utils.BlockUtils;
|
import thaumcraft.common.lib.utils.BlockUtils;
|
||||||
import tombenpotter.emt.ElectroMagicTools;
|
|
||||||
import tombenpotter.emt.ModInformation;
|
|
||||||
import tombenpotter.emt.common.util.ConfigHandler;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
public class ItemRockbreakerDrill extends ItemThaumiumDrill {
|
public class ItemRockbreakerDrill extends ItemThaumiumDrill {
|
||||||
|
|
||||||
private static final Block[] isEffective = {Blocks.nether_brick, Blocks.netherrack, Blocks.glowstone, Blocks.iron_block, Blocks.gold_block, Blocks.diamond_block, Blocks.lapis_block, Blocks.redstone_block, Blocks.redstone_ore, Blocks.emerald_ore, Blocks.emerald_block, Blocks.stonebrick, Blocks.glass, Blocks.stone, Blocks.gold_ore, Blocks.iron_ore, Blocks.coal_ore, Blocks.cobblestone, Blocks.diamond_ore, Blocks.lapis_ore, Blocks.dirt, Blocks.gravel, Blocks.sand, Blocks.sandstone, Blocks.soul_sand, Blocks.clay, Blocks.grass, Blocks.snow_layer, Blocks.snow, Blocks.farmland, Blocks.hardened_clay, Blocks.stained_hardened_clay, Blocks.mossy_cobblestone};
|
private static final Block[] isEffective = { Blocks.nether_brick, Blocks.netherrack, Blocks.glowstone,
|
||||||
public Icon icon;
|
Blocks.iron_block, Blocks.gold_block, Blocks.diamond_block, Blocks.lapis_block, Blocks.redstone_block,
|
||||||
int side;
|
Blocks.redstone_ore, Blocks.emerald_ore, Blocks.emerald_block, Blocks.stonebrick, Blocks.glass,
|
||||||
|
Blocks.stone, Blocks.gold_ore, Blocks.iron_ore, Blocks.coal_ore, Blocks.cobblestone, Blocks.diamond_ore,
|
||||||
|
Blocks.lapis_ore, Blocks.dirt, Blocks.gravel, Blocks.sand, Blocks.sandstone, Blocks.soul_sand, Blocks.clay,
|
||||||
|
Blocks.grass, Blocks.snow_layer, Blocks.snow, Blocks.farmland, Blocks.hardened_clay,
|
||||||
|
Blocks.stained_hardened_clay, Blocks.mossy_cobblestone };
|
||||||
public int searchCost = 1000;
|
public int searchCost = 1000;
|
||||||
public int hitCost = 400;
|
public int hitCost = 400;
|
||||||
|
int side;
|
||||||
|
|
||||||
public ItemRockbreakerDrill() {
|
public ItemRockbreakerDrill() {
|
||||||
side = 0;
|
side = 0;
|
||||||
setCreativeTab(ElectroMagicTools.tabEMT);
|
setCreativeTab(EMT.TAB);
|
||||||
this.efficiencyOnProperMaterial = 25F;
|
this.efficiencyOnProperMaterial = 25F;
|
||||||
this.setMaxStackSize(1);
|
this.setMaxStackSize(1);
|
||||||
if (ConfigHandler.toolsInBore == false) {
|
if (EMTConfigHandler.toolsInBore == false) {
|
||||||
this.setMaxDamage(27);
|
this.setMaxDamage(27);
|
||||||
} else {
|
} else {
|
||||||
this.setMaxDamage(2571);
|
this.setMaxDamage(2571);
|
||||||
}
|
}
|
||||||
maxCharge = 900000;
|
maxCharge = 1000000;
|
||||||
transferLimit = 900;
|
transferLimit = 1000;
|
||||||
tier = 3;
|
tier = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/drill_rockbreaker");
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/drill_rockbreaker");
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isEffectiveAgainst(Block block) {
|
private boolean isEffectiveAgainst(Block block) {
|
||||||
@@ -86,17 +76,18 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player) {
|
public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player) {
|
||||||
MovingObjectPosition movingobjectposition = BlockUtils.getTargetBlock(((Entity) (player)).worldObj, player, true);
|
MovingObjectPosition movingobjectposition = BlockUtils
|
||||||
|
.getTargetBlock(((Entity) (player)).worldObj, player, true);
|
||||||
if (movingobjectposition != null && movingobjectposition.typeOfHit == MovingObjectType.BLOCK) {
|
if (movingobjectposition != null && movingobjectposition.typeOfHit == MovingObjectType.BLOCK) {
|
||||||
side = movingobjectposition.sideHit;
|
side = movingobjectposition.sideHit;
|
||||||
}
|
}
|
||||||
return super.onBlockStartBreak(itemstack, X, Y, Z, player);
|
return super.onBlockStartBreak(itemstack, X, Y, Z, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entityLiving) {
|
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z,
|
||||||
if (ConfigHandler.toolsInBore == false) {
|
EntityLivingBase entityLiving) {
|
||||||
|
if (EMTConfigHandler.toolsInBore == false) {
|
||||||
cost = 350;
|
cost = 350;
|
||||||
} else {
|
} else {
|
||||||
cost = 1;
|
cost = 1;
|
||||||
@@ -134,17 +125,26 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
|
|||||||
}
|
}
|
||||||
int fortune = EnchantmentHelper.getFortuneModifier(entityLiving);
|
int fortune = EnchantmentHelper.getFortuneModifier(entityLiving);
|
||||||
world.setBlockToAir(x + xx, y + yy, z + zz);
|
world.setBlockToAir(x + xx, y + yy, z + zz);
|
||||||
ArrayList ret = bl.getDrops(world, x + xx, y + yy, z + zz, md, fortune);
|
ArrayList<ItemStack> ret = bl.getDrops(world, x + xx, y + yy, z + zz, md, fortune);
|
||||||
boolean creative = false;
|
boolean creative = false;
|
||||||
if ((entityLiving instanceof EntityPlayer) && ((EntityPlayer) entityLiving).capabilities.isCreativeMode) {
|
if ((entityLiving instanceof EntityPlayer)
|
||||||
|
&& ((EntityPlayer) entityLiving).capabilities.isCreativeMode) {
|
||||||
creative = true;
|
creative = true;
|
||||||
}
|
}
|
||||||
if (ret.size() <= 0 || creative || ((Entity) (entityLiving)).worldObj.isRemote) {
|
if (ret.size() <= 0 || creative || ((Entity) (entityLiving)).worldObj.isRemote) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ItemStack is;
|
ItemStack is;
|
||||||
for (Iterator i$ = ret.iterator(); i$.hasNext(); world.spawnEntityInWorld(new EntityFollowingItem(world, (double) x + (double) xx + 0.5D, (double) y + (double) yy + 0.5D, (double) z + (double) zz + 0.5D, is, entityLiving, 3))) {
|
for (Iterator<ItemStack> i$ = ret.iterator(); i$.hasNext(); world.spawnEntityInWorld(
|
||||||
is = (ItemStack) i$.next();
|
new EntityFollowingItem(
|
||||||
|
world,
|
||||||
|
(double) x + (double) xx + 0.5D,
|
||||||
|
(double) y + (double) yy + 0.5D,
|
||||||
|
(double) z + (double) zz + 0.5D,
|
||||||
|
is,
|
||||||
|
entityLiving,
|
||||||
|
3))) {
|
||||||
|
is = i$.next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -153,11 +153,12 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
|
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||||
|
float xOffset, float yOffset, float zOffset) {
|
||||||
if (!player.isSneaking()) {
|
if (!player.isSneaking()) {
|
||||||
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
|
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
|
||||||
ItemStack torchStack = player.inventory.mainInventory[i];
|
ItemStack torchStack = player.inventory.mainInventory[i];
|
||||||
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch")) {
|
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase(Locale.US).contains("torch")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Item item = torchStack.getItem();
|
Item item = torchStack.getItem();
|
||||||
@@ -166,7 +167,8 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
|
|||||||
}
|
}
|
||||||
int oldMeta = torchStack.getItemDamage();
|
int oldMeta = torchStack.getItemDamage();
|
||||||
int oldSize = torchStack.stackSize;
|
int oldSize = torchStack.stackSize;
|
||||||
boolean result = torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
boolean result = torchStack
|
||||||
|
.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||||
if (player.capabilities.isCreativeMode) {
|
if (player.capabilities.isCreativeMode) {
|
||||||
torchStack.setItemDamage(oldMeta);
|
torchStack.setItemDamage(oldMeta);
|
||||||
torchStack.stackSize = oldSize;
|
torchStack.stackSize = oldSize;
|
||||||
@@ -181,10 +183,15 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
|
|||||||
} else {
|
} else {
|
||||||
ElectricItem.manager.use(stack, searchCost, player);
|
ElectricItem.manager.use(stack, searchCost, player);
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
world.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "thaumcraft:wandfail", 0.2F, 0.2F + world.rand.nextFloat() * 0.2F);
|
world.playSoundEffect(
|
||||||
|
x + 0.5D,
|
||||||
|
y + 0.5D,
|
||||||
|
z + 0.5D,
|
||||||
|
"thaumcraft:wandfail",
|
||||||
|
0.2F,
|
||||||
|
0.2F + world.rand.nextFloat() * 0.2F);
|
||||||
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, xOffset, zOffset);
|
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, xOffset, zOffset);
|
||||||
}
|
}
|
||||||
Minecraft mc = Minecraft.getMinecraft();
|
|
||||||
Thaumcraft.instance.renderEventHandler.startScan(player, x, y, z, System.currentTimeMillis() + 5000L, 1);
|
Thaumcraft.instance.renderEventHandler.startScan(player, x, y, z, System.currentTimeMillis() + 5000L, 1);
|
||||||
player.swingItem();
|
player.swingItem();
|
||||||
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||||
@@ -194,7 +201,8 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
|
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
|
||||||
if (!((Entity) (player)).worldObj.isRemote && (!(entity instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled())) {
|
if (!((Entity) (player)).worldObj.isRemote
|
||||||
|
&& (!(entity instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled())) {
|
||||||
entity.setFire(2);
|
entity.setFire(2);
|
||||||
}
|
}
|
||||||
return super.onLeftClickEntity(stack, player, entity);
|
return super.onLeftClickEntity(stack, player, entity);
|
||||||
+27
-39
@@ -1,21 +1,7 @@
|
|||||||
/*******************************************************************************
|
package emt.item.tool.drill;
|
||||||
* Copyright (c) 2014 Tombenpotter.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
|
||||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
|
||||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
|
||||||
* http://www.minecraftforum.net/topic/1585216-
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
package tombenpotter.emt.common.items.tools.drills;
|
import java.util.List;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import ic2.api.item.ElectricItem;
|
|
||||||
import ic2.api.item.IElectricItem;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
@@ -25,17 +11,19 @@ import net.minecraft.init.Items;
|
|||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemPickaxe;
|
import net.minecraft.item.ItemPickaxe;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import tombenpotter.emt.ElectroMagicTools;
|
|
||||||
import tombenpotter.emt.ModInformation;
|
|
||||||
import tombenpotter.emt.common.util.ConfigHandler;
|
|
||||||
import tombenpotter.emt.common.util.RandomHelper;
|
|
||||||
|
|
||||||
import java.util.List;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
|
import ic2.api.item.IElectricItem;
|
||||||
|
|
||||||
public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
|
public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
|
||||||
|
|
||||||
public int maxCharge = 60000;
|
public int maxCharge = 100000;
|
||||||
public int cost;
|
public int cost;
|
||||||
public int tier = 2;
|
public int tier = 2;
|
||||||
public double transferLimit = 100;
|
public double transferLimit = 100;
|
||||||
@@ -43,9 +31,9 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
|
|||||||
public ItemThaumiumDrill() {
|
public ItemThaumiumDrill() {
|
||||||
super(ToolMaterial.EMERALD);
|
super(ToolMaterial.EMERALD);
|
||||||
this.efficiencyOnProperMaterial = 20F;
|
this.efficiencyOnProperMaterial = 20F;
|
||||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
this.setCreativeTab(EMT.TAB);
|
||||||
this.setMaxStackSize(1);
|
this.setMaxStackSize(1);
|
||||||
if (ConfigHandler.toolsInBore == false) {
|
if (EMTConfigHandler.toolsInBore == false) {
|
||||||
this.setMaxDamage(27);
|
this.setMaxDamage(27);
|
||||||
} else {
|
} else {
|
||||||
this.setMaxDamage(240);
|
this.setMaxDamage(240);
|
||||||
@@ -55,12 +43,11 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/drill_thaumium");
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/drill_thaumium");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||||
ItemStack itemStack = new ItemStack(this, 1);
|
ItemStack itemStack = new ItemStack(this, 1);
|
||||||
if (getChargedItem(itemStack) == this) {
|
if (getChargedItem(itemStack) == this) {
|
||||||
ItemStack charged = new ItemStack(this, 1);
|
ItemStack charged = new ItemStack(this, 1);
|
||||||
@@ -73,8 +60,9 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
|
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6,
|
||||||
if (ConfigHandler.toolsInBore == false) {
|
EntityLivingBase entityLiving) {
|
||||||
|
if (EMTConfigHandler.toolsInBore == false) {
|
||||||
cost = 250;
|
cost = 250;
|
||||||
} else {
|
} else {
|
||||||
cost = 1;
|
cost = 1;
|
||||||
@@ -85,7 +73,8 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canHarvestBlock(Block block, ItemStack stack) {
|
public boolean canHarvestBlock(Block block, ItemStack stack) {
|
||||||
return Items.diamond_pickaxe.canHarvestBlock(block, stack) || Items.diamond_shovel.canHarvestBlock(block, stack);
|
return Items.diamond_pickaxe.canHarvestBlock(block, stack)
|
||||||
|
|| Items.diamond_shovel.canHarvestBlock(block, stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -94,7 +83,8 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
|
|||||||
return 1.0F;
|
return 1.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F) {
|
if (Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F
|
||||||
|
|| Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F) {
|
||||||
return efficiencyOnProperMaterial;
|
return efficiencyOnProperMaterial;
|
||||||
} else {
|
} else {
|
||||||
return super.getDigSpeed(stack, block, meta);
|
return super.getDigSpeed(stack, block, meta);
|
||||||
@@ -106,11 +96,6 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
|
|
||||||
return RandomHelper.placeTorch(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isRepairable() {
|
public boolean isRepairable() {
|
||||||
return false;
|
return false;
|
||||||
@@ -118,7 +103,7 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemEnchantability() {
|
public int getItemEnchantability() {
|
||||||
if (ConfigHandler.enchanting == false) {
|
if (EMTConfigHandler.enchanting == false) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return 4;
|
return 4;
|
||||||
@@ -127,10 +112,13 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||||
return ConfigHandler.enchanting;
|
return EMTConfigHandler.enchanting;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* IC2 API METHODS */
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||||
|
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||||
+14
-25
@@ -1,20 +1,5 @@
|
|||||||
/*******************************************************************************
|
package emt.item.tool.omnitool;
|
||||||
* Copyright (c) 2014 Tombenpotter.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
|
||||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
|
||||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
|
||||||
* http://www.minecraftforum.net/topic/1585216-
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
package tombenpotter.emt.common.items.tools.omnitools;
|
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import ic2.api.item.ElectricItem;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
@@ -22,35 +7,39 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import tombenpotter.emt.ElectroMagicTools;
|
|
||||||
import tombenpotter.emt.ModInformation;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import tombenpotter.emt.common.util.ConfigHandler;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
|
|
||||||
public class ItemOmnitoolDiamond extends ItemOmnitoolIron {
|
public class ItemOmnitoolDiamond extends ItemOmnitoolIron {
|
||||||
|
|
||||||
public ItemOmnitoolDiamond() {
|
public ItemOmnitoolDiamond() {
|
||||||
super();
|
super();
|
||||||
this.efficiencyOnProperMaterial = 16F;
|
this.efficiencyOnProperMaterial = 16F;
|
||||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
this.setCreativeTab(EMT.TAB);
|
||||||
this.setMaxStackSize(1);
|
this.setMaxStackSize(1);
|
||||||
if (!ConfigHandler.toolsInBore) {
|
if (!EMTConfigHandler.toolsInBore) {
|
||||||
this.setMaxDamage(27);
|
this.setMaxDamage(27);
|
||||||
} else {
|
} else {
|
||||||
this.setMaxDamage(350);
|
this.setMaxDamage(350);
|
||||||
}
|
}
|
||||||
maxCharge = 70000;
|
maxCharge = 100000;
|
||||||
hitCost = 250;
|
hitCost = 250;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/omnitool_diamond");
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/omnitool_diamond");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
|
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6,
|
||||||
if (!ConfigHandler.toolsInBore) {
|
EntityLivingBase entityLiving) {
|
||||||
|
if (!EMTConfigHandler.toolsInBore) {
|
||||||
cost = 200;
|
cost = 200;
|
||||||
} else {
|
} else {
|
||||||
cost = 1;
|
cost = 1;
|
||||||
+37
-36
@@ -1,21 +1,8 @@
|
|||||||
/*******************************************************************************
|
package emt.item.tool.omnitool;
|
||||||
* Copyright (c) 2014 Tombenpotter.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
|
||||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
|
||||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
|
||||||
* http://www.minecraftforum.net/topic/1585216-
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
package tombenpotter.emt.common.items.tools.omnitools;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import ic2.api.item.ElectricItem;
|
|
||||||
import ic2.api.item.IElectricItem;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
@@ -27,26 +14,29 @@ import net.minecraft.item.ItemBlock;
|
|||||||
import net.minecraft.item.ItemPickaxe;
|
import net.minecraft.item.ItemPickaxe;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.event.ForgeEventFactory;
|
import net.minecraftforge.event.ForgeEventFactory;
|
||||||
import tombenpotter.emt.ElectroMagicTools;
|
|
||||||
import tombenpotter.emt.ModInformation;
|
|
||||||
import tombenpotter.emt.common.util.ConfigHandler;
|
|
||||||
|
|
||||||
import java.util.List;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
|
import ic2.api.item.IElectricItem;
|
||||||
|
|
||||||
public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
|
public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
|
||||||
|
|
||||||
public int maxCharge = 20000;
|
public int maxCharge = 50000;
|
||||||
public int cost;
|
public int cost;
|
||||||
public int hitCost = 125;
|
public int hitCost = 125;
|
||||||
|
|
||||||
public ItemOmnitoolIron() {
|
public ItemOmnitoolIron() {
|
||||||
super(ToolMaterial.EMERALD);
|
super(ToolMaterial.EMERALD);
|
||||||
this.efficiencyOnProperMaterial = 13F;
|
this.efficiencyOnProperMaterial = 13F;
|
||||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
this.setCreativeTab(EMT.TAB);
|
||||||
this.setMaxStackSize(1);
|
this.setMaxStackSize(1);
|
||||||
if (!ConfigHandler.toolsInBore) {
|
if (!EMTConfigHandler.toolsInBore) {
|
||||||
this.setMaxDamage(27);
|
this.setMaxDamage(27);
|
||||||
} else {
|
} else {
|
||||||
this.setMaxDamage(200);
|
this.setMaxDamage(200);
|
||||||
@@ -56,12 +46,11 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/omnitool_iron");
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/omnitool_iron");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||||
ItemStack itemStack = new ItemStack(this, 1);
|
ItemStack itemStack = new ItemStack(this, 1);
|
||||||
if (getChargedItem(itemStack) == this) {
|
if (getChargedItem(itemStack) == this) {
|
||||||
ItemStack charged = new ItemStack(this, 1);
|
ItemStack charged = new ItemStack(this, 1);
|
||||||
@@ -74,10 +63,9 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving)
|
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6,
|
||||||
|
EntityLivingBase entityLiving) {
|
||||||
{
|
if (!EMTConfigHandler.toolsInBore) {
|
||||||
if (!ConfigHandler.toolsInBore) {
|
|
||||||
cost = 100;
|
cost = 100;
|
||||||
} else {
|
} else {
|
||||||
cost = 1;
|
cost = 1;
|
||||||
@@ -88,7 +76,10 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canHarvestBlock(Block block, ItemStack stack) {
|
public boolean canHarvestBlock(Block block, ItemStack stack) {
|
||||||
return Items.iron_axe.canHarvestBlock(block, stack) || Items.iron_sword.canHarvestBlock(block, stack) || Items.iron_pickaxe.canHarvestBlock(block, stack) || Items.iron_shovel.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack);
|
return Items.iron_axe.canHarvestBlock(block, stack) || Items.iron_sword.canHarvestBlock(block, stack)
|
||||||
|
|| Items.iron_pickaxe.canHarvestBlock(block, stack)
|
||||||
|
|| Items.iron_shovel.canHarvestBlock(block, stack)
|
||||||
|
|| Items.shears.canHarvestBlock(block, stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -97,7 +88,11 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
|
|||||||
return 1.0F;
|
return 1.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F || Items.shears.getDigSpeed(stack, block, meta) > 1.0F) {
|
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F
|
||||||
|
|| Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F
|
||||||
|
|| Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F
|
||||||
|
|| Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F
|
||||||
|
|| Items.shears.getDigSpeed(stack, block, meta) > 1.0F) {
|
||||||
return efficiencyOnProperMaterial;
|
return efficiencyOnProperMaterial;
|
||||||
} else {
|
} else {
|
||||||
return super.getDigSpeed(stack, block, meta);
|
return super.getDigSpeed(stack, block, meta);
|
||||||
@@ -113,10 +108,11 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
|
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||||
|
float xOffset, float yOffset, float zOffset) {
|
||||||
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
|
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
|
||||||
ItemStack torchStack = player.inventory.mainInventory[i];
|
ItemStack torchStack = player.inventory.mainInventory[i];
|
||||||
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch")) {
|
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase(Locale.US).contains("torch")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Item item = torchStack.getItem();
|
Item item = torchStack.getItem();
|
||||||
@@ -148,7 +144,7 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemEnchantability() {
|
public int getItemEnchantability() {
|
||||||
if (!ConfigHandler.enchanting) {
|
if (!EMTConfigHandler.enchanting) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return 4;
|
return 4;
|
||||||
@@ -157,7 +153,12 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||||
return ConfigHandler.enchanting;
|
return EMTConfigHandler.enchanting;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||||
|
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* IC2 API METHODS */
|
/* IC2 API METHODS */
|
||||||
+14
-25
@@ -1,20 +1,5 @@
|
|||||||
/*******************************************************************************
|
package emt.item.tool.omnitool;
|
||||||
* Copyright (c) 2014 Tombenpotter.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
|
||||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
|
||||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
|
||||||
* http://www.minecraftforum.net/topic/1585216-
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
package tombenpotter.emt.common.items.tools.omnitools;
|
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import ic2.api.item.ElectricItem;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
@@ -22,35 +7,39 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import tombenpotter.emt.ElectroMagicTools;
|
|
||||||
import tombenpotter.emt.ModInformation;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import tombenpotter.emt.common.util.ConfigHandler;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.util.EMTConfigHandler;
|
||||||
|
import ic2.api.item.ElectricItem;
|
||||||
|
|
||||||
public class ItemOmnitoolThaumium extends ItemOmnitoolDiamond {
|
public class ItemOmnitoolThaumium extends ItemOmnitoolDiamond {
|
||||||
|
|
||||||
public ItemOmnitoolThaumium() {
|
public ItemOmnitoolThaumium() {
|
||||||
super();
|
super();
|
||||||
this.efficiencyOnProperMaterial = 21F;
|
this.efficiencyOnProperMaterial = 21F;
|
||||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
this.setCreativeTab(EMT.TAB);
|
||||||
this.setMaxStackSize(1);
|
this.setMaxStackSize(1);
|
||||||
if (!ConfigHandler.toolsInBore) {
|
if (!EMTConfigHandler.toolsInBore) {
|
||||||
this.setMaxDamage(27);
|
this.setMaxDamage(27);
|
||||||
} else {
|
} else {
|
||||||
this.setMaxDamage(467);
|
this.setMaxDamage(467);
|
||||||
}
|
}
|
||||||
maxCharge = 140000;
|
maxCharge = 200000;
|
||||||
hitCost = 650;
|
hitCost = 650;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/omnitool_thaumium");
|
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/omnitool_thaumium");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
|
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6,
|
||||||
if (!ConfigHandler.toolsInBore) {
|
EntityLivingBase entityLiving) {
|
||||||
|
if (!EMTConfigHandler.toolsInBore) {
|
||||||
cost = 300;
|
cost = 300;
|
||||||
} else {
|
} else {
|
||||||
cost = 1;
|
cost = 1;
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package emt.nei;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import codechicken.nei.api.API;
|
||||||
|
import codechicken.nei.api.IConfigureNEI;
|
||||||
|
import emt.EMT;
|
||||||
|
import emt.init.EMTItems;
|
||||||
|
|
||||||
|
public class NEI_Config implements IConfigureNEI {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loadConfig() {
|
||||||
|
API.hideItem(new ItemStack(EMTItems.itemEMTItems, 1, 16));
|
||||||
|
API.hideItem(new ItemStack(EMTItems.itemEMTItems, 1, 17));
|
||||||
|
API.hideItem(new ItemStack(EMTItems.itemEMTItems, 1, 18));
|
||||||
|
API.hideItem(new ItemStack(EMTItems.itemEMTItems, 1, 19));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "EMT";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getVersion() {
|
||||||
|
return EMT.VERSION;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package emt.network;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||||
|
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||||
|
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||||
|
import emt.init.EMTItems;
|
||||||
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|
||||||
|
public class PacketEMTKeys implements IMessage, IMessageHandler<PacketEMTKeys, IMessage> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IMessage onMessage(PacketEMTKeys message, MessageContext ctx) {
|
||||||
|
if (ctx.getServerHandler().playerEntity.inventory.armorInventory[2] != null
|
||||||
|
&& ctx.getServerHandler().playerEntity.inventory.armorInventory[2].getItem() == EMTItems.quantumArmor) {
|
||||||
|
ctx.getServerHandler().playerEntity.inventory.armorInventory[2].stackTagCompound
|
||||||
|
.setBoolean("unequip", true);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fromBytes(ByteBuf buf) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void toBytes(ByteBuf buf) {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package emt.network;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.multiplayer.WorldClient;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||||
|
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||||
|
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import emt.tile.GT_MetaTileEntity_ResearchCompleter;
|
||||||
|
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
|
||||||
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|
||||||
|
public class PacketNodeInfo implements IMessage, IMessageHandler<PacketNodeInfo, IMessage> {
|
||||||
|
|
||||||
|
private int mBlockX, mBlockY, mBlockZ, mDim, nodeDistance, nodeColor;
|
||||||
|
|
||||||
|
public PacketNodeInfo() {}
|
||||||
|
|
||||||
|
public PacketNodeInfo(int mBlockX, int mBlockY, int mBlockZ, int mDim, int nodeDistance, int nodeColor) {
|
||||||
|
this.mBlockX = mBlockX;
|
||||||
|
this.mBlockY = mBlockY;
|
||||||
|
this.mBlockZ = mBlockZ;
|
||||||
|
this.mDim = mDim;
|
||||||
|
this.nodeDistance = nodeDistance;
|
||||||
|
this.nodeColor = nodeColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fromBytes(ByteBuf buf) {
|
||||||
|
mBlockX = buf.readInt();
|
||||||
|
mBlockY = buf.readInt();
|
||||||
|
mBlockZ = buf.readInt();
|
||||||
|
mDim = buf.readInt();
|
||||||
|
nodeDistance = buf.readInt();
|
||||||
|
nodeColor = buf.readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void toBytes(ByteBuf buf) {
|
||||||
|
buf.writeInt(mBlockX);
|
||||||
|
buf.writeInt(mBlockY);
|
||||||
|
buf.writeInt(mBlockZ);
|
||||||
|
buf.writeInt(mDim);
|
||||||
|
buf.writeInt(nodeDistance);
|
||||||
|
buf.writeInt(nodeColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IMessage onMessage(PacketNodeInfo message, MessageContext ctx) {
|
||||||
|
WorldClient world = Minecraft.getMinecraft().theWorld;
|
||||||
|
if (world != null) {
|
||||||
|
if (world.blockExists(message.mBlockX, message.mBlockY, message.mBlockZ)) {
|
||||||
|
TileEntity tileEntity = world.getTileEntity(message.mBlockX, message.mBlockY, message.mBlockZ);
|
||||||
|
if (tileEntity instanceof IGregTechTileEntity) {
|
||||||
|
IGregTechTileEntity gtTile = (IGregTechTileEntity) tileEntity;
|
||||||
|
if (gtTile.getMetaTileEntity() instanceof GT_MetaTileEntity_ResearchCompleter) {
|
||||||
|
GT_MetaTileEntity_ResearchCompleter researchCompleter = (GT_MetaTileEntity_ResearchCompleter) gtTile
|
||||||
|
.getMetaTileEntity();
|
||||||
|
researchCompleter.setNodeValues(message.nodeDistance, message.nodeColor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loaded 100 of 793 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user