mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-15 09:34:57 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2d9da6af7 | ||
|
|
a9819781d0 | ||
|
|
055834b63a | ||
|
|
e244a0c82c | ||
|
|
ef96f754d8 | ||
|
|
32270601e7 | ||
|
|
823305dd94 | ||
|
|
bbf80a4320 | ||
|
|
4057537027 | ||
|
|
3a294b79a7 | ||
|
|
206d483422 | ||
|
|
6d51d53da1 | ||
|
|
1ee6c05494 | ||
|
|
8feb3500a4 | ||
|
|
4515aa513a | ||
|
|
c06057ddd0 | ||
|
|
9b4a4c2b1d | ||
|
|
2b3d21b05d | ||
|
|
cb43bbee52 | ||
|
|
b92a1a10e9 | ||
|
|
8a431e56ef | ||
|
|
f73b48695e | ||
|
|
0454fea0a8 | ||
|
|
4ff772954e | ||
|
|
d8304d5d7e | ||
|
|
a12cfff9d9 | ||
|
|
d34ad60d31 | ||
|
|
508b26ca45 | ||
|
|
255bd9da99 | ||
|
|
5cedc2adca | ||
|
|
c968278d27 | ||
|
|
2392785daa | ||
|
|
e82691165f | ||
|
|
e54cd57162 | ||
|
|
0a3a933b77 | ||
|
|
10dbed1406 | ||
|
|
b515870cb4 | ||
|
|
30010d2554 | ||
|
|
317d9abfda | ||
|
|
7df3a94916 | ||
|
|
8158562974 | ||
|
|
a96ce6c873 | ||
|
|
6efbdd747d | ||
|
|
82dd0e5eed | ||
|
|
64c0590bef | ||
|
|
691ccd578e | ||
|
|
98cd99aa4e | ||
|
|
cd8e78f60a | ||
|
|
5ed536da7c | ||
|
|
96ca20c784 | ||
|
|
764d969bb4 | ||
|
|
a26a86fe99 | ||
|
|
ebe6580aaf | ||
|
|
e90ab8caf6 | ||
|
|
efdffd31c8 | ||
|
|
fa515f0941 | ||
|
|
78c033a7d2 | ||
|
|
4975fa80c3 | ||
|
|
aa642a3ee8 | ||
|
|
b19809bd3c | ||
|
|
b566a1befd | ||
|
|
88c9270316 | ||
|
|
f52cc3893b | ||
|
|
b7578e3a11 | ||
|
|
c124a34533 | ||
|
|
ae038b23f2 | ||
|
|
df29777b49 | ||
|
|
a786d71cfd | ||
|
|
2b757ae91a | ||
|
|
decc351e04 | ||
|
|
98806129bc | ||
|
|
55c01f4cea | ||
|
|
38447d4d13 | ||
|
|
348149f4d6 | ||
|
|
dfb4504cde | ||
|
|
f12c6d2d11 | ||
|
|
0ff0aa802c | ||
|
|
fd25e0822d | ||
|
|
649c13f5f0 | ||
|
|
630dcde28a | ||
|
|
d4dee797d7 | ||
|
|
47ff5d9ad1 | ||
|
|
6ff1d8b8d7 | ||
|
|
934ffde12a | ||
|
|
6c806c377a | ||
|
|
24c8add7fc | ||
|
|
8c39ad956e | ||
|
|
36ccd5c3e1 | ||
|
|
d621d8a5df | ||
|
|
76d77b4784 | ||
|
|
6efbd6e158 | ||
|
|
aa45da81ba | ||
|
|
3cd1c30dbc | ||
|
|
8ba478d758 | ||
|
|
b5a8740e4a | ||
|
|
8f6b056776 | ||
|
|
d72ba48a1a | ||
|
|
c0a3e2240f | ||
|
|
46f78ce7b3 | ||
|
|
b0bc8429ac | ||
|
|
9c44111665 | ||
|
|
54a9da917d | ||
|
|
bcafbcbc32 | ||
|
|
2ce018d84b | ||
|
|
0638822b74 | ||
|
|
2b8d905e0e | ||
|
|
d0f28a32b2 | ||
|
|
b74e142ce1 | ||
|
|
3d95b9f6d9 | ||
|
|
571d158809 | ||
|
|
9cd6bfcfa8 | ||
|
|
ebc70ab22a | ||
|
|
e3e4a4341d | ||
|
|
918e4f0099 | ||
|
|
123bed88a2 | ||
|
|
9de446cc4e | ||
|
|
f328efa4e9 | ||
|
|
cdb5ddeb6a | ||
|
|
7f83c387e3 | ||
|
|
95c52f3607 | ||
|
|
19a30bdb91 | ||
|
|
1b262d6604 | ||
|
|
ca73687940 | ||
|
|
ed2f06c514 | ||
|
|
bef36c15b0 | ||
|
|
7dba583c26 | ||
|
|
3168639c89 | ||
|
|
e9019fd8c3 | ||
|
|
d43cc63367 | ||
|
|
89e8ec8e38 | ||
|
|
f270231e67 | ||
|
|
34be92d462 | ||
|
|
eea193aa83 | ||
|
|
d6a5827f0b | ||
|
|
a093e7c094 | ||
|
|
4ea0795063 | ||
|
|
31b83ea852 | ||
|
|
0f494d4ac7 | ||
|
|
0cfddef397 | ||
|
|
e4478bc296 | ||
|
|
6a921c78fb | ||
|
|
5f9e0f30fd | ||
|
|
355ba9a7ed | ||
|
|
424bc8910d | ||
|
|
6eab284cd1 | ||
|
|
1745a7e946 | ||
|
|
74e381f184 | ||
|
|
0b2589b007 | ||
|
|
d29187746d | ||
|
|
26d538cb50 | ||
|
|
d48fca4652 | ||
|
|
211ab566a7 | ||
|
|
bb7a42dff5 | ||
|
|
31bcc661cd | ||
|
|
43a29e7ec8 | ||
|
|
13905ee4a9 | ||
|
|
2b9b105211 | ||
|
|
8b10349309 | ||
|
|
0d26b6b2f2 | ||
|
|
3e5de52efd | ||
|
|
e30e9f4ab9 | ||
|
|
05d1eb87ce | ||
|
|
7679dfc393 | ||
|
|
bb52acc67c | ||
|
|
3caf8cbfef | ||
|
|
207f15ed0b | ||
|
|
c5178be225 | ||
|
|
cd7250604e | ||
|
|
533c9d0b2a | ||
|
|
c00fa15f0e | ||
|
|
ce3dea42e3 | ||
|
|
287cb8cb87 | ||
|
|
10fec50457 | ||
|
|
43c61c18c0 | ||
|
|
dca593f7d8 | ||
|
|
4c874fcf7d | ||
|
|
e62a2f1199 | ||
|
|
8ab94e6741 | ||
|
|
1278c09064 | ||
|
|
ed0b884bce | ||
|
|
85f413f857 | ||
|
|
3cc298b0f1 | ||
|
|
8b0d54f3ec | ||
|
|
40445462f1 | ||
|
|
8eea336fdb | ||
|
|
521514f3d2 | ||
|
|
cc50a05f43 | ||
|
|
1fc56c3b20 | ||
|
|
9cee882788 | ||
|
|
9404f769bb | ||
|
|
7b8b317ffe | ||
|
|
b40a6d4ec9 | ||
|
|
42865951a9 | ||
|
|
a058c3f8c9 | ||
|
|
a83e428d29 | ||
|
|
9c41566485 | ||
|
|
842b9c7199 | ||
|
|
cbb0c15783 | ||
|
|
cbc6f9acff | ||
|
|
03ecce51cc | ||
|
|
644145ac92 | ||
|
|
850a7e2919 | ||
|
|
1f54359836 | ||
|
|
debde28aba | ||
|
|
a2aa07c917 | ||
|
|
3c9572eb83 | ||
|
|
03fd954781 | ||
|
|
2002dff3c9 | ||
|
|
d9ade6dae0 | ||
|
|
3b547c1b87 | ||
|
|
05070982dc | ||
|
|
9833dbb01f | ||
|
|
e67ef8adec | ||
|
|
b5b4ff2de6 | ||
|
|
f78e21e31a | ||
|
|
457962c716 | ||
|
|
7a0dde1140 | ||
|
|
5f7f7fbed6 | ||
|
|
c107c75cbe | ||
|
|
8ed4fa8d7b | ||
|
|
5a10d8a0b2 | ||
|
|
16c3fae45d | ||
|
|
b3be6a8f02 | ||
|
|
aac4d730d6 | ||
|
|
dacd2741a3 | ||
|
|
2f47114015 | ||
|
|
b7ae349314 | ||
|
|
fbea338462 | ||
|
|
b07e5a1556 | ||
|
|
13f49fc930 | ||
|
|
3c4b025c74 | ||
|
|
3df3d9121e | ||
|
|
58ab49d66e | ||
|
|
37893d8aca | ||
|
|
9814601ff2 | ||
|
|
11e8a06a48 | ||
|
|
26f44a2862 | ||
|
|
3073473b0e | ||
|
|
61af8ba6c9 | ||
|
|
3e60c43b30 | ||
|
|
e9ae149ba2 | ||
|
|
b62ec72422 | ||
|
|
50ef3d8b2c | ||
|
|
a0e15f76ca | ||
|
|
e7766d3ad9 | ||
|
|
4e096e7338 | ||
|
|
88fd031fb4 | ||
|
|
ee272de168 | ||
|
|
1faaa6e297 | ||
|
|
6c86447891 | ||
|
|
905e81c2b9 | ||
|
|
25bb682f7d | ||
|
|
18e10f617c | ||
|
|
e0a0ab5594 | ||
|
|
29d96db1e8 | ||
|
|
3769ec42d2 | ||
|
|
d0c1133304 | ||
|
|
c3ff59fbfb | ||
|
|
aa52b063b7 | ||
|
|
a74b3c87c4 | ||
|
|
6c38a6a28e | ||
|
|
db49d305f4 | ||
|
|
5df7b9252b | ||
|
|
f4d0979bb1 | ||
|
|
199200cb01 | ||
|
|
419cebef33 | ||
|
|
716167e3ec | ||
|
|
60debc45f3 | ||
|
|
2c04d42717 | ||
|
|
9e21ed9670 | ||
|
|
095e710bec | ||
|
|
888c5268d5 | ||
|
|
1180c16f45 | ||
|
|
dea1fb144a | ||
|
|
a01190a242 | ||
|
|
0ebced9609 | ||
|
|
ab4489c5aa | ||
|
|
d2ea1d820c | ||
|
|
4d0dfd837e | ||
|
|
e07f10d981 | ||
|
|
d48e9484b8 | ||
|
|
b9924ea98b | ||
|
|
5707d27598 | ||
|
|
42bde9e576 | ||
|
|
76f09be39d | ||
|
|
3aa328a522 | ||
|
|
2b0f5bfdf4 | ||
|
|
bbe6f919c4 | ||
|
|
4441d78eb2 | ||
|
|
e6cb758e0e | ||
|
|
6d774de5a6 | ||
|
|
0a2ca1febc | ||
|
|
6d3ff67efd | ||
|
|
d37a52dcf4 | ||
|
|
c03fa0e955 | ||
|
|
b3549edf51 | ||
|
|
e09d159935 | ||
|
|
66f0da433e | ||
|
|
4cb2610b1c | ||
|
|
c44f11cf09 | ||
|
|
b69c31ed8a | ||
|
|
6a2231f8fb | ||
|
|
a3a6c71c42 | ||
|
|
8d5c0c6f8b | ||
|
|
56603fd00c | ||
|
|
ed69411d2e | ||
|
|
d8c8aec2ee | ||
|
|
e1d017f077 | ||
|
|
9269af7a13 | ||
|
|
8ffdba5021 | ||
|
|
e00aecd886 | ||
|
|
98f859f2fb | ||
|
|
55a15d23b2 | ||
|
|
38189388f6 | ||
|
|
8bb1b74b1c | ||
|
|
465d32af25 | ||
|
|
13b8a023a3 | ||
|
|
54ca3488df | ||
|
|
26bf69effc | ||
|
|
307580aed8 | ||
|
|
d2d93004e0 | ||
|
|
e1df424bfd | ||
|
|
6a75347b05 | ||
|
|
cfd513ea80 | ||
|
|
edcc47a6b3 | ||
|
|
6593118f3d | ||
|
|
8f29faa28a | ||
|
|
fd724d147a | ||
|
|
1e6716f8ec | ||
|
|
787395494c | ||
|
|
b0b6ffb963 | ||
|
|
d3d57ab0df | ||
|
|
375515937d | ||
|
|
b2e1b2dc9b | ||
|
|
6c869cab98 | ||
|
|
212f857692 | ||
|
|
c40adda51c | ||
|
|
35f7ba6153 | ||
|
|
327b7bba87 | ||
|
|
defc47000b | ||
|
|
694cd8103a | ||
|
|
f50e7281c5 | ||
|
|
0a37ad0666 | ||
|
|
13d4907bff | ||
|
|
78725009c1 | ||
|
|
a1bc9144bd | ||
|
|
1034111985 | ||
|
|
b897056824 | ||
|
|
0c27bf850c | ||
|
|
87563b6c97 | ||
|
|
62d6294da2 | ||
|
|
78489a6146 | ||
|
|
b4d71543db | ||
|
|
b4db0f32e4 | ||
|
|
8ad42a8918 | ||
|
|
96ed44a186 | ||
|
|
4e17804997 | ||
|
|
e391d06f32 | ||
|
|
353fcb1ba7 | ||
|
|
73db1a608a | ||
|
|
322327e1f4 | ||
|
|
1c6b60122e | ||
|
|
c2ca77ecae | ||
|
|
441f57d027 | ||
|
|
1e7a042b53 | ||
|
|
2e0bb5a3b2 | ||
|
|
bf08336bc5 | ||
|
|
62cbf31ac2 | ||
|
|
a2eac214b4 | ||
|
|
32933ce90b | ||
|
|
44cdc191fc | ||
|
|
e4f77e42d3 | ||
|
|
9f91832c7e | ||
|
|
6d4af0fb5d | ||
|
|
4345739a87 | ||
|
|
0a881a81f8 | ||
|
|
b066f7ad4c | ||
|
|
a19380347a | ||
|
|
9bc1211e57 | ||
|
|
cbce5d0fc0 | ||
|
|
b20b56c5d4 | ||
|
|
27041c205c | ||
|
|
00504d4096 | ||
|
|
ed0c5e1a7e | ||
|
|
ddf90f4ee0 | ||
|
|
39290512cf | ||
|
|
09ea20729d | ||
|
|
736e6c5fa2 | ||
|
|
e96f4fc8a0 | ||
|
|
bbe1f539dd | ||
|
|
1fcaacd41b | ||
|
|
7306764c51 | ||
|
|
d3c7280f3f | ||
|
|
2c6ed06574 | ||
|
|
81e2e18089 | ||
|
|
7b7e7eb7e7 | ||
|
|
944aaf3297 | ||
|
|
5a5793f243 | ||
|
|
5e41a4d2c0 | ||
|
|
c4ac0bc7a5 | ||
|
|
5549cfaaa1 | ||
|
|
ae4d246c59 | ||
|
|
2622557a00 | ||
|
|
339abedeee | ||
|
|
149b35224a | ||
|
|
d148279224 | ||
|
|
554fe8bad1 | ||
|
|
27e8259ff6 | ||
|
|
3a51df154a | ||
|
|
a3c79c0427 | ||
|
|
f569a04797 | ||
|
|
610ddfed12 |
No files matched your search
@@ -9,7 +9,6 @@
|
||||
|
||||
# files
|
||||
!/.gitignore
|
||||
!/.gitmodules
|
||||
!/CLA.txt
|
||||
!/CONTRIBUTING.md
|
||||
!/LICENSE.txt
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
[submodule "lang"]
|
||||
path = lang
|
||||
url = https://github.com/ForestryMC/Forestry-Localization.git
|
||||
@@ -9,9 +9,9 @@ Forestry is a modification for the game Minecraft and known primarily for its fa
|
||||
|
||||
[Wiki](http://forestry.sengir.net/)
|
||||
|
||||
[Latest Builds for 1.11 / 1.11.2](http://jenkins.ic2.player.to/job/Forestry_1.11/)
|
||||
[Latest Builds for 1.11.2/1.12](http://jenkins.ic2.player.to/job/Forestry_1.11/)
|
||||
|
||||
[IRC #forestry on esper.net](http://webchat.esper.net/?nick=ForestryGithub...&channels=forestry&prompt=1)
|
||||
[](https://discord.gg/49XNRJk)
|
||||
|
||||
For those interested in developement, you can also visit #forestry-dev.
|
||||
|
||||
@@ -21,9 +21,14 @@ The localization files reside in their own repository. It is pulled in automatic
|
||||
|
||||
You may want to adjust the "./gradle.properties" file to set your mc account as needed.
|
||||
|
||||
To setup, open a command line and run "gradlew setupDecompWorkspace" and "gradlew eclipse".
|
||||
To setup, open a command line and run "gradlew setupDecompWorkspace". Then run the following depending on your IDE:
|
||||
|
||||
To package, open a command line and type "gradlew release".
|
||||
Eclipse: "gradlew eclipse"
|
||||
IntelliJ IDEA: "gradlew idea genIntellijRuns"
|
||||
|
||||
To package, open a command line and type "gradlew build".
|
||||
|
||||
For mod authors: the Forestry maven is located at http://maven.ic2.player.to/net/sengir/forestry/
|
||||
|
||||
### Notes
|
||||
|
||||
|
||||
Executable → Regular
+28
-37
@@ -4,30 +4,31 @@ buildscript {
|
||||
maven { url = "http://files.minecraftforge.net/maven" }
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
|
||||
classpath "gradle.plugin.se.bjurr.gitchangelog:git-changelog-gradle-plugin:1.47"
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "com.matthewprenger.cursegradle" version "1.0.7"
|
||||
id "se.bjurr.gitchangelog.git-changelog-gradle-plugin" version "1.32"
|
||||
id "com.matthewprenger.cursegradle" version "1.0.9"
|
||||
}
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: "se.bjurr.gitchangelog.git-changelog-gradle-plugin"
|
||||
|
||||
version = version_major + '.' + version_minor + '.' + version_patch + '.' + getBuildNumber()
|
||||
if (project.hasProperty('buildQualifier')) {
|
||||
version = project.version + '-' + project.buildQualifier
|
||||
}
|
||||
group= "net.sengir.forestry" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
group = "net.sengir.forestry" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "forestry_" + mcversion
|
||||
|
||||
ext.dirDest = './build/dist'
|
||||
ext.dirLang = "./lang"
|
||||
|
||||
// java version
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
minecraft {
|
||||
version = mcversion + "-" + forgeversion
|
||||
@@ -38,17 +39,9 @@ minecraft {
|
||||
replace '@BUILD_NUMBER@', getBuildNumber()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
resources {
|
||||
srcDir project.dirLang
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url 'http://maven.epoxide.xyz'
|
||||
url = 'http://maven.mcmoddev.com'
|
||||
}
|
||||
maven {
|
||||
url "http://dvs1.progwml6.com/files/maven"
|
||||
@@ -57,13 +50,22 @@ repositories {
|
||||
name = "ic2"
|
||||
url = "http://maven.ic2.player.to/"
|
||||
}
|
||||
maven {
|
||||
name = "Modmuss50"
|
||||
url = "http://maven.modmuss50.me"
|
||||
}
|
||||
maven {
|
||||
url = 'https://mod-buildcraft.com/maven'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
deobfCompile "net.darkhax.tesla:Tesla:${tesla_version}"
|
||||
deobfCompile "mezz.jei:jei_${mcversion}:${jei_version}:api"
|
||||
runtime "mezz.jei:jei_${mcversion}:${jei_version}"
|
||||
deobfCompile "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
|
||||
deobfProvided "net.darkhax.tesla:Tesla-${tesla_mcversion}:${tesla_version}"
|
||||
deobfProvided "mezz.jei:jei_${jei_mcversion}:${jei_version}:api"
|
||||
runtimeOnly "mezz.jei:jei_${jei_mcversion}:${jei_version}"
|
||||
deobfProvided "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
|
||||
deobfProvided "TechReborn:TechReborn-${TR_mcversion}:${TR_version}:api"
|
||||
deobfProvided "com.mod-buildcraft:buildcraft-api:${buildcraft_version}"
|
||||
}
|
||||
|
||||
configurations {
|
||||
@@ -82,7 +84,7 @@ processResources {
|
||||
include 'mcmod.info'
|
||||
|
||||
// replace version and mcversion
|
||||
expand 'version':project.version, 'mcversion':project.minecraft.version
|
||||
expand 'version': project.version, 'mcversion': project.minecraft.version
|
||||
}
|
||||
|
||||
// copy everything else, thats not the mcmod.info
|
||||
@@ -132,7 +134,7 @@ uploadArchives {
|
||||
repositories {
|
||||
if (project.hasProperty('mavenDir')) {
|
||||
mavenDeployer {
|
||||
repository(url: "file://"+mavenDir)
|
||||
repository(url: "file://" + mavenDir)
|
||||
}
|
||||
} else {
|
||||
println 'Archives upload disabled, mavenDir in gradle.properties is missing.'
|
||||
@@ -148,28 +150,17 @@ task makeChangelog(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {
|
||||
filePath = "changelog.html"
|
||||
untaggedName = "Current release ${project.version}"
|
||||
fromCommit = "5a3850c2642e535656d090d1473054d5fa8d3331"
|
||||
toRef = "HEAD"
|
||||
templateContent = """
|
||||
Alpha version, still buggy. Do not create a world you care about with this version, it can and will break things severely.<br/>
|
||||
Please help the project by trying it out and <a href="https://github.com/ForestryMC/ForestryMC/issues">reporting issues here.</a><br/>
|
||||
{{#tags}}
|
||||
<h3>{{name}}</h3>
|
||||
<ul>
|
||||
{{#commits}}
|
||||
<li>{{{message}}} - {{authorName}}</li>
|
||||
{{/commits}}
|
||||
</ul>
|
||||
{{/tags}}
|
||||
"""
|
||||
toRef = "HEAD"
|
||||
templateContent = file('changelog.mustache').getText('UTF-8')
|
||||
}
|
||||
|
||||
curseforge {
|
||||
apiKey = project.hasProperty('curseforge_apikey') ? project.curseforge_apikey : '0'
|
||||
project {
|
||||
id = '59751'
|
||||
id = curse_project_id
|
||||
changelog = file('changelog.html')
|
||||
changelogType = 'html'
|
||||
releaseType = 'alpha'
|
||||
releaseType = 'beta'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
Please help the Forestry project by <a href="https://github.com/ForestryMC/ForestryMC/issues">reporting issues here.</a><br/>
|
||||
{{#tags}}
|
||||
<h3>{{name}}</h3>
|
||||
<ul>
|
||||
{{#commits}}
|
||||
<li>{{{message}}} - {{authorName}}</li>
|
||||
{{/commits}}
|
||||
</ul>
|
||||
{{/tags}}
|
||||
Binary file not shown.
+14
-9
@@ -1,11 +1,16 @@
|
||||
mcversion=1.11.2
|
||||
forgeversion=13.20.0.2279
|
||||
mcp_mappings=snapshot_20161220
|
||||
|
||||
tesla_version=1.11-1.3.0.51
|
||||
jei_version=4.3.0.252
|
||||
ic2_version=2.7.7-ex111
|
||||
mcversion=1.12.2
|
||||
forgeversion=14.23.4.2705
|
||||
mcp_mappings=snapshot_20171003
|
||||
curse_project_id=59751
|
||||
|
||||
tesla_version=1.0.60
|
||||
tesla_mcversion=1.12
|
||||
jei_version=4.10.0.200
|
||||
jei_mcversion=1.12.2
|
||||
ic2_version=2.8.90-ex112
|
||||
TR_mcversion=1.12.2
|
||||
TR_version=2.13.2.561
|
||||
buildcraft_version=7.99.17
|
||||
version_major=5
|
||||
version_minor=3
|
||||
version_patch=4
|
||||
version_minor=8
|
||||
version_patch=1
|
||||
Vendored
BIN
Binary file not shown.
+6
-6
@@ -1,6 +1,6 @@
|
||||
#Mon Sep 14 12:28:28 PDT 2015
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip
|
||||
#Mon Jul 03 15:24:47 PDT 2017
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip
|
||||
@@ -42,11 +42,6 @@ case "`uname`" in
|
||||
;;
|
||||
esac
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||
if $cygwin ; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
fi
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
@@ -114,6 +109,7 @@ fi
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
|
||||
-1
Submodule lang deleted from f5300f059b.
Regular → Executable
+70
-37
@@ -10,13 +10,41 @@
|
||||
******************************************************************************/
|
||||
package forestry;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import forestry.plugins.ForestryCompatPlugins;
|
||||
import forestry.plugins.PluginBuildCraftFuels;
|
||||
import forestry.plugins.PluginIC2;
|
||||
import forestry.plugins.PluginNatura;
|
||||
import forestry.plugins.PluginTechReborn;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import net.minecraftforge.client.event.ModelRegistryEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.core.ForestryEvent;
|
||||
import forestry.core.EventHandlerCore;
|
||||
import forestry.core.climate.ClimateEventHandler;
|
||||
import forestry.core.advancements.AdvancementManager;
|
||||
import forestry.core.climate.ClimateStates;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.GameMode;
|
||||
@@ -28,21 +56,8 @@ import forestry.core.network.PacketHandler;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.MigrationHelper;
|
||||
import forestry.core.worldgen.WorldGenerator;
|
||||
import forestry.plugins.PluginManager;
|
||||
import forestry.plugins.compat.PluginIC2;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import forestry.modules.ForestryModules;
|
||||
import forestry.modules.ModuleManager;
|
||||
|
||||
/**
|
||||
* Forestry Minecraft Mod
|
||||
@@ -51,13 +66,17 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
*/
|
||||
@Mod(
|
||||
modid = Constants.MOD_ID,
|
||||
name = "Forestry",
|
||||
name = Constants.MOD_NAME,
|
||||
version = Constants.VERSION,
|
||||
guiFactory = "forestry.core.config.ForestryGuiConfigFactory",
|
||||
acceptedMinecraftVersions = "[1.11]",
|
||||
dependencies = "required-after:forge@[13.20.0.2270,);"
|
||||
+ "after:JEI@[4.3.0,);"
|
||||
+ "after:" + PluginIC2.modId + ";")
|
||||
acceptedMinecraftVersions = "[1.12.2,1.13.0)",
|
||||
dependencies = "required-after:forge@[14.23.4.2705,);"
|
||||
+ "after:jei@[4.7.8.91,);"
|
||||
+ "after:" + PluginIC2.MOD_ID + ";"
|
||||
+ "after:" + PluginNatura.MOD_ID + ";"
|
||||
+ "after:toughasnails;"
|
||||
+ "after:" + PluginTechReborn.MOD_ID + ";"
|
||||
+ "after:" + PluginBuildCraftFuels.MOD_ID + ";")
|
||||
public class Forestry {
|
||||
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@@ -70,15 +89,20 @@ public class Forestry {
|
||||
ForestryAPI.instance = this;
|
||||
ForestryAPI.forestryConstants = new Constants();
|
||||
ForestryAPI.errorStateRegistry = new ErrorStateRegistry();
|
||||
ForestryAPI.states = ClimateStates.INSTANCE;
|
||||
EnumErrorCode.init();
|
||||
FluidRegistry.enableUniversalBucket();
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
ModuleManager moduleManager = ModuleManager.getInstance();
|
||||
ForestryAPI.moduleManager = moduleManager;
|
||||
moduleManager.registerContainers(new ForestryModules(), new ForestryCompatPlugins());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static PacketHandler packetHandler;
|
||||
|
||||
public static PacketHandler getPacketHandler() {
|
||||
Preconditions.checkState(packetHandler != null);
|
||||
Preconditions.checkNotNull(packetHandler);
|
||||
return packetHandler;
|
||||
}
|
||||
|
||||
@@ -90,20 +114,33 @@ public class Forestry {
|
||||
EventHandlerCore eventHandlerCore = new EventHandlerCore();
|
||||
MinecraftForge.EVENT_BUS.register(eventHandlerCore);
|
||||
MinecraftForge.EVENT_BUS.register(new MultiblockEventHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new ClimateEventHandler());
|
||||
MinecraftForge.EVENT_BUS.register(Config.class);
|
||||
Proxies.common.registerEventHandlers();
|
||||
|
||||
configFolder = new File(event.getModConfigurationDirectory(), Constants.MOD_ID);
|
||||
Config.load(event.getSide());
|
||||
|
||||
PluginManager.runSetup(event);
|
||||
MinecraftForge.EVENT_BUS.post(new ForestryEvent.PreInit(this, event));
|
||||
|
||||
ModuleManager.runSetup(event);
|
||||
ModuleManager.getInternalHandler().runSetup();
|
||||
|
||||
String gameMode = Config.gameMode;
|
||||
Preconditions.checkState(gameMode != null);
|
||||
Preconditions.checkNotNull(gameMode);
|
||||
ForestryAPI.activeMode = new GameMode(gameMode);
|
||||
|
||||
PluginManager.runPreInit(event.getSide());
|
||||
MigrationHelper.registerFixable();
|
||||
|
||||
ModuleManager.getInternalHandler().runPreInit(event.getSide());
|
||||
}
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void registerItems(RegistryEvent.Register<Item> event) {
|
||||
ModuleManager.getInternalHandler().runRegisterBackpacksAndCrates();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void registerModels(ModelRegistryEvent event) {
|
||||
Proxies.render.registerModels();
|
||||
}
|
||||
|
||||
@@ -112,14 +149,15 @@ public class Forestry {
|
||||
// Register gui handler
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler());
|
||||
|
||||
PluginManager.runInit();
|
||||
ModuleManager.getInternalHandler().runInit();
|
||||
|
||||
Proxies.render.registerItemAndBlockColors();
|
||||
AdvancementManager.registerTriggers();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
PluginManager.runPostInit();
|
||||
ModuleManager.getInternalHandler().runPostInit();
|
||||
|
||||
// Register world generator
|
||||
WorldGenerator worldGenerator = new WorldGenerator();
|
||||
@@ -129,12 +167,12 @@ public class Forestry {
|
||||
Proxies.common.registerTickHandlers(worldGenerator);
|
||||
|
||||
// Handle IMC messages.
|
||||
PluginManager.processIMCMessages(FMLInterModComms.fetchRuntimeMessages(ForestryAPI.instance));
|
||||
ModuleManager.getInternalHandler().processIMCMessages(FMLInterModComms.fetchRuntimeMessages(ForestryAPI.instance));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
PluginManager.serverStarting(event.getServer());
|
||||
ModuleManager.serverStarting(event.getServer());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -144,11 +182,6 @@ public class Forestry {
|
||||
|
||||
@EventHandler
|
||||
public void processIMCMessages(IMCEvent event) {
|
||||
PluginManager.processIMCMessages(event.getMessages());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onMissingMappings(FMLMissingMappingsEvent event) {
|
||||
MigrationHelper.onMissingMappings(event);
|
||||
ModuleManager.getInternalHandler().processIMCMessages(event.getMessages());
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,8 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -34,26 +35,41 @@ public class BeeManager {
|
||||
|
||||
/**
|
||||
* Convenient access to AlleleManager.alleleRegistry.getSpeciesRoot("rootBees")
|
||||
*
|
||||
* @implNote Only null if the "apiculture" module is not enabled.
|
||||
*/
|
||||
@Nullable
|
||||
public static IBeeRoot beeRoot;
|
||||
|
||||
/**
|
||||
* Used to create new bees.
|
||||
*
|
||||
* @implNote Only null if the "apiculture" module is not enabled.
|
||||
*/
|
||||
@Nullable
|
||||
public static IBeeFactory beeFactory;
|
||||
|
||||
/**
|
||||
* Used to create new bee mutations.
|
||||
*
|
||||
* @implNote Only null if the "apiculture" module is not enabled.
|
||||
*/
|
||||
@Nullable
|
||||
public static IBeeMutationFactory beeMutationFactory;
|
||||
|
||||
/**
|
||||
* Used to get Forestry's jubilance implementations.
|
||||
*
|
||||
* @implNote Only null if the "apiculture" module is not enabled.
|
||||
*/
|
||||
@Nullable
|
||||
public static IJubilanceFactory jubilanceFactory;
|
||||
|
||||
/**
|
||||
* Used to check whether a player is wearing Apiarist Armor.
|
||||
*
|
||||
* @implNote Only null if the "apiculture" module is not enabled.
|
||||
*/
|
||||
@Nullable
|
||||
public static IArmorApiaristHelper armorApiaristHelper;
|
||||
}
|
||||
@@ -9,15 +9,19 @@ import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.core.IErrorState;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IIndividualLiving;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Other implementations than Forestry's default one are not supported.
|
||||
@@ -85,8 +89,27 @@ public interface IBee extends IIndividualLiving {
|
||||
|
||||
List<IBee> spawnDrones(IBeeHousing housing);
|
||||
|
||||
/**
|
||||
* @deprecated since Forestry 5.5.4. Use {@link #plantFlowerRandom(IBeeHousing, List)}
|
||||
*/
|
||||
@Deprecated
|
||||
void plantFlowerRandom(IBeeHousing housing);
|
||||
|
||||
/**
|
||||
* Plants a random flower from the given list near the housing
|
||||
*
|
||||
* @param housing the location the bee is living
|
||||
* @param potentialFlowers the flowers to choose from
|
||||
* @return the position of the planted flower, or null of none were planted
|
||||
* @since Forestry 5.5.4
|
||||
*/
|
||||
@Nullable
|
||||
default BlockPos plantFlowerRandom(IBeeHousing housing, List<IBlockState> potentialFlowers) {
|
||||
//noinspection deprecation
|
||||
plantFlowerRandom(housing);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
IIndividual retrievePollen(IBeeHousing housing);
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ public interface IBeeFactory {
|
||||
* Automatically registered with AlleleManager.alleleRegistry.registerAllele()
|
||||
* See IAlleleBeeSpeciesBuilder and IAlleleSpeciesBuilder for adding additional properties to the returned species.
|
||||
*
|
||||
* @param modId The modId of the mod that is creating the species
|
||||
* @param uid Unique Identifier for this species
|
||||
* @param dominant Whether this species is genetically dominant (false means it is recessive)
|
||||
* @param authority Authority for the binomial name, e.g. "Sengir" on species of base Forestry.
|
||||
@@ -24,8 +25,9 @@ public interface IBeeFactory {
|
||||
* @param primaryColor The outline color of this species
|
||||
* @param secondaryColor The body color of this species
|
||||
* @return a new bee species allele.
|
||||
* @since Forestry 5.6.0.
|
||||
*/
|
||||
IAlleleBeeSpeciesBuilder createSpecies(String uid, boolean dominant, String authority, String unlocalizedName, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor);
|
||||
IAlleleBeeSpeciesBuilder createSpecies(String modId, String uid, boolean dominant, String authority, String unlocalizedName, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor);
|
||||
|
||||
/**
|
||||
* Creates a new bee branch.
|
||||
@@ -36,4 +38,10 @@ public interface IBeeFactory {
|
||||
* @return a new bee branch
|
||||
*/
|
||||
IClassification createBranch(String uid, String scientific);
|
||||
|
||||
/**
|
||||
* @deprecated since Forestry 5.6.0. use {@link #createSpecies(String, String, boolean, String, String, String, IClassification, String, int, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
IAlleleBeeSpeciesBuilder createSpecies(String uid, boolean dominant, String authority, String unlocalizedName, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor);
|
||||
}
|
||||
@@ -5,16 +5,20 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.core.INbtReadable;
|
||||
import forestry.api.core.INbtWritable;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Stores beekeeping logic for bee housings.
|
||||
@@ -79,4 +83,12 @@ public interface IBeekeepingLogic extends INbtWritable, INbtReadable {
|
||||
* These positions are synced to the client from the server.
|
||||
*/
|
||||
List<BlockPos> getFlowerPositions();
|
||||
|
||||
default void readData(PacketBuffer data) throws IOException {
|
||||
|
||||
}
|
||||
|
||||
default void writeData(PacketBuffer data) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -37,10 +37,15 @@ public interface IBeekeepingMode {
|
||||
*/
|
||||
boolean isFatigued(IBee queen, IBeeHousing housing);
|
||||
|
||||
/**
|
||||
* @return true if the queen is being overworked in the bee housing (with chance). will trigger a negative effect.
|
||||
/**
|
||||
* @return true if the queen is being overworked in the bee housing (with chance). will trigger a negative effect.
|
||||
* @deprecated bees max out at 16x productivity instead of being overworked.
|
||||
* TODO remove this method in 1.13
|
||||
*/
|
||||
boolean isOverworked(IBee queen, IBeeHousing housing);
|
||||
@Deprecated
|
||||
default boolean isOverworked(IBee queen, IBeeHousing housing) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if the genetic structure of the queen is breaking down during spawning of the offspring (with chance). will trigger a negative effect.
|
||||
|
||||
@@ -20,5 +20,18 @@ public interface IHiveFrame {
|
||||
*/
|
||||
ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear);
|
||||
|
||||
/**
|
||||
* @param frame ItemStack containing the actual frame.
|
||||
* @return the {@link IBeeModifier} for this frame.
|
||||
* @since Forestry 5.5.1
|
||||
*/
|
||||
default IBeeModifier getBeeModifier(ItemStack frame) {
|
||||
return getBeeModifier();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since Forestry 5.5.1. Use {@link #getBeeModifier(ItemStack)}
|
||||
*/
|
||||
@Deprecated
|
||||
IBeeModifier getBeeModifier();
|
||||
}
|
||||
@@ -1,3 +1,8 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@@ -8,9 +8,10 @@ package forestry.api.apiculture.hives;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import forestry.api.apiculture.IHiveDrop;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
import forestry.api.apiculture.IHiveDrop;
|
||||
|
||||
public interface IHiveRegistry {
|
||||
|
||||
/* Forestry Hive Names */
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import forestry.api.core.IArmorNaturalist;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.capabilities.CapabilityInject;
|
||||
|
||||
import forestry.api.core.IArmorNaturalist;
|
||||
|
||||
public class ArboricultureCapabilities {
|
||||
/**
|
||||
* Capability for {@link IArmorNaturalist}.
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
import forestry.core.utils.Translator;
|
||||
|
||||
public enum EnumFruitFamily implements IFruitFamily {
|
||||
PRUNES("prunes", "Prunus domestica"),
|
||||
@@ -37,12 +38,12 @@ public enum EnumFruitFamily implements IFruitFamily {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return Translator.translateToLocal("for.family." + uid);
|
||||
return I18n.translateToLocal("for.family." + uid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return Translator.translateToLocal("for.family." + uid + ".description");
|
||||
return I18n.translateToLocal("for.family." + uid + ".description");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,8 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -19,6 +19,4 @@ public interface IAlleleFruit extends IAlleleProperty<IAlleleFruit> {
|
||||
@Nullable
|
||||
String getModelName();
|
||||
|
||||
String getModID();
|
||||
|
||||
}
|
||||
@@ -7,15 +7,18 @@ package forestry.api.arboriculture;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.api.genetics.IAlleleProperty;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public interface IAlleleTreeSpecies extends IAlleleSpecies, IAlleleProperty<IAlleleTreeSpecies> {
|
||||
|
||||
@@ -36,11 +39,6 @@ public interface IAlleleTreeSpecies extends IAlleleSpecies, IAlleleProperty<IAll
|
||||
* @return Tree generator for this species.
|
||||
*/
|
||||
ITreeGenerator getGenerator();
|
||||
|
||||
/**
|
||||
* @return The modid from the mod of the species.
|
||||
*/
|
||||
String getModID();
|
||||
|
||||
/**
|
||||
* @return Float between 0 and 1 representing the rarity of the species, will affect spawn rate. If it's 0, it will not spawn.
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
||||
/**
|
||||
* Provides functions that are related to the forestry charcoal pile.
|
||||
*/
|
||||
public interface ICharcoalManager {
|
||||
/**
|
||||
* Registers the given block as a valid block for the charcoal pile wall and adds the given charcoal amount to it.
|
||||
* <p>
|
||||
* This method unlike {@link #registerWall(IBlockState, int)} ignores the metadata of the actual block and
|
||||
* only compares the world block with the given block.
|
||||
*/
|
||||
void registerWall(Block block, int amount);
|
||||
|
||||
/**
|
||||
* Registers the given block as a valid block for the charcoal pile wall and adds the given charcoal amount to it.
|
||||
* <p>
|
||||
* This method unlike {@link #registerWall(Block, int)} compares the world state with the given state and not
|
||||
* only the block.
|
||||
*/
|
||||
void registerWall(IBlockState blockState, int amount);
|
||||
|
||||
/**
|
||||
* Registers your implementation of the {@link ICharcoalPileWall} interface.
|
||||
*/
|
||||
void registerWall(ICharcoalPileWall wall);
|
||||
|
||||
/**
|
||||
* @return A collection with all registered charcoal pile walls.
|
||||
*/
|
||||
Collection<ICharcoalPileWall> getWalls();
|
||||
}
|
||||
@@ -14,7 +14,12 @@ public interface ICharcoalPileWall {
|
||||
int getCharcoalAmount();
|
||||
|
||||
boolean matches(IBlockState state);
|
||||
|
||||
NonNullList<ItemStack> getDisplyItems();
|
||||
|
||||
@Deprecated
|
||||
default NonNullList<ItemStack> getDisplyItems(){
|
||||
return getDisplayItems();
|
||||
}
|
||||
|
||||
NonNullList<ItemStack> getDisplayItems();
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
@@ -5,32 +5,12 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.awt.Color;
|
||||
|
||||
import forestry.api.genetics.IClassification;
|
||||
|
||||
public interface ITreeFactory {
|
||||
/**
|
||||
* Creates a new tree species.
|
||||
* Automatically registered with AlleleManager.alleleRegistry.registerAllele()
|
||||
* See IAlleleTreeSpeciesBuilder and IAlleleSpeciesBuilder for adding additional properties to the returned species.
|
||||
*
|
||||
* @param uid Unique Identifier for this species
|
||||
* @param unlocalizedName Unlocalized name for this species
|
||||
* @param authority Authority for the binomial name, e.g. "Sengir" on species of base Forestry.
|
||||
* @param unlocalizedDescription Unlocalized description for this species
|
||||
* @param dominant Whether this species is genetically dominant (false means it is recessive)
|
||||
* @param branch Classification of this species
|
||||
* @param binomial Binomial name of the species sans genus. "humboldti" will have the bee species flavour name be "Apis humboldti". Feel free to use fun names or null.
|
||||
* @param modID The modID from the mod of the species
|
||||
* @param leafSpriteProvider The leaf sprite provider for this species
|
||||
* @param germlingModelProvider The germling model provider for this species
|
||||
* @param woodProvider The wood texture provider. It is used to get wood textures for the charcoal pile.
|
||||
* @param generator The tree generator
|
||||
* @return a new tree species allele.
|
||||
*/
|
||||
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, IWoodProvider woodProvider, ITreeGenerator generator);
|
||||
|
||||
/**
|
||||
* Creates a new tree species.
|
||||
* Automatically registered with AlleleManager.alleleRegistry.registerAllele()
|
||||
@@ -48,10 +28,18 @@ public interface ITreeFactory {
|
||||
* @param germlingModelProvider The germling model provider for this species
|
||||
* @param woodProvider The wood texture provider. It is used to get wood textures for the charcoal pile.
|
||||
* @param generator The tree generator
|
||||
* @param leafProvider The leaf provider
|
||||
* @return a new tree species allele.
|
||||
*/
|
||||
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, IWoodProvider woodProvider, ITreeGenerator generator, ILeafProvider leafProvider);
|
||||
|
||||
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, IWoodProvider woodProvider, ITreeGenerator generator, @Nullable ILeafProvider leafProvider);
|
||||
|
||||
/**
|
||||
* @deprecated since Forestry 5.6.0. use {@link #createSpecies(String, String, String, String, boolean, IClassification, String, String, ILeafSpriteProvider, IGermlingModelProvider, IWoodProvider, ITreeGenerator, ILeafProvider)}
|
||||
*/
|
||||
@Deprecated
|
||||
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, IWoodProvider woodProvider, ITreeGenerator generator);
|
||||
|
||||
|
||||
/**
|
||||
* Get one of the built-in Forestry leaf types. Default type is deciduous.
|
||||
*/
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import forestry.api.genetics.IGenome;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.genetics.IGenome;
|
||||
|
||||
public interface ITreeGenome extends IGenome {
|
||||
|
||||
@Override
|
||||
@@ -37,6 +38,8 @@ public interface ITreeGenome extends IGenome {
|
||||
|
||||
int getGirth();
|
||||
|
||||
boolean getFireproof();
|
||||
|
||||
IAlleleLeafEffect getEffect();
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,15 +9,18 @@ import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IChromosome;
|
||||
import forestry.api.genetics.ISpeciesRootPollinatable;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IChromosome;
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
import forestry.api.genetics.ISpeciesRootPollinatable;
|
||||
|
||||
public interface ITreeRoot extends ISpeciesRootPollinatable {
|
||||
|
||||
@Override
|
||||
@@ -101,4 +104,6 @@ public interface ITreeRoot extends ISpeciesRootPollinatable {
|
||||
/* MUTATIONS */
|
||||
@Override
|
||||
List<ITreeMutation> getMutations(boolean shuffle);
|
||||
|
||||
Collection<IFruitProvider> getFruitProvidersForFruitFamily(IFruitFamily fruitFamily);
|
||||
}
|
||||
@@ -5,13 +5,15 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import forestry.api.core.ITextureManager;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.core.ITextureManager;
|
||||
|
||||
public interface IWoodProvider {
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerSprites(Item item, ITextureManager manager);
|
||||
@@ -29,11 +31,15 @@ public interface IWoodProvider {
|
||||
|
||||
/**
|
||||
* The amount of charcoal dropped from a charcoal pile of this wood.
|
||||
* @deprecated Will be removed in 1.13
|
||||
*/
|
||||
@Deprecated
|
||||
int getCarbonization();
|
||||
|
||||
/**
|
||||
* The chance that a pile has to drop a extra charcoal
|
||||
* @deprecated Will be removed in 1.13
|
||||
*/
|
||||
@Deprecated
|
||||
float getCharcoalChance(int numberOfCharcoal);
|
||||
}
|
||||
@@ -1,3 +1,8 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -12,7 +13,10 @@ public class TreeManager {
|
||||
|
||||
/**
|
||||
* Convenient access to AlleleManager.alleleRegistry.getSpeciesRoot("rootTrees")
|
||||
*
|
||||
* @implNote Only null if the "arboriculture" module is not enabled.
|
||||
*/
|
||||
@Nullable
|
||||
public static ITreeRoot treeRoot;
|
||||
|
||||
/**
|
||||
@@ -22,13 +26,31 @@ public class TreeManager {
|
||||
|
||||
/**
|
||||
* Used to create new trees.
|
||||
*
|
||||
* @implNote Only null if the "arboriculture" module is not enabled.
|
||||
*/
|
||||
@Nullable
|
||||
public static ITreeFactory treeFactory;
|
||||
|
||||
/**
|
||||
* Used to create new tree mutations.
|
||||
*
|
||||
* @implNote Only null if the "arboriculture" module is not enabled.
|
||||
*/
|
||||
@Nullable
|
||||
public static ITreeMutationFactory treeMutationFactory;
|
||||
|
||||
|
||||
/**
|
||||
* Can be used to add new charcoal pile walls.
|
||||
*
|
||||
* @implNote Only null if the "charcoal" module is not enabled.
|
||||
*/
|
||||
@Nullable
|
||||
public static ICharcoalManager charcoalManager;
|
||||
|
||||
/**
|
||||
* @deprecated Please use {@link ICharcoalManager#registerWall}.
|
||||
*/
|
||||
@Deprecated
|
||||
public static List<ICharcoalPileWall> pileWalls = new ArrayList<>();
|
||||
}
|
||||
Regular → Executable
+8
-3
@@ -1,12 +1,17 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
import net.minecraftforge.client.model.ModelProcessingHelper;
|
||||
|
||||
public enum WoodBlockKind {
|
||||
LOG, PLANKS, SLAB, FENCE, FENCE_GATE, STAIRS, DOOR;
|
||||
@@ -57,6 +62,6 @@ public enum WoodBlockKind {
|
||||
break;
|
||||
}
|
||||
textures.putAll(customTextures);
|
||||
return ModelProcessingHelper.retexture(model, new ImmutableMap.Builder<String, String>().putAll(textures).build());
|
||||
return model.retexture(ImmutableMap.copyOf(textures));
|
||||
}
|
||||
}
|
||||
@@ -5,10 +5,11 @@
|
||||
******************************************************************************/
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
@API(apiVersion = "4.2.1", owner = "ForestryAPI|core", provides = "ForestryAPI|arboriculture")
|
||||
@API(apiVersion = "4.3.0", owner = "ForestryAPI|core", provides = "ForestryAPI|arboriculture")
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
@@ -0,0 +1,54 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.book;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.gui.IElementGroup;
|
||||
import forestry.api.gui.IGuiElement;
|
||||
import forestry.api.gui.IGuiElementFactory;
|
||||
|
||||
/**
|
||||
* The deserialized content data of a book page. It creates a gui element at the moment the entry gets opened.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public abstract class BookContent<D> {
|
||||
public String type;
|
||||
|
||||
/**
|
||||
* A data object that was deserialized from the json object of this content.
|
||||
* Can be everything from an image to a crafting recipe.
|
||||
*/
|
||||
@Nullable
|
||||
public D data = null;
|
||||
|
||||
/**
|
||||
* The class of the data field. Used for the deserialization. If the result of this method is null the data field
|
||||
* will be null too.
|
||||
*/
|
||||
@Nullable
|
||||
public abstract Class<? extends D> getDataClass();
|
||||
|
||||
/**
|
||||
* Called after the deserialization.
|
||||
*/
|
||||
public void onDeserialization() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the content to the page by adding a {@link IGuiElement} or at the content to the previous element.
|
||||
*
|
||||
* @param page The gui element that represents a book page
|
||||
* @param previous The content of the previous element.
|
||||
* @param previousElement The element that was previously added to the page.
|
||||
* @param pageHeight The max height of the current page.
|
||||
* @return True if you added an element.
|
||||
*/
|
||||
public abstract boolean addElements(IElementGroup page, IGuiElementFactory factory, @Nullable BookContent previous, @Nullable IGuiElement previousElement, int pageHeight);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.book;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class BookManager {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static IBookLoader loader;
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.book;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IBookCategory {
|
||||
/**
|
||||
* @return the {@link ItemStack} that represents this category at the front page.
|
||||
*/
|
||||
ItemStack getStack();
|
||||
|
||||
IBookCategory setStack(ItemStack stack);
|
||||
|
||||
/**
|
||||
* Adds an custom entry to the category.
|
||||
*/
|
||||
IBookCategory addEntry(IBookEntry entry);
|
||||
|
||||
/**
|
||||
* Adds an entry with the given name and the given icon to the category.
|
||||
*
|
||||
* @param name A unique name for this entry.
|
||||
* @param stack The stack that will be displayed next to the entry title at the category page.
|
||||
*/
|
||||
IBookCategory addEntry(String name, ItemStack stack);
|
||||
|
||||
/**
|
||||
* Creates a entry builder with the given name.
|
||||
* <p>
|
||||
* At the end of your creation you have to call {@link IBookEntryBuilder#addToCategory()} to add the entry to this
|
||||
* category.
|
||||
*
|
||||
* @param name A unique name for this entry.
|
||||
*/
|
||||
IBookEntryBuilder createEntry(String name);
|
||||
|
||||
/**
|
||||
* Creates a entry builder with the given name and the given icon.
|
||||
* <p>
|
||||
* At the end of your creation you have to call {@link IBookEntryBuilder#addToCategory()} to add the entry to this
|
||||
* category.
|
||||
*
|
||||
* @param name A unique name for this entry.
|
||||
* @param stack The stack that will be displayed next to the entry title at the category page.
|
||||
*/
|
||||
IBookEntryBuilder createEntry(String name, ItemStack stack);
|
||||
|
||||
/**
|
||||
* @return a collection that contains all entries of this category.
|
||||
*/
|
||||
Collection<IBookEntry> getEntries();
|
||||
|
||||
/**
|
||||
* @return the entry with the given unique name.
|
||||
*/
|
||||
@Nullable
|
||||
IBookEntry getEntry(String name);
|
||||
|
||||
/**
|
||||
* @return the localized name of this category.
|
||||
*/
|
||||
String getLocalizedName();
|
||||
|
||||
/**
|
||||
* Currently unused
|
||||
*/
|
||||
String getTooltip();
|
||||
|
||||
/**
|
||||
* @return the unique name of this category
|
||||
*/
|
||||
String getName();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package forestry.api.book;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.gui.IElementGroup;
|
||||
import forestry.api.gui.IGuiElement;
|
||||
import forestry.api.gui.IGuiElementFactory;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IBookContent {
|
||||
/**
|
||||
* Called after the deserialization.
|
||||
*/
|
||||
default void onDeserialization() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the content to the page by adding a {@link IGuiElement} or at the content to the previous element.
|
||||
*
|
||||
* @param page The gui element that represents a book page
|
||||
* @param previous The content of the previous element.
|
||||
* @param previousElement The element that was previously added to the page.
|
||||
* @param pageHeight The max height of the current page.
|
||||
* @return True if you added an element.
|
||||
*/
|
||||
boolean addElements(IElementGroup page, IGuiElementFactory factory, @Nullable BookContent previous, @Nullable IGuiElement previousElement, int pageHeight);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.book;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* A entry in the {@link IForesterBook}.
|
||||
* <p>
|
||||
* Forestry crates them with the help of json file, but you can add you own custom ones with
|
||||
* {@link IBookCategory#addEntry(IBookEntry)}.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IBookEntry {
|
||||
|
||||
/**
|
||||
* @return The stack that is displayed before the entry name.
|
||||
*/
|
||||
ItemStack getStack();
|
||||
|
||||
/**
|
||||
* @return A unique string identifier for this entry.
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* @return the object that creates the book pages at the moment the bock opens.
|
||||
*/
|
||||
IBookPageFactory getPageFactory();
|
||||
|
||||
/**
|
||||
* All sub entries of this entry are reachable over the buttons on the left side of the book.
|
||||
*/
|
||||
IBookEntry[] getSubEntries();
|
||||
|
||||
/**
|
||||
* The parent of the entry if this entry is a sub entry. Null if the entry is no sub entry.
|
||||
*/
|
||||
@Nullable
|
||||
IBookEntry getParent();
|
||||
|
||||
/**
|
||||
* @return the localized title of this entry.
|
||||
*/
|
||||
String getTitle();
|
||||
|
||||
/**
|
||||
* @return the content that was deserialized from the json file of this entry.
|
||||
*/
|
||||
BookContent[][] getContent();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.book;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IBookEntryBuilder {
|
||||
|
||||
/**
|
||||
* Sets the content of the entry.
|
||||
*/
|
||||
IBookEntryBuilder setContent(BookContent[][] content);
|
||||
|
||||
/**
|
||||
* Sets the localized name of entry.
|
||||
*/
|
||||
IBookEntryBuilder setTitle(String title);
|
||||
|
||||
IBookEntryBuilder setStack(ItemStack stack);
|
||||
|
||||
IBookEntryBuilder setLoader(IBookPageFactory loader);
|
||||
|
||||
/**
|
||||
* Creates a sub entry.
|
||||
* <p>
|
||||
* Important: You not have to call {@link #addToCategory()} at the end of the creation of the sub entry
|
||||
*
|
||||
* @param name The unique name of the sub entry.
|
||||
* @return The entry builder of the sub entry.
|
||||
*/
|
||||
default IBookEntryBuilder createSubEntry(String name) {
|
||||
return createSubEntry(name, ItemStack.EMPTY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a sub entry.
|
||||
* <p>
|
||||
* Important: You not have to call {@link #addToCategory()} at the end of the creation of the sub entry
|
||||
*
|
||||
* @param name The unique name of the sub entry.
|
||||
* @param stack The stack that represents the sub entry.
|
||||
* @return The entry builder of the sub entry.
|
||||
*/
|
||||
IBookEntryBuilder createSubEntry(String name, ItemStack stack);
|
||||
|
||||
IBookEntry build(@Nullable IBookEntry parent);
|
||||
|
||||
/**
|
||||
* Builds a entry with the current information.
|
||||
*/
|
||||
IBookEntry build();
|
||||
|
||||
/**
|
||||
* Builds the entry and adds it to the category.
|
||||
*/
|
||||
IBookCategory addToCategory();
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.book;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IBookLoader {
|
||||
|
||||
/**
|
||||
* Adds a content type.
|
||||
*
|
||||
* @param name The name of the content type.
|
||||
* @param contentClass The class for the deserialization of the content.
|
||||
*/
|
||||
void registerContentType(String name, Class<? extends BookContent> contentClass);
|
||||
|
||||
void registerPageFactory(String name, IBookPageFactory factory);
|
||||
|
||||
IBookPageFactory getPageFactory(String name);
|
||||
|
||||
/**
|
||||
* Loads the book if it was not loaded already or if it was invalidated. Otherwise it returns the last loaded
|
||||
* instance.
|
||||
*
|
||||
* @return The current instance of the forestry guide book.
|
||||
*/
|
||||
IForesterBook loadBook();
|
||||
|
||||
/**
|
||||
* Invalidates the current instance of the book.
|
||||
* The next time {@link #loadBook()} gets called a new instance of the book will be loaded.
|
||||
*/
|
||||
void invalidateBook();
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.book;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.gui.IGuiElement;
|
||||
|
||||
/**
|
||||
* A factory that creates book pages for a book entry.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IBookPageFactory {
|
||||
/**
|
||||
* Usually called at the moment the player opens the given entry.
|
||||
* Creates a collection of gui elements that represent a page of the book.
|
||||
*
|
||||
* @param entry The opened book entry.
|
||||
* @param leftPageHeight The height of a page on the left side of the book.
|
||||
* @param rightPageHeight The height of a page on the right side of the book.
|
||||
* @param pageWidth The width of a book page.
|
||||
* @return A collection where every member represent a page of the book.
|
||||
*/
|
||||
Collection<IGuiElement> load(IBookEntry entry, int leftPageHeight, int rightPageHeight, int pageWidth);
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.book;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* IForesterBook is the interface that the forestry guide book class implements.
|
||||
* <p>
|
||||
* You can get the current instance of the guide book from {@link IBookLoader#loadBook()}.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IForesterBook {
|
||||
|
||||
/**
|
||||
* Creates a category, add it to this book and returns it.
|
||||
*
|
||||
* @param name A unique identifier for the category.
|
||||
* @return The created category.
|
||||
*/
|
||||
IBookCategory addCategory(String name);
|
||||
|
||||
/**
|
||||
* @return The category with the given unique name.
|
||||
*/
|
||||
@Nullable
|
||||
IBookCategory getCategory(String name);
|
||||
|
||||
/**
|
||||
* @return All categories of this book.
|
||||
*/
|
||||
Collection<IBookCategory> getCategories();
|
||||
|
||||
/**
|
||||
* @return A collection that contains all unique names of the categories
|
||||
*/
|
||||
Collection<String> getCategoryNames();
|
||||
|
||||
/**
|
||||
* @return A collection that contains all entries of the category with the given name.
|
||||
*/
|
||||
Collection<IBookEntry> getEntries(String category);
|
||||
|
||||
/**
|
||||
* @return the entry with the given unique name.
|
||||
*/
|
||||
@Nullable
|
||||
IBookEntry getEntry(String name);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
@API(apiVersion = "5.8.1", owner = "ForestryAPI|core", provides = "ForestryAPI|book")
|
||||
package forestry.api.book;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
|
||||
import net.minecraftforge.fml.common.API;
|
||||
@@ -8,6 +8,7 @@ package forestry.api.circuits;
|
||||
public enum CircuitSocketType implements ICircuitSocketType {
|
||||
NONE("none"),
|
||||
FARM("forestry.farm"),
|
||||
GREENHOUSE_CLIMATISER("forestry.greenhouse.climatiser"),
|
||||
ELECTRIC_ENGINE("forestry.electric.engine"),
|
||||
MACHINE("forestry.machine");
|
||||
|
||||
|
||||
@@ -7,11 +7,17 @@ package forestry.api.circuits;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
public interface ICircuit {
|
||||
String getUID();
|
||||
|
||||
String getUnlocalizedName();
|
||||
|
||||
default String getLocalizedName(){
|
||||
return I18n.translateToLocal(getUnlocalizedName());
|
||||
}
|
||||
|
||||
boolean isCircuitable(Object tile);
|
||||
|
||||
void onInsertion(int slot, Object tile);
|
||||
|
||||
@@ -18,6 +18,8 @@ public interface ICircuitRegistry {
|
||||
|
||||
void registerCircuit(ICircuit circuit);
|
||||
|
||||
void registerDeprecatedCircuitReplacement(String deprecatedCircuit, ICircuit replacement);
|
||||
|
||||
@Nullable
|
||||
ICircuit getCircuit(String uid);
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
public enum ClimateStateType {
|
||||
DEFAULT(0.0F, 2.0F),
|
||||
EXTENDED(-3.0F, 3.0F);
|
||||
|
||||
public final float boundDown, boundUp;
|
||||
|
||||
ClimateStateType(Float boundDown, Float boundUp) {
|
||||
this.boundDown = boundDown;
|
||||
this.boundUp = boundUp;
|
||||
}
|
||||
|
||||
public float clamp(float value) {
|
||||
return MathHelper.clamp(value, boundDown, boundUp);
|
||||
}
|
||||
}
|
||||
+7
-8
@@ -5,14 +5,13 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
public interface IClimatiserDefinition {
|
||||
import java.util.Locale;
|
||||
|
||||
float getChange();
|
||||
|
||||
float getRange();
|
||||
|
||||
EnumClimatiserModes getMode();
|
||||
|
||||
EnumClimatiserTypes getType();
|
||||
public enum ClimateType {
|
||||
TEMPERATURE, HUMIDITY;
|
||||
|
||||
public String getName(){
|
||||
return name().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package forestry.api.climate;
|
||||
|
||||
public enum EnumClimatiserModes {
|
||||
|
||||
POSITIVE, NEGATIVE, BOTH
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package forestry.api.climate;
|
||||
|
||||
public enum EnumClimatiserTypes {
|
||||
|
||||
TEMPERATURE, HUMIDITY, BOTH
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
public interface IClimateControl {
|
||||
|
||||
IClimateInfo getControlClimate();
|
||||
|
||||
void setControlClimate(IClimateInfo climateInfo);
|
||||
|
||||
float getControlTemperature();
|
||||
|
||||
float getControlHumidity();
|
||||
|
||||
void setControlTemperature(float temperature);
|
||||
|
||||
void setControlHumidity(float humidity);
|
||||
|
||||
}
|
||||
@@ -1,9 +1,16 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
/**
|
||||
* @deprecated TODO: Remove in 1.13, Use IClimateState
|
||||
*/
|
||||
@Deprecated
|
||||
public interface IClimateInfo {
|
||||
|
||||
float getTemperature();
|
||||
|
||||
float getHumidity();
|
||||
|
||||
}
|
||||
@@ -5,37 +5,37 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IClimateManager {
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link IClimateStates#create(float, float, ClimateStateType)}
|
||||
*/
|
||||
@Deprecated
|
||||
IClimateInfo createInfo(float temperature, float humidity);
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #getClimateState(World, BlockPos)}
|
||||
*/
|
||||
@Deprecated
|
||||
IClimateInfo getInfo(World world, BlockPos pos);
|
||||
|
||||
IClimateProvider getDefaultClimate(World world, BlockPos pos);
|
||||
|
||||
void addRegion(IClimateRegion region);
|
||||
|
||||
void removeRegion(IClimateRegion region);
|
||||
|
||||
void addSource(IClimateSourceProvider source);
|
||||
|
||||
void removeSource(IClimateSourceProvider source);
|
||||
|
||||
void onWorldUnload(World world);
|
||||
/**
|
||||
* Gets the current state of a container at this position or setSettings one with the datas from the biome.
|
||||
* @since 5.3.4
|
||||
*/
|
||||
IClimateState getClimateState(World world, BlockPos pos);
|
||||
|
||||
@Nullable
|
||||
IClimatePosition getPosition(World world, BlockPos pos);
|
||||
|
||||
@Nullable
|
||||
IClimateRegion getRegionForPos(World world, BlockPos pos);
|
||||
|
||||
Map<World, List<IClimateRegion>> getRegions();
|
||||
/**
|
||||
* Creates a climate state with the help of the biome on this position.
|
||||
* @since 5.3.4
|
||||
*/
|
||||
IClimateState getBiomeState(World world, BlockPos pos);
|
||||
|
||||
/**
|
||||
* @return Create a climate manager.
|
||||
*/
|
||||
IClimateProvider getDefaultClimate(World world, BlockPos pos);
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import forestry.api.core.INbtReadable;
|
||||
import forestry.api.core.INbtWritable;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
/**
|
||||
* A IClimatePosition contains the climate infos (temperature and humidity) of one position.
|
||||
*/
|
||||
public interface IClimatePosition extends INbtReadable, INbtWritable {
|
||||
|
||||
IClimateRegion getClimateRegion();
|
||||
|
||||
BlockPos getPos();
|
||||
|
||||
void setTemperature(float temperature);
|
||||
|
||||
void addTemperature(float temperature);
|
||||
|
||||
float getTemperature();
|
||||
|
||||
void setHumidity(float humidity);
|
||||
|
||||
void addHumidity(float humidity);
|
||||
|
||||
float getHumidity();
|
||||
|
||||
IClimateInfo getInfo();
|
||||
|
||||
}
|
||||
@@ -5,9 +5,10 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
public interface IClimateProvider {
|
||||
Biome getBiome();
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import java.util.Collection;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import forestry.api.core.INbtReadable;
|
||||
import forestry.api.core.INbtWritable;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IClimateRegion extends INbtReadable, INbtWritable {
|
||||
|
||||
World getWorld();
|
||||
|
||||
int getTicksPerUpdate();
|
||||
|
||||
void setPosition(BlockPos pos, float temperature, float humidity);
|
||||
|
||||
@Nullable
|
||||
IClimatePosition getPosition(BlockPos pos);
|
||||
|
||||
Collection<IClimatePosition> getPositions();
|
||||
|
||||
void addSource(IClimateSource source);
|
||||
|
||||
void removeSource(IClimateSource source);
|
||||
|
||||
Collection<IClimateSource> getSources();
|
||||
|
||||
void calculateAverageClimate();
|
||||
|
||||
float getAverageTemperature();
|
||||
|
||||
float getAverageHumidity();
|
||||
|
||||
/**
|
||||
* Update the climate in a region.
|
||||
*/
|
||||
void updateClimate(int ticks);
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* A climate source is used to change the climate in a region.
|
||||
*/
|
||||
public interface IClimateSource {
|
||||
|
||||
/**
|
||||
* @param tickCount The current tick count.
|
||||
* @param region The climate region, in that the source stands.
|
||||
* @return Return true if the the climate has changed.
|
||||
*/
|
||||
boolean changeClimate(int tickCount, IClimateRegion region);
|
||||
|
||||
/**
|
||||
* @return The ticks that are required for one change.
|
||||
*/
|
||||
int getTicksForChange(IClimateRegion region);
|
||||
|
||||
@Nullable
|
||||
IClimateSourceProvider getProvider();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
import forestry.api.core.INbtWritable;
|
||||
|
||||
/**
|
||||
* A {@link IClimateState} is used to store and handle temperature and humidity.
|
||||
*
|
||||
* The values are oriented on the values of {@link Biome#getDefaultTemperature()} and {@link Biome#getRainfall()}.
|
||||
*/
|
||||
public interface IClimateState extends INbtWritable {
|
||||
|
||||
float getTemperature();
|
||||
|
||||
float getHumidity();
|
||||
|
||||
IClimateState addTemperature(float temperature);
|
||||
|
||||
IClimateState addHumidity(float humidity);
|
||||
|
||||
IClimateState add(IClimateState state);
|
||||
|
||||
IClimateState scale(double factor);
|
||||
|
||||
IClimateState remove(IClimateState state);
|
||||
|
||||
default float get(ClimateType type){
|
||||
return type == ClimateType.HUMIDITY ? getHumidity() : getTemperature();
|
||||
}
|
||||
|
||||
IClimateState copy(ClimateStateType type);
|
||||
|
||||
IClimateState copy();
|
||||
|
||||
boolean isPresent();
|
||||
|
||||
ClimateStateType getType();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.climate;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public interface IClimateStates {
|
||||
|
||||
IClimateState create(NBTTagCompound compound);
|
||||
|
||||
IClimateState create(NBTTagCompound compound, ClimateStateType type);
|
||||
|
||||
IClimateState create(float temperature, float humidity, ClimateStateType type);
|
||||
|
||||
IClimateState create(IClimateState climateState, ClimateStateType type);
|
||||
|
||||
IClimateState absent();
|
||||
|
||||
IClimateState min();
|
||||
|
||||
IClimateState max();
|
||||
}
|
||||
@@ -5,10 +5,11 @@
|
||||
******************************************************************************/
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
@API(apiVersion = "2.1.0", owner = "Forestry", provides = "ForestryAPI|climate")
|
||||
@API(apiVersion = "5.0.0", owner = "Forestry", provides = "ForestryAPI|climate")
|
||||
package forestry.api.climate;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
@@ -1,3 +1,8 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -9,12 +9,4 @@ public class CamouflageManager {
|
||||
|
||||
public static ICamouflageAccess camouflageAccess;
|
||||
|
||||
public static final String BLOCK = "block";
|
||||
|
||||
public static final String GLASS = "glass";
|
||||
|
||||
public static final String DOOR = "door";
|
||||
|
||||
public static final String NONE = "none";
|
||||
|
||||
}
|
||||
@@ -20,6 +20,8 @@ public enum EnumHumidity {
|
||||
*/
|
||||
DAMP("Damp");
|
||||
|
||||
public static final EnumHumidity[] VALUES = values();
|
||||
|
||||
public final String name;
|
||||
|
||||
EnumHumidity(String name) {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import forestry.api.climate.IClimateState;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
@@ -66,14 +67,15 @@ public enum EnumTemperature {
|
||||
if (BiomeHelper.isBiomeHellish(biome)) {
|
||||
return HELLISH;
|
||||
}
|
||||
return getFromValue(biome.getTemperature());
|
||||
return getFromValue(biome.getDefaultTemperature());
|
||||
}
|
||||
|
||||
public static EnumTemperature getFromBiome(Biome biome, World world, BlockPos pos) {
|
||||
if (BiomeHelper.isBiomeHellish(biome)) {
|
||||
return HELLISH;
|
||||
}
|
||||
float temperature = ForestryAPI.climateManager.getInfo(world, pos).getTemperature();
|
||||
IClimateState state = ForestryAPI.climateManager.getClimateState(world, pos);
|
||||
float temperature = state.getTemperature();
|
||||
return getFromValue(temperature);
|
||||
}
|
||||
}
|
||||
@@ -7,19 +7,26 @@ package forestry.api.core;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import forestry.api.climate.IClimateManager;
|
||||
import forestry.api.farming.IFarmRegistry;
|
||||
import forestry.api.farming.ISimpleFarmLogic;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.climate.IClimateManager;
|
||||
import forestry.api.climate.IClimateStates;
|
||||
import forestry.api.farming.IFarmRegistry;
|
||||
import forestry.api.farming.IFarmable;
|
||||
import forestry.api.farming.ISimpleFarmLogic;
|
||||
import forestry.api.modules.IModuleContainer;
|
||||
import forestry.api.modules.IModuleManager;
|
||||
|
||||
/**
|
||||
* Forestry's API is divided into several subcategories to make it easier to understand.
|
||||
* <p>
|
||||
* If you need to distribute API files, try to only include the parts you are actually
|
||||
* using to minimize conflicts due to API changes.
|
||||
* <p>
|
||||
* .core - Miscallenous base classes and interfaces as well as some basics for tools, armor, game modes and stuff needed by biome mods.
|
||||
* .core - Miscellaneous base classes and interfaces as well as some basics for tools, armor, game modes and stuff needed by biome mods.
|
||||
* .fuels - Managers and classes to facilitate adding fuels to various engines and machines.
|
||||
* .recipes - Managers and helpers to facilitate adding new recipes to various machines.
|
||||
* .storage - Managers, events and interfaces for defining new backpacks and handling backpack behaviour.
|
||||
@@ -50,7 +57,18 @@ public class ForestryAPI {
|
||||
public static IClimateManager climateManager;
|
||||
|
||||
/**
|
||||
* A registry for register fertilizers, {@link IFarmabeles}s and {@link ISimpleFarmLogic}s
|
||||
* Instance of the module manager of forestry.
|
||||
* This can be used to register {@link IModuleContainer}s in the constructor of your mod.
|
||||
*/
|
||||
public static IModuleManager moduleManager;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static IClimateStates states;
|
||||
|
||||
/**
|
||||
* A registry for register fertilizers, {@link IFarmable}s and {@link ISimpleFarmLogic}s
|
||||
*/
|
||||
public static IFarmRegistry farmRegistry;
|
||||
|
||||
@@ -65,10 +83,20 @@ public class ForestryAPI {
|
||||
public static IForestryConstants forestryConstants;
|
||||
|
||||
/**
|
||||
* The currently enabled Forestry plugins.
|
||||
* The currently enabled Forestry modules.
|
||||
* Can be used to check if certain features are available, for example:
|
||||
* ForestryAPI.enabledPlugins.contains("APICULTURE")
|
||||
* ForestryAPI.enabledModules.contains(new ResourceLocation("forestry", "apiculture"))
|
||||
*/
|
||||
public static Set<ResourceLocation> enabledModules;
|
||||
|
||||
/**
|
||||
* The currently enabled Forestry modules.
|
||||
* Can be used to check if certain features are available, for example:
|
||||
* ForestryAPI.enabledPlugins.contains("forestry.apiculture")
|
||||
*
|
||||
* @deprecated Use {@link #enabledModules}
|
||||
*/
|
||||
@Deprecated
|
||||
public static Set<String> enabledPlugins;
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,13 +5,17 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IBreedingTracker;
|
||||
import forestry.api.genetics.IMutation;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
public abstract class ForestryEvent extends Event {
|
||||
|
||||
@@ -53,6 +57,24 @@ public abstract class ForestryEvent extends Event {
|
||||
this.tracker = tracker;
|
||||
this.player = player;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Posted before forestry registers all items and blocks.
|
||||
*
|
||||
* @deprecated removed in 1.13
|
||||
*/
|
||||
@Deprecated
|
||||
public static class PreInit extends ForestryEvent{
|
||||
/**
|
||||
* The main mod instance for Forestry.
|
||||
*/
|
||||
public Object instance;
|
||||
public final FMLPreInitializationEvent event;
|
||||
|
||||
public PreInit(Object instance, FMLPreInitializationEvent event) {
|
||||
this.instance = instance;
|
||||
this.event = event;
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-12
@@ -3,19 +3,11 @@
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.greenhouse;
|
||||
package forestry.api.core;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IInternalBlockFace {
|
||||
|
||||
boolean isTested();
|
||||
|
||||
void setTested(boolean tested);
|
||||
|
||||
EnumFacing getFace();
|
||||
|
||||
BlockPos getPos();
|
||||
|
||||
public interface IBlockPosPredicate {
|
||||
boolean test(World world, BlockPos blockPos);
|
||||
}
|
||||
@@ -7,6 +7,8 @@ package forestry.api.core;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface ICamouflageAccess {
|
||||
@@ -16,21 +18,20 @@ public interface ICamouflageAccess {
|
||||
*
|
||||
* @param itemHandler The handler that is to register.
|
||||
*/
|
||||
void registerCamouflageItemHandler(ICamouflageItemHandler itemHandler);
|
||||
void registerItemHandler(ICamouflageItemHandler itemHandler);
|
||||
|
||||
/**
|
||||
* @return A list of all item camouflage handler's that are registered for that camouflage type.
|
||||
*/
|
||||
List<ICamouflageItemHandler> getCamouflageItemHandler(String type);
|
||||
List<ICamouflageItemHandler> getItemHandlers();
|
||||
|
||||
void addItemToBlackList(String type, ItemStack camouflageBlock);
|
||||
void addItemToBlackList(ItemStack camouflageBlock);
|
||||
|
||||
void addModIdToBlackList(String type, String modID);
|
||||
void addModIdToBlackList(String modID);
|
||||
|
||||
boolean isItemBlackListed(String type, ItemStack camouflageBlock);
|
||||
|
||||
ICamouflageItemHandler getNoneItemHandler();
|
||||
boolean isItemBlackListed(ItemStack camouflageBlock);
|
||||
|
||||
ICamouflageItemHandler getHandlerFromItem(ItemStack stack);
|
||||
@Nullable
|
||||
ICamouflageItemHandler getHandler(ItemStack stack);
|
||||
|
||||
}
|
||||
@@ -12,22 +12,17 @@ public interface ICamouflageHandler extends ILocatable {
|
||||
/**
|
||||
* @return The item of the block that is the camouflage of this handler for the type.
|
||||
*/
|
||||
ItemStack getCamouflageBlock(String type);
|
||||
ItemStack getCamouflageBlock();
|
||||
|
||||
/**
|
||||
* @return The default camouflage block item for the type.
|
||||
*/
|
||||
ItemStack getDefaultCamouflageBlock(String type);
|
||||
|
||||
/**
|
||||
* @return True if the handler can handle this type of camouflage.
|
||||
*/
|
||||
boolean canHandleType(String type);
|
||||
ItemStack getDefaultCamouflageBlock();
|
||||
|
||||
/**
|
||||
* Set the camouflage block item for the type.
|
||||
*
|
||||
* @return True if the block has chanced.
|
||||
*/
|
||||
boolean setCamouflageBlock(String type, ItemStack camouflageBlock, boolean sendClientUpdate);
|
||||
boolean setCamouflageBlock(ItemStack camouflageBlock, boolean sendClientUpdate);
|
||||
}
|
||||
@@ -5,22 +5,20 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
public interface ICamouflageItemHandler {
|
||||
|
||||
|
||||
boolean canHandle(ItemStack stack);
|
||||
|
||||
String getType();
|
||||
|
||||
float getLightTransmittance(ItemStack stack, ICamouflageHandler camouflageHandler);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
Pair<IBlockState, IBakedModel> getModel(ItemStack stack, ICamouflageHandler camouflageHandler, ICamouflagedTile camouflageTile);
|
||||
Pair<IBlockState, IBakedModel> getModel(ItemStack stack);
|
||||
|
||||
}
|
||||
@@ -5,12 +5,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public interface ICamouflagedTile {
|
||||
|
||||
String getCamouflageType();
|
||||
|
||||
BlockPos getCoordinates();
|
||||
public interface ICamouflagedTile extends ILocatable {
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Set;
|
||||
|
||||
public interface IErrorStateRegistry {
|
||||
@@ -12,6 +13,7 @@ public interface IErrorStateRegistry {
|
||||
|
||||
void addAlias(IErrorState state, String name);
|
||||
|
||||
@Nullable
|
||||
IErrorState getErrorState(short id);
|
||||
|
||||
IErrorState getErrorState(String name);
|
||||
|
||||
@@ -1,23 +1,20 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* Interface for things, that have a location.
|
||||
* Must not be named "getWorld" and "getPos" to avoid
|
||||
* SpecialSource issue https://github.com/md-5/SpecialSource/issues/12
|
||||
*/
|
||||
public interface ILocatable {
|
||||
BlockPos getCoordinates();
|
||||
|
||||
/**
|
||||
* Must not be named "getWorld" to avoid SpecialSource issue https://github.com/md-5/SpecialSource/issues/12
|
||||
*/
|
||||
World getWorldObj();
|
||||
}
|
||||
@@ -12,13 +12,17 @@ import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import net.minecraftforge.common.model.IModelState;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* A model baker to make custom models
|
||||
*
|
||||
* @deprecated TODO Remove in 1.13: Not needed in the api
|
||||
*/
|
||||
@Deprecated
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IModelBaker {
|
||||
|
||||
@@ -34,6 +38,8 @@ public interface IModelBaker {
|
||||
|
||||
void addBakedModel(@Nullable IBlockState state, IBakedModel model);
|
||||
|
||||
void addBakedModelPost(@Nullable IBlockState state, IBakedModel model);
|
||||
|
||||
void addFace(EnumFacing facing, TextureAtlasSprite sprite);
|
||||
|
||||
void setModelState(@Nullable IModelState modelState);
|
||||
|
||||
Regular → Executable
+7
-2
@@ -8,14 +8,19 @@ package forestry.api.core;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.client.model.IPerspectiveAwareModel;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* @deprecated TODO Remove in 1.13: Not needed in the api
|
||||
*/
|
||||
@Deprecated
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IModelBakerModel extends IPerspectiveAwareModel {
|
||||
public interface IModelBakerModel extends IBakedModel {
|
||||
|
||||
void setGui3d(boolean gui3d);
|
||||
|
||||
|
||||
@@ -8,9 +8,14 @@ package forestry.api.core;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* @deprecated TODO Remove in 1.13: Not needed in the api
|
||||
*/
|
||||
@Deprecated
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IModelManager {
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
@@ -8,6 +8,10 @@ package forestry.api.core;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* @deprecated TODO Remove in 1.13: Not needed in the api
|
||||
*/
|
||||
@Deprecated
|
||||
public interface IStateMapperRegister {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
|
||||
@@ -5,10 +5,11 @@
|
||||
******************************************************************************/
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
@API(apiVersion = "5.1.0", owner = "Forestry", provides = "ForestryAPI|core")
|
||||
@API(apiVersion = "5.7.0", owner = "Forestry", provides = "ForestryAPI|core")
|
||||
package forestry.api.core;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
@@ -5,14 +5,16 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.farming;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
//TODO: Remove this class in 1.13
|
||||
@Deprecated
|
||||
public class Farmables {
|
||||
/**
|
||||
* Can be used to add IFarmables to some of the vanilla farm logics.
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package forestry.api.farming;
|
||||
|
||||
import forestry.api.circuits.ICircuit;
|
||||
|
||||
public interface IFarmCircuit extends ICircuit {
|
||||
|
||||
IFarmLogic getFarmLogic();
|
||||
}
|
||||
@@ -5,12 +5,14 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.farming;
|
||||
|
||||
import forestry.api.core.IErrorLogicSource;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import forestry.api.core.IErrorLogicSource;
|
||||
|
||||
public interface IFarmHousing extends IErrorLogicSource {
|
||||
|
||||
BlockPos getCoords();
|
||||
@@ -33,10 +35,36 @@ public interface IFarmHousing extends IErrorLogicSource {
|
||||
* Will remove the appropriate germling from the farm's inventory.
|
||||
* It's up to the logic to only call this on a valid location.
|
||||
*
|
||||
* @deprecated TODO remove this method in 1.13
|
||||
*
|
||||
* @return true if planting was successful, false otherwise.
|
||||
*/
|
||||
@Deprecated
|
||||
boolean plantGermling(IFarmable farmable, World world, BlockPos pos);
|
||||
|
||||
/**
|
||||
* Callback for {@link IFarmLogic}s to plant a sapling, seed, germling, stem.
|
||||
* Will remove the appropriate germling from the farm's inventory.
|
||||
* It's up to the logic to only call this on a valid location.
|
||||
*
|
||||
* @return true if planting was successful, false otherwise.
|
||||
*/
|
||||
default boolean plantGermling(IFarmable farmable, World world, BlockPos pos, FarmDirection direction){
|
||||
return plantGermling(farmable, world, pos);
|
||||
}
|
||||
|
||||
default boolean isValidPlatform(World world, BlockPos pos){
|
||||
return false;
|
||||
}
|
||||
|
||||
default boolean isSquare(){
|
||||
return false;
|
||||
}
|
||||
|
||||
default boolean canPlantSoil(boolean manual){
|
||||
return !manual;
|
||||
}
|
||||
|
||||
/* INTERACTION WITH HATCHES */
|
||||
IFarmInventory getFarmInventory();
|
||||
|
||||
|
||||
@@ -27,4 +27,6 @@ public interface IFarmInventory {
|
||||
IInventory getResourcesInventory();
|
||||
|
||||
IInventory getFertilizerInventory();
|
||||
|
||||
|
||||
}
|
||||
@@ -7,37 +7,142 @@ package forestry.api.farming;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
|
||||
/**
|
||||
* The IFarmLogic is used by farm blocks and multi-blocks to cultivate and harvest crops and plants.
|
||||
*
|
||||
* Every farm block has only ony one logic a multi-block farm has four, one for every direction.
|
||||
*/
|
||||
public interface IFarmLogic {
|
||||
|
||||
/**
|
||||
* @return The amount of fertilizer that the {@link IFarmHousing} automatically removes after this logic cultivated
|
||||
* a block or harvested a crop.
|
||||
*/
|
||||
int getFertilizerConsumption();
|
||||
|
||||
/**
|
||||
* @param hydrationModifier A modifier that depends on the weather and the biome of the farm.
|
||||
*
|
||||
* @return The amount of water that the {@link IFarmHousing} automatically removes after this logic cultivated
|
||||
* a block or harvested a crop.
|
||||
*/
|
||||
int getWaterConsumption(float hydrationModifier);
|
||||
|
||||
/**
|
||||
* Checks if the given stack is a resource or a soil that this logic uses to grow plants on or to create other
|
||||
* products like peat.
|
||||
*/
|
||||
boolean isAcceptedResource(ItemStack itemstack);
|
||||
|
||||
/**
|
||||
* Checks if the given stack is a germling (plantable sapling, seed, etc.) for any {@link IFarmable} of this farm.
|
||||
*/
|
||||
boolean isAcceptedGermling(ItemStack itemstack);
|
||||
|
||||
/**
|
||||
* Collects all items that are laying on the ground and are in the {@link IFarmHousing#getArea()} of the farm.
|
||||
*
|
||||
* @param world The world of the farm.
|
||||
* @param farmHousing The farm that uses this logic.
|
||||
*
|
||||
* @return A collection that contains all items that were collected.
|
||||
*/
|
||||
NonNullList<ItemStack> collect(World world, IFarmHousing farmHousing);
|
||||
|
||||
/**
|
||||
* Tries to cultivate one or more blocks at the given position and with the given extent.
|
||||
*
|
||||
* @param world The world of the farm.
|
||||
* @param farmHousing The farm that uses this logic.
|
||||
* @param pos The position at that the logic should start to cultivate.
|
||||
* @param direction The direction of the extension.
|
||||
* @param extent How many blocks this logic has to cultivate after it cultivated the block at the given position.
|
||||
* The positions of the next blocks are having a offset in the given direction.
|
||||
* @return True if the logic has cultivated any block.
|
||||
*/
|
||||
boolean cultivate(World world, IFarmHousing farmHousing, BlockPos pos, FarmDirection direction, int extent);
|
||||
|
||||
/**
|
||||
* Tries to harvest one or more blocks at the given position and with the given extent.
|
||||
*
|
||||
* @param world The world of the farm.
|
||||
* @param pos The position at that the logic should start to harvest.
|
||||
* @param direction The direction of the extension.
|
||||
* @param extent How many blocks this logic tries to harvest after it has tried to harvested the block at the given position.
|
||||
* The positions of the next blocks are having a offset in the given direction.
|
||||
* @return True if the logic has cultivated any block.
|
||||
*/
|
||||
Collection<ICrop> harvest(World world, BlockPos pos, FarmDirection direction, int extent);
|
||||
|
||||
IFarmLogic setManual(boolean manual);
|
||||
/**
|
||||
* Returns the {@link IFarmProperties} that created this logic.
|
||||
*
|
||||
* @since Forestry 5.8
|
||||
*
|
||||
* @return Returns the {@link IFarmProperties} that created this logic. Returns a fake instance from
|
||||
* {@link IFarmRegistry#createFakeInstance(IFarmLogic)} if the logic is older that Forestry 5.8.
|
||||
* TODO: Remove "default" from this method in 1.13
|
||||
*/
|
||||
default IFarmProperties getProperties(){
|
||||
return ForestryAPI.farmRegistry.createFakeInstance(this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
ResourceLocation getTextureMap();
|
||||
default boolean isManual(){
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Since Forestry 5.8 logic instances are created at the constructor of the {@link IFarmProperties} and
|
||||
* have a immutable manual state.
|
||||
* TODO Remove this method in 1.13
|
||||
*/
|
||||
@Deprecated
|
||||
default IFarmLogic setManual(boolean manual){
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use {@link IFarmRegistry#getProperties(String)} to get the {@link IFarmProperties} for the farm logic and register the soil
|
||||
* with {@link IFarmProperties#registerSoil(ItemStack, IBlockState, boolean)}.
|
||||
*/
|
||||
@Deprecated
|
||||
default void addSoil(ItemStack resource, IBlockState soilState, boolean hasMetaData){
|
||||
//
|
||||
}
|
||||
|
||||
default String getUnlocalizedName(){
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Localized short, human-readable identifier used in the farm gui and in tooltips.
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/* GUI ONLY */
|
||||
/**
|
||||
* @deprecated No longer needed because mc always uses the same map for blocks and items.
|
||||
* TODO remove this method in 1.13
|
||||
*/
|
||||
@Deprecated
|
||||
@SideOnly(Side.CLIENT)
|
||||
default ResourceLocation getTextureMap(){
|
||||
return TextureMap.LOCATION_BLOCKS_TEXTURE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the itemStack that represents this farm logic. Used as an icon for the farm logic.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package forestry.api.farming;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* @since Forestry 5.8
|
||||
*/
|
||||
public interface IFarmProperties {
|
||||
|
||||
/**
|
||||
* Can be used to register a {@link IBlockState} as a valid soil.
|
||||
*/
|
||||
default void registerSoil(ItemStack resource, IBlockState soilState){
|
||||
registerSoil(resource, soilState, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be used to register a {@link IBlockState} as a valid soil.
|
||||
*/
|
||||
void registerSoil(ItemStack resource, IBlockState soilState, boolean hasMetaData);
|
||||
|
||||
void addGermlings(ItemStack... germlings);
|
||||
|
||||
void addGermlings(Collection<ItemStack> germlings);
|
||||
|
||||
void addProducts(ItemStack... products);
|
||||
|
||||
void addProducts(Collection<ItemStack> products);
|
||||
|
||||
/**
|
||||
* Adds the {@link IFarmable}s that where registered with the given identifier.
|
||||
*/
|
||||
void registerFarmables(String identifier);
|
||||
|
||||
/**
|
||||
* @return true if the given block state is a valid soil state.
|
||||
*/
|
||||
boolean isAcceptedSoil(IBlockState blockState);
|
||||
|
||||
/**
|
||||
* @return true if the given stack is the {@link ItemStack} of a soil.
|
||||
*/
|
||||
boolean isAcceptedResource(ItemStack itemStack);
|
||||
|
||||
Collection<ISoil> getSoils();
|
||||
|
||||
Collection<IFarmable> getFarmables();
|
||||
|
||||
Collection<IFarmableInfo> getFarmableInfo();
|
||||
|
||||
/**
|
||||
* Returns the instance of the manual or managed {@link IFarmLogic}.
|
||||
*/
|
||||
IFarmLogic getLogic(boolean manuel);
|
||||
}
|
||||
@@ -5,36 +5,97 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.farming;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IFarmRegistry {
|
||||
|
||||
/**
|
||||
* Registers farming logic in registry under given identifier
|
||||
* @param identifier Valid identifiers: farmArboreal farmCrops farmGourd farmInfernal farmPoales farmSucculentes farmShroom
|
||||
* @param logic corresponding instance of logic
|
||||
*
|
||||
* @deprecated Since Forestry 5.8. Use {@link #registerLogic(String, BiFunction, String...)} or
|
||||
* {@link #registerLogic(String, IFarmProperties)}.
|
||||
*/
|
||||
@Deprecated
|
||||
void registerLogic(String identifier, IFarmLogic logic);
|
||||
|
||||
/**
|
||||
* Registers farming logic in registry
|
||||
* @since Forestry 5.8
|
||||
*/
|
||||
IFarmProperties registerLogic(String identifier, IFarmProperties farmInstance);
|
||||
|
||||
/**
|
||||
* Registers farming logic in registry under given identifier
|
||||
*
|
||||
* @param identifier Valid identifiers: farmArboreal farmCrops farmGourd farmInfernal farmPoales farmSucculentes farmShroom
|
||||
* @param logicFactory factory that creates the corresponding instance of logic
|
||||
* @param farmablesIdentifiers Identifiers: farmArboreal farmCrops farmGourd farmInfernal farmPoales farmSucculentes farmShroom
|
||||
* @since Forestry 5.8
|
||||
*/
|
||||
IFarmProperties registerLogic(String identifier, BiFunction<IFarmProperties, Boolean, IFarmLogic> logicFactory, String... farmablesIdentifiers);
|
||||
|
||||
/**
|
||||
* Can be used to add IFarmables to some of the vanilla farm logics.
|
||||
* <p>
|
||||
* Identifiers: farmArboreal farmWheat farmGourd farmInfernal farmPoales farmSucculentes farmVegetables farmShroom
|
||||
* Identifiers: farmArboreal farmCrops farmGourd farmInfernal farmPoales farmSucculentes farmShroom
|
||||
*/
|
||||
void registerFarmables(String identifier, IFarmable... farmable);
|
||||
|
||||
Collection<IFarmable> getFarmables(String identifier);
|
||||
|
||||
IFarmableInfo getFarmableInfo(String identifier);
|
||||
|
||||
/**
|
||||
* Can be used to create a simple version of a farm logic, like the vanilla vegetable or wheat farm logic.
|
||||
*
|
||||
* @return Null if the farming plugin is not active.
|
||||
*
|
||||
* @deprecated Since Forestry 5.8. Use {@link #createCropLogic(IFarmProperties, boolean, ISimpleFarmLogic)} instead.
|
||||
*/
|
||||
IFarmLogic createLogic(ISimpleFarmLogic simpleFarmLogic);
|
||||
@Nullable
|
||||
@Deprecated
|
||||
default IFarmLogic createLogic(ISimpleFarmLogic simpleFarmLogic){
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param itemStack
|
||||
* @param value The value of the fertitlizer.The value of the forestry fertelizer is 500.
|
||||
* @param itemStack the fertilizer itemstack
|
||||
* @param value The value of the fertilizer. The value of the forestry fertilizer is 500.
|
||||
*/
|
||||
void registerFertilizer(ItemStack itemStack, int value);
|
||||
|
||||
/**
|
||||
* @return The value of the fertitlizer
|
||||
* @return The value of the fertilizer
|
||||
*/
|
||||
int getFertilizeValue(ItemStack itemStack);
|
||||
|
||||
/**
|
||||
* Returns a fake {@link IFarmProperties} that returns the given logic at {@link IFarmProperties#getLogic(boolean)}.
|
||||
*
|
||||
* @since Forestry 5.8
|
||||
* @deprecated Only for backwards comparability.
|
||||
*/
|
||||
@Deprecated
|
||||
IFarmProperties createFakeInstance(IFarmLogic logic);
|
||||
|
||||
/**
|
||||
* Can be used to create a simple version of a farm logic, like the vanilla vegetable or wheat farm logic.
|
||||
*
|
||||
* @return Null if the farming plugin is not active.
|
||||
*/
|
||||
@Nullable
|
||||
IFarmLogic createCropLogic(IFarmProperties instance, boolean isManual, ISimpleFarmLogic simpleFarmLogic);
|
||||
|
||||
/**
|
||||
* @since Forestry 5.8
|
||||
*/
|
||||
@Nullable
|
||||
IFarmProperties getProperties(String identifier);
|
||||
|
||||
}
|
||||
@@ -20,8 +20,19 @@ public interface IFarmable {
|
||||
|
||||
/**
|
||||
* @return true if the block at the given location is a "sapling" for this type, i.e. a non-harvestable immature version of the crop.
|
||||
* @deprecated Since Forestry 5.8. Use the version below. TODO Remove this method in 1.13
|
||||
*/
|
||||
boolean isSaplingAt(World world, BlockPos pos);
|
||||
@Deprecated
|
||||
default boolean isSaplingAt(World world, BlockPos pos){
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if the block at the given location is a "sapling" for this type, i.e. a non-harvestable immature version of the crop.
|
||||
*/
|
||||
default boolean isSaplingAt(World world, BlockPos pos, IBlockState blockState){
|
||||
return isSaplingAt(world, pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link ICrop} if the block at the given location is a harvestable and mature crop, null otherwise.
|
||||
@@ -34,6 +45,9 @@ public interface IFarmable {
|
||||
*/
|
||||
boolean isGermling(ItemStack itemstack);
|
||||
|
||||
default void addInformation(IFarmableInfo info){
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if the item is something that can drop from this type without actually being harvested as a crop. (Apples or sapling from decaying leaves.)
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package forestry.api.farming;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* IFarmableInfo describes the valid germlings and possible products of an IFarmable. This is mainly used by the jei farming
|
||||
* category to display the valid germlings and possible products.
|
||||
*/
|
||||
public interface IFarmableInfo {
|
||||
|
||||
/***
|
||||
* @return The identifier of the IFarmable.
|
||||
*/
|
||||
String getIdentifier();
|
||||
|
||||
default void addGermlings(ItemStack... germlings){
|
||||
addGermlings(Arrays.asList(germlings));
|
||||
}
|
||||
|
||||
void addGermlings(Collection<ItemStack> germlings);
|
||||
|
||||
/**
|
||||
* @return a collection that contains all valid germlings of a farmable.
|
||||
*/
|
||||
Collection<ItemStack> getGermlings();
|
||||
|
||||
default void addProducts(ItemStack... products){
|
||||
addProducts(Arrays.asList(products));
|
||||
}
|
||||
|
||||
void addProducts(Collection<ItemStack> products);
|
||||
|
||||
/**
|
||||
* @return a collection that contains all possible products of a farmable.
|
||||
*/
|
||||
Collection<ItemStack> getProducts();
|
||||
}
|
||||
@@ -8,7 +8,9 @@ package forestry.api.farming;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* A simple version of the IFarmLogic.
|
||||
* A simple version of the IFarmLogic.
|
||||
*
|
||||
* @apiNote TODO Remove this in 1.13
|
||||
*/
|
||||
public interface ISimpleFarmLogic {
|
||||
|
||||
@@ -16,7 +18,11 @@ public interface ISimpleFarmLogic {
|
||||
* @return the itemStack that represents this farm logic. Used as an icon for the farm logic.
|
||||
*/
|
||||
ItemStack getIconItemStack();
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated Since 5.8
|
||||
*/
|
||||
@Deprecated
|
||||
Iterable<IFarmable> getSeeds();
|
||||
|
||||
String getName();
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package forestry.api.farming;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* @since Forestry 5.8
|
||||
*/
|
||||
public interface ISoil {
|
||||
|
||||
ItemStack getResource();
|
||||
|
||||
IBlockState getSoilState();
|
||||
|
||||
boolean hasMetaData();
|
||||
}
|
||||
@@ -5,10 +5,11 @@
|
||||
******************************************************************************/
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
@API(apiVersion = "2.2.0", owner = "ForestryAPI|core", provides = "ForestryAPI|farming")
|
||||
@API(apiVersion = "5.8.0", owner = "ForestryAPI|core", provides = "ForestryAPI|farming")
|
||||
package forestry.api.farming;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
|
||||
import net.minecraftforge.fml.common.API;
|
||||
@@ -26,7 +26,7 @@ public class FermenterFuel {
|
||||
}
|
||||
|
||||
/**
|
||||
* How much is fermeted per work cycle, i.e. how much biomass is produced per cycle.
|
||||
* How much is fermented per work cycle, i.e. how much biomass is produced per cycle.
|
||||
*/
|
||||
public int getFermentPerCycle() {
|
||||
return fermentPerCycle;
|
||||
|
||||
@@ -23,4 +23,10 @@ public class AlleleManager {
|
||||
* Creates Forestry alleles.
|
||||
*/
|
||||
public static IAlleleFactory alleleFactory;
|
||||
|
||||
/**
|
||||
* @since 5.8
|
||||
*/
|
||||
public static IFilterRegistry filterRegistry;
|
||||
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import forestry.api.arboriculture.IAlleleFruit;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
/**
|
||||
* Called after Forestry has registered all his species alleles of a individual.
|
||||
*/
|
||||
|
||||
Loaded 100 of 1698 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user