Compare commits

..
324 Commits
Author SHA1 Message Date
Armisael5 24e473018e Fix empowering bee not seeing nodes correctly (#71) 2026-11-20 09:40:45 -05:00
d635a7a406 Protect some calls that lead to loadChunk with blockExists (#53)
Co-authored-by: Martin Robertz <[email protected]>
Co-authored-by: micvog <[email protected]>
2026-11-14 18:54:46 +01:00
UltraProdigy f82ed6358a ci: run build and test on release branches 2026-11-09 01:10:46 -05:00
Armisael5 1ed50ed660 Fix apiary crash (#70) 2026-11-01 06:15:52 -06:00
Yucheng-0909 f38854d65e Fix Thaumaturge's Backpack T2 English name (#69) 2026-10-28 07:47:23 +01:00
boubou19 53d085d292 Cache more enum .values() (#67) 2026-08-11 02:54:09 +02:00
boubou19 4345981958 Cache enum .values() (#66) 2026-08-10 21:01:38 +02:00
__felix__andgithub-actions[bot] 1dd3f7342e fix gt loader check (#64)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-29 11:53:40 -04:00
Eldrinn-Elantey f88d1f8c96 Fix magic apiary GUI bypassing claim protection (#63) 2026-05-04 16:39:06 +02:00
Ranzu 59aa1ce79c Fix gui crop and localize Inventory title (#61) 2026-04-13 19:24:25 +02:00
Ranzu d571f64b14 Un-hide Hives (#62) 2026-04-13 17:32:48 +02:00
Martin Robertz f3cf6407cf update+gradle+deps+bs 2026-03-10 20:03:01 +01:00
EricC808andMartin Robertz e3460d5dbc Clarified tool tip for each blood frame to reflect actual use (#58)
Co-authored-by: Martin Robertz <[email protected]>
2026-03-09 23:32:27 -04:00
UltraProdigy d9a7759c49 Optimize Image & Workflow (#60) 2026-03-07 10:31:15 +01:00
Alexdoru 7c38b1101a cache frequent enum.values() calls (#59) 2026-03-04 16:28:06 +00:00
SST-03 9ce571f464 use AspectList.remove instead of AspectList.reduce to fix "sometimes drainer doesn't work with essentia import bus" (#56) 2026-02-02 20:38:45 +01:00
Martin Robertz f881470241 update 2025-11-05 18:15:32 +01:00
koolkrafter5 d4bd32c67b Add hint text for Tempus (#57) 2025-11-05 06:52:38 +00:00
Martin Robertz 60607bc521 update 2025-10-02 01:13:16 +02:00
Martin Robertz 2e7e1a3efc update 2025-06-08 10:51:18 +02:00
Nikolay S. 0bd57ed988 Add missing equals sign. (#55) 2025-06-08 05:31:53 +00:00
Martin Robertz eccceab233 update 2025-05-16 22:03:38 +02:00
Caedis e5d696f210 Replace Baubles with Baubles Expanded (#54) 2025-05-13 07:42:13 -05:00
Martin Robertz 0f59e8b4ef update 2025-03-22 12:32:24 +01:00
Yannick Marcotte-Gourde 7248bac5d0 Give Enchanted Earth some minimal hardness (#52) 2025-03-22 12:26:03 +01:00
Maya 81cb972fff update 2025-02-25 21:11:41 -06:00
FrostyFire1 9589da0f00 Fix hibeescus mana drain (#51) 2025-02-25 21:11:31 -06:00
Dream Master b5cf82b574 update 2025-01-02 13:32:42 +01:00
mM4riandMartin Robertz c4cb9a19c6 Fix crash for crumbling/transmuting effect if effect range is 0 (#49)
Co-authored-by: Martin Robertz <[email protected]>
2025-01-02 12:05:18 +01:00
glowredman 8fb3407357 Add Localizations (#50) 2025-01-02 12:03:06 +01:00
Martin Robertz 001f1b27f6 update 2024-09-12 08:22:10 +02:00
chochem 6429eea5d6 Merge pull request #48 from chochem/add-null-check
Add a couple of null checks
2024-09-11 18:27:58 +01:00
chochem 3ff6e91053 second null check 2024-09-11 18:07:25 +01:00
chochem cdf3046e61 sa 2024-09-11 17:59:35 +01:00
chochem 05476997e1 add null check to allow duplicate apatite removal 2024-09-11 17:58:27 +01:00
boubou19 c2cafd4a98 Merge pull request #47 from GTNewHorizons/rename
The renaming
2024-09-03 16:52:03 +02:00
NotAPenguin e9606af217 rename 2024-09-03 14:43:39 +02:00
Dream Master c3abd86907 update 2024-07-06 12:52:27 +07:00
Martin Robertz ddac6aeb67 Merge pull request #46 from Quantumlyy/patch-bee-speed-modifier
Patch production multiplier to account for difficulty and genome
2024-07-06 10:36:48 +07:00
Quantumlyy 31c130ebae adjust modifier calculations 2024-07-03 15:06:42 +02:00
Martin Robertz 77d5bcf6d1 update 2024-05-31 19:52:13 +02:00
Martin Robertz b43e100d6f Merge pull request #45 from ClassixX/master
Update MagicApiaryInventory.java
2024-05-31 19:51:01 +02:00
ClassixX 3483b613aa Update MagicApiaryInventory.java
Changed sidedness to match forestry apiary and fixed canExtractItem to return true for the product slots
2024-05-29 20:09:36 +02:00
Martin Robertz 9919f54cc8 update 2024-05-13 17:16:45 +02:00
Martin Robertz c4835b735a Merge pull request #44 from kappa-maintainer/master
Apply same GTNH coremod check to bee product
2024-05-13 12:10:56 +02:00
kappa-maintainer e035bdb914 Make BeeProductHelper checks gtnh 2024-05-13 09:54:31 +00:00
Martin Robertz dcaf57b506 update 2024-04-24 21:53:39 +02:00
Alastors 6b34a53afa Merge pull request #42 from GTNewHorizons/fixSucc 2024-04-24 15:24:15 -04:00
Alastors e990776988 fix the succ 2024-04-24 00:27:24 -04:00
Raven Szewczyk 53e83a0c1a [ci skip] upgraded build system 2024-02-04 20:00:02 +00:00
Martin Robertz 3c39529c6f update deps 2024-02-04 15:17:16 +01:00
Martin Robertz 774defd118 Merge pull request #38 from kamenskyi/patch-1
Update ru_RU.lang
2024-02-04 15:16:26 +01:00
kamenskyi 6b5b6b0efe Update ru_RU.lang
fix ru mistakes
2024-02-02 22:28:36 +03:00
Martin Robertz 41a0528d2a update bs+deps 2024-02-02 15:34:18 +01:00
Martin Robertz eb05b5c1eb Merge pull request #39 from AnrDaemon/fix-lang-refs
Fixed Thaumonomicon pages references
2024-02-02 05:21:36 +01:00
AnrDaemon 2f1bd92b33 Fixed thaumonomicon pages references 2024-02-02 02:43:02 +03:00
kamenskyi 3be904d27d Update ru_RU.lang
fix ru mistakes
2024-02-01 17:48:29 +03:00
kamenskyi 08b1b9b456 Update ru_RU.lang
fix
2024-01-30 12:59:27 +03:00
kamenskyi 6467ba4612 Update ru_RU.lang
fix ru mistakes, add blood mamic and botania
2024-01-30 12:43:43 +03:00
Martin Robertz 09dc0657ef update deps 2024-01-29 07:23:03 +01:00
Martin Robertz dcfa448af3 Merge pull request #37 from Quantumlyy/drainer-energistics
Add Thaumic Energistics support to the Apimancers drainer
2024-01-28 19:55:12 +01:00
Martin Robertz 786cb01b94 Merge pull request #35 from kamenskyi/add_ru_lang_file
Update ru_RU.lang
2024-01-28 18:38:11 +01:00
Quantumlyy f6f4a988af move theapi init to postinit 2024-01-28 18:13:39 +01:00
kamenskyi 5a823658ea Update ru_RU.lang
fix ru mistakes
2024-01-28 20:04:58 +03:00
Quantumlyy 8770492524 register drainer with ThEApi 2024-01-28 18:00:38 +01:00
Martin Robertz 322203ac6a Merge branch 'master' into drainer-energistics 2024-01-28 11:34:14 +01:00
Quantumlyy 1e5c8db826 sa 2024-01-28 11:30:17 +01:00
Quantumlyy ef47b1863a call normal updateentity 2024-01-28 11:18:16 +01:00
Martin Robertz c3dac80d44 update deps 2024-01-28 11:12:31 +01:00
Quantumlyy f2beaae45c this should make it work with TE now 2024-01-28 11:03:49 +01:00
Martin Robertz 3a4e4dce04 Merge pull request #34 from Quantumlyy/bring-closer-to-forestry
Add Apimancers Drainer
2024-01-28 09:39:48 +01:00
Alastors 99c3cb68eb minor cleanup 2024-01-28 02:49:57 -05:00
Alastors 38bc8a151c fixing the block side 2024-01-28 02:38:26 -05:00
Quantumlyy a64bd5f437 check that block side is not top 2024-01-27 11:36:09 +01:00
Quantumlyy fb43f46bb8 fix: check for gtnh coremod to determine drainer functionality 2024-01-27 11:22:20 +01:00
Quantumlyy 9d2c667c35 the grand rename 2024-01-21 21:01:57 +01:00
Quantumlyy 67dfeb7daa requested changes 2024-01-21 20:55:21 +01:00
Quantumlyy e2080bc542 sa 2024-01-21 20:55:01 +01:00
Quantumlyy b0116884f1 GTu no transitive 2024-01-21 20:47:26 +01:00
Quantumlyy a9948fcf26 sa 2024-01-21 20:37:50 +01:00
Quantumlyy 828231c3c4 Merge branch 'bring-closer-to-forestry' of https://github.com/Quantumlyy/MagicBees into bring-closer-to-forestry 2024-01-21 20:35:45 +01:00
Quantumlyy aed51fbd9a add infusion recipe 2024-01-21 20:35:40 +01:00
Alastors 9bae32761c Update build.gradle 2024-01-21 14:33:30 -05:00
Alastors 25c04cedcb Update dependencies.gradle 2024-01-21 14:32:54 -05:00
Martin Robertz cfe1cad9e8 Merge branch 'master' into bring-closer-to-forestry 2024-01-12 19:01:54 +01:00
Martin Robertz 766a440429 update bs+deps 2024-01-12 18:58:10 +01:00
Raven Szewczyk 428bfb04f8 [ci skip] upgraded build system 2024-01-08 21:27:14 +00:00
Quantumlyy 9fb5e3d8fb reword 2023-12-31 15:08:34 +01:00
Quantumlyy 3da4083bba localize 2023-12-31 15:04:53 +01:00
Quantumlyy 9d36165259 cursed shit 2023-12-31 15:03:38 +01:00
Nejc Drobnič 573c089b96 Merge pull request #1 from GTNewHorizons/dev
update
2023-12-31 14:46:55 +01:00
Martin Robertz b82ce5e15f update 2023-12-31 14:44:27 +01:00
Martin Robertz 4f5358bea6 Update Config.java 2023-12-24 21:15:17 +01:00
Martin Robertz df0761c9af Update dependencies.gradle 2023-12-24 21:02:53 +01:00
Martin Robertz b5165b3e58 Update Config.java 2023-12-24 21:00:38 +01:00
kamenskyi 12f8ed9435 Update ru_RU.lang
add ru lang file
2023-12-24 21:06:26 +03:00
Quantumlyy edf3ff7423 add prod multiplier based on industrial apiary speed 2023-12-14 07:39:02 +01:00
Quantumlyy 06571c1eb4 check for queen in industrial apiary 2023-12-13 22:41:09 +01:00
Quantumlyy 4823e44793 add some scanner data 2023-12-13 12:04:15 +01:00
Quantumlyy f55a9f7643 address review 2023-12-13 09:58:59 +01:00
Quantumlyy 65b698face perform standard check alongside gt check 2023-12-13 09:43:43 +01:00
Quantumlyy 123ff12302 implement alternative housing checker for industrial apiary 2023-12-13 09:19:05 +01:00
Quantumlyy 6e6cbbab48 rename phialing cabinet to apiamancers drainer 2023-12-13 08:56:47 +01:00
Quantumlyy b965d50bbc oops 2023-12-13 08:32:34 +01:00
Quantumlyy fb98d686fb create method for detecting if housing is present 2023-12-13 08:32:13 +01:00
Quantumlyy ff20b5f600 change housing detection 2023-12-13 07:31:10 +01:00
Quantumlyy 2ade3e5705 use instanceof 2023-12-13 07:09:14 +01:00
Quantumlyy b7a928bb06 debug 2023-12-13 06:59:25 +01:00
Quantumlyy ec4491994c add bee ageing 2023-12-12 21:30:11 +01:00
Quantumlyy 89acb72f0b add textures 2023-12-12 19:29:38 +01:00
Quantumlyy fc9ebd66d9 add phialing cabinet research 2023-12-12 13:10:10 +01:00
Quantumlyy 4c64395e21 tweak default config values 2023-12-12 11:46:22 +01:00
Quantumlyy 121fe1c0a9 sa 2023-12-12 10:40:48 +01:00
Quantumlyy 906b97064e remove queen aging 2023-12-12 10:36:47 +01:00
Quantumlyy ae736770fb age queen for every essentia generated 2023-12-12 10:35:42 +01:00
Quantumlyy 27ea81cd09 handle null aspect 2023-12-12 09:35:26 +01:00
Quantumlyy aa25a5086d sa 2023-12-10 19:14:04 +01:00
Quantumlyy ac68e40b9f add lang strings for phialing cabinet and essentia bee 2023-12-10 10:34:30 +01:00
Quantumlyy 2935df3409 fix multiplication by 0 issue 2023-12-10 00:17:30 +01:00
Quantumlyy 98c0810820 sa 2023-12-09 23:21:54 +01:00
Quantumlyy af2d06aa7b take into account the production multiplier 2023-12-09 23:18:00 +01:00
Quantumlyy e88eb1756c lower potential operations if the cabinet is full 2023-12-09 23:04:10 +01:00
Quantumlyy b19979e88b revert container slots 2023-12-09 19:48:11 +01:00
Quantumlyy 974e459311 oops 2023-12-09 18:31:40 +01:00
Quantumlyy f366dcdfc6 finish up cabinet logic 2023-12-09 18:26:17 +01:00
Quantumlyy e7e5292526 read and write nbt 2023-12-09 08:57:32 +01:00
Quantumlyy c79503d669 remove stubs 2023-12-09 01:45:11 +01:00
Quantumlyy 6529e7245d correctly check for the species 2023-12-09 00:53:21 +01:00
Quantumlyy 29e72ed7fc make phialing cabinet capacity configurable 2023-12-08 23:31:35 +01:00
Quantumlyy 02c7fc7613 sa 2023-12-08 23:23:30 +01:00
Quantumlyy 7416d21f6f use config for phialing cabinet values 2023-12-08 23:22:19 +01:00
Quantumlyy d3ad57a622 sa 2023-12-08 23:15:21 +01:00
Quantumlyy 0578441707 check for beehousing instead of apiary 2023-12-08 15:09:44 +01:00
Quantumlyy 07a987151e differentiate essentia based on first inserted 2023-12-08 15:05:59 +01:00
Quantumlyy c23401e45c add tc essentia bee 2023-12-08 11:43:11 +01:00
Quantumlyy e03d4da989 add basics for phialing cabinet 2023-12-08 11:36:56 +01:00
Quantumlyy 4c47f77214 why was that there? 2023-12-07 22:48:48 +01:00
Quantumlyy bdd76306bb revert slot move 2023-12-07 22:40:49 +01:00
Quantumlyy ae246d87eb extract MagicApiaryInventory into file 2023-12-07 21:40:37 +01:00
Quantumlyy c8aaeba7cb edit frame and product slots 2023-12-07 19:08:06 +01:00
Quantumlyy 7345669405 remove pointless arithmetic 2023-12-07 18:06:22 +01:00
Quantumlyy 5e912b69bd remove unused methods 2023-12-07 18:00:36 +01:00
Quantumlyy 481c22a19d use apiary inventory and beelistener 2023-12-07 16:49:09 +01:00
Martin Robertz 4103ce72e5 sa 2023-12-06 12:42:02 +01:00
Martin Robertz 116e3610e6 fix wci 2023-12-06 12:36:23 +01:00
Martin Robertz 702a02e943 update gradle+deps 2023-12-06 12:18:58 +01:00
Alastors b200f3006a Merge pull request #33 from GTNewHorizons/ethereal-shard-dupe-fix 2023-12-06 02:42:13 -05:00
Alastors 322b8d0944 Fix star imports
it's always the damn star imports
2023-12-06 02:34:07 -05:00
Alastors b5e1046904 clearing repositories 2023-12-06 02:10:10 -05:00
Alastors f0f51be20e Update NodeHelper.java 2023-12-06 02:08:55 -05:00
Alastors c3b0378096 forgot to update the buildscript 2023-12-06 01:55:48 -05:00
Alastors baf9f915e5 actually got the bug this time 2023-12-06 01:53:56 -05:00
Alastors 0d97d836a3 fixing the ethereal shard dupe 2023-12-06 00:08:11 -05:00
Martin Robertz f777cf976d Merge pull request #31 from hacatu/master
Buffed magic, resiliant, and basic blood frames
2023-09-13 08:54:44 +02:00
Gabriel Eiseman bd6887c598 Base blood frame should be +2 like magic frame 2023-08-28 11:35:12 -04:00
Gabriel Eiseman acf2525801 Buffed magic, resiliant, and basic blood frames 2023-08-25 12:29:35 -04:00
Martin Robertz 054bf8f329 update bs+deps 2023-07-18 20:43:00 +02:00
Martin Robertz 418a322378 Merge pull request #30 from hacatu/master
Fix Additive Production
2023-07-18 20:41:16 +02:00
hacatuandJakub dcf47bb393 Fix comment
Co-authored-by: Jakub <[email protected]>
2023-07-18 16:00:35 +00:00
hacatuandJakub 5ca5c11fc9 Update magic apiary
Co-authored-by: Jakub <[email protected]>
2023-07-18 15:45:18 +00:00
Gabriel Eiseman 991c4fff5e Fully normalize positive frames to -1 2023-07-18 09:44:01 -04:00
Gabriel Eiseman 137784f76d Nerf the actual production modifiers for frames and the magic apiary 2023-07-17 12:48:39 -04:00
Gabriel Eiseman bde910d708 Nerf the actual production modifiers for frames and the magic apiary 2023-07-17 12:42:29 -04:00
Gabriel Eiseman befd485d39 Fixed blood magic oblivion-like frames to actually prevent production 2023-07-14 17:55:48 -04:00
Gabriel Eiseman e56e056c5d Fixed production modifiers to be additive 2023-07-14 16:05:06 -04:00
Martin Robertz ce4f1880ca Merge pull request #28 from GTNewHorizons/fix
Fix
2023-05-03 21:49:17 +02:00
kuba6000 520d2e09e1 fix 2023-05-03 21:42:34 +02:00
Martin Robertz 870eafbbe4 update dep 2023-05-03 21:24:41 +02:00
Martin Robertz d9ef30fe32 Merge pull request #27 from GTNewHorizons/TconNuggetREmoval
Tcon nugget r emoval
2023-05-03 21:19:58 +02:00
Runakai1 0112a7f104 Spotless 2023-05-03 15:34:38 +02:00
Runakai1 9724d519e8 Tcon Nugget Conversion 2023-05-03 14:54:32 +02:00
Martin Robertz 3d562d0052 Merge pull request #20 from GTNewHorizons/Blood-Frames
Addition of Blood Magic Frames
2023-04-30 20:14:21 +02:00
Alexander Anishin 9f17d8ceff Added configuration for new modules 2023-04-30 20:36:44 +03:00
Alexander Anishin 614acf5114 Moved ring code to optional module 2023-04-30 20:13:07 +03:00
Alexander Anishin b338d97517 Fixed multipler issue with blood frames 2023-04-30 20:10:34 +03:00
Alastors 2870e06387 Actual Final PR of this 2023-04-30 10:16:06 -04:00
Martin Robertz 96514b1aff Merge pull request #25 from GTNewHorizons/Blood-Frames-spotless-fixes
Spotless apply for branch Blood-Frames for #20
2023-04-30 12:11:40 +02:00
GitHub GTNH Actions f85900d9a8 spotlessApply 2023-04-30 10:10:49 +00:00
Martin Robertz 66b1f3e075 Merge branch 'master' into Blood-Frames 2023-04-30 12:06:03 +02:00
Martin Robertz e053b019af Merge pull request #19 from Cardinalstars/master
Collector's Bee Ring feature
2023-04-30 11:42:59 +02:00
Alastors 5dfa179c87 Final Pull on this PR
There of course will need to be further balancing in the future, but I have handled this PR to the absolute best of my ability, and as I have little to no experience with BM within GTNH as a whole, I have no true ability to balance the passive LP cost by myself, as such I think we should let this out as it is, and balance as we get responses out in the wild.
2023-04-29 22:01:36 -04:00
Alastors 966e4ba2f2 WE'VE FINALLY FIXED IT 100%
@kuba6000 @firenoo holy christ guys, we've actually finally fixed this piece of crap, it took 2 grueling days, but we actually fixed the thing.
2023-04-29 19:34:52 -04:00
Alastors 1cbe881ae3 firenoo fix 2023-04-29 18:49:47 -04:00
Alastors b0b38a472a small update to BloodBase 2023-04-29 18:31:27 -04:00
Alastors 5f56b46e00 Kuba requested changes, what am I doing wrong? 2023-04-29 18:25:31 -04:00
Alastors 83b0bfc504 I actually fixed it this time 2023-04-29 16:34:34 -04:00
Alastors fe56288c72 I forgot to spotless 2023-04-29 15:47:00 -04:00
Alastors ff25ec619c Everything works again 2023-04-29 15:35:23 -04:00
Alastors c4ef06b027 Revert "Revert "Add recipes and research nodes""
This reverts commit fa10e888dc.
2023-04-29 15:12:06 -04:00
Alastors 0b6c1cc345 Revert "Adding back the textures and lang file"
This reverts commit 02afe5dbc8.
2023-04-29 15:12:04 -04:00
Alastors 0efc169ef7 Revert "Remove comments + add helper"
This reverts commit d83a0cc775.
2023-04-29 15:11:52 -04:00
Alastors d83a0cc775 Remove comments + add helper 2023-04-29 15:08:00 -04:00
Alastors 02afe5dbc8 Adding back the textures and lang file 2023-04-29 15:02:18 -04:00
rjnasers 951f5a1ad5 Forgot Spotless 2023-04-29 13:21:23 -05:00
rjnasers 1cbc997be3 Adding fix that should make calls only once per second and acts the same. After testing it seems to work, but if somewhere an effect is implemented very weird it might not. 2023-04-29 13:20:38 -05:00
Alexander Anishin f3d3a0a2df Code refactoring 2023-04-29 13:11:51 +03:00
Alastors fa10e888dc Revert "Add recipes and research nodes"
This reverts commit 1e0c7d3c5e.
2023-04-29 02:34:54 -04:00
Alastors fdc1301b43 Revert "fix the glitch"
This reverts commit 3afee4f553.
2023-04-29 02:26:52 -04:00
Alastors 756b186db4 Revert "fix?"
This reverts commit 80c1c4d5da.
2023-04-29 02:26:50 -04:00
Alastors 639c53a01d Revert "Gonna be annoyed if this works"
This reverts commit bc963b0d7e.
2023-04-29 02:26:48 -04:00
Alastors 309a9c0818 Revert "work?"
This reverts commit c3fcb6fc28.
2023-04-29 02:26:46 -04:00
Alastors 2c547e3851 Revert "please fix"
This reverts commit 9f1642fd5b.
2023-04-29 02:26:42 -04:00
Alastors 79d0283901 Revert "Update Config.java"
This reverts commit 17768a1300.
2023-04-29 02:26:40 -04:00
Alastors 918ec20739 Revert "Update BloodHelper.java"
This reverts commit 5b4aaf50f4.
2023-04-29 02:26:38 -04:00
Alastors 2ea0a44429 Revert "Update Config.java"
This reverts commit 98fd7c1e19.
2023-04-29 02:26:36 -04:00
Alastors 8f919fc688 Revert "Update Config.java"
This reverts commit c209ef59fb.
2023-04-29 02:26:33 -04:00
Alastors c47b50b617 Revert "Update Config.java"
This reverts commit c31726001b.
2023-04-29 02:26:19 -04:00
Alastors 764fda0985 Revert "Update Config.java"
This reverts commit 806c326b62.
2023-04-29 02:26:17 -04:00
Alastors 8412246e3e Revert "Update Config.java"
This reverts commit d612f8c520.
2023-04-29 02:26:13 -04:00
Alastors 1391dd3ed6 Revert "Update BloodHelper.java"
This reverts commit a64ae86853.
2023-04-29 02:26:10 -04:00
Alastors cf6536c17f Revert "please fucking work"
This reverts commit 66c5bdf2ca.
2023-04-29 02:26:08 -04:00
Alastors fddc31a8f5 Revert "a"
This reverts commit 5e5a80fb5c.
2023-04-29 02:26:06 -04:00
Alastors 840771f5f4 Revert "b"
This reverts commit b76b77d4a3.
2023-04-29 02:26:03 -04:00
Alastors b76b77d4a3 b 2023-04-29 02:20:36 -04:00
Alastors 5e5a80fb5c a 2023-04-29 02:17:33 -04:00
Alastors 66c5bdf2ca please fucking work 2023-04-29 02:13:36 -04:00
Alastors a64ae86853 Update BloodHelper.java 2023-04-29 02:10:01 -04:00
Alastors d612f8c520 Update Config.java 2023-04-29 01:55:44 -04:00
Alastors 806c326b62 Update Config.java 2023-04-29 01:53:15 -04:00
Alastors c31726001b Update Config.java 2023-04-29 01:48:41 -04:00
Alastors c209ef59fb Update Config.java 2023-04-29 01:40:29 -04:00
Alastors 98fd7c1e19 Update Config.java 2023-04-29 01:29:49 -04:00
Alastors 5b4aaf50f4 Update BloodHelper.java 2023-04-29 01:23:41 -04:00
Alastors 17768a1300 Update Config.java 2023-04-29 01:20:13 -04:00
Alastors 9f1642fd5b please fix 2023-04-29 00:49:28 -04:00
Alastors c3fcb6fc28 work? 2023-04-29 00:26:53 -04:00
Alastors bc963b0d7e Gonna be annoyed if this works 2023-04-29 00:22:10 -04:00
Alastors 80c1c4d5da fix? 2023-04-29 00:18:36 -04:00
Alastors 3afee4f553 fix the glitch 2023-04-29 00:13:15 -04:00
Alastors 1e0c7d3c5e Add recipes and research nodes 2023-04-29 00:07:09 -04:00
Alastors 9b21be0eb5 Added Recipes 2023-04-28 13:19:31 -04:00
Alastors 3a0d9352b1 I fucking forgot spotless again 2023-04-28 12:10:59 -04:00
Alastors 108a11c119 Fix? 2023-04-28 12:04:41 -04:00
Martin Robertz e90b40159c derp 2023-04-28 17:56:14 +02:00
Martin Robertz 61398d3139 update dep file 2023-04-28 17:52:05 +02:00
Martin Robertz e1d289bc48 update bs+sa 2023-04-28 17:50:21 +02:00
Alastors 75db1329ea Update Config.java 2023-04-28 11:03:33 -04:00
Alastors 32ffe03aa3 Update Config.java 2023-04-28 10:55:02 -04:00
Alastors 138e8d9c40 Please work 2023-04-28 01:51:07 -04:00
Alastors 6c6b690d57 Update dependencies.gradle 2023-04-28 01:36:51 -04:00
Alastors 726831399d Update dependencies.gradle 2023-04-28 01:30:54 -04:00
Alastors 87ec6c63eb I swear to god if this fixes it 2023-04-28 01:19:22 -04:00
Alastors ef4359835a Should work this time 2023-04-28 01:13:14 -04:00
Alastors b9292af3d9 SpOtLeSsChEcK fAiLEd 2023-04-27 23:40:46 -04:00
Alastors 77936b6dab Finally fixed the optional dependency 2023-04-27 23:35:19 -04:00
rjnasers e24a94f0ba PR comment fixes. 2023-04-27 21:40:15 -05:00
Alastors 1d4a52c3af You gonna work this time? 2023-04-27 22:17:38 -04:00
Alastors c7c47b9a1b fer fecks sake spotless 2023-04-27 22:11:12 -04:00
Alastors e12eda73fc Addition of Blood Magic Frames
Adds the replacement for the Blood Frame from BM, which is soon to be deleted from BM because of glitches, likewise this adds a new frame, The Maddening Frame of Frenzy, both use LP, both need a recipe to be decided on a later date, both need their lp tweaked, the updated LP is currently proposed to be switched to 25k
2023-04-27 22:01:03 -04:00
rjnasers 2b1e179eeb Updating gui 2023-04-27 13:54:13 -05:00
rjnasers dbc4b23821 Updating image 2023-04-27 13:26:27 -05:00
rjnasers f5dc54e1fb Fixing Deps. 2023-04-27 13:09:27 -05:00
rjnasers 500adb0357 Fixing some comment. 2023-04-27 12:48:59 -05:00
rjnasers 7df6221e0b Adding comments and final formatting. 2023-04-26 16:45:06 -05:00
rjnasers 2d78a84df1 Apply spotless and fixing keeping item on death 2023-04-26 16:20:41 -05:00
rjnasers 729908b1b0 Fully Fleshed out Functionality and GUI. Having some small issues with the paritcleFX, but not huge deal right now. Would be nice to have, but crashes make people even sadder. 2023-04-26 15:11:53 -05:00
rjnasers e5cea4e3dd Fixing InventoryBeeRing and adding some minor functionality to ItemBeeRing 2023-04-23 20:39:53 -05:00
rjnasers c17c2f3746 Changes to InventoryBeeRing.java mostly. 2023-04-22 13:44:40 -05:00
rjnasers 951df8a632 Basic bee ring start. 2023-04-22 11:28:20 -05:00
Runakai1 bdb7a53b96 Merge pull request #18 from GTNewHorizons/beeeeeez
Implement accelerated effect on Rejuvenating bee effect + Fix
2023-04-12 15:43:45 +02:00
Runakai1 e5f0fc2368 Spotless 2023-04-12 14:10:24 +02:00
Jakub 702cffe458 Writing code and commiting on the phone be like 2023-04-12 13:30:04 +02:00
Jakub 72b71021de Fix 2023-04-12 13:20:53 +02:00
kuba6000 0149c34d1d Keep as int 2023-04-10 20:29:17 +02:00
kuba6000 caca6a6329 Sanity check 2023-04-10 20:29:06 +02:00
kuba6000 6bd5cc24d3 Implement accelerated effect on Rejuvenating bee effect 2023-04-10 20:23:52 +02:00
kuba6000 4bef945c4e Prevent overflow 2023-04-10 20:21:47 +02:00
Martin Robertz 6fe4436226 Merge pull request #17 from GTNewHorizons/SilBee
Change Silicon Specialty
2023-04-10 15:31:05 +02:00
Runakai1 0f7363c756 Forgot something 2023-04-10 13:46:06 +02:00
Runakai1 afa16af645 Change Silicon Specialty
Changes the Chance from 16->30% (Specialty combs have half the shown chance and since silicon is easy, there is no need to gate it behind 16%) and made it output raw silicon instead of galacticraft silicon
2023-04-10 13:45:01 +02:00
Raven Szewczyk 4ce1caa37e [ci skip] upgraded build system 2023-01-31 09:54:13 +00:00
Jason Mitchell e565d86ed9 [ci skip] Add git-blame-ignore-revs for spotlessApply 2023-01-29 10:24:49 -08:00
Jason Mitchell f1069a91f1 [ci skip] spotlessApply with the new settings 2023-01-29 10:24:49 -08:00
Jason Mitchell 32411450d3 [ci skip] Update buildscript to RetroFuturaGradle 2023-01-29 10:24:14 -08:00
Martin Robertz 49ef624bd4 Merge pull request #16 from GTNewHorizons/yeet_version_checker
update buildscript and remove update checker
2023-01-18 19:47:25 +01:00
Alexdoru 189d305a31 remove version checker 2023-01-18 14:16:53 +01:00
Alexdoru 97a45e8e0a update buildscript 2023-01-18 13:59:18 +01:00
boubou19 8c72b75e0e Merge pull request #15 from GTNewHorizons/interface
Interface IAlleleBeeAcceleratableEffect moved to Forestry
2022-10-13 16:48:19 +02:00
kuba6000 2cca9de690 Interface IAlleleBeeAcceleratableEffect moved to Forestry 2022-10-13 16:14:39 +02:00
kuba6000 6523fb0a1d Remove GT dep 2022-10-13 16:13:28 +02:00
kuba6000 8833aab1f1 Bump Forestry 2022-10-13 16:13:28 +02:00
Martin Robertz 7e9a54ced2 Merge pull request #14 from GTNewHorizons/effects
Implement acceleratable empowering bee effect
2022-10-13 10:09:08 +02:00
kuba6000 14a712260b Spotless 2022-10-12 21:09:45 +02:00
kuba6000 d993c90c3e Buildscript 2022-10-12 21:09:18 +02:00
kuba6000 e73f5a841e dep 2022-10-12 21:06:52 +02:00
kuba6000 9fcf50b61a Update AlleleEffectEmpowering.java 2022-10-12 21:03:29 +02:00
kuba6000 337d8692c6 Implement acceleratable empowering effect 2022-10-12 20:51:36 +02:00
kuba6000 8cf54bb10f Add GT5 dep 2022-10-12 20:03:23 +02:00
Martin Robertz 854ae94be6 Merge pull request #13 from ChromicRedBrick/Fix-duplicate-key
Fix localization keys
2022-10-04 16:53:29 +02:00
ChromicRedBrickandKiwi aea52904d4 Fix duplicate keys
Co-Authored-By: Kiwi <[email protected]>
2022-10-04 19:39:08 +08:00
Martin Robertz 4704d4c18c Merge pull request #12 from Kiwi233/1.7.10-krypt
Update zh_CN.lang
2022-09-24 12:34:28 +02:00
[Kiwi233] 2abb28bd8e Update zh_CN.lang 2022-09-24 14:23:22 +08:00
boubou19 011a5767a7 Merge pull request #11 from GTNewHorizons/feature/checks
Some safety checks
2022-08-03 08:46:47 +02:00
repo_alt 9fa67a8426 Some safety checks 2022-08-03 10:33:33 +04:00
Jason Mitchell fb65570ce9 [ci skip] Migrate github actions to GTNH-Actions-Workflows 2022-07-16 10:49:26 -07:00
Martin Robertz 0901392f11 Merge pull request #10 from GTNewHorizons/QuickBeeDropFix
20% instead of 0.00001% (lmao)
2022-04-27 23:19:18 +02:00
ScriptedPiky 1359133050 20% instead of 0.00001% (lmao)
Why was this even a thing is beyond me
Fixes: https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/10225
2022-04-27 13:12:54 -07:00
Martin Robertz b12577b506 Merge pull request #9 from GTNewHorizons/maven
Maven
2022-03-15 20:00:17 +01:00
bombcar b787d693b9 Maven 2022-03-15 13:36:46 -05:00
Martin Robertz 1f19dc2f5e Merge pull request #8 from GTNewHorizons/fix/ultramine
help suboptimal asm code to not generate GuiContainer in frame info
2022-03-14 07:22:18 +01:00
Glease 4e638db2a7 help suboptimal asm code to not generate GuiContainer in frame info 2022-03-13 20:51:11 +08:00
Martin Robertz db7d6ab7a2 Merge pull request #7 from GTNewHorizons/fix/build
fix the build
2022-03-13 02:51:13 +01:00
Martin Robertz 1db58409ec Update dependencies.gradle 2022-03-13 02:48:54 +01:00
Martin Robertz ff9e54760a Update dependencies.gradle 2022-03-13 02:48:22 +01:00
Glease a15b899913 fix the build 2022-03-13 09:46:38 +08:00
Martin Robertz 68a2880877 Update dependencies.gradle 2022-03-13 02:45:45 +01:00
Martin Robertz 913c4e5d00 Update dependencies.gradle 2022-03-13 02:41:49 +01:00
Martin Robertz 51f161c2e8 Update dependencies.gradle 2022-03-13 02:39:53 +01:00
Martin Robertz a49128337b Update dependencies.gradle 2022-03-13 02:35:30 +01:00
Martin Robertz 4903f97de6 Update build.gradle 2022-03-13 02:31:11 +01:00
Martin Robertz f87a689045 Update dependencies.gradle 2022-03-13 02:30:48 +01:00
Johann Bernhardt 987d7c2b11 Merge pull request #6 from GTNewHorizons/unified-build-script
Migrated to unified build script
2022-01-07 23:58:10 +01:00
Johann Bernhardt 3550fe23d4 Migrated to unified build script 2022-01-07 23:14:30 +01:00
Martin Robertz 237abd6cef Merge pull request #5 from alkcorp/1.7.10-krypt
Allows Backpack to accept wildcard items.
2021-10-07 19:45:58 +02:00
Alkalus 5e86d62433 Allows Backpack to accept wildcard items. 2021-10-07 18:40:01 +01:00
DreamMasterXXL 4c71e42dd6 bump version 2021-08-17 08:57:23 +02:00
Martin Robertz de793aa5fc Update build.gradle 2021-08-14 15:47:50 +02:00
Martin Robertz 58439c0936 Update build.gradle 2021-08-14 15:47:01 +02:00
Martin Robertz ef76ab40e3 Update gradle.properties 2021-08-14 15:43:26 +02:00
Martin Robertz d2a3b91fe0 Merge pull request #4 from D-Cysteine/1.7.10-krypt
Update to latest Forestry API
2021-08-14 15:41:30 +02:00
D-Cysteine a370c61948 Update to latest Forestry API 2021-08-12 20:54:58 -06:00
DreamMasterXXL 04ea5e8862 bump version 2020-12-03 20:37:56 +01:00
Martin Robertz b411fec0c1 Merge pull request #3 from KiloJoel/magnetFix
items go lower and don't move when close
2020-11-22 21:20:48 +01:00
KiloJoel 82368a06bf items go lower and don't move when close 2020-11-22 20:08:47 +00:00
338 changed files with 15991 additions and 13224 deletions

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
# This is the universal Text Editor Configuration
# for all GTNewHorizons projects
# See: https://editorconfig.org/
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.{bat,ini}]
end_of_line = crlf
[*.{dtd,json,info,mcmeta,md,sh,svg,xml,xsd,xsl,yaml,yml}]
indent_size = 2
+2
View File
@@ -0,0 +1,2 @@
# Ignore spotlessApply reformat
f1069a91f1b2ea9469775696c097dd6fb484e6e8
+44
View File
@@ -0,0 +1,44 @@
* text eol=lf
*.[jJ][aA][rR] binary
*.[pP][nN][gG] binary
*.[jJ][pP][gG] binary
*.[jJ][pP][eE][gG] binary
*.[gG][iI][fF] binary
*.[tT][iI][fF] binary
*.[tT][iI][fF][fF] binary
*.[iI][cC][oO] binary
*.[sS][vV][gG] text
*.[eE][pP][sS] binary
*.[xX][cC][fF] binary
*.[kK][aA][rR] binary
*.[mM]4[aA] binary
*.[mM][iI][dD] binary
*.[mM][iI][dD][iI] binary
*.[mM][pP]3 binary
*.[oO][gG][gG] binary
*.[rR][aA] binary
*.7[zZ] binary
*.[gG][zZ] binary
*.[tT][aA][rR] binary
*.[tT][gG][zZ] binary
*.[zZ][iI][pP] binary
*.[tT][cC][nN] binary
*.[sS][oO] binary
*.[dD][lL][lL] binary
*.[dD][yY][lL][iI][bB] binary
*.[pP][sS][dD] binary
*.[tT][tT][fF] binary
*.[oO][tT][fF] binary
*.[pP][aA][tT][cC][hH] -text
*.[bB][aA][tT] text eol=crlf
*.[cC][mM][dD] text eol=crlf
*.[pP][sS]1 text eol=crlf
*[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary
+13
View File
@@ -0,0 +1,13 @@
name: Build and test
on:
pull_request:
branches: [ master, main, release/** ]
push:
branches: [ master, main, release/** ]
jobs:
build-and-test:
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master
secrets: inherit
+17
View File
@@ -0,0 +1,17 @@
name: Optimize images
on:
pull_request:
branches: [ master, main, release/** ]
paths:
- "**/*.png"
push:
branches: [ master, main, release/** ]
paths:
- "**/*.png"
jobs:
optimize-images:
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/optimize-images.yml@master
secrets: inherit
+14
View File
@@ -0,0 +1,14 @@
name: Release tagged build
on:
push:
tags: [ '*' ]
permissions:
contents: write
jobs:
release-tags:
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/release-tags.yml@master
secrets: inherit
+28 -99
View File
@@ -1,103 +1,32 @@
# IntelliJ IDEA Files .gradle
.settings
/.idea/
/run/
/build/
/eclipse/
.classpath
.project
/bin/
/config/
/crash-reports/
/logs/
options.txt
/saves/
usernamecache.json
banned-ips.json
banned-players.json
eula.txt
ops.json
server.properties
servers.dat
usercache.json
whitelist.json
/out/
*.iml *.iml
*.ipr *.ipr
*.iws *.iws
out/ src/main/resources/mixins.*.json
.idea/
# Eclipse Project Files
.classpath
.project
.settings/
eclipse/
# Gradle
.gradle
gradle/
build/
debug/
bin/
config/
crash-reports/
logs/
mods/
saves/
usernamecache.json
options.txt
asm
Thumbs.db
## Windows
Thumbs.db
## gradle
/.gradle
/build
## ForgeGradle
/run
## eclipse
/.settings
/.metadata
/.classpath
/.project
/eclipse
/bin
## intellij
/out
/.idea
/atlassian-ide-plugin.xml
/*.ipr
/*.iws
/*.iml
## Private Stuffs
/private.properties
## Jars
*.jar
!/gradle/wrapper/gradle-wrapper.jar
### OSX (adds a lot of garbage)###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
# Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
*.bat *.bat
LICENSE* *.DS_Store
forge* !gradlew.bat
CREDITS* layout.json
MinecraftForge*
README.txt
*.psd
*.pdn
/src/main/resources/assets/thaumcraft
##API
/src/api
/models
-3
View File
@@ -1,3 +0,0 @@
[submodule "src/api/java/thaumcraft/api"]
path = src/api/java/thaumcraft/api
url = https://github.com/Azanor/thaumcraft-api
+3
View File
@@ -0,0 +1,3 @@
# Any Github changes require admin approval
/.github/** @GTNewHorizons/admin
+4 -94
View File
@@ -1,95 +1,5 @@
buildscript { //version: 1707058017
repositories {
mavenCentral() plugins {
maven { id 'com.gtnewhorizons.gtnhconvention'
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/"
}
ivy {
name "Thaumcraft"
artifactPattern "http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-deobf-${project.version_mc}-[revision].[ext]"
}
//ivy {
// name "Botania"
// artifactPattern "http://botaniamod.net/files/deobf/[module] [revision]-deobf.[ext]"
//}
}
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"
sourceCompatibility = 1.6
targetCompatibility = 1.6
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}:api"
runtime "net.sengir.forestry:forestry_${project.version_mc}:${project.version_forestry}:dev"
//compile name: 'Botania', version: "${project.version_botania}", ext: 'jar'
//compile name: 'Baubles', version: "${project.version_baubles}", ext: 'jar'
//compile name: 'Thaumcraft', version: "${project.version_thaumcraft}", ext: '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
}
}
task deobfJar(type: Jar) { // Generate deobfuscated
from sourceSets.main.output
classifier = 'deobf'
}
artifacts {
archives deobfJar
}
task fullBuild(dependsOn: ['build', 'deobfJar']) {
} }
+18
View File
@@ -0,0 +1,18 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:ForestryMC:4.12.1:dev')
compileOnly('com.github.GTNewHorizons:BloodMagic:1.10.0:dev')
compileOnly('com.github.GTNewHorizons:ThaumicHorizons:1.9.0:dev')
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.3.0-GTNH:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Botania:1.14.1-GTNH:api') {transitive = false}
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.55.13:dev')
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.8.0-GTNH:dev')
//runtimeOnlyNonPublishable('com.github.GTNewHorizons:Baubles-Expanded:2.3.0-GTNH:dev') {transitive = false}
//runtimeOnlyNonPublishable('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') {transitive = false}
//runtimeOnlyNonPublishable('com.github.GTNewHorizons:GT5-Unofficial:5.09.55.13:dev')
}
-3
View File
@@ -1,3 +0,0 @@
2.4.3
false
Fixes a crash with EE3 integration.
+236 -9
View File
@@ -1,11 +1,238 @@
version_major=2 # ExampleMod tag to use as Blowdryer (Spotless, etc.) settings version, leave empty to disable.
version_minor=5 # LOCAL to test local config updates.
version_rev=4-GTNH gtnh.settings.blowdryerTag = 0.2.0
version_forestry=4.2.+ # Human-readable mod name, available for mcmod.info population.
version_botania=r1.8-248 modName = Magic Bees
version_baubles=1.0.1.10
version_thaumcraft=4.2.3.5
version_mc=1.7.10 # Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation.
version_forge=10.13.4.1614-1.7.10 # Conventionally lowercase.
modId = MagicBees
# Root package of the mod, used to find various classes in other properties,
# mcmod.info substitution, enabling assertions in run tasks, etc.
modGroup = magicbees
# Whether to use modGroup as the maven publishing group.
# When false, com.github.GTNewHorizons is used.
useModGroupForPublishing = false
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
autoUpdateBuildScript = false
# Version of Minecraft to target
minecraftVersion = 1.7.10
# Version of Minecraft Forge to target
forgeVersion = 10.13.4.1614
# Specify an MCP channel for dependency deobfuscation and the deobfParams task.
channel = stable
# Specify an MCP mappings version for dependency deobfuscation and the deobfParams task.
mappingsVersion = 12
# Defines other MCP mappings for dependency deobfuscation.
remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
# Select a default username for testing your mod. You can always override this per-run by running
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
developmentEnvironmentUserName = Developer
# Enables modern Java syntax support. Valid values:
# - false: No modern syntax, Java 8 only
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
# - modern: Native modern Java bytecode, no downgrading
enableModernJavaSyntax = false
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
# and should *not* be used in most situations. -1 disables this.
# forceToolchainVersion = -1
# Target JVM version for JVM Downgrader bytecode downgrading.
# Only used when enableModernJavaSyntax = jvmDowngrader
# downgradeTargetVersion = 8
# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
# Classes will be available in META-INF/versions/N/ for each version N in this list.
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
# jvmDowngraderMultiReleaseVersions = 21,25
# Specifies how JVM Downgrader API stubs are provided. Options:
# - shade: Shade minimized stubs into the jar
# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint)
# - external: Another dependency provides stubs (no constraint, no warning)
# - (empty): Warning reminding you to configure stubs
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
# jvmDowngraderStubsProvider =
# Enables injecting missing generics into the decompiled source code for a better coding experience.
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
enableGenericInjection = false
# Generate a class with a String field for the mod version named as defined below.
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
# If gradleTokenVersion is empty or missing, the field will not be present in the class.
generateGradleTokenClass = magicbees.Tags
# Name of the token containing the project's current version to generate/replace.
gradleTokenVersion = VERSION
# [DEPRECATED] Mod ID replacement token.
gradleTokenModId =
# [DEPRECATED] Mod name replacement token.
gradleTokenModName =
# [DEPRECATED] Mod Group replacement token.
gradleTokenGroupName =
# [DEPRECATED]
# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java
# public static final String VERSION = "GRADLETOKEN_VERSION";
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
# version in @Mod([...], version = VERSION, [...]).
# Leave these properties empty to skip individual token replacements.
replaceGradleTokenInFile =
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
# leave this property empty.
# Example value: (apiPackage = api) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.api
apiPackage = api
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
# There can be multiple files in a space-separated list.
# Example value: mymodid_at.cfg nei_at.cfg
accessTransformersFile =
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = false
# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
# Mixin classes will have access to "main" classes, but not the other way around.
separateMixinSourceSet =
# Adds some debug arguments like verbose output and class export.
usesMixinDebug = false
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
mixinPlugin =
# Specify the package that contains all of your Mixins. The package must exist or
# the build will fail. If you have a package property defined in your mixins.<modid>.json,
# it must match with this or the build will fail.
mixinsPackage =
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
# This parameter is for legacy compatibility only
# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin
coreModClass =
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
containsMixinsAndOrCoreModOnly = false
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
forceEnableMixins = false
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated into your jar. It is your
# responsibility to check the license and request permission for distribution if required.
usesShadowedDependencies = false
# If disabled, won't remove unused classes from shadowed dependencies. Some libraries use reflection to access
# their own classes, making the minimization unreliable.
minimizeShadowedDependencies = true
# If disabled, won't rename the shadowed classes.
relocateShadowedDependencies = true
# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
includeWellKnownRepositories = true
# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated
# list of strings, with the acceptable keys being(case does not matter):
# cursemaven
# modrinth
excludeWellKnownRepositories =
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
usesMavenPublishing = true
# Maven repository to publish the mod to.
# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/
# Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token.
#
# The project's ID on Modrinth. Can be either the slug or the ID.
# Leave this empty if you don't want to publish to Modrinth.
modrinthProjectId =
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
# Syntax: scope1-type1:name1;scope2-type2:name2;...
# Where scope can be one of [required, optional, incompatible, embedded],
# type can be one of [project, version],
# and the name is the Modrinth project or version slug/id of the other mod.
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
modrinthRelations =
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
#
# The project's numeric ID on CurseForge. You can find this in the About Project box.
# Leave this empty if you don't want to publish on CurseForge.
curseForgeProjectId =
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
# Syntax: type1:name1;type2:name2;...
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
# and the name is the CurseForge project slug of the other mod.
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
curseForgeRelations =
# Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older
# projects. New projects should not use this parameter.
customArchiveBaseName = magicbees
# Optional parameter to customize the default working directory used by the runClient* tasks. Relative to the project directory.
# runClientWorkingDirectory = run/client
# Optional parameter to customize the default working directory used by the runServer* tasks. Relative to the project directory.
# runServerWorkingDirectory = run/server
# Optional parameter to have the build automatically fail if an illegal version is used.
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
# The check is ONLY performed if the version is a git tag.
# Note: the specified string must be escaped, so e.g. 1\\.1\\.\\d+ instead of 1\.1\.\d+
# versionPattern =
# Uncomment to prevent the source code from being published.
# noPublishedSources = true
# Uncomment this to disable Spotless checks.
# This should only be uncommented to keep it easier to sync with upstream/other forks.
# That is, if there is no other active fork/upstream, NEVER change this.
# disableSpotless = true
# Uncomment this to disable Checkstyle checks (currently wildcard import check).
# disableCheckstyle = true
# Override the IDEA build type. Valid values are: "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle"
# (force use delegated build).
# This is meant to be set in $HOME/.gradle/gradle.properties.
# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be native build.
# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want!
# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you.
# ideaOverrideBuildType = idea
# Whether IDEA should run spotless checks when pressing the Build button.
# This is meant to be set in $HOME/.gradle/gradle.properties.
# ideaCheckSpotlessOnBuild = true
# Non-GTNH properties
org.gradle.configuration-cache = true
org.gradle.parallel = true
+12
View File
@@ -0,0 +1,12 @@
#This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/d4fd992c9557644e637ebe98263e0ae7/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/59a9771cad43219260d9aac9a8ec4d6a/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/3689d0bcdd77ac01674ba3c9dbbe94d0/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/8e1d9ee5d0f13e442218f6884a306da1/redirect
toolchainVersion=25
Binary file not shown.
+3 -2
View File
@@ -1,6 +1,7 @@
#Sat Jan 04 01:56:22 CET 2020
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip
Vendored
+199 -115
View File
@@ -1,78 +1,128 @@
#!/usr/bin/env bash #!/bin/sh
#
# Copyright © 2015 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
############################################################################## ##############################################################################
## #
## Gradle start up script for UN*X # Gradle start up script for POSIX generated by Gradle.
## #
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
############################################################################## ##############################################################################
# Attempt to set APP_HOME # Attempt to set APP_HOME
# Resolve links: $0 may be a link # Resolve links: $0 may be a link
PRG="$0" app_path=$0
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do # Need this for daisy-chained symlinks.
ls=`ls -ld "$PRG"` while
link=`expr "$ls" : '.*-> \(.*\)$'` APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
if expr "$link" : '/.*' > /dev/null; then [ -h "$app_path" ]
PRG="$link" do
else ls=$( ls -ld "$app_path" )
PRG=`dirname "$PRG"`"/$link" link=${ls#*' -> '}
fi case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle" # This is normally unused
APP_BASE_NAME=`basename "$0"` # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
DEFAULT_JVM_OPTS="" APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" MAX_FD=maximum
warn ( ) { warn () {
echo "$*" echo "$*"
} } >&2
die ( ) { die () {
echo echo
echo "$*" echo "$*"
echo echo
exit 1 exit 1
} } >&2
# OS specific support (must be 'true' or 'false'). # OS specific support (must be 'true' or 'false').
cygwin=false cygwin=false
msys=false msys=false
darwin=false darwin=false
nonstop=false nonstop=false
case "`uname`" in case "$( uname )" in #(
CYGWIN* ) CYGWIN* ) cygwin=true ;; #(
cygwin=true Darwin* ) darwin=true ;; #(
;; MSYS* | MINGW* ) msys=true ;; #(
Darwin* ) NONSTOP* ) nonstop=true ;;
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables # IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java" JAVACMD=$JAVA_HOME/jre/sh/java
else else
JAVACMD="$JAVA_HOME/bin/java" JAVACMD=$JAVA_HOME/bin/java
fi fi
if [ ! -x "$JAVACMD" ] ; then if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -81,84 +131,118 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi fi
else else
JAVACMD="java" 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. if ! command -v java >/dev/null 2>&1
then
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 Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi
fi fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
MAX_FD_LIMIT=`ulimit -H -n` case $MAX_FD in #(
if [ $? -eq 0 ] ; then max*)
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
MAX_FD="$MAX_FD_LIMIT" # shellcheck disable=SC2039,SC3045
fi MAX_FD=$( ulimit -H -n ) ||
ulimit -n $MAX_FD warn "Could not query maximum file descriptor limit"
if [ $? -ne 0 ] ; then esac
warn "Could not set maximum file descriptor limit: $MAX_FD" case $MAX_FD in #(
fi '' | soft) :;; #(
else *)
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
fi # shellcheck disable=SC2039,SC3045
fi ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
# 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"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
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 esac
fi fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules # Collect all arguments for the java command, stacking in reverse order:
function splitJvmOpts() { # * args from the command line
JVM_OPTS=("$@") # * the main class name
} # * -classpath
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS # * -D...appname settings
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" # * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" # For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
Vendored
+44 -41
View File
@@ -1,4 +1,22 @@
@if "%DEBUG%" == "" @echo off @rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ########################################################################## @rem ##########################################################################
@rem @rem
@rem Gradle startup script for Windows @rem Gradle startup script for Windows
@@ -9,25 +27,29 @@
if "%OS%"=="Windows_NT" setlocal if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=. if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. @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 DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe @rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init if %ERRORLEVEL% equ 0 goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail goto fail
@@ -35,54 +57,35 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=% set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init if exist "%JAVA_EXE%" goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail goto fail
:init
@rem Get command-line arguments, handling Windows 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 :execute
@rem Setup the command line @rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle @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% "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd if %ERRORLEVEL% equ 0 goto mainEnd
:fail :fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code! rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 set EXIT_CODE=%ERRORLEVEL%
exit /b 1 if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd :mainEnd
if "%OS%"=="Windows_NT" endlocal if "%OS%"=="Windows_NT" endlocal
Binary file not shown.
Binary file not shown.
Binary file not shown.
+4
View File
@@ -0,0 +1,4 @@
// Add any additional repositories for your dependencies here
repositories {
}
+23
View File
@@ -0,0 +1,23 @@
pluginManagement {
repositories {
maven {
// RetroFuturaGradle
name "GTNH Maven"
url "https://nexus.gtnewhorizons.com/repository/public/"
mavenContent {
includeGroup("com.gtnewhorizons")
includeGroupByRegex("com\\.gtnewhorizons\\..+")
}
}
gradlePluginPortal()
mavenCentral()
mavenLocal()
}
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.24'
}
@@ -2,12 +2,12 @@ package magicbees.api;
import magicbees.api.bees.ITransmutationEffectController; import magicbees.api.bees.ITransmutationEffectController;
public class MagicBeesAPI 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;
// This is a reference to the Tempus aspect. Initialized after MagicBees's post init phase. // Use this object during or after the Mod.Init phase to add your logic to the Transmutation bee effect.
// Ensure it is not null, and cast it to thaumcraft.api.aspects.Aspect. public static ITransmutationEffectController transmutationEffectController;
public static Object thaumcraftAspectTempus;
// This is a reference to the Tempus aspect. Initialized after MagicBees's post init phase.
// Ensure it is not null, and cast it to thaumcraft.api.aspects.Aspect.
public static Object thaumcraftAspectTempus;
} }
@@ -1,8 +1,7 @@
package magicbees.api.bees; package magicbees.api.bees;
public enum AuraChargeType { public enum AuraChargeType {
MUTATION, MUTATION,
DEATH, DEATH,
PRODUCTION, PRODUCTION,;
;
} }
@@ -1,46 +1,42 @@
package magicbees.api.bees; package magicbees.api.bees;
/** /**
* Allows a tile entity to provide a Magic Apiary with 'aura' to boost bee production, mutation rate, * Allows a tile entity to provide a Magic Apiary with 'aura' to boost bee production, mutation rate, or decrease bee
* or decrease bee lifespan. * lifespan.
* *
* @author MysteriousAges * @author MysteriousAges
*/ */
public interface IMagicApiaryAuraProvider { public interface IMagicApiaryAuraProvider {
/** /**
* Requests a mutation charge from the aura provider. If true is returned, the * Requests a mutation charge from the aura provider. If true is returned, the aura provider should decrement its
* aura provider should decrement its internal charge by one. If there are no * internal charge by one. If there are no charges remaining, it should return false.
* charges remaining, it should return false. *
* * @return True if a charge is given; false otherwise.
* @return True if a charge is given; false otherwise. */
*/ boolean getMutationCharge();
boolean getMutationCharge();
/** /**
* Requests a mutation charge from the aura provider. If true is returned, the * Requests a mutation charge from the aura provider. If true is returned, the aura provider should decrement its
* aura provider should decrement its internal charge by one. If there are no * internal charge by one. If there are no charges remaining, it should return false.
* charges remaining, it should return false. *
* * @return True if a charge is given; false otherwise.
* @return True if a charge is given; false otherwise. */
*/ boolean getDeathRateCharge();
boolean getDeathRateCharge();
/** /**
* Requests a mutation charge from the aura provider. If true is returned, the * Requests a mutation charge from the aura provider. If true is returned, the aura provider should decrement its
* aura provider should decrement its internal charge by one. If there are no * internal charge by one. If there are no charges remaining, it should return false.
* charges remaining, it should return false. *
* * @return True if a charge is given; false otherwise.
* @return True if a charge is given; false otherwise. */
*/ boolean getProductionCharge();
boolean getProductionCharge();
/** /**
* Requests a mutation charge from the aura provider. If true is returned, the * Requests a mutation charge from the aura provider. If true is returned, the aura provider should decrement its
* aura provider should decrement its internal charge by one. If there are no * internal charge by one. If there are no charges remaining, it should return false.
* charges remaining, it should return false. *
* * @return True if a charge is given; false otherwise.
* @return True if a charge is given; false otherwise. */
*/ boolean getCharge(AuraChargeType auraChargeType);
boolean getCharge(AuraChargeType auraChargeType);
} }
@@ -1,14 +1,12 @@
package magicbees.api.bees; package magicbees.api.bees;
/** /**
* Manages adding custom ITransmutationEffectLogic instances into the bee effect * Manages adding custom ITransmutationEffectLogic instances into the bee effect system.
* system.
* *
* @author MysteriousAges * @author MysteriousAges
* *
*/ */
public interface ITransmutationEffectController public interface ITransmutationEffectController {
{
public void addEffectLogic(ITransmutationEffectLogic logic);
public void addEffectLogic(ITransmutationEffectLogic logic);
} }
@@ -5,29 +5,27 @@ import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
/** /**
* Class to control plugin logic for the Transmutation bee effect. Turns blocks * Class to control plugin logic for the Transmutation bee effect. Turns blocks into other blocks based on biome, time
* into other blocks based on biome, time of day, or whatever is deemed * of day, or whatever is deemed appropriate at the time.
* appropriate at the time.
* *
* @author MysteriousAges * @author MysteriousAges
* *
*/ */
public interface ITransmutationEffectLogic public interface ITransmutationEffectLogic {
{
/** /**
* Allows an external mod to add transmutation logic to the Transmuting bee effect. * Allows an external mod to add transmutation logic to the Transmuting bee effect. Called from a list of
* Called from a list of ITransmutationEffectLogic until one returns true. You can * ITransmutationEffectLogic until one returns true. You can implement more than one transmutation effect in a
* implement more than one transmutation effect in a single implementation of the * single implementation of the interface. Function checks for a series of conditions based on block ID/meta, or
* interface. Function checks for a series of conditions based on block ID/meta, or * biome information, or world information.
* biome information, or world information. *
* * @param world World object
* @param world World object * @param biome Biome information for current coordinates
* @param biome Biome information for current coordinates * @param sourceBlock ItemStack representing the block at current coordinates
* @param sourceBlock ItemStack representing the block at current coordinates * @param x Current X coordinate to attempt a transmute
* @param x Current X coordinate to attempt a transmute * @param y Current Y coordinate to attempt a transmute
* @param y Current Y coordinate to attempt a transmute * @param z Current Z coordinate to attempt a transmute
* @param z Current Z coordinate to attempt a transmute * @return true if a block was changed.
* @return true if a block was changed. */
*/ public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z);
public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z);
} }
+256 -249
View File
@@ -1,5 +1,17 @@
package magicbees.bees; package magicbees.bees;
import net.minecraft.potion.Potion;
import forestry.api.apiculture.EnumBeeChromosome;
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;
import forestry.api.genetics.IChromosomeType;
import forestry.api.genetics.IFlowerProvider;
import magicbees.api.MagicBeesAPI; import magicbees.api.MagicBeesAPI;
import magicbees.bees.allele.effect.AlleleEffectCrumbling; import magicbees.bees.allele.effect.AlleleEffectCrumbling;
import magicbees.bees.allele.effect.AlleleEffectCure; import magicbees.bees.allele.effect.AlleleEffectCure;
@@ -27,290 +39,285 @@ import magicbees.main.utils.compat.ArsMagicaHelper;
import magicbees.main.utils.compat.BotaniaHelper; import magicbees.main.utils.compat.BotaniaHelper;
import magicbees.main.utils.compat.ThaumcraftHelper; import magicbees.main.utils.compat.ThaumcraftHelper;
import magicbees.main.utils.compat.ThermalModsHelper; import magicbees.main.utils.compat.ThermalModsHelper;
import net.minecraft.potion.Potion;
import thaumcraft.api.nodes.NodeType; import thaumcraft.api.nodes.NodeType;
import forestry.api.apiculture.EnumBeeChromosome;
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;
import forestry.api.genetics.IChromosomeType;
import forestry.api.genetics.IFlowerProvider;
public class Allele implements IAllele { public class Allele implements IAllele {
private static final String FLOWER_ARS_MAGICA_PLANT = "flowerArsMagicaPlant"; private static final String FLOWER_ARS_MAGICA_PLANT = "flowerArsMagicaPlant";
private static final String FLOWER_BOTANIA = "flowerBotania"; private static final String FLOWER_BOTANIA = "flowerBotania";
private static final String EFFECT_TE_BLIZZY = "TEBlizzy"; private static final String EFFECT_TE_BLIZZY = "TEBlizzy";
private static final String EFFECT_TE_BLITZ = "TEBlitz"; private static final String EFFECT_TE_BLITZ = "TEBlitz";
private static final String EFFECT_TE_BASALZ = "TEBasalz"; private static final String EFFECT_TE_BASALZ = "TEBasalz";
private static final String EFFECT_AM_WISP = "AMWisp"; private static final String EFFECT_AM_WISP = "AMWisp";
private static final String EFFECT_MANA_DRAIN = "ManaDrain"; private static final String EFFECT_MANA_DRAIN = "ManaDrain";
private static final String EFFECT_DREAMING = "Dreaming"; private static final String EFFECT_DREAMING = "Dreaming";
private static final String EFFECT_WISPY = "Wispy"; private static final String EFFECT_WISPY = "Wispy";
private static final String EFFECT_BATTY = "Batty"; private static final String EFFECT_BATTY = "Batty";
private static final String EFFECT_BRAINY = "Brainy"; private static final String EFFECT_BRAINY = "Brainy";
private static final String EFFECT_NODE_RAVENING = "NodeRavening"; private static final String EFFECT_NODE_RAVENING = "NodeRavening";
private static final String EFFECT_NODE_PURIFYING = "NodePurifying"; private static final String EFFECT_NODE_PURIFYING = "NodePurifying";
private static final String EFFECT_NODE_TAINTING = "NodeTainting"; private static final String EFFECT_NODE_TAINTING = "NodeTainting";
private static final String EFFECT_NODE_REPAIR = "NodeRepair"; private static final String EFFECT_NODE_REPAIR = "NodeRepair";
private static final String EFFECT_NODE_EMPOWER = "NodeEmpower"; private static final String EFFECT_NODE_EMPOWER = "NodeEmpower";
private static final String EFFECT_VIS_RECHARGE = "VisRecharge"; private static final String EFFECT_VIS_RECHARGE = "VisRecharge";
private static final String FLOWERS_AURA_NODE = "AuraNode"; private static final String FLOWERS_AURA_NODE = "AuraNode";
private static final String FLOWERS_THAUMCRAFT_PLANT = "ThaumcraftPlant"; private static final String FLOWERS_THAUMCRAFT_PLANT = "ThaumcraftPlant";
public static AlleleFloat speedBlinding; public static AlleleFloat speedBlinding;
public static IAlleleBeeEffect forestryBaseEffect; public static IAlleleBeeEffect forestryBaseEffect;
public static IAlleleFlowers flowerBookshelf; public static IAlleleFlowers flowerBookshelf;
public static IAlleleFlowers flowerThaumcraft; public static IAlleleFlowers flowerThaumcraft;
public static IAlleleFlowers flowerArsMagica; public static IAlleleFlowers flowerArsMagica;
public static IAlleleFlowers flowerAuraNode; public static IAlleleFlowers flowerAuraNode;
public static IAlleleFlowers flowerBotania; public static IAlleleFlowers flowerBotania;
public static IAlleleEffect effectCleansing; public static IAlleleEffect effectCleansing;
public static IAlleleEffect effectDigSpeed; public static IAlleleEffect effectDigSpeed;
public static IAlleleEffect effectMoveSpeed; public static IAlleleEffect effectMoveSpeed;
public static IAlleleEffect effectSlowSpeed; public static IAlleleEffect effectSlowSpeed;
public static IAlleleEffect effectWithering; public static IAlleleEffect effectWithering;
public static IAlleleEffect effectVisRecharge; public static IAlleleEffect effectVisRecharge;
public static IAlleleEffect effectNodeEmpower; public static IAlleleEffect effectNodeEmpower;
public static IAlleleEffect effectNodeRepair; public static IAlleleEffect effectNodeRepair;
public static IAlleleEffect effectNodeConversionTaint; public static IAlleleEffect effectNodeConversionTaint;
public static IAlleleEffect effectNodeConversionPure; public static IAlleleEffect effectNodeConversionPure;
public static IAlleleEffect effectNodeConversionHungry; public static IAlleleEffect effectNodeConversionHungry;
public static IAlleleEffect effectTransmuting; public static IAlleleEffect effectTransmuting;
public static IAlleleEffect effectCrumbling; public static IAlleleEffect effectCrumbling;
public static IAlleleEffect effectInvisibility; public static IAlleleEffect effectInvisibility;
public static IAlleleEffect effectDreaming; public static IAlleleEffect effectDreaming;
public static IAlleleEffect spawnWolf; public static IAlleleEffect spawnWolf;
public static IAlleleEffect spawnBats; public static IAlleleEffect spawnBats;
public static IAlleleEffect spawnCow; public static IAlleleEffect spawnCow;
public static IAlleleEffect spawnChicken; public static IAlleleEffect spawnChicken;
public static IAlleleEffect spawnPig; public static IAlleleEffect spawnPig;
public static IAlleleEffect spawnSheep; public static IAlleleEffect spawnSheep;
public static IAlleleEffect spawnCat; public static IAlleleEffect spawnCat;
public static IAlleleEffect spawnHorse; public static IAlleleEffect spawnHorse;
public static IAlleleEffect spawnGhast; public static IAlleleEffect spawnGhast;
public static IAlleleEffect spawnSpider; public static IAlleleEffect spawnSpider;
public static IAlleleEffect spawnBlaze; public static IAlleleEffect spawnBlaze;
public static IAlleleEffect spawnBrainyZombie; public static IAlleleEffect spawnBrainyZombie;
public static IAlleleEffect spawnWisp; public static IAlleleEffect spawnWisp;
public static IAlleleEffect spawnBlizz; public static IAlleleEffect spawnBlizz;
public static IAlleleEffect spawnBlitz; public static IAlleleEffect spawnBlitz;
public static IAlleleEffect spawnBasalz; public static IAlleleEffect spawnBasalz;
public static IAlleleEffect spawnManaDrainer; public static IAlleleEffect spawnManaDrainer;
public static IAlleleEffect spawnWispOrHecate; public static IAlleleEffect spawnWispOrHecate;
public static void setupAdditionalAlleles() { public static void setupAdditionalAlleles() {
forestryBaseEffect = (IAlleleBeeEffect) getBaseAllele("effectNone"); forestryBaseEffect = (IAlleleBeeEffect) getBaseAllele("effectNone");
IFlowerProvider vanillaFlowers = ((IAlleleFlowers)getBaseAllele("flowersVanilla")).getProvider(); IFlowerProvider vanillaFlowers = ((IAlleleFlowers) getBaseAllele("flowersVanilla")).getProvider();
speedBlinding = new AlleleFloat("speedBlinding", 2f, false, EnumBeeChromosome.SPEED); speedBlinding = new AlleleFloat("speedBlinding", 2f, false, EnumBeeChromosome.SPEED);
flowerBookshelf = new AlleleFlower("Bookshelf", new FlowerProviderBookshelf(), true); flowerBookshelf = new AlleleFlower("Bookshelf", new FlowerProviderBookshelf(), true);
effectCleansing = new AlleleEffectCure("Curative", false); effectCleansing = new AlleleEffectCure("Curative", false);
effectDigSpeed = new AlleleEffectPotion("DigSpeed", Potion.digSpeed, 15, false); effectDigSpeed = new AlleleEffectPotion("DigSpeed", Potion.digSpeed, 15, false);
effectMoveSpeed = new AlleleEffectPotion("MoveSpeed", Potion.moveSpeed, 10, false); effectMoveSpeed = new AlleleEffectPotion("MoveSpeed", Potion.moveSpeed, 10, false);
effectSlowSpeed = new AlleleEffectPotion("SlowSpeed", Potion.moveSlowdown, 3, false).setMalicious(); effectSlowSpeed = new AlleleEffectPotion("SlowSpeed", Potion.moveSlowdown, 3, false).setMalicious();
effectWithering = new AlleleEffectPotion("Withering", Potion.wither, 10, false).setMalicious(); effectWithering = new AlleleEffectPotion("Withering", Potion.wither, 10, false).setMalicious();
TransmutationEffectController controller = new TransmutationEffectController( TransmutationEffectController controller = new TransmutationEffectController(
new TransmutationEffectRailcraft(), new TransmutationEffectRailcraft(),
new TransmutationEffectVanilla() new TransmutationEffectVanilla());
); MagicBeesAPI.transmutationEffectController = controller;
MagicBeesAPI.transmutationEffectController = controller; effectTransmuting = new AlleleEffectTransmuting("Transmuting", true, controller, 200);
effectTransmuting = new AlleleEffectTransmuting("Transmuting", true, controller, 200); effectCrumbling = new AlleleEffectCrumbling("Crumbling", true);
effectCrumbling = new AlleleEffectCrumbling("Crumbling", true);
effectInvisibility = new AlleleEffectPotion("Invisibility", Potion.invisibility, 10, false); effectInvisibility = new AlleleEffectPotion("Invisibility", Potion.invisibility, 10, false);
spawnGhast = new AlleleEffectSpawnMob("Ghastly", false, "Ghast", "mob.ghast.moan") spawnGhast = new AlleleEffectSpawnMob("Ghastly", false, "Ghast", "mob.ghast.moan").setThrottle(2060)
.setThrottle(2060) .setChanceToSpawn(10).setMaxMobsInSpawnZone(1);
.setChanceToSpawn(10) spawnSpider = new AlleleEffectSpawnMob("Spidery", false, "Spider", "mob.spider.step").setThrottle(400)
.setMaxMobsInSpawnZone(1); .setChanceToSpawn(70).setMaxMobsInSpawnZone(4);
spawnSpider = new AlleleEffectSpawnMob("Spidery", false, "Spider", "mob.spider.step") spawnBlaze = new AlleleEffectSpawnMob("Ablaze", false, "Blaze", "mob.blaze.breathe").setThrottle(800)
.setThrottle(400) .setChanceToSpawn(60).setMaxMobsInSpawnZone(2);
.setChanceToSpawn(70) spawnWolf = new AlleleEffectSpawnMob("Canine", false, "Wolf", "mob.wolf.panting").setThrottle(650)
.setMaxMobsInSpawnZone(4); .setChanceToSpawn(40).setMaxMobsInSpawnZone(2);
spawnBlaze = new AlleleEffectSpawnMob("Ablaze", false, "Blaze", "mob.blaze.breathe") spawnPig = new AlleleEffectSpawnMob("Porcine", true, "Pig", "mob.pig.say").setThrottle(350)
.setThrottle(800) .setMaxMobsInSpawnZone(4);
.setChanceToSpawn(60) spawnCow = new AlleleEffectSpawnMob("Bovine", true, "Cow", "mob.cow.say").setThrottle(640)
.setMaxMobsInSpawnZone(2); .setMaxMobsInSpawnZone(3);
spawnWolf = new AlleleEffectSpawnMob("Canine", false , "Wolf", "mob.wolf.panting") spawnChicken = new AlleleEffectSpawnMob("Chicken", true, "Chicken", "mob.chicken.hurt").setThrottle(20)
.setThrottle(650) .setMaxMobsInSpawnZone(20);
.setChanceToSpawn(40) spawnSheep = new AlleleEffectSpawnMob("Sheep", false, "Sheep", "mob.sheep.say").setThrottle(450)
.setMaxMobsInSpawnZone(2); .setMaxMobsInSpawnZone(5);
spawnPig = new AlleleEffectSpawnMob("Porcine", true, "Pig", "mob.pig.say") spawnCat = new AlleleEffectSpawnMob("Catty", false, "Ozelot", "mob.cat.meow").setThrottle(702)
.setThrottle(350) .setChanceToSpawn(60).setMaxMobsInSpawnZone(2);
.setMaxMobsInSpawnZone(4); spawnHorse = new AlleleEffectSpawnMob("Horse", false, "EntityHorse", "mob.horse.idle").setThrottle(450)
spawnCow = new AlleleEffectSpawnMob("Bovine", true, "Cow", "mob.cow.say") .setChanceToSpawn(59).setMaxMobsInSpawnZone(2);
.setThrottle(640)
.setMaxMobsInSpawnZone(3);
spawnChicken = new AlleleEffectSpawnMob("Chicken", true, "Chicken", "mob.chicken.hurt")
.setThrottle(20)
.setMaxMobsInSpawnZone(20);
spawnSheep = new AlleleEffectSpawnMob("Sheep", false, "Sheep", "mob.sheep.say")
.setThrottle(450)
.setMaxMobsInSpawnZone(5);
spawnCat = new AlleleEffectSpawnMob("Catty", false, "Ozelot", "mob.cat.meow")
.setThrottle(702)
.setChanceToSpawn(60)
.setMaxMobsInSpawnZone(2);
spawnHorse = new AlleleEffectSpawnMob("Horse", false, "EntityHorse", "mob.horse.idle")
.setThrottle(450)
.setChanceToSpawn(59)
.setMaxMobsInSpawnZone(2);
if (ThaumcraftHelper.isActive()) { if (ThaumcraftHelper.isActive()) {
flowerThaumcraft = new AlleleFlower(FLOWERS_THAUMCRAFT_PLANT, new FlowerProviderThaumcraftFlower(), false); flowerThaumcraft = new AlleleFlower(FLOWERS_THAUMCRAFT_PLANT, new FlowerProviderThaumcraftFlower(), false);
flowerAuraNode = new AlleleFlower(FLOWERS_AURA_NODE, new FlowerProviderAuraNode(), true); flowerAuraNode = new AlleleFlower(FLOWERS_AURA_NODE, new FlowerProviderAuraNode(), true);
effectVisRecharge = new AlleleEffectRecharge(EFFECT_VIS_RECHARGE, false); effectVisRecharge = new AlleleEffectRecharge(EFFECT_VIS_RECHARGE, false);
effectNodeEmpower = new AlleleEffectEmpowering(EFFECT_NODE_EMPOWER, false); effectNodeEmpower = new AlleleEffectEmpowering(EFFECT_NODE_EMPOWER, false);
effectNodeRepair = new AlleleEffectNodeRepair(EFFECT_NODE_REPAIR, false); effectNodeRepair = new AlleleEffectNodeRepair(EFFECT_NODE_REPAIR, false);
effectNodeConversionTaint = new AlleleEffectNodeConversion(EFFECT_NODE_TAINTING, NodeType.TAINTED, false, 250); effectNodeConversionTaint = new AlleleEffectNodeConversion(
effectNodeConversionPure = new AlleleEffectNodeConversion(EFFECT_NODE_PURIFYING, NodeType.PURE, false, 250); EFFECT_NODE_TAINTING,
effectNodeConversionHungry = new AlleleEffectNodeConversion(EFFECT_NODE_RAVENING, NodeType.HUNGRY, false, 2); NodeType.TAINTED,
false,
250);
effectNodeConversionPure = new AlleleEffectNodeConversion(EFFECT_NODE_PURIFYING, NodeType.PURE, false, 250);
effectNodeConversionHungry = new AlleleEffectNodeConversion(
EFFECT_NODE_RAVENING,
NodeType.HUNGRY,
false,
2);
spawnBrainyZombie = new AlleleEffectSpawnMob(EFFECT_BRAINY, false, ThaumcraftHelper.Entity.BRAINY_ZOMBIE.entityID) spawnBrainyZombie = new AlleleEffectSpawnMob(
.setAggrosPlayerOnSpawn() EFFECT_BRAINY,
.setThrottle(800) false,
.setSpawnsOnPlayerNear(null) ThaumcraftHelper.Entity.BRAINY_ZOMBIE.entityID).setAggrosPlayerOnSpawn().setThrottle(800)
.setMaxMobsInSpawnZone(2); .setSpawnsOnPlayerNear(null).setMaxMobsInSpawnZone(2);
spawnBats = new AlleleEffectSpawnMob(EFFECT_BATTY, false, ThaumcraftHelper.Entity.FIREBAT.entityID) spawnBats = new AlleleEffectSpawnMob(EFFECT_BATTY, false, ThaumcraftHelper.Entity.FIREBAT.entityID)
.setThrottle(300) .setThrottle(300).setSpawnsOnPlayerNear("Bat");
.setSpawnsOnPlayerNear("Bat");
spawnWisp = new AlleleEffectSpawnWisp(EFFECT_WISPY, false, ThaumcraftHelper.Entity.WISP.entityID, "thaumcraft.wisplive") spawnWisp = new AlleleEffectSpawnWisp(
.setThrottle(1800) EFFECT_WISPY,
.setChanceToSpawn(79); false,
} ThaumcraftHelper.Entity.WISP.entityID,
else { "thaumcraft.wisplive").setThrottle(1800).setChanceToSpawn(79);
spawnBats = new AlleleEffectSpawnMob(EFFECT_BATTY, false, "Bat") } else {
.setThrottle(150); spawnBats = new AlleleEffectSpawnMob(EFFECT_BATTY, false, "Bat").setThrottle(150);
flowerThaumcraft = new AlleleFlower(FLOWERS_THAUMCRAFT_PLANT, vanillaFlowers, false); flowerThaumcraft = new AlleleFlower(FLOWERS_THAUMCRAFT_PLANT, vanillaFlowers, false);
flowerAuraNode = new AlleleFlower(FLOWERS_AURA_NODE, vanillaFlowers, true);Allele.effectVisRecharge = new AlleleEffectRecharge(EFFECT_VIS_RECHARGE, false); flowerAuraNode = new AlleleFlower(FLOWERS_AURA_NODE, vanillaFlowers, true);
effectNodeEmpower = new AlleleEffectPlaceholder(EFFECT_NODE_EMPOWER, false); Allele.effectVisRecharge = new AlleleEffectRecharge(EFFECT_VIS_RECHARGE, false);
effectNodeRepair = new AlleleEffectPlaceholder(EFFECT_NODE_REPAIR, false); effectNodeEmpower = new AlleleEffectPlaceholder(EFFECT_NODE_EMPOWER, false);
effectNodeConversionTaint = new AlleleEffectPlaceholder(EFFECT_NODE_TAINTING, false); effectNodeRepair = new AlleleEffectPlaceholder(EFFECT_NODE_REPAIR, false);
effectNodeConversionPure = new AlleleEffectPlaceholder(EFFECT_NODE_PURIFYING, false); effectNodeConversionTaint = new AlleleEffectPlaceholder(EFFECT_NODE_TAINTING, false);
effectNodeConversionHungry = new AlleleEffectPlaceholder(EFFECT_NODE_RAVENING, false); effectNodeConversionPure = new AlleleEffectPlaceholder(EFFECT_NODE_PURIFYING, false);
spawnBrainyZombie = new AlleleEffectPlaceholder(EFFECT_BRAINY, false); effectNodeConversionHungry = new AlleleEffectPlaceholder(EFFECT_NODE_RAVENING, false);
spawnWisp = new AlleleEffectPlaceholder(EFFECT_WISPY, false); spawnBrainyZombie = new AlleleEffectPlaceholder(EFFECT_BRAINY, false);
} spawnWisp = new AlleleEffectPlaceholder(EFFECT_WISPY, false);
}
if (BotaniaHelper.isActive()) { if (BotaniaHelper.isActive()) {
flowerBotania = new AlleleFlower(FLOWER_BOTANIA, new FlowerProviderBotania(), true); flowerBotania = new AlleleFlower(FLOWER_BOTANIA, new FlowerProviderBotania(), true);
effectDreaming = new AlleleEffectTransmuting(EFFECT_DREAMING, false, effectDreaming = new AlleleEffectTransmuting(
new TransmutationEffectController(new TransmutationEffectLBotaniaLiving()), 100); EFFECT_DREAMING,
} false,
else { new TransmutationEffectController(new TransmutationEffectLBotaniaLiving()),
flowerBotania = new AlleleFlower(FLOWER_BOTANIA, vanillaFlowers, true); 100);
effectDreaming = new AlleleEffectPlaceholder(EFFECT_DREAMING, false); } else {
} flowerBotania = new AlleleFlower(FLOWER_BOTANIA, vanillaFlowers, true);
effectDreaming = new AlleleEffectPlaceholder(EFFECT_DREAMING, false);
}
if (ArsMagicaHelper.isActive()) { if (ArsMagicaHelper.isActive()) {
flowerArsMagica = new AlleleFlower(FLOWER_ARS_MAGICA_PLANT, new FlowerProviderArsMagicaFlower(), false); flowerArsMagica = new AlleleFlower(FLOWER_ARS_MAGICA_PLANT, new FlowerProviderArsMagicaFlower(), false);
spawnManaDrainer = new AlleleEffectSpawnMobWeighted(EFFECT_MANA_DRAIN, true, 20, spawnManaDrainer = new AlleleEffectSpawnMobWeighted(
new String[] { ArsMagicaHelper.Name + ".MobManaCreeper", ArsMagicaHelper.Name + ".ManaVortex" }, EFFECT_MANA_DRAIN,
new int[] { 60, 2 } true,
); 20,
new String[] { ArsMagicaHelper.Name + ".MobManaCreeper", ArsMagicaHelper.Name + ".ManaVortex" },
new int[] { 60, 2 });
spawnWispOrHecate = new AlleleEffectSpawnMobWeighted(EFFECT_AM_WISP, true, 20, spawnWispOrHecate = new AlleleEffectSpawnMobWeighted(
new String[] { ArsMagicaHelper.Name + ".MobWisp", ArsMagicaHelper.Name + ".MobHecate" }, EFFECT_AM_WISP,
new int[] { 40, 3 } true,
); 20,
} new String[] { ArsMagicaHelper.Name + ".MobWisp", ArsMagicaHelper.Name + ".MobHecate" },
else { new int[] { 40, 3 });
flowerArsMagica = new AlleleFlower(FLOWER_ARS_MAGICA_PLANT, vanillaFlowers, false); } else {
spawnManaDrainer = new AlleleEffectPlaceholder(EFFECT_MANA_DRAIN, true); flowerArsMagica = new AlleleFlower(FLOWER_ARS_MAGICA_PLANT, vanillaFlowers, false);
spawnWispOrHecate = new AlleleEffectPlaceholder(EFFECT_AM_WISP, true); spawnManaDrainer = new AlleleEffectPlaceholder(EFFECT_MANA_DRAIN, true);
} spawnWispOrHecate = new AlleleEffectPlaceholder(EFFECT_AM_WISP, true);
}
//TODO TE spawning // TODO TE spawning
if (ThermalModsHelper.isActive()) { if (ThermalModsHelper.isActive()) {
spawnBlizz = new AlleleEffectSpawnMob(EFFECT_TE_BLIZZY, true, ThermalModsHelper.Entity.BLIZZ.entityID, ThermalModsHelper.Entity.BLIZZ.soundName) spawnBlizz = new AlleleEffectSpawnMob(
.setThrottle(100) EFFECT_TE_BLIZZY,
.setChanceToSpawn(80); true,
spawnBlitz = new AlleleEffectSpawnMob(EFFECT_TE_BLITZ, true, ThermalModsHelper.Entity.BLITZ.entityID, ThermalModsHelper.Entity.BLITZ.soundName) ThermalModsHelper.Entity.BLIZZ.entityID,
.setThrottle(100) ThermalModsHelper.Entity.BLIZZ.soundName).setThrottle(100).setChanceToSpawn(80);
.setChanceToSpawn(80); spawnBlitz = new AlleleEffectSpawnMob(
spawnBasalz = new AlleleEffectSpawnMob(EFFECT_TE_BASALZ, true, ThermalModsHelper.Entity.BASALZ.entityID, ThermalModsHelper.Entity.BASALZ.soundName) EFFECT_TE_BLITZ,
.setThrottle(100) true,
.setChanceToSpawn(80); ThermalModsHelper.Entity.BLITZ.entityID,
} ThermalModsHelper.Entity.BLITZ.soundName).setThrottle(100).setChanceToSpawn(80);
else { spawnBasalz = new AlleleEffectSpawnMob(
spawnBlizz = new AlleleEffectPlaceholder(EFFECT_TE_BLIZZY, true); EFFECT_TE_BASALZ,
spawnBlitz = new AlleleEffectPlaceholder(EFFECT_TE_BLITZ, true); true,
spawnBasalz = new AlleleEffectPlaceholder(EFFECT_TE_BASALZ, true); ThermalModsHelper.Entity.BASALZ.entityID,
} ThermalModsHelper.Entity.BASALZ.soundName).setThrottle(100).setChanceToSpawn(80);
} } else {
spawnBlizz = new AlleleEffectPlaceholder(EFFECT_TE_BLIZZY, true);
spawnBlitz = new AlleleEffectPlaceholder(EFFECT_TE_BLITZ, true);
spawnBasalz = new AlleleEffectPlaceholder(EFFECT_TE_BASALZ, true);
}
}
public static void registerDeprecatedAlleleReplacements() { public static void registerDeprecatedAlleleReplacements() {
IAlleleRegistry registry = AlleleManager.alleleRegistry; IAlleleRegistry registry = AlleleManager.alleleRegistry;
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeAttract", effectNodeEmpower); registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeAttract", effectNodeEmpower);
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodePurify", effectNodeConversionPure); registry.registerDeprecatedAlleleReplacement("magicbees.effectNodePurify", effectNodeConversionPure);
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeFlux", effectNodeConversionTaint); registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeFlux", effectNodeConversionTaint);
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeCharge", effectNodeEmpower); registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeCharge", effectNodeEmpower);
registry.registerDeprecatedAlleleReplacement("magicbees.speciesTCAttractive", BeeSpecies.TC_EMPOWERING.getSpecies()); registry.registerDeprecatedAlleleReplacement(
registry.registerDeprecatedAlleleReplacement("magicbees.speciesBMBloodyBMBloody", BeeSpecies.EARTHY.getSpecies()); "magicbees.speciesTCAttractive",
registry.registerDeprecatedAlleleReplacement("magicbees.speciesBMBloodyBMBound", BeeSpecies.ARCANE.getSpecies()); BeeSpecies.TC_EMPOWERING.getSpecies());
} registry.registerDeprecatedAlleleReplacement(
"magicbees.speciesBMBloodyBMBloody",
BeeSpecies.EARTHY.getSpecies());
registry.registerDeprecatedAlleleReplacement(
"magicbees.speciesBMBloodyBMBound",
BeeSpecies.ARCANE.getSpecies());
}
public static IAlleleBeeSpecies getBaseSpecies(String name) { public static IAlleleBeeSpecies getBaseSpecies(String name) {
return (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele((new StringBuilder()).append("forestry.species").append(name).toString()); return (IAlleleBeeSpecies) AlleleManager.alleleRegistry
} .getAllele((new StringBuilder()).append("forestry.species").append(name).toString());
}
public static IAlleleBeeSpecies getExtraSpecies(String name) { public static IAlleleBeeSpecies getExtraSpecies(String name) {
return (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele((new StringBuilder()).append("extrabees.species.").append(name.toLowerCase()) return (IAlleleBeeSpecies) AlleleManager.alleleRegistry
.toString()); .getAllele((new StringBuilder()).append("extrabees.species.").append(name.toLowerCase()).toString());
} }
public static IAllele getBaseAllele(String name) { public static IAllele getBaseAllele(String name) {
return AlleleManager.alleleRegistry.getAllele("forestry." + name); return AlleleManager.alleleRegistry.getAllele("forestry." + name);
} }
public static IAllele getAllele(String name) { public static IAllele getAllele(String name) {
return AlleleManager.alleleRegistry.getAllele(name); return AlleleManager.alleleRegistry.getAllele(name);
} }
private String uid; private String uid;
private boolean dominant; private boolean dominant;
public Allele(String id, boolean isDominant, IChromosomeType... chromosomeTypes) { public Allele(String id, boolean isDominant, IChromosomeType... chromosomeTypes) {
this.uid = "magicbees." + id; this.uid = "magicbees." + id;
this.dominant = isDominant; this.dominant = isDominant;
AlleleManager.alleleRegistry.registerAllele(this, chromosomeTypes); AlleleManager.alleleRegistry.registerAllele(this, chromosomeTypes);
} }
@Override @Override
public String getUID() { public String getUID() {
return this.uid; return this.uid;
} }
@Override @Override
public boolean isDominant() { public boolean isDominant() {
return this.dominant; return this.dominant;
} }
@Override @Override
public String getName() { public String getName() {
return LocalizationManager.getLocalizedString(getUID()); return LocalizationManager.getLocalizedString(getUID());
} }
@Override
public String getUnlocalizedName() {
return this.uid;
}
@Override
public String getUnlocalizedName() {
return this.uid;
}
} }
+57 -67
View File
@@ -3,8 +3,6 @@ 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.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.ChunkCoordinates;
@@ -14,82 +12,74 @@ import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeHousing;
import forestry.api.genetics.IEffectData; import forestry.api.genetics.IEffectData;
public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect {
{
protected int throttle;
protected boolean combinable;
public AlleleEffect(String id, boolean isDominant, int timeout) protected int throttle;
{ protected boolean combinable;
super("effect" + id, isDominant, EnumBeeChromosome.EFFECT);
this.throttle = timeout;
combinable = false;
}
@Override public AlleleEffect(String id, boolean isDominant, int timeout) {
public boolean isCombinable() super("effect" + id, isDominant, EnumBeeChromosome.EFFECT);
{ this.throttle = timeout;
return combinable; combinable = false;
} }
public AlleleEffect setIsCombinable(boolean canCombine) { @Override
combinable = canCombine; public boolean isCombinable() {
return this; return combinable;
} }
@Override public AlleleEffect setIsCombinable(boolean canCombine) {
public abstract IEffectData validateStorage(IEffectData storedData); combinable = canCombine;
return this;
}
@Override @Override
public final IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) public abstract IEffectData validateStorage(IEffectData storedData);
{
int count = storedData.getInteger(0);
if (count >= this.throttle)
{
storedData = this.doEffectThrottled(genome, storedData, housing);
}
else
{
storedData.setInteger(0, count + 1);
}
return storedData;
}
/** @Override
* @param genome public final IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
* @param storedData int count = storedData.getInteger(0);
* @param housing if (count >= this.throttle) {
* @return storedData = this.doEffectThrottled(genome, storedData, housing);
*/ } else {
protected abstract IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing); storedData.setInteger(0, count + 1);
}
return storedData;
}
@Override /**
public IEffectData doFX(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) * @param genome
{ * @param storedData
return Allele.forestryBaseEffect.doFX(genome, storedData, housing); * @param housing
} * @return
*/
protected abstract IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing);
@SuppressWarnings("unchecked") @Override
protected <T extends Entity> List<T> getEntitiesWithinRange(IBeeGenome genome, IBeeHousing housing, Class<T> entityClass) public IEffectData doFX(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
{ return Allele.forestryBaseEffect.doFX(genome, storedData, housing);
// Get the size of the affected area }
int[] area = genome.getTerritory();
ChunkCoordinates coords = housing.getCoordinates();
// Calculate offset @SuppressWarnings("unchecked")
int[] min = new int[3]; protected <T extends Entity> List<T> getEntitiesWithinRange(IBeeGenome genome, IBeeHousing housing,
int[] max = new int[3]; Class<T> entityClass) {
min[0] = coords.posX - area[0] / 2; // Get the size of the affected area
max[0] = coords.posX + area[0] / 2; int[] area = genome.getTerritory();
ChunkCoordinates coords = housing.getCoordinates();
min[1] = coords.posY - area[1] / 2; // Calculate offset
max[1] = coords.posY + area[1] / 2; int[] min = new int[3];
int[] max = new int[3];
min[0] = coords.posX - area[0] / 2;
max[0] = coords.posX + area[0] / 2;
min[2] = coords.posZ - area[2] / 2; min[1] = coords.posY - area[1] / 2;
max[2] = coords.posZ + area[2] / 2; max[1] = coords.posY + area[1] / 2;
AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(min[0], min[1], min[2], max[0], max[1], max[2]); min[2] = coords.posZ - area[2] / 2;
return (List<T>)housing.getWorld().getEntitiesWithinAABB(entityClass, bounds); max[2] = coords.posZ + area[2] / 2;
}
AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(min[0], min[1], min[2], max[0], max[1], max[2]);
return (List<T>) housing.getWorld().getEntitiesWithinAABB(entityClass, bounds);
}
} }
+10 -13
View File
@@ -3,20 +3,17 @@ package magicbees.bees;
import forestry.api.genetics.IAlleleFloat; import forestry.api.genetics.IAlleleFloat;
import forestry.api.genetics.IChromosomeType; import forestry.api.genetics.IChromosomeType;
public class AlleleFloat extends Allele implements IAlleleFloat public class AlleleFloat extends Allele implements IAlleleFloat {
{
private float value;
public AlleleFloat(String id, float val, boolean isDominant, IChromosomeType... chromosomeTypes) private float value;
{
super(id, isDominant, chromosomeTypes);
this.value = val;
}
@Override public AlleleFloat(String id, float val, boolean isDominant, IChromosomeType... chromosomeTypes) {
public float getValue() super(id, isDominant, chromosomeTypes);
{ this.value = val;
return this.value; }
}
@Override
public float getValue() {
return this.value;
}
} }
+14 -18
View File
@@ -1,29 +1,25 @@
package magicbees.bees; package magicbees.bees;
import forestry.api.apiculture.EnumBeeChromosome; import forestry.api.apiculture.EnumBeeChromosome;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IAlleleFlowers; import forestry.api.genetics.IAlleleFlowers;
import forestry.api.genetics.IFlowerProvider; import forestry.api.genetics.IFlowerProvider;
public class AlleleFlower extends Allele implements IAlleleFlowers public class AlleleFlower extends Allele implements IAlleleFlowers {
{
private IFlowerProvider provider;
public AlleleFlower(String uid, IFlowerProvider flowerProvider, boolean isDominant) private IFlowerProvider provider;
{
super("flower" + uid, isDominant, EnumBeeChromosome.FLOWER_PROVIDER);
this.provider = flowerProvider;
}
@Override public AlleleFlower(String uid, IFlowerProvider flowerProvider, boolean isDominant) {
public IFlowerProvider getProvider() super("flower" + uid, isDominant, EnumBeeChromosome.FLOWER_PROVIDER);
{ this.provider = flowerProvider;
return this.provider; }
}
@Override @Override
public String getName() { public IFlowerProvider getProvider() {
return this.provider.getDescription(); return this.provider;
} }
@Override
public String getName() {
return this.provider.getDescription();
}
} }
+24 -23
View File
@@ -3,31 +3,32 @@ package magicbees.bees;
import magicbees.api.bees.AuraChargeType; import magicbees.api.bees.AuraChargeType;
public enum AuraCharge { public enum AuraCharge {
MUTATION(AuraChargeType.MUTATION, 850, 11),
DEATH(AuraChargeType.DEATH, 400, 5),
PRODUCTION(AuraChargeType.PRODUCTION, 300, 3),
;
public final AuraChargeType type; MUTATION(AuraChargeType.MUTATION, 850, 11),
public final int duration; DEATH(AuraChargeType.DEATH, 400, 5),
/** The number of ticks to count between draining vis from the environment **/ PRODUCTION(AuraChargeType.PRODUCTION, 300, 3),;
public final int tickRate;
public final int flag;
AuraCharge(AuraChargeType chargeType, int duration, int tickRate) { public final AuraChargeType type;
this.type = chargeType; public final int duration;
this.duration = duration; /** The number of ticks to count between draining vis from the environment **/
this.tickRate = tickRate; public final int tickRate;
flag = 1 << ordinal();
}
public static AuraCharge fromChargeType(AuraChargeType type) { public final int flag;
for (AuraCharge charge : values()) {
if (type == charge.type) {
return charge;
}
}
return null; AuraCharge(AuraChargeType chargeType, int duration, int tickRate) {
} this.type = chargeType;
this.duration = duration;
this.tickRate = tickRate;
flag = 1 << ordinal();
}
public static AuraCharge fromChargeType(AuraChargeType type) {
for (AuraCharge charge : values()) {
if (type == charge.type) {
return charge;
}
}
return null;
}
} }
@@ -2,127 +2,110 @@ package magicbees.bees;
import java.util.ArrayList; import java.util.ArrayList;
import magicbees.main.utils.LocalizationManager;
import forestry.api.genetics.AlleleManager; import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IAlleleSpecies; import forestry.api.genetics.IAlleleSpecies;
import forestry.api.genetics.IClassification; import forestry.api.genetics.IClassification;
import magicbees.main.utils.LocalizationManager;
public enum BeeClassification implements 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"), VEILED("Veiled", "Velatapis"),
EXTRINSIC("Extrinsic", "Extrarapis"), ARCANE("Arcane", "Arcanapis"),
SUPERNATURAL("Supernatural", "Occultapis"),
SCHOLARLY("Scholarly", "Doctapis"),
SKULKING("Skulking", "Malevolenapis"),
MAGICAL("Magic", "Magicapis"),
TIME("Time", "Tempestivapis"),
SOUL("Soul", "Animapis"),
METALLIC("Metallic", "Metalliapis"), ABOMINABLE("Abominable", "Detestabilapis"),
GEM("Gem", "Lapidapis"), EXTRINSIC("Extrinsic", "Extrarapis"),
TRANSMUTING("Transmuting", "Transmutapis"),
THAUMIC("Thaumic", "Thaumiapis"), METALLIC("Metallic", "Metalliapis"),
FLESHY("Fleshy", "Carnosapis"), GEM("Gem", "Lapidapis"),
TRANSMUTING("Transmuting", "Transmutapis"),
ALCHEMICAL("Alchemical", "Alchimiapis"), THAUMIC("Thaumic", "Thaumiapis"),
FLESHY("Fleshy", "Carnosapis"),
ESSENTIAL("Essential", "Essentiapis"), ALCHEMICAL("Alchemical", "Alchimiapis"),
THERMAL("Thermal", "Thermametallic"), ESSENTIAL("Essential", "Essentiapis"),
ADORABLE("Adorable", "Amabilis"),
BLOODY("Bloody", "Sanguis"), THERMAL("Thermal", "Thermametallic"),
ADORABLE("Adorable", "Amabilis"),
BOTANICAL("Botanical", "Botanica"), BLOODY("Bloody", "Sanguis"),
;
private String uID; BOTANICAL("Botanical", "Botanica"),;
private String latin;
private ArrayList<IAlleleSpecies> species;
private IClassification parent;
private EnumClassLevel level;
private BeeClassification(String name, String scientific) private String uID;
{ private String latin;
this.uID = "classification." + name.toLowerCase(); private ArrayList<IAlleleSpecies> species;
this.latin = scientific; private IClassification parent;
this.level = EnumClassLevel.GENUS; private EnumClassLevel level;
this.species = new ArrayList<IAlleleSpecies>();
this.parent = AlleleManager.alleleRegistry.getClassification("family.apidae");
AlleleManager.alleleRegistry.registerClassification(this);
}
@Override private BeeClassification(String name, String scientific) {
public EnumClassLevel getLevel() this.uID = "classification." + name.toLowerCase();
{ this.latin = scientific;
return this.level; this.level = EnumClassLevel.GENUS;
} this.species = new ArrayList<IAlleleSpecies>();
this.parent = AlleleManager.alleleRegistry.getClassification("family.apidae");
AlleleManager.alleleRegistry.registerClassification(this);
}
@Override @Override
public String getUID() public EnumClassLevel getLevel() {
{ return this.level;
return this.uID; }
}
@Override @Override
public String getName() public String getUID() {
{ return this.uID;
return LocalizationManager.getLocalizedString(getUID()); }
}
@Override @Override
public String getScientific() public String getName() {
{ return LocalizationManager.getLocalizedString(getUID());
return this.latin; }
}
@Override @Override
public String getDescription() public String getScientific() {
{ return this.latin;
return LocalizationManager.getLocalizedString(getUID() + ".description"); }
}
@Override @Override
public IClassification[] getMemberGroups() public String getDescription() {
{ return LocalizationManager.getLocalizedString(getUID() + ".description");
return null; }
}
@Override @Override
public void addMemberGroup(IClassification group) public IClassification[] getMemberGroups() {
{ return null;
}
} @Override
public void addMemberGroup(IClassification group) {}
@Override @Override
public IAlleleSpecies[] getMemberSpecies() public IAlleleSpecies[] getMemberSpecies() {
{ return this.species.toArray(new IAlleleSpecies[this.species.size()]);
return this.species.toArray(new IAlleleSpecies[this.species.size()]); }
}
@Override @Override
public void addMemberSpecies(IAlleleSpecies species) public void addMemberSpecies(IAlleleSpecies species) {
{ if (!this.species.contains(species)) {
if (!this.species.contains(species)) this.species.add(species);
{ }
this.species.add(species); }
}
}
@Override @Override
public IClassification getParent() public IClassification getParent() {
{ return this.parent;
return this.parent; }
}
@Override
public void setParent(IClassification parent)
{
this.parent = parent;
}
@Override
public void setParent(IClassification parent) {
this.parent = parent;
}
} }
File diff suppressed because it is too large. Load diff
@@ -5,19 +5,20 @@ import java.awt.Color;
import forestry.api.apiculture.IBeeIconColourProvider; import forestry.api.apiculture.IBeeIconColourProvider;
public enum BeeIconColourProvider implements IBeeIconColourProvider { public enum BeeIconColourProvider implements IBeeIconColourProvider {
RAINBOW { RAINBOW {
@Override
public int getIconColour(int renderPass) { @Override
if (renderPass == 0) { public int getIconColour(int renderPass) {
int hue = (int) (System.currentTimeMillis() >> 2) % 360; if (renderPass == 0) {
return Color.getHSBColor(hue / 360f, 0.75f, 0.80f).getRGB(); int hue = (int) (System.currentTimeMillis() >> 2) % 360;
} else if (renderPass == 1) { return Color.getHSBColor(hue / 360f, 0.75f, 0.80f).getRGB();
int hue = (int) (System.currentTimeMillis() >> 3) % 360; } else if (renderPass == 1) {
hue += 60; int hue = (int) (System.currentTimeMillis() >> 3) % 360;
hue = hue % 360; hue += 60;
return Color.getHSBColor(hue / 360f, 0.5f, 0.6f).getRGB(); hue = hue % 360;
} return Color.getHSBColor(hue / 360f, 0.5f, 0.6f).getRGB();
return 0xffffff; }
} return 0xffffff;
} }
}
} }
@@ -7,45 +7,44 @@ import net.minecraft.util.IIcon;
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 forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.EnumBeeType;
import forestry.api.apiculture.IBeeIconProvider; import forestry.api.apiculture.IBeeIconProvider;
import magicbees.main.CommonProxy; import magicbees.main.CommonProxy;
public enum BeeIconProvider implements IBeeIconProvider { public enum BeeIconProvider implements IBeeIconProvider {
SKULKING(CommonProxy.DOMAIN + ":bees/skulking/"),
DOCTORAL(CommonProxy.DOMAIN + ":bees/doctoral/");
@SideOnly(Side.CLIENT) SKULKING(CommonProxy.DOMAIN + ":bees/skulking/"),
private IIcon[][] icons; DOCTORAL(CommonProxy.DOMAIN + ":bees/doctoral/");
private final String iconPath;
BeeIconProvider(String iconPath) { @SideOnly(Side.CLIENT)
this.iconPath = iconPath; private IIcon[][] icons;
}
@Override private final String iconPath;
public void registerIcons(IIconRegister itemMap) {
this.icons = new IIcon[EnumBeeType.VALUES.length][3];
IIcon body1 = itemMap.registerIcon(iconPath + "body1"); BeeIconProvider(String iconPath) {
this.iconPath = iconPath;
}
for (int i = 0; i < EnumBeeType.VALUES.length; i++) { @Override
EnumBeeType beeType = EnumBeeType.VALUES[i]; public void registerIcons(IIconRegister itemMap) {
if (beeType == EnumBeeType.NONE) this.icons = new IIcon[EnumBeeType.VALUES.length][3];
continue;
String beeTypeIconPath = iconPath + beeType.toString().toLowerCase(Locale.ENGLISH); IIcon body1 = itemMap.registerIcon(iconPath + "body1");
icons[i][0] = itemMap.registerIcon(beeTypeIconPath + ".outline"); for (int i = 0; i < EnumBeeType.VALUES.length; i++) {
icons[i][1] = (beeType != EnumBeeType.LARVAE) ? body1 : itemMap.registerIcon(beeTypeIconPath + ".body"); EnumBeeType beeType = EnumBeeType.VALUES[i];
icons[i][2] = itemMap.registerIcon(beeTypeIconPath + ".body2"); if (beeType == EnumBeeType.NONE) continue;
}
}
@Override String beeTypeIconPath = iconPath + beeType.toString().toLowerCase(Locale.ENGLISH);
public IIcon getIcon(EnumBeeType type, int renderPass) {
return icons[type.ordinal()][Math.min(renderPass, 2)]; icons[i][0] = itemMap.registerIcon(beeTypeIconPath + ".outline");
} icons[i][1] = (beeType != EnumBeeType.LARVAE) ? body1 : itemMap.registerIcon(beeTypeIconPath + ".body");
icons[i][2] = itemMap.registerIcon(beeTypeIconPath + ".body2");
}
}
@Override
public IIcon getIcon(EnumBeeType type, int renderPass) {
return icons[type.ordinal()][Math.min(renderPass, 2)];
}
} }
+77 -77
View File
@@ -5,12 +5,8 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Random; 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 net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.EnumBeeType;
import forestry.api.apiculture.IAlleleBeeSpecies; import forestry.api.apiculture.IAlleleBeeSpecies;
import forestry.api.apiculture.IBee; import forestry.api.apiculture.IBee;
@@ -18,95 +14,99 @@ import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeRoot; import forestry.api.apiculture.IBeeRoot;
import forestry.api.genetics.AlleleManager; import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IAllele; import forestry.api.genetics.IAllele;
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;
public class BeeManager public class BeeManager {
{
public static IBeeRoot beeRoot;
private static List<Tuple<IAlleleBeeSpecies, Double>> worldgenSpeciesWeights = new ArrayList<Tuple<IAlleleBeeSpecies, Double>>(); public static IBeeRoot beeRoot;
private static double worldgenSpeciesWeightsTotal = 0;
public static void getBeeRoot() { private static List<Tuple<IAlleleBeeSpecies, Double>> worldgenSpeciesWeights = new ArrayList<Tuple<IAlleleBeeSpecies, Double>>();
beeRoot = (IBeeRoot)AlleleManager.alleleRegistry.getSpeciesRoot("rootBees"); private static double worldgenSpeciesWeightsTotal = 0;
}
public static void setupAlleles() { public static void getBeeRoot() {
Allele.setupAdditionalAlleles(); beeRoot = (IBeeRoot) AlleleManager.alleleRegistry.getSpeciesRoot("rootBees");
BeeSpecies.setupBeeSpecies(); }
Allele.registerDeprecatedAlleleReplacements();
}
public static void lateBeeInit() public static void setupAlleles() {
{ Allele.setupAdditionalAlleles();
BeeMutation.setupMutations(); BeeSpecies.setupBeeSpecies();
BeeProductHelper.initBaseProducts(); Allele.registerDeprecatedAlleleReplacements();
BeeProductHelper.initOreDictSProducts(); }
HiveType.initHiveData(); public static void lateBeeInit() {
BeeMutation.setupMutations();
BeeProductHelper.initBaseProducts();
BeeProductHelper.initOreDictSProducts();
beeRoot.setResearchSuitability(Config.drops.getStackForType(DropType.INTELLECT), 0.5f); HiveType.initHiveData();
}
public static ItemStack getDefaultItemStackForSpecies(IAlleleBeeSpecies beeSpecies, EnumBeeType type) { beeRoot.setResearchSuitability(Config.drops.getStackForType(DropType.INTELLECT), 0.5f);
IBee bee = getBeeFromSpecies(beeSpecies, false); }
return BeeManager.beeRoot.getMemberStack(bee, type.ordinal());
}
public static IBee getBeeFromSpecies(IAlleleBeeSpecies beeSpecies, boolean applyRainResist) { public static ItemStack getDefaultItemStackForSpecies(IAlleleBeeSpecies beeSpecies, EnumBeeType type) {
IAllele[] speciesTemplate = BeeManager.beeRoot.getTemplate(beeSpecies.getUID()); IBee bee = getBeeFromSpecies(beeSpecies, false);
return BeeManager.beeRoot.getMemberStack(bee, type.ordinal());
}
if (applyRainResist) { public static IBee getBeeFromSpecies(IAlleleBeeSpecies beeSpecies, boolean applyRainResist) {
speciesTemplate = BeeGenomeManager.addRainResist(speciesTemplate); IAllele[] speciesTemplate = BeeManager.beeRoot.getTemplate(beeSpecies.getUID());
}
IBeeGenome genome = BeeManager.beeRoot.templateAsGenome(speciesTemplate); if (applyRainResist) {
return BeeManager.beeRoot.getBee(null, genome); speciesTemplate = BeeGenomeManager.addRainResist(speciesTemplate);
} }
public static IAlleleBeeSpecies getRandomWorldgenSpecies(Random r) { IBeeGenome genome = BeeManager.beeRoot.templateAsGenome(speciesTemplate);
Collections.shuffle(worldgenSpeciesWeights); return BeeManager.beeRoot.getBee(null, genome);
double value = r.nextDouble() * worldgenSpeciesWeightsTotal; }
IAlleleBeeSpecies species = Allele.getBaseSpecies("Forest");
for (Tuple<IAlleleBeeSpecies, Double> t : worldgenSpeciesWeights) { public static IAlleleBeeSpecies getRandomWorldgenSpecies(Random r) {
value -= t.right.doubleValue(); Collections.shuffle(worldgenSpeciesWeights);
if (value <= 0.0) { double value = r.nextDouble() * worldgenSpeciesWeightsTotal;
species = t.left; IAlleleBeeSpecies species = Allele.getBaseSpecies("Forest");
break;
}
}
return species; for (Tuple<IAlleleBeeSpecies, Double> t : worldgenSpeciesWeights) {
} value -= t.right.doubleValue();
if (value <= 0.0) {
species = t.left;
break;
}
}
public static void addWorldgenSpeciesWeight(IAlleleBeeSpecies species, double d) { return species;
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(species, d)); }
worldgenSpeciesWeightsTotal += d;
}
public static void populateSpeciesListRarity() { public static void addWorldgenSpeciesWeight(IAlleleBeeSpecies species, double d) {
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Forest"), 20.0)); worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(species, d));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Meadows"), 20.0)); worldgenSpeciesWeightsTotal += d;
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()) { public static void populateSpeciesListRarity() {
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Water"), 12.0)); worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Forest"), 20.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Rock"), 16.0)); worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getBaseSpecies("Meadows"), 20.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Basalt"), 10.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));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.MYSTICAL.getSpecies(), 20.0)); if (ExtraBeesHelper.isActive()) {
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.UNUSUAL.getSpecies(), 20.0)); worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Water"), 12.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.SORCEROUS.getSpecies(), 13.0)); worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Rock"), 16.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.ATTUNED.getSpecies(), 6.0)); worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Basalt"), 10.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.INFERNAL.getSpecies(), 10.0)); }
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.OBLIVION.getSpecies(), 1.0));
for (Tuple<IAlleleBeeSpecies, Double> t : worldgenSpeciesWeights) { worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.MYSTICAL.getSpecies(), 20.0));
worldgenSpeciesWeightsTotal += t.right.doubleValue(); worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.UNUSUAL.getSpecies(), 20.0));
} worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.SORCEROUS.getSpecies(), 13.0));
} worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.ATTUNED.getSpecies(), 6.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.INFERNAL.getSpecies(), 10.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.OBLIVION.getSpecies(), 1.0));
for (Tuple<IAlleleBeeSpecies, Double> t : worldgenSpeciesWeights) {
worldgenSpeciesWeightsTotal += t.right.doubleValue();
}
}
} }
File diff suppressed because it is too large. Load diff
+544 -376
View File
@@ -1,5 +1,137 @@
package magicbees.bees; package magicbees.bees;
import static magicbees.bees.BeeSpecies.ABANDONED;
import static magicbees.bees.BeeSpecies.AE_SKYSTONE;
import static magicbees.bees.BeeSpecies.ALUMINUM;
import static magicbees.bees.BeeSpecies.AM_AIR;
import static magicbees.bees.BeeSpecies.AM_ARCANE;
import static magicbees.bees.BeeSpecies.AM_EARTH;
import static magicbees.bees.BeeSpecies.AM_ESSENCE;
import static magicbees.bees.BeeSpecies.AM_FIRE;
import static magicbees.bees.BeeSpecies.AM_ICE;
import static magicbees.bees.BeeSpecies.AM_LIGHTNING;
import static magicbees.bees.BeeSpecies.AM_PLANT;
import static magicbees.bees.BeeSpecies.AM_QUINTESSENCE;
import static magicbees.bees.BeeSpecies.AM_VORTEX;
import static magicbees.bees.BeeSpecies.AM_WATER;
import static magicbees.bees.BeeSpecies.AM_WIGHT;
import static magicbees.bees.BeeSpecies.APATITE;
import static magicbees.bees.BeeSpecies.ARCANE;
import static magicbees.bees.BeeSpecies.ARDITE;
import static magicbees.bees.BeeSpecies.ATTUNED;
import static magicbees.bees.BeeSpecies.AWARE;
import static magicbees.bees.BeeSpecies.BATTY;
import static magicbees.bees.BeeSpecies.BEEF;
import static magicbees.bees.BeeSpecies.BIGBAD;
import static magicbees.bees.BeeSpecies.BOT_ALFHEIM;
import static magicbees.bees.BeeSpecies.BOT_BLOSSOM;
import static magicbees.bees.BeeSpecies.BOT_BOTANIC;
import static magicbees.bees.BeeSpecies.BOT_DREAMING;
import static magicbees.bees.BeeSpecies.BOT_FLORAL;
import static magicbees.bees.BeeSpecies.BOT_ROOTED;
import static magicbees.bees.BeeSpecies.BOT_SOMNOLENT;
import static magicbees.bees.BeeSpecies.BOT_VAZBEE;
import static magicbees.bees.BeeSpecies.BRAINY;
import static magicbees.bees.BeeSpecies.CATTY;
import static magicbees.bees.BeeSpecies.CERTUS;
import static magicbees.bees.BeeSpecies.CHARMED;
import static magicbees.bees.BeeSpecies.CHICKEN;
import static magicbees.bees.BeeSpecies.COBALT;
import static magicbees.bees.BeeSpecies.COPPER;
import static magicbees.bees.BeeSpecies.CRUMBLING;
import static magicbees.bees.BeeSpecies.DIAMOND;
import static magicbees.bees.BeeSpecies.DOCTORAL;
import static magicbees.bees.BeeSpecies.DRACONIC;
import static magicbees.bees.BeeSpecies.EARTHY;
import static magicbees.bees.BeeSpecies.EE_MINIUM;
import static magicbees.bees.BeeSpecies.ELDRITCH;
import static magicbees.bees.BeeSpecies.EMERALD;
import static magicbees.bees.BeeSpecies.ENCHANTED;
import static magicbees.bees.BeeSpecies.ESOTERIC;
import static magicbees.bees.BeeSpecies.ETHEREAL;
import static magicbees.bees.BeeSpecies.FIREY;
import static magicbees.bees.BeeSpecies.FLUIX;
import static magicbees.bees.BeeSpecies.FORLORN;
import static magicbees.bees.BeeSpecies.GHASTLY;
import static magicbees.bees.BeeSpecies.GOLD;
import static magicbees.bees.BeeSpecies.HATEFUL;
import static magicbees.bees.BeeSpecies.HORSE;
import static magicbees.bees.BeeSpecies.INFERNAL;
import static magicbees.bees.BeeSpecies.INVISIBLE;
import static magicbees.bees.BeeSpecies.IRON;
import static magicbees.bees.BeeSpecies.LEAD;
import static magicbees.bees.BeeSpecies.LORDLY;
import static magicbees.bees.BeeSpecies.MANYULLYN;
import static magicbees.bees.BeeSpecies.MUTABLE;
import static magicbees.bees.BeeSpecies.MYSTERIOUS;
import static magicbees.bees.BeeSpecies.MYSTICAL;
import static magicbees.bees.BeeSpecies.NAMELESS;
import static magicbees.bees.BeeSpecies.OBLIVION;
import static magicbees.bees.BeeSpecies.PORK;
import static magicbees.bees.BeeSpecies.PUPIL;
import static magicbees.bees.BeeSpecies.RSA_FLUXED;
import static magicbees.bees.BeeSpecies.SAVANT;
import static magicbees.bees.BeeSpecies.SCHOLARLY;
import static magicbees.bees.BeeSpecies.SHEEPISH;
import static magicbees.bees.BeeSpecies.SILICON;
import static magicbees.bees.BeeSpecies.SILVER;
import static magicbees.bees.BeeSpecies.SKULKING;
import static magicbees.bees.BeeSpecies.SMOULDERING;
import static magicbees.bees.BeeSpecies.SORCEROUS;
import static magicbees.bees.BeeSpecies.SOUL;
import static magicbees.bees.BeeSpecies.SPIDERY;
import static magicbees.bees.BeeSpecies.SPIRIT;
import static magicbees.bees.BeeSpecies.SPITEFUL;
import static magicbees.bees.BeeSpecies.SUPERNATURAL;
import static magicbees.bees.BeeSpecies.TC_AIR;
import static magicbees.bees.BeeSpecies.TC_CHAOS;
import static magicbees.bees.BeeSpecies.TC_EARTH;
import static magicbees.bees.BeeSpecies.TC_EMPOWERING;
import static magicbees.bees.BeeSpecies.TC_FIRE;
import static magicbees.bees.BeeSpecies.TC_HUNGRY;
import static magicbees.bees.BeeSpecies.TC_NEXUS;
import static magicbees.bees.BeeSpecies.TC_ORDER;
import static magicbees.bees.BeeSpecies.TC_PURE;
import static magicbees.bees.BeeSpecies.TC_REJUVENATING;
import static magicbees.bees.BeeSpecies.TC_TAINT;
import static magicbees.bees.BeeSpecies.TC_VIS;
import static magicbees.bees.BeeSpecies.TC_VOID;
import static magicbees.bees.BeeSpecies.TC_WATER;
import static magicbees.bees.BeeSpecies.TC_WISPY;
import static magicbees.bees.BeeSpecies.TE_AMPED;
import static magicbees.bees.BeeSpecies.TE_BLIZZY;
import static magicbees.bees.BeeSpecies.TE_BRONZE;
import static magicbees.bees.BeeSpecies.TE_COAL;
import static magicbees.bees.BeeSpecies.TE_DANTE;
import static magicbees.bees.BeeSpecies.TE_DESTABILIZED;
import static magicbees.bees.BeeSpecies.TE_ELECTRUM;
import static magicbees.bees.BeeSpecies.TE_ENDEARING;
import static magicbees.bees.BeeSpecies.TE_GELID;
import static magicbees.bees.BeeSpecies.TE_GROUNDED;
import static magicbees.bees.BeeSpecies.TE_INVAR;
import static magicbees.bees.BeeSpecies.TE_LUMIUS;
import static magicbees.bees.BeeSpecies.TE_LUX;
import static magicbees.bees.BeeSpecies.TE_NICKEL;
import static magicbees.bees.BeeSpecies.TE_PLATINUM;
import static magicbees.bees.BeeSpecies.TE_PYRO;
import static magicbees.bees.BeeSpecies.TE_ROCKING;
import static magicbees.bees.BeeSpecies.TE_SHOCKING;
import static magicbees.bees.BeeSpecies.TE_SIGNALUS;
import static magicbees.bees.BeeSpecies.TE_WINSOME;
import static magicbees.bees.BeeSpecies.TIMELY;
import static magicbees.bees.BeeSpecies.TIN;
import static magicbees.bees.BeeSpecies.TRANSMUTING;
import static magicbees.bees.BeeSpecies.UNUSUAL;
import static magicbees.bees.BeeSpecies.WATERY;
import static magicbees.bees.BeeSpecies.WINDY;
import static magicbees.bees.BeeSpecies.WITHERING;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import gregtech.api.enums.Materials;
import magicbees.item.types.CombType; import magicbees.item.types.CombType;
import magicbees.item.types.DropType; import magicbees.item.types.DropType;
import magicbees.item.types.NuggetType; import magicbees.item.types.NuggetType;
@@ -11,433 +143,469 @@ import magicbees.main.utils.LogHelper;
import magicbees.main.utils.compat.AppliedEnergisticsHelper; import magicbees.main.utils.compat.AppliedEnergisticsHelper;
import magicbees.main.utils.compat.ArsMagicaHelper; import magicbees.main.utils.compat.ArsMagicaHelper;
import magicbees.main.utils.compat.BotaniaHelper; import magicbees.main.utils.compat.BotaniaHelper;
import magicbees.main.utils.compat.BotaniaHelper.PastureSeed;
import magicbees.main.utils.compat.EquivalentExchangeHelper; import magicbees.main.utils.compat.EquivalentExchangeHelper;
import magicbees.main.utils.compat.ForestryHelper; import magicbees.main.utils.compat.ForestryHelper;
import magicbees.main.utils.compat.RedstoneArsenalHelper; import magicbees.main.utils.compat.RedstoneArsenalHelper;
import magicbees.main.utils.compat.ThaumcraftHelper; import magicbees.main.utils.compat.ThaumcraftHelper;
import magicbees.main.utils.compat.ThermalModsHelper; import magicbees.main.utils.compat.ThermalModsHelper;
import magicbees.main.utils.compat.BotaniaHelper.PastureSeed;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import static magicbees.bees.BeeSpecies.*;
public class BeeProductHelper { public class BeeProductHelper {
public static void initBaseProducts() { public static void initBaseProducts() {
MYSTICAL.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f); MYSTICAL.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f);
SORCEROUS.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f); SORCEROUS.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f);
UNUSUAL.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f); UNUSUAL.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f);
ATTUNED.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f); ATTUNED.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f);
ELDRITCH.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f); ELDRITCH.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f);
ESOTERIC.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.18f); ESOTERIC.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.18f);
MYSTERIOUS.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.20f); MYSTERIOUS.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.20f);
ARCANE.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.25f) ARCANE.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.25f)
.addSpecialty(Config.drops.getStackForType(DropType.ENCHANTED, 1), 0.09f); .addSpecialty(Config.drops.getStackForType(DropType.ENCHANTED, 1), 0.09f);
CHARMED.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.18f); CHARMED.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.18f);
ENCHANTED.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.20f); ENCHANTED.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.20f);
SUPERNATURAL.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.25f) SUPERNATURAL.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.25f)
.addSpecialty(Config.pollen.getStackForType(PollenType.UNUSUAL), 0.08f); .addSpecialty(Config.pollen.getStackForType(PollenType.UNUSUAL), 0.08f);
ETHEREAL.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f) ETHEREAL.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f)
.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.10f); .addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.10f);
WINDY.addProduct(Config.combs.getStackForType(CombType.AIRY), 0.25f); WINDY.addProduct(Config.combs.getStackForType(CombType.AIRY), 0.25f);
FIREY.addProduct(Config.combs.getStackForType(CombType.FIREY), 0.25f); FIREY.addProduct(Config.combs.getStackForType(CombType.FIREY), 0.25f);
EARTHY.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.25f); EARTHY.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.25f);
WATERY.addProduct(Config.combs.getStackForType(CombType.WATERY), 0.25f) WATERY.addProduct(Config.combs.getStackForType(CombType.WATERY), 0.25f)
.addSpecialty(new ItemStack(Blocks.ice), 0.025f); .addSpecialty(new ItemStack(Blocks.ice), 0.025f);
PUPIL.addProduct(Config.combs.getStackForType(CombType.PAPERY), 0.20f); PUPIL.addProduct(Config.combs.getStackForType(CombType.PAPERY), 0.20f);
SCHOLARLY.addProduct(Config.combs.getStackForType(CombType.PAPERY), 0.25f); SCHOLARLY.addProduct(Config.combs.getStackForType(CombType.PAPERY), 0.25f);
SAVANT.addProduct(Config.combs.getStackForType(CombType.PAPERY), 0.40f); SAVANT.addProduct(Config.combs.getStackForType(CombType.PAPERY), 0.40f);
AWARE.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.18f); AWARE.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.18f);
SPIRIT.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.22f) SPIRIT.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.22f)
.addSpecialty(Config.combs.getStackForType(CombType.SOUL), 0.16f); .addSpecialty(Config.combs.getStackForType(CombType.SOUL), 0.16f);
SOUL.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.28f) SOUL.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.28f)
.addSpecialty(Config.combs.getStackForType(CombType.SOUL), 0.20f); .addSpecialty(Config.combs.getStackForType(CombType.SOUL), 0.20f);
SKULKING.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f); SKULKING.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f);
GHASTLY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.08f) GHASTLY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.08f)
.addSpecialty(new ItemStack(Items.ghast_tear), 0.099f); .addSpecialty(new ItemStack(Items.ghast_tear), 0.099f);
SPIDERY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.13f) SPIDERY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.13f)
.addProduct(new ItemStack(Items.string), 0.08f) .addProduct(new ItemStack(Items.string), 0.08f).addSpecialty(new ItemStack(Items.spider_eye), 0.08f);
.addSpecialty(new ItemStack(Items.spider_eye), 0.08f); SMOULDERING.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f)
SMOULDERING.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) .addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.10f)
.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.10f) .addSpecialty(new ItemStack(Items.blaze_rod), 0.05f);
.addSpecialty(new ItemStack(Items.blaze_rod), 0.05f); BRAINY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f)
BRAINY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) .addProduct(new ItemStack(Items.rotten_flesh), 0.06f);
.addProduct(new ItemStack(Items.rotten_flesh), 0.06f); BIGBAD.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.18f)
BIGBAD.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.18f) .addProduct(new ItemStack(Items.beef), 0.12f).addProduct(new ItemStack(Items.chicken), 0.12f)
.addProduct(new ItemStack(Items.beef), 0.12f) .addSpecialty(new ItemStack(Items.melon), 0.20f);
.addProduct(new ItemStack(Items.chicken), 0.12f) BATTY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f)
.addSpecialty(new ItemStack(Items.melon), 0.20f); .addSpecialty(new ItemStack(Items.string), 0.20f);
BATTY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) CHICKEN.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.23f)
.addSpecialty(new ItemStack(Items.string), 0.00001f); .addSpecialty(new ItemStack(Items.feather), 0.08f).addSpecialty(new ItemStack(Items.egg), 0.08f);
CHICKEN.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.23f) BEEF.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f)
.addSpecialty(new ItemStack(Items.feather), 0.08f) .addSpecialty(new ItemStack(Items.leather), 0.165f);
.addSpecialty(new ItemStack(Items.egg), 0.08f); PORK.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f)
BEEF.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f) .addSpecialty(new ItemStack(Items.carrot), 0.165f);
.addSpecialty(new ItemStack(Items.leather), 0.165f); SHEEPISH.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f)
PORK.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) .addSpecialty(new ItemStack(Blocks.wool), 0.16f).addSpecialty(new ItemStack(Items.wheat), 0.24f);
.addSpecialty(new ItemStack(Items.carrot), 0.165f); HORSE.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f)
SHEEPISH.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f) .addSpecialty(new ItemStack(Items.leather), 0.24f).addSpecialty(new ItemStack(Items.apple), 0.38f);
.addSpecialty(new ItemStack(Blocks.wool), 0.16f) CATTY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f)
.addSpecialty(new ItemStack(Items.wheat), 0.24f); .addSpecialty(new ItemStack(Items.fish), 0.24f);
HORSE.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f)
.addSpecialty(new ItemStack(Items.leather), 0.24f)
.addSpecialty(new ItemStack(Items.apple), 0.38f);
CATTY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f)
.addSpecialty(new ItemStack(Items.fish), 0.24f);
TIMELY.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.16f); TIMELY.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.16f);
LORDLY.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.19f); LORDLY.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.19f);
DOCTORAL.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.24f) DOCTORAL.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.24f)
.addSpecialty(new ItemStack(Config.jellyBaby), 0.078f); .addSpecialty(new ItemStack(Config.jellyBaby), 0.078f);
INFERNAL.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.12f); INFERNAL.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.12f);
HATEFUL.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.18f); HATEFUL.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.18f);
SPITEFUL.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.24f); SPITEFUL.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.24f);
WITHERING.addSpecialty(Config.miscResources.getStackForType(ResourceType.SKULL_CHIP), 0.15f); WITHERING.addSpecialty(Config.miscResources.getStackForType(ResourceType.SKULL_CHIP), 0.15f);
OBLIVION.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.14f); OBLIVION.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.14f);
NAMELESS.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.19f); NAMELESS.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.19f);
ABANDONED.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.24f); ABANDONED.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.24f);
FORLORN.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.30f); FORLORN.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.30f);
DRACONIC.addSpecialty(Config.miscResources.getStackForType(ResourceType.DRAGON_DUST), 0.15f); DRACONIC.addSpecialty(Config.miscResources.getStackForType(ResourceType.DRAGON_DUST), 0.15f);
IRON.addProduct(ForestryHelper.itemHoneycomb, 0.10f) IRON.addProduct(ForestryHelper.itemHoneycomb, 0.10f)
.addSpecialty(Config.nuggets.getStackForType(NuggetType.IRON), 0.18f); .addSpecialty(Config.nuggets.getStackForType(NuggetType.IRON), 0.18f);
GOLD.addProduct(ForestryHelper.itemHoneycomb, 0.10f) GOLD.addProduct(ForestryHelper.itemHoneycomb, 0.10f).addSpecialty(new ItemStack(Items.gold_nugget, 1), 0.16f);
.addSpecialty(new ItemStack(Items.gold_nugget, 1), 0.16f); DIAMOND.addProduct(ForestryHelper.itemHoneycomb, 0.10f)
DIAMOND.addProduct(ForestryHelper.itemHoneycomb, 0.10f) .addSpecialty(Config.nuggets.getStackForType(NuggetType.DIAMOND), 0.06f);
.addSpecialty(Config.nuggets.getStackForType(NuggetType.DIAMOND), 0.06f); EMERALD.addProduct(ForestryHelper.itemHoneycomb, 0.10f)
EMERALD.addProduct(ForestryHelper.itemHoneycomb, 0.10f) .addSpecialty(Config.nuggets.getStackForType(NuggetType.EMERALD), 0.04f);
.addSpecialty(Config.nuggets.getStackForType(NuggetType.EMERALD), 0.04f); COPPER.addProduct(ForestryHelper.itemHoneycomb, 0.10f)
COPPER.addProduct(ForestryHelper.itemHoneycomb, 0.10f) .addSpecialty(Config.nuggets.getStackForType(NuggetType.COPPER), 0.20f);
.addSpecialty(Config.nuggets.getStackForType(NuggetType.COPPER), 0.20f); TIN.addProduct(ForestryHelper.itemHoneycomb, 0.10f)
TIN.addProduct(ForestryHelper.itemHoneycomb, 0.10f) .addSpecialty(Config.nuggets.getStackForType(NuggetType.TIN), 0.20f);
.addSpecialty(Config.nuggets.getStackForType(NuggetType.TIN), 0.20f); APATITE.addProduct(ForestryHelper.itemHoneycomb, 0.10f)
APATITE.addProduct(ForestryHelper.itemHoneycomb, 0.10f) .addSpecialty(Config.nuggets.getStackForType(NuggetType.APATITE), 0.10f);
.addSpecialty(Config.nuggets.getStackForType(NuggetType.APATITE), 0.10f);
MUTABLE.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.PARCHED.ordinal()), 0.30f) MUTABLE.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.PARCHED.ordinal()), 0.30f)
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.10f); .addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.10f);
TRANSMUTING.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.PARCHED.ordinal()), 0.10f) TRANSMUTING.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.PARCHED.ordinal()), 0.10f)
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.30f) .addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.30f)
.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.SILKY.ordinal()), 0.05f) .addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.SILKY.ordinal()), 0.05f)
.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.SIMMERING.ordinal()), 0.05f); .addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.SIMMERING.ordinal()), 0.05f);
CRUMBLING.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.PARCHED.ordinal()), 0.10f) CRUMBLING.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.PARCHED.ordinal()), 0.10f)
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.30f) .addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.30f)
.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.POWDERY.ordinal()), 0.10f) .addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.POWDERY.ordinal()), 0.10f)
.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.COCOA.ordinal()), 0.15f); .addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.COCOA.ordinal()), 0.15f);
INVISIBLE.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.35f); INVISIBLE.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.35f);
}
} public static void initOreDictSProducts() {
boolean isGTNHCoreModLoaded = Config.isGTNHCoreModLoaded;
SILVER.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
if (OreDictionary.getOres("nuggetSilver").size() > 0) {
SILVER.addSpecialty(
isGTNHCoreModLoaded ? Materials.Silver.getNuggets(1) : OreDictionary.getOres("nuggetSilver").get(0),
0.16f);
} else {
SILVER.setInactive();
}
public static void initOreDictSProducts() { LEAD.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
SILVER.addProduct(ForestryHelper.itemHoneycomb, 0.10f); if (OreDictionary.getOres("nuggetLead").size() > 0) {
if (OreDictionary.getOres("ingotSilver").size() > 0) { LEAD.addSpecialty(
SILVER.addSpecialty(Config.nuggets.getStackForType(NuggetType.SILVER), 0.16f); isGTNHCoreModLoaded ? Materials.Lead.getNuggets(1) : OreDictionary.getOres("nuggetLead").get(0),
} 0.17f);
else { } else {
SILVER.setInactive(); LEAD.setInactive();
} }
LEAD.addProduct(ForestryHelper.itemHoneycomb, 0.10f); // Oil berry alu bee
if (OreDictionary.getOres("ingotLead").size() > 0) { ALUMINUM.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
LEAD.addSpecialty(Config.nuggets.getStackForType(NuggetType.LEAD), 0.17f); if (OreDictionary.getOres("nuggetAluminum").size() > 0) {
} ALUMINUM.addSpecialty(OreDictionary.getOres("nuggetAluminum").get(0), 0.20f);
else { } else {
LEAD.setInactive(); ALUMINUM.setInactive();
} }
ALUMINUM.addProduct(ForestryHelper.itemHoneycomb, 0.10f); TE_PLATINUM.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
if (OreDictionary.getOres("nuggetAluminum").size() > 0) { if (OreDictionary.getOres("nuggetPlatinum").size() > 0) {
ALUMINUM.addSpecialty(OreDictionary.getOres("nuggetAluminum").get(0), 0.20f); TE_PLATINUM.addSpecialty(
} else { isGTNHCoreModLoaded ? Materials.Platinum.getNuggets(1)
ALUMINUM.setInactive(); : OreDictionary.getOres("nuggetPlatinum").get(0),
} 0.18f);
} else {
TE_PLATINUM.setInactive();
}
TE_PLATINUM.addProduct(ForestryHelper.itemHoneycomb, 0.10f); TE_NICKEL.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
if (OreDictionary.getOres("nuggetPlatinum").size() > 0&& OreDictionary.getOres("ingotPlatinum").size() > 0) { if (OreDictionary.getOres("nuggetNickel").size() > 0) {
TE_PLATINUM.addSpecialty(OreDictionary.getOres("nuggetPlatinum").get(0), 0.18f); TE_NICKEL.addSpecialty(
} else { isGTNHCoreModLoaded ? Materials.Nickel.getNuggets(1) : OreDictionary.getOres("nuggetNickel").get(0),
TE_PLATINUM.setInactive(); 0.18f);
} } else {
TE_NICKEL.setInactive();
}
TE_NICKEL.addProduct(ForestryHelper.itemHoneycomb, 0.10f); ARDITE.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
if (OreDictionary.getOres("nuggetNickel").size() > 0 && OreDictionary.getOres("ingotNickel").size() > 0) { if (OreDictionary.getOres("nuggetArdite").size() > 0) {
TE_NICKEL.addSpecialty(OreDictionary.getOres("nuggetNickel").get(0), 0.18f); ARDITE.addSpecialty(
} else { isGTNHCoreModLoaded ? Materials.Ardite.getNuggets(1) : OreDictionary.getOres("nuggetArdite").get(0),
TE_NICKEL.setInactive(); 0.18f);
} } else {
ARDITE.setInactive();
}
ARDITE.addProduct(ForestryHelper.itemHoneycomb, 0.10f); COBALT.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
if (OreDictionary.getOres("nuggetArdite").size() > 0) { if (OreDictionary.getOres("nuggetCobalt").size() > 0) {
ARDITE.addSpecialty(OreDictionary.getOres("nuggetArdite").get(0), 0.18f); COBALT.addSpecialty(
} else { isGTNHCoreModLoaded ? Materials.Cobalt.getNuggets(1) : OreDictionary.getOres("nuggetCobalt").get(0),
ARDITE.setInactive(); 0.18f);
} } else {
COBALT.setInactive();
}
COBALT.addProduct(ForestryHelper.itemHoneycomb, 0.10f); TE_BRONZE.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
if (OreDictionary.getOres("nuggetCobalt").size() > 0) { if (OreDictionary.getOres("nuggetBronze").size() > 0) {
COBALT.addSpecialty(OreDictionary.getOres("nuggetCobalt").get(0), 0.18f); TE_BRONZE.addSpecialty(
} isGTNHCoreModLoaded ? Materials.Bronze.getNuggets(1) : OreDictionary.getOres("nuggetBronze").get(0),
if (OreDictionary.getOres("nuggetNaturalCobalt").size() > 0) { 0.18f);
COBALT.addSpecialty(OreDictionary.getOres("nuggetNaturalCobalt").get(0), 0.24f); } else {
} TE_BRONZE.setInactive();
if (COBALT.getSpecies().getSpecialtyChances().size() <= 0) { }
COBALT.setInactive();
}
TE_BRONZE.addProduct(ForestryHelper.itemHoneycomb, 0.10f); TE_INVAR.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
if (OreDictionary.getOres("nuggetBronze").size() > 0 && OreDictionary.getOres("ingotBronze").size() > 0) { if (OreDictionary.getOres("nuggetInvar").size() > 0) {
TE_BRONZE.addSpecialty(OreDictionary.getOres("nuggetBronze").get(0), 0.18f); TE_INVAR.addSpecialty(
} else { isGTNHCoreModLoaded ? Materials.Invar.getNuggets(1) : OreDictionary.getOres("nuggetInvar").get(0),
TE_BRONZE.setInactive(); 0.18f);
} } else {
TE_INVAR.setInactive();
}
TE_INVAR.addProduct(ForestryHelper.itemHoneycomb, 0.10f); TE_ELECTRUM.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
if (OreDictionary.getOres("nuggetInvar").size() > 0 && OreDictionary.getOres("ingotInvar").size() > 0) { if (OreDictionary.getOres("nuggetElectrum").size() > 0) {
TE_INVAR.addSpecialty(OreDictionary.getOres("nuggetInvar").get(0), 0.18f); TE_ELECTRUM.addSpecialty(
} else { isGTNHCoreModLoaded ? Materials.Electrum.getNuggets(1)
TE_INVAR.setInactive(); : OreDictionary.getOres("nuggetElectrum").get(0),
} 0.18f);
} else {
TE_ELECTRUM.setInactive();
}
TE_ELECTRUM.addProduct(ForestryHelper.itemHoneycomb, 0.10f); MANYULLYN.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
if (OreDictionary.getOres("nuggetElectrum").size() > 0 && OreDictionary.getOres("ingotElectrum").size() > 0) { if (OreDictionary.getOres("nuggetManyullyn").size() > 0) {
TE_ELECTRUM.addSpecialty(OreDictionary.getOres("nuggetElectrum").get(0), 0.18f); MANYULLYN.addSpecialty(
} else { isGTNHCoreModLoaded ? Materials.Manyullyn.getNuggets(1)
TE_ELECTRUM.setInactive(); : OreDictionary.getOres("nuggetManyullyn").get(0),
} 0.18f);
} else {
MANYULLYN.setInactive();
}
MANYULLYN.addProduct(ForestryHelper.itemHoneycomb, 0.10f); CERTUS.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
if (OreDictionary.getOres("nuggetManyullyn").size() > 0) { if (OreDictionary.getOres("crystalCertusQuartz").size() > 0) {
MANYULLYN.addSpecialty(OreDictionary.getOres("nuggetManyullyn").get(0), 0.16f); CERTUS.addSpecialty(OreDictionary.getOres("crystalCertusQuartz").get(0), 0.08f);
} else { } else {
MANYULLYN.setInactive(); CERTUS.setInactive();
} }
OSMIUM.addProduct(ForestryHelper.itemHoneycomb, 0.15f); SILICON.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
if (OreDictionary.getOres("nuggetOsmium").size() > 0) { if (OreDictionary.getOres("dustSilicon").size() > 0) {
OSMIUM.addSpecialty(OreDictionary.getOres("nuggetOsmium").get(0), 0.16f); SILICON.addSpecialty(OreDictionary.getOres("dustSilicon").get(0), 0.30f);
} } else {
else { SILICON.setInactive();
OSMIUM.setInactive(); }
}
CERTUS.addProduct(ForestryHelper.itemHoneycomb, 0.10f); FLUIX.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
if (OreDictionary.getOres("crystalCertusQuartz").size() > 0) { if (OreDictionary.getOres("crystalFluix").size() > 0) {
CERTUS.addSpecialty(OreDictionary.getOres("crystalCertusQuartz").get(0), 0.08f); FLUIX.addSpecialty(OreDictionary.getOres("crystalFluix").get(0), 0.06f);
} } else {
else { FLUIX.setInactive();
CERTUS.setInactive(); }
} }
SILICON.addProduct(ForestryHelper.itemHoneycomb, 0.10f); public static void initThaumcraftProducts() {
if (OreDictionary.getOres("itemSilicon").size() > 0) { TC_AIR.addProduct(Config.combs.getStackForType(CombType.TC_AIR), 0.20f);
SILICON.addSpecialty(OreDictionary.getOres("itemSilicon").get(0), 0.16f); TC_FIRE.addProduct(Config.combs.getStackForType(CombType.TC_FIRE), 0.20f);
} TC_WATER.addProduct(Config.combs.getStackForType(CombType.TC_WATER), 0.20f);
else { TC_EARTH.addProduct(Config.combs.getStackForType(CombType.TC_EARTH), 0.20f);
SILICON.setInactive(); TC_ORDER.addProduct(Config.combs.getStackForType(CombType.TC_ORDER), 0.20f);
} TC_CHAOS.addProduct(Config.combs.getStackForType(CombType.TC_CHAOS), 0.20f);
FLUIX.addProduct(ForestryHelper.itemHoneycomb, 0.10f); TC_VIS.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.10f);
if (OreDictionary.getOres("crystalFluix").size() > 0) { TC_REJUVENATING.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.18f);
FLUIX.addSpecialty(OreDictionary.getOres("crystalFluix").get(0), 0.06f); TC_EMPOWERING.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.14f);
} TC_EMPOWERING.addSpecialty(
else { new ItemStack(ForestryHelper.pollen, 1, ForestryHelper.Pollen.CRYSTALLINE.ordinal()),
FLUIX.setInactive(); 0.02f);
} TC_NEXUS.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.25f);
} TC_NEXUS.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.12f);
TC_NEXUS.addSpecialty(
new ItemStack(ForestryHelper.pollen, 1, ForestryHelper.Pollen.CRYSTALLINE.ordinal()),
0.02f);
TC_TAINT.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.18f);
TC_TAINT.addProduct(
new ItemStack(ForestryHelper.craftingResource, 1, ForestryHelper.Propolis.STICKY.ordinal()),
0.213f);
TC_PURE.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.16f);
TC_PURE.addSpecialty(Config.combs.getStackForType(CombType.SOUL), 0.19f);
TC_HUNGRY.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.28f);
TC_HUNGRY.addSpecialty(Config.combs.getStackForType(CombType.TEMPORAL), 0.195f);
TC_WISPY.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.SILKY.ordinal()), 0.22f)
.addSpecialty(
new ItemStack(
ForestryHelper.craftingResource,
1,
ForestryHelper.CraftingMaterial.SILK_WISP.ordinal()),
0.04f);
TC_VOID.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
public static void initThaumcraftProducts() { if (ThaumcraftHelper.isActive()) {
TC_AIR.addProduct(Config.combs.getStackForType(CombType.TC_AIR), 0.20f); SCHOLARLY.addSpecialty(Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT), 0.02f);
TC_FIRE.addProduct(Config.combs.getStackForType(CombType.TC_FIRE), 0.20f); SAVANT.addSpecialty(Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT), 0.05f);
TC_WATER.addProduct(Config.combs.getStackForType(CombType.TC_WATER), 0.20f);
TC_EARTH.addProduct(Config.combs.getStackForType(CombType.TC_EARTH), 0.20f);
TC_ORDER.addProduct(Config.combs.getStackForType(CombType.TC_ORDER), 0.20f);
TC_CHAOS.addProduct(Config.combs.getStackForType(CombType.TC_CHAOS), 0.20f);
TC_VIS.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.10f); TC_AIR.addSpecialty(Config.propolis.getStackForType(PropolisType.AIR), 0.18f);
TC_REJUVENATING.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.18f); TC_FIRE.addSpecialty(Config.propolis.getStackForType(PropolisType.FIRE), 0.18f);
TC_EMPOWERING.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.14f); TC_WATER.addSpecialty(Config.propolis.getStackForType(PropolisType.WATER), 0.18f);
TC_EMPOWERING.addSpecialty(new ItemStack(ForestryHelper.pollen, 1, ForestryHelper.Pollen.CRYSTALLINE.ordinal()), 0.02f); TC_EARTH.addSpecialty(Config.propolis.getStackForType(PropolisType.EARTH), 0.18f);
TC_NEXUS.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.25f); TC_ORDER.addSpecialty(Config.propolis.getStackForType(PropolisType.ORDER), 0.18f);
TC_NEXUS.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.12f); TC_CHAOS.addSpecialty(Config.propolis.getStackForType(PropolisType.CHAOS), 0.18f);
TC_NEXUS.addSpecialty(new ItemStack(ForestryHelper.pollen, 1, ForestryHelper.Pollen.CRYSTALLINE.ordinal()), 0.02f);
TC_TAINT.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.18f);
TC_TAINT.addProduct(new ItemStack(ForestryHelper.craftingResource, 1 , ForestryHelper.Propolis.STICKY.ordinal()), 0.213f);
TC_PURE.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.16f);
TC_PURE.addSpecialty(Config.combs.getStackForType(CombType.SOUL), 0.19f);
TC_HUNGRY.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.28f);
TC_HUNGRY.addSpecialty(Config.combs.getStackForType(CombType.TEMPORAL), 0.195f);
TC_WISPY.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.SILKY.ordinal()), 0.22f)
.addSpecialty(new ItemStack(ForestryHelper.craftingResource, 1, ForestryHelper.CraftingMaterial.SILK_WISP.ordinal()), 0.04f);
TC_VOID.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
if (ThaumcraftHelper.isActive()) { BATTY.addSpecialty(new ItemStack(Items.gunpowder), 0.04f);
SCHOLARLY.addSpecialty(Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT), 0.02f); BRAINY.addSpecialty(new ItemStack(ThaumcraftHelper.zombieBrain, 1), 0.02f);
SAVANT.addSpecialty(Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT), 0.05f); CHICKEN.addSpecialty(new ItemStack(ThaumcraftHelper.nuggetChicken, 1), 0.09f);
BEEF.addSpecialty(new ItemStack(ThaumcraftHelper.nuggetBeef, 1), 0.09f);
PORK.addSpecialty(new ItemStack(ThaumcraftHelper.nuggetPork, 1), 0.09f);
TC_VOID.addSpecialty(
new ItemStack(ThaumcraftHelper.nuggetMetal, 1, ThaumcraftHelper.NuggetType.VOID_METAL.ordinal()),
0.155f);
}
}
TC_AIR.addSpecialty(Config.propolis.getStackForType(PropolisType.AIR), 0.18f); public static void initEquivalentExchange3Species() {
TC_FIRE.addSpecialty(Config.propolis.getStackForType(PropolisType.FIRE), 0.18f); EE_MINIUM.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.16f);
TC_WATER.addSpecialty(Config.propolis.getStackForType(PropolisType.WATER), 0.18f);
TC_EARTH.addSpecialty(Config.propolis.getStackForType(PropolisType.EARTH), 0.18f);
TC_ORDER.addSpecialty(Config.propolis.getStackForType(PropolisType.ORDER), 0.18f);
TC_CHAOS.addSpecialty(Config.propolis.getStackForType(PropolisType.CHAOS), 0.18f);
BATTY.addSpecialty(new ItemStack(Items.gunpowder), 0.04f); if (EquivalentExchangeHelper.isActive()) {
BRAINY.addSpecialty(new ItemStack(ThaumcraftHelper.zombieBrain, 1), 0.02f); EE_MINIUM.addSpecialty(new ItemStack(EquivalentExchangeHelper.minuimShard), 0.06f);
CHICKEN.addSpecialty(new ItemStack(ThaumcraftHelper.nuggetChicken, 1), 0.09f); }
BEEF.addSpecialty(new ItemStack(ThaumcraftHelper.nuggetBeef, 1), 0.09f); }
PORK.addSpecialty(new ItemStack(ThaumcraftHelper.nuggetPork, 1), 0.09f);
TC_VOID.addSpecialty(new ItemStack(ThaumcraftHelper.nuggetMetal, 1, ThaumcraftHelper.NuggetType.VOID_METAL.ordinal()), 0.155f);
}
}
public static void initEquivalentExchange3Species() { public static void initArsMagicaSpecies() {
EE_MINIUM.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.16f); AM_ESSENCE.addProduct(Config.combs.getStackForType(CombType.AM_ESSENCE), 0.12f);
AM_QUINTESSENCE.addProduct(Config.combs.getStackForType(CombType.AM_ESSENCE), 0.23f);
AM_EARTH.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f);
AM_AIR.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f);
AM_FIRE.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f);
AM_WATER.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f);
AM_LIGHTNING.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f);
AM_PLANT.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f);
AM_ICE.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f);
AM_ARCANE.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.19f);
AM_VORTEX.addProduct(Config.combs.getStackForType(CombType.AM_ESSENCE), 0.10f);
AM_WIGHT.addProduct(Config.combs.getStackForType(CombType.SOUL), 0.30f)
.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f);
if (EquivalentExchangeHelper.isActive()) { if (ArsMagicaHelper.isActive()) {
EE_MINIUM.addSpecialty(new ItemStack(EquivalentExchangeHelper.minuimShard), 0.06f); AM_QUINTESSENCE.addSpecialty(
} new ItemStack(
} ArsMagicaHelper.itemResource,
1,
ArsMagicaHelper.ResourceType.ARCANE_COMPOUND.ordinal()),
0.05f);
AM_EARTH.addSpecialty(
new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.EARTH.ordinal()),
0.07f);
AM_AIR.addSpecialty(
new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.AIR.ordinal()),
0.07f);
AM_FIRE.addSpecialty(
new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.FIRE.ordinal()),
0.07f);
AM_WATER.addSpecialty(
new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.WATER.ordinal()),
0.07f);
AM_LIGHTNING.addSpecialty(
new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.LIGHTNING.ordinal()),
0.07f);
AM_PLANT.addSpecialty(
new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.PLANT.ordinal()),
0.07f);
AM_ICE.addSpecialty(
new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.ICE.ordinal()),
0.07f);
AM_ARCANE.addSpecialty(
new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.ARCANE.ordinal()),
0.11f);
AM_VORTEX.addSpecialty(
new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.EARTH.ordinal()),
0.15f);
AM_WIGHT.addSpecialty(
new ItemStack(
ArsMagicaHelper.itemResource,
1,
ArsMagicaHelper.ResourceType.ARCANE_COMPOUND.ordinal()),
0.11f);
}
}
public static void initArsMagicaSpecies() { public static void initThermalExpansionProducts() {
AM_ESSENCE.addProduct(Config.combs.getStackForType(CombType.AM_ESSENCE), 0.12f); TE_DANTE.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f)
AM_QUINTESSENCE.addProduct(Config.combs.getStackForType(CombType.AM_ESSENCE), 0.23f); .addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.10f)
AM_EARTH.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); .addSpecialty(new ItemStack(Items.blaze_powder), 0.05f);
AM_AIR.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); TE_PYRO.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f)
AM_FIRE.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); .addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.10f)
AM_WATER.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); .addSpecialty(new ItemStack(Items.blaze_powder), 0.05f);
AM_LIGHTNING.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); TE_DESTABILIZED.addProduct(Config.combs.getStackForType(CombType.TE_DESTABILIZED), 0.10f)
AM_PLANT.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); .addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f)
AM_ICE.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); .addSpecialty(new ItemStack(Items.redstone), 0.05f);
AM_ARCANE.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.19f); TE_LUX.addProduct(Config.combs.getStackForType(CombType.TE_LUX), 0.10f)
AM_VORTEX.addProduct(Config.combs.getStackForType(CombType.AM_ESSENCE), 0.10f); .addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f)
AM_WIGHT.addProduct(Config.combs.getStackForType(CombType.SOUL), 0.30f) .addSpecialty(new ItemStack(Items.glowstone_dust), 0.05f);
.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f); TE_WINSOME.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f)
.addProduct(Config.combs.getStackForType(CombType.TE_ENDEARING), 0.05f)
.addSpecialty(new ItemStack(Items.ender_pearl), 0.05f);
TE_ENDEARING
.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.MYSTERIOUS.ordinal()), 0.10f)
.addProduct(Config.combs.getStackForType(CombType.TE_ENDEARING), 0.05f);
TE_COAL.addProduct(ForestryHelper.itemHoneycomb, 0.10f)
.addProduct(Config.combs.getStackForType(CombType.TE_CARBON), 0.05f)
.addSpecialty(new ItemStack(Items.coal), 0.05f);
TE_BLIZZY.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.FROZEN.ordinal()), 0.10f);
TE_GELID.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.FROZEN.ordinal()), 0.10f);
TE_SHOCKING.addProduct(Config.combs.getStackForType(CombType.AIRY), 0.16f);
TE_AMPED.addProduct(Config.combs.getStackForType(CombType.AIRY), 0.29f);
TE_GROUNDED.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.16f);
TE_ROCKING.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.29f);
if (ArsMagicaHelper.isActive()) { TE_SIGNALUS.addProduct(Config.combs.getStackForType(CombType.TE_DESTABILIZED), 0.10f)
AM_QUINTESSENCE.addSpecialty(new ItemStack(ArsMagicaHelper.itemResource, 1, ArsMagicaHelper.ResourceType.ARCANE_COMPOUND.ordinal()), 0.05f); .addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f);
AM_EARTH.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.EARTH.ordinal()), 0.07f); TE_LUMIUS.addProduct(Config.combs.getStackForType(CombType.TE_LUX), 0.10f)
AM_AIR.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.AIR.ordinal()), 0.07f); .addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f);
AM_FIRE.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.FIRE.ordinal()), 0.07f);
AM_WATER.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.WATER.ordinal()), 0.07f);
AM_LIGHTNING.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.LIGHTNING.ordinal()), 0.07f);
AM_PLANT.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.PLANT.ordinal()), 0.07f);
AM_ICE.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.ICE.ordinal()), 0.07f);
AM_ARCANE.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.ARCANE.ordinal()), 0.11f);
AM_VORTEX.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.EARTH.ordinal()), 0.15f);
AM_WIGHT.addSpecialty(new ItemStack(ArsMagicaHelper.itemResource, 1, ArsMagicaHelper.ResourceType.ARCANE_COMPOUND.ordinal()), 0.11f);
}
}
public static void initThermalExpansionProducts() { if (ThermalModsHelper.isActive()) {
TE_DANTE.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) LogHelper.info("Thermal Expansion bees active");
.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.10f) TE_BLIZZY.addSpecialty(ThermalModsHelper.dustBlizz, 0.09f);
.addSpecialty(new ItemStack(Items.blaze_powder), 0.05f); TE_GELID.addSpecialty(ThermalModsHelper.dustCryotheum, 0.09f);
TE_PYRO.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) TE_DANTE.addSpecialty(ThermalModsHelper.dustSulfur, 0.09f);
.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.10f) TE_PYRO.addSpecialty(ThermalModsHelper.dustPyrotheum, 0.09f);
.addSpecialty(new ItemStack(Items.blaze_powder), 0.05f); TE_SHOCKING.addSpecialty(ThermalModsHelper.dustBlitz, 0.09f);
TE_DESTABILIZED.addProduct(Config.combs.getStackForType(CombType.TE_DESTABILIZED), 0.10f) TE_AMPED.addSpecialty(ThermalModsHelper.dustAerotheum, 0.09f);
.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f) TE_GROUNDED.addSpecialty(ThermalModsHelper.dustBasalz, 0.09f);
.addSpecialty(new ItemStack(Items.redstone), 0.05f); TE_ROCKING.addSpecialty(ThermalModsHelper.dustPetrotheum, 0.09f);
TE_LUX.addProduct(Config.combs.getStackForType(CombType.TE_LUX), 0.10f) TE_WINSOME.addSpecialty(ThermalModsHelper.dustPlatinum, 0.09f);
.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f) TE_ENDEARING.addSpecialty(ThermalModsHelper.enderiumNugget, 0.09f);
.addSpecialty(new ItemStack(Items.glowstone_dust), 0.05f); TE_SIGNALUS.addSpecialty(ThermalModsHelper.signalumNugget, 0.09f);
TE_WINSOME.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) TE_LUMIUS.addSpecialty(ThermalModsHelper.lumiumNugget, 0.09f);
.addProduct(Config.combs.getStackForType(CombType.TE_ENDEARING), 0.05f) }
.addSpecialty(new ItemStack(Items.ender_pearl), 0.05f); }
TE_ENDEARING.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.MYSTERIOUS.ordinal()), 0.10f)
.addProduct(Config.combs.getStackForType(CombType.TE_ENDEARING), 0.05f);
TE_COAL.addProduct(ForestryHelper.itemHoneycomb, 0.10f)
.addProduct(Config.combs.getStackForType(CombType.TE_CARBON), 0.05f)
.addSpecialty(new ItemStack(Items.coal), 0.05f);
TE_BLIZZY.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.FROZEN.ordinal()), 0.10f);
TE_GELID.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.FROZEN.ordinal()), 0.10f);
TE_SHOCKING.addProduct(Config.combs.getStackForType(CombType.AIRY), 0.16f);
TE_AMPED.addProduct(Config.combs.getStackForType(CombType.AIRY), 0.29f);
TE_GROUNDED.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.16f);
TE_ROCKING.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.29f);
TE_SIGNALUS.addProduct(Config.combs.getStackForType(CombType.TE_DESTABILIZED), 0.10f) public static void initRedstoneArsenelProducts() {
.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f); RSA_FLUXED.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
TE_LUMIUS.addProduct(Config.combs.getStackForType(CombType.TE_LUX), 0.10f)
.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f);
if (ThermalModsHelper.isActive()) { if (RedstoneArsenalHelper.isActive()) {
LogHelper.info("Thermal Expansion bees active"); RSA_FLUXED.addSpecialty(RedstoneArsenalHelper.fluxNugget, 0.09f);
TE_BLIZZY.addSpecialty(ThermalModsHelper.dustBlizz, 0.09f); }
TE_GELID.addSpecialty(ThermalModsHelper.dustCryotheum, 0.09f); }
TE_DANTE.addSpecialty(ThermalModsHelper.dustSulfur, 0.09f);
TE_PYRO.addSpecialty(ThermalModsHelper.dustPyrotheum, 0.09f);
TE_SHOCKING.addSpecialty(ThermalModsHelper.dustBlitz, 0.09f);
TE_AMPED.addSpecialty(ThermalModsHelper.dustAerotheum, 0.09f);
TE_GROUNDED.addSpecialty(ThermalModsHelper.dustBasalz, 0.09f);
TE_ROCKING.addSpecialty(ThermalModsHelper.dustPetrotheum, 0.09f);
TE_WINSOME.addSpecialty(ThermalModsHelper.dustPlatinum, 0.09f);
TE_ENDEARING.addSpecialty(ThermalModsHelper.enderiumNugget, 0.09f);
TE_SIGNALUS.addSpecialty(ThermalModsHelper.signalumNugget, 0.09f);
TE_LUMIUS.addSpecialty(ThermalModsHelper.lumiumNugget, 0.09f);
}
}
public static void initRedstoneArsenelProducts() { public static void initBotaniaProducts() {
RSA_FLUXED.addProduct(ForestryHelper.itemHoneycomb, 0.10f); BOT_ROOTED.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.10f);
BOT_BOTANIC.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.10f)
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.05f);
BOT_BLOSSOM.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.20f)
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.05f);
BOT_FLORAL.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.25f)
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.05f);
BOT_VAZBEE.addProduct(Config.combs.getStackForType(CombType.SOUL), 0.05f)
.addProduct(new ItemStack(Items.dye, 1, 9), 0.20f).addProduct(new ItemStack(Blocks.wool, 1, 9), 0.02f)
.addProduct(new ItemStack(Blocks.red_flower, 1, 7), 0.06f)
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.15f);
BOT_SOMNOLENT.addProduct(Config.combs.getStackForType(CombType.WATERY), 0.08f)
.addProduct(Config.combs.getStackForType(CombType.SOUL), 0.15f);
BOT_DREAMING.addProduct(Config.combs.getStackForType(CombType.WATERY), 0.16f)
.addProduct(Config.combs.getStackForType(CombType.SOUL), 0.33f);
BOT_ALFHEIM.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.28f);
if (RedstoneArsenalHelper.isActive()) { if (BotaniaHelper.isActive()) {
RSA_FLUXED.addSpecialty(RedstoneArsenalHelper.fluxNugget, 0.09f); for (int i = 0; i < 16; ++i) {
} ItemStack petal = new ItemStack(BotaniaHelper.itemPetal, 1, i);
} BOT_BOTANIC.addSpecialty(petal, 0.01f);
BOT_BLOSSOM.addSpecialty(petal, 0.04f);
BOT_FLORAL.addSpecialty(petal, 0.16f);
}
public static void initBotaniaProducts() { for (PastureSeed type : PastureSeed.values()) {
BOT_ROOTED.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.10f); BOT_VAZBEE.addSpecialty(new ItemStack(BotaniaHelper.itemPastureSeed, 1, type.ordinal()), 0.04f);
BOT_BOTANIC.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.10f) }
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.05f); }
BOT_BLOSSOM.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.20f) }
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.05f);
BOT_FLORAL.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.25f)
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.05f);
BOT_VAZBEE.addProduct(Config.combs.getStackForType(CombType.SOUL), 0.05f)
.addProduct(new ItemStack(Items.dye, 1, 9), 0.20f)
.addProduct(new ItemStack(Blocks.wool, 1, 9), 0.02f)
.addProduct(new ItemStack(Blocks.red_flower, 1, 7), 0.06f)
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.15f);
BOT_SOMNOLENT.addProduct(Config.combs.getStackForType(CombType.WATERY), 0.08f)
.addProduct(Config.combs.getStackForType(CombType.SOUL), 0.15f);
BOT_DREAMING.addProduct(Config.combs.getStackForType(CombType.WATERY), 0.16f)
.addProduct(Config.combs.getStackForType(CombType.SOUL), 0.33f);
BOT_ALFHEIM.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.28f);
if (BotaniaHelper.isActive()) { public static void initAppEngProducts() {
for (int i = 0; i < 16; ++i) { AE_SKYSTONE.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.19f);
ItemStack petal = new ItemStack(BotaniaHelper.itemPetal, 1, i); if (AppliedEnergisticsHelper.skystone != null) {
BOT_BOTANIC.addSpecialty(petal, 0.01f); AE_SKYSTONE.addSpecialty(new ItemStack(AppliedEnergisticsHelper.skystone), 0.02f);
BOT_BLOSSOM.addSpecialty(petal, 0.04f); } else {
BOT_FLORAL.addSpecialty(petal, 0.16f); AE_SKYSTONE.setInactive();
} }
}
for (PastureSeed type : PastureSeed.values()) {
BOT_VAZBEE.addSpecialty(new ItemStack(BotaniaHelper.itemPastureSeed, 1, type.ordinal()), 0.04f);
}
}
}
public static void initAppEngProducts() {
AE_SKYSTONE.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.19f);
if (AppliedEnergisticsHelper.skystone != null) {
AE_SKYSTONE.addSpecialty(new ItemStack(AppliedEnergisticsHelper.skystone), 0.02f);
}
else {
AE_SKYSTONE.setInactive();
}
}
} }
File diff suppressed because it is too large. Load diff
+141 -145
View File
@@ -9,7 +9,6 @@ import net.minecraft.block.Block;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.common.BiomeDictionary;
import forestry.api.apiculture.hives.HiveManager; import forestry.api.apiculture.hives.HiveManager;
@@ -17,7 +16,6 @@ import forestry.api.apiculture.hives.IHiveDescription;
import forestry.api.apiculture.hives.IHiveGen; import forestry.api.apiculture.hives.IHiveGen;
import forestry.api.core.EnumHumidity; import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature; import forestry.api.core.EnumTemperature;
import magicbees.block.types.HiveType; import magicbees.block.types.HiveType;
import magicbees.main.Config; import magicbees.main.Config;
import magicbees.main.utils.BlockUtil; import magicbees.main.utils.BlockUtil;
@@ -28,164 +26,162 @@ import magicbees.world.feature.HiveGenOblivion;
import magicbees.world.feature.HiveGenUnderground; import magicbees.world.feature.HiveGenUnderground;
public enum HiveDescription implements IHiveDescription { public enum HiveDescription implements IHiveDescription {
CURIOUS(HiveType.CURIOUS, 3.0f, HiveManager.genHelper.tree(), false,
BiomeDictionary.Type.FOREST, BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.HILLS),
UNUSUAL(HiveType.UNUSUAL, 1.0f, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass), false,
BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.MOUNTAIN, BiomeDictionary.Type.HILLS, BiomeDictionary.Type.RIVER),
RESONANT(HiveType.RESONANT, 0.9f, HiveManager.genHelper.ground(Blocks.sand, Blocks.sandstone), false,
BiomeDictionary.Type.SANDY, BiomeDictionary.Type.MESA, BiomeDictionary.Type.HOT, BiomeDictionary.Type.MAGICAL),
DEEP(HiveType.DEEP, 5.0f, new HiveGenUnderground(10, 15, 5), true,
BiomeDictionary.Type.HILLS, BiomeDictionary.Type.MOUNTAIN, BiomeDictionary.Type.MAGICAL) {
@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, 5);
FeatureOreVein.redstoneGen.generateVein(world, random, x - 1, y, z, 5);
FeatureOreVein.redstoneGen.generateVein(world, random, x, y + 1, z, 5);
FeatureOreVein.redstoneGen.generateVein(world, random, x, y - 1, z, 5);
FeatureOreVein.redstoneGen.generateVein(world, random, x, y, z + 1, 5);
FeatureOreVein.redstoneGen.generateVein(world, random, x, y, z - 1, 5);
}
},
INFERNAL(HiveType.INFERNAL, 50.0f, new HiveGenNether(0, 175, 6), true,
BiomeDictionary.Type.NETHER) {
@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, 0.95f, new HiveGenUnderground(5, 13, 6), true,
BiomeDictionary.Type.MAGICAL, BiomeDictionary.Type.HOT) {
@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)) { CURIOUS(HiveType.CURIOUS, 3.0f, HiveManager.genHelper.tree(), false, BiomeDictionary.Type.FOREST,
world.setBlock(x, y + 1, z, Blocks.glowstone, 0, 3); BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.HILLS),
} UNUSUAL(HiveType.UNUSUAL, 1.0f, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass), false,
BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.MOUNTAIN, BiomeDictionary.Type.HILLS,
BiomeDictionary.Type.RIVER),
RESONANT(HiveType.RESONANT, 0.9f, HiveManager.genHelper.ground(Blocks.sand, Blocks.sandstone), false,
BiomeDictionary.Type.SANDY, BiomeDictionary.Type.MESA, BiomeDictionary.Type.HOT,
BiomeDictionary.Type.MAGICAL),
DEEP(HiveType.DEEP, 5.0f, new HiveGenUnderground(10, 15, 5), true, BiomeDictionary.Type.HILLS,
BiomeDictionary.Type.MOUNTAIN, BiomeDictionary.Type.MAGICAL) {
if (BlockUtil.canBlockReplaceAt(world, x, y - 1, z, Blocks.stone)) { @Override
world.setBlock(x, y - 1, z, Blocks.glowstone, 0, 3); 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, 5);
FeatureOreVein.redstoneGen.generateVein(world, random, x - 1, y, z, 5);
FeatureOreVein.redstoneGen.generateVein(world, random, x, y + 1, z, 5);
FeatureOreVein.redstoneGen.generateVein(world, random, x, y - 1, z, 5);
FeatureOreVein.redstoneGen.generateVein(world, random, x, y, z + 1, 5);
FeatureOreVein.redstoneGen.generateVein(world, random, x, y, z - 1, 5);
}
},
INFERNAL(HiveType.INFERNAL, 50.0f, new HiveGenNether(0, 175, 6), true, BiomeDictionary.Type.NETHER) {
FeatureOreVein.glowstoneGen.generateVein(world, random, x, y, z + 1, world.rand.nextInt(4) + 1); @Override
FeatureOreVein.glowstoneGen.generateVein(world, random, x, y, z - 1, world.rand.nextInt(4) + 1); public void postGen(World world, int x, int y, int z) {
} super.postGen(world, x, y, z);
}, Random random = world.rand;
OBLIVION(HiveType.OBLIVION, 20.0f, new HiveGenOblivion(), true, FeatureOreVein.netherQuartzGen.generateVein(world, random, x + 1, y, z, 4);
BiomeDictionary.Type.END) { FeatureOreVein.netherQuartzGen.generateVein(world, random, x - 1, y, z, 4);
@Override FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y + 1, z, 4);
public void postGen(World world, int x, int y, int z) { FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y - 1, z, 4);
super.postGen(world, x, y, z); FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y, z + 1, 4);
int obsidianSpikeHeight = world.rand.nextInt(8) + 3; FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y, z - 1, 4);
}
},
INFERNAL_OVERWORLD(HiveType.INFERNAL, 0.95f, new HiveGenUnderground(5, 13, 6), true, BiomeDictionary.Type.MAGICAL,
BiomeDictionary.Type.HOT) {
for (int i = 1; i < obsidianSpikeHeight && y - i > 0; ++i) { @Override
world.setBlock(x, y - i, z, Blocks.obsidian, 0, 2); 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);
OBLIVION_OVERWORLD(HiveType.OBLIVION, 0.87f, new HiveGenUnderground(5, 5, 5), true, FeatureOreVein.glowstoneGen.generateVein(world, random, x - 1, y, z, world.rand.nextInt(4) + 1);
BiomeDictionary.Type.MAGICAL, BiomeDictionary.Type.COLD) {
@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); if (BlockUtil.canBlockReplaceAt(world, x, y + 1, z, Blocks.stone)) {
FeatureOreVein.endStoneGen.generateVein(world, random, x - 1, y, z, world.rand.nextInt(6) + 1); world.setBlock(x, y + 1, z, Blocks.glowstone, 0, 3);
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; if (BlockUtil.canBlockReplaceAt(world, x, y - 1, z, Blocks.stone)) {
world.setBlock(x, y - 1, z, Blocks.glowstone, 0, 3);
}
private final HiveType hiveType; FeatureOreVein.glowstoneGen.generateVein(world, random, x, y, z + 1, world.rand.nextInt(4) + 1);
private final float genChance; FeatureOreVein.glowstoneGen.generateVein(world, random, x, y, z - 1, world.rand.nextInt(4) + 1);
private final List<BiomeDictionary.Type> biomes = new ArrayList<BiomeDictionary.Type>(); }
private final IHiveGen hiveGen; },
private final boolean spawnsIgnoreClimate; OBLIVION(HiveType.OBLIVION, 20.0f, new HiveGenOblivion(), true, BiomeDictionary.Type.END) {
private HiveDescription(HiveType type, float chance, IHiveGen genType, boolean ignoreClimate, BiomeDictionary.Type ... goodBiomeTypes) { @Override
hiveType = type; public void postGen(World world, int x, int y, int z) {
genChance = chance; super.postGen(world, x, y, z);
hiveGen = genType; int obsidianSpikeHeight = world.rand.nextInt(8) + 3;
spawnsIgnoreClimate = ignoreClimate;
for (BiomeDictionary.Type biomeType : goodBiomeTypes) {
biomes.add(biomeType);
}
}
@Override for (int i = 1; i < obsidianSpikeHeight && y - i > 0; ++i) {
public IHiveGen getHiveGen() world.setBlock(x, y - i, z, Blocks.obsidian, 0, 2);
{ }
return hiveGen; }
} },
OBLIVION_OVERWORLD(HiveType.OBLIVION, 0.87f, new HiveGenUnderground(5, 5, 5), true, BiomeDictionary.Type.MAGICAL,
BiomeDictionary.Type.COLD) {
@Override @Override
public Block getBlock() public void postGen(World world, int x, int y, int z) {
{ super.postGen(world, x, y, z);
return Config.hive; Random random = world.rand;
}
@Override FeatureOreVein.endStoneGen.generateVein(world, random, x + 1, y, z, world.rand.nextInt(6) + 1);
public int getMeta() 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);
return hiveType.ordinal(); 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);
}
};
@Override private static boolean logSpawns = Config.logHiveSpawns;
public boolean isGoodBiome(BiomeGenBase biome)
{
BiomeDictionary.Type[] types = BiomeDictionary.getTypesForBiome(biome);
for (BiomeDictionary.Type type : types)
{
if (biomes.contains(type))
{
return true;
}
}
return false; private final HiveType hiveType;
} private final float genChance;
private final List<BiomeDictionary.Type> biomes = new ArrayList<BiomeDictionary.Type>();
private final IHiveGen hiveGen;
private final boolean spawnsIgnoreClimate;
@Override private HiveDescription(HiveType type, float chance, IHiveGen genType, boolean ignoreClimate,
public boolean isGoodHumidity(EnumHumidity humidity) BiomeDictionary.Type... goodBiomeTypes) {
{ hiveType = type;
return spawnsIgnoreClimate || hiveType.getOccupant().canWorkInHumidity(humidity); genChance = chance;
} hiveGen = genType;
spawnsIgnoreClimate = ignoreClimate;
for (BiomeDictionary.Type biomeType : goodBiomeTypes) {
biomes.add(biomeType);
}
}
@Override @Override
public boolean isGoodTemperature(EnumTemperature temperature) public IHiveGen getHiveGen() {
{ return hiveGen;
return spawnsIgnoreClimate || hiveType.getOccupant().canWorkInTemperature(temperature); }
}
@Override @Override
public float getGenChance() public Block getBlock() {
{ return Config.hive;
return genChance; }
}
@Override @Override
public void postGen(World world, int x, int y, int z) public int getMeta() {
{ return hiveType.ordinal();
if (logSpawns) }
{
LogHelper.info("Spawned " + this.toString().toLowerCase(Locale.ENGLISH) + " hive at: X " + x + ", Y: " + y + ", Z: " + z); @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 spawnsIgnoreClimate || hiveType.getOccupant().canWorkInHumidity(humidity);
}
@Override
public boolean isGoodTemperature(EnumTemperature temperature) {
return spawnsIgnoreClimate || 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);
}
}
} }
+45 -53
View File
@@ -5,73 +5,65 @@ import java.util.Collection;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.EnumBeeType;
import forestry.api.apiculture.IBee; import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IHiveDrop; import forestry.api.apiculture.IHiveDrop;
import forestry.api.genetics.IAllele; import forestry.api.genetics.IAllele;
public class HiveDrop implements IHiveDrop 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) private IAllele[] template;
{ private int chance;
this.template = beeTemplate; private ItemStack[] bonus;
this.bonus = bonusDrops; private float ignoblePercent = 0f;
this.chance = dropChance;
}
public HiveDrop setIgnoblePercentage(float f) public HiveDrop(IAllele[] beeTemplate, ItemStack[] bonusDrops, int dropChance) {
{ this.template = beeTemplate;
this.ignoblePercent = f; this.bonus = bonusDrops;
this.chance = dropChance;
}
return this; public HiveDrop setIgnoblePercentage(float f) {
} this.ignoblePercent = f;
private IBee getBee(World w) return this;
{ }
IBee bee = BeeManager.beeRoot.getBee(w, BeeManager.beeRoot.templateAsGenome(this.template));
if (w.rand.nextFloat() < this.ignoblePercent)
{
bee.setIsNatural(false);
}
return bee; 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);
}
@Override return bee;
public ItemStack getPrincess(World world, int x, int y, int z, int fortune) }
{
return BeeManager.beeRoot.getMemberStack(getBee(world), EnumBeeType.PRINCESS.ordinal());
}
@Override @Override
public Collection<ItemStack> getDrones(World world, int x, int y, int z, int fortune) public ItemStack getPrincess(World world, int x, int y, int z, int fortune) {
{ return BeeManager.beeRoot.getMemberStack(getBee(world), EnumBeeType.PRINCESS.ordinal());
ArrayList<ItemStack> value = new ArrayList<ItemStack>(1); }
value.add(BeeManager.beeRoot.getMemberStack(getBee(world), EnumBeeType.DRONE.ordinal()));
return value;
}
@Override @Override
public Collection<ItemStack> getAdditional(World world, int x, int y, int z, int fortune) public Collection<ItemStack> getDrones(World world, int x, int y, int z, int fortune) {
{ ArrayList<ItemStack> value = new ArrayList<ItemStack>(1);
ArrayList<ItemStack> value = new ArrayList<ItemStack>(bonus.length); value.add(BeeManager.beeRoot.getMemberStack(getBee(world), EnumBeeType.DRONE.ordinal()));
return value;
}
for (int i = 0; i < bonus.length; ++i) @Override
{ public Collection<ItemStack> getAdditional(World world, int x, int y, int z, int fortune) {
value.add(bonus[i].copy()); ArrayList<ItemStack> value = new ArrayList<ItemStack>(bonus.length);
}
return value; for (int i = 0; i < bonus.length; ++i) {
} value.add(bonus[i].copy());
}
@Override return value;
public int getChance(World world, int x, int y, int z) }
{
return this.chance; @Override
} public int getChance(World world, int x, int y, int z) {
return this.chance;
}
} }
@@ -0,0 +1,171 @@
package magicbees.bees;
import java.util.ArrayList;
import java.util.Collection;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.common.util.Constants;
import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IBeekeepingMode;
import forestry.api.apiculture.IHiveFrame;
import forestry.apiculture.inventory.IApiaryInventory;
import magicbees.main.utils.ItemStackUtils;
import magicbees.tileentity.TileEntityMagicApiary;
public class MagicApiaryInventory implements IApiaryInventory {
public static final int SLOT_QUEEN = 0;
public static final int SLOT_DRONE = 1;
public static final int SLOT_FRAME_START = 2;
public static final int SLOT_FRAME_COUNT = 3;
public static final int SLOT_PRODUCTS_START = 5;
public static final int SLOT_PRODUCTS_COUNT = 7;
private final TileEntityMagicApiary magicApiary;
private final ItemStack[] items;
public MagicApiaryInventory(TileEntityMagicApiary magicApiary) {
this.magicApiary = magicApiary;
this.items = new ItemStack[12];
}
@Override
public ItemStack getQueen() {
return magicApiary.getStackInSlot(SLOT_QUEEN);
}
@Override
public ItemStack getDrone() {
return magicApiary.getStackInSlot(SLOT_DRONE);
}
@Override
public void setQueen(ItemStack itemstack) {
magicApiary.setInventorySlotContents(SLOT_QUEEN, itemstack);
}
@Override
public void setDrone(ItemStack itemstack) {
magicApiary.setInventorySlotContents(SLOT_DRONE, itemstack);
}
@Override
public boolean addProduct(ItemStack product, boolean all) {
int countAdded = ItemStackUtils
.addItemToInventory(magicApiary, product, SLOT_PRODUCTS_START, SLOT_PRODUCTS_COUNT);
if (all) {
return countAdded == product.stackSize;
}
return countAdded > 0;
}
public int getSizeInventory() {
return items.length;
}
public ItemStack getStackInSlot(int i) {
return items[i];
}
public void setInventorySlotContents(int i, ItemStack itemStack) {
items[i] = itemStack;
if (itemStack != null && itemStack.stackSize > getInventoryStackLimit()) {
itemStack.stackSize = getInventoryStackLimit();
}
}
public int[] getAccessibleSlotsFromSide(int side) {
int[] slots = new int[SLOT_PRODUCTS_COUNT + 2];
slots[0] = SLOT_QUEEN;
slots[1] = SLOT_DRONE;
for (int i = 0, slot = SLOT_PRODUCTS_START; i < SLOT_PRODUCTS_COUNT; ++i, ++slot) {
slots[i + 2] = slot;
}
return slots;
}
public boolean canInsertItem(int slot, ItemStack itemStack, int side) {
if (slot == SLOT_QUEEN && BeeManager.beeRoot.isMember(itemStack) && !BeeManager.beeRoot.isDrone(itemStack)) {
return true;
} else if (slot == SLOT_DRONE && BeeManager.beeRoot.isDrone(itemStack)) {
return true;
}
return slot == SLOT_DRONE && BeeManager.beeRoot.isDrone(itemStack);
}
public boolean canExtractItem(int slot, ItemStack itemStack, int side) {
return slot >= SLOT_PRODUCTS_START && slot <= SLOT_PRODUCTS_START + SLOT_PRODUCTS_COUNT;
}
public int getInventoryStackLimit() {
return 64;
}
public Collection<IHiveFrame> getFrames() {
Collection<IHiveFrame> hiveFrames = new ArrayList<IHiveFrame>(SLOT_FRAME_COUNT);
for (int i = SLOT_FRAME_START; i < SLOT_FRAME_START + SLOT_FRAME_COUNT; i++) {
ItemStack stackInSlot = magicApiary.getStackInSlot(i);
if (stackInSlot == null) {
continue;
}
Item itemInSlot = stackInSlot.getItem();
if (itemInSlot instanceof IHiveFrame) {
hiveFrames.add((IHiveFrame) itemInSlot);
}
}
return hiveFrames;
}
public void wearOutFrames(IBeeHousing beeHousing, int amount) {
IBeekeepingMode beekeepingMode = BeeManager.beeRoot.getBeekeepingMode(magicApiary.getWorldObj());
int wear = Math.round(amount * beekeepingMode.getWearModifier());
for (int i = MagicApiaryInventory.SLOT_FRAME_START; i
< MagicApiaryInventory.SLOT_FRAME_START + MagicApiaryInventory.SLOT_FRAME_COUNT; i++) {
ItemStack hiveFrameStack = magicApiary.getStackInSlot(i);
if (hiveFrameStack == null) {
continue;
}
Item hiveFrameItem = hiveFrameStack.getItem();
if (!(hiveFrameItem instanceof IHiveFrame)) {
continue;
}
IHiveFrame hiveFrame = (IHiveFrame) hiveFrameItem;
ItemStack queenStack = magicApiary.getBeeInventory().getQueen();
IBee queen = BeeManager.beeRoot.getMember(queenStack);
ItemStack usedFrame = hiveFrame.frameUsed(magicApiary, hiveFrameStack, queen, wear);
magicApiary.setInventorySlotContents(i, usedFrame);
}
}
public void writeToNBT(NBTTagCompound compound) {
NBTTagList itemsNBT = new NBTTagList();
for (int i = 0; i < items.length; i++) {
ItemStack itemStack = items[i];
if (itemStack != null) {
NBTTagCompound item = new NBTTagCompound();
item.setByte("Slot", (byte) i);
itemStack.writeToNBT(item);
itemsNBT.appendTag(item);
}
}
compound.setTag("Items", itemsNBT);
}
public void readFromNBT(NBTTagCompound compound) {
NBTTagList items = compound.getTagList("Items", Constants.NBT.TAG_COMPOUND);
for (int i = 0; i < items.tagCount(); i++) {
NBTTagCompound item = items.getCompoundTagAt(i);
int slot = item.getByte("Slot");
if (slot >= 0 && slot < getSizeInventory()) {
setInventorySlotContents(slot, ItemStack.loadItemStackFromNBT(item));
}
}
}
}
@@ -2,47 +2,52 @@ package magicbees.bees;
import net.minecraft.world.World; import net.minecraft.world.World;
import forestry.api.core.IClimateProvider;
import forestry.api.genetics.IAllele; import forestry.api.genetics.IAllele;
import forestry.api.genetics.IGenome; import forestry.api.genetics.IGenome;
import forestry.api.genetics.IMutationCondition; import forestry.api.genetics.IMutationCondition;
import magicbees.main.utils.LocalizationManager; import magicbees.main.utils.LocalizationManager;
import magicbees.main.utils.MoonPhase; import magicbees.main.utils.MoonPhase;
// There is a bonus to this mutation during moon phases... // There is a bonus to this mutation during moon phases...
public class MoonPhaseMutationBonus implements IMutationCondition { public class MoonPhaseMutationBonus implements IMutationCondition {
private final MoonPhase moonPhaseStart;
private final MoonPhase moonPhaseEnd;
private final float mutationBonus;
public MoonPhaseMutationBonus(MoonPhase phase, float bonus) { private final MoonPhase moonPhaseStart;
this.moonPhaseStart = phase; private final MoonPhase moonPhaseEnd;
this.moonPhaseEnd = phase; private final float mutationBonus;
this.mutationBonus = bonus;
}
public MoonPhaseMutationBonus(MoonPhase start, MoonPhase end, float bonus) { public MoonPhaseMutationBonus(MoonPhase phase, float bonus) {
this.moonPhaseStart = start; this.moonPhaseStart = phase;
this.moonPhaseEnd = end; this.moonPhaseEnd = phase;
this.mutationBonus = bonus; this.mutationBonus = bonus;
} }
@Override public MoonPhaseMutationBonus(MoonPhase start, MoonPhase end, float bonus) {
public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) { this.moonPhaseStart = start;
if (MoonPhase.getMoonPhase(world).isBetween(this.moonPhaseStart, this.moonPhaseEnd)) { this.moonPhaseEnd = end;
return this.mutationBonus; this.mutationBonus = bonus;
} }
return 1;
}
@Override @Override
public String getDescription() { public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0,
if (this.moonPhaseStart != this.moonPhaseEnd) { IGenome genome1, IClimateProvider climate) {
return String.format(LocalizationManager.getLocalizedString("research.bonusPhase"), if (MoonPhase.getMoonPhase(world).isBetween(this.moonPhaseStart, this.moonPhaseEnd)) {
moonPhaseStart.getLocalizedNameAlt(), moonPhaseEnd.getLocalizedNameAlt()); return this.mutationBonus;
} else { }
return String.format(LocalizationManager.getLocalizedString("research.bonusPhaseSingle"), return 1;
moonPhaseStart.getLocalizedName()); }
}
} @Override
public String getDescription() {
if (this.moonPhaseStart != this.moonPhaseEnd) {
return String.format(
LocalizationManager.getLocalizedString("research.bonusPhase"),
moonPhaseStart.getLocalizedNameAlt(),
moonPhaseEnd.getLocalizedNameAlt());
} else {
return String.format(
LocalizationManager.getLocalizedString("research.bonusPhaseSingle"),
moonPhaseStart.getLocalizedName());
}
}
} }
@@ -2,44 +2,48 @@ package magicbees.bees;
import net.minecraft.world.World; import net.minecraft.world.World;
import forestry.api.core.IClimateProvider;
import forestry.api.genetics.IAllele; import forestry.api.genetics.IAllele;
import forestry.api.genetics.IGenome; import forestry.api.genetics.IGenome;
import forestry.api.genetics.IMutationCondition; import forestry.api.genetics.IMutationCondition;
import magicbees.main.utils.LocalizationManager; import magicbees.main.utils.LocalizationManager;
import magicbees.main.utils.MoonPhase; import magicbees.main.utils.MoonPhase;
public class MoonPhaseMutationRestriction implements IMutationCondition { public class MoonPhaseMutationRestriction implements IMutationCondition {
private final MoonPhase moonPhaseStart;
private final MoonPhase moonPhaseEnd;
public MoonPhaseMutationRestriction(MoonPhase phase) { private final MoonPhase moonPhaseStart;
this.moonPhaseStart = phase; private final MoonPhase moonPhaseEnd;
this.moonPhaseEnd = phase;
}
public MoonPhaseMutationRestriction(MoonPhase start, MoonPhase end) { public MoonPhaseMutationRestriction(MoonPhase phase) {
this.moonPhaseStart = start; this.moonPhaseStart = phase;
this.moonPhaseEnd = end; this.moonPhaseEnd = phase;
} }
@Override public MoonPhaseMutationRestriction(MoonPhase start, MoonPhase end) {
public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) { this.moonPhaseStart = start;
if (MoonPhase.getMoonPhase(world).isBetween(this.moonPhaseStart, this.moonPhaseEnd)) { this.moonPhaseEnd = end;
return 1; }
}
return 0;
}
@Override @Override
public String getDescription() { public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0,
if (moonPhaseStart != moonPhaseEnd) { IGenome genome1, IClimateProvider climate) {
return String.format(LocalizationManager.getLocalizedString("research.requiresPhase"), if (MoonPhase.getMoonPhase(world).isBetween(this.moonPhaseStart, this.moonPhaseEnd)) {
moonPhaseStart.getLocalizedNameAlt(), moonPhaseEnd.getLocalizedNameAlt()); return 1;
} }
else { return 0;
return String.format(LocalizationManager.getLocalizedString("research.requiresPhaseSingle"), }
moonPhaseStart.getLocalizedName());
} @Override
} public String getDescription() {
if (moonPhaseStart != moonPhaseEnd) {
return String.format(
LocalizationManager.getLocalizedString("research.requiresPhase"),
moonPhaseStart.getLocalizedNameAlt(),
moonPhaseEnd.getLocalizedNameAlt());
} else {
return String.format(
LocalizationManager.getLocalizedString("research.requiresPhaseSingle"),
moonPhaseStart.getLocalizedName());
}
}
} }
@@ -2,86 +2,96 @@ package magicbees.bees.allele.effect;
import java.util.HashMap; import java.util.HashMap;
import magicbees.bees.AlleleEffect;
import magicbees.bees.BeeManager;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IBeeModifier; import forestry.api.apiculture.IBeeModifier;
import forestry.api.genetics.IEffectData; import forestry.api.genetics.IEffectData;
import magicbees.bees.AlleleEffect;
import magicbees.bees.BeeManager;
public class AlleleEffectCrumbling extends AlleleEffect { public class AlleleEffectCrumbling extends AlleleEffect {
private static HashMap<ItemStack, ItemStack> crumbleMap = new HashMap<ItemStack, ItemStack>();
public static void addPairToMap(ItemStack source, ItemStack target) { private static HashMap<ItemStack, ItemStack> crumbleMap = new HashMap<ItemStack, ItemStack>();
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) { public static void addPairToMap(ItemStack source, ItemStack target) {
super(id, isDominant, 600); boolean add = true;
for (ItemStack i : crumbleMap.keySet()) {
if (OreDictionary.itemMatches(i, source, false)) {
add = false;
break;
}
}
if (add) {
crumbleMap.put(source, target);
}
}
addPairToMap(new ItemStack(Blocks.stone), new ItemStack(Blocks.cobblestone)); public AlleleEffectCrumbling(String id, boolean isDominant) {
addPairToMap(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.mossy_cobblestone)); super(id, isDominant, 600);
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 addPairToMap(new ItemStack(Blocks.stone), new ItemStack(Blocks.cobblestone));
public IEffectData validateStorage(IEffectData storedData) { addPairToMap(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.mossy_cobblestone));
if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { addPairToMap(new ItemStack(Blocks.stonebrick, 1, 0), new ItemStack(Blocks.stonebrick, 1, 2));
storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0); 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));
return storedData; addPairToMap(new ItemStack(Blocks.gravel), new ItemStack(Blocks.sand));
} }
@Override @Override
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { public IEffectData validateStorage(IEffectData storedData) {
World world = housing.getWorld(); if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) {
ChunkCoordinates coords = housing.getCoordinates(); storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0);
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); }
return storedData;
}
// Get random coords within territory @Override
int xRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]); protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
int yRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]); World world = housing.getWorld();
int zRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]); ChunkCoordinates coords = housing.getCoordinates();
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
int xCoord = coords.posX + world.rand.nextInt(xRange) - xRange / 2; // Get random coords within territory
int yCoord = coords.posY + world.rand.nextInt(yRange) - yRange / 2; int[] randomCoords = new int[3];
int zCoord = coords.posZ + world.rand.nextInt(zRange) - zRange / 2; for (int i = 0; i < 3; i++) {
int range = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[i]);
if (range > 0) {
randomCoords[i] = world.rand.nextInt(range) - range / 2;
}
}
Block block = world.getBlock(xCoord, yCoord, zCoord); int xCoord = coords.posX + randomCoords[0];
if (block != null) { int yCoord = coords.posY + randomCoords[1];
ItemStack source = new ItemStack(block, 1, world.getBlockMetadata(xCoord, yCoord, zCoord)); int zCoord = coords.posZ + randomCoords[2];
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; 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);
storedData.setInteger(0, 0); break;
}
}
}
return storedData; storedData.setInteger(0, 0);
}
return storedData;
}
} }
@@ -2,40 +2,38 @@ package magicbees.bees.allele.effect;
import java.util.List; import java.util.List;
import magicbees.bees.AlleleEffect;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeHousing;
import forestry.api.genetics.IEffectData; import forestry.api.genetics.IEffectData;
import magicbees.bees.AlleleEffect;
public class AlleleEffectCure extends AlleleEffect { public class AlleleEffectCure extends AlleleEffect {
public AlleleEffectCure(String id, boolean isDominant) { public AlleleEffectCure(String id, boolean isDominant) {
super(id, isDominant, 200); super(id, isDominant, 200);
} }
@Override @Override
public IEffectData validateStorage(IEffectData storedData) { public IEffectData validateStorage(IEffectData storedData) {
if (storedData == null) { if (storedData == null) {
storedData = new EffectData(1, 0, 0); storedData = new EffectData(1, 0, 0);
} }
return storedData; return storedData;
} }
@Override @Override
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
List<EntityPlayer> entityList = this.getEntitiesWithinRange(genome, housing, EntityPlayer.class); List<EntityPlayer> entityList = this.getEntitiesWithinRange(genome, housing, EntityPlayer.class);
for (EntityPlayer player : entityList) { for (EntityPlayer player : entityList) {
player.curePotionEffects(new ItemStack(Items.milk_bucket)); player.curePotionEffects(new ItemStack(Items.milk_bucket));
} }
storedData.setInteger(0, 0); storedData.setInteger(0, 0);
return storedData;
}
return storedData;
}
} }
@@ -1,48 +1,118 @@
package magicbees.bees.allele.effect; package magicbees.bees.allele.effect;
import java.util.List; import static magicbees.main.utils.compat.thaumcraft.NodeHelper.getWeightedRandomAspect;
import static magicbees.main.utils.compat.thaumcraft.NodeHelper.updateNode;
import magicbees.bees.AlleleEffect; import java.util.ArrayList;
import magicbees.bees.BeeManager; import java.util.Collections;
import magicbees.main.utils.BlockUtil; import java.util.List;
import magicbees.main.utils.compat.thaumcraft.NodeHelper;
import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.Chunk;
import forestry.api.apiculture.IAlleleBeeAcceleratableEffect;
import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IBeeModifier; import forestry.api.apiculture.IBeeModifier;
import forestry.api.genetics.IEffectData; import forestry.api.genetics.IEffectData;
import magicbees.bees.AlleleEffect;
import magicbees.bees.BeeManager;
import magicbees.main.Config;
import magicbees.main.utils.BlockUtil;
import magicbees.main.utils.compat.thaumcraft.NodeHelper;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.nodes.INode;
public class AlleleEffectEmpowering extends AlleleEffect { public class AlleleEffectEmpowering extends AlleleEffect implements IAlleleBeeAcceleratableEffect {
public AlleleEffectEmpowering(String id, boolean isDominant) { public AlleleEffectEmpowering(String id, boolean isDominant) {
super(id, isDominant, 200); super(id, isDominant, 200);
combinable = true; combinable = true;
} }
@Override @Override
public IEffectData validateStorage(IEffectData storedData) { public IEffectData validateStorage(IEffectData storedData) {
if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { if (!(storedData instanceof EffectData)) {
storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0); storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0);
} }
return storedData; return storedData;
} }
@Override @Override
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
World world = housing.getWorld(); World world = housing.getWorld();
ChunkCoordinates coords = housing.getCoordinates(); ChunkCoordinates coords = housing.getCoordinates();
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
int range = Math.max((int)Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f)), 1); int range = Math
List<Chunk> chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range); .max((int) Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f)), 1);
List<Chunk> chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range);
if (NodeHelper.growNodeInRange(chunks, world, coords.posX, coords.posY, coords.posZ, range)) { if (NodeHelper.growNodeInRange(chunks, world, coords.posX, coords.posY, coords.posZ, range)) {
storedData.setInteger(0, storedData.getInteger(0) - throttle); storedData.setInteger(0, storedData.getInteger(0) - throttle);
} }
return storedData; return storedData;
} }
@Override
public IEffectData doEffectAccelerated(IBeeGenome genome, IEffectData storedData, IBeeHousing housing, float did) {
storedData.setInteger(0, 0);
World world = housing.getWorld();
ChunkCoordinates coords = housing.getCoordinates();
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
int range = Math
.max((int) Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f)), 1);
List<Chunk> chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range);
int idid = (int) did;
List<INode> nodes = new ArrayList<>(idid);
Collections.shuffle(chunks);
for (Chunk chunk : chunks) {
List<INode> l = NodeHelper.findNodesInChunkWithinRange(chunk, coords.posX, coords.posY, coords.posZ, range);
nodes.addAll(l);
idid -= l.size();
if (idid <= 0) {
while (idid < 0) {
nodes.remove(0);
idid++;
}
break;
}
}
if (nodes.isEmpty()) return storedData;
did /= (float) nodes.size();
if (did < 1f) did = 1f;
for (INode node : nodes) {
AspectList aspectsBase = node.getAspectsBase();
int randBase = Math.max(aspectsBase.visSize(), 1);
if (world.rand.nextInt(randBase) < 120) {
Aspect aspectToAdd;
int rollAttempts = 0;
short amount = (short) Math
.min((int) did + world.rand.nextInt((int) (2f * did)), Config.thaumcraftNodeMaxSize);
do {
aspectToAdd = getWeightedRandomAspect(world.rand);
++rollAttempts;
} while (aspectsBase.getAmount(aspectToAdd) > (Config.thaumcraftNodeMaxSize - 1) && rollAttempts < 20);
if (20 <= rollAttempts) {
continue;
}
amount = (short) Math.min(Config.thaumcraftNodeMaxSize - aspectsBase.getAmount(aspectToAdd), amount);
aspectsBase.add(aspectToAdd, amount);
node.getAspects().add(aspectToAdd, amount);
updateNode(node, world);
}
}
return storedData;
}
} }
@@ -2,49 +2,50 @@ package magicbees.bees.allele.effect;
import java.util.List; import java.util.List;
import magicbees.bees.AlleleEffect;
import magicbees.bees.BeeManager;
import magicbees.main.utils.BlockUtil;
import magicbees.main.utils.compat.thaumcraft.NodeHelper;
import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.Chunk;
import thaumcraft.api.nodes.NodeType;
import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IBeeModifier; import forestry.api.apiculture.IBeeModifier;
import forestry.api.genetics.IEffectData; import forestry.api.genetics.IEffectData;
import magicbees.bees.AlleleEffect;
import magicbees.bees.BeeManager;
import magicbees.main.utils.BlockUtil;
import magicbees.main.utils.compat.thaumcraft.NodeHelper;
import thaumcraft.api.nodes.NodeType;
public class AlleleEffectNodeConversion extends AlleleEffect { public class AlleleEffectNodeConversion extends AlleleEffect {
private NodeType targetType; private NodeType targetType;
public AlleleEffectNodeConversion(String id, NodeType targetNodeType, boolean isDominant, int timeout) { public AlleleEffectNodeConversion(String id, NodeType targetNodeType, boolean isDominant, int timeout) {
super(id, isDominant, timeout); super(id, isDominant, timeout);
targetType = targetNodeType; targetType = targetNodeType;
} }
@Override @Override
public IEffectData validateStorage(IEffectData storedData) { public IEffectData validateStorage(IEffectData storedData) {
if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) {
storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0); storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0);
} }
return storedData; return storedData;
} }
@Override @Override
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
World world = housing.getWorld(); World world = housing.getWorld();
ChunkCoordinates coords = housing.getCoordinates(); ChunkCoordinates coords = housing.getCoordinates();
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
int range = (int)Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f)); int range = (int) Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f));
List<Chunk> chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range); List<Chunk> chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range);
if (NodeHelper.convertNodeInRangeToType(chunks, world, coords.posX, coords.posY, coords.posZ, range, targetType)) { if (NodeHelper
storedData.setInteger(0, storedData.getInteger(0) - throttle); .convertNodeInRangeToType(chunks, world, coords.posX, coords.posY, coords.posZ, range, targetType)) {
} storedData.setInteger(0, storedData.getInteger(0) - throttle);
}
return storedData;
}
return storedData;
}
} }
@@ -5,6 +5,7 @@ import java.util.List;
import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.Chunk;
import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IBeeModifier; import forestry.api.apiculture.IBeeModifier;
@@ -16,31 +17,30 @@ import magicbees.main.utils.compat.thaumcraft.NodeHelper;
public class AlleleEffectNodeRepair extends AlleleEffect { public class AlleleEffectNodeRepair extends AlleleEffect {
public AlleleEffectNodeRepair(String id, boolean isDominant) { public AlleleEffectNodeRepair(String id, boolean isDominant) {
super(id, isDominant, 2); super(id, isDominant, 2);
} }
@Override @Override
public IEffectData validateStorage(IEffectData storedData) { public IEffectData validateStorage(IEffectData storedData) {
if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) {
storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0); storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0);
} }
return storedData; return storedData;
} }
@Override @Override
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
World world = housing.getWorld(); World world = housing.getWorld();
ChunkCoordinates coords = housing.getCoordinates(); ChunkCoordinates coords = housing.getCoordinates();
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
int range = (int)Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f)); int range = (int) Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f));
List<Chunk> chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range); List<Chunk> chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range);
if (NodeHelper.repairNodeInRange(chunks, world, coords.posX, coords.posY, coords.posZ, range)) { if (NodeHelper.repairNodeInRange(chunks, world, coords.posX, coords.posY, coords.posZ, range)) {
storedData.setInteger(0, storedData.getInteger(0) - throttle); storedData.setInteger(0, storedData.getInteger(0) - throttle);
} }
return storedData;
}
return storedData;
}
} }
@@ -7,18 +7,17 @@ import magicbees.bees.AlleleEffect;
public class AlleleEffectPlaceholder extends AlleleEffect { public class AlleleEffectPlaceholder extends AlleleEffect {
public AlleleEffectPlaceholder(String id, boolean isDominant) { public AlleleEffectPlaceholder(String id, boolean isDominant) {
super(id, isDominant, 100000); super(id, isDominant, 100000);
} }
@Override @Override
public IEffectData validateStorage(IEffectData storedData) { public IEffectData validateStorage(IEffectData storedData) {
return storedData; return storedData;
} }
@Override
protected IEffectData doEffectThrottled(IBeeGenome genome,IEffectData storedData, IBeeHousing housing) {
return storedData;
}
@Override
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
return storedData;
}
} }
@@ -2,8 +2,6 @@ package magicbees.bees.allele.effect;
import java.util.List; import java.util.List;
import magicbees.bees.AlleleEffect;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
@@ -13,52 +11,54 @@ import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeHousing;
import forestry.api.genetics.IEffectData; import forestry.api.genetics.IEffectData;
import magicbees.bees.AlleleEffect;
public class AlleleEffectPotion extends AlleleEffect { public class AlleleEffectPotion extends AlleleEffect {
private int potionId;
private int duration;
private boolean isMalicious;
public AlleleEffectPotion(String name, Potion potionApplied, int effectDuration, boolean isDominant) { private int potionId;
super(name, isDominant, 200); private int duration;
this.potionId = potionApplied.id; private boolean isMalicious;
this.duration = 20 * effectDuration;
this.isMalicious = false;
}
public AlleleEffectPotion setMalicious() { public AlleleEffectPotion(String name, Potion potionApplied, int effectDuration, boolean isDominant) {
this.isMalicious = true; super(name, isDominant, 200);
this.potionId = potionApplied.id;
this.duration = 20 * effectDuration;
this.isMalicious = false;
}
return this; public AlleleEffectPotion setMalicious() {
} this.isMalicious = true;
@Override return this;
public IEffectData validateStorage(IEffectData storedData) { }
if (storedData == null) {
storedData = new EffectData(1, 0, 0);
}
return storedData;
}
@Override @Override
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { public IEffectData validateStorage(IEffectData storedData) {
List<EntityLivingBase> entityList = this.getEntitiesWithinRange(genome, housing, EntityLivingBase.class); if (storedData == null) {
storedData = new EffectData(1, 0, 0);
}
return storedData;
}
for (EntityLivingBase e : entityList) { @Override
if (this.isMalicious) { public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
int armorPieces = BeeManager.armorApiaristHelper.wearsItems(e, getUID(), true); List<EntityLivingBase> entityList = this.getEntitiesWithinRange(genome, housing, EntityLivingBase.class);
int finalDuration = this.duration / 4 * (4 - armorPieces);
if (finalDuration > 0) {
e.addPotionEffect(new PotionEffect(this.potionId, finalDuration, 0));
}
} else {
if (e instanceof EntityPlayer) {
e.addPotionEffect(new PotionEffect(this.potionId, this.duration, 0));
}
}
}
storedData.setInteger(0, 0);
return storedData; for (EntityLivingBase e : entityList) {
} if (this.isMalicious) {
int armorPieces = BeeManager.armorApiaristHelper.wearsItems(e, getUID(), true);
int finalDuration = this.duration / 4 * (4 - armorPieces);
if (finalDuration > 0) {
e.addPotionEffect(new PotionEffect(this.potionId, finalDuration, 0));
}
} else {
if (e instanceof EntityPlayer) {
e.addPotionEffect(new PotionEffect(this.potionId, this.duration, 0));
}
}
}
storedData.setInteger(0, 0);
return storedData;
}
} }
@@ -1,47 +1,118 @@
package magicbees.bees.allele.effect; package magicbees.bees.allele.effect;
import java.util.List; import static magicbees.main.utils.compat.thaumcraft.NodeHelper.updateNode;
import magicbees.bees.AlleleEffect; import java.util.ArrayList;
import magicbees.bees.BeeManager; import java.util.Collections;
import magicbees.main.utils.BlockUtil; import java.util.HashMap;
import magicbees.main.utils.compat.thaumcraft.NodeHelper; import java.util.List;
import java.util.Map;
import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.Chunk;
import forestry.api.apiculture.IAlleleBeeAcceleratableEffect;
import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IBeeModifier; import forestry.api.apiculture.IBeeModifier;
import forestry.api.genetics.IEffectData; import forestry.api.genetics.IEffectData;
import magicbees.bees.AlleleEffect;
import magicbees.bees.BeeManager;
import magicbees.main.utils.BlockUtil;
import magicbees.main.utils.compat.thaumcraft.NodeHelper;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.nodes.INode;
public class AlleleEffectRecharge extends AlleleEffect { public class AlleleEffectRecharge extends AlleleEffect implements IAlleleBeeAcceleratableEffect {
public AlleleEffectRecharge(String id, boolean isDominant) { public AlleleEffectRecharge(String id, boolean isDominant) {
super(id, isDominant, 20); super(id, isDominant, 20);
combinable = true; combinable = true;
} }
@Override @Override
public IEffectData validateStorage(IEffectData storedData) { public IEffectData validateStorage(IEffectData storedData) {
if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { if (!(storedData instanceof EffectData)) {
storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0); storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0);
} }
return storedData; return storedData;
} }
@Override @Override
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
World world = housing.getWorld(); World world = housing.getWorld();
ChunkCoordinates coords = housing.getCoordinates(); ChunkCoordinates coords = housing.getCoordinates();
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
int range = (int)Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f)); int range = (int) Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f));
List<Chunk> chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range); List<Chunk> chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range);
if (NodeHelper.rechargeNodeInRange(chunks, world, coords.posX, coords.posY, coords.posZ, range)) { if (NodeHelper.rechargeNodeInRange(chunks, world, coords.posX, coords.posY, coords.posZ, range)) {
storedData.setInteger(0, storedData.getInteger(0) - throttle); storedData.setInteger(0, storedData.getInteger(0) - throttle);
} }
return storedData; return storedData;
} }
@Override
public IEffectData doEffectAccelerated(IBeeGenome genome, IEffectData storedData, IBeeHousing housing, float did) {
storedData.setInteger(0, 0);
World world = housing.getWorld();
ChunkCoordinates coords = housing.getCoordinates();
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
int range = Math
.max((int) Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f)), 1);
List<Chunk> chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range);
int idid = (int) did;
List<INode> nodes = new ArrayList<>(idid);
Collections.shuffle(chunks);
for (Chunk chunk : chunks) {
List<INode> l = NodeHelper.findNodesInChunkWithinRange(chunk, coords.posX, coords.posY, coords.posZ, range);
nodes.addAll(l);
idid -= l.size();
if (idid <= 0) {
while (idid < 0) {
nodes.remove(0);
idid++;
}
break;
}
}
if (nodes.isEmpty()) return storedData;
did /= (float) nodes.size();
if (did < 1f) did = 1f;
for (INode node : nodes) {
AspectList baseAspects = node.getAspectsBase();
AspectList currentAspects = node.getAspects();
HashMap<Aspect, Integer> toAdd = new HashMap<>();
int total = 0;
for (Map.Entry<Aspect, Integer> aspect : baseAspects.aspects.entrySet()) {
int diff = aspect.getValue() - currentAspects.getAmount(aspect.getKey());
if (diff <= 0) continue;
toAdd.put(aspect.getKey(), diff);
total += diff;
}
if (total == 0) continue;
int amount = Math.min(total + world.rand.nextInt(total), (int) did);
if (amount <= 0) amount = 1;
for (Map.Entry<Aspect, Integer> aspect : toAdd.entrySet()) {
currentAspects.add(aspect.getKey(), Math.min(aspect.getValue(), amount));
}
updateNode(node, world);
}
return storedData;
}
} }
@@ -2,9 +2,6 @@ package magicbees.bees.allele.effect;
import java.util.List; import java.util.List;
import magicbees.bees.AlleleEffect;
import magicbees.bees.BeeManager;
import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -12,175 +9,191 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World; import net.minecraft.world.World;
import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IBeeModifier; import forestry.api.apiculture.IBeeModifier;
import forestry.api.genetics.IEffectData; import forestry.api.genetics.IEffectData;
import magicbees.bees.AlleleEffect;
import magicbees.bees.BeeManager;
public class AlleleEffectSpawnMob extends AlleleEffect { 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) { protected boolean aggosOnPlayer;
this(id, isDominant, mobToSpawn, null); 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, String mobSoundFx) { public AlleleEffectSpawnMob(String id, boolean isDominant, String mobToSpawn) {
super(id, isDominant, 200); this(id, isDominant, mobToSpawn, null);
this.aggosOnPlayer = false; }
this.mobName = mobToSpawn;
this.chanceToSpawn = 100;
this.maxMobsInArea = 6;
this.mobSound = mobSoundFx;
}
@Override public AlleleEffectSpawnMob(String id, boolean isDominant, String mobToSpawn, String mobSoundFx) {
public IEffectData validateStorage(IEffectData storedData) { super(id, isDominant, 200);
if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { this.aggosOnPlayer = false;
// Throttle; Ready to spawn this.mobName = mobToSpawn;
storedData = new EffectData(1, 1, 0); this.chanceToSpawn = 100;
} this.maxMobsInArea = 6;
return storedData; this.mobSound = mobSoundFx;
} }
@Override @Override
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { public IEffectData validateStorage(IEffectData storedData) {
// Check if we're ready to spawn the mob. if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) {
boolean didSpawn = false; // Throttle; Ready to spawn
if (storedData.getBoolean(0)) { storedData = new EffectData(1, 1, 0);
World w = housing.getWorld(); }
return storedData;
}
int roll = w.rand.nextInt(100); @Override
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
// Check if we're ready to spawn the mob.
boolean didSpawn = false;
if (storedData.getBoolean(0)) {
World w = housing.getWorld();
if (roll <= chanceToSpawn) { int roll = w.rand.nextInt(100);
if (spawnsWhilePlayerNear) {
EntityPlayer target = findPlayerTarget(genome, housing);
// Let's spawn a mob. =D if (roll <= chanceToSpawn) {
if (target != null) { if (spawnsWhilePlayerNear) {
didSpawn = spawnMob(genome, target, w, housing, false); EntityPlayer target = findPlayerTarget(genome, housing);
} else if (alternateMob != null) {
didSpawn = spawnMob(genome, null, w, housing, true);
}
} else {
storedData.setBoolean(0, !this.spawnMob(genome, null, w, housing, true));
}
} else {
playMobLiveSound(genome, housing, w);
didSpawn = true;
}
if (didSpawn) { // Let's spawn a mob. =D
storedData.setBoolean(0, !didSpawn); if (target != null) {
storedData.setInteger(0, storedData.getInteger(0) - throttle); didSpawn = spawnMob(genome, target, w, housing, false);
} } else if (alternateMob != null) {
} didSpawn = spawnMob(genome, null, w, housing, true);
else { }
storedData.setBoolean(0, true); } else {
} storedData.setBoolean(0, !this.spawnMob(genome, null, w, housing, true));
}
} else {
playMobLiveSound(genome, housing, w);
didSpawn = true;
}
return storedData; if (didSpawn) {
} storedData.setBoolean(0, !didSpawn);
storedData.setInteger(0, storedData.getInteger(0) - throttle);
}
} else {
storedData.setBoolean(0, true);
}
private void playMobLiveSound(IBeeGenome genome, IBeeHousing housing, World w) { return storedData;
if (mobSound != null && w.rand.nextInt(100) < 35) { }
ChunkCoordinates coords = housing.getCoordinates();
int range = genome.getTerritory()[0]; private void playMobLiveSound(IBeeGenome genome, IBeeHousing housing, World w) {
double x = coords.posX + w.rand.nextDouble() * (range * 2) - range; if (mobSound != null && w.rand.nextInt(100) < 35) {
range = genome.getTerritory()[1]; ChunkCoordinates coords = housing.getCoordinates();
double y = coords.posY + w.rand.nextDouble() * (range * 2) - range;
range = genome.getTerritory()[2];
double z = coords.posZ + 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);
}
}
private EntityPlayer findPlayerTarget(IBeeGenome genome, IBeeHousing housing) { int range = genome.getTerritory()[0];
List<EntityPlayer> entities = getEntitiesWithinRange(genome, housing, EntityPlayer.class); double x = coords.posX + w.rand.nextDouble() * (range * 2) - range;
for (EntityPlayer e : entities) { range = genome.getTerritory()[1];
// Check for wearing armor & cancel double y = coords.posY + w.rand.nextDouble() * (range * 2) - range;
// Full armor suit is treated as "invisible." range = genome.getTerritory()[2];
if (forestry.api.apiculture.BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) e, getUID(), true) < 4) { double z = coords.posZ + w.rand.nextDouble() * (range * 2) - range;
return e; w.playSoundEffect(x, y, z, this.mobSound, 0.5f, (w.rand.nextFloat() - w.rand.nextFloat()) * 0.2f + 1.0f);
} }
} }
return null;
}
protected boolean spawnMob(IBeeGenome bee, EntityPlayer player, World world, IBeeHousing housing, boolean spawnAlternate) { private EntityPlayer findPlayerTarget(IBeeGenome genome, IBeeHousing housing) {
boolean spawnedFlag = false; List<EntityPlayer> entities = getEntitiesWithinRange(genome, housing, EntityPlayer.class);
for (EntityPlayer e : entities) {
// Check for wearing armor & cancel
// Full armor suit is treated as "invisible."
if (forestry.api.apiculture.BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) e, getUID(), true)
< 4) {
return e;
}
}
return null;
}
EntityLiving mob; protected boolean spawnMob(IBeeGenome bee, EntityPlayer player, World world, IBeeHousing housing,
if (spawnAlternate && alternateMob != null) { boolean spawnAlternate) {
mob = (EntityLiving) EntityList.createEntityByName(alternateMob, world); boolean spawnedFlag = false;
} else {
mob = (EntityLiving) EntityList.createEntityByName(mobName, world);
}
if (mob != null) { EntityLiving mob;
double pos[] = this.randomMobSpawnCoords(world, bee, housing); if (spawnAlternate && alternateMob != null) {
mob = (EntityLiving) EntityList.createEntityByName(alternateMob, world);
} else {
mob = (EntityLiving) EntityList.createEntityByName(mobName, world);
}
int entitiesCount = world.getEntitiesWithinAABB(mob.getClass(), if (mob != null) {
AxisAlignedBB.getBoundingBox((int) pos[0], (int) pos[1], (int) pos[2], double pos[] = this.randomMobSpawnCoords(world, bee, housing);
(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); 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();
if (entitiesCount < maxMobsInArea && mob.getCanSpawnHere()) { mob.setPositionAndRotation(pos[0], pos[1], pos[2], world.rand.nextFloat() * 360f, 0f);
spawnedFlag = world.spawnEntityInWorld(mob);
if (aggosOnPlayer && player != null) {
if (forestry.api.apiculture.BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) player, getUID(), true) < 4) {
// Protect fully suited player from initial murder intent.
mob.setAttackTarget(player);
}
}
}
}
return spawnedFlag; if (entitiesCount < maxMobsInArea && mob.getCanSpawnHere()) {
} spawnedFlag = world.spawnEntityInWorld(mob);
if (aggosOnPlayer && player != null) {
if (forestry.api.apiculture.BeeManager.armorApiaristHelper
.wearsItems((EntityLivingBase) player, getUID(), true) < 4) {
// Protect fully suited player from initial murder intent.
mob.setAttackTarget(player);
}
}
}
}
public AlleleEffectSpawnMob setSpawnsOnPlayerNear(String alternateMobToSpawn) { return spawnedFlag;
spawnsWhilePlayerNear = true; }
alternateMob = alternateMobToSpawn;
return this;
}
public AlleleEffectSpawnMob setAggrosPlayerOnSpawn() { public AlleleEffectSpawnMob setSpawnsOnPlayerNear(String alternateMobToSpawn) {
aggosOnPlayer = true; spawnsWhilePlayerNear = true;
return this; alternateMob = alternateMobToSpawn;
} return this;
}
public AlleleEffectSpawnMob setThrottle(int val) { public AlleleEffectSpawnMob setAggrosPlayerOnSpawn() {
throttle = val; aggosOnPlayer = true;
return this; return this;
} }
public AlleleEffectSpawnMob setChanceToSpawn(int value) { public AlleleEffectSpawnMob setThrottle(int val) {
chanceToSpawn = value; throttle = val;
return this; return this;
} }
public AlleleEffectSpawnMob setMaxMobsInSpawnZone(int value) { public AlleleEffectSpawnMob setChanceToSpawn(int value) {
maxMobsInArea = value; chanceToSpawn = value;
return this; return this;
} }
protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing) { public AlleleEffectSpawnMob setMaxMobsInSpawnZone(int value) {
ChunkCoordinates coords = housing.getCoordinates(); maxMobsInArea = value;
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); return this;
}
double pos[] = new double[3]; protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing) {
pos[0] = coords.posX + (world.rand.nextDouble() * (bee.getTerritory()[0] * beeModifier.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[0] / 2); ChunkCoordinates coords = housing.getCoordinates();
pos[1] = coords.posY + world.rand.nextInt(3) - 1; IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
pos[2] = coords.posZ + (world.rand.nextDouble() * (bee.getTerritory()[2] * beeModifier.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[2] / 2);
return pos; double pos[] = new double[3];
} pos[0] = coords.posX
+ (world.rand.nextDouble() * (bee.getTerritory()[0] * beeModifier.getTerritoryModifier(bee, 1f))
- bee.getTerritory()[0] / 2);
pos[1] = coords.posY + world.rand.nextInt(3) - 1;
pos[2] = coords.posZ
+ (world.rand.nextDouble() * (bee.getTerritory()[2] * beeModifier.getTerritoryModifier(bee, 1f))
- bee.getTerritory()[2] / 2);
return pos;
}
} }
@@ -1,8 +1,5 @@
package magicbees.bees.allele.effect; package magicbees.bees.allele.effect;
import magicbees.bees.AlleleEffect;
import magicbees.bees.BeeManager;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
@@ -13,75 +10,83 @@ import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IBeeModifier; import forestry.api.apiculture.IBeeModifier;
import forestry.api.genetics.IEffectData; import forestry.api.genetics.IEffectData;
import magicbees.bees.AlleleEffect;
import magicbees.bees.BeeManager;
public class AlleleEffectSpawnMobWeighted extends AlleleEffect { public class AlleleEffectSpawnMobWeighted extends AlleleEffect {
private String[] entityNames;
private int[] spawnChance;
public AlleleEffectSpawnMobWeighted(String id, boolean isDominant, int throttle, String[] mobs, int[] chance) { private String[] entityNames;
super(id, isDominant, throttle); private int[] spawnChance;
if (mobs.length != chance.length) {
throw new IllegalArgumentException("Array lengths must be equal!");
}
this.entityNames = mobs;
this.spawnChance = chance;
}
@Override public AlleleEffectSpawnMobWeighted(String id, boolean isDominant, int throttle, String[] mobs, int[] chance) {
public IEffectData validateStorage(IEffectData storedData) { super(id, isDominant, throttle);
if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { if (mobs.length != chance.length) {
storedData = new EffectData(1, 0, 0); throw new IllegalArgumentException("Array lengths must be equal!");
} }
return storedData; this.entityNames = mobs;
} this.spawnChance = chance;
}
@Override @Override
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { public IEffectData validateStorage(IEffectData storedData) {
if (this.spawnMob(genome, housing)) { if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) {
storedData.setInteger(0, 0); storedData = new EffectData(1, 0, 0);
} }
return storedData;
}
return storedData; @Override
} public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
if (this.spawnMob(genome, housing)) {
storedData.setInteger(0, 0);
}
protected boolean spawnMob(IBeeGenome genome, IBeeHousing housing) { return storedData;
boolean flag = false; }
World w = housing.getWorld(); protected boolean spawnMob(IBeeGenome genome, IBeeHousing housing) {
int roll = 0; boolean flag = false;
for (int i = 0; i < this.spawnChance.length && !flag; ++i) { World w = housing.getWorld();
roll = 100 - w.rand.nextInt(100) + 1; int roll = 0;
if (roll < this.spawnChance[i]) {
Entity mob = EntityList.createEntityByName(this.entityNames[i], w);
if (mob != null) {
flag = true;
double[] coords = this.randomMobSpawnCoords(w, genome, housing);
mob.setPositionAndRotation(coords[0], coords[1], coords[2], w.rand.nextFloat() * 360f, 0f); for (int i = 0; i < this.spawnChance.length && !flag; ++i) {
if (mob instanceof EntityLiving) { roll = 100 - w.rand.nextInt(100) + 1;
if (((EntityLiving) mob).getCanSpawnHere()) { if (roll < this.spawnChance[i]) {
w.spawnEntityInWorld(mob); Entity mob = EntityList.createEntityByName(this.entityNames[i], w);
} if (mob != null) {
} else { flag = true;
w.spawnEntityInWorld(mob); double[] coords = this.randomMobSpawnCoords(w, genome, housing);
}
}
}
}
return flag; 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);
}
}
}
}
protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing) { return flag;
ChunkCoordinates coords = housing.getCoordinates(); }
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
double pos[] = new double[3]; protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing) {
pos[0] = coords.posX + world.rand.nextDouble() * (bee.getTerritory()[0] * beeModifier.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[0] / 2; ChunkCoordinates coords = housing.getCoordinates();
pos[1] = coords.posY + world.rand.nextDouble() * (bee.getTerritory()[1] * beeModifier.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[1] / 2; IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
pos[2] = coords.posZ + world.rand.nextDouble() * (bee.getTerritory()[2] * beeModifier.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[2] / 2;
return pos;
}
double pos[] = new double[3];
pos[0] = coords.posX
+ world.rand.nextDouble() * (bee.getTerritory()[0] * beeModifier.getTerritoryModifier(bee, 1f))
- bee.getTerritory()[0] / 2;
pos[1] = coords.posY
+ world.rand.nextDouble() * (bee.getTerritory()[1] * beeModifier.getTerritoryModifier(bee, 1f))
- bee.getTerritory()[1] / 2;
pos[2] = coords.posZ
+ world.rand.nextDouble() * (bee.getTerritory()[2] * beeModifier.getTerritoryModifier(bee, 1f))
- bee.getTerritory()[2] / 2;
return pos;
}
} }
@@ -2,7 +2,6 @@ package magicbees.bees.allele.effect;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import magicbees.main.utils.compat.ThaumcraftHelper;
import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -13,65 +12,68 @@ import net.minecraft.world.World;
import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeHousing;
import magicbees.main.utils.compat.ThaumcraftHelper;
public class AlleleEffectSpawnWisp extends AlleleEffectSpawnMob { public class AlleleEffectSpawnWisp extends AlleleEffectSpawnMob {
private byte[] wispTypes = { 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,
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47 };
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) { public AlleleEffectSpawnWisp(String id, boolean isDominant, String mobToSpawn, String soundToPlay) {
super(id, isDominant, mobToSpawn, soundToPlay); super(id, isDominant, mobToSpawn, soundToPlay);
} }
@Override @Override
protected boolean spawnMob(IBeeGenome bee, EntityPlayer player, World world, IBeeHousing housing, boolean spawnAlternate) { protected boolean spawnMob(IBeeGenome bee, EntityPlayer player, World world, IBeeHousing housing,
boolean spawnedFlag = false; boolean spawnAlternate) {
boolean spawnedFlag = false;
EntityLiving mob; EntityLiving mob;
if (spawnAlternate && this.alternateMob != null) { if (spawnAlternate && this.alternateMob != null) {
mob = (EntityLiving) EntityList.createEntityByName(this.alternateMob, world); mob = (EntityLiving) EntityList.createEntityByName(this.alternateMob, world);
} else { } else {
mob = (EntityLiving) EntityList.createEntityByName(this.mobName, world); mob = (EntityLiving) EntityList.createEntityByName(this.mobName, world);
} }
if (mob != null) { if (mob != null) {
double pos[] = this.randomMobSpawnCoords(world, bee, housing); double pos[] = this.randomMobSpawnCoords(world, bee, housing);
int entitiesCount = world.getEntitiesWithinAABB( int entitiesCount = world.getEntitiesWithinAABB(
mob.getClass(), 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, AxisAlignedBB.getBoundingBox(
4.0D, 8.0D)).size(); (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); mob.setPositionAndRotation(pos[0], pos[1], pos[2], world.rand.nextFloat() * 360f, 0f);
if (entitiesCount < this.maxMobsInArea && mob.getCanSpawnHere()) { if (entitiesCount < this.maxMobsInArea && mob.getCanSpawnHere()) {
// Try some Reflection on TC code. This could be dangerous. // Try some Reflection on TC code. This could be dangerous.
try { try {
Class<?> wispEntity = Class.forName(ThaumcraftHelper.Entity.WISP.getClassName()); Class<?> wispEntity = Class.forName(ThaumcraftHelper.Entity.WISP.getClassName());
Field type = wispEntity.getDeclaredField("type"); Field type = wispEntity.getDeclaredField("type");
type.setByte(mob, wispTypes[world.rand.nextInt(wispTypes.length)]); type.setByte(mob, wispTypes[world.rand.nextInt(wispTypes.length)]);
} catch (Exception e) { /* } catch (Exception e) {
* Last time I had a request to post /*
* error messages, I regretted it. * Last time I had a request to post error messages, I regretted it.
*/ */
} }
spawnedFlag = world.spawnEntityInWorld(mob); spawnedFlag = world.spawnEntityInWorld(mob);
if (this.aggosOnPlayer && player != null) { if (this.aggosOnPlayer && player != null) {
if (BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) player, getUID(), true) < 4) { if (BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) player, getUID(), true) < 4) {
// Protect fully suited player from initial murder // Protect fully suited player from initial murder
// intent. // intent.
mob.setAttackTarget(player); mob.setAttackTarget(player);
} }
} }
} }
} }
return spawnedFlag; return spawnedFlag;
} }
} }
@@ -1,55 +1,68 @@
package magicbees.bees.allele.effect; package magicbees.bees.allele.effect;
import magicbees.bees.AlleleEffect;
import magicbees.bees.BeeManager;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IBeeModifier; import forestry.api.apiculture.IBeeModifier;
import forestry.api.genetics.IEffectData; import forestry.api.genetics.IEffectData;
import magicbees.bees.AlleleEffect;
import magicbees.bees.BeeManager;
public class AlleleEffectTransmuting extends AlleleEffect { public class AlleleEffectTransmuting extends AlleleEffect {
private TransmutationEffectController transmutationController; private TransmutationEffectController transmutationController;
public AlleleEffectTransmuting(String id, boolean isDominant, TransmutationEffectController effectController, int timeoutBeeTicks) { public AlleleEffectTransmuting(String id, boolean isDominant, TransmutationEffectController effectController,
super(id, isDominant, timeoutBeeTicks); int timeoutBeeTicks) {
this.transmutationController = effectController; super(id, isDominant, timeoutBeeTicks);
} this.transmutationController = effectController;
}
@Override @Override
public IEffectData validateStorage(IEffectData storedData) { public IEffectData validateStorage(IEffectData storedData) {
if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) {
storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0); storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0);
} }
return storedData; return storedData;
} }
@Override @Override
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
World world = housing.getWorld(); World world = housing.getWorld();
ChunkCoordinates coords = housing.getCoordinates(); ChunkCoordinates coords = housing.getCoordinates();
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
// Get random coords within territory // Get random coords within territory
int xRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]); int[] randomCoords = new int[3];
int yRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]); for (int i = 0; i < 3; i++) {
int zRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]); int range = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[i]);
if (range > 0) {
randomCoords[i] = world.rand.nextInt(range) - range / 2;
}
}
int xCoord = coords.posX + world.rand.nextInt(xRange) - xRange / 2; int xCoord = coords.posX + randomCoords[0];
int yCoord = coords.posY + world.rand.nextInt(yRange) - yRange / 2; int yCoord = coords.posY + randomCoords[1];
int zCoord = coords.posZ + world.rand.nextInt(zRange) - zRange / 2; int zCoord = coords.posZ + randomCoords[2];
BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord); BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord);
transmutationController.attemptTransmutations(world, biome, transmutationController.attemptTransmutations(
new ItemStack(world.getBlock(xCoord, yCoord, zCoord), 1, world.getBlockMetadata(xCoord, yCoord, zCoord)), xCoord, yCoord, zCoord); world,
biome,
new ItemStack(
world.getBlock(xCoord, yCoord, zCoord),
1,
world.getBlockMetadata(xCoord, yCoord, zCoord)),
xCoord,
yCoord,
zCoord);
storedData.setInteger(0, 0); storedData.setInteger(0, 0);
return storedData; return storedData;
} }
} }
@@ -1,89 +1,72 @@
package magicbees.bees.allele.effect; package magicbees.bees.allele.effect;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import forestry.api.genetics.IEffectData; import forestry.api.genetics.IEffectData;
public class EffectData implements IEffectData public class EffectData implements IEffectData {
{
private int[] intData;
private boolean[] boolData;
private float[] floatData;
public EffectData(int intCount, int boolCount, int floatCount) private int[] intData;
{ private boolean[] boolData;
this.intData = new int[intCount]; private float[] floatData;
this.boolData = new boolean[boolCount];
this.floatData = new float[floatCount];
}
@Override public EffectData(int intCount, int boolCount, int floatCount) {
public void readFromNBT(NBTTagCompound nbttagcompound) this.intData = new int[intCount];
{ this.boolData = new boolean[boolCount];
} this.floatData = new float[floatCount];
}
@Override @Override
public void writeToNBT(NBTTagCompound nbttagcompound) public void readFromNBT(NBTTagCompound nbttagcompound) {}
{
}
@Override @Override
public void setInteger(int index, int val) public void writeToNBT(NBTTagCompound nbttagcompound) {}
{
if (index >= 0 && index < this.intData.length)
{
this.intData[index] = val;
}
}
@Override @Override
public void setFloat(int index, float val) public void setInteger(int index, int val) {
{ if (index >= 0 && index < this.intData.length) {
if (index >= 0 && index < this.floatData.length) this.intData[index] = val;
{ }
this.floatData[index] = val; }
}
}
@Override @Override
public void setBoolean(int index, boolean val) public void setFloat(int index, float val) {
{ if (index >= 0 && index < this.floatData.length) {
if (index >= 0 && index < this.boolData.length) this.floatData[index] = val;
{ }
this.boolData[index] = val; }
}
}
@Override @Override
public int getInteger(int index) public void setBoolean(int index, boolean val) {
{ if (index >= 0 && index < this.boolData.length) {
int val = 0; this.boolData[index] = val;
if (index >= 0 && index < this.intData.length) }
{ }
val = this.intData[index];
}
return val;
}
@Override @Override
public float getFloat(int index) public int getInteger(int index) {
{ int val = 0;
float val = 0f; if (index >= 0 && index < this.intData.length) {
if (index >= 0 && index < this.floatData.length) val = this.intData[index];
{ }
val = this.floatData[index]; return val;
} }
return val;
}
@Override @Override
public boolean getBoolean(int index) public float getFloat(int index) {
{ float val = 0f;
boolean val = false; if (index >= 0 && index < this.floatData.length) {
if (index >= 0 && index < this.boolData.length) val = this.floatData[index];
{ }
val = this.boolData[index]; return val;
} }
return val;
}
@Override
public boolean getBoolean(int index) {
boolean val = false;
if (index >= 0 && index < this.boolData.length) {
val = this.boolData[index];
}
return val;
}
} }
@@ -4,43 +4,46 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import magicbees.api.bees.ITransmutationEffectController;
import magicbees.api.bees.ITransmutationEffectLogic;
import magicbees.main.utils.LogHelper;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import magicbees.api.bees.ITransmutationEffectController;
import magicbees.api.bees.ITransmutationEffectLogic;
import magicbees.main.utils.LogHelper;
public class TransmutationEffectController implements ITransmutationEffectController { public class TransmutationEffectController implements ITransmutationEffectController {
private List<ITransmutationEffectLogic> logicObjects;
public TransmutationEffectController(ITransmutationEffectLogic... effectLogic) { private List<ITransmutationEffectLogic> logicObjects;
logicObjects = new ArrayList<ITransmutationEffectLogic>();
for (ITransmutationEffectLogic logic : effectLogic) {
logicObjects.add(logic);
}
}
public void attemptTransmutations(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) { public TransmutationEffectController(ITransmutationEffectLogic... effectLogic) {
Collections.shuffle(logicObjects); logicObjects = new ArrayList<ITransmutationEffectLogic>();
for (ITransmutationEffectLogic logic : logicObjects) { for (ITransmutationEffectLogic logic : effectLogic) {
try { logicObjects.add(logic);
if (logic.tryTransmutation(world, biome, sourceBlock, x, y, z)) { }
break; }
}
} catch (Exception e) {
LogHelper.warn(String.format("Magic Bees encountered an issue with an ITransmutationEffectLogic provider %s. Debug information follows.",
logic.getClass().getName()));
LogHelper.info(e.getMessage());
}
}
}
@Override public void attemptTransmutations(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
public void addEffectLogic(ITransmutationEffectLogic logic) { Collections.shuffle(logicObjects);
if (logic != null && !logicObjects.contains(logic)) { for (ITransmutationEffectLogic logic : logicObjects) {
logicObjects.add(logic); try {
} if (logic.tryTransmutation(world, biome, sourceBlock, x, y, z)) {
} break;
}
} catch (Exception e) {
LogHelper.warn(
String.format(
"Magic Bees encountered an issue with an ITransmutationEffectLogic provider %s. Debug information follows.",
logic.getClass().getName()));
LogHelper.info(e.getMessage());
}
}
}
@Override
public void addEffectLogic(ITransmutationEffectLogic logic) {
if (logic != null && !logicObjects.contains(logic)) {
logicObjects.add(logic);
}
}
} }
@@ -1,31 +1,30 @@
package magicbees.bees.allele.effect; package magicbees.bees.allele.effect;
import magicbees.api.bees.ITransmutationEffectLogic;
import magicbees.main.utils.compat.BotaniaHelper;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import magicbees.api.bees.ITransmutationEffectLogic;
import magicbees.main.utils.compat.BotaniaHelper;
public class TransmutationEffectLBotaniaLiving implements ITransmutationEffectLogic { public class TransmutationEffectLBotaniaLiving implements ITransmutationEffectLogic {
@Override @Override
public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) { public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
int[] oreIDs = OreDictionary.getOreIDs(sourceBlock); int[] oreIDs = OreDictionary.getOreIDs(sourceBlock);
for (int oreId : oreIDs) { for (int oreId : oreIDs) {
if (oreId == OreDictionary.getOreID("logWood")) { if (oreId == OreDictionary.getOreID("logWood")) {
world.setBlock(x, y, z, BotaniaHelper.blockLivingWood); world.setBlock(x, y, z, BotaniaHelper.blockLivingWood);
return true; return true;
} } else if (oreId == OreDictionary.getOreID("stone")) {
else if (oreId == OreDictionary.getOreID("stone")) { world.setBlock(x, y, z, BotaniaHelper.blockLivingRock);
world.setBlock(x, y, z, BotaniaHelper.blockLivingRock); return true;
return true; } else if (oreId == OreDictionary.getOreID("livingwood")) {
} world.setBlock(x, y, z, BotaniaHelper.blockDreamWood);
else if (oreId == OreDictionary.getOreID("livingwood")) { return true;
world.setBlock(x, y, z, BotaniaHelper.blockDreamWood); }
return true; }
} return false;
} }
return false;
}
} }
@@ -2,8 +2,6 @@ package magicbees.bees.allele.effect;
import java.util.Locale; import java.util.Locale;
import cpw.mods.fml.common.registry.GameRegistry;
import magicbees.api.bees.ITransmutationEffectLogic;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@@ -12,38 +10,45 @@ import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import cpw.mods.fml.common.registry.GameRegistry;
import magicbees.api.bees.ITransmutationEffectLogic;
public class TransmutationEffectRailcraft implements ITransmutationEffectLogic { 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) { @Override
boolean flag = false; public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FOREST) && !BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SNOWY)) { boolean flag = false;
ItemStack item = GameRegistry.findItemStack("Railcraft", "cube.stone.quarried", 1); if (OreDictionary.itemMatches(new ItemStack(Blocks.stone), sourceBlock, false)
if (item != null) { || OreDictionary.itemMatches(new ItemStack(Blocks.cobblestone), sourceBlock, false)) {
world.setBlock(x, y, z, Block.getBlockFromItem(item.getItem()), item.getItemDamage(), 2); flag = trySpawnQuarriedStone(world, biome, sourceBlock, x, y, z)
flag = true; || trySpawnAbyssalStone(world, biome, sourceBlock, x, y, z);
} }
} return flag;
return flag; }
}
private boolean trySpawnAbyssalStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) { private boolean trySpawnQuarriedStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
boolean flag = false; boolean flag = false;
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.WATER) && !biome.biomeName.toLowerCase(Locale.ENGLISH).contains("river")) { if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FOREST)
ItemStack item = GameRegistry.findItemStack("Railcraft", "cube.stone.abyssal", 1); && !BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SNOWY)) {
if (item != null) { ItemStack item = GameRegistry.findItemStack("Railcraft", "cube.stone.quarried", 1);
world.setBlock(x, y, z, Block.getBlockFromItem(item.getItem()), item.getItemDamage(), 2); if (item != null) {
flag = true; world.setBlock(x, y, z, Block.getBlockFromItem(item.getItem()), item.getItemDamage(), 2);
} flag = true;
} }
return flag; }
} 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;
}
} }
@@ -1,6 +1,5 @@
package magicbees.bees.allele.effect; package magicbees.bees.allele.effect;
import magicbees.api.bees.ITransmutationEffectLogic;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -8,18 +7,22 @@ import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
public class TransmutationEffectVanilla implements ITransmutationEffectLogic { import magicbees.api.bees.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) { public class TransmutationEffectVanilla implements ITransmutationEffectLogic {
boolean flag = false;
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SANDY) && OreDictionary.itemMatches(new ItemStack(Blocks.sand), sourceBlock, false)) { @Override
world.setBlock(x, y, z, Blocks.sandstone); public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
flag = true; return trySpawnSandstone(world, biome, sourceBlock, x, y, z);
} }
return flag;
} 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;
}
} }
@@ -11,21 +11,21 @@ import forestry.api.genetics.IFlowerProvider;
public abstract class FlowerProvider implements IFlowerProvider { public abstract class FlowerProvider implements IFlowerProvider {
@Override @Override
@Deprecated @Deprecated
public Set<IFlower> getFlowers() { public Set<IFlower> getFlowers() {
return FlowerManager.flowerRegistry.getAcceptableFlowers(getFlowerType()); return FlowerManager.flowerRegistry.getAcceptableFlowers(getFlowerType());
} }
protected void registerPlantableFlower(Block block, int meta, int weight) { protected void registerPlantableFlower(Block block, int meta, int weight) {
FlowerManager.flowerRegistry.registerPlantableFlower(block, meta, weight, getFlowerType()); FlowerManager.flowerRegistry.registerPlantableFlower(block, meta, weight, getFlowerType());
} }
protected void registerAcceptableFlower(Block block, int meta) { protected void registerAcceptableFlower(Block block, int meta) {
FlowerManager.flowerRegistry.registerAcceptableFlower(block, meta, getFlowerType()); FlowerManager.flowerRegistry.registerAcceptableFlower(block, meta, getFlowerType());
} }
protected void registerGrowthRule(IFlowerGrowthRule growthRule) { protected void registerGrowthRule(IFlowerGrowthRule growthRule) {
FlowerManager.flowerRegistry.registerGrowthRule(growthRule, getFlowerType()); FlowerManager.flowerRegistry.registerGrowthRule(growthRule, getFlowerType());
} }
} }
@@ -1,7 +1,5 @@
package magicbees.bees.allele.flowerProvider; package magicbees.bees.allele.flowerProvider;
import magicbees.main.utils.LocalizationManager;
import magicbees.main.utils.compat.ArsMagicaHelper;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@@ -12,82 +10,85 @@ import forestry.api.genetics.IFlowerGrowthRule;
import forestry.api.genetics.IFlowerRegistry; import forestry.api.genetics.IFlowerRegistry;
import forestry.api.genetics.IIndividual; import forestry.api.genetics.IIndividual;
import forestry.api.genetics.IPollinatable; import forestry.api.genetics.IPollinatable;
import magicbees.main.utils.LocalizationManager;
import magicbees.main.utils.compat.ArsMagicaHelper;
public class FlowerProviderArsMagicaFlower extends FlowerProvider implements IFlowerGrowthRule { public class FlowerProviderArsMagicaFlower extends FlowerProvider implements IFlowerGrowthRule {
public FlowerProviderArsMagicaFlower() { public FlowerProviderArsMagicaFlower() {
registerPlantableFlower(ArsMagicaHelper.blackOrchid, 0, 1); registerPlantableFlower(ArsMagicaHelper.blackOrchid, 0, 1);
registerPlantableFlower(ArsMagicaHelper.desertNova, 0, 1); registerPlantableFlower(ArsMagicaHelper.desertNova, 0, 1);
registerPlantableFlower(ArsMagicaHelper.aum, 0, 1); registerPlantableFlower(ArsMagicaHelper.aum, 0, 1);
registerPlantableFlower(ArsMagicaHelper.wakebloom, 0, 1); registerPlantableFlower(ArsMagicaHelper.wakebloom, 0, 1);
registerPlantableFlower(ArsMagicaHelper.tarmaRoot, 0, 1); registerPlantableFlower(ArsMagicaHelper.tarmaRoot, 0, 1);
registerGrowthRule(this); registerGrowthRule(this);
} }
@Override @Override
public String getFlowerType() { public String getFlowerType() {
return "flowersArsMagica"; return "flowersArsMagica";
} }
@Override @Override
public String getDescription() { public String getDescription() {
return LocalizationManager.getLocalizedString("flowerProvider.arsmagica"); return LocalizationManager.getLocalizedString("flowerProvider.arsmagica");
} }
@Override @Override
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) { public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) {
return products; return products;
} }
@Override @Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) { public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
return pollinatable.getPlantType().size() > 1; return pollinatable.getPlantType().size() > 1;
} }
@Override @Override
@Deprecated @Deprecated
public boolean growFlower(World world, IIndividual genome, int x, int y, int z) { public boolean growFlower(World world, IIndividual genome, int x, int y, int z) {
return growFlower(world, x, y, z); return growFlower(world, x, y, z);
} }
@Override @Override
public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z) { public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z) {
return growFlower(world, x, y, z); return growFlower(world, x, y, z);
} }
@Override @Override
@Deprecated @Deprecated
public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) { public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y,
return growFlower(world, x, y, z); int z) {
} return growFlower(world, x, y, z);
}
private boolean growFlower(World world, int x, int y, int z) { private boolean growFlower(World world, int x, int y, int z) {
boolean flag = false; boolean flag = false;
Block blockDown = world.getBlock(x, y - 1, z); Block blockDown = world.getBlock(x, y - 1, z);
if (world.getBlock(x, y, z).isAir(world, x, y, z)) { if (world.getBlock(x, y, z).isAir(world, x, y, z)) {
if (blockDown == Blocks.dirt || blockDown == Blocks.grass) { if (blockDown == Blocks.dirt || blockDown == Blocks.grass) {
int dart = world.rand.nextInt(100); int dart = world.rand.nextInt(100);
Block block; Block block;
if (dart > 60) { if (dart > 60) {
block = ArsMagicaHelper.blackOrchid; block = ArsMagicaHelper.blackOrchid;
} else if (dart > 30) { } else if (dart > 30) {
block = ArsMagicaHelper.aum; block = ArsMagicaHelper.aum;
} else { } else {
block = ArsMagicaHelper.tarmaRoot; block = ArsMagicaHelper.tarmaRoot;
} }
world.setBlock(x, y, z, block); world.setBlock(x, y, z, block);
flag = true; flag = true;
} else if (blockDown == Blocks.sand) { } else if (blockDown == Blocks.sand) {
world.setBlock(x, y, z, ArsMagicaHelper.desertNova); world.setBlock(x, y, z, ArsMagicaHelper.desertNova);
flag = true; flag = true;
} else if (blockDown == Blocks.stone) { } else if (blockDown == Blocks.stone) {
world.setBlock(x, y, z, ArsMagicaHelper.tarmaRoot); world.setBlock(x, y, z, ArsMagicaHelper.tarmaRoot);
flag = true; flag = true;
} else if (blockDown == Blocks.water || blockDown == Blocks.water) { } else if (blockDown == Blocks.water || blockDown == Blocks.water) {
world.setBlock(x, y, z, ArsMagicaHelper.wakebloom); world.setBlock(x, y, z, ArsMagicaHelper.wakebloom);
flag = true; flag = true;
} }
} }
return flag; return flag;
} }
} }
@@ -1,66 +1,65 @@
package magicbees.bees.allele.flowerProvider; package magicbees.bees.allele.flowerProvider;
import magicbees.main.utils.LocalizationManager;
import magicbees.main.utils.compat.ThaumcraftHelper;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import forestry.api.genetics.IIndividual; import forestry.api.genetics.IIndividual;
import forestry.api.genetics.IPollinatable; import forestry.api.genetics.IPollinatable;
import magicbees.main.utils.LocalizationManager;
import magicbees.main.utils.compat.ThaumcraftHelper;
public class FlowerProviderAuraNode extends FlowerProvider { public class FlowerProviderAuraNode extends FlowerProvider {
public FlowerProviderAuraNode() { public FlowerProviderAuraNode() {
registerAcceptableFlower(ThaumcraftHelper.airy, ThaumcraftHelper.AiryBlockType.NODE.ordinal()); registerAcceptableFlower(ThaumcraftHelper.airy, ThaumcraftHelper.AiryBlockType.NODE.ordinal());
registerAcceptableFlower(ThaumcraftHelper.airy, ThaumcraftHelper.AiryBlockType.ENERGIZED_NODE.ordinal()); registerAcceptableFlower(ThaumcraftHelper.airy, ThaumcraftHelper.AiryBlockType.ENERGIZED_NODE.ordinal());
} }
@Override @Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) { public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
return pollinatable.getPlantType().size() > 0; return pollinatable.getPlantType().size() > 0;
} }
@Override @Override
@Deprecated @Deprecated
public boolean growFlower(World world, IIndividual genome, int x, int y, int z) { public boolean growFlower(World world, IIndividual genome, int x, int y, int z) {
return true; return true;
} }
@Override @Override
public String getFlowerType() { public String getFlowerType() {
return "flowersThaumcraftAuraNode"; return "flowersThaumcraftAuraNode";
} }
@Override @Override
public String getDescription() { public String getDescription() {
return LocalizationManager.getLocalizedString("flowerProvider.node"); return LocalizationManager.getLocalizedString("flowerProvider.node");
} }
@Override @Override
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) { public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) {
return products; return products;
} }
protected ItemStack[] addItemToProducts(ItemStack[] products, ItemStack itemStack) { protected ItemStack[] addItemToProducts(ItemStack[] products, ItemStack itemStack) {
for (ItemStack stack : products) { for (ItemStack stack : products) {
if (stack.getItem() == itemStack.getItem() && stack.getItemDamage() == itemStack.getItemDamage()) { if (stack.getItem() == itemStack.getItem() && stack.getItemDamage() == itemStack.getItemDamage()) {
if (stack.stackSize < stack.getItem().getItemStackLimit(stack)) { if (stack.stackSize < stack.getItem().getItemStackLimit(stack)) {
stack.stackSize += itemStack.stackSize; stack.stackSize += itemStack.stackSize;
itemStack.stackSize = Math.max(stack.stackSize - stack.getItem().getItemStackLimit(stack), 0); itemStack.stackSize = Math.max(stack.stackSize - stack.getItem().getItemStackLimit(stack), 0);
} }
} }
} }
if (itemStack.stackSize > 0) { if (itemStack.stackSize > 0) {
ItemStack[] newProducts = new ItemStack[products.length + 1]; ItemStack[] newProducts = new ItemStack[products.length + 1];
for (int i = 0; i < products.length; ++i) { for (int i = 0; i < products.length; ++i) {
newProducts[i] = products[i]; newProducts[i] = products[i];
} }
newProducts[products.length] = itemStack; newProducts[products.length] = itemStack;
products = newProducts; products = newProducts;
} }
return products;
}
return products;
}
} }
@@ -2,45 +2,46 @@ package magicbees.bees.allele.flowerProvider;
import java.util.EnumSet; import java.util.EnumSet;
import magicbees.main.utils.LocalizationManager;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.EnumPlantType; import net.minecraftforge.common.EnumPlantType;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import forestry.api.genetics.IIndividual; import forestry.api.genetics.IIndividual;
import forestry.api.genetics.IPollinatable; import forestry.api.genetics.IPollinatable;
import magicbees.main.utils.LocalizationManager;
public class FlowerProviderBookshelf extends FlowerProvider { public class FlowerProviderBookshelf extends FlowerProvider {
public FlowerProviderBookshelf() { public FlowerProviderBookshelf() {
registerAcceptableFlower(Blocks.bookshelf, OreDictionary.WILDCARD_VALUE); registerAcceptableFlower(Blocks.bookshelf, OreDictionary.WILDCARD_VALUE);
} }
@Override @Override
@Deprecated @Deprecated
public boolean growFlower(World world, IIndividual genome, int x, int i, int j) { public boolean growFlower(World world, IIndividual genome, int x, int i, int j) {
return true; return true;
} }
@Override @Override
public String getFlowerType() { public String getFlowerType() {
return "flowersBookshelf"; return "flowersBookshelf";
} }
@Override @Override
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int i, int j, ItemStack products[]) { public ItemStack[] affectProducts(World world, IIndividual genome, int x, int i, int j, ItemStack products[]) {
return products; return products;
} }
@Override @Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) { public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
EnumSet<EnumPlantType> types = pollinatable.getPlantType(); EnumSet<EnumPlantType> types = pollinatable.getPlantType();
return types.size() > 0 && !types.contains(EnumPlantType.Nether) && !types.contains(EnumPlantType.Water); return types.size() > 0 && !types.contains(EnumPlantType.Nether) && !types.contains(EnumPlantType.Water);
} }
@Override @Override
public String getDescription() { public String getDescription() {
return LocalizationManager.getLocalizedString("flowerProvider.book"); return LocalizationManager.getLocalizedString("flowerProvider.book");
} }
} }
@@ -1,7 +1,5 @@
package magicbees.bees.allele.flowerProvider; package magicbees.bees.allele.flowerProvider;
import magicbees.main.utils.LocalizationManager;
import magicbees.main.utils.compat.BotaniaHelper;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
@@ -11,56 +9,59 @@ import forestry.api.genetics.IFlowerGrowthRule;
import forestry.api.genetics.IFlowerRegistry; import forestry.api.genetics.IFlowerRegistry;
import forestry.api.genetics.IIndividual; import forestry.api.genetics.IIndividual;
import forestry.api.genetics.IPollinatable; import forestry.api.genetics.IPollinatable;
import magicbees.main.utils.LocalizationManager;
import magicbees.main.utils.compat.BotaniaHelper;
public class FlowerProviderBotania extends FlowerProvider implements IFlowerGrowthRule { public class FlowerProviderBotania extends FlowerProvider implements IFlowerGrowthRule {
public FlowerProviderBotania() { public FlowerProviderBotania() {
registerPlantableFlower(BotaniaHelper.blockMysticalFlower, OreDictionary.WILDCARD_VALUE, 1); registerPlantableFlower(BotaniaHelper.blockMysticalFlower, OreDictionary.WILDCARD_VALUE, 1);
registerGrowthRule(this); registerGrowthRule(this);
} }
@Override @Override
@Deprecated @Deprecated
public boolean growFlower(World world, IIndividual individual, int x, int y, int z) { public boolean growFlower(World world, IIndividual individual, int x, int y, int z) {
return growFlower(world, x, y, z); return growFlower(world, x, y, z);
} }
@Override @Override
public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z) { public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z) {
return growFlower(world, x, y, z); return growFlower(world, x, y, z);
} }
@Override @Override
@Deprecated @Deprecated
public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) { public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y,
return growFlower(world, x, y, z); int z) {
} return growFlower(world, x, y, z);
}
private boolean growFlower(World world, int x, int y, int z) { private boolean growFlower(World world, int x, int y, int z) {
if (world.isAirBlock(x, y, z) && BotaniaHelper.blockMysticalFlower.canPlaceBlockAt(world, x, y, z)) { if (world.isAirBlock(x, y, z) && BotaniaHelper.blockMysticalFlower.canPlaceBlockAt(world, x, y, z)) {
world.setBlock(x, y, z, BotaniaHelper.blockMysticalFlower); world.setBlock(x, y, z, BotaniaHelper.blockMysticalFlower);
world.setBlockMetadataWithNotify(x, y, z, world.rand.nextInt(16), 2); world.setBlockMetadataWithNotify(x, y, z, world.rand.nextInt(16), 2);
} }
return false; return false;
} }
@Override @Override
public ItemStack[] affectProducts(World world, IIndividual individual, int x, int y, int z, ItemStack[] products) { public ItemStack[] affectProducts(World world, IIndividual individual, int x, int y, int z, ItemStack[] products) {
return products; return products;
} }
@Override @Override
public String getDescription() { public String getDescription() {
return LocalizationManager.getLocalizedString("flowerProvider.botania"); return LocalizationManager.getLocalizedString("flowerProvider.botania");
} }
@Override @Override
public String getFlowerType() { public String getFlowerType() {
return "flowersBotania"; return "flowersBotania";
} }
@Override @Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) { public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
return pollinatable.getPlantType().size() > 0; return pollinatable.getPlantType().size() > 0;
} }
} }
@@ -1,7 +1,5 @@
package magicbees.bees.allele.flowerProvider; package magicbees.bees.allele.flowerProvider;
import magicbees.main.utils.LocalizationManager;
import magicbees.main.utils.compat.ThaumcraftHelper;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@@ -12,64 +10,67 @@ import forestry.api.genetics.IFlowerGrowthRule;
import forestry.api.genetics.IFlowerRegistry; import forestry.api.genetics.IFlowerRegistry;
import forestry.api.genetics.IIndividual; import forestry.api.genetics.IIndividual;
import forestry.api.genetics.IPollinatable; import forestry.api.genetics.IPollinatable;
import magicbees.main.utils.LocalizationManager;
import magicbees.main.utils.compat.ThaumcraftHelper;
public class FlowerProviderThaumcraftFlower extends FlowerProvider implements IFlowerGrowthRule { public class FlowerProviderThaumcraftFlower extends FlowerProvider implements IFlowerGrowthRule {
public FlowerProviderThaumcraftFlower() { public FlowerProviderThaumcraftFlower() {
registerPlantableFlower(ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.SHIMMERLEAF.ordinal(), 1); registerPlantableFlower(ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.SHIMMERLEAF.ordinal(), 1);
registerPlantableFlower(ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.CINDERPEARL.ordinal(), 1); registerPlantableFlower(ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.CINDERPEARL.ordinal(), 1);
registerGrowthRule(this); registerGrowthRule(this);
} }
@Override @Override
public String getFlowerType() { public String getFlowerType() {
return "flowersThaumcraft"; return "flowersThaumcraft";
} }
@Override @Override
public String getDescription() { public String getDescription() {
return LocalizationManager.getLocalizedString("flowerProvider.magic"); return LocalizationManager.getLocalizedString("flowerProvider.magic");
} }
@Override @Override
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) { public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) {
return products; return products;
} }
@Override @Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) { public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
return 0 < pollinatable.getPlantType().size(); return 0 < pollinatable.getPlantType().size();
} }
@Override @Override
@Deprecated @Deprecated
public boolean growFlower(World world, IIndividual genome, int x, int y, int z) { public boolean growFlower(World world, IIndividual genome, int x, int y, int z) {
return growFlower(world, x, y, z); return growFlower(world, x, y, z);
} }
@Override @Override
public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z) { public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z) {
return growFlower(world, x, y, z); return growFlower(world, x, y, z);
} }
@Override @Override
@Deprecated @Deprecated
public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) { public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y,
return growFlower(world, x, y, z); int z) {
} return growFlower(world, x, y, z);
}
private boolean growFlower(World world, int x, int y, int z) { private boolean growFlower(World world, int x, int y, int z) {
boolean flag = false; boolean flag = false;
Block blockDown = world.getBlock(x, y - 1, z); Block blockDown = world.getBlock(x, y - 1, z);
if (world.getBlock(x, y, z).isAir(world, x, y, z)) { if (world.getBlock(x, y, z).isAir(world, x, y, z)) {
if (blockDown == Blocks.dirt || blockDown == Blocks.grass) { if (blockDown == Blocks.dirt || blockDown == Blocks.grass) {
world.setBlock(x, y, z, ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.SHIMMERLEAF.ordinal(), 2); world.setBlock(x, y, z, ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.SHIMMERLEAF.ordinal(), 2);
flag = true; flag = true;
} else if (blockDown == Blocks.sand) { } else if (blockDown == Blocks.sand) {
world.setBlock(x, y, z, ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.CINDERPEARL.ordinal(), 2); world.setBlock(x, y, z, ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.CINDERPEARL.ordinal(), 2);
flag = true; flag = true;
} }
} }
return flag; return flag;
} }
} }
@@ -0,0 +1,93 @@
package magicbees.block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
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.tileentity.TileEntity;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.main.CommonProxy;
import magicbees.main.utils.TabMagicBees;
import magicbees.tileentity.TileEntityApimancersDrainerCommon;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.IEssentiaContainerItem;
public class BlockApimancersDrainer extends BlockContainer {
@SideOnly(Side.CLIENT)
private IIcon[] icons;
public static Class<? extends TileEntity> drainer = TileEntityApimancersDrainerCommon.class;
public BlockApimancersDrainer() {
super(Material.rock);
this.setCreativeTab(TabMagicBees.tabMagicBees);
this.setBlockName("apimancersDrainer");
this.setHardness(1f);
this.setResistance(1.5f);
this.setHarvestLevel("pickaxe", 0);
}
@Override
public TileEntity createNewTileEntity(World world, int metadata) {
try {
return drainer.newInstance();
} catch (Exception e) {
return null;
}
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float par7,
float par8, float par9) {
if (world.isRemote) {
return false;
} else {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TileEntityApimancersDrainerCommon && side != 1) {
ItemStack tItemStack = player.getHeldItem();
if (tItemStack != null) {
Item tItem = tItemStack.getItem();
if (tItem instanceof IEssentiaContainerItem
&& ((IEssentiaContainerItem) tItem).getAspects(player.getHeldItem()) != null
&& ((IEssentiaContainerItem) tItem).getAspects(player.getHeldItem()).size() > 0) {
Aspect tLocked = ((IEssentiaContainerItem) tItem).getAspects(player.getHeldItem())
.getAspects()[0];
((TileEntityApimancersDrainerCommon) tile).setAspect(tLocked);
player.addChatMessage(
new ChatComponentTranslation("Producing " + tLocked.getLocalizedDescription()));
}
} else {
((TileEntityApimancersDrainerCommon) tile).setAspect(null);
player.addChatMessage(new ChatComponentTranslation("Cleared production specifier"));
}
world.markBlockForUpdate(x, y, z);
return true;
}
return false;
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return icons[side <= 1 ? side : 2];
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister register) {
icons = new IIcon[4];
for (int i = 0; i < icons.length; i++) {
icons[i] = register.registerIcon(CommonProxy.DOMAIN + ":apimancersdrainer." + i);
}
}
}
@@ -1,12 +1,5 @@
package magicbees.block; 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.Block;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
@@ -18,96 +11,95 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
public class BlockEffectJar extends BlockContainer import cpw.mods.fml.relauncher.Side;
{ import cpw.mods.fml.relauncher.SideOnly;
public BlockEffectJar() import magicbees.client.gui.UIScreens;
{ import magicbees.main.CommonProxy;
super(Material.glass); import magicbees.main.MagicBees;
this.setCreativeTab(TabMagicBees.tabMagicBees); import magicbees.main.utils.TabMagicBees;
this.setBlockName("effectJar"); import magicbees.tileentity.TileEntityEffectJar;
this.setBlockBounds(0.25f, 0f, 0.25f, 0.75f, 0.81f, 0.74f);
this.setHardness(0.1f);
this.setResistance(1.5f);
}
@Override public class BlockEffectJar extends BlockContainer {
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()) public BlockEffectJar() {
{ super(Material.glass);
player.openGui(MagicBees.object, UIScreens.EFFECT_JAR.ordinal(), world, x, y, z); this.setCreativeTab(TabMagicBees.tabMagicBees);
activate = true; this.setBlockName("effectJar");
} this.setBlockBounds(0.25f, 0f, 0.25f, 0.75f, 0.81f, 0.74f);
this.setHardness(0.1f);
this.setResistance(1.5f);
}
return activate; @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;
@Override if (!player.isSneaking()) {
public TileEntity createNewTileEntity(World w, int metadata) if (!world.isRemote) {
{ player.openGui(MagicBees.object, UIScreens.EFFECT_JAR.ordinal(), world, x, y, z);
return new TileEntityEffectJar(); }
} activate = true;
}
@Override return activate;
public boolean isOpaqueCube() }
{
return false;
}
@Override @Override
public boolean renderAsNormalBlock() public TileEntity createNewTileEntity(World w, int metadata) {
{ return new TileEntityEffectJar();
return false; }
}
@Override @Override
public int getRenderType() public boolean isOpaqueCube() {
{ return false;
return CommonProxy.RenderIdEffectJar; }
}
@Override @Override
public void breakBlock(World world, int x, int y, int z, Block block, int meta) public boolean renderAsNormalBlock() {
{ return false;
this.dropInventory(world, x, y, z); }
super.breakBlock(world, x, y, z, block, meta);
}
private void dropInventory(World world, int x, int y, int z) @Override
{ public int getRenderType() {
TileEntity e = world.getTileEntity(x, y, z); return CommonProxy.RenderIdEffectJar;
}
if (e != null && e instanceof TileEntityEffectJar) @Override
{ public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
TileEntityEffectJar jar = (TileEntityEffectJar)e; this.dropInventory(world, x, y, z);
super.breakBlock(world, x, y, z, block, meta);
}
// 0 is the only droppable stack. private void dropInventory(World world, int x, int y, int z) {
ItemStack stack = jar.getStackInSlot(0); TileEntity e = world.getTileEntity(x, y, z);
if (stack != null && stack.stackSize > 0) if (e != null && e instanceof TileEntityEffectJar) {
{ TileEntityEffectJar jar = (TileEntityEffectJar) e;
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()); // 0 is the only droppable stack.
ItemStack stack = jar.getStackInSlot(0);
entityItem.motionX = world.rand.nextGaussian() * 0.05f; if (stack != null && stack.stackSize > 0) {
entityItem.motionY = world.rand.nextGaussian() * 0.05f + 0.2f; float pX = world.rand.nextFloat() * 0.8f + 0.1f;
entityItem.motionZ = world.rand.nextGaussian() * 0.05f; float pY = world.rand.nextFloat() * 0.8f + 0.1f;
float pZ = world.rand.nextFloat() * 0.8f + 0.1f;
world.spawnEntityInWorld(entityItem); EntityItem entityItem = new EntityItem(world, x + pX, y + pY, z + pZ, stack.copy());
stack.stackSize = 0;
}
}
}
@Override entityItem.motionX = world.rand.nextGaussian() * 0.05f;
@SideOnly(Side.CLIENT) entityItem.motionY = world.rand.nextGaussian() * 0.05f + 0.2f;
public void registerBlockIcons(IIconRegister par1IconRegister) entityItem.motionZ = world.rand.nextGaussian() * 0.05f;
{
this.blockIcon = Blocks.glass.getIcon(0, 0); world.spawnEntityInWorld(entityItem);
} stack.stackSize = 0;
}
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister par1IconRegister) {
this.blockIcon = Blocks.glass.getIcon(0, 0);
}
} }
@@ -2,8 +2,6 @@ package magicbees.block;
import java.util.Random; import java.util.Random;
import magicbees.main.CommonProxy;
import magicbees.main.utils.TabMagicBees;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
@@ -12,64 +10,68 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable; import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
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.main.CommonProxy;
import magicbees.main.utils.TabMagicBees;
public class BlockEnchantedEarth extends Block { public class BlockEnchantedEarth extends Block {
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
private IIcon top; private IIcon top;
public BlockEnchantedEarth() { public BlockEnchantedEarth() {
super(Material.ground); super(Material.ground);
setCreativeTab(TabMagicBees.tabMagicBees); setCreativeTab(TabMagicBees.tabMagicBees);
setBlockName("enchantedEarth"); setBlockName("enchantedEarth");
setBlockTextureName(CommonProxy.DOMAIN + ":enchantedEarth"); setBlockTextureName(CommonProxy.DOMAIN + ":enchantedEarth");
setTickRandomly(true); setTickRandomly(true);
setStepSound(soundTypeGravel); setStepSound(soundTypeGravel);
} setHardness(0.1F);
}
@Override @Override
public void updateTick(World world, int x, int y, int z, Random random) { public void updateTick(World world, int x, int y, int z, Random random) {
for (int height = y + 1; height <= 256; ++height) { for (int height = y + 1; height <= 256; ++height) {
Block b = world.getBlock(x, height, z); Block b = world.getBlock(x, height, z);
if (b == this) { if (b == this) {
continue; continue;
} } else {
else { if (b.getTickRandomly()) {
if (b.getTickRandomly()) { world.scheduleBlockUpdate(x, height, z, b, 0);
world.scheduleBlockUpdate(x, height, z, b, 0); }
} break;
break; }
} }
} if (y < 256 && random.nextInt(2) == 0) {
if (y < 256 && random.nextInt(2) == 0) { int newX = x + (random.nextInt(3) - 1);
int newX = x + (random.nextInt(3) - 1); int newZ = z + (random.nextInt(3) - 1);
int newZ = z + (random.nextInt(3) - 1); int newY = y + 1;
int newY = y + 1; Block b = world.getBlock(newX, newY, newZ);
Block b = world.getBlock(newX, newY, newZ); if (b.getTickRandomly()) {
if (b.getTickRandomly()) { world.scheduleBlockUpdate(newX, newY, newZ, b, random.nextInt(5) + 1);
world.scheduleBlockUpdate(newX, newY, newZ, b, random.nextInt(5) + 1); }
} }
} }
}
@Override @Override
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) { public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction,
return true; IPlantable plantable) {
} return true;
}
@Override @Override
public IIcon getIcon(int side, int meta) { public IIcon getIcon(int side, int meta) {
if (side == 1) { if (side == 1) {
return top; return top;
} }
return super.getIcon(side, meta); return super.getIcon(side, meta);
} }
@Override @Override
public void registerBlockIcons(IIconRegister iconRegister) { public void registerBlockIcons(IIconRegister iconRegister) {
top = iconRegister.registerIcon(textureName + "_top"); top = iconRegister.registerIcon(textureName + "_top");
super.registerBlockIcons(iconRegister); super.registerBlockIcons(iconRegister);
} }
} }
+70 -84
View File
@@ -3,10 +3,6 @@ package magicbees.block;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; 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.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
@@ -17,97 +13,87 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.core.Tabs; import forestry.api.core.Tabs;
import magicbees.block.types.HiveType;
import magicbees.main.Config;
public class BlockHive extends Block public class BlockHive extends Block {
{
public BlockHive()
{
super(new MaterialHive());
this.setLightLevel(0.8f);
setHardness(1f);
setCreativeTab(Tabs.tabApiculture);
setBlockName("hive");
}
@Override public BlockHive() {
public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) super(new MaterialHive());
{ this.setLightLevel(0.8f);
return false; setHardness(1f);
} setCreativeTab(Tabs.tabApiculture);
setBlockName("hive");
}
@Override @Override
public int damageDropped(int meta) public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) {
{ return false;
return meta; }
}
@Override @Override
public int getLightValue(IBlockAccess world, int x, int y, int z) public int damageDropped(int meta) {
{ return meta;
int meta = world.getBlockMetadata(x, y, z); }
if (meta < 0 || meta > HiveType.values().length)
{
meta = 0;
}
return HiveType.getHiveFromMeta(meta).getLightValue();
}
@SideOnly(Side.CLIENT) @Override
@SuppressWarnings({ "rawtypes", "unchecked" }) public int getLightValue(IBlockAccess world, int x, int y, int z) {
@Override int meta = world.getBlockMetadata(x, y, z);
public void getSubBlocks(Item item, CreativeTabs tab, List itemsList) if (meta < 0 || meta > HiveType.VALUES.length) {
{ meta = 0;
// Java bitches about raw types & types not being checked. Sorry, but the API sucks. }
for (HiveType type : HiveType.values()) return HiveType.getHiveFromMeta(meta).getLightValue();
{ }
if (type.show || Config.forestryDebugEnabled)
{
itemsList.add(new ItemStack(this, 1, type.ordinal()));
}
}
}
@Override @SideOnly(Side.CLIENT)
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) @SuppressWarnings({ "rawtypes", "unchecked" })
{ @Override
return HiveType.getHiveFromMeta(metadata).getDrops(world, x, y, z, fortune); 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 @Override
@SideOnly(Side.CLIENT) public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
public void registerBlockIcons(IIconRegister register) return HiveType.getHiveFromMeta(metadata).getDrops(world, x, y, z, fortune);
{ }
HiveType.registerIcons(register);
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) public void registerBlockIcons(IIconRegister register) {
{ HiveType.registerIcons(register);
if (meta < 0 || meta > HiveType.values().length) }
{
meta = 0;
}
return HiveType.getHiveFromMeta(meta).getIconForSide(side);
}
@Override @Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) @SideOnly(Side.CLIENT)
{ public IIcon getIcon(int side, int meta) {
Block block = world.getBlock(x, y, z); if (meta < 0 || meta > HiveType.VALUES.length) {
meta = 0;
}
return HiveType.getHiveFromMeta(meta).getIconForSide(side);
}
if (block.isAir(world, x, y, z)) @Override
{ public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
return null; Block block = world.getBlock(x, y, z);
}
Item item = Item.getItemFromBlock(block); if (block.isAir(world, x, y, z)) {
if (item == null) return null;
{ }
return null;
}
return new ItemStack(item, 1, getDamageValue(world, x, y, z) & 7); Item item = Item.getItemFromBlock(block);
} if (item == null) {
return null;
}
return new ItemStack(item, 1, getDamageValue(world, x, y, z) & 7);
}
} }
@@ -1,10 +1,5 @@
package magicbees.block; package magicbees.block;
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.Block;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
@@ -16,16 +11,21 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.World; import net.minecraft.world.World;
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.client.gui.UIScreens;
import magicbees.main.CommonProxy;
import magicbees.main.MagicBees;
import magicbees.main.utils.TabMagicBees;
import magicbees.tileentity.TileEntityMagicApiary;
public class BlockMagicApiary extends BlockContainer {
public class BlockMagicApiary extends BlockContainer
{
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
private IIcon[] icons; private IIcon[] icons;
public BlockMagicApiary() public BlockMagicApiary() {
{
super(Material.wood); super(Material.wood);
this.setCreativeTab(TabMagicBees.tabMagicBees); this.setCreativeTab(TabMagicBees.tabMagicBees);
this.setBlockName("magicApiary"); this.setBlockName("magicApiary");
@@ -35,13 +35,14 @@ public class BlockMagicApiary extends BlockContainer
} }
@Override @Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9 ) public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7,
{ float par8, float par9) {
boolean activate = false; boolean activate = false;
if (!player.isSneaking()) if (!player.isSneaking()) {
{ if (!world.isRemote) {
player.openGui(MagicBees.object, UIScreens.THAUMIC_APIARY.ordinal(), world, x, y, z); player.openGui(MagicBees.object, UIScreens.THAUMIC_APIARY.ordinal(), world, x, y, z);
}
activate = true; activate = true;
} }
@@ -50,23 +51,22 @@ public class BlockMagicApiary extends BlockContainer
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta){ public IIcon getIcon(int side, int meta) {
if (side == 0){ if (side == 0) {
return icons[0]; return icons[0];
}else if (side == 1){ } else if (side == 1) {
return icons[1]; return icons[1];
}else if (side == 2 || side == 3){ } else if (side == 2 || side == 3) {
return icons[2]; return icons[2];
}else{ } else {
return icons[3]; return icons[3];
} }
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister register) public void registerBlockIcons(IIconRegister register) {
{
icons = new IIcon[4]; icons = new IIcon[4];
icons[0] = register.registerIcon(CommonProxy.DOMAIN + ":thaumicapiary.0"); icons[0] = register.registerIcon(CommonProxy.DOMAIN + ":thaumicapiary.0");
@@ -81,15 +81,15 @@ public class BlockMagicApiary extends BlockContainer
} }
@Override @Override
public void breakBlock(World world, int x, int y, int z, Block block, int meta){ public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
TileEntity te = world.getTileEntity(x, y, z); TileEntity te = world.getTileEntity(x, y, z);
if (te != null && te instanceof IInventory){ if (te != null && te instanceof IInventory) {
IInventory inventory = (IInventory)te; IInventory inventory = (IInventory) te;
for (int i = 0; i < inventory.getSizeInventory(); i++){ for (int i = 0; i < inventory.getSizeInventory(); i++) {
ItemStack itemStack = inventory.getStackInSlotOnClosing(i); ItemStack itemStack = inventory.getStackInSlotOnClosing(i);
if (itemStack != null){ if (itemStack != null) {
float spawnX = x + world.rand.nextFloat(); float spawnX = x + world.rand.nextFloat();
float spawnY = y + world.rand.nextFloat(); float spawnY = y + world.rand.nextFloat();
float spawnZ = z + world.rand.nextFloat(); float spawnZ = z + world.rand.nextFloat();
@@ -1,8 +1,5 @@
package magicbees.block; package magicbees.block;
import magicbees.main.CommonProxy;
import magicbees.main.utils.TabMagicBees;
import magicbees.tileentity.TileEntityManaAuraProvider;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
@@ -10,39 +7,41 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.World; import net.minecraft.world.World;
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.main.CommonProxy;
import magicbees.main.utils.TabMagicBees;
import magicbees.tileentity.TileEntityManaAuraProvider;
public class BlockManaAuraProvider extends Block implements ITileEntityProvider { public class BlockManaAuraProvider extends Block implements ITileEntityProvider {
@SideOnly(Side.CLIENT)
private IIcon topIcon;
public BlockManaAuraProvider() {
super(Material.rock);
this.setCreativeTab(TabMagicBees.tabMagicBees);
this.setBlockName("manaAuraProvider");
this.setHardness(2f);
this.setResistance(3f);
this.setHarvestLevel("pickaxe", 0);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityManaAuraProvider();
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":manaApiaryBooster0");
this.topIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":manaApiaryBooster1");
}
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) private IIcon topIcon;
{
return (side == 0 || side == 1) ? this.topIcon : this.blockIcon; public BlockManaAuraProvider() {
super(Material.rock);
this.setCreativeTab(TabMagicBees.tabMagicBees);
this.setBlockName("manaAuraProvider");
this.setHardness(2f);
this.setResistance(3f);
this.setHarvestLevel("pickaxe", 0);
} }
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityManaAuraProvider();
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":manaApiaryBooster0");
this.topIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":manaApiaryBooster1");
}
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return (side == 0 || side == 1) ? this.topIcon : this.blockIcon;
}
} }
@@ -1,49 +1,47 @@
package magicbees.block; 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.BlockContainer;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
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.main.CommonProxy;
import magicbees.main.utils.TabMagicBees;
import magicbees.tileentity.TileEntityVisAuraProvider;
public class BlockVisAuraProvider extends BlockContainer { public class BlockVisAuraProvider extends BlockContainer {
public BlockVisAuraProvider() { public BlockVisAuraProvider() {
super(Material.glass); super(Material.glass);
this.setCreativeTab(TabMagicBees.tabMagicBees); this.setCreativeTab(TabMagicBees.tabMagicBees);
this.setBlockName("visAuraProvider"); this.setBlockName("visAuraProvider");
this.setHardness(0.5f); this.setHardness(0.5f);
this.setResistance(1.5f); this.setResistance(1.5f);
this.setLightLevel(8); this.setLightLevel(8);
} }
@Override @Override
public boolean isOpaqueCube() public boolean isOpaqueCube() {
{ return false;
return false; }
}
@Override @Override
public TileEntity createNewTileEntity(World world, int metadata) { public TileEntity createNewTileEntity(World world, int metadata) {
return new TileEntityVisAuraProvider(); return new TileEntityVisAuraProvider();
} }
@Override @Override
public int getRenderType() public int getRenderType() {
{ return CommonProxy.RenderIdVisAuraProvider;
return CommonProxy.RenderIdVisAuraProvider; }
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.blockIcon = Blocks.planks.getIcon(0, 5);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.blockIcon = Blocks.planks.getIcon(0, 5);
}
} }
@@ -3,14 +3,11 @@ package magicbees.block;
import net.minecraft.block.material.MapColor; import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
public class MaterialHive extends Material public class MaterialHive extends Material {
{
public MaterialHive()
{
super(MapColor.stoneColor);
this.setImmovableMobility();
this.setRequiresTool();
}
public MaterialHive() {
super(MapColor.stoneColor);
this.setImmovableMobility();
this.setRequiresTool();
}
} }
+133 -146
View File
@@ -3,6 +3,15 @@ package magicbees.block.types;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
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;
import magicbees.bees.BeeGenomeManager; import magicbees.bees.BeeGenomeManager;
import magicbees.bees.BeeSpecies; import magicbees.bees.BeeSpecies;
import magicbees.bees.HiveDrop; import magicbees.bees.HiveDrop;
@@ -10,182 +19,160 @@ import magicbees.item.types.CombType;
import magicbees.main.CommonProxy; import magicbees.main.CommonProxy;
import magicbees.main.Config; import magicbees.main.Config;
import magicbees.main.utils.compat.ForestryHelper; 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 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; CURIOUS("curious", BeeSpecies.MYSTICAL, 12, true),
UNUSUAL("unusual", BeeSpecies.UNUSUAL, 12, true),
RESONANT("resonant", BeeSpecies.SORCEROUS, 12, true),
DEEP("deep", BeeSpecies.ATTUNED, 4, true),
INFERNAL("infernal", BeeSpecies.INFERNAL, 15, true),
OBLIVION("oblivion", BeeSpecies.OBLIVION, 7, true),;
private String name; public static final HiveType[] VALUES = values();
private BeeSpecies occupant;
public boolean show;
private int lightLevel;
private ArrayList<IHiveDrop> drops;
@SideOnly(Side.CLIENT) private static String[] nameList;
private IIcon[] icons;
public static HiveType getHiveFromMeta(int meta) private String name;
{ private BeeSpecies occupant;
HiveType type = CURIOUS; public boolean show;
private int lightLevel;
private ArrayList<IHiveDrop> drops;
if (meta > 0 && meta < HiveType.values().length) @SideOnly(Side.CLIENT)
{ private IIcon[] icons;
type = HiveType.values()[meta];
}
return type; public static HiveType getHiveFromMeta(int meta) {
} HiveType type = CURIOUS;
public static void initHiveData() if (meta > 0 && meta < HiveType.VALUES.length) {
{ type = HiveType.VALUES[meta];
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)); return type;
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)); public static void initHiveData() {
UNUSUAL.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.UNUSUAL.getGenome()), combs, 15)); ItemStack[] combs = new ItemStack[] { Config.combs.getStackForType(CombType.MUNDANE) };
UNUSUAL.drops.add(valiantDrop); HiveDrop valiantDrop = new HiveDrop(
BeeGenomeManager.addRainResist(ForestryHelper.getTemplateForestryForSpecies("Valiant")),
combs,
5);
RESONANT.drops.add(new HiveDrop(BeeSpecies.SORCEROUS.getGenome(), combs, 80).setIgnoblePercentage(0.7f)); CURIOUS.drops.add(new HiveDrop(BeeSpecies.MYSTICAL.getGenome(), combs, 80).setIgnoblePercentage(0.7f));
RESONANT.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.SORCEROUS.getGenome()), combs, 20)); CURIOUS.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.MYSTICAL.getGenome()), combs, 15));
RESONANT.drops.add(valiantDrop); CURIOUS.drops.add(valiantDrop);
DEEP.drops.add(new HiveDrop(BeeSpecies.ATTUNED.getGenome(), combs, 80).setIgnoblePercentage(0.65f)); UNUSUAL.drops.add(new HiveDrop(BeeSpecies.UNUSUAL.getGenome(), combs, 80).setIgnoblePercentage(0.7f));
DEEP.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.ATTUNED.getGenome()), combs, 20)); UNUSUAL.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.UNUSUAL.getGenome()), combs, 15));
DEEP.drops.add(valiantDrop); UNUSUAL.drops.add(valiantDrop);
combs = new ItemStack[] { Config.combs.getStackForType(CombType.MOLTEN), new ItemStack(Items.glowstone_dust, 6) }; 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);
INFERNAL.drops.add(new HiveDrop(BeeSpecies.INFERNAL.getGenome(), combs, 80).setIgnoblePercentage(0.5f)); DEEP.drops.add(new HiveDrop(BeeSpecies.ATTUNED.getGenome(), combs, 80).setIgnoblePercentage(0.65f));
INFERNAL.drops.add(new HiveDrop(ForestryHelper.getTemplateForestryForSpecies("Steadfast"), combs, 3)); DEEP.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.ATTUNED.getGenome()), combs, 20));
DEEP.drops.add(valiantDrop);
combs = new ItemStack[] { Config.combs.getStackForType(CombType.FORGOTTEN), new ItemStack(Items.ender_pearl, 1) }; combs = new ItemStack[] { Config.combs.getStackForType(CombType.MOLTEN),
new ItemStack(Items.glowstone_dust, 6) };
OBLIVION.drops.add(new HiveDrop(BeeSpecies.OBLIVION.getGenome(), combs, 80)); INFERNAL.drops.add(new HiveDrop(BeeSpecies.INFERNAL.getGenome(), combs, 80).setIgnoblePercentage(0.5f));
OBLIVION.drops.add(new HiveDrop(ForestryHelper.getTemplateForestryForSpecies("Steadfast"), combs, 9)); INFERNAL.drops.add(new HiveDrop(ForestryHelper.getTemplateForestryForSpecies("Steadfast"), combs, 3));
}
private HiveType(String hiveName, BeeSpecies occupant, int light, boolean visible) combs = new ItemStack[] { Config.combs.getStackForType(CombType.FORGOTTEN),
{ new ItemStack(Items.ender_pearl, 1) };
this.name = hiveName;
this.occupant = occupant;
this.lightLevel = light;
this.show = visible;
this.drops = new ArrayList<IHiveDrop>();
}
@SideOnly(Side.CLIENT) OBLIVION.drops.add(new HiveDrop(BeeSpecies.OBLIVION.getGenome(), combs, 80));
public static void registerIcons(IIconRegister register) OBLIVION.drops.add(new HiveDrop(ForestryHelper.getTemplateForestryForSpecies("Steadfast"), combs, 9));
{ }
for (HiveType type : HiveType.values())
{
type.icons = new IIcon[2];
type.icons[0] = register.registerIcon(CommonProxy.DOMAIN + ":beehive." + type.ordinal() + ".top"); private HiveType(String hiveName, BeeSpecies occupant, int light, boolean visible) {
type.icons[1] = register.registerIcon(CommonProxy.DOMAIN + ":beehive." + type.ordinal() + ".side"); this.name = hiveName;
} this.occupant = occupant;
} this.lightLevel = light;
this.show = visible;
this.drops = new ArrayList<IHiveDrop>();
}
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIconForSide(int side) public static void registerIcons(IIconRegister register) {
{ for (HiveType type : HiveType.VALUES) {
IIcon i = this.icons[0]; type.icons = new IIcon[2];
if (side != 0 && side != 1) type.icons[0] = register.registerIcon(CommonProxy.DOMAIN + ":beehive." + type.ordinal() + ".top");
{ type.icons[1] = register.registerIcon(CommonProxy.DOMAIN + ":beehive." + type.ordinal() + ".side");
i = this.icons[1]; }
} }
return i; @SideOnly(Side.CLIENT)
} public IIcon getIconForSide(int side) {
IIcon i = this.icons[0];
public int getLightValue() if (side != 0 && side != 1) {
{ i = this.icons[1];
return this.lightLevel; }
}
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int fortune) return i;
{ }
ArrayList<ItemStack> hiveDrops = new ArrayList<ItemStack>();
int dart;
Collections.shuffle(this.drops); public int getLightValue() {
return this.lightLevel;
}
// Get a princess. public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int fortune) {
int throttle = 0; ArrayList<ItemStack> hiveDrops = new ArrayList<ItemStack>();
while (hiveDrops.size() <= 0 && throttle < 10) int dart;
{
++throttle;
for (IHiveDrop drop : drops)
{
dart = world.rand.nextInt(100);
if (dart <= drop.getChance(world, x, y, z))
{
hiveDrops.add(drop.getPrincess(world, x, y, z, fortune));
break;
}
}
}
// Get a drone, maybe. Collections.shuffle(this.drops);
for (IHiveDrop drop : drops)
{
dart = world.rand.nextInt(100);
if (dart <= drop.getChance(world, x, y, z))
{
hiveDrops.addAll(drop.getDrones(world, x, y, z, fortune));
break;
}
}
// Get additional drops. // Get a princess.
for (IHiveDrop drop : drops) int throttle = 0;
{ while (hiveDrops.size() <= 0 && throttle < 10) {
dart = world.rand.nextInt(100); ++throttle;
if (dart <= drop.getChance(world, x, y, z)) for (IHiveDrop drop : drops) {
{ dart = world.rand.nextInt(100);
hiveDrops.addAll(drop.getAdditional(world, x, y, z, fortune)); if (dart <= drop.getChance(world, x, y, z)) {
} hiveDrops.add(drop.getPrincess(world, x, y, z, fortune));
} break;
}
}
}
return hiveDrops; // Get a drone, maybe.
} for (IHiveDrop drop : drops) {
dart = world.rand.nextInt(100);
if (dart <= drop.getChance(world, x, y, z)) {
hiveDrops.addAll(drop.getDrones(world, x, y, z, fortune));
break;
}
}
public static String[] getAllNames() // Get additional drops.
{ for (IHiveDrop drop : drops) {
return (nameList == null) ? nameList = generateNames() : nameList; dart = world.rand.nextInt(100);
} if (dart <= drop.getChance(world, x, y, z)) {
hiveDrops.addAll(drop.getAdditional(world, x, y, z, fortune));
}
}
public BeeSpecies getOccupant() { return hiveDrops;
return this.occupant; }
}
private static String[] generateNames() public static String[] getAllNames() {
{ return (nameList == null) ? nameList = generateNames() : nameList;
String[] names = new String[values().length]; }
for (int i = 0; i < names.length; ++i)
{ public BeeSpecies getOccupant() {
names[i] = values()[i].name; return this.occupant;
} }
return names;
} 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;
}
} }
@@ -1,45 +1,38 @@
package magicbees.block.types; package magicbees.block.types;
public enum PlankType public enum PlankType {
{
GREATWOOD("greatwood", 48),
SILVERWOOD("silverwood", 49),
;
public String name; GREATWOOD("greatwood", 48),
public int textureIdx; SILVERWOOD("silverwood", 49),;
private static String[] nameList;
private PlankType(String n, int idx) public String name;
{ public int textureIdx;
this.name = n; private static String[] nameList;
this.textureIdx = idx;
}
public static PlankType getType(int meta) private PlankType(String n, int idx) {
{ this.name = n;
PlankType type = null; this.textureIdx = idx;
}
if (meta >= 0 && meta <= values().length) public static PlankType getType(int meta) {
{ PlankType type = null;
type = values()[meta];
}
return type; if (meta >= 0 && meta <= values().length) {
} type = values()[meta];
}
public static String[] getAllNames() return type;
{ }
return (nameList == null) ? nameList = generateNames() : nameList;
}
private static String[] generateNames() public static String[] getAllNames() {
{ return (nameList == null) ? nameList = generateNames() : nameList;
String[] names = new String[values().length]; }
for (int i = 0; i < names.length; ++i)
{ private static String[] generateNames() {
names[i] = values()[i].name; String[] names = new String[values().length];
} for (int i = 0; i < names.length; ++i) {
return names; names[i] = values()[i].name;
} }
return names;
}
} }
@@ -1,122 +1,102 @@
package magicbees.client.gui; 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.entity.player.EntityPlayer;
import net.minecraft.inventory.Container; import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot; import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
public class ContainerEffectJar extends Container import cpw.mods.fml.common.registry.GameRegistry;
{ import cpw.mods.fml.relauncher.Side;
public TileEntityEffectJar jar; import cpw.mods.fml.relauncher.SideOnly;
import magicbees.tileentity.TileEntityEffectJar;
public int lastBeeHealth = 0; public class ContainerEffectJar extends Container {
public int speciesColour = 0xffffff;
public ContainerEffectJar(TileEntityEffectJar tileEntityEffectJar, EntityPlayer player) public TileEntityEffectJar jar;
{
this.jar = tileEntityEffectJar;
this.addSlotToContainer(new SlotCustomItems(this.jar, 0, 80, 22, GameRegistry.findItemStack("Forestry", "beeDroneGE", 1)));
for (int i = 0; i < 3; ++i) public int lastBeeHealth = 0;
{ public int speciesColour = 0xffffff;
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) public ContainerEffectJar(TileEntityEffectJar tileEntityEffectJar, EntityPlayer player) {
{ this.jar = tileEntityEffectJar;
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 132)); this.addSlotToContainer(
} new SlotCustomItems(this.jar, 0, 80, 22, GameRegistry.findItemStack("Forestry", "beeDroneGE", 1)));
}
@Override for (int i = 0; i < 3; ++i) {
public void addCraftingToCrafters(ICrafting crafting) for (int j = 0; j < 9; ++j) {
{ this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 74 + i * 18));
super.addCraftingToCrafters(crafting); }
}
crafting.sendProgressBarUpdate(this, 0, this.jar.currentBeeHealth); for (int i = 0; i < 9; ++i) {
crafting.sendProgressBarUpdate(this, 1, this.jar.currentBeeColour); this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 132));
} }
}
@Override @Override
public void detectAndSendChanges() public void addCraftingToCrafters(ICrafting crafting) {
{ super.addCraftingToCrafters(crafting);
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); ++i) crafting.sendProgressBarUpdate(this, 0, this.jar.currentBeeHealth);
{ crafting.sendProgressBarUpdate(this, 1, this.jar.currentBeeColour);
ICrafting crafting = (ICrafting)this.crafters.get(i); }
if (this.lastBeeHealth != this.jar.currentBeeHealth) @Override
{ public void detectAndSendChanges() {
crafting.sendProgressBarUpdate(this, 0, this.jar.currentBeeHealth); super.detectAndSendChanges();
this.lastBeeHealth = this.jar.currentBeeHealth;
}
if (this.speciesColour != this.jar.currentBeeColour)
{
crafting.sendProgressBarUpdate(this, 1, this.jar.currentBeeColour);
this.speciesColour = this.jar.currentBeeColour;
}
}
}
@Override for (int i = 0; i < this.crafters.size(); ++i) {
@SideOnly(Side.CLIENT) ICrafting crafting = (ICrafting) this.crafters.get(i);
public void updateProgressBar(int craftingId, int value)
{
if (craftingId == 0)
{
this.jar.currentBeeHealth = value;
}
else if (craftingId == 1)
{
this.jar.currentBeeColour = value;
}
}
@Override if (this.lastBeeHealth != this.jar.currentBeeHealth) {
public boolean canInteractWith(EntityPlayer entityplayer) crafting.sendProgressBarUpdate(this, 0, this.jar.currentBeeHealth);
{ this.lastBeeHealth = this.jar.currentBeeHealth;
return this.jar.isUseableByPlayer(entityplayer); }
} if (this.speciesColour != this.jar.currentBeeColour) {
crafting.sendProgressBarUpdate(this, 1, this.jar.currentBeeColour);
this.speciesColour = this.jar.currentBeeColour;
}
}
}
@Override @Override
public ItemStack transferStackInSlot(EntityPlayer player, int slot) @SideOnly(Side.CLIENT)
{ public void updateProgressBar(int craftingId, int value) {
Slot itemSlot = this.getSlot(slot); if (craftingId == 0) {
boolean clearSlot = false; this.jar.currentBeeHealth = value;
} else if (craftingId == 1) {
this.jar.currentBeeColour = value;
}
}
if (itemSlot != null && itemSlot.getHasStack()) @Override
{ public boolean canInteractWith(EntityPlayer entityplayer) {
ItemStack srcStack = itemSlot.getStack(); return this.jar.isUseableByPlayer(entityplayer);
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) @Override
{ public ItemStack transferStackInSlot(EntityPlayer player, int slot) {
itemSlot.putStack(null); Slot itemSlot = this.getSlot(slot);
} boolean clearSlot = false;
itemSlot.onSlotChanged();
player.inventory.markDirty();
return null; 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,16 @@
package magicbees.client.gui;
import net.minecraft.entity.player.InventoryPlayer;
import cpw.mods.fml.common.registry.GameRegistry;
import forestry.core.gui.ContainerItemInventory;
import magicbees.main.utils.compat.baubles.InventoryBeeRing;
public class ContainerEffectRing extends ContainerItemInventory<InventoryBeeRing> {
public ContainerEffectRing(InventoryBeeRing inventory, InventoryPlayer playerInventory) {
super(inventory, playerInventory, 8, 74);
addSlotToContainer(
new SlotCustomItems(inventory, 0, 80, 22, GameRegistry.findItemStack("Forestry", "beeDroneGE", 1)));
}
}
@@ -5,19 +5,19 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container; import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot; import net.minecraft.inventory.Slot;
public class ContainerMB extends Container public class ContainerMB extends Container {
{
protected final int PLAYER_INVENTORY_ROWS = 3; protected final int PLAYER_INVENTORY_ROWS = 3;
protected final int PLAYER_INVENTORY_COLUMNS = 9; protected final int PLAYER_INVENTORY_COLUMNS = 9;
public void addPlayerInventory(InventoryPlayer inventoryPlayer, int xStart, int yStart) public void addPlayerInventory(InventoryPlayer inventoryPlayer, int xStart, int yStart) {
{ for (int x = 0; x < PLAYER_INVENTORY_COLUMNS; x++) {
for (int x = 0; x < PLAYER_INVENTORY_COLUMNS; x++){ addSlotToContainer(
addSlotToContainer(new Slot(inventoryPlayer, x, xStart + 8 + 18 * x, yStart + 4 + PLAYER_INVENTORY_ROWS * 18)); 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 y = 0; y < PLAYER_INVENTORY_ROWS; y++) {
for (int x = 0; x < PLAYER_INVENTORY_COLUMNS; x++){ for (int x = 0; x < PLAYER_INVENTORY_COLUMNS; x++) {
addSlotToContainer(new Slot(inventoryPlayer, x + y * 9 + 9, xStart + 8 + 18 * x, yStart + y * 18)); addSlotToContainer(new Slot(inventoryPlayer, x + y * 9 + 9, xStart + 8 + 18 * x, yStart + y * 18));
} }
} }
@@ -1,15 +1,16 @@
package magicbees.client.gui; package magicbees.client.gui;
import forestry.api.apiculture.IHiveFrame;
import magicbees.bees.BeeManager;
import magicbees.main.utils.ItemInterface;
import magicbees.tileentity.TileEntityMagicApiary;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot; import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import forestry.api.apiculture.IHiveFrame;
import magicbees.bees.BeeManager;
import magicbees.main.utils.ItemInterface;
import magicbees.tileentity.TileEntityMagicApiary;
public class ContainerMagicApiary extends ContainerMB { public class ContainerMagicApiary extends ContainerMB {
public TileEntityMagicApiary apiary; public TileEntityMagicApiary apiary;
@@ -19,39 +20,47 @@ public class ContainerMagicApiary extends ContainerMB {
private static final int SLOT_QUEEN = 0; private static final int SLOT_QUEEN = 0;
private static final int SLOT_DRONE = 1; private static final int SLOT_DRONE = 1;
private static final int SLOT_FRAME_START = 2; private static final int SLOT_FRAME_START = 2;
private static final int SLOT_INVENTORY_START = 5; private static final int SLOT_INVENTORY_START = 5;
private static final int SLOT_FRAME_COUNT = 3; private static final int SLOT_FRAME_COUNT = 3;
private static final int SLOT_INVENTORY_COUNT = 7; private static final int SLOT_INVENTORY_COUNT = 7;
public ContainerMagicApiary(InventoryPlayer inventoryPlayer, TileEntityMagicApiary thaumicApiary){ public ContainerMagicApiary(InventoryPlayer inventoryPlayer, TileEntityMagicApiary thaumicApiary) {
this.apiary = thaumicApiary; this.apiary = thaumicApiary;
// Queen/Princess slot // Queen/Princess slot
addSlotToContainer(new SlotCustomItems(this.apiary, 0, 29, 39, ItemInterface.getItemStack("Forestry", "beeQueenGE", 1), ItemInterface.getItemStack("Forestry", "beePrincessGE", 1))); addSlotToContainer(
new SlotCustomItems(
this.apiary,
0,
29,
39,
ItemInterface.getItemStack("Forestry", "beeQueenGE", 1),
ItemInterface.getItemStack("Forestry", "beePrincessGE", 1)));
// Drone slot // Drone slot
addSlotToContainer(new SlotCustomItems(this.apiary, 1, 29, 65, ItemInterface.getItemStack("Forestry", "beeDroneGE", 64))); addSlotToContainer(
new SlotCustomItems(this.apiary, 1, 29, 65, ItemInterface.getItemStack("Forestry", "beeDroneGE", 64)));
int currentSlot = 1; int currentSlot = 1;
// Frame slots // Frame slots
for (int x = 0; x < 3; x++){ for (int x = 0; x < 3; x++) {
currentSlot++; currentSlot++;
addSlotToContainer(new SlotFrame(thaumicApiary, currentSlot, 66, 23 + x * 29)); addSlotToContainer(new SlotFrame(thaumicApiary, currentSlot, 66, 23 + x * 29));
//LogHelper.info("[1] CURRENTSLOT: " + currentSlot); // LogHelper.info("[1] CURRENTSLOT: " + currentSlot);
} }
for (int x = 0; x < 3; x++){ for (int x = 0; x < 3; x++) {
currentSlot++; currentSlot++;
addSlotToContainer(new Slot(thaumicApiary, currentSlot, 116, 26 + x * 26)); addSlotToContainer(new Slot(thaumicApiary, currentSlot, 116, 26 + x * 26));
//LogHelper.info("[2] CURRENTSLOT: " + currentSlot); // LogHelper.info("[2] CURRENTSLOT: " + currentSlot);
} }
int j = 0; int j = 0;
for (int y = 0; y < 2; y++){ for (int y = 0; y < 2; y++) {
for (int x = 0; x < 2; x++){ for (int x = 0; x < 2; x++) {
currentSlot++; currentSlot++;
addSlotToContainer(new Slot(thaumicApiary, currentSlot, 95 + x * 42, 39 + j * 26)); addSlotToContainer(new Slot(thaumicApiary, currentSlot, 95 + x * 42, 39 + j * 26));
//LogHelper.info("[3] CURRENTSLOT: " + currentSlot); // LogHelper.info("[3] CURRENTSLOT: " + currentSlot);
} }
j++; j++;
} }
@@ -59,41 +68,39 @@ public class ContainerMagicApiary extends ContainerMB {
addPlayerInventory(inventoryPlayer, 0, 110); addPlayerInventory(inventoryPlayer, 0, 110);
maxSlot = currentSlot; maxSlot = currentSlot;
} }
@Override @Override
public ItemStack transferStackInSlot(EntityPlayer player, int slotIndex){ public ItemStack transferStackInSlot(EntityPlayer player, int slotIndex) {
Slot itemSlot = this.getSlot(slotIndex); Slot itemSlot = this.getSlot(slotIndex);
boolean clearSlot = false; boolean clearSlot = false;
if (itemSlot != null && itemSlot.getHasStack()) { if (itemSlot != null && itemSlot.getHasStack()) {
ItemStack srcStack = itemSlot.getStack(); ItemStack srcStack = itemSlot.getStack();
if (slotIndex <= maxSlot && srcStack != null){ if (slotIndex <= maxSlot && srcStack != null) {
clearSlot = this.mergeItemStack(srcStack, maxSlot + 1, maxSlot + 36, false); clearSlot = this.mergeItemStack(srcStack, maxSlot + 1, maxSlot + 36, false);
}else{ } else {
if (slotIndex > maxSlot && srcStack != null){ if (slotIndex > maxSlot && srcStack != null) {
if (BeeManager.beeRoot.isMember(srcStack)){ if (BeeManager.beeRoot.isMember(srcStack)) {
if (!BeeManager.beeRoot.isDrone(srcStack)){ if (!BeeManager.beeRoot.isDrone(srcStack)) {
if (this.getSlot(SLOT_QUEEN).getHasStack() == false) { if (this.getSlot(SLOT_QUEEN).getHasStack() == false) {
clearSlot = this.mergeItemStack(srcStack, SLOT_QUEEN, SLOT_QUEEN + 1, false); clearSlot = this.mergeItemStack(srcStack, SLOT_QUEEN, SLOT_QUEEN + 1, false);
}
}else{
if (this.getSlot(SLOT_DRONE).isItemValid(srcStack)){
clearSlot = this.mergeItemStack(srcStack, SLOT_DRONE, SLOT_DRONE + 1, false);
}
} }
}else if(srcStack.getItem() instanceof IHiveFrame){ } else {
clearSlot = this.mergeItemStack(srcStack, SLOT_FRAME_START, SLOT_FRAME_START + SLOT_FRAME_COUNT, false); if (this.getSlot(SLOT_DRONE).isItemValid(srcStack)) {
clearSlot = this.mergeItemStack(srcStack, SLOT_DRONE, SLOT_DRONE + 1, false);
}
}
} else if (srcStack.getItem() instanceof IHiveFrame) {
clearSlot = this
.mergeItemStack(srcStack, SLOT_FRAME_START, SLOT_FRAME_START + SLOT_FRAME_COUNT, false);
} }
} }
} }
} }
if (clearSlot){ if (clearSlot) {
itemSlot.putStack(null); itemSlot.putStack(null);
} }
@@ -108,7 +115,6 @@ public class ContainerMagicApiary extends ContainerMB {
return apiary.isUseableByPlayer(entityPlayer); return apiary.isUseableByPlayer(entityPlayer);
} }
@Override @Override
public void updateProgressBar(int i, int j) { public void updateProgressBar(int i, int j) {
apiary.getGUINetworkData(i, j); apiary.getGUINetworkData(i, j);
@@ -1,65 +1,67 @@
package magicbees.client.gui; package magicbees.client.gui;
import magicbees.main.CommonProxy;
import magicbees.tileentity.TileEntityEffectJar;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import magicbees.main.CommonProxy;
import magicbees.tileentity.TileEntityEffectJar;
public class GUIEffectJar extends GuiContainer 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; public static final String BACKGROUND_FILE = "jarScreen.png";
private static final int HEIGHT = 156; public static final ResourceLocation BACKGROUND_LOCATION = new ResourceLocation(
CommonProxy.DOMAIN,
CommonProxy.GUI_TEXTURE + "jarScreen.png");
private static final int SLOT_JAR_X = 80; private static final int WIDTH = 176;
private static final int SLOT_JAR_Y = 22; private static final int HEIGHT = 156;
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_DEST_X = 117;
private static final int BAR_SRC_Y = 0; private static final int BAR_DEST_Y = 10;
private static final int BAR_WIDTH = 10; private static final int BAR_SRC_X = 176;
private static final int BAR_HEIGHT = 40; private static final int BAR_SRC_Y = 0;
public GUIEffectJar(TileEntityEffectJar jar, EntityPlayer player) private static final int BAR_WIDTH = 10;
{ private static final int BAR_HEIGHT = 40;
super(new ContainerEffectJar(jar, player));
this.xSize = WIDTH;
this.ySize = HEIGHT;
}
@Override public GUIEffectJar(TileEntityEffectJar jar, EntityPlayer player) {
protected void drawGuiContainerForegroundLayer(int par1, int par2) super(new ContainerEffectJar(jar, player));
{ this.xSize = WIDTH;
fontRendererObj.drawString("Inventory", 9, 63, 0); this.ySize = HEIGHT;
} }
@Override @Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) protected void drawGuiContainerForegroundLayer(int par1, int par2) {
{ fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 9, 63, 0);
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); @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);
TileEntityEffectJar jar = ((ContainerEffectJar)this.inventorySlots).jar; this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, xSize, ySize);
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); 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;
int value = BAR_HEIGHT - (jar.currentBeeHealth * BAR_HEIGHT) / 100; GL11.glColor3f(r, g, b);
this.drawTexturedModalRect(this.guiLeft + BAR_DEST_X, this.guiTop + value + BAR_DEST_Y, BAR_SRC_X, BAR_SRC_Y, BAR_WIDTH, BAR_HEIGHT - value);
}
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,62 @@
package magicbees.client.gui;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import forestry.core.gui.GuiForestry;
import magicbees.main.CommonProxy;
import magicbees.main.utils.compat.baubles.InventoryBeeRing;
public class GUIEffectRing extends GuiForestry<ContainerEffectRing, IInventory> {
public static final String BACKGROUND_FILE = "ringScreen.png";
public static final ResourceLocation BACKGROUND_LOCATION = new ResourceLocation(
CommonProxy.DOMAIN,
CommonProxy.GUI_TEXTURE + BACKGROUND_FILE);
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;
private final InventoryBeeRing inventoryBeeRing;
protected GUIEffectRing(InventoryBeeRing inventory, InventoryPlayer playerInventory) {
super(BACKGROUND_LOCATION, new ContainerEffectRing(inventory, playerInventory), inventory);
this.inventoryBeeRing = inventory;
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
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);
int currentBeeColour = this.inventoryBeeRing.getCurrentBeeColour();
float r = ((currentBeeColour >> 16) & 255) / 255f;
float g = ((currentBeeColour >> 8) & 255) / 255f;
float b = (currentBeeColour & 255) / 255f;
GL11.glColor3f(r, g, b);
int value = BAR_HEIGHT - (this.inventoryBeeRing.getCurrentBeeHealth() * 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);
}
}
@@ -1,48 +1,41 @@
package magicbees.client.gui; package magicbees.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;
import magicbees.main.utils.compat.baubles.InventoryBeeRing;
import magicbees.tileentity.TileEntityEffectJar; import magicbees.tileentity.TileEntityEffectJar;
import magicbees.tileentity.TileEntityMagicApiary; 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 public class GUIHandler implements IGuiHandler {
{
@Override @Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
{ Object value = null;
Object value = null;
if (ID == UIScreens.EFFECT_JAR.ordinal()) if (ID == UIScreens.EFFECT_JAR.ordinal()) {
{ value = new ContainerEffectJar((TileEntityEffectJar) world.getTileEntity(x, y, z), player);
value = new ContainerEffectJar((TileEntityEffectJar)world.getTileEntity(x, y, z), player); } else if (ID == UIScreens.THAUMIC_APIARY.ordinal()) {
}
else if (ID == UIScreens.THAUMIC_APIARY.ordinal())
{
TileEntityMagicApiary tileEntityThaumicApiary = (TileEntityMagicApiary) world.getTileEntity(x, y, z); TileEntityMagicApiary tileEntityThaumicApiary = (TileEntityMagicApiary) world.getTileEntity(x, y, z);
value = new ContainerMagicApiary(player.inventory, tileEntityThaumicApiary); value = new ContainerMagicApiary(player.inventory, tileEntityThaumicApiary);
} else if (ID == UIScreens.EFFECT_RING.ordinal()) {
value = new ContainerEffectRing(new InventoryBeeRing(player.getHeldItem(), player), player.inventory);
} }
return value; return value;
} }
@Override @Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
{ if (ID == UIScreens.EFFECT_JAR.ordinal()) {
Object value = null; return new GUIEffectJar((TileEntityEffectJar) world.getTileEntity(x, y, z), player);
} else if (ID == UIScreens.THAUMIC_APIARY.ordinal()) {
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); TileEntityMagicApiary tileEntityThaumicApiary = (TileEntityMagicApiary) world.getTileEntity(x, y, z);
value = new GuiMagicApiary(player.inventory, tileEntityThaumicApiary); return new GuiMagicApiary(player.inventory, tileEntityThaumicApiary);
} else if (ID == UIScreens.EFFECT_RING.ordinal()) {
return new GUIEffectRing(new InventoryBeeRing(player.getHeldItem(), player), player.inventory);
} }
return null;
return value; }
}
} }
@@ -2,34 +2,28 @@ package magicbees.client.gui;
import java.util.Set; import java.util.Set;
import cpw.mods.fml.client.IModGuiFactory;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
public class GuiFactory implements IModGuiFactory import cpw.mods.fml.client.IModGuiFactory;
{
@Override public class GuiFactory implements IModGuiFactory {
public void initialize(Minecraft minecraftInstance)
{
} @Override
public void initialize(Minecraft minecraftInstance) {}
@Override @Override
public Class<? extends GuiScreen> mainConfigGuiClass() public Class<? extends GuiScreen> mainConfigGuiClass() {
{ return ModGuiConfig.class;
return ModGuiConfig.class; }
}
@Override @Override
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
{ return null;
return null; }
}
@Override @Override
public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) {
{ return null;
return null; }
}
} }
@@ -1,24 +1,27 @@
package magicbees.client.gui; package magicbees.client.gui;
import magicbees.main.CommonProxy;
import magicbees.tileentity.TileEntityMagicApiary;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
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.main.CommonProxy;
import magicbees.tileentity.TileEntityMagicApiary;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiMagicApiary extends GuiContainer public class GuiMagicApiary extends GuiContainer {
{
public static final ResourceLocation BACKGROUND_LOCATION = new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.GUI_TEXTURE + "apiary.png"); 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 WIDTH = 176;
private static final int HEIGHT = 190; private static final int HEIGHT = 192;
private static final int LIFEBAR_WIDTH = 2; private static final int LIFEBAR_WIDTH = 2;
private static final int LIFEBAR_HEIGHT = 46; private static final int LIFEBAR_HEIGHT = 46;
@@ -61,14 +64,12 @@ public class GuiMagicApiary extends GuiContainer
this.xSize = WIDTH; this.xSize = WIDTH;
this.ySize = HEIGHT; this.ySize = HEIGHT;
} }
@Override @Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) protected void drawGuiContainerForegroundLayer(int par1, int par2) {
{ fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 9, 99, 0);
fontRendererObj.drawString("Inventory", 9, 99, 0); }
}
@Override @Override
protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y) { protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y) {
@@ -77,7 +78,7 @@ public class GuiMagicApiary extends GuiContainer
this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
TileEntityMagicApiary apiary = ((ContainerMagicApiary)this.inventorySlots).apiary; TileEntityMagicApiary apiary = ((ContainerMagicApiary) this.inventorySlots).apiary;
drawLifebar(apiary); drawLifebar(apiary);
@@ -86,56 +87,72 @@ public class GuiMagicApiary extends GuiContainer
drawMutationIcon(apiary); drawMutationIcon(apiary);
} }
private void drawMutationIcon(TileEntityMagicApiary apiary) { private void drawMutationIcon(TileEntityMagicApiary apiary) {
if (apiary.isMutationBoosted()) { if (apiary.isMutationBoosted()) {
this.drawTexturedModalRect(this.guiLeft + MUTATIONBOOST_DEST_X, this.guiTop + MUTATIONBOOST_DEST_Y, this.drawTexturedModalRect(
MUTATIONBOOST_SRC_X, MUTATIONBOOST_SRC_Y, MUTATIONBOOST_WIDTH, MUTATIONBOOST_HEIGHT); 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 private void drawDeathRateIcon(TileEntityMagicApiary apiary) {
protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_) { if (apiary.isDeathRateBoosted()) {
// TODO Auto-generated method stub this.drawTexturedModalRect(
super.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_); 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_);
}
} }
@@ -3,36 +3,42 @@ package magicbees.client.gui;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import magicbees.main.Config;
import magicbees.main.utils.VersionInfo;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.config.ConfigElement; import net.minecraftforge.common.config.ConfigElement;
import net.minecraftforge.common.config.Configuration;
import cpw.mods.fml.client.config.DummyConfigElement; import cpw.mods.fml.client.config.DummyConfigElement;
import cpw.mods.fml.client.config.GuiConfig; import cpw.mods.fml.client.config.GuiConfig;
import cpw.mods.fml.client.config.IConfigElement; import cpw.mods.fml.client.config.IConfigElement;
import magicbees.main.Config;
import magicbees.main.utils.VersionInfo;
public class ModGuiConfig extends GuiConfig public class ModGuiConfig extends GuiConfig {
{
public ModGuiConfig(GuiScreen guiScreen)
{
super(guiScreen, configElements(), VersionInfo.ModName, false, false,
GuiConfig.getAbridgedConfigPath(Config.configuration.toString()));
}
private static List<IConfigElement> configElements() { public ModGuiConfig(GuiScreen guiScreen) {
List<IConfigElement> list = new ArrayList<IConfigElement>(); super(
guiScreen,
configElements(),
VersionInfo.ModName,
false,
false,
GuiConfig.getAbridgedConfigPath(Config.configuration.toString()));
}
list.add(categoryElement(Config.CATEGORY_GENERAL, "General", "magicbees.config.category.general")); private static List<IConfigElement> configElements() {
list.add(categoryElement(Config.CATEGORY_DEBUG, "Debug", "magicbees.config.category.debug")); List<IConfigElement> list = new ArrayList<IConfigElement>();
list.add(categoryElement(Config.CATEGORY_MODULES, "Modules", "magicbees.config.category.modules"));
list.add(categoryElement(Config.CATEGORY_BOTANIA, "Botania Plugin", "magicbees.config.category.botania"));
return list; list.add(categoryElement(Config.CATEGORY_GENERAL, "General", "magicbees.config.category.general"));
} list.add(categoryElement(Config.CATEGORY_DEBUG, "Debug", "magicbees.config.category.debug"));
list.add(categoryElement(Config.CATEGORY_MODULES, "Modules", "magicbees.config.category.modules"));
list.add(categoryElement(Config.CATEGORY_BOTANIA, "Botania Plugin", "magicbees.config.category.botania"));
private static IConfigElement categoryElement(String category, String name, String tooltip_key) { return list;
return new DummyConfigElement.DummyCategoryElement(name, tooltip_key, }
new ConfigElement(Config.configuration.getCategory(category)).getChildElements());
} private static IConfigElement categoryElement(String category, String name, String tooltip_key) {
return new DummyConfigElement.DummyCategoryElement(
name,
tooltip_key,
new ConfigElement(Config.configuration.getCategory(category)).getChildElements());
}
} }
@@ -12,90 +12,71 @@ import net.minecraftforge.oredict.OreDictionary;
/** /**
* @author MysteriousAges * @author MysteriousAges
*/ */
public class SlotCustomItems extends Slot public class SlotCustomItems extends Slot {
{
private List<ItemStack> items;
public SlotCustomItems(IInventory inventory, int slotIndex, int xPos, int yPos, ItemStack... items) private List<ItemStack> items;
{
super(inventory, slotIndex, xPos, yPos);
this.items = new ArrayList<ItemStack>(items.length);
Collections.addAll(this.items, 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) /**
{ * @return List of valid ItemStacks
boolean contains = false; */
for (int i = 0; i < this.items.size(); ++i) public List<ItemStack> getValidItems() {
{ return this.items;
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);
}
}
/** public void addValidItem(ItemStack newItem) {
* @param removeItem ItemStack to remove. boolean contains = false;
*/ for (int i = 0; i < this.items.size(); ++i) {
public void removeValidItem(ItemStack removeItem) ItemStack s = this.items.get(i);
{ if (s.getItem() == newItem.getItem()) {
for (int i = 0; i < this.items.size(); ++i) if (s.getItemDamage() == OreDictionary.WILDCARD_VALUE) {
{ contains = true;
ItemStack s = this.items.get(i); break;
if (s.getItem() == removeItem.getItem()) } else if (s.getItemDamage() == newItem.getItemDamage()) {
{ contains = true;
if (s.getItemDamage() == OreDictionary.WILDCARD_VALUE) break;
{ }
this.items.remove(i); }
break; }
} if (!contains) {
else if (s.getItemDamage() == removeItem.getItemDamage()) this.items.add(newItem);
{ }
this.items.remove(i); }
break;
}
}
}
}
@Override /**
public boolean isItemValid(ItemStack itemStack) * @param removeItem ItemStack to remove.
{ */
for (ItemStack item : this.items) public void removeValidItem(ItemStack removeItem) {
{ for (int i = 0; i < this.items.size(); ++i) {
if (item != null && item.getItem() == itemStack.getItem()) ItemStack s = this.items.get(i);
{ if (s.getItem() == removeItem.getItem()) {
if (item.getItemDamage() == itemStack.getItemDamage() || item.getItemDamage() == OreDictionary.WILDCARD_VALUE) if (s.getItemDamage() == OreDictionary.WILDCARD_VALUE) {
{ this.items.remove(i);
return true; break;
} } else if (s.getItemDamage() == removeItem.getItemDamage()) {
} this.items.remove(i);
} break;
return false; }
} }
}
}
@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;
}
} }
@@ -1,26 +1,28 @@
package magicbees.client.gui; package magicbees.client.gui;
import forestry.api.apiculture.IHiveFrame;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import forestry.api.apiculture.IHiveFrame;
public class SlotFrame extends SlotCustomItems { public class SlotFrame extends SlotCustomItems {
public SlotFrame(IInventory inventory, int slotIndex, int xPos, int yPos) { public SlotFrame(IInventory inventory, int slotIndex, int xPos, int yPos) {
super(inventory, slotIndex, xPos, yPos); super(inventory, slotIndex, xPos, yPos);
} }
@Override @Override
public boolean isItemValid(ItemStack itemStack){ public boolean isItemValid(ItemStack itemStack) {
if (itemStack == null){ if (itemStack == null) {
return false; return false;
} }
if (!inventory.isItemValidForSlot(getSlotIndex(), itemStack)){ if (!inventory.isItemValidForSlot(getSlotIndex(), itemStack)) {
return false; return false;
} }
boolean flag = false; boolean flag = false;
if(itemStack.getItem() instanceof IHiveFrame){ if (itemStack.getItem() instanceof IHiveFrame) {
flag = true; flag = true;
} }
@@ -1,7 +1,7 @@
package magicbees.client.gui; package magicbees.client.gui;
public enum UIScreens public enum UIScreens {
{ EFFECT_JAR,
EFFECT_JAR, THAUMIC_APIARY,
THAUMIC_APIARY,; EFFECT_RING
} }
@@ -1,39 +1,42 @@
package magicbees.client.model; package magicbees.client.model;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11;
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.main.CommonProxy; 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) @SideOnly(Side.CLIENT)
public class ModelEffectJar 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(); 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");
private IModelCustom effectJarObj; public static final ModelEffectJar model = new ModelEffectJar();
public ModelEffectJar() private IModelCustom effectJarObj;
{
this.effectJarObj = AdvancedModelLoader.loadModel(objFile);
}
public void render() public ModelEffectJar() {
{ this.effectJarObj = AdvancedModelLoader.loadModel(objFile);
this.effectJarObj.renderPart("jarLid"); }
GL11.glPushAttrib(GL11.GL_ENABLE_BIT); public void render() {
GL11.glEnable(GL11.GL_CULL_FACE); this.effectJarObj.renderPart("jarLid");
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();
} 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();
}
} }
@@ -1,40 +1,49 @@
package magicbees.client.model; package magicbees.client.model;
import org.lwjgl.opengl.GL11;
import magicbees.main.CommonProxy;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom; import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11;
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.main.CommonProxy;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class ModelVisAuraProvider { 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(); 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");
private IModelCustom visAuraProviderObj; public static final ModelVisAuraProvider model = new ModelVisAuraProvider();
public ModelVisAuraProvider() { private IModelCustom visAuraProviderObj;
this.visAuraProviderObj = AdvancedModelLoader.loadModel(objFile);
}
public void render(long tick) { public ModelVisAuraProvider() {
GL11.glPushMatrix(); this.visAuraProviderObj = AdvancedModelLoader.loadModel(objFile);
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); public void render(long tick) {
this.visAuraProviderObj.renderPart("frame"); 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");
}
} }
@@ -1,77 +1,71 @@
package magicbees.client.render; 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.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class RendererEffectJar extends TileEntitySpecialRenderer implements IItemRenderer import cpw.mods.fml.client.FMLClientHandler;
{ import magicbees.client.model.ModelEffectJar;
public static RendererEffectJar instance = new RendererEffectJar(); import magicbees.tileentity.TileEntityEffectJar;
@Override public class RendererEffectJar extends TileEntitySpecialRenderer implements IItemRenderer {
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 static RendererEffectJar instance = new RendererEffectJar();
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
return true;
}
@Override @Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick) {
{ if (tileEntity instanceof TileEntityEffectJar) {
return true; this.doRender(x, y, z, 1f);
} }
}
@Override @Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) public boolean handleRenderType(ItemStack item, ItemRenderType type) {
{ return true;
switch (type) }
{
default:
case ENTITY:
doRender(0, 0, 0, 1.8f);
break;
case EQUIPPED: @Override
doRender(0, 0, 0, 1.5f); public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
break; return true;
}
case EQUIPPED_FIRST_PERSON: @Override
doRender(-.5, .5, 0.25, 1f); public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
break; switch (type) {
default:
case ENTITY:
doRender(0, 0, 0, 1.8f);
break;
case INVENTORY: case EQUIPPED:
doRender(0.3, 0.25, 0.3, 1.5f); doRender(0, 0, 0, 1.5f);
break; break;
}
}
private void doRender(double x, double y, double z, float scale) case EQUIPPED_FIRST_PERSON:
{ doRender(-.5, .5, 0.25, 1f);
GL11.glPushMatrix(); break;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScaled(scale, scale, scale); case INVENTORY:
GL11.glTranslated(x, y, z); doRender(0.3, 0.25, 0.3, 1.5f);
break;
}
}
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ModelEffectJar.textureLocation); private void doRender(double x, double y, double z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
ModelEffectJar.model.render(); GL11.glScaled(scale, scale, scale);
GL11.glTranslated(x, y, z);
GL11.glEnable(GL11.GL_LIGHTING); FMLClientHandler.instance().getClient().renderEngine.bindTexture(ModelEffectJar.textureLocation);
GL11.glPopMatrix();
}
ModelEffectJar.model.render();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
} }
@@ -1,7 +1,5 @@
package magicbees.client.render; package magicbees.client.render;
import magicbees.client.model.ModelVisAuraProvider;
import magicbees.tileentity.TileEntityVisAuraProvider;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@@ -10,41 +8,43 @@ import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.FMLClientHandler;
import magicbees.client.model.ModelVisAuraProvider;
import magicbees.tileentity.TileEntityVisAuraProvider;
public class RendererVisAuraProvider extends TileEntitySpecialRenderer implements IItemRenderer { public class RendererVisAuraProvider extends TileEntitySpecialRenderer implements IItemRenderer {
public static RendererVisAuraProvider instance = new RendererVisAuraProvider();
@Override public static RendererVisAuraProvider instance = new RendererVisAuraProvider();
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 @Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) { public void renderTileEntityAt(TileEntity entity, double x, double y, double z, float tick) {
return true; if (entity instanceof TileEntityVisAuraProvider) {
} this.doRender(x, y, z, 1f, entity.getWorldObj().getTotalWorldTime());
}
}
@Override @Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { public boolean handleRenderType(ItemStack item, ItemRenderType type) {
return true; return true;
} }
@Override @Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) { public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
doRender(0, 0, 0, 1f, 0); return true;
} }
private void doRender(double x, double y, double z, float scale, long tick) { @Override
GL11.glPushMatrix(); public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
GL11.glScaled(scale, scale, scale); doRender(0, 0, 0, 1f, 0);
GL11.glTranslated(x, y, z); }
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ModelVisAuraProvider.textureLocation); private void doRender(double x, double y, double z, float scale, long tick) {
ModelVisAuraProvider.model.render(tick); GL11.glPushMatrix();
GL11.glScaled(scale, scale, scale);
GL11.glTranslated(x, y, z);
GL11.glPopMatrix(); FMLClientHandler.instance().getClient().renderEngine.bindTexture(ModelVisAuraProvider.textureLocation);
} ModelVisAuraProvider.model.render(tick);
GL11.glPopMatrix();
}
} }
+69 -78
View File
@@ -2,100 +2,91 @@ package magicbees.item;
import java.util.List; import java.util.List;
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.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 net.minecraft.util.IIcon;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
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.CapsuleType;
import magicbees.item.types.FluidType;
import magicbees.main.CommonProxy;
import magicbees.main.utils.TabMagicBees;
public class ItemCapsule extends Item public class ItemCapsule extends Item {
{
private CapsuleType capsuleType;
public ItemCapsule(CapsuleType type, int maxStackSize) private CapsuleType capsuleType;
{
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() public ItemCapsule(CapsuleType type, int maxStackSize) {
{ super();
return this.capsuleType; 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());
}
@Override public CapsuleType getType() {
public String getItemStackDisplayName(ItemStack itemStack) return this.capsuleType;
{ }
return String.format(this.capsuleType.getLocalizedName(), FluidType.values()[itemStack.getItemDamage()].getDisplayName());
}
public ItemStack getCapsuleForLiquid(FluidType l) @Override
{ public String getItemStackDisplayName(ItemStack itemStack) {
return new ItemStack(this, 1, l.ordinal()); return String.format(
} this.capsuleType.getLocalizedName(),
FluidType.VALUES[itemStack.getItemDamage()].getDisplayName());
}
@SuppressWarnings({ "unchecked", "rawtypes" }) public ItemStack getCapsuleForLiquid(FluidType l) {
@Override return new ItemStack(this, 1, l.ordinal());
@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 @SuppressWarnings({ "unchecked", "rawtypes" })
@SideOnly(Side.CLIENT) @Override
public boolean requiresMultipleRenderPasses() @SideOnly(Side.CLIENT)
{ public void getSubItems(Item item, CreativeTabs tab, List itemList) {
return true; for (FluidType l : FluidType.VALUES) {
} if (l.available) {
itemList.add(new ItemStack(this, 1, l.ordinal()));
}
}
}
@SideOnly(Side.CLIENT) @Override
public void registerIcons(IIconRegister iconRegister) @SideOnly(Side.CLIENT)
{ public boolean requiresMultipleRenderPasses() {
this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":capsule" + this.capsuleType.getName().substring(0, 1).toUpperCase() return true;
+ this.capsuleType.getName().substring(1)); }
for (FluidType t : FluidType.values())
{
if (t != FluidType.EMPTY)
{
t.liquidIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":liquids/" + t.liquidID);
}
}
}
@Override @SideOnly(Side.CLIENT)
@SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) {
public IIcon getIconFromDamageForRenderPass(int metadata, int pass) this.itemIcon = iconRegister.registerIcon(
{ CommonProxy.DOMAIN + ":capsule"
IIcon i = this.itemIcon; + this.capsuleType.getName().substring(0, 1).toUpperCase()
if (metadata != 0 && pass == 0) + this.capsuleType.getName().substring(1));
{ for (FluidType t : FluidType.VALUES) {
i = FluidType.values()[metadata % FluidType.values().length].liquidIcon; if (t != FluidType.EMPTY) {
} t.liquidIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":liquids/" + t.liquidID);
return i; }
} }
}
@Override @Override
public int getRenderPasses(int metadata) @SideOnly(Side.CLIENT)
{ public IIcon getIconFromDamageForRenderPass(int metadata, int pass) {
return (metadata == 0) ? 1 : 2; IIcon i = this.itemIcon;
} if (metadata != 0 && pass == 0) {
i = FluidType.VALUES[metadata % FluidType.VALUES.length].liquidIcon;
}
return i;
}
@Override
public int getRenderPasses(int metadata) {
return (metadata == 0) ? 1 : 2;
}
} }
+69 -83
View File
@@ -2,111 +2,97 @@ package magicbees.item;
import java.util.List; import java.util.List;
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.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 net.minecraft.util.IIcon;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
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 forestry.api.core.Tabs; import forestry.api.core.Tabs;
import magicbees.item.types.CombType;
import magicbees.main.Config;
import magicbees.main.utils.compat.ForestryHelper;
public class ItemComb extends Item 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) public ItemComb() {
{ super();
return new ItemStack(this, 1, type.ordinal()); this.setCreativeTab(Tabs.tabApiculture);
} this.setHasSubtypes(true);
this.setUnlocalizedName("comb");
GameRegistry.registerItem(this, "comb");
}
public ItemStack getStackForType(CombType type, int count) public ItemStack getStackForType(CombType type) {
{ return new ItemStack(this, 1, type.ordinal());
return new ItemStack(this, count, type.ordinal()); }
}
@SuppressWarnings({ "unchecked", "rawtypes" }) public ItemStack getStackForType(CombType type, int count) {
@Override return new ItemStack(this, count, type.ordinal());
@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 @SuppressWarnings({ "unchecked", "rawtypes" })
@SideOnly(Side.CLIENT) @Override
public boolean requiresMultipleRenderPasses() @SideOnly(Side.CLIENT)
{ public void getSubItems(Item item, CreativeTabs tabs, List list) {
return true; for (CombType type : CombType.VALUES) {
} if (type.showInList || Config.forestryDebugEnabled) {
list.add(this.getStackForType(type));
}
}
}
@Override @Override
public int getRenderPasses(int meta) @SideOnly(Side.CLIENT)
{ public boolean requiresMultipleRenderPasses() {
return 2; return true;
} }
@SideOnly(Side.CLIENT) @Override
private IIcon secondIcon; public int getRenderPasses(int meta) {
return 2;
}
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister) private IIcon secondIcon;
{
this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":beeCombs.0");
this.secondIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":beeCombs.1");
}
@Override @SideOnly(Side.CLIENT)
public IIcon getIcon(ItemStack stack, int pass) public void registerIcons(IIconRegister par1IconRegister) {
{ this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":beeCombs.0");
return (pass == 0) ? itemIcon : secondIcon; this.secondIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":beeCombs.1");
} }
@Override @Override
@SideOnly(Side.CLIENT) public IIcon getIcon(ItemStack stack, int pass) {
public int getColorFromItemStack(ItemStack stack, int pass) return (pass == 0) ? itemIcon : secondIcon;
{ }
int meta = Math.max(0, Math.min(CombType.values().length - 1, stack.getItemDamage()));
int colour = CombType.values()[meta].getColours()[0];
if (pass >= 1) @Override
{ @SideOnly(Side.CLIENT)
colour = CombType.values()[meta].getColours()[1]; 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];
return colour; if (pass >= 1) {
} colour = CombType.VALUES[meta].getColours()[1];
}
@Override return colour;
public String getItemStackDisplayName(ItemStack stack) }
{
return CombType.values()[stack.getItemDamage()].getName();
}
@Override
public int getDamage(ItemStack stack) {
if (CombType.values().length < super.getDamage(stack)) {
stack.setItemDamage(0);
}
return super.getDamage(stack);
}
@Override
public String getItemStackDisplayName(ItemStack stack) {
return CombType.VALUES[stack.getItemDamage()].getName();
}
@Override
public int getDamage(ItemStack stack) {
if (CombType.VALUES.length < super.getDamage(stack)) {
stack.setItemDamage(0);
}
return super.getDamage(stack);
}
} }
+62 -74
View File
@@ -2,98 +2,86 @@ package magicbees.item;
import java.util.List; 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.DropType;
import magicbees.main.utils.compat.ForestryHelper;
import net.minecraft.client.renderer.texture.IIconRegister; 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 net.minecraft.util.IIcon;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.core.Tabs; import forestry.api.core.Tabs;
import magicbees.item.types.DropType;
import magicbees.main.utils.compat.ForestryHelper;
public class ItemDrop extends Item public class ItemDrop extends Item {
{
public ItemDrop()
{
super();
this.setCreativeTab(Tabs.tabApiculture);
this.setHasSubtypes(true);
this.setUnlocalizedName("drop");
GameRegistry.registerItem(this, "drop");
}
public ItemStack getStackForType(DropType type) public ItemDrop() {
{ super();
return new ItemStack(this, 1, type.ordinal()); this.setCreativeTab(Tabs.tabApiculture);
} this.setHasSubtypes(true);
this.setUnlocalizedName("drop");
GameRegistry.registerItem(this, "drop");
}
public ItemStack getStackForType(DropType type, int count) public ItemStack getStackForType(DropType type) {
{ return new ItemStack(this, 1, type.ordinal());
return new ItemStack(this, count, type.ordinal()); }
}
@Override public ItemStack getStackForType(DropType type, int count) {
@SideOnly(Side.CLIENT) return new ItemStack(this, count, type.ordinal());
@SuppressWarnings({ "unchecked", "rawtypes" }) }
public void getSubItems(Item item, CreativeTabs tabs, List list)
{
for (DropType type : DropType.values())
{
list.add(this.getStackForType(type));
}
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses() @SuppressWarnings({ "unchecked", "rawtypes" })
{ public void getSubItems(Item item, CreativeTabs tabs, List list) {
return true; for (DropType type : DropType.VALUES) {
} list.add(this.getStackForType(type));
}
}
@Override @Override
public int getRenderPasses(int metadata) @SideOnly(Side.CLIENT)
{ public boolean requiresMultipleRenderPasses() {
return 2; return true;
} }
@SideOnly(Side.CLIENT) @Override
private IIcon secondIcon; public int getRenderPasses(int metadata) {
return 2;
}
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister) private IIcon secondIcon;
{
this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":honeyDrop.0");
this.secondIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":honeyDrop.1");
}
@Override @SideOnly(Side.CLIENT)
public IIcon getIcon(ItemStack stack, int pass) public void registerIcons(IIconRegister par1IconRegister) {
{ this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":honeyDrop.0");
return (pass == 0) ? this.itemIcon : this.secondIcon; this.secondIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":honeyDrop.1");
} }
@Override @Override
@SideOnly(Side.CLIENT) public IIcon getIcon(ItemStack stack, int pass) {
public int getColorFromItemStack(ItemStack stack, int pass) return (pass == 0) ? this.itemIcon : this.secondIcon;
{ }
int meta = Math.max(0, Math.min(DropType.values().length - 1, stack.getItemDamage()));
int colour = DropType.values()[meta].combColour[0];
if (pass >= 1) @Override
{ @SideOnly(Side.CLIENT)
colour = DropType.values()[meta].combColour[1]; public int getColorFromItemStack(ItemStack stack, int pass) {
} int meta = Math.max(0, Math.min(DropType.VALUES.length - 1, stack.getItemDamage()));
int colour = DropType.VALUES[meta].combColour[0];
return colour; if (pass >= 1) {
} colour = DropType.VALUES[meta].combColour[1];
}
@Override return colour;
public String getItemStackDisplayName(ItemStack stack) }
{
return DropType.values()[stack.getItemDamage()].getName();
}
@Override
public String getItemStackDisplayName(ItemStack stack) {
return DropType.VALUES[stack.getItemDamage()].getName();
}
} }
Loaded 100 of 338 files, more files were not shown because too many files have changed in this diff. Show more