mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-10-26 22:34:08 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
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 | ||
|
|
cda20175c8 | ||
|
|
46ec4b8127 | ||
|
|
8f46355769 | ||
|
|
93f869a8f5 | ||
|
|
3084b058da | ||
|
|
db23bffea6 | ||
|
|
0d9fe52f5d | ||
|
|
036fc4b0cc | ||
|
|
67bcd94edf | ||
|
|
9975f4b028 | ||
|
|
274b4ab05a | ||
|
|
b581a5544b | ||
|
|
28f4321cfb | ||
|
|
3c5f588431 | ||
|
|
19ed5877df | ||
|
|
2f1bc4188a | ||
|
|
6f6cdf8198 | ||
|
|
132584e937 | ||
|
|
9aa6405566 | ||
|
|
40bad433c8 | ||
|
|
01ca175951 | ||
|
|
298d46399f | ||
|
|
a929156626 | ||
|
|
70942d7089 | ||
|
|
38ca4b429d | ||
|
|
be9e4f731f | ||
|
|
fefb5b5cc4 | ||
|
|
1c752992cf | ||
|
|
c6420168aa | ||
|
|
ae89d0f18d | ||
|
|
ef2ab91b37 | ||
|
|
59232209a4 | ||
|
|
20ab306985 | ||
|
|
076a7ee23a | ||
|
|
b12cd80ad3 | ||
|
|
6d7fe40cd3 | ||
|
|
e4401efeb6 | ||
|
|
a3c30caa40 | ||
|
|
1580790398 | ||
|
|
8f89b630a5 | ||
|
|
861357f313 | ||
|
|
84b171603d | ||
|
|
ae356abcfe | ||
|
|
d498b7cd2e | ||
|
|
50420c3b4b | ||
|
|
99e9cac30a | ||
|
|
18ea3e6bfb | ||
|
|
f51540fd52 | ||
|
|
f8a4018ec7 | ||
|
|
0ee62f53e3 | ||
|
|
fd5606d02d | ||
|
|
94d94b6c79 | ||
|
|
47001131b0 | ||
|
|
1ed833a4a7 | ||
|
|
9d6c10f354 | ||
|
|
52db87735a | ||
|
|
c9281021b6 | ||
|
|
9b3579fe56 | ||
|
|
d5a3a056f5 | ||
|
|
d7d4440b0e | ||
|
|
91d234e6ed | ||
|
|
b4d69dbac2 | ||
|
|
7967f25c1c | ||
|
|
b6427bcae9 | ||
|
|
90f793508a | ||
|
|
db6ccb9016 | ||
|
|
3d5a8aab19 | ||
|
|
59939824a3 | ||
|
|
0c75bc9356 | ||
|
|
ad5b7fd73b | ||
|
|
4f8376a148 | ||
|
|
9e0c7ba0c7 | ||
|
|
769ed577c4 | ||
|
|
b0fe511fc8 | ||
|
|
fc9470777b | ||
|
|
a0d0f2ba65 | ||
|
|
044e61f73f | ||
|
|
abc7756a9b | ||
|
|
c8a01f7da0 | ||
|
|
59b177e231 | ||
|
|
27a5991350 | ||
|
|
e0023c0566 | ||
|
|
6135f44792 | ||
|
|
5270f5ea20 | ||
|
|
ea10c48439 | ||
|
|
3593d4b759 | ||
|
|
9e37f37c53 | ||
|
|
f0f372205c | ||
|
|
7bfeef18a9 | ||
|
|
9a60705967 | ||
|
|
0e617e6046 | ||
|
|
d32ce6c519 | ||
|
|
e0293afad0 | ||
|
|
dfb2ef2a61 | ||
|
|
f44d846d32 | ||
|
|
74d4130ba5 |
No files matched your search
@@ -1,29 +0,0 @@
|
||||
-- API --
|
||||
* Updated to BlockPos and EnumFacing everywhere where it made sense
|
||||
* Registering repainting blocks will need to also receive a PropertyEnum with EnumDyeColor as the component type
|
||||
so Botania knows what property to set the color on
|
||||
* ICorporeaSpark.getInventory had to be changed to ICorporeaSpark.getSparkInventory because the signature clashed (IInventory vs ItemStack[], respectively)
|
||||
This can be changed to match vanilla signature, but either would break backward compat.
|
||||
* SubTileEntity.getComparatorInputOverride parameter removed (it was actually incorrect also. Not side, but the meta of the block).
|
||||
Anyways, vanilla removed it from their method so we follow suit.
|
||||
* SubTileEntity's methods that are copied from block (onBlockadded, etc.) updated to match vanilla counterparts
|
||||
* Multiblock system reworked to use states and blockposes
|
||||
* Magnet blacklist still uses metas instead of states because they need to support the short maxvalue wildcard.
|
||||
* Now includes a way for addons to pass the Botania loader the models they want to use to render their subtile with
|
||||
* Removed icon methods from SubTileSignature
|
||||
|
||||
-- Other --
|
||||
* Lang entries to be updated in non-english: Corporea funnel new numbers. Moving of prismarine entry.
|
||||
* Most things left untouched to make patches from upstream easier
|
||||
* Most uses of chunkcoordinates directly convert blockpos (THANK YOU VAZKII FOR USING THEM). Remove creation of extra instances
|
||||
since BlockPos'es are immutable and thus can be reused everywhere.
|
||||
* Some really needed fields in EntityItem are private now. Reflection time :(
|
||||
* Alfglass now just uses the vanilla random model selection system to choose a pattern. Some of your builds may look different.
|
||||
Unless someone figures out a way to use the old one
|
||||
* The alt textures will probably be a resource pack now to decrease complexity...
|
||||
sorry :/ The systems needed to dynamically switch out the textures like that is not worth just throwing them into a resource pack
|
||||
* Slabs are kinda janky if you look at them - Mojang made some extremely silly assumptions and we're going to have to go with them
|
||||
* Quartz stair textures may be assigned incorrectly - resource pack authors check me
|
||||
* Glass pane inner faces are not getting culled (vanilla bug?)
|
||||
* Some item forms of technical/non-user blocks are removed
|
||||
* Full list: [all double slab items, all solid vine items]
|
||||
@@ -1,14 +1,14 @@
|
||||
1.8 PORT README:
|
||||
README:
|
||||
|
||||
This is williewillus' 1.8(.8) port of Botania!
|
||||
This is williewillus' port and continuation of Botania for Minecraft versions 1.8.x and above
|
||||
|
||||
All licensing and distribution rights are exactly as 1.7.10 Botania
|
||||
All licensing and distribution rights are exactly as 1.7.10 Botania.
|
||||
|
||||
Use at your own risk as bugs may pop up unexpectedly.
|
||||
|
||||
I will EXACTLY match Vazkii/upstream design wise so NEVER ask me for balance or design changes. No.
|
||||
As of 2016 02 25, Vazkii has stopped working on Botania. Requests for design changes will still not be accepted here (post them on reddit). Even then, don't expect anything to be added without severe deliberation scrutiny.
|
||||
|
||||
Please report all 1.8 bugs to MY REPOSITORY, NOT VAZKII'S.
|
||||
Please report all 1.8+ issues to this repository.
|
||||
|
||||
These non-CurseForge builds can be openly used in modpacks of any kind, in accordance with the requirements of the license of this mod.
|
||||
|
||||
|
||||
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"
|
||||
}
|
||||
}
|
||||
+16
-17
@@ -11,12 +11,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 +43,7 @@ minecraft {
|
||||
version = "${config.mc_version}-${config.forge_version}"
|
||||
runDir = "eclipse/assets"
|
||||
|
||||
mappings = "snapshot_20151229"
|
||||
mappings = "snapshot_20160518"
|
||||
//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 +54,6 @@ minecraft {
|
||||
}
|
||||
|
||||
//This here is for SCP
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
configurations {
|
||||
sshAntTask
|
||||
}
|
||||
@@ -66,11 +64,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.9.4:3.4.0.202"
|
||||
|
||||
//and a bit more for SCP
|
||||
sshAntTask "org.apache.ant:ant-jsch:1.7.1", "jsch:jsch:0.1.29"
|
||||
@@ -81,6 +75,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 +98,7 @@ processResources {
|
||||
*/
|
||||
task deobfJar(type: Jar) {
|
||||
from(sourceSets.main.output)
|
||||
archiveName = "${baseName} ${version}-deobf.${extension}"
|
||||
archiveName = "${baseName}.${version}-deobf.${extension}"
|
||||
}
|
||||
|
||||
artifacts {
|
||||
@@ -110,7 +107,7 @@ 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, "")
|
||||
@@ -216,21 +213,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"
|
||||
releaseType = "beta"
|
||||
addGameVersion '1.9.4'
|
||||
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 @@
|
||||
#
|
||||
#Fri Jan 08 18:17:27 GMT 2016
|
||||
#Fri May 27 20:53:49 CDT 2016
|
||||
version=r1.8
|
||||
dir_output=../Build Output/Botania/
|
||||
forge_version=11.15.1.1722
|
||||
mc_version=1.8.9
|
||||
dir_repo=./
|
||||
build_number=249
|
||||
mc_version=1.9.4
|
||||
forge_version=12.17.0.1922-1.9.4
|
||||
build_number=308
|
||||
mod_name=Botania
|
||||
@@ -53,3 +53,7 @@ l0nekitsune=14
|
||||
swiftlileagle=14
|
||||
gryphonn=11
|
||||
loraanicus=10
|
||||
samerater=8
|
||||
coolcabbage16=13
|
||||
eladkay=3
|
||||
tobiasling=9
|
||||
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.inventory;
|
||||
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IDrawerInventory extends ISidedInventory
|
||||
{
|
||||
/**
|
||||
* Gets a drawer's group slot index from an IInventory slot index.
|
||||
*
|
||||
* @param inventorySlot An IInventory slot index returned from getInventorySlot.
|
||||
*/
|
||||
int getDrawerSlot (int inventorySlot);
|
||||
|
||||
/**
|
||||
* Gets an IInventory slot index suitable for operations for the given type.
|
||||
*
|
||||
* @param drawerSlot The index of the drawer within its group.
|
||||
* @param type The type of IInventory slot to return an index for.
|
||||
*/
|
||||
int getInventorySlot (int drawerSlot, SlotType type);
|
||||
|
||||
/**
|
||||
* Gets the type associated with a given IInventory slot index.
|
||||
*
|
||||
* @param inventorySlot An IInventory slot index returned from getInventorySlot.
|
||||
*/
|
||||
SlotType getInventorySlotType (int inventorySlot);
|
||||
|
||||
boolean canInsertItem (int slot, ItemStack stack);
|
||||
|
||||
boolean canExtractItem (int slot, ItemStack stack);
|
||||
|
||||
boolean syncInventoryIfNeeded ();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.inventory;
|
||||
|
||||
/**
|
||||
* Classifies different IInventory slots according to how they should be used.
|
||||
*/
|
||||
public enum SlotType
|
||||
{
|
||||
/** An inventory slot for input-only operations; stack sizes artificially held low. */
|
||||
INPUT,
|
||||
|
||||
/** An inventory slot for output-only operations; stack sizes artificially held high. */
|
||||
OUTPUT;
|
||||
|
||||
public static final SlotType[] values = values();
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public interface IDrawer
|
||||
{
|
||||
/**
|
||||
* Gets an ItemStack of size 1 representing the type, metadata, and tags of the stored items.
|
||||
* The returned ItemStack should not be modified for any reason. Make a copy if you need to store or modify it.
|
||||
*/
|
||||
ItemStack getStoredItemPrototype ();
|
||||
|
||||
/**
|
||||
* Gets an ItemStack initialized to the number of items stored in this drawer.
|
||||
* The returned ItemStack is guaranteed to be a new copy and can be used for any purpose. Does not affect drawer contents.
|
||||
*/
|
||||
ItemStack getStoredItemCopy ();
|
||||
|
||||
/**
|
||||
* Sets the type of the stored item and initializes it to the given amount. Any existing item will be replaced.
|
||||
*
|
||||
* @param itemPrototype An ItemStack representing the type, metadata, and tags of the item to store.
|
||||
* @param amount The amount to initialize the stored item count to.
|
||||
*/
|
||||
void setStoredItem (ItemStack itemPrototype, int amount);
|
||||
|
||||
/**
|
||||
* Gets the number of items stored in this drawer.
|
||||
*/
|
||||
int getStoredItemCount ();
|
||||
|
||||
/**
|
||||
* Sets the number of items stored in this drawer. Triggers syncing of inventories and client data.
|
||||
* Setting a drawer's count to 0 may also result in the item type being cleared, depending in implementation.
|
||||
*
|
||||
* @param amount The new amount of items stored in this drawer.
|
||||
*/
|
||||
void setStoredItemCount (int amount);
|
||||
|
||||
/**
|
||||
* Gets the maximum number of items that can be stored in this drawer.
|
||||
* This value will vary depending on the max stack size of the stored item type.
|
||||
*/
|
||||
int getMaxCapacity ();
|
||||
|
||||
/**
|
||||
* Gets the maximum number of items that could be stored in this drawer if it held the given item.
|
||||
*
|
||||
* @param itemPrototype The item type to query.
|
||||
*/
|
||||
int getMaxCapacity (ItemStack itemPrototype);
|
||||
|
||||
/**
|
||||
* Gets the number of items that could still be added to this drawer before it is full.
|
||||
*/
|
||||
int getRemainingCapacity ();
|
||||
|
||||
/**
|
||||
* Gets the max stack size of the item type stored in this drawer. Convenience method.
|
||||
*/
|
||||
int getStoredItemStackSize ();
|
||||
|
||||
/**
|
||||
* Gets whether or not an item of the given type and data can be stored in this drawer.
|
||||
*
|
||||
* Stack size and available capacity are not considered. For drawers that are not empty, this
|
||||
* method can allow ore-dictionary compatible items to be accepted into the drawer, as defined by what
|
||||
* the drawer considers to be an equivalent item.
|
||||
* For drawers that are empty, locking status is considered.
|
||||
*
|
||||
* @param itemPrototype An ItemStack representing the type, metadata, and tags of an item.
|
||||
*/
|
||||
boolean canItemBeStored (ItemStack itemPrototype);
|
||||
|
||||
/**
|
||||
* Gets whether or not an item of the given type and data can be extracted from this drawer.
|
||||
*
|
||||
* This is intended to allow outbound ore-dictionary conversions of compatible items, as defined by what
|
||||
* the drawer considers to be an equivalent item.
|
||||
*
|
||||
* @param itemPrototype An ItemStack representing the type, metadata, and tags of an item.
|
||||
*/
|
||||
boolean canItemBeExtracted (ItemStack itemPrototype);
|
||||
|
||||
/**
|
||||
* Gets whether or not the drawer has items.
|
||||
* A drawer set with an item type and 0 count is not considered empty.
|
||||
*/
|
||||
boolean isEmpty ();
|
||||
|
||||
/**
|
||||
* Gets auxiliary data that has been associated with this drawer.
|
||||
*
|
||||
* @param key The key used to identify the data.
|
||||
* @return An opaque object that was previously stored.
|
||||
*/
|
||||
Object getExtendedData (String key);
|
||||
|
||||
/**
|
||||
* Stores auxiliary data with this drawer, mainly for use in integration.
|
||||
* @param key The key to identify the data with.
|
||||
* @param data The data to store.
|
||||
*/
|
||||
void setExtendedData (String key, Object data);
|
||||
|
||||
void writeToNBT (NBTTagCompound tag);
|
||||
|
||||
void readFromNBT (NBTTagCompound tag);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.inventory.IDrawerInventory;
|
||||
|
||||
public interface IDrawerGroup
|
||||
{
|
||||
/**
|
||||
* Gets the number of drawers contained within this group.
|
||||
*/
|
||||
int getDrawerCount ();
|
||||
|
||||
/**
|
||||
* Gets the drawer at the given slot within this group.
|
||||
*/
|
||||
IDrawer getDrawer (int slot);
|
||||
|
||||
/**
|
||||
* Gets whether the drawer in the given slot is usable.
|
||||
*/
|
||||
boolean isDrawerEnabled (int slot);
|
||||
|
||||
IDrawerInventory getDrawerInventory ();
|
||||
|
||||
boolean markDirtyIfNeeded ();
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package powercrystals.minefactoryreloaded.api;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IDeepStorageUnit
|
||||
{
|
||||
/**
|
||||
* @return A populated ItemStack with stackSize for the full amount of materials in the DSU.
|
||||
* May have a stackSize > getMaxStackSize(). May have a stackSize of 0 (indicating locked contents).
|
||||
*/
|
||||
ItemStack getStoredItemType();
|
||||
|
||||
/**
|
||||
* Sets the total amount of the item currently being stored, or zero if all items are to be removed.
|
||||
*/
|
||||
void setStoredItemCount(int amount);
|
||||
|
||||
/**
|
||||
* Sets the type of the stored item and initializes the number of stored items to amount.
|
||||
* Will overwrite any existing stored items.
|
||||
*/
|
||||
void setStoredItemType(ItemStack type, int amount);
|
||||
|
||||
/**
|
||||
* @return The maximum number of items the DSU can hold.
|
||||
* May change based on the current type stored.
|
||||
*/
|
||||
int getMaxStoredCount();
|
||||
}
|
||||
@@ -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,32 +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;
|
||||
@@ -36,8 +32,11 @@ 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;
|
||||
import vazkii.botania.api.internal.DummyMethodHandler;
|
||||
@@ -60,65 +59,76 @@ 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.addEnum(ArmorMaterial.class, "MANASTEEL",
|
||||
new Class[] { String.class, int.class, int[].class, int.class, SoundEvent.class, float.class },
|
||||
"manasteel", 16, new int[] { 2, 6, 5, 2 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 1.0F); // todo 1.9.4 toughness
|
||||
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.addEnum(ArmorMaterial.class, "B_ELEMENTIUM",
|
||||
new Class[] { String.class, int.class, int[].class, int.class, SoundEvent.class, float.class },
|
||||
"b_elementium", 18, new int[] { 2, 6, 5, 2 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 1.0F); // todo 1.9.4 toughness
|
||||
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.addEnum(ArmorMaterial.class, "TERRASTEEL",
|
||||
new Class[] { String.class, int.class, int[].class, int.class, SoundEvent.class, float.class },
|
||||
"terrasteel", 34, new int[] {3, 8, 6, 3}, 26, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 1.0F); // todo 1.9.4 toughness
|
||||
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.addEnum(ArmorMaterial.class, "MANAWEAVE",
|
||||
new Class[] { String.class, int.class, int[].class, int.class, SoundEvent.class, float.class },
|
||||
"manaweave", 5, new int[] { 1, 2, 2, 1 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, 1.0F); // todo 1.9.4 toughness
|
||||
|
||||
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;
|
||||
@@ -132,14 +142,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
|
||||
@@ -210,12 +220,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"));
|
||||
|
||||
@@ -245,12 +255,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
|
||||
@@ -275,7 +285,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;
|
||||
@@ -299,47 +309,46 @@ public final class BotaniaAPI {
|
||||
return fallbackBrew;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Registers a Block as disposable using its Ore Dictionary Name.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
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
|
||||
* The component type of the property must be EnumDyeColor
|
||||
*/
|
||||
public static Block registerPaintableBlock(Block paintable, PropertyEnum<EnumDyeColor> colorProp){
|
||||
paintableBlocks.put(paintable, colorProp);
|
||||
return paintable;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Blacklists an Entity from being affected by the Rod of the Shaded Mesa.
|
||||
* Pass in the class for the Entity, e.g. EntityCow.class
|
||||
*/
|
||||
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()
|
||||
*/
|
||||
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.
|
||||
@@ -361,11 +370,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);
|
||||
@@ -388,7 +397,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)
|
||||
@@ -407,19 +416,32 @@ public final class BotaniaAPI {
|
||||
* @return The recipe created.
|
||||
*/
|
||||
public static RecipePetals registerPetalRecipe(ItemStack output, Object... inputs) {
|
||||
Preconditions.checkArgument(inputs.length <= 16);
|
||||
RecipePetals recipe = new RecipePetals(output, inputs);
|
||||
petalRecipes.add(recipe);
|
||||
return recipe;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a Pure Daisy Recipe.
|
||||
* Registers a Pure Daisy Recipe with the default time
|
||||
* @param input The block that works as an input for the recipe. Can be a Block or an oredict String.
|
||||
* @param outputState The blockstate to be placed upon recipe completion.
|
||||
* @return The recipe created.
|
||||
*/
|
||||
public static RecipePureDaisy registerPureDaisyRecipe(Object input, IBlockState outputState) {
|
||||
RecipePureDaisy recipe = new RecipePureDaisy(input, outputState);
|
||||
return registerPureDaisyRecipe(input, outputState, RecipePureDaisy.DEFAULT_TIME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a Pure Daisy Recipe.
|
||||
* @param input The block that works as an input for the recipe. Can be a Block or an oredict String.
|
||||
* @param outputState The blockstate to be placed upon recipe completion.
|
||||
* @param time The amount of time in ticks to complete this recipe. Note that this is ticks on your block, not total time.
|
||||
* The Pure Daisy only ticks one block at a time in a round robin fashion.
|
||||
* @return The recipe created.
|
||||
*/
|
||||
public static RecipePureDaisy registerPureDaisyRecipe(Object input, IBlockState outputState, int time) {
|
||||
RecipePureDaisy recipe = new RecipePureDaisy(input, outputState, time);
|
||||
pureDaisyRecipes.add(recipe);
|
||||
return recipe;
|
||||
}
|
||||
@@ -433,6 +455,7 @@ public final class BotaniaAPI {
|
||||
* @return The recipe created.
|
||||
*/
|
||||
public static RecipeRuneAltar registerRuneAltarRecipe(ItemStack output, int mana, Object... inputs) {
|
||||
Preconditions.checkArgument(inputs.length <= 16);
|
||||
RecipeRuneAltar recipe = new RecipeRuneAltar(output, mana, inputs);
|
||||
runeAltarRecipes.add(recipe);
|
||||
return recipe;
|
||||
@@ -446,6 +469,7 @@ public final class BotaniaAPI {
|
||||
* @return The recipe created.
|
||||
*/
|
||||
public static RecipeManaInfusion registerManaInfusionRecipe(ItemStack output, Object input, int mana) {
|
||||
Preconditions.checkArgument(mana <= 1000000);
|
||||
RecipeManaInfusion recipe = new RecipeManaInfusion(output, input, mana);
|
||||
manaInfusionRecipes.add(recipe);
|
||||
return recipe;
|
||||
@@ -458,7 +482,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;
|
||||
}
|
||||
|
||||
@@ -469,7 +493,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;
|
||||
}
|
||||
|
||||
@@ -488,9 +512,10 @@ 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);
|
||||
RecipeBrew recipe = new RecipeBrew(brew, inputs);
|
||||
brewRecipes.add(recipe);
|
||||
return recipe;
|
||||
@@ -498,9 +523,10 @@ public final class BotaniaAPI {
|
||||
|
||||
/**
|
||||
* Registers a SubTileEntity, a new special flower. Look in the subtile package of the API.
|
||||
* If you call this after PostInit you're a failiure and we are very disappointed in you.
|
||||
* Call this in preInit, and don't forget to register a model in BotaniaAPIClient.
|
||||
*/
|
||||
public static void registerSubTile(String key, Class<? extends SubTileEntity> subtileClass) {
|
||||
Preconditions.checkArgument(Loader.instance().isInState(LoaderState.PREINITIALIZATION));
|
||||
subTiles.put(key, subtileClass);
|
||||
subTileMods.put(key, Loader.instance().activeModContainer().getModId());
|
||||
}
|
||||
@@ -655,7 +681,7 @@ public final class BotaniaAPI {
|
||||
|
||||
/**
|
||||
* Registers a Wiki provider for a mod so it uses that instead of the fallback
|
||||
* FTB wiki. Make sure to call this on PostInit only!
|
||||
* FTB wiki.
|
||||
*/
|
||||
public static void registerModWiki(String mod, IWikiProvider provider) {
|
||||
WikiHooks.registerModWiki(mod, provider);
|
||||
|
||||
@@ -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,25 +10,24 @@
|
||||
*/
|
||||
package vazkii.botania.api.brew;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
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.
|
||||
*/
|
||||
public class Brew {
|
||||
|
||||
String key;
|
||||
String name;
|
||||
int color;
|
||||
int cost;
|
||||
List<PotionEffect> effects;
|
||||
boolean canInfuseBloodPendant = true;
|
||||
boolean canInfuseIncense = true;
|
||||
private final String key;
|
||||
private final String name;
|
||||
private final int color;
|
||||
private final int cost;
|
||||
private final List<PotionEffect> effects;
|
||||
private boolean canInfuseBloodPendant = true;
|
||||
private boolean canInfuseIncense = true;
|
||||
|
||||
/**
|
||||
* @param name The unlocalized name of this potion.
|
||||
@@ -42,7 +41,7 @@ public class Brew {
|
||||
this.name = name;
|
||||
this.color = color;
|
||||
this.cost = cost;
|
||||
this.effects = new ArrayList<>(Arrays.asList(effects));
|
||||
this.effects = ImmutableList.copyOf(effects);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -115,7 +114,7 @@ public class Brew {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of potion effects for the ItemStack passed in.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
@@ -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,30 +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;
|
||||
|
||||
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
|
||||
@@ -54,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);
|
||||
}
|
||||
@@ -85,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);
|
||||
}
|
||||
|
||||
@@ -94,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;
|
||||
@@ -116,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);
|
||||
}
|
||||
|
||||
@@ -126,22 +123,15 @@ 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<>();
|
||||
|
||||
for(IInventory inv : inventories) {
|
||||
int count = 0;
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
if(!isValidSlot(inv, i))
|
||||
continue;
|
||||
|
||||
ItemStack stackAt = inv.getStackInSlot(i);
|
||||
if(stacksMatch(stack, stackAt, checkNBT))
|
||||
count += stackAt.stackSize;
|
||||
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);
|
||||
inv.countItems(request);
|
||||
if (request.foundItems > 0) {
|
||||
countMap.put(inv.getWrappedObject(), request.foundItems);
|
||||
}
|
||||
|
||||
if(count > 0)
|
||||
countMap.put(inv, count);
|
||||
}
|
||||
|
||||
return countMap;
|
||||
@@ -170,6 +160,9 @@ public final class CorporeaHelper {
|
||||
* The "matcher" parameter has to be an ItemStack or a String, if the first it'll check if the
|
||||
* two stacks are similar using the "checkNBT" parameter, else it'll check if the name of the item
|
||||
* equals or matches (case a regex is passed in) the matcher string.
|
||||
* <br><br>
|
||||
* When requesting counting of items, individual stacks may exceed maxStackSize for
|
||||
* purposes of counting huge amounts.
|
||||
*/
|
||||
public static List<ItemStack> requestItem(Object matcher, int itemCount, ICorporeaSpark spark, boolean checkNBT, boolean doit) {
|
||||
List<ItemStack> stacks = new ArrayList<>();
|
||||
@@ -177,55 +170,32 @@ public final class CorporeaHelper {
|
||||
if(MinecraftForge.EVENT_BUS.post(event))
|
||||
return stacks;
|
||||
|
||||
List<IInventory> inventories = getInventoriesOnNetwork(spark);
|
||||
Map<ICorporeaInterceptor, ICorporeaSpark> interceptors = new HashMap<>();
|
||||
List<InvWithLocation> inventories = getInventoriesOnNetwork(spark);
|
||||
|
||||
lastRequestMatches = 0;
|
||||
lastRequestExtractions = 0;
|
||||
List<IWrappedInventory> inventoriesW = BotaniaAPI.internalHandler.wrapInventory(inventories);
|
||||
Map<ICorporeaInterceptor, ICorporeaSpark> interceptors = new HashMap<ICorporeaInterceptor, ICorporeaSpark>();
|
||||
|
||||
int count = itemCount;
|
||||
for(IInventory inv : inventories) {
|
||||
boolean removedAny = false;
|
||||
ICorporeaSpark invSpark = getSparkForInventory(inv);
|
||||
CorporeaRequest request = new CorporeaRequest(matcher, checkNBT, itemCount);
|
||||
for(IWrappedInventory inv : inventoriesW) {
|
||||
ICorporeaSpark invSpark = inv.getSpark();
|
||||
|
||||
if(inv instanceof ICorporeaInterceptor) {
|
||||
ICorporeaInterceptor interceptor = (ICorporeaInterceptor) inv;
|
||||
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);
|
||||
}
|
||||
|
||||
for(int i = inv.getSizeInventory() - 1; i >= 0; i--) {
|
||||
if(!isValidSlot(inv, i))
|
||||
continue;
|
||||
|
||||
ItemStack stackAt = inv.getStackInSlot(i);
|
||||
if(matcher instanceof ItemStack ? stacksMatch((ItemStack) matcher, stackAt, checkNBT) : matcher instanceof String ? stacksMatch(stackAt, (String) matcher) : false) {
|
||||
int rem = Math.min(stackAt.stackSize, count == -1 ? stackAt.stackSize : count);
|
||||
|
||||
if(rem > 0) {
|
||||
ItemStack copy = stackAt.copy();
|
||||
if(rem < copy.stackSize)
|
||||
copy.stackSize = rem;
|
||||
stacks.add(copy);
|
||||
}
|
||||
|
||||
lastRequestMatches += stackAt.stackSize;
|
||||
lastRequestExtractions += rem;
|
||||
if(doit && rem > 0) {
|
||||
inv.decrStackSize(i, rem);
|
||||
removedAny = true;
|
||||
if(invSpark != null)
|
||||
invSpark.onItemExtracted(stackAt);
|
||||
}
|
||||
if(count != -1)
|
||||
count -= rem;
|
||||
}
|
||||
if(doit) {
|
||||
stacks.addAll(inv.extractItems(request));
|
||||
} else {
|
||||
stacks.addAll(inv.countItems(request));
|
||||
}
|
||||
|
||||
if(removedAny)
|
||||
inv.markDirty();
|
||||
}
|
||||
|
||||
lastRequestMatches = request.foundItems;
|
||||
lastRequestExtractions = request.extractedItems;
|
||||
|
||||
for(ICorporeaInterceptor interceptor : interceptors.keySet())
|
||||
interceptor.interceptRequestLast(matcher, itemCount, interceptors.get(interceptor), spark, stacks, inventories, doit);
|
||||
|
||||
@@ -235,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());
|
||||
}
|
||||
|
||||
@@ -260,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.
|
||||
*/
|
||||
@@ -309,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.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* This class was created by <Vindex>. 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
|
||||
*
|
||||
*/
|
||||
package vazkii.botania.api.corporea;
|
||||
|
||||
public class CorporeaRequest {
|
||||
public final Object matcher;
|
||||
public final boolean checkNBT;
|
||||
public int count;
|
||||
public int foundItems = 0;
|
||||
public int extractedItems = 0;
|
||||
|
||||
public CorporeaRequest(Object matcher, boolean checkNBT, int count) {
|
||||
super();
|
||||
this.matcher = matcher;
|
||||
this.checkNBT = checkNBT;
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* This class was created by <Vindex>. 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
|
||||
*
|
||||
*/
|
||||
package vazkii.botania.api.corporea;
|
||||
|
||||
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.
|
||||
*
|
||||
*/
|
||||
public interface IWrappedInventory {
|
||||
|
||||
/**
|
||||
* Break encapsulation and exposes original inventory.
|
||||
*/
|
||||
InvWithLocation getWrappedObject();
|
||||
|
||||
/**
|
||||
* Counts items in the inventory matching the request
|
||||
*
|
||||
* @param request
|
||||
* - specifies what should be found
|
||||
* @return List of ItemStack, individual stacks may exceed maxStackSize for
|
||||
* purposes of counting huge amounts. To get final count requestor
|
||||
* should sum stackSize of all stacks.
|
||||
*/
|
||||
List<ItemStack> countItems(CorporeaRequest request);
|
||||
|
||||
/**
|
||||
* Convenience method for accessing spark over inventory
|
||||
*/
|
||||
ICorporeaSpark getSpark();
|
||||
|
||||
/**
|
||||
* Extracts items matching request from the inventory.<br/>
|
||||
* {@link CorporeaRequest#count} is updated to reflect how many items are
|
||||
* yet to be extracted.<br/>
|
||||
* {@link CorporeaRequest#foundItems} and
|
||||
* {@link CorporeaRequest#extractedItems} are updated to reflect how many
|
||||
* items were found and extracted.
|
||||
*
|
||||
* @param request
|
||||
* @return List of ItemStacks to be delivered to the destination.
|
||||
*/
|
||||
List<ItemStack> extractItems(CorporeaRequest 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,14 +10,14 @@
|
||||
*/
|
||||
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();
|
||||
@@ -38,13 +38,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,11 +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;
|
||||
@@ -36,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
|
||||
@@ -119,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
|
||||
@@ -159,7 +161,7 @@ public class DummyMethodHandler implements IInternalMethodHandler {
|
||||
|
||||
@Override
|
||||
public ItemStack getBindDisplayForFlowerType(SubTileEntity e) {
|
||||
return new ItemStack(Blocks.stone, 0, 0);
|
||||
return new ItemStack(Blocks.STONE, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -177,6 +179,11 @@ public class DummyMethodHandler implements IInternalMethodHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemHandlerModifiable getBaublesInventoryWrapped(EntityPlayer player) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldForceCheck() {
|
||||
return true;
|
||||
@@ -192,11 +199,6 @@ public class DummyMethodHandler implements IInternalMethodHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBossStatus(IBotaniaBoss status) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBuildcraftPipe(TileEntity tile) {
|
||||
return false;
|
||||
@@ -227,4 +229,9 @@ public class DummyMethodHandler implements IInternalMethodHandler {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
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
|
||||
|
||||
@@ -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,11 +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;
|
||||
@@ -34,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.
|
||||
@@ -96,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);
|
||||
@@ -112,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);
|
||||
@@ -124,4 +126,9 @@ public interface IInternalMethodHandler {
|
||||
|
||||
public void sendBaubleUpdatePacket(EntityPlayer player, int slot);
|
||||
|
||||
/**
|
||||
* Wrap inventories in the network into wrappers providing compatibility for storage mods.
|
||||
*/
|
||||
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) {
|
||||
|
||||
@@ -10,13 +10,19 @@
|
||||
*/
|
||||
package vazkii.botania.api.item;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import vazkii.botania.api.mana.IManaReceiver;
|
||||
|
||||
/**
|
||||
* A TileEntity that implements this is considered an Avatar.
|
||||
*/
|
||||
public interface IAvatarTile extends IInventory, IManaReceiver {
|
||||
public interface IAvatarTile extends IManaReceiver {
|
||||
|
||||
/**
|
||||
* Gets the avatar's inventory
|
||||
* @return An IItemhandler representing the avatar's inventory
|
||||
*/
|
||||
public IItemHandler getInventory();
|
||||
|
||||
/**
|
||||
* Gets the amount of ticks that have elapsed on this avatar while it's functional
|
||||
|
||||
@@ -14,9 +14,6 @@ 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;
|
||||
|
||||
/**
|
||||
* A Bauble Item that implements this will be have hooks to render something on
|
||||
* the player while its equipped.
|
||||
|
||||
@@ -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.
|
||||
@@ -28,8 +28,10 @@ public interface IRelic {
|
||||
public void bindToUsername(String playerName, ItemStack stack);
|
||||
|
||||
/**
|
||||
* Gets the username of the person this relic is bound to.
|
||||
* Gets the username of the person this relic is bound to, or the empty String if the username field is empty.
|
||||
* You should not use this to determine if a relic is bound, use UUIDs instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public String getSoulbindUsername(ItemStack stack);
|
||||
|
||||
/**
|
||||
@@ -38,12 +40,12 @@ public interface IRelic {
|
||||
public void bindToUUID(UUID uuid, ItemStack stack);
|
||||
|
||||
/**
|
||||
* Gets the UUID of the person this relic is bound to.
|
||||
* Gets the UUID of the person this relic is bound to, or null if a well-formed UUID could not be found
|
||||
*/
|
||||
public UUID getSoulbindUUID(ItemStack stack);
|
||||
|
||||
/**
|
||||
* Checks if the relic is using UUIDs.
|
||||
* Checks if the relic contains a well-formed UUID.
|
||||
*/
|
||||
public boolean hasUUID(ItemStack stack);
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
*/
|
||||
package vazkii.botania.api.lexicon;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.mana.IManaItem;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 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 +23,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.
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
@@ -145,7 +145,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));
|
||||
|
||||
@@ -4,12 +4,32 @@ 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) ^ System.identityHashCode(tile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof TileSignature
|
||||
&& tile == ((TileSignature) o).tile
|
||||
&& remoteWorld == ((TileSignature) o).remoteWorld;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -38,15 +38,7 @@ public interface ISparkAttachable extends IManaReceiver {
|
||||
|
||||
/**
|
||||
* Gets the Spark that is attached to this block. A common implementation is
|
||||
* to check for Spark entities above:
|
||||
*
|
||||
List<ISparkEntity> sparks = worldObj.getEntitiesWithinAABB(ISparkEntity.class, new AxisAlignedBB(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 2, zCoord + 1));
|
||||
if(sparks.size() == 1) {
|
||||
Entity e = (Entity) sparks.get(0);
|
||||
return (ISparkEntity) e;
|
||||
}
|
||||
|
||||
return null;
|
||||
* to check for Spark entities above using world.getEntitiesWithinAABB()
|
||||
*/
|
||||
public ISparkEntity getAttachedSpark();
|
||||
|
||||
|
||||
@@ -19,15 +19,7 @@ public interface ISparkEntity {
|
||||
|
||||
/**
|
||||
* Which TileEntity is this Spark attached to? A common implementation is checking the block below.
|
||||
*
|
||||
int x = MathHelper.floor_double(posX);
|
||||
int y = MathHelper.floor_double(posY) - 1;
|
||||
int z = MathHelper.floor_double(posZ);
|
||||
TileEntity tile = worldObj.getTileEntity(x, y, z);
|
||||
if(tile != null && tile instanceof ISparkAttachable)
|
||||
return (ISparkAttachable) tile;
|
||||
|
||||
return null;
|
||||
* using world.getTileEntity(new BlockPos(this).down())
|
||||
*/
|
||||
public ISparkAttachable getAttachedTile();
|
||||
|
||||
@@ -49,12 +41,12 @@ public interface ISparkEntity {
|
||||
* 3: Recessive<br>
|
||||
* 4: Isolated
|
||||
*/
|
||||
public int getUpgrade();
|
||||
public SparkUpgradeType getUpgrade();
|
||||
|
||||
/**
|
||||
* Sets the upgrade on this Spark. See {@link ISparkEntity#getUpgrade}
|
||||
*/
|
||||
public void setUpgrade(int upgrade);
|
||||
public void setUpgrade(SparkUpgradeType upgrade);
|
||||
|
||||
/**
|
||||
* See {@link ISparkAttachable#areIncomingTranfersDone()}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package vazkii.botania.api.mana.spark;
|
||||
|
||||
public enum SparkUpgradeType {
|
||||
NONE,
|
||||
DISPERSIVE,
|
||||
DOMINANT,
|
||||
RECESSIVE,
|
||||
ISOLATED
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
@API(owner = "Botania", apiVersion = "76", 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
|
||||
@@ -29,7 +29,7 @@ public class ElvenPortalUpdateEvent extends Event {
|
||||
*/
|
||||
public final TileEntity portalTile;
|
||||
public final AxisAlignedBB aabb;
|
||||
public boolean open;
|
||||
public final boolean open;
|
||||
public final List<ItemStack> stacksInside;
|
||||
|
||||
public ElvenPortalUpdateEvent(TileEntity te, AxisAlignedBB aabb, boolean open, List<ItemStack> stacks) {
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
*/
|
||||
package vazkii.botania.api.recipe;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.item.IPetalApothecary;
|
||||
|
||||
/**
|
||||
* Have an Item implement this to allow it to be used in the Petal Apothecary.
|
||||
*/
|
||||
public interface IFlowerComponent {
|
||||
|
||||
public boolean canFit(ItemStack stack, IInventory apothecary);
|
||||
public boolean canFit(ItemStack stack, IPetalApothecary apothecary);
|
||||
|
||||
public int getParticleColor(ItemStack stack);
|
||||
|
||||
|
||||
@@ -10,38 +10,39 @@
|
||||
*/
|
||||
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 {
|
||||
|
||||
Brew brew;
|
||||
List<Object> inputs;
|
||||
private final Brew brew;
|
||||
private final ImmutableList<Object> inputs;
|
||||
|
||||
public RecipeBrew(Brew brew, Object... inputs) {
|
||||
this.brew = brew;
|
||||
|
||||
List<Object> inputsToSet = new ArrayList<>();
|
||||
ImmutableList.Builder<Object> inputsToSet = ImmutableList.builder();
|
||||
for(Object obj : inputs) {
|
||||
if(obj instanceof String || obj instanceof ItemStack)
|
||||
inputsToSet.add(obj);
|
||||
else throw new IllegalArgumentException("Invalid input");
|
||||
}
|
||||
|
||||
this.inputs = inputsToSet;
|
||||
this.inputs = inputsToSet.build();
|
||||
}
|
||||
|
||||
public boolean matches(IInventory inv) {
|
||||
public boolean matches(IItemHandler inv) {
|
||||
List<Object> inputsMissing = new ArrayList<>(inputs);
|
||||
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
for(int i = 0; i < inv.getSlots(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(stack == null)
|
||||
break;
|
||||
@@ -87,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();
|
||||
}
|
||||
|
||||
@@ -105,10 +106,22 @@ 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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 31 * brew.hashCode() ^ inputs.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof RecipeBrew
|
||||
&& brew == ((RecipeBrew) o).brew
|
||||
&& inputs.equals(((RecipeBrew) o).inputs);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,27 +1,28 @@
|
||||
package vazkii.botania.api.recipe;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class RecipeElvenTrade {
|
||||
|
||||
ItemStack output;
|
||||
List<Object> inputs;
|
||||
private final ItemStack output;
|
||||
private final ImmutableList<Object> inputs;
|
||||
|
||||
public RecipeElvenTrade(ItemStack output, Object... inputs) {
|
||||
this.output = output;
|
||||
|
||||
List<Object> inputsToSet = new ArrayList<>();
|
||||
ImmutableList.Builder<Object> inputsToSet = ImmutableList.builder();
|
||||
for(Object obj : inputs) {
|
||||
if(obj instanceof String || obj instanceof ItemStack)
|
||||
inputsToSet.add(obj);
|
||||
else throw new IllegalArgumentException("Invalid input");
|
||||
}
|
||||
|
||||
this.inputs = inputsToSet;
|
||||
this.inputs = inputsToSet.build();
|
||||
}
|
||||
|
||||
public boolean matches(List<ItemStack> stacks, boolean remove) {
|
||||
@@ -79,12 +80,12 @@ 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();
|
||||
}
|
||||
|
||||
public List<Object> getInputs() {
|
||||
return new ArrayList<>(inputs);
|
||||
return inputs;
|
||||
}
|
||||
|
||||
public ItemStack getOutput() {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
ItemStack output;
|
||||
Object input;
|
||||
int mana;
|
||||
boolean isAlchemy = false;
|
||||
boolean isConjuration = false;
|
||||
private final ItemStack output;
|
||||
private final Object input;
|
||||
private final int mana;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Loaded 100 of 1352 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user