Compare commits

...
167 Commits
Author SHA1 Message Date
mezz 9d8c616b67 Add block and item migration from 1.10 to 1.11 names 2016-12-31 01:14:13 -08:00
mezz 17afceab6a Fix fruit allele registration 2016-12-31 00:51:16 -08:00
mezz 306bae490c Move away from deprecated methods 2016-12-31 00:08:02 -08:00
mezz d8e735ef3b API javadoc cleanup, use NonNullList for ItemStack lists 2016-12-30 23:39:42 -08:00
Nedelosk 55919a135e Add GreenhouseLogicTerrain and adding multiblock error renderer 2016-12-30 03:44:41 +01:00
Nedelosk 02f5c7121d Merge branch 'mc-1.11' of https://github.com/ForestryMC/ForestryMC into mc-1.11 2016-12-30 00:21:18 +01:00
mezz ed1907ddea Update to 1.11.2 2016-12-29 10:44:26 -08:00
mezz 0a0bdfa978 Fix networking for worktable and escritoire 2016-12-29 00:15:25 -08:00
mezz 4abbc92472 Clean up more null issues 2016-12-28 23:55:10 -08:00
Nedelosk 1fa461430e Fix #1554 1.10.2 Game Crash and Ticking Block Exception when using Reanimation effect on Skeleton and Zombie Drops 2016-12-28 18:35:40 -08:00
Nedelosk d60bdd5f93 Merge branch 'mc-1.11' of https://github.com/ForestryMC/ForestryMC into mc-1.11 2016-12-29 00:01:04 +01:00
Nedelosk f39ff51ca8 Fix #1554 1.10.2 Game Crash and Ticking Block Exception when using Reanimation effect on Skeleton and Zombie Drops 2016-12-28 23:57:57 +01:00
mezz 35f9b95f37 Clean up more null/nonnull, refactor gui ledgers 2016-12-26 08:08:08 -08:00
Nedelosk b2d4e6eaba Fix greenhouse lang 2016-12-26 04:10:29 +01:00
Nedelosk 5bd4ba3cd5 Add an climate pillar on the left side of the greenhouse gui 2016-12-25 15:54:41 +01:00
Nedelosk d4f9c69538 Improve greenhouse and add new greenhouse gui texture 2016-12-25 02:20:44 +01:00
Nedelosk ea976ebb2f Remove unloaded climate regions 2016-12-24 03:14:14 +01:00
Nedelosk c5798af241 Clean Up 2016-12-24 02:57:15 +01:00
Nedelosk e0bff8ec64 Clean Up and improve greenhouse climate system 2016-12-24 02:54:12 +01:00
mezz 8bf6b19a63 Remove redundant Nonnull annotations (everything is Nonnull by default) 2016-12-22 19:45:08 -08:00
mezz abf6ccb3ed Fix slot backgrounds 2016-12-22 19:26:19 -08:00
mezz d55b91df48 Fix error Ledger texture 2016-12-22 19:26:09 -08:00
mezz 1b865a0589 Update lang keys 2016-12-22 19:25:57 -08:00
mezz a2c12f3841 Fix missing resources 2016-12-22 19:18:00 -08:00
Nedelosk 08c99cb0ca Clean Up ModelBaker and start to clean up greenhouse 2016-12-23 03:44:30 +01:00
mezz 8cfafec6f9 Automatic code reformatting 2016-12-22 16:53:55 -08:00
mezz 9611ae08ae Update for 1.11. Missing assets, unstable. 2016-12-22 16:47:56 -08:00
Nedelosk 30d7365518 Fix #1508 Bee buildup during pause 2016-12-22 13:24:12 +01:00
Nedelosk 56800af94d Fix #1477 Electrical Engine places backwards 2016-12-22 03:17:35 +01:00
Nedelosk 043571b659 Improve farm control 2016-12-22 02:56:55 +01:00
Nedelosk 7fd2776147 Fix gamemode commit 2016-12-22 02:50:44 +01:00
Nedelosk d4c2d7220d Fix #580, Fix #1479 Add a way to register items to work as fertilizer in farms in a config 2016-12-22 02:47:00 +01:00
Nedelosk d392666dc4 Add missing methods 2016-12-20 06:48:35 +01:00
mezz 07b88d36fc Check that fluids are not null when auto-dumping from bottler 2016-12-19 16:33:33 -08:00
Nedelosk 408d1dc7c3 Fix #1521 IC2 + Foresty crash 2016-12-19 19:20:47 +01:00
Nedelosk 7b1aead339 Fix #1509 Alveary ignores rain 2016-12-19 19:15:28 +01:00
Nedelosk 21969649a2 Fix #1542 SidedInvWrapper used when facing is null 2016-12-19 17:12:06 +01:00
Nedelosk f9b8b89340 Adding a debug message 2016-12-12 14:21:12 +01:00
Nedelosk 65712adcb3 Delete 9864a84a13 2016-12-10 10:26:42 +01:00
Nedelosk 9864a84a13 Make that the climate event handler only work on the server thread 2016-12-10 10:24:46 +01:00
Nedelosk 8f9ae45147 Fix greenhouse climate info 2016-12-10 10:20:45 +01:00
mezz 2965f28403 Fix #1522 log spam with Reliquary void tear 2016-12-01 21:28:37 -08:00
Nirek-K cb93c217e0 Fix #1520 Add Chorus flower/plant to End flower. 2016-11-30 11:53:04 -06:00
mezz 219e9bf355 Fix EntityItemPickupEvent when there are multiple modded handlers 2016-11-29 12:44:13 -08:00
mezz 43a2f0ae76 Fix farm picking up items off Immersive Engineering conveyors 2016-11-25 12:24:15 -08:00
mezz 098b739dca Fix crash with TOP looking at new papaya fruit pods 2016-11-16 21:57:17 -08:00
mezz 4dfa29b1ad Add more null annotations 2016-11-16 21:56:31 -08:00
mezz 60d2820ed6 Update Forge and MCP 2016-11-12 19:12:57 -08:00
Nedelosk 91ec6cff9b Fix #1504 [1.10.2] [5.2.15.296] Butterflies gravitating towards 0,0 where huge swarms are found 2016-11-13 00:30:11 +01:00
mezz 1775e59880 Fix #1507 Crash with Energy Transfer to Mekanism 2016-11-11 20:38:59 -08:00
mezz f62745b233 Clean up bottler updateServerSide 2016-11-11 20:38:59 -08:00
mezz 1d6293c788 Clean up bottler canDump 2016-11-11 20:38:58 -08:00
mezz 3fd07f2a7a Clean up bottler JEI recipes 2016-11-11 20:38:58 -08:00
marcin212 856e800e0e Add Immersive Engineering compat (#1506) 2016-11-11 13:11:58 -08:00
Nirek-K d9561fd7af Re-Add Harvestcraft plugin, covers everything it did in 1.7 (new things will have to be suggested/added later) 2016-11-11 03:07:27 -06:00
Nirek-K e0623f7d57 Minor logic fixes for orchard, to get it to see crops again. 2016-11-07 18:31:12 -06:00
Nirek-K d48b979ac3 Add Actuallly Additions crops also to orchard.
Add Actuallly Additions crops also to orchard.
2016-11-07 10:25:27 -06:00
mezz 63494c40a7 Fix #1497 Chisel integration with digging backpack 2016-11-06 17:15:18 -08:00
mezz 2c57aef3b3 Fix backpack IMC handling 2016-11-06 17:14:06 -08:00
mezz 1392823fae Fix #1498 Crash when Arboriculture plugin is disabled 2016-11-06 16:55:12 -08:00
mezz 67693961ac Change address texture back to 32x32 to avoid breaking texture packs 2016-11-06 16:42:25 -08:00
mezz 8ad8597ff0 Fix #1499 Server Error when trying to access a GUI 2016-11-06 13:59:42 -08:00
mezz 4c8d5e2f43 Move Forestry GUI icons to a new TextureMap 2016-11-06 01:51:43 -08:00
mezz d04713339c Fix the build 2016-11-04 18:40:58 -07:00
Nedelosk 844aea7431 Improve butterfly item texture atlas and model, Fix #1312 2016-11-05 02:26:59 +01:00
mezz 53a9bf458e Update JEI version 2016-11-03 22:44:45 -07:00
mezz 2ae52451b2 Implement JEI lookups on fluid tanks 2016-11-03 21:24:42 -07:00
Speiger d3054c33e7 Improve Crate Renderer (#1493) 2016-11-01 15:43:03 -07:00
mezz bf61462a2a Rename centrifuge gui texture for compat with older texture packs 2016-10-31 20:59:42 -07:00
marcin212 41f3ae4b1f Allow multipass rendering for sapling 2016-10-30 17:21:13 -07:00
mezz b1d7c1721d Add strict null checking for ActuallyAdditions plugin 2016-10-30 15:01:33 -07:00
Ellpeck 2944165741 Added Actually Additions compatibility 2016-10-30 15:01:33 -07:00
Nedelosk e316526675 Fix Charcoal Pile 2016-10-30 13:35:09 +01:00
Nedelosk 411cbd913c Fix #1473 New Bottler issues 2016-10-30 13:32:55 +01:00
Nedelosk 2191d00f3d Fix #1487 Random crash in WeightedRandomModel 2016-10-30 12:54:25 +01:00
Nedelosk a02af0ddf2 Fix #1490 Crash in 1.10.2 when trying to render a Hill Cherry sapling 2016-10-30 12:51:58 +01:00
Nedelosk a8e4f5dde7 Fix #1476 Wood Pile processes instantly 2016-10-30 12:40:22 +01:00
mezz 85718b1df8 Fix and improve Bottler JEI integration 2016-10-29 18:22:40 -07:00
mezz 781b4d883b Fix #1486 Crash from candle block 2016-10-26 13:55:55 -07:00
Nedelosk c5c056750a Fix butterfly 2016-10-25 00:50:58 +02:00
Nedelosk 3b8af4e4c9 Fix IPollinatable and New Version 2016-10-25 00:47:49 +02:00
Nedelosk f58938ff32 Improve IPollinatable 2016-10-25 00:27:26 +02:00
Nedelosk a05bc13852 Fix Climate Handler and add climate test mod for devs 2016-10-22 17:37:49 +02:00
Nedelosk 1cd3e15ef9 Make climate update to a Runnable 2016-10-20 02:44:57 +02:00
Nedelosk 1ac7a7de42 Add Fluid Container Output and processing Slots to the Bottler 2016-10-19 18:58:55 +02:00
Nedelosk 90ed57c742 Merge branch 'mc-1.10' of https://github.com/ForestryMC/ForestryMC into mc-1.10 2016-10-19 13:01:26 +02:00
Nedelosk 94b0b44f51 Fix inverted climate infos 2016-10-19 13:00:56 +02:00
mezz c0fafc20da Improve bee hive performance (#1470) 2016-10-18 17:35:03 -07:00
mezz 4f85236475 Fix #1470 Prevent bees from loading new chunks 2016-10-18 16:15:44 -07:00
Nedelosk 41ab1ea374 Update Version 2016-10-19 00:34:11 +02:00
Nedelosk 52b8d56ff0 Make that the ash drop of the kiln is never 0 2016-10-19 00:04:17 +02:00
Nedelosk a61879daff Fix Alveary 2016-10-18 23:25:20 +02:00
Nedelosk e71edd5855 Fix #1469 Wrong climate info when apiary is placed in greenhouse. 2016-10-18 23:18:15 +02:00
Nedelosk 321e316665 Fix #1456 Breaking a Swarm Hive with Botania's Bore Lens crashes the game 2016-10-18 22:05:44 +02:00
Nedelosk aca6ed1fd8 Add CircuitBoard to colour.properties and Fix #1468 [1.10.2-5.2.14.283] Server side crash 2016-10-18 21:00:16 +02:00
Nedelosk b135593733 Fix #1466 Add Malisis Doors to camouflage Blacklist 2016-10-18 20:31:14 +02:00
Nedelosk ac7fe4b2d2 Fix #1467 Green House Camouflage Glitch 2016-10-18 19:58:01 +02:00
Nedelosk 5e0e045053 Fix #1465 1.10.2-5.2.14.276 - Electrical Engines no longer allow levers to attach to the back 2016-10-18 17:53:23 +02:00
Nedelosk f01dab6f58 Fix #1420 Tweak the effects of three placed fluids 2016-10-18 17:47:07 +02:00
Nedelosk 9385a4caca Fix and Add model caches and Fix #1102Invisible butterflies in itemframes 2016-10-18 17:27:24 +02:00
Nedelosk 582c8d64df Fix greenhouse tiles 2016-10-18 16:20:30 +02:00
Nedelosk 26c40b2006 Fix #1447 Flickering Greenhouse 2016-10-18 16:15:49 +02:00
Nedelosk b7eaaf6804 Fix #1460 Empty bucket can't be pulled out of (i.e.) Biogas engine 2016-10-18 15:56:09 +02:00
Nedelosk 3f07e68952 Fix #1071 Butterflies spread out of control 2016-10-18 15:42:12 +02:00
Nedelosk 2b40762934 Fix #1459 Greenhouse Door Crash w/ Malisis' Doors Mod Doors 2016-10-18 15:28:36 +02:00
Nedelosk dcaf6e144f Fix #1294 JEI Integration for Thermionic Fab and Carpenter 2016-10-18 15:12:59 +02:00
Nedelosk 413e1b9a0d Fix #1439 Cocoons config bug in 1.10.2 2016-10-18 14:13:28 +02:00
Nedelosk 64f64f2b5c Fix #1441 Centrifuge preview slot should show item being centrifuged, not its result 2016-10-18 14:10:30 +02:00
Nedelosk 2d25754731 Fix 1444 Apiarist's Chest collision box is acting weird., Fix # 1422 Cacoons cause suffocation if you walk into them 2016-10-18 13:58:47 +02:00
Nedelosk 2df6cfb7f7 Fix #1455 Igniting a Wood Pile built by a fake player crashes the game 2016-10-18 13:40:11 +02:00
Nedelosk 2d0ca49359 Fix 1408 Floating desert acacia "trees" appear in the middle of nowere 2016-10-18 13:04:54 +02:00
Nedelosk d567138365 Fix #1463, Fix #1457 Make charcoal drop with % chance, remove custom charcoals. 2016-10-18 11:57:27 +02:00
Nedelosk 72380251f3 Fix #1432 multiblock.error.small.x when right-clicking Wood Piles 2016-10-10 10:17:55 +02:00
Nedelosk 05a263826e Fix #1438 Crash after Breaking Chest 2016-10-10 10:13:17 +02:00
Nedelosk 61aa8bdcf0 Fix #1437 Drone in the analyzer 2016-10-10 10:06:53 +02:00
Nedelosk e0694842b6 Improve Camouflage Packet 2016-10-10 10:00:58 +02:00
mezz ff9942d0bc Fix "upper half" wood slabs having the wrong wood type 2016-10-08 20:05:43 -07:00
mezz dcf7776cc1 Fix #1451 Crash when placing decorative leaf blocks 2016-10-08 19:55:20 -07:00
mezz a0d355d0aa Fix some nullable annotation errors 2016-10-07 21:49:54 -07:00
mezz 649a061b6e Fix ModelBlockCached not resetting after a texture remap 2016-10-07 21:28:57 -07:00
mezz 2ca743a931 Clean up ModelBlockCached slightly 2016-10-07 21:28:25 -07:00
mezz 76a34a603b Update ApicultureJeiPlugin to stop using deprecated methods 2016-10-07 17:22:19 -07:00
mezz 68651939e7 Fix crash when getting wood blocks with invalid variants 2016-10-07 15:42:20 -07:00
Adrian Siekierka 9dcc818a17 Add model caching (#1449) 2016-10-07 15:10:09 -07:00
mezz 5e3c23e4eb Bump version 2016-10-02 17:52:43 -07:00
mezz d8ffc5c4b8 Fix #1403 worktable bug with items it can't craft 2016-10-02 17:52:35 -07:00
mezz 737f64eeab Fix uppercase variable name 2016-10-02 15:18:11 -07:00
mezz 0db27d83b0 Add worktable to JEI's Crafting Table items 2016-10-02 15:17:59 -07:00
mezz f57de19b06 Fix #1442 Let BeeHousings detect biome changes 2016-10-02 15:17:32 -07:00
mezz 1fed58fae5 Bump version 2016-09-30 23:29:41 -07:00
mezz 1d8d61daf1 Fix missing Squeezer recipes in JEI 2016-09-30 23:29:15 -07:00
mezz 65bd93749c Fix missing itemHandler capability for Farm hatch 2016-09-28 21:49:58 -07:00
mezz ac48b4b5c6 Update JEI integration 2016-09-27 02:53:06 -07:00
Nedelosk 3be3ecfc8a Fix #1436 Placing lit candles does not cause a lighting update, Fix #1435 Freshly crafted candle items are not the same as just-broken candle items. 2016-09-24 15:48:56 +02:00
mezz 10aae6b6bc Clean up IBeeHousing slightly 2016-09-19 21:12:58 -07:00
mezz d84560926c Make IArmorNaturalist into a capability 2016-09-19 21:12:58 -07:00
mezz ab3de49198 Make IArmorApiarist into a capability 2016-09-19 21:12:57 -07:00
Nedelosk b2b743398c Adding a preview slot to the centrifuge 2016-09-19 20:28:52 +02:00
Nedelosk 52f233e84a Fix the clockwork engine 2016-09-18 01:30:58 +02:00
Nedelosk 2f2ec91670 Fix #1253 2016-09-18 00:20:11 +02:00
Nedelosk 2e2fa8e6df Removed a comment because it is not true anymore 2016-09-17 23:41:02 +02:00
Nedelosk 3de6e0c5b7 Bump version 2016-09-17 23:27:51 +02:00
Nedelosk 0f4ba8d8fa Clean Up 2016-09-17 23:26:58 +02:00
Nedelosk 9570d26c83 Fix #1429 [API-TreeManager] TreeManager doesn't work properly 2016-09-17 23:19:39 +02:00
Nedelosk 01dc4f2bfe Fix the alyzer plugin api 2016-09-17 23:18:53 +02:00
Nedelosk 80de4d6490 Fix #1427 Engines do not show RF/t output properly 2016-09-17 22:50:46 +02:00
Nedelosk 253e9f18ed Fix #1078 Adding a work Cycle for every pending product 2016-09-17 22:23:11 +02:00
Nedelosk bbda5c8ba9 Fix #1419 Disabled greenhouse in plugins (as they're buggy) and having crash with 'cocoon's 2016-09-17 22:00:53 +02:00
mezz c289590740 Bump version 2016-09-15 14:53:26 -07:00
mezz 714858be99 Fix cable connections with Engines 2016-09-15 14:53:19 -07:00
mezz 5bb60cad8a Bump version 2016-09-14 14:24:24 -07:00
mezz b8cf4ef1cf Update zh_CN.lang 2016-09-14 14:24:23 -07:00
mezz d35075d681 Prevent farms on a chunk edge from loading unloaded chunks 2016-09-14 14:23:06 -07:00
mezz 79c56311c2 Refactor Energy systems and make RF optional 2016-09-13 00:37:39 -07:00
mezz 77cea8a645 Add support for new Forge energy capability 2016-09-12 16:07:47 -07:00
Nedelosk ed00ca3158 Merge pull request #1407 from ForestryMC/Greenhouse
Adding Greenhouse Window, Climate Control,  Camouflage Spray Can and Improve Recipes
2016-09-12 18:00:45 +02:00
Nedelosk 418f00abf2 Merge branch 'mc-1.10' of https://github.com/ForestryMC/ForestryMC into mc-1.10 2016-09-12 14:47:01 +02:00
mezz 0fa8fdad39 Remove access-related hints and the power-required hint 2016-09-11 22:23:38 -07:00
Aroma1997 0a110eb761 Fix #1414 greenhouse climate blocks crash (#1418) 2016-09-11 13:27:27 -07:00
Nedelosk 9feb5cb114 Merge branch 'mc-1.10' of https://github.com/ForestryMC/ForestryMC into mc-1.10 2016-09-11 10:51:16 +02:00
Nirek-K 7aa44fb1fa Fix #1413 phospor should give lava 2016-09-03 22:36:33 -05:00
Nedelosk 84fa956ce4 Improve greenhouse glass 2016-08-24 14:38:54 +02:00
Nedelosk 0c14a85c31 Adding new recipes and improve other recipes 2016-08-24 14:03:09 +02:00
Nedelosk a20fbbe60f Adding Greenhouse windows and climate control and improve recipes 2016-08-24 00:33:53 +02:00
mezz 27d932ee34 Do not allow rain tanks to be filled from the bottom 2016-08-18 18:47:32 -07:00
mezz 52b1784f25 Close #1400 Reduce frequency of End Hives 2016-08-17 21:11:24 -07:00
mezz 154f4f2712 Close #1398 Make wild bees friendlier to endermen 2016-08-17 21:03:35 -07:00
2097 changed files with 28033 additions and 25866 deletions

No files matched your search

+8 -17
View File
@@ -1,14 +1,7 @@
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'
@@ -16,11 +9,10 @@ buildscript {
}
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"
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'maven'
version = version_major + '.' + version_minor + '.' + version_patch + '.' + getBuildNumber()
@@ -71,7 +63,7 @@ dependencies {
deobfCompile "net.darkhax.tesla:Tesla:${tesla_version}"
deobfCompile "mezz.jei:jei_${mcversion}:${jei_version}:api"
runtime "mezz.jei:jei_${mcversion}:${jei_version}"
deobfCompile "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
// deobfCompile "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
}
configurations {
@@ -98,6 +90,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 +103,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'
}
}
+8 -8
View File
@@ -1,11 +1,11 @@
mcversion=1.10.2
forgeversion=12.18.1.2060
mcp_mappings=snapshot_20160525
mcversion=1.11.2
forgeversion=13.20.0.2201
mcp_mappings=snapshot_20161220
tesla_version=1.10.2-1.2.1.42
jei_version=3.8.1.242
ic2_version=2.6.38-ex110
tesla_version=1.11-1.3.0.51
jei_version=4.2.0.211
#ic2_version=2.6.76-ex110
version_major=5
version_minor=2
version_patch=9
version_minor=3
version_patch=0
+1 -1
Submodule lang updated: 4c93562cb9...d39f07201c.
-165
View File
@@ -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.
-11
View File
@@ -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
-11
View File
@@ -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;
-9
View File
@@ -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;
+39 -21
View File
@@ -10,22 +10,10 @@
******************************************************************************/
package forestry;
import javax.annotation.Nullable;
import java.io.File;
import forestry.plugins.compat.PluginIC2;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInterModComms;
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;
import com.google.common.base.Preconditions;
import forestry.api.core.ForestryAPI;
import forestry.core.EventHandlerCore;
import forestry.core.climate.ClimateEventHandler;
@@ -38,8 +26,22 @@ import forestry.core.gui.GuiHandler;
import forestry.core.multiblock.MultiblockEventHandler;
import forestry.core.network.PacketHandler;
import forestry.core.proxy.Proxies;
import forestry.core.utils.MigrationHelper;
import forestry.core.worldgen.WorldGenerator;
import forestry.plugins.PluginManager;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInterModComms;
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCEvent;
import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;
/**
* Forestry Minecraft Mod
@@ -51,14 +53,16 @@ import forestry.plugins.PluginManager;
name = "Forestry",
version = Constants.VERSION,
guiFactory = "forestry.core.config.ForestryGuiConfigFactory",
acceptedMinecraftVersions = "[1.10]",
dependencies = "required-after:Forge@[12.18.0.1989,);"
+ "after:JEI@[3.8.0,);"
+ "after:" + PluginIC2.modId + ";")
acceptedMinecraftVersions = "[1.11]",
dependencies = "required-after:forge@[13.19.1.2189,);"
+ "after:JEI@[4.1.1,);")
// + "after:" + PluginIC2.modId + ";")
public class Forestry {
@SuppressWarnings("NullableProblems")
@Mod.Instance(Constants.MOD_ID)
public static Forestry instance;
@Nullable
private File configFolder;
public Forestry() {
@@ -69,7 +73,13 @@ public class Forestry {
FluidRegistry.enableUniversalBucket();
}
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) {
@@ -86,10 +96,12 @@ public class Forestry {
PluginManager.runSetup(event);
ForestryAPI.activeMode = new GameMode(Config.gameMode);
String gameMode = Config.gameMode;
Preconditions.checkState(gameMode != null);
ForestryAPI.activeMode = new GameMode(gameMode);
PluginManager.runPreInit();
Proxies.render.registerModels();
}
@@ -123,6 +135,7 @@ public class Forestry {
PluginManager.serverStarting(event.getServer());
}
@Nullable
public File getConfigFolder() {
return configFolder;
}
@@ -131,4 +144,9 @@ public class Forestry {
public void processIMCMessages(IMCEvent event) {
PluginManager.processIMCMessages(event.getMessages());
}
@EventHandler
public void onMissingMappings(FMLMissingMappingsEvent event) {
MigrationHelper.onMissingMappings(event);
}
}
@@ -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);
@@ -9,13 +9,13 @@ import forestry.api.genetics.IAlleleEffect;
import forestry.api.genetics.IEffectData;
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 +23,11 @@ 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.
*/
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);
+13 -13
View File
@@ -5,18 +5,17 @@
******************************************************************************/
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;
/**
* Other implementations than Forestry's default one are not supported.
@@ -28,7 +27,6 @@ public interface IBee extends IIndividualLiving {
/**
* @return Bee's genetic information.
*/
@Nonnull
@Override
IBeeGenome getGenome();
@@ -51,7 +49,6 @@ public interface IBee extends IIndividualLiving {
/**
* Set the natural flag on this bee.
* @param flag
*/
void setIsNatural(boolean flag);
@@ -66,6 +63,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 +71,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,33 +5,33 @@
******************************************************************************/
package forestry.api.apiculture;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import forestry.api.core.IClimateProvider;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import com.mojang.authlib.GameProfile;
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, IClimateProvider {
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();
@@ -40,14 +40,14 @@ public interface IBeeHousing extends IHousing, IErrorLogicSource, IClimateProvid
boolean canBlockSeeTheSky();
/** Must not be named "getWorld" to avoid SpecialSource issue https://github.com/md-5/SpecialSource/issues/12 */
World getWorldObj();
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,17 +5,15 @@
******************************************************************************/
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;
/**
* Stores beekeeping logic for bee housings.
* Get one with BeeManager.beeRoot.createBeekeepingLogic(IBeeHousing housing)
@@ -27,6 +25,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();
@@ -75,6 +74,5 @@ public interface IBeekeepingLogic extends INbtWritable, INbtReadable {
* 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,10 +13,10 @@ 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);
@@ -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.
******************************************************************************/
@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;
@@ -98,8 +94,15 @@ public enum EnumForestryWoodType 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
@@ -5,16 +5,17 @@
******************************************************************************/
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;
import net.minecraft.util.text.translation.I18n;
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 +38,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,13 +64,20 @@ 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){
if (this == DARK_OAK) {
return "blocks/planks_big_oak";
}
return "blocks/planks_" + getName();
@@ -82,7 +85,7 @@ public enum EnumVanillaWoodType implements IWoodType {
@Override
public String getDoorLowerTexture() {
if(this == OAK){
if (this == OAK) {
return "blocks/door_wood_lower";
}
return "blocks/door_wood_lower";
@@ -90,7 +93,7 @@ public enum EnumVanillaWoodType implements IWoodType {
@Override
public String getDoorUpperTexture() {
if(this == OAK){
if (this == OAK) {
return "blocks/door_wood_upper";
}
return "blocks/door_" + getName() + "_upper";
@@ -98,7 +101,7 @@ public enum EnumVanillaWoodType implements IWoodType {
@Override
public String getBarkTexture() {
if(this == DARK_OAK){
if (this == DARK_OAK) {
return "blocks/log_big_oak";
}
return "blocks/log_" + getName();
@@ -106,7 +109,7 @@ public enum EnumVanillaWoodType implements IWoodType {
@Override
public String getHeartTexture() {
if(this == DARK_OAK){
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,55 @@
******************************************************************************/
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();
IWoodProvider getWoodProvider();
/* 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,23 @@
******************************************************************************/
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);
}
@@ -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,14 @@ public interface IGermlingModelProvider {
@SideOnly(Side.CLIENT)
void registerModels(Item item, IModelManager manager, EnumGermlingType type);
@Nonnull
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 +0,0 @@
/*******************************************************************************
* 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;
/**
* @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();
}
@@ -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,6 +14,7 @@ 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;
@@ -28,27 +28,24 @@ public interface ITree extends IIndividual, ITreeGenData {
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 +69,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,7 +5,6 @@
******************************************************************************/
package forestry.api.arboriculture;
import javax.annotation.Nonnull;
import java.awt.Color;
import forestry.api.genetics.IClassification;
@@ -16,22 +15,24 @@ public interface ITreeFactory {
* 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 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
* @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, @Nonnull IWoodProvider woodProvider, ITreeGenerator generator);
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, IWoodProvider woodProvider, ITreeGenerator generator);
/** Get one of the built-in Forestry leaf types. Default type is deciduous. */
/**
* 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,8 +5,6 @@
******************************************************************************/
package forestry.api.arboriculture;
import javax.annotation.Nonnull;
import forestry.api.genetics.IGenome;
public interface ITreeGenome extends IGenome {
@@ -17,7 +15,6 @@ public interface ITreeGenome extends IGenome {
@Override
IAlleleTreeSpecies getSecondary();
@Nonnull
IFruitProvider getFruitProvider();
float getHeight();
@@ -26,7 +23,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();
@@ -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,25 @@
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.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 +43,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 +66,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,22 +79,24 @@ 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
@@ -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();
}
@@ -24,7 +24,7 @@ public interface IWoodAccess {
ItemStack getStack(IWoodType woodType, WoodBlockKind kind, boolean fireproof);
IBlockState getBlock(IWoodType woodType, WoodBlockKind kind, boolean fireproof);
List<IWoodType> getRegisteredWoodTypes();
}
@@ -15,5 +15,5 @@ import net.minecraftforge.fml.relauncher.SideOnly;
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);
}
@@ -13,9 +13,9 @@ import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public interface IWoodStateMapper extends IStateMapper {
ModelResourceLocation getModelLocation(IBlockState state);
ModelResourceLocation getDefaultModelResourceLocation(IBlockState state);
}
@@ -13,15 +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();
}
@@ -3,8 +3,8 @@ package forestry.api.arboriculture;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMap;
import net.minecraftforge.client.model.IModel;
import net.minecraftforge.client.model.ModelProcessingHelper;
@@ -12,55 +12,55 @@ public enum WoodBlockKind {
LOG, PLANKS, SLAB, FENCE, FENCE_GATE, STAIRS, DOOR(false);
public final boolean retextureItem;
private WoodBlockKind() {
WoodBlockKind() {
this(true);
}
private WoodBlockKind(boolean retextureItem) {
WoodBlockKind(boolean retextureItem) {
this.retextureItem = retextureItem;
}
@Override
public String toString() {
return super.toString().toLowerCase(Locale.ENGLISH);
}
public IModel retextureModel(IModel model, IWoodType type, ImmutableMap<String, String> customTextures){
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;
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 ModelProcessingHelper.retexture(model, new ImmutableMap.Builder<String, String>().putAll(textures).build());
@@ -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,7 +5,6 @@
******************************************************************************/
package forestry.api.circuits;
import javax.annotation.Nonnull;
import java.util.List;
import forestry.api.core.INbtWritable;
@@ -26,13 +25,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);
}
@@ -3,15 +3,14 @@
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.arboriculture;
package forestry.api.climate;
import forestry.api.genetics.IAllele;
import forestry.api.core.ILocatable;
/**
* Simple allele encapsulating an {@link IGrowthProvider}.
*/
public interface IAlleleGrowth extends IAllele {
public interface IClimateControlProvider extends ILocatable {
IGrowthProvider getProvider();
IClimateInfo getControlClimate();
void setControlClimate(IClimateInfo climateControl);
}
@@ -3,7 +3,7 @@
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.core.climate;
package forestry.api.climate;
public interface IClimateControlled {
/**
@@ -0,0 +1,9 @@
package forestry.api.climate;
public interface IClimateInfo {
float getTemperature();
float getHumidity();
}
@@ -3,41 +3,39 @@
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.core.climate;
package forestry.api.climate;
import javax.annotation.Nullable;
import java.util.List;
import java.util.Map;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import forestry.api.core.IClimateProvider;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public interface IClimateManager {
float getTemperature(World world, BlockPos pos);
float getHumidity(World world, BlockPos pos);
IClimateInfo createInfo(float temperature, float humidity);
IClimateInfo getInfo(World world, BlockPos pos);
IClimateProvider getDefaultClimate(World world, BlockPos pos);
void addRegion(IClimateRegion region);
void removeRegion(IClimateRegion region);
void addSource(IClimateSource source);
void removeSource(IClimateSource source);
void addSource(IClimateSourceProvider source);
void removeSource(IClimateSourceProvider source);
void onWorldUnload(World world);
@Nullable
IClimatePosition getPosition(World world, BlockPos pos);
@Nullable
IClimateRegion getRegionForPos(World world, BlockPos pos);
@Nonnull
Map<Integer, List<IClimateRegion>> getRegions();
@Nonnull
Map<Integer, Map<BlockPos, IClimateSource>> getSources();
Map<World, List<IClimateRegion>> getRegions();
}
@@ -3,32 +3,33 @@
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.core.climate;
import javax.annotation.Nonnull;
package forestry.api.climate;
import forestry.api.core.INbtReadable;
import forestry.api.core.INbtWritable;
import net.minecraft.util.math.BlockPos;
/**
* A IClimatePosition contains the climate infos (temperature and humidity) of one position.
*/
public interface IClimatePosition extends INbtReadable, INbtWritable {
@Nonnull
IClimateRegion getClimateRegion();
@Nonnull
BlockPos getPos();
void setTemperature(float temperature);
void addTemperature(float temperature);
float getTemperature();
void setHumidity(float humidity);
void addHumidity(float humidity);
float getHumidity();
IClimateInfo getInfo();
}
@@ -0,0 +1,18 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.climate;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
import net.minecraft.world.biome.Biome;
public interface IClimateProvider {
Biome getBiome();
EnumTemperature getTemperature();
EnumHumidity getHumidity();
}
@@ -3,12 +3,10 @@
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.core.climate;
package forestry.api.climate;
import java.util.List;
import java.util.Map;
import javax.annotation.Nonnull;
import java.util.Collection;
import javax.annotation.Nullable;
import forestry.api.core.INbtReadable;
import forestry.api.core.INbtWritable;
@@ -16,20 +14,33 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public interface IClimateRegion extends INbtReadable, INbtWritable {
@Nonnull
World getWorld();
int getTicksPerUpdate();
void setPosition(BlockPos pos, float temperature, float humidity);
@Nullable
IClimatePosition getPosition(BlockPos pos);
Collection<IClimatePosition> getPositions();
void addSource(IClimateSource source);
void removeSource(IClimateSource source);
Collection<IClimateSource> getSources();
void calculateAverageClimate();
float getAverageTemperature();
float getAverageHumidity();
/**
* Update the climate in a region, all 20 world ticks.
* Update the climate in a region.
*/
void updateClimate();
@Nonnull
Map<BlockPos, IClimatePosition> getPositions();
int getTicksPerUpdate();
List<BlockPos> getOtherPositions();
void updateClimate(int ticks);
}
@@ -3,29 +3,28 @@
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.core.climate;
package forestry.api.climate;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import javax.annotation.Nullable;
/**
* A climate source is used to change the climate in a region.
*/
public interface IClimateSource {
/**
* @param tickCount The current tick count.
* @param region The climate region, in that the source stands.
* @param region The climate region, in that the source stands.
* @return Return true if the the climate has changed.
*/
void changeClimate(int tickCount, IClimateRegion region);
boolean changeClimate(int tickCount, IClimateRegion region);
/**
* @return The ticks that are required for one change.
*/
int getTicksForChange(IClimateRegion region);
World getWorld();
BlockPos getPos();
@Nullable
IClimateSourceProvider getProvider();
}
@@ -0,0 +1,18 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.climate;
import java.util.Set;
import forestry.api.core.ILocatable;
import net.minecraft.util.math.BlockPos;
public interface IClimateSourceProvider extends ILocatable {
IClimateSource getClimateSource();
Set<BlockPos> getPositionsInRange();
}
@@ -3,14 +3,16 @@
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.genetics;
package forestry.api.climate;
import java.util.EnumSet;
public interface IClimatiserDefinition {
import net.minecraftforge.common.EnumPlantType;
float getChange();
public interface IAllelePlantType extends IAllele {
float getRange();
EnumSet<EnumPlantType> getPlantTypes();
EnumClimatiserModes getMode();
EnumClimatiserTypes getType();
}
@@ -0,0 +1,14 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
@API(apiVersion = "2.1.0", owner = "Forestry", provides = "ForestryAPI|climate")
package forestry.api.climate;
import javax.annotation.ParametersAreNonnullByDefault;
import mcp.MethodsReturnNonnullByDefault;
import net.minecraftforge.fml.common.API;
Loaded 100 of 2097 files, more files were not shown because too many files have changed in this diff. Show more