Compare commits

..
168 Commits
Author SHA1 Message Date
Nedelosk 2b9b105211 Add deprecated circuit replacement and Version 5.8 2018-02-03 12:45:27 +01:00
Nedelosk 8b10349309 Merge pull request #1948 from ForestryMC/farm
Reintroduce the old-style farm and Rebalance electron tubes
2018-02-03 12:10:48 +01:00
Nedelosk 0d26b6b2f2 Merge pull request #1965 from temp1011/mc-1.12
Add IMC messages for dimension blacklist
2018-02-03 12:08:05 +01:00
temp1011 3e5de52efd fix imports 2018-02-02 00:18:41 +00:00
temp1011 e30e9f4ab9 Add IMC messages for mods to blacklist dimensions in 2018-02-02 00:07:59 +00:00
Nedelosk 05d1eb87ce Round fertilizer values 2018-01-28 22:54:35 +01:00
Nedelosk 7679dfc393 Make cultivation farms more expensive 2018-01-28 18:38:29 +01:00
Nedelosk bb52acc67c Fix #1955 Add Filter Sorting to fix a server sided bug 2018-01-23 16:24:56 +01:00
Nedelosk 3caf8cbfef Update Lang 2018-01-23 15:36:38 +01:00
Nedelosk 207f15ed0b Remove unneeded GL state changes 2018-01-23 15:29:30 +01:00
Nedelosk c5178be225 Add missing fluid handler capability to the planter 2018-01-22 19:54:14 +01:00
Nedelosk cd7250604e Add missing farm logic localisation 2018-01-22 18:56:25 +01:00
Nedelosk 533c9d0b2a Clean Up API 2018-01-20 21:29:07 +01:00
Nedelosk c00fa15f0e Improve fertilizer config and Clean Up 2018-01-20 21:00:21 +01:00
Nedelosk ce3dea42e3 Pull from branch 'mc-1.12' 2018-01-20 19:28:34 +01:00
Nedelosk 287cb8cb87 Rebalance electron tubes and add ender farm 2018-01-20 18:05:31 +01:00
Nedelosk 10fec50457 Improve Farm Logic System and add ring farm layout 2018-01-20 02:35:33 +01:00
Nedelosk 43c61c18c0 Fix broken model baker uvs 2018-01-15 19:23:54 +01:00
Nedelosk dca593f7d8 Fix #1945 Database duping trees / bees 2018-01-15 19:18:59 +01:00
Nedelosk 4c874fcf7d Update Lang 2018-01-15 19:12:54 +01:00
Nedelosk e62a2f1199 Merge branch 'mc-1.12' of https://github.com/ForestryMC/ForestryMC into pipe-1.12 2018-01-15 19:05:11 +01:00
Nedelosk 8ab94e6741 Improve genetic filter implementation 2018-01-15 19:03:52 +01:00
Nedelosk 1278c09064 Move the filter logic to a separate interface 2018-01-15 19:03:51 +01:00
Nedelosk ed0b884bce Change default filter rule 2018-01-15 19:03:50 +01:00
Nedelosk 85f413f857 Improve Filter collision box 2018-01-15 19:03:49 +01:00
Nedelosk 3cc298b0f1 Remove unused texture 2018-01-15 19:03:49 +01:00
Nedelosk 8b0d54f3ec Add sorting block (Genetic Filter) 2018-01-15 19:03:48 +01:00
temp1011 40445462f1 Add more Dimension Config Blacklists for world generation (#1942) 2018-01-14 12:16:36 -08:00
temp1011 8eea336fdb Removing overworked bees mechanic, cap production modifier at 16x (#1946) 2018-01-14 12:15:45 -08:00
Nedelosk 521514f3d2 Remove Unused Files 2018-01-14 02:53:56 +01:00
Nedelosk cc50a05f43 Reintroduce the old-style farm 2018-01-14 02:35:12 +01:00
Nedelosk 1fc56c3b20 Merge pull request #1941 from phillipasmith1995/mc-1.12
Adds dimension blacklist for hive generation.
2018-01-08 17:17:18 +01:00
phillipasmith1995 9cee882788 Adds dimension blacklist for hive generation. 2018-01-08 09:24:17 -06:00
phillipasmith1995 9404f769bb Merge branch 'mc-1.12' of https://github.com/phillipasmith1995/ForestryMC into mc-1.12
# Conflicts:
#	src/main/java/forestry/apiculture/HiveConfig.java
2018-01-08 09:21:51 -06:00
phillipasmith1995 7b8b317ffe Adds dimension blacklist for hive generation. 2018-01-08 09:18:49 -06:00
phillipasmith1995 b40a6d4ec9 Adds dimension blacklist for hive generation. 2018-01-08 00:52:34 -06:00
Nedelosk 42865951a9 Move the worktable into a separate module 2018-01-07 02:18:11 +01:00
Nedelosk a058c3f8c9 Merge remote-tracking branch 'origin/mc-1.12' into 1.12 2018-01-07 00:21:00 +01:00
Nedelosk a83e428d29 Merge pull request #1938 from temp1011/analyzerpowerconfig
Add power config for Analyzer
2018-01-07 00:20:37 +01:00
temp1011 9c41566485 Should be all of them (hopefully) 2018-01-06 23:18:34 +00:00
temp1011 842b9c7199 Add power config for analyzer 2018-01-06 22:51:36 +00:00
Nedelosk cbb0c15783 Fix #1061 Squeezer is very "liberal" regarding oredict in Recipes 2018-01-06 23:23:46 +01:00
Nedelosk cbc6f9acff Update Lang Git-Module 2018-01-06 22:39:08 +01:00
Nedelosk 03ecce51cc Fix #1937 Backpacks do not hold previously defined items 2018-01-06 22:33:29 +01:00
Nedelosk 644145ac92 Fix #1399 Add Hive Generation Blacklist 2018-01-06 22:19:37 +01:00
Nedelosk 850a7e2919 Fix #1884 Tin can / wax capsule cannot pick up fluid blocks in world 2018-01-06 20:56:15 +01:00
Nedelosk 1f54359836 Fix Crate Registration 2018-01-06 17:14:08 +01:00
Nedelosk debde28aba Merge remote-tracking branch 'origin/mc-1.12' into 1.12 2018-01-06 16:51:38 +01:00
Nedelosk a2aa07c917 Fix #1916 Client Crash with new version 2018-01-06 16:51:13 +01:00
Nedelosk 3c9572eb83 Fix #1874 Crash when adding bee to BQM quest / chestloot 2018-01-06 16:21:47 +01:00
Nedelosk 03fd954781 Merge pull request #1930 from temp1011/mc-1.12
Some minor additions
2018-01-06 16:07:20 +01:00
Nedelosk 2002dff3c9 Fix #1920 Crate registration only on client side 2018-01-06 15:57:16 +01:00
temp1011 d9ade6dae0 No biome check 2018-01-06 14:34:20 +00:00
Nedelosk 3b547c1b87 Fix #1919 Butterfly Model throws NullPointerException 2018-01-06 14:39:43 +01:00
Nedelosk 05070982dc Improve Database Recipe 2018-01-06 13:20:35 +01:00
temp1011 9833dbb01f Merge branch 'mc-1.12' into mc-1.12 2018-01-05 18:10:22 +00:00
temp1011 e67ef8adec Merge branch 'mc-1.12' into mc-1.12 2018-01-05 16:56:54 +00:00
temp1011 b5b4ff2de6 Fix hive flammability
Hive placed in the overworld burned whereas hive placed in nether did not in my tests. Hopefully this works better.
2018-01-05 16:13:40 +00:00
Nedelosk f78e21e31a Merge remote-tracking branch 'origin/mc-1.12' into 1.12 2018-01-05 16:42:56 +01:00
Nedelosk 457962c716 Fix #1932 Client Tile Updates Depending On Apiculture Module 2018-01-05 16:36:00 +01:00
temp1011 7a0dde1140 Woops 2018-01-02 20:36:16 +00:00
temp1011 5f7f7fbed6 add damage option to hives based on config 2017-12-30 23:24:45 +00:00
temp1011 c107c75cbe update config in apiculture 2017-12-30 23:22:19 +00:00
temp1011 8ed4fa8d7b make non hellish hives flammable 2017-12-30 00:09:41 +00:00
mezz 5a10d8a0b2 Fix "Invalid property value detected" error logs from Buildcraft 2017-12-26 19:30:14 -08:00
Nedelosk 16c3fae45d Fix #1918 Fix #1912 packet handler issue with latest Forge (14.23.1.2574+) 2017-12-18 20:25:21 +01:00
Nedelosk b3be6a8f02 Fix Broken Sockets 2017-12-17 16:07:12 +01:00
Nedelosk aac4d730d6 Merge remote-tracking branch 'origin/mc-1.12' into 1.12 2017-12-17 15:45:32 +01:00
Nedelosk dacd2741a3 Fix #1907 Electric engine doesn't update configuration properly 2017-12-17 15:41:01 +01:00
Nedelosk 2f47114015 Fix #1901 Custom Backpack Model Registration 2017-12-17 15:26:43 +01:00
Nedelosk b7ae349314 Fix #1906 Willow leaves can be used to create an x-ray 2017-12-17 10:38:20 +01:00
Remy A fbea338462 Fix resurrected ender dragons having no AI (#1908) 2017-12-12 21:48:56 -08:00
mezz b07e5a1556 Revert "Slightly improve render performance of genetic items (bee, trees, etc)"
This reverts commit 3df3d9121e.
2017-11-29 22:00:21 -08:00
Nedelosk 13f49fc930 Merge remote-tracking branch 'origin/mc-1.12' into 1.12 2017-11-24 00:04:05 +01:00
Nedelosk 3c4b025c74 Fix #1893 False Module Container ID 2017-11-24 00:03:41 +01:00
mezz 3df3d9121e Slightly improve render performance of genetic items (bee, trees, etc) 2017-11-11 22:04:39 -08:00
mezz 58ab49d66e Stop viscous fluids from making water flowing sounds 2017-11-11 20:51:27 -08:00
Nedelosk 37893d8aca Fix #1890 NPE with Quark 2017-11-08 20:33:59 +01:00
Nedelosk 9814601ff2 Fix backward compatibility 2017-11-03 23:10:10 +01:00
Nedelosk 11e8a06a48 Clean Up Module System 2017-11-03 22:38:13 +01:00
Nedelosk 26f44a2862 Fix Module System 2017-11-03 21:34:21 +01:00
Nedelosk 3073473b0e Fix Api 2017-11-03 19:55:25 +01:00
Nedelosk 61af8ba6c9 Improve Module System 2017-11-03 18:40:44 +01:00
Nedelosk 3e60c43b30 Merge remote-tracking branch 'origin/mc-1.12' into mc-1.12 2017-11-03 17:01:50 +01:00
Nedelosk e9ae149ba2 Fix GreenhouseEventHandler 2017-11-03 16:58:31 +01:00
Nedelosk b62ec72422 Change the plugin system to a module system and split up modules
-Changed plugin system to a module
-Renamed forestry plugins to modules
-Mod integration plugins are still called plugins
-Moved the woodpile from the arboriculture module to the charcoal module
-Moved the backpacks from the storage module to the backpacks module
-Moved the crates from the storage module to the creates module
-Added the database module with a new storage block for individuals
-Added a species plugin interface to handle the database gui
-Added some alyzer methods to the species plugin to move the alyzer
integration later to it
2017-11-03 16:56:02 +01:00
Nedelosk 50ef3d8b2c Update Lang 2017-11-03 16:46:09 +01:00
Nedelosk a0e15f76ca Move some classes to the api and fix broken api classes 2017-11-03 16:09:17 +01:00
Nedelosk e7766d3ad9 Remove experimental code 2017-11-02 16:12:06 +01:00
Nedelosk 4e096e7338 Remove unused resources 2017-11-02 16:06:17 +01:00
Nedelosk 88fd031fb4 Change the plugin system to a module system and slit up modules
-Moved the woodpile from the arboriculture module to the charcoal module
-Moved the backpacks from the storage module to the backpacks module
-Moved the crates from the storage module to the creates module
-Added the database module with a new storage for individuals
-Added a gui element system to improve the alyzer api
-Added a species plugin interface to handle the database gui
-Added some alyzer methods to the species plugin to move the alyzer
integration later to it
2017-11-02 16:03:33 +01:00
Nedelosk ee272de168 Fix #1866 Block State Interaction Issues With Pokecube and Forestry 2017-10-12 11:55:06 +02:00
Nedelosk 1faaa6e297 Merge remote-tracking branch 'origin/mc-1.12' into mc-1.12 2017-10-07 14:44:34 +02:00
Nedelosk 6c86447891 Fix Mystical Agriculture Inferium Seeds and update Integration 2017-10-07 14:41:13 +02:00
Nedelosk 905e81c2b9 Fix #1860 Mystical Agriculture Integration (Could not find item) 2017-10-07 14:25:20 +02:00
Nedelosk 25bb682f7d Fix #1856 Non Glass Fluids in Thermionic Fabricator are not getting used up. 2017-10-07 14:15:38 +02:00
Nedelosk 18e10f617c Fix #1863 Bottler does not empty bottles 2017-10-07 14:08:30 +02:00
mezz e0a0ab5594 Add modId to alleles and use new Forge item.getCreatorModId feature 2017-10-03 00:03:46 -07:00
Nedelosk 29d96db1e8 Merge remote-tracking branch 'origin/mc-1.12' into mc-1.12 2017-09-30 16:16:12 +02:00
Nedelosk 3769ec42d2 Fix #1857 Couldn't find resource table forestry:chests/village_naturalist 2017-09-30 16:15:52 +02:00
mezz d0c1133304 Update for 1.12.2 2017-09-18 20:33:56 -07:00
Nedelosk c3ff59fbfb Remove expensive check 2017-09-18 15:26:03 +02:00
Nedelosk aa52b063b7 Fix two Greenhouse Crashes 2017-09-18 15:08:58 +02:00
Nedelosk a74b3c87c4 Fix #1854 Crash on load if the greenhouse plugin is disabled 2017-09-18 13:50:07 +02:00
Nedelosk 6c38a6a28e Fix Greenhouse Climatisers 2017-09-15 13:50:38 +02:00
Nedelosk db49d305f4 Add PreInit Event to the Api 2017-09-10 16:14:32 +02:00
Nedelosk 5df7b9252b Remove Error Message 2017-09-10 01:26:00 +02:00
Nedelosk f4d0979bb1 Fix Climate Sources 2017-09-10 00:20:50 +02:00
Nedelosk 199200cb01 Fix #1425 Add Milk Capsule Cake Recipe 2017-09-09 22:24:37 +02:00
Nedelosk 419cebef33 Fix #1680 Display almost all butterflies 2017-09-09 20:44:19 +02:00
Nedelosk 716167e3ec Fix #1375 Split up the loot tables for every plugin 2017-09-09 20:18:19 +02:00
Nedelosk 60debc45f3 Update Lang 2017-09-09 01:12:03 +02:00
Nedelosk 2c04d42717 Improve Climate Source Circuits 2017-09-09 00:45:38 +02:00
Nedelosk 9e21ed9670 Update Version and Forge 2017-09-08 22:56:48 +02:00
Nedelosk 095e710bec Merge branch 'mc-1.12' of https://github.com/ForestryMC/ForestryMC into Greenhouse 2017-09-08 22:48:31 +02:00
Nedelosk 888c5268d5 Merge branch 'mc-1.12' of https://github.com/ForestryMC/ForestryMC into Greenhouse 2017-09-08 22:48:13 +02:00
Nedelosk 1180c16f45 Improve Climate Sources 2017-09-08 22:43:24 +02:00
mezz dea1fb144a Fix #1434 Fix #1551 Make hives spawn existing flowers only, up to 10 2017-09-07 23:41:59 -07:00
mezz a01190a242 Fix #1679 use fractions of world height to define ore generation levels 2017-09-07 21:41:15 -07:00
mezz 0ebced9609 Fix #1845 API has references to internal classes 2017-09-07 19:23:59 -07:00
Nedelosk ab4489c5aa Improve Climate Modifier Widget 2017-09-07 16:44:28 +02:00
Nedelosk d2ea1d820c Add Climate Modifier Widget 2017-09-07 15:23:43 +02:00
Nedelosk 4d0dfd837e Make Climate state creation only accessible through ClimateStates 2017-09-06 19:33:13 +02:00
Nedelosk e07f10d981 Clean Up Greenhouse Climate 2017-09-06 17:38:00 +02:00
Nedelosk d48e9484b8 Merge branch 'mc-1.12' of https://github.com/ForestryMC/ForestryMC into Greenhouse 2017-09-06 16:27:11 +02:00
Nedelosk 3aa328a522 Clean Up Climatisers 2017-09-02 18:07:46 +02:00
Nedelosk 2b0f5bfdf4 Clean Up 2017-09-02 17:28:13 +02:00
Nedelosk bbe6f919c4 Merge branch 'mc-1.12' of https://github.com/ForestryMC/ForestryMC into mc-1.12 2017-09-02 16:01:22 +02:00
Nedelosk 4441d78eb2 Improve Time Modifier 2017-09-02 15:56:10 +02:00
Nedelosk 6d774de5a6 Clean Up Climate Bar 2017-09-01 12:49:29 +02:00
Nedelosk 0a2ca1febc Fix Camouflage 2017-08-31 17:19:51 +02:00
Nedelosk 6d3ff67efd Fix Greenhouse Target State NPE 2017-08-31 16:47:08 +02:00
Nedelosk d37a52dcf4 Merge branch 'mc-1.12' of https://github.com/ForestryMC/ForestryMC into mc-1.12 2017-08-31 16:38:20 +02:00
Nedelosk c03fa0e955 Improve Climate State 2017-08-31 16:29:46 +02:00
Nedelosk 66f0da433e Fix Targeted state 2017-08-29 19:08:26 +02:00
Nedelosk d8c8aec2ee Move Climate Bar to the top of the gui 2017-08-21 21:16:36 +02:00
Nedelosk 38189388f6 Move Greenhouse classes out of the api 2017-08-14 20:57:34 +02:00
Nedelosk 8bb1b74b1c Merge branch 'Greenhouse' of https://github.com/ForestryMC/ForestryMC into mc-1.12 2017-08-14 19:58:11 +02:00
Nedelosk 465d32af25 Merge branch 'mc-1.12' of https://github.com/ForestryMC/ForestryMC into mc-1.12 2017-08-14 19:57:20 +02:00
Nedelosk 13b8a023a3 Merge branch 'mc-1.11' into Greenhouse 2017-08-14 19:55:09 +02:00
Nedelosk 54ca3488df Update Greenhouse Code to 1.12 2017-08-14 19:51:09 +02:00
Nedelosk 26bf69effc Merge branch 'Greenhouse' of https://github.com/ForestryMC/ForestryMC into mc-1.12 2017-08-14 19:50:34 +02:00
mezz 8f29faa28a Fix #1787 Wood logs drop the wrong item when harvested with silk touch 2017-08-12 12:37:11 -07:00
mezz 1e6716f8ec #1687 Fix crash when genetics items are missing nbt 2017-08-06 12:13:37 -07:00
mezz 787395494c Fix tree generation with Mystcraft 2017-07-29 21:35:50 -07:00
Nedelosk b0b6ffb963 Remove unused code 2017-07-30 01:57:33 +02:00
Nedelosk d3d57ab0df Clean Up 2017-07-30 01:40:27 +02:00
Nedelosk 375515937d Cache Overlay Model 2017-07-30 01:22:51 +02:00
Nedelosk 6c869cab98 Add climate data 2017-07-29 22:40:56 +02:00
Nedelosk 212f857692 Add ash recipe 2017-07-29 22:05:20 +02:00
Nedelosk c40adda51c Fix PluginCore 2017-07-29 17:48:05 +02:00
Nedelosk 35f7ba6153 Merge branch 'mc-1.11' of https://github.com/ForestryMC/ForestryMC into Greenhouse 2017-07-29 17:46:36 +02:00
Nedelosk 327b7bba87 Improve Greenhouse and fix Wood Pile 2017-07-29 17:38:47 +02:00
mezz 694cd8103a Fix client visual glitch with worktable 2017-07-29 00:52:48 -07:00
mezz f50e7281c5 Fix serious issues with the worktable
Fix #1677 Fix #1768 Fix #1558 Fix #1519 Fix #1403
2017-07-29 00:52:48 -07:00
Nedelosk 1034111985 Fix #1772 crash if forestry.factory=false 2017-07-28 00:12:01 +02:00
Nedelosk 0c27bf850c Add OreDictionary support for the Fermenter 2017-07-27 15:40:52 +02:00
Nedelosk 78489a6146 Fix Fertilizer Config from 1.10 to 1.11 / 1.12 2017-07-25 15:59:37 +02:00
Nedelosk b4db0f32e4 Fix #1731 All 45 slot backpacks have localisation issues. 2017-07-24 02:06:58 +02:00
Nedelosk 8ad42a8918 Fix #1686 1.11.2 Config changes in GUI reset to values in file 2017-07-24 01:59:01 +02:00
Nedelosk 96ed44a186 Add Better with Mods Integration and Fix IE, Roots and Rustic Integration 2017-07-24 00:12:36 +02:00
Nedelosk 4e17804997 Add Roots Integration 2017-07-23 21:39:16 +02:00
Nedelosk e391d06f32 Add Rustic Integration 2017-07-23 20:37:56 +02:00
Nedelosk 353fcb1ba7 Port Mystical Agriculture Integration 2017-07-23 17:35:23 +02:00
Nedelosk 322327e1f4 Update Update formatting-settings.jar
- Changed CONTINUATION_INDENT_SIZE from 8 to 4
2017-07-16 13:46:14 +02:00
Nedelosk c2ca77ecae Update formatting-settings.jar 2017-07-15 18:00:34 +02:00
mezz 441f57d027 Test using deobfProvided instead of deobfCompile 2017-07-13 22:42:01 -07:00
mezz 2e0bb5a3b2 Fix JEI dependency info 2017-07-09 21:03:29 -07:00
994 changed files with 31894 additions and 12642 deletions

No files matched your search

-1
View File
@@ -161,7 +161,6 @@ curseforge {
changelog = file('changelog.html')
changelogType = 'html'
releaseType = 'beta'
addGameVersion '1.12'
}
}
Binary file not shown.
Executable → Regular
+7 -7
View File
@@ -1,14 +1,14 @@
mcversion=1.12.1
forgeversion=14.22.0.2469
mcp_mappings=snapshot_20170904
mcversion=1.12.2
forgeversion=14.23.1.2582
mcp_mappings=snapshot_20170918
curse_project_id=59751
tesla_version=1.0.60
tesla_mcversion=1.12
jei_version=4.7.8.92
jei_mcversion=1.12.1
jei_version=4.8.5.138
jei_mcversion=1.12.2
ic2_version=2.8.24-ex112
version_major=5
version_minor=5
version_patch=2
version_minor=8
version_patch=0
+1 -1
Submodule lang updated: 192d6f8584...c560d52707.
+36 -16
View File
@@ -15,9 +15,11 @@ import com.google.common.base.Preconditions;
import javax.annotation.Nullable;
import java.io.File;
import forestry.plugins.compat.PluginNatura;
import net.minecraft.item.Item;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fml.common.Mod;
@@ -28,13 +30,16 @@ import net.minecraftforge.fml.common.event.FMLInterModComms.IMCEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;
import forestry.api.core.ForestryAPI;
import forestry.api.core.ForestryEvent;
import forestry.core.EventHandlerCore;
import forestry.core.climate.ClimateEventHandler;
import forestry.core.advancements.AdvancementManager;
import forestry.core.climate.ClimateStates;
import forestry.core.config.Config;
import forestry.core.config.Constants;
import forestry.core.config.GameMode;
@@ -45,8 +50,11 @@ import forestry.core.multiblock.MultiblockEventHandler;
import forestry.core.network.PacketHandler;
import forestry.core.proxy.Proxies;
import forestry.core.worldgen.WorldGenerator;
import forestry.plugins.PluginManager;
import forestry.plugins.compat.PluginIC2;
import forestry.modules.ForestryModules;
import forestry.modules.ModuleManager;
import forestry.plugins.ForestryCompatPlugins;
import forestry.plugins.PluginIC2;
import forestry.plugins.PluginNatura;
/**
* Forestry Minecraft Mod
@@ -58,11 +66,12 @@ import forestry.plugins.compat.PluginIC2;
name = Constants.MOD_NAME,
version = Constants.VERSION,
guiFactory = "forestry.core.config.ForestryGuiConfigFactory",
acceptedMinecraftVersions = "[1.12, 1.12.1]",
dependencies = "required-after:forge@[14.21.1.2395,);"
acceptedMinecraftVersions = "[1.12.2,1.13.0)",
dependencies = "required-after:forge@[14.23.0.2500,);"
+ "after:jei@[4.7.8.91,);"
+ "after:" + PluginIC2.modId + ";"
+ "after:" + PluginNatura.modId + ";")
+ "after:" + PluginNatura.modId + ";"
+ "after:toughasnails;")
public class Forestry {
@SuppressWarnings("NullableProblems")
@@ -75,9 +84,13 @@ public class Forestry {
ForestryAPI.instance = this;
ForestryAPI.forestryConstants = new Constants();
ForestryAPI.errorStateRegistry = new ErrorStateRegistry();
ForestryAPI.states = ClimateStates.INSTANCE;
EnumErrorCode.init();
FluidRegistry.enableUniversalBucket();
MinecraftForge.EVENT_BUS.register(this);
ModuleManager moduleManager = ModuleManager.getInstance();
ForestryAPI.moduleManager = moduleManager;
moduleManager.registerContainers(new ForestryModules(), new ForestryCompatPlugins());
}
@Nullable
@@ -96,25 +109,31 @@ public class Forestry {
EventHandlerCore eventHandlerCore = new EventHandlerCore();
MinecraftForge.EVENT_BUS.register(eventHandlerCore);
MinecraftForge.EVENT_BUS.register(new MultiblockEventHandler());
MinecraftForge.EVENT_BUS.register(new ClimateEventHandler());
MinecraftForge.EVENT_BUS.register(Config.class);
Proxies.common.registerEventHandlers();
configFolder = new File(event.getModConfigurationDirectory(), Constants.MOD_ID);
Config.load(event.getSide());
PluginManager.runSetup(event);
MinecraftForge.EVENT_BUS.post(new ForestryEvent.PreInit(this, event));
ModuleManager.runSetup(event);
ModuleManager.getInternalHandler().runSetup();
String gameMode = Config.gameMode;
Preconditions.checkState(gameMode != null);
ForestryAPI.activeMode = new GameMode(gameMode);
PluginManager.runPreInit(event.getSide());
ModuleManager.getInternalHandler().runPreInit(event.getSide());
}
@SubscribeEvent(priority = EventPriority.LOWEST)
public void registerItems(RegistryEvent.Register<Item> event) {
ModuleManager.getInternalHandler().runRegisterBackpacksAndCrates();
}
@SubscribeEvent
public void registerModels(ModelRegistryEvent event) {
PluginManager.runRegisterBackpacksAndCrates();
Proxies.render.registerModels();
}
@@ -123,14 +142,15 @@ public class Forestry {
// Register gui handler
NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler());
PluginManager.runInit();
ModuleManager.getInternalHandler().runInit();
Proxies.render.registerItemAndBlockColors();
AdvancementManager.registerTriggers();
}
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
PluginManager.runPostInit();
ModuleManager.getInternalHandler().runPostInit();
// Register world generator
WorldGenerator worldGenerator = new WorldGenerator();
@@ -140,12 +160,12 @@ public class Forestry {
Proxies.common.registerTickHandlers(worldGenerator);
// Handle IMC messages.
PluginManager.processIMCMessages(FMLInterModComms.fetchRuntimeMessages(ForestryAPI.instance));
ModuleManager.getInternalHandler().processIMCMessages(FMLInterModComms.fetchRuntimeMessages(ForestryAPI.instance));
}
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
PluginManager.serverStarting(event.getServer());
ModuleManager.serverStarting(event.getServer());
}
@Nullable
@@ -155,6 +175,6 @@ public class Forestry {
@EventHandler
public void processIMCMessages(IMCEvent event) {
PluginManager.processIMCMessages(event.getMessages());
ModuleManager.getInternalHandler().processIMCMessages(event.getMessages());
}
}
@@ -1,3 +1,8 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.apiculture;
import net.minecraftforge.common.capabilities.Capability;
@@ -9,15 +9,19 @@ import javax.annotation.Nullable;
import java.util.List;
import java.util.Set;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import forestry.api.core.IErrorState;
import forestry.api.genetics.IEffectData;
import forestry.api.genetics.IIndividual;
import forestry.api.genetics.IIndividualLiving;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
/**
* Other implementations than Forestry's default one are not supported.
@@ -85,8 +89,27 @@ public interface IBee extends IIndividualLiving {
List<IBee> spawnDrones(IBeeHousing housing);
/**
* @deprecated since Forestry 5.5.4. Use {@link #plantFlowerRandom(IBeeHousing, List)}
*/
@Deprecated
void plantFlowerRandom(IBeeHousing housing);
/**
* Plants a random flower from the given list near the housing
*
* @param housing the location the bee is living
* @param potentialFlowers the flowers to choose from
* @return the position of the planted flower, or null of none were planted
* @since Forestry 5.5.4
*/
@Nullable
default BlockPos plantFlowerRandom(IBeeHousing housing, List<IBlockState> potentialFlowers) {
//noinspection deprecation
plantFlowerRandom(housing);
return null;
}
@Nullable
IIndividual retrievePollen(IBeeHousing housing);
@@ -14,6 +14,7 @@ public interface IBeeFactory {
* Automatically registered with AlleleManager.alleleRegistry.registerAllele()
* See IAlleleBeeSpeciesBuilder and IAlleleSpeciesBuilder for adding additional properties to the returned species.
*
* @param modId The modId of the mod that is creating the species
* @param uid Unique Identifier for this species
* @param dominant Whether this species is genetically dominant (false means it is recessive)
* @param authority Authority for the binomial name, e.g. "Sengir" on species of base Forestry.
@@ -24,8 +25,9 @@ public interface IBeeFactory {
* @param primaryColor The outline color of this species
* @param secondaryColor The body color of this species
* @return a new bee species allele.
* @since Forestry 5.6.0.
*/
IAlleleBeeSpeciesBuilder createSpecies(String uid, boolean dominant, String authority, String unlocalizedName, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor);
IAlleleBeeSpeciesBuilder createSpecies(String modId, String uid, boolean dominant, String authority, String unlocalizedName, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor);
/**
* Creates a new bee branch.
@@ -36,4 +38,10 @@ public interface IBeeFactory {
* @return a new bee branch
*/
IClassification createBranch(String uid, String scientific);
/**
* @deprecated since Forestry 5.6.0. use {@link #createSpecies(String, String, boolean, String, String, String, IClassification, String, int, int)}
*/
@Deprecated
IAlleleBeeSpeciesBuilder createSpecies(String uid, boolean dominant, String authority, String unlocalizedName, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor);
}
@@ -8,23 +8,24 @@ package forestry.api.apiculture;
import java.io.IOException;
import java.util.List;
import forestry.api.core.INbtReadable;
import forestry.api.core.INbtWritable;
import forestry.core.network.IStreamable;
import forestry.core.network.PacketBufferForestry;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import forestry.api.core.INbtReadable;
import forestry.api.core.INbtWritable;
/**
* Stores beekeeping logic for bee housings.
* Get one with BeeManager.beeRoot.createBeekeepingLogic(IBeeHousing housing)
* Save and load it to NBT using the INbtWritable methods.
*/
public interface IBeekeepingLogic extends INbtWritable, INbtReadable, IStreamable {
public interface IBeekeepingLogic extends INbtWritable, INbtReadable {
/* SERVER */
@@ -83,13 +84,11 @@ public interface IBeekeepingLogic extends INbtWritable, INbtReadable, IStreamabl
*/
List<BlockPos> getFlowerPositions();
@Override
default void readData(PacketBufferForestry data) throws IOException {
default void readData(PacketBuffer data) throws IOException {
}
@Override
default void writeData(PacketBufferForestry data) {
default void writeData(PacketBuffer data) {
}
}
@@ -37,10 +37,15 @@ public interface IBeekeepingMode {
*/
boolean isFatigued(IBee queen, IBeeHousing housing);
/**
* @return true if the queen is being overworked in the bee housing (with chance). will trigger a negative effect.
/**
* @return true if the queen is being overworked in the bee housing (with chance). will trigger a negative effect.
* @deprecated bees max out at 16x productivity instead of being overworked.
* TODO remove this method in 1.13
*/
boolean isOverworked(IBee queen, IBeeHousing housing);
@Deprecated
default boolean isOverworked(IBee queen, IBeeHousing housing) {
return false;
}
/**
* @return true if the genetic structure of the queen is breaking down during spawning of the offspring (with chance). will trigger a negative effect.
@@ -1,3 +1,8 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.apiculture;
import net.minecraft.entity.player.EntityPlayer;
@@ -8,9 +8,10 @@ package forestry.api.apiculture.hives;
import java.util.List;
import java.util.Locale;
import forestry.api.apiculture.IHiveDrop;
import net.minecraft.util.IStringSerializable;
import forestry.api.apiculture.IHiveDrop;
public interface IHiveRegistry {
/* Forestry Hive Names */
@@ -1,9 +1,15 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.arboriculture;
import forestry.api.core.IArmorNaturalist;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityInject;
import forestry.api.core.IArmorNaturalist;
public class ArboricultureCapabilities {
/**
* Capability for {@link IArmorNaturalist}.
@@ -5,9 +5,10 @@
******************************************************************************/
package forestry.api.arboriculture;
import net.minecraft.util.text.translation.I18n;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IFruitFamily;
import forestry.core.utils.Translator;
public enum EnumFruitFamily implements IFruitFamily {
PRUNES("prunes", "Prunus domestica"),
@@ -37,12 +38,12 @@ public enum EnumFruitFamily implements IFruitFamily {
@Override
public String getName() {
return Translator.translateToLocal("for.family." + uid);
return I18n.translateToLocal("for.family." + uid);
}
@Override
public String getDescription() {
return Translator.translateToLocal("for.family." + uid + ".description");
return I18n.translateToLocal("for.family." + uid + ".description");
}
}
@@ -1,3 +1,8 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.arboriculture;
import java.util.Locale;
@@ -19,6 +19,4 @@ public interface IAlleleFruit extends IAlleleProperty<IAlleleFruit> {
@Nullable
String getModelName();
String getModID();
}
@@ -7,15 +7,18 @@ package forestry.api.arboriculture;
import java.util.Collection;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.common.EnumPlantType;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import forestry.api.core.IModelManager;
import forestry.api.genetics.IAlleleProperty;
import forestry.api.genetics.IAlleleSpecies;
import forestry.api.genetics.IFruitFamily;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.common.EnumPlantType;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public interface IAlleleTreeSpecies extends IAlleleSpecies, IAlleleProperty<IAlleleTreeSpecies> {
@@ -36,11 +39,6 @@ public interface IAlleleTreeSpecies extends IAlleleSpecies, IAlleleProperty<IAll
* @return Tree generator for this species.
*/
ITreeGenerator getGenerator();
/**
* @return The modid from the mod of the species.
*/
String getModID();
/**
* @return Float between 0 and 1 representing the rarity of the species, will affect spawn rate. If it's 0, it will not spawn.
@@ -14,7 +14,10 @@ public interface ICharcoalPileWall {
int getCharcoalAmount();
boolean matches(IBlockState state);
@Deprecated
NonNullList<ItemStack> getDisplyItems();
NonNullList<ItemStack> getDisplayItems();
}
@@ -1,6 +1,6 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.arboriculture;
@@ -5,32 +5,12 @@
******************************************************************************/
package forestry.api.arboriculture;
import javax.annotation.Nullable;
import java.awt.Color;
import forestry.api.genetics.IClassification;
public interface ITreeFactory {
/**
* Creates a new tree species.
* Automatically registered with AlleleManager.alleleRegistry.registerAllele()
* See IAlleleTreeSpeciesBuilder and IAlleleSpeciesBuilder for adding additional properties to the returned species.
*
* @param uid Unique Identifier for this species
* @param unlocalizedName Unlocalized name for this species
* @param authority Authority for the binomial name, e.g. "Sengir" on species of base Forestry.
* @param unlocalizedDescription Unlocalized description for this species
* @param dominant Whether this species is genetically dominant (false means it is recessive)
* @param branch Classification of this species
* @param binomial Binomial name of the species sans genus. "humboldti" will have the bee species flavour name be "Apis humboldti". Feel free to use fun names or null.
* @param modID The modID from the mod of the species
* @param leafSpriteProvider The leaf sprite provider for this species
* @param germlingModelProvider The germling model provider for this species
* @param woodProvider The wood texture provider. It is used to get wood textures for the charcoal pile.
* @param generator The tree generator
* @return a new tree species allele.
*/
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, IWoodProvider woodProvider, ITreeGenerator generator);
/**
* Creates a new tree species.
* Automatically registered with AlleleManager.alleleRegistry.registerAllele()
@@ -48,10 +28,18 @@ public interface ITreeFactory {
* @param germlingModelProvider The germling model provider for this species
* @param woodProvider The wood texture provider. It is used to get wood textures for the charcoal pile.
* @param generator The tree generator
* @param leafProvider The leaf provider
* @return a new tree species allele.
*/
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, IWoodProvider woodProvider, ITreeGenerator generator, ILeafProvider leafProvider);
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, IWoodProvider woodProvider, ITreeGenerator generator, @Nullable ILeafProvider leafProvider);
/**
* @deprecated since Forestry 5.6.0. use {@link #createSpecies(String, String, String, String, boolean, IClassification, String, String, ILeafSpriteProvider, IGermlingModelProvider, IWoodProvider, ITreeGenerator, ILeafProvider)}
*/
@Deprecated
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, IWoodProvider woodProvider, ITreeGenerator generator);
/**
* Get one of the built-in Forestry leaf types. Default type is deciduous.
*/
@@ -5,9 +5,10 @@
******************************************************************************/
package forestry.api.arboriculture;
import forestry.api.genetics.IGenome;
import net.minecraft.item.ItemStack;
import forestry.api.genetics.IGenome;
public interface ITreeGenome extends IGenome {
@Override
@@ -37,6 +38,8 @@ public interface ITreeGenome extends IGenome {
int getGirth();
boolean getFireproof();
IAlleleLeafEffect getEffect();
/**
@@ -9,16 +9,18 @@ import javax.annotation.Nullable;
import java.util.Collection;
import java.util.List;
import com.mojang.authlib.GameProfile;
import forestry.api.genetics.IAllele;
import forestry.api.genetics.IChromosome;
import forestry.api.genetics.IFruitFamily;
import forestry.api.genetics.ISpeciesRootPollinatable;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import com.mojang.authlib.GameProfile;
import forestry.api.genetics.IAllele;
import forestry.api.genetics.IChromosome;
import forestry.api.genetics.IFruitFamily;
import forestry.api.genetics.ISpeciesRootPollinatable;
public interface ITreeRoot extends ISpeciesRootPollinatable {
@Override
@@ -5,13 +5,15 @@
******************************************************************************/
package forestry.api.arboriculture;
import forestry.api.core.ITextureManager;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import forestry.api.core.ITextureManager;
public interface IWoodProvider {
@SideOnly(Side.CLIENT)
void registerSprites(Item item, ITextureManager manager);
@@ -29,11 +31,15 @@ public interface IWoodProvider {
/**
* The amount of charcoal dropped from a charcoal pile of this wood.
* @deprecated Will be removed in 1.13
*/
@Deprecated
int getCarbonization();
/**
* The chance that a pile has to drop a extra charcoal
* @deprecated Will be removed in 1.13
*/
@Deprecated
float getCharcoalChance(int numberOfCharcoal);
}
@@ -1,3 +1,8 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.arboriculture;
import net.minecraft.util.IStringSerializable;
@@ -1,3 +1,8 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.arboriculture;
import com.google.common.collect.ImmutableMap;
@@ -5,10 +5,11 @@
******************************************************************************/
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
@API(apiVersion = "4.2.1", owner = "ForestryAPI|core", provides = "ForestryAPI|arboriculture")
@API(apiVersion = "4.3.0", owner = "ForestryAPI|core", provides = "ForestryAPI|arboriculture")
package forestry.api.arboriculture;
import javax.annotation.ParametersAreNonnullByDefault;
import mcp.MethodsReturnNonnullByDefault;
import net.minecraftforge.fml.common.API;
import mcp.MethodsReturnNonnullByDefault;
@@ -8,6 +8,7 @@ package forestry.api.circuits;
public enum CircuitSocketType implements ICircuitSocketType {
NONE("none"),
FARM("forestry.farm"),
GREENHOUSE_CLIMATISER("forestry.greenhouse.climatiser"),
ELECTRIC_ENGINE("forestry.electric.engine"),
MACHINE("forestry.machine");
@@ -7,11 +7,17 @@ package forestry.api.circuits;
import java.util.List;
import net.minecraft.util.text.translation.I18n;
public interface ICircuit {
String getUID();
String getUnlocalizedName();
default String getLocalizedName(){
return I18n.translateToLocal(getUnlocalizedName());
}
boolean isCircuitable(Object tile);
void onInsertion(int slot, Object tile);
@@ -18,6 +18,8 @@ public interface ICircuitRegistry {
void registerCircuit(ICircuit circuit);
void registerDeprecatedCircuitReplacement(String deprecatedCircuit, ICircuit replacement);
@Nullable
ICircuit getCircuit(String uid);
@@ -0,0 +1,24 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.climate;
import net.minecraft.util.math.MathHelper;
public enum ClimateStateType {
DEFAULT(0.0F, 2.0F),
EXTENDED(-3.0F, 3.0F);
public final float boundDown, boundUp;
ClimateStateType(Float boundDown, Float boundUp) {
this.boundDown = boundDown;
this.boundUp = boundUp;
}
public float clamp(float value) {
return MathHelper.clamp(value, boundDown, boundUp);
}
}
@@ -5,14 +5,13 @@
******************************************************************************/
package forestry.api.climate;
public interface IClimatiserDefinition {
import java.util.Locale;
float getChange();
float getRange();
EnumClimatiserModes getMode();
EnumClimatiserTypes getType();
public enum ClimateType {
TEMPERATURE, HUMIDITY;
public String getName(){
return name().toLowerCase(Locale.ENGLISH);
}
}
@@ -1,7 +0,0 @@
package forestry.api.climate;
public enum EnumClimatiserModes {
POSITIVE, NEGATIVE, BOTH
}
@@ -1,7 +0,0 @@
package forestry.api.climate;
public enum EnumClimatiserTypes {
TEMPERATURE, HUMIDITY, BOTH
}
@@ -1,22 +0,0 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.climate;
public interface IClimateControl {
IClimateInfo getControlClimate();
void setControlClimate(IClimateInfo climateInfo);
float getControlTemperature();
float getControlHumidity();
void setControlTemperature(float temperature);
void setControlHumidity(float humidity);
}
@@ -1,9 +1,16 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.climate;
/**
* @deprecated TODO: Remove in 1.13, Use IClimateState
*/
@Deprecated
public interface IClimateInfo {
float getTemperature();
float getHumidity();
}
@@ -5,37 +5,37 @@
******************************************************************************/
package forestry.api.climate;
import javax.annotation.Nullable;
import java.util.List;
import java.util.Map;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public interface IClimateManager {
/**
* @deprecated Use {@link IClimateStates#create(float, float, ClimateStateType)}
*/
@Deprecated
IClimateInfo createInfo(float temperature, float humidity);
/**
* @deprecated Use {@link #getClimateState(World, BlockPos)}
*/
@Deprecated
IClimateInfo getInfo(World world, BlockPos pos);
IClimateProvider getDefaultClimate(World world, BlockPos pos);
void addRegion(IClimateRegion region);
void removeRegion(IClimateRegion region);
void addSource(IClimateSourceProvider source);
void removeSource(IClimateSourceProvider source);
void onWorldUnload(World world);
/**
* Gets the current state of a container at this position or setSettings one with the datas from the biome.
* @since 5.3.4
*/
IClimateState getClimateState(World world, BlockPos pos);
@Nullable
IClimatePosition getPosition(World world, BlockPos pos);
@Nullable
IClimateRegion getRegionForPos(World world, BlockPos pos);
Map<World, List<IClimateRegion>> getRegions();
/**
* Creates a climate state with the help of the biome on this position.
* @since 5.3.4
*/
IClimateState getBiomeState(World world, BlockPos pos);
/**
* @return Create a climate manager.
*/
IClimateProvider getDefaultClimate(World world, BlockPos pos);
}
@@ -1,35 +0,0 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.climate;
import forestry.api.core.INbtReadable;
import forestry.api.core.INbtWritable;
import net.minecraft.util.math.BlockPos;
/**
* A IClimatePosition contains the climate infos (temperature and humidity) of one position.
*/
public interface IClimatePosition extends INbtReadable, INbtWritable {
IClimateRegion getClimateRegion();
BlockPos getPos();
void setTemperature(float temperature);
void addTemperature(float temperature);
float getTemperature();
void setHumidity(float humidity);
void addHumidity(float humidity);
float getHumidity();
IClimateInfo getInfo();
}
@@ -5,9 +5,10 @@
******************************************************************************/
package forestry.api.climate;
import net.minecraft.world.biome.Biome;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
import net.minecraft.world.biome.Biome;
public interface IClimateProvider {
Biome getBiome();
@@ -1,46 +0,0 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.climate;
import java.util.Collection;
import javax.annotation.Nullable;
import forestry.api.core.INbtReadable;
import forestry.api.core.INbtWritable;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public interface IClimateRegion extends INbtReadable, INbtWritable {
World getWorld();
int getTicksPerUpdate();
void setPosition(BlockPos pos, float temperature, float humidity);
@Nullable
IClimatePosition getPosition(BlockPos pos);
Collection<IClimatePosition> getPositions();
void addSource(IClimateSource source);
void removeSource(IClimateSource source);
Collection<IClimateSource> getSources();
void calculateAverageClimate();
float getAverageTemperature();
float getAverageHumidity();
/**
* Update the climate in a region.
*/
void updateClimate(int ticks);
}
@@ -1,30 +0,0 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.climate;
import javax.annotation.Nullable;
/**
* A climate source is used to change the climate in a region.
*/
public interface IClimateSource {
/**
* @param tickCount The current tick count.
* @param region The climate region, in that the source stands.
* @return Return true if the the climate has changed.
*/
boolean changeClimate(int tickCount, IClimateRegion region);
/**
* @return The ticks that are required for one change.
*/
int getTicksForChange(IClimateRegion region);
@Nullable
IClimateSourceProvider getProvider();
}
@@ -0,0 +1,45 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.climate;
import net.minecraft.world.biome.Biome;
import forestry.api.core.INbtWritable;
/**
* A {@link IClimateState} is used to store and handle temperature and humidity.
*
* The values are oriented on the values of {@link Biome#getTemperature()} and {@link Biome#getRainfall()}.
*/
public interface IClimateState extends INbtWritable {
float getTemperature();
float getHumidity();
IClimateState addTemperature(float temperature);
IClimateState addHumidity(float humidity);
IClimateState add(IClimateState state);
IClimateState scale(double factor);
IClimateState remove(IClimateState state);
default float get(ClimateType type){
return type == ClimateType.HUMIDITY ? getHumidity() : getTemperature();
}
IClimateState copy(ClimateStateType type);
IClimateState copy();
boolean isPresent();
ClimateStateType getType();
}
@@ -0,0 +1,25 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.climate;
import net.minecraft.nbt.NBTTagCompound;
public interface IClimateStates {
IClimateState create(NBTTagCompound compound);
IClimateState create(NBTTagCompound compound, ClimateStateType type);
IClimateState create(float temperature, float humidity, ClimateStateType type);
IClimateState create(IClimateState climateState, ClimateStateType type);
IClimateState absent();
IClimateState min();
IClimateState max();
}
@@ -5,10 +5,11 @@
******************************************************************************/
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
@API(apiVersion = "2.1.0", owner = "Forestry", provides = "ForestryAPI|climate")
@API(apiVersion = "5.0.0", owner = "Forestry", provides = "ForestryAPI|climate")
package forestry.api.climate;
import javax.annotation.ParametersAreNonnullByDefault;
import mcp.MethodsReturnNonnullByDefault;
import net.minecraftforge.fml.common.API;
import mcp.MethodsReturnNonnullByDefault;
@@ -1,3 +1,8 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.core;
import java.util.HashMap;
@@ -9,12 +9,4 @@ public class CamouflageManager {
public static ICamouflageAccess camouflageAccess;
public static final String BLOCK = "block";
public static final String GLASS = "glass";
public static final String DOOR = "door";
public static final String NONE = "none";
}
@@ -20,6 +20,8 @@ public enum EnumHumidity {
*/
DAMP("Damp");
public static final EnumHumidity[] VALUES = values();
public final String name;
EnumHumidity(String name) {
@@ -5,6 +5,7 @@
******************************************************************************/
package forestry.api.core;
import forestry.api.climate.IClimateState;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -73,7 +74,8 @@ public enum EnumTemperature {
if (BiomeHelper.isBiomeHellish(biome)) {
return HELLISH;
}
float temperature = ForestryAPI.climateManager.getInfo(world, pos).getTemperature();
IClimateState state = ForestryAPI.climateManager.getClimateState(world, pos);
float temperature = state.getTemperature();
return getFromValue(temperature);
}
}
@@ -7,12 +7,19 @@ package forestry.api.core;
import java.util.Set;
import forestry.api.climate.IClimateManager;
import forestry.api.farming.IFarmRegistry;
import forestry.api.farming.ISimpleFarmLogic;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import forestry.api.climate.IClimateManager;
import forestry.api.climate.IClimateStates;
import forestry.api.farming.IFarmRegistry;
import forestry.api.farming.IFarmable;
import forestry.api.farming.ISimpleFarmLogic;
import forestry.api.modules.IModuleContainer;
import forestry.api.modules.IModuleManager;
/**
* Forestry's API is divided into several subcategories to make it easier to understand.
* <p>
@@ -50,7 +57,18 @@ public class ForestryAPI {
public static IClimateManager climateManager;
/**
* A registry for register fertilizers, {@link IFarmabeles}s and {@link ISimpleFarmLogic}s
* Instance of the module manager of forestry.
* This can be used to register {@link IModuleContainer}s in the constructor of your mod.
*/
public static IModuleManager moduleManager;
/**
*
*/
public static IClimateStates states;
/**
* A registry for register fertilizers, {@link IFarmable}s and {@link ISimpleFarmLogic}s
*/
public static IFarmRegistry farmRegistry;
@@ -65,10 +83,20 @@ public class ForestryAPI {
public static IForestryConstants forestryConstants;
/**
* The currently enabled Forestry plugins.
* The currently enabled Forestry modules.
* Can be used to check if certain features are available, for example:
* ForestryAPI.enabledPlugins.contains("APICULTURE")
* ForestryAPI.enabledModules.contains(new ResourceLocation("forestry", "apiculture"))
*/
public static Set<ResourceLocation> enabledModules;
/**
* The currently enabled Forestry modules.
* Can be used to check if certain features are available, for example:
* ForestryAPI.enabledPlugins.contains("forestry.apiculture")
*
* @deprecated Use {@link #enabledModules}
*/
@Deprecated
public static Set<String> enabledPlugins;
/**
@@ -5,13 +5,17 @@
******************************************************************************/
package forestry.api.core;
import net.minecraft.entity.player.EntityPlayer;
import com.mojang.authlib.GameProfile;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.Event;
import forestry.api.genetics.IAlleleSpecies;
import forestry.api.genetics.IBreedingTracker;
import forestry.api.genetics.IMutation;
import forestry.api.genetics.ISpeciesRoot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.fml.common.eventhandler.Event;
public abstract class ForestryEvent extends Event {
@@ -53,6 +57,24 @@ public abstract class ForestryEvent extends Event {
this.tracker = tracker;
this.player = player;
}
}
/**
* Posted before forestry registers all items and blocks.
*
* @deprecated removed in 1.13
*/
@Deprecated
public static class PreInit extends ForestryEvent{
/**
* The main mod instance for Forestry.
*/
public Object instance;
public final FMLPreInitializationEvent event;
public PreInit(Object instance, FMLPreInitializationEvent event) {
this.instance = instance;
this.event = event;
}
}
}
@@ -3,10 +3,11 @@
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.greenhouse;
public class GreenhouseManager {
public static IGreenhouseHelper greenhouseHelper;
package forestry.api.core;
/**
* The alignment of the text in a text gui element.
*/
public enum GuiElementAlignment {
LEFT, CENTER, RIGHT
}
@@ -7,6 +7,8 @@ package forestry.api.core;
import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
public interface ICamouflageAccess {
@@ -16,21 +18,20 @@ public interface ICamouflageAccess {
*
* @param itemHandler The handler that is to register.
*/
void registerCamouflageItemHandler(ICamouflageItemHandler itemHandler);
void registerItemHandler(ICamouflageItemHandler itemHandler);
/**
* @return A list of all item camouflage handler's that are registered for that camouflage type.
*/
List<ICamouflageItemHandler> getCamouflageItemHandler(String type);
List<ICamouflageItemHandler> getItemHandlers();
void addItemToBlackList(String type, ItemStack camouflageBlock);
void addItemToBlackList(ItemStack camouflageBlock);
void addModIdToBlackList(String type, String modID);
void addModIdToBlackList(String modID);
boolean isItemBlackListed(String type, ItemStack camouflageBlock);
ICamouflageItemHandler getNoneItemHandler();
boolean isItemBlackListed(ItemStack camouflageBlock);
ICamouflageItemHandler getHandlerFromItem(ItemStack stack);
@Nullable
ICamouflageItemHandler getHandler(ItemStack stack);
}
@@ -12,22 +12,17 @@ public interface ICamouflageHandler extends ILocatable {
/**
* @return The item of the block that is the camouflage of this handler for the type.
*/
ItemStack getCamouflageBlock(String type);
ItemStack getCamouflageBlock();
/**
* @return The default camouflage block item for the type.
*/
ItemStack getDefaultCamouflageBlock(String type);
/**
* @return True if the handler can handle this type of camouflage.
*/
boolean canHandleType(String type);
ItemStack getDefaultCamouflageBlock();
/**
* Set the camouflage block item for the type.
*
* @return True if the block has chanced.
*/
boolean setCamouflageBlock(String type, ItemStack camouflageBlock, boolean sendClientUpdate);
boolean setCamouflageBlock(ItemStack camouflageBlock, boolean sendClientUpdate);
}
@@ -5,22 +5,20 @@
******************************************************************************/
package forestry.api.core;
import org.apache.commons.lang3.tuple.Pair;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.lang3.tuple.Pair;
public interface ICamouflageItemHandler {
boolean canHandle(ItemStack stack);
String getType();
float getLightTransmittance(ItemStack stack, ICamouflageHandler camouflageHandler);
@SideOnly(Side.CLIENT)
Pair<IBlockState, IBakedModel> getModel(ItemStack stack, ICamouflageHandler camouflageHandler, ICamouflagedTile camouflageTile);
Pair<IBlockState, IBakedModel> getModel(ItemStack stack);
}
@@ -5,12 +5,6 @@
******************************************************************************/
package forestry.api.core;
import net.minecraft.util.math.BlockPos;
public interface ICamouflagedTile {
String getCamouflageType();
BlockPos getCoordinates();
public interface ICamouflagedTile extends ILocatable {
}
@@ -5,6 +5,7 @@
******************************************************************************/
package forestry.api.core;
import javax.annotation.Nullable;
import java.util.Set;
public interface IErrorStateRegistry {
@@ -12,6 +13,7 @@ public interface IErrorStateRegistry {
void addAlias(IErrorState state, String name);
@Nullable
IErrorState getErrorState(short id);
IErrorState getErrorState(String name);
@@ -0,0 +1,43 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.core;
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public interface IGuiElement {
int getX();
int getY();
int getWidth();
int getHeight();
void setXOffset(int xOffset);
void setYOffset(int yOffset);
@Nullable
IGuiElement getParent();
void setParent(@Nullable IGuiElement parent);
void draw(int startX, int startY);
@SideOnly(Side.CLIENT)
default List<String> getToolTip(int mouseX, int mouseY){
return Collections.emptyList();
}
@SideOnly(Side.CLIENT)
boolean isMouseOver(int mouseX, int mouseY);
}
@@ -0,0 +1,54 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.core;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import forestry.api.genetics.IAllele;
import forestry.api.genetics.IAlleleInteger;
import forestry.api.genetics.IAlleleSpecies;
import forestry.api.genetics.IAlleleTolerance;
import forestry.api.genetics.IBreedingTracker;
import forestry.api.genetics.IMutation;
/**
* A helper interface to create gui elements.
*/
@SideOnly(Side.CLIENT)
public interface IGuiElementFactory {
IGuiElementHelper createHelper(IGuiElementLayout element);
/* GENETIC*/
/**
* @param dominant True if you want the dominant color and false if you want the recessive color.
*
* @return The color code that forestry uses to show if a allele is dominant (true) or recessive (false).
*/
int getColorCoding(boolean dominant);
/**
* @return Null if the mutation is secret and undiscovered. {@link IMutation#isSecret()}
*/
IGuiElement createMutation(int x, int y, int width, int height, IMutation mutation, IAllele species, IBreedingTracker breedingTracker);
/**
* @return Null if the mutation is secret and undiscovered. {@link IMutation#isSecret()}
*/
IGuiElement createMutationResultant(int x, int y, int width, int height, IMutation mutation, IBreedingTracker breedingTracker);
IGuiElement createFertilityInfo(IAlleleInteger fertilityAllele, int x, int texOffset);
IGuiElement createToleranceInfo(IAlleleTolerance toleranceAllele, IAlleleSpecies species, String text);
/* LAYOUTS */
IGuiElementLayout createHorizontal(int xPos, int yPos, int height);
IGuiElementLayout createVertical(int xPos, int yPos, int width);
IGuiElementLayout createPanel(int xPos, int yPos, int width, int height);
}
@@ -0,0 +1,98 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.core;
import java.util.function.Function;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import forestry.api.core.IGuiElementLayoutHelper.LayoutFactory;
import forestry.api.genetics.IAllele;
import forestry.api.genetics.IAlleleInteger;
import forestry.api.genetics.IAlleleSpecies;
import forestry.api.genetics.IAlleleTolerance;
import forestry.api.genetics.IBreedingTracker;
import forestry.api.genetics.IChromosomeType;
import forestry.api.genetics.IIndividual;
import forestry.api.genetics.IMutation;
/**
* A helper interface to add gui elements.
*/
@SideOnly(Side.CLIENT)
public interface IGuiElementHelper {
/**
* Adds a {@link IGuiElement} to the parent of this.
*/
void add(IGuiElement element);
/**
* Centers a element to the center of the x axis of the parent element.
*
* @return the element
*/
IGuiElement centerElement(IGuiElement element);
/**
* Creates and adds an item gui element.
*/
void addItem(int x, ItemStack itemStack);
IGuiElementLayoutHelper layoutHelper(LayoutFactory layoutFactory, int width, int height);
/**
* Adds the chromosomeName and the name of the active/not active allele, of the chromosome, with {@link #addText}.
*/
void addAllele(String chromosomeName, IIndividual individual, IChromosomeType chromosome, boolean active);
/**
* Adds the chromosomeName and the result of toString with {@link #addText}.
*/
<A extends IAllele> void addAllele(String chromosomeName, Function<A, String> toString, IIndividual individual, IChromosomeType chromosome, boolean active);
void addFertilityInfo(IAlleleInteger fertilityAllele, int x, int texOffset);
void addToleranceInfo(IAlleleTolerance toleranceAllele, IAlleleSpecies species, String text);
void addMutation(int x, int y, int width, int height, IMutation mutation, IAllele species, IBreedingTracker breedingTracker);
void addMutationResultant(int x, int y, int width, int height, IMutation mutation, IBreedingTracker breedingTracker);
/**
* Adds a text element with the default color,the align {@link GuiElementAlignment#LEFT} and the height 12.
*/
void addText(String text);
/**
* Adds a text element with the align {@link GuiElementAlignment#LEFT} and the height 12.
*/
void addText(String text, int color);
/**
* Adds a text element with the default color and the height 12.
*/
void addText(String text, GuiElementAlignment align);
/**
* Adds a text element with the height 12.
*/
void addText(String text,GuiElementAlignment align, int color);
/**
* Adds a text element.
*/
void addText(int x, int height, String text, GuiElementAlignment align, int color);
/**
* @return The element to which all elements are added.
*/
IGuiElement getParent();
IGuiElementFactory factory();
}
@@ -0,0 +1,67 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.core;
import java.util.Collection;
import java.util.List;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public interface IGuiElementLayout extends IGuiElement {
/**
* Adds a element to this layout.
*/
IGuiElementLayout addElement(IGuiElement element);
/**
* Removes a element from this layout.
*/
IGuiElementLayout removeElement(IGuiElement element);
default IGuiElementLayout addElements(IGuiElement... elements){
for(IGuiElement element : elements){
addElement(element);
}
return this;
}
default IGuiElementLayout removeElements(IGuiElement... elements){
for(IGuiElement element : elements){
removeElement(element);
}
return this;
}
default IGuiElementLayout addElements(Collection<IGuiElement> elements){
elements.forEach(element -> addElement(element));
return this;
}
default IGuiElementLayout removeElements(Collection<IGuiElement> elements){
elements.forEach(element -> removeElement(element));
return this;
}
List<IGuiElement> getElements();
IGuiElementLayout setDistance(int distance);
void addTooltip(String line);
/**
* @return The tooltip that is displayed if the mouse is over this element and no element of this layout is under it.
*/
List<String> getTooltip();
/**
* @return The distance between the different elements of this layout.
*/
int getDistance();
int getSize();
}
@@ -0,0 +1,41 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.core;
import java.util.Collection;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public interface IGuiElementLayoutHelper {
/**
* @return Only false if the helper has no space to add this element.
*/
boolean add(IGuiElement element);
/**
* Removes all layouts and resets all variables of this helper.
*/
void clear();
/**
* Adds the layouts to the parent of the {@link IGuiElementHelper}. And calls {@link #clear()}
*/
void finish();
/**
* @return All layouts that were created with the help of this helper since the last {@link #clear()} or {@link #finish()}.
*/
Collection<IGuiElementLayout> layouts();
interface LayoutFactory {
/**
* A factory method to create new layouts if the last layout is full.
*/
IGuiElementLayout createLayout(int xOffset, int yOffset);
}
}
@@ -1,23 +1,20 @@
/*******************************************************************************
* Copyright (c) 2011-2014 SirSengir.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v3
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-3.0.txt
* Copyright 2011-2014 SirSengir
*
* Various Contributors including, but not limited to:
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.core;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
/**
* Interface for things, that have a location.
* Must not be named "getWorld" and "getPos" to avoid
* SpecialSource issue https://github.com/md-5/SpecialSource/issues/12
*/
public interface ILocatable {
BlockPos getCoordinates();
/**
* Must not be named "getWorld" to avoid SpecialSource issue https://github.com/md-5/SpecialSource/issues/12
*/
World getWorldObj();
}
@@ -12,13 +12,17 @@ import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.common.model.IModelState;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
/**
* A model baker to make custom models
*
* @deprecated TODO Remove in 1.13: Not needed in the api
*/
@Deprecated
@SideOnly(Side.CLIENT)
public interface IModelBaker {
@@ -34,6 +38,8 @@ public interface IModelBaker {
void addBakedModel(@Nullable IBlockState state, IBakedModel model);
void addBakedModelPost(@Nullable IBlockState state, IBakedModel model);
void addFace(EnumFacing facing, TextureAtlasSprite sprite);
void setModelState(@Nullable IModelState modelState);
@@ -15,6 +15,10 @@ import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
/**
* @deprecated TODO Remove in 1.13: Not needed in the api
*/
@Deprecated
@SideOnly(Side.CLIENT)
public interface IModelBakerModel extends IBakedModel {
@@ -8,9 +8,14 @@ package forestry.api.core;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
/**
* @deprecated TODO Remove in 1.13: Not needed in the api
*/
@Deprecated
@SideOnly(Side.CLIENT)
public interface IModelManager {
@@ -1,3 +1,8 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.core;
import net.minecraft.nbt.NBTTagCompound;
@@ -1,12 +1,7 @@
/*******************************************************************************
* Copyright (c) 2011-2014 SirSengir.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v3
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-3.0.txt
* Copyright 2011-2014 SirSengir
*
* Various Contributors including, but not limited to:
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.core;
@@ -5,10 +5,11 @@
******************************************************************************/
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
@API(apiVersion = "5.1.0", owner = "Forestry", provides = "ForestryAPI|core")
@API(apiVersion = "5.7.0", owner = "Forestry", provides = "ForestryAPI|core")
package forestry.api.core;
import javax.annotation.ParametersAreNonnullByDefault;
import mcp.MethodsReturnNonnullByDefault;
import net.minecraftforge.fml.common.API;
import mcp.MethodsReturnNonnullByDefault;
@@ -5,14 +5,16 @@
******************************************************************************/
package forestry.api.farming;
import java.util.LinkedHashMap;
import java.util.Map;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import java.util.LinkedHashMap;
import java.util.Map;
import net.minecraft.item.ItemStack;
//TODO: Remove this class in 1.13
@Deprecated
public class Farmables {
/**
* Can be used to add IFarmables to some of the vanilla farm logics.
@@ -5,12 +5,14 @@
******************************************************************************/
package forestry.api.farming;
import forestry.api.core.IErrorLogicSource;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3i;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidStack;
import forestry.api.core.IErrorLogicSource;
public interface IFarmHousing extends IErrorLogicSource {
BlockPos getCoords();
@@ -33,10 +35,36 @@ public interface IFarmHousing extends IErrorLogicSource {
* Will remove the appropriate germling from the farm's inventory.
* It's up to the logic to only call this on a valid location.
*
* @deprecated TODO remove this method in 1.13
*
* @return true if planting was successful, false otherwise.
*/
@Deprecated
boolean plantGermling(IFarmable farmable, World world, BlockPos pos);
/**
* Callback for {@link IFarmLogic}s to plant a sapling, seed, germling, stem.
* Will remove the appropriate germling from the farm's inventory.
* It's up to the logic to only call this on a valid location.
*
* @return true if planting was successful, false otherwise.
*/
default boolean plantGermling(IFarmable farmable, World world, BlockPos pos, FarmDirection direction){
return plantGermling(farmable, world, pos);
}
default boolean isValidPlatform(World world, BlockPos pos){
return false;
}
default boolean isSquare(){
return false;
}
default boolean canPlantSoil(boolean manual){
return true;
}
/* INTERACTION WITH HATCHES */
IFarmInventory getFarmInventory();
@@ -27,4 +27,6 @@ public interface IFarmInventory {
IInventory getResourcesInventory();
IInventory getFertilizerInventory();
}
@@ -8,39 +8,136 @@ package forestry.api.farming;
import java.util.Collection;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import forestry.api.core.ForestryAPI;
/**
* The IFarmLogic is used by farm blocks and multi-blocks to cultivate and harvest crops and plants.
*
* Every farm block has only ony one logic a multi-block farm has four, one for every direction.
*/
public interface IFarmLogic {
/**
* @return The amount of fertilizer that the {@link IFarmHousing} automatically removes after this logic cultivated
* a block or harvested a crop.
*/
int getFertilizerConsumption();
/**
* @param hydrationModifier A modifier that depends on the weather and the biome of the farm.
*
* @return The amount of water that the {@link IFarmHousing} automatically removes after this logic cultivated
* a block or harvested a crop.
*/
int getWaterConsumption(float hydrationModifier);
/**
* Checks if the given stack is a resource or a soil that this logic uses to grow plants on or to create other
* products like peat.
*/
boolean isAcceptedResource(ItemStack itemstack);
/**
* Checks if the given stack is a germling (plantable sapling, seed, etc.) for any {@link IFarmable} of this farm.
*/
boolean isAcceptedGermling(ItemStack itemstack);
/**
* Collects all items that are laying on the ground and are in the {@link IFarmHousing#getArea()} of the farm.
*
* @param world The world of the farm.
* @param farmHousing The farm that uses this logic.
*
* @return A collection that contains all items that were collected.
*/
NonNullList<ItemStack> collect(World world, IFarmHousing farmHousing);
/**
* Tries to cultivate one or more blocks at the given position and with the given extent.
*
* @param world The world of the farm.
* @param farmHousing The farm that uses this logic.
* @param pos The position at that the logic should start to cultivate.
* @param direction The direction of the extension.
* @param extent How many blocks this logic has to cultivate after it cultivated the block at the given position.
* The positions of the next blocks are having a offset in the given direction.
* @return True if the logic has cultivated any block.
*/
boolean cultivate(World world, IFarmHousing farmHousing, BlockPos pos, FarmDirection direction, int extent);
/**
* Tries to harvest one or more blocks at the given position and with the given extent.
*
* @param world The world of the farm.
* @param pos The position at that the logic should start to harvest.
* @param direction The direction of the extension.
* @param extent How many blocks this logic tries to harvest after it has tried to harvested the block at the given position.
* The positions of the next blocks are having a offset in the given direction.
* @return True if the logic has cultivated any block.
*/
Collection<ICrop> harvest(World world, BlockPos pos, FarmDirection direction, int extent);
IFarmLogic setManual(boolean manual);
/**
* Returns the {@link IFarmProperties} that created this logic.
*
* @since Forestry 5.8
*
* @return Returns the {@link IFarmProperties} that created this logic. Returns a fake instance from
* {@link IFarmRegistry#createFakeInstance(IFarmLogic)} if the logic is older that Forestry 5.8.
* TODO: Remove "default" from this method in 1.13
*/
default IFarmProperties getProperties(){
return ForestryAPI.farmRegistry.createFakeInstance(this);
}
void addSoil(ItemStack resource, IBlockState soilState, boolean hasMetaData);
@SideOnly(Side.CLIENT)
ResourceLocation getTextureMap();
/**
* @deprecated Since Forestry 5.8 logic instances are created at the constructor of the {@link IFarmProperties} and
* have a immutable manual state. TODO Remove this method in 1.13
*/
@Deprecated
default IFarmLogic setManual(boolean manual){
return this;
}
/**
* Use {@link IFarmRegistry#getProperties(String)} to get the {@link IFarmProperties} for the farm logic and register the soil
* with {@link IFarmProperties#registerSoil(ItemStack, IBlockState, boolean)}.
*/
@Deprecated
default void addSoil(ItemStack resource, IBlockState soilState, boolean hasMetaData){
//
}
default String getUnlocalizedName(){
return "";
}
/**
* @return Localized short, human-readable identifier used in the farm gui and in tooltips.
*/
String getName();
/* GUI ONLY */
/**
* @deprecated No longer needed because mc always uses the same map for blocks and items.
* TODO remove this method in 1.13
*/
@Deprecated
@SideOnly(Side.CLIENT)
default ResourceLocation getTextureMap(){
return TextureMap.LOCATION_BLOCKS_TEXTURE;
}
/**
* @return the itemStack that represents this farm logic. Used as an icon for the farm logic.
*/
@@ -0,0 +1,48 @@
package forestry.api.farming;
import java.util.Collection;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
/**
* @since Forestry 5.8
*/
public interface IFarmProperties {
/**
* Can be used to register a {@link IBlockState} as a valid soil.
*/
default void registerSoil(ItemStack resource, IBlockState soilState){
registerSoil(resource, soilState, false);
}
/**
* Can be used to register a {@link IBlockState} as a valid soil.
*/
void registerSoil(ItemStack resource, IBlockState soilState, boolean hasMetaData);
/**
* Adds the {@link IFarmable}s that where registered with the given identifier.
*/
void registerFarmables(String identifier);
/**
* @return true if the given block state is a valid soil state.
*/
boolean isAcceptedSoil(IBlockState blockState);
/**
* @return true if the given stack is the {@link ItemStack} of a soil.
*/
boolean isAcceptedResource(ItemStack itemStack);
Collection<ISoil> getSoils();
Collection<IFarmable> getFarmables();
/**
* Returns the instance of the manual or managed {@link IFarmLogic}.
*/
IFarmLogic getLogic(boolean manuel);
}
@@ -5,7 +5,9 @@
******************************************************************************/
package forestry.api.farming;
import javax.annotation.Nullable;
import java.util.Collection;
import java.util.function.BiFunction;
import net.minecraft.item.ItemStack;
@@ -13,15 +15,35 @@ public interface IFarmRegistry {
/**
* Registers farming logic in registry under given identifier
* @param identifier Valid identifiers: farmArboreal farmWheat farmGourd farmInfernal farmPoales farmSucculentes farmVegetables farmShroom
* @param identifier Valid identifiers: farmArboreal farmCrops farmGourd farmInfernal farmPoales farmSucculentes farmShroom
* @param logic corresponding instance of logic
*
* @deprecated Since Forestry 5.8. Use {@link #registerLogic(String, BiFunction, String...)} or
* {@link #registerLogic(String, IFarmProperties)}.
*/
void registerFarmLogic(String identifier, IFarmLogic logic);
@Deprecated
void registerLogic(String identifier, IFarmLogic logic);
/**
* Registers farming logic in registry
* @since Forestry 5.8
*/
IFarmProperties registerLogic(String identifier, IFarmProperties farmInstance);
/**
* Registers farming logic in registry under given identifier
*
* @param identifier Valid identifiers: farmArboreal farmCrops farmGourd farmInfernal farmPoales farmSucculentes farmShroom
* @param logicFactory factory that creates the corresponding instance of logic
* @param farmablesIdentifiers Identifiers: farmArboreal farmCrops farmGourd farmInfernal farmPoales farmSucculentes farmShroom
* @since Forestry 5.8
*/
IFarmProperties registerLogic(String identifier, BiFunction<IFarmProperties, Boolean, IFarmLogic> logicFactory, String... farmablesIdentifiers);
/**
* Can be used to add IFarmables to some of the vanilla farm logics.
* <p>
* Identifiers: farmArboreal farmWheat farmGourd farmInfernal farmPoales farmSucculentes farmVegetables farmShroom
* Identifiers: farmArboreal farmCrops farmGourd farmInfernal farmPoales farmSucculentes farmShroom
*/
void registerFarmables(String identifier, IFarmable... farmable);
@@ -29,13 +51,20 @@ public interface IFarmRegistry {
/**
* Can be used to create a simple version of a farm logic, like the vanilla vegetable or wheat farm logic.
*
* @return Null if the farming plugin is not active.
*
* @deprecated Since Forestry 5.8. Use {@link #createCropLogic(IFarmProperties, boolean, ISimpleFarmLogic)} instead.
*/
IFarmLogic createLogic(ISimpleFarmLogic simpleFarmLogic);
@Nullable
@Deprecated
default IFarmLogic createLogic(ISimpleFarmLogic simpleFarmLogic){
return null;
}
/**
*
* @param itemStack
* @param value The value of the fertitlizer.The value of the forestry fertelizer is 500.
* @param value The value of the fertitlizer. The value of the forestry fertelizer is 500.
*/
void registerFertilizer(ItemStack itemStack, int value);
@@ -43,5 +72,28 @@ public interface IFarmRegistry {
* @return The value of the fertitlizer
*/
int getFertilizeValue(ItemStack itemStack);
/**
* Returns a fake {@link IFarmProperties} that returns the given logic at {@link IFarmProperties#getLogic(boolean)}.
*
* @since Forestry 5.8
* @deprecated Only for backwards comparability.
*/
@Deprecated
IFarmProperties createFakeInstance(IFarmLogic logic);
/**
* Can be used to create a simple version of a farm logic, like the vanilla vegetable or wheat farm logic.
*
* @return Null if the farming plugin is not active.
*/
@Nullable
IFarmLogic createCropLogic(IFarmProperties instance, boolean isManual, ISimpleFarmLogic simpleFarmLogic);
/**
* @since Forestry 5.8
*/
@Nullable
IFarmProperties getProperties(String identifier);
}
@@ -20,8 +20,19 @@ public interface IFarmable {
/**
* @return true if the block at the given location is a "sapling" for this type, i.e. a non-harvestable immature version of the crop.
* @deprecated Since Forestry 5.8. Use the version below. TODO Remove this method in 1.13
*/
boolean isSaplingAt(World world, BlockPos pos);
@Deprecated
default boolean isSaplingAt(World world, BlockPos pos){
return false;
}
/**
* @return true if the block at the given location is a "sapling" for this type, i.e. a non-harvestable immature version of the crop.
*/
default boolean isSaplingAt(World world, BlockPos pos, IBlockState blockState){
return isSaplingAt(world, pos);
}
/**
* @return {@link ICrop} if the block at the given location is a harvestable and mature crop, null otherwise.
@@ -8,7 +8,9 @@ package forestry.api.farming;
import net.minecraft.item.ItemStack;
/**
* A simple version of the IFarmLogic.
* A simple version of the IFarmLogic.
*
* @apiNote TODO Remove this in 1.13
*/
public interface ISimpleFarmLogic {
@@ -16,7 +18,11 @@ public interface ISimpleFarmLogic {
* @return the itemStack that represents this farm logic. Used as an icon for the farm logic.
*/
ItemStack getIconItemStack();
/**
* @deprecated Since 5.8
*/
@Deprecated
Iterable<IFarmable> getSeeds();
String getName();
@@ -0,0 +1,16 @@
package forestry.api.farming;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
/**
* @since Forestry 5.8
*/
public interface ISoil {
ItemStack getResource();
IBlockState getSoilState();
boolean hasMetaData();
}
@@ -5,10 +5,11 @@
******************************************************************************/
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
@API(apiVersion = "2.2.0", owner = "ForestryAPI|core", provides = "ForestryAPI|farming")
@API(apiVersion = "5.8.0", owner = "ForestryAPI|core", provides = "ForestryAPI|farming")
package forestry.api.farming;
import javax.annotation.ParametersAreNonnullByDefault;
import mcp.MethodsReturnNonnullByDefault;
import net.minecraftforge.fml.common.API;
@@ -23,4 +23,9 @@ public class AlleleManager {
* Creates Forestry alleles.
*/
public static IAlleleFactory alleleFactory;
/**
* @since 5.8
*/
public static IFilterRegistry filterRegistry;
}
@@ -1,6 +1,10 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.genetics;
import forestry.api.arboriculture.IAlleleFruit;
import net.minecraftforge.fml.common.eventhandler.Event;
/**
@@ -1,3 +1,8 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.genetics;
/**
@@ -0,0 +1,15 @@
package forestry.api.genetics;
/**
* Every instance of this enum represents a tab in the database.
*/
public enum EnumDatabaseTab {
//Used to display information about the active species of the individual.
ACTIVE_SPECIES,
//Used to display information about the inactive species of the individual.
INACTIVE_SPECIES,
//Used to display information about the products of the active species of the individual.
PRODUCTS,
//Used to display information about the mutations of the active species of the individual.
MUTATIONS;
}
@@ -0,0 +1,17 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.genetics;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityInject;
public class GeneticCapabilities {
/**
* Capability for {@link IFilterLogic}.
*/
@CapabilityInject(IFilterLogic.class)
public static Capability<IFilterLogic> FILTER_LOGIC;
}
@@ -21,6 +21,14 @@ public interface IAllele {
*/
String getUID();
/**
* @return modId of the mod that created this allele
* @since Forestry 5.6.0
*/
default String getModID() {
return "forestry";
}
/**
* @return true if the allele is dominant, false otherwise.
*/
@@ -1,3 +1,8 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.genetics;
import net.minecraft.util.math.Vec3i;
@@ -1,3 +1,8 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.genetics;
public interface IAlleleProperty<A extends IAlleleProperty<A>> extends IAllele, Comparable<A> {
@@ -207,7 +207,7 @@ public interface IAlleleRegistry {
* @param handler IAlleleHandler to register.
*/
void registerAlleleHandler(IAlleleHandler handler);
/* BLACKLIST */
/**
@@ -1,3 +1,8 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.genetics;
import java.util.List;
@@ -5,10 +5,14 @@
******************************************************************************/
package forestry.api.genetics;
import forestry.api.apiculture.IBeekeepingMode;
import java.util.Collection;
import java.util.Collections;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import forestry.api.apiculture.IBeekeepingMode;
/**
* Keeps track of who bred, discovered, and researched which species in a world.
*
@@ -67,6 +71,13 @@ public interface IBreedingTracker {
*/
boolean isDiscovered(IAlleleSpecies species);
/**
* @return A collection that contains the {@link IAllele#getUID()}s of all discovered species.
*/
default Collection<String> getDiscoveredSpecies(){
return Collections.emptyList();
}
/**
* Register a successfully researched mutation.
* Mutations are normally researched in the Escritoire.
@@ -1,12 +1,7 @@
/*******************************************************************************
* Copyright (c) 2011-2014 SirSengir.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v3
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-3.0.txt
* Copyright 2011-2014 SirSengir
*
* Various Contributors including, but not limited to:
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.genetics;
@@ -1,3 +1,8 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.genetics;
import java.util.Collection;
@@ -0,0 +1,37 @@
package forestry.api.genetics;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import forestry.api.core.IGuiElementHelper;
/**
* A tab of the database screen that shows some information about a {@link IIndividual}.
*/
@SideOnly(Side.CLIENT)
public interface IDatabaseTab<I extends IIndividual> {
/**
* Creates the gui elements that are displayed if this tab is selected in the database.
*
* @param individual The individual that is currently in the database selected.
* @param elementHelper A helper to create the gui elements.
*/
void createElements(IGuiElementHelper elementHelper, I individual, ItemStack itemStack);
/**
* @return The slot of this tab.
*/
EnumDatabaseTab getTab();
/**
* Can be used to give the tab a custom tooltip.
*/
@Nullable
default String getTooltip(I individual){
return null;
}
}
@@ -0,0 +1,27 @@
package forestry.api.genetics;
public interface IFilterData {
/**
* If the root is present, returns the root,
* otherwise throws {@code NoSuchElementException}.
*/
ISpeciesRoot getRoot();
/**
* If the individual is present, returns the individual,
* otherwise throws {@code NoSuchElementException}.
*/
IIndividual getIndividual();
/**
* If the type is present, returns the type,
* otherwise throws {@code NoSuchElementException}.
*/
ISpeciesType getType();
/**
* @return True if this data contains a root, individual and type.
*/
boolean isPresent();
}
@@ -0,0 +1,56 @@
package forestry.api.genetics;
import javax.annotation.Nullable;
import java.io.IOException;
import java.util.Collection;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.WorldServer;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import forestry.api.core.INbtReadable;
import forestry.api.core.INbtWritable;
public interface IFilterLogic extends INbtWritable, INbtReadable {
void writeGuiData(PacketBuffer data);
@SideOnly(Side.CLIENT)
void readGuiData(PacketBuffer data) throws IOException;
Collection<EnumFacing> getValidDirections(ItemStack itemStack, EnumFacing from);
boolean isValid(ItemStack itemStack, EnumFacing facing);
boolean isValid(EnumFacing facing, ItemStack itemStack, IFilterData filterData);
boolean isValidAllelePair(EnumFacing orientation, String activeUID, String inactiveUID);
IFilterRuleType getRule(EnumFacing facing);
boolean setRule(EnumFacing facing, IFilterRuleType rule);
@Nullable
IAllele getGenomeFilter(EnumFacing facing, int index, boolean active);
boolean setGenomeFilter(EnumFacing facing, int index, boolean active, @Nullable IAllele allele);
void sendToServer(EnumFacing facing, int index, boolean active, @Nullable IAllele allele);
void sendToServer(EnumFacing facing, IFilterRuleType rule);
INetworkHandler getNetworkHandler();
interface INetworkHandler{
/**
* Sends the data of the logic to the client of all players that have the gui currently open.
*
* @param player The player that changed the filter.
*/
void sendToPlayers(IFilterLogic logic, WorldServer server, EntityPlayer player);
}
}
@@ -0,0 +1,40 @@
package forestry.api.genetics;
import javax.annotation.Nullable;
import java.util.Collection;
import forestry.api.core.ILocatable;
/**
* @since 5.8
*/
public interface IFilterRegistry {
/**
* Registers a filter rule.
*/
void registerFilter(IFilterRuleType rule);
Collection<IFilterRuleType> getRules();
IFilterRuleType getDefaultRule();
@Nullable
IFilterRuleType getRule(String uid);
@Nullable
IFilterRuleType getRule(int id);
int getId(IFilterRuleType rule);
IFilterLogic createLogic(ILocatable locatable, IFilterLogic.INetworkHandler networkHandler);
default IFilterRuleType getRuleOrDefault(String uid){
IFilterRuleType rule = getRule(uid);
return rule != null ? rule : getDefaultRule();
}
default IFilterRuleType getRuleOrDefault(int id){
IFilterRuleType rule = getRule(id);
return rule != null ? rule : getDefaultRule();
}
}
@@ -0,0 +1,17 @@
package forestry.api.genetics;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
public interface IFilterRule {
boolean isValid(ItemStack itemStack, IFilterData data);
/**
* If a root with this uid is registered, the filter will only get stack with individuals from this root.
*/
@Nullable
default String getRootUID() {
return null;
}
}
@@ -0,0 +1,27 @@
package forestry.api.genetics;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public interface IFilterRuleType extends IFilterRule {
void addLogic(IFilterRule logic);
/**
* @return True if a other logic can be added to this type.
*/
boolean isContainer();
/**
* @return A unique identifier for the rule.
*/
String getUID();
@SideOnly(Side.CLIENT)
TextureAtlasSprite getSprite();
@SideOnly(Side.CLIENT)
ResourceLocation getTextureMap();
}
@@ -5,6 +5,9 @@
******************************************************************************/
package forestry.api.genetics;
import java.util.Collection;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -13,6 +16,20 @@ public interface IFlowerGrowthHelper {
* Plants a random flower from flowerType at the specified position.
*
* @return true if successful, false if it could not be planted.
* @deprecated since Forestry 5.5.4. Use {@link #plantRandomFlower(String, World, BlockPos, Collection)}
*/
@Deprecated
boolean plantRandomFlower(String flowerType, World world, BlockPos pos);
/**
* Plants a random flower from flowerType at the specified position.
*
* @param flowerType the flower type that can be planted
* @param world the world to plant flowers in
* @param pos the position to plant the flowers
* @param potentialFlowers the potential flowers that can be planted
* @return true if a flower was planted, false otherwise
* @since Forestry 5.5.4
*/
boolean plantRandomFlower(String flowerType, World world, BlockPos pos, Collection<IBlockState> potentialFlowers);
}
@@ -5,6 +5,9 @@
******************************************************************************/
package forestry.api.genetics;
import java.util.Collection;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -18,6 +21,20 @@ public interface IFlowerGrowthRule {
* For implementers, you can plant a random flower using IFlowerGrowthHelper.plantRandomFlower
*
* @since Forestry 4.0.8
* @deprecated since Forestry 5.5.4. Use {@link #growFlower(IFlowerGrowthHelper, String, World, BlockPos, Collection)}
*/
@Deprecated
boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, BlockPos pos);
/**
* Checks a position for suitability, and then plants a flower there.
* Returns true on success.
* For implementers, you can plant a random flower using IFlowerGrowthHelper.plantRandomFlower
*
* @since Forestry 5.5.4
*/
default boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, BlockPos pos, Collection<IBlockState> potentialFlowers) {
//noinspection deprecation
return growFlower(helper, flowerType, world, pos);
}
}
@@ -5,17 +5,19 @@
******************************************************************************/
package forestry.api.genetics;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.core.IBlockPosPredicate;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.core.IBlockPosPredicate;
// See {@link forestry.api.apiculture.FlowerManager}.FlowerType___ for basic Forestry flower types.
// Each IFlowerProvider has one flower type, and multiple IFlowerProviders may share one type.
// "Acceptable flowers" allow nearby bees to do work.
@@ -59,8 +61,9 @@ public interface IFlowerRegistry {
/**
* Calls the appropriate IFlowerGrowthRule to grow a flower at a specified position.
* @since Forestry 5.5.4
*/
boolean growFlower(String flowerType, World world, IIndividual individual, BlockPos pos);
boolean growFlower(String flowerType, World world, IIndividual individual, BlockPos pos, Collection<IBlockState> potentialFlowers);
/**
* Gets an iterator over the area a bee can travel from its beeHousing.
@@ -96,4 +99,12 @@ public interface IFlowerRegistry {
*/
@Deprecated
boolean isAcceptedFlower(String flowerType, World world, BlockPos pos);
/**
* Calls the appropriate IFlowerGrowthRule to grow a flower at a specified position.
*
* @deprecated since Forestry 5.5.4. Use {@link #growFlower(String, World, IIndividual, BlockPos, Collection)}
*/
@Deprecated
boolean growFlower(String flowerType, World world, IIndividual individual, BlockPos pos);
}
@@ -14,17 +14,38 @@ import forestry.api.core.INbtWritable;
*/
public interface IGenome extends INbtWritable {
/**
* @return The active species of this genome.
*/
IAlleleSpecies getPrimary();
/**
* @return The inactive species of this genome.
*/
IAlleleSpecies getSecondary();
/**
* @return A array with all chromosomes of this genome.
*/
IChromosome[] getChromosomes();
/**
* @return The active allele of this chromosome type.
*/
IAllele getActiveAllele(IChromosomeType chromosomeType);
/**
* @return The inactive allele of this chromosome type.
*/
IAllele getInactiveAllele(IChromosomeType chromosomeType);
/**
* @return true if the given other IGenome has the amount of chromosomes and their alleles are identical.
*/
boolean isGeneticEqual(IGenome other);
/**
* @return The root of this species and describes the class of species of this genome.
*/
ISpeciesRoot getSpeciesRoot();
}
Loaded 100 of 994 files, more files were not shown because too many files have changed in this diff. Show more