Compare commits

...
244 Commits
Author SHA1 Message Date
MysteriousAges 319682ae2b Cleaning up crashy statements that rely on API classes being present. 2015-04-20 23:24:20 -07:00
MysteriousAges c8f20bd513 Merge pull request #40 from ibmibmibm/master
Update zh_TW.lang

Thanks for your work! (:
2015-04-20 21:42:33 -07:00
MysteriousAges 6f6823b6d2 Adding Botania lexicon entries & crafting recipes for Beegonia & Hiveacynth. 2015-04-20 21:37:49 -07:00
MysteriousAges a65c593c9a Adding Hiveacynth, with several configuration options. 2015-04-20 19:54:00 -07:00
MysteriousAges 55840ac08e Adding Beegonia subtile. 2015-04-20 17:36:55 -07:00
MysteriousAges a7076ce817 Add back the version checker; pings Github now.
Fix NPE on init.
2015-04-19 23:43:37 -07:00
MysteriousAges e5e6474ff9 Adding version check file. 2015-04-19 22:15:48 -07:00
MysteriousAges 1703e8a862 Update load order dependencies. 2015-04-19 15:27:09 -07:00
MysteriousAges b16524e919 Start on Botania integration. 2015-04-19 15:26:40 -07:00
MysteriousAges d8cd023876 Adding BotaniaHelper for future reasons. 2015-04-19 14:17:09 -07:00
MysteriousAges d64ec3caa2 Merge branch 'master' of github.com:MagicBees/MagicBees
Conflicts:
	src/api/java/thaumcraft/api
2015-04-19 13:57:39 -07:00
MysteriousAges 515e0e1751 Once more, with feeling. 2015-04-19 13:56:38 -07:00
MysteriousAges cc9bbefa3f Update README.md 2015-04-19 13:19:46 -07:00
MysteriousAges 18c7790abd Moving Thaumcraft api submodule to the "correct" location.
Adding Blood Magic deobf jar to libs folder for ease of building.
Adding Botania deobf jar to libs folder for ease of building.
rev++
2015-04-19 13:14:29 -07:00
Shen-Ta Hsieh ccbfa4995d Update zh_TW.lang 2015-04-18 16:58:13 +08:00
MysteriousAges 54faf63bab Moved postInit block/item queries for mods to init to try avoiding bee mutation NPEs. 2015-04-13 17:49:26 -07:00
MysteriousAges e14bbe254a Changed bee init to Mod init, from post. Fixes #17. 2015-04-13 09:16:31 -07:00
MysteriousAges 50d914e846 Changed tool registration on Thaumium grafter & scoop. Fixes #34 2015-04-13 09:10:42 -07:00
MysteriousAges 3b8dec5425 Cleaning up misplaced modname references.
Incrementing build number.
2015-04-12 15:42:47 -07:00
MysteriousAges a332d3f2e5 Removing Forestry interfaces from @Optional. Fixes #35 2015-04-12 15:24:35 -07:00
MysteriousAges d921717965 Merge branch 'thaumicApiary-dev'
Conflicts:
	gradle.properties
2015-04-12 14:45:19 -07:00
MysteriousAges 55f9e58297 Converted Russian loc file to UTF-8 from something else. Fixes #33 2015-03-31 14:15:20 -07:00
MysteriousAges 7930108032 Bump version number for release build. 2015-03-29 21:24:49 -07:00
mezz 0fd8b319de Fix apiary not retaining AuraCharge state 2015-03-28 02:51:41 -07:00
MysteriousAges 051cc96514 Research notes for Vis Aura provider, TC crafting & garbage.
Apiary logic tweaks.
2015-03-27 22:35:33 -07:00
MysteriousAges 40fdbb29c6 Finalize Vis Apiary Booster crafting recipe.
Better IMagicApiaryAuraProvider search algorithm.
Reformat ThaumcraftHelper; removed old method, Add enums for wooden & metal TC devices.
2015-03-27 16:31:15 -07:00
MysteriousAges 52798c8175 Vis aura provider rendering!
Rename EfectJarRenderer to RendererEffectJar.
2015-03-26 22:19:40 -07:00
MysteriousAges a5fed5c9b7 Change Apiary to query chunks for IAuraProvider directly without going through the world object. 2015-03-26 13:57:29 -07:00
MysteriousAges 07624a3a4c Change HiveType to check spawn location to see if occupant bees can actually work in the biome, and not spawn if they cannot. 2015-03-26 13:05:15 -07:00
MysteriousAges dc4cd3331c Removing unnessecary try/catch from thaumium tools; moving to item init. 2015-03-24 16:18:10 -07:00
MysteriousAges 6ea6f1e017 Adding temporary crafting recipes for Magic Apiary & vis aura converter. 2015-03-21 21:26:51 -07:00
MysteriousAges cb7b515626 Added network event for updating bit flags.
Magic Apiary pulls charges from Aura Providers.
2015-03-21 20:45:36 -07:00
MysteriousAges 46cb2cb95a Add VisAuraProvider. Placeholder texture, placeholder name, placeholder EVERYTHING.
Add crude search mechanism for Aura Providers to Magic Apiary.
2015-03-21 18:20:45 -07:00
MysteriousAges cc987d6ac8 Renaming Thaumic Apiary to Magic Apiary. 2015-03-20 16:52:42 -07:00
MysteriousAges 4f39132e4e Adjusting lifebar locations in Apiary GUI. 2015-03-19 14:02:43 -07:00
MysteriousAges 4938c29e8c Deleting reference package. Not needed.
Moving Apiary config location - not Thaumcraft specific.
Adding ItemStackUtils - generic item stack/inventory functions.
Thaumic Apiary has baseline functionality. Bees work in it.
2015-03-19 13:51:41 -07:00
MysteriousAges cbb0b15dee Adding network packet stuff. 2015-03-18 23:53:22 -07:00
MysteriousAges b881283492 Updating GUI texture. 2015-03-18 23:52:55 -07:00
MysteriousAges 5d4b84727d Work on Thaumic Apiary. Creating Packet Handler for sending network events (ie queen item stack changes)
Tweaking textures on thaumic apiary again
Adding MORE crap to gitignore
build.gradle missing a runDir argument, apparently.
2015-03-17 23:03:48 -07:00
MysteriousAges ad9135590d Starting to flesh out Thaumic Apiary. 2015-03-15 01:06:14 -07:00
MysteriousAges 5cd884929f Moving the thaumcraft submodule to a place where Eclipse won't bitch me out about it. @_@
Added the 'mods/' folder to gitignore. Don't need that stuff in the repo, kthxbai
2015-03-15 00:45:43 -07:00
MysteriousAges 7bd5e7ac54 Refactoring Effect Jar code a bit. 2015-03-14 15:39:05 -07:00
MysteriousAges 8cda9b9f43 Hazardifying Thaumic Apiary GUI. 2015-03-14 15:38:37 -07:00
MysteriousAges 444303d06d Hazardifying apiary textures.
Deleting unused greatwood & silverwood plank textures.
2015-03-14 15:22:07 -07:00
MysteriousAges b3ca22fd1f Administrative cleanup stuff. Whee. 2015-03-14 15:11:35 -07:00
MysteriousAges 1f8f324c56 Kicking Thaumcraft API out into submodule. You'll have to update submodules to build from now on. (Easier than trying to keep a damned jar up to date manually)
Brushing up build.gradle and creating gradle.properties to manage mod version & version dependencies.
Disabling mod version check for now - Dropbox file has been inaccessible for the better part of a year. (Thanks, dropbox.)
Nuking build version in VersionInfo.java - not used for anything; not useful.
2015-03-14 15:06:01 -07:00
MysteriousAges 3d1cdfa9af Adding BS files to gitignore. 2015-03-14 14:00:07 -07:00
MysteriousAges 1275abc1c4 Cleaning up Config.java some. 2015-03-14 13:59:24 -07:00
Arkandos 3347afb0c3 Update imports to unstable forestry 2015-01-16 22:59:06 +01:00
Arkandos 016049ef67 Merge my branch into the main one, initial work on the thaumic apiary
Might have messed something up. Not quite sure
2015-01-16 22:06:02 +01:00
mezz 33b0af6682 Close #27 Use Forestry API for hive generation 2015-01-13 23:55:31 -08:00
mezz 8bf47d8f5f Update to latest unstable forestry 2015-01-13 23:55:30 -08:00
mezz e9c91cda37 Make config fields start lowercase 2015-01-13 23:55:30 -08:00
mezz f645076eeb Make config options consistently static 2015-01-13 23:55:30 -08:00
mezz 8ccb8f4d75 Merge pull request #28 from Adaptivity/UpdateruRUlang
Update ru_RU.lang
2015-01-10 10:27:27 -08:00
Adaptivity 142637151a Update ru_RU.lang 2015-01-10 17:56:46 +03:00
mezz 469867bc1f Close #22 have Apatite bees require block of Apatite instead of the ore 2015-01-10 00:55:52 -08:00
mezz 712679d8ac Fix #25 Broken Thaumcraft research 2015-01-10 00:49:05 -08:00
mezz 8eb8363b31 missed one 2015-01-10 00:16:21 -08:00
mezz cd758dfec2 Fix #18 Bees not delivering notes in Escritoire 2015-01-10 00:05:04 -08:00
mezz 629cd06ef6 Fix #24 Game does not load if Thaumcraft not installed 2015-01-09 23:13:32 -08:00
mezz 8e11456ea3 Fix #19 Transmuting Effect Causes Server Crash 2015-01-09 22:45:03 -08:00
mezz 2c5e6ca041 Fix #4 Placing a bee into the jar gui causes a crash 2015-01-09 00:21:55 -08:00
mezz a739206e01 Fix typo in Mysterious magnet 2015-01-08 23:46:54 -08:00
mezz 9b9926b340 Update dependencies (Forge, Forestry, Thaumcraft, BloodMagic) 2015-01-08 23:42:46 -08:00
mezz dac7c0ddef Autoformat: spaces to tabs, remove unused imports 2015-01-08 21:48:13 -08:00
mezz a6d1a9f1a4 Create Readme
Based on the forum post http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1287405-magic-bees-magic-themed-bees-for-forestry-the
2015-01-08 18:57:26 -08:00
Arkandos 98a5e73ddf Update the changelog 2014-10-24 19:30:01 +02:00
Arkandos f68b47473f Merged in Astrologers/magic-bees (pull request #4)
new zh_CN.lang
2014-10-24 12:54:47 +02:00
Astrologers a0df95b36c new zh_CN.lang 2014-10-24 18:28:50 +09:00
Arkandos 6ff6b72580 Merged in marcin212/magic-bees (pull request #3)
probably fix: #21 #20 #17.
2014-10-18 17:03:37 +02:00
marcin212 2f5cbb7d3c Fixed issue #23 Infernal Hive not spawning (+1 squashed commits)
Squashed commits:

[ca7be80] probably fix #21 #20 #17.
2014-10-18 16:49:29 +02:00
Arkandos 250e5c159f More bugfixes
Fixed some derps on my side.
Also added a configoption to set thaumcraft sapling droprate
2014-10-09 12:00:15 +02:00
Arkandos 0c5f27e192 Bugfixes
Fixes #14 & #16
2014-09-23 00:30:12 +02:00
Arkandos a6c439c078 Started work on Thaumic Apiary
Also some bugfixes
2014-09-16 20:30:30 +02:00
Arkandos 300a22efab Merged in Vexatos/magic-bees-1/Vexatos/updated-de_delang-1408802455071 (pull request #2)
Updated de_DE.lang
2014-08-23 16:25:28 +02:00
Vexatos fdf89303e4 Updated de_DE.lang 2014-08-23 14:01:07 +00:00
Arkandos ffe3f9d33e Updated to Tarig0s Language files 2014-08-23 01:34:02 +02:00
Arkandos 0e0eaac495 Fixes.
Upped forge to latest.
Now requires Forestry 3.
Hopefully fixed Thaumcraft and ExtraBees integration
2014-08-23 00:33:46 +02:00
Arkandos e9c423579b Seems good. Merging
Merged in Tarig0/magic-bees-1/Tarig0/add-forestry-maven-repo-1408309659498 (pull request #1)

Add forestry maven repo
2014-08-17 23:15:49 +02:00
Tarig0 1be990eb0e Add forestry maven repo 2014-08-17 21:07:42 +00:00
Arkandos 87a918b7c6 Centrifuge fixes
Released version 2.1.18
2014-08-17 19:51:35 +02:00
Arkandos 580f1f4e12 Bugfixes and Modularization
Fixed several crashes due to ThermalExpansion splitting into Thermal
Foundation.
Also added config options to disable modinteraction with other mods.
2014-08-11 14:09:15 +02:00
Arkandos 2b0b729ad0 Started work on BloodMagic bees
Created 2 very basic, BM bees.
Also fixed a crash when trying to get nuggets from an ingot.
Also removed some unneeded nuggets.
2014-08-04 01:28:57 +02:00
Arkandos f5a6ca61ba Started work on Bloodmagic Bees
Implemented BloodMagicHelper to interface with bloodmagic
2014-08-02 18:55:38 +02:00
Arkandos 44ecbbdc45 Implemented config gui
Just implemented a simple config gui. Will try to refine this later
2014-08-01 19:28:34 +02:00
Arkandos d3c6ad5433 1.7.10 Port
Initial 1.7.10 Port. Everything seems to be working, but can't be tested
without access to Thaumcraft.
Got rid of Forestrys Item/BlockInterfaces and created my own.
Started to use @Optional.Interface
Implemented @Pahimar s LogHelper to deal with log4j
Changed localization system to use the vanilla one
2014-08-01 04:05:49 +02:00
MysteriousAges 5b053dd990 Merged in Vexatos/magic-bees-1/Vexatos/en_usxml-edited-removed-german-species-n-1398711730720 (pull request #6)
en_US.xml edited, removed German species names
2014-04-28 12:11:40 -07:00
Vexatos e416d09dde en_US.xml edited, removed German species names 2014-04-28 19:03:16 +00:00
MysteriousAges 723506d04f Merged in Vexatos/magic-bees (pull request #5)
Update de_DE.xml, removed duped entry from en_US
2014-04-28 11:55:37 -07:00
Vexatos c352b42fc1 Update de_DE.xml, removed duped entry from en_US 2014-04-22 10:18:50 +02:00
MysteriousAges 95275e57d6 Merged in Minalien/magic-bees (pull request #4)
Upgraded to 1.7.2.
2014-04-08 16:48:24 -07:00
Ken 'Minalien' Murray 02659b2816 Upgraded to 1.7.2. List of currently-known issues are in CURRENT_ISSUES.txt file. 2014-04-08 12:39:01 -07:00
MysteriousAges 02655f092e Tagging MB with license info 2014-01-24 03:00:08 +00:00
MysteriousAges 03bc6c0d83 Fixing WorldGeneratorHandler.java 'cause oops. 2014-01-21 14:00:32 -08:00
MysteriousAges 85f8ab960d Tidying up from merge some
Switching hivegen to respect isGenMineableReplaceable for crazy mods like underground biomes.
2014-01-18 12:44:14 -08:00
MysteriousAges 2146249b9c Cleaning up code from TE merge 2014-01-16 13:51:51 -08:00
MysteriousAges a4ebd6d859 Merged in jadedcat/magic-bees-jc (pull request #3)
Thermal Expansion and Redstone Arsenal Bees
2014-01-16 12:35:07 -08:00
jadedcat 6c79dfb104 Thermal Expansion and Redstone Arsenal Bees 2014-01-16 14:31:09 -06:00
MysteriousAges 9233d45b33 Revert "Merged in kieranmenor/magic-bees (pull request #1)"
This reverts commit 7082436190, reversing
changes made to fb8873b781.
2014-01-16 12:13:00 -08:00
MysteriousAges 7082436190 Merged in kieranmenor/magic-bees (pull request #1)
Conflicts:
	magicbees_src/magicbees/world/feature/FeatureHive.java
2014-01-15 18:45:50 -08:00
MysteriousAges fb8873b781 Build. 2014-01-12 17:11:25 -08:00
MysteriousAges 12c1b3b5c3 (Possibly) fixing busted AM2 mob spawns. 2013-12-27 13:35:59 -08:00
MysteriousAges ecaa9babf7 TCons renamed their aluminum ore. -_- 2013-12-27 13:35:40 -08:00
MysteriousAges 16086558e4 Fixes to fluids. 2013-12-18 15:34:35 -08:00
MysteriousAges cc4390ec21 Fluid name updates 2013-12-18 13:44:42 -08:00
MysteriousAges 0cb6505fd4 build nonsense 2013-12-18 12:53:07 -08:00
MysteriousAges 52128123ef Shadow on tempus aspect
Config option to switch off otherworld hives spawning in magic biomes.
2013-12-17 11:41:23 -08:00
MysteriousAges 6136a59a15 Tweaks and things. 2013-11-02 13:24:45 -07:00
MysteriousAges 0886fd1389 Build script updates
Changing recipe of Dimensional Singularity to make it less painful.
2013-10-20 23:15:49 -07:00
MysteriousAges ea409d34de Hive frames are not enchantable. (Enchants never did anything anyway.)
Adjusting hive spawn code.
2013-10-10 23:39:04 -07:00
Kieran Menor 1f7fe61afe Rewrote most of the hive spawn logic. Spawn chances for each hive are defined in HiveType.initHiveData() for each biome type.
It builds. Not tested in Minecraft due to lack of 1.6.2 setup.
2013-10-08 02:17:54 +02:00
MysteriousAges 1cb45e24c5 Build script changes for jenkins. 2013-10-06 22:28:56 -07:00
MysteriousAges 7ab175d8b6 Block update message. Guessing 0 people are going to see this, but whatever. 2013-10-06 21:18:50 -07:00
MysteriousAges 31ff948c6d Cleaning up some old commented crap. 2013-10-06 12:26:24 -07:00
MysteriousAges fa2590d41e Fixes. 2013-09-29 19:41:16 -07:00
MysteriousAges 0e77348285 Shit. It's going into the repo. 2013-09-25 21:21:03 -07:00
MysteriousAges 608656be73 Refactoring resource locations to reference CommonProxy.DOMAIN.
Adding the Mysterious Magnet.
2013-09-17 19:40:26 -07:00
MysteriousAges 58c56623af Fixing indentation. (Remind me to not use Eclipse to edit these.) 2013-09-16 10:05:40 -07:00
MysteriousAges f05c12b2ee Holy shit, all the research!
Also, some new stuff. @_@
2013-09-16 00:30:40 -07:00
MysteriousAges 4b802d4727 + Mutating essence
Renaming other essences to shorter forms
2013-09-15 20:47:56 -07:00
MysteriousAges ffd6f2ca94 TC4 & AM2 integration progress! <3 2013-09-12 19:33:08 -07:00
MysteriousAges c309c20268 Seriously Thaumcraft? WTF.
Fixing logic error in Railcraft transmutation effect logic.
2013-09-10 15:24:52 -07:00
MysteriousAges 3d75e97b20 Shit, I did it again.
Cleaning up old TC3 stuff, preparing to try integrating TC4.
Cleaning up helper stuff so it is more consistent & straightforward.
2013-09-09 23:23:00 -07:00
MysteriousAges e23ebd1011 Pulling forward some changes to 1.5 2013-09-04 21:07:04 -07:00
MysteriousAges 707a9bd64e Fixing disable check. 2013-09-04 21:02:36 -07:00
MysteriousAges 6c567e247a Deactivating TC3 integration.
Fixing bad animated textures.
2013-09-04 20:44:03 -07:00
MysteriousAges 132d9b47f0 Merge branch '1.5' of bitbucket.org:MysteriousAges/magic-bees into 1.5 2013-09-04 16:23:20 -07:00
MysteriousAges 5090aa76ea Stuff! (It's in the changelogs.) 2013-09-02 17:32:59 -07:00
MysteriousAges 61e6b82bc3 Mutations for Crumbling & Mutable. 2013-08-28 23:44:38 -07:00
MysteriousAges 533d7d55a8 Crumbling, Transmuting bees & their (crappy) effects. 2013-08-28 17:46:38 -07:00
MysteriousAges 7513ba1255 Fixing mutation rate on Iron bees. 2013-08-26 11:35:53 -07:00
MysteriousAges a560085ac9 Liquid references renaming to Fluid. Should wrap up 1.6 port. 2013-08-25 20:43:00 -07:00
MysteriousAges f9ceeba358 Porting to 1.6. 2013-08-25 19:56:55 -07:00
MysteriousAges c5d59a4505 Moving model texture dir 2013-08-25 18:50:01 -07:00
MysteriousAges 0a6f6eda09 Begin port to 1.6 2013-08-25 18:48:41 -07:00
MysteriousAges ca8b206912 Lang changes.
Effect data fix.
2013-08-18 23:25:33 -07:00
MysteriousAges 3aea0376bc Changelog. 2013-08-02 23:01:22 -07:00
MysteriousAges 7751c01463 Bugs. 2013-08-02 22:58:06 -07:00
MysteriousAges 5699937179 Changing localization method for capsules; adding a %s instead of concatenating the strings in code.
Updates for Lang files.
2013-08-02 13:56:35 -07:00
MysteriousAges abb7e64613 Update langs 2013-07-26 01:31:33 -07:00
MysteriousAges f31d3b9b09 Adding Tinker's Construct metal bees (Aluminum, Ardite, Cobalt, Manyullyn) 2013-07-26 01:25:51 -07:00
MysteriousAges a7515baf69 New logo file for "Magic Bees". 2013-07-19 16:01:18 -07:00
MysteriousAges 888f86d8bb Fixing derp in build script 2013-07-19 15:36:34 -07:00
MysteriousAges 3989430408 3 new essences: Time, armor & oblivion
Crafting recipes for the essences
Recipes for essences -> remaining frames; removed all "no TC" recipes for frames.
Thaumcraft recipe cost reduction on frames
2013-07-19 15:34:54 -07:00
MysteriousAges 99a88cf9bc Fixing hard-coded value in ForestryHelper that effed over mutations into Cultivated.
Updating for whitespace issues in en_US, updating de_DE.
2013-07-17 10:49:04 -07:00
MysteriousAges 6c50d89353 Fixes for new version. 2013-07-16 23:08:57 -07:00
MysteriousAges dbc6acb9c9 Wither/Slow effects respect api armor
Nugget production adjustments
2013-06-17 16:46:05 -07:00
MysteriousAges ff476ad969 Updating langs 2013-06-14 13:41:07 -07:00
MysteriousAges e20ab2dfb9 Updating to Forestry 2.2.8.0
fixing some shit.
2013-06-14 13:30:00 -07:00
MysteriousAges c3210c0883 Uncomment ru_RU localization. 2013-06-10 02:59:44 -07:00
MysteriousAges c2c21301a6 Tweaks to hivegen; still needs more work.
Changing references to "biofuel" to "ethanol"
2013-06-10 01:01:30 -07:00
MysteriousAges 91777b1960 Fixing inconsistent whitespace in lang files. 2013-06-09 23:06:46 -07:00
MysteriousAges 532042393b Fixing inconsistent whitespace in lang files. 2013-06-09 23:05:01 -07:00
MysteriousAges c89c9b0d33 2.0.0 release, some balance tweaks 2013-06-06 15:39:36 -07:00
MysteriousAges 0b000d68b9 Updates to ru_RU localization
Oblivion bee branch
Adding permanent vanilla crafting recipes for Gentle & Metabolic frames.
Mutations for base element bees
2013-06-05 00:11:40 -07:00
MysteriousAges 2f286e8e2c Loc updates. 2013-06-04 23:13:42 -07:00
MysteriousAges 406132babc Adding Wither Skull crafting, sort of.
Loc string fixes
Escritoire work

... I really need to commit more often. :x
2013-06-04 13:26:44 -07:00
MysteriousAges b7a071d887 Fixing bad XML tags 2013-05-31 18:38:46 -07:00
MysteriousAges 37e8965a3c Finishing up Worldgen, added new initial mutations (still several left to go) 2013-05-31 15:09:15 -07:00
MysteriousAges b7714a1435 Moving files around. 2013-05-31 03:33:19 -07:00
MysteriousAges c9bffd18d8 New Forestry API update
Hive gen work.
2013-05-29 17:49:54 -07:00
MysteriousAges 48b9d59f33 Hives, retrogen, worldgen, loc fixes, and assloads of refactoring. 2013-05-29 11:15:25 -07:00
MysteriousAges f7fcf5ed9d Lemming, you are a fiend. 2013-05-28 16:54:28 -07:00
MysteriousAges a95036aa2e Texture changes. 2013-05-28 02:09:29 -07:00
MysteriousAges 10da83f082 Removing PSDs. 2013-05-23 21:11:28 -07:00
MysteriousAges bc596ee3a6 More things! 2013-05-23 21:07:49 -07:00
MysteriousAges 6ae6a8afc0 Refactor ALL THE FUCKNIG THINGS 2013-05-23 21:07:28 -07:00
MysteriousAges bde2baab2d Removing net.mysteriousages.utils 2013-05-23 21:05:19 -07:00
MysteriousAges f33e48ead9 Hive textures! 2013-05-22 20:42:06 -07:00
MysteriousAges 6152508a0b Cleaning up extra function from merge. 2013-05-22 00:45:16 -07:00
MysteriousAges f3ceac50cd Merge branch '1.4.7_ForestryUpdate'
Conflicts:
	thaumicbees_src/thaumicbees/bees/Allele.java
2013-05-22 00:44:29 -07:00
MysteriousAges 98a38a1f6e Forestry 2.2.4 API break updates. 2013-05-22 00:42:49 -07:00
MysteriousAges 7aba3f5f53 Some refactoring; work on some initial hive blocks. 2013-05-19 14:53:27 -07:00
MysteriousAges 66c1a89c32 Fixing render issue with jar. 2013-05-15 10:41:48 -07:00
MysteriousAges 5f9b122d77 Some polishing, registering all the items with Forge because RG asked for it. *worry* 2013-05-13 13:11:34 -07:00
MysteriousAges 71d203bffc Version++ 2013-05-06 00:24:52 -07:00
MysteriousAges 092c076dba Work on the Effect jar, which is finally done! \o/ 2013-05-06 00:24:06 -07:00
MysteriousAges ebb8298c9d Merge branch 'master' into EffectJar
Conflicts:
	thaumicbees_src/thaumicbees/main/Config.java
	thaumicbees_src/thaumicbees/main/ThaumicBees.java
2013-05-01 12:06:48 -07:00
MysteriousAges ab2f6a64d5 Bee mutation swapping around. 2013-05-01 12:02:26 -07:00
MysteriousAges 62b7d28020 Adding Apatite bees.
Mutation class supports block requirements beneath the apiary. Can use blockId/blockId & meta/ore dictionary entry.
Added Ars Magica recipe for Concentrated compound.
2013-04-28 22:11:56 -07:00
MysteriousAges e5ae2527a9 Many Ars Magica bees! 2013-04-25 20:38:45 -07:00
MysteriousAges aca8b2dcb1 Fixing some texture misses, eliminating dead/useless code that throws errors and dead/useless code that does not throw errors
Starting Ars Magica integration.
New Skulking family sprite. Enjoy nightmares.
2013-04-24 15:43:23 -07:00
MysteriousAges 88ec668999 *tableflip* 2013-04-22 16:03:27 -07:00
MysteriousAges 9729d75252 Work on Effect jar;
Fixing TC3 integration on 1.5
2013-04-21 15:38:52 -07:00
MysteriousAges fc2f40d100 Fixing caps on Fuel.png & Oil.png 2013-04-19 12:10:29 -07:00
MysteriousAges ce0424b468 Fixing caps on "fuel.png" & "oil.png" 2013-04-19 12:10:07 -07:00
MysteriousAges 940846d069 ++ version 2013-04-15 02:28:45 -07:00
MysteriousAges b2d18fbb64 Moon dial
Creative tab
2013-04-15 02:27:33 -07:00
MysteriousAges 96389b5329 Port to 1.5.1! Woooo! 2013-04-15 00:17:50 -07:00
MysteriousAges 61afb3a0bc Changelog & last loc string 2013-04-12 01:30:10 -07:00
MysteriousAges bf57ac3491 Lang & changelog. Version ++. 2013-04-11 23:10:40 -07:00
MysteriousAges e8421f40fe New bees, EE3 "integration". Nuggets, Frames. 2013-04-11 23:08:17 -07:00
MysteriousAges b8d12b1f9a Lots of new bees, pulling out most dependencies on Thaumcraft 3 into helper; making it possible to run without. 2013-04-11 02:40:25 -07:00
MysteriousAges 1476470054 More work on Bee Jar. 2013-04-02 20:02:09 -07:00
MysteriousAges 89fb41b814 Flammability configuration option; start of effect jar 2013-03-28 09:21:00 -07:00
MysteriousAges f44591b47d Removing Apiary junk FOREVERZ. (Not really; moved to branch.)
Purify + Node growth? Fuck you. You die here.
2013-03-26 00:00:58 -07:00
MysteriousAges fd82a0ef72 Fixing things, and adding balance to grafter. 2013-03-24 13:34:17 -07:00
MysteriousAges cbbf2558fd Merge branch 'master' of bitbucket.org:MysteriousAges/thaumicbees 2013-03-13 19:53:53 -07:00
MysteriousAges 76f541bc3f Exdending length of come bee effects
Adding hunger-inducing to grafter
Adding Greatwood & Silverwood log planks
Fixing more Version Info shit.
2013-03-13 19:53:39 -07:00
MysteriousAges 7f95da0f6c Implementing some functions for Apiary. I think it might get shelved for now... 2013-03-13 17:39:54 -07:00
MysteriousAges 3798f1f771 Version really should be the ant variable. 2013-03-06 20:59:55 -08:00
MysteriousAges 721a60c994 Holy fuck that was a mess. 2013-03-06 20:44:06 -08:00
MysteriousAges 4a03a5f48c Revert "Merge branch 'machineDev' of https://bitbucket.org/MysteriousAges/thaumicbees into machineDev"
This reverts commit c6720b7417, reversing
changes made to 575c799587.
2013-03-06 19:44:01 -08:00
MysteriousAges c6720b7417 Merge branch 'machineDev' of https://bitbucket.org/MysteriousAges/thaumicbees into machineDev 2013-03-06 19:36:14 -08:00
MysteriousAges 575c799587 Revert "Revert "Merge from master.""
This reverts commit 2c324174e4.
2013-03-06 19:33:09 -08:00
MysteriousAges 2c324174e4 Revert "Merge from master."
This reverts commit e92d9c131e.
2013-03-06 19:30:43 -08:00
MysteriousAges 28f5a15f0a Merge branch 'master' of https://github.com/MysteriousAges/ThaumicBees-Loc 2013-03-06 16:48:31 -08:00
MysteriousAges 9bed2d3749 Fixing problems with grafter not enchanting; version checking. 2013-03-06 13:42:57 -08:00
MysteriousAges 1a394ce858 Changelog. 2013-03-05 18:09:50 -08:00
MysteriousAges 5d3bd8bde2 Adjusting version info to match format Version checking supports. Better fix would be to add support in version checking. 2013-03-05 18:08:53 -08:00
MysteriousAges 5279a6e64a Update to 1.4.3 2013-03-05 01:06:29 -08:00
MysteriousAges 2c2306b223 Adding aspects for Extra Bees items
Adding support for remote version checking! Wahoo!
2013-03-05 00:57:31 -08:00
MysteriousAges 8aaa24c3c1 Adding new keys. 2013-03-04 14:08:42 -08:00
MysteriousAges e32c05ab3e Merge branch 'machineDev'
Conflicts:
	thaumicbees_src/thaumicbees/main/Config.java

Deleting block classes from this branch, because GO AWAY.
2013-03-04 13:18:15 -08:00
MysteriousAges f21bd467c2 Uncommenting blocks in Config. 2013-03-04 13:10:21 -08:00
MysteriousAges d3e93188c0 Edits to build.xml & mod info. 2013-03-04 13:09:50 -08:00
MysteriousAges e92d9c131e Merge from master. 2013-03-04 13:04:21 -08:00
MysteriousAges 1bee56adf3 Die, build.number. You don't need to be tracked. 2013-03-04 13:03:15 -08:00
MysteriousAges 85a2723ef8 Checkin before moving Apiary stuff to branch. 2013-03-04 13:02:15 -08:00
MysteriousAges 29069e7e9f Grafter & Scoop~! 2013-03-03 23:50:29 -08:00
MysteriousAges c8be483bf0 Merge branch 'master' of bitbucket.org:MysteriousAges/thaumicbees
Conflicts:
	thaumicbees_src/thaumicbees/main/Config.java
2013-02-27 19:29:18 -08:00
MysteriousAges 92ace4e9a3 Scoop work. 2013-02-27 17:49:32 -08:00
MysteriousAges aed979a19f dev 2013-02-26 17:56:57 -08:00
MysteriousAges 0fa9a6ed23 New capsule, more refactoring. More research. More config options for capsule stack size 2013-02-22 16:14:17 -08:00
MysteriousAges b3660ecf58 Removing build number from repo. 2013-02-18 12:37:37 -08:00
MysteriousAges 5eb787352b Planks & Refactoring. 2013-02-18 12:13:31 -08:00
MysteriousAges a7774e1fca Loc problems getting fixed. 2013-02-15 13:00:30 -08:00
MysteriousAges 596ae798ec Initial commit. en_US only. 2013-02-12 17:34:33 -08:00
MysteriousAges 902812e015 Starting Localization! Yaaaaaaaaaay 2013-02-12 17:21:29 -08:00
MysteriousAges 0b510e8426 Tweaking the flux & purify bee effect
Commenting out Magic Apiary blocks for a release version.
2013-02-12 13:40:18 -08:00
MysteriousAges d4c5d1e356 Forestry API break not public yet. 2013-02-12 13:13:37 -08:00
MysteriousAges 5a2f360e50 Another FC build.
*Heavily refactored bee code. Much cleaner now I think.
*Temporal bee branch complete, now with more Doctor Who!
2013-02-09 14:12:43 -08:00
MysteriousAges 84ad8b0d7b Lots of work... None of it actually on machines. 2013-02-06 00:33:51 -08:00
MysteriousAges 6a26bec4e1 Fucktons of refactoring.
*Moving ItemManager & BlockManager functionality into Config object.
*New CraftingManager to hold all the crafting stuff
*Shuffling some classes around in packages and whatnot.
*Switching to use the ItemInterface provided by Thaumcraft's API rather than reading configs.
*New texture stuff for a magic apiary.
2013-02-05 01:16:01 -08:00
MysteriousAges 827199b518 :P 2013-02-03 23:44:12 -08:00
MysteriousAges ead879a913 Fixing error with Node Required mutations without specific type
Tweaking scholarly genome (temp. tolerance both 1 -> both 2)
Tweaking Aura Growth/pull bee effect
2013-02-03 17:07:44 -08:00
MysteriousAges 47a2962bd6 Fixing problems with @SideOnly functions again. 2013-01-30 13:22:26 -08:00
MysteriousAges 105a8d47a0 Tweaking Research for "Stark hint" - indicating more research is required.
Adding extra mutation to Vis bee with extra chance.
2013-01-29 18:43:34 -08:00
MysteriousAges ad16a3b999 Adding Weather aspect to the list of Fluxes the Flux bee doesn't generate. (Because it looks like an internal TC thing.) 2013-01-28 21:04:50 -08:00
MysteriousAges 63bb014de8 Bugfixes:
* Re-enabled capsules being added to the liquid dictionary.
* Discovered cause of items being added to creative tabs twice, and killed it.
2013-01-28 14:22:40 -08:00
MysteriousAges dc40994271 Refinements, bug fixes, the Node bee & effect. 2013-01-28 02:20:09 -08:00
MysteriousAges efc2309222 *Vis, Purify & Flux flower provider finalizing
*Solid Flux -> Essentia bottle crafting
*Reseach adjustments
*Apiary Frame adjustments
*Putting try/catch around Backpack init to provide a more useful error message
*Spelling corrections in research.xml, fixed overflow on Metabolic Frame description.
2013-01-27 15:05:15 -08:00
MysteriousAges eafc34cb54 Updating to Forestry 2.0 API & whatnot.
*Hive Frames
*Fixed problems with Ghastly bee
*Better Thaumcraft Integration & fix for NBT Bee recipes
2013-01-26 13:42:39 -08:00
330 changed files with 19930 additions and 3831 deletions

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
# IntelliJ IDEA Files
*.iml
*.ipr
*.iws
out/
.idea/
# Eclipse Project Files
.classpath
.project
.settings/
eclipse/
# Gradle
.gradle
gradle/
build/
debug/
bin/
config/
crash-reports/
logs/
mods/
saves/
usernamecache.json
options.txt
+3
View File
@@ -0,0 +1,3 @@
[submodule "src/api/java/thaumcraft/api"]
path = src/api/java/thaumcraft/api
url = https://github.com/Azanor/thaumcraft-api
+4
View File
@@ -0,0 +1,4 @@
Copyright © 2013 MysteriousAges
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
+13
View File
@@ -0,0 +1,13 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <[email protected]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+25
View File
@@ -0,0 +1,25 @@
# MagicBees
Magic Bees is an addon for Forestry that adds several new bee species with a magical theme. Breeding them will help you brew potions, or give you extra ways to make resources for other magic-themed mods such as Thaumcraft and Ars Magica.
## Installation
Magic Bees depends on Forestry, which is required. You may [download Forestry here](http://www.curse.com/mc-mods/minecraft/forestry).
Minecraft Forge is also needed to run Forestry. Magic Bees will usually work with whichever version of Forge Forestry requires.
To install, simply download the mod from [CurseForge](http://minecraft.curseforge.com/mc-mods/65764-magic-bees) and place in the mods folder of your Minecraft instance.
## Compatability
Adding the following mods will result in additional features being unlocked:
* [Extra Bees](http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1284348-1-7-10-1-6-4-forestry-binnies-mods-1-8-0-2-0-dev) - Mutations to get the Thaumic Bees species will use Extra Bees species in some cases. If Thaumcraft is installed, TB will add aspects to Extra Bees items. You will also get access to Thaumic Bees alleles though the genetic machines.
* [Thaumcraft](http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1292130-thaumcraft-4-2-3-0-updated-2015-1-5) - Adds several tools related to Thaumcraft & Forestry, as well as adding Thaumcraft aspects to many Forestry items and blocks.
* [Equivalent Exchange 3](http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1286564-equivalent-exchange-3-0-1-142) - Adds the Minium Bee, which produces Minium Shards. More features to come in the future.
* [Ars Magica](http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1286036-ars-magica-v5-52-014-updated-august-2-1-5-2) - Adds 13 bee species that interact with Ars Magica, or produce AM items.
* [Tinker's Construct](http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2218638-tinkers-construct) - Adds 3 new bee species to help produce some of the higher tier metals. The Aluminum bee will also help with producing some lower-tier alloys as well.
## License
MagicBees is licesed under the WTFPL ( http://www.wtfpl.net/ )
Seriously, do whatever. Just don't ask us to support it if we didn't distribute it. =D
We didn't distribute it if you downloaded it from a site other than CurseForge, or from a modpack that does not use CurseForge as their source.
+71
View File
@@ -0,0 +1,71 @@
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
}
}
repositories {
maven {
name = "forestry"
url = "http://maven.ic2.player.to/"
}
}
apply plugin: 'forge'
ext.version_mod = "${project.version_major}.${project.version_minor}.${project.version_rev}"
version = project.version_mc + "-" + project.version_mod
group= "magicbees" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "magicbees"
minecraft {
version = project.version_mc + "-" + project.version_forge
runDir = "."
replace '@VERSION@', project.version_mod
replace '@MCVERSION@', project.version_mc
}
dependencies {
compile "net.sengir.forestry:forestry_${project.version_mc}:${project.version_forestry}:dev"
compile files("/libs/BloodMagic-${project.version_mc}-${project.version_bloodmagic}.jar")
compile files("/libs/Botania ${project.version_botania}-deobf.jar")
}
processResources
{
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
idea {
module {
inheritOutputDirs = true
}
}
+275
View File
@@ -0,0 +1,275 @@
2.1.22
+ Added configoption to change thaumcraft saplingdroprate using thaumiumgrafter
* First 1.7.10 update on CurseForge! Woohoo!
* Updated chinese translation courtesy of Astrologers
* Fixed texturebugs with thaumium scoop and grafter
* Fixed backpack issues. Hopefully fixed for real this time
2.1.21
* Bumped forestry requirement to 3.0.0.174 (Might work with lower versions, untested)
* Fixed issue with Thaumic tools not having icons/localized names
2.1.20
* Fixes crash due to not registrering backpack correctly
* Fixes crash when breeding metal bees
* Fixed a missing configoption
* Started work on ThaumicApiary
2.1.19
* Updated to Forestry 3. This is now required.
* Updated Thaumcraft integration to work in 1.7.10
* Updated ExtraBees integration
* Changed all language files to the .lang format
2.1.18
* A few critical bugfixes to stop centrifuge crashes.
2.1.13
Updated to 1.7.2.
2.1.12
Changing hive gen to use isGenMineableReplaceable, which should make Deep hives spawn in Underground Biomes stone.
Fixing logic error in handling world gen/retrogen
2.1.11
Thermal Expansion & Redstone Arsenal bees, courtesy of jadedcat.
Adding missing loc string for Blinding speed allele
2.1.10
Changing Aluminum bees to use changed ore dictionary entries. mDiyo Houuuuuuuuuuuuuuuuuse!
Updating AM2 mob-spawning bees to use newer names.
2.1.9
Adding configuration option to not spawn special hives in Magic Biomes for people who hate fun, and specialness.
Adding a shadow to the Tempus aspect for Vazkii.
Possibly fixing issues with fluid containers.
2.1.8
Fixing inconcistent recipes between Thaumonomicon & actual crafting
Added missing centrifuge recipe for the Transmuting combs. This is the source of Unstable Propolis.
2.1.7
Some non-bee bug removals.
Magnets are ... a bit expensive. >_>;
2.1.6
How about not crashing because I forgot a colour tuple? >.>
Presenting a new bee species: You can't see it though, because it's invisible. >_>
2.1.5
Behold! The Mysterious Magnet! It attracts items to it, and thus, you, from great distances! (well, greater than your arms anyhow.)
Updating TC4 API for when it releases.
2.1.4
Some cleanup of Helper code
Hammering out rest of Transmutation effect, and exposing parts of it in an API so other people can hook into it if they want.
Have some Ars Magica 2 integration.
Also, have some Thaumcraft 4 integration!
2.1.3
Added a new mini bee branch: Polymorphic. It is said Unusual bees can have some unusual effects on the world if they are advanced...
Altered mutation to get Minium bees to fit into the Polymorphic branch.
Crumbling effect ages the area around the hive.
Added an IMC Handler to allow other mods to send an IMC message with key 'addCrumblePair" and a value containing two NBT tags
'source' and 'target' for ItemStacks of the source block and target block. Blocks added on a first-come-first-serve basis.
Only one entry per source block is accepted. Several vanilla defaults are provided, can be overridden using IMC.
Changing humidity tolerance of Sorcerous bees to be actually useful.
Fixed issues with the bee effects rendering (the little bee icons that shoot out of the bee machine while they work) for custom effects.
2.1.2
Fixed issue with mob spawning effects incorrectly checking for effect data variables.
Updating localization files (RU, DE)
2.1.1
Reworking some language entries & code to enable string formatting in capsule names.
Localization file updates.
Tinker's Construct bees (Ardite, Cobalt, Manyullyn) and Aluminum bees.
2.1.0
Added new permanent methods for crafting all frames. These will be available even when Thaumcraft is installed.
Removed temporary frame recipes which used to be available when Thaumcraft was not installed.
Lowered the cost of creating several frames through Thaumcraft. These should still be a viable option with the new recipes.
Fixed issue with foundation-requiring mutations in Forestry Alvearies. (Will likely not work with Extra Bees Alveary blocks)
2.0.5
Fixed hard-coded value in a subroutine that should not have been hard-coded.
2.0.4
Fixed backwards mutation logic.
2.0.3
Adjusting Thaumcraft research notes to reflect recent (Hah!) changes.
2.0.2
Fixed Escritoire/Mutation Notes for bees which require a Thaumcraft Node.
Fixing colour data for Temporal Combs.
Adjusting the production rates on some nugget-producing bees.
Withering bee species now requires arid rather than normal humidity, to conform with the rest of the Infernal line.
Withering and Slow Effects should now correctly be reduced while wearing Apiarist's Armor or other protective gear.
2.0.1
Modifying mutation class to allow block-requiring mutations to work in Alvearies/other multiblock hive structures.
Tweaking hive gen
Fixing mistakes in bee genome templates
Updating Biofuel capsule to use the Ethanol liquid in Forestry
2.0.0
Enabling Retrogen of hives in case you missed them initially.
Tearing out all old mutations, rewriting from the ground up. Maybe these will be less frustrating. ;)
Adding subroutines to make MB species actually worthwhile to check out in the Escritoire. If you get stuck on a mutation, throw it into the table and try out the minigame!
New bee species (Too many to list. Have fun finding them!)
New hives
Added zh_CN localization by crafteverywhere
Added de_DE localization by philip98 and Vexatos
Added ru_RU localization by CrazyTechno and VeryBigBro
=========== Old Thaumic Bees Changelog ================
1.4.7b
Fix for creative mode crash when a certain config option is enabled.
1.4.7a
Update for Forestry Beta.
1.4.7
Added the Bee Collector's Jar.
Created an alternate recipe for the Temporal Frame that is always active.
Adjusted TC3 alternate recipe for the Temporal Frame.
Fixed an issue with the "Pick Block" function on the Greatwood & Silverwood planks. Should also stop NEI from providing incorrect block info on them.
Fixed the Node flower growing flowers.
Adding Apatite bees.
1.4.6
Ars Magica integration! 13 new bee species to help you research & cast spells.
Changing mutations around, because I'm still not happy with them. (Again.)
Many icon & texture fixes. (derp!)
1.4.5a
Repaired Thaumcraft 3 integration for 3.0.4a.
Fixed Biofuel capsules being shown as "Empty x Capsule"
Fixed missing texture for oil & fuel capsules
1.4.5
Added the Jade Moon Dial - tells you what moon phase it currently is for breeding purposes.
Added a creative menu tab for certain Thaumic Bees items - misc resources, capsules, tools.
1.4.4b
Ported to 1.5! Wooo!
1.4.4a
Fixed an isuse that caused GregTech to crash.
1.4.4
Made greatwood & silverwood planks fireproof by default - added a config option to toggle it.
Added Nuggets - Iron, Copper, Tin, Silver, Lead. Should craft into 1st ore dictionary ingot of appropriate type.
Added Shards - Diamond, Emerald.
Added 15 new bees. Have fun~ <3
Added Equivalent Exchange 3 compatability! (It's 1 thing, don't get terribly excited.)
New frame type! Search Strongholds for them.
1.4.3c
Thaumium Grafter now doubles your chance to get Greatwood & Silverwood saplings.
Thaumium Grafter now takes extra damage when trying to break Greatwood & Silverwood leaves.
Thaumium Grafter now has a balancing feature when repairing.
Extra... uh. "Enhancements". =D
1.4.3b
Greatwood & Silverwood planks support BuildCraft facades.
Tweaking Aura cost for Repair on Thaumium Grafters and other balance.
Turns out I can't get the version crap to work properly. More fixes.
1.4.3a
Changed Version info embedded in mod to match format supported by Version checking. Will need to make this more robust in the future.
Fixed bug with Thaumium Grafter not being enchantable.
1.4.3
Added automatic version-checking for ThaumicBees! From this version on, when a new version becomes available, it will notify you in-game. Notifications can be switched off via a config file option.
Fixed missing aspects on Extra Bees combs.
1.4.2
Added Void Capsules - hold up to 8 buckets of liquid with one! It's a waterproof bag of holding! Plus stacking.
Fix: Added Greatwood & Silverwood slabs to the ore dictionary so they should work as normal.
Added Thaumium Scoop - 30 uses, can be enchanted with Repair.
Added Thaumium Grafter - 15 uses, can be enchanted with Repair.
1.4.1
Added Greatwood and Silverwood planks. Since Greatwood and Silverwood are tougher than other trees, you'll need some extra machinery. To obtain these, jam a log of the appropriate tree into a Forestry carpenter and provide a half bucket of water.
Added slabs for the new planks also.
1.4.0a
Fixed some issues with the Node bee's effect.
1.4.0
New branch of bees containing 3 new species. A new type of frame!
Thaumaturge's Backpack now require Amber rather than Gold Nuggets.
Due to popular complaint, the Bees & Magic node now requires Unified Thaumic Field Theory to unlock.
Moving all kinds of string contstants out of code into Localization files.
Also fixed crazy aspects showing up on things that shouldn't have those aspects.
ACTUALLY fixed issue with untyped node mutations failing.
1.3.0d
Fixed an issue with mutations requiring a non-specific type of node to fail.
1.3.0c
Discovered a function call that will crash dedicated servers. If you are running ThuamicBees on a server, please update to this revision.
1.3.0b
Fixed a problem with capsules not being registered with the Forge Liquid Dictionary. You should be able to use them just about everywhere, now.
Fixed the issue with certain items appearing twice in Creative Mode tabs.
1.3.0a
Some bug fixes, including uncommenting some mutation-related code, research tweaking.
Added the last bee for a long while, probably. Good luck getting it.
Common TB crashes stemming from Forestry issues should now be reported a little better, especially the backpack registration & item texture file related things. Errors should appear in your log, so make sure you read the log before you report the error here. It could be something silly on your end that is causing the crash.
1.3.0
3 new species of bee: Vis, Pure, and Flux! Each requires an aura node nearby, and may have some side-effects...
New Thaumcraft research! Open up your Thaumanomicon to see it.
New Apiary Frames! They run off magic, confers bees with bonuses, and may have an impact outside of your apiary...
1.2.705B - Replaced 1.2.705
Fixed issue with bad Mutation class, allowing pure bees to turn into any bee that involves them in a mutation.
Also ACTUALLY fixed issue with Extra Bees loading after ThaumicBees on *nix-based systems.
1.2.705
*Stealth update: Fixed an issue with TB loading before Extra Bees, resulting in some Null Pointers getting passed and choked on. If you get this issue, please re-download 1.2.705. No other changes were made in this version.
*8 new species of bees, including "Praecantatio", which, like the other Elemental bees, may contain Vis shards in its propolis. Some of the new species may also have extra evil involved, so be ready for anything.
*Extra integration with Extra Bees! Mutations for some of the new bees. If Extra Bees is present, their mutations will require EB species rather than the base Forestry species.
*Changed the "Charmed" mutation to avoid conflicting with Extra Bees. (Binnie already had one there, so mine got moved.)
*New bee branch, similar to Extra Bees's mob spawning bees.
*One new bee from a new branch, the rest of which will come once Azanor releases the Thaumcraft API.
1.1.702-67 - Replaced 1.1.702-62
Additional Magic Capsules, featuring ExtraBees liquids, and RailCraft Creosote & Steam. (Yes, steam capsules. It's magic. That's how. :P)
Tagged additional Forestry items with Thaumcraft aspects.
1.1.702-62
Added Magic Capsules!
Compatible with BuildCraft and Forestry liquids, they function almost the same way as refactory capsules, except that they can store 2 buckets' worth of liquid. As such, you cannot right-click with them to scoop up water or lava, but you can use them in bottlers, carpenters, Railcraft's Iron Tanks, Thermal Expansion's liquid transposers, and other things that support the Forge Liquid Dictionary. They can be useful for storing larger amounts of liquids in chests and things. I am also able to add other liquids to them in the future, and liquids from mods that are not present will not appear in the Creative inventory or the NEI listings.
1.0.701-56
Update to Forestry 1.7.0.1/1.7.0.2
Added all kinds of backpack integration for Thaumcraft, including a new Thaumaturge's Backpack and Woven variety. These will suck up shards, Thaumcraft resources such as quicksilver, amber, zombie brains, research fragments and other goodies. Other TC items such as marker blocks, warded stone, candles, logs, leaves and plants also can fall into Forestry's default backpacks as appropriate. (I may have missed some other obvious items.)
1.0.70-53
Update to Forestry 1.7.0.0
1.0.0-50
-Added Thaumcraft aspects to some Forestry items, notably combs and bees. (Finally, something to use those extra drones for!)
-Added another Swarmer inducer item - craftable via carpenter using liquid honey, Royal Jelly, Pollen and Enchanting Drops from Arcane bees. 8 times more effective than Royal Jelly alone!
-Added carpenter recipe for candles using magic wax. Same patterns as with beeswax.
1.0.0-48
-Support for Forestry 1.6.5.5+
-Extra alles for bee mutations!
-Thaumcraft aspects associated with some Forestry items!
1.0.0-35
-Bugfix version to account for launcher jars located outside of expected folder. Replaced 1.0.0-34
1.0.0-34
-Initial Release
+3
View File
@@ -0,0 +1,3 @@
2.2.2
false
Magic Apiary, assorted bugfixes.
+10
View File
@@ -0,0 +1,10 @@
version_major=2
version_minor=2
version_rev=3
version_forestry=3.4.0.7
version_bloodmagic=1.3.1-7
version_botania=r1.6-180
version_mc=1.7.10
version_forge=10.13.2.1230
Binary file not shown.
+6
View File
@@ -0,0 +1,6 @@
#Wed Jul 02 15:54:47 CDT 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip
Vendored
+164
View File
@@ -0,0 +1,164 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
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"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
Vendored
+90
View File
@@ -0,0 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,9 @@
package magicbees.api;
import magicbees.api.bees.ITransmutationEffectController;
public class MagicBeesAPI
{
// Use this object during or after the Mod.Init phase to add your logic to the Transmutation bee effect.
public static ITransmutationEffectController transmutationEffectController;
}
@@ -0,0 +1,4 @@
package magicbees.api.bees;
public interface IAuraChargeType {
}
@@ -0,0 +1,46 @@
package magicbees.api.bees;
/**
* Allows a tile entity to provide a Magic Apiary with 'aura' to boost bee production, mutation rate,
* or decrease bee lifespan.
*
* @author MysteriousAges
*/
public interface IMagicApiaryAuraProvider {
/**
* Requests a mutation charge from the aura provider. If true is returned, the
* aura provider should decrement its internal charge by one. If there are no
* charges remaining, it should return false.
*
* @return True if a charge is given; false otherwise.
*/
boolean getMutationCharge();
/**
* Requests a mutation charge from the aura provider. If true is returned, the
* aura provider should decrement its internal charge by one. If there are no
* charges remaining, it should return false.
*
* @return True if a charge is given; false otherwise.
*/
boolean getDeathRateCharge();
/**
* Requests a mutation charge from the aura provider. If true is returned, the
* aura provider should decrement its internal charge by one. If there are no
* charges remaining, it should return false.
*
* @return True if a charge is given; false otherwise.
*/
boolean getProductionCharge();
/**
* Requests a mutation charge from the aura provider. If true is returned, the
* aura provider should decrement its internal charge by one. If there are no
* charges remaining, it should return false.
*
* @return True if a charge is given; false otherwise.
*/
boolean getCharge(IAuraChargeType auraChargeType);
}
@@ -0,0 +1,14 @@
package magicbees.api.bees;
/**
* Manages adding custom ITransmutationEffectLogic instances into the bee effect
* system.
*
* @author MysteriousAges
*
*/
public interface ITransmutationEffectController
{
public void addEffectLogic(ITransmutationEffectLogic logic);
}
@@ -0,0 +1,33 @@
package magicbees.api.bees;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
/**
* Class to control plugin logic for the Transmutation bee effect. Turns blocks
* into other blocks based on biome, time of day, or whatever is deemed
* appropriate at the time.
*
* @author MysteriousAges
*
*/
public interface ITransmutationEffectLogic
{
/**
* Allows an external mod to add transmutation logic to the Transmuting bee effect.
* Called from a list of ITransmutationEffectLogic until one returns true. You can
* implement more than one transmutation effect in a single implementation of the
* interface. Function checks for a series of conditions based on block ID/meta, or
* biome information, or world information.
*
* @param world World object
* @param biome Biome information for current coordinates
* @param sourceBlock ItemStack representing the block at current coordinates
* @param x Current X coordinate to attempt a transmute
* @param y Current Y coordinate to attempt a transmute
* @param z Current Z coordinate to attempt a transmute
* @return true if a block was changed.
*/
public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z);
}
+269
View File
@@ -0,0 +1,269 @@
package magicbees.bees;
import magicbees.main.utils.LocalizationManager;
import magicbees.main.utils.compat.ArsMagicaHelper;
import magicbees.main.utils.compat.ThaumcraftHelper;
import magicbees.main.utils.compat.ThermalExpansionHelper;
import net.minecraft.potion.Potion;
import forestry.api.apiculture.IAlleleBeeEffect;
import forestry.api.apiculture.IAlleleBeeSpecies;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IAllele;
import forestry.api.genetics.IAlleleEffect;
import forestry.api.genetics.IAlleleFlowers;
import forestry.api.genetics.IAlleleRegistry;
public class Allele implements IAllele
{
public static AlleleFloat speedBlinding;
public static IAlleleBeeEffect forestryBaseEffect;
public static IAlleleFlowers flowerBookshelf;
public static IAlleleFlowers flowerThaumcraft;
public static IAlleleFlowers flowerArsMagica;
public static IAlleleFlowers flowerAuraNode;
public static IAlleleEffect effectCleansing;
public static IAlleleEffect effectDigSpeed;
public static IAlleleEffect effectMoveSpeed;
public static IAlleleEffect effectSlowSpeed;
public static IAlleleEffect effectWithering;
public static IAlleleEffect effectTransmuting;
public static IAlleleEffect effectCrumbling;
public static IAlleleEffect effectInvisibility;
public static IAlleleEffect spawnBrainyZombie;
public static IAlleleEffect spawnWisp;
public static IAlleleEffect spawnBats;
public static IAlleleEffect spawnGhast;
public static IAlleleEffect spawnSpider;
public static IAlleleEffect spawnBlaze;
public static IAlleleEffect spawnBlizz;
public static IAlleleEffect spawnManaDrainer;
public static IAlleleEffect spawnWispOrHecate;
/*public static IAlleleEffect effectNodeAttract;
public static IAlleleEffect effectNodePurify;
public static IAlleleEffect effectNodeFlux;
public static IAlleleEffect effectNodeCharge;*/
public static void setupAdditionalAlleles()
{
forestryBaseEffect = (IAlleleBeeEffect)getBaseAllele("effectNone");
Allele.speedBlinding = new AlleleFloat("speedBlinding", 2f, false);
Allele.flowerBookshelf = new AlleleFlower("Bookshelf", new FlowerProviderBookshelf(), true);
if (ThaumcraftHelper.isActive())
{
Allele.flowerThaumcraft = new AlleleFlower("ThaumcraftPlant", new FlowerProviderThaumcraftFlower(), false);
Allele.flowerAuraNode = new AlleleFlower("AuraNode", new FlowerProviderAuraNode(), true);
Allele.spawnBrainyZombie = new AlleleEffectSpawnMob("Brainy", false, ThaumcraftHelper.Entity.BRAINY_ZOMBIE.entityID)
.setAggrosPlayerOnSpawn().setThrottle(800).setSpawnsOnPlayerNear(null).setMaxMobsInSpawnZone(2);
Allele.spawnBats = new AlleleEffectSpawnMob("Batty", false, ThaumcraftHelper.Entity.FIREBAT.entityID)
.setThrottle(300).setSpawnsOnPlayerNear("Bat");
Allele.spawnWisp = new AlleleEffectSpawnWisp("Wispy", false, ThaumcraftHelper.Entity.WISP.entityID, "thaumcraft.wisplive")
.setThrottle(1800).setChanceToSpawn(79);
}
else
{
Allele.flowerThaumcraft = Allele.flowerAuraNode = (IAlleleFlowers)Allele.getBaseAllele("flowersVanilla");
}
if (ArsMagicaHelper.isActive())
{
Allele.flowerArsMagica = new AlleleFlower("flowerArsMagicaPlant", new FlowerProviderArsMagicaFlower(), false);
//String id, boolean isDominant, int throttle, String[] mobs, int[] chance
Allele.spawnManaDrainer = new AlleleEffectSpawnMobWeighted("ManaDrain", true, 20,
new String[] { ArsMagicaHelper.Name + ".MobManaCreeper", ArsMagicaHelper.Name + ".ManaVortex" },
new int[] { 60, 2 });
Allele.spawnWispOrHecate = new AlleleEffectSpawnMobWeighted("AMWisp", true, 20,
new String[] { ArsMagicaHelper.Name + ".MobWisp", ArsMagicaHelper.Name + ".MobHecate" },
new int[] { 40, 3 });
}
else
{
Allele.flowerArsMagica = (IAlleleFlowers)Allele.getBaseAllele("flowersVanilla");
Allele.spawnManaDrainer = Allele.spawnWispOrHecate = (IAlleleEffect)Allele.getBaseAllele("effectNone");
}
/*Allele.effectNodeAttract = new AlleleEffectAuraNodeAttract("NodeAttract", false, 400);
Allele.effectNodePurify = new AlleleEffectAuraNodePurify("NodePurify", false, 600, 150);
Allele.effectNodeFlux = new AlleleEffectAuraNodeFlux("NodeFlux", true, 300, 300);
Allele.effectNodeCharge = new AlleleEffectAuraNodeCharge("NodeCharge", true, 1200);*/
if (ThermalExpansionHelper.isActive())
{
Allele.spawnBlizz = new AlleleEffectSpawnMob("TEBlizzy", true, ThermalExpansionHelper.Entity.BLIZZ.entityID)
.setThrottle(100).setChanceToSpawn(80);
}
else
{
Allele.spawnBlizz = (IAlleleEffect)Allele.getBaseAllele("effectNone");
}
Allele.effectCleansing = new AlleleEffectCure("Curative", false);
Allele.effectDigSpeed = new AlleleEffectPotion("DigSpeed", Potion.digSpeed, 15, false);
Allele.effectMoveSpeed = new AlleleEffectPotion("MoveSpeed", Potion.moveSpeed, 10, false);
Allele.effectSlowSpeed = new AlleleEffectPotion("SlowSpeed", Potion.moveSlowdown, 3, false).setMalicious();
Allele.effectWithering = new AlleleEffectPotion("Withering", Potion.wither, 10, false).setMalicious();
Allele.effectTransmuting = new AlleleEffectTransmuting("Transmuting", true);
Allele.effectCrumbling = new AlleleEffectCrumbling("Crumbling", true);
Allele.effectInvisibility = new AlleleEffectPotion("Invisibility", Potion.invisibility, 10, false);
Allele.spawnGhast = new AlleleEffectSpawnMob("Ghastly", false, "Ghast", "mob.ghast.moan")
.setThrottle(2060).setChanceToSpawn(10).setMaxMobsInSpawnZone(1);
Allele.spawnSpider = new AlleleEffectSpawnMob("Spidery", false, "Spider", "mob.spider.step")
.setThrottle(400).setChanceToSpawn(70).setMaxMobsInSpawnZone(4);
Allele.spawnBlaze = new AlleleEffectSpawnMob("Ablaze", false, "Blaze", "mob.blaze.breathe")
.setThrottle(800).setChanceToSpawn(60).setMaxMobsInSpawnZone(2);
}
public static void registerDeprecatedAlleleReplacements()
{
IAlleleRegistry registry = AlleleManager.alleleRegistry;
registry.registerDeprecatedAlleleReplacement("thaumicbees.fertilityHighDominant", Allele.getBaseAllele("fertilityHigh"));
registry.registerDeprecatedAlleleReplacement("thaumicbees.flowerflowerBookshelf", flowerBookshelf);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speedBlinding", speedBlinding);
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodeAttract", Allele.getBaseAllele("effectBeatific"));
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodePurify", Allele.getBaseAllele("effectBeatific"));
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodeFlux", Allele.getBaseAllele("effectBeatific"));
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodeCharge", Allele.getBaseAllele("effectBeatific"));
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeAttract", Allele.getBaseAllele("effectBeatific"));
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodePurify", Allele.getBaseAllele("effectBeatific"));
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeFlux", Allele.getBaseAllele("effectBeatific"));
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeCharge", Allele.getBaseAllele("effectBeatific"));
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectCurative", effectCleansing);
registry.registerDeprecatedAlleleReplacement("thaumicbees.effecteffectDigSpeed", effectDigSpeed);
registry.registerDeprecatedAlleleReplacement("thaumicbees.effecteffectMoveSpeed", effectMoveSpeed);
registry.registerDeprecatedAlleleReplacement("thaumicbees.effecteffectSlowSpeed", effectSlowSpeed);
registry.registerDeprecatedAlleleReplacement("thaumicbees.Ghast", spawnGhast);
registry.registerDeprecatedAlleleReplacement("thaumicbees.Spider", spawnSpider);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEsoteric", BeeSpecies.ESOTERIC);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesMysterious", BeeSpecies.MYSTERIOUS);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesArcane", BeeSpecies.ARCANE);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesCharmed", BeeSpecies.CHARMED);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEnchanted", BeeSpecies.ENCHANTED);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSupernatural", BeeSpecies.SUPERNATURAL);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPupil", BeeSpecies.PUPIL);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesScholarly", BeeSpecies.SCHOLARLY);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSavant", BeeSpecies.SAVANT);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesAware", BeeSpecies.AWARE);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSpirit", BeeSpecies.SPIRIT);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSoul", BeeSpecies.SOUL);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSkulking", BeeSpecies.SKULKING);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesGhastly", BeeSpecies.GHASTLY);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSpidery", BeeSpecies.SPIDERY);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesTimely", BeeSpecies.TIMELY);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesLordly", BeeSpecies.LORDLY);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesDoctoral", BeeSpecies.DOCTORAL);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesIron", BeeSpecies.IRON);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesGold", BeeSpecies.GOLD);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesCopper", BeeSpecies.COPPER);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesTin", BeeSpecies.TIN);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSilver", BeeSpecies.SILVER);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesLead", BeeSpecies.LEAD);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesDiamond", BeeSpecies.DIAMOND);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEmerald", BeeSpecies.EMERALD);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesApatite", BeeSpecies.APATITE);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesStark", BeeSpecies.TC_CHAOS);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesAura", BeeSpecies.TC_AIR);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesIgnis", BeeSpecies.TC_FIRE);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesAqua", BeeSpecies.TC_WATER);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSolum", BeeSpecies.TC_EARTH);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPraecantatio", BeeSpecies.TC_ORDER);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesVis", BeeSpecies.TC_VIS);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPure", BeeSpecies.TC_PURE);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesFlux", BeeSpecies.TC_TAINT);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesNode", BeeSpecies.TC_ATTRACT);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesRejuvenating", BeeSpecies.TC_REJUVENATING);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBrainy", BeeSpecies.TC_BRAINY);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesGossamer", BeeSpecies.TC_WISPY);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesWispy", BeeSpecies.TC_WISPY);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBatty", BeeSpecies.TC_BATTY);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesChicken", BeeSpecies.TC_CHICKEN);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBeef", BeeSpecies.TC_BEEF);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPork", BeeSpecies.TC_PORK);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesMinium", BeeSpecies.EE_MINIUM);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEssence", BeeSpecies.AM_ESSENCE);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesQuintessence", BeeSpecies.AM_QUINTESSENCE);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesErde", BeeSpecies.AM_EARTH);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesLuft", BeeSpecies.AM_AIR);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesFeuer", BeeSpecies.AM_FIRE);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesWasser", BeeSpecies.AM_WATER);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBlitz", BeeSpecies.AM_LIGHTNING);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesStaude", BeeSpecies.AM_PLANT);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEis", BeeSpecies.AM_ICE);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesMagma", BeeSpecies.AM_FIRE);
registry.registerDeprecatedAlleleReplacement("magicbees.speciesMagma", BeeSpecies.AM_FIRE);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesArkanen", BeeSpecies.AM_ARCANE);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesVortex", BeeSpecies.AM_VORTEX);
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesWight", BeeSpecies.AM_WIGHT);
}
public static IAlleleBeeSpecies getBaseSpecies(String name)
{
return (IAlleleBeeSpecies)AlleleManager.alleleRegistry.getAllele((new StringBuilder()).append("forestry.species").append(name).toString());
}
public static IAlleleBeeSpecies getExtraSpecies(String name)
{
return (IAlleleBeeSpecies)AlleleManager.alleleRegistry.getAllele((new StringBuilder()).append("extrabees.species.").append(name.toLowerCase()).toString());
}
public static IAllele getBaseAllele(String name)
{
return AlleleManager.alleleRegistry.getAllele("forestry." + name);
}
public static IAllele getAllele(String name)
{
return AlleleManager.alleleRegistry.getAllele(name);
}
private String uid;
private boolean dominant;
public Allele(String id, boolean isDominant)
{
this.uid = "magicbees." + id;
this.dominant = isDominant;
AlleleManager.alleleRegistry.registerAllele(this);
}
@Override
public String getUID()
{
return this.uid;
}
@Override
public boolean isDominant()
{
return this.dominant;
}
@Override
public String getName()
{
return LocalizationManager.getLocalizedString(getUID());
}
@Override
public String getUnlocalizedName()
{
return this.uid;
}
}
@@ -1,12 +1,10 @@
package thaumicbees.bees.genetics; package magicbees.bees;
import java.util.List; import java.util.List;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import thaumicbees.main.ThaumicBees;
import forestry.api.apiculture.IAlleleBeeEffect; import forestry.api.apiculture.IAlleleBeeEffect;
import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeHousing;
@@ -14,12 +12,12 @@ import forestry.api.genetics.IEffectData;
public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect
{ {
protected String readableName; protected int throttle;
public AlleleEffect(String id, boolean isDominant, String identifier) public AlleleEffect(String id, boolean isDominant, int timeout)
{ {
super(id, isDominant); super("effect" + id, isDominant);
this.readableName = identifier; this.throttle = timeout;
} }
@Override @Override
@@ -32,39 +30,32 @@ public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect
public abstract IEffectData validateStorage(IEffectData storedData); public abstract IEffectData validateStorage(IEffectData storedData);
@Override @Override
public String getIdentifier() public final IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
{ {
return this.readableName; int count = storedData.getInteger(0);
if (count >= this.throttle)
{
storedData = this.doEffectThrottled(genome, storedData, housing);
}
else
{
storedData.setInteger(0, count + 1);
}
return storedData;
} }
@Override /**
public abstract IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing); * @param genome
* @param storedData
* @param housing
* @return
*/
protected abstract IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing);
@Override @Override
public IEffectData doFX(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) public IEffectData doFX(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
{ {
int[] area = genome.getTerritory(); return Allele.forestryBaseEffect.doFX(genome, storedData, housing);
float mod = housing.getTerritoryModifier(genome);
// Check to make sure territory is at least 1 with housing modifications
area[0] = Math.max((int)(area[0] * mod), 1);
area[1] = Math.max((int)(area[1] * mod), 1);
area[2] = Math.max((int)(area[2] * mod), 1);
ThaumicBees.proxy.drawBeeEffects(housing.getWorld(), housing.getXCoord(), housing.getYCoord(), housing.getZCoord(),
genome.getPrimaryAsBee().getPrimaryColor(), area[0], area[1], area[2]);
return storedData;
}
@Override
public String getIconTextureFile()
{
return null;
}
@Override
public int getIconIndex()
{
return -1;
} }
protected List<Entity> getEntitiesWithinRange(IBeeGenome genome, IBeeHousing housing) protected List<Entity> getEntitiesWithinRange(IBeeGenome genome, IBeeHousing housing)
@@ -84,7 +75,7 @@ public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect
min[2] = housing.getZCoord() - area[2] / 2; min[2] = housing.getZCoord() - area[2] / 2;
max[2] = housing.getZCoord() + area[2] / 2; max[2] = housing.getZCoord() + area[2] / 2;
AxisAlignedBB bounds = AxisAlignedBB.getAABBPool().addOrModifyAABBInPool(min[0], min[1], min[2], max[0], max[1], max[2]); AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(min[0], min[1], min[2], max[0], max[1], max[2]);
return housing.getWorld().getEntitiesWithinAABB(EntityPlayer.class, bounds); return housing.getWorld().getEntitiesWithinAABB(EntityPlayer.class, bounds);
} }
@@ -0,0 +1,92 @@
package magicbees.bees;
import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.genetics.IEffectData;
public class AlleleEffectCrumbling extends AlleleEffect
{
private static HashMap<ItemStack, ItemStack> crumbleMap = new HashMap<ItemStack, ItemStack>();
public static void addPairToMap(ItemStack source, ItemStack target)
{
boolean add = true;
for (ItemStack i : crumbleMap.keySet())
{
if (OreDictionary.itemMatches(i, source, false))
{
add = false;
break;
}
}
if (add)
{
crumbleMap.put(source, target);
}
}
public AlleleEffectCrumbling(String id, boolean isDominant)
{
super(id, isDominant, 600);
addPairToMap(new ItemStack(Blocks.stone), new ItemStack(Blocks.cobblestone));
addPairToMap(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.mossy_cobblestone));
addPairToMap(new ItemStack(Blocks.stonebrick, 1, 0), new ItemStack(Blocks.stonebrick, 1, 2));
addPairToMap(new ItemStack(Blocks.stonebrick, 1, 2), new ItemStack(Blocks.stonebrick, 1, 1));
addPairToMap(new ItemStack(Blocks.cobblestone_wall), new ItemStack(Blocks.cobblestone_wall, 1, 1));
addPairToMap(new ItemStack(Blocks.gravel), new ItemStack(Blocks.sand));
}
@Override
public IEffectData validateStorage(IEffectData storedData)
{
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData))
{
storedData = new magicbees.bees.EffectData(1, 0, 0);
}
return storedData;
}
@Override
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
{
World world = housing.getWorld();
// Get random coords within territory
int xRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
int yRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
int zRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]);
int xCoord = housing.getXCoord() + world.rand.nextInt(xRange) - xRange / 2;
int yCoord = housing.getYCoord() + world.rand.nextInt(yRange) - yRange / 2;
int zCoord = housing.getZCoord() + world.rand.nextInt(zRange) - zRange / 2;
Block block = world.getBlock(xCoord, yCoord, zCoord);
if (block != null)
{
ItemStack source = new ItemStack(block, 1, world.getBlockMetadata(xCoord, yCoord, zCoord));
for (ItemStack key : crumbleMap.keySet())
{
if (OreDictionary.itemMatches(source, key, false))
{
ItemStack target = crumbleMap.get(key);
world.setBlock(xCoord, yCoord, zCoord, Block.getBlockFromItem(target.getItem()),
target.getItemDamage(), 2);
break;
}
}
}
storedData.setInteger(0, 0);
return storedData;
}
}
@@ -0,0 +1,49 @@
package magicbees.bees;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.genetics.IEffectData;
public class AlleleEffectCure extends AlleleEffect
{
public AlleleEffectCure(String id, boolean isDominant)
{
super(id, isDominant, 200);
}
@Override
public IEffectData validateStorage(IEffectData storedData)
{
if (storedData == null)
{
storedData = new EffectData(1, 0, 0);
}
return storedData;
}
@Override
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
{
List<Entity> entityList = this.getEntitiesWithinRange(genome, housing);
for (Entity e : entityList)
{
if (e instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer)e;
player.curePotionEffects(new ItemStack(Items.milk_bucket));
}
}
storedData.setInteger(0, 0);
return storedData;
}
}
@@ -0,0 +1,74 @@
package magicbees.bees;
import java.util.List;
import magicbees.item.ItemArmorApiarist;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.genetics.IEffectData;
public class AlleleEffectPotion extends AlleleEffect
{
private int potionId;
private int duration;
private boolean isMalicious;
public AlleleEffectPotion(String name, Potion potionApplied, int effectDuration, boolean isDominant)
{
super(name, isDominant, 200);
this.potionId = potionApplied.id;
this.duration = 20 * effectDuration;
this.isMalicious = false;
}
public AlleleEffectPotion setMalicious()
{
this.isMalicious = true;
return this;
}
@Override
public IEffectData validateStorage(IEffectData storedData)
{
if (storedData == null)
{
storedData = new EffectData(1, 0, 0);
}
return storedData;
}
@Override
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
{
List<Entity> entityList = this.getEntitiesWithinRange(genome, housing);
for (Entity e : entityList)
{
if (e instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer)e;
if (this.isMalicious)
{
int armorPieces = ItemArmorApiarist.getNumberPiecesWorn(player);
int finalDuration = this.duration / 4 * (4 - armorPieces);
if (finalDuration > 0)
{
player.addPotionEffect(new PotionEffect(this.potionId, finalDuration, 0));
}
}
else
{
player.addPotionEffect(new PotionEffect(this.potionId, this.duration, 0));
}
}
}
storedData.setInteger(0, 0);
return storedData;
}
}
@@ -0,0 +1,207 @@
package magicbees.bees;
import java.util.List;
import magicbees.item.ItemArmorApiarist;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.genetics.IEffectData;
public class AlleleEffectSpawnMob extends AlleleEffect
{
protected boolean aggosOnPlayer;
protected boolean spawnsWhilePlayerNear;
protected String alternateMob;
protected String mobName;
protected String mobSound;
protected int chanceToSpawn;
protected int maxMobsInArea;
public AlleleEffectSpawnMob(String id, boolean isDominant, String mobToSpawn)
{
this(id, isDominant, mobToSpawn, null);
}
public AlleleEffectSpawnMob(String id, boolean isDominant, String mobToSpawn, String mobSoundFx)
{
super(id, isDominant, 200);
this.aggosOnPlayer = false;
this.mobName = mobToSpawn;
this.chanceToSpawn = 100;
this.maxMobsInArea = 6;
this.mobSound = mobSoundFx;
}
@Override
public IEffectData validateStorage(IEffectData storedData)
{
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData))
{
// Throttle; Ready to spawn
storedData = new EffectData(1, 1, 0);
}
return storedData;
}
@Override
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
{
// Check if we're ready to spawn the mob.
if (storedData.getBoolean(0))
{
World w = housing.getWorld();
int roll = w.rand.nextInt(100);
if (roll <= this.chanceToSpawn)
{
if (this.spawnsWhilePlayerNear)
{
List<Entity> entities = this.getEntitiesWithinRange(genome, housing);
EntityPlayer target = null;
for (Entity e : entities)
{
if (e instanceof EntityPlayer)
{
target = (EntityPlayer)e;
// Check for wearing armor & cancel
if (ItemArmorApiarist.getNumberPiecesWorn(target) >= 4)
{
// Full armor suit is treated as "invisible."
target = null;
}
else
{
break;
}
}
}
// Let's spawn a mob. =D
if (target != null)
{
storedData.setBoolean(0, !this.spawnMob(genome, target, w, housing, false));
}
else if (this.alternateMob != null)
{
storedData.setBoolean(0, !this.spawnMob(genome, null, w, housing, true));
}
}
else
{
storedData.setBoolean(0, !this.spawnMob(genome, null, w, housing, true));
}
}
else
{
if (this.mobSound != null && w.rand.nextInt(100) < 35)
{
int range = genome.getTerritory()[0];
double x = housing.getXCoord() + w.rand.nextDouble() * (range * 2) - range;
range = genome.getTerritory()[1];
double y = housing.getYCoord() + w.rand.nextDouble() * (range * 2) - range;
range = genome.getTerritory()[2];
double z = housing.getZCoord() + w.rand.nextDouble() * (range * 2) - range;
w.playSoundEffect(x, y, z, this.mobSound, 0.5f,
(w.rand.nextFloat() - w.rand.nextFloat()) * 0.2f + 1.0f);
}
storedData.setBoolean(0, true);
}
}
return storedData;
}
protected boolean spawnMob(IBeeGenome bee, EntityPlayer player, World world, IBeeHousing housing, boolean spawnAlternate)
{
boolean spawnedFlag = false;
EntityLiving mob;
if (spawnAlternate && this.alternateMob != null)
{
mob = (EntityLiving)EntityList.createEntityByName(this.alternateMob, world);
}
else
{
mob = (EntityLiving)EntityList.createEntityByName(this.mobName, world);
}
if (mob != null)
{
double pos[] = this.randomMobSpawnCoords(world, bee, housing);
int entitiesCount = world.getEntitiesWithinAABB(mob.getClass(),
AxisAlignedBB.getBoundingBox((int)pos[0], (int)pos[1], (int)pos[2], (int)pos[0] + 1, (int)pos[1] + 1, (int)pos[2] + 1)
.expand(8.0D, 4.0D, 8.0D)).size();
mob.setPositionAndRotation(pos[0], pos[1], pos[2], world.rand.nextFloat() * 360f, 0f);
if (entitiesCount < this.maxMobsInArea && mob.getCanSpawnHere())
{
spawnedFlag = world.spawnEntityInWorld(mob);
if (this.aggosOnPlayer && player != null)
{
if (ItemArmorApiarist.getNumberPiecesWorn(player) < 4)
{
// Protect fully suited player from initial murder intent.
mob.setAttackTarget(player);
}
}
}
}
return spawnedFlag;
}
public AlleleEffectSpawnMob setSpawnsOnPlayerNear(String alternateMobToSpawn)
{
this.spawnsWhilePlayerNear = true;
this.alternateMob = alternateMobToSpawn;
return this;
}
public AlleleEffectSpawnMob setAggrosPlayerOnSpawn()
{
this.aggosOnPlayer = true;
return this;
}
public AlleleEffectSpawnMob setThrottle(int val)
{
this.throttle = val;
return this;
}
public AlleleEffectSpawnMob setChanceToSpawn(int value)
{
this.chanceToSpawn = value;
return this;
}
public AlleleEffectSpawnMob setMaxMobsInSpawnZone(int value)
{
this.maxMobsInArea = value;
return this;
}
protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing)
{
double pos[] = new double[3];
pos[0] = housing.getXCoord() + (world.rand.nextDouble() * (bee.getTerritory()[0] * housing.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[0] / 2);
pos[1] = housing.getYCoord() + world.rand.nextInt(3) - 1;
pos[2] = housing.getZCoord() + (world.rand.nextDouble() * (bee.getTerritory()[2] * housing.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[2] / 2);
return pos;
}
}
@@ -0,0 +1,91 @@
package magicbees.bees;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving;
import net.minecraft.world.World;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.genetics.IEffectData;
public class AlleleEffectSpawnMobWeighted extends AlleleEffect
{
private String[] entityNames;
private int[] spawnChance;
public AlleleEffectSpawnMobWeighted(String id, boolean isDominant, int throttle, String[] mobs, int[] chance)
{
super(id, isDominant, throttle);
if (mobs.length != chance.length)
{
throw new IllegalArgumentException("Array lengths must be equal!");
}
this.entityNames = mobs;
this.spawnChance = chance;
}
@Override
public IEffectData validateStorage(IEffectData storedData)
{
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData))
{
storedData = new EffectData(1, 0, 0);
}
return storedData;
}
@Override
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
{
if (this.spawnMob(genome, housing))
{
storedData.setInteger(0, 0);
}
return storedData;
}
protected boolean spawnMob(IBeeGenome genome, IBeeHousing housing)
{
boolean flag = false;
World w = housing.getWorld();
int roll = 0;
for (int i = 0; i < this.spawnChance.length && !flag; ++i)
{
roll = 100 - w.rand.nextInt(100) + 1;
if (roll < this.spawnChance[i])
{
flag = true;
Entity mob = EntityList.createEntityByName(this.entityNames[i], w);
double[] coords = this.randomMobSpawnCoords(w, genome, housing);
mob.setPositionAndRotation(coords[0], coords[1], coords[2], w.rand.nextFloat() * 360f, 0f);
if (mob instanceof EntityLiving)
{
if (((EntityLiving)mob).getCanSpawnHere())
{
w.spawnEntityInWorld(mob);
}
}
else
{
w.spawnEntityInWorld(mob);
}
}
}
return flag;
}
protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing)
{
double pos[] = new double[3];
pos[0] = housing.getXCoord() + world.rand.nextDouble() * (bee.getTerritory()[0] * housing.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[0] / 2;
pos[1] = housing.getYCoord() + world.rand.nextDouble() * (bee.getTerritory()[1] * housing.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[1] / 2;
pos[2] = housing.getZCoord() + world.rand.nextDouble() * (bee.getTerritory()[2] * housing.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[2] / 2;
return pos;
}
}
@@ -0,0 +1,76 @@
package magicbees.bees;
import java.lang.reflect.Field;
import magicbees.item.ItemArmorApiarist;
import magicbees.main.utils.compat.ThaumcraftHelper;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
public class AlleleEffectSpawnWisp extends AlleleEffectSpawnMob
{
private byte[] wispTypes = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47 };
public AlleleEffectSpawnWisp(String id, boolean isDominant, String mobToSpawn, String soundToPlay)
{
super(id, isDominant, mobToSpawn, soundToPlay);
}
@Override
protected boolean spawnMob(IBeeGenome bee, EntityPlayer player, World world, IBeeHousing housing, boolean spawnAlternate)
{
boolean spawnedFlag = false;
EntityLiving mob;
if (spawnAlternate && this.alternateMob != null)
{
mob = (EntityLiving)EntityList.createEntityByName(this.alternateMob, world);
}
else
{
mob = (EntityLiving)EntityList.createEntityByName(this.mobName, world);
}
if (mob != null)
{
double pos[] = this.randomMobSpawnCoords(world, bee, housing);
int entitiesCount = world.getEntitiesWithinAABB(mob.getClass(),
AxisAlignedBB.getBoundingBox((int)pos[0], (int)pos[1], (int)pos[2], (int)pos[0] + 1, (int)pos[1] + 1, (int)pos[2] + 1)
.expand(8.0D, 4.0D, 8.0D)).size();
mob.setPositionAndRotation(pos[0], pos[1], pos[2], world.rand.nextFloat() * 360f, 0f);
if (entitiesCount < this.maxMobsInArea && mob.getCanSpawnHere())
{
// Try some Reflection on TC code. This could be dangerous.
try
{
Class wispEntity = Class.forName(ThaumcraftHelper.Entity.WISP.getClassName());
Field type = wispEntity.getDeclaredField("type");
type.setByte(mob, wispTypes[world.rand.nextInt(wispTypes.length)]);
}
catch (Exception e)
{ /*Last time I had a request to post error messages, I regretted it.*/ }
spawnedFlag = world.spawnEntityInWorld(mob);
if (this.aggosOnPlayer && player != null)
{
if (ItemArmorApiarist.getNumberPiecesWorn(player) < 4)
{
// Protect fully suited player from initial murder intent.
mob.setAttackTarget(player);
}
}
}
}
return spawnedFlag;
}
}
@@ -0,0 +1,49 @@
package magicbees.bees;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.genetics.IEffectData;
public class AlleleEffectTransmuting extends AlleleEffect
{
public AlleleEffectTransmuting(String id, boolean isDominant)
{
super(id, isDominant, 200);
}
@Override
public IEffectData validateStorage(IEffectData storedData)
{
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData))
{
storedData = new magicbees.bees.EffectData(1, 0, 0);
}
return storedData;
}
@Override
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
{
World world = housing.getWorld();
// Get random coords within territory
int xRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
int yRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
int zRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]);
int xCoord = housing.getXCoord() + world.rand.nextInt(xRange) - xRange / 2;
int yCoord = housing.getYCoord() + world.rand.nextInt(yRange) - yRange / 2;
int zCoord = housing.getZCoord() + world.rand.nextInt(zRange) - zRange / 2;
BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord);
TransmutationEffectController.instance.attemptTransmutations(world, biome,
new ItemStack(world.getBlock(xCoord, yCoord, zCoord), 1, world.getBlockMetadata(xCoord, yCoord, zCoord)),
xCoord, yCoord, zCoord);
storedData.setInteger(0, 0);
return storedData;
}
}
@@ -0,0 +1,21 @@
package magicbees.bees;
import forestry.api.genetics.IAlleleFloat;
public class AlleleFloat extends Allele implements IAlleleFloat
{
private float value;
public AlleleFloat(String id, float val, boolean isDominant)
{
super(id, isDominant);
this.value = val;
}
@Override
public float getValue()
{
return this.value;
}
}
@@ -1,8 +1,8 @@
package thaumicbees.bees.genetics; package magicbees.bees;
import forestry.api.apiculture.IAlleleFlowers;
import forestry.api.apiculture.IFlowerProvider;
import forestry.api.genetics.AlleleManager; import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IAlleleFlowers;
import forestry.api.genetics.IFlowerProvider;
public class AlleleFlower extends Allele implements IAlleleFlowers public class AlleleFlower extends Allele implements IAlleleFlowers
{ {
@@ -1,4 +1,4 @@
package thaumicbees.bees.genetics; package magicbees.bees;
import forestry.api.genetics.IAlleleInteger; import forestry.api.genetics.IAlleleInteger;
@@ -0,0 +1,22 @@
package magicbees.bees;
import magicbees.api.bees.IAuraChargeType;
import thaumcraft.api.aspects.Aspect;
public enum AuraChargeType implements IAuraChargeType {
MUTATION(Aspect.WATER, 850, 11),
DEATH(Aspect.ENTROPY, 400, 5),
PRODUCTION(Aspect.AIR, 300, 3);
public final int duration;
public final Aspect aspect;
/** The number of ticks to count between draining vis from the environment **/
public final int tickRate;
public final int flag = 1 << ordinal();
AuraChargeType(Aspect aspect, int duration, int tickRate) {
this.aspect = aspect;
this.duration = duration;
this.tickRate = tickRate;
}
}
@@ -0,0 +1,128 @@
package magicbees.bees;
import java.util.ArrayList;
import magicbees.main.utils.LocalizationManager;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IAlleleSpecies;
import forestry.api.genetics.IClassification;
public enum BeeClassification implements IClassification
{
VEILED("Veiled", "Velatapis"),
ARCANE("Arcane", "Arcanapis"),
SUPERNATURAL("Supernatural", "Occultapis"),
SCHOLARLY("Scholarly", "Doctapis"),
SKULKING("Skulking", "Malevolenapis"),
MAGICAL("Magic", "Magicapis"),
TIME("Time", "Tempestivapis"),
SOUL("Soul", "Animapis"),
ABOMINABLE("Abominable", "Detestabilapis"),
EXTRINSIC("Extrinsic", "Extrarapis"),
METALLIC("Metallic", "Metalliapis"),
GEM("Gem", "Lapidapis"),
TRANSMUTING("Transmuting", "Transmutapis"),
THAUMIC("Thaumic", "Thaumiapis"),
FLESHY("Fleshy", "Carnosapis"),
ALCHEMICAL("Alchemical", "Alchimiapis"),
ESSENTIAL("Essential", "Essentiapis"),
THERMAL("Thermal", "Thermametallic"),
ADORABLE("Adorable", "Amabilis"),
BLOODY("Bloody", "Sanguis"),
BOTANICAL("Botanical", "Botanica"),
;
private String uID;
private String latin;
private ArrayList<IAlleleSpecies> species;
private IClassification parent;
private EnumClassLevel level;
private BeeClassification(String name, String scientific)
{
this.uID = "classification." + name.toLowerCase();
this.latin = scientific;
this.level = EnumClassLevel.GENUS;
this.species = new ArrayList();
this.parent = AlleleManager.alleleRegistry.getClassification("family.apidae");
AlleleManager.alleleRegistry.registerClassification(this);
}
@Override
public EnumClassLevel getLevel()
{
return this.level;
}
@Override
public String getUID()
{
return this.uID;
}
@Override
public String getName()
{
return LocalizationManager.getLocalizedString(getUID());
}
@Override
public String getScientific()
{
return this.latin;
}
@Override
public String getDescription()
{
return LocalizationManager.getLocalizedString(getUID() + ".description");
}
@Override
public IClassification[] getMemberGroups()
{
return null;
}
@Override
public void addMemberGroup(IClassification group)
{
}
@Override
public IAlleleSpecies[] getMemberSpecies()
{
return this.species.toArray(new IAlleleSpecies[this.species.size()]);
}
@Override
public void addMemberSpecies(IAlleleSpecies species)
{
if (!this.species.contains(species))
{
this.species.add(species);
}
}
@Override
public IClassification getParent()
{
return this.parent;
}
@Override
public void setParent(IClassification parent)
{
this.parent = parent;
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,84 @@
package magicbees.bees;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import magicbees.block.types.HiveType;
import magicbees.item.types.DropType;
import magicbees.main.Config;
import magicbees.main.utils.Tuple;
import magicbees.main.utils.compat.ExtraBeesHelper;
import forestry.api.apiculture.IAlleleBeeSpecies;
import forestry.api.apiculture.IBeeRoot;
import forestry.api.genetics.AlleleManager;
public class BeeManager
{
public static IBeeRoot beeRoot;
private static List<Tuple<IAlleleBeeSpecies, Double>> worldgenSpeciesWeights = new ArrayList<Tuple<IAlleleBeeSpecies, Double>>();
private static double worldgenSpeciesWeightsTotal = 0;
public static void ititializeBees()
{
beeRoot = (IBeeRoot)AlleleManager.alleleRegistry.getSpeciesRoot("rootBees");
Allele.setupAdditionalAlleles();
BeeSpecies.setupBeeSpecies();
Allele.registerDeprecatedAlleleReplacements();
BeeMutation.setupMutations();
HiveType.initHiveData();
beeRoot.setResearchSuitability(Config.drops.getStackForType(DropType.INTELLECT), 0.5f);
}
public static IAlleleBeeSpecies getRandomWorldgenSpecies(Random r) {
Collections.shuffle(worldgenSpeciesWeights);
double value = r.nextDouble() * worldgenSpeciesWeightsTotal;
IAlleleBeeSpecies species = Allele.getBaseSpecies("Forest");
for (Tuple<IAlleleBeeSpecies, Double> t : worldgenSpeciesWeights) {
value -= t.right.doubleValue();
if (value <= 0.0) {
species = t.left;
break;
}
}
return species;
}
public static void addWorldgenSpeciesWeight(IAlleleBeeSpecies species, double d) {
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(species, d));
worldgenSpeciesWeightsTotal += d;
}
public static void populateSpeciesListRarity() {
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Forest"), 20.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Meadows"), 20.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Tropical"), 10.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Modest"), 16.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Wintry"), 10.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Ended"), 0.5));
if (ExtraBeesHelper.isActive()) {
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Water"), 12.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Rocky"), 16.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Embittered"), 10.0));
}
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.MYSTICAL, 20.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.UNUSUAL, 20.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.SORCEROUS, 13.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.ATTUNED, 6.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.INFERNAL, 10.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.OBLIVION, 1.0));
for (Tuple<IAlleleBeeSpecies, Double> t : worldgenSpeciesWeights) {
worldgenSpeciesWeightsTotal += t.right.doubleValue();
}
}
}
@@ -0,0 +1,600 @@
package magicbees.bees;
import java.util.ArrayList;
import java.util.Collection;
import magicbees.main.Config;
import magicbees.main.utils.LocalizationManager;
import magicbees.main.utils.LogHelper;
import magicbees.main.utils.MoonPhase;
import magicbees.main.utils.compat.ArsMagicaHelper;
import magicbees.main.utils.compat.EquivalentExchangeHelper;
import magicbees.main.utils.compat.ExtraBeesHelper;
import magicbees.main.utils.compat.ForestryHelper;
import magicbees.main.utils.compat.RedstoneArsenalHelper;
import magicbees.main.utils.compat.ThaumcraftHelper;
import magicbees.main.utils.compat.ThermalExpansionHelper;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.BiomeDictionary.Type;
import net.minecraftforge.oredict.OreDictionary;
import forestry.api.apiculture.IAlleleBeeSpecies;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IBeeMutation;
import forestry.api.apiculture.IBeeRoot;
import forestry.api.genetics.IAllele;
import forestry.api.genetics.IGenome;
public class BeeMutation implements IBeeMutation
{
public static void setupMutations()
{
IAlleleBeeSpecies baseA, baseB;
BeeMutation mutation;
// Forestry + These -> Common
BeeSpecies[] magicMundane = new BeeSpecies[] { BeeSpecies.MYSTICAL, BeeSpecies.SORCEROUS, BeeSpecies.UNUSUAL, BeeSpecies.ATTUNED };
String[] forestryMundane = new String[] { "Forest", "Meadows", "Modest", "Wintry", "Tropical", "Marshy" };
String[] binnieMundane = new String[] { "marble", "rock", "water", "basalt" };
for (BeeSpecies species : magicMundane)
{
for (String str : forestryMundane)
{
new BeeMutation(species, Allele.getBaseSpecies(str), ForestryHelper.getTemplateForestryForSpecies("Common"), 15);
}
if (ExtraBeesHelper.isActive())
{
for (String str : binnieMundane)
{
LogHelper.info("Registering " + str);
try
{
new BeeMutation(species, Allele.getExtraSpecies(str), ForestryHelper.getTemplateForestryForSpecies("Common"), 15);
}
catch (Exception e)
{
LogHelper.info("Unable to register! This mutation will not be available.");
}
}
}
new BeeMutation(species, Allele.getBaseSpecies("Common"), ForestryHelper.getTemplateForestryForSpecies("Cultivated"), 12);
new BeeMutation(species, Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH, 12);
}
new BeeMutation(Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH, BeeSpecies.ESOTERIC, 10);
new BeeMutation(BeeSpecies.ELDRITCH, BeeSpecies.ESOTERIC, BeeSpecies.MYSTERIOUS, 8);
new BeeMutation(BeeSpecies.ESOTERIC, BeeSpecies.MYSTERIOUS, BeeSpecies.ARCANE, 8)
.setMoonPhaseBonus(MoonPhase.WAXING_CRESCENT, MoonPhase.WAXING_GIBBOUS, 1.2f);
new BeeMutation(Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH, BeeSpecies.CHARMED, 10);
new BeeMutation(BeeSpecies.ELDRITCH, BeeSpecies.CHARMED, BeeSpecies.ENCHANTED, 8);
new BeeMutation(BeeSpecies.CHARMED, BeeSpecies.ENCHANTED, BeeSpecies.SUPERNATURAL, 8)
.setMoonPhaseBonus(MoonPhase.WANING_GIBBOUS, MoonPhase.WANING_CRESCENT, 1.2f);
new BeeMutation(BeeSpecies.ARCANE, BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, 7);
new BeeMutation(BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, BeeSpecies.WINDY, 14)
.setBlockRequired(Blocks.leaves);
new BeeMutation(BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, BeeSpecies.WATERY, 14)
.setBlockRequired(Blocks.water);
new BeeMutation(BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, BeeSpecies.EARTHY, 100)//14)
.setBlockRequired(Blocks.brick_block);
new BeeMutation(BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, BeeSpecies.FIREY, 14)
.setBlockRequired(Blocks.lava);
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.ATTUNED, BeeSpecies.AWARE, 10);
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.AWARE, BeeSpecies.SPIRIT, 8);
new BeeMutation(BeeSpecies.ATTUNED, BeeSpecies.AWARE, BeeSpecies.SPIRIT, 8);
new BeeMutation(BeeSpecies.AWARE, BeeSpecies.SPIRIT, BeeSpecies.SOUL, 7);
new BeeMutation(Allele.getBaseSpecies("Monastic"), BeeSpecies.ARCANE, BeeSpecies.PUPIL, 10);
new BeeMutation(BeeSpecies.ARCANE, BeeSpecies.PUPIL, BeeSpecies.SCHOLARLY, 8);
new BeeMutation(BeeSpecies.PUPIL, BeeSpecies.SCHOLARLY, BeeSpecies.SAVANT, 6);
new BeeMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.ETHEREAL, BeeSpecies.TIMELY, 8);
new BeeMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.TIMELY, BeeSpecies.LORDLY, 8);
new BeeMutation(BeeSpecies.TIMELY, BeeSpecies.LORDLY, BeeSpecies.DOCTORAL, 7);
new BeeMutation(BeeSpecies.INFERNAL, BeeSpecies.ELDRITCH, BeeSpecies.HATEFUL, 9)
.setBiomeRequired(BiomeDictionary.Type.NETHER);
new BeeMutation(BeeSpecies.INFERNAL, BeeSpecies.HATEFUL, BeeSpecies.SPITEFUL, 7)
.setBiomeRequired(BiomeDictionary.Type.NETHER);
new BeeMutation(Allele.getBaseSpecies("Demonic"), BeeSpecies.SPITEFUL, BeeSpecies.WITHERING, 6)
.setBiomeRequired(BiomeDictionary.Type.NETHER);
new BeeMutation(Allele.getBaseSpecies("Modest"), BeeSpecies.ELDRITCH, BeeSpecies.SKULKING, 12);
new BeeMutation(Allele.getBaseSpecies("Tropical"), BeeSpecies.SKULKING, BeeSpecies.SPIDERY, 10);
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.ETHEREAL, BeeSpecies.GHASTLY, 9);
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.HATEFUL, BeeSpecies.SMOULDERING, 7)
.setBiomeRequired(BiomeDictionary.Type.NETHER);
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.OBLIVION, BeeSpecies.NAMELESS, 10);
new BeeMutation(BeeSpecies.OBLIVION, BeeSpecies.NAMELESS, BeeSpecies.ABANDONED, 8);
new BeeMutation(BeeSpecies.NAMELESS, BeeSpecies.ABANDONED, BeeSpecies.FORLORN, 6);
new BeeMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.ABANDONED, BeeSpecies.DRACONIC, 6)
.setBiomeRequired(BiomeDictionary.Type.END);
new BeeMutation(BeeSpecies.UNUSUAL, BeeSpecies.ELDRITCH, BeeSpecies.MUTABLE, 12);
new BeeMutation(BeeSpecies.UNUSUAL, BeeSpecies.MUTABLE, BeeSpecies.TRANSMUTING, 9);
new BeeMutation(BeeSpecies.UNUSUAL, BeeSpecies.MUTABLE, BeeSpecies.CRUMBLING, 9);
new BeeMutation(BeeSpecies.MYSTICAL, BeeSpecies.MUTABLE, BeeSpecies.INVISIBLE, 15);
if (BeeSpecies.COPPER.isActive())
{
new BeeMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Meadows"), BeeSpecies.COPPER, 12)
.setBlockRequired("blockCopper");
}
if (BeeSpecies.TIN.isActive())
{
new BeeMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Forest"), BeeSpecies.TIN, 12)
.setBlockRequired("blockTin");
}
new BeeMutation(Allele.getBaseSpecies("Common"), Allele.getBaseSpecies("Industrious"), BeeSpecies.IRON, 12)
.setBlockRequired(Blocks.iron_block);
if (BeeSpecies.LEAD.isActive())
{
baseA = (BeeSpecies.TIN.isActive()) ? BeeSpecies.TIN : (BeeSpecies.COPPER.isActive()) ? BeeSpecies.COPPER : BeeSpecies.IRON;
mutation = new BeeMutation(baseA, Allele.getBaseSpecies("Common"), BeeSpecies.LEAD, 10);
if (OreDictionary.getOres("blockLead").size() > 0)
{
mutation.setBlockRequired("blockLead");
}
}
if (BeeSpecies.SILVER.isActive())
{
mutation = new BeeMutation(Allele.getBaseSpecies("Imperial"), Allele.getBaseSpecies("Modest"), BeeSpecies.SILVER, 8);
if (OreDictionary.getOres("blockSilver").size() > 0)
{
mutation.setBlockRequired("blockSilver");
}
}
baseA = (BeeSpecies.EE_MINIUM.isActive()) ? BeeSpecies.EE_MINIUM : Allele.getBaseSpecies("Imperial");
baseB = (BeeSpecies.LEAD.isActive()) ? BeeSpecies.LEAD : BeeSpecies.IRON;
new BeeMutation(baseA, baseB, BeeSpecies.GOLD, 8)
.setBlockRequired(Blocks.gold_block);
if (BeeSpecies.ALUMINUM.isActive())
{
new BeeMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Cultivated"), BeeSpecies.ALUMINUM, 10)
.setBlockRequired("blockAluminum");
}
if (BeeSpecies.ARDITE.isActive())
{
new BeeMutation(Allele.getBaseSpecies("Industrious"), BeeSpecies.INFERNAL, BeeSpecies.ARDITE, 9)
.setBlockRequired("blockArdite");
}
if (BeeSpecies.COBALT.isActive())
{
new BeeMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.INFERNAL, BeeSpecies.COBALT, 9)
.setBlockRequired("blockCobalt");
}
if (BeeSpecies.MANYULLYN.isActive())
{
new BeeMutation(BeeSpecies.ARDITE, BeeSpecies.COBALT, BeeSpecies.MANYULLYN, 9)
.setBlockRequired("blockManyullyn");
}
new BeeMutation(Allele.getBaseSpecies("Austere"), BeeSpecies.GOLD, BeeSpecies.DIAMOND, 7)
.setBlockRequired(Blocks.diamond_block);
baseA = (BeeSpecies.SILVER.isActive()) ? BeeSpecies.SILVER : Allele.getBaseSpecies("Imperial");
new BeeMutation(Allele.getBaseSpecies("Austere"), baseA, BeeSpecies.EMERALD, 6)
.setBlockRequired(Blocks.emerald_block);
new BeeMutation(Allele.getBaseSpecies("Rural"), BeeSpecies.COPPER, BeeSpecies.APATITE, 12)
.setBlockRequired("blockApatite");
if (ThaumcraftHelper.isActive())
{
new BeeMutation(BeeSpecies.WINDY, BeeSpecies.WINDY, BeeSpecies.TC_AIR, 8)
.setBlockAndMetaRequired(Config.tcCrystal, ThaumcraftHelper.ShardType.AIR.ordinal());
new BeeMutation(BeeSpecies.FIREY, BeeSpecies.FIREY, BeeSpecies.TC_FIRE, 8)
.setBlockAndMetaRequired(Config.tcCrystal, ThaumcraftHelper.ShardType.FIRE.ordinal());
new BeeMutation(BeeSpecies.WATERY, BeeSpecies.WATERY, BeeSpecies.TC_WATER, 8)
.setBlockAndMetaRequired(Config.tcCrystal, ThaumcraftHelper.ShardType.WATER.ordinal());
new BeeMutation(BeeSpecies.EARTHY, BeeSpecies.EARTHY, BeeSpecies.TC_EARTH, 8)
.setBlockAndMetaRequired(Config.tcCrystal, ThaumcraftHelper.ShardType.EARTH.ordinal());
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.ARCANE, BeeSpecies.TC_ORDER, 8)
.setBlockAndMetaRequired(Config.tcCrystal, ThaumcraftHelper.ShardType.ORDER.ordinal());
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.SUPERNATURAL, BeeSpecies.TC_CHAOS, 8)
.setBlockAndMetaRequired(Config.tcCrystal, ThaumcraftHelper.ShardType.CHAOS.ordinal());
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.WINDY, BeeSpecies.TC_BATTY, 9);
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.PUPIL, BeeSpecies.TC_BRAINY, 9);
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.GHASTLY, BeeSpecies.TC_WISPY, 9)
.setMoonPhaseRestricted(MoonPhase.WANING_CRESCENT, MoonPhase.WAXING_CRESCENT);
new BeeMutation(Allele.getBaseSpecies("Common"), BeeSpecies.SKULKING, BeeSpecies.TC_CHICKEN, 12)
.setBiomeRequired(Type.FOREST);
new BeeMutation(Allele.getBaseSpecies("Common"), BeeSpecies.SKULKING, BeeSpecies.TC_BEEF, 12)
.setBiomeRequired(Type.PLAINS);
new BeeMutation(Allele.getBaseSpecies("Common"), BeeSpecies.SKULKING, BeeSpecies.TC_PORK, 12)
.setBiomeRequired(Type.MOUNTAIN);
}
if (ArsMagicaHelper.isActive())
{
new BeeMutation(BeeSpecies.ARCANE, BeeSpecies.ETHEREAL, BeeSpecies.AM_ESSENCE, 10);
new BeeMutation(BeeSpecies.ARCANE, BeeSpecies.AM_ESSENCE, BeeSpecies.AM_QUINTESSENCE, 7);
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.WINDY, BeeSpecies.AM_AIR, 10);
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.EARTHY, BeeSpecies.AM_EARTH, 10);
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.FIREY, BeeSpecies.AM_FIRE, 10);
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.WATERY, BeeSpecies.AM_WATER, 10);
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.ETHEREAL, BeeSpecies.AM_ARCANE, 10);
new BeeMutation(BeeSpecies.WINDY, BeeSpecies.AM_AIR, BeeSpecies.AM_LIGHTNING, 8);
new BeeMutation(BeeSpecies.EARTHY, BeeSpecies.AM_EARTH, BeeSpecies.AM_PLANT, 8);
new BeeMutation(BeeSpecies.WATERY, BeeSpecies.AM_WATER, BeeSpecies.AM_ICE, 8);
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.AM_ESSENCE, BeeSpecies.AM_VORTEX, 8);
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.GHASTLY, BeeSpecies.AM_WIGHT, 8);
}
if (EquivalentExchangeHelper.isActive())
{
new BeeMutation(Allele.getBaseSpecies("Frugal"), BeeSpecies.MUTABLE, BeeSpecies.EE_MINIUM, 8);
}
if (RedstoneArsenalHelper.isActive())
{
new BeeMutation(BeeSpecies.TE_ELECTRUM, BeeSpecies.TE_DESTABILIZED, BeeSpecies.RSA_FLUXED, 10)
.setBlockRequired("blockElectrumFlux");
}
if (ThermalExpansionHelper.isActive())
{
new BeeMutation(BeeSpecies.TIN, BeeSpecies.COPPER, BeeSpecies.TE_BRONZE, 12)
.setBlockRequired("blockBronze");
new BeeMutation(BeeSpecies.GOLD, BeeSpecies.SILVER, BeeSpecies.TE_ELECTRUM, 10)
.setBlockRequired("blockElectrum");
new BeeMutation(BeeSpecies.IRON, BeeSpecies.ESOTERIC, BeeSpecies.TE_NICKEL, 14)
.setBlockRequired("blockNickel");
new BeeMutation(BeeSpecies.IRON, BeeSpecies.TE_NICKEL, BeeSpecies.TE_INVAR, 14)
.setBlockRequired("blockInvar");
new BeeMutation(BeeSpecies.TE_NICKEL, BeeSpecies.TE_INVAR, BeeSpecies.TE_PLATINUM, 10)
.setBlockRequired("blockPlatinum");
new BeeMutation(BeeSpecies.TIN, BeeSpecies.COPPER, BeeSpecies.TE_BRONZE, 12)
.setBlockRequired("blockBronze");
new BeeMutation(BeeSpecies.SPITEFUL, BeeSpecies.TIN, BeeSpecies.TE_COAL, 12)
.setBlockRequired(Blocks.coal_ore);
new BeeMutation(BeeSpecies.SPITEFUL, Allele.getBaseSpecies("Industrious"), BeeSpecies.TE_DESTABILIZED, 12)
.setBlockRequired(Blocks.redstone_ore);
new BeeMutation(BeeSpecies.SMOULDERING, BeeSpecies.INFERNAL, BeeSpecies.TE_LUX, 12)
.setBlockRequired(Blocks.glowstone);
new BeeMutation(BeeSpecies.SMOULDERING, Allele.getBaseSpecies("Austere"), BeeSpecies.TE_DANTE, 12)
.setBiomeRequired(BiomeDictionary.Type.NETHER);
new BeeMutation(BeeSpecies.TE_DANTE, BeeSpecies.TE_COAL, BeeSpecies.TE_PYRO, 8)
.setBiomeRequired(BiomeDictionary.Type.NETHER);
new BeeMutation(BeeSpecies.SKULKING, Allele.getBaseSpecies("Wintry"), BeeSpecies.TE_BLIZZY, 12);
new BeeMutation(BeeSpecies.TE_BLIZZY, Allele.getBaseSpecies("Icy"), BeeSpecies.TE_GELID, 8);
new BeeMutation(BeeSpecies.TE_PLATINUM, BeeSpecies.OBLIVION, BeeSpecies.TE_WINSOME, 12);
new BeeMutation(BeeSpecies.TE_WINSOME, BeeSpecies.TE_COAL, BeeSpecies.TE_ENDEARING, 8)
.setBlockRequired("blockEnderium");
}
}
private IAllele parent1;
private IAllele parent2;
private IAllele mutationTemplate[];
private int baseChance;
private boolean isSecret;
private boolean isMoonRestricted;
private MoonPhase moonPhaseStart;
private MoonPhase moonPhaseEnd;
private float moonPhaseMutationBonus;
private boolean requiresBlock;
private Block requiredBlock;
private int requiredBlockMeta;
private String requiredBlockOreDictEntry;
private String requiredBlockName;
private BiomeDictionary.Type requiredBiomeType;
public BeeMutation(IAlleleBeeSpecies species0, IAlleleBeeSpecies species1, BeeSpecies resultSpecies, int percentChance)
{
this(species0, species1, resultSpecies.getGenome(), percentChance);
}
public BeeMutation(IAlleleBeeSpecies species0, IAlleleBeeSpecies species1, IAllele[] resultSpeciesGenome, int percentChance)
{
this.parent1 = species0;
this.parent2 = species1;
this.mutationTemplate = resultSpeciesGenome;
this.baseChance = percentChance;
this.isSecret = false;
this.isMoonRestricted = false;
this.moonPhaseMutationBonus = -1f;
//this.nodeType = null;
this.requiresBlock = false;
this.requiredBlockMeta = OreDictionary.WILDCARD_VALUE;
this.requiredBlockOreDictEntry = null;
this.requiredBiomeType = null;
this.requiredBlockName = null;
BeeManager.beeRoot.registerMutation(this);
}
@Override
public float getChance(IBeeHousing housing, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1)
{
float finalChance = 0f;
float chance = this.baseChance * 1f;
if (this.arePartners(allele0, allele1))
{
// This mutation applies. Continue calculation.
if (this.moonPhaseStart != null && this.moonPhaseEnd != null)
{
// Only occurs during the phases.
if (this.isMoonRestricted && !MoonPhase.getMoonPhase(housing.getWorld()).isBetween(this.moonPhaseStart, this.moonPhaseEnd))
{
chance = 0;
}
else if (this.moonPhaseMutationBonus != -1f)
{
// There is a bonus to this mutation during moon phases...
if (MoonPhase.getMoonPhase(housing.getWorld()).isBetween(this.moonPhaseStart, this.moonPhaseEnd))
{
chance = (int)(chance * this.moonPhaseMutationBonus);
}
}
}
if (this.requiresBlock)
{
Block blockBelow;
int blockMeta;
int i = 1;
do
{
blockBelow = housing.getWorld().getBlock(housing.getXCoord(), housing.getYCoord() - i,
housing.getZCoord());
blockMeta = housing.getWorld().getBlockMetadata(housing.getXCoord(), housing.getYCoord() - i, housing.getZCoord());
++i;
}
while (blockBelow != null && (blockBelow instanceof IBeeHousing || blockBelow == Config.fAlvearyBlock));
if (this.requiredBlockOreDictEntry != null)
{
int[] dicId = OreDictionary.getOreIDs(new ItemStack(blockBelow, 1, blockMeta));
if (dicId.length != 0)
{
if (!OreDictionary.getOreName(dicId[0]).equals(this.requiredBlockOreDictEntry))
{
chance = 0;
}
}
else
{
chance = 0;
}
}
else if (this.requiredBlock != blockBelow || (this.requiredBlockMeta != OreDictionary.WILDCARD_VALUE &&
this.requiredBlockMeta != blockMeta))
{
chance = 0;
}
}
if (this.requiredBiomeType != null)
{
BiomeDictionary.Type[] types = BiomeDictionary.getTypesForBiome(housing.getWorld().getBiomeGenForCoords(housing.getXCoord(), housing.getZCoord()));
boolean found = false;
for (int i = 0; i < types.length; ++i)
{
if (this.requiredBiomeType == types[i])
{
found = true;
break;
}
}
if (!found)
{
chance = 0;
}
}
finalChance = Math.round(chance
* housing.getMutationModifier((IBeeGenome)genome0,
(IBeeGenome)genome1, chance)
* BeeManager.beeRoot.getBeekeepingMode(housing.getWorld())
.getMutationModifier((IBeeGenome)genome0,
(IBeeGenome)genome1, chance));
}
return finalChance;
}
@Override
public IAllele getAllele0()
{
return parent1;
}
@Override
public IAllele getAllele1()
{
return parent2;
}
@Override
public IAllele[] getTemplate()
{
return mutationTemplate;
}
@Override
public float getBaseChance()
{
return baseChance;
}
@Override
public boolean isPartner(IAllele allele)
{
return parent1.getUID().equals(allele.getUID()) || parent2.getUID().equals(allele.getUID());
}
@Override
public IAllele getPartner(IAllele allele)
{
IAllele val = parent1;
if (val.getUID().equals(allele.getUID()))
val = parent2;
return val;
}
@Override
public Collection<String> getSpecialConditions()
{
ArrayList<String> conditions = new ArrayList<String>();
if (this.isMoonRestricted && moonPhaseStart != null && moonPhaseEnd != null)
{
if (moonPhaseStart != moonPhaseEnd)
{
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresPhase"),
moonPhaseStart.getLocalizedName(), moonPhaseEnd.getLocalizedName()));
}
else
{
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresPhaseSingle"),
moonPhaseStart.getLocalizedName()));
}
}
if (this.requiresBlock)
{
if (this.requiredBlockName != null)
{
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresBlock"),
LocalizationManager.getLocalizedString(this.requiredBlockName)));
}
else if (this.requiredBlockOreDictEntry != null)
{
ArrayList<ItemStack> ores = OreDictionary.getOres(this.requiredBlockOreDictEntry);
if (ores.size() > 0)
{
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresBlock"), ores.get(0).getDisplayName()));
}
}
else
{
int meta = OreDictionary.WILDCARD_VALUE;
if (this.requiredBlockMeta != OreDictionary.WILDCARD_VALUE)
{
meta = this.requiredBlockMeta;
}
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresBlock"),
new ItemStack(this.requiredBlock, 1, meta).getDisplayName()));
}
}
if (this.requiredBiomeType != null)
{
String biomeName = this.requiredBiomeType.name().substring(0, 1) + this.requiredBiomeType.name().substring(1).toLowerCase();
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresBiome"), biomeName));
}
return conditions;
}
@Override
public IBeeRoot getRoot()
{
return BeeManager.beeRoot;
}
public boolean arePartners(IAllele alleleA, IAllele alleleB)
{
return (this.parent1.getUID().equals(alleleA.getUID())) && this.parent2.getUID().equals(alleleB.getUID()) ||
this.parent1.getUID().equals(alleleB.getUID()) && this.parent2.getUID().equals(alleleA.getUID());
}
public BeeMutation setSecret()
{
this.isSecret = true;
return this;
}
public boolean isSecret()
{
return isSecret;
}
public BeeMutation setBlockRequired(Block block)
{
this.requiresBlock = true;
this.requiredBlock = block;
return this;
}
public BeeMutation setBlockAndMetaRequired(Block block, int meta)
{
this.requiresBlock = true;
this.requiredBlock = block;
this.requiredBlockMeta = meta;
return this;
}
public BeeMutation setBlockRequired(String oreDictEntry)
{
this.requiresBlock = true;
this.requiredBlockOreDictEntry = oreDictEntry;
return this;
}
public BeeMutation setBlockRequiredNameOverride(String blockName)
{
this.requiredBlockName = blockName;
return this;
}
public BeeMutation setMoonPhaseRestricted(MoonPhase begin, MoonPhase end)
{
this.isMoonRestricted = true;
this.moonPhaseStart = begin;
this.moonPhaseEnd = end;
return this;
}
public BeeMutation setMoonPhaseBonus(MoonPhase begin, MoonPhase end, float mutationBonus)
{
this.moonPhaseMutationBonus = mutationBonus;
this.moonPhaseStart = begin;
this.moonPhaseEnd = end;
return this;
}
public BeeMutation setBiomeRequired(BiomeDictionary.Type biomeType)
{
this.requiredBiomeType = biomeType;
return this;
}
}
File diff suppressed because it is too large. Load diff
@@ -1,4 +1,4 @@
package thaumicbees.bees.genetics; package magicbees.bees;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import forestry.api.genetics.IEffectData; import forestry.api.genetics.IEffectData;
@@ -18,11 +18,13 @@ public class EffectData implements IEffectData
@Override @Override
public void readFromNBT(NBTTagCompound nbttagcompound) public void readFromNBT(NBTTagCompound nbttagcompound)
{ } {
}
@Override @Override
public void writeToNBT(NBTTagCompound nbttagcompound) public void writeToNBT(NBTTagCompound nbttagcompound)
{ } {
}
@Override @Override
public void setInteger(int index, int val) public void setInteger(int index, int val)
@@ -66,7 +68,7 @@ public class EffectData implements IEffectData
public float getFloat(int index) public float getFloat(int index)
{ {
float val = 0f; float val = 0f;
if (index >= 0 && index < this.intData.length) if (index >= 0 && index < this.floatData.length)
{ {
val = this.floatData[index]; val = this.floatData[index];
} }
@@ -77,7 +79,7 @@ public class EffectData implements IEffectData
public boolean getBoolean(int index) public boolean getBoolean(int index)
{ {
boolean val = false; boolean val = false;
if (index >= 0 && index < this.intData.length) if (index >= 0 && index < this.boolData.length)
{ {
val = this.boolData[index]; val = this.boolData[index];
} }
@@ -0,0 +1,105 @@
package magicbees.bees;
import magicbees.main.Config;
import magicbees.main.utils.LocalizationManager;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import forestry.api.genetics.IFlowerProvider;
import forestry.api.genetics.IIndividual;
import forestry.api.genetics.IPollinatable;
public class FlowerProviderArsMagicaFlower implements IFlowerProvider
{
private ItemStack[] flowers = { new ItemStack(Config.amBlackOrchid), new ItemStack(Config.amDesertNova),
new ItemStack(Config.amAum), new ItemStack(Config.amWakebloom),
new ItemStack(Config.amTarmaRoot) };
@Override
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int y, int z)
{
boolean flag = false;
Block block = world.getBlock(x, y, z);
if (block == Config.amBlackOrchid || block == Config.amDesertNova ||
block == Config.amAum || block == Config.amWakebloom ||
block == Config.amTarmaRoot)
{
flag = true;
}
return flag;
}
@Override
public boolean growFlower(World world, IIndividual genome, int x, int y, int z)
{
boolean flag = false;
x = -222;
y = 70;
z = -51;
Block blockDown = world.getBlock(x, y - 1, z);
if (world.getBlock(x, y, z).isAir(world, x, y, z))
{
if (blockDown == Blocks.dirt || blockDown == Blocks.grass)
{
int dart = world.rand.nextInt(100);
Block block;
if (dart > 60)
{
block = Config.amBlackOrchid;
}
else if (dart > 30)
{
block = Config.amAum;
}
else
{
block = Config.amTarmaRoot;
}
world.setBlock(x, y, z, block);
flag = true;
}
else if (blockDown == Blocks.sand)
{
world.setBlock(x, y, z, Config.amDesertNova);
flag = true;
}
else if (blockDown == Blocks.stone)
{
world.setBlock(x, y, z, Config.amTarmaRoot);
flag = true;
}
else if (blockDown == Blocks.water || blockDown == Blocks.water)
{
world.setBlock(x, y, z, Config.amWakebloom);
flag = true;
}
}
return flag;
}
@Override
public String getDescription()
{
return LocalizationManager.getLocalizedString("flowerProvider.arsmagica");
}
@Override
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products)
{
return products;
}
@Override
public ItemStack[] getItemStacks()
{
return this.flowers;
}
@Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable)
{
return pollinatable.getPlantType().size() > 1;
}
}
@@ -0,0 +1,101 @@
package magicbees.bees;
import magicbees.main.utils.LocalizationManager;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import forestry.api.genetics.IFlowerProvider;
import forestry.api.genetics.IIndividual;
import forestry.api.genetics.IPollinatable;
public class FlowerProviderAuraNode implements IFlowerProvider
{
protected int nodeRange = 70;
@Override
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int y, int z)
{
return this.isNodeWithinRange(world, x, y, z);
}
@Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable)
{
return pollinatable.getPlantType().size() > 0;
}
@Override
public boolean growFlower(World world, IIndividual genome, int x, int y, int z)
{
return true;
}
@Override
public String getDescription()
{
return LocalizationManager.getLocalizedString("flowerProvider.node");
}
@Override
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products)
{
return products;
}
@Override
public ItemStack[] getItemStacks()
{
return null;
}
protected boolean isNodeWithinRange(World w, int x, int y, int z)
{
boolean nodeNearby = false;
/*if (ThaumcraftApi.getClosestAuraWithinRange(w, x, y, z, this.nodeRange) >= 0)
{
nodeNearby = true;
}*/
return nodeNearby;
}
/*protected AuraNode getNodeWithinRange(World w, int x, int y, int z)
{
AuraNode node = null;
int nodeId = ThaumcraftApi.getClosestAuraWithinRange(w, x, y, z, this.nodeRange);
if (nodeId >= 0)
{
node = ThaumcraftApi.getNodeCopy(nodeId);
}
return node;
}*/
protected ItemStack[] addItemToProducts(ItemStack[] products, ItemStack itemStack)
{
for (ItemStack stack : products)
{
if (stack.getItem() == itemStack.getItem() && stack.getItemDamage() == itemStack.getItemDamage())
{
if (stack.stackSize < stack.getItem().getItemStackLimit(stack))
{
stack.stackSize += itemStack.stackSize;
itemStack.stackSize = Math.max(stack.stackSize - stack.getItem().getItemStackLimit(stack), 0);
}
}
}
if (itemStack.stackSize > 0)
{
ItemStack[] newProducts = new ItemStack[products.length + 1];
for (int i = 0; i < products.length; ++i)
{
newProducts[i] = products[i];
}
newProducts[products.length] = itemStack;
products = newProducts;
}
return products;
}
}
@@ -0,0 +1,55 @@
package magicbees.bees;
import java.util.EnumSet;
import magicbees.main.utils.LocalizationManager;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.EnumPlantType;
import forestry.api.genetics.IFlowerProvider;
import forestry.api.genetics.IIndividual;
import forestry.api.genetics.IPollinatable;
public class FlowerProviderBookshelf implements IFlowerProvider
{
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int i, int j)
{
boolean flag = false;
if (world.getBlock(x, i, j) == Blocks.bookshelf)
{
flag = true;
}
return flag;
}
public boolean growFlower(World world, IIndividual genome, int x, int i, int j)
{
// Always return true so the system thinks we grew a flower.
// Bees can't grow bookshelves! Are you crazy?!
return true;
}
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int i, int j, ItemStack products[])
{
return products;
}
public ItemStack[] getItemStacks()
{
return new ItemStack[] { new ItemStack(Blocks.bookshelf) };
}
@Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable)
{
EnumSet<EnumPlantType> types = pollinatable.getPlantType();
return types.size() > 0 && !types.contains(EnumPlantType.Nether) && !types.contains(EnumPlantType.Water);
}
public String getDescription()
{
return LocalizationManager.getLocalizedString("flowerProvider.book");
}
}
@@ -0,0 +1,78 @@
package magicbees.bees;
import magicbees.main.Config;
import magicbees.main.utils.LocalizationManager;
import magicbees.main.utils.compat.ThaumcraftHelper;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import forestry.api.genetics.IFlowerProvider;
import forestry.api.genetics.IIndividual;
import forestry.api.genetics.IPollinatable;
public class FlowerProviderThaumcraftFlower implements IFlowerProvider
{
private ItemStack[] flowers = { new ItemStack(Config.tcPlant, 1, 2), new ItemStack(Config.tcPlant, 1, 3) };
@Override
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int y, int z)
{
boolean flag = false;
if (world.getBlock(x, y, z) == Config.tcPlant)
{
int meta = world.getBlockMetadata(x, y, z);
if (meta == 2 || meta == 3)
{
flag = true;
}
}
return flag;
}
@Override
public boolean growFlower(World world, IIndividual genome, int x, int y, int z)
{
boolean flag = false;
Block blockDown = world.getBlock(x, y - 1, z);
if (world.getBlock(x, y, z).isAir(world, x, y, z))
{
if (blockDown == Blocks.dirt || blockDown == Blocks.grass)
{
world.setBlock(x, y, z, Config.tcPlant, ThaumcraftHelper.BlockPlant.SHIMMERLEAF.ordinal(), 2);
flag = true;
}
else if (blockDown == Blocks.sand)
{
world.setBlock(x, y, z, Config.tcPlant, ThaumcraftHelper.BlockPlant.CINDERPEARL.ordinal(), 2);
flag = true;
}
}
return flag;
}
@Override
public String getDescription()
{
return LocalizationManager.getLocalizedString("flowerProvider.magic");
}
@Override
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products)
{
return products;
}
@Override
public ItemStack[] getItemStacks()
{
return this.flowers;
}
@Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable)
{
return pollinatable.getPlantType().size() > 1;
}
}
@@ -0,0 +1,211 @@
package magicbees.bees;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeDictionary;
import forestry.api.apiculture.hives.HiveManager;
import forestry.api.apiculture.hives.IHiveDescription;
import forestry.api.apiculture.hives.IHiveGen;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
import magicbees.block.types.HiveType;
import magicbees.main.Config;
import magicbees.main.utils.BlockUtil;
import magicbees.main.utils.LogHelper;
import magicbees.world.feature.FeatureOreVein;
import magicbees.world.feature.HiveGenNether;
import magicbees.world.feature.HiveGenOblivion;
import magicbees.world.feature.HiveGenUnderground;
public enum HiveDescription implements IHiveDescription {
CURIOUS(HiveType.CURIOUS, 3.0f, HiveManager.genHelper.tree()),
UNUSUAL(HiveType.UNUSUAL, 1.0f, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass)),
RESONANT(HiveType.RESONANT, 0.5f, HiveManager.genHelper.ground(Blocks.sand, Blocks.sandstone)),
DEEP(HiveType.DEEP, 2.0f, new HiveGenUnderground(10, 10, 6)) {
@Override
public void postGen(World world, int x, int y, int z)
{
super.postGen(world, x, y, z);
Random random = world.rand;
FeatureOreVein.redstoneGen.generateVein(world, random, x + 1, y, z, 2);
FeatureOreVein.redstoneGen.generateVein(world, random, x - 1, y, z, 2);
FeatureOreVein.redstoneGen.generateVein(world, random, x, y + 1, z, 2);
FeatureOreVein.redstoneGen.generateVein(world, random, x, y - 1, z, 2);
FeatureOreVein.redstoneGen.generateVein(world, random, x, y, z + 1, 2);
FeatureOreVein.redstoneGen.generateVein(world, random, x, y, z - 1, 2);
}
},
INFERNAL(HiveType.INFERNAL, 50.0f, new HiveGenNether(0, 175, 6)) {
@Override
public void postGen(World world, int x, int y, int z)
{
super.postGen(world, x, y, z);
Random random = world.rand;
FeatureOreVein.netherQuartzGen.generateVein(world, random, x + 1, y, z, 4);
FeatureOreVein.netherQuartzGen.generateVein(world, random, x - 1, y, z, 4);
FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y + 1, z, 4);
FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y - 1, z, 4);
FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y, z + 1, 4);
FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y, z - 1, 4);
}
},
INFERNAL_OVERWORLD(HiveType.INFERNAL, 1.0f, new HiveGenUnderground(5, 13, 6)) {
@Override
public void postGen(World world, int x, int y, int z)
{
super.postGen(world, x, y, z);
Random random = world.rand;
FeatureOreVein.glowstoneGen.generateVein(world, random, x + 1, y, z, world.rand.nextInt(4) + 1);
FeatureOreVein.glowstoneGen.generateVein(world, random, x - 1, y, z, world.rand.nextInt(4) + 1);
if (BlockUtil.canBlockReplaceAt(world, x, y + 1, z, Blocks.stone))
{
world.setBlock(x, y + 1, z, Blocks.glowstone, 0, 3);
}
if (BlockUtil.canBlockReplaceAt(world, x, y - 1, z, Blocks.stone))
{
world.setBlock(x, y - 1, z, Blocks.glowstone, 0, 3);
}
FeatureOreVein.glowstoneGen.generateVein(world, random, x, y, z + 1, world.rand.nextInt(4) + 1);
FeatureOreVein.glowstoneGen.generateVein(world, random, x, y, z - 1, world.rand.nextInt(4) + 1);
}
},
OBLIVION(HiveType.OBLIVION, 20.0f, new HiveGenOblivion()) {
@Override
public void postGen(World world, int x, int y, int z)
{
super.postGen(world, x, y, z);
int obsidianSpikeHeight = world.rand.nextInt(8) + 3;
for (int i = 1; i < obsidianSpikeHeight && y - i > 0; ++i)
{
world.setBlock(x, y - i, z, Blocks.obsidian, 0, 2);
}
}
},
OBLIVION_OVERWORLD(HiveType.OBLIVION, 1.0f, new HiveGenUnderground(5, 5, 5)) {
@Override
public void postGen(World world, int x, int y, int z)
{
super.postGen(world, x, y, z);
Random random = world.rand;
FeatureOreVein.endStoneGen.generateVein(world, random, x + 1, y, z, world.rand.nextInt(6) + 1);
FeatureOreVein.endStoneGen.generateVein(world, random, x - 1, y, z, world.rand.nextInt(6) + 1);
FeatureOreVein.endStoneGen.generateVein(world, random, x, y + 1, z, world.rand.nextInt(3) + 1);
FeatureOreVein.endStoneGen.generateVein(world, random, x, y - 1, z, world.rand.nextInt(3) + 1);
FeatureOreVein.endStoneGen.generateVein(world, random, x, y, z + 1, world.rand.nextInt(6) + 1);
FeatureOreVein.endStoneGen.generateVein(world, random, x, y, z - 1, world.rand.nextInt(6) + 1);
}
};
private static boolean logSpawns = Config.logHiveSpawns;
private final HiveType hiveType;
private final float genChance;
private final List<BiomeDictionary.Type> biomes = new ArrayList<BiomeDictionary.Type>();
private final IHiveGen hiveGen;
private HiveDescription(HiveType hiveType, float genChance, IHiveGen hiveGen)
{
this.hiveType = hiveType;
this.genChance = genChance;
this.hiveGen = hiveGen;
}
public static void initHiveData()
{
CURIOUS.biomes.add(BiomeDictionary.Type.FOREST);
CURIOUS.biomes.add(BiomeDictionary.Type.JUNGLE);
CURIOUS.biomes.add(BiomeDictionary.Type.HILLS);
UNUSUAL.biomes.add(BiomeDictionary.Type.PLAINS);
UNUSUAL.biomes.add(BiomeDictionary.Type.MOUNTAIN);
UNUSUAL.biomes.add(BiomeDictionary.Type.HILLS);
RESONANT.biomes.add(BiomeDictionary.Type.SANDY);
RESONANT.biomes.add(BiomeDictionary.Type.MAGICAL);
DEEP.biomes.add(BiomeDictionary.Type.HILLS);
DEEP.biomes.add(BiomeDictionary.Type.MOUNTAIN);
DEEP.biomes.add(BiomeDictionary.Type.MAGICAL);
INFERNAL.biomes.add(BiomeDictionary.Type.NETHER);
INFERNAL_OVERWORLD.biomes.add(BiomeDictionary.Type.MAGICAL);
OBLIVION.biomes.add(BiomeDictionary.Type.END);
OBLIVION_OVERWORLD.biomes.add(BiomeDictionary.Type.MAGICAL);
}
@Override
public IHiveGen getHiveGen()
{
return hiveGen;
}
@Override
public Block getBlock()
{
return Config.hive;
}
@Override
public int getMeta()
{
return hiveType.ordinal();
}
@Override
public boolean isGoodBiome(BiomeGenBase biome)
{
BiomeDictionary.Type[] types = BiomeDictionary.getTypesForBiome(biome);
for (BiomeDictionary.Type type : types)
{
if (biomes.contains(type))
{
return true;
}
}
return false;
}
@Override
public boolean isGoodHumidity(EnumHumidity humidity)
{
return hiveType.getOccupant().canWorkInHumidity(humidity);
}
@Override
public boolean isGoodTemperature(EnumTemperature temperature)
{
return hiveType.getOccupant().canWorkInTemperature(temperature);
}
@Override
public float getGenChance()
{
return genChance;
}
@Override
public void postGen(World world, int x, int y, int z)
{
if (logSpawns)
{
LogHelper.info("Spawned " + this.toString().toLowerCase(Locale.ENGLISH) + " hive at: X " + x + ", Y: " + y + ", Z: " + z);
}
}
}
@@ -0,0 +1,77 @@
package magicbees.bees;
import java.util.ArrayList;
import java.util.Collection;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import forestry.api.apiculture.EnumBeeType;
import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IHiveDrop;
import forestry.api.genetics.IAllele;
public class HiveDrop implements IHiveDrop
{
private IAllele[] template;
private int chance;
private ItemStack[] bonus;
private float ignoblePercent = 0f;
public HiveDrop(IAllele[] beeTemplate, ItemStack[] bonusDrops, int dropChance)
{
this.template = beeTemplate;
this.bonus = bonusDrops;
this.chance = dropChance;
}
public HiveDrop setIgnoblePercentage(float f)
{
this.ignoblePercent = f;
return this;
}
private IBee getBee(World w)
{
IBee bee = BeeManager.beeRoot.getBee(w, BeeManager.beeRoot.templateAsGenome(this.template));
if (w.rand.nextFloat() < this.ignoblePercent)
{
bee.setIsNatural(false);
}
return bee;
}
@Override
public ItemStack getPrincess(World world, int x, int y, int z, int fortune)
{
return BeeManager.beeRoot.getMemberStack(getBee(world), EnumBeeType.PRINCESS.ordinal());
}
@Override
public Collection<ItemStack> getDrones(World world, int x, int y, int z, int fortune)
{
ArrayList<ItemStack> value = new ArrayList<ItemStack>(1);
value.add(BeeManager.beeRoot.getMemberStack(getBee(world), EnumBeeType.DRONE.ordinal()));
return value;
}
@Override
public Collection<ItemStack> getAdditional(World world, int x, int y, int z, int fortune)
{
ArrayList<ItemStack> value = new ArrayList<ItemStack>(bonus.length);
for (int i = 0; i < bonus.length; ++i)
{
value.add(bonus[i].copy());
}
return value;
}
@Override
public int getChance(World world, int x, int y, int z)
{
return this.chance;
}
}
@@ -0,0 +1,62 @@
package magicbees.bees;
import java.util.ArrayList;
import cpw.mods.fml.common.FMLLog;
import magicbees.api.MagicBeesAPI;
import magicbees.api.bees.ITransmutationEffectController;
import magicbees.api.bees.ITransmutationEffectLogic;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
public class TransmutationEffectController implements ITransmutationEffectController
{
private ArrayList<ITransmutationEffectLogic> logicObjects;
static TransmutationEffectController instance;
public TransmutationEffectController()
{
logicObjects = new ArrayList<ITransmutationEffectLogic>();
logicObjects.add(new TransmutationEffectRailcraft());
logicObjects.add(new TransmutationEffectVanilla());
MagicBeesAPI.transmutationEffectController = instance = this;
}
public void attemptTransmutations(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
{
boolean done;
ITransmutationEffectLogic logic;
for (int i = 0; i < logicObjects.size(); i++)
{
logic = logicObjects.get(i);
try
{
done = logic.tryTransmutation(world, biome, sourceBlock, x, y, z);
}
catch (Exception e)
{
done = false;
FMLLog.warning("Magic Bees encountered an issue with an ITransmutationEffectLogic provider %s. Debug information follows.", logic.getClass().getName());
FMLLog.info(e.getMessage());
}
if (done)
{
logicObjects.remove(i);
logicObjects.add(logic);
break;
}
}
}
@Override
public void addEffectLogic(ITransmutationEffectLogic logic)
{
if (logic != null && !logicObjects.contains(logic))
{
logicObjects.add(logic);
}
}
}
@@ -0,0 +1,61 @@
package magicbees.bees;
import java.util.Locale;
import cpw.mods.fml.common.registry.GameRegistry;
import magicbees.api.bees.ITransmutationEffectLogic;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.oredict.OreDictionary;
public class TransmutationEffectRailcraft implements ITransmutationEffectLogic
{
@Override
public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
{
boolean flag = false;
if (OreDictionary.itemMatches(new ItemStack(Blocks.stone), sourceBlock, false) ||
OreDictionary.itemMatches(new ItemStack(Blocks.cobblestone), sourceBlock, false))
{
flag = trySpawnQuarriedStone(world, biome, sourceBlock, x, y, z) ||
trySpawnAbyssalStone(world, biome, sourceBlock, x, y, z);
}
return flag;
}
private boolean trySpawnQuarriedStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
{
boolean flag = false;
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FOREST) &&
!BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SNOWY))
{
ItemStack item = GameRegistry.findItemStack("Railcraft", "cube.stone.quarried", 1);
if (item != null)
{
world.setBlock(x, y, z, Block.getBlockFromItem(item.getItem()), item.getItemDamage(), 2);
flag = true;
}
}
return flag;
}
private boolean trySpawnAbyssalStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
{
boolean flag = false;
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.WATER) &&
!biome.biomeName.toLowerCase(Locale.ENGLISH).contains("river"))
{
ItemStack item = GameRegistry.findItemStack("Railcraft", "cube.stone.abyssal", 1);
if (item != null)
{
world.setBlock(x, y, z, Block.getBlockFromItem(item.getItem()), item.getItemDamage(), 2);
flag = true;
}
}
return flag;
}
}
@@ -0,0 +1,30 @@
package magicbees.bees;
import magicbees.api.bees.ITransmutationEffectLogic;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.oredict.OreDictionary;
public class TransmutationEffectVanilla implements ITransmutationEffectLogic
{
@Override
public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
{
return trySpawnSandstone(world, biome, sourceBlock, x, y, z);
}
private boolean trySpawnSandstone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
{
boolean flag = false;
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SANDY) &&
OreDictionary.itemMatches(new ItemStack(Blocks.sand), sourceBlock, false))
{
world.setBlock(x, y, z, Blocks.sandstone);
flag = true;
}
return flag;
}
}
@@ -0,0 +1,113 @@
package magicbees.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.client.gui.UIScreens;
import magicbees.main.CommonProxy;
import magicbees.main.MagicBees;
import magicbees.main.utils.TabMagicBees;
import magicbees.tileentity.TileEntityEffectJar;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class BlockEffectJar extends BlockContainer
{
public BlockEffectJar()
{
super(Material.glass);
this.setCreativeTab(TabMagicBees.tabMagicBees);
this.setBlockName("effectJar");
this.setBlockBounds(0.25f, 0f, 0.25f, 0.75f, 0.81f, 0.74f);
this.setHardness(0.1f);
this.setResistance(1.5f);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
{
boolean activate = false;
if (!player.isSneaking())
{
player.openGui(MagicBees.object, UIScreens.EFFECT_JAR.ordinal(), world, x, y, z);
activate = true;
}
return activate;
}
@Override
public TileEntity createNewTileEntity(World w, int metadata)
{
return new TileEntityEffectJar();
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
public boolean renderAsNormalBlock()
{
return false;
}
@Override
public int getRenderType()
{
return CommonProxy.RenderIdEffectJar;
}
@Override
public void breakBlock(World world, int x, int y, int z, Block block, int meta)
{
super.breakBlock(world, x, y, z, block, meta);
this.dropInventory(world, x, y, z);
}
private void dropInventory(World world, int x, int y, int z)
{
TileEntity e = world.getTileEntity(x, y, z);
if (e != null && e instanceof TileEntityEffectJar)
{
TileEntityEffectJar jar = (TileEntityEffectJar)e;
// 0 is the only droppable stack.
ItemStack stack = jar.getStackInSlot(0);
if (stack != null && stack.stackSize > 0)
{
float pX = world.rand.nextFloat() * 0.8f + 0.1f;
float pY = world.rand.nextFloat() * 0.8f + 0.1f;
float pZ = world.rand.nextFloat() * 0.8f + 0.1f;
EntityItem entityItem = new EntityItem(world, x + pX, y + pY, z + pZ, stack.copy());
entityItem.motionX = world.rand.nextGaussian() * 0.05f;
entityItem.motionY = world.rand.nextGaussian() * 0.05f + 0.2f;
entityItem.motionZ = world.rand.nextGaussian() * 0.05f;
world.spawnEntityInWorld(entityItem);
stack.stackSize = 0;
}
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister par1IconRegister)
{
this.blockIcon = Blocks.glass.getIcon(0, 0);
}
}
@@ -0,0 +1,113 @@
package magicbees.block;
import java.util.ArrayList;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.block.types.HiveType;
import magicbees.main.Config;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import forestry.api.core.Tabs;
public class BlockHive extends Block
{
public BlockHive()
{
super(new MaterialHive());
this.setLightLevel(0.8f);
setHardness(1f);
setCreativeTab(Tabs.tabApiculture);
setBlockName("hive");
}
@Override
public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity)
{
return false;
}
@Override
public int damageDropped(int meta)
{
return meta;
}
@Override
public int getLightValue(IBlockAccess world, int x, int y, int z)
{
int meta = world.getBlockMetadata(x, y, z);
if (meta < 0 || meta > HiveType.values().length)
{
meta = 0;
}
return HiveType.getHiveFromMeta(meta).getLightValue();
}
@SideOnly(Side.CLIENT)
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void getSubBlocks(Item item, CreativeTabs tab, List itemsList)
{
// Java bitches about raw types & types not being checked. Sorry, but the API sucks.
for (HiveType type : HiveType.values())
{
if (type.show || Config.forestryDebugEnabled)
{
itemsList.add(new ItemStack(this, 1, type.ordinal()));
}
}
}
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
{
return HiveType.getHiveFromMeta(metadata).getDrops(world, x, y, z, fortune);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister register)
{
HiveType.registerIcons(register);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta)
{
if (meta < 0 || meta > HiveType.values().length)
{
meta = 0;
}
return HiveType.getHiveFromMeta(meta).getIconForSide(side);
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
Block block = world.getBlock(x, y, z);
if (block.isAir(world, x, y, z))
{
return null;
}
Item item = Item.getItemFromBlock(block);
if (item == null)
{
return null;
}
return new ItemStack(item, 1, getDamageValue(world, x, y, z) & 7);
}
}
@@ -0,0 +1,114 @@
package magicbees.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.client.gui.UIScreens;
import magicbees.main.CommonProxy;
import magicbees.main.MagicBees;
import magicbees.main.utils.TabMagicBees;
import magicbees.tileentity.TileEntityMagicApiary;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import javax.swing.*;
public class BlockMagicApiary extends BlockContainer
{
@SideOnly(Side.CLIENT)
private IIcon[] icons;
public BlockMagicApiary()
{
super(Material.wood);
this.setCreativeTab(TabMagicBees.tabMagicBees);
this.setBlockName("magicApiary");
this.setHardness(1f);
this.setResistance(1.5f);
this.setHarvestLevel("axe", 0);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9 )
{
boolean activate = false;
if (!player.isSneaking())
{
player.openGui(MagicBees.object, UIScreens.THAUMIC_APIARY.ordinal(), world, x, y, z);
activate = true;
}
return activate;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta){
if (side == 0){
return icons[0];
}else if (side == 1){
return icons[1];
}else if (side == 2 || side == 3){
return icons[2];
}else{
return icons[4];
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister register)
{
icons = new IIcon[5];
icons[0] = register.registerIcon(CommonProxy.DOMAIN + ":thaumicapiary.0");
icons[1] = register.registerIcon(CommonProxy.DOMAIN + ":thaumicapiary.1");
icons[2] = register.registerIcon(CommonProxy.DOMAIN + ":thaumicapiary.2");
icons[4] = register.registerIcon(CommonProxy.DOMAIN + ":thaumicapiary.4");
}
@Override
public TileEntity createNewTileEntity(World world, int metadata) {
return new TileEntityMagicApiary();
}
@Override
public void breakBlock(World world, int x, int y, int z, Block block, int meta){
TileEntity te = world.getTileEntity(x, y, z);
if (te != null && te instanceof IInventory){
IInventory inventory = (IInventory)te;
for (int i = 0; i < inventory.getSizeInventory(); i++){
ItemStack itemStack = inventory.getStackInSlotOnClosing(i);
if (itemStack != null){
float spawnX = x + world.rand.nextFloat();
float spawnY = y + world.rand.nextFloat();
float spawnZ = z + world.rand.nextFloat();
EntityItem droppedItem = new EntityItem(world, spawnX, spawnY, spawnZ, itemStack);
float mult = 0.05F;
droppedItem.motionX = (-0.5F + world.rand.nextFloat()) * mult;
droppedItem.motionY = (4 + world.rand.nextFloat()) * mult;
droppedItem.motionZ = (-0.5F + world.rand.nextFloat()) * mult;
world.spawnEntityInWorld(droppedItem);
}
}
}
super.breakBlock(world, x, y, z, block, meta);
}
}
@@ -0,0 +1,68 @@
package magicbees.block;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.block.types.PlankType;
import magicbees.main.CommonProxy;
import magicbees.main.Config;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
public class BlockPlanks extends Block
{
@SideOnly(Side.CLIENT)
private IIcon[] IIcons;
public BlockPlanks()
{
super(Material.wood);
this.setHardness(2.5f);
this.setResistance(6.0f);
this.setCreativeTab(CreativeTabs.tabBlock);
if (Config.areMagicPlanksFlammable)
{
Blocks.fire.setFireInfo(this, 5, 20);
}
}
@Override
public int damageDropped(int meta)
{
return meta;
}
@SideOnly(Side.CLIENT)
@Override
public void getSubBlocks(Item item, CreativeTabs tab, List itemsList)
{
for (PlankType type : PlankType.values())
{
itemsList.add(new ItemStack(this, 1, type.ordinal()));
}
}
@SideOnly(Side.CLIENT)
@Override
public IIcon getIcon(int side, int meta)
{
return this.IIcons[Math.max(0, Math.min(meta & 7, IIcons.length - 1))];
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister par1IIconRegister)
{
this.IIcons = new IIcon[PlankType.values().length];
for (PlankType t : PlankType.values())
{
this.IIcons[t.ordinal()] = par1IIconRegister.registerIcon(CommonProxy.DOMAIN + ":" + t.name);
}
}
}
@@ -0,0 +1,49 @@
package magicbees.block;
import magicbees.main.CommonProxy;
import magicbees.main.utils.TabMagicBees;
import magicbees.tileentity.TileEntityVisAuraProvider;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockVisAuraProvider extends BlockContainer {
public BlockVisAuraProvider() {
super(Material.glass);
this.setCreativeTab(TabMagicBees.tabMagicBees);
this.setBlockName("visAuraProvider");
this.setHardness(0.5f);
this.setResistance(1.5f);
this.setLightLevel(8);
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
public TileEntity createNewTileEntity(World world, int metadata) {
return new TileEntityVisAuraProvider();
}
@Override
public int getRenderType()
{
return CommonProxy.RenderIdVisAuraProvider;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.blockIcon = Blocks.planks.getIcon(0, 5);
}
}
@@ -0,0 +1,105 @@
package magicbees.block;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.block.types.PlankType;
import magicbees.main.CommonProxy;
import magicbees.main.Config;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class BlockWoodSlab extends BlockSlab
{
@SideOnly(Side.CLIENT)
private IIcon[] icons;
public BlockWoodSlab(boolean doubleSlab)
{
super(doubleSlab, Material.wood);
this.setHardness(2.5f);
this.setResistance(6.0f);
this.setBlockName("tb.slab.wood");
this.setCreativeTab(CreativeTabs.tabBlock);
this.setLightOpacity(doubleSlab ? 255 : 0);
if (Config.areMagicPlanksFlammable)
{
Blocks.fire.setFireInfo(this, 5, 20);
}
}
@Override
public Item getItemDropped(int id, Random rand, int par3)
{
return Item.getItemFromBlock(Config.slabWoodHalf);
}
protected ItemStack createStackedBlock(int meta)
{
return new ItemStack(Config.planksWood, 1, meta & 7);
}
@Override
public String func_150002_b(int meta)
{
return this.getUnlocalizedName() + "." + PlankType.getType(meta).name;
}
@SideOnly(Side.CLIENT)
@Override
public void getSubBlocks(Item item, CreativeTabs tab, List itemsList)
{
for (PlankType type : PlankType.values())
{
itemsList.add(new ItemStack(this, 1, type.ordinal()));
}
}
@SideOnly(Side.CLIENT)
@Override
public IIcon getIcon(int side, int meta)
{
return this.icons[Math.max(0, Math.min(meta & 7, icons.length - 1))];
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister)
{
this.icons = new IIcon[PlankType.values().length];
for (PlankType t : PlankType.values())
{
this.icons[t.ordinal()] = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":" + t.name);
}
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
Block block = world.getBlock(x, y, z);
if (block.isAir(world, x, y, z))
{
return null;
}
Item item = Item.getItemFromBlock(block);
if (item == null)
{
return null;
}
return new ItemStack(item, 1, getDamageValue(world, x, y, z) & 7);
}
}
@@ -0,0 +1,16 @@
package magicbees.block;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
public class MaterialHive extends Material
{
public MaterialHive()
{
super(MapColor.stoneColor);
this.setImmovableMobility();
this.setRequiresTool();
}
}
@@ -0,0 +1,188 @@
package magicbees.block.types;
import java.util.ArrayList;
import magicbees.bees.BeeGenomeManager;
import magicbees.bees.BeeSpecies;
import magicbees.bees.HiveDrop;
import magicbees.item.types.CombType;
import magicbees.main.CommonProxy;
import magicbees.main.Config;
import magicbees.main.utils.compat.ForestryHelper;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.apiculture.IHiveDrop;
public enum HiveType
{
CURIOUS("curious", BeeSpecies.MYSTICAL, 12, true),
UNUSUAL("unusual", BeeSpecies.UNUSUAL, 12, true),
RESONANT("resonant", BeeSpecies.SORCEROUS, 12, true),
DEEP("deep", BeeSpecies.ATTUNED, 4, false),
INFERNAL("infernal", BeeSpecies.INFERNAL, 15, false),
OBLIVION("oblivion", BeeSpecies.OBLIVION, 7, false),
;
private static String[] nameList;
private String name;
private BeeSpecies occupant;
public boolean show;
private int lightLevel;
private ArrayList<IHiveDrop> drops;
@SideOnly(Side.CLIENT)
private IIcon[] icons;
public static HiveType getHiveFromMeta(int meta)
{
HiveType type = CURIOUS;
if (meta > 0 && meta < HiveType.values().length)
{
type = HiveType.values()[meta];
}
return type;
}
public static void initHiveData()
{
ItemStack[] combs = new ItemStack[] { Config.combs.getStackForType(CombType.MUNDANE) };
HiveDrop valiantDrop = new HiveDrop(BeeGenomeManager.addRainResist(ForestryHelper.getTemplateForestryForSpecies("Valiant")), combs, 5);
CURIOUS.drops.add(new HiveDrop(BeeSpecies.MYSTICAL.getGenome(), combs, 80).setIgnoblePercentage(0.7f));
CURIOUS.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.MYSTICAL.getGenome()), combs, 15));
CURIOUS.drops.add(valiantDrop);
UNUSUAL.drops.add(new HiveDrop(BeeSpecies.UNUSUAL.getGenome(), combs, 80).setIgnoblePercentage(0.7f));
UNUSUAL.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.UNUSUAL.getGenome()), combs, 15));
UNUSUAL.drops.add(valiantDrop);
RESONANT.drops.add(new HiveDrop(BeeSpecies.SORCEROUS.getGenome(), combs, 80).setIgnoblePercentage(0.7f));
RESONANT.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.SORCEROUS.getGenome()), combs, 20));
RESONANT.drops.add(valiantDrop);
DEEP.drops.add(new HiveDrop(BeeSpecies.ATTUNED.getGenome(), combs, 80).setIgnoblePercentage(0.65f));
DEEP.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.ATTUNED.getGenome()), combs, 20));
DEEP.drops.add(valiantDrop);
combs = new ItemStack[] { Config.combs.getStackForType(CombType.MOLTEN), new ItemStack(Items.glowstone_dust, 6) };
INFERNAL.drops.add(new HiveDrop(BeeSpecies.INFERNAL.getGenome(), combs, 80).setIgnoblePercentage(0.5f));
INFERNAL.drops.add(new HiveDrop(ForestryHelper.getTemplateForestryForSpecies("Steadfast"), combs, 3));
combs = new ItemStack[] { Config.combs.getStackForType(CombType.FORGOTTEN), new ItemStack(Items.ender_pearl, 1) };
OBLIVION.drops.add(new HiveDrop(BeeSpecies.OBLIVION.getGenome(), combs, 80));
OBLIVION.drops.add(new HiveDrop(ForestryHelper.getTemplateForestryForSpecies("Steadfast"), combs, 9));
}
private HiveType(String hiveName, BeeSpecies occupant, int light, boolean visible)
{
this.name = hiveName;
this.occupant = occupant;
this.lightLevel = light;
this.show = visible;
this.drops = new ArrayList<IHiveDrop>();
}
@SideOnly(Side.CLIENT)
public static void registerIcons(IIconRegister register)
{
for (HiveType type : HiveType.values())
{
type.icons = new IIcon[2];
type.icons[0] = register.registerIcon(CommonProxy.DOMAIN + ":beehive." + type.ordinal() + ".top");
type.icons[1] = register.registerIcon(CommonProxy.DOMAIN + ":beehive." + type.ordinal() + ".side");
}
}
@SideOnly(Side.CLIENT)
public IIcon getIconForSide(int side)
{
IIcon i = this.icons[0];
if (side != 0 && side != 1)
{
i = this.icons[1];
}
return i;
}
public int getLightValue()
{
return this.lightLevel;
}
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int fortune)
{
ArrayList<ItemStack> hiveDrops = new ArrayList<ItemStack>();
int dart;
// Get a princess.
int throttle = 0;
while (hiveDrops.size() <= 0 && throttle < 10)
{
++throttle;
dart = world.rand.nextInt(100);
for (IHiveDrop drop : drops)
{
if (dart <= drop.getChance(world, x, y, z))
{
hiveDrops.add(drop.getPrincess(world, x, y, z, fortune));
break;
}
}
}
// Get a drone, maybe.
dart = world.rand.nextInt(100);
for (IHiveDrop drop : drops)
{
if (dart <= drop.getChance(world, x, y, z))
{
hiveDrops.addAll(drop.getDrones(world, x, y, z, fortune));
break;
}
}
// Get additional drops.
dart = world.rand.nextInt(100);
for (IHiveDrop drop : drops)
{
if (dart <= drop.getChance(world, x, y, z))
{
hiveDrops.addAll(drop.getAdditional(world, x, y, z, fortune));
}
}
return hiveDrops;
}
public static String[] getAllNames()
{
return (nameList == null) ? nameList = generateNames() : nameList;
}
public BeeSpecies getOccupant() {
return this.occupant;
}
private static String[] generateNames()
{
String[] names = new String[values().length];
for (int i = 0; i < names.length; ++i)
{
names[i] = values()[i].name;
}
return names;
}
}
@@ -0,0 +1,45 @@
package magicbees.block.types;
public enum PlankType
{
GREATWOOD("greatwood", 48),
SILVERWOOD("silverwood", 49),
;
public String name;
public int textureIdx;
private static String[] nameList;
private PlankType(String n, int idx)
{
this.name = n;
this.textureIdx = idx;
}
public static PlankType getType(int meta)
{
PlankType type = null;
if (meta >= 0 && meta <= values().length)
{
type = values()[meta];
}
return type;
}
public static String[] getAllNames()
{
return (nameList == null) ? nameList = generateNames() : nameList;
}
private static String[] generateNames()
{
String[] names = new String[values().length];
for (int i = 0; i < names.length; ++i)
{
names[i] = values()[i].name;
}
return names;
}
}
@@ -0,0 +1,122 @@
package magicbees.client.gui;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.tileentity.TileEntityEffectJar;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerEffectJar extends Container
{
public TileEntityEffectJar jar;
public int lastBeeHealth = 0;
public int speciesColour = 0xffffff;
public ContainerEffectJar(TileEntityEffectJar tileEntityEffectJar, EntityPlayer player)
{
this.jar = tileEntityEffectJar;
this.addSlotToContainer(new SlotCustomItems(this.jar, 0, 80, 22, GameRegistry.findItemStack("Forestry", "beeDroneGE", 1)));
for (int i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 74 + i * 18));
}
}
for (int i = 0; i < 9; ++i)
{
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 132));
}
}
@Override
public void addCraftingToCrafters(ICrafting crafting)
{
super.addCraftingToCrafters(crafting);
crafting.sendProgressBarUpdate(this, 0, this.jar.currentBeeHealth);
crafting.sendProgressBarUpdate(this, 1, this.jar.currentBeeColour);
}
@Override
public void detectAndSendChanges()
{
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); ++i)
{
ICrafting crafting = (ICrafting)this.crafters.get(i);
if (this.lastBeeHealth != this.jar.currentBeeHealth)
{
crafting.sendProgressBarUpdate(this, 0, this.jar.currentBeeHealth);
this.lastBeeHealth = this.jar.currentBeeHealth;
}
if (this.speciesColour != this.jar.currentBeeColour)
{
crafting.sendProgressBarUpdate(this, 1, this.jar.currentBeeColour);
this.speciesColour = this.jar.currentBeeColour;
}
}
}
@Override
@SideOnly(Side.CLIENT)
public void updateProgressBar(int craftingId, int value)
{
if (craftingId == 0)
{
this.jar.currentBeeHealth = value;
}
else if (craftingId == 1)
{
this.jar.currentBeeColour = value;
}
}
@Override
public boolean canInteractWith(EntityPlayer entityplayer)
{
return this.jar.isUseableByPlayer(entityplayer);
}
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int slot)
{
Slot itemSlot = this.getSlot(slot);
boolean clearSlot = false;
if (itemSlot != null && itemSlot.getHasStack())
{
ItemStack srcStack = itemSlot.getStack();
if (slot == 0 && srcStack != null)
{
clearSlot = this.mergeItemStack(srcStack, 1, 36 + 1, false);
}
else
{
if (this.getSlot(0).isItemValid(srcStack))
{
clearSlot = this.mergeItemStack(srcStack, 0, 1, false);
}
}
}
if (clearSlot)
{
itemSlot.putStack(null);
}
itemSlot.onSlotChanged();
player.inventory.markDirty();
return null;
}
}
@@ -0,0 +1,30 @@
package magicbees.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
public class ContainerMB extends Container
{
protected final int PLAYER_INVENTORY_ROWS = 3;
protected final int PLAYER_INVENTORY_COLUMNS = 9;
public void addPlayerInventory(InventoryPlayer inventoryPlayer, int xStart, int yStart)
{
for (int x = 0; x < PLAYER_INVENTORY_COLUMNS; x++){
addSlotToContainer(new Slot(inventoryPlayer, x, xStart + 8 + 18 * x, yStart + 4 + PLAYER_INVENTORY_ROWS * 18));
}
for (int y = 0; y < PLAYER_INVENTORY_ROWS; y++){
for (int x = 0; x < PLAYER_INVENTORY_COLUMNS; x++){
addSlotToContainer(new Slot(inventoryPlayer, x + y * 9 + 9, xStart + 8 + 18 * x, yStart + y * 18));
}
}
}
@Override
public boolean canInteractWith(EntityPlayer entityPlayer) {
return true;
}
}
@@ -0,0 +1,125 @@
package magicbees.client.gui;
import forestry.api.apiculture.IHiveFrame;
import forestry.plugins.PluginApiculture;
import magicbees.main.utils.ItemInterface;
import magicbees.tileentity.TileEntityMagicApiary;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerMagicApiary extends ContainerMB {
public TileEntityMagicApiary apiary;
public int maxSlot = 0;
// Constants
private static final int SLOT_QUEEN = 0;
private static final int SLOT_DRONE = 1;
private static final int SLOT_FRAME_START = 2;
private static final int SLOT_INVENTORY_START = 5;
private static final int SLOT_FRAME_COUNT = 3;
private static final int SLOT_INVENTORY_COUNT = 7;
public ContainerMagicApiary(InventoryPlayer inventoryPlayer, TileEntityMagicApiary thaumicApiary){
this.apiary = thaumicApiary;
// Queen/Princess slot
addSlotToContainer(new SlotCustomItems(this.apiary, 0, 29, 39, ItemInterface.getItemStack("Forestry", "beeQueenGE", 1), ItemInterface.getItemStack("Forestry", "beePrincessGE", 1)));
// Drone slot
addSlotToContainer(new SlotCustomItems(this.apiary, 1, 29, 65, ItemInterface.getItemStack("Forestry", "beeDroneGE", 64)));
int currentSlot = 1;
// Frame slots
for (int x = 0; x < 3; x++){
currentSlot++;
addSlotToContainer(new SlotFrame(thaumicApiary, currentSlot, 66, 23 + x * 29));
//LogHelper.info("[1] CURRENTSLOT: " + currentSlot);
}
for (int x = 0; x < 3; x++){
currentSlot++;
addSlotToContainer(new Slot(thaumicApiary, currentSlot, 116, 26 + x * 26));
//LogHelper.info("[2] CURRENTSLOT: " + currentSlot);
}
int j = 0;
for (int y = 0; y < 2; y++){
for (int x = 0; x < 2; x++){
currentSlot++;
addSlotToContainer(new Slot(thaumicApiary, currentSlot, 95 + x * 42, 39 + j * 26));
//LogHelper.info("[3] CURRENTSLOT: " + currentSlot);
}
j++;
}
addPlayerInventory(inventoryPlayer, 0, 110);
maxSlot = currentSlot;
}
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int slotIndex){
Slot itemSlot = this.getSlot(slotIndex);
boolean clearSlot = false;
if (itemSlot != null && itemSlot.getHasStack()) {
ItemStack srcStack = itemSlot.getStack();
if (slotIndex <= maxSlot && srcStack != null){
clearSlot = this.mergeItemStack(srcStack, maxSlot + 1, maxSlot + 36, false);
}else{
if (slotIndex > maxSlot && srcStack != null){
if (PluginApiculture.beeInterface.isMember(srcStack)){
if (!PluginApiculture.beeInterface.isDrone(srcStack)){
if (this.getSlot(SLOT_QUEEN).getHasStack() == false) {
clearSlot = this.mergeItemStack(srcStack, SLOT_QUEEN, SLOT_QUEEN, false);
}
}else{
if (this.getSlot(SLOT_DRONE).isItemValid(srcStack)){
clearSlot = this.mergeItemStack(srcStack, SLOT_DRONE, SLOT_DRONE, false);
}
}
}else if(srcStack.getItem() instanceof IHiveFrame){
clearSlot = this.mergeItemStack(srcStack, SLOT_FRAME_START, SLOT_FRAME_START + SLOT_FRAME_COUNT, false);
}
}
}
}
if (clearSlot){
itemSlot.putStack(null);
}
itemSlot.onSlotChanged();
player.inventory.markDirty();
return null;
}
@Override
public boolean canInteractWith(EntityPlayer entityPlayer) {
return apiary.isUseableByPlayer(entityPlayer);
}
@Override
public void updateProgressBar(int i, int j) {
apiary.getGUINetworkData(i, j);
}
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (Object crafter : crafters) {
apiary.sendGUINetworkData(this, (ICrafting) crafter);
}
}
}
@@ -0,0 +1,65 @@
package magicbees.client.gui;
import magicbees.main.CommonProxy;
import magicbees.tileentity.TileEntityEffectJar;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
public class GUIEffectJar extends GuiContainer
{
public static final String BACKGROUND_FILE = "jarScreen.png";
public static final ResourceLocation BACKGROUND_LOCATION = new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.GUI_TEXTURE + "jarScreen.png");
private static final int WIDTH = 176;
private static final int HEIGHT = 156;
private static final int SLOT_JAR_X = 80;
private static final int SLOT_JAR_Y = 22;
private static final int SLOT_INVENTORY_X = 8;
private static final int SLOT_INVENTORY_Y = 74;
private static final int BAR_DEST_X = 117;
private static final int BAR_DEST_Y = 10;
private static final int BAR_SRC_X = 176;
private static final int BAR_SRC_Y = 0;
private static final int BAR_WIDTH = 10;
private static final int BAR_HEIGHT = 40;
public GUIEffectJar(TileEntityEffectJar jar, EntityPlayer player)
{
super(new ContainerEffectJar(jar, player));
this.xSize = WIDTH;
this.ySize = HEIGHT;
}
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2)
{
fontRendererObj.drawString("Inventory", 9, 63, 0);
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j)
{
GL11.glColor4f(1f, 1f, 1f, 1f);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_SRC_ALPHA);
this.mc.getTextureManager().bindTexture(BACKGROUND_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, xSize, ySize);
TileEntityEffectJar jar = ((ContainerEffectJar)this.inventorySlots).jar;
float r = ((jar.currentBeeColour >> 16) & 255) / 255f;
float g = ((jar.currentBeeColour >> 8) & 255) / 255f;
float b = (jar.currentBeeColour & 255) / 255f;
GL11.glColor3f(r, g, b);
int value = BAR_HEIGHT - (jar.currentBeeHealth * BAR_HEIGHT) / 100;
this.drawTexturedModalRect(this.guiLeft + BAR_DEST_X, this.guiTop + value + BAR_DEST_Y, BAR_SRC_X, BAR_SRC_Y, BAR_WIDTH, BAR_HEIGHT - value);
}
}
@@ -0,0 +1,48 @@
package magicbees.client.gui;
import magicbees.tileentity.TileEntityEffectJar;
import magicbees.tileentity.TileEntityMagicApiary;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;
public class GUIHandler implements IGuiHandler
{
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
Object value = null;
if (ID == UIScreens.EFFECT_JAR.ordinal())
{
value = new ContainerEffectJar((TileEntityEffectJar)world.getTileEntity(x, y, z), player);
}
else if (ID == UIScreens.THAUMIC_APIARY.ordinal())
{
TileEntityMagicApiary tileEntityThaumicApiary = (TileEntityMagicApiary) world.getTileEntity(x, y, z);
value = new ContainerMagicApiary(player.inventory, tileEntityThaumicApiary);
}
return value;
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
Object value = null;
if (ID == UIScreens.EFFECT_JAR.ordinal())
{
value = new GUIEffectJar((TileEntityEffectJar)world.getTileEntity(x, y, z), player);
}else if (ID == UIScreens.THAUMIC_APIARY.ordinal())
{
TileEntityMagicApiary tileEntityThaumicApiary = (TileEntityMagicApiary) world.getTileEntity(x, y, z);
value = new GuiMagicApiary(player.inventory, tileEntityThaumicApiary);
}
return value;
}
}
@@ -0,0 +1,35 @@
package magicbees.client.gui;
import java.util.Set;
import cpw.mods.fml.client.IModGuiFactory;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
public class GuiFactory implements IModGuiFactory
{
@Override
public void initialize(Minecraft minecraftInstance)
{
}
@Override
public Class<? extends GuiScreen> mainConfigGuiClass()
{
return ModGuiConfig.class;
}
@Override
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories()
{
return null;
}
@Override
public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element)
{
return null;
}
}
@@ -0,0 +1,143 @@
package magicbees.client.gui;
import magicbees.main.CommonProxy;
import magicbees.tileentity.TileEntityMagicApiary;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiMagicApiary extends GuiContainer
{
public static final ResourceLocation BACKGROUND_LOCATION = new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.GUI_TEXTURE + "apiary.png");
private static final int WIDTH = 176;
private static final int HEIGHT = 190;
private static final int LIFEBAR_WIDTH = 2;
private static final int LIFEBAR_HEIGHT = 46;
private static final int LIFEBAR_DEST_X = 21;
private static final int LIFEBAR_DEST_Y = 37;
private static final int LIFEBAR_SRC_Y = 0;
private static final int LIFEBAR_SRC_STAGE1_X = 184;
private static final int LIFEBAR_SRC_STAGE2_X = 182;
private static final int LIFEBAR_SRC_STAGE3_X = 180;
private static final int LIFEBAR_SRC_STAGE4_X = 178;
private static final int LIFEBAR_SRC_STAGE5_X = 176;
private static final int WORKBOOST_WIDTH = 16;
private static final int WORKBOOST_HEIGHT = 12;
private static final int WORKBOOST_DEST_X = 37;
private static final int WORKBOOST_DEST_Y = 18;
private static final int WORKBOOST_SRC_X = 176;
private static final int WORKBOOST_SRC_Y = 46;
private static final int DEATHBOOST_WIDTH = 11;
private static final int DEATHBOOST_HEIGHT = 13;
private static final int DEATHBOOST_DEST_X = 25;
private static final int DEATHBOOST_DEST_Y = 17;
private static final int DEATHBOOST_SRC_X = 176;
private static final int DEATHBOOST_SRC_Y = 58;
private static final int MUTATIONBOOST_WIDTH = 9;
private static final int MUTATIONBOOST_HEIGHT = 13;
private static final int MUTATIONBOOST_DEST_X = 15;
private static final int MUTATIONBOOST_DEST_Y = 17;
private static final int MUTATIONBOOST_SRC_X = 176;
private static final int MUTATIONBOOST_SRC_Y = 71;
private GuiButton mutationButton;
public GuiMagicApiary(InventoryPlayer inventoryPlayer, TileEntityMagicApiary thaumicApiary) {
super(new ContainerMagicApiary(inventoryPlayer, thaumicApiary));
this.xSize = WIDTH;
this.ySize = HEIGHT;
}
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2)
{
fontRendererObj.drawString("Inventory", 9, 99, 0);
}
@Override
protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y) {
GL11.glColor4f(1, 1, 1, 1);
this.mc.getTextureManager().bindTexture(BACKGROUND_LOCATION);
this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
TileEntityMagicApiary apiary = ((ContainerMagicApiary)this.inventorySlots).apiary;
drawLifebar(apiary);
drawWorkBoostIcon(apiary);
drawDeathRateIcon(apiary);
drawMutationIcon(apiary);
}
private void drawMutationIcon(TileEntityMagicApiary apiary) {
if (apiary.isMutationBoosted()) {
this.drawTexturedModalRect(this.guiLeft + MUTATIONBOOST_DEST_X, this.guiTop + MUTATIONBOOST_DEST_Y,
MUTATIONBOOST_SRC_X, MUTATIONBOOST_SRC_Y, MUTATIONBOOST_WIDTH, MUTATIONBOOST_HEIGHT);
}
}
private void drawDeathRateIcon(TileEntityMagicApiary apiary) {
if (apiary.isDeathRateBoosted()) {
this.drawTexturedModalRect(this.guiLeft + DEATHBOOST_DEST_X, this.guiTop + DEATHBOOST_DEST_Y,
DEATHBOOST_SRC_X, DEATHBOOST_SRC_Y, DEATHBOOST_WIDTH, DEATHBOOST_HEIGHT);
}
}
private void drawWorkBoostIcon(TileEntityMagicApiary apiary) {
if (apiary.isProductionBoosted()) {
this.drawTexturedModalRect(this.guiLeft + WORKBOOST_DEST_X, this.guiTop + WORKBOOST_DEST_Y,
WORKBOOST_SRC_X, WORKBOOST_SRC_Y, WORKBOOST_WIDTH, WORKBOOST_HEIGHT);
}
}
private void drawLifebar(TileEntityMagicApiary apiary) {
int value = LIFEBAR_HEIGHT - apiary.getHealthScaled(LIFEBAR_HEIGHT);
int lifebarSrc = getLifebarSrc(apiary);
this.drawTexturedModalRect(this.guiLeft + LIFEBAR_DEST_X, this.guiTop + value + LIFEBAR_DEST_Y,
lifebarSrc, LIFEBAR_SRC_Y, LIFEBAR_WIDTH, LIFEBAR_HEIGHT - value);
}
private int getLifebarSrc(TileEntityMagicApiary apiary) {
int value = apiary.getHealthScaled(5);
if (value >= 5) {
return LIFEBAR_SRC_STAGE1_X;
}
else if (value >= 4) {
return LIFEBAR_SRC_STAGE2_X;
}
else if (value >= 3) {
return LIFEBAR_SRC_STAGE3_X;
}
else if (value >= 2) {
return LIFEBAR_SRC_STAGE4_X;
}
else {
return LIFEBAR_SRC_STAGE5_X;
}
}
@Override
protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_) {
// TODO Auto-generated method stub
super.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_);
}
}
@@ -0,0 +1,21 @@
package magicbees.client.gui;
import cpw.mods.fml.client.config.GuiConfig;
import magicbees.main.Config;
import magicbees.main.utils.VersionInfo;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.config.ConfigElement;
import net.minecraftforge.common.config.Configuration;
public class ModGuiConfig extends GuiConfig
{
public ModGuiConfig(GuiScreen guiScreen)
{
super(guiScreen,
new ConfigElement(Config.configuration.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(),
VersionInfo.ModName,
false,
false,
GuiConfig.getAbridgedConfigPath(Config.configuration.toString()));
}
}
@@ -0,0 +1,101 @@
package magicbees.client.gui;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
/**
* @author MysteriousAges
*/
public class SlotCustomItems extends Slot
{
private List<ItemStack> items;
public SlotCustomItems(IInventory inventory, int slotIndex, int xPos, int yPos, ItemStack... items)
{
super(inventory, slotIndex, xPos, yPos);
this.items = new ArrayList<ItemStack>(items.length);
Collections.addAll(this.items, items);
}
/**
* @return List of valid ItemStacks
*/
public List<ItemStack> getValidItems()
{
return this.items;
}
public void addValidItem(ItemStack newItem)
{
boolean contains = false;
for (int i = 0; i < this.items.size(); ++i)
{
ItemStack s = this.items.get(i);
if (s.getItem() == newItem.getItem())
{
if (s.getItemDamage() == OreDictionary.WILDCARD_VALUE)
{
contains = true;
break;
}
else if (s.getItemDamage() == newItem.getItemDamage())
{
contains = true;
break;
}
}
}
if (!contains)
{
this.items.add(newItem);
}
}
/**
* @param removeItem ItemStack to remove.
*/
public void removeValidItem(ItemStack removeItem)
{
for (int i = 0; i < this.items.size(); ++i)
{
ItemStack s = this.items.get(i);
if (s.getItem() == removeItem.getItem())
{
if (s.getItemDamage() == OreDictionary.WILDCARD_VALUE)
{
this.items.remove(i);
break;
}
else if (s.getItemDamage() == removeItem.getItemDamage())
{
this.items.remove(i);
break;
}
}
}
}
@Override
public boolean isItemValid(ItemStack itemStack)
{
for (ItemStack item : this.items)
{
if (item != null && item.getItem() == itemStack.getItem())
{
if (item.getItemDamage() == itemStack.getItemDamage() || item.getItemDamage() == OreDictionary.WILDCARD_VALUE)
{
return true;
}
}
}
return false;
}
}
@@ -0,0 +1,29 @@
package magicbees.client.gui;
import forestry.api.apiculture.IHiveFrame;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
public class SlotFrame extends SlotCustomItems {
public SlotFrame(IInventory inventory, int slotIndex, int xPos, int yPos) {
super(inventory, slotIndex, xPos, yPos);
}
@Override
public boolean isItemValid(ItemStack itemStack){
if (itemStack == null){
return false;
}
if (!inventory.isItemValidForSlot(getSlotIndex(), itemStack)){
return false;
}
boolean flag = false;
if(itemStack.getItem() instanceof IHiveFrame){
flag = true;
}
return flag;
}
}
@@ -0,0 +1,7 @@
package magicbees.client.gui;
public enum UIScreens
{
EFFECT_JAR,
THAUMIC_APIARY,;
}
@@ -0,0 +1,39 @@
package magicbees.client.model;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.main.CommonProxy;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class ModelEffectJar
{
public static final ResourceLocation objFile = new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.MODEL + "effectJar.obj");
public static final ResourceLocation textureLocation = new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.MODEL + "jarTexture.png");
public static final ModelEffectJar model = new ModelEffectJar();
private IModelCustom effectJarObj;
public ModelEffectJar()
{
this.effectJarObj = AdvancedModelLoader.loadModel(objFile);
}
public void render()
{
this.effectJarObj.renderPart("jarLid");
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
this.effectJarObj.renderPart("jarBase");
GL11.glPopAttrib();
}
}
@@ -0,0 +1,40 @@
package magicbees.client.model;
import org.lwjgl.opengl.GL11;
import magicbees.main.CommonProxy;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelVisAuraProvider {
public static final ResourceLocation objFile = new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.MODEL + "visAuraConverter.obj");
public static final ResourceLocation textureLocation = new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.MODEL + "visAuraProvider.png");
public static final ModelVisAuraProvider model = new ModelVisAuraProvider();
private IModelCustom visAuraProviderObj;
public ModelVisAuraProvider() {
this.visAuraProviderObj = AdvancedModelLoader.loadModel(objFile);
}
public void render(long tick) {
GL11.glPushMatrix();
GL11.glRotated(Math.sin(tick * Math.PI * 2 / 80) * 0.7, 0, 1, 0);
GL11.glRotated(Math.sin((tick + 25) * Math.PI * 2 / 150) * 0.75, 0.5, 0, 0.5);
GL11.glTranslated(Math.sin(tick * Math.PI * 2 / 1000) * 0.025, 0, Math.sin((tick + 30) * Math.PI * 2 / 650) * 0.03);
float red = (float)(Math.sin(tick * Math.PI * 2 / 130) * 0.2 + 0.8);
float green = (float)(Math.cos((tick + 2) * Math.PI * 2 / 140) * 0.2 + 0.8);
float blue = (float)(Math.sin((tick + 5) * Math.PI * 2 / 99) * 0.2 + 0.8);
GL11.glColor3f(red, green, blue);
this.visAuraProviderObj.renderPart("centre");
GL11.glPopMatrix();
GL11.glColor3f(1f, 1f, 1f);
this.visAuraProviderObj.renderPart("frame");
}
}
@@ -0,0 +1,77 @@
package magicbees.client.render;
import cpw.mods.fml.client.FMLClientHandler;
import magicbees.client.model.ModelEffectJar;
import magicbees.tileentity.TileEntityEffectJar;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
public class RendererEffectJar extends TileEntitySpecialRenderer implements IItemRenderer
{
public static RendererEffectJar instance = new RendererEffectJar();
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick)
{
if (tileEntity instanceof TileEntityEffectJar)
{
this.doRender(x, y, z, 1f);
}
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
return true;
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
{
return true;
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
switch (type)
{
default:
case ENTITY:
doRender(0, 0, 0, 1.8f);
break;
case EQUIPPED:
doRender(0, 0, 0, 1.5f);
break;
case EQUIPPED_FIRST_PERSON:
doRender(-.5, .5, 0.25, 1f);
break;
case INVENTORY:
doRender(0.3, 0.25, 0.3, 1.5f);
break;
}
}
private void doRender(double x, double y, double z, float scale)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScaled(scale, scale, scale);
GL11.glTranslated(x, y, z);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ModelEffectJar.textureLocation);
ModelEffectJar.model.render();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}
@@ -0,0 +1,50 @@
package magicbees.client.render;
import magicbees.client.model.ModelVisAuraProvider;
import magicbees.tileentity.TileEntityVisAuraProvider;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class RendererVisAuraProvider extends TileEntitySpecialRenderer implements IItemRenderer {
public static RendererVisAuraProvider instance = new RendererVisAuraProvider();
@Override
public void renderTileEntityAt(TileEntity entity, double x, double y, double z, float tick) {
if (entity instanceof TileEntityVisAuraProvider) {
this.doRender(x, y, z, 1f, entity.getWorldObj().getTotalWorldTime());
}
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
return true;
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
return true;
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
doRender(0, 0, 0, 1f, 0);
}
private void doRender(double x, double y, double z, float scale, long tick) {
GL11.glPushMatrix();
GL11.glScaled(scale, scale, scale);
GL11.glTranslated(x, y, z);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ModelVisAuraProvider.textureLocation);
ModelVisAuraProvider.model.render(tick);
GL11.glPopMatrix();
}
}
@@ -1,4 +1,4 @@
package thaumicbees.item; package magicbees.item;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@@ -8,25 +8,29 @@ import forestry.api.apiculture.IArmorApiarist;
public class ItemArmorApiarist extends Item implements IArmorApiarist public class ItemArmorApiarist extends Item implements IArmorApiarist
{ {
public ItemArmorApiarist(int par1) public ItemArmorApiarist()
{ {
super(par1); super();
} }
public static int getNumberPiecesWorn(EntityPlayer player) public static int getNumberPiecesWorn(EntityPlayer player)
{ {
int count = 0; int count = 0;
if (wearsHelmet(player)) { if (wearsHelmet(player))
{
count++; count++;
} }
if (wearsChest(player)) { if (wearsChest(player))
{
count++; count++;
} }
if (wearsLegs(player)) { if (wearsLegs(player))
{
count++; count++;
} }
if (wearsBoots(player)) { if (wearsBoots(player))
{
count++; count++;
} }
@@ -56,4 +60,10 @@ public class ItemArmorApiarist extends Item implements IArmorApiarist
ItemStack armorItem = player.inventory.armorInventory[0]; ItemStack armorItem = player.inventory.armorInventory[0];
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist; return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
} }
@Override
public boolean protectPlayer(EntityPlayer player, ItemStack armor, String cause, boolean doProtect)
{
return false;
}
} }
@@ -0,0 +1,100 @@
package magicbees.item;
import java.util.List;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.item.types.CapsuleType;
import magicbees.item.types.FluidType;
import magicbees.main.CommonProxy;
import magicbees.main.utils.TabMagicBees;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
public class ItemCapsule extends Item
{
private CapsuleType capsuleType;
public ItemCapsule(CapsuleType type, int maxStackSize)
{
super();
this.capsuleType = type;
this.setCreativeTab(TabMagicBees.tabMagicBees);
this.setHasSubtypes(true);
this.setMaxStackSize(maxStackSize);
this.setUnlocalizedName("capsule." + type.toString().toLowerCase());
GameRegistry.registerItem(this, "capsule." + type.toString().toLowerCase());
}
public CapsuleType getType()
{
return this.capsuleType;
}
@Override
public String getItemStackDisplayName(ItemStack itemStack)
{
return String.format(this.capsuleType.getLocalizedName(), FluidType.values()[itemStack.getItemDamage()].getDisplayName());
}
public ItemStack getCapsuleForLiquid(FluidType l)
{
return new ItemStack(this, 1, l.ordinal());
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List itemList)
{
for (FluidType l : FluidType.values())
{
if (l.available)
{
itemList.add(new ItemStack(this, 1, l.ordinal()));
}
}
}
@Override
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses()
{
return true;
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":capsule" + this.capsuleType.getName().substring(0, 1).toUpperCase()
+ this.capsuleType.getName().substring(1));
for (FluidType t : FluidType.values())
{
if (t != FluidType.EMPTY && t.liquidIcon == null)
{
t.liquidIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":liquids/" + t.liquidID.toLowerCase());
}
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamageForRenderPass(int metadata, int pass)
{
IIcon i = this.itemIcon;
if (metadata != 0 && pass == 0)
{
i = FluidType.values()[Math.max(0, Math.min(metadata, FluidType.values().length - 1))].liquidIcon;
}
return i;
}
@Override
public int getRenderPasses(int metadata)
{
return (metadata == 0) ? 1 : 2;
}
}
+102
View File
@@ -0,0 +1,102 @@
package magicbees.item;
import java.util.List;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.item.types.CombType;
import magicbees.main.Config;
import magicbees.main.utils.compat.ForestryHelper;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import forestry.api.core.Tabs;
public class ItemComb extends Item
{
public ItemComb()
{
super();
this.setCreativeTab(Tabs.tabApiculture);
this.setHasSubtypes(true);
this.setUnlocalizedName("comb");
GameRegistry.registerItem(this, "comb");
}
public ItemStack getStackForType(CombType type)
{
return new ItemStack(this, 1, type.ordinal());
}
public ItemStack getStackForType(CombType type, int count)
{
return new ItemStack(this, count, type.ordinal());
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tabs, List list)
{
for (CombType type : CombType.values())
{
if (type.showInList || Config.forestryDebugEnabled)
{
list.add(this.getStackForType(type));
}
}
}
@Override
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses()
{
return true;
}
@Override
public int getRenderPasses(int meta)
{
return 2;
}
@SideOnly(Side.CLIENT)
private IIcon secondIcon;
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":beeCombs.0");
this.secondIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":beeCombs.1");
}
@Override
public IIcon getIcon(ItemStack stack, int pass)
{
return (pass == 0) ? itemIcon : secondIcon;
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack stack, int pass)
{
int meta = Math.max(0, Math.min(CombType.values().length - 1, stack.getItemDamage()));
int colour = CombType.values()[meta].getColours()[0];
if (pass >= 1)
{
colour = CombType.values()[meta].getColours()[1];
}
return colour;
}
@Override
public String getItemStackDisplayName(ItemStack stack)
{
return CombType.values()[stack.getItemDamage()].getName();
}
}
@@ -0,0 +1,61 @@
package magicbees.item;
import java.util.List;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.main.CommonProxy;
import magicbees.main.utils.LocalizationManager;
import magicbees.main.utils.TabMagicBees;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class ItemCrystalAspect extends Item
{
public ItemCrystalAspect()
{
super();
this.setCreativeTab(TabMagicBees.tabMagicBees);
this.setHasSubtypes(true);
this.setUnlocalizedName("crystalAspect");
GameRegistry.registerItem(this, "crystalAspect");
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List list)
{
/*for (EnumTag tag : EnumTag.values())
{
if (tag == EnumTag.UNKNOWN)
{
continue;
}
list.add(new ItemStack(this.itemID, 1, tag.id));
}*/
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":crystalAspect");
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack stack, int pass)
{
return 0;
//return EnumTag.get(stack.getItemDamage()).color;
}
@Override
public String getItemStackDisplayName(ItemStack stack)
{
return LocalizationManager.getLocalizedString("resource.crystalAspect");
//return String.format(LocalizationManager.getLocalizedString("resource.crystalAspect"), EnumTag.get(stack.getItemDamage()).name);
}
}
@@ -1,48 +1,34 @@
package thaumicbees.item; package magicbees.item;
import java.util.List; import java.util.List;
import thaumicbees.item.ItemComb.CombType; import cpw.mods.fml.common.registry.GameRegistry;
import thaumicbees.item.ItemPollen.PollenType;
import thaumicbees.main.CommonProxy;
import thaumicbees.main.ThaumicBees;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import magicbees.item.types.DropType;
import magicbees.main.utils.compat.ForestryHelper;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import forestry.api.core.Tabs;
public class ItemDrop extends Item public class ItemDrop extends Item
{ {
public enum DropType public ItemDrop()
{ {
ENCHANTED("Enchanting Drop", 0x6e1c6d, 0xff8fff), super();
INTELLECT("Intellect Drop", 0x25914D, 0x18E072), this.setCreativeTab(Tabs.tabApiculture);
;
private DropType(String pName, int colourA, int colourB)
{
this.name = pName;
this.combColour[0] = colourA;
this.combColour[1] = colourB;
}
public final String name;
public int[] combColour = new int[2];
}
public ItemDrop(int itemID)
{
super(itemID);
this.setTextureFile(CommonProxy.FORESTRY_GFX_ITEMS);
this.setCreativeTab(CreativeTabs.tabMaterials);
this.setHasSubtypes(true); this.setHasSubtypes(true);
this.setUnlocalizedName("drop");
GameRegistry.registerItem(this, "drop");
} }
public ItemStack getStackForType(DropType type) public ItemStack getStackForType(DropType type)
{ {
return new ItemStack(this, 1, type.ordinal()); return new ItemStack(this, 1, type.ordinal());
} }
public ItemStack getStackForType(DropType type, int count) public ItemStack getStackForType(DropType type, int count)
{ {
@@ -51,9 +37,8 @@ public class ItemDrop extends Item
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubItems(int id, CreativeTabs tabs, List list) public void getSubItems(Item item, CreativeTabs tabs, List list)
{ {
super.getSubItems(id, tabs, list);
for (DropType type : DropType.values()) for (DropType type : DropType.values())
{ {
list.add(this.getStackForType(type)); list.add(this.getStackForType(type));
@@ -72,17 +57,21 @@ public class ItemDrop extends Item
{ {
return 2; return 2;
} }
@SideOnly(Side.CLIENT)
private IIcon secondIcon;
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":honeyDrop.0");
this.secondIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":honeyDrop.1");
}
@Override @Override
public int getIconIndex(ItemStack stack, int pass) public IIcon getIcon(ItemStack stack, int pass)
{ {
int idx = 109; return (pass == 0) ? this.itemIcon : this.secondIcon;
// 109, 110 are the base forestry drop textures.
if (pass >= 1)
{
idx = 110;
}
return idx;
} }
@Override @Override
@@ -101,15 +90,9 @@ public class ItemDrop extends Item
} }
@Override @Override
public String getItemDisplayName(ItemStack stack) public String getItemStackDisplayName(ItemStack stack)
{ {
String result = ""; return DropType.values()[stack.getItemDamage()].getName();
int meta = stack.getItemDamage();
if (meta >= 0 && meta < DropType.values().length)
{
result = DropType.values()[meta].name;
}
return result;
} }
} }
@@ -0,0 +1,30 @@
package magicbees.item;
import magicbees.block.types.HiveType;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import forestry.core.items.ItemForestryBlock;
/**
* Created by Allen on 7/29/2014.
*/
public class ItemMagicHive extends ItemForestryBlock
{
public ItemMagicHive(Block block)
{
super(block);
}
@Override
public String getUnlocalizedName(ItemStack itemstack)
{
return getBlock().getUnlocalizedName() + "." + HiveType.getHiveFromMeta(itemstack.getItemDamage()).name().toLowerCase();
}
@Override
public String getItemStackDisplayName(ItemStack p_77653_1_)
{
return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(p_77653_1_) + ".name")).trim();
}
}
@@ -0,0 +1,129 @@
package magicbees.item;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.item.types.HiveFrameType;
import magicbees.main.CommonProxy;
import magicbees.main.utils.TabMagicBees;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IHiveFrame;
public class ItemMagicHiveFrame extends Item implements IHiveFrame
{
private HiveFrameType type;
public ItemMagicHiveFrame(HiveFrameType frameType)
{
super();
this.type = frameType;
this.setMaxDamage(this.type.maxDamage);
this.setMaxStackSize(1);
this.setCreativeTab(TabMagicBees.tabMagicBees);
this.setUnlocalizedName("frame" + frameType.getName());
GameRegistry.registerItem(this, "frame" + frameType.getName());
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":frame" + type.getName());
}
// --------- IHiveFrame functions -----------------------------------------
@Override
public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear)
{
return this.doWear(housing.getWorld(), housing.getXCoord(), housing.getYCoord(), housing.getZCoord(), frame, wear);
}
private ItemStack doWear(World w, int x, int y, int z, ItemStack frame, int wear)
{
int damage = wear;
frame.setItemDamage(frame.getItemDamage() + damage);
if (frame.getItemDamage() >= frame.getMaxDamage())
{
// Break the frame.
frame = null;
}
return frame;
}
@Override
public float getTerritoryModifier(IBeeGenome genome, float currentModifier)
{
return this.type.territoryMod;
}
@Override
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
{
return this.type.mutationMod;
}
@Override
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
{
return this.type.lifespanMod;
}
@Override
public float getProductionModifier(IBeeGenome genome, float currentModifier)
{
return this.type.productionMod;
}
@Override
public float getFloweringModifier(IBeeGenome genome, float currentModifier)
{
return this.type.floweringMod;
}
@Override
public boolean isSealed()
{
return this.type.isSealed;
}
@Override
public boolean isSelfLighted()
{
return this.type.isLit;
}
@Override
public boolean isSunlightSimulated()
{
return this.type.isSunlit;
}
@Override
public boolean isHellish()
{
return this.type.isHellish;
}
@Override
public float getGeneticDecay(IBeeGenome genome, float currentModifier)
{
return this.type.geneticDecayMod;
}
@Override
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2)
{
return false;
}
}
@@ -0,0 +1,75 @@
package magicbees.item;
import java.util.List;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.item.types.ResourceType;
import magicbees.main.CommonProxy;
import magicbees.main.utils.TabMagicBees;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
public class ItemMiscResources extends Item
{
private IIcon[] icons = new IIcon[ResourceType.values().length];
public ItemMiscResources()
{
super();
this.setCreativeTab(TabMagicBees.tabMagicBees);
this.setHasSubtypes(true);
this.setUnlocalizedName("miscResources");
GameRegistry.registerItem(this, "miscResources");
}
public ItemStack getStackForType(ResourceType type)
{
return new ItemStack(this, 1, type.ordinal());
}
public ItemStack getStackForType(ResourceType type, int count)
{
return new ItemStack(this, count, type.ordinal());
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tabs, List list)
{
for (ResourceType type : ResourceType.values())
{
if (type.showInList)
{
list.add(this.getStackForType(type));
}
}
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister)
{
for (int i = 0; i < ResourceType.values().length; i++)
{
this.icons[i] = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":" + ResourceType.values()[i].getName());
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int meta)
{
return icons[meta];
}
@Override
public String getItemStackDisplayName(ItemStack stack)
{
return ResourceType.values()[stack.getItemDamage()].getLocalizedName();
}
}
@@ -0,0 +1,60 @@
package magicbees.item;
import java.util.List;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.main.CommonProxy;
import magicbees.main.Config;
import magicbees.main.utils.MoonPhase;
import magicbees.main.utils.TabMagicBees;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
public class ItemMoonDial extends Item
{
@SideOnly(Side.CLIENT)
private IIcon[] icons;
public ItemMoonDial()
{
super();
this.setCreativeTab(TabMagicBees.tabMagicBees);
this.setUnlocalizedName("moonDial");
GameRegistry.registerItem(this, "moonDial");
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister)
{
this.icons = new IIcon[MoonPhase.values().length];
for (int i = 0; i < MoonPhase.values().length; ++i)
{
this.icons[i] = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":moonDial." + i);
}
this.itemIcon = this.icons[4];
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
{
return this.icons[MoonPhase.getMoonPhaseFromTime(player.worldObj.getWorldTime()).ordinal()];
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List infoList, boolean par4)
{
if (Config.moonDialShowsPhaseInText &&
entityPlayer.getCurrentEquippedItem() != null &&
entityPlayer.getCurrentEquippedItem().getItem() == this)
{
infoList.add("\u00A77" + MoonPhase.getMoonPhaseFromTime(entityPlayer.worldObj.getWorldTime()).getLocalizedName());
}
}
}
@@ -0,0 +1,205 @@
package magicbees.item;
import java.util.List;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.main.CommonProxy;
import magicbees.main.utils.LocalizationManager;
import magicbees.main.utils.TabMagicBees;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
public class ItemMysteriousMagnet extends Item
{
@SideOnly(Side.CLIENT)
private IIcon activeIcon;
private float rangeBase;
private float multiplier;
private int maxLevel;
private final float fudgeFactor = 0.2f;
public ItemMysteriousMagnet()
{
super();
this.setNoRepair();
this.setHasSubtypes(true);
this.rangeBase = 3f;
this.multiplier = 0.75f;
this.maxLevel = 8;
this.setUnlocalizedName(CommonProxy.DOMAIN + ":mysteriousMagnet");
this.setCreativeTab(TabMagicBees.tabMagicBees);
}
public void setBaseRange(float value)
{
this.rangeBase = value;
}
public void setLevelMultiplier(float value)
{
this.multiplier = value;
}
public void setMaximumLevel(int value)
{
this.maxLevel = value;
}
public int getMaximumLevel()
{
return this.maxLevel;
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4)
{
String s = LocalizationManager.getLocalizedString("misc.level", itemStack.getItemDamage() >> 1);
if (isMagnetActive(itemStack))
{
list.add(LocalizationManager.getLocalizedString("misc.magnetActive", s));
}
else
{
list.add(LocalizationManager.getLocalizedString("misc.magnetInactive", s));
}
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tabs, List list)
{
for (int i = 0; i <= this.maxLevel; i++)
{
list.add(new ItemStack(this, 1, i * 2));
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":magnetInactive");
this.activeIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":magnetActive");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int damage)
{
return isMagnetActive(damage) ? this.activeIcon : this.itemIcon;
}
@Override
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack itemStack, int pass)
{
return isMagnetActive(itemStack);
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
{
if (player.isSneaking())
{
itemStack.setItemDamage(itemStack.getItemDamage() ^ 1);
}
return itemStack;
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5)
{
if (isMagnetActive(itemStack) && entity instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer)entity;
int dragCount = player.getCommandSenderName().hashCode();
float radius = getRadius(itemStack.getItemDamage()) - fudgeFactor;
AxisAlignedBB bounds = player.boundingBox.expand(radius, radius, radius);
if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER)
{
bounds.expand(fudgeFactor, fudgeFactor, fudgeFactor);
if ((itemStack.getItemDamage() >> 1) >= 7)
{
List<EntityArrow> arrows = world.getEntitiesWithinAABB(EntityArrow.class, bounds);
for (EntityArrow arrow : arrows)
{
if (arrow.canBePickedUp == 1 && world.rand.nextInt(6) == 0)
{
EntityItem replacement = new EntityItem(world, arrow.posX, arrow.posY, arrow.posZ,
new ItemStack(Items.arrow));
world.spawnEntityInWorld(replacement);
}
world.removeEntity(arrow);
}
}
}
List<EntityItem> list = world.getEntitiesWithinAABB(EntityItem.class, bounds);
for (EntityItem e : list)
{
if (e.age >= 10)
{
double x = player.posX - e.posX;
double y = player.posY - e.posY;
double z = player.posZ - e.posZ;
double length = Math.sqrt(x * x + y * y + z * z) * 2;
x = x / length + player.motionX / 2;
y = y / length + player.motionY / 2;
z = z / length + player.motionZ / 2;
e.motionX = x;
e.motionY = y;
e.motionZ = z;
e.isAirBorne = true;
if (e.isCollidedHorizontally)
{
e.motionY += 1;
}
if (world.rand.nextInt(20) == 0)
{
float pitch = 0.85f - world.rand.nextFloat() * 3f / 10f;
world.playSoundEffect(e.posX, e.posY, e.posZ, "mob.endermen.portal", 0.6f, pitch);
}
}
}
}
}
private boolean isMagnetActive(ItemStack itemStack)
{
return isMagnetActive(itemStack.getItemDamage());
}
private boolean isMagnetActive(int damage)
{
return (damage & 0x01) == 1;
}
private float getRadius(int damageValue)
{
return this.rangeBase + (multiplier * (damageValue >> 1));
}
}
@@ -0,0 +1,75 @@
package magicbees.item;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.item.types.NuggetType;
import magicbees.main.CommonProxy;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
public class ItemNugget extends Item
{
@SideOnly(Side.CLIENT)
private IIcon[] icons;
public ItemNugget()
{
super();
this.setCreativeTab(CreativeTabs.tabMaterials);
this.setHasSubtypes(true);
this.setUnlocalizedName("beeNugget");
}
public ItemStack getStackForType(NuggetType type)
{
return new ItemStack(this, 1, type.ordinal());
}
public ItemStack getStackForType(NuggetType type, int count)
{
return new ItemStack(this, count, type.ordinal());
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List list)
{
for (NuggetType type : NuggetType.values())
{
if (type.isActive())
{
list.add(new ItemStack(item, 1, type.ordinal()));
}
}
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister)
{
this.icons = new IIcon[NuggetType.values().length];
for (int i = 0; i < NuggetType.values().length; i++)
{
this.icons[i] = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":nugget"
+ NuggetType.values()[i].name().substring(0, 1)
+ NuggetType.values()[i].name().substring(1).toLowerCase());
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int meta)
{
return icons[meta];
}
@Override
public String getItemStackDisplayName(ItemStack stack)
{
return NuggetType.values()[stack.getItemDamage()].getName();
}
}
@@ -0,0 +1,98 @@
package magicbees.item;
import java.util.List;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.item.types.PollenType;
import magicbees.main.utils.compat.ForestryHelper;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import forestry.api.core.Tabs;
public class ItemPollen extends Item
{
public ItemPollen()
{
super();
this.setCreativeTab(Tabs.tabApiculture);
this.setHasSubtypes(true);
this.setUnlocalizedName("pollen");
GameRegistry.registerItem(this, "pollen");
}
public ItemStack getStackForType(PollenType type)
{
return new ItemStack(this, 1, type.ordinal());
}
public ItemStack getStackForType(PollenType type, int count)
{
return new ItemStack(this, count, type.ordinal());
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tabs, List list)
{
for (PollenType type : PollenType.values())
{
list.add(this.getStackForType(type));
}
}
@Override
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses()
{
return true;
}
@Override
public int getRenderPasses(int metadata)
{
return 2;
}
@SideOnly(Side.CLIENT)
private IIcon secondIcon;
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":pollen.0");
this.secondIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":pollen.1");
}
@Override
public IIcon getIcon(ItemStack stack, int pass)
{
return (pass == 0) ? this.itemIcon : this.secondIcon;
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack stack, int pass)
{
int meta = Math.max(0, Math.min(PollenType.values().length - 1, stack.getItemDamage()));
int colour = PollenType.values()[meta].colour[0];
if (pass >= 1)
{
colour = PollenType.values()[meta].colour[1];
}
return colour;
}
@Override
public String getItemStackDisplayName(ItemStack stack)
{
return PollenType.values()[stack.getItemDamage()].getName();
}
}
@@ -0,0 +1,71 @@
package magicbees.item;
import java.util.List;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.item.types.PropolisType;
import magicbees.main.utils.compat.ForestryHelper;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import forestry.api.core.Tabs;
public class ItemPropolis extends Item
{
public ItemPropolis()
{
super();
this.setCreativeTab(Tabs.tabApiculture);
this.setHasSubtypes(true);
this.setUnlocalizedName("propolis");
GameRegistry.registerItem(this, "propolis");
}
public ItemStack getStackForType(PropolisType type)
{
return new ItemStack(this, 1, type.ordinal());
}
public ItemStack getStackForType(PropolisType type, int count)
{
return new ItemStack(this, count, type.ordinal());
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tabs, List list)
{
for (PropolisType type : PropolisType.values())
{
list.add(this.getStackForType(type));
}
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":propolis.0");
}
@Override
public int getColorFromItemStack(ItemStack stack, int pass)
{
int colour = 0xffffff;
int meta = stack.getItemDamage();
if (meta >= 0 && meta < PropolisType.values().length)
{
colour = PropolisType.values()[meta].colour;
}
return colour;
}
@Override
public String getItemStackDisplayName(ItemStack stack)
{
return PropolisType.values()[stack.getItemDamage()].getName();
}
}
@@ -0,0 +1,137 @@
package magicbees.item;
import magicbees.main.CommonProxy;
import magicbees.main.Config;
import magicbees.main.utils.compat.ThaumcraftHelper;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import thaumcraft.api.IRepairableExtended;
import thaumcraft.api.ThaumcraftApi;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.arboriculture.IToolGrafter;
@Optional.InterfaceList(
{
@Optional.Interface(iface = "thaumcraft.api.IRepairableExtended", modid = ThaumcraftHelper.Name, striprefs = true)
}
)
public class ItemThaumiumGrafter extends Item implements IRepairableExtended, IToolGrafter
{
public ItemThaumiumGrafter()
{
super();
this.setMaxStackSize(1);
this.setMaxDamage(15);
this.setCreativeTab(forestry.api.core.Tabs.tabArboriculture);
this.setUnlocalizedName("thaumiumGrafter");
this.setHarvestLevel("grafter", 3);
}
@Override
public float getSaplingModifier(ItemStack stack, World world, EntityPlayer player, int x, int y, int z)
{
return 100f;
}
@Override
public float func_150893_a(ItemStack itemStack, Block block)
{
return 1f;
}
@Override
public float getDigSpeed(ItemStack itemStack, Block block, int metadata)
{
return ForgeHooks.isToolEffective(itemStack, block, metadata) ? 4.8f : func_150893_a(itemStack, block);
}
@Override
public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, int x, int y, int z,
EntityLivingBase entityLiving)
{
int damage = 1;
if (block == Config.tcLeaf)
{
int meta = world.getBlockMetadata(x, y, z) & 1;
if (meta == 0 || meta == 1)
{
double chance = Math.random();
if (chance <= Config.thaumcraftSaplingDroprate)
{
this.dropItem(world, x, y, z, new ItemStack(Config.tcPlant, 1, meta));
}
}
}
itemstack.damageItem(damage, entityLiving);
return true;
}
private void dropItem(World world, int x, int y, int z, ItemStack item)
{
if (!world.isRemote && world.getGameRules().getGameRuleBooleanValue("doTileDrops"))
{
float f = 0.7F;
double d0 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
double d1 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
double d2 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
EntityItem entityitem = new EntityItem(world, (double)x + d0, (double)y + d1, (double)z + d2, item);
entityitem.delayBeforeCanPickup = 10;
world.spawnEntityInWorld(entityitem);
}
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
@Optional.Method(modid = ThaumcraftHelper.Name)
public int getItemEnchantability()
{
return ThaumcraftApi.toolMatThaumium.getEnchantability();
}
/**
* Return the name for this tool's material.
*/
@Optional.Method(modid = ThaumcraftHelper.Name)
public String getToolMaterialName()
{
return ThaumcraftApi.toolMatThaumium.toString();
}
/**
* Return whether this item is repairable in an anvil.
*/
@Optional.Method(modid = ThaumcraftHelper.Name)
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return ThaumcraftApi.toolMatThaumium.customCraftingMaterial == par2ItemStack.getItem() || super.getIsRepairable(par1ItemStack, par2ItemStack);
}
@Override
public boolean doRepair(ItemStack stack, EntityPlayer player, int enchantLevel)
{
boolean flag = false;
if (stack.getItemDamage() > 0)
{
flag = true;
player.addExhaustion(0.6f * (enchantLevel * enchantLevel));
}
return flag;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":thaumiumGrafter");
}
}
@@ -0,0 +1,89 @@
package magicbees.item;
import magicbees.main.CommonProxy;
import magicbees.main.utils.compat.ThaumcraftHelper;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import thaumcraft.api.IRepairable;
import thaumcraft.api.ThaumcraftApi;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.core.IToolScoop;
@Optional.InterfaceList(
{
@Optional.Interface(iface = "thaumcraft.api.IRepairable", modid = ThaumcraftHelper.Name, striprefs = true)
}
)
public class ItemThaumiumScoop extends Item implements IRepairable, IToolScoop
{
public ItemThaumiumScoop()
{
super();
this.setMaxStackSize(1);
this.setMaxDamage(30);
this.setCreativeTab(forestry.api.core.Tabs.tabApiculture);
this.setUnlocalizedName("thaumiumScoop");
this.setHarvestLevel("scoop", 3);
}
@Override
public float func_150893_a(ItemStack itemStack, Block block)
{
return 1f;
}
@Override
public float getDigSpeed(ItemStack itemStack, Block block, int metadata)
{
return ForgeHooks.isToolEffective(itemStack, block, metadata) ? 4.8f : func_150893_a(itemStack, block);
}
@Override
public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, int j, int k, int l,
EntityLivingBase entityliving)
{
itemstack.damageItem(1, entityliving);
return true;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
@Optional.Method(modid = ThaumcraftHelper.Name)
public int getItemEnchantability()
{
return ThaumcraftApi.toolMatThaumium.getEnchantability();
}
/**
* Return the name for this tool's material.
*/
@Optional.Method(modid = ThaumcraftHelper.Name)
public String getToolMaterialName()
{
return ThaumcraftApi.toolMatThaumium.toString();
}
/**
* Return whether this item is repairable in an anvil.
*/
@Optional.Method(modid = ThaumcraftHelper.Name)
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return ThaumcraftApi.toolMatThaumium.customCraftingMaterial == par2ItemStack.getItem() || super.getIsRepairable(par1ItemStack, par2ItemStack);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":thaumiumScoop");
}
}
+83
View File
@@ -0,0 +1,83 @@
package magicbees.item;
import java.util.List;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.item.types.WaxType;
import magicbees.main.CommonProxy;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import forestry.api.core.Tabs;
public class ItemWax extends Item
{
@SideOnly(Side.CLIENT)
private IIcon secondaryIcon;
public ItemWax()
{
super();
this.setCreativeTab(Tabs.tabApiculture);
this.setHasSubtypes(true);
this.setUnlocalizedName("wax");
GameRegistry.registerItem(this, "wax");
}
public ItemStack getStackForType(WaxType type)
{
return new ItemStack(this, 1, type.ordinal());
}
public ItemStack getStackForType(WaxType type, int count)
{
return new ItemStack(this, count, type.ordinal());
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":wax.0");
this.secondaryIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":wax.1");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int meta)
{
return (WaxType.values()[meta].sparkly) ? this.itemIcon : this.secondaryIcon;
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tabs, List list)
{
for (WaxType type : WaxType.values())
{
list.add(this.getStackForType(type));
}
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack stack, int pass)
{
int colour = 0xffffff;
int meta = stack.getItemDamage();
if (meta >= 0 && meta < WaxType.values().length)
{
colour = WaxType.values()[meta].colour;
}
return colour;
}
@Override
public String getItemStackDisplayName(ItemStack stack)
{
return WaxType.values()[stack.getItemDamage()].getName();
}
}
@@ -0,0 +1,30 @@
package magicbees.item.types;
import magicbees.main.utils.LocalizationManager;
public enum CapsuleType
{
MAGIC("magic", 2000, 0),
VOID("void", 8000, 1),
;
private String name;
public int capacity;
public int iconIdx;
private CapsuleType(String n, int c, int idx)
{
this.name = n;
this.capacity = c;
this.iconIdx = idx;
}
public String getName()
{
return this.name;
}
public String getLocalizedName()
{
return LocalizationManager.getLocalizedString("capsule." + name);
}
}
@@ -0,0 +1,100 @@
package magicbees.item.types;
import magicbees.main.utils.LocalizationManager;
public enum CombType
{
MUNDANE("mundane", true),
MOLTEN("molten", true),
OCCULT("occult", true),
OTHERWORLDLY("otherworldly", true),
TRANSMUTED("transmuted", true),
PAPERY("paper", true),
SOUL("soul", true),
FURTIVE("furtive", false),
INTELLECT("aware", false),
TEMPORAL("time", false),
FORGOTTEN("forgotten", false),
AIRY("air", false),
FIREY("fire", false),
WATERY("water", false),
EARTHY("earth", false),
TC_AIR("TCair", false),
TC_FIRE("TCfire", false),
TC_WATER("TCwater", false),
TC_EARTH("TCearth", false),
TC_ORDER("TCorder", false),
TC_CHAOS("TCchaos", false),
AM_ESSENCE("essence", false),
AM_POTENT("potent", false),
TE_DESTABILIZED("TEelectric", false),
TE_CARBON("TEcarbon", false),
TE_LUX("TElux", false),
TE_ENDEARING("TEendearing", false),
;
private static int[][] colours = new int[][] {
{ 0xFF9859, 0xFFC58E },
{ 0xcc3333, 0x1E160E },
{ 0x9872FF, 0x2D2D2D },
{ 0x3EE0D8, 0x3A3820 },
{ 0xE5425D, 0x323291 },
{ 0xBCA664, 0x35332E },
{ 0x7F7171, 0x876D53 },
{ 0xB7ACB7, 0x636363 },
{ 0x0092e9, 0x618fff },
{ 0x2F9381, 0x773C31 },
{ 0xB191D8, 0x35443B },
{ 0xffff7e, 0x606308 },
{ 0xff3C01, 0x5B0D10 },
{ 0x0090ff, 0x102F6B },
{ 0x00a000, 0x043004 },
{ 0xFFDF14, 0x707019 },
{ 0xE21802, 0x3F0E12 },
{ 0x00B6FF, 0x0F373D },
{ 0x28D328, 0x333004 },
{ 0xDDDDFF, 0x9D9DB5 },
{ 0x555577, 0x2D2D56 },
{ 0xCC8604, 0x41046F },
{ 0xCCCC04, 0x41046F },
{ 0xCC002C, 0x6B0118 },
{ 0x454545, 0x0F0F0F },
{ 0xF5F3A4, 0xC9C87D },
{ 0x12E3D9, 0x069E97 },
};
private CombType(String pName, boolean show)
{
this.name = pName;
this.showInList = show;
}
public void setHidden()
{
this.showInList = false;
}
private String name;
public boolean showInList;
public String getName()
{
return LocalizationManager.getLocalizedString("comb." + this.name);
}
public int[] getColours()
{
return colours[this.ordinal()];
}
}
@@ -0,0 +1,30 @@
package magicbees.item.types;
import magicbees.main.utils.LocalizationManager;
public enum DropType
{
ENCHANTED("enchanting", 0x6e1c6d, 0xff8fff),
INTELLECT("intellect", 0x25914D, 0x18E072),
DESTABILIZED("destabilized", 0xCC002C, 0x6B0118),
CARBON("carbon", 0x454545, 0x0F0F0F),
LUX("lux", 0xF5F3A4, 0xC9C87D),
ENDEARING("endearing", 0x12E3D9, 0x069E97),
;
private DropType(String pName, int colourA, int colourB)
{
this.name = pName;
this.combColour[0] = colourA;
this.combColour[1] = colourB;
}
private final String name;
public int[] combColour = new int[2];
public String getName()
{
return LocalizationManager.getLocalizedString("drop." + this.name);
}
}
@@ -0,0 +1,56 @@
package magicbees.item.types;
import magicbees.main.utils.LocalizationManager;
import net.minecraft.util.IIcon;
public enum FluidType
{
// Incidentally, Item meta is the liquid ID.
// Args are: forgeLiquidID, Display Name, Icon idx
EMPTY(""),
// Vanilla
WATER("water"),
LAVA("lava"),
// Forestry
BIOMASS("biomass"),
ETHANOL("bioethanol"),
// Buildcraft
OIL("oil"),
FUEL("fuel"),
// More Forestry
SEEDOIL("seedoil"),
HONEY("honey"),
JUICE("juice"),
CRUSHEDICE("ice"),
MILK("milk"),
// ExtraBees liquids
ACID("acid"),
POISON("poison"),
LIQUIDNITROGEN("liquidnitrogen"),
DNA("liquiddna"),
// Railcraft
CREOSOTEOIL("creosote"),
STEAM("steam"),
;
public String liquidID;
public int iconIdx;
public boolean available = false;
public IIcon liquidIcon;
private FluidType(String l)
{
this.liquidID = l;
}
public String getDisplayName()
{
return LocalizationManager.getLocalizedString("liquid." + liquidID);
}
}
@@ -0,0 +1,64 @@
package magicbees.item.types;
import magicbees.main.utils.LocalizationManager;
public enum HiveFrameType
{
MAGIC("Magic", 240, 1f, 1f, 1f, 2f, 0.6f),
RESILIENT("Resilient", 800, 1f, 1f, 1f, 2f, 0.5f),
GENTLE("Gentle", 200, 1f, 0.7f, 1.5f, 1.4f, 0.01f),
METABOLIC("Metabolic", 130, 1f, 1.8f, 1f, 1.2f, 1f),
NECROTIC("Necrotic", 280, 1f, 1f, 0.3f, 0.75f, 1.2f),
TEMPORAL("Temporal", 300, 1f, 1f, 2.5f, 1f, 0.8f),
OBLIVION("Oblivion", 50, 1f, 1f, 0.0001f, 0f, 1f),
;
private HiveFrameType(String name, int damage,
float territory, float mutation, float lifespan, float production, float geneticDecay)
{
this(name, damage, territory, mutation, lifespan, production, 1f, geneticDecay, false, false, false, false);
}
private HiveFrameType(String name, int damage,
float territory, float mutation, float lifespan, float production, float flowering, float geneticDecay,
boolean sealed, boolean lit, boolean sunlit, boolean hellish)
{
this.frameName = name;
this.maxDamage = damage;
this.territoryMod = territory;
this.mutationMod = mutation;
this.lifespanMod = lifespan;
this.productionMod = production;
this.floweringMod = flowering;
this.geneticDecayMod = geneticDecay;
this.isSealed = sealed;
this.isLit = lit;
this.isSunlit = sunlit;
this.isHellish = hellish;
}
private String frameName;
public int maxDamage;
public float territoryMod;
public float mutationMod;
public float lifespanMod;
public float productionMod;
public float floweringMod;
public float geneticDecayMod;
public boolean isSealed;
public boolean isLit;
public boolean isSunlit;
public boolean isHellish;
public String getName()
{
return this.frameName;
}
public String getLocalizedName()
{
return LocalizationManager.getLocalizedString("frame." + this.frameName);
}
}
@@ -0,0 +1,51 @@
package magicbees.item.types;
import magicbees.main.utils.LocalizationManager;
import net.minecraft.item.Item;
public enum NuggetType
{
IRON,
COPPER,
TIN,
SILVER,
LEAD,
DIAMOND,
EMERALD,
APATITE,
;
private Item targetIngot;
private boolean active;
private NuggetType()
{
this.active = true;
}
public void setIngotItem(Item target)
{
this.targetIngot = target;
}
public Item getIngotItem()
{
return this.targetIngot;
}
public void setInactive()
{
this.active = false;
}
public boolean isActive()
{
return this.active;
}
public String getName()
{
return LocalizationManager.getLocalizedString("nugget." + this.toString().toLowerCase());
}
}
@@ -0,0 +1,25 @@
package magicbees.item.types;
import magicbees.main.utils.LocalizationManager;
public enum PollenType
{
UNUSUAL("unusual", 0xD8417B, 0xA03059),
PHASED("phased", 0x4974B4, 0x456BA5),
;
private PollenType(String pName, int colourA, int colourB)
{
this.name = pName;
this.colour[0] = colourA;
this.colour[1] = colourB;
}
private String name;
public int[] colour = new int[2];
public String getName()
{
return LocalizationManager.getLocalizedString("pollen." + this.name);
}
}
@@ -0,0 +1,30 @@
package magicbees.item.types;
import magicbees.main.utils.LocalizationManager;
public enum PropolisType
{
UNSTABLE("unstable", 0xEFB492),
AIR("air", 0xA19E10),
FIRE("fire", 0x95132F),
WATER("water", 0x1054A1),
EARTH("earth", 0x00a000),
ORDER("dull", 0xDDDDFF),
CHAOS("magic", 0x555577),
;
private PropolisType(String pName, int overlayColour)
{
this.name = pName;
this.colour = overlayColour;
}
private String name;
public int colour;
public String getName()
{
return LocalizationManager.getLocalizedString("propolis." + this.name);
}
}
Loaded 100 of 330 files, more files were not shown because too many files have changed in this diff. Show more