mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-15 17:44:55 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76f09be39d | ||
|
|
e6cb758e0e | ||
|
|
b3549edf51 | ||
|
|
e09d159935 | ||
|
|
4cb2610b1c | ||
|
|
c44f11cf09 | ||
|
|
b69c31ed8a | ||
|
|
6a2231f8fb | ||
|
|
a3a6c71c42 | ||
|
|
8d5c0c6f8b | ||
|
|
56603fd00c | ||
|
|
ed69411d2e | ||
|
|
e1d017f077 | ||
|
|
9269af7a13 | ||
|
|
8ffdba5021 | ||
|
|
e00aecd886 | ||
|
|
98f859f2fb | ||
|
|
55a15d23b2 | ||
|
|
307580aed8 | ||
|
|
d2d93004e0 | ||
|
|
e1df424bfd | ||
|
|
6a75347b05 | ||
|
|
cfd513ea80 | ||
|
|
edcc47a6b3 | ||
|
|
6593118f3d | ||
|
|
fd724d147a | ||
|
|
b2e1b2dc9b | ||
|
|
defc47000b | ||
|
|
0a37ad0666 | ||
|
|
13d4907bff | ||
|
|
78725009c1 | ||
|
|
a1bc9144bd | ||
|
|
b897056824 | ||
|
|
87563b6c97 | ||
|
|
62d6294da2 | ||
|
|
b4d71543db | ||
|
|
73db1a608a | ||
|
|
1c6b60122e | ||
|
|
1e7a042b53 | ||
|
|
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 | ||
|
|
438883bb8e | ||
|
|
828dd63acd | ||
|
|
f7cc35d949 | ||
|
|
ec9004b50b | ||
|
|
8b4c1a5dab | ||
|
|
853355062e | ||
|
|
834e3ed55a | ||
|
|
5b2b0bfc95 | ||
|
|
4fae8c26d9 | ||
|
|
0aa4a0f794 | ||
|
|
ac0864303c | ||
|
|
8811b24811 | ||
|
|
904293f407 | ||
|
|
3e175aa8e6 | ||
|
|
c4ecdde110 | ||
|
|
4aa978023d | ||
|
|
50009786d8 | ||
|
|
032d706fc4 | ||
|
|
dcd9e90898 | ||
|
|
bab3479cde | ||
|
|
a5b79c97d2 | ||
|
|
05d6dc3d4a | ||
|
|
6e2ed37e80 | ||
|
|
c840945706 | ||
|
|
ca7d6dbc66 | ||
|
|
81ef5d536f | ||
|
|
f911100c3d | ||
|
|
386f0645a5 | ||
|
|
91d46d1331 | ||
|
|
e1eb4d25fb | ||
|
|
72234d9b5d | ||
|
|
97f21bfda8 | ||
|
|
c8c30073a2 | ||
|
|
dc27154c1f | ||
|
|
5b15e6f405 | ||
|
|
2530a7fb15 | ||
|
|
4ec1381fbe | ||
|
|
d97f6f69b0 | ||
|
|
c8fcb292d4 | ||
|
|
e075fe8fbf | ||
|
|
5ce9b9f65b | ||
|
|
2c9a30db73 | ||
|
|
4a31215ce1 | ||
|
|
4da5e86813 | ||
|
|
66bdedd65b | ||
|
|
0149013579 | ||
|
|
bebf5b3aec | ||
|
|
0356a3f479 | ||
|
|
d29aa13377 | ||
|
|
c2313c7569 | ||
|
|
bb28a6db48 | ||
|
|
f61f7a0aff | ||
|
|
84f01de7f9 | ||
|
|
ced6f3cbf2 | ||
|
|
bbec31fc6e | ||
|
|
67024ffb2b | ||
|
|
1945c4ff70 | ||
|
|
7a1e35e05f | ||
|
|
06adb53944 | ||
|
|
919ce8238b | ||
|
|
6f285d1c88 | ||
|
|
af9ddb4928 | ||
|
|
1d2f3f16ab | ||
|
|
7f63ae8450 | ||
|
|
77ecd03416 | ||
|
|
56a907dbec | ||
|
|
e93633d999 | ||
|
|
fc0d144508 | ||
|
|
252dd8ab22 | ||
|
|
6ef41d4cd8 | ||
|
|
0b08780964 | ||
|
|
1cf24982fd | ||
|
|
9555005ac0 | ||
|
|
00b4b6552c | ||
|
|
23a9af3020 | ||
|
|
84a14811d8 | ||
|
|
7b340fdb49 | ||
|
|
9044a72aee | ||
|
|
cc40bd1cc3 | ||
|
|
a13e63cb2d | ||
|
|
6cb3b73200 | ||
|
|
7c8d81470d | ||
|
|
ef3f64fdd9 | ||
|
|
fdd6d75d0e | ||
|
|
46bb2cdccd | ||
|
|
aa21b31392 | ||
|
|
6a12e19798 | ||
|
|
81dd20b41c | ||
|
|
0b491f26fc | ||
|
|
bb0a0343c1 | ||
|
|
17e38e7c5e | ||
|
|
0ad3baecda | ||
|
|
a72971e042 | ||
|
|
b5e24e84cb | ||
|
|
c210886400 | ||
|
|
1bdbb7e9f8 | ||
|
|
f91c0574ad | ||
|
|
50f0efb7a0 | ||
|
|
3d932700cd | ||
|
|
6a00a65aac | ||
|
|
1b781684a0 | ||
|
|
f2d280a861 | ||
|
|
87ce642235 | ||
|
|
b297bbb2c4 | ||
|
|
931e518ca2 | ||
|
|
7ff4944281 | ||
|
|
9d8c616b67 | ||
|
|
17afceab6a | ||
|
|
306bae490c | ||
|
|
d8e735ef3b | ||
|
|
55919a135e | ||
|
|
02f5c7121d | ||
|
|
ed1907ddea | ||
|
|
0a0bdfa978 | ||
|
|
4abbc92472 | ||
|
|
1fa461430e | ||
|
|
d60bdd5f93 | ||
|
|
f39ff51ca8 | ||
|
|
35f9b95f37 | ||
|
|
b2d4e6eaba | ||
|
|
5bd4ba3cd5 | ||
|
|
d4f9c69538 | ||
|
|
ea976ebb2f | ||
|
|
c5798af241 | ||
|
|
e0bff8ec64 | ||
|
|
8bf6b19a63 | ||
|
|
abf6ccb3ed | ||
|
|
d55b91df48 | ||
|
|
1b865a0589 | ||
|
|
a2c12f3841 | ||
|
|
08c99cb0ca | ||
|
|
8cfafec6f9 | ||
|
|
9611ae08ae | ||
|
|
30d7365518 | ||
|
|
56800af94d | ||
|
|
043571b659 | ||
|
|
7fd2776147 | ||
|
|
d4c2d7220d | ||
|
|
d392666dc4 | ||
|
|
07b88d36fc | ||
|
|
408d1dc7c3 | ||
|
|
7b1aead339 | ||
|
|
21969649a2 | ||
|
|
f9b8b89340 | ||
|
|
65712adcb3 | ||
|
|
9864a84a13 | ||
|
|
8f9ae45147 | ||
|
|
2965f28403 | ||
|
|
cb93c217e0 | ||
|
|
219e9bf355 | ||
|
|
43a2f0ae76 | ||
|
|
098b739dca | ||
|
|
4dfa29b1ad | ||
|
|
60d2820ed6 | ||
|
|
91ec6cff9b | ||
|
|
1775e59880 | ||
|
|
f62745b233 | ||
|
|
1d6293c788 | ||
|
|
3fd07f2a7a | ||
|
|
856e800e0e | ||
|
|
d9561fd7af | ||
|
|
e0623f7d57 | ||
|
|
d48b979ac3 | ||
|
|
63494c40a7 | ||
|
|
2c57aef3b3 | ||
|
|
1392823fae | ||
|
|
67693961ac | ||
|
|
8ad8597ff0 | ||
|
|
4c8d5e2f43 | ||
|
|
d04713339c | ||
|
|
844aea7431 | ||
|
|
53a9bf458e | ||
|
|
2ae52451b2 | ||
|
|
d3054c33e7 | ||
|
|
bf61462a2a | ||
|
|
41f3ae4b1f | ||
|
|
b1d7c1721d | ||
|
|
2944165741 | ||
|
|
e316526675 | ||
|
|
411cbd913c | ||
|
|
2191d00f3d | ||
|
|
a02af0ddf2 | ||
|
|
a8e4f5dde7 | ||
|
|
85718b1df8 | ||
|
|
781b4d883b | ||
|
|
c5c056750a | ||
|
|
3b8af4e4c9 | ||
|
|
f58938ff32 | ||
|
|
a05bc13852 | ||
|
|
1cd3e15ef9 | ||
|
|
1ac7a7de42 | ||
|
|
90ed57c742 | ||
|
|
94b0b44f51 | ||
|
|
c0fafc20da | ||
|
|
4f85236475 | ||
|
|
41ab1ea374 | ||
|
|
52b8d56ff0 | ||
|
|
a61879daff | ||
|
|
e71edd5855 | ||
|
|
321e316665 | ||
|
|
aca6ed1fd8 | ||
|
|
b135593733 | ||
|
|
ac7fe4b2d2 | ||
|
|
5e0e045053 | ||
|
|
f01dab6f58 | ||
|
|
9385a4caca | ||
|
|
582c8d64df | ||
|
|
26c40b2006 | ||
|
|
b7eaaf6804 | ||
|
|
3f07e68952 | ||
|
|
2b40762934 | ||
|
|
dcaf6e144f | ||
|
|
413e1b9a0d | ||
|
|
64f64f2b5c | ||
|
|
2d25754731 | ||
|
|
2df6cfb7f7 | ||
|
|
2d0ca49359 | ||
|
|
d567138365 | ||
|
|
72380251f3 | ||
|
|
05a263826e | ||
|
|
61aa8bdcf0 | ||
|
|
e0694842b6 | ||
|
|
ff9942d0bc | ||
|
|
dcf7776cc1 | ||
|
|
a0d355d0aa | ||
|
|
649a061b6e | ||
|
|
2ca743a931 | ||
|
|
76a34a603b | ||
|
|
68651939e7 | ||
|
|
9dcc818a17 | ||
|
|
5e3c23e4eb | ||
|
|
d8ffc5c4b8 | ||
|
|
737f64eeab | ||
|
|
0db27d83b0 | ||
|
|
f57de19b06 | ||
|
|
1fed58fae5 | ||
|
|
1d8d61daf1 | ||
|
|
65bd93749c | ||
|
|
ac48b4b5c6 | ||
|
|
3be3ecfc8a | ||
|
|
10aae6b6bc | ||
|
|
d84560926c | ||
|
|
ab3de49198 | ||
|
|
b2b743398c | ||
|
|
52f233e84a | ||
|
|
2f2ec91670 | ||
|
|
2e2fa8e6df | ||
|
|
3de6e0c5b7 | ||
|
|
0f4ba8d8fa | ||
|
|
9570d26c83 | ||
|
|
01dc4f2bfe | ||
|
|
80de4d6490 | ||
|
|
253e9f18ed | ||
|
|
bbda5c8ba9 | ||
|
|
c289590740 | ||
|
|
714858be99 | ||
|
|
5bb60cad8a | ||
|
|
b8cf4ef1cf | ||
|
|
d35075d681 | ||
|
|
79c56311c2 | ||
|
|
77cea8a645 | ||
|
|
ed00ca3158 | ||
|
|
418f00abf2 | ||
|
|
0fa8fdad39 | ||
|
|
0a110eb761 | ||
|
|
9feb5cb114 | ||
|
|
7aa44fb1fa | ||
|
|
84fa956ce4 | ||
|
|
0c14a85c31 | ||
|
|
a20fbbe60f | ||
|
|
27d932ee34 | ||
|
|
52b1784f25 | ||
|
|
154f4f2712 | ||
|
|
806ca2cf7b | ||
|
|
9f171977bb | ||
|
|
2031f7fe02 | ||
|
|
4259a55e7a | ||
|
|
065344ba5e | ||
|
|
d0c9a77528 | ||
|
|
604429f267 | ||
|
|
f5a9dcccb8 | ||
|
|
b056cce707 | ||
|
|
1497aada57 | ||
|
|
fb8ddf54b7 | ||
|
|
9a05322d45 | ||
|
|
8c2008b06c | ||
|
|
e3cc08a624 | ||
|
|
36cd4663d9 | ||
|
|
a014ef6d14 | ||
|
|
34fa218c38 | ||
|
|
f422b577fe | ||
|
|
e379465227 | ||
|
|
eb63e75200 | ||
|
|
b5faab51c3 | ||
|
|
ddffe5d4ce | ||
|
|
f59e57aa6a | ||
|
|
ae8cbf2ff2 | ||
|
|
305f3f78ec | ||
|
|
98e506cc4a | ||
|
|
ecfb11c096 | ||
|
|
6b59736ffe | ||
|
|
a3a1f7720e | ||
|
|
89cfbfca9c | ||
|
|
e0676030d6 | ||
|
|
0c76e22b8a | ||
|
|
1a8f1751d9 | ||
|
|
b95bb8315f | ||
|
|
2cc2540bdc | ||
|
|
84af238d82 | ||
|
|
89960db2bd | ||
|
|
c5f53bda3e | ||
|
|
2e1b62e58d | ||
|
|
982aefa165 | ||
|
|
2cccf95775 | ||
|
|
1969ed8b09 | ||
|
|
c3fc490fac | ||
|
|
59687329fb | ||
|
|
94f751d78a | ||
|
|
f6feca096f | ||
|
|
649f38efb8 | ||
|
|
e4e221b9fd | ||
|
|
d7f063eec8 | ||
|
|
aa988a3be7 | ||
|
|
18f2a027bc | ||
|
|
7ca34e52d6 | ||
|
|
7f83b5b909 |
No files matched your search
@@ -0,0 +1,5 @@
|
||||
Thank you for reporting!
|
||||
|
||||
For issues:
|
||||
* Try the latest version, it may have fixed the issue already.
|
||||
* If you crashed, please paste the crash log to [gist](https://gist.github.com/) and link it here.
|
||||
+3
-3
@@ -2,11 +2,10 @@
|
||||
/*
|
||||
|
||||
# folders
|
||||
!/.github
|
||||
!/forestry_techne
|
||||
!/gradle/wrapper
|
||||
!/src
|
||||
!/api
|
||||
!/test
|
||||
|
||||
# files
|
||||
!/.gitignore
|
||||
@@ -21,4 +20,5 @@
|
||||
!/build.xml
|
||||
!/gradlew
|
||||
!/gradlew.bat
|
||||
.DS_Store
|
||||
!/cla-signatures.txt
|
||||
!/formatting-settings.jar
|
||||
@@ -1,4 +1,4 @@
|
||||
Forestry
|
||||
[Forestry](https://minecraft.curseforge.com/projects/forestry/files)
|
||||
====================================
|
||||
|
||||
### What is it?
|
||||
@@ -9,7 +9,7 @@ Forestry is a modification for the game Minecraft and known primarily for its fa
|
||||
|
||||
[Wiki](http://forestry.sengir.net/)
|
||||
|
||||
[Latest Builds for 1.10 / 1.10.2](http://jenkins.ic2.player.to/job/Forestry_5/)
|
||||
[Latest Builds for 1.11 / 1.11.2](http://jenkins.ic2.player.to/job/Forestry_1.11/)
|
||||
|
||||
[IRC #forestry on esper.net](http://webchat.esper.net/?nick=ForestryGithub...&channels=forestry&prompt=1)
|
||||
|
||||
@@ -17,7 +17,7 @@ For those interested in developement, you can also visit #forestry-dev.
|
||||
|
||||
### Building
|
||||
|
||||
The API and localization files reside in their own repository. It is pulled in automatically.
|
||||
The localization files reside in their own repository. It is pulled in automatically.
|
||||
|
||||
You may want to adjust the "./gradle.properties" file to set your mc account as needed.
|
||||
|
||||
|
||||
Executable → Regular
+21
-38
@@ -1,27 +1,21 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
}
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
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 "net.minecraftforge.gradle.forge" version "2.0.2"
|
||||
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')) {
|
||||
@@ -34,8 +28,8 @@ 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
|
||||
@@ -68,9 +62,9 @@ repositories {
|
||||
}
|
||||
|
||||
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.darkhax.tesla:Tesla-${tesla_mcversion}:${tesla_version}"
|
||||
deobfCompile "mezz.jei:jei_${jei_mcversion}:${jei_version}:api"
|
||||
runtime "mezz.jei:jei_${jei_mcversion}:${jei_version}"
|
||||
deobfCompile "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
|
||||
}
|
||||
|
||||
@@ -98,6 +92,9 @@ processResources {
|
||||
exclude 'mcmod.info'
|
||||
exclude '**/*.md'
|
||||
}
|
||||
|
||||
// Move access transformers to META-INF
|
||||
rename '(.+_at.cfg)', 'META-INF/$1'
|
||||
}
|
||||
|
||||
// prevent java 8's strict doclint for javadocs from failing builds
|
||||
@@ -108,12 +105,8 @@ allprojects {
|
||||
}
|
||||
|
||||
jar {
|
||||
// Copy redstone api into the jar, should shade this as a maven dep...
|
||||
from (sourceSets.api.allSource) {
|
||||
include 'cofh/**/*.txt'
|
||||
}
|
||||
from (sourceSets.api.output.classesDir) {
|
||||
include 'cofh/**/*.*'
|
||||
manifest {
|
||||
attributes 'FMLAT': 'forestry_at.cfg'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,27 +151,17 @@ task makeChangelog(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {
|
||||
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}}
|
||||
"""
|
||||
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'
|
||||
addGameVersion '1.12'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
Regular → Executable
+11
-8
@@ -1,11 +1,14 @@
|
||||
mcversion=1.10.2
|
||||
forgeversion=12.18.0.2005-1.10.0
|
||||
mcp_mappings=snapshot_20160525
|
||||
mcversion=1.12.1
|
||||
forgeversion=14.22.0.2462
|
||||
mcp_mappings=snapshot_20170826
|
||||
curse_project_id=59751
|
||||
|
||||
tesla_version=1.9.4-1.1.0.24
|
||||
jei_version=3.7.3.221
|
||||
ic2_version=2.6.5-ex110
|
||||
tesla_version=1.0.60
|
||||
tesla_mcversion=1.12
|
||||
jei_version=4.7.8.91
|
||||
jei_mcversion=1.12.1
|
||||
ic2_version=2.8.17-ex112
|
||||
|
||||
version_major=5
|
||||
version_minor=1
|
||||
version_patch=12
|
||||
version_minor=5
|
||||
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
-1
Submodule lang updated: a8bbc7bd1c...192d6f8584.
@@ -1,165 +0,0 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
@@ -1,11 +0,0 @@
|
||||
Redstone Flux API
|
||||
====================================
|
||||
This is the standalone CoFH Energy API - also known as the "Redstone Flux" API.
|
||||
|
||||
Make great use of it.
|
||||
|
||||
You are of course free to modify any/all of this code and even repackage it, but then it wouldn't be an awesome crossmod API anymore, now would it?
|
||||
|
||||
Don't be a jerk.
|
||||
|
||||
~Team CoFH
|
||||
@@ -1,11 +0,0 @@
|
||||
package cofh.api;
|
||||
|
||||
public class CoFHAPIProps {
|
||||
|
||||
private CoFHAPIProps() {
|
||||
|
||||
}
|
||||
|
||||
public static final String VERSION = "1.8.9R1.2.0B1";
|
||||
|
||||
}
|
||||
@@ -1,162 +0,0 @@
|
||||
package cofh.api.energy;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
/**
|
||||
* Reference implementation of {@link IEnergyStorage}. Use/extend this or implement your own.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public class EnergyStorage implements IEnergyStorage {
|
||||
|
||||
protected int energy;
|
||||
protected int capacity;
|
||||
protected int maxReceive;
|
||||
protected int maxExtract;
|
||||
|
||||
public EnergyStorage(int capacity) {
|
||||
|
||||
this(capacity, capacity, capacity);
|
||||
}
|
||||
|
||||
public EnergyStorage(int capacity, int maxTransfer) {
|
||||
|
||||
this(capacity, maxTransfer, maxTransfer);
|
||||
}
|
||||
|
||||
public EnergyStorage(int capacity, int maxReceive, int maxExtract) {
|
||||
|
||||
this.capacity = capacity;
|
||||
this.maxReceive = maxReceive;
|
||||
this.maxExtract = maxExtract;
|
||||
}
|
||||
|
||||
public EnergyStorage readFromNBT(NBTTagCompound nbt) {
|
||||
|
||||
this.energy = nbt.getInteger("Energy");
|
||||
|
||||
if (energy > capacity) {
|
||||
energy = capacity;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
|
||||
if (energy < 0) {
|
||||
energy = 0;
|
||||
}
|
||||
nbt.setInteger("Energy", energy);
|
||||
return nbt;
|
||||
}
|
||||
|
||||
public EnergyStorage setCapacity(int capacity) {
|
||||
|
||||
this.capacity = capacity;
|
||||
|
||||
if (energy > capacity) {
|
||||
energy = capacity;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public EnergyStorage setMaxTransfer(int maxTransfer) {
|
||||
|
||||
setMaxReceive(maxTransfer);
|
||||
setMaxExtract(maxTransfer);
|
||||
return this;
|
||||
}
|
||||
|
||||
public EnergyStorage setMaxReceive(int maxReceive) {
|
||||
|
||||
this.maxReceive = maxReceive;
|
||||
return this;
|
||||
}
|
||||
|
||||
public EnergyStorage setMaxExtract(int maxExtract) {
|
||||
|
||||
this.maxExtract = maxExtract;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getMaxReceive() {
|
||||
|
||||
return maxReceive;
|
||||
}
|
||||
|
||||
public int getMaxExtract() {
|
||||
|
||||
return maxExtract;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is included to allow for server to client sync. Do not call this externally to the containing Tile Entity, as not all IEnergyHandlers
|
||||
* are guaranteed to have it.
|
||||
*
|
||||
* @param energy
|
||||
*/
|
||||
public void setEnergyStored(int energy) {
|
||||
|
||||
this.energy = energy;
|
||||
|
||||
if (this.energy > capacity) {
|
||||
this.energy = capacity;
|
||||
} else if (this.energy < 0) {
|
||||
this.energy = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is included to allow the containing tile to directly and efficiently modify the energy contained in the EnergyStorage. Do not rely on this
|
||||
* externally, as not all IEnergyHandlers are guaranteed to have it.
|
||||
*
|
||||
* @param energy
|
||||
*/
|
||||
public void modifyEnergyStored(int energy) {
|
||||
|
||||
this.energy += energy;
|
||||
|
||||
if (this.energy > capacity) {
|
||||
this.energy = capacity;
|
||||
} else if (this.energy < 0) {
|
||||
this.energy = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* IEnergyStorage */
|
||||
@Override
|
||||
public int receiveEnergy(int maxReceive, boolean simulate) {
|
||||
|
||||
int energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive));
|
||||
|
||||
if (!simulate) {
|
||||
energy += energyReceived;
|
||||
}
|
||||
return energyReceived;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int extractEnergy(int maxExtract, boolean simulate) {
|
||||
|
||||
int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));
|
||||
|
||||
if (!simulate) {
|
||||
energy -= energyExtracted;
|
||||
}
|
||||
return energyExtracted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored() {
|
||||
|
||||
return energy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
|
||||
return capacity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package cofh.api.energy;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
|
||||
/**
|
||||
* Implement this interface on TileEntities which should connect to energy transportation blocks. This is intended for blocks which generate energy but do not
|
||||
* accept it; otherwise just use IEnergyHandler.
|
||||
* <p>
|
||||
* Note that {@link IEnergyHandler} is an extension of this.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IEnergyConnection {
|
||||
|
||||
/**
|
||||
* Returns TRUE if the TileEntity can connect on a given side.
|
||||
*/
|
||||
boolean canConnectEnergy(EnumFacing from);
|
||||
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package cofh.api.energy;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Implement this interface on Item classes that support external manipulation of their internal energy storages.
|
||||
* <p>
|
||||
* A reference implementation is provided {@link ItemEnergyContainer}.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IEnergyContainerItem {
|
||||
|
||||
/**
|
||||
* Adds energy to a container item. Returns the quantity of energy that was accepted. This should always return 0 if the item cannot be externally charged.
|
||||
*
|
||||
* @param container
|
||||
* ItemStack to be charged.
|
||||
* @param maxReceive
|
||||
* Maximum amount of energy to be sent into the item.
|
||||
* @param simulate
|
||||
* If TRUE, the charge will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) received by the item.
|
||||
*/
|
||||
int receiveEnergy(ItemStack container, int maxReceive, boolean simulate);
|
||||
|
||||
/**
|
||||
* Removes energy from a container item. Returns the quantity of energy that was removed. This should always return 0 if the item cannot be externally
|
||||
* discharged.
|
||||
*
|
||||
* @param container
|
||||
* ItemStack to be discharged.
|
||||
* @param maxExtract
|
||||
* Maximum amount of energy to be extracted from the item.
|
||||
* @param simulate
|
||||
* If TRUE, the discharge will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) extracted from the item.
|
||||
*/
|
||||
int extractEnergy(ItemStack container, int maxExtract, boolean simulate);
|
||||
|
||||
/**
|
||||
* Get the amount of energy currently stored in the container item.
|
||||
*/
|
||||
int getEnergyStored(ItemStack container);
|
||||
|
||||
/**
|
||||
* Get the max amount of energy that can be stored in the container item.
|
||||
*/
|
||||
int getMaxEnergyStored(ItemStack container);
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package cofh.api.energy;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
/**
|
||||
* Implement this interface on Tile Entities which should handle energy, generally storing it in one or more internal {@link IEnergyStorage} objects.
|
||||
* <p>
|
||||
* A reference implementation is provided {@link TileEnergyHandler}.
|
||||
* <p>
|
||||
* Note that {@link IEnergyReceiver} and {@link IEnergyProvider} are extensions of this.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IEnergyHandler extends IEnergyConnection {
|
||||
|
||||
/**
|
||||
* Returns the amount of energy currently stored.
|
||||
*/
|
||||
int getEnergyStored(EnumFacing from);
|
||||
|
||||
/**
|
||||
* Returns the maximum amount of energy that can be stored.
|
||||
*/
|
||||
int getMaxEnergyStored(EnumFacing from);
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package cofh.api.energy;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
|
||||
/**
|
||||
* Implement this interface on Tile Entities which should provide energy, generally storing it in one or more internal {@link IEnergyStorage} objects.
|
||||
* <p>
|
||||
* A reference implementation is provided {@link TileEnergyHandler}.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IEnergyProvider extends IEnergyHandler {
|
||||
|
||||
/**
|
||||
* Remove energy from an IEnergyProvider, internal distribution is left entirely to the IEnergyProvider.
|
||||
*
|
||||
* @param from
|
||||
* Orientation the energy is extracted from.
|
||||
* @param maxExtract
|
||||
* Maximum amount of energy to extract.
|
||||
* @param simulate
|
||||
* If TRUE, the extraction will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) extracted.
|
||||
*/
|
||||
int extractEnergy(EnumFacing from, int maxExtract, boolean simulate);
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package cofh.api.energy;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
|
||||
/**
|
||||
* Implement this interface on Tile Entities which should receive energy, generally storing it in one or more internal {@link IEnergyStorage} objects.
|
||||
* <p>
|
||||
* A reference implementation is provided {@link TileEnergyHandler}.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IEnergyReceiver extends IEnergyHandler {
|
||||
|
||||
/**
|
||||
* Add energy to an IEnergyReceiver, internal distribution is left entirely to the IEnergyReceiver.
|
||||
*
|
||||
* @param from
|
||||
* Orientation the energy is received from.
|
||||
* @param maxReceive
|
||||
* Maximum amount of energy to receive.
|
||||
* @param simulate
|
||||
* If TRUE, the charge will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) received.
|
||||
*/
|
||||
int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate);
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package cofh.api.energy;
|
||||
|
||||
/**
|
||||
* An energy storage is the unit of interaction with Energy inventories.<br>
|
||||
* This is not to be implemented on TileEntities. This is for internal use only.
|
||||
* <p>
|
||||
* A reference implementation can be found at {@link EnergyStorage}.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IEnergyStorage {
|
||||
|
||||
/**
|
||||
* Adds energy to the storage. Returns quantity of energy that was accepted.
|
||||
*
|
||||
* @param maxReceive
|
||||
* Maximum amount of energy to be inserted.
|
||||
* @param simulate
|
||||
* If TRUE, the insertion will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) accepted by the storage.
|
||||
*/
|
||||
int receiveEnergy(int maxReceive, boolean simulate);
|
||||
|
||||
/**
|
||||
* Removes energy from the storage. Returns quantity of energy that was removed.
|
||||
*
|
||||
* @param maxExtract
|
||||
* Maximum amount of energy to be extracted.
|
||||
* @param simulate
|
||||
* If TRUE, the extraction will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) extracted from the storage.
|
||||
*/
|
||||
int extractEnergy(int maxExtract, boolean simulate);
|
||||
|
||||
/**
|
||||
* Returns the amount of energy currently stored.
|
||||
*/
|
||||
int getEnergyStored();
|
||||
|
||||
/**
|
||||
* Returns the maximum amount of energy that can be stored.
|
||||
*/
|
||||
int getMaxEnergyStored();
|
||||
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
package cofh.api.energy;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
/**
|
||||
* Reference implementation of {@link IEnergyContainerItem}. Use/extend this or implement your own.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public class ItemEnergyContainer extends Item implements IEnergyContainerItem {
|
||||
|
||||
protected int capacity;
|
||||
protected int maxReceive;
|
||||
protected int maxExtract;
|
||||
|
||||
public ItemEnergyContainer() {
|
||||
|
||||
}
|
||||
|
||||
public ItemEnergyContainer(int capacity) {
|
||||
|
||||
this(capacity, capacity, capacity);
|
||||
}
|
||||
|
||||
public ItemEnergyContainer(int capacity, int maxTransfer) {
|
||||
|
||||
this(capacity, maxTransfer, maxTransfer);
|
||||
}
|
||||
|
||||
public ItemEnergyContainer(int capacity, int maxReceive, int maxExtract) {
|
||||
|
||||
this.capacity = capacity;
|
||||
this.maxReceive = maxReceive;
|
||||
this.maxExtract = maxExtract;
|
||||
}
|
||||
|
||||
public ItemEnergyContainer setCapacity(int capacity) {
|
||||
|
||||
this.capacity = capacity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemEnergyContainer setMaxTransfer(int maxTransfer) {
|
||||
|
||||
setMaxReceive(maxTransfer);
|
||||
setMaxExtract(maxTransfer);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemEnergyContainer setMaxReceive(int maxReceive) {
|
||||
|
||||
this.maxReceive = maxReceive;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemEnergyContainer setMaxExtract(int maxExtract) {
|
||||
|
||||
this.maxExtract = maxExtract;
|
||||
return this;
|
||||
}
|
||||
|
||||
/* IEnergyContainerItem */
|
||||
@Override
|
||||
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
|
||||
|
||||
if (!container.hasTagCompound()) {
|
||||
container.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
int energy = container.getTagCompound().getInteger("Energy");
|
||||
int energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive));
|
||||
|
||||
if (!simulate) {
|
||||
energy += energyReceived;
|
||||
container.getTagCompound().setInteger("Energy", energy);
|
||||
}
|
||||
return energyReceived;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) {
|
||||
|
||||
if (container.getTagCompound() == null || !container.getTagCompound().hasKey("Energy")) {
|
||||
return 0;
|
||||
}
|
||||
int energy = container.getTagCompound().getInteger("Energy");
|
||||
int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));
|
||||
|
||||
if (!simulate) {
|
||||
energy -= energyExtracted;
|
||||
container.getTagCompound().setInteger("Energy", energy);
|
||||
}
|
||||
return energyExtracted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored(ItemStack container) {
|
||||
|
||||
if (container.getTagCompound() == null || !container.getTagCompound().hasKey("Energy")) {
|
||||
return 0;
|
||||
}
|
||||
return container.getTagCompound().getInteger("Energy");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ItemStack container) {
|
||||
|
||||
return capacity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package cofh.api.energy;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
/**
|
||||
* Reference implementation of {@link IEnergyReceiver} and {@link IEnergyProvider}. Use/extend this or implement your own.
|
||||
*
|
||||
* This class is really meant to summarize how each interface is properly used.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public class TileEnergyHandler extends TileEntity implements IEnergyReceiver, IEnergyProvider {
|
||||
|
||||
protected EnergyStorage storage = new EnergyStorage(32000);
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
|
||||
super.readFromNBT(nbt);
|
||||
storage.readFromNBT(nbt);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
nbt = super.writeToNBT(nbt);
|
||||
storage.writeToNBT(nbt);
|
||||
return nbt;
|
||||
}
|
||||
|
||||
/* IEnergyConnection */
|
||||
@Override
|
||||
public boolean canConnectEnergy(EnumFacing from) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* IEnergyReceiver */
|
||||
@Override
|
||||
public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate) {
|
||||
|
||||
return storage.receiveEnergy(maxReceive, simulate);
|
||||
}
|
||||
|
||||
/* IEnergyProvider */
|
||||
@Override
|
||||
public int extractEnergy(EnumFacing from, int maxExtract, boolean simulate) {
|
||||
|
||||
return storage.extractEnergy(maxExtract, simulate);
|
||||
}
|
||||
|
||||
/* IEnergyHandler */
|
||||
@Override
|
||||
public int getEnergyStored(EnumFacing from) {
|
||||
|
||||
return storage.getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(EnumFacing from) {
|
||||
|
||||
return storage.getMaxEnergyStored();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
/**
|
||||
* (C) 2014-2016 Team CoFH / CoFH / Cult of the Full Hub
|
||||
* http://www.teamcofh.com
|
||||
*/
|
||||
@API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHAPI", provides = "CoFHAPI|energy")
|
||||
package cofh.api.energy;
|
||||
|
||||
import net.minecraftforge.fml.common.API;
|
||||
import cofh.api.CoFHAPIProps;
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
/**
|
||||
* (C) 2014-2016 Team CoFH / CoFH / Cult of the Full Hub
|
||||
* http://www.teamcofh.com
|
||||
*/
|
||||
@API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHLib", provides = "CoFHAPI")
|
||||
package cofh.api;
|
||||
|
||||
import net.minecraftforge.fml.common.API;
|
||||
|
||||
Regular → Executable
+39
-11
@@ -10,11 +10,16 @@
|
||||
******************************************************************************/
|
||||
package forestry;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
|
||||
import forestry.plugins.compat.PluginIC2;
|
||||
import forestry.plugins.compat.PluginNatura;
|
||||
import net.minecraftforge.client.event.ModelRegistryEvent;
|
||||
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;
|
||||
@@ -23,11 +28,13 @@ 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.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.core.EventHandlerCore;
|
||||
import forestry.core.climate.ClimateEventHandler;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.GameMode;
|
||||
@@ -39,6 +46,7 @@ import forestry.core.network.PacketHandler;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.worldgen.WorldGenerator;
|
||||
import forestry.plugins.PluginManager;
|
||||
import forestry.plugins.compat.PluginIC2;
|
||||
|
||||
/**
|
||||
* Forestry Minecraft Mod
|
||||
@@ -47,17 +55,20 @@ import forestry.plugins.PluginManager;
|
||||
*/
|
||||
@Mod(
|
||||
modid = Constants.MOD_ID,
|
||||
name = "Forestry",
|
||||
name = Constants.MOD_NAME,
|
||||
version = Constants.VERSION,
|
||||
guiFactory = "forestry.core.config.ForestryGuiConfigFactory",
|
||||
acceptedMinecraftVersions = "[1.10]",
|
||||
dependencies = "required-after:Forge@[12.18.0.1989,);"
|
||||
+ "after:JEI@[3.7.0,);"
|
||||
+ "after:" + PluginIC2.modId + ";")
|
||||
acceptedMinecraftVersions = "[1.12, 1.12.1]",
|
||||
dependencies = "required-after:forge@[14.21.1.2395,);"
|
||||
+ "after:jei@[4.7.0,);"
|
||||
+ "after:" + PluginIC2.modId + ";"
|
||||
+ "after:" + PluginNatura.modId + ";")
|
||||
public class Forestry {
|
||||
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@Mod.Instance(Constants.MOD_ID)
|
||||
public static Forestry instance;
|
||||
@Nullable
|
||||
private File configFolder;
|
||||
|
||||
public Forestry() {
|
||||
@@ -66,9 +77,16 @@ public class Forestry {
|
||||
ForestryAPI.errorStateRegistry = new ErrorStateRegistry();
|
||||
EnumErrorCode.init();
|
||||
FluidRegistry.enableUniversalBucket();
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
public static PacketHandler packetHandler;
|
||||
@Nullable
|
||||
private static PacketHandler packetHandler;
|
||||
|
||||
public static PacketHandler getPacketHandler() {
|
||||
Preconditions.checkState(packetHandler != null);
|
||||
return packetHandler;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
@@ -78,16 +96,25 @@ public class Forestry {
|
||||
EventHandlerCore eventHandlerCore = new EventHandlerCore();
|
||||
MinecraftForge.EVENT_BUS.register(eventHandlerCore);
|
||||
MinecraftForge.EVENT_BUS.register(new MultiblockEventHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new ClimateEventHandler());
|
||||
Proxies.common.registerEventHandlers();
|
||||
|
||||
configFolder = new File(event.getModConfigurationDirectory(), Constants.MOD_ID);
|
||||
Config.load();
|
||||
Config.load(event.getSide());
|
||||
|
||||
PluginManager.runSetup(event);
|
||||
|
||||
ForestryAPI.activeMode = new GameMode(Config.gameMode);
|
||||
String gameMode = Config.gameMode;
|
||||
Preconditions.checkState(gameMode != null);
|
||||
ForestryAPI.activeMode = new GameMode(gameMode);
|
||||
|
||||
PluginManager.runPreInit();
|
||||
|
||||
PluginManager.runPreInit(event.getSide());
|
||||
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void registerModels(ModelRegistryEvent event) {
|
||||
PluginManager.runRegisterBackpacksAndCrates();
|
||||
Proxies.render.registerModels();
|
||||
}
|
||||
|
||||
@@ -121,6 +148,7 @@ public class Forestry {
|
||||
PluginManager.serverStarting(event.getServer());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public File getConfigFolder() {
|
||||
return configFolder;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.capabilities.CapabilityInject;
|
||||
|
||||
public class ApicultureCapabilities {
|
||||
/**
|
||||
* Capability for {@link IArmorApiarist}.
|
||||
* The {@link Capability#getDefaultInstance()} will always protect the wearer with no side effects.
|
||||
*/
|
||||
@CapabilityInject(IArmorApiarist.class)
|
||||
public static Capability<IArmorApiarist> ARMOR_APIARIST;
|
||||
}
|
||||
@@ -5,7 +5,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -13,7 +12,6 @@ import java.util.Map;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
*
|
||||
* Some miscellaneous lists and settings for bees.
|
||||
*
|
||||
* @author SirSengir
|
||||
@@ -32,7 +30,6 @@ public class BeeManager {
|
||||
/**
|
||||
* List of items that can induce swarming. Integer denotes x in 1000 chance.
|
||||
*/
|
||||
@Nonnull
|
||||
public static final Map<ItemStack, Integer> inducers = new HashMap<>();
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Easily extendable default IBeeModifier.
|
||||
* By itself, this IBeeModifier does nothing.
|
||||
@@ -23,7 +25,7 @@ public class DefaultBeeModifier implements IBeeModifier {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
public float getLifespanModifier(IBeeGenome genome, @Nullable IBeeGenome mate, float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,9 +75,9 @@ public enum EnumBeeChromosome implements IChromosomeType {
|
||||
* Determines the bee's effect.
|
||||
*/
|
||||
EFFECT(IAlleleBeeEffect.class);
|
||||
|
||||
|
||||
private final Class<? extends IAllele> alleleClass;
|
||||
|
||||
|
||||
EnumBeeChromosome(Class<? extends IAllele> alleleClass) {
|
||||
this.alleleClass = alleleClass;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public enum EnumBeeType implements ISpeciesType {
|
||||
|
||||
public static final EnumBeeType[] VALUES = values();
|
||||
|
||||
String name;
|
||||
private final String name;
|
||||
|
||||
EnumBeeType() {
|
||||
this.name = this.toString().toLowerCase(Locale.ENGLISH);
|
||||
|
||||
@@ -7,15 +7,17 @@ package forestry.api.apiculture;
|
||||
|
||||
import forestry.api.genetics.IAlleleEffect;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public interface IAlleleBeeEffect extends IAlleleEffect {
|
||||
|
||||
|
||||
/**
|
||||
* Called by apiaries to cause an effect in the world. (server)
|
||||
*
|
||||
* @param genome Genome of the bee queen causing this effect
|
||||
* @param genome Genome of the bee queen causing this effect
|
||||
* @param storedData Object containing the stored effect data for the apiary/hive the bee is in.
|
||||
* @param housing {@link IBeeHousing} the bee currently resides in.
|
||||
* @param housing {@link IBeeHousing} the bee currently resides in.
|
||||
* @return storedData, may have been manipulated.
|
||||
*/
|
||||
IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing);
|
||||
@@ -23,11 +25,12 @@ public interface IAlleleBeeEffect extends IAlleleEffect {
|
||||
/**
|
||||
* Is called to produce visual bee effects. (client)
|
||||
*
|
||||
* @param genome Genome of the bee queen causing this effect
|
||||
* @param genome Genome of the bee queen causing this effect
|
||||
* @param storedData Object containing the stored effect data for the apiary/hive the bee is in.
|
||||
* @param housing {@link IBeeHousing} the bee currently resides in.
|
||||
* @param housing {@link IBeeHousing} the bee currently resides in.
|
||||
* @return storedData, may have been manipulated.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
IEffectData doFX(IBeeGenome genome, IEffectData storedData, IBeeHousing housing);
|
||||
|
||||
|
||||
}
|
||||
@@ -7,14 +7,13 @@ package forestry.api.apiculture;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
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.IModelManager;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
|
||||
public interface IAlleleBeeSpecies extends IAlleleSpecies {
|
||||
|
||||
@@ -41,13 +40,14 @@ public interface IAlleleBeeSpecies extends IAlleleSpecies {
|
||||
|
||||
/**
|
||||
* Only jubilant bees produce specialities.
|
||||
*
|
||||
* @return true if the bee is jubilant, false otherwise.
|
||||
*/
|
||||
boolean isJubilant(IBeeGenome genome, IBeeHousing housing);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
ModelResourceLocation getModel(EnumBeeType type);
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerModels(Item item, IModelManager manager);
|
||||
}
|
||||
@@ -5,9 +5,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.genetics.IAlleleSpeciesBuilder;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IAlleleBeeSpeciesBuilder extends IAlleleSpeciesBuilder {
|
||||
|
||||
@@ -38,9 +37,13 @@ public interface IAlleleBeeSpeciesBuilder extends IAlleleSpeciesBuilder {
|
||||
*/
|
||||
IAlleleBeeSpeciesBuilder setNocturnal();
|
||||
|
||||
/** Use this if you have custom icons for bees. */
|
||||
/**
|
||||
* Use this if you have custom icons for bees.
|
||||
*/
|
||||
IAlleleBeeSpeciesBuilder setCustomBeeModelProvider(IBeeModelProvider beeIconProvider);
|
||||
|
||||
/** Use this if you have custom icon colours for bees (other than the default static primary + secondary colours). */
|
||||
/**
|
||||
* Use this if you have custom icon colours for bees (other than the default static primary + secondary colours).
|
||||
*/
|
||||
IAlleleBeeSpeciesBuilder setCustomBeeSpriteColourProvider(IBeeSpriteColourProvider beeIconColourProvider);
|
||||
}
|
||||
@@ -18,8 +18,7 @@ public interface IApiaristTracker extends IBreedingTracker {
|
||||
/**
|
||||
* Register the birth of a queen. Will mark species as discovered.
|
||||
*
|
||||
* @param queen
|
||||
* Created queen.
|
||||
* @param queen Created queen.
|
||||
*/
|
||||
void registerQueen(IIndividual queen);
|
||||
|
||||
@@ -31,8 +30,7 @@ public interface IApiaristTracker extends IBreedingTracker {
|
||||
/**
|
||||
* Register the birth of a princess. Will mark species as discovered.
|
||||
*
|
||||
* @param princess
|
||||
* Created princess.
|
||||
* @param princess Created princess.
|
||||
*/
|
||||
void registerPrincess(IIndividual princess);
|
||||
|
||||
@@ -44,8 +42,7 @@ public interface IApiaristTracker extends IBreedingTracker {
|
||||
/**
|
||||
* Register the birth of a drone. Will mark species as discovered.
|
||||
*
|
||||
* @param drone
|
||||
* Created drone.
|
||||
* @param drone Created drone.
|
||||
*/
|
||||
void registerDrone(IIndividual drone);
|
||||
|
||||
|
||||
@@ -5,21 +5,25 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* When implemented by armor piece items, allows them to act as apiarist's armor.
|
||||
* When implemented as a capability by armor items, protects the wearer from negative bee effects.
|
||||
*
|
||||
* @see ApicultureCapabilities#ARMOR_APIARIST
|
||||
*/
|
||||
public interface IArmorApiarist {
|
||||
/**
|
||||
* Called when the apiarist's armor acts as protection against an attack.
|
||||
*
|
||||
* @param entity Entity being attacked
|
||||
* @param armor Armor item
|
||||
* @param cause Optional cause of attack, such as a bee effect identifier
|
||||
* @param entity Entity being attacked
|
||||
* @param armor Armor item
|
||||
* @param cause Optional cause of attack, such as a bee effect identifier
|
||||
* @param doProtect Whether or not to actually do the side effects of protection
|
||||
* @return Whether or not the armor should protect the player from that attack
|
||||
*/
|
||||
boolean protectEntity(EntityLivingBase entity, ItemStack armor, String cause, boolean doProtect);
|
||||
boolean protectEntity(EntityLivingBase entity, ItemStack armor, @Nullable String cause, boolean doProtect);
|
||||
}
|
||||
@@ -17,9 +17,10 @@ public interface IArmorApiaristHelper {
|
||||
|
||||
/**
|
||||
* Called when the apiarist's armor acts as protection against an attack.
|
||||
* @param stack ItemStack to check
|
||||
* @param entity Entity being attacked
|
||||
* @param cause Optional cause of attack, such as a bee effect identifier
|
||||
*
|
||||
* @param stack ItemStack to check
|
||||
* @param entity Entity being attacked
|
||||
* @param cause Optional cause of attack, such as a bee effect identifier
|
||||
* @param doProtect Whether or not to actually do the side effects of protection
|
||||
* @return Whether or not the item is valid Apiarist Armor and should protect the player from that attack
|
||||
* @since Forestry 4.2
|
||||
@@ -28,11 +29,12 @@ public interface IArmorApiaristHelper {
|
||||
|
||||
/**
|
||||
* Called when the apiarist's armor acts as protection against an attack.
|
||||
* @param entity Entity being attacked
|
||||
* @param cause Optional cause of attack, such as a bee effect identifier
|
||||
*
|
||||
* @param entity Entity being attacked
|
||||
* @param cause Optional cause of attack, such as a bee effect identifier
|
||||
* @param doProtect Whether or not to actually do the side effects of protection
|
||||
* @return The number of valid Apiarist Armor pieces the player is wearing that are actually protecting.
|
||||
* 4 means full protection, but it can go higher if they are holding items like the smoker.
|
||||
* 4 means full protection, but it can go higher if they are holding items like the smoker.
|
||||
* @since Forestry 4.2
|
||||
*/
|
||||
int wearsItems(EntityLivingBase entity, String cause, boolean doProtect);
|
||||
|
||||
@@ -5,18 +5,19 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
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.
|
||||
@@ -28,7 +29,6 @@ public interface IBee extends IIndividualLiving {
|
||||
/**
|
||||
* @return Bee's genetic information.
|
||||
*/
|
||||
@Nonnull
|
||||
@Override
|
||||
IBeeGenome getGenome();
|
||||
|
||||
@@ -51,12 +51,12 @@ public interface IBee extends IIndividualLiving {
|
||||
|
||||
/**
|
||||
* Set the natural flag on this bee.
|
||||
* @param flag
|
||||
*/
|
||||
void setIsNatural(boolean flag);
|
||||
|
||||
IEffectData[] doEffect(IEffectData[] storedData, IBeeHousing housing);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
IEffectData[] doFX(IEffectData[] storedData, IBeeHousing housing);
|
||||
|
||||
/**
|
||||
@@ -66,6 +66,7 @@ public interface IBee extends IIndividualLiving {
|
||||
|
||||
/**
|
||||
* Determines whether the queen can work.
|
||||
*
|
||||
* @param housing the {@link IBeeHousing} the bee currently resides in.
|
||||
* @return an empty set if the queen can work, a set of error states if the queen can not work
|
||||
*/
|
||||
@@ -73,20 +74,22 @@ public interface IBee extends IIndividualLiving {
|
||||
|
||||
List<Biome> getSuitableBiomes();
|
||||
|
||||
ItemStack[] getProduceList();
|
||||
NonNullList<ItemStack> getProduceList();
|
||||
|
||||
ItemStack[] getSpecialtyList();
|
||||
NonNullList<ItemStack> getSpecialtyList();
|
||||
|
||||
ItemStack[] produceStacks(IBeeHousing housing);
|
||||
NonNullList<ItemStack> produceStacks(IBeeHousing housing);
|
||||
|
||||
@Nullable
|
||||
IBee spawnPrincess(IBeeHousing housing);
|
||||
|
||||
IBee[] spawnDrones(IBeeHousing housing);
|
||||
List<IBee> spawnDrones(IBeeHousing housing);
|
||||
|
||||
void plantFlowerRandom(IBeeHousing housing);
|
||||
|
||||
ITree retrievePollen(IBeeHousing housing);
|
||||
@Nullable
|
||||
IIndividual retrievePollen(IBeeHousing housing);
|
||||
|
||||
boolean pollinateRandom(IBeeHousing housing, ITree pollen);
|
||||
boolean pollinateRandom(IBeeHousing housing, IIndividual pollen);
|
||||
|
||||
}
|
||||
@@ -14,15 +14,15 @@ public interface IBeeFactory {
|
||||
* Automatically registered with AlleleManager.alleleRegistry.registerAllele()
|
||||
* See IAlleleBeeSpeciesBuilder and IAlleleSpeciesBuilder for adding additional properties to the returned 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.
|
||||
* @param unlocalizedName Unlocalized name for this 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.
|
||||
* @param unlocalizedName Unlocalized name for this species
|
||||
* @param unlocalizedDescription Unlocalized description for this species
|
||||
* @param branch Classification of this species
|
||||
* @param binomial Binomial name of the species sans genus ("Apis"). "humboldti" will have the bee species flavour name be "Apis humboldti". Feel free to use fun names or null.
|
||||
* @param primaryColor The outline color of this species
|
||||
* @param secondaryColor The body color of this species
|
||||
* @param branch Classification of this species
|
||||
* @param binomial Binomial name of the species sans genus ("Apis"). "humboldti" will have the bee species flavour name be "Apis humboldti". Feel free to use fun names or null.
|
||||
* @param primaryColor The outline color of this species
|
||||
* @param secondaryColor The body color of this species
|
||||
* @return a new bee species allele.
|
||||
*/
|
||||
IAlleleBeeSpeciesBuilder createSpecies(String uid, boolean dominant, String authority, String unlocalizedName, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor);
|
||||
@@ -31,7 +31,7 @@ public interface IBeeFactory {
|
||||
* Creates a new bee branch.
|
||||
* Must be registered with AlleleManager.alleleRegistry.getClassification("family.apidae").addMemberGroup();
|
||||
*
|
||||
* @param uid Unique Identifier for this branch
|
||||
* @param uid Unique Identifier for this branch
|
||||
* @param scientific approximates a "genus" in real life. Real life examples: "Micrapis", "Megapis"
|
||||
* @return a new bee branch
|
||||
*/
|
||||
|
||||
@@ -5,23 +5,21 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
|
||||
import forestry.api.genetics.EnumTolerance;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
import forestry.api.genetics.IGenome;
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
|
||||
/**
|
||||
* Only the default implementation is supported.
|
||||
*
|
||||
* @author SirSengir
|
||||
*
|
||||
*/
|
||||
public interface IBeeGenome extends IGenome {
|
||||
|
||||
@Override
|
||||
IAlleleBeeSpecies getPrimary();
|
||||
|
||||
|
||||
@Override
|
||||
IAlleleBeeSpecies getSecondary();
|
||||
|
||||
|
||||
@@ -5,58 +5,49 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.climate.IClimateProvider;
|
||||
import forestry.api.core.IErrorLogicSource;
|
||||
import forestry.api.core.ILocatable;
|
||||
import forestry.api.genetics.IHousing;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
public interface IBeeHousing extends IHousing, IErrorLogicSource {
|
||||
public interface IBeeHousing extends IHousing, IErrorLogicSource, IClimateProvider, ILocatable {
|
||||
|
||||
/**
|
||||
* Used by BeeManager.beeRoot.createBeeHousingModifier(IBeeHousing housing)
|
||||
* Used by {@link IBeeRoot#createBeeHousingModifier(IBeeHousing)}
|
||||
* to combine bee modifiers from several sources that can change over time.
|
||||
*
|
||||
* @return IBeeModifiers from the housing, frames, etc.
|
||||
*/
|
||||
Iterable<IBeeModifier> getBeeModifiers();
|
||||
|
||||
/**
|
||||
* Used by BeeManager.beeRoot.createBeeHousingListener(IBeeHousing housing)
|
||||
* Used by {@link IBeeRoot#createBeeHousingListener(IBeeHousing)}
|
||||
* to combine bee listeners from several sources that can change over time.
|
||||
*
|
||||
* @return IBeeListeners from the housing, multiblock parts, etc.
|
||||
*/
|
||||
Iterable<IBeeListener> getBeeListeners();
|
||||
|
||||
@Nonnull
|
||||
IBeeHousingInventory getBeeInventory();
|
||||
|
||||
IBeekeepingLogic getBeekeepingLogic();
|
||||
|
||||
EnumTemperature getTemperature();
|
||||
|
||||
EnumHumidity getHumidity();
|
||||
|
||||
int getBlockLightValue();
|
||||
|
||||
boolean canBlockSeeTheSky();
|
||||
|
||||
/** Must not be named "getWorld" to avoid SpecialSource issue https://github.com/md-5/SpecialSource/issues/12 */
|
||||
World getWorldObj();
|
||||
|
||||
Biome getBiome();
|
||||
boolean isRaining();
|
||||
|
||||
@Nullable
|
||||
GameProfile getOwner();
|
||||
|
||||
/**
|
||||
* @return exact coordinates where bee particle FX should spawn from
|
||||
* @since Forestry 4.2
|
||||
* @return exact coordinates where bee FX should spawn from
|
||||
*/
|
||||
Vec3d getBeeFXCoordinates();
|
||||
}
|
||||
@@ -21,7 +21,7 @@ public interface IBeeHousingInventory {
|
||||
* Adds products to the housing's inventory.
|
||||
*
|
||||
* @param product ItemStack with the product to add.
|
||||
* @param all if true, success requires that all products are added
|
||||
* @param all if true, success requires that all products are added
|
||||
* @return boolean indicating success or failure.
|
||||
*/
|
||||
boolean addProduct(ItemStack product, boolean all);
|
||||
|
||||
@@ -11,6 +11,7 @@ public interface IBeeListener {
|
||||
|
||||
/**
|
||||
* Called when the bees wear out the housing's equipment.
|
||||
*
|
||||
* @param amount Integer indicating the amount worn out.
|
||||
*/
|
||||
void wearOutEquipment(int amount);
|
||||
@@ -22,6 +23,7 @@ public interface IBeeListener {
|
||||
|
||||
/**
|
||||
* Called when the bees have retrieved some pollen.
|
||||
*
|
||||
* @return true if this bee listener handled the pollen.
|
||||
*/
|
||||
boolean onPollenRetrieved(IIndividual pollen);
|
||||
|
||||
@@ -5,14 +5,12 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import forestry.api.core.IModelManager;
|
||||
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;
|
||||
|
||||
import forestry.api.core.IModelManager;
|
||||
|
||||
public interface IBeeModelProvider {
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerModels(Item item, IModelManager manager);
|
||||
|
||||
@@ -5,31 +5,33 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public interface IBeeModifier {
|
||||
/**
|
||||
* @param genome Genome of the bee this modifier is called for.
|
||||
* @param genome Genome of the bee this modifier is called for.
|
||||
* @param currentModifier Current modifier.
|
||||
* @return Float used to modify the base territory.
|
||||
*/
|
||||
float getTerritoryModifier(IBeeGenome genome, float currentModifier);
|
||||
|
||||
/**
|
||||
* @param genome Genome of the bee this modifier is called for.
|
||||
* @param mate Genome of the bee mate this modifier is called for.
|
||||
* @param genome Genome of the bee this modifier is called for.
|
||||
* @param mate Genome of the bee mate this modifier is called for.
|
||||
* @param currentModifier Current modifier.
|
||||
* @return Float used to modify the base mutation chance.
|
||||
*/
|
||||
float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier);
|
||||
|
||||
/**
|
||||
* @param genome Genome of the bee this modifier is called for.
|
||||
* @param genome Genome of the bee this modifier is called for.
|
||||
* @param currentModifier Current modifier.
|
||||
* @return Float used to modify the life span of queens.
|
||||
*/
|
||||
float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier);
|
||||
float getLifespanModifier(IBeeGenome genome, @Nullable IBeeGenome mate, float currentModifier);
|
||||
|
||||
/**
|
||||
* @param genome Genome of the bee this modifier is called for.
|
||||
* @param genome Genome of the bee this modifier is called for.
|
||||
* @param currentModifier Current modifier.
|
||||
* @return Float modifying the production speed of queens.
|
||||
*/
|
||||
|
||||
@@ -8,10 +8,10 @@ package forestry.api.apiculture;
|
||||
import forestry.api.genetics.IMutation;
|
||||
|
||||
public interface IBeeMutation extends IMutation {
|
||||
|
||||
|
||||
@Override
|
||||
IBeeRoot getRoot();
|
||||
|
||||
|
||||
/**
|
||||
* @return float representing the chance for mutation to occur. note that this is 0 - 100 based, since it was an integer previously!
|
||||
*/
|
||||
|
||||
@@ -15,8 +15,8 @@ public interface IBeeMutationFactory {
|
||||
*
|
||||
* @param parentBee0 A parent bee for this mutation
|
||||
* @param parentBee1 A parent bee for this mutation
|
||||
* @param result The resulting alleles for this mutation
|
||||
* @param chance The chance that breeding the two parent bees will result in this mutation
|
||||
* @param result The resulting alleles for this mutation
|
||||
* @param chance The chance that breeding the two parent bees will result in this mutation
|
||||
* @return a new bee mutation.
|
||||
*/
|
||||
IBeeMutationBuilder createMutation(IAlleleBeeSpecies parentBee0, IAlleleBeeSpecies parentBee1, IAllele[] result, int chance);
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
@@ -19,15 +18,16 @@ import net.minecraft.world.World;
|
||||
public interface IBeeRoot extends ISpeciesRoot {
|
||||
|
||||
/**
|
||||
* @return true if passed item is a Forestry bee. Equal to getType(ItemStack stack) != EnumBeeType.NONE
|
||||
* @return true if passed item is a Forestry bee. Equal to getType(ItemStack stack) != null
|
||||
*/
|
||||
@Override
|
||||
boolean isMember(ItemStack stack);
|
||||
|
||||
/**
|
||||
* @return {@link IBee} pattern parsed from the passed stack's nbt data.
|
||||
* @return {@link IBee} pattern parsed from the passed stack's nbt data. Null if the ItemStack is not a valid member.
|
||||
*/
|
||||
@Override
|
||||
@Nullable
|
||||
IBee getMember(ItemStack stack);
|
||||
|
||||
@Override
|
||||
@@ -49,16 +49,15 @@ public interface IBeeRoot extends ISpeciesRoot {
|
||||
/* BREEDING TRACKER */
|
||||
|
||||
/**
|
||||
* @param world
|
||||
* @return {@link IApiaristTracker} associated with the passed world.
|
||||
*/
|
||||
@Override
|
||||
IApiaristTracker getBreedingTracker(World world, GameProfile player);
|
||||
IApiaristTracker getBreedingTracker(World world, @Nullable GameProfile player);
|
||||
|
||||
/* BEE SPECIFIC */
|
||||
|
||||
/**
|
||||
* @return type of bee encoded on the itemstack. EnumBeeType.NONE if it isn't a bee.
|
||||
* @return type of bee encoded on the itemstack. null if it isn't a bee.
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
@@ -75,8 +74,7 @@ public interface IBeeRoot extends ISpeciesRoot {
|
||||
boolean isMated(ItemStack stack);
|
||||
|
||||
/**
|
||||
* @param genome
|
||||
* Valid {@link IBeeGenome}
|
||||
* @param genome Valid {@link IBeeGenome}
|
||||
* @return {@link IBee} from the passed genome
|
||||
*/
|
||||
IBee getBee(IBeeGenome genome);
|
||||
@@ -84,17 +82,16 @@ public interface IBeeRoot extends ISpeciesRoot {
|
||||
/**
|
||||
* Creates an IBee suitable for a queen containing the necessary second genome for the mate.
|
||||
*
|
||||
* @param genome
|
||||
* Valid {@link IBeeGenome}
|
||||
* @param mate
|
||||
* Valid {@link IBee} representing the mate.
|
||||
* @param genome Valid {@link IBeeGenome}
|
||||
* @param mate Valid {@link IBee} representing the mate.
|
||||
* @return Mated {@link IBee} from the passed genomes.
|
||||
*/
|
||||
IBee getBee(World world, IBeeGenome genome, IBee mate);
|
||||
|
||||
/* TEMPLATES */
|
||||
|
||||
@Override
|
||||
ArrayList<IBee> getIndividualTemplates();
|
||||
List<IBee> getIndividualTemplates();
|
||||
|
||||
/* MUTATIONS */
|
||||
@Override
|
||||
@@ -103,15 +100,16 @@ public interface IBeeRoot extends ISpeciesRoot {
|
||||
/* GAME MODE */
|
||||
void resetBeekeepingMode();
|
||||
|
||||
ArrayList<IBeekeepingMode> getBeekeepingModes();
|
||||
List<IBeekeepingMode> getBeekeepingModes();
|
||||
|
||||
IBeekeepingMode getBeekeepingMode(World world);
|
||||
|
||||
@Nullable
|
||||
IBeekeepingMode getBeekeepingMode(String name);
|
||||
|
||||
void registerBeekeepingMode(IBeekeepingMode mode);
|
||||
|
||||
void setBeekeepingMode(World world, String name);
|
||||
void setBeekeepingMode(World world, IBeekeepingMode mode);
|
||||
|
||||
/* MISC */
|
||||
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
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 forestry.api.core.INbtReadable;
|
||||
import forestry.api.core.INbtWritable;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Stores beekeeping logic for bee housings.
|
||||
@@ -27,6 +27,7 @@ public interface IBeekeepingLogic extends INbtWritable, INbtReadable {
|
||||
|
||||
/**
|
||||
* Checks that the bees can work, setting error conditions on the housing where needed
|
||||
*
|
||||
* @return true if no errors are present and doWork should be called
|
||||
*/
|
||||
boolean canWork();
|
||||
@@ -63,18 +64,19 @@ public interface IBeekeepingLogic extends INbtWritable, INbtReadable {
|
||||
* Whether bee fx should be active.
|
||||
* Internally, this is automatically synced to the client.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
boolean canDoBeeFX();
|
||||
|
||||
/**
|
||||
* Display bee fx. Calls IBee.doFX(IEffectData[] storedData, IBeeHousing housing) on the queen.
|
||||
* Internally, the queen is automatically synced to the client for the fx.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
void doBeeFX();
|
||||
|
||||
/**
|
||||
* Used by bee fx to direct bees to nearby flowers.
|
||||
* These positions are synced to the client from the server.
|
||||
*/
|
||||
@Nonnull
|
||||
List<BlockPos> getFlowerPositions();
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
@@ -20,7 +20,7 @@ public interface IBeekeepingMode {
|
||||
/**
|
||||
* @return Localized list of strings outlining the behaviour of this beekeeping mode.
|
||||
*/
|
||||
ArrayList<String> getDescription();
|
||||
List<String> getDescription();
|
||||
|
||||
/**
|
||||
* @return Float used to modify the wear on comb frames.
|
||||
@@ -28,41 +28,31 @@ public interface IBeekeepingMode {
|
||||
float getWearModifier();
|
||||
|
||||
/**
|
||||
* @param queen
|
||||
* @return fertility taking into account the birthing queen and surroundings.
|
||||
*/
|
||||
int getFinalFertility(IBee queen, World world, BlockPos pos);
|
||||
|
||||
/**
|
||||
* @param queen
|
||||
* @return true if the queen is genetically "fatigued" and should not be reproduced anymore.
|
||||
*/
|
||||
boolean isFatigued(IBee queen, IBeeHousing housing);
|
||||
|
||||
/**
|
||||
* @param queen
|
||||
* @param housing
|
||||
* @return true if the queen is being overworked in the bee housing (with chance). will trigger a negative effect.
|
||||
*/
|
||||
boolean isOverworked(IBee queen, IBeeHousing housing);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param queen
|
||||
* @param offspring
|
||||
* @param housing
|
||||
* @return true if the genetic structure of the queen is breaking down during spawning of the offspring (with chance). will trigger a negative effect.
|
||||
*/
|
||||
boolean isDegenerating(IBee queen, IBee offspring, IBeeHousing housing);
|
||||
|
||||
/**
|
||||
* @param queen
|
||||
* @return true if an offspring of this queen is considered a natural
|
||||
*/
|
||||
boolean isNaturalOffspring(IBee queen);
|
||||
|
||||
/**
|
||||
* @param queen
|
||||
* @return true if this mode allows the passed queen or princess to be multiplied
|
||||
*/
|
||||
boolean mayMultiplyPrincess(IBee queen);
|
||||
|
||||
@@ -5,15 +5,14 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
/**
|
||||
* Bees can be seeded either as hive drops or as mutation results.
|
||||
*
|
||||
* <p>
|
||||
* Add IHiveDrops with HiveManager.get___Hive.addDrop
|
||||
*
|
||||
* @author SirSengir
|
||||
@@ -22,13 +21,13 @@ public interface IHiveDrop {
|
||||
|
||||
IBee getBeeType(IBlockAccess world, BlockPos pos);
|
||||
|
||||
Collection<ItemStack> getExtraItems(IBlockAccess world, BlockPos pos, int fortune);
|
||||
NonNullList<ItemStack> getExtraItems(IBlockAccess world, BlockPos pos, int fortune);
|
||||
|
||||
/**
|
||||
* Chance to drop a bee or extra items. Default drops have 0.80 (= 80 %).
|
||||
*
|
||||
* @param world Minecraft world this is called for.
|
||||
* @param pos Coordinates of the broken hive.
|
||||
* @param pos Coordinates of the broken hive.
|
||||
* @return Chance for drop as a float of 0.0 - 1.0.
|
||||
*/
|
||||
double getChance(IBlockAccess world, BlockPos pos, int fortune);
|
||||
@@ -37,7 +36,7 @@ public interface IHiveDrop {
|
||||
* Chance for the princess to be ignoble. Default is around 0.4 to 0.7 (40% - 70%).
|
||||
*
|
||||
* @param world Minecraft world this is called for.
|
||||
* @param pos Coordinates of the broken hive.
|
||||
* @param pos Coordinates of the broken hive.
|
||||
* @return Chance for ignoble as a float of 0.0 - 1.0.
|
||||
*/
|
||||
double getIgnobleChance(IBlockAccess world, BlockPos pos, int fortune);
|
||||
|
||||
@@ -13,12 +13,25 @@ public interface IHiveFrame {
|
||||
* Wears out a frame.
|
||||
*
|
||||
* @param housing IBeeHousing the frame is contained in.
|
||||
* @param frame ItemStack containing the actual frame.
|
||||
* @param queen Current queen in the caller.
|
||||
* @param wear Integer denoting the amount worn out. The wear modifier of the current beekeeping mode has already been taken into account.
|
||||
* @return ItemStack containing the actual frame with adjusted damage, or null if it has been broken.
|
||||
* @param frame ItemStack containing the actual frame.
|
||||
* @param queen Current queen in the caller.
|
||||
* @param wear Integer denoting the amount worn out. The wear modifier of the current beekeeping mode has already been taken into account.
|
||||
* @return ItemStack containing the actual frame with adjusted damage, or Empty ItemStack if it has been broken.
|
||||
*/
|
||||
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();
|
||||
}
|
||||
@@ -8,9 +8,13 @@ package forestry.api.apiculture;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
||||
public interface IJubilanceFactory {
|
||||
/** The default Jubilance Provider is satisfied when the humidity and temperature are ideal for the bee. */
|
||||
/**
|
||||
* The default Jubilance Provider is satisfied when the humidity and temperature are ideal for the bee.
|
||||
*/
|
||||
IJubilanceProvider getDefault();
|
||||
|
||||
/** The Requires Resource Jubilance Provider is satisfied when a specific block is under the hive. */
|
||||
/**
|
||||
* The Requires Resource Jubilance Provider is satisfied when a specific block is under the hive.
|
||||
*/
|
||||
IJubilanceProvider getRequiresResource(IBlockState... acceptedBlockStates);
|
||||
}
|
||||
@@ -7,14 +7,13 @@ package forestry.api.apiculture.hives;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
|
||||
public interface IHiveDescription {
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,13 +5,11 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture.hives;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
import forestry.api.apiculture.IHiveDrop;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
public interface IHiveRegistry {
|
||||
|
||||
@@ -25,25 +23,23 @@ public interface IHiveRegistry {
|
||||
SNOW("forestry:snow", "forestry.speciesWintry"),
|
||||
SWAMP("forestry:swamp", "forestry.speciesMarshy"),
|
||||
SWARM("forestry:swarm", "forestry.speciesForest");
|
||||
|
||||
|
||||
public static final HiveType[] VALUES = values();
|
||||
|
||||
@Nonnull
|
||||
private final String hiveUid;
|
||||
@Nonnull
|
||||
private final String speciesUid;
|
||||
|
||||
HiveType(@Nonnull String hiveUid, @Nonnull String speciesUid) {
|
||||
HiveType(String hiveUid, String speciesUid) {
|
||||
this.hiveUid = hiveUid;
|
||||
this.speciesUid = speciesUid;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
public String getHiveUid() {
|
||||
return hiveUid;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
public String getSpeciesUid() {
|
||||
return speciesUid;
|
||||
}
|
||||
@@ -56,7 +52,6 @@ public interface IHiveRegistry {
|
||||
public int getMeta() {
|
||||
return ordinal();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,12 @@
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
@API(apiVersion = "4.1.0", owner = "ForestryAPI|apiculture", provides = "ForestryAPI|hives")
|
||||
package forestry.api.apiculture.hives;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
@@ -3,7 +3,12 @@
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
@API(apiVersion = "4.8.0", owner = "ForestryAPI|core", provides = "ForestryAPI|apiculture")
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
@API(apiVersion = "5.0.0", owner = "ForestryAPI|core", provides = "ForestryAPI|apiculture")
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
@@ -0,0 +1,14 @@
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import forestry.api.core.IArmorNaturalist;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.capabilities.CapabilityInject;
|
||||
|
||||
public class ArboricultureCapabilities {
|
||||
/**
|
||||
* Capability for {@link IArmorNaturalist}.
|
||||
* The {@link Capability#getDefaultInstance()} will always show pollination with no side effects.
|
||||
*/
|
||||
@CapabilityInject(IArmorNaturalist.class)
|
||||
public static Capability<IArmorNaturalist> ARMOR_NATURALIST;
|
||||
}
|
||||
@@ -5,58 +5,55 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
public enum EnumForestryWoodType implements IWoodType {
|
||||
LARCH(4, 20),
|
||||
TEAK(4, 20),
|
||||
ACACIA(4, 20),
|
||||
LIME(4, 19),
|
||||
CHESTNUT(4, 21),
|
||||
WENGE(4, 20),
|
||||
BAOBAB(4, 20),
|
||||
SEQUOIA(3, 18, 4.0f),
|
||||
LARCH(4),
|
||||
TEAK(4),
|
||||
ACACIA(4),
|
||||
LIME(4),
|
||||
CHESTNUT(4),
|
||||
WENGE(4),
|
||||
BAOBAB(4),
|
||||
SEQUOIA(3, 4.0f),
|
||||
|
||||
KAPOK(4, 20),
|
||||
EBONY(4, 20),
|
||||
MAHOGANY(4, 20),
|
||||
BALSA(4, 20, 1.0f),
|
||||
WILLOW(4, 20),
|
||||
WALNUT(4, 21),
|
||||
GREENHEART(4, 20, 7.5f),
|
||||
CHERRY(4, 20),
|
||||
KAPOK(4),
|
||||
EBONY(4),
|
||||
MAHOGANY(4),
|
||||
BALSA(4, 1.0f),
|
||||
WILLOW(4),
|
||||
WALNUT(4),
|
||||
GREENHEART(4, 7.5f),
|
||||
CHERRY(4),
|
||||
|
||||
MAHOE(4, 20),
|
||||
POPLAR(4, 20),
|
||||
PALM(4, 20),
|
||||
PAPAYA(4, 20),
|
||||
PINE(4, 20, 3.0f),
|
||||
PLUM(4, 20),
|
||||
MAPLE(4, 20),
|
||||
CITRUS(4, 20),
|
||||
MAHOE(4),
|
||||
POPLAR(4),
|
||||
PALM(4),
|
||||
PAPAYA(4),
|
||||
PINE(4, 3.0f),
|
||||
PLUM(4),
|
||||
MAPLE(4),
|
||||
CITRUS(4),
|
||||
|
||||
GIGANTEUM(3, 18, 4.0f),
|
||||
IPE(4, 20),
|
||||
PADAUK(4, 20),
|
||||
COCOBOLO(4, 20),
|
||||
ZEBRAWOOD(4, 20);
|
||||
GIGANTEUM(3, 4.0f),
|
||||
IPE(4),
|
||||
PADAUK(4),
|
||||
COCOBOLO(4),
|
||||
ZEBRAWOOD(4);
|
||||
|
||||
public static final float DEFAULT_HARDNESS = 2.0f;
|
||||
public static final EnumForestryWoodType[] VALUES = values();
|
||||
|
||||
private final int carbonization;
|
||||
private final int combustability;
|
||||
private final float hardness;
|
||||
|
||||
EnumForestryWoodType(int carbonization, int combustability) {
|
||||
this(carbonization, combustability, DEFAULT_HARDNESS);
|
||||
EnumForestryWoodType(int carbonization) {
|
||||
this(carbonization, DEFAULT_HARDNESS);
|
||||
}
|
||||
|
||||
EnumForestryWoodType(int carbonization, int combustability, float hardness) {
|
||||
EnumForestryWoodType(int carbonization, float hardness) {
|
||||
this.carbonization = carbonization;
|
||||
this.combustability = combustability;
|
||||
this.hardness = hardness;
|
||||
}
|
||||
|
||||
@@ -64,7 +61,7 @@ public enum EnumForestryWoodType implements IWoodType {
|
||||
public float getHardness() {
|
||||
return hardness;
|
||||
}
|
||||
|
||||
|
||||
public static EnumForestryWoodType getRandom(Random random) {
|
||||
return VALUES[random.nextInt(VALUES.length)];
|
||||
}
|
||||
@@ -73,7 +70,7 @@ public enum EnumForestryWoodType implements IWoodType {
|
||||
public String toString() {
|
||||
return super.toString().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return toString();
|
||||
@@ -84,7 +81,6 @@ public enum EnumForestryWoodType implements IWoodType {
|
||||
return ordinal();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public static EnumForestryWoodType byMetadata(int meta) {
|
||||
if (meta < 0 || meta >= VALUES.length) {
|
||||
meta = 0;
|
||||
@@ -92,11 +88,45 @@ public enum EnumForestryWoodType implements IWoodType {
|
||||
return VALUES[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCarbonization() {
|
||||
return carbonization;
|
||||
}
|
||||
|
||||
public int getCombustability() {
|
||||
return combustability;
|
||||
@Override
|
||||
public float getCharcoalChance(int numberOfCharcoal) {
|
||||
if (numberOfCharcoal == 3) {
|
||||
return 0.75F;
|
||||
} else if (numberOfCharcoal == 4) {
|
||||
return 0.5F;
|
||||
} else if (numberOfCharcoal == 5) {
|
||||
return 0.25F;
|
||||
}
|
||||
return 0.15F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlankTexture() {
|
||||
return "forestry:blocks/wood/planks." + getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDoorLowerTexture() {
|
||||
return "forestry:blocks/doors/" + getName() + "_lower";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDoorUpperTexture() {
|
||||
return "forestry:blocks/doors/" + getName() + "_upper";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBarkTexture() {
|
||||
return "forestry:blocks/wood/bark." + getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHeartTexture() {
|
||||
return "forestry:blocks/wood/heart." + getName();
|
||||
}
|
||||
}
|
||||
@@ -5,16 +5,16 @@
|
||||
******************************************************************************/
|
||||
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"),
|
||||
POMES("pomes", "Pomum"),
|
||||
JUNGLE("jungle", "Tropicus"),
|
||||
NUX("nuts", "Nux");
|
||||
NUX("nuts", "Nux"),
|
||||
NONE("none", "None");
|
||||
|
||||
private final String uid;
|
||||
private final String scientific;
|
||||
@@ -37,12 +37,12 @@ public enum EnumFruitFamily implements IFruitFamily {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18n.translateToLocal("for.family." + uid);
|
||||
return Translator.translateToLocal("for.family." + uid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return I18n.translateToLocal("for.family." + uid + ".description");
|
||||
return Translator.translateToLocal("for.family." + uid + ".description");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,7 +11,7 @@ public enum EnumGermlingType implements ISpeciesType {
|
||||
SAPLING("sapling"), POLLEN("pollen");
|
||||
|
||||
public static final EnumGermlingType[] VALUES = values();
|
||||
|
||||
|
||||
private final String name;
|
||||
|
||||
EnumGermlingType(String name) {
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
public enum EnumPileType{
|
||||
public enum EnumPileType {
|
||||
WOOD,
|
||||
DIRT,
|
||||
ASH;
|
||||
|
||||
|
||||
public static final EnumPileType[] VALUES = values();
|
||||
}
|
||||
@@ -8,11 +8,9 @@ package forestry.api.arboriculture;
|
||||
import java.util.Locale;
|
||||
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IAlleleArea;
|
||||
import forestry.api.genetics.IAlleleBoolean;
|
||||
import forestry.api.genetics.IAlleleFloat;
|
||||
import forestry.api.genetics.IAlleleInteger;
|
||||
import forestry.api.genetics.IAllelePlantType;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
@@ -25,12 +23,6 @@ public enum EnumTreeChromosome implements IChromosomeType {
|
||||
* will actually yield fruit with this species. - Native {@link EnumPlantType} for this tree. Combines with the PLANT chromosome.
|
||||
*/
|
||||
SPECIES(IAlleleTreeSpecies.class),
|
||||
/**
|
||||
* {@link IGrowthProvider}, determines conditions required by the tree to grow.
|
||||
* @deprecated unused
|
||||
*/
|
||||
@Deprecated
|
||||
GROWTH(IAlleleGrowth.class),
|
||||
/**
|
||||
* A float modifying the height of the tree. Taken into account at worldgen.
|
||||
*/
|
||||
@@ -47,22 +39,10 @@ public enum EnumTreeChromosome implements IChromosomeType {
|
||||
* Chance for fruit leaves and/or drops.
|
||||
*/
|
||||
YIELD(IAlleleFloat.class),
|
||||
/**
|
||||
* May add additional tolerances for {@link EnumPlantType}.
|
||||
* @deprecated this is tied to species directly
|
||||
*/
|
||||
@Deprecated
|
||||
PLANT(IAllelePlantType.class),
|
||||
/**
|
||||
* Determines the speed at which fruit will ripen on this tree.
|
||||
*/
|
||||
SAPPINESS(IAlleleFloat.class),
|
||||
/**
|
||||
* Territory for leaf effects.
|
||||
* @deprecated unused
|
||||
*/
|
||||
@Deprecated
|
||||
TERRITORY(IAlleleArea.class),
|
||||
/**
|
||||
* Leaf effect. Unused.
|
||||
*/
|
||||
@@ -71,27 +51,15 @@ public enum EnumTreeChromosome implements IChromosomeType {
|
||||
* Amount of random ticks which need to elapse before a sapling will grow into a tree.
|
||||
*/
|
||||
MATURATION(IAlleleInteger.class),
|
||||
|
||||
|
||||
GIRTH(IAlleleInteger.class),
|
||||
/**
|
||||
* The combustibility of the wood, when it burn to charcoal and the combustibility of the charcoal.
|
||||
* @deprecated this is tied to species directly
|
||||
*/
|
||||
@Deprecated
|
||||
COMBUSTIBILITY(IAlleleInteger.class),
|
||||
/**
|
||||
* The amount of charcoal that a wood pile ash drop;
|
||||
* @deprecated this is tied to species directly
|
||||
*/
|
||||
@Deprecated
|
||||
CARBONIZATION(IAlleleInteger.class),
|
||||
/**
|
||||
* Determines if the tree can burn.
|
||||
*/
|
||||
FIREPROOF(IAlleleBoolean.class),;
|
||||
|
||||
Class<? extends IAllele> alleleClass;
|
||||
|
||||
|
||||
private final Class<? extends IAllele> alleleClass;
|
||||
|
||||
EnumTreeChromosome(Class<? extends IAllele> alleleClass) {
|
||||
this.alleleClass = alleleClass;
|
||||
}
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockPlanks;
|
||||
|
||||
public enum EnumVanillaWoodType implements IWoodType {
|
||||
OAK(BlockPlanks.EnumType.OAK, 5, 20),
|
||||
SPRUCE(BlockPlanks.EnumType.SPRUCE, 4, 19),
|
||||
BIRCH(BlockPlanks.EnumType.BIRCH, 4, 19),
|
||||
JUNGLE(BlockPlanks.EnumType.JUNGLE, 5, 20),
|
||||
ACACIA(BlockPlanks.EnumType.ACACIA, 4, 20),
|
||||
DARK_OAK(BlockPlanks.EnumType.DARK_OAK, 5, 20);
|
||||
OAK(BlockPlanks.EnumType.OAK, 5),
|
||||
SPRUCE(BlockPlanks.EnumType.SPRUCE, 4),
|
||||
BIRCH(BlockPlanks.EnumType.BIRCH, 4),
|
||||
JUNGLE(BlockPlanks.EnumType.JUNGLE, 5),
|
||||
ACACIA(BlockPlanks.EnumType.ACACIA, 4),
|
||||
DARK_OAK(BlockPlanks.EnumType.DARK_OAK, 5);
|
||||
|
||||
public static final EnumVanillaWoodType[] VALUES = values();
|
||||
|
||||
@@ -22,12 +21,10 @@ public enum EnumVanillaWoodType implements IWoodType {
|
||||
|
||||
private final BlockPlanks.EnumType vanillaType;
|
||||
private final int carbonization;
|
||||
private final int combustability;
|
||||
|
||||
EnumVanillaWoodType(BlockPlanks.EnumType vanillaType, int carbonization, int combustability) {
|
||||
EnumVanillaWoodType(BlockPlanks.EnumType vanillaType, int carbonization) {
|
||||
this.vanillaType = vanillaType;
|
||||
this.carbonization = carbonization;
|
||||
this.combustability = combustability;
|
||||
}
|
||||
|
||||
public BlockPlanks.EnumType getVanillaType() {
|
||||
@@ -49,7 +46,6 @@ public enum EnumVanillaWoodType implements IWoodType {
|
||||
return ordinal();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public static EnumVanillaWoodType byMetadata(int meta) {
|
||||
if (meta < 0 || meta >= VALUES.length) {
|
||||
meta = 0;
|
||||
@@ -68,7 +64,54 @@ public enum EnumVanillaWoodType implements IWoodType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCombustability() {
|
||||
return combustability;
|
||||
public float getCharcoalChance(int numberOfCharcoal) {
|
||||
if (numberOfCharcoal == 3) {
|
||||
return 0.75F;
|
||||
} else if (numberOfCharcoal == 4) {
|
||||
return 0.5F;
|
||||
} else if (numberOfCharcoal == 5) {
|
||||
return 0.25F;
|
||||
}
|
||||
return 0.15F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlankTexture() {
|
||||
if (this == DARK_OAK) {
|
||||
return "blocks/planks_big_oak";
|
||||
}
|
||||
return "blocks/planks_" + getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDoorLowerTexture() {
|
||||
if (this == OAK) {
|
||||
return "blocks/door_wood_lower";
|
||||
}
|
||||
return "blocks/door_wood_lower";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDoorUpperTexture() {
|
||||
if (this == OAK) {
|
||||
return "blocks/door_wood_upper";
|
||||
}
|
||||
return "blocks/door_" + getName() + "_upper";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBarkTexture() {
|
||||
if (this == DARK_OAK) {
|
||||
return "blocks/log_big_oak";
|
||||
}
|
||||
return "blocks/log_" + getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHeartTexture() {
|
||||
if (this == DARK_OAK) {
|
||||
return "blocks/log_big_oak_top";
|
||||
}
|
||||
return "blocks/log_" + getName() + "_top";
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import forestry.api.genetics.IAlleleProperty;
|
||||
@@ -15,13 +14,11 @@ import forestry.api.genetics.IAlleleProperty;
|
||||
*/
|
||||
public interface IAlleleFruit extends IAlleleProperty<IAlleleFruit> {
|
||||
|
||||
@Nonnull
|
||||
IFruitProvider getProvider();
|
||||
|
||||
@Nullable
|
||||
String getModelName();
|
||||
|
||||
@Nonnull
|
||||
String getModID();
|
||||
|
||||
}
|
||||
@@ -5,11 +5,10 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IAlleleEffect;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* Simple allele encapsulating a leaf effect. (Not implemented)
|
||||
|
||||
@@ -5,65 +5,64 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
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> {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
ITreeRoot getRoot();
|
||||
|
||||
|
||||
/**
|
||||
* @return Native plant type of this species.
|
||||
*/
|
||||
@Nonnull
|
||||
EnumPlantType getPlantType();
|
||||
|
||||
/**
|
||||
* @return List of all {@link IFruitFamily}s which can grow on leaves generated by this species.
|
||||
*/
|
||||
@Nonnull
|
||||
Collection<IFruitFamily> getSuitableFruit();
|
||||
|
||||
/**
|
||||
* @return Tree generator for this species.
|
||||
*/
|
||||
@Nonnull
|
||||
ITreeGenerator getGenerator();
|
||||
|
||||
|
||||
/**
|
||||
* @return The modid from the mod of the species.
|
||||
*/
|
||||
@Nonnull
|
||||
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.
|
||||
*/
|
||||
float getRarity();
|
||||
|
||||
IWoodProvider getWoodProvider();
|
||||
|
||||
ILeafProvider getLeafProvider();
|
||||
|
||||
IGrowthProvider getGrowthProvider();
|
||||
|
||||
/* MODELS AND OVERRIDES */
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
ILeafSpriteProvider getLeafSpriteProvider();
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
int getGermlingColour(EnumGermlingType type, int renderPass);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
ModelResourceLocation getGermlingModel(EnumGermlingType type);
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerModels(Item item, IModelManager manager, EnumGermlingType type);
|
||||
|
||||
|
||||
@@ -5,20 +5,33 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
|
||||
import forestry.api.genetics.IAlleleSpeciesBuilder;
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
|
||||
public interface IAlleleTreeSpeciesBuilder extends IAlleleSpeciesBuilder {
|
||||
|
||||
@Override
|
||||
IAlleleTreeSpecies build();
|
||||
|
||||
/** Add a fruit family for this tree. Trees can have multiple fruit families. */
|
||||
/**
|
||||
* Add a fruit family for this tree. Trees can have multiple fruit families.
|
||||
*/
|
||||
IAlleleTreeSpeciesBuilder addFruitFamily(IFruitFamily family);
|
||||
|
||||
/** Set the minecraft plant type for this tree. Default is Plains. */
|
||||
/**
|
||||
* Set the minecraft plant type for this tree. Default is Plains.
|
||||
*/
|
||||
IAlleleTreeSpeciesBuilder setPlantType(EnumPlantType type);
|
||||
|
||||
/**
|
||||
* Set rarity of the species, will affect spawn rate in the world. Must be a float between 0 and 1. If it's 0, it will not spawn.
|
||||
*/
|
||||
IAlleleTreeSpeciesBuilder setRarity(float rarity);
|
||||
|
||||
/**
|
||||
* Set the growth provider.
|
||||
*/
|
||||
IAlleleTreeSpeciesBuilder setGrowthProvider(IGrowthProvider growthProvider);
|
||||
|
||||
}
|
||||
+10
-7
@@ -5,13 +5,16 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import forestry.api.genetics.IAllele;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
/**
|
||||
* Simple allele encapsulating an {@link IGrowthProvider}.
|
||||
*/
|
||||
public interface IAlleleGrowth extends IAllele {
|
||||
|
||||
IGrowthProvider getProvider();
|
||||
public interface ICharcoalPileWall {
|
||||
|
||||
int getCharcoalAmount();
|
||||
|
||||
boolean matches(IBlockState state);
|
||||
|
||||
NonNullList<ItemStack> getDisplyItems();
|
||||
|
||||
}
|
||||
@@ -5,30 +5,28 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
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.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
|
||||
public interface IFruitProvider {
|
||||
|
||||
IFruitFamily getFamily();
|
||||
|
||||
int getColour(ITreeGenome genome, IBlockAccess world, BlockPos pos, int ripeningTime);
|
||||
|
||||
/** return the color to use for decorative leaves. Usually the ripe color. */
|
||||
/**
|
||||
* return the color to use for decorative leaves. Usually the ripe color.
|
||||
*/
|
||||
int getDecorativeColor();
|
||||
|
||||
boolean isFruitLeaf(ITreeGenome genome, World world, BlockPos pos);
|
||||
@@ -36,15 +34,12 @@ public interface IFruitProvider {
|
||||
int getRipeningPeriod();
|
||||
|
||||
// / Products, Chance
|
||||
@Nonnull
|
||||
Map<ItemStack, Float> getProducts();
|
||||
|
||||
// / Specialty, Chance
|
||||
@Nonnull
|
||||
Map<ItemStack, Float> getSpecialty();
|
||||
|
||||
@Nonnull
|
||||
List<ItemStack> getFruits(ITreeGenome genome, World world, BlockPos pos, int ripeningTime);
|
||||
NonNullList<ItemStack> getFruits(ITreeGenome genome, World world, BlockPos pos, int ripeningTime);
|
||||
|
||||
/**
|
||||
* @return Short, human-readable identifier used in the treealyzer.
|
||||
@@ -54,7 +49,6 @@ public interface IFruitProvider {
|
||||
@Nullable
|
||||
String getModelName();
|
||||
|
||||
@Nonnull
|
||||
String getModID();
|
||||
|
||||
/* TEXTURE OVERLAY */
|
||||
@@ -66,7 +60,9 @@ public interface IFruitProvider {
|
||||
@Nullable
|
||||
ResourceLocation getSprite(ITreeGenome genome, IBlockAccess world, BlockPos pos, int ripeningTime);
|
||||
|
||||
/** return the ResourceLocation to display on decorative leaves */
|
||||
/**
|
||||
* return the ResourceLocation to display on decorative leaves
|
||||
*/
|
||||
@Nullable
|
||||
ResourceLocation getDecorativeSprite();
|
||||
|
||||
|
||||
@@ -5,16 +5,12 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import forestry.api.core.IModelManager;
|
||||
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;
|
||||
|
||||
import forestry.api.core.IModelManager;
|
||||
|
||||
/**
|
||||
* Provides icons for saplings, pollen, etc.
|
||||
* You must implement this yourself to use TreeManager.treeFactory.createSpecies()
|
||||
@@ -24,6 +20,15 @@ public interface IGermlingModelProvider {
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerModels(Item item, IModelManager manager, EnumGermlingType type);
|
||||
|
||||
@Nonnull
|
||||
@SideOnly(Side.CLIENT)
|
||||
ModelResourceLocation getModel(EnumGermlingType type);
|
||||
|
||||
/**
|
||||
* Provides color for sapling. See {@link ILeafSpriteProvider} for pollen color.
|
||||
*
|
||||
* @param type the germling type to render
|
||||
* @param renderPass renderPass of rendering
|
||||
* @return sapling color for renderPass
|
||||
*/
|
||||
int getSpriteColor(EnumGermlingType type, int renderPass);
|
||||
}
|
||||
@@ -1,42 +1,18 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
/**
|
||||
* @deprecated this is being removed to simplify trees
|
||||
*/
|
||||
@Deprecated
|
||||
public interface IGrowthProvider {
|
||||
|
||||
/**
|
||||
* Check to see whether a sapling at the given location with the given genome can grow into a tree.
|
||||
*
|
||||
* @param genome Genome of the tree this is called for.
|
||||
* @param world Minecraft world the tree will inhabit.
|
||||
* @param pos Coordinates to attempt growth at.
|
||||
* @param expectedGirth Trunk size of the tree to generate.
|
||||
* @param expectedHeight Height of the tree to generate.
|
||||
* @return position that the tree can grow, null otherwise.
|
||||
*/
|
||||
@Nullable
|
||||
BlockPos canGrow(ITreeGenome genome, World world, BlockPos pos, int expectedGirth, int expectedHeight);
|
||||
|
||||
/**
|
||||
* @return Short, human-readable identifier used in the treealyzer.
|
||||
*/
|
||||
String getDescription();
|
||||
|
||||
/**
|
||||
* @return Detailed description of growth behaviour used in the treealyzer.
|
||||
*/
|
||||
String[] getInfo();
|
||||
|
||||
boolean canSpawn(ITree tree, World world, BlockPos pos);
|
||||
|
||||
boolean isBiomeValid(ITree tree, Biome biome);
|
||||
|
||||
}
|
||||
+9
-3
@@ -5,6 +5,12 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
public enum EnumGrowthConditions {
|
||||
HOSTILE, PALTRY, NORMAL, GOOD, EXCELLENT
|
||||
}
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface ILeafProvider {
|
||||
|
||||
void init(IAlleleTreeSpecies treeSpecies);
|
||||
|
||||
ItemStack getDecorativeLeaves();
|
||||
|
||||
}
|
||||
@@ -5,19 +5,16 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
/**
|
||||
* Provides icons for leaves. Used by TreeManager.treeFactory.createSpecies()
|
||||
* Get a default Forestry implementation from TreeManager.treeFactory.getLeafIconProvider() or implement your own.
|
||||
*
|
||||
* <p>
|
||||
* If you implement your own, be sure to register the icons.
|
||||
* Icon registration is not done here because these icons are heavily reused.
|
||||
*/
|
||||
public interface ILeafSpriteProvider {
|
||||
@Nonnull
|
||||
ResourceLocation getSprite(boolean pollinated, boolean fancy);
|
||||
|
||||
int getColor(boolean pollinated);
|
||||
|
||||
@@ -16,7 +16,7 @@ public interface IToolGrafter {
|
||||
*
|
||||
* @param stack ItemStack containing the grafter.
|
||||
* @param world Minecraft world the player and the target block inhabit.
|
||||
* @param pos Coordinate of the broken leaf block.
|
||||
* @param pos Coordinate of the broken leaf block.
|
||||
* @return Float representing the factor the usual drop chance is to be multiplied by.
|
||||
*/
|
||||
float getSaplingModifier(ItemStack stack, World world, EntityPlayer player, BlockPos pos);
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -15,10 +14,13 @@ import forestry.api.genetics.IEffectData;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public interface ITree extends IIndividual, ITreeGenData {
|
||||
|
||||
@@ -26,29 +28,27 @@ public interface ITree extends IIndividual, ITreeGenData {
|
||||
|
||||
IEffectData[] doEffect(IEffectData[] storedData, World world, BlockPos pos);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
IEffectData[] doFX(IEffectData[] storedData, World world, BlockPos pos);
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
ITreeGenome getGenome();
|
||||
|
||||
@Nullable
|
||||
ITreeGenome getMate();
|
||||
|
||||
/**
|
||||
* @since Forestry 4.0
|
||||
*/
|
||||
ITree[] getSaplings(World world, GameProfile playerProfile, BlockPos pos, float modifier);
|
||||
List<ITree> getSaplings(World world, @Nullable GameProfile playerProfile, BlockPos pos, float modifier);
|
||||
|
||||
// Products, Chance
|
||||
@Nonnull
|
||||
Map<ItemStack, Float> getProducts();
|
||||
|
||||
// Specialties, Chance
|
||||
@Nonnull
|
||||
Map<ItemStack, Float> getSpecialties();
|
||||
|
||||
@Nonnull
|
||||
List<ItemStack> produceStacks(World world, BlockPos pos, int ripeningTime);
|
||||
NonNullList<ItemStack> produceStacks(World world, BlockPos pos, int ripeningTime);
|
||||
|
||||
/**
|
||||
* @return Boolean indicating whether a sapling can stay planted at the given position.
|
||||
@@ -72,7 +72,7 @@ public interface ITree extends IIndividual, ITreeGenData {
|
||||
* @return Integer denoting how resilient leaf blocks are against adverse influences (i.e. caterpillars).
|
||||
*/
|
||||
int getResilience();
|
||||
|
||||
|
||||
/**
|
||||
* @return Integer denoting the size of the tree trunk.
|
||||
*/
|
||||
|
||||
@@ -5,12 +5,32 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
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()
|
||||
@@ -30,8 +50,10 @@ public interface ITreeFactory {
|
||||
* @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, @Nonnull IWoodProvider woodProvider, ITreeGenerator generator);
|
||||
|
||||
/** Get one of the built-in Forestry leaf types. Default type is deciduous. */
|
||||
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);
|
||||
|
||||
/**
|
||||
* Get one of the built-in Forestry leaf types. Default type is deciduous.
|
||||
*/
|
||||
ILeafSpriteProvider getLeafIconProvider(EnumLeafType enumLeafType, Color color, Color colorPollinated);
|
||||
}
|
||||
@@ -5,15 +5,15 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
/**
|
||||
* Implements the tree generation for a tree species.
|
||||
*/
|
||||
@@ -22,5 +22,5 @@ public interface ITreeGenerator {
|
||||
|
||||
boolean setLogBlock(ITreeGenome genome, World world, BlockPos pos, EnumFacing facing);
|
||||
|
||||
boolean setLeaves(ITreeGenome genome, World world, GameProfile owner, BlockPos pos);
|
||||
boolean setLeaves(ITreeGenome genome, World world, @Nullable GameProfile owner, BlockPos pos);
|
||||
}
|
||||
@@ -5,9 +5,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import forestry.api.genetics.IGenome;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface ITreeGenome extends IGenome {
|
||||
|
||||
@@ -17,7 +16,6 @@ public interface ITreeGenome extends IGenome {
|
||||
@Override
|
||||
IAlleleTreeSpecies getSecondary();
|
||||
|
||||
@Nonnull
|
||||
IFruitProvider getFruitProvider();
|
||||
|
||||
float getHeight();
|
||||
@@ -26,7 +24,7 @@ public interface ITreeGenome extends IGenome {
|
||||
|
||||
/**
|
||||
* @return Determines either a) how many fruit leaves there are or b) the chance for any fruit leave to drop a sapling. Exact usage determined by the
|
||||
* IFruitProvider
|
||||
* IFruitProvider
|
||||
*/
|
||||
float getYield();
|
||||
|
||||
@@ -40,4 +38,15 @@ public interface ITreeGenome extends IGenome {
|
||||
int getGirth();
|
||||
|
||||
IAlleleLeafEffect getEffect();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return A ItemStack that is used in getPickBlock of the leave block.
|
||||
*/
|
||||
ItemStack getDecorativeLeaves();
|
||||
|
||||
/**
|
||||
* @return true if this genome matches one of the default template genomes
|
||||
*/
|
||||
boolean matchesTemplateGenome();
|
||||
}
|
||||
@@ -8,36 +8,26 @@ package forestry.api.arboriculture;
|
||||
public interface ITreeModifier {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param genome
|
||||
* @return Float used to modify the height.
|
||||
*/
|
||||
float getHeightModifier(ITreeGenome genome, float currentModifier);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param genome
|
||||
* @return Float used to modify the yield.
|
||||
*/
|
||||
float getYieldModifier(ITreeGenome genome, float currentModifier);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param genome
|
||||
* @return Float used to modify the sappiness.
|
||||
*/
|
||||
float getSappinessModifier(ITreeGenome genome, float currentModifier);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param genome
|
||||
* @return Float used to modify the maturation.
|
||||
*/
|
||||
float getMaturationModifier(ITreeGenome genome, float currentModifier);
|
||||
|
||||
/**
|
||||
* @param genome0
|
||||
* @param genome1
|
||||
* @return Float used to modify the base mutation chance.
|
||||
*/
|
||||
float getMutationModifier(ITreeGenome genome0, ITreeGenome genome1, float currentModifier);
|
||||
|
||||
@@ -5,14 +5,13 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import forestry.api.genetics.IMutation;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IMutation;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
|
||||
public interface ITreeMutation extends IMutation {
|
||||
|
||||
|
||||
/**
|
||||
* @return {@link ISpeciesRoot} this mutation is associated with.
|
||||
*/
|
||||
|
||||
@@ -15,8 +15,8 @@ public interface ITreeMutationFactory {
|
||||
*
|
||||
* @param parentTree0 A parent tree for this mutation
|
||||
* @param parentTree1 A parent tree for this mutation
|
||||
* @param result The resulting alleles for this mutation
|
||||
* @param chance The chance that breeding the two parent trees will result in this mutation
|
||||
* @param result The resulting alleles for this mutation
|
||||
* @param chance The chance that breeding the two parent trees will result in this mutation
|
||||
* @return a new tree mutation.
|
||||
*/
|
||||
ITreeMutationBuilder createMutation(IAlleleTreeSpecies parentTree0, IAlleleTreeSpecies parentTree1, IAllele[] result, int chance);
|
||||
|
||||
@@ -6,25 +6,26 @@
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
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.ISpeciesRoot;
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
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;
|
||||
|
||||
public interface ITreeRoot extends ISpeciesRoot {
|
||||
public interface ITreeRoot extends ISpeciesRootPollinatable {
|
||||
|
||||
@Override
|
||||
boolean isMember(ItemStack itemstack);
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
ITree getMember(ItemStack itemstack);
|
||||
|
||||
@Override
|
||||
@@ -43,16 +44,16 @@ public interface ITreeRoot extends ISpeciesRoot {
|
||||
ITreeGenome templateAsGenome(IAllele[] templateActive, IAllele[] templateInactive);
|
||||
|
||||
/**
|
||||
* @param world
|
||||
* @return {@link IArboristTracker} associated with the passed world.
|
||||
*/
|
||||
@Override
|
||||
IArboristTracker getBreedingTracker(World world, GameProfile player);
|
||||
IArboristTracker getBreedingTracker(World world, @Nullable GameProfile player);
|
||||
|
||||
/* TREE SPECIFIC */
|
||||
|
||||
/**
|
||||
* Register a leaf tick handler.
|
||||
*
|
||||
* @param handler the {@link ILeafTickHandler} to register.
|
||||
*/
|
||||
void registerLeafTickHandler(ILeafTickHandler handler);
|
||||
@@ -66,6 +67,7 @@ public interface ITreeRoot extends ISpeciesRoot {
|
||||
@Override
|
||||
EnumGermlingType getType(ItemStack stack);
|
||||
|
||||
@Nullable
|
||||
ITree getTree(World world, BlockPos pos);
|
||||
|
||||
ITree getTree(World world, ITreeGenome genome);
|
||||
@@ -78,24 +80,28 @@ public interface ITreeRoot extends ISpeciesRoot {
|
||||
@Override
|
||||
IChromosome[] templateAsChromosomes(IAllele[] templateActive, IAllele[] templateInactive);
|
||||
|
||||
boolean setFruitBlock(World world, IAlleleFruit allele, float sappiness, BlockPos pos);
|
||||
boolean setFruitBlock(World world, ITreeGenome genome, IAlleleFruit allele, float sappiness, BlockPos pos);
|
||||
|
||||
/* GAME MODE */
|
||||
List<ITreekeepingMode> getTreekeepingModes();
|
||||
|
||||
ITreekeepingMode getTreekeepingMode(World world);
|
||||
|
||||
@Nullable
|
||||
ITreekeepingMode getTreekeepingMode(String name);
|
||||
|
||||
void registerTreekeepingMode(ITreekeepingMode mode);
|
||||
|
||||
void setTreekeepingMode(World world, String name);
|
||||
void setTreekeepingMode(World world, ITreekeepingMode mode);
|
||||
|
||||
/* TEMPLATES */
|
||||
|
||||
@Override
|
||||
ArrayList<ITree> getIndividualTemplates();
|
||||
List<ITree> getIndividualTemplates();
|
||||
|
||||
/* MUTATIONS */
|
||||
@Override
|
||||
List<ITreeMutation> getMutations(boolean shuffle);
|
||||
|
||||
Collection<IFruitProvider> getFruitProvidersForFruitFamily(IFruitFamily fruitFamily);
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public interface ITreekeepingMode extends ITreeModifier {
|
||||
|
||||
@@ -17,6 +17,6 @@ public interface ITreekeepingMode extends ITreeModifier {
|
||||
/**
|
||||
* @return Localized list of strings outlining the behaviour of this treekeeping mode.
|
||||
*/
|
||||
ArrayList<String> getDescription();
|
||||
List<String> getDescription();
|
||||
|
||||
}
|
||||
@@ -5,6 +5,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -23,4 +25,7 @@ public interface IWoodAccess {
|
||||
|
||||
IBlockState getBlock(IWoodType woodType, WoodBlockKind kind, boolean fireproof);
|
||||
|
||||
List<IWoodType> getRegisteredWoodTypes();
|
||||
|
||||
void register(IWoodType woodType, WoodBlockKind woodBlockKind, boolean fireproof, IBlockState blockState, ItemStack itemStack);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/*******************************************************************************
|
||||
* 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.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IWoodItemMeshDefinition extends ItemMeshDefinition {
|
||||
|
||||
ResourceLocation getDefaultModelLocation(ItemStack stack);
|
||||
|
||||
}
|
||||
@@ -5,8 +5,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import forestry.api.core.ITextureManager;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -19,25 +17,23 @@ public interface IWoodProvider {
|
||||
void registerSprites(Item item, ITextureManager manager);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return The texture sprite of the wood.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
TextureAtlasSprite getSprite(boolean isTop);
|
||||
|
||||
|
||||
/**
|
||||
* @return A stack of wood from the tree to craft wood pile's or other things.
|
||||
*/
|
||||
ItemStack getWoodStack();
|
||||
|
||||
/**
|
||||
* @return how long this wood's charcoal burns / 1000
|
||||
*/
|
||||
int getCombustibility();
|
||||
|
||||
|
||||
/**
|
||||
* The amount of charcoal dropped from a charcoal pile of this wood.
|
||||
*/
|
||||
int getCarbonization();
|
||||
|
||||
/**
|
||||
* The chance that a pile has to drop a extra charcoal
|
||||
*/
|
||||
float getCharcoalChance(int numberOfCharcoal);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
/*******************************************************************************
|
||||
* 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.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.statemap.IStateMapper;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IWoodStateMapper extends IStateMapper {
|
||||
|
||||
ModelResourceLocation getModelLocation(IBlockState state);
|
||||
|
||||
ModelResourceLocation getDefaultModelResourceLocation(IBlockState state);
|
||||
|
||||
}
|
||||
@@ -13,5 +13,15 @@ public interface IWoodType extends IStringSerializable {
|
||||
|
||||
int getCarbonization();
|
||||
|
||||
int getCombustability();
|
||||
float getCharcoalChance(int numberOfCharcoal);
|
||||
|
||||
String getPlankTexture();
|
||||
|
||||
String getDoorLowerTexture();
|
||||
|
||||
String getDoorUpperTexture();
|
||||
|
||||
String getBarkTexture();
|
||||
|
||||
String getHeartTexture();
|
||||
}
|
||||
@@ -5,6 +5,9 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TreeManager {
|
||||
|
||||
/**
|
||||
@@ -26,4 +29,6 @@ public class TreeManager {
|
||||
* Used to create new tree mutations.
|
||||
*/
|
||||
public static ITreeMutationFactory treeMutationFactory;
|
||||
|
||||
public static List<ICharcoalPileWall> pileWalls = new ArrayList<>();
|
||||
}
|
||||
Regular → Executable
+51
-1
@@ -1,12 +1,62 @@
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
|
||||
public enum WoodBlockKind {
|
||||
LOG, PLANKS, SLAB, FENCE, FENCE_GATE, STAIRS, DOOR;
|
||||
|
||||
public String getName(){
|
||||
return super.toString().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString().toLowerCase(Locale.ENGLISH);
|
||||
return getName();
|
||||
}
|
||||
|
||||
public IModel retextureModel(IModel model, IWoodType type, ImmutableMap<String, String> customTextures) {
|
||||
Map<String, String> textures = new HashMap<>();
|
||||
switch (this) {
|
||||
case SLAB:
|
||||
case STAIRS:
|
||||
String textureLocation = type.getPlankTexture();
|
||||
textures.put("particle", textureLocation);
|
||||
textures.put("side", textureLocation);
|
||||
textures.put("top", textureLocation);
|
||||
textures.put("bottom", textureLocation);
|
||||
textures.put("all", textureLocation);
|
||||
break;
|
||||
case PLANKS:
|
||||
textures.put("particle", type.getPlankTexture());
|
||||
textures.put("all", type.getPlankTexture());
|
||||
break;
|
||||
case FENCE_GATE:
|
||||
case FENCE:
|
||||
textures.put("particle", type.getPlankTexture());
|
||||
textures.put("side", type.getPlankTexture());
|
||||
textures.put("texture", type.getPlankTexture());
|
||||
break;
|
||||
case DOOR:
|
||||
textures.put("particle", type.getDoorLowerTexture());
|
||||
textures.put("bottom", type.getDoorLowerTexture());
|
||||
textures.put("top", type.getDoorUpperTexture());
|
||||
break;
|
||||
case LOG:
|
||||
textures.put("particle", type.getBarkTexture());
|
||||
textures.put("side", type.getBarkTexture());
|
||||
textures.put("all", type.getBarkTexture());
|
||||
textures.put("end", type.getHeartTexture());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
textures.putAll(customTextures);
|
||||
return model.retexture(ImmutableMap.copyOf(textures));
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,12 @@
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
@API(apiVersion = "4.2.1", owner = "ForestryAPI|core", provides = "ForestryAPI|arboriculture")
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
@@ -5,17 +5,20 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.circuits;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
import forestry.api.core.INbtWritable;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public interface ICircuitBoard extends INbtWritable {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
int getPrimaryColor();
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
int getSecondaryColor();
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void addTooltip(List<String> list);
|
||||
|
||||
void onInsertion(Object tile);
|
||||
@@ -26,13 +29,11 @@ public interface ICircuitBoard extends INbtWritable {
|
||||
|
||||
void onTick(Object tile);
|
||||
|
||||
@Nonnull
|
||||
ICircuit[] getCircuits();
|
||||
|
||||
/**
|
||||
* Specifies where a circuit can be used.
|
||||
*/
|
||||
@Nonnull
|
||||
ICircuitSocketType getSocketType();
|
||||
|
||||
}
|
||||
@@ -5,26 +5,26 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.circuits;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public interface ICircuitLayout {
|
||||
|
||||
/** unique ID for this circuit layout */
|
||||
@Nonnull
|
||||
/**
|
||||
* unique ID for this circuit layout
|
||||
*/
|
||||
String getUID();
|
||||
|
||||
/** localized name for this circuit layout */
|
||||
@Nonnull
|
||||
/**
|
||||
* localized name for this circuit layout
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/** localized string for how this circuit layout is used */
|
||||
@Nonnull
|
||||
/**
|
||||
* localized string for how this circuit layout is used
|
||||
*/
|
||||
String getUsage();
|
||||
|
||||
/**
|
||||
* Specifies where a circuit layout is used.
|
||||
*/
|
||||
@Nonnull
|
||||
ICircuitSocketType getSocketType();
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.circuits;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -17,6 +18,7 @@ public interface ICircuitRegistry {
|
||||
|
||||
void registerCircuit(ICircuit circuit);
|
||||
|
||||
@Nullable
|
||||
ICircuit getCircuit(String uid);
|
||||
|
||||
ICircuitLibrary getCircuitLibrary(World world, String playerName);
|
||||
@@ -26,10 +28,12 @@ public interface ICircuitRegistry {
|
||||
|
||||
void registerLayout(ICircuitLayout layout);
|
||||
|
||||
@Nullable
|
||||
ICircuitLayout getLayout(String uid);
|
||||
|
||||
ICircuitLayout getDefaultLayout();
|
||||
|
||||
@Nullable
|
||||
ICircuitBoard getCircuitBoard(ItemStack itemstack);
|
||||
|
||||
boolean isChipset(ItemStack itemstack);
|
||||
|
||||
@@ -10,9 +10,13 @@ package forestry.api.circuits;
|
||||
* See CircuitSocketType for Forestry's uses.
|
||||
*/
|
||||
public interface ICircuitSocketType {
|
||||
/** unique identifier for this socket type */
|
||||
/**
|
||||
* unique identifier for this socket type
|
||||
*/
|
||||
String getUid();
|
||||
|
||||
/** comparison using uid */
|
||||
/**
|
||||
* comparison using uid
|
||||
*/
|
||||
boolean equals(ICircuitSocketType socketType);
|
||||
}
|
||||
@@ -3,7 +3,12 @@
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
@API(apiVersion = "3.1.0", owner = "ForestryAPI|core", provides = "ForestryAPI|circuits")
|
||||
package forestry.api.circuits;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
@@ -0,0 +1,7 @@
|
||||
package forestry.api.climate;
|
||||
|
||||
public enum EnumClimatiserModes {
|
||||
|
||||
POSITIVE, NEGATIVE, BOTH
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package forestry.api.climate;
|
||||
|
||||
public enum EnumClimatiserTypes {
|
||||
|
||||
TEMPERATURE, HUMIDITY, BOTH
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/*******************************************************************************
|
||||
* 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);
|
||||
|
||||
}
|
||||
Loaded 100 of 3190 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user