mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-10-26 22:34:08 +00:00
Compare commits
483
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67ef25de09 | ||
|
|
072e3a693b | ||
|
|
b29c810a80 | ||
|
|
3f8e3f72d9 | ||
|
|
5041e23ede | ||
|
|
21a35c9c92 | ||
|
|
6d542dec5a | ||
|
|
4552a451ae | ||
|
|
5c33e95a54 | ||
|
|
1e2bd1d4cd | ||
|
|
1cc995c986 | ||
|
|
1799380064 | ||
|
|
0d3ffa2598 | ||
|
|
3dc65c80d8 | ||
|
|
bc0da61058 | ||
|
|
c9e1647070 | ||
|
|
d622f0cd58 | ||
|
|
32a505a575 | ||
|
|
7ce589c6db | ||
|
|
f0aa44999f | ||
|
|
88f99a636c | ||
|
|
568139fd17 | ||
|
|
cf0189c3ee | ||
|
|
2ee0d7f0ed | ||
|
|
6997a96460 | ||
|
|
179ca23f6c | ||
|
|
e7e5b1b484 | ||
|
|
fbd9917fd4 | ||
|
|
881e271a0b | ||
|
|
3b5c500bc9 | ||
|
|
4751da9e7b | ||
|
|
1c4ae58377 | ||
|
|
9f0c710479 | ||
|
|
8a13a03016 | ||
|
|
7ef27df0bc | ||
|
|
01a913c96c | ||
|
|
110396f39e | ||
|
|
233bc705b0 | ||
|
|
6264ebddbc | ||
|
|
bedbf55b33 | ||
|
|
a5d688883e | ||
|
|
83d0b8dc12 | ||
|
|
c05c1ef8bf | ||
|
|
c5d5e59b96 | ||
|
|
1fd48994d7 | ||
|
|
cf56634a91 | ||
|
|
1344bb8c08 | ||
|
|
2bf69eaa56 | ||
|
|
b242d43861 | ||
|
|
404c39c8f8 | ||
|
|
d8bdb6a31d | ||
|
|
c5208175d7 | ||
|
|
a0d0fefe8d | ||
|
|
87172ea3f2 | ||
|
|
16381383cb | ||
|
|
252e3191dc | ||
|
|
ce0ba85397 | ||
|
|
aa8dc5d16c | ||
|
|
dff2cf2bf1 | ||
|
|
347c100e93 | ||
|
|
003fb22733 | ||
|
|
7f5d3859e4 | ||
|
|
124fdeeee3 | ||
|
|
611f33a133 | ||
|
|
a76efcc6fc | ||
|
|
cd3daf2b47 | ||
|
|
dc05115497 | ||
|
|
44a4657cd8 | ||
|
|
8e70e9fa68 | ||
|
|
0b635c5bc7 | ||
|
|
6f69d5d154 | ||
|
|
589b4e49b6 | ||
|
|
b30ad911fa | ||
|
|
be667b2ee3 | ||
|
|
bea1c6ecdc | ||
|
|
971b1ee3e2 | ||
|
|
4172637bcc | ||
|
|
2650813f95 | ||
|
|
1fbcb0b39b | ||
|
|
e28f82dc7d | ||
|
|
d3d94e46d7 | ||
|
|
b2d7bc2794 | ||
|
|
2afaac9f20 | ||
|
|
28b3e5d22b | ||
|
|
da3958a414 | ||
|
|
4ddf3767c5 | ||
|
|
81c45fb079 | ||
|
|
49d79abb83 | ||
|
|
1a3b6833b5 | ||
|
|
38cd0fbf55 | ||
|
|
9d1e7f86cf | ||
|
|
5863b165ad | ||
|
|
f7a1f629be | ||
|
|
6f348e7db1 | ||
|
|
b6ddefcaf4 | ||
|
|
c6df7c260a | ||
|
|
9a11ebef1f | ||
|
|
1bb254a4fc | ||
|
|
8600b75691 | ||
|
|
337851994f | ||
|
|
b232d8bb93 | ||
|
|
2a2971f75a | ||
|
|
dced32bf4c | ||
|
|
420d4b0aa4 | ||
|
|
d4b0d0aec9 | ||
|
|
e37b3ac3e6 | ||
|
|
6a4f8e9f4b | ||
|
|
d7929eed08 | ||
|
|
028f0c4c82 | ||
|
|
71edb3abb1 | ||
|
|
4fede6f49e | ||
|
|
4ef18f3347 | ||
|
|
eaa9c89684 | ||
|
|
37c2adece1 | ||
|
|
9f94407be0 | ||
|
|
7b6d2e843e | ||
|
|
7d87732ccb | ||
|
|
3c9388702c | ||
|
|
e338735814 | ||
|
|
d34fc5a3e1 | ||
|
|
d9522fcc18 | ||
|
|
53147606c1 | ||
|
|
cfb368f67e | ||
|
|
6c307d16f4 | ||
|
|
3a8fc10cc9 | ||
|
|
f2544a6fa4 | ||
|
|
b7e77936b3 | ||
|
|
8767180a7b | ||
|
|
bc52c67c89 | ||
|
|
0001f9c8f1 | ||
|
|
9fef518968 | ||
|
|
6b10ada28a | ||
|
|
f3a3e80334 | ||
|
|
5cdd2ee32f | ||
|
|
a9cc76576a | ||
|
|
fc23dedd05 | ||
|
|
65bf209835 | ||
|
|
d2e84babb7 | ||
|
|
850ea37f4d | ||
|
|
2d0af453b3 | ||
|
|
d5c9c7815e | ||
|
|
25cd574662 | ||
|
|
3cf1619b2e | ||
|
|
73c06c10eb | ||
|
|
1d5dfa149e | ||
|
|
c1fff324d1 | ||
|
|
95f1e768fe | ||
|
|
ec9496b0e7 | ||
|
|
5f3951c7fa | ||
|
|
47ac6fc65a | ||
|
|
ae0894a8d0 | ||
|
|
96bf87333b | ||
|
|
9e09a3f42d | ||
|
|
bc0ca77960 | ||
|
|
8bca8bb5f6 | ||
|
|
ece95aca1c | ||
|
|
c357ab68c3 | ||
|
|
cfc1ba8baf | ||
|
|
f56eca23fc | ||
|
|
b7aab995db | ||
|
|
ec5fcef90c | ||
|
|
f4d7a80e49 | ||
|
|
c289edd825 | ||
|
|
5ac09b830d | ||
|
|
709fc130d5 | ||
|
|
873aedf4e5 | ||
|
|
27410530d6 | ||
|
|
491452ac7b | ||
|
|
4e905ede36 | ||
|
|
6afc33c57b | ||
|
|
5f35b8aef0 | ||
|
|
699ee5027a | ||
|
|
7c32f5fbaf | ||
|
|
3c0fe199d5 | ||
|
|
c15f08b066 | ||
|
|
c47de38ec9 | ||
|
|
9b3c1d721d | ||
|
|
5d19a0dd6c | ||
|
|
89834b4053 | ||
|
|
85eef6c461 | ||
|
|
9897d3ed80 | ||
|
|
02cfe14d94 | ||
|
|
4b4b9a308c | ||
|
|
55df4f0619 | ||
|
|
c83578b920 | ||
|
|
39517588e7 | ||
|
|
14f0c43850 | ||
|
|
05c6a07bc2 | ||
|
|
d241f95bee | ||
|
|
49a6f00b41 | ||
|
|
14b2a35862 | ||
|
|
4aeed07f75 | ||
|
|
cdcfe75325 | ||
|
|
303e89f6c5 | ||
|
|
c9e501fd02 | ||
|
|
3049ac9767 | ||
|
|
11c0e4b274 | ||
|
|
fab5fc0087 | ||
|
|
a5df917d5a | ||
|
|
c2931d1517 | ||
|
|
b71cb163a7 | ||
|
|
ff69a2e458 | ||
|
|
4cfd420cc1 | ||
|
|
95bd4689d6 | ||
|
|
d2aa4e0ebc | ||
|
|
1bff638075 | ||
|
|
78f296d0cf | ||
|
|
6014df2b12 | ||
|
|
30c208aa55 | ||
|
|
96a2da61f5 | ||
|
|
fd35d25423 | ||
|
|
2065f01b8d | ||
|
|
6c52c4f5f9 | ||
|
|
307068c9c4 | ||
|
|
688da731ab | ||
|
|
ac003f1307 | ||
|
|
3e0f5da01d | ||
|
|
cc1b66f3cd | ||
|
|
c08fa024a0 | ||
|
|
4f0d63f5a0 | ||
|
|
8ef557e51b | ||
|
|
974e8d0316 | ||
|
|
cf82603f04 | ||
|
|
1d54442e01 | ||
|
|
a07f7914ae | ||
|
|
51c7d310a7 | ||
|
|
e3e6f8996f | ||
|
|
7f759c1b88 | ||
|
|
57e1fd5b41 | ||
|
|
8b88289789 | ||
|
|
ff2afbf037 | ||
|
|
41b3e6cd4f | ||
|
|
930703b5c1 | ||
|
|
f52dca111f | ||
|
|
9694664922 | ||
|
|
e2e00f7ef1 | ||
|
|
c9de3bcc03 | ||
|
|
995c19c04a | ||
|
|
96983a1d6b | ||
|
|
8f00e9bdd6 | ||
|
|
49d3004c60 | ||
|
|
8fb3b886a8 | ||
|
|
3c159e2485 | ||
|
|
bdf51cbc8b | ||
|
|
056f46b1f8 | ||
|
|
a59ee11da4 | ||
|
|
9b06371a4e | ||
|
|
afb3f6f44b | ||
|
|
1deb617f72 | ||
|
|
5495271fa2 | ||
|
|
588a02f385 | ||
|
|
b1fad332b8 | ||
|
|
df478b0ff8 | ||
|
|
68560a335e | ||
|
|
13905a174c | ||
|
|
ef0f31f2de | ||
|
|
1d7a402c6e | ||
|
|
b0fad5db16 | ||
|
|
481eb5e711 | ||
|
|
1e26be3c77 | ||
|
|
a2d8aa17d2 | ||
|
|
ebc6f1a8c6 | ||
|
|
6a5e37b632 | ||
|
|
6b55f97a44 | ||
|
|
ae71a4756c | ||
|
|
bf0712a75c | ||
|
|
79e2ee7c0a | ||
|
|
fb7fda6996 | ||
|
|
c944512519 | ||
|
|
dc8104f68b | ||
|
|
46417330a4 | ||
|
|
2f292ed3be | ||
|
|
4231dc839f | ||
|
|
be1eb570ef | ||
|
|
d524a0b2e9 | ||
|
|
afc5f93b55 | ||
|
|
072f13d3db | ||
|
|
5e11fe6e06 | ||
|
|
a3abfb6aad | ||
|
|
c0c1db1aa7 | ||
|
|
e99d5dff63 | ||
|
|
1b144e6b58 | ||
|
|
7dcd0281b8 | ||
|
|
2d412ac70f | ||
|
|
a0d251fafd | ||
|
|
f24409f336 | ||
|
|
7a66a9756b | ||
|
|
a802650289 | ||
|
|
130c67e758 | ||
|
|
d0e2f474bc | ||
|
|
6889afc34e | ||
|
|
bb152907a7 | ||
|
|
3996c5d078 | ||
|
|
8f4f63453a | ||
|
|
725ae1cef1 | ||
|
|
93656a9d43 | ||
|
|
96a1db97a9 | ||
|
|
a339397fcc | ||
|
|
e37255a997 | ||
|
|
95427b1c9d | ||
|
|
4a6bf0ed0d | ||
|
|
b6827ca04e | ||
|
|
45df392cce | ||
|
|
abf5d9672b | ||
|
|
dc35d395cf | ||
|
|
fca4e2bfa8 | ||
|
|
543b5a1958 | ||
|
|
f8d18ae769 | ||
|
|
6d350451fc | ||
|
|
5d1829a00e | ||
|
|
16f6289844 | ||
|
|
da11e497fc | ||
|
|
be155e0abb | ||
|
|
2ad607bff3 | ||
|
|
b090622477 | ||
|
|
af5e9f7751 | ||
|
|
b32f834a73 | ||
|
|
d34e3453fe | ||
|
|
5d5109d6d1 | ||
|
|
a838427df8 | ||
|
|
55262cd4e5 | ||
|
|
de0ba4ada9 | ||
|
|
5bf1c26ffb | ||
|
|
dd300ea32f | ||
|
|
b7fead0e4d | ||
|
|
905a372708 | ||
|
|
9309355af2 | ||
|
|
910dfc25db | ||
|
|
0ad2a4f218 | ||
|
|
b479284760 | ||
|
|
0a396b0d82 | ||
|
|
3f85ca5805 | ||
|
|
9f60ac59fa | ||
|
|
f01b8a1fa9 | ||
|
|
8c3d1bde14 | ||
|
|
a782017852 | ||
|
|
b9fcf9bd53 | ||
|
|
391eea0416 | ||
|
|
a4279647fa | ||
|
|
9e82e5357a | ||
|
|
d33590f7ca | ||
|
|
45dda5f19c | ||
|
|
be9fba512b | ||
|
|
f219836f81 | ||
|
|
2c75af2359 | ||
|
|
86b6962f94 | ||
|
|
26831d3e98 | ||
|
|
a6c2631946 | ||
|
|
7a36e543ad | ||
|
|
649dffcf71 | ||
|
|
b3ee6dcf7a | ||
|
|
69cbecb521 | ||
|
|
effd07129c | ||
|
|
e73feae688 | ||
|
|
cee7a965a5 | ||
|
|
07f3099071 | ||
|
|
70cc32a839 | ||
|
|
50eeb06bf6 | ||
|
|
d97b2ceb1d | ||
|
|
209970b60c | ||
|
|
5cdf48393a | ||
|
|
533a287bd3 | ||
|
|
7c61b1b9d3 | ||
|
|
4a9c269a67 | ||
|
|
1a7e128ae5 | ||
|
|
be09676053 | ||
|
|
11d327dcce | ||
|
|
5df661bf28 | ||
|
|
fa8c12d6fc | ||
|
|
3fb76acf57 | ||
|
|
2471642df7 | ||
|
|
39a44642e4 | ||
|
|
bcecfb9148 | ||
|
|
1f11359b23 | ||
|
|
4ec22a0417 | ||
|
|
8a6189cbd2 | ||
|
|
796d231867 | ||
|
|
fb0a414443 | ||
|
|
ae57ace7e8 | ||
|
|
f011be3571 | ||
|
|
109d045a4d | ||
|
|
32fb1bcf6d | ||
|
|
529c41407f | ||
|
|
ea6484211b | ||
|
|
53ce019cf5 | ||
|
|
eec7c8ba59 | ||
|
|
c07febc67d | ||
|
|
08550cc442 | ||
|
|
82fa306a5c | ||
|
|
63a5bdee1c | ||
|
|
f8157f1222 | ||
|
|
7536ebe4c6 | ||
|
|
af19c7cece | ||
|
|
43395f9441 | ||
|
|
97495a913d | ||
|
|
1d901ec9ac | ||
|
|
62b39ee682 | ||
|
|
759bf2835d | ||
|
|
69db133091 | ||
|
|
5ceceec6bb | ||
|
|
e122e5252c | ||
|
|
5f3172bd5d | ||
|
|
79c8e3d695 | ||
|
|
f5b435bf24 | ||
|
|
b6d607b553 | ||
|
|
d411fac65c | ||
|
|
9bc724d6fd | ||
|
|
bcd00dbba3 | ||
|
|
c8531fde67 | ||
|
|
4771ec5bdb | ||
|
|
ecb0f8a4be | ||
|
|
ab618923df | ||
|
|
674ba5c19d | ||
|
|
1b87160ef6 | ||
|
|
ec419edfe3 | ||
|
|
5b9a5bf480 | ||
|
|
1b79575648 | ||
|
|
0ba32450cf | ||
|
|
400f6583ad | ||
|
|
365bed04c0 | ||
|
|
3e79893a35 | ||
|
|
d37518c9f4 | ||
|
|
0af2d25a71 | ||
|
|
268a8afda5 | ||
|
|
5cc6879ecb | ||
|
|
a268149d73 | ||
|
|
fe16702db4 | ||
|
|
c23b9dcaee | ||
|
|
663c797cf3 | ||
|
|
3852282598 | ||
|
|
3dd877e69a | ||
|
|
1c608d4636 | ||
|
|
cfbf2cc538 | ||
|
|
017829927f | ||
|
|
644d6553d1 | ||
|
|
58e06ae86b | ||
|
|
3bb203e371 | ||
|
|
5821ede5e6 | ||
|
|
316363d729 | ||
|
|
66a5c5e578 | ||
|
|
fcb394bba3 | ||
|
|
e174144937 | ||
|
|
6622ec5270 | ||
|
|
f86f42b895 | ||
|
|
b9b7a4e07d | ||
|
|
199243c120 | ||
|
|
4b056375d4 | ||
|
|
8e550e36d2 | ||
|
|
9a756ef79e | ||
|
|
bead93c653 | ||
|
|
e2596f4511 | ||
|
|
ec1cc498ce | ||
|
|
8f67094377 | ||
|
|
2172d78dd2 | ||
|
|
099c02157e | ||
|
|
3cc7099ab2 | ||
|
|
f1403a4577 | ||
|
|
64e1282444 | ||
|
|
949fdde057 | ||
|
|
e031b3b52c | ||
|
|
55c2a522ee | ||
|
|
cf7f10d082 | ||
|
|
19e226780d | ||
|
|
8909b26e99 | ||
|
|
3534a6cc5f | ||
|
|
95f8cc529f | ||
|
|
4c1b15b336 | ||
|
|
4bad74dbfd | ||
|
|
f5b71f9db1 | ||
|
|
769528ceed | ||
|
|
84e38b5a32 | ||
|
|
3a9f0b346e | ||
|
|
3097dde357 | ||
|
|
e25cf207a6 | ||
|
|
c74e77d9fc | ||
|
|
c105b606c4 | ||
|
|
93174616c7 | ||
|
|
63f160b78b | ||
|
|
bb89013f1e | ||
|
|
1229141b2f | ||
|
|
9f1a2b8a7d | ||
|
|
6f6cdf8198 | ||
|
|
132584e937 |
No files matched your search
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"pack": {
|
||||
"pack_format": 1,
|
||||
"pack_format": 2,
|
||||
"description": "Alternate Botania textures by Futureazoo"
|
||||
}
|
||||
}
|
||||
+38
-22
@@ -1,3 +1,6 @@
|
||||
import groovy.json.JsonSlurper
|
||||
import groovy.json.JsonOutput
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -11,12 +14,13 @@ buildscript {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
|
||||
classpath 'com.matthewprenger:CurseGradle:1.0-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "chickenbones"
|
||||
url = "http://chickenbones.net/maven/"
|
||||
@@ -42,7 +46,7 @@ minecraft {
|
||||
version = "${config.mc_version}-${config.forge_version}"
|
||||
runDir = "eclipse/assets"
|
||||
|
||||
mappings = "snapshot_20151229"
|
||||
mappings = "snapshot_20160718"
|
||||
//This, does the token replacement.
|
||||
//Though, I reccomend this to be replaced with a token such as @VERSION@
|
||||
replace 'GRADLE:BUILD', config.build_number
|
||||
@@ -53,9 +57,6 @@ minecraft {
|
||||
}
|
||||
|
||||
//This here is for SCP
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
configurations {
|
||||
sshAntTask
|
||||
}
|
||||
@@ -66,11 +67,7 @@ dependencies {
|
||||
compile files(
|
||||
'Baubles-deobf.jar'
|
||||
)
|
||||
//compile "codechicken:CodeChickenLib:1.8-1.1.2.139:dev"
|
||||
//compile "codechicken:CodeChickenCore:1.8-1.0.5.36:dev"
|
||||
//compile "codechicken:NotEnoughItems:1.8-1.0.5.104:dev"
|
||||
//compile "codechicken:ForgeMultipart:1.7.10-1.1.1.320:dev"
|
||||
deobfCompile "mezz.jei:jei_1.8.9:2.25.7.145"
|
||||
deobfCompile "mezz.jei:jei_1.10.2:3.7.8.234"
|
||||
|
||||
//and a bit more for SCP
|
||||
sshAntTask "org.apache.ant:ant-jsch:1.7.1", "jsch:jsch:0.1.29"
|
||||
@@ -81,6 +78,9 @@ compileJava {
|
||||
targetCompatibility = 1.8
|
||||
}
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
|
||||
processResources {
|
||||
// replace stuff in mcmod.info, nothing else
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
@@ -101,7 +101,7 @@ processResources {
|
||||
*/
|
||||
task deobfJar(type: Jar) {
|
||||
from(sourceSets.main.output)
|
||||
archiveName = "${baseName} ${version}-deobf.${extension}"
|
||||
archiveName = "${baseName}.${version}-deobf.${extension}"
|
||||
}
|
||||
|
||||
artifacts {
|
||||
@@ -110,16 +110,33 @@ artifacts {
|
||||
/**
|
||||
* Increments the buildnumber in your config file, and saves it
|
||||
*/
|
||||
task incrementBuildNumber(dependsOn: 'reobf') << {
|
||||
task incrementBuildNumber(dependsOn: 'reobfJar') << {
|
||||
config.build_number = (config.build_number.toString().toInteger()) + 1
|
||||
configFile.withWriter {
|
||||
config.toProperties().store(it, "")
|
||||
}
|
||||
|
||||
// todo make this flexibile - collection of supported mc versions
|
||||
|
||||
file('web/versions.ini').append("\n${version}=${minecraft.version}")
|
||||
file("${config.dir_repo}/version/${minecraft.version}.txt").write("${version}")
|
||||
|
||||
def updateJsonFile = file('version/update.json')
|
||||
def updateJson = new JsonSlurper().parse(updateJsonFile) as Map
|
||||
|
||||
// todo detect if the mcversion is absent
|
||||
|
||||
// Add to version section
|
||||
updateJson."${minecraft.version}"."${version}" = "See https://github.com/williewillus/Botania/releases/${version}"
|
||||
|
||||
// Update promos
|
||||
updateJson.promos."${minecraft.version}-latest" = "${version}"
|
||||
updateJson.promos."${minecraft.version}-recommended" = "${version}"
|
||||
|
||||
updateJsonFile.write(JsonOutput.prettyPrint(JsonOutput.toJson(updateJson)))
|
||||
}
|
||||
|
||||
/* Unused - Forgecraft and web server stuff
|
||||
// I have no idea what I'm doing
|
||||
task wtfGradle2(type: Copy) {
|
||||
from(jar.destinationDir)
|
||||
@@ -157,9 +174,7 @@ task sort(type: Delete) {
|
||||
delete "${config.dir_output}/${deobfJar.archiveName}", "${config.dir_output}/wtf"
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the upload task from the build.xml
|
||||
*/
|
||||
// This is the upload task from the build.xml
|
||||
task upload() << {
|
||||
scp('/files') {
|
||||
fileset(file: jar.archivePath)
|
||||
@@ -175,9 +190,7 @@ task upload() << {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is deply_web task
|
||||
*/
|
||||
// This is deploy_web task
|
||||
task deployWeb << {
|
||||
scp('/') {
|
||||
fileset(dir: 'web') //everything from the web directory
|
||||
@@ -205,6 +218,7 @@ def scp(String dir, Closure antFileset = {}) {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
def parseConfig(File config) {
|
||||
config.withReader {
|
||||
@@ -216,21 +230,23 @@ def parseConfig(File config) {
|
||||
|
||||
jar {
|
||||
//rename the default output, for some better... sanity with scipts
|
||||
archiveName = "${baseName} ${version}.${extension}"
|
||||
archiveName = "${baseName}-unofficial.${version}.${extension}"
|
||||
}
|
||||
|
||||
curseforge {
|
||||
apiKey = priv.cfkey
|
||||
project {
|
||||
id = "225643"
|
||||
id = "241973"
|
||||
changelog = """
|
||||
See http://botaniamod.net/changelog.php#${version}
|
||||
See https://github.com/williewillus/Botania/releases/tag/${version}
|
||||
"""
|
||||
releaseType = "release"
|
||||
addGameVersion "${minecraft.version}"
|
||||
relations {
|
||||
requiredLibrary 'baubles'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
defaultTasks 'clean', 'build', 'sort', 'forgecraft', 'incrementBuildNumber', 'curse', 'upload'
|
||||
//defaultTasks 'clean', 'build', 'sort', 'forgecraft', 'incrementBuildNumber', 'curse', 'upload'
|
||||
defaultTasks 'clean', 'build', 'incrementBuildNumber', 'curseforge'
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
#
|
||||
#Thu Feb 25 19:50:43 GMT 2016
|
||||
#Fri Jul 29 18:40:22 CDT 2016
|
||||
version=r1.8
|
||||
dir_output=../Build Output/Botania/
|
||||
forge_version=11.15.1.1763
|
||||
mc_version=1.8.9
|
||||
forge_version=12.18.1.2044
|
||||
mc_version=1.10.2
|
||||
dir_repo=./
|
||||
build_number=250
|
||||
build_number=315
|
||||
mod_name=Botania
|
||||
@@ -55,3 +55,5 @@ gryphonn=11
|
||||
loraanicus=10
|
||||
samerater=8
|
||||
coolcabbage16=13
|
||||
eladkay=3
|
||||
tobiasling=9
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
#Mon Sep 14 12:28:28 PDT 2015
|
||||
#Sat May 28 11:56:22 CDT 2016
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-all.zip
|
||||
@@ -12,7 +12,7 @@ import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public final class BuildCraftAPI {
|
||||
|
||||
@@ -10,11 +10,13 @@ import java.util.Random;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/** Use minecraft's EnumDyeColor in as many places as possible. */
|
||||
@Deprecated
|
||||
public enum EnumColor implements IStringSerializable {
|
||||
@@ -111,13 +113,14 @@ public enum EnumColor implements IStringSerializable {
|
||||
return name().replace("_", ".").toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getName() {
|
||||
return NAMES[ordinal()];
|
||||
}
|
||||
|
||||
public String getLocalizedName() {
|
||||
return StatCollector.translateToLocal(getTag());
|
||||
return I18n.translateToLocal(getTag());
|
||||
}
|
||||
|
||||
public String getDye() {
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.Map;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTBase.NBTPrimitive;
|
||||
import net.minecraft.nbt.NBTPrimitive;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* should be located as "LICENSE.API" in the BuildCraft source code distribution. */
|
||||
package buildcraft.api.core;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
/** To be implemented by TileEntities able to provide a square area on the world, typically BuildCraft markers. */
|
||||
public interface IAreaProvider {
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
* should be located as "LICENSE.API" in the BuildCraft source code distribution. */
|
||||
package buildcraft.api.core;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public interface IBox extends IZone {
|
||||
IBox expand(int amount);
|
||||
|
||||
@@ -2,7 +2,7 @@ package buildcraft.api.core;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
/** To be implemented by TileEntities able to provide a path on the world, typically BuildCraft path markers. */
|
||||
public interface IPathProvider {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* should be located as "LICENSE.API" in the BuildCraft source code distribution. */
|
||||
package buildcraft.api.core;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IWorldProperty {
|
||||
|
||||
@@ -6,12 +6,12 @@ package buildcraft.api.core;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
public interface IZone {
|
||||
/** Returns the smallest possible distance that the index would have to be changed by in order for
|
||||
* {@link #contains(Vec3)} to return true. If the position is already inside then this will return 0 */
|
||||
* {@link #contains(Vec3d)} to return true. If the position is already inside then this will return 0 */
|
||||
double distanceTo(BlockPos index);
|
||||
|
||||
/** Returns {@link #distanceTo(BlockPos)} but squared. Usually this will be quicker to calculate. */
|
||||
@@ -19,8 +19,8 @@ public interface IZone {
|
||||
|
||||
/** Returns true if the point is enclosed by this zone, such that none of the coordinates lie outside the range
|
||||
* specified by this zone. */
|
||||
boolean contains(Vec3 point);
|
||||
boolean contains(Vec3d point);
|
||||
|
||||
/** Gets a random position that {@link #contains(Vec3)} will return true. */
|
||||
/** Gets a random position that {@link #contains(Vec3d)} will return true. */
|
||||
BlockPos getRandomBlockPos(Random rand);
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
/** This class is used whenever stacks needs to be stored as keys. */
|
||||
@@ -80,7 +81,7 @@ public final class StackKey {
|
||||
}
|
||||
}
|
||||
if (fluidStack != null) {
|
||||
if (fluidStack.getFluid().getID() != k.fluidStack.getFluid().getID() || fluidStack.amount != k.fluidStack.amount || !objectsEqual(
|
||||
if (fluidStack.getFluid() != k.fluidStack.getFluid() || fluidStack.amount != k.fluidStack.amount || !objectsEqual(
|
||||
fluidStack.tag, k.fluidStack.tag)) {
|
||||
return false;
|
||||
}
|
||||
@@ -98,7 +99,7 @@ public final class StackKey {
|
||||
}
|
||||
result = 31 * result + 7;
|
||||
if (fluidStack != null) {
|
||||
result = 31 * result + fluidStack.getFluid().getID();
|
||||
result = 31 * result + FluidRegistry.getFluidID(fluidStack.getFluid());
|
||||
result = 31 * result + fluidStack.amount;
|
||||
result = 31 * result + objectHashCode(fluidStack.tag);
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */
|
||||
package buildcraft.api.core.render;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
/* This interface designates a block as a state machine responsible for culling For implementation details look into
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package buildcraft.api.transport;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ package buildcraft.api.transport;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.google.common.collect.Maps;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import buildcraft.api.transport.pluggable.PipePluggable;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
package buildcraft.api.transport.pluggable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package thaumcraft.api.crafting;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,33 +2,28 @@
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
*
|
||||
* File Created @ [Jan 14, 2014, 6:15:28 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.api;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockCarpet;
|
||||
import net.minecraft.block.BlockColored;
|
||||
import net.minecraft.block.BlockStainedGlass;
|
||||
import net.minecraft.block.BlockStainedGlassPane;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -37,8 +32,10 @@ import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.LoaderState;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import vazkii.botania.api.brew.Brew;
|
||||
@@ -62,65 +59,72 @@ import vazkii.botania.api.wiki.IWikiProvider;
|
||||
import vazkii.botania.api.wiki.SimpleWikiProvider;
|
||||
import vazkii.botania.api.wiki.WikiHooks;
|
||||
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public final class BotaniaAPI {
|
||||
|
||||
private static List<LexiconCategory> categories = new ArrayList<>();
|
||||
private static List<LexiconEntry> allEntries = new ArrayList<>();
|
||||
private static final List<LexiconCategory> categories = new ArrayList<>();
|
||||
private static final List<LexiconEntry> allEntries = new ArrayList<>();
|
||||
|
||||
public static Map<String, KnowledgeType> knowledgeTypes = new HashMap<>();
|
||||
public static final Map<String, KnowledgeType> knowledgeTypes = new HashMap<>();
|
||||
|
||||
public static Map<String, Brew> brewMap = new LinkedHashMap<>();
|
||||
|
||||
public static List<String> disposableBlocks = new ArrayList<>();
|
||||
public static List<String> semiDisposableBlocks = new ArrayList<>();
|
||||
public static final Map<String, Brew> brewMap = new LinkedHashMap<>();
|
||||
|
||||
public static List<RecipePetals> petalRecipes = new ArrayList<>();
|
||||
public static List<RecipePureDaisy> pureDaisyRecipes = new ArrayList<>();
|
||||
public static List<RecipeManaInfusion> manaInfusionRecipes = new ArrayList<>();
|
||||
public static List<RecipeRuneAltar> runeAltarRecipes = new ArrayList<>();
|
||||
public static List<RecipeElvenTrade> elvenTradeRecipes = new ArrayList<>();
|
||||
public static List<RecipeBrew> brewRecipes = new ArrayList<>();
|
||||
public static List<RecipeManaInfusion> miniFlowerRecipes = new ArrayList<>();
|
||||
public static final List<String> disposableBlocks = new ArrayList<>();
|
||||
public static final List<String> semiDisposableBlocks = new ArrayList<>();
|
||||
|
||||
private static BiMap<String, Class<? extends SubTileEntity>> subTiles = HashBiMap.<String, Class<? extends SubTileEntity>> create();
|
||||
private static Map<Class<? extends SubTileEntity>, SubTileSignature> subTileSignatures = new HashMap<>();
|
||||
public static Set<String> subtilesForCreativeMenu = new LinkedHashSet<>();
|
||||
public static Map<String, String> subTileMods = new HashMap<>();
|
||||
public static BiMap<String, String> miniFlowers = HashBiMap.<String, String> create();
|
||||
public static final List<RecipePetals> petalRecipes = new ArrayList<>();
|
||||
public static final List<RecipePureDaisy> pureDaisyRecipes = new ArrayList<>();
|
||||
public static final List<RecipeManaInfusion> manaInfusionRecipes = new ArrayList<>();
|
||||
public static final List<RecipeRuneAltar> runeAltarRecipes = new ArrayList<>();
|
||||
public static final List<RecipeElvenTrade> elvenTradeRecipes = new ArrayList<>();
|
||||
public static final List<RecipeBrew> brewRecipes = new ArrayList<>();
|
||||
public static final List<RecipeManaInfusion> miniFlowerRecipes = new ArrayList<>();
|
||||
|
||||
public static Map<String, Integer> oreWeights = new HashMap<>();
|
||||
public static Map<String, Integer> oreWeightsNether = new HashMap<>();
|
||||
public static Map<Item, Block> seeds = new HashMap<>();
|
||||
private static final BiMap<String, Class<? extends SubTileEntity>> subTiles = HashBiMap.create();
|
||||
private static final Map<Class<? extends SubTileEntity>, SubTileSignature> subTileSignatures = new HashMap<>();
|
||||
public static final Set<String> subtilesForCreativeMenu = new LinkedHashSet<>();
|
||||
public static final Map<String, String> subTileMods = new HashMap<>();
|
||||
public static final BiMap<String, String> miniFlowers = HashBiMap.create();
|
||||
|
||||
public static Set<Item> looniumBlacklist = new LinkedHashSet<>();
|
||||
public static Map<Block, PropertyEnum<EnumDyeColor>> paintableBlocks = new LinkedHashMap<>();
|
||||
public static Set<String> magnetBlacklist = new LinkedHashSet<>();
|
||||
public static Set<Class<? extends Entity>> gravityRodBlacklist = new LinkedHashSet<>();
|
||||
public static final Map<String, Integer> oreWeights = new HashMap<>();
|
||||
public static final Map<String, Integer> oreWeightsNether = new HashMap<>();
|
||||
public static final Map<Item, Block> seeds = new HashMap<>();
|
||||
|
||||
public static final Set<Item> looniumBlacklist = new LinkedHashSet<>();
|
||||
public static final Map<Block, PropertyEnum<EnumDyeColor>> paintableBlocks = new LinkedHashMap<>();
|
||||
public static final Set<String> magnetBlacklist = new LinkedHashSet<>();
|
||||
public static final Set<Class<? extends Entity>> gravityRodBlacklist = new LinkedHashSet<>();
|
||||
|
||||
|
||||
public static ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", "manasteel", 16, new int[] { 2, 6, 5, 2 }, 18);
|
||||
public static ToolMaterial manasteelToolMaterial = EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20);
|
||||
public static final ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", "manasteel", 16,
|
||||
new int[] { 2, 6, 5, 2 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0);
|
||||
public static final ToolMaterial manasteelToolMaterial = EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20);
|
||||
|
||||
public static ArmorMaterial elementiumArmorMaterial = EnumHelper.addArmorMaterial("B_ELEMENTIUM", "b_elementium", 18, new int[] { 2, 6, 5, 2 }, 18);
|
||||
public static ToolMaterial elementiumToolMaterial = EnumHelper.addToolMaterial("B_ELEMENTIUM", 3, 720, 6.2F, 2F, 20);
|
||||
public static final ArmorMaterial elementiumArmorMaterial = EnumHelper.addArmorMaterial("B_ELEMENTIUM", "b_elementium", 18,
|
||||
new int[] { 2, 6, 5, 2 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0);
|
||||
public static final ToolMaterial elementiumToolMaterial = EnumHelper.addToolMaterial("B_ELEMENTIUM", 3, 720, 6.2F, 2F, 20);
|
||||
|
||||
public static ArmorMaterial terrasteelArmorMaterial = EnumHelper.addArmorMaterial("TERRASTEEL", "terrasteel", 34, new int[] {3, 8, 6, 3}, 26);
|
||||
public static ToolMaterial terrasteelToolMaterial = EnumHelper.addToolMaterial("TERRASTEEL", 4, 2300, 9F, 3F, 26);
|
||||
public static final ArmorMaterial terrasteelArmorMaterial = EnumHelper.addArmorMaterial("TERRASTEEL", "terrasteel", 34,
|
||||
new int[] { 3, 8, 6, 3 }, 26, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 3F);
|
||||
public static final ToolMaterial terrasteelToolMaterial = EnumHelper.addToolMaterial("TERRASTEEL", 4, 2300, 9F, 3F, 26);
|
||||
|
||||
public static ArmorMaterial manaweaveArmorMaterial = EnumHelper.addArmorMaterial("MANAWEAVE", "manaweave", 5, new int[] { 1, 2, 2, 1 }, 18);
|
||||
public static final ArmorMaterial manaweaveArmorMaterial = EnumHelper.addArmorMaterial("MANAWEAVE", "manaweave", 5,
|
||||
new int[] { 1, 2, 2, 1 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, 0);
|
||||
|
||||
public static EnumRarity rarityRelic = EnumHelper.addRarity("RELIC", EnumChatFormatting.GOLD, "Relic");
|
||||
public static final EnumRarity rarityRelic = EnumHelper.addRarity("RELIC", TextFormatting.GOLD, "Relic");
|
||||
|
||||
public static KnowledgeType basicKnowledge;
|
||||
public static KnowledgeType elvenKnowledge;
|
||||
public static final KnowledgeType basicKnowledge;
|
||||
public static final KnowledgeType elvenKnowledge;
|
||||
|
||||
// This is here for completeness sake, but you shouldn't use it
|
||||
public static KnowledgeType relicKnowledge;
|
||||
public static final KnowledgeType relicKnowledge;
|
||||
|
||||
// All of these categories are initialized during botania's PreInit stage.
|
||||
public static LexiconCategory categoryBasics;
|
||||
@@ -134,14 +138,14 @@ public final class BotaniaAPI {
|
||||
public static LexiconCategory categoryAlfhomancy;
|
||||
public static LexiconCategory categoryMisc;
|
||||
|
||||
public static Brew fallbackBrew = new Brew("fallback", "botania.brew.fallback", 0, 0);
|
||||
public static final Brew fallbackBrew = new Brew("fallback", "botania.brew.fallback", 0, 0);
|
||||
|
||||
static {
|
||||
registerSubTile("", DummySubTile.class);
|
||||
|
||||
basicKnowledge = registerKnowledgeType("minecraft", EnumChatFormatting.RESET, true);
|
||||
elvenKnowledge = registerKnowledgeType("alfheim", EnumChatFormatting.DARK_GREEN, false);
|
||||
relicKnowledge = registerKnowledgeType("relic", EnumChatFormatting.DARK_PURPLE, false);
|
||||
basicKnowledge = registerKnowledgeType("minecraft", TextFormatting.RESET, true);
|
||||
elvenKnowledge = registerKnowledgeType("alfheim", TextFormatting.DARK_GREEN, false);
|
||||
relicKnowledge = registerKnowledgeType("relic", TextFormatting.DARK_PURPLE, false);
|
||||
|
||||
addOreWeight("oreAluminum", 3940); // Tinkers' Construct
|
||||
addOreWeight("oreAmber", 2075); // Thaumcraft
|
||||
@@ -212,12 +216,12 @@ public final class BotaniaAPI {
|
||||
addOreWeightNether("oreOnyx", 500); // SimpleOres 2
|
||||
addOreWeightNether("oreHaditeCoal", 500); // Hadite
|
||||
|
||||
addSeed(Items.wheat_seeds, Blocks.wheat);
|
||||
addSeed(Items.potato, Blocks.potatoes);
|
||||
addSeed(Items.carrot, Blocks.carrots);
|
||||
addSeed(Items.nether_wart, Blocks.nether_wart);
|
||||
addSeed(Items.pumpkin_seeds, Blocks.pumpkin_stem);
|
||||
addSeed(Items.melon_seeds, Blocks.melon_stem);
|
||||
addSeed(Items.WHEAT_SEEDS, Blocks.WHEAT);
|
||||
addSeed(Items.POTATO, Blocks.POTATOES);
|
||||
addSeed(Items.CARROT, Blocks.CARROTS);
|
||||
addSeed(Items.NETHER_WART, Blocks.NETHER_WART);
|
||||
addSeed(Items.PUMPKIN_SEEDS, Blocks.PUMPKIN_STEM);
|
||||
addSeed(Items.MELON_SEEDS, Blocks.MELON_STEM);
|
||||
|
||||
registerModWiki("Minecraft", new SimpleWikiProvider("Minecraft Wiki", "http://minecraft.gamepedia.com/%s"));
|
||||
|
||||
@@ -247,12 +251,12 @@ public final class BotaniaAPI {
|
||||
registerModWiki("GanysNether", new SimpleWikiProvider("Gany's Nether Wiki", "http://ganys-nether.wikia.com/wiki/%s"));
|
||||
registerModWiki("GanysEnd", new SimpleWikiProvider("Gany's End Wiki", "http://ganys-end.wikia.com/wiki/%s"));
|
||||
|
||||
registerPaintableBlock(Blocks.stained_glass, BlockStainedGlass.COLOR);
|
||||
registerPaintableBlock(Blocks.stained_glass_pane, BlockStainedGlassPane.COLOR);
|
||||
registerPaintableBlock(Blocks.stained_hardened_clay, BlockColored.COLOR);
|
||||
registerPaintableBlock(Blocks.wool, BlockColored.COLOR);
|
||||
registerPaintableBlock(Blocks.carpet, BlockCarpet.COLOR);
|
||||
|
||||
registerPaintableBlock(Blocks.STAINED_GLASS, BlockStainedGlass.COLOR);
|
||||
registerPaintableBlock(Blocks.STAINED_GLASS_PANE, BlockStainedGlassPane.COLOR);
|
||||
registerPaintableBlock(Blocks.STAINED_HARDENED_CLAY, BlockColored.COLOR);
|
||||
registerPaintableBlock(Blocks.WOOL, BlockColored.COLOR);
|
||||
registerPaintableBlock(Blocks.CARPET, BlockCarpet.COLOR);
|
||||
|
||||
registerDisposableBlock("dirt"); // Vanilla
|
||||
registerDisposableBlock("sand"); // Vanilla
|
||||
registerDisposableBlock("gravel"); // Vanilla
|
||||
@@ -277,7 +281,7 @@ public final class BotaniaAPI {
|
||||
* @param id The ID for this knowledge type.
|
||||
* @param color The color to display this knowledge type as.
|
||||
*/
|
||||
public static KnowledgeType registerKnowledgeType(String id, EnumChatFormatting color, boolean autoUnlock) {
|
||||
public static KnowledgeType registerKnowledgeType(String id, TextFormatting color, boolean autoUnlock) {
|
||||
KnowledgeType type = new KnowledgeType(id, color, autoUnlock);
|
||||
knowledgeTypes.put(id, type);
|
||||
return type;
|
||||
@@ -307,7 +311,7 @@ public final class BotaniaAPI {
|
||||
public static void registerDisposableBlock(String oreDictName) {
|
||||
disposableBlocks.add(oreDictName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Registers a Block as semi disposable using its Ore Dictionary Name.
|
||||
* This means it will not be trashed when sneaking.
|
||||
@@ -315,7 +319,7 @@ public final class BotaniaAPI {
|
||||
public static void registerSemiDisposableBlock(String oreDictName) {
|
||||
semiDisposableBlocks.add(oreDictName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Registers a paintableBlock and returns it.
|
||||
* You must also provide the PropertyEnum that this block uses to express its color
|
||||
@@ -332,7 +336,7 @@ public final class BotaniaAPI {
|
||||
public static void blacklistEntityFromGravityRod(Class<? extends Entity> entity) {
|
||||
gravityRodBlacklist.add(entity);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the provided Entity is contained in the Blacklist.
|
||||
* Pass in the class for the Entity, e.g. entity.getClass()
|
||||
@@ -340,7 +344,7 @@ public final class BotaniaAPI {
|
||||
public static boolean isEntityBlacklistedFromGravityRod(Class entity) {
|
||||
return gravityRodBlacklist.contains(entity);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Blacklists an item from being pulled by the Ring of Magnetization.
|
||||
* Short.MAX_VALUE can be used as the stack's damage for a wildcard.
|
||||
@@ -362,11 +366,11 @@ public final class BotaniaAPI {
|
||||
public static boolean isItemBlacklistedFromMagnet(ItemStack stack) {
|
||||
return isItemBlacklistedFromMagnet(stack, 0);
|
||||
}
|
||||
|
||||
|
||||
public static boolean isItemBlacklistedFromMagnet(ItemStack stack, int recursion) {
|
||||
if(recursion > 5)
|
||||
return false;
|
||||
|
||||
|
||||
if(stack.getItemDamage() != Short.MAX_VALUE) {
|
||||
ItemStack copy = new ItemStack(stack.getItem(), 0, Short.MAX_VALUE);
|
||||
boolean general = isItemBlacklistedFromMagnet(copy, recursion + 1);
|
||||
@@ -389,7 +393,7 @@ public final class BotaniaAPI {
|
||||
public static boolean isBlockBlacklistedFromMagnet(Block block, int meta, int recursion) {
|
||||
if(recursion >= 5)
|
||||
return false;
|
||||
|
||||
|
||||
if(meta != Short.MAX_VALUE) {
|
||||
boolean general = isBlockBlacklistedFromMagnet(block, Short.MAX_VALUE, recursion + 1);
|
||||
if(general)
|
||||
@@ -474,7 +478,7 @@ public final class BotaniaAPI {
|
||||
*/
|
||||
public static RecipeManaInfusion registerManaAlchemyRecipe(ItemStack output, Object input, int mana) {
|
||||
RecipeManaInfusion recipe = registerManaInfusionRecipe(output, input, mana);
|
||||
recipe.setAlchemy(true);
|
||||
recipe.setCatalyst(RecipeManaInfusion.alchemyState);
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@@ -485,7 +489,7 @@ public final class BotaniaAPI {
|
||||
*/
|
||||
public static RecipeManaInfusion registerManaConjurationRecipe(ItemStack output, Object input, int mana) {
|
||||
RecipeManaInfusion recipe = registerManaInfusionRecipe(output, input, mana);
|
||||
recipe.setConjuration(true);
|
||||
recipe.setCatalyst(RecipeManaInfusion.conjurationState);
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@@ -504,7 +508,7 @@ public final class BotaniaAPI {
|
||||
/**
|
||||
* Registers a Brew Recipe (for the Botanical Brewery).
|
||||
* @param brew The brew in to be set in this recipe.
|
||||
* @inputs The items used in the recipe, no more than 6.
|
||||
* @param inputs The items used in the recipe, no more than 6.
|
||||
*/
|
||||
public static RecipeBrew registerBrewRecipe(Brew brew, Object... inputs) {
|
||||
Preconditions.checkArgument(inputs.length <= 6);
|
||||
|
||||
@@ -10,7 +10,7 @@ package vazkii.botania.api;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Maps;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.LoaderState;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
@@ -10,23 +10,19 @@
|
||||
*/
|
||||
package vazkii.botania.api.boss;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.entity.boss.IBossDisplayData;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.internal.ShaderCallback;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* An extension of IBossDisplayData. This counts as a botania boss and as a normal
|
||||
* minecraft boss since it has IBossDisplayData. Instead of using the typical
|
||||
* BossStatus.setBossStatus(entity, true) to set the health bar in the render use
|
||||
* BotaniaAPI.internalMethodHandler.setBossStatus(entity);<br><br>
|
||||
* Alternatively, you can check if botania is loaded and use the vanilla one
|
||||
* if that's not the case.
|
||||
* A Botania boss, that is subject to special rendering.
|
||||
*/
|
||||
public interface IBotaniaBoss extends IBossDisplayData {
|
||||
public interface IBotaniaBoss {
|
||||
|
||||
/**
|
||||
* The ResourceLocation to bind for this boss's boss bar.
|
||||
@@ -51,9 +47,35 @@ public interface IBotaniaBoss extends IBossDisplayData {
|
||||
public Rectangle getBossBarHPTextureRect();
|
||||
|
||||
/**
|
||||
* A callback for when this boss's boss bar renders, you can do aditional rendering
|
||||
* A callback for when this boss's boss bar renders, you can do additional rendering
|
||||
* here if needed.
|
||||
* @return How tall your auxiliary renders were
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void bossBarRenderCallback(ScaledResolution res, int x, int y);
|
||||
public int bossBarRenderCallback(ScaledResolution res, int x, int y);
|
||||
|
||||
/**
|
||||
* Get the serverside UUID of the {@link net.minecraft.world.BossInfoServer} instance tracking this boss
|
||||
* Note that this is NOT the entity's UUID, nor is it the clientside UUID of the BossInfoServer instance!
|
||||
* You will most likely need to sync this yourself using the datawatcher
|
||||
* @return The uuid.
|
||||
*/
|
||||
public UUID getBossInfoUuid();
|
||||
|
||||
/**
|
||||
* The Shader Program to use for this boss's bar. Return 0 case
|
||||
* you don't want a shader to be used. You can use separate shaders
|
||||
* for the background and foreground.
|
||||
* @param background True if rendering the background of the boss bar,
|
||||
* false if rendering the bar itself that shows the HP.
|
||||
* @return OpenGL program ID of the shader to use
|
||||
*/
|
||||
public int getBossBarShaderProgram(boolean background);
|
||||
|
||||
/**
|
||||
* A callback for the shader, used to pass in uniforms. Return null for no callback.
|
||||
* @return a ShaderCallback to use. If getBossBarShaderProgram returns an invalid shader the result of this method is ignored.
|
||||
*/
|
||||
public ShaderCallback getBossBarShaderCallback(boolean background, int shader);
|
||||
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Oct 29, 2014, 6:13:21 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.api.boss;
|
||||
|
||||
import vazkii.botania.api.internal.ShaderCallback;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* A Botania boss whose HP bar makes use of shaders. Shaders
|
||||
* used through this have a few uniforms available:
|
||||
* <li><b><i>int</i> time</b> - The amount of total ticks elapsed.</li>
|
||||
* <li><b><i>int</i> startX</b> - The U coordinate passed in for the render of this bar's texture.</li>
|
||||
* <li><b><i>int</i> startY</b> - The V coordinate passed in for the render of this bar's texture.</li>
|
||||
*/
|
||||
public interface IBotaniaBossWithShader extends IBotaniaBoss {
|
||||
|
||||
/**
|
||||
* The Shader Program to use for this boss bar. Return 0 case
|
||||
* you don't want a shader to be used. You can use separate shaders
|
||||
* for the background and foreground.
|
||||
* @param background True if rendering the background of the boss bar,
|
||||
* false if rendering the bar itself that shows the HP.
|
||||
*/
|
||||
public int getBossBarShaderProgram(boolean background);
|
||||
|
||||
/**
|
||||
* A callback for the shader, used to pass in uniforms. Return null for no callback.
|
||||
*/
|
||||
public ShaderCallback getBossBarShaderCallback(boolean background, int shader);
|
||||
|
||||
}
|
||||
@@ -10,15 +10,12 @@
|
||||
*/
|
||||
package vazkii.botania.api.brew;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The class for a Brew definition, each one is a singleton.
|
||||
*/
|
||||
@@ -28,9 +25,9 @@ public class Brew {
|
||||
private final String name;
|
||||
private final int color;
|
||||
private final int cost;
|
||||
private final List<PotionEffectShim> effects;
|
||||
boolean canInfuseBloodPendant = true;
|
||||
boolean canInfuseIncense = true;
|
||||
private final List<PotionEffect> effects;
|
||||
private boolean canInfuseBloodPendant = true;
|
||||
private boolean canInfuseIncense = true;
|
||||
|
||||
/**
|
||||
* @param name The unlocalized name of this potion.
|
||||
@@ -39,7 +36,7 @@ public class Brew {
|
||||
* @param cost The cost, in Mana for this brew.
|
||||
* @param effects A list of effects to apply to the player when they drink it.
|
||||
*/
|
||||
public Brew(String key, String name, int color, int cost, PotionEffectShim... effects) {
|
||||
public Brew(String key, String name, int color, int cost, PotionEffect... effects) {
|
||||
this.key = key;
|
||||
this.name = name;
|
||||
this.color = color;
|
||||
@@ -116,23 +113,13 @@ public class Brew {
|
||||
return getManaCost();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the PotionEffectShim's that this brew has.
|
||||
*/
|
||||
public List<PotionEffectShim> getPotionEffectsShim(ItemStack stack) {
|
||||
return effects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of vanilla PotionEffects for the ItemStack passed in.
|
||||
* Note that for the lexicon, this passes in a botania Managlass
|
||||
* Vial or an Alfglass Flask at all times.
|
||||
*/
|
||||
public List<PotionEffect> getPotionEffects(ItemStack stack) {
|
||||
List<PotionEffect> ret = new ArrayList<>();
|
||||
for(PotionEffectShim s : getPotionEffectsShim(stack))
|
||||
ret.add(s.toVanilla());
|
||||
return ret;
|
||||
return effects;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package vazkii.botania.api.brew;
|
||||
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraftforge.fml.common.registry.GameData;
|
||||
|
||||
// Version of PotionEffect that doesn't use number ID's
|
||||
// See https://github.com/MinecraftForge/MinecraftForge/issues/2374
|
||||
// todo 1.9 remove?
|
||||
public class PotionEffectShim {
|
||||
|
||||
public final Potion potion;
|
||||
public final int duration;
|
||||
public final int amplifier;
|
||||
|
||||
public PotionEffectShim(Potion potion, int duration, int amplifier) {
|
||||
this.potion = potion;
|
||||
this.duration = duration;
|
||||
this.amplifier = amplifier;
|
||||
}
|
||||
|
||||
public PotionEffect toVanilla() {
|
||||
return new PotionEffect(GameData.getPotionRegistry().getId(potion), duration, amplifier, true, true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,6 +9,18 @@
|
||||
* File Created @ [Feb 14, 2015, 3:28:54 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.api.corporea;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -16,31 +28,15 @@ import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
|
||||
public final class CorporeaHelper {
|
||||
|
||||
private static final List<IInventory> empty = ImmutableList.of();
|
||||
private static final WeakHashMap<List<ICorporeaSpark>, List<IInventory>> cachedNetworks = new WeakHashMap<>();
|
||||
private static final List<InvWithLocation> empty = ImmutableList.of();
|
||||
private static final WeakHashMap<List<ICorporeaSpark>, List<InvWithLocation>> cachedNetworks = new WeakHashMap<>();
|
||||
private static final List<ICorporeaAutoCompleteController> autoCompleteControllers = new ArrayList<>();
|
||||
|
||||
private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]");
|
||||
|
||||
public static final String[] WILDCARD_STRINGS = new String[] {
|
||||
"...", "~", "+", "?" , "*"
|
||||
};
|
||||
public static final String[] WILDCARD_STRINGS = { "...", "~", "+", "?" , "*" };
|
||||
|
||||
/**
|
||||
* How many items were matched in the last request. If java had "out" params like C# this wouldn't be needed :V
|
||||
@@ -55,23 +51,23 @@ public final class CorporeaHelper {
|
||||
* Gets a list of all the inventories on this spark network. This list is cached for use once every tick,
|
||||
* and if something changes during that tick it'll still have the first result.
|
||||
*/
|
||||
public static List<IInventory> getInventoriesOnNetwork(ICorporeaSpark spark) {
|
||||
public static List<InvWithLocation> getInventoriesOnNetwork(ICorporeaSpark spark) {
|
||||
ICorporeaSpark master = spark.getMaster();
|
||||
if(master == null)
|
||||
return empty;
|
||||
List<ICorporeaSpark> network = master.getConnections();
|
||||
|
||||
if(cachedNetworks.containsKey(network)) {
|
||||
List<IInventory> cache = cachedNetworks.get(network);
|
||||
List<InvWithLocation> cache = cachedNetworks.get(network);
|
||||
if(cache != null)
|
||||
return cache;
|
||||
}
|
||||
|
||||
List<IInventory> inventories = new ArrayList<>();
|
||||
List<InvWithLocation> inventories = new ArrayList<>();
|
||||
if(network != null)
|
||||
for(ICorporeaSpark otherSpark : network)
|
||||
if(otherSpark != null) {
|
||||
IInventory inv = otherSpark.getSparkInventory();
|
||||
InvWithLocation inv = otherSpark.getSparkInventory();
|
||||
if(inv != null)
|
||||
inventories.add(inv);
|
||||
}
|
||||
@@ -86,7 +82,7 @@ public final class CorporeaHelper {
|
||||
* called instead if the context for those exists to avoid having to get the values again.
|
||||
*/
|
||||
public static int getCountInNetwork(ItemStack stack, ICorporeaSpark spark, boolean checkNBT) {
|
||||
List<IInventory> inventories = getInventoriesOnNetwork(spark);
|
||||
List<InvWithLocation> inventories = getInventoriesOnNetwork(spark);
|
||||
return getCountInNetwork(stack, inventories, checkNBT);
|
||||
}
|
||||
|
||||
@@ -95,18 +91,18 @@ public final class CorporeaHelper {
|
||||
* The higher level function that use a Map< IInventory, Integer > should be
|
||||
* called instead if the context for this exists to avoid having to get the value again.
|
||||
*/
|
||||
public static int getCountInNetwork(ItemStack stack, List<IInventory> inventories, boolean checkNBT) {
|
||||
Map<IInventory, Integer> map = getInventoriesWithItemInNetwork(stack, inventories, checkNBT);
|
||||
public static int getCountInNetwork(ItemStack stack, List<InvWithLocation> inventories, boolean checkNBT) {
|
||||
Map<InvWithLocation, Integer> map = getInventoriesWithItemInNetwork(stack, inventories, checkNBT);
|
||||
return getCountInNetwork(stack, map, checkNBT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the amount of available items in the network of the type passed in, checking NBT or not.
|
||||
*/
|
||||
public static int getCountInNetwork(ItemStack stack, Map<IInventory, Integer> inventories, boolean checkNBT) {
|
||||
public static int getCountInNetwork(ItemStack stack, Map<InvWithLocation, Integer> inventories, boolean checkNBT) {
|
||||
int count = 0;
|
||||
|
||||
for(IInventory inv : inventories.keySet())
|
||||
for(InvWithLocation inv : inventories.keySet())
|
||||
count += inventories.get(inv);
|
||||
|
||||
return count;
|
||||
@@ -117,8 +113,8 @@ public final class CorporeaHelper {
|
||||
* The higher level function that use a List< IInventory > should be
|
||||
* called instead if the context for this exists to avoid having to get the value again.
|
||||
*/
|
||||
public static Map<IInventory, Integer> getInventoriesWithItemInNetwork(ItemStack stack, ICorporeaSpark spark, boolean checkNBT) {
|
||||
List<IInventory> inventories = getInventoriesOnNetwork(spark);
|
||||
public static Map<InvWithLocation, Integer> getInventoriesWithItemInNetwork(ItemStack stack, ICorporeaSpark spark, boolean checkNBT) {
|
||||
List<InvWithLocation> inventories = getInventoriesOnNetwork(spark);
|
||||
return getInventoriesWithItemInNetwork(stack, inventories, checkNBT);
|
||||
}
|
||||
|
||||
@@ -127,8 +123,8 @@ public final class CorporeaHelper {
|
||||
* The deeper level function that use a List< IInventory > should be
|
||||
* called instead if the context for this exists to avoid having to get the value again.
|
||||
*/
|
||||
public static Map<IInventory, Integer> getInventoriesWithItemInNetwork(ItemStack stack,List<IInventory> inventories, boolean checkNBT) {
|
||||
Map<IInventory, Integer> countMap = new HashMap<IInventory, Integer>();
|
||||
public static Map<InvWithLocation, Integer> getInventoriesWithItemInNetwork(ItemStack stack, List<InvWithLocation> inventories, boolean checkNBT) {
|
||||
Map<InvWithLocation, Integer> countMap = new HashMap<>();
|
||||
List<IWrappedInventory> wrappedInventories = BotaniaAPI.internalHandler.wrapInventory(inventories);
|
||||
for (IWrappedInventory inv : wrappedInventories) {
|
||||
CorporeaRequest request = new CorporeaRequest(stack, checkNBT, -1);
|
||||
@@ -174,7 +170,7 @@ public final class CorporeaHelper {
|
||||
if(MinecraftForge.EVENT_BUS.post(event))
|
||||
return stacks;
|
||||
|
||||
List<IInventory> inventories = getInventoriesOnNetwork(spark);
|
||||
List<InvWithLocation> inventories = getInventoriesOnNetwork(spark);
|
||||
|
||||
List<IWrappedInventory> inventoriesW = BotaniaAPI.internalHandler.wrapInventory(inventories);
|
||||
Map<ICorporeaInterceptor, ICorporeaSpark> interceptors = new HashMap<ICorporeaInterceptor, ICorporeaSpark>();
|
||||
@@ -183,9 +179,9 @@ public final class CorporeaHelper {
|
||||
for(IWrappedInventory inv : inventoriesW) {
|
||||
ICorporeaSpark invSpark = inv.getSpark();
|
||||
|
||||
Object originalInventory = inv.getWrappedObject();
|
||||
if(originalInventory instanceof ICorporeaInterceptor) {
|
||||
ICorporeaInterceptor interceptor = (ICorporeaInterceptor) originalInventory;
|
||||
InvWithLocation originalInventory = inv.getWrappedObject();
|
||||
if(originalInventory.world.getTileEntity(originalInventory.pos) instanceof ICorporeaInterceptor) {
|
||||
ICorporeaInterceptor interceptor = (ICorporeaInterceptor) originalInventory.world.getTileEntity(originalInventory.pos);
|
||||
interceptor.interceptRequest(matcher, itemCount, invSpark, spark, stacks, inventories, doit);
|
||||
interceptors.put(interceptor, invSpark);
|
||||
}
|
||||
@@ -209,11 +205,8 @@ public final class CorporeaHelper {
|
||||
/**
|
||||
* Gets the spark attached to the inventory passed case it's a TileEntity.
|
||||
*/
|
||||
public static ICorporeaSpark getSparkForInventory(IInventory inv) {
|
||||
if(!(inv instanceof TileEntity))
|
||||
return null;
|
||||
|
||||
TileEntity tile = (TileEntity) inv;
|
||||
public static ICorporeaSpark getSparkForInventory(InvWithLocation inv) {
|
||||
TileEntity tile = inv.world.getTileEntity(inv.pos);
|
||||
return getSparkForBlock(tile.getWorld(), tile.getPos());
|
||||
}
|
||||
|
||||
@@ -234,13 +227,6 @@ public final class CorporeaHelper {
|
||||
return getSparkForBlock(world, pos) != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets if the slot passed in can be extracted from by a spark.
|
||||
*/
|
||||
public static boolean isValidSlot(IInventory inv, int slot) {
|
||||
return !(inv instanceof ISidedInventory) || arrayHas(((ISidedInventory) inv).getSlotsForFace(EnumFacing.UP), slot) && ((ISidedInventory) inv).canExtractItem(slot, inv.getStackInSlot(slot), EnumFacing.UP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets if two stacks match.
|
||||
*/
|
||||
@@ -283,17 +269,6 @@ public final class CorporeaHelper {
|
||||
cachedNetworks.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to check if an int array contains an int.
|
||||
*/
|
||||
public static boolean arrayHas(int[] arr, int val) {
|
||||
for (int element : arr)
|
||||
if(element == val)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to make stacksMatch() less messy.
|
||||
*/
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
package vazkii.botania.api.corporea;
|
||||
|
||||
public class CorporeaRequest {
|
||||
public Object matcher;
|
||||
public boolean checkNBT;
|
||||
public final Object matcher;
|
||||
public final boolean checkNBT;
|
||||
public int count;
|
||||
public int foundItems = 0;
|
||||
public int extractedItems = 0;
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
*/
|
||||
package vazkii.botania.api.corporea;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* An interface for systems which may control if the item auto complete system should be active
|
||||
*/
|
||||
|
||||
@@ -10,11 +10,10 @@
|
||||
*/
|
||||
package vazkii.botania.api.corporea;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A TileEntity that implements this will be able to intercept corporea
|
||||
* requests case there is a Corporea Spark on top.
|
||||
@@ -26,13 +25,13 @@ public interface ICorporeaInterceptor {
|
||||
* at this point, but the list of stacks is not complete. The request parameter can
|
||||
* be either a String or ItemStack.
|
||||
*/
|
||||
public void interceptRequest(Object request, int count, ICorporeaSpark spark, ICorporeaSpark source, List<ItemStack> stacks, List<IInventory> inventories, boolean doit);
|
||||
public void interceptRequest(Object request, int count, ICorporeaSpark spark, ICorporeaSpark source, List<ItemStack> stacks, List<InvWithLocation> inventories, boolean doit);
|
||||
|
||||
/**
|
||||
* Intercepts a request after all the stacks have been found and processed. Both the
|
||||
* list of inventories and stacks is complete at this point. The request parameter can
|
||||
* be either a String or ItemStack.
|
||||
*/
|
||||
public void interceptRequestLast(Object request, int count, ICorporeaSpark spark, ICorporeaSpark source, List<ItemStack> stacks, List<IInventory> inventories, boolean doit);
|
||||
public void interceptRequestLast(Object request, int count, ICorporeaSpark spark, ICorporeaSpark source, List<ItemStack> stacks, List<InvWithLocation> inventories, boolean doit);
|
||||
|
||||
}
|
||||
@@ -10,11 +10,11 @@
|
||||
*/
|
||||
package vazkii.botania.api.corporea;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* An interface for a Corporea Spark. Includes functions for handling
|
||||
* connections.
|
||||
@@ -38,7 +38,7 @@ public interface ICorporeaSpark {
|
||||
/**
|
||||
* Gets the inventory this spark is bound to, generally the one right below it.
|
||||
*/
|
||||
public IInventory getSparkInventory();
|
||||
public InvWithLocation getSparkInventory();
|
||||
|
||||
/**
|
||||
* Gets the list of sparks this spark is connected to, see registerConnections(). This list
|
||||
@@ -82,6 +82,6 @@ public interface ICorporeaSpark {
|
||||
* Gets the network that this spark is on, or the color it's displaying. Sparks may only connect to others
|
||||
* of the same network, and on changing network should trigger a re-cache of the previous network.
|
||||
*/
|
||||
public int getNetwork();
|
||||
public EnumDyeColor getNetwork();
|
||||
|
||||
}
|
||||
@@ -9,11 +9,10 @@
|
||||
*/
|
||||
package vazkii.botania.api.corporea;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This interface wraps IInventory corporea works with in order to provide
|
||||
* compatibility with different storage mods.
|
||||
@@ -24,7 +23,7 @@ public interface IWrappedInventory {
|
||||
/**
|
||||
* Break encapsulation and exposes original inventory.
|
||||
*/
|
||||
IInventory getWrappedObject();
|
||||
InvWithLocation getWrappedObject();
|
||||
|
||||
/**
|
||||
* Counts items in the inventory matching the request
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package vazkii.botania.api.corporea;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
public class InvWithLocation {
|
||||
|
||||
public final IItemHandler handler;
|
||||
public final World world;
|
||||
public final BlockPos pos;
|
||||
|
||||
public InvWithLocation(IItemHandler itemHandler, World world, BlockPos pos) {
|
||||
this.handler = itemHandler;
|
||||
this.world = world;
|
||||
this.pos = pos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 31 * handler.hashCode() ^ world.hashCode() ^ pos.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof InvWithLocation
|
||||
&& handler.equals(((InvWithLocation) o).handler)
|
||||
&& world == ((InvWithLocation) o).world
|
||||
&& pos.equals(((InvWithLocation) o).pos);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,22 +10,20 @@
|
||||
*/
|
||||
package vazkii.botania.api.internal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.mana.TileSignature;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class DummyManaNetwork implements IManaNetwork {
|
||||
|
||||
public static final DummyManaNetwork instance = new DummyManaNetwork();
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
// NO-OP
|
||||
}
|
||||
public void clear() {}
|
||||
|
||||
@Override
|
||||
public TileEntity getClosestPool(BlockPos pos, World world, int limit) {
|
||||
@@ -38,13 +36,13 @@ public class DummyManaNetwork implements IManaNetwork {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TileSignature> getAllCollectorsInWorld(World world) {
|
||||
return ImmutableList.of();
|
||||
public Set<TileSignature> getAllCollectorsInWorld(World world) {
|
||||
return ImmutableSet.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TileSignature> getAllPoolsInWorld(World world) {
|
||||
return ImmutableList.of();
|
||||
public Set<TileSignature> getAllPoolsInWorld(World world) {
|
||||
return ImmutableSet.of();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,10 +10,8 @@
|
||||
*/
|
||||
package vazkii.botania.api.internal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -22,12 +20,13 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.boss.IBotaniaBoss;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
import vazkii.botania.api.corporea.IWrappedInventory;
|
||||
import vazkii.botania.api.corporea.InvWithLocation;
|
||||
import vazkii.botania.api.lexicon.LexiconPage;
|
||||
import vazkii.botania.api.lexicon.multiblock.MultiblockSet;
|
||||
import vazkii.botania.api.recipe.RecipeBrew;
|
||||
@@ -37,6 +36,8 @@ import vazkii.botania.api.recipe.RecipePetals;
|
||||
import vazkii.botania.api.recipe.RecipeRuneAltar;
|
||||
import vazkii.botania.api.subtile.SubTileEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DummyMethodHandler implements IInternalMethodHandler {
|
||||
|
||||
@Override
|
||||
@@ -120,7 +121,7 @@ public class DummyMethodHandler implements IInternalMethodHandler {
|
||||
|
||||
@Override
|
||||
public ItemStack getSubTileAsStack(String subTile) {
|
||||
return new ItemStack(Blocks.stone, 0, 0);
|
||||
return new ItemStack(Blocks.STONE, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -149,35 +150,32 @@ public class DummyMethodHandler implements IInternalMethodHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res) {
|
||||
// NO-OP
|
||||
}
|
||||
public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res) {}
|
||||
|
||||
@Override
|
||||
public void drawComplexManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res, ItemStack bindDisplay, boolean properlyBound) {
|
||||
// NO-OP
|
||||
}
|
||||
public void drawComplexManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res, ItemStack bindDisplay, boolean properlyBound) {}
|
||||
|
||||
@Override
|
||||
public ItemStack getBindDisplayForFlowerType(SubTileEntity e) {
|
||||
return new ItemStack(Blocks.stone, 0, 0);
|
||||
return new ItemStack(Blocks.STONE, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderLexiconText(int x, int y, int width, int height, String unlocalizedText) {
|
||||
// NO-OP
|
||||
}
|
||||
public void renderLexiconText(int x, int y, int width, int height, String unlocalizedText) {}
|
||||
|
||||
@Override
|
||||
public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m) {
|
||||
// NO-OP
|
||||
}
|
||||
public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m) {}
|
||||
|
||||
@Override
|
||||
public IInventory getBaublesInventory(EntityPlayer player) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemHandlerModifiable getBaublesInventoryWrapped(EntityPlayer player) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldForceCheck() {
|
||||
return true;
|
||||
@@ -193,20 +191,13 @@ public class DummyMethodHandler implements IInternalMethodHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBossStatus(IBotaniaBoss status) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBuildcraftPipe(TileEntity tile) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, BlockPos pos, EnumFacing side) {
|
||||
// NO-OP
|
||||
}
|
||||
public void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, BlockPos pos, EnumFacing side) {}
|
||||
|
||||
@Override
|
||||
public boolean hasSolegnoliaAround(Entity e) {
|
||||
@@ -224,12 +215,10 @@ public class DummyMethodHandler implements IInternalMethodHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendBaubleUpdatePacket(EntityPlayer player, int slot) {
|
||||
// NO-OP
|
||||
}
|
||||
public void sendBaubleUpdatePacket(EntityPlayer player, int slot) {}
|
||||
|
||||
@Override
|
||||
public List<IWrappedInventory> wrapInventory(List<IInventory> inventories) {
|
||||
public List<IWrappedInventory> wrapInventory(List<InvWithLocation> inventories) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
*/
|
||||
package vazkii.botania.api.internal;
|
||||
|
||||
import vazkii.botania.api.lexicon.LexiconPage;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.lexicon.LexiconPage;
|
||||
|
||||
/**
|
||||
* A dummy page. It does absolutely nothing and is only
|
||||
@@ -27,8 +27,6 @@ public class DummyPage extends LexiconPage {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderScreen(IGuiLexiconEntry gui, int x, int y) {
|
||||
// NO-OP
|
||||
}
|
||||
public void renderScreen(IGuiLexiconEntry gui, int x, int y) {}
|
||||
|
||||
}
|
||||
@@ -10,11 +10,11 @@
|
||||
*/
|
||||
package vazkii.botania.api.internal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Internal interface for the Lexicon Entry GUI. This contains
|
||||
* everything that can be accessed from it. It's safe to cast
|
||||
|
||||
@@ -10,10 +10,8 @@
|
||||
*/
|
||||
package vazkii.botania.api.internal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -21,12 +19,15 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.boss.IBotaniaBoss;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
import vazkii.botania.api.corporea.IWrappedInventory;
|
||||
import vazkii.botania.api.corporea.InvWithLocation;
|
||||
import vazkii.botania.api.lexicon.LexiconPage;
|
||||
import vazkii.botania.api.lexicon.multiblock.MultiblockSet;
|
||||
import vazkii.botania.api.recipe.RecipeBrew;
|
||||
@@ -35,8 +36,8 @@ import vazkii.botania.api.recipe.RecipeManaInfusion;
|
||||
import vazkii.botania.api.recipe.RecipePetals;
|
||||
import vazkii.botania.api.recipe.RecipeRuneAltar;
|
||||
import vazkii.botania.api.subtile.SubTileEntity;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Any methods that refer to internal methods in Botania are here.
|
||||
@@ -97,6 +98,8 @@ public interface IInternalMethodHandler {
|
||||
|
||||
public IInventory getBaublesInventory(EntityPlayer player);
|
||||
|
||||
public IItemHandlerModifiable getBaublesInventoryWrapped(EntityPlayer player);
|
||||
|
||||
public void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, BlockPos pos, EnumFacing side);
|
||||
|
||||
public boolean hasSolegnoliaAround(Entity e);
|
||||
@@ -113,8 +116,6 @@ public interface IInternalMethodHandler {
|
||||
|
||||
public ResourceLocation getDefaultBossBarTexture();
|
||||
|
||||
public void setBossStatus(IBotaniaBoss status);
|
||||
|
||||
public boolean isBuildcraftPipe(TileEntity tile);
|
||||
|
||||
public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m);
|
||||
@@ -128,6 +129,6 @@ public interface IInternalMethodHandler {
|
||||
/**
|
||||
* Wrap inventories in the network into wrappers providing compatibility for storage mods.
|
||||
*/
|
||||
List<IWrappedInventory> wrapInventory(List<IInventory> inventories);
|
||||
List<IWrappedInventory> wrapInventory(List<InvWithLocation> inventories);
|
||||
|
||||
}
|
||||
@@ -10,64 +10,64 @@
|
||||
*/
|
||||
package vazkii.botania.api.internal;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Interface for the Mana Burst entity. This can safely be casted to EntityThrowable.
|
||||
*/
|
||||
public interface IManaBurst {
|
||||
|
||||
public boolean isFake();
|
||||
boolean isFake();
|
||||
|
||||
public void setMotion(double x, double y, double z);
|
||||
void setMotion(double x, double y, double z);
|
||||
|
||||
public int getColor();
|
||||
int getColor();
|
||||
|
||||
public void setColor(int color);
|
||||
void setColor(int color);
|
||||
|
||||
public int getMana();
|
||||
int getMana();
|
||||
|
||||
public void setMana(int mana);
|
||||
void setMana(int mana);
|
||||
|
||||
public int getStartingMana();
|
||||
int getStartingMana();
|
||||
|
||||
public void setStartingMana(int mana);
|
||||
void setStartingMana(int mana);
|
||||
|
||||
public int getMinManaLoss();
|
||||
int getMinManaLoss();
|
||||
|
||||
public void setMinManaLoss(int minManaLoss);
|
||||
void setMinManaLoss(int minManaLoss);
|
||||
|
||||
public float getManaLossPerTick();
|
||||
float getManaLossPerTick();
|
||||
|
||||
public void setManaLossPerTick(float mana);
|
||||
void setManaLossPerTick(float mana);
|
||||
|
||||
public float getGravity();
|
||||
float getGravity();
|
||||
|
||||
public void setGravity(float gravity);
|
||||
void setGravity(float gravity);
|
||||
|
||||
public BlockPos getBurstSourceBlockPos();
|
||||
BlockPos getBurstSourceBlockPos();
|
||||
|
||||
public void setBurstSourceCoords(BlockPos pos);
|
||||
void setBurstSourceCoords(BlockPos pos);
|
||||
|
||||
public ItemStack getSourceLens();
|
||||
ItemStack getSourceLens();
|
||||
|
||||
public void setSourceLens(ItemStack lens);
|
||||
void setSourceLens(ItemStack lens);
|
||||
|
||||
public boolean hasAlreadyCollidedAt(BlockPos pos);
|
||||
boolean hasAlreadyCollidedAt(BlockPos pos);
|
||||
|
||||
public void setCollidedAt(BlockPos pos);
|
||||
void setCollidedAt(BlockPos pos);
|
||||
|
||||
public int getTicksExisted();
|
||||
int getTicksExisted();
|
||||
|
||||
public void setFake(boolean fake);
|
||||
void setFake(boolean fake);
|
||||
|
||||
public void setShooterUUID(UUID uuid);
|
||||
void setShooterUUID(UUID uuid);
|
||||
|
||||
public UUID getShooterUIID();
|
||||
UUID getShooterUUID();
|
||||
|
||||
public void ping();
|
||||
void ping();
|
||||
|
||||
}
|
||||
@@ -10,13 +10,13 @@
|
||||
*/
|
||||
package vazkii.botania.api.internal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.mana.TileSignature;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* A basic interface for a world's Mana Network.
|
||||
* @see IInternalMethodHandler#getManaNetworkInstance()
|
||||
@@ -52,16 +52,16 @@ public interface IManaNetwork {
|
||||
public TileEntity getClosestPool(BlockPos pos, World world, int limit);
|
||||
|
||||
/**
|
||||
* Gets the list of all Mana Collectors (eg. Mana Spreader) in the dimension
|
||||
* passed in. Note that this is the actual list and not a copy, make sure to
|
||||
* clone the list if you intend to change it in any way.
|
||||
* Gets the set of all Mana Collectors (eg. Mana Spreader) in the dimension
|
||||
* passed in. Note that this is the actual set and not a copy, make sure to
|
||||
* clone the set if you intend to change it in any way.
|
||||
*/
|
||||
public List<TileSignature> getAllCollectorsInWorld(World world);
|
||||
public Set<TileSignature> getAllCollectorsInWorld(World world);
|
||||
|
||||
/**
|
||||
* Gets the list of all Mana Pools in the dimension passed in. Note that this
|
||||
* is the actual list and not a copy, make sure to clone the list if you intend
|
||||
* Gets the set of all Mana Pools in the dimension passed in. Note that this
|
||||
* is the actual set and not a copy, make sure to clone the set if you intend
|
||||
* to change it in any way.
|
||||
*/
|
||||
public List<TileSignature> getAllPoolsInWorld(World world);
|
||||
public Set<TileSignature> getAllPoolsInWorld(World world);
|
||||
}
|
||||
@@ -10,24 +10,34 @@
|
||||
*/
|
||||
package vazkii.botania.api.internal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
|
||||
public final class VanillaPacketDispatcher {
|
||||
|
||||
public static void dispatchTEToNearbyPlayers(TileEntity tile) {
|
||||
World world = tile.getWorld();
|
||||
List players = world.playerEntities;
|
||||
for(Object player : players)
|
||||
if(player instanceof EntityPlayerMP) {
|
||||
EntityPlayerMP mp = (EntityPlayerMP) player;
|
||||
if(pointDistancePlane(mp.posX, mp.posZ, tile.getPos().getX() + 0.5, tile.getPos().getZ() + 0.5) < 64)
|
||||
((EntityPlayerMP) player).playerNetServerHandler.sendPacket(tile.getDescriptionPacket());
|
||||
if(tile.getWorld() instanceof WorldServer) {
|
||||
WorldServer ws = ((WorldServer) tile.getWorld());
|
||||
SPacketUpdateTileEntity packet = tile.getUpdatePacket();
|
||||
|
||||
if(packet == null)
|
||||
return;
|
||||
|
||||
for (EntityPlayer player : ws.playerEntities) {
|
||||
EntityPlayerMP playerMP = ((EntityPlayerMP) player);
|
||||
|
||||
if (playerMP.getDistanceSq(tile.getPos()) < 64 * 64
|
||||
&& ws.getPlayerChunkMap().isPlayerWatchingChunk(playerMP, tile.getPos().getX() >> 4, tile.getPos().getZ() >> 4)) {
|
||||
playerMP.connection.sendPacket(packet);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void dispatchTEToNearbyPlayers(World world, BlockPos pos) {
|
||||
|
||||
@@ -13,9 +13,7 @@ package vazkii.botania.api.item;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
/**
|
||||
* A Bauble Item that implements this will be have hooks to render something on
|
||||
@@ -37,24 +35,67 @@ public interface IBaubleRender {
|
||||
/**
|
||||
* A few helper methods for the render.
|
||||
*/
|
||||
public static class Helper {
|
||||
final class Helper {
|
||||
|
||||
/**
|
||||
* Rotates the render for a bauble correctly if the player is sneaking.
|
||||
* Use for renders under {@link RenderType#BODY}.
|
||||
*/
|
||||
public static void rotateIfSneaking(EntityPlayer player) {
|
||||
if(player.isSneaking())
|
||||
applySneakingRotation();
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotates the render for a bauble correctly for a sneaking player.
|
||||
* Use for renders under {@link RenderType#BODY}.
|
||||
*/
|
||||
public static void applySneakingRotation() {
|
||||
GlStateManager.rotate(28.64789F, 1.0F, 0.0F, 0.0F);
|
||||
GlStateManager.translate(0F, 0.2F, 0F);
|
||||
GlStateManager.rotate(90F / (float) Math.PI, 1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shifts the render for a bauble correctly to the head, including sneaking rotation.
|
||||
* Use for renders under {@link RenderType#HEAD}.
|
||||
*/
|
||||
public static void translateToHeadLevel(EntityPlayer player) {
|
||||
GlStateManager.translate(0, -player.getDefaultEyeHeight() + (player.isSneaking() ? 0.25 : 0), 0);
|
||||
GlStateManager.translate(0, -player.getDefaultEyeHeight(), 0);
|
||||
if (player.isSneaking())
|
||||
GlStateManager.translate(0.25F * MathHelper.sin(player.rotationPitch * (float) Math.PI / 180), 0.25F * MathHelper.cos(player.rotationPitch * (float) Math.PI / 180), 0F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shifts the render for a bauble correctly to the face.
|
||||
* Use for renders under {@link RenderType#HEAD}, and usually after calling {@link Helper#translateToHeadLevel(EntityPlayer)}.
|
||||
*/
|
||||
public static void translateToFace() {
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
GlStateManager.translate(0f, -4.35f, -1.27f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Scales down the render to a correct size.
|
||||
* Use for any render.
|
||||
*/
|
||||
public static void defaultTransforms() {
|
||||
GlStateManager.translate(0.0, 3.0, 1.0);
|
||||
GlStateManager.scale(0.55, 0.55, 0.55);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shifts the render for a bauble correctly to the chest.
|
||||
* Use for renders under {@link RenderType#BODY}, and usually after calling {@link Helper#rotateIfSneaking(EntityPlayer)}.
|
||||
*/
|
||||
public static void translateToChest() {
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
GlStateManager.translate(0F, -3.2F, -0.85F);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static enum RenderType {
|
||||
enum RenderType {
|
||||
/**
|
||||
* Render Type for the player's body, translations apply on the player's rotation.
|
||||
* Sneaking is not handled and should be done during the render.
|
||||
@@ -64,7 +105,7 @@ public interface IBaubleRender {
|
||||
|
||||
/**
|
||||
* Render Type for the player's body, translations apply on the player's head rotations.
|
||||
* Sneaking is not handled and should be done during the render.~
|
||||
* Sneaking is not handled and should be done during the render.
|
||||
* @see IBaubleRender.Helper
|
||||
*/
|
||||
HEAD;
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Jan 18, 2015, 12:20:44 AM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.api.item;
|
||||
|
||||
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
|
||||
/**
|
||||
* Used to define a Mana Pool that can be dyed through floral powder.
|
||||
*/
|
||||
public interface IDyablePool {
|
||||
|
||||
public EnumDyeColor getColor();
|
||||
|
||||
public void setColor(EnumDyeColor color);
|
||||
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Apr 30, 2015, 1:43:17 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.api.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
|
||||
/**
|
||||
* An extension of IWireframeCoordinateListProvider that allows for
|
||||
* rendering a single thicker wireframe.
|
||||
*/
|
||||
public interface IExtendedWireframeCoordinateListProvider extends IWireframeCoordinateListProvider {
|
||||
|
||||
/**
|
||||
* Gets the source wireframe to draw, this one will be drawn thicker.
|
||||
*/
|
||||
public BlockPos getSourceWireframe(EntityPlayer player, ItemStack stack);
|
||||
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.api.item;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public interface IFloatingFlower {
|
||||
@@ -22,7 +23,7 @@ public interface IFloatingFlower {
|
||||
public void setIslandType(IslandType type);
|
||||
|
||||
public class IslandType {
|
||||
private static HashMap<String, IslandType> registry = new HashMap<>();
|
||||
private static final HashMap<String, IslandType> registry = new HashMap<>();
|
||||
|
||||
public static final IslandType GRASS = new IslandType("GRASS");
|
||||
public static final IslandType PODZOL = new IslandType("PODZOL");
|
||||
@@ -35,6 +36,8 @@ public interface IFloatingFlower {
|
||||
public static final IslandType INFUSED = new IslandType("INFUSED");
|
||||
public static final IslandType MUTATED = new IslandType("MUTATED");
|
||||
|
||||
private final String typeName;
|
||||
|
||||
/**
|
||||
* Instantiates and registers a new floating flower island type
|
||||
* Note that you need to register the model for this island type, see BotaniaAPIClient
|
||||
@@ -46,14 +49,11 @@ public interface IFloatingFlower {
|
||||
registry.put(name, this);
|
||||
}
|
||||
|
||||
public final String typeName;
|
||||
|
||||
public static IslandType ofType(String typeStr) {
|
||||
IslandType type = registry.get(typeStr);
|
||||
return type == null ? GRASS : type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.typeName;
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
* File Created @ [17/11/2015, 20:10:53 (GMT)]
|
||||
*/
|
||||
package vazkii.botania.api.item;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import vazkii.botania.api.subtile.SubTileEntity;
|
||||
|
||||
/**
|
||||
@@ -20,9 +20,15 @@ import vazkii.botania.api.subtile.SubTileEntity;
|
||||
public interface IFlowerPlaceable {
|
||||
|
||||
/**
|
||||
* Gets the block to be placed, return null to not place anything.
|
||||
* Gets the state to be placed, return null to not place anything.
|
||||
*/
|
||||
public Block getBlockToPlaceByFlower(ItemStack stack, SubTileEntity flower, BlockPos pos);
|
||||
public IBlockState getBlockToPlaceByFlower(ItemStack stack, SubTileEntity flower, BlockPos pos);
|
||||
|
||||
/**
|
||||
* Called after the block is placed.
|
||||
* @param stack The stack that was placed.
|
||||
* @param flower The flower doing the placing.
|
||||
* @param pos The position that was placed at.
|
||||
*/
|
||||
public void onBlockPlacedByFlower(ItemStack stack, SubTileEntity flower, BlockPos pos);
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
package vazkii.botania.api.item;
|
||||
import net.minecraft.world.World;
|
||||
/**
|
||||
* A BiomeGenBase that implements this will not have Botania flowers generated.
|
||||
* A Biome that implements this will not have Botania flowers generated.
|
||||
*/
|
||||
public interface IFlowerlessBiome {
|
||||
/**
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Oct 29, 2014, 4:52:04 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.api.item;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* A BlockBush can implement this to check if it can be broken
|
||||
* by a Horn/Drum of the Wild or not.
|
||||
* @Deprecated Use IHornHarvestable instead
|
||||
*/
|
||||
@Deprecated
|
||||
public interface IGrassHornExcempt {
|
||||
|
||||
public boolean canUproot(World world, BlockPos pos);
|
||||
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
package vazkii.botania.api.item;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,7 +22,7 @@ public interface IManaDissolvable {
|
||||
|
||||
/**
|
||||
* Called for every tick the item is on a mana pool. If the stack has stack
|
||||
* size 0 the item is killed. This is called in both the server and client.
|
||||
* size 0 the item is killed. This is called serverside.
|
||||
*/
|
||||
public void onDissolveTick(IManaPool pool, ItemStack stack, EntityItem item);
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.api.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -23,16 +24,18 @@ import net.minecraft.item.ItemStack;
|
||||
*/
|
||||
public interface IManaProficiencyArmor {
|
||||
|
||||
public boolean shouldGiveProficiency(ItemStack stack, int slot, EntityPlayer player);
|
||||
public boolean shouldGiveProficiency(ItemStack stack, EntityEquipmentSlot slot, EntityPlayer player);
|
||||
|
||||
public final static class Helper {
|
||||
|
||||
public static boolean hasProficiency(EntityPlayer player) {
|
||||
for(int i = 0; i < 4; i++) {
|
||||
ItemStack armor = player.getCurrentArmor(i);
|
||||
for(EntityEquipmentSlot e: EntityEquipmentSlot.values()) {
|
||||
if(e.getSlotType() != EntityEquipmentSlot.Type.ARMOR)
|
||||
continue;
|
||||
ItemStack armor = player.getItemStackFromSlot(e);
|
||||
if(armor != null) {
|
||||
Item item = armor.getItem();
|
||||
if(item instanceof IManaProficiencyArmor && ((IManaProficiencyArmor) item).shouldGiveProficiency(armor, i, player))
|
||||
if(item instanceof IManaProficiencyArmor && ((IManaProficiencyArmor) item).shouldGiveProficiency(armor, e, player))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
*/
|
||||
package vazkii.botania.api.item;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* An item that implements this counts as a Relic item. This is purely for interaction
|
||||
* and other mod items should not implement this interface.
|
||||
|
||||
@@ -12,8 +12,8 @@ package vazkii.botania.api.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
/**
|
||||
* An item that implements this can break multiple blocks at once
|
||||
|
||||
@@ -10,13 +10,11 @@
|
||||
*/
|
||||
package vazkii.botania.api.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* An item that implements this will allow for various wireframes to be drawn
|
||||
@@ -27,8 +25,16 @@ public interface IWireframeCoordinateListProvider {
|
||||
|
||||
/**
|
||||
* Returns a list of BlockPos for the wireframes to draw.
|
||||
* Can be null.
|
||||
* Will not be null.
|
||||
*/
|
||||
public List<BlockPos> getWireframesToDraw(EntityPlayer player, ItemStack stack);
|
||||
|
||||
/**
|
||||
* Gets a wireframe to draw thicker than the rest.
|
||||
* This is useful to indicate the precedence of some position over the others.
|
||||
* @return The position of a single wireframe to draw thicker than all the others.
|
||||
*/
|
||||
public BlockPos getSourceWireframe(EntityPlayer player, ItemStack stack);
|
||||
|
||||
|
||||
}
|
||||
@@ -12,8 +12,6 @@ package vazkii.botania.api.item;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Why would you ever want this ._.
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
*/
|
||||
package vazkii.botania.api.lexicon;
|
||||
|
||||
import java.util.Queue;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
import java.util.Queue;
|
||||
|
||||
/**
|
||||
* Fired when the Lexica Botania's tutorial is started. You can add your
|
||||
* own entries to the tutorial here. Please use this responsibly.
|
||||
|
||||
@@ -12,7 +12,7 @@ package vazkii.botania.api.lexicon;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package vazkii.botania.api.lexicon;
|
||||
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
public class KnowledgeType {
|
||||
|
||||
public final String id;
|
||||
public final EnumChatFormatting color;
|
||||
public final TextFormatting color;
|
||||
public final boolean autoUnlock;
|
||||
|
||||
public KnowledgeType(String id, EnumChatFormatting color, boolean autoUnlock) {
|
||||
public KnowledgeType(String id, TextFormatting color, boolean autoUnlock) {
|
||||
this.id = id;
|
||||
this.color = color;
|
||||
this.autoUnlock = autoUnlock;
|
||||
|
||||
@@ -10,11 +10,12 @@
|
||||
*/
|
||||
package vazkii.botania.api.lexicon;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class LexiconCategory implements Comparable<LexiconCategory> {
|
||||
|
||||
private static int count = 0;
|
||||
@@ -70,7 +71,7 @@ public class LexiconCategory implements Comparable<LexiconCategory> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(LexiconCategory category) {
|
||||
public int compareTo(@Nonnull LexiconCategory category) {
|
||||
return priority == category.priority ? sortingId - category.sortingId : category.priority - priority;
|
||||
}
|
||||
}
|
||||
@@ -10,16 +10,17 @@
|
||||
*/
|
||||
package vazkii.botania.api.lexicon;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class LexiconEntry implements Comparable<LexiconEntry> {
|
||||
|
||||
public final String unlocalizedName;
|
||||
@@ -27,11 +28,11 @@ public class LexiconEntry implements Comparable<LexiconEntry> {
|
||||
|
||||
private KnowledgeType type = BotaniaAPI.basicKnowledge;
|
||||
|
||||
public List<LexiconPage> pages = new ArrayList<>();
|
||||
public final List<LexiconPage> pages = new ArrayList<>();
|
||||
private boolean priority = false;
|
||||
private ItemStack icon = null;
|
||||
|
||||
private List<ItemStack> extraDisplayedRecipes = new ArrayList<>();
|
||||
private final List<ItemStack> extraDisplayedRecipes = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* @param unlocalizedName The unlocalized name of this entry. This will be localized by the client display.
|
||||
@@ -122,7 +123,7 @@ public class LexiconEntry implements Comparable<LexiconEntry> {
|
||||
}
|
||||
|
||||
public final String getNameForSorting() {
|
||||
return (priority ? 0 : 1) + StatCollector.translateToLocal(getUnlocalizedName());
|
||||
return (priority ? 0 : 1) + I18n.translateToLocal(getUnlocalizedName());
|
||||
}
|
||||
|
||||
public List<ItemStack> getDisplayedRecipes() {
|
||||
@@ -159,7 +160,7 @@ public class LexiconEntry implements Comparable<LexiconEntry> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(LexiconEntry o) {
|
||||
public int compareTo(@Nonnull LexiconEntry o) {
|
||||
return getNameForSorting().compareTo(o.getNameForSorting());
|
||||
}
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
*/
|
||||
package vazkii.botania.api.lexicon;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.internal.IGuiLexiconEntry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.internal.IGuiLexiconEntry;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public abstract class LexiconPage {
|
||||
|
||||
@@ -40,9 +40,7 @@ public abstract class LexiconPage {
|
||||
* Called per update tick. Non gui-sensitive version, kept for backwards compatibility only.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void updateScreen() {
|
||||
// NO-OP
|
||||
}
|
||||
public void updateScreen() {}
|
||||
|
||||
/**
|
||||
* Called per update tick. Feel free to override fully, the
|
||||
@@ -58,41 +56,31 @@ public abstract class LexiconPage {
|
||||
* You can add buttons and whatever you'd do on initGui() here.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onOpened(IGuiLexiconEntry gui) {
|
||||
// NO-OP
|
||||
}
|
||||
public void onOpened(IGuiLexiconEntry gui) {}
|
||||
|
||||
/**
|
||||
* Called when this page is opened, be it via closing the gui or when the player changes page.
|
||||
* Make sure to dispose of anything you don't use any more, such as buttons in the gui's buttonList.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onClosed(IGuiLexiconEntry gui) {
|
||||
// NO-OP
|
||||
}
|
||||
public void onClosed(IGuiLexiconEntry gui) {}
|
||||
|
||||
/**
|
||||
* Called when a button is pressed, equivalent to GuiScreen.actionPerformed.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onActionPerformed(IGuiLexiconEntry gui, GuiButton button) {
|
||||
// NO-OP
|
||||
}
|
||||
public void onActionPerformed(IGuiLexiconEntry gui, GuiButton button) {}
|
||||
|
||||
/**
|
||||
* Called when a key is pressed.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onKeyPressed(char c, int key) {
|
||||
// NO-OP
|
||||
}
|
||||
public void onKeyPressed(char c, int key) {}
|
||||
|
||||
/**
|
||||
* Called when {@link LexiconEntry#setLexiconPages(LexiconPage...)} is called.
|
||||
*/
|
||||
public void onPageAdded(LexiconEntry entry, int index) {
|
||||
// NO-OP
|
||||
}
|
||||
public void onPageAdded(LexiconEntry entry, int index) {}
|
||||
|
||||
/**
|
||||
* Shows the list of recipes present in this page for display in the category
|
||||
|
||||
@@ -10,12 +10,13 @@
|
||||
*/
|
||||
package vazkii.botania.api.lexicon;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import vazkii.botania.api.mana.IManaItem;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.mana.IManaItem;
|
||||
|
||||
/**
|
||||
* This class contains mappings for which entry and page correspond to each
|
||||
* craftable ItemStack. Use the map method to map an ItemStack to a page in
|
||||
@@ -23,7 +24,7 @@ import vazkii.botania.api.mana.IManaItem;
|
||||
*/
|
||||
public final class LexiconRecipeMappings {
|
||||
|
||||
private static Map<String, EntryData> mappings = new HashMap<>();
|
||||
private static final Map<String, EntryData> mappings = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Maps the given stack to the given page of the entry.
|
||||
@@ -47,21 +48,28 @@ public final class LexiconRecipeMappings {
|
||||
}
|
||||
|
||||
public static EntryData getDataForStack(ItemStack stack) {
|
||||
String wildKey = stackToString(stack, true);
|
||||
if (mappings.containsKey(wildKey))
|
||||
return mappings.get(wildKey);
|
||||
return mappings.get(stackToString(stack));
|
||||
}
|
||||
|
||||
public static String stackToString(ItemStack stack) {
|
||||
return stackToString(stack, false);
|
||||
}
|
||||
|
||||
public static String stackToString(ItemStack stack, boolean forceIgnore) {
|
||||
if(stack == null || stack.getItem() == null)
|
||||
return "NULL";
|
||||
|
||||
|
||||
if(stack.hasTagCompound() && stack.getItem() instanceof IRecipeKeyProvider)
|
||||
return ((IRecipeKeyProvider) stack.getItem()).getKey(stack);
|
||||
|
||||
return stack.getUnlocalizedName() + (ignoreMeta(stack) ? "" : "~" + stack.getItemDamage());
|
||||
return stack.getUnlocalizedName() + (forceIgnore || ignoreMeta(stack) ? "" : "~" + stack.getItemDamage());
|
||||
}
|
||||
|
||||
public static boolean ignoreMeta(ItemStack stack) {
|
||||
return stack.isItemStackDamageable() || stack.getItem() instanceof IManaItem;
|
||||
return stack.isItemStackDamageable() || stack.getItem() instanceof IManaItem || stack.getItemDamage() == OreDictionary.WILDCARD_VALUE;
|
||||
}
|
||||
|
||||
public static class EntryData {
|
||||
|
||||
@@ -10,14 +10,14 @@
|
||||
*/
|
||||
package vazkii.botania.api.lexicon.multiblock;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* A hook for rendering blocks in the multiblock display.
|
||||
*/
|
||||
@@ -25,7 +25,7 @@ public interface IMultiblockRenderHook {
|
||||
|
||||
public static Map<Block, IMultiblockRenderHook> renderHooks = new HashMap<>();
|
||||
|
||||
public void renderBlockForMultiblock(IBlockAccess world, Multiblock mb, IBlockState state, MultiblockComponent comp, float alpha);
|
||||
public void renderBlockForMultiblock(IBlockAccess world, Multiblock mb, IBlockState state, MultiblockComponent comp);
|
||||
|
||||
public boolean needsTranslate(IBlockState state);
|
||||
|
||||
|
||||
@@ -10,14 +10,18 @@
|
||||
*/
|
||||
package vazkii.botania.api.lexicon.multiblock;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* This class describes a Mutiblock object. It's used to display a
|
||||
* multiblock in the lexicon and to show the player in a ghost-like
|
||||
@@ -25,14 +29,14 @@ import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent;
|
||||
*/
|
||||
public class Multiblock {
|
||||
|
||||
public List<MultiblockComponent> components = new ArrayList<>();
|
||||
public List<ItemStack> materials = new ArrayList<>();
|
||||
public final List<MultiblockComponent> components = new ArrayList<>();
|
||||
public final List<ItemStack> materials = new ArrayList<>();
|
||||
|
||||
public BlockPos minPos = BlockPos.ORIGIN;
|
||||
public BlockPos maxPos = BlockPos.ORIGIN;
|
||||
public BlockPos offPos = BlockPos.ORIGIN;
|
||||
|
||||
public HashMap<BlockPos, MultiblockComponent> locationCache = new HashMap<>();
|
||||
public final HashMap<BlockPos, MultiblockComponent> locationCache = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Adds a multiblock component to this multiblock. The component's x y z
|
||||
|
||||
@@ -10,9 +10,8 @@
|
||||
*/
|
||||
package vazkii.botania.api.lexicon.multiblock.component;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
@@ -26,8 +25,8 @@ public class AnyComponent extends MultiblockComponent {
|
||||
|
||||
@Override
|
||||
public boolean matches(World world, BlockPos pos) {
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
return !block.isAir(world, pos) && block.getCollisionBoundingBox(world, pos, world.getBlockState(pos)) != null;
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
return !state.getBlock().isAir(state, world, pos) && state.getCollisionBoundingBox(world, pos) != null;
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -14,7 +14,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
package vazkii.botania.api.lexicon.multiblock.component;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@ package vazkii.botania.api.lexicon.multiblock.component;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -27,7 +27,7 @@ public class MultiblockComponent {
|
||||
protected BlockPos relPos;
|
||||
protected final IBlockState state;
|
||||
protected final TileEntity tileEntity;
|
||||
private boolean doFancyRender;
|
||||
private final boolean doFancyRender;
|
||||
|
||||
public MultiblockComponent(BlockPos relPos, IBlockState state) {
|
||||
this(relPos, state, null);
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package vazkii.botania.api.lexicon.multiblock.component;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
// Multiblock component that only compares blocks, not blockstates
|
||||
|
||||
@@ -17,8 +17,32 @@ package vazkii.botania.api.mana;
|
||||
*/
|
||||
public interface IDirectioned {
|
||||
|
||||
/**
|
||||
* @return The X rotation, in degrees
|
||||
*/
|
||||
public float getRotationX();
|
||||
|
||||
/**
|
||||
* @return The Y rotation, in degrees
|
||||
*/
|
||||
public float getRotationY();
|
||||
|
||||
/**
|
||||
* Set the X rotation
|
||||
* @param rot X rotation, in degrees
|
||||
*/
|
||||
public void setRotationX(float rot);
|
||||
|
||||
/**
|
||||
* Set the Y rotation
|
||||
* @param rot Y rotation, in degrees
|
||||
*/
|
||||
public void setRotationY(float rot);
|
||||
|
||||
/**
|
||||
* This should be called after rotation setting is done to allow
|
||||
* for the block to re-calculate.
|
||||
*/
|
||||
public void commitRedirection();
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Jun 19, 2015, 10:05:24 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.api.mana;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* This interface marks a TileEntity that can be identified through
|
||||
* an UUID. This UUID must presist between sessions.
|
||||
*/
|
||||
public interface IIdentifiable {
|
||||
|
||||
public UUID getIdentifier();
|
||||
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.api.mana;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
package vazkii.botania.api.mana;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Have an Item implement this to be counted as a lens for the mana spreader.
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
package vazkii.botania.api.mana;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
|
||||
/**
|
||||
@@ -31,7 +31,7 @@ public interface ILensEffect {
|
||||
* any block. This is called after the collision is handled.
|
||||
* @return True to kill the burst. False to keep it alive.
|
||||
*/
|
||||
public boolean collideBurst(IManaBurst burst, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack);
|
||||
public boolean collideBurst(IManaBurst burst, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack);
|
||||
|
||||
/**
|
||||
* Called when a mana burst fired from a mana spreader with this focus is updated.
|
||||
|
||||
@@ -10,12 +10,16 @@
|
||||
*/
|
||||
package vazkii.botania.api.mana;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* Any TileEntity that implements this can be counted as a "ghost" block of
|
||||
* Any Block that implements this can be counted as a "ghost" block of
|
||||
* sorts, that won't call the collision code for the mana bursts.
|
||||
*/
|
||||
public interface IManaCollisionGhost {
|
||||
|
||||
public boolean isGhost();
|
||||
public boolean isGhost(IBlockState state, World world, BlockPos pos);
|
||||
|
||||
}
|
||||
@@ -10,6 +10,8 @@
|
||||
*/
|
||||
package vazkii.botania.api.mana;
|
||||
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
|
||||
/**
|
||||
* Any TileEntity that implements this is considered a Mana Pool,
|
||||
* by which nearby functional flowers will pull mana from it.<br>
|
||||
@@ -27,4 +29,15 @@ public interface IManaPool extends IManaReceiver {
|
||||
*/
|
||||
public boolean isOutputtingPower();
|
||||
|
||||
/**
|
||||
* @return The color of this pool.
|
||||
*/
|
||||
public EnumDyeColor getColor();
|
||||
|
||||
/**
|
||||
* Sets the color of this pool.
|
||||
* @param color The color to set.
|
||||
*/
|
||||
public void setColor(EnumDyeColor color);
|
||||
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.api.mana;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
*/
|
||||
package vazkii.botania.api.mana;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* This describes an interface of a Mana Sender block that should be able to pingbackable
|
||||
* by a burst to tell it that the burst is still alive.
|
||||
*/
|
||||
public interface IPingable extends IIdentifiable {
|
||||
public interface IPingable {
|
||||
|
||||
/**
|
||||
* Pings this object back, telling it that the burst passed in is still alive
|
||||
@@ -28,4 +28,9 @@ public interface IPingable extends IIdentifiable {
|
||||
*/
|
||||
public void pingback(IManaBurst burst, UUID expectedIdentity);
|
||||
|
||||
/**
|
||||
* @return A unique and persistent identifier for this IPingable
|
||||
*/
|
||||
public UUID getIdentifier();
|
||||
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
package vazkii.botania.api.mana;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [15/11/2015, 19:28:18 (GMT)]
|
||||
*/
|
||||
package vazkii.botania.api.mana;
|
||||
|
||||
/**
|
||||
* This is an extension of IDirectioned for TileEntities
|
||||
* that allow for their rotation to be public and modifiable outside.
|
||||
* This is used in botania for the Redirective mana lens.
|
||||
*/
|
||||
public interface IRedirectable extends IDirectioned {
|
||||
|
||||
public void setRotationX(float rot);
|
||||
|
||||
public void setRotationY(float rot);
|
||||
|
||||
/**
|
||||
* This should be called after rotation setting is done to allow
|
||||
* for the block to re-calculate.
|
||||
*/
|
||||
public void commitRedirection();
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* This class was created by <Flaxbeard>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Jul 25, 2016, 9:02:12 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.api.mana;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
public class ManaDiscountEvent extends Event {
|
||||
|
||||
private final EntityPlayer entityPlayer;
|
||||
private float discount;
|
||||
|
||||
public ManaDiscountEvent(EntityPlayer entityPlayer, float discount) {
|
||||
this.entityPlayer = entityPlayer;
|
||||
this.discount = discount;
|
||||
}
|
||||
|
||||
public EntityPlayer getEntityPlayer() {
|
||||
return entityPlayer;
|
||||
}
|
||||
|
||||
public float getDiscount() {
|
||||
return discount;
|
||||
}
|
||||
|
||||
public void setDiscount(float discount) {
|
||||
this.discount = discount;
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.api.mana;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
|
||||
public final class ManaItemHandler {
|
||||
@@ -145,7 +146,7 @@ public final class ManaItemHandler {
|
||||
if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canExportManaToItem(stack, stackInSlot))
|
||||
continue;
|
||||
|
||||
int received = 0;
|
||||
int received;
|
||||
if(manaItemSlot.getMana(stackInSlot) + manaToSend <= manaItemSlot.getMaxMana(stackInSlot))
|
||||
received = manaToSend;
|
||||
else received = manaToSend - (manaItemSlot.getMana(stackInSlot) + manaToSend - manaItemSlot.getMaxMana(stackInSlot));
|
||||
@@ -249,6 +250,10 @@ public final class ManaItemHandler {
|
||||
if(armor != null && armor.getItem() instanceof IManaDiscountArmor)
|
||||
discount += ((IManaDiscountArmor) armor.getItem()).getDiscount(armor, i, player);
|
||||
}
|
||||
|
||||
ManaDiscountEvent event = new ManaDiscountEvent(player, discount);
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
discount = event.getDiscount();
|
||||
|
||||
return discount;
|
||||
}
|
||||
|
||||
@@ -4,17 +4,25 @@ import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileSignature {
|
||||
|
||||
public final TileEntity tile;
|
||||
public final boolean remoteWorld;
|
||||
private final TileEntity tile;
|
||||
private final boolean remoteWorld;
|
||||
|
||||
public TileSignature(TileEntity tile, boolean remoteWorld) {
|
||||
this.tile = tile;
|
||||
this.remoteWorld = remoteWorld;
|
||||
}
|
||||
|
||||
public TileEntity getTile() {
|
||||
return tile;
|
||||
}
|
||||
|
||||
public boolean isRemote() {
|
||||
return remoteWorld;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Boolean.hashCode(remoteWorld) ^ tile.hashCode();
|
||||
return Boolean.hashCode(remoteWorld) ^ System.identityHashCode(tile);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
*/
|
||||
package vazkii.botania.api.mana.spark;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public final class SparkHelper {
|
||||
|
||||
public static final int SPARK_SCAN_RANGE = 12;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@API(owner = "Botania", apiVersion = "77", provides = "BotaniaAPI")
|
||||
@API(owner = "Botania", apiVersion = "79", provides = "BotaniaAPI")
|
||||
package vazkii.botania.api;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
*/
|
||||
package vazkii.botania.api.recipe;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* An event fired when an Elven Portal TE updates. The portal's
|
||||
* relevant AABB and other stuff is passed in for convenience. This
|
||||
|
||||
@@ -10,18 +10,17 @@
|
||||
*/
|
||||
package vazkii.botania.api.recipe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import vazkii.botania.api.brew.Brew;
|
||||
import vazkii.botania.api.brew.IBrewContainer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RecipeBrew {
|
||||
|
||||
private final Brew brew;
|
||||
@@ -89,7 +88,7 @@ public class RecipeBrew {
|
||||
return inputsMissing.isEmpty();
|
||||
}
|
||||
|
||||
boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) {
|
||||
private boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) {
|
||||
return stack.getItem() == stack2.getItem() && stack.getItemDamage() == stack2.getItemDamage();
|
||||
}
|
||||
|
||||
@@ -107,7 +106,7 @@ public class RecipeBrew {
|
||||
|
||||
public ItemStack getOutput(ItemStack stack) {
|
||||
if(stack == null || !(stack.getItem() instanceof IBrewContainer))
|
||||
return new ItemStack(Items.glass_bottle); // Fallback...
|
||||
return new ItemStack(Items.GLASS_BOTTLE); // Fallback...
|
||||
IBrewContainer container = (IBrewContainer) stack.getItem();
|
||||
|
||||
return container.getItemForBrew(brew, stack);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package vazkii.botania.api.recipe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RecipeElvenTrade {
|
||||
|
||||
private final ItemStack output;
|
||||
@@ -80,7 +80,7 @@ public class RecipeElvenTrade {
|
||||
return inputsMissing.isEmpty();
|
||||
}
|
||||
|
||||
boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) {
|
||||
private boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) {
|
||||
return stack.getItem() == stack2.getItem() && stack.getItemDamage() == stack2.getItemDamage();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,18 +10,22 @@
|
||||
*/
|
||||
package vazkii.botania.api.recipe;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class RecipeManaInfusion {
|
||||
|
||||
private final ItemStack output;
|
||||
private final Object input;
|
||||
private final int mana;
|
||||
boolean isAlchemy = false;
|
||||
boolean isConjuration = false;
|
||||
private @Nullable IBlockState catalystState;
|
||||
|
||||
public static IBlockState alchemyState;
|
||||
public static IBlockState conjurationState;
|
||||
|
||||
public RecipeManaInfusion(ItemStack output, Object input, int mana) {
|
||||
this.output = output;
|
||||
@@ -54,20 +58,12 @@ public class RecipeManaInfusion {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setAlchemy(boolean alchemy) {
|
||||
isAlchemy = alchemy;
|
||||
public IBlockState getCatalyst() {
|
||||
return catalystState;
|
||||
}
|
||||
|
||||
public boolean isAlchemy() {
|
||||
return isAlchemy;
|
||||
}
|
||||
|
||||
public void setConjuration(boolean conjuration) {
|
||||
isConjuration = conjuration;
|
||||
}
|
||||
|
||||
public boolean isConjuration() {
|
||||
return isConjuration;
|
||||
public void setCatalyst(IBlockState catalyst) {
|
||||
catalystState = catalyst;
|
||||
}
|
||||
|
||||
public Object getInput() {
|
||||
@@ -81,5 +77,37 @@ public class RecipeManaInfusion {
|
||||
public int getManaToConsume() {
|
||||
return mana;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RecipeManaInfusion#setCatalyst(IBlockState)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public void setAlchemy(boolean alchemy) {
|
||||
catalystState = alchemy ? alchemyState : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RecipeManaInfusion#getCatalyst()} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean isAlchemy() {
|
||||
return catalystState == alchemyState;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RecipeManaInfusion#setCatalyst(IBlockState)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public void setConjuration(boolean conjuration) {
|
||||
catalystState = conjuration ? conjurationState : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RecipeManaInfusion#getCatalyst()} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean isConjuration() {
|
||||
return catalystState == conjurationState;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public class RecipeMiniFlower extends RecipeManaInfusion {
|
||||
|
||||
public RecipeMiniFlower(String flower, String mini, int mana) {
|
||||
super(BotaniaAPI.internalHandler.getSubTileAsStack(flower), BotaniaAPI.internalHandler.getSubTileAsStack(mini), mana);
|
||||
setAlchemy(true);
|
||||
setCatalyst(RecipeManaInfusion.alchemyState);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,15 +10,14 @@
|
||||
*/
|
||||
package vazkii.botania.api.recipe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RecipePetals {
|
||||
|
||||
private final ItemStack output;
|
||||
@@ -83,7 +82,7 @@ public class RecipePetals {
|
||||
return inputsMissing.isEmpty();
|
||||
}
|
||||
|
||||
boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) {
|
||||
private boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) {
|
||||
return stack.getItem() == stack2.getItem() && stack.getItemDamage() == stack2.getItemDamage();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,19 +10,19 @@
|
||||
*/
|
||||
package vazkii.botania.api.recipe;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import vazkii.botania.api.subtile.SubTileEntity;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class RecipePureDaisy {
|
||||
|
||||
public static final int DEFAULT_TIME = 150;
|
||||
@@ -57,7 +57,7 @@ public class RecipePureDaisy {
|
||||
return isOreDict(stack, oredict);
|
||||
}
|
||||
|
||||
public boolean isOreDict(ItemStack stack, String entry) {
|
||||
private boolean isOreDict(ItemStack stack, String entry) {
|
||||
if(stack == null || stack.getItem() == null)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package vazkii.botania.api.sound;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
|
||||
/**
|
||||
* Use these to play Botania sounds.
|
||||
* Do not access this class before Botania preinits!
|
||||
*/
|
||||
public final class BotaniaSoundEvents {
|
||||
|
||||
public static final SoundEvent airRod = getRegisteredSoundEvent("botania:airRod");
|
||||
public static final SoundEvent agricarnation = getRegisteredSoundEvent("botania:agricarnation");
|
||||
public static final SoundEvent altarCraft = getRegisteredSoundEvent("botania:altarCraft");
|
||||
public static final SoundEvent babylonAttack = getRegisteredSoundEvent("botania:babylonAttack");
|
||||
public static final SoundEvent babylonSpawn = getRegisteredSoundEvent("botania:babylonSpawn");
|
||||
public static final SoundEvent bellows = getRegisteredSoundEvent("botania:bellows");
|
||||
public static final SoundEvent bifrostRod = getRegisteredSoundEvent("botania:bifrostRod");
|
||||
public static final SoundEvent blackLotus = getRegisteredSoundEvent("botania:blackLotus");
|
||||
public static final SoundEvent dash = getRegisteredSoundEvent("botania:dash");
|
||||
public static final SoundEvent ding = getRegisteredSoundEvent("botania:ding");
|
||||
public static final SoundEvent divaCharm = getRegisteredSoundEvent("botania:divaCharm");
|
||||
public static final SoundEvent divinationRod = getRegisteredSoundEvent("botania:divinationRod");
|
||||
public static final SoundEvent doit = getRegisteredSoundEvent("botania:doit");
|
||||
public static final SoundEvent enchanterFade = getRegisteredSoundEvent("botania:enchanterForm");
|
||||
public static final SoundEvent enchanterForm = getRegisteredSoundEvent("botania:enchanterFade");
|
||||
public static final SoundEvent enchanterEnchant = getRegisteredSoundEvent("botania:enchanterEnchant");
|
||||
public static final SoundEvent endoflame = getRegisteredSoundEvent("botania:endoflame");
|
||||
public static final SoundEvent equipBauble = getRegisteredSoundEvent("botania:equipBauble");
|
||||
public static final SoundEvent gaiaTrap = getRegisteredSoundEvent("botania:gaiaTrap");
|
||||
public static final SoundEvent goldenLaurel = getRegisteredSoundEvent("botania:goldenLaurel");
|
||||
public static final SoundEvent holyCloak = getRegisteredSoundEvent("botania:holyCloak");
|
||||
public static final SoundEvent laputaStart = getRegisteredSoundEvent("botania:laputaStart");
|
||||
public static final SoundEvent lexiconOpen = getRegisteredSoundEvent("botania:lexiconOpen");
|
||||
public static final SoundEvent lexiconPage = getRegisteredSoundEvent("botania:lexiconPage");
|
||||
public static final SoundEvent lightRelay = getRegisteredSoundEvent("botania:lightRelay");
|
||||
public static final SoundEvent manaBlaster = getRegisteredSoundEvent("botania:manaBlaster");
|
||||
public static final SoundEvent manaPoolCraft = getRegisteredSoundEvent("botania:manaPoolCraft");
|
||||
public static final SoundEvent missile = getRegisteredSoundEvent("botania:missile");
|
||||
public static final SoundEvent orechid = getRegisteredSoundEvent("botania:orechid");
|
||||
public static final SoundEvent potionCreate = getRegisteredSoundEvent("botania:potionCreate");
|
||||
public static final SoundEvent runeAltarCraft = getRegisteredSoundEvent("botania:runeAltarCraft");
|
||||
public static final SoundEvent runeAltarStart = getRegisteredSoundEvent("botania:runeAltarStart");
|
||||
public static final SoundEvent spreaderFire = getRegisteredSoundEvent("botania:spreaderFire");
|
||||
public static final SoundEvent starcaller = getRegisteredSoundEvent("botania:starcaller");
|
||||
public static final SoundEvent terraBlade = getRegisteredSoundEvent("botania:terraBlade");
|
||||
public static final SoundEvent terraformRod = getRegisteredSoundEvent("botania:terraformRod");
|
||||
public static final SoundEvent terraPickMode = getRegisteredSoundEvent("botania:terraPickMode");
|
||||
public static final SoundEvent terrasteelCraft = getRegisteredSoundEvent("botania:terrasteelCraft");
|
||||
public static final SoundEvent thermalily = getRegisteredSoundEvent("botania:thermalily");
|
||||
public static final SoundEvent unholyCloak = getRegisteredSoundEvent("botania:unholyCloak");
|
||||
public static final SoundEvent way = getRegisteredSoundEvent("botania:way");
|
||||
|
||||
public static final SoundEvent gaiaMusic1 = getRegisteredSoundEvent("botania:music.gaia1");
|
||||
public static final SoundEvent gaiaMusic2 = getRegisteredSoundEvent("botania:music.gaia2");
|
||||
|
||||
private static SoundEvent getRegisteredSoundEvent(String name) {
|
||||
return SoundEvent.REGISTRY.getObject(new ResourceLocation(name));
|
||||
}
|
||||
|
||||
private BotaniaSoundEvents() {}
|
||||
}
|
||||
@@ -17,13 +17,28 @@ import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import vazkii.botania.api.item.IFloatingFlower;
|
||||
import vazkii.botania.api.state.enums.*;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import vazkii.botania.api.state.enums.AlfPortalState;
|
||||
import vazkii.botania.api.state.enums.AltGrassVariant;
|
||||
import vazkii.botania.api.state.enums.AltarVariant;
|
||||
import vazkii.botania.api.state.enums.BiomeBrickVariant;
|
||||
import vazkii.botania.api.state.enums.BiomeStoneVariant;
|
||||
import vazkii.botania.api.state.enums.CratePattern;
|
||||
import vazkii.botania.api.state.enums.CrateVariant;
|
||||
import vazkii.botania.api.state.enums.CustomBrickVariant;
|
||||
import vazkii.botania.api.state.enums.DrumVariant;
|
||||
import vazkii.botania.api.state.enums.LivingRockVariant;
|
||||
import vazkii.botania.api.state.enums.LivingWoodVariant;
|
||||
import vazkii.botania.api.state.enums.LuminizerVariant;
|
||||
import vazkii.botania.api.state.enums.PlatformVariant;
|
||||
import vazkii.botania.api.state.enums.PoolVariant;
|
||||
import vazkii.botania.api.state.enums.PylonVariant;
|
||||
import vazkii.botania.api.state.enums.QuartzVariant;
|
||||
import vazkii.botania.api.state.enums.SpreaderVariant;
|
||||
import vazkii.botania.api.state.enums.StorageVariant;
|
||||
|
||||
/**
|
||||
* Holds all Botania block state properties. Use these to set botania blockstates
|
||||
@@ -72,18 +87,6 @@ public final class BotaniaStateProps {
|
||||
|
||||
/** Properties for individual blocks **/
|
||||
|
||||
// Block18Stone
|
||||
public static final PropertyEnum<FutureStoneVariant> FUTURESTONE_VARIANT = PropertyEnum.create("variant", FutureStoneVariant.class);
|
||||
|
||||
// Block18StoneWall
|
||||
public static final PropertyEnum<FutureStoneVariant> FUTURESTONEWALL_VARIANT = PropertyEnum.create("variant", FutureStoneVariant.class, new Predicate<FutureStoneVariant>() {
|
||||
@Override
|
||||
public boolean apply(FutureStoneVariant variant) {
|
||||
// Just the four kinds (no polished, chiseled, etc.)
|
||||
return variant.ordinal() >= 0 && variant.ordinal() <= 3;
|
||||
}
|
||||
});
|
||||
|
||||
// BlockAlfPortal
|
||||
public static final PropertyEnum<AlfPortalState> ALFPORTAL_STATE = PropertyEnum.create("state", AlfPortalState.class);
|
||||
|
||||
@@ -100,7 +103,7 @@ public final class BotaniaStateProps {
|
||||
public static final PropertyEnum<BiomeBrickVariant> BIOMEBRICK_VARIANT = PropertyEnum.create("variant", BiomeBrickVariant.class);
|
||||
|
||||
// BlockBiomeStoneWall
|
||||
public static final PropertyEnum<BiomeStoneVariant> BIOMESTONEWALL_VARIANT = PropertyEnum.create("variant", BiomeStoneVariant.class, new Predicate<BiomeStoneVariant>() {
|
||||
public static final PropertyEnum<BiomeStoneVariant> BIOMESTONEWALL_VARIANT = PropertyEnum.create("bswall_variant", BiomeStoneVariant.class, new Predicate<BiomeStoneVariant>() {
|
||||
@Override
|
||||
public boolean apply(BiomeStoneVariant input) {
|
||||
return input.getName().contains("cobble");
|
||||
@@ -116,9 +119,6 @@ public final class BotaniaStateProps {
|
||||
// BlockEnchanter
|
||||
public static final PropertyEnum<EnumFacing.Axis> ENCHANTER_DIRECTION = PropertyEnum.create("facing", EnumFacing.Axis.class, Predicates.not(Predicates.equalTo(EnumFacing.Axis.Y)));
|
||||
|
||||
// BlockEndStoneBrick
|
||||
public static final PropertyEnum<EndBrickVariant> ENDBRICK_VARIANT = PropertyEnum.create("variant", EndBrickVariant.class);
|
||||
|
||||
// BlockForestDrum
|
||||
public static final PropertyEnum<DrumVariant> DRUM_VARIANT = PropertyEnum.create("variant", DrumVariant.class);
|
||||
|
||||
@@ -132,7 +132,7 @@ public final class BotaniaStateProps {
|
||||
public static final PropertyEnum<LivingRockVariant> LIVINGROCK_VARIANT = PropertyEnum.create("variant", LivingRockVariant.class);
|
||||
|
||||
// BlockModDoubleFlower (white to gray)
|
||||
public static final PropertyEnum<EnumDyeColor> DOUBLEFLOWER_VARIANT_1 = PropertyEnum.create("variant", EnumDyeColor.class, new Predicate<EnumDyeColor>() {
|
||||
public static final PropertyEnum<EnumDyeColor> DOUBLEFLOWER_VARIANT_1 = PropertyEnum.create("df_variant", EnumDyeColor.class, new Predicate<EnumDyeColor>() {
|
||||
@Override
|
||||
public boolean apply(EnumDyeColor input) {
|
||||
return input.ordinal() >= 0 && input.ordinal() <= 7;
|
||||
@@ -140,7 +140,7 @@ public final class BotaniaStateProps {
|
||||
});
|
||||
|
||||
// (silver to black)
|
||||
public static final PropertyEnum<EnumDyeColor> DOUBLEFLOWER_VARIANT_2 = PropertyEnum.create("variant", EnumDyeColor.class, new Predicate<EnumDyeColor>() {
|
||||
public static final PropertyEnum<EnumDyeColor> DOUBLEFLOWER_VARIANT_2 = PropertyEnum.create("df_variant", EnumDyeColor.class, new Predicate<EnumDyeColor>() {
|
||||
@Override
|
||||
public boolean apply(EnumDyeColor input) {
|
||||
return input.ordinal() >= 8 && input.ordinal() <= 15;
|
||||
@@ -170,9 +170,6 @@ public final class BotaniaStateProps {
|
||||
// BlockPrism
|
||||
public static final PropertyBool HAS_LENS = PropertyBool.create("has_lens");
|
||||
|
||||
// BlockPrismarine
|
||||
public static final PropertyEnum<PrismarineVariant> PRISMARINE_VARIANT = PropertyEnum.create("variant", PrismarineVariant.class);
|
||||
|
||||
// BlockPylon
|
||||
public static final PropertyEnum<PylonVariant> PYLON_VARIANT = PropertyEnum.create("variant", PylonVariant.class);
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Objects;
|
||||
|
||||
// Generic base class for unlisted properties
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/**
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
* <p>
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*/
|
||||
package vazkii.botania.api.state.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public enum EndBrickVariant implements IStringSerializable {
|
||||
END_STONE_BRICKS,
|
||||
CHISELED_END_STONE_BRICKS,
|
||||
ENDER_BRICKS,
|
||||
PILLAR_ENDER_BRICKS;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
/**
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
* <p>
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*/
|
||||
package vazkii.botania.api.state.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public enum FutureStoneVariant implements IStringSerializable {
|
||||
ANDESITE,
|
||||
BASALT,
|
||||
DIORITE,
|
||||
GRANITE,
|
||||
POLISHED_ANDESITE,
|
||||
POLISHED_BASALT,
|
||||
POLISHED_DIORITE,
|
||||
POLISHED_GRANITE,
|
||||
ANDESITE_BRICK,
|
||||
BASALT_BRICK,
|
||||
DIORITE_BRICK,
|
||||
GRANITE_BRICK,
|
||||
CHISELED_ANDESITE,
|
||||
CHISELED_BASALT,
|
||||
CHISELED_DIORITE,
|
||||
CHISELED_GRANITE;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
Loaded 100 of 2029 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user