Compare commits

...
191 Commits
Author SHA1 Message Date
mezz 76f09be39d Close #1838 Make IHiveFrame's getBeeModifier() ItemStack aware 2017-09-04 13:52:32 -07:00
LachimHeigrim e6cb758e0e Fix #1827 Allow Natura nether saplings to be autofarmed in arboreal farm (#1829) 2017-09-01 19:58:46 -07:00
mezz b3549edf51 Fix #1833 Item in players hand get deleted by farm planting 2017-08-29 22:14:47 -07:00
mezz e09d159935 Fix breeding data desync after changing dimensions 2017-08-29 20:55:31 -07:00
Nedelosk 4cb2610b1c Fix #1830 Carpenter removes the wrong item 2017-08-28 16:03:12 +02:00
mezz c44f11cf09 Update dependencies 2017-08-27 14:56:59 -07:00
mezz b69c31ed8a Clean up generics for Forestry ItemBlocks 2017-08-25 21:14:13 -07:00
mezz 6a2231f8fb Fix a crash when escritoire loads with a specimen already in it 2017-08-22 23:00:27 -07:00
mezz a3a6c71c42 Fix #1762 Swapping specimens in the escritoire has strange effects 2017-08-22 22:46:13 -07:00
mezz 8d5c0c6f8b Fix #1806 Allow sapling's products to work as hint items in escritoire 2017-08-22 22:37:35 -07:00
mezz 56603fd00c Fix #1813 Saplings do not drop when removed by water of piston 2017-08-22 22:10:47 -07:00
mezz ed69411d2e Fix #1815 Stop MultiFarm from converting vanilla saplings 2017-08-22 21:45:55 -07:00
mezz e1d017f077 Fix #1819 Crash when growing short Sipiri trees 2017-08-20 22:24:53 -07:00
mezz 9269af7a13 Update to 1.12.1 2017-08-18 20:17:18 -07:00
Nedelosk 8ffdba5021 Fix build script 2017-08-17 13:59:39 +02:00
Nedelosk e00aecd886 Fix #1807 Honeycomb block uncraftable 2017-08-16 19:26:15 +02:00
Nedelosk 98f859f2fb Add a log message to the Create Model 2017-08-16 14:48:11 +02:00
mezz 55a15d23b2 Fix Pam's harvestcraft integration 2017-08-14 21:19:29 -07:00
mezz 307580aed8 Mark as working on 1.12.1 on CurseForge 2017-08-13 22:06:46 -07:00
Nedelosk d2d93004e0 Merge pull request #1801 from asiekierka/mc-1.12
Reduce SimpleModel memory usage
2017-08-13 18:21:02 +02:00
Adrian Siekierka e1df424bfd reduce SimpleModel memory usage 2017-08-13 16:35:26 +02:00
Robert Obermeier 6a75347b05 Add Red Orchid support to farm (#1800) 2017-08-12 17:09:00 -07:00
Robert Obermeier cfd513ea80 Fix Natura support (#1794) 2017-08-12 15:50:31 -07:00
Robert Obermeier edcc47a6b3 Fix #1753 Add generalized sapling support (#1798) 2017-08-12 14:44:16 -07:00
mezz 6593118f3d Fix #1787 Wood logs drop the wrong item when harvested with silk touch 2017-08-12 12:39:59 -07:00
Robert Obermeier fd724d147a Fix #1789 The End has no hives. (#1795) 2017-08-11 20:56:12 -07:00
mezz b2e1b2dc9b Fix tree generation with Mystcraft 2017-07-29 15:42:34 -07:00
mezz defc47000b Fix client visual glitch with worktable 2017-07-29 00:56:34 -07:00
mezz 0a37ad0666 First beta version 2017-07-28 23:31:04 -07:00
mezz 13d4907bff #1687 Fix crash when genetics items are missing nbt 2017-07-28 23:28:43 -07:00
mezz 78725009c1 Fix #1777 crash on load from backpacks 2017-07-28 23:13:51 -07:00
mezz a1bc9144bd Fix #1768 fix serious issues with the worktable 2017-07-27 22:39:49 -07:00
Nedelosk b897056824 Fix #1772 crash if forestry.factory=false 2017-07-28 00:11:03 +02:00
Nedelosk 87563b6c97 Merge remote-tracking branch 'origin/mc-1.12' into mc-1.12 2017-07-25 16:01:11 +02:00
Nedelosk 62d6294da2 Fix Fertilizer Config from 1.10 to 1.11 / 1.12 2017-07-25 16:01:01 +02:00
Robert Obermeier b4d71543db Move hives into biome decoration generation
fixes #1760
2017-07-24 22:33:21 -07:00
mezz 73db1a608a Fix #1741 Fix recipes for farm blocks only allow quartz 2017-07-17 23:41:18 -07:00
Brennan Ward 1c6b60122e Update to AA r115 2017-07-15 17:51:15 -07:00
mezz 1e7a042b53 Fix missing item/block event handling 2017-07-12 22:47:26 -07:00
mezz bf08336bc5 Fix JEI dependency info 2017-07-09 21:02:15 -07:00
mezz 62cbf31ac2 Version 5.4.3 2017-07-03 17:22:56 -07:00
mezz a2eac214b4 Minor cleanup 2017-07-03 17:22:39 -07:00
Nedelosk 32933ce90b Merge remote-tracking branch 'origin/mc-1.12' into mc-1.12 2017-07-04 02:15:42 +02:00
Nedelosk 44cdc191fc Fix #1732 Forestry - Blocks all look the same when placed 2017-07-04 02:15:30 +02:00
mezz e4f77e42d3 Fix #1237 Fireproof blocks work as fuel 2017-07-03 16:52:45 -07:00
mezz 9f91832c7e Experiment updating Gradle Wrapper to 4.0 2017-07-03 15:26:50 -07:00
mezz 6d4af0fb5d Version 5.4.2 2017-07-03 00:17:10 -07:00
mezz 4345739a87 Merge remote-tracking branch 'origin/mc-1.11' into mc-1.12 2017-07-03 00:15:34 -07:00
mezz 0a881a81f8 Fix worktable crafting (#1728) 2017-07-03 00:12:58 -07:00
mezz b066f7ad4c Create proper recipe registry names 2017-07-03 00:06:31 -07:00
mezz a19380347a Fix missing textures on butterfly items (#1730) 2017-07-02 21:31:49 -07:00
mezz 9bc1211e57 Fix missing textures on machine tabs (#1730) 2017-07-02 21:31:29 -07:00
mezz cbce5d0fc0 Cleanup 2017-07-02 21:31:03 -07:00
mezz b20b56c5d4 Update Forge 2017-07-02 21:30:40 -07:00
mezz 27041c205c Fix #1723 Items show in the wrong creative tabs 2017-07-02 01:00:28 -07:00
mezz 00504d4096 Version 5.4.1 2017-07-02 00:51:29 -07:00
mezz ed0c5e1a7e Move away from deprecated JEI classes 2017-07-02 00:51:06 -07:00
mezz ddf90f4ee0 Update Forge to Recommended Build 2017-07-02 00:47:37 -07:00
mezz 39290512cf Fix GUIs drawing without the black background 2017-06-26 20:02:45 -07:00
Nedelosk 09ea20729d Improve Wood Model Loader 2017-06-26 14:00:41 +02:00
Nedelosk 736e6c5fa2 Change wood texture json file name 2017-06-25 15:33:00 +02:00
Nedelosk e96f4fc8a0 Fix Fence Gate Model 2017-06-25 11:55:25 +02:00
mezz bbe1f539dd Update cursegradle plugin 2017-06-24 22:22:42 -07:00
mezz 1fcaacd41b Stop using some deprecated methods and classes 2017-06-24 22:10:55 -07:00
mezz 7306764c51 Initial update to Minecraft 1.12 2017-06-24 21:49:47 -07:00
Nedelosk d3c7280f3f Fix #1712 1.11.2 Ferementer does not work when sappinessHigh 2017-06-23 20:23:38 +02:00
Nedelosk 2c6ed06574 More Recipe Clean Up 2017-06-23 18:56:30 +02:00
Nedelosk 81e2e18089 Clean Up Carpenter and Fabricator RecipeManagers 2017-06-23 18:50:51 +02:00
Nedelosk 7b7e7eb7e7 Update formatting-settings to 1.11.2
Changed IMPORT_LAYOUT cpw.mods.fml to net.minecraftforge.fml
2017-06-23 18:30:39 +02:00
Nedelosk 944aaf3297 Fix #1715 Forestry 1.11.2 trees spawn even when disabled in config 2017-06-22 14:57:47 +02:00
Nedelosk 5a5793f243 Fix forestry slab brightness 2017-06-22 14:54:40 +02:00
Nedelosk 5e41a4d2c0 Fix #1676 Soldering Iron usage has insufficient server-side validation 2017-06-21 22:01:46 +02:00
Nedelosk c4ac0bc7a5 Fix #1685 1.11.2 crashing when rendering item 2017-06-21 21:53:11 +02:00
Nedelosk 5549cfaaa1 Fix #1674 Forestry logs do not triggers Getting Wood Achievement 2017-06-21 21:45:56 +02:00
Nedelosk ae4d246c59 Fix #1690 Backpack does not resupply the offhand 2017-06-21 21:45:22 +02:00
Nedelosk 2622557a00 Fix #1702 Slabs not blocking light 2017-06-21 20:58:42 +02:00
Nedelosk 339abedeee Fix 1.11 Bees do damage on peaceful mode 2017-06-21 20:47:03 +02:00
Nedelosk 149b35224a Fix #1714 Wax cast negative durability 2017-06-21 20:34:38 +02:00
Nedelosk d148279224 Fix Bottler JEI integration 2017-06-18 01:45:53 +02:00
Nedelosk 554fe8bad1 Add tintindex to the door models 2017-06-17 13:59:00 +02:00
Nedelosk 27e8259ff6 Move the bee allele register event to the preInit 2017-06-15 19:50:48 +02:00
mezz 3a51df154a Update JEI integration 2017-06-06 23:50:11 -07:00
mezz a3c79c0427 Fix leaves spawning near 0,0,0 2017-06-04 13:34:59 -07:00
mezz f569a04797 Fix backpack pickup handler 2017-05-10 15:27:01 -07:00
mezz 610ddfed12 Update dependencies 2017-05-10 15:18:53 -07:00
mezz 438883bb8e Change IAllele.getName to IAllele.getAlleleName to fix obfuscation bugs 2017-05-10 00:06:30 -07:00
mezz 828dd63acd Fix #1681 Worldgen leaves are not decaying 2017-05-07 17:40:31 -07:00
mezz f7cc35d949 Add new default leaf block without tile entity for worldgen trees #1661 2017-05-03 17:15:58 -07:00
AlexIIL ec9004b50b Fix names in BC|Transport compat
As with the update to 1.11 BC|Transport now has a modid of "buildcrafttransport", and the pipeWaterproof has been renamed to "waterproof".

You *might* want to rename this plugin from "BuildCraft 6 Transport" to "BuildCraft 8 Transport" - but that's minor.

The api for getting BC items is [here](https://github.com/BuildCraft/BuildCraftAPI/blob/8.0.x/api/buildcraft/api/BCItems.java#L123), so thet's where the registry names came from (and they won't be changed in 8.0.x or 7.99.x) in case I've made a mistake.
2017-04-29 13:19:25 -07:00
Nedelosk 8b4c1a5dab Fix #1667 Unable to open Electrical Engine GUI 2017-04-22 00:18:02 +02:00
Nedelosk 853355062e Fix #1666 Crash 1.11.2 2017-04-21 22:34:00 +02:00
Nedelosk 834e3ed55a Readd Ic2 Integration 2017-04-21 22:30:37 +02:00
Nedelosk 5b2b0bfc95 Fix #1657 Charcoal Pit - Silk Touch 2017-04-11 21:35:02 +02:00
Nedelosk 4fae8c26d9 Allow other mods to register fruit blocks 2017-04-10 01:19:49 +02:00
Nedelosk 0aa4a0f794 Add AlleleRegisterEvent 2017-04-10 00:23:39 +02:00
Nedelosk ac0864303c Clean Up Climate Region 2017-04-08 20:46:57 +02:00
Nedelosk 8811b24811 Merge branch 'mc-1.11' of https://github.com/ForestryMC/ForestryMC into mc-1.11 2017-04-08 19:37:15 +02:00
Nedelosk 904293f407 Move go home to get getBlockPathWeight 2017-04-08 19:37:07 +02:00
mezz 3e175aa8e6 Use improved Forge LootTableLoadEvent, remove hacky LootTableLoader 2017-04-07 22:09:44 -07:00
Nedelosk c4ecdde110 Fix #1426 A way to change how much sand an tree multifarm gives when a tree grows 2017-04-07 21:44:20 +02:00
Nedelosk 4aa978023d Fix #1539 Immersive engineering Ethanol doesn’t work with Bio Generator 2017-04-07 19:46:46 +02:00
Nedelosk 50009786d8 Fix #1546 Electric Engine via MFSU 2017-04-07 19:10:19 +02:00
Nedelosk 032d706fc4 Fix #1594 EnderLillySeeds not accept for farm 2017-04-07 18:37:52 +02:00
Nedelosk dcd9e90898 Fix butterfly pollen 2017-04-07 18:29:03 +02:00
Nedelosk bab3479cde Add Cache to greenhouse nursery and clean up 2017-04-07 17:45:45 +02:00
Nedelosk a5b79c97d2 Improve greenhouse recipes 2017-04-07 14:12:42 +02:00
Nedelosk 05d6dc3d4a Fix greenhouse door model 2017-04-07 13:29:25 +02:00
Nedelosk 6e2ed37e80 Fix #1652 A way to make Cobwebs out of Silk Wisps and fix greenhouse item models 2017-04-07 13:21:39 +02:00
Nedelosk c840945706 Add missing changes 2017-04-07 13:10:28 +02:00
Nedelosk ca7d6dbc66 Add honey comb blocks and improve greenhouse nursery 2017-04-07 12:55:34 +02:00
Nedelosk 81ef5d536f Add missing changes 2017-04-06 01:11:27 +02:00
Nedelosk f911100c3d Clean Up and update version 2017-04-06 00:17:41 +02:00
Nedelosk 386f0645a5 Fix #627 Make a simpler API interface for IFarmLogic and improve the farm api 2017-04-06 00:13:15 +02:00
Nedelosk 91d46d1331 Fix #1440 Chisel Blocks do not render when used as Camo for Forestry Greenhouse blocks 2017-04-05 20:57:19 +02:00
Nedelosk e1eb4d25fb Fix Biogas Engine not noticing its generated power is being used 2017-04-05 15:54:57 +02:00
Nedelosk 72234d9b5d Fix #1537 Peat Engine not noticing its generated power is being used 2017-04-05 15:52:39 +02:00
Nedelosk 97f21bfda8 Fix #1643 gave wrong comb and now world wont load 2017-04-05 13:58:41 +02:00
Nedelosk c8c30073a2 Fix #1647 Method canDrain always returns true 2017-04-05 13:48:49 +02:00
mezz dc27154c1f Update JEI integration 2017-04-03 17:20:38 -07:00
SirSengir 5b15e6f405 Allow short mead cans/capsules to be drunk. 2017-03-26 20:51:20 +02:00
SirSengir 2530a7fb15 Remove mead as well. 2017-03-26 16:18:48 +02:00
SirSengir 4ec1381fbe Merge branch 'mc-1.11' of https://github.com/ForestryMC/ForestryMC into mc-1.11 2017-03-26 16:10:26 +02:00
SirSengir d97f6f69b0 Remove the infuser and associated gui. Port recipes to potions. 2017-03-26 16:10:12 +02:00
mezz c8fcb292d4 Fix sided config options 2017-03-26 06:20:21 -07:00
Nedelosk e075fe8fbf Fix #1640 Clientside crash when trying to access Statistics "Items" screen 2017-03-26 14:26:23 +02:00
Nedelosk 5ce9b9f65b Fix #1639 Thermionic Fabricator & Glass Pane 2017-03-26 14:22:54 +02:00
Nedelosk 2c9a30db73 Fix #1639 Thermionic Fabricator & Glass Pane 2017-03-26 14:21:31 +02:00
Nedelosk 4a31215ce1 Fix #1624 Crashing 2017-03-17 21:15:52 +01:00
Nedelosk 4da5e86813 Remove butterfly hatch and add butterfly nursery 2017-03-17 20:26:43 +01:00
Nedelosk 66bdedd65b Fix #1621 Some Butterflies have missing textures 2017-03-10 23:37:08 +01:00
mezz 0149013579 Use TileUtil for getting tiles from the world 2017-03-10 00:16:44 -08:00
mezz bebf5b3aec Fix canNurse because butterflies cannot convert vanilla leaves 2017-03-09 23:26:37 -08:00
mezz 0356a3f479 Prevent butterflies from converting vanilla leaves to Forestry leaves 2017-03-09 22:32:43 -08:00
Nedelosk d29aa13377 Fix #1616 Smarter tree generation 2017-03-07 22:25:18 +01:00
Nedelosk c2313c7569 Fix cocoon 2017-03-07 21:19:37 +01:00
Nedelosk bb28a6db48 Fix #1592 Carpenter recipe for Portable Analyzer asks for Magenta Stained Glass Pane 2017-03-06 19:55:12 +01:00
Nedelosk f61f7a0aff Remove walnut and chestnut from the tree generation list 2017-03-06 17:53:36 +01:00
Nedelosk 84f01de7f9 Improve cocoon positions 2017-03-06 16:45:08 +01:00
Nedelosk ced6f3cbf2 Fix #872 Clean Up and add tree generaton 2017-03-06 15:49:12 +01:00
Nedelosk bbec31fc6e Fix #1573 Butterfly shift stats don't match analyzer stats 2017-03-05 16:37:11 +01:00
Nedelosk 67024ffb2b Fix #1394 Add podzol as an alternative to mycelium 2017-03-05 16:27:28 +01:00
Nedelosk 1945c4ff70 Fix #1484 Add podzol recipe to the moistener 2017-03-05 15:57:15 +01:00
Nedelosk 7a1e35e05f Fix #1569 Can't See Capsule/Can Recipes 2017-03-05 14:55:35 +01:00
Nedelosk 06adb53944 Fix #1610 1.11.2 - Multiblocks not assembling? 2017-03-03 22:14:43 +01:00
Nedelosk 919ce8238b Fix #1590 [1.11.2] Tin tubes creating in the carpenter without tin. 2017-02-26 20:54:48 +01:00
Nedelosk 6f285d1c88 Fix #1608 Thermionic Fabricator crash 2017-02-26 20:26:51 +01:00
Nedelosk af9ddb4928 Fix server packets on singeplayer 2017-02-26 20:17:52 +01:00
Nedelosk 1d2f3f16ab Fix #1582 Error in log related to forestry 2017-02-25 20:53:31 +01:00
Nedelosk 7f63ae8450 Fix #1600 backpackt2.png not found 2017-02-25 20:33:01 +01:00
Nedelosk 77ecd03416 Fix #1607 Wrong calculation for stamps in letters 2017-02-25 19:48:37 +01:00
Nedelosk 56a907dbec Fix Cocoon 2017-02-19 21:59:28 +01:00
mezz e93633d999 Add proper @SideOnly(Side.CLIENT) annotations
with help from Minecraft Dev Plugin
https://plugins.jetbrains.com/idea/plugin/8327-minecraft-development
2017-02-14 21:12:09 -08:00
mezz fc0d144508 Fix #1595 DataParameter ID issue caused by Forestry carts 2017-02-12 17:05:22 -08:00
mezz 252dd8ab22 Add IAlleleRegistry#addValidAlleleTypes 2017-02-08 22:51:46 -08:00
mezz 6ef41d4cd8 Allow IWoodTypes besides EnumForestryWoodType to use Forestry models 2017-02-08 22:31:40 -08:00
mezz 0b08780964 Fix pipetting small amounts of liquid 2017-02-08 22:31:40 -08:00
Nedelosk 1cf24982fd Merge pull request #1588 from Ellpeck/mc-1.11
fix Actually Additions integration
2017-02-04 17:03:17 +01:00
Ellpeck 9555005ac0 fix actually additions integration 2017-02-04 16:59:56 +01:00
Nedelosk 00b4b6552c Fix #1568 Oredict carpenter problem 2017-01-31 14:23:22 +01:00
Nedelosk 23a9af3020 Fix TreeFactory 2017-01-24 11:13:34 +01:00
Nedelosk 84a14811d8 Merge branch 'mc-1.11' of https://github.com/ForestryMC/ForestryMC into mc-1.11 2017-01-24 11:11:32 +01:00
Nedelosk 7b340fdb49 Add ILeafProvider 2017-01-24 11:11:24 +01:00
mezz 9044a72aee Fix #1572 All trees have apple oak leaves 2017-01-21 19:35:17 -08:00
mezz cc40bd1cc3 Expose WoodAccess registration to the API 2017-01-20 23:00:33 -08:00
mezz a13e63cb2d Fix #1566 Incompatibility with Schematica 2017-01-14 11:08:47 -08:00
Nedelosk 6cb3b73200 Add minecraft curseforge link 2017-01-12 16:34:25 +01:00
Nedelosk 7c8d81470d Add issue template and clean up .gitignore 2017-01-12 16:01:26 +01:00
Nedelosk ef3f64fdd9 Upadate README.md to 1.11 2017-01-12 15:51:07 +01:00
Nedelosk fdd6d75d0e Improve cocoons 2017-01-12 15:44:30 +01:00
Nedelosk 46bb2cdccd Add missing code 2017-01-12 15:37:41 +01:00
Nedelosk aa21b31392 Clean Up Wood Textures 2017-01-12 15:19:21 +01:00
Nedelosk 6a12e19798 Clean Up Wood Model Loader 2017-01-12 13:29:31 +01:00
mezz 81dd20b41c Prevent exception from accessing tile entities from ChunkCache 2017-01-09 12:25:33 -08:00
mezz 0b491f26fc Fix #1561 Crash when using the carpenter 2017-01-08 03:36:43 -08:00
mezz bb0a0343c1 Fix #1563 Crash when viewing bee trades with a villager 2017-01-08 03:20:40 -08:00
mezz 17e38e7c5e Fix #1565 Farm crash when farmland on at least one side is missing 2017-01-08 03:01:06 -08:00
Nedelosk 0ad3baecda Fix #1564 Gamecrash while trying to craft golden electron tube 2017-01-08 01:06:26 +01:00
mezz a72971e042 Fix #1562 Carpenter recipes not showing properly in JEI 2017-01-07 01:10:16 -08:00
mezz b5e24e84cb Fix #1560 network sync issue for genome tracker when player logs in 2017-01-06 23:53:24 -08:00
Nedelosk c210886400 Fix #1559 2017-01-05 16:16:10 +01:00
Nedelosk 1bdbb7e9f8 Clean Up Models, Jei and IInduvidual translators 2017-01-04 23:26:47 +01:00
Nedelosk f91c0574ad Clean Up 2017-01-03 17:01:30 +01:00
Nedelosk 50f0efb7a0 Update Module 2017-01-03 02:35:57 +01:00
Nedelosk 3d932700cd Fix carpenter and thermionic fabricator recipes 2017-01-03 02:32:45 +01:00
Nedelosk 6a00a65aac Update lang Module 2017-01-02 23:22:06 +01:00
Nedelosk 1b781684a0 Improve charcoal pile 2017-01-02 23:21:48 +01:00
mezz f2d280a861 Clean up backpack resupply handler 2017-01-02 12:08:11 -08:00
Nedelosk 87ce642235 Make that the multiblocks error renderers are only work with naturalist eyes 2017-01-01 20:19:15 +01:00
Nedelosk b297bbb2c4 Fix #1556 Log Piles Missing Models 2017-01-01 20:15:13 +01:00
Nedelosk 931e518ca2 Add multiblock tooltips and error game overlay renderer 2017-01-01 04:09:29 +01:00
Nedelosk 7ff4944281 Clean Up greenhouse 2017-01-01 03:06:36 +01:00
862 changed files with 14211 additions and 13157 deletions

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
Thank you for reporting!
For issues:
* Try the latest version, it may have fixed the issue already.
* If you crashed, please paste the crash log to [gist](https://gist.github.com/) and link it here.
+3 -3
View File
@@ -2,11 +2,10 @@
/*
# folders
!/.github
!/forestry_techne
!/gradle/wrapper
!/src
!/api
!/test
# files
!/.gitignore
@@ -21,4 +20,5 @@
!/build.xml
!/gradlew
!/gradlew.bat
.DS_Store
!/cla-signatures.txt
!/formatting-settings.jar
+3 -3
View File
@@ -1,4 +1,4 @@
Forestry
[Forestry](https://minecraft.curseforge.com/projects/forestry/files)
====================================
### What is it?
@@ -9,7 +9,7 @@ Forestry is a modification for the game Minecraft and known primarily for its fa
[Wiki](http://forestry.sengir.net/)
[Latest Builds for 1.10 / 1.10.2](http://jenkins.ic2.player.to/job/Forestry_5/)
[Latest Builds for 1.11 / 1.11.2](http://jenkins.ic2.player.to/job/Forestry_1.11/)
[IRC #forestry on esper.net](http://webchat.esper.net/?nick=ForestryGithub...&channels=forestry&prompt=1)
@@ -17,7 +17,7 @@ For those interested in developement, you can also visit #forestry-dev.
### Building
The API and localization files reside in their own repository. It is pulled in automatically.
The localization files reside in their own repository. It is pulled in automatically.
You may want to adjust the "./gradle.properties" file to set your mc account as needed.
Executable → Regular
+15 -23
View File
@@ -4,16 +4,18 @@ buildscript {
maven { url = "http://files.minecraftforge.net/maven" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath "gradle.plugin.se.bjurr.gitchangelog:git-changelog-gradle-plugin:1.47"
}
}
plugins {
id "com.matthewprenger.cursegradle" version "1.0.7"
id "se.bjurr.gitchangelog.git-changelog-gradle-plugin" version "1.32"
id "com.matthewprenger.cursegradle" version "1.0.9"
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: "se.bjurr.gitchangelog.git-changelog-gradle-plugin"
version = version_major + '.' + version_minor + '.' + version_patch + '.' + getBuildNumber()
if (project.hasProperty('buildQualifier')) {
@@ -26,8 +28,8 @@ ext.dirDest = './build/dist'
ext.dirLang = "./lang"
// java version
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
minecraft {
version = mcversion + "-" + forgeversion
@@ -60,10 +62,10 @@ repositories {
}
dependencies {
deobfCompile "net.darkhax.tesla:Tesla:${tesla_version}"
deobfCompile "mezz.jei:jei_${mcversion}:${jei_version}:api"
runtime "mezz.jei:jei_${mcversion}:${jei_version}"
// deobfCompile "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
deobfCompile "net.darkhax.tesla:Tesla-${tesla_mcversion}:${tesla_version}"
deobfCompile "mezz.jei:jei_${jei_mcversion}:${jei_version}:api"
runtime "mezz.jei:jei_${jei_mcversion}:${jei_version}"
deobfCompile "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
}
configurations {
@@ -149,27 +151,17 @@ task makeChangelog(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {
untaggedName = "Current release ${project.version}"
fromCommit = "5a3850c2642e535656d090d1473054d5fa8d3331"
toRef = "HEAD"
templateContent = """
Alpha version, still buggy. Do not create a world you care about with this version, it can and will break things severely.<br/>
Please help the project by trying it out and <a href="https://github.com/ForestryMC/ForestryMC/issues">reporting issues here.</a><br/>
{{#tags}}
<h3>{{name}}</h3>
<ul>
{{#commits}}
<li>{{{message}}} - {{authorName}}</li>
{{/commits}}
</ul>
{{/tags}}
"""
templateContent = file('changelog.mustache').getText('UTF-8')
}
curseforge {
apiKey = project.hasProperty('curseforge_apikey') ? project.curseforge_apikey : '0'
project {
id = '59751'
id = curse_project_id
changelog = file('changelog.html')
changelogType = 'html'
releaseType = 'alpha'
releaseType = 'beta'
addGameVersion '1.12'
}
}
+9
View File
@@ -0,0 +1,9 @@
Please help the Forestry project by <a href="https://github.com/ForestryMC/ForestryMC/issues">reporting issues here.</a><br/>
{{#tags}}
<h3>{{name}}</h3>
<ul>
{{#commits}}
<li>{{{message}}} - {{authorName}}</li>
{{/commits}}
</ul>
{{/tags}}
Binary file not shown.
Regular → Executable
+11 -8
View File
@@ -1,11 +1,14 @@
mcversion=1.11.2
forgeversion=13.20.0.2201
mcp_mappings=snapshot_20161220
mcversion=1.12.1
forgeversion=14.22.0.2462
mcp_mappings=snapshot_20170826
curse_project_id=59751
tesla_version=1.11-1.3.0.51
jei_version=4.2.0.211
#ic2_version=2.6.76-ex110
tesla_version=1.0.60
tesla_mcversion=1.12
jei_version=4.7.8.91
jei_mcversion=1.12.1
ic2_version=2.8.17-ex112
version_major=5
version_minor=3
version_patch=0
version_minor=5
version_patch=1
Binary file not shown.
+6 -6
View File
@@ -1,6 +1,6 @@
#Mon Sep 14 12:28:28 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip
#Mon Jul 03 15:24:47 PDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip
Vendored
+1 -5
View File
@@ -42,11 +42,6 @@ case "`uname`" in
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
@@ -114,6 +109,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+1 -1
Submodule lang updated: d39f07201c...192d6f8584.
+35 -27
View File
@@ -10,10 +10,28 @@
******************************************************************************/
package forestry;
import com.google.common.base.Preconditions;
import javax.annotation.Nullable;
import java.io.File;
import com.google.common.base.Preconditions;
import forestry.plugins.compat.PluginNatura;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInterModComms;
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;
import forestry.api.core.ForestryAPI;
import forestry.core.EventHandlerCore;
import forestry.core.climate.ClimateEventHandler;
@@ -26,22 +44,9 @@ import forestry.core.gui.GuiHandler;
import forestry.core.multiblock.MultiblockEventHandler;
import forestry.core.network.PacketHandler;
import forestry.core.proxy.Proxies;
import forestry.core.utils.MigrationHelper;
import forestry.core.worldgen.WorldGenerator;
import forestry.plugins.PluginManager;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInterModComms;
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCEvent;
import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;
import forestry.plugins.compat.PluginIC2;
/**
* Forestry Minecraft Mod
@@ -50,13 +55,14 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
*/
@Mod(
modid = Constants.MOD_ID,
name = "Forestry",
name = Constants.MOD_NAME,
version = Constants.VERSION,
guiFactory = "forestry.core.config.ForestryGuiConfigFactory",
acceptedMinecraftVersions = "[1.11]",
dependencies = "required-after:forge@[13.19.1.2189,);"
+ "after:JEI@[4.1.1,);")
// + "after:" + PluginIC2.modId + ";")
acceptedMinecraftVersions = "[1.12, 1.12.1]",
dependencies = "required-after:forge@[14.21.1.2395,);"
+ "after:jei@[4.7.0,);"
+ "after:" + PluginIC2.modId + ";"
+ "after:" + PluginNatura.modId + ";")
public class Forestry {
@SuppressWarnings("NullableProblems")
@@ -71,6 +77,7 @@ public class Forestry {
ForestryAPI.errorStateRegistry = new ErrorStateRegistry();
EnumErrorCode.init();
FluidRegistry.enableUniversalBucket();
MinecraftForge.EVENT_BUS.register(this);
}
@Nullable
@@ -90,9 +97,10 @@ public class Forestry {
MinecraftForge.EVENT_BUS.register(eventHandlerCore);
MinecraftForge.EVENT_BUS.register(new MultiblockEventHandler());
MinecraftForge.EVENT_BUS.register(new ClimateEventHandler());
Proxies.common.registerEventHandlers();
configFolder = new File(event.getModConfigurationDirectory(), Constants.MOD_ID);
Config.load();
Config.load(event.getSide());
PluginManager.runSetup(event);
@@ -100,8 +108,13 @@ public class Forestry {
Preconditions.checkState(gameMode != null);
ForestryAPI.activeMode = new GameMode(gameMode);
PluginManager.runPreInit();
PluginManager.runPreInit(event.getSide());
}
@SubscribeEvent
public void registerModels(ModelRegistryEvent event) {
PluginManager.runRegisterBackpacksAndCrates();
Proxies.render.registerModels();
}
@@ -144,9 +157,4 @@ public class Forestry {
public void processIMCMessages(IMCEvent event) {
PluginManager.processIMCMessages(event.getMessages());
}
@EventHandler
public void onMissingMappings(FMLMissingMappingsEvent event) {
MigrationHelper.onMissingMappings(event);
}
}
@@ -7,6 +7,8 @@ package forestry.api.apiculture;
import forestry.api.genetics.IAlleleEffect;
import forestry.api.genetics.IEffectData;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public interface IAlleleBeeEffect extends IAlleleEffect {
@@ -28,6 +30,7 @@ public interface IAlleleBeeEffect extends IAlleleEffect {
* @param housing {@link IBeeHousing} the bee currently resides in.
* @return storedData, may have been manipulated.
*/
@SideOnly(Side.CLIENT)
IEffectData doFX(IBeeGenome genome, IEffectData storedData, IBeeHousing housing);
}
@@ -16,6 +16,8 @@ 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.
@@ -54,6 +56,7 @@ public interface IBee extends IIndividualLiving {
IEffectData[] doEffect(IEffectData[] storedData, IBeeHousing housing);
@SideOnly(Side.CLIENT)
IEffectData[] doFX(IEffectData[] storedData, IBeeHousing housing);
/**
@@ -13,6 +13,8 @@ import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
/**
* Stores beekeeping logic for bee housings.
@@ -62,12 +64,14 @@ public interface IBeekeepingLogic extends INbtWritable, INbtReadable {
* Whether bee fx should be active.
* Internally, this is automatically synced to the client.
*/
@SideOnly(Side.CLIENT)
boolean canDoBeeFX();
/**
* Display bee fx. Calls IBee.doFX(IEffectData[] storedData, IBeeHousing housing) on the queen.
* Internally, the queen is automatically synced to the client for the fx.
*/
@SideOnly(Side.CLIENT)
void doBeeFX();
/**
@@ -20,5 +20,18 @@ public interface IHiveFrame {
*/
ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear);
/**
* @param frame ItemStack containing the actual frame.
* @return the {@link IBeeModifier} for this frame.
* @since Forestry 5.5.1
*/
default IBeeModifier getBeeModifier(ItemStack frame) {
return getBeeModifier();
}
/**
* @deprecated since Forestry 5.5.1. Use {@link #getBeeModifier(ItemStack)}
*/
@Deprecated
IBeeModifier getBeeModifier();
}
@@ -8,7 +8,6 @@ package forestry.api.arboriculture;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IFruitFamily;
import forestry.core.utils.Translator;
import net.minecraft.util.text.translation.I18n;
public enum EnumFruitFamily implements IFruitFamily {
PRUNES("prunes", "Prunus domestica"),
@@ -41,8 +41,17 @@ public interface IAlleleTreeSpecies extends IAlleleSpecies, IAlleleProperty<IAll
* @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.
*/
float getRarity();
IWoodProvider getWoodProvider();
ILeafProvider getLeafProvider();
IGrowthProvider getGrowthProvider();
/* MODELS AND OVERRIDES */
@SideOnly(Side.CLIENT)
@@ -23,5 +23,15 @@ public interface IAlleleTreeSpeciesBuilder extends IAlleleSpeciesBuilder {
* Set the minecraft plant type for this tree. Default is Plains.
*/
IAlleleTreeSpeciesBuilder setPlantType(EnumPlantType type);
/**
* Set rarity of the species, will affect spawn rate in the world. Must be a float between 0 and 1. If it's 0, it will not spawn.
*/
IAlleleTreeSpeciesBuilder setRarity(float rarity);
/**
* Set the growth provider.
*/
IAlleleTreeSpeciesBuilder setGrowthProvider(IGrowthProvider growthProvider);
}
@@ -3,21 +3,18 @@
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.greenhouse;
package forestry.api.arboriculture;
import forestry.api.climate.IClimateInfo;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
public interface ITerrainRecipe {
boolean matches(IBlockState blockState);
IBlockState getResult();
IClimateInfo getMinClimate();
IClimateInfo getMaxClimate();
float getChance();
public interface ICharcoalPileWall {
int getCharcoalAmount();
boolean matches(IBlockState state);
NonNullList<ItemStack> getDisplyItems();
}
@@ -20,6 +20,7 @@ public interface IGermlingModelProvider {
@SideOnly(Side.CLIENT)
void registerModels(Item item, IModelManager manager, EnumGermlingType type);
@SideOnly(Side.CLIENT)
ModelResourceLocation getModel(EnumGermlingType type);
/**
@@ -0,0 +1,18 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.arboriculture;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
public interface IGrowthProvider {
boolean canSpawn(ITree tree, World world, BlockPos pos);
boolean isBiomeValid(ITree tree, Biome biome);
}
@@ -5,6 +5,12 @@
******************************************************************************/
package forestry.api.arboriculture;
public enum EnumGrowthConditions {
HOSTILE, PALTRY, NORMAL, GOOD, EXCELLENT
}
import net.minecraft.item.ItemStack;
public interface ILeafProvider {
void init(IAlleleTreeSpecies treeSpecies);
ItemStack getDecorativeLeaves();
}
@@ -19,6 +19,8 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public interface ITree extends IIndividual, ITreeGenData {
@@ -26,6 +28,7 @@ public interface ITree extends IIndividual, ITreeGenData {
IEffectData[] doEffect(IEffectData[] storedData, World world, BlockPos pos);
@SideOnly(Side.CLIENT)
IEffectData[] doFX(IEffectData[] storedData, World world, BlockPos pos);
@Override
@@ -31,6 +31,27 @@ public interface ITreeFactory {
*/
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()
* 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, ILeafProvider leafProvider);
/**
* Get one of the built-in Forestry leaf types. Default type is deciduous.
*/
@@ -6,6 +6,7 @@
package forestry.api.arboriculture;
import forestry.api.genetics.IGenome;
import net.minecraft.item.ItemStack;
public interface ITreeGenome extends IGenome {
@@ -37,4 +38,15 @@ public interface ITreeGenome extends IGenome {
int getGirth();
IAlleleLeafEffect getEffect();
/**
*
* @return A ItemStack that is used in getPickBlock of the leave block.
*/
ItemStack getDecorativeLeaves();
/**
* @return true if this genome matches one of the default template genomes
*/
boolean matchesTemplateGenome();
}
@@ -12,6 +12,7 @@ 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;
@@ -101,4 +102,6 @@ public interface ITreeRoot extends ISpeciesRootPollinatable {
/* MUTATIONS */
@Override
List<ITreeMutation> getMutations(boolean shuffle);
Collection<IFruitProvider> getFruitProvidersForFruitFamily(IFruitFamily fruitFamily);
}
@@ -27,4 +27,5 @@ public interface IWoodAccess {
List<IWoodType> getRegisteredWoodTypes();
void register(IWoodType woodType, WoodBlockKind woodBlockKind, boolean fireproof, IBlockState blockState, ItemStack itemStack);
}
@@ -26,7 +26,7 @@ public interface IWoodProvider {
* @return A stack of wood from the tree to craft wood pile's or other things.
*/
ItemStack getWoodStack();
/**
* The amount of charcoal dropped from a charcoal pile of this wood.
*/
@@ -5,6 +5,9 @@
******************************************************************************/
package forestry.api.arboriculture;
import java.util.ArrayList;
import java.util.List;
public class TreeManager {
/**
@@ -26,4 +29,6 @@ public class TreeManager {
* Used to create new tree mutations.
*/
public static ITreeMutationFactory treeMutationFactory;
public static List<ICharcoalPileWall> pileWalls = new ArrayList<>();
}
+8 -14
View File
@@ -1,29 +1,23 @@
package forestry.api.arboriculture;
import com.google.common.collect.ImmutableMap;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import com.google.common.collect.ImmutableMap;
import net.minecraftforge.client.model.IModel;
import net.minecraftforge.client.model.ModelProcessingHelper;
public enum WoodBlockKind {
LOG, PLANKS, SLAB, FENCE, FENCE_GATE, STAIRS, DOOR(false);
public final boolean retextureItem;
WoodBlockKind() {
this(true);
}
WoodBlockKind(boolean retextureItem) {
this.retextureItem = retextureItem;
LOG, PLANKS, SLAB, FENCE, FENCE_GATE, STAIRS, DOOR;
public String getName(){
return super.toString().toLowerCase(Locale.ENGLISH);
}
@Override
public String toString() {
return super.toString().toLowerCase(Locale.ENGLISH);
return getName();
}
public IModel retextureModel(IModel model, IWoodType type, ImmutableMap<String, String> customTextures) {
@@ -63,6 +57,6 @@ public enum WoodBlockKind {
break;
}
textures.putAll(customTextures);
return ModelProcessingHelper.retexture(model, new ImmutableMap.Builder<String, String>().putAll(textures).build());
return model.retexture(ImmutableMap.copyOf(textures));
}
}
@@ -8,13 +8,17 @@ package forestry.api.circuits;
import java.util.List;
import forestry.api.core.INbtWritable;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public interface ICircuitBoard extends INbtWritable {
@SideOnly(Side.CLIENT)
int getPrimaryColor();
@SideOnly(Side.CLIENT)
int getSecondaryColor();
@SideOnly(Side.CLIENT)
void addTooltip(List<String> list);
void onInsertion(Object tile);
@@ -8,6 +8,8 @@ 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.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -42,14 +44,16 @@ public class ForestryAPI {
@SideOnly(Side.CLIENT)
public static ITextureManager textureManager;
/**
* A {@link IModelManager} needed for some things in the API.
*/
@SideOnly(Side.CLIENT)
public static IModelManager modelManager;
public static IClimateManager climateManager;
/**
* A registry for register fertilizers, {@link IFarmabeles}s and {@link ISimpleFarmLogic}s
*/
public static IFarmRegistry farmRegistry;
/**
* The currently active {@link IGameMode}.
*/
+3 -2
View File
@@ -8,14 +8,15 @@ package forestry.api.core;
import javax.annotation.Nullable;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.client.model.IPerspectiveAwareModel;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public interface IModelBakerModel extends IPerspectiveAwareModel {
public interface IModelBakerModel extends IBakedModel {
void setGui3d(boolean gui3d);
@@ -6,6 +6,7 @@
package forestry.api.core;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -18,7 +19,7 @@ public interface ITextureManager {
/**
* Location of the Forestry Gui Texture Map.
* Used for binding with {@link net.minecraft.client.renderer.texture.TextureManager#bindTexture(ResourceLocation)}
* Used for binding with {@link TextureManager#bindTexture(ResourceLocation)}
*/
ResourceLocation getGuiTextureMap();
@@ -10,6 +10,7 @@ import java.util.Map;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import net.minecraft.item.ItemStack;
public class Farmables {
@@ -17,9 +18,15 @@ public class Farmables {
* Can be used to add IFarmables to some of the vanilla farm logics.
* <p>
* Identifiers: farmArboreal farmWheat farmGourd farmInfernal farmPoales farmSucculentes farmVegetables farmShroom
* @deprecated Please use {@link IFarmRegistry#registerFarmables(String, IFarmable...)} and {@link IFarmRegistry#getFarmables(String)}.
*/
@Deprecated
public static final Multimap<String, IFarmable> farmables = HashMultimap.create();
/**
* @deprecated Please use {@link IFarmRegistry#registerFertilizer(ItemStack, int)} and {@link IFarmRegistry#getFertilizeValue(ItemStack)}.
*/
@Deprecated
public static final Map<ItemStack, Integer> fertilizers = new LinkedHashMap<>();
}
@@ -7,6 +7,7 @@ package forestry.api.farming;
import java.util.Collection;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
@@ -33,6 +34,8 @@ public interface IFarmLogic {
IFarmLogic setManual(boolean manual);
void addSoil(ItemStack resource, IBlockState soilState, boolean hasMetaData);
@SideOnly(Side.CLIENT)
ResourceLocation getTextureMap();
@@ -0,0 +1,47 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.farming;
import java.util.Collection;
import net.minecraft.item.ItemStack;
public interface IFarmRegistry {
/**
* Registers farming logic in registry under given identifier
* @param identifier Valid identifiers: farmArboreal farmWheat farmGourd farmInfernal farmPoales farmSucculentes farmVegetables farmShroom
* @param logic corresponding instance of logic
*/
void registerFarmLogic(String identifier, IFarmLogic logic);
/**
* Can be used to add IFarmables to some of the vanilla farm logics.
* <p>
* Identifiers: farmArboreal farmWheat farmGourd farmInfernal farmPoales farmSucculentes farmVegetables farmShroom
*/
void registerFarmables(String identifier, IFarmable... farmable);
Collection<IFarmable> getFarmables(String identifier);
/**
* Can be used to create a simple version of a farm logic, like the vanilla vegetable or wheat farm logic.
*/
IFarmLogic createLogic(ISimpleFarmLogic simpleFarmLogic);
/**
*
* @param itemStack
* @param value The value of the fertitlizer.The value of the forestry fertelizer is 500.
*/
void registerFertilizer(ItemStack itemStack, int value);
/**
* @return The value of the fertitlizer
*/
int getFertilizeValue(ItemStack itemStack);
}
@@ -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.farming;
import net.minecraft.item.ItemStack;
/**
* A simple version of the IFarmLogic.
*/
public interface ISimpleFarmLogic {
/**
* @return the itemStack that represents this farm logic. Used as an icon for the farm logic.
*/
ItemStack getIconItemStack();
Iterable<IFarmable> getSeeds();
String getName();
}
@@ -5,7 +5,7 @@
******************************************************************************/
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
@API(apiVersion = "2.1.0", owner = "ForestryAPI|core", provides = "ForestryAPI|farming")
@API(apiVersion = "2.2.0", owner = "ForestryAPI|core", provides = "ForestryAPI|farming")
package forestry.api.farming;
import javax.annotation.ParametersAreNonnullByDefault;
@@ -1,13 +0,0 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.food;
public class BeverageManager {
public static final IBeverageEffect[] effectList = new IBeverageEffect[128];
public static IInfuserManager infuserManager;
public static IIngredientManager ingredientManager;
}
@@ -5,12 +5,6 @@
******************************************************************************/
package forestry.api.genetics;
import java.util.HashMap;
import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
/**
* Holds a static reference to the {@link IAlleleRegistry}.
*/
@@ -20,16 +14,6 @@ public class AlleleManager {
*/
public static IAlleleRegistry alleleRegistry;
/**
* Translates plain leaf blocks into genetic data. Used by bees and butterflies to convert and pollinate foreign leaf blocks.
*/
public static final Map<Block, ILeafTranslator> leafTranslators = new HashMap<>();
/**
* Translates plain saplings into genetic data. Used by the treealyzer and the farm to convert foreign saplings.
*/
public static final Map<Item, ISaplingTranslator> saplingTranslation = new HashMap<>();
/**
* Queryable instance of an {@link IClimateHelper} for easier implementation.
*/
@@ -0,0 +1,22 @@
package forestry.api.genetics;
import forestry.api.arboriculture.IAlleleFruit;
import net.minecraftforge.fml.common.eventhandler.Event;
/**
* Called after Forestry has registered all his alleles of an specific type. Like IAlleleFruit or IAlleleSpecies
* @since 5.3.3
*/
public class AlleleRegisterEvent<A extends IAllele> extends Event {
private final Class<? extends A> alleleClass;
public AlleleRegisterEvent(Class<? extends A> alleleClass) {
this.alleleClass = alleleClass;
}
public Class<? extends A> getAlleleClass() {
return alleleClass;
}
}
@@ -1,15 +1,14 @@
package forestry.api.genetics;
import net.minecraftforge.fml.common.eventhandler.Event;
/**
* Called after Forestry has registered all his species alleles of a individual.
*/
public class AlleleSpeciesRegisterEvent extends Event {
public class AlleleSpeciesRegisterEvent<A extends IAlleleSpecies> extends AlleleRegisterEvent<A> {
private final ISpeciesRoot root;
public AlleleSpeciesRegisterEvent(ISpeciesRoot root) {
public AlleleSpeciesRegisterEvent(ISpeciesRoot root, Class<? extends A> alleleClass) {
super(alleleClass);
this.root = root;
}
@@ -28,9 +28,20 @@ public interface IAllele {
/**
* @return Localized short, human-readable identifier used in tooltips and beealyzer.
* @deprecated since Forestry 5.3.4. Use {@link #getAlleleName()}.
*/
@Deprecated
String getName();
/**
* @return Localized short, human-readable identifier used in tooltips and beealyzer.
* @since Forestry 5.3.4
* @apiNote This can't be named "getName" or it can conflict during obfuscation. https://github.com/md-5/SpecialSource/issues/12
*/
default String getAlleleName() {
return getName();
}
/**
* @return The unlocalized identifier
*/
@@ -109,6 +109,13 @@ public interface IAlleleRegistry {
*/
void registerAllele(IAllele allele, IChromosomeType... chromosomeTypes);
/**
* Add more valid chromosome types for an allele.
* Used by addons that create new chromosome types beyond bees, trees, and butterflies.
* @since Forestry 5.3.1
*/
void addValidAlleleTypes(IAllele allele, IChromosomeType... chromosomeTypes);
/**
* @return HashMap of all registered deprecated alleles and their corresponding replacements
*/
@@ -0,0 +1,20 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.genetics;
import javax.annotation.Nullable;
import net.minecraft.block.state.IBlockState;
/**
* Translates blockStates into genetic data.
* Used by bees and butterflies to convert and pollinate foreign leaf blocks.
*/
public interface IBlockTranslator<I extends IIndividual> extends IIndividualTranslator<I, IBlockState> {
@Nullable
@Override
I getIndividualFromObject(IBlockState blockState);
}
@@ -3,10 +3,11 @@
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.greenhouse;
package forestry.api.genetics;
public enum EnumGreenhouseEventType {
CAMOUFLAGE
import javax.annotation.Nullable;
public interface IIndividualTranslator<I extends IIndividual, O> {
@Nullable
I getIndividualFromObject(O objectToTranslator);
}
@@ -0,0 +1,19 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.genetics;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
/**
* Translates items into genetic data. Used by the treealyzer and the farm to convert foreign saplings.
*/
public interface IItemTranslator<I extends IIndividual> extends IIndividualTranslator<I, ItemStack> {
@Nullable
@Override
I getIndividualFromObject(ItemStack itemStack);
}
@@ -1,16 +0,0 @@
package forestry.api.genetics;
import javax.annotation.Nullable;
import forestry.api.arboriculture.ITree;
import net.minecraft.block.state.IBlockState;
/**
* Translates blockStates for a single plain leaf block into genetic data.
* Used by bees and butterflies to convert and pollinate foreign leaf blocks.
* Kept in a map with Block keys: {@link AlleleManager#leafTranslators}
*/
public interface ILeafTranslator {
@Nullable
ITree getTreeFromLeaf(IBlockState leafBlockState);
}
@@ -1,11 +0,0 @@
package forestry.api.genetics;
import javax.annotation.Nullable;
import forestry.api.arboriculture.ITree;
import net.minecraft.item.ItemStack;
public interface ISaplingTranslator {
@Nullable
ITree getTreeFromSapling(ItemStack sapling);
}
@@ -12,6 +12,7 @@ import java.util.Map;
import java.util.Random;
import com.mojang.authlib.GameProfile;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
@@ -65,6 +66,11 @@ public interface ISpeciesRoot {
IIndividual getMember(ItemStack stack);
IIndividual getMember(NBTTagCompound compound);
<O extends Object, I extends IIndividual> void registerTranslator(Object translatorKey, IIndividualTranslator<I, O> translator);
@Nullable
<O extends Object, I extends IIndividual> IIndividualTranslator<I, O> getTranslator(Object translatorKey);
@Nullable
ISpeciesType getType(ItemStack itemStack);
@@ -1,56 +0,0 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.greenhouse;
import forestry.api.multiblock.IGreenhouseController;
import net.minecraft.nbt.NBTTagCompound;
public class DefaultGreenhouseLogic implements IGreenhouseLogic {
public final IGreenhouseController controller;
private final String name;
public DefaultGreenhouseLogic(IGreenhouseController controller, String name) {
this.controller = controller;
this.name = name;
}
@Override
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
return nbt;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
}
@Override
public void work() {
}
@Override
public void onEvent(EnumGreenhouseEventType type, Object event) {
}
@Override
public IGreenhouseController getController() {
return controller;
}
@Override
public String getName() {
return name;
}
@Override
public void onMachineAssembled() {
}
@Override
public void onMachineDisassembled() {
}
}
@@ -5,10 +5,6 @@
******************************************************************************/
package forestry.api.greenhouse;
import javax.annotation.Nullable;
import forestry.api.core.ICamouflageHandler;
import forestry.api.core.ICamouflagedTile;
import forestry.api.multiblock.IGreenhouseController;
import net.minecraftforge.fml.common.eventhandler.Event;
@@ -20,24 +16,6 @@ public class GreenhouseEvents extends Event {
this.controller = state;
}
public static class CamouflageChangeEvent extends GreenhouseEvents {
@Nullable
public final ICamouflagedTile camouflagedBlock;
public final ICamouflageHandler camouflageHandler;
public final String camouflageType;
public CamouflageChangeEvent(IGreenhouseController controller, @Nullable ICamouflagedTile camouflagedBlock, ICamouflageHandler camouflageHandler, String camouflageType) {
super(controller);
this.camouflagedBlock = camouflagedBlock;
this.camouflageHandler = camouflageHandler;
this.camouflageType = camouflageType;
}
}
public static class InternalBlockEvent extends GreenhouseEvents {
public final IInternalBlock internalBlock;
@@ -1,11 +0,0 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.greenhouse;
public interface IGreenhouseClimaLogic extends IGreenhouseLogic {
}
@@ -6,12 +6,7 @@
package forestry.api.greenhouse;
import javax.annotation.Nullable;
import java.util.List;
import forestry.api.climate.IClimateInfo;
import forestry.api.multiblock.IGreenhouseController;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -23,14 +18,4 @@ public interface IGreenhouseHelper {
@Nullable
IGreenhouseController getGreenhouseController(World world, BlockPos pos);
void registerGreenhouseLogic(Class<? extends IGreenhouseLogic> logic);
List<Class<? extends IGreenhouseLogic>> getGreenhouseLogics();
void registerTerrainRecipe(Block inputBlock, IBlockState outputState, IClimateInfo minClimate, IClimateInfo maxClimate, float chance);
void registerTerrainRecipe(IBlockState inputState, IBlockState outputState, IClimateInfo minClimate, IClimateInfo maxClimate, float chance);
ITerrainRecipe getValidTerrainRecipe(IBlockState blockState, IClimateInfo climateInfo);
}
@@ -1,31 +0,0 @@
/*******************************************************************************
* 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
*
* Various Contributors including, but not limited to:
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
******************************************************************************/
package forestry.api.greenhouse;
import forestry.api.core.INbtReadable;
import forestry.api.core.INbtWritable;
import forestry.api.multiblock.IGreenhouseController;
public interface IGreenhouseLogic extends INbtWritable, INbtReadable {
void work();
void onEvent(EnumGreenhouseEventType type, Object event);
void onMachineAssembled();
void onMachineDisassembled();
IGreenhouseController getController();
String getName();
}
@@ -1,18 +0,0 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.greenhouse;
import forestry.api.climate.IClimateInfo;
public interface IOvergrowth {
IClimateInfo getMinClimate();
IClimateInfo getMaxClimate();
float getChance();
}
@@ -23,5 +23,8 @@ public interface IAlleleButterflyCocoon extends IAlleleProperty<IAlleleButterfly
String getCocoonName();
Map<ItemStack, Float> getCocoonLoot();
void clearLoot();
void addLoot(ItemStack loot, float chance);
}
@@ -5,8 +5,11 @@
******************************************************************************/
package forestry.api.lepidopterology;
import java.util.Set;
import javax.annotation.Nullable;
import forestry.api.core.IErrorState;
import forestry.api.genetics.IIndividualLiving;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
@@ -48,6 +51,27 @@ public interface IButterfly extends IIndividualLiving {
*/
@Nullable
IButterfly spawnCaterpillar(World world, IButterflyNursery nursery);
/**
* Determines whether the caterpillar can grow.
*
* @param cocoon the {@link IButterflyCocoon} the caterpillar resides in.
* @param nursery the {@link IButterflyNursery} of the caterpillar.
* @return an empty set if the caterpillar can grow, a set of error states if the caterpillar can not grow
* @since 5.3.3
*/
Set<IErrorState> getCanGrow(IButterflyNursery nursery, @Nullable IButterflyCocoon cocoon);
/**
* Determines whether the caterpillar can spawn. (Used to auto-spawn butterflies out of a cocoon.)
*
* @param cocoon the {@link IButterflyCocoon} the caterpillar resides in.
* @param nursery the {@link IButterflyNursery} of the caterpillar.
* @return an empty set if the caterpillar can spawn, a set of error states if the caterpillar can not spawn
* @since 5.3.3
*/
Set<IErrorState> getCanSpawn(IButterflyNursery nursery, @Nullable IButterflyCocoon cocoon);
/**
* @param playerKill Whether or not the butterfly was killed by a player.
@@ -10,21 +10,14 @@
******************************************************************************/
package forestry.api.lepidopterology;
import javax.annotation.Nullable;
import forestry.api.genetics.IHousing;
public interface IButterflyCocoon extends IHousing {
IButterfly getCaterpillar();
void setCaterpillar(IButterfly butterfly);
@Nullable
IButterflyNursery getNursery();
void setNursery(IButterflyNursery nursery);
boolean isSolid();
}
@@ -10,15 +10,19 @@ import javax.annotation.Nullable;
import forestry.api.climate.IClimateProvider;
import forestry.api.genetics.IHousing;
import forestry.api.genetics.IIndividual;
import net.minecraft.world.World;
public interface IButterflyNursery extends IHousing, IClimateProvider {
@Nullable
IButterfly getCaterpillar();
@Nullable
IIndividual getNanny();
void setCaterpillar(@Nullable IButterfly caterpillar);
boolean canNurse(IButterfly caterpillar);
World getWorldObj();
}
@@ -14,6 +14,7 @@ import forestry.api.genetics.ISpeciesRoot;
import net.minecraft.entity.EntityLiving;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public interface IButterflyRoot extends ISpeciesRoot {
@@ -52,7 +53,7 @@ public interface IButterflyRoot extends ISpeciesRoot {
*/
EntityLiving spawnButterflyInWorld(World world, IButterfly butterfly, double x, double y, double z);
boolean plantCocoon(World world, IButterflyNursery nursery, GameProfile owner, int age);
BlockPos plantCocoon(World world, BlockPos pos, IButterfly caterpillar, GameProfile owner, int age, boolean createNursery);
/**
* @return true if passed item is mated.
@@ -5,7 +5,7 @@
******************************************************************************/
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
@API(apiVersion = "1.3.0", owner = "ForestryAPI|core", provides = "ForestryAPI|lepidopterology")
@API(apiVersion = "1.4.0", owner = "ForestryAPI|core", provides = "ForestryAPI|lepidopterology")
package forestry.api.lepidopterology;
import javax.annotation.ParametersAreNonnullByDefault;
@@ -1,38 +0,0 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.multiblock;
import com.mojang.authlib.GameProfile;
import forestry.api.arboriculture.EnumPileType;
import forestry.api.arboriculture.IAlleleTreeSpecies;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
/**
* Needs to be implemented by TileEntities that want to be part of an charcoal pile.
* The sub-interfaces can be implemented to alter the operation of the charcoal pile.
* They are automatically detected and handled by the charcoal pile when they join its structure.
*/
public interface ICharcoalPileComponent<T extends IMultiblockLogicCharcoalPile> extends IMultiblockComponent {
@Override
T getMultiblockLogic();
IAlleleTreeSpecies getTreeSpecies();
void setTreeSpecies(IAlleleTreeSpecies treeSpecies);
@Override
GameProfile getOwner();
void setOwner(GameProfile owner);
EnumPileType getPileType();
@SideOnly(Side.CLIENT)
IAlleleTreeSpecies getNextWoodPile();
}
@@ -1,9 +0,0 @@
package forestry.api.multiblock;
public interface ICharcoalPileController extends IMultiblockController {
boolean isActive();
void setActive(boolean active);
}
@@ -10,6 +10,7 @@ import forestry.api.climate.IClimateSourceProvider;
import forestry.api.climate.IClimatiserDefinition;
import forestry.api.greenhouse.IGreenhouseListener;
import forestry.api.lepidopterology.IButterflyCocoon;
import forestry.api.lepidopterology.IButterflyNursery;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
@@ -32,8 +33,8 @@ public interface IGreenhouseComponent<T extends IMultiblockLogicGreenhouse> exte
IClimatiserDefinition getDefinition();
}
interface ButterflyHatch extends IGreenhouseComponent {
NonNullList<ItemStack> addCocoonLoot(IButterflyCocoon cocoon);
interface Nursery extends IGreenhouseComponent, IButterflyNursery {
void addCocoonLoot(IButterflyCocoon cocoon, NonNullList<ItemStack> loot);
}
interface Active extends IGreenhouseComponent {
@@ -5,34 +5,35 @@
******************************************************************************/
package forestry.api.multiblock;
import java.util.List;
import java.util.Set;
import forestry.api.climate.IClimateControlProvider;
import forestry.api.climate.IClimateRegion;
import forestry.api.core.ICamouflageHandler;
import forestry.api.greenhouse.EnumGreenhouseEventType;
import forestry.api.greenhouse.IGreenhouseHousing;
import forestry.api.greenhouse.IGreenhouseLogic;
import forestry.api.greenhouse.IInternalBlock;
import forestry.api.lepidopterology.IButterfly;
import forestry.api.lepidopterology.IButterflyCocoon;
public interface IGreenhouseController extends IMultiblockController, IGreenhouseHousing, ICamouflageHandler, IClimateControlProvider {
/**
* Handle change events.
*/
void onChange(EnumGreenhouseEventType type, Object event);
/**
* @return The logics of the greenhouse.
*/
List<IGreenhouseLogic> getLogics();
/**
* @return All internal blocks of the greenhouse.
*/
Set<IInternalBlock> getInternalBlocks();
/**
* spawns a butterfly in a greenhouse
* @return true if it has spawned it, and false if it has not
*/
boolean spawnButterfly(IGreenhouseComponent.Nursery nursery);
/**
* @deprecated use {@link #spawnButterfly(IButterflyCocoon)}
*/
@Deprecated
boolean spawnButterfly(IButterfly butterfly);
IClimateRegion getRegion();
}
@@ -1,21 +0,0 @@
/*******************************************************************************
* 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
*
* Various Contributors including, but not limited to:
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
******************************************************************************/
package forestry.api.multiblock;
public interface IMultiblockLogicCharcoalPile extends IMultiblockLogic {
/**
* @return the multiblock controller for this logic
*/
@Override
ICharcoalPileController getController();
}
@@ -15,6 +15,4 @@ public interface IMultiblockLogicFactory {
IMultiblockLogicFarm createFarmLogic();
IMultiblockLogicGreenhouse createGreenhouseLogic();
IMultiblockLogicCharcoalPile createCharcoalPileLogic();
}
@@ -10,6 +10,8 @@ import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
/**
* Base logic class for Multiblock-connected tile entities.
@@ -86,6 +88,7 @@ public abstract class MultiblockTileEntityBase<T extends IMultiblockLogic> exten
}
@Override
@SideOnly(Side.CLIENT)
public final void onDataPacket(NetworkManager network, SPacketUpdateTileEntity packet) {
super.onDataPacket(network, packet);
NBTTagCompound nbtData = packet.getNbtCompound();
+8 -2
View File
@@ -6,6 +6,7 @@
package forestry.api.recipes;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.NonNullList;
/**
@@ -29,7 +30,12 @@ public interface IDescriptiveRecipe {
* @return array of all the ingredients in the crafting table.
* Each inner list represents one slot's accepted ItemStacks
*/
NonNullList<NonNullList<ItemStack>> getIngredients();
NonNullList<NonNullList<ItemStack>> getRawIngredients();
NonNullList<String> getOreDicts();
ItemStack getRecipeOutput();
/**
* Must not be named the same as {@link IRecipe#getRecipeOutput()} to avoid obfuscation for recipes that implement both.
*/
ItemStack getOutput();
}
@@ -21,6 +21,8 @@ public interface IFabricatorRecipe extends IForestryRecipe {
* Each inner list represents one slot's accepted ItemStacks
*/
NonNullList<NonNullList<ItemStack>> getIngredients();
NonNullList<String> getOreDicts();
/**
* @return the width of ingredients in the crafting grid to create this recipe.
+4 -2
View File
@@ -8,12 +8,14 @@ package forestry.api.storage;
import javax.annotation.Nullable;
import java.util.function.Predicate;
import forestry.api.genetics.ISpeciesRoot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.common.registry.IForgeRegistryEntry;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.registries.IForgeRegistryEntry;
import forestry.api.genetics.ISpeciesRoot;
/**
* The Backpack Interface allows you to add items to Forestry backpacks or create your own backpacks.
@@ -40,8 +40,9 @@ import forestry.core.config.Constants;
import forestry.core.errors.EnumErrorCode;
import forestry.core.network.IStreamable;
import forestry.core.network.PacketBufferForestry;
import forestry.core.proxy.Proxies;
import forestry.core.utils.Log;
import forestry.core.utils.NetworkUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
@@ -50,6 +51,8 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
@@ -457,9 +460,9 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
if (world != null && !world.isRemote) {
if (housing instanceof Entity) {
Entity housingEntity = (Entity) this.housing;
Proxies.net.sendNetworkPacket(new PacketBeeLogicActiveEntity(this.housing, housingEntity), housingEntity.getPosition(), world);
NetworkUtil.sendNetworkPacket(new PacketBeeLogicActiveEntity(this.housing, housingEntity), housingEntity.getPosition(), world);
} else {
Proxies.net.sendNetworkPacket(new PacketBeeLogicActive(housing), housing.getCoordinates(), world);
NetworkUtil.sendNetworkPacket(new PacketBeeLogicActive(housing), housing.getCoordinates(), world);
}
}
}
@@ -469,9 +472,9 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
World world = housing.getWorldObj();
if (world != null && !world.isRemote) {
if (housing instanceof TileEntity) {
Proxies.net.sendToPlayer(new PacketBeeLogicActive(housing), player);
NetworkUtil.sendToPlayer(new PacketBeeLogicActive(housing), player);
} else if (housing instanceof Entity) {
Proxies.net.sendToPlayer(new PacketBeeLogicActiveEntity(housing, (Entity) housing), player);
NetworkUtil.sendToPlayer(new PacketBeeLogicActiveEntity(housing, (Entity) housing), player);
}
}
}
@@ -486,11 +489,13 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
}
@Override
@SideOnly(Side.CLIENT)
public boolean canDoBeeFX() {
return !Proxies.common.getClientInstance().isGamePaused() && active;
return !Minecraft.getMinecraft().isGamePaused() && active;
}
@Override
@SideOnly(Side.CLIENT)
public void doBeeFX() {
if (queen != null) {
queen.doFX(effectData, housing);
@@ -498,7 +503,6 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
}
@Override
public List<BlockPos> getFlowerPositions() {
return hasFlowersCache.getFlowerCoords();
}
+122 -74
View File
@@ -10,6 +10,9 @@
******************************************************************************/
package forestry.apiculture;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import javax.annotation.Nullable;
import java.io.File;
import java.util.ArrayList;
@@ -18,8 +21,42 @@ import java.util.Objects;
import java.util.Random;
import java.util.Set;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import net.minecraft.block.BlockFlower;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.init.PotionTypes;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionUtils;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.DimensionType;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.IChunkGenerator;
import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.brewing.BrewingRecipeRegistry;
import net.minecraftforge.common.capabilities.CapabilityManager;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.registries.IForgeRegistry;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.common.registry.VillagerRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import forestry.Forestry;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.EnumBeeType;
@@ -38,6 +75,7 @@ import forestry.api.storage.ICrateRegistry;
import forestry.api.storage.StorageManager;
import forestry.apiculture.blocks.BlockAlvearyType;
import forestry.apiculture.blocks.BlockCandle;
import forestry.apiculture.blocks.BlockHoneyComb;
import forestry.apiculture.blocks.BlockRegistryApiculture;
import forestry.apiculture.capabilities.ArmorApiarist;
import forestry.apiculture.commands.CommandBee;
@@ -65,8 +103,6 @@ import forestry.apiculture.multiblock.TileAlvearySieve;
import forestry.apiculture.multiblock.TileAlvearyStabiliser;
import forestry.apiculture.multiblock.TileAlvearySwarmer;
import forestry.apiculture.network.PacketRegistryApiculture;
import forestry.apiculture.proxy.ProxyApiculture;
import forestry.apiculture.proxy.ProxyApicultureClient;
import forestry.apiculture.tiles.TileCandle;
import forestry.apiculture.tiles.TileHive;
import forestry.apiculture.worldgen.HiveDecorator;
@@ -97,51 +133,24 @@ import forestry.food.items.ItemRegistryFood;
import forestry.plugins.BlankForestryPlugin;
import forestry.plugins.ForestryPlugin;
import forestry.plugins.ForestryPluginUids;
import net.minecraft.block.BlockFlower;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
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.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.IChunkGenerator;
import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.capabilities.CapabilityManager;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.common.registry.VillagerRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@ForestryPlugin(pluginID = ForestryPluginUids.APICULTURE, name = "Apiculture", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.apiculture.description")
public class PluginApiculture extends BlankForestryPlugin {
@SuppressWarnings("NullableProblems")
@SidedProxy(clientSide = "forestry.apiculture.proxy.ProxyApicultureClient", serverSide = "forestry.apiculture.proxy.ProxyApiculture")
public static ProxyApiculture proxy;
private static final String CONFIG_CATEGORY = "apiculture";
public static String beekeepingMode = "NORMAL";
private static float secondPrincessChance = 0;
public static final int ticksPerBeeWorkCycle = 550;
@SideOnly(Side.CLIENT)
@Nullable
private static TextureAtlasSprite beeSprite;
@Nullable
private static ItemRegistryApiculture items;
@Nullable
private static BlockRegistryApiculture blocks;
@Nullable
private static HiveRegistry hiveRegistry;
public static String beekeepingMode = "NORMAL";
public static final int ticksPerBeeWorkCycle = 550;
@Nullable
public static VillagerRegistry.VillagerProfession villagerApiarist;
@@ -160,6 +169,12 @@ public class PluginApiculture extends BlankForestryPlugin {
return hiveRegistry;
}
@SideOnly(Side.CLIENT)
public static TextureAtlasSprite getBeeSprite() {
Preconditions.checkState(beeSprite != null, "Bee sprite has not been registered");
return beeSprite;
}
@Override
public void setupAPI() {
super.setupAPI();
@@ -298,7 +313,8 @@ public class PluginApiculture extends BlankForestryPlugin {
villagerRegistry.registerVillageCreationHandler(villageHandler);
villagerApiarist = new VillagerRegistry.VillagerProfession(Constants.ID_VILLAGER_APIARIST, Constants.TEXTURE_SKIN_BEEKPEEPER, Constants.TEXTURE_SKIN_ZOMBIE_BEEKPEEPER);
villagerRegistry.register(villagerApiarist);
IForgeRegistry<VillagerRegistry.VillagerProfession> villagerProfessions = ForgeRegistries.VILLAGER_PROFESSIONS;
villagerProfessions.register(villagerApiarist);
ItemStack wildcardPrincess = new ItemStack(items.beePrincessGE, 1);
ItemStack wildcardDrone = new ItemStack(items.beeDroneGE, 1);
@@ -423,115 +439,126 @@ public class PluginApiculture extends BlankForestryPlugin {
// / APIARIST'S ARMOR
ItemStack wovenSilk = coreItems.craftingMaterial.getWovenSilk();
RecipeUtil.addRecipe(items.apiaristHat,
RecipeUtil.addRecipe("apiarist_hat", items.apiaristHat,
"###", "# #",
'#', wovenSilk);
RecipeUtil.addRecipe(items.apiaristChest,
RecipeUtil.addRecipe("apiarist_chest", items.apiaristChest,
"# #", "###", "###",
'#', wovenSilk);
RecipeUtil.addRecipe(items.apiaristLegs,
RecipeUtil.addRecipe("apiarist_legs", items.apiaristLegs,
"###", "# #", "# #",
'#', wovenSilk);
RecipeUtil.addRecipe(items.apiaristBoots,
RecipeUtil.addRecipe("apiarist_boots", items.apiaristBoots,
"# #", "# #",
'#', wovenSilk);
// / HABITAT LOCATOR
RecipeUtil.addRecipe(items.habitatLocator,
RecipeUtil.addRecipe("habitat_locator", items.habitatLocator,
" X ",
"X#X",
" X ",
'#', OreDictUtil.DUST_REDSTONE, 'X', OreDictUtil.INGOT_BRONZE);
// Bees
RecipeUtil.addRecipe(items.scoop,
RecipeUtil.addRecipe("scoop", items.scoop,
"#X#", "###", " # ",
'#', OreDictUtil.STICK_WOOD,
'X', Blocks.WOOL);
RecipeUtil.addRecipe(items.smoker,
RecipeUtil.addRecipe("smoker", items.smoker,
"LS#",
"LF#",
"###",
'#', "ingotTin", 'S', OreDictUtil.STICK_WOOD, 'F', Items.FLINT_AND_STEEL, 'L', OreDictUtil.LEATHER);
RecipeUtil.addRecipe(new ItemStack(Items.SLIME_BALL),
RecipeUtil.addRecipe("propolis_to_slime", new ItemStack(Items.SLIME_BALL),
"#X#", "#X#", "#X#",
'#', items.propolis,
'X', items.pollenCluster.get(EnumPollenCluster.NORMAL, 1));
RecipeUtil.addRecipe(new ItemStack(Items.SPECKLED_MELON),
RecipeUtil.addRecipe("honey_melon", new ItemStack(Items.SPECKLED_MELON),
"#X#", "#Y#", "#X#",
'#', items.honeyDrop,
'X', items.honeydew,
'Y', Items.MELON);
RecipeUtil.addRecipe(items.frameUntreated,
RecipeUtil.addRecipe("frame_untreated", items.frameUntreated,
"###", "#S#", "###",
'#', OreDictUtil.STICK_WOOD,
'S', Items.STRING);
RecipeUtil.addRecipe(items.frameImpregnated,
RecipeUtil.addRecipe("frame_impregnated", items.frameImpregnated,
"###", "#S#", "###",
'#', coreItems.stickImpregnated,
'S', Items.STRING);
RecipeUtil.addRecipe(items.minecartBeehouse.getBeeHouseMinecart(),
RecipeUtil.addRecipe("bee_house_minecart", items.minecartBeehouse.getBeeHouseMinecart(),
"B",
"C",
'B', new ItemStack(blocks.beeHouse),
'C', Items.MINECART);
RecipeUtil.addRecipe(items.minecartBeehouse.getApiaryMinecart(),
RecipeUtil.addRecipe("apiary_minecart", items.minecartBeehouse.getApiaryMinecart(),
"B",
"C",
'B', new ItemStack(blocks.apiary),
'C', Items.MINECART);
for(int blockCount = 0;blockCount < blocks.beeCombs.length;blockCount++){
BlockHoneyComb block = blocks.beeCombs[blockCount];
for(int blockMeta = 0;blockMeta < EnumHoneyComb.VALUES.length - blockCount * 16;blockMeta++){
int itemMeta = blockMeta + blockCount * 16;
RecipeUtil.addRecipe("comb." + itemMeta, new ItemStack(block, 1, blockMeta),
"###",
"###",
"###", '#', items.beeComb.get(EnumHoneyComb.get(itemMeta), 1));
}
}
// FOOD STUFF
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FOOD)) {
ItemRegistryFood foodItems = PluginFood.getItems();
RecipeUtil.addRecipe(new ItemStack(foodItems.honeyedSlice, 4),
RecipeUtil.addRecipe("honeyed_slice", new ItemStack(foodItems.honeyedSlice, 4),
"###", "#X#", "###",
'#', items.honeyDrop,
'X', Items.BREAD);
RecipeUtil.addRecipe(foodItems.honeyPot,
RecipeUtil.addRecipe("honey_pot", foodItems.honeyPot,
"# #", " X ", "# #",
'#', items.honeyDrop,
'X', fluidItems.waxCapsuleEmpty);
RecipeUtil.addRecipe(foodItems.ambrosia,
RecipeUtil.addRecipe("ambrosia", foodItems.ambrosia,
"#Y#", "XXX", "###",
'#', items.honeydew,
'X', items.royalJelly,
'Y', fluidItems.waxCapsuleEmpty);
}
// / CAPSULES
int outputCapsuleAmount = ForestryAPI.activeMode.getIntegerSetting("recipe.output.capsule");
if (outputCapsuleAmount > 0) {
ItemStack capsule = fluidItems.waxCapsuleEmpty.getItemStack(outputCapsuleAmount);
RecipeUtil.addRecipe(capsule, "###", '#', coreItems.beeswax);
RecipeUtil.addRecipe("wax_capsule", capsule, "###", '#', coreItems.beeswax);
}
int outputRefractoryAmount = ForestryAPI.activeMode.getIntegerSetting("recipe.output.refractory");
if (outputRefractoryAmount > 0) {
ItemStack capsule = fluidItems.refractoryEmpty.getItemStack(outputRefractoryAmount);
RecipeUtil.addRecipe(capsule, "###", '#', coreItems.refractoryWax);
RecipeUtil.addRecipe("refractory_capsule", capsule, "###", '#', coreItems.refractoryWax);
}
// / BITUMINOUS PEAT
RecipeUtil.addRecipe(coreItems.bituminousPeat.getItemStack(),
RecipeUtil.addRecipe("bituminous_peat", coreItems.bituminousPeat.getItemStack(),
" # ", "XYX", " # ",
'#', OreDictUtil.DUST_ASH,
'X', coreItems.peat,
'Y', items.propolis);
// / TORCHES
RecipeUtil.addRecipe(new ItemStack(Blocks.TORCH, 3),
RecipeUtil.addRecipe("beeswax_worth", new ItemStack(Blocks.TORCH, 3),
" # ", " # ", " Y ",
'#', coreItems.beeswax,
'Y', OreDictUtil.STICK_WOOD);
RecipeUtil.addRecipe(coreItems.craftingMaterial.getPulsatingMesh(),
RecipeUtil.addRecipe("pulsating_mesh", coreItems.craftingMaterial.getPulsatingMesh(),
"# #", " # ", "# #",
'#', items.propolis.get(EnumPropolis.PULSATING, 1));
// / WAX CAST
RecipeUtil.addRecipe(items.waxCast,
RecipeUtil.addRecipe("wax_cast", items.waxCast,
"###",
"# #",
"###",
@@ -539,14 +566,14 @@ public class PluginApiculture extends BlankForestryPlugin {
// / ALVEARY
ItemStack alvearyPlainBlock = blocks.getAlvearyBlock(BlockAlvearyType.PLAIN);
RecipeUtil.addRecipe(alvearyPlainBlock,
RecipeUtil.addRecipe("alveary_plain", alvearyPlainBlock,
"###",
"#X#",
"###",
'X', coreItems.impregnatedCasing,
'#', coreItems.craftingMaterial.getScentedPaneling());
// SWARMER
RecipeUtil.addRecipe(blocks.getAlvearyBlock(BlockAlvearyType.SWARMER),
RecipeUtil.addRecipe("alveary_swarmer", blocks.getAlvearyBlock(BlockAlvearyType.SWARMER),
"#G#",
" X ",
"#G#",
@@ -554,7 +581,7 @@ public class PluginApiculture extends BlankForestryPlugin {
'X', alvearyPlainBlock,
'G', OreDictUtil.INGOT_GOLD);
// FAN
RecipeUtil.addRecipe(blocks.getAlvearyBlock(BlockAlvearyType.FAN),
RecipeUtil.addRecipe("alveary_fan", blocks.getAlvearyBlock(BlockAlvearyType.FAN),
"I I",
" X ",
"I#I",
@@ -562,7 +589,7 @@ public class PluginApiculture extends BlankForestryPlugin {
'X', alvearyPlainBlock,
'I', OreDictUtil.INGOT_IRON);
// HEATER
RecipeUtil.addRecipe(blocks.getAlvearyBlock(BlockAlvearyType.HEATER),
RecipeUtil.addRecipe("alveary_heater", blocks.getAlvearyBlock(BlockAlvearyType.HEATER),
"#I#",
" X ",
"YYY",
@@ -570,7 +597,7 @@ public class PluginApiculture extends BlankForestryPlugin {
'X', alvearyPlainBlock,
'I', OreDictUtil.INGOT_IRON, 'Y', OreDictUtil.STONE);
// HYGROREGULATOR
RecipeUtil.addRecipe(blocks.getAlvearyBlock(BlockAlvearyType.HYGRO),
RecipeUtil.addRecipe("alveary_hygro", blocks.getAlvearyBlock(BlockAlvearyType.HYGRO),
"GIG",
"GXG",
"GIG",
@@ -578,14 +605,14 @@ public class PluginApiculture extends BlankForestryPlugin {
'I', OreDictUtil.INGOT_IRON,
'G', OreDictUtil.BLOCK_GLASS);
// STABILISER
RecipeUtil.addRecipe(blocks.getAlvearyBlock(BlockAlvearyType.STABILISER),
RecipeUtil.addRecipe("alveary_stabiliser", blocks.getAlvearyBlock(BlockAlvearyType.STABILISER),
"G G",
"GXG",
"G G",
'X', alvearyPlainBlock,
'G', OreDictUtil.GEM_QUARTZ);
// SIEVE
RecipeUtil.addRecipe(blocks.getAlvearyBlock(BlockAlvearyType.SIEVE),
RecipeUtil.addRecipe("alveary_sieve", blocks.getAlvearyBlock(BlockAlvearyType.SIEVE),
"III",
" X ",
"WWW",
@@ -633,8 +660,8 @@ public class PluginApiculture extends BlankForestryPlugin {
"#X#",
'#', coreItems.beeswax,
'X', coreItems.craftingMaterial.getSilkWisp());
RecipeUtil.addShapelessRecipe(blocks.candle.getUnlitCandle(1), blocks.candle.getUnlitCandle(1));
RecipeUtil.addShapelessRecipe(blocks.candle.getLitCandle(1), blocks.candle.getLitCandle(1));
RecipeUtil.addShapelessRecipe("candle_unlit_reset", blocks.candle.getUnlitCandle(1), blocks.candle.getUnlitCandle(1));
RecipeUtil.addShapelessRecipe("candle_lit_reset", blocks.candle.getLitCandle(1), blocks.candle.getLitCandle(1));
// / CENTRIFUGE
// Honey combs
@@ -734,7 +761,7 @@ public class PluginApiculture extends BlankForestryPlugin {
RecipeManagers.fermenterManager.addRecipe(items.honeydew.getItemStack(), 500, 1.0f, Fluids.SHORT_MEAD.getFluid(1), Fluids.FOR_HONEY.getFluid(1));
}
RecipeUtil.addRecipe(blocks.apiary,
RecipeUtil.addRecipe("apiary", blocks.apiary,
"XXX",
"#C#",
"###",
@@ -742,7 +769,7 @@ public class PluginApiculture extends BlankForestryPlugin {
'#', OreDictUtil.PLANK_WOOD,
'C', coreItems.impregnatedCasing);
RecipeUtil.addRecipe(blocks.beeChest,
RecipeUtil.addRecipe("bee_chest", blocks.beeChest,
" # ",
"XYX",
"XXX",
@@ -750,13 +777,24 @@ public class PluginApiculture extends BlankForestryPlugin {
'X', OreDictUtil.BEE_COMB,
'Y', OreDictUtil.CHEST_WOOD);
RecipeUtil.addRecipe(blocks.beeHouse,
RecipeUtil.addRecipe("bee_house", blocks.beeHouse,
"XXX",
"#C#",
"###",
'X', OreDictUtil.SLAB_WOOD,
'#', OreDictUtil.PLANK_WOOD,
'C', OreDictUtil.BEE_COMB);
// BREWING RECIPES
BrewingRecipeRegistry.addRecipe(
PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.AWKWARD),
items.pollenCluster.get(EnumPollenCluster.NORMAL, 1),
PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.HEALING));
BrewingRecipeRegistry.addRecipe(
PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.AWKWARD),
items.pollenCluster.get(EnumPollenCluster.CRYSTALLINE, 1),
PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.REGENERATION));
}
private static void registerBeehiveDrops() {
@@ -864,8 +902,18 @@ public class PluginApiculture extends BlankForestryPlugin {
@Override
public void populateChunk(IChunkGenerator chunkGenerator, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) {
if(!world.provider.getDimensionType().equals(DimensionType.THE_END)) return;
if (Config.getBeehivesAmount() > 0.0) {
HiveDecorator.decorateHives(chunkGenerator, world, rand, chunkX, chunkZ, hasVillageGenerated);
HiveDecorator.decorateHives(world, rand, chunkX, chunkZ);
}
}
@Override
public void decorateBiome(World world, Random rand, BlockPos pos) {
if (Config.getBeehivesAmount() > 0.0) {
int chunkX = pos.getX() >> 4;
int chunkZ = pos.getZ() >> 4;
HiveDecorator.decorateHives(world, rand, chunkX, chunkZ);
}
}
@@ -901,7 +949,7 @@ public class PluginApiculture extends BlankForestryPlugin {
for (int i = 0; i < ParticleSnow.sprites.length; i++) {
ParticleSnow.sprites[i] = event.getMap().registerSprite(new ResourceLocation("forestry:entity/particles/snow." + (i + 1)));
}
ProxyApicultureClient.beeSprite = event.getMap().registerSprite(new ResourceLocation("forestry:entity/particles/swarm_bee"));
beeSprite = event.getMap().registerSprite(new ResourceLocation("forestry:entity/particles/swarm_bee"));
}
private static class EndFlowerAcceptableRule implements IFlowerAcceptableRule {
@@ -10,9 +10,10 @@
******************************************************************************/
package forestry.apiculture;
import net.minecraft.world.World;
import forestry.api.apiculture.BeeManager;
import forestry.core.ISaveEventHandler;
import net.minecraft.world.World;
public class SaveEventHandlerApiculture implements ISaveEventHandler {
+34 -24
View File
@@ -10,12 +10,34 @@
******************************************************************************/
package forestry.apiculture.blocks;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.EnumMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import forestry.api.core.IModelManager;
import forestry.api.core.IStateMapperRegister;
import forestry.api.core.Tabs;
@@ -31,26 +53,11 @@ import forestry.apiculture.multiblock.TileAlvearyStabiliser;
import forestry.apiculture.multiblock.TileAlvearySwarmer;
import forestry.apiculture.network.packets.PacketAlvearyChange;
import forestry.core.blocks.BlockStructure;
import forestry.core.proxy.Proxies;
import forestry.core.tiles.IActivatable;
import forestry.core.tiles.TileUtil;
import forestry.core.utils.BlockUtil;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import forestry.core.utils.NetworkUtil;
import forestry.core.utils.Translator;
public abstract class BlockAlveary extends BlockStructure implements IStateMapperRegister {
private static final PropertyEnum<State> STATE = PropertyEnum.create("state", State.class);
@@ -221,7 +228,7 @@ public abstract class BlockAlveary extends BlockStructure implements IStateMappe
@Override
@SideOnly(Side.CLIENT)
public void registerStateMapper() {
Proxies.render.registerStateMapper(this, new AlvearyStateMapper(getAlvearyType()));
ModelLoader.setCustomStateMapper(this, new AlvearyStateMapper(getAlvearyType()));
}
@SideOnly(Side.CLIENT)
@@ -244,15 +251,18 @@ public abstract class BlockAlveary extends BlockStructure implements IStateMappe
@Override
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos) {
TileEntity tileEntity = worldIn.getTileEntity(pos);
if (tileEntity instanceof TileAlveary) {
TileAlveary tileAlveary = (TileAlveary) tileEntity;
TileUtil.actOnTile(worldIn, pos, TileAlveary.class, tileAlveary -> {
// We must check that the slabs on top were not removed
IAlvearyControllerInternal alveary = tileAlveary.getMultiblockLogic().getController();
alveary.reassemble();
BlockPos referenceCoord = alveary.getReferenceCoord();
Proxies.net.sendNetworkPacket(new PacketAlvearyChange(referenceCoord), referenceCoord, worldIn);
}
NetworkUtil.sendNetworkPacket(new PacketAlvearyChange(referenceCoord), referenceCoord, worldIn);
});
}
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, @Nullable World world, List<String> tooltip, ITooltipFlag advanced) {
tooltip.add(Translator.translateToLocal("tile.for.alveary.tooltip"));
}
}
+20 -30
View File
@@ -11,24 +11,10 @@
package forestry.apiculture.blocks;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.EnumBeeType;
import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IHiveDrop;
import forestry.api.apiculture.IHiveTile;
import forestry.api.apiculture.hives.IHiveRegistry.HiveType;
import forestry.api.core.IItemModelRegister;
import forestry.api.core.IModelManager;
import forestry.api.core.Tabs;
import forestry.apiculture.MaterialBeehive;
import forestry.apiculture.PluginApiculture;
import forestry.apiculture.tiles.TileHive;
import forestry.core.blocks.IBlockWithMeta;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
@@ -43,9 +29,25 @@ import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.EnumBeeType;
import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IHiveDrop;
import forestry.api.apiculture.IHiveTile;
import forestry.api.apiculture.hives.IHiveRegistry.HiveType;
import forestry.api.core.IItemModelRegister;
import forestry.api.core.IModelManager;
import forestry.api.core.Tabs;
import forestry.apiculture.MaterialBeehive;
import forestry.apiculture.PluginApiculture;
import forestry.apiculture.tiles.TileHive;
import forestry.core.blocks.IBlockWithMeta;
import forestry.core.tiles.TileUtil;
public class BlockBeeHives extends BlockContainer implements IItemModelRegister, IBlockWithMeta {
private static final PropertyEnum<HiveType> HIVE_TYPES = PropertyEnum.create("hive", HiveType.class);
@@ -85,27 +87,17 @@ public class BlockBeeHives extends BlockContainer implements IItemModelRegister,
@Override
public void onBlockClicked(World world, BlockPos pos, EntityPlayer player) {
super.onBlockClicked(world, pos, player);
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof IHiveTile) {
IHiveTile hive = (IHiveTile) tile;
hive.onAttack(world, pos, player);
}
TileUtil.actOnTile(world, pos, IHiveTile.class, tile -> tile.onAttack(world, pos, player));
}
@Override
public void onBlockHarvested(World world, BlockPos pos, IBlockState state, EntityPlayer player) {
boolean canHarvest = canHarvestBlock(world, pos, player);
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof IHiveTile) {
IHiveTile hive = (IHiveTile) tile;
hive.onBroken(world, pos, player, canHarvest);
}
TileUtil.actOnTile(world, pos, IHiveTile.class, tile -> tile.onBroken(world, pos, player, canHarvest));
}
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
List<ItemStack> drops = new ArrayList<>();
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
Random random = world instanceof World ? ((World) world).rand : RANDOM;
List<IHiveDrop> hiveDrops = getDropsForHive(getMetaFromState(state));
@@ -149,8 +141,6 @@ public class BlockBeeHives extends BlockContainer implements IItemModelRegister,
break;
}
}
return drops;
}
// / CREATIVE INVENTORY
@@ -180,7 +170,7 @@ public class BlockBeeHives extends BlockContainer implements IItemModelRegister,
}
@Override
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list) {
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
for (IBlockState blockState : getBlockState().getValidStates()) {
if (getHiveType(blockState) != HiveType.SWARM) {
int meta = getMetaFromState(blockState);
@@ -0,0 +1,22 @@
package forestry.apiculture.blocks;
import java.util.Locale;
import net.minecraft.util.IStringSerializable;
public enum BlockBeeProductType implements IStringSerializable {
BEE_COMBS,
BEESWAX;
public static final BlockBeeProductType[] VALUES = values();
@Override
public String getName() {
return name().toLowerCase(Locale.ENGLISH);
}
public int getMeta() {
return ordinal();
}
}
+26 -27
View File
@@ -10,24 +10,16 @@
******************************************************************************/
package forestry.apiculture.blocks;
import com.google.common.collect.ImmutableMap;
import javax.annotation.Nullable;
import java.awt.Color;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import com.google.common.collect.ImmutableMap;
import forestry.api.core.IItemModelRegister;
import forestry.api.core.IModelManager;
import forestry.api.core.Tabs;
import forestry.apiculture.tiles.TileCandle;
import forestry.core.blocks.IColoredBlock;
import forestry.core.tiles.TileUtil;
import forestry.core.utils.ItemStackUtil;
import net.minecraft.block.BlockTorch;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.SoundType;
@@ -51,9 +43,19 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.oredict.OreDictionary;
import forestry.api.core.IItemModelRegister;
import forestry.api.core.IModelManager;
import forestry.api.core.Tabs;
import forestry.apiculture.tiles.TileCandle;
import forestry.core.blocks.IColoredBlock;
import forestry.core.tiles.TileUtil;
import forestry.core.utils.ItemStackUtil;
public class BlockCandle extends BlockTorch implements IItemModelRegister, ITileEntityProvider, IColoredBlock {
@@ -140,26 +142,24 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister, ITile
@Override
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
TileEntity tileEntity = world.getTileEntity(pos);
if (tileEntity instanceof TileCandle && ((TileCandle) tileEntity).isLit()) {
TileCandle candle = TileUtil.getTile(world, pos, TileCandle.class);
if (candle != null && candle.isLit()) {
return 14;
}
return 0;
}
@Override
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list) {
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
list.add(new ItemStack(this, 1, 0));
}
@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
TileEntity tileEntity = worldIn.getTileEntity(pos);
if (!(tileEntity instanceof TileCandle)) {
TileCandle tileCandle = TileUtil.getTile(worldIn, pos, TileCandle.class);
if (tileCandle == null) {
return false;
}
TileCandle tileCandle = (TileCandle) tileEntity;
final boolean isLit = tileCandle.isLit();
boolean flag = false;
@@ -202,9 +202,9 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister, ITile
if (toggleLitState) {
tileCandle.setLit(!isLit);
worldIn.markBlockRangeForRenderUpdate(pos, pos);
worldIn.theProfiler.startSection("checkLight");
worldIn.profiler.startSection("checkLight");
worldIn.checkLight(pos);
worldIn.theProfiler.endSection();
worldIn.profiler.endSection();
flag = true;
}
return flag;
@@ -240,9 +240,9 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister, ITile
drop.set(itemStack);
}
}
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
ItemStack dropStack = drop.get();
drop.remove();
@@ -251,10 +251,7 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister, ITile
dropStack = getCandleDrop(world, pos);
}
ArrayList<ItemStack> drops = new ArrayList<>(1);
drops.add(dropStack);
return drops;
}
@Override
@@ -289,14 +286,15 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister, ITile
tileCandle.setColour(colour);
tileCandle.setLit(isLit);
if (tileCandle.isLit()) {
world.theProfiler.startSection("checkLight");
world.profiler.startSection("checkLight");
world.checkLight(pos);
world.theProfiler.endSection();
world.profiler.endSection();
}
}
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand) {
TileCandle tileCandle = TileUtil.getTile(worldIn, pos, TileCandle.class);
if (tileCandle != null && tileCandle.isLit()) {
@@ -333,6 +331,7 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister, ITile
return new ItemStack(this, amount, 1);
}
@SideOnly(Side.CLIENT)
@Override
public int colorMultiplier(IBlockState state, @Nullable IBlockAccess worldIn, @Nullable BlockPos pos, int tintIndex) {
if (worldIn != null && pos != null) {
@@ -0,0 +1,164 @@
package forestry.apiculture.blocks;
import com.google.common.base.Predicate;
import javax.annotation.Nullable;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import forestry.api.core.IItemModelRegister;
import forestry.api.core.IModelManager;
import forestry.api.core.IStateMapperRegister;
import forestry.api.core.Tabs;
import forestry.apiculture.items.EnumHoneyComb;
import forestry.core.blocks.IBlockWithMeta;
import forestry.core.blocks.IColoredBlock;
import forestry.core.config.Config;
import forestry.core.config.Constants;
public abstract class BlockHoneyComb extends Block implements IItemModelRegister, IBlockWithMeta, IColoredBlock, IStateMapperRegister {
public final int minMeta;
public static final BlockHoneyComb[] create(){
BlockHoneyComb[] blocks = new BlockHoneyComb[2];
for(int i = 0;i < blocks.length;i++){
HoneyCombPredicate filter = new HoneyCombPredicate(i, 16);
PropertyEnum<EnumHoneyComb> variant = PropertyEnum.create("type", EnumHoneyComb.class, filter);
blocks[i] = new BlockHoneyComb(filter.minMeta) {
@Override
protected PropertyEnum<EnumHoneyComb> getVariant() {
return variant;
}
};
}
return blocks;
}
public BlockHoneyComb(int minMeta) {
super(Material.CLOTH);
setHardness(1F);
setCreativeTab(Tabs.tabApiculture);
setDefaultState(this.blockState.getBaseState().withProperty(getVariant(), getVariant().getAllowedValues().iterator().next()));
this.minMeta = minMeta;
}
protected abstract PropertyEnum<EnumHoneyComb> getVariant();
@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, getVariant());
}
@Override
public int getMetaFromState(IBlockState state) {
return state.getValue(getVariant()).ordinal()-minMeta;
}
@Override
public IBlockState getStateFromMeta(int meta) {
return getDefaultState().withProperty(getVariant(), EnumHoneyComb.get(minMeta + meta));
}
@Override
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
for (EnumHoneyComb honeyComb : getVariant().getAllowedValues()) {
if(!honeyComb.isSecret() || Config.isDebug){
list.add(get(honeyComb));
}
}
}
@Override
public String getUnlocalizedName() {
return "tile.for.bee_combs";
}
@SideOnly(Side.CLIENT)
@Override
public BlockRenderLayer getBlockLayer() {
return BlockRenderLayer.CUTOUT;
}
@Override
public int damageDropped(IBlockState state) {
return getMetaFromState(state);
}
@SideOnly(Side.CLIENT)
@Override
public void registerModel(Item item, IModelManager manager) {
for (EnumHoneyComb comb : getVariant().getAllowedValues()) {
manager.registerItemModel(item, comb.ordinal()-minMeta, "block_bee_combs");
}
}
public ItemStack get(EnumHoneyComb honeyComb) {
return new ItemStack(this, 1, honeyComb.ordinal() - minMeta);
}
@Override
public String getNameFromMeta(int meta) {
EnumHoneyComb honeyComb = EnumHoneyComb.get(minMeta + meta);
return honeyComb.name;
}
@SideOnly(Side.CLIENT)
@Override
public int colorMultiplier(IBlockState state, IBlockAccess worldIn, BlockPos pos, int tintIndex) {
int meta = getMetaFromState(state);
EnumHoneyComb honeyComb = EnumHoneyComb.get(minMeta + meta);
if (tintIndex == 1) {
return honeyComb.primaryColor;
} else {
return honeyComb.secondaryColor;
}
}
@SideOnly(Side.CLIENT)
@Override
public void registerStateMapper() {
ModelLoader.setCustomStateMapper(this, new HoneyCombStateMapper());
}
private static class HoneyCombPredicate implements Predicate<EnumHoneyComb> {
private final int minMeta;
private final int maxMeta;
public HoneyCombPredicate(int blockNumber, int variantsPerBlock) {
this.minMeta = blockNumber * variantsPerBlock;
this.maxMeta = minMeta + variantsPerBlock - 1;
}
@Override
public boolean apply(@Nullable EnumHoneyComb honeyComb) {
return honeyComb != null && honeyComb.ordinal() >= minMeta && honeyComb.ordinal() <= maxMeta;
}
}
@SideOnly(Side.CLIENT)
private static class HoneyCombStateMapper extends StateMapperBase {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
return new ModelResourceLocation(Constants.MOD_ID + ":bee_combs", "normal");
}
}
}
@@ -14,6 +14,7 @@ import java.util.Map;
import forestry.api.core.Tabs;
import forestry.apiculture.items.ItemBlockCandle;
import forestry.apiculture.items.ItemBlockHoneyComb;
import forestry.core.blocks.BlockBase;
import forestry.core.blocks.BlockRegistry;
import forestry.core.items.ItemBlockForestry;
@@ -27,31 +28,38 @@ public class BlockRegistryApiculture extends BlockRegistry {
public final BlockBeeHives beehives;
public final BlockCandle candle;
public final BlockStump stump;
public final BlockHoneyComb[] beeCombs;
private final Map<BlockAlvearyType, BlockAlveary> alvearyBlockMap;
public BlockRegistryApiculture() {
apiary = new BlockApiculture(BlockTypeApiculture.APIARY);
registerBlock(apiary, new ItemBlockForestry(apiary), "apiary");
registerBlock(apiary, new ItemBlockForestry<>(apiary), "apiary");
beeHouse = new BlockApiculture(BlockTypeApiculture.BEE_HOUSE);
registerBlock(beeHouse, new ItemBlockForestry(beeHouse), "bee_house");
registerBlock(beeHouse, new ItemBlockForestry<>(beeHouse), "bee_house");
beeChest = new BlockBase<>(BlockTypeApicultureTesr.APIARIST_CHEST, Material.WOOD);
registerBlock(beeChest, new ItemBlockForestry(beeChest), "bee_chest");
registerBlock(beeChest, new ItemBlockForestry<>(beeChest), "bee_chest");
beeChest.setCreativeTab(Tabs.tabApiculture);
beeChest.setHarvestLevel("axe", 0);
beehives = new BlockBeeHives();
registerBlock(beehives, new ItemBlockForestry(beehives), "beehives");
registerBlock(beehives, new ItemBlockForestry<>(beehives), "beehives");
candle = new BlockCandle();
registerBlock(candle, new ItemBlockCandle(candle), "candle");
stump = new BlockStump();
registerBlock(stump, new ItemBlockForestry(stump), "stump");
registerBlock(stump, new ItemBlockForestry<>(stump), "stump");
beeCombs = BlockHoneyComb.create();
for(int i = 0;i < beeCombs.length;i++){
BlockHoneyComb block = beeCombs[i];
registerBlock(block, new ItemBlockHoneyComb(block), "bee_combs_" + i);
}
alvearyBlockMap = BlockAlveary.create();
for (BlockAlveary block : alvearyBlockMap.values()) {
registerBlock(block, new ItemBlockForestry(block), "alveary." + block.getAlvearyType());
registerBlock(block, new ItemBlockForestry<>(block), "alveary." + block.getAlvearyType());
}
}
+9 -7
View File
@@ -12,12 +12,6 @@ package forestry.apiculture.blocks;
import java.util.Random;
import forestry.api.core.IItemModelRegister;
import forestry.api.core.IModelManager;
import forestry.api.core.Tabs;
import forestry.apiculture.PluginApiculture;
import forestry.apiculture.tiles.TileCandle;
import forestry.core.config.Constants;
import net.minecraft.block.Block;
import net.minecraft.block.BlockTorch;
import net.minecraft.block.SoundType;
@@ -31,9 +25,17 @@ import net.minecraft.util.EnumHand;
import net.minecraft.util.NonNullList;
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.IItemModelRegister;
import forestry.api.core.IModelManager;
import forestry.api.core.Tabs;
import forestry.apiculture.PluginApiculture;
import forestry.apiculture.tiles.TileCandle;
import forestry.core.config.Constants;
public class BlockStump extends BlockTorch implements IItemModelRegister {
public BlockStump() {
@@ -49,7 +51,7 @@ public class BlockStump extends BlockTorch implements IItemModelRegister {
}
@Override
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list) {
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
list.add(new ItemStack(this, 1, 0));
}
@@ -10,28 +10,26 @@
******************************************************************************/
package forestry.apiculture.blocks;
import javax.annotation.Nullable;
import forestry.apiculture.tiles.TileApiaristChest;
import forestry.core.blocks.IBlockTypeTesr;
import forestry.core.blocks.IMachinePropertiesTesr;
import forestry.core.blocks.MachinePropertiesTesr;
import forestry.core.config.Constants;
import forestry.core.proxy.Proxies;
import forestry.core.tiles.TileForestry;
import forestry.core.tiles.TileNaturalistChest;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.util.math.AxisAlignedBB;
public enum BlockTypeApicultureTesr implements IBlockTypeTesr {
APIARIST_CHEST(TileApiaristChest.class, "api_chest", Proxies.render.getRenderChest("apiaristchest"), TileNaturalistChest.chestBoundingBox);
APIARIST_CHEST(TileApiaristChest.class, "api_chest", "apiaristchest", TileNaturalistChest.chestBoundingBox);
public static final BlockTypeApicultureTesr[] VALUES = values();
private final IMachinePropertiesTesr<?> machineProperties;
<T extends TileForestry> BlockTypeApicultureTesr(Class<T> teClass, String name, @Nullable TileEntitySpecialRenderer<? super T> renderer, AxisAlignedBB boundingBox) {
this.machineProperties = new MachinePropertiesTesr<>(teClass, name, renderer, boundingBox, Constants.MOD_ID + ":blocks/" + name + ".0", false);
<T extends TileApiaristChest> BlockTypeApicultureTesr(Class<T> teClass, String name, String textureName, AxisAlignedBB boundingBox) {
MachinePropertiesTesr<T> machineProperties = new MachinePropertiesTesr<>(teClass, name, boundingBox, Constants.MOD_ID + ":blocks/" + name + ".0", false);
Proxies.render.setRenderChest(machineProperties, textureName);
this.machineProperties = machineProperties;
}
@Override
@@ -94,7 +94,7 @@ public class CommandBeeGive extends SubCommand {
ItemStack beeStack = BeeManager.beeRoot.getMemberStack(bee, beeType);
player.dropItem(beeStack, false, true);
CommandHelpers.sendLocalizedChatMessage(sender, "for.chat.command.forestry.bee.give.given", player.getName(), bee.getGenome().getPrimary().getName(), beeType.getName());
CommandHelpers.sendLocalizedChatMessage(sender, "for.chat.command.forestry.bee.give.given", player.getName(), bee.getGenome().getPrimary().getAlleleName(), beeType.getName());
}
private static IBeeGenome getBeeGenome(String speciesName) throws SpeciesNotFoundException, TemplateNotFoundException {
@@ -115,7 +115,7 @@ public class CommandBeeGive extends SubCommand {
if (species == null) {
for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) {
if (allele instanceof IAlleleBeeSpecies && allele.getName().equals(speciesName)) {
if (allele instanceof IAlleleBeeSpecies && allele.getAlleleName().equals(speciesName)) {
species = (IAlleleBeeSpecies) allele;
break;
}
@@ -150,7 +150,7 @@ public class CommandBeeGive extends SubCommand {
for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) {
if (allele instanceof IAlleleBeeSpecies) {
species.add(allele.getName());
species.add(allele.getAlleleName());
}
}
@@ -7,13 +7,13 @@ import forestry.apiculture.PluginApiculture;
import forestry.apiculture.items.ItemRegistryApiculture;
import forestry.core.genetics.Genome;
import forestry.core.utils.JeiUtil;
import mezz.jei.api.BlankModPlugin;
import mezz.jei.api.IModPlugin;
import mezz.jei.api.IModRegistry;
import mezz.jei.api.ISubtypeRegistry;
import mezz.jei.api.JEIPlugin;
@JEIPlugin
public class ApicultureJeiPlugin extends BlankModPlugin {
public class ApicultureJeiPlugin implements IModPlugin {
@Override
public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) {
ItemRegistryApiculture items = PluginApiculture.getItems();
@@ -21,7 +21,7 @@ public class ApicultureJeiPlugin extends BlankModPlugin {
ISubtypeRegistry.ISubtypeInterpreter beeSubtypeInterpreter = itemStack -> {
IAlleleSpecies species = Genome.getSpeciesDirectly(BeeManager.beeRoot, itemStack);
return species == null ? null : species.getUID();
return species == null ? ISubtypeRegistry.ISubtypeInterpreter.NONE : species.getUID();
};
subtypeRegistry.registerSubtypeInterpreter(items.beeDroneGE, beeSubtypeInterpreter);
+5 -5
View File
@@ -63,17 +63,17 @@ public class AIAvoidPlayers extends EntityAIBase {
if (randomTarget == null) {
return false;
}
if (player.getDistanceSq(randomTarget.xCoord, randomTarget.yCoord, randomTarget.zCoord) < player.getDistanceSqToEntity(mob)) {
if (player.getDistanceSq(randomTarget.x, randomTarget.y, randomTarget.z) < player.getDistanceSqToEntity(mob)) {
return false;
}
path = pathNavigator.getPathToXYZ(randomTarget.xCoord, randomTarget.yCoord, randomTarget.zCoord);
path = pathNavigator.getPathToXYZ(randomTarget.x, randomTarget.y, randomTarget.z);
return path != null;
}
@Override
public boolean continueExecuting() {
public boolean shouldContinueExecuting() {
return !this.pathNavigator.noPath();
}
@@ -29,9 +29,14 @@ import forestry.apiculture.inventory.IApiaryInventory;
import forestry.apiculture.inventory.InventoryApiary;
import forestry.core.inventory.IInventoryAdapter;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Tuple;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class EntityMinecartApiary extends EntityMinecartBeeHousingBase implements IApiary {
@@ -85,8 +90,11 @@ public class EntityMinecartApiary extends EntityMinecartBeeHousingBase implement
beeModifiers.add(beeModifier);
for (IHiveFrame frame : inventory.getFrames()) {
beeModifiers.add(frame.getBeeModifier());
for (Tuple<IHiveFrame, ItemStack> frame : inventory.getFrames()) {
IHiveFrame hiveFrame = frame.getFirst();
ItemStack stack = frame.getSecond();
IBeeModifier beeModifier = hiveFrame.getBeeModifier(stack);
beeModifiers.add(beeModifier);
}
return beeModifiers;
@@ -98,13 +106,14 @@ public class EntityMinecartApiary extends EntityMinecartBeeHousingBase implement
}
@Override
public Object getGui(EntityPlayer player, int data) {
@SideOnly(Side.CLIENT)
public GuiContainer getGui(EntityPlayer player, int data) {
ContainerMinecartBeehouse container = new ContainerMinecartBeehouse(player.inventory, this, true);
return new GuiBeeHousing<>(this, container, GuiBeeHousing.Icon.APIARY);
}
@Override
public Object getContainer(EntityPlayer player, int data) {
public Container getContainer(EntityPlayer player, int data) {
return new ContainerMinecartBeehouse(player.inventory, this, true);
}
}
@@ -33,10 +33,9 @@ import forestry.core.owner.GameProfileDataSerializer;
import forestry.core.owner.IOwnedTile;
import forestry.core.owner.IOwnerHandler;
import forestry.core.owner.OwnerHandler;
import forestry.core.proxy.Proxies;
import forestry.core.tiles.IClimatised;
import forestry.core.utils.ClimateUtil;
import net.minecraft.entity.item.EntityMinecart;
import forestry.core.utils.NetworkUtil;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.EntityDataManager;
@@ -46,7 +45,7 @@ import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
public abstract class EntityMinecartBeeHousingBase extends EntityMinecartContainerForestry implements IBeeHousing, IOwnedTile, IGuiBeeHousingDelegate, IClimatised, IStreamableGui {
private static final DataParameter<Optional<GameProfile>> OWNER = EntityDataManager.createKey(EntityMinecart.class, GameProfileDataSerializer.INSTANCE);
private static final DataParameter<Optional<GameProfile>> OWNER = EntityDataManager.createKey(EntityMinecartBeeHousingBase.class, GameProfileDataSerializer.INSTANCE);
private static final Random random = new Random();
private static final int beeFXInterval = 4;
@@ -192,7 +191,7 @@ public abstract class EntityMinecartBeeHousingBase extends EntityMinecartContain
} else {
if (needsActiveUpdate) {
IForestryPacketServer packet = new PacketBeeLogicEntityRequest(this);
Proxies.net.sendToServer(packet);
NetworkUtil.sendToServer(packet);
needsActiveUpdate = false;
}
@@ -23,9 +23,13 @@ import forestry.apiculture.gui.ContainerMinecartBeehouse;
import forestry.apiculture.gui.GuiBeeHousing;
import forestry.core.inventory.IInventoryAdapter;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class EntityMinecartBeehouse extends EntityMinecartBeeHousingBase {
private static final IBeeModifier beeModifier = new BeehouseBeeModifier();
@@ -80,13 +84,14 @@ public class EntityMinecartBeehouse extends EntityMinecartBeeHousingBase {
}
@Override
public Object getGui(EntityPlayer player, int data) {
@SideOnly(Side.CLIENT)
public GuiContainer getGui(EntityPlayer player, int data) {
ContainerMinecartBeehouse container = new ContainerMinecartBeehouse(player.inventory, this, false);
return new GuiBeeHousing<>(this, container, GuiBeeHousing.Icon.BEE_HOUSE);
}
@Override
public Object getContainer(EntityPlayer player, int data) {
public Container getContainer(EntityPlayer player, int data) {
return new ContainerMinecartBeehouse(player.inventory, this, false);
}
}
+17 -16
View File
@@ -10,20 +10,21 @@
******************************************************************************/
package forestry.apiculture.entities;
import forestry.apiculture.proxy.ProxyApicultureClient;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import forestry.apiculture.PluginApiculture;
public class ParticleBeeExplore extends Particle {
private final Vec3d origin;
public ParticleBeeExplore(World world, Vec3d origin, BlockPos destination, int color) {
super(world, origin.xCoord, origin.yCoord, origin.zCoord, 0.0D, 0.0D, 0.0D);
setParticleTexture(ProxyApicultureClient.beeSprite);
super(world, origin.x, origin.y, origin.z, 0.0D, 0.0D, 0.0D);
setParticleTexture(PluginApiculture.getBeeSprite());
this.origin = origin;
this.motionX = (destination.getX() + 0.5 - this.posX) * 0.015;
@@ -54,9 +55,9 @@ public class ParticleBeeExplore extends Particle {
this.move(this.motionX, this.motionY, this.motionZ);
if (this.particleAge == this.particleMaxAge / 2) {
this.motionX = (origin.xCoord - this.posX) * 0.03;
this.motionY = (origin.yCoord - this.posY) * 0.03;
this.motionZ = (origin.zCoord - this.posZ) * 0.03;
this.motionX = (origin.x - this.posX) * 0.03;
this.motionY = (origin.y - this.posY) * 0.03;
this.motionZ = (origin.z - this.posZ) * 0.03;
}
if (this.particleAge < this.particleMaxAge * 0.25) {
@@ -72,15 +73,15 @@ public class ParticleBeeExplore extends Particle {
} else if (this.particleAge < this.particleMaxAge * 0.75) {
// venture back
this.motionX *= 0.95;
this.motionY = (origin.yCoord - this.posY) * 0.03;
this.motionY = (origin.y - this.posY) * 0.03;
this.motionY = (this.motionY + 0.2 * (-0.5 + rand.nextFloat())) / 2;
this.motionZ *= 0.95;
} else {
// get to origin
this.motionX = (origin.xCoord - this.posX) * 0.03;
this.motionY = (origin.yCoord - this.posY) * 0.03;
this.motionX = (origin.x - this.posX) * 0.03;
this.motionY = (origin.y - this.posY) * 0.03;
this.motionY = (this.motionY + 0.2 * (-0.5 + rand.nextFloat())) / 2;
this.motionZ = (origin.zCoord - this.posZ) * 0.03;
this.motionZ = (origin.z - this.posZ) * 0.03;
}
if (this.particleAge++ >= this.particleMaxAge) {
@@ -89,7 +90,7 @@ public class ParticleBeeExplore extends Particle {
}
@Override
public void renderParticle(VertexBuffer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) {
public void renderParticle(BufferBuilder buffer, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) {
float minU = 0;
float maxU = 1;
float minV = 0;
@@ -110,10 +111,10 @@ public class ParticleBeeExplore extends Particle {
int i = this.getBrightnessForRender(partialTicks);
int j = i >> 16 & 65535;
int k = i & 65535;
worldRendererIn.pos(f11 - rotationX * f10 - rotationXY * f10, f12 - rotationZ * f10, f13 - rotationYZ * f10 - rotationXZ * f10).tex(maxU, maxV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
worldRendererIn.pos(f11 - rotationX * f10 + rotationXY * f10, f12 + rotationZ * f10, f13 - rotationYZ * f10 + rotationXZ * f10).tex(maxU, minV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
worldRendererIn.pos(f11 + rotationX * f10 + rotationXY * f10, f12 + rotationZ * f10, f13 + rotationYZ * f10 + rotationXZ * f10).tex(minU, minV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
worldRendererIn.pos(f11 + rotationX * f10 - rotationXY * f10, f12 - rotationZ * f10, f13 + rotationYZ * f10 - rotationXZ * f10).tex(minU, maxV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
buffer.pos(f11 - rotationX * f10 - rotationXY * f10, f12 - rotationZ * f10, f13 - rotationYZ * f10 - rotationXZ * f10).tex(maxU, maxV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
buffer.pos(f11 - rotationX * f10 + rotationXY * f10, f12 + rotationZ * f10, f13 - rotationYZ * f10 + rotationXZ * f10).tex(maxU, minV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
buffer.pos(f11 + rotationX * f10 + rotationXY * f10, f12 + rotationZ * f10, f13 + rotationYZ * f10 + rotationXZ * f10).tex(minU, minV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
buffer.pos(f11 + rotationX * f10 - rotationXY * f10, f12 - rotationZ * f10, f13 + rotationYZ * f10 - rotationXZ * f10).tex(minU, maxV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
}
// avoid calculating lighting for bees, it is too much processing
+17 -16
View File
@@ -10,21 +10,22 @@
******************************************************************************/
package forestry.apiculture.entities;
import forestry.apiculture.proxy.ProxyApicultureClient;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import forestry.apiculture.PluginApiculture;
public class ParticleBeeRoundTrip extends Particle {
private final Vec3d origin;
private final BlockPos destination;
public ParticleBeeRoundTrip(World world, Vec3d origin, BlockPos destination, int color) {
super(world, origin.xCoord, origin.yCoord, origin.zCoord, 0.0D, 0.0D, 0.0D);
setParticleTexture(ProxyApicultureClient.beeSprite);
super(world, origin.x, origin.y, origin.z, 0.0D, 0.0D, 0.0D);
setParticleTexture(PluginApiculture.getBeeSprite());
this.origin = origin;
this.destination = destination;
@@ -56,9 +57,9 @@ public class ParticleBeeRoundTrip extends Particle {
this.move(this.motionX, this.motionY, this.motionZ);
if (this.particleAge == this.particleMaxAge / 2) {
this.motionX = (origin.xCoord - this.posX) * 0.03 + 0.1 * rand.nextFloat();
this.motionY = (origin.yCoord - this.posY) * 0.03 + 0.1 * rand.nextFloat();
this.motionZ = (origin.zCoord - this.posZ) * 0.03 + 0.1 * rand.nextFloat();
this.motionX = (origin.x - this.posX) * 0.03 + 0.1 * rand.nextFloat();
this.motionY = (origin.y - this.posY) * 0.03 + 0.1 * rand.nextFloat();
this.motionZ = (origin.z - this.posZ) * 0.03 + 0.1 * rand.nextFloat();
}
if (this.particleAge < this.particleMaxAge * 0.25) {
@@ -75,15 +76,15 @@ public class ParticleBeeRoundTrip extends Particle {
} else if (this.particleAge < this.particleMaxAge * 0.75) {
// venture back
this.motionX *= 0.95;
this.motionY = (origin.yCoord - this.posY) * 0.03;
this.motionY = (origin.y - this.posY) * 0.03;
this.motionY = (this.motionY + 0.2 * (-0.5 + rand.nextFloat())) / 2;
this.motionZ *= 0.95;
} else {
// get to origin
this.motionX = (origin.xCoord - this.posX) * 0.03;
this.motionY = (origin.yCoord - this.posY) * 0.03;
this.motionX = (origin.x - this.posX) * 0.03;
this.motionY = (origin.y - this.posY) * 0.03;
this.motionY = (this.motionY + 0.2 * (-0.5 + rand.nextFloat())) / 2;
this.motionZ = (origin.zCoord - this.posZ) * 0.03;
this.motionZ = (origin.z - this.posZ) * 0.03;
}
if (this.particleAge++ >= this.particleMaxAge) {
@@ -92,7 +93,7 @@ public class ParticleBeeRoundTrip extends Particle {
}
@Override
public void renderParticle(VertexBuffer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) {
public void renderParticle(BufferBuilder buffer, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) {
float minU = 0;
float maxU = 1;
float minV = 0;
@@ -113,10 +114,10 @@ public class ParticleBeeRoundTrip extends Particle {
int i = this.getBrightnessForRender(partialTicks);
int j = i >> 16 & 65535;
int k = i & 65535;
worldRendererIn.pos(f11 - rotationX * f10 - rotationXY * f10, f12 - rotationZ * f10, f13 - rotationYZ * f10 - rotationXZ * f10).tex(maxU, maxV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
worldRendererIn.pos(f11 - rotationX * f10 + rotationXY * f10, f12 + rotationZ * f10, f13 - rotationYZ * f10 + rotationXZ * f10).tex(maxU, minV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
worldRendererIn.pos(f11 + rotationX * f10 + rotationXY * f10, f12 + rotationZ * f10, f13 + rotationYZ * f10 + rotationXZ * f10).tex(minU, minV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
worldRendererIn.pos(f11 + rotationX * f10 - rotationXY * f10, f12 - rotationZ * f10, f13 + rotationYZ * f10 - rotationXZ * f10).tex(minU, maxV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
buffer.pos(f11 - rotationX * f10 - rotationXY * f10, f12 - rotationZ * f10, f13 - rotationYZ * f10 - rotationXZ * f10).tex(maxU, maxV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
buffer.pos(f11 - rotationX * f10 + rotationXY * f10, f12 + rotationZ * f10, f13 - rotationYZ * f10 + rotationXZ * f10).tex(maxU, minV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
buffer.pos(f11 + rotationX * f10 + rotationXY * f10, f12 + rotationZ * f10, f13 + rotationYZ * f10 + rotationXZ * f10).tex(minU, minV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
buffer.pos(f11 + rotationX * f10 - rotationXY * f10, f12 - rotationZ * f10, f13 + rotationYZ * f10 - rotationXZ * f10).tex(minU, maxV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
}
// avoid calculating lighting for bees, it is too much processing
+17 -16
View File
@@ -10,20 +10,21 @@
******************************************************************************/
package forestry.apiculture.entities;
import forestry.apiculture.proxy.ProxyApicultureClient;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import forestry.apiculture.PluginApiculture;
public class ParticleBeeTargetEntity extends Particle {
private final Vec3d origin;
private final Entity entity;
public ParticleBeeTargetEntity(World world, Vec3d origin, Entity entity, int color) {
super(world, origin.xCoord, origin.yCoord, origin.zCoord, 0.0D, 0.0D, 0.0D);
setParticleTexture(ProxyApicultureClient.beeSprite);
super(world, origin.x, origin.y, origin.z, 0.0D, 0.0D, 0.0D);
setParticleTexture(PluginApiculture.getBeeSprite());
this.origin = origin;
this.entity = entity;
@@ -56,9 +57,9 @@ public class ParticleBeeTargetEntity extends Particle {
this.move(this.motionX, this.motionY, this.motionZ);
if (this.particleAge == this.particleMaxAge / 2) {
this.motionX = (origin.xCoord - this.posX) * 0.03;
this.motionY = (origin.yCoord - this.posY) * 0.03;
this.motionZ = (origin.zCoord - this.posZ) * 0.03;
this.motionX = (origin.x - this.posX) * 0.03;
this.motionY = (origin.y - this.posY) * 0.03;
this.motionZ = (origin.z - this.posZ) * 0.03;
}
if (this.particleAge < this.particleMaxAge * 0.5) {
@@ -72,15 +73,15 @@ public class ParticleBeeTargetEntity extends Particle {
} else if (this.particleAge < this.particleMaxAge * 0.75) {
// venture back
this.motionX *= 0.95;
this.motionY = (origin.yCoord - this.posY) * 0.03;
this.motionY = (origin.y - this.posY) * 0.03;
this.motionY = (this.motionY + 0.2 * (-0.5 + rand.nextFloat())) / 2;
this.motionZ *= 0.95;
} else {
// get to origin
this.motionX = (origin.xCoord - this.posX) * 0.03;
this.motionY = (origin.yCoord - this.posY) * 0.03;
this.motionX = (origin.x - this.posX) * 0.03;
this.motionY = (origin.y - this.posY) * 0.03;
this.motionY = (this.motionY + 0.2 * (-0.5 + rand.nextFloat())) / 2;
this.motionZ = (origin.zCoord - this.posZ) * 0.03;
this.motionZ = (origin.z - this.posZ) * 0.03;
}
if (this.particleAge++ >= this.particleMaxAge) {
@@ -89,7 +90,7 @@ public class ParticleBeeTargetEntity extends Particle {
}
@Override
public void renderParticle(VertexBuffer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) {
public void renderParticle(BufferBuilder buffer, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) {
float minU = 0;
float maxU = 1;
float minV = 0;
@@ -110,10 +111,10 @@ public class ParticleBeeTargetEntity extends Particle {
int i = this.getBrightnessForRender(partialTicks);
int j = i >> 16 & 65535;
int k = i & 65535;
worldRendererIn.pos(f11 - rotationX * f10 - rotationXY * f10, f12 - rotationZ * f10, f13 - rotationYZ * f10 - rotationXZ * f10).tex(maxU, maxV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
worldRendererIn.pos(f11 - rotationX * f10 + rotationXY * f10, f12 + rotationZ * f10, f13 - rotationYZ * f10 + rotationXZ * f10).tex(maxU, minV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
worldRendererIn.pos(f11 + rotationX * f10 + rotationXY * f10, f12 + rotationZ * f10, f13 + rotationYZ * f10 + rotationXZ * f10).tex(minU, minV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
worldRendererIn.pos(f11 + rotationX * f10 - rotationXY * f10, f12 - rotationZ * f10, f13 + rotationYZ * f10 - rotationXZ * f10).tex(minU, maxV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
buffer.pos(f11 - rotationX * f10 - rotationXY * f10, f12 - rotationZ * f10, f13 - rotationYZ * f10 - rotationXZ * f10).tex(maxU, maxV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
buffer.pos(f11 - rotationX * f10 + rotationXY * f10, f12 + rotationZ * f10, f13 - rotationYZ * f10 + rotationXZ * f10).tex(maxU, minV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
buffer.pos(f11 + rotationX * f10 + rotationXY * f10, f12 + rotationZ * f10, f13 + rotationYZ * f10 + rotationXZ * f10).tex(minU, minV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
buffer.pos(f11 + rotationX * f10 - rotationXY * f10, f12 - rotationZ * f10, f13 + rotationYZ * f10 - rotationXZ * f10).tex(minU, maxV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
}
// avoid calculating lighting for bees, it is too much processing
+3 -1
View File
@@ -10,7 +10,9 @@
******************************************************************************/
package forestry.apiculture.flowers;
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import net.minecraft.block.state.IBlockState;
public final class Flower {
@@ -57,7 +59,7 @@ public final class Flower {
@Override
public String toString() {
return Objects.toStringHelper(this).add("blockState", blockState).add("weight", weight).toString();
return MoreObjects.toStringHelper(this).add("blockState", blockState).add("weight", weight).toString();
}
}
@@ -10,6 +10,9 @@
******************************************************************************/
package forestry.apiculture.genetics;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.EnumBeeChromosome;
import forestry.api.apiculture.IApiaristTracker;
@@ -18,8 +21,6 @@ import forestry.api.genetics.IIndividual;
import forestry.api.genetics.ISpeciesRoot;
import forestry.apiculture.PluginApiculture;
import forestry.core.genetics.BreedingTracker;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
public class ApiaristTracker extends BreedingTracker implements IApiaristTracker {
+26 -21
View File
@@ -19,7 +19,21 @@ import java.util.Map;
import java.util.Random;
import java.util.Set;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3i;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import com.mojang.authlib.GameProfile;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.EnumBeeChromosome;
import forestry.api.apiculture.FlowerManager;
@@ -52,19 +66,10 @@ import forestry.core.errors.EnumErrorCode;
import forestry.core.genetics.Chromosome;
import forestry.core.genetics.GenericRatings;
import forestry.core.genetics.IndividualLiving;
import forestry.core.tiles.TileUtil;
import forestry.core.utils.GeneticsUtil;
import forestry.core.utils.Translator;
import forestry.core.utils.VectUtil;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3i;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
public class Bee extends IndividualLiving implements IBee {
@@ -182,6 +187,7 @@ public class Bee extends IndividualLiving implements IBee {
}
@Override
@SideOnly(Side.CLIENT)
public IEffectData[] doFX(IEffectData[] storedData, IBeeHousing housing) {
IAlleleBeeEffect effect = genome.getEffect();
@@ -202,6 +208,7 @@ public class Bee extends IndividualLiving implements IBee {
return storedData;
}
@SideOnly(Side.CLIENT)
private IEffectData doFX(IAlleleBeeEffect effect, IEffectData storedData, IBeeHousing housing) {
return effect.doFX(genome, storedData, housing);
}
@@ -265,7 +272,7 @@ public class Bee extends IndividualLiving implements IBee {
}
// / Check for the sky, except if in hell
if (!world.provider.hasNoSky()) {
if (!world.provider.isNether()) {
if (!housing.canBlockSeeTheSky() && !canWorkUnderground(beeModifier)) {
errorStates.add(EnumErrorCode.NO_SKY);
}
@@ -357,7 +364,7 @@ public class Bee extends IndividualLiving implements IBee {
IAlleleBeeSpecies primary = genome.getPrimary();
IAlleleBeeSpecies secondary = genome.getSecondary();
if (!isPureBred(EnumBeeChromosome.SPECIES)) {
list.add(TextFormatting.BLUE + Translator.translateToLocal("for.bees.hybrid").replaceAll("%PRIMARY", primary.getName()).replaceAll("%SECONDARY", secondary.getName()));
list.add(TextFormatting.BLUE + Translator.translateToLocal("for.bees.hybrid").replaceAll("%PRIMARY", primary.getAlleleName()).replaceAll("%SECONDARY", secondary.getAlleleName()));
}
if (generation > 0) {
@@ -385,12 +392,12 @@ public class Bee extends IndividualLiving implements IBee {
if (Translator.canTranslateToLocal(unlocalizedCustomSpeed)) {
speed = Translator.translateToLocal(unlocalizedCustomSpeed);
} else {
speed = speedAllele.getName() + ' ' + Translator.translateToLocal("for.gui.worker");
speed = speedAllele.getAlleleName() + ' ' + Translator.translateToLocal("for.gui.worker");
}
String lifespan = genome.getActiveAllele(EnumBeeChromosome.LIFESPAN).getName() + ' ' + Translator.translateToLocal("for.gui.life");
String tempTolerance = TextFormatting.GREEN + "T: " + AlleleManager.climateHelper.toDisplay(genome.getPrimary().getTemperature()) + " / " + tempToleranceAllele.getName();
String humidTolerance = TextFormatting.GREEN + "H: " + AlleleManager.climateHelper.toDisplay(genome.getPrimary().getHumidity()) + " / " + humidToleranceAllele.getName();
String lifespan = genome.getActiveAllele(EnumBeeChromosome.LIFESPAN).getAlleleName() + ' ' + Translator.translateToLocal("for.gui.life");
String tempTolerance = TextFormatting.GREEN + "T: " + AlleleManager.climateHelper.toDisplay(genome.getPrimary().getTemperature()) + " / " + tempToleranceAllele.getAlleleName();
String humidTolerance = TextFormatting.GREEN + "H: " + AlleleManager.climateHelper.toDisplay(genome.getPrimary().getHumidity()) + " / " + humidToleranceAllele.getAlleleName();
String flowers = genome.getFlowerProvider().getDescription();
list.add(lifespan);
@@ -662,10 +669,8 @@ public class Bee extends IndividualLiving implements IBee {
for (int i = 0; i < 20; i++) {
BlockPos randomPos = VectUtil.getRandomPositionInArea(random, area);
BlockPos blockPos = VectUtil.add(housingPos, randomPos, offset);
TileEntity tile = world.getTileEntity(blockPos);
if (tile instanceof ICheckPollinatable) {
ICheckPollinatable pitcher = (ICheckPollinatable) tile;
ICheckPollinatable pitcher = TileUtil.getTile(world, blockPos, ICheckPollinatable.class);
if (pitcher != null) {
if (genome.getFlowerProvider().isAcceptedPollinatable(world, pitcher)) {
pollen = pitcher.getPollen();
}
@@ -717,7 +722,7 @@ public class Bee extends IndividualLiving implements IBee {
continue;
}
IPollinatable realPollinatable = GeneticsUtil.getOrCreatePollinatable(housing.getOwner(), world, posBlock);
IPollinatable realPollinatable = GeneticsUtil.getOrCreatePollinatable(housing.getOwner(), world, posBlock, Config.pollinateVanillaTrees);
if (realPollinatable != null) {
realPollinatable.mateWith(pollen);
@@ -1021,11 +1021,10 @@ public enum BeeDefinition implements IBeeDefinition {
for (BeeDefinition bee : values()) {
bee.registerMutations();
}
MinecraftForge.EVENT_BUS.post(new AlleleSpeciesRegisterEvent(BeeManager.beeRoot));
}
public static void preInit() {
MinecraftForge.EVENT_BUS.post(new AlleleSpeciesRegisterEvent<>(BeeManager.beeRoot, IAlleleBeeSpecies.class));
}
private void init() {
@@ -10,12 +10,17 @@
******************************************************************************/
package forestry.apiculture.genetics;
import java.util.concurrent.TimeUnit;
import com.google.common.base.Preconditions;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import java.util.concurrent.TimeUnit;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.math.Vec3i;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.EnumBeeChromosome;
import forestry.api.apiculture.IAlleleBeeEffect;
@@ -33,9 +38,6 @@ import forestry.core.genetics.Genome;
import forestry.core.genetics.alleles.AlleleArea;
import forestry.core.genetics.alleles.AlleleBoolean;
import forestry.core.genetics.alleles.AlleleTolerance;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.math.Vec3i;
public class BeeGenome extends Genome implements IBeeGenome {
/**
@@ -16,6 +16,9 @@ import java.util.List;
import java.util.Locale;
import java.util.Random;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.DefaultBeeModifier;
import forestry.api.apiculture.IBee;
@@ -23,8 +26,6 @@ import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IBeeModifier;
import forestry.api.apiculture.IBeekeepingMode;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public class BeekeepingMode implements IBeekeepingMode {
Loaded 100 of 862 files, more files were not shown because too many files have changed in this diff. Show more