Compare commits

...

84 commits
1.16.3 ... 1.9

Author SHA1 Message Date
Nicholas Ignoffo 730b26b5ac Update changelog + version 2017-06-21 20:10:32 -07:00
Graham Hughes 51f597321d Add crop support for Pam's Harvestcraft and Roots herbs (#1164)
* Add harvest ritual support for Pam's crops.

* Add roots crops.

* Per @TehNut, use BM instance logger.

* Call getMaxAge rather than hardcode 3.

(cherry picked from commit 061850e)
2017-06-21 19:59:38 -07:00
Nicholas Ignoffo 70253f4030 Fix HarvestHandlerStem not working (#1165)
(cherry picked from commit 16d4609)
2017-06-21 19:58:59 -07:00
Nicholas Ignoffo f27511c1d1 Fix ItemStackWrapper ignoring stack's NBT (#1155)
who even made this class i mean come on this is such a stupid thing to do like omgwtf what a moron

(cherry picked from commit 8c12b48)
2017-06-21 19:58:49 -07:00
Yulife f18b60d062 JSONifcy routing nodes
I don't know how I should prepare the model but here's the full package.
Master routing nodes uses one texture, normal routing node use a base
texture plus a texture for their kind.
2017-06-11 19:09:21 +02:00
Yulife 7a126f4474 Sigil Changes 2017-06-10 21:21:08 +02:00
Nicholas Ignoffo 2ce43cfd7b API-facing methods for removing recipes (#1152)
(cherry picked from commit f7b8dc0)
2017-06-01 22:43:17 -07:00
Nicholas Ignoffo 11c869a753 Fix client not registering capability (#1150)
(cherry picked from commit 273dca3)
2017-06-01 22:37:31 -07:00
NoX-programer 44c132498f Update ru_RU.lang (#1146) 2017-05-24 06:01:09 -07:00
Nicholas Ignoffo 1a407276de Fixed capacity on tank being reset when tile was reloaded (#1138)
(cherry picked from commit e9ce88f)
2017-05-23 18:55:17 -07:00
Nicholas Ignoffo 9a7db207a2 Fixed NPE in Fluid Filter (#1139) 2017-05-23 18:41:24 -07:00
Nicholas Ignoffo 016ba64c54 Fix diamond meteor giving blocks + dynamically calculate weight (#1126)
(cherry picked from commit a2ceee3)
2017-05-21 13:47:44 -07:00
Nicholas Ignoffo 4b14eac1db Large Bloodstone Bricks should get 4 from crafting (#1125)
(cherry picked from commit 5b9bb07)
2017-05-21 13:47:36 -07:00
Nicholas Ignoffo 066cf5909c Fix permission level for commands (#1117)
(cherry picked from commit c7f6445)
2017-05-21 13:47:26 -07:00
Nicholas Ignoffo 375e3b0ee2 Add support for ExU and AA crops to plantable handler (#1107)
Theoretically. Don't actually know if their stuff is written properly.

(cherry picked from commit abef1ba)
2017-05-21 13:47:15 -07:00
Nicholas Ignoffo 4cce468ede Update changelog + version
(cherry picked from commit 66e3066)
2017-05-08 19:40:29 -07:00
Nicholas Ignoffo 717279db4b Bound tools now properly mark themselves as tools
Because *somebody* forgot to do that.
2017-05-08 19:36:48 -07:00
Nicholas Ignoffo 324d49e3ac Sanity check pos passed by client
Prevents malicious clients from loading arbitrary chunks.

Thanks to pau101 for spotting it.

(cherry picked from commit 7c19e2e)
2017-04-30 17:21:05 -07:00
Nicholas Ignoffo 078ab16b43 Update changelog + version 2017-04-03 18:02:56 -07:00
Nicholas Ignoffo 1e25a48709 Merge remote-tracking branch 'origin/1.9' into 1.9 2017-04-03 17:59:34 -07:00
Nicholas Ignoffo 3be9bdf4bc Allow commands to be used in command blocks (#1117)
(cherry picked from commit 805576a)
2017-04-03 17:59:16 -07:00
Nicholas Ignoffo 5ea7177bdb Re-implement Soul Fray on death (#1118)
This should be all that's needed

(cherry picked from commit bffd191)
2017-04-03 17:59:06 -07:00
NatsuArashi f44ad3a449 Traditional Chinese update. (#1116)
* Update zh_TW.lang

* Create zh_TW.lang

* Update zh_TW.lang
2017-04-03 17:09:44 -07:00
Nicholas Ignoffo 0b0ec65ece Update changelog + version 2017-03-28 19:32:34 -07:00
Nicholas Ignoffo e91a3b348f Merge remote-tracking branch 'origin/1.9' into 1.9 2017-03-28 19:28:13 -07:00
Nicholas Ignoffo dd2c6915f3 Fix bound tools not checking if they're bound (#1114)
(cherry picked from commit 3134f6b)
2017-03-28 19:26:29 -07:00
Nicholas Ignoffo 692c69865a Fix README
(cherry picked from commit 07e025d)
2017-03-28 19:26:17 -07:00
Urey. Xue ad46745879 Update zh_CN.lang (#1052)
* Simp. Chinese translation for SANGVINE SCIENTIEM, round I

* Simp. Chinese translation for SANGVINE SCIENTIEM, round I

Also contains update for main language file

* Amendment I

* Amendment II

* use "/cut" to trick String.split(), so that we could manually split page
* Minor improvements on translation

* Amendment III

* Amendment IV

* Amendment V

* Amendment VI
2017-03-19 09:54:40 -07:00
Nicholas Ignoffo c607a1ccad Rewrite the placer ritual
Includes a slight nerf: Instead of placing the entire 25x25 at the same time, it now places 1 block at a time.

This was brought on by 30 minutes of debugging an intended feature that was mistaken for a bug in #1103

TODO: Rewrite most of the rituals to get rid of any remaining legacy code

(cherry picked from commit a5a47c4)
2017-03-14 20:25:53 -07:00
Nicholas Ignoffo f845c1306d Change lots of recipes to use oredict (#1101)
I probably missed a few

(cherry picked from commit 41c2f37)
2017-03-14 20:24:09 -07:00
Nicholas Ignoffo f4d1bb6ca6 Update changelog + version
(cherry picked from commit 350c7cd)
2017-03-13 16:22:55 -07:00
A_D 2b92151419 fixed inconsistent altar tier readout with seer's sigil (#1094) 2017-03-12 04:07:24 -07:00
Nicholas Ignoffo ed0bde22e8 Update changelog + version
(cherry picked from commit 5e2ef61)
2017-03-07 17:37:12 -08:00
Nicholas Ignoffo 9822a79265 Fix JEI not displaying armor tomes
(cherry picked from commit 4e5bc46)
2017-03-03 17:22:23 -08:00
majikguy 9540df7cf1 Fixed a typo that made stage 4 of the Body Builder upgrade 5x as difficult as stage 5. (#1080) 2017-03-03 16:57:04 -08:00
neconeco2 22354eaa0a Update ja_JP.lang (#1076) 2017-03-02 20:32:55 -08:00
Nicholas Ignoffo acf2d683c7 Update changelog + version
(cherry picked from commit 5e2ef61)
2017-03-02 17:54:12 -08:00
Nicholas Ignoffo 0b93c11733 Sort rituals by component count to avoid conflicts (#1070)
Large rituals can now use, for example, the Serenade of the Nether layout if wanted.
2017-02-27 17:37:30 -08:00
Nicholas Ignoffo fedea85993 Fix Alchemy Table JEI compat being fundamentally wrong (#1069) 2017-02-27 16:44:40 -08:00
Nicholas Ignoffo 719cff06e1 Child mobs are now viable for sacrifice at half the rate 2017-02-25 18:00:17 -08:00
Nicholas Ignoffo 3f24e464e6 Rewrite Hymn of Syphoning for caps
Needs testing and needs to be optimized.
2017-02-25 17:59:10 -08:00
Nicholas Ignoffo c4f92708b1 Dagger of Sacrifice should not work for FakePlayers 2017-02-25 17:16:25 -08:00
Nicholas Ignoffo 32668f70ca Break early if activation crystal isn't bound
Fixes annoying and usually false "not configured correctly" message.

https://redd.it/5vte95
2017-02-23 20:01:07 -08:00
Nicholas Ignoffo 970acd4e69 Fix crash when teleposing Demon Will Crystals (#1062) 2017-02-23 19:45:09 -08:00
Nicholas Ignoffo b55b453e6d Fix crash when using newly created toggle sigils (#1059) 2017-02-22 16:25:06 -08:00
Nicholas Ignoffo e8f0194ed8 Special case RAW will when converting enums 2017-02-22 16:15:45 -08:00
Nicholas Ignoffo a8f8ad575d Update version + changelog
(cherry picked from commit 91aeb4b)
2017-02-21 16:54:12 -08:00
Nicholas Ignoffo 461c4762fe Fix oddity with comparators on Altars (#1058)
*shakes fist at @Arcaratus*
2017-02-21 16:08:34 -08:00
Nicholas Ignoffo 0d4524cafc Fix crash when checking if stacks can combine (#1053) 2017-02-20 14:13:14 -08:00
Nicholas Ignoffo 1fb221c7f0 Fix crash when creating a tank stack with meta > 15 (#1057)
Also finally fixes the tanks so they properly drop themselves.
2017-02-20 14:07:35 -08:00
Nicholas Ignoffo 4ac87f5e8a Update version + changelog 2017-02-19 14:49:36 -08:00
Nicholas Ignoffo f0e3aa6602 Missed a couple files 2017-02-13 19:38:08 -08:00
Nicholas Ignoffo 2ee2cc5ee6 More proper fix for #1019 2017-02-13 19:35:14 -08:00
Nicholas Ignoffo 5bf5fd570d Fix duplicate LA attributes overwriting each other (#1019)
Somebody please save me from this horrible horrible code
2017-02-13 19:09:19 -08:00
Nicholas Ignoffo 9027f767a6 Fix ore doubling potentially adding invalid recipes (#1051) 2017-02-13 17:13:28 -08:00
Nicholas Ignoffo ddb7542827 Implement an inverted MRS that requires an RS signal to function (#1022) 2017-02-13 16:21:54 -08:00
Nicholas Ignoffo 9cbec7dd37 Update README 2017-02-13 16:01:19 -08:00
Nicholas Ignoffo e092161a39 Downgrade tomes are now know that they're downgrades
Also Disoriented is localized finally
2017-02-13 12:57:41 -08:00
Nicholas Ignoffo 2d02bcf37b Fixed JEI localization (#1048) 2017-02-13 12:42:27 -08:00
neconeco2 55949109e1 Update ja_JP.lang (#1049) 2017-02-13 12:12:17 -08:00
Nicholas Ignoffo dea31f5f36 Cache the bound SoulNetwork for rituals
Avoids looking up the map data once or more each tick

(cherry picked from commit c13be9e)
2017-02-12 18:10:22 -08:00
Nicholas Ignoffo 8040d85e97 Update version + changelog 2017-02-12 16:14:10 -08:00
Nicholas Ignoffo bb9347ba5a Fix server crash when adding guide recipe to JEI (#1045) 2017-02-12 16:01:54 -08:00
Nicholas Ignoffo 24f110f790 Update version + changelog
(cherry picked from commit b00fe38)
2017-02-12 11:28:13 -08:00
Nicholas Ignoffo 8a8bff865f IMC API for adding new altar components (#1039)
CC @Drullkus
2017-02-12 01:18:16 -08:00
pksiazek 6802bc5f47 #1036 Fixed Living Armor sacrifical upgrade (#1037) 2017-02-06 16:03:27 -08:00
Nicholas Ignoffo 59920ef34f Bound tools should drain LP (#1033) 2017-02-05 12:42:28 -08:00
Nicholas Ignoffo 13228f61da Temporarily remove item rendering for tank fluid
You cannot bake GL stuff. This is bad. Also it got broken at one point.

I'll re-add this once I remove the need for a TESR.
2017-02-05 11:58:23 -08:00
Nicholas Ignoffo 305e001b15 No-spam messages should be handled on the main thread (#1035) 2017-02-04 22:44:57 -08:00
Nicholas Ignoffo 85a8a12a6f Update mappings 2017-02-04 22:43:19 -08:00
Nicholas Ignoffo 7b21439a03 Remove cross-version proxy
1.9.4 support has been dropped. Extremely little gain for major drawbacks.
2017-02-04 21:43:01 -08:00
Nicholas Ignoffo 6ff12aa0fe Update Blood Tank model and texture
Thanks @InsomniaKitten

Need to rewrite inventory model handler because you *cannot* use GL there.
2017-01-18 19:39:08 -08:00
Nicholas Ignoffo 4c614df15e Empty flasks can now be refilled (#976)
Right click a water source (any block that uses Material.WATER, same as vanilla potions) to refill it. This removes all potion effects. The model will display without the fluid inside as a visual indicator.
2016-12-30 18:27:16 -08:00
Nicholas Ignoffo b6eae2fc67 Fix Expulsion whitelist (#1010) 2016-12-30 17:43:02 -08:00
Nicholas Ignoffo c7f2b7d29c Add current charge to Waila tooltip (#1013) 2016-12-30 17:34:43 -08:00
Nicholas Ignoffo 09007c58b2 Change meteor config NPE with EnderCore to a useful error message 2016-12-30 17:12:38 -08:00
Nicholas Ignoffo fffed0e34c Gold meteor only needs it's version set once 2016-12-30 17:11:00 -08:00
Nicholas Ignoffo 5c1b8b17bd Fix meteor config not generating new defaults 2016-12-30 17:10:36 -08:00
Nicholas Ignoffo a5449d3abc Blacklist sentient spectres from WoS and Sacrifice (#1015)
A config refresh is required for this to take effect. Needs mentioning in changelog.
2016-12-30 16:37:19 -08:00
WayofTime f08307180c Added a null check for the Will getter for the Aura incase the WillChunk somehow does not generate. (#1011) 2016-12-20 19:42:39 -05:00
WayofTime afa3d1ef91 Made it so the book does not give the filling recipe when the Blood Orb recipe is queried. 2016-12-20 19:28:16 -05:00
Nicholas Ignoffo 082d2b8f4d Sigils should draw LP from the bound network, not the user 2016-12-19 17:32:03 -08:00
tartaric_acid ae2ff03547 Update zh_CN file (#1003)
* Update zh_CN file

* Fix some mistakes (WIP)

* Finish all fix

* Fix some mistakes
2016-12-15 21:53:36 -08:00
WayofTime a5a17f6b04 Added Fluid routing to the routing nodes - this is done by using the Fluid Filter and placing a fluid container as the filter. 2016-12-14 14:48:39 -05:00
306 changed files with 4730 additions and 2907 deletions

View file

@ -1,5 +1,5 @@
#
#Sat Apr 02 15:31:00 EDT 2016
#Tue Dec 13 20:41:11 EST 2016
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
org.eclipse.jdt.core.formatter.brace_position_for_block=next_line
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
@ -288,10 +288,10 @@ org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=next_line
eclipse.preferences.version=1
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=next_line
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16

View file

@ -1,31 +1,28 @@
#Blood Magic: Alchemical Wizardry [![](http://cf.way2muchnoise.eu/full_blood-magic_downloads.svg)](https://minecraft.curseforge.com/projects/blood-magic)
# Blood Magic: Alchemical Wizardry [![](http://cf.way2muchnoise.eu/full_blood-magic_downloads.svg)](https://minecraft.curseforge.com/projects/blood-magic)
###Gruesome? Probably. Worth it? Definitely!
###[Downloads](http://minecraft.curseforge.com/mc-mods/224791-blood-magic/files)
### Gruesome? Probably. Worth it? Definitely!
### [Downloads](http://minecraft.curseforge.com/projects/blood-magic/files)
##Information
## Information
Have you ever picked up a magic mod for Minecraft, and thought that it was too tame? Was there not enough danger involved when creating your next high-tech gadget? Bored with all of those peaceful animals just staring at you without a care in the world? Well then, I am glad you came here!
Blood Magic is an arcane art that is practiced by mages who attempt to gather a vast amount of power through utilizing a forbidden material: blood. Even though it does grant a huge amount of power, every single action that is performed with this volatile magic can prove deadly. You have been warned.
##Links
## Links
* Twitter: [@WayofTime](https://twitter.com/WayofTime)
* Wiki: Found at [FTBWiki](http://ftbwiki.org/Blood_Magic)
* [Minecraft Forum Thread](http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1290532-bm)
* [Curseforge](http://minecraft.curseforge.com/mc-mods/224791-blood-magic)
* [Curseforge](http://minecraft.curseforge.com/projects/blood-magic)
* [Donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=J7SNY7L82PQ82)
* [Patreon](https://www.patreon.com/BloodMagic)
##Development Setup
## Development Setup
1. Fork this project to your own Github repository and clone it to your desktop.
2. Navigate to the directory you cloned to. Open a command window there and run `gradlew setupDevWorkspace` then (if you use Eclipse) `gradlew eclipse` or (if you use IDEA) `gradlew idea`.
3. This process will setup [Forge](http://www.minecraftforge.net/forum/), your workspace, and link [MineTweaker](http://minetweaker3.powerofbytes.com/) as a dependency.
4. Open the project in your IDE of choice.
5. Set `../src/api/java` as a source directory.
2. Navigate to the directory you cloned to. Follow the [Forge Documentation](http://mcforge.readthedocs.io/en/latest/gettingstarted/#from-zero-to-modding) (start at step 4) to setup your workspace. If you use IDEA, follow [this set](http://mcforge.readthedocs.io/en/latest/gettingstarted/#terminal-free-intellij-idea-configuration) of steps.
####IntelliJ IDEA extra steps
#### IntelliJ IDEA extra steps
1. Navigate to `File > Settings > Plugins > Browse repositories...`. Search for Lombok and install the plugin.
2. Navigate to `File > Settings > Build, Execution, Deployment > Compiler > Annotation Processors`. Check `Enable annotation processing`.
@ -33,7 +30,7 @@ Blood Magic is an arcane art that is practiced by mages who attempt to gather a
[Setup video](https://www.youtube.com/watch?v=8VEdtQLuLO0&feature=youtu.be) by LexManos. For more information, refer to the [Forge Forums](http://www.minecraftforge.net/forum/index.php/topic,14048.0.html).
##Developing Addons
## Developing Addons
Add to your build.gradle:
@ -49,23 +46,23 @@ Add to your build.gradle:
`<BLOODMAGIC-VERSION>` can be found on CurseForge (or via the Maven itself), check the file name of the version you want.
##Custom Builds
## Custom Builds
**Custom builds are *unsupported*. If you have an issue while using an unofficial build, it is not guaranteed that you will get support.**
####How to make a custom build:
#### How to make a custom build:
1. Clone directly from this repository to your desktop.
2. Navigate to the directory you cloned to. Open a command window there and run `gradlew build`
3. Once it completes, your new build will be found at `../build/libs/BloodMagic-*.jar`. You can ignore the `deobf`, `sources`, and `javadoc` jars.
##License
## License
![CCA4.0](https://licensebuttons.net/l/by/4.0/88x31.png)
Blood Magic: AlchemicalWizardry by WayofTime is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).
##Installation Instructions
## Installation Instructions
This mod requires "Minecraft Forge" in order to operate. It is incredibly easy to download and set up, so might as well get to it!
@ -75,7 +72,7 @@ This mod requires "Minecraft Forge" in order to operate. It is incredibly easy t
3. Place the mod in the **mods** folder of your .minecraft. If you are unsure of where that is located, it is here: `../Users/you/AppData/roaming/.minecraft`.
##FAQ
## FAQ
**Q**: My weak blood orb doesn't show my current LP! Fix it please.

View file

@ -12,7 +12,7 @@ buildscript {
plugins {
id "net.minecraftforge.gradle.forge" version "2.0.2"
id 'com.matthewprenger.cursegradle' version '1.0.7'
id 'com.matthewprenger.cursegradle' version '1.0.9'
id 'io.franzbecker.gradle-lombok' version '1.6'
}
@ -45,27 +45,14 @@ if (new File(projectDir, '.git').exists())
repositories {
maven { url "http://dvs1.progwml6.com/files/maven" }
maven { url "http://mobiusstrip.eu/maven" }
maven { url "http://tehnut.info/maven" }
ivy {
name "Thaumcraft"
artifactPattern "https://dl.dropboxusercontent.com/u/47135879/[module]-[revision]-deobf.[ext]"
}
ivy {
name "Baubles"
artifactPattern "https://dl.dropboxusercontent.com/u/47135879/[module]-1.8.9-[revision]-deobf.[ext]"
}
}
dependencies {
deobfCompile "mezz.jei:jei_${mc_version}:${jei_version}"
deobfCompile "mcp.mobius.waila:Waila:${waila_version}_${mc_version}:dev"
deobfCompile "mcp.mobius.waila:Hwyla:${waila_version}_${mc_version}"
deobfCompile "info.amerifrance.guideapi:Guide-API:${mc_version}-${guideapi_version}"
deobfCompile "info.tehnut.buttons:Buttons:${buttons_version}:api"
// compile name: "Thaumcraft", version: "${mc_version}-${thaumcraft_version}", ext: "jar"
// compile name: 'Baubles', version: "${baubles_version}", ext: 'jar'
}
minecraft {
@ -205,6 +192,8 @@ String getChangelogText() {
def curseRelations = {
optionalLibrary 'just-enough-items-jei'
optionalLibrary 'waila'
optionalLibrary 'hwyla'
optionalLibrary 'buttonz'
requiredLibrary 'guide-api'
}
@ -218,8 +207,6 @@ curseforge {
releaseType = 'beta'
relations curseRelations
addGameVersion '1.10'
addGameVersion '1.10.2'
addArtifact javadocJar
addArtifact sourceJar

View file

@ -1,3 +1,123 @@
------------------------------------------------------
Version 2.1.11
------------------------------------------------------
- Added support for some modded crops (Untested. Theoretically they work)
- Harvestcraft
- Actually Additions
- Extra Utilities
- Fixed permission level for sub-commands
- Large Bloodstone Bricks should receive 4 from a craft
- Fixed Diamond Meteor giving blocks of diamond
- Dynamically calculate Meteor Weight
- Fixed NPE in fluid filter
- Fixed Blood Tank capacity being reset when the chunk reloaded
- Updated russian translation
- Fixed Rune Type capability not registering on physical client
- Updated Sigil of Holding texture so set color is more visible
- Fixed blocks destroyed by bound tools not storing any NBT data
- Fixed Harvest ritual not working on Melons and Pumpkins
- [API] Methods for removing recipes
------------------------------------------------------
Version 2.1.10
------------------------------------------------------
- Fixed malicious clients being able to load arbitrary chunks on the server
- Fixed Bound tools not setting their tool class and harvest level
------------------------------------------------------
Version 2.1.9
------------------------------------------------------
- Blood Magic commands (/bloodmagic) can now be used in Command Blocks
- https://github.com/WayofTime/BloodMagic/issues/1117
- Re-implemented the Soul Fray debuff on death
- No more exploiting sacrifice by killing yourself over and over (again)
- https://github.com/WayofTime/BloodMagic/issues/1118
- Updated Traditional Chinese localization
- https://github.com/WayofTime/BloodMagic/pull/1116
------------------------------------------------------
Version 2.1.8
------------------------------------------------------
- Fixed crash when activing Bound Tools
- https://github.com/WayofTime/BloodMagic/issues/1114
- Updated the Chinese localization
- https://github.com/WayofTime/BloodMagic/pull/1052
- Placer Ritual is now much more performant
- Many recipes have been moved over to support the Ore Dictionary
- https://github.com/WayofTime/BloodMagic/issues/1101
------------------------------------------------------
Version 2.1.7
------------------------------------------------------
- Fixed the Seer's Sigil not using Roman Numerals to display the altar tier
- https://github.com/WayofTime/BloodMagic/pull/1094
------------------------------------------------------
Version 2.1.6
------------------------------------------------------
- Fixed JEI not displaying Armor Tomes
- Fixed Body Builder level 4 being 5x more expensive than level 5
- https://github.com/WayofTime/BloodMagic/pull/1080
- Updated Japanese localization
- https://github.com/WayofTime/BloodMagic/pull/1076
------------------------------------------------------
Version 2.1.5
------------------------------------------------------
- Fixed JEI compat for Alchemy Table recipes
- Fixed (yet another) crash when creating an "invalid" stack of the Blood Tank
- Fixed Demon Will Crystal and Teleposer crashy interaction
- Fixed crash when working with toggleable sigils
------------------------------------------------------
Version 2.1.4
------------------------------------------------------
- Fixed a crash when checking if two items could be combined
- Fixed a crash when attempting to open the Sigil of Holding GUI
- Fixed a crash when somebody made an "invalid" stack of the Blood Tank
- Fixed a crash/hilarity where a Blood Altar would update itself as a Comparator
- Thanks to Arcaratus for causing this. I haven't laughed that hard in a while.
------------------------------------------------------
Version 2.1.3
------------------------------------------------------
- Fixed JEI localization
- Added a new Master Ritual Stone that inverts it's redstone activity
- Fixed Living Armor attributes overriding eachother instead of adding up
- Fixed Ore doubling sometimes adding invalid recipes
- Downgrade tomes are now called Downgrade Tomes
- Added some caching to rituals to (hopefully) increase performance with less world data query-ing
------------------------------------------------------
Version 2.1.2
------------------------------------------------------
- Fixed server crash when adding guide recipe to JEI
------------------------------------------------------
Version 2.1.1-70
------------------------------------------------------
- Fixed the Living Armour Sacrificial Upgrade
- Fixed Bound Tools not draining LP
- Implemented the Blood Tank
- Current recipes are temporary™
- Empty flasks can now be refilled to create a new flask
- Fixed Aura of Expulsion whitelist
- Added the Altar's Charge value to the Waila Tooltip when holding a Seer's Sigil
- Fixed meteor config error caused by EnderCore reloading configs early into startup
- Fixed meteor config not generating new entries
- Blacklisted Sentient Spectres from the Well of Suffering
- Fixed Sigils drawing from the user instead of the bound network
- Added Fluid routing to the routing nodes - this is done by using the Fluid Filter and placing a fluid container as the filter.
- Made it so the book does not give the filling recipe when the Blood Orb recipe is queried.
- Added a null check for the Will getter for the Aura incase the WillChunk somehow does not generate.
- [API] Added a new IMC API for modders to register their blocks as an altar component.
- Example: Chisel Glowstone can now be used for the Tier 3 caps (once Chisel implements it)
------------------------------------------------------
Version 2.1.0-69
------------------------------------------------------

View file

@ -1,15 +1,13 @@
mod_name=BloodMagic
package_group=com.wayoftime.bloodmagic
mod_version=2.1.0
mc_version=1.9.4
forge_version=12.17.0.1957
mod_version=2.1.11
mc_version=1.10.2
forge_version=12.18.3.2221
curse_id=224791
mappings_version=snapshot_20160518
mappings_version=stable_29
jei_version=3.6.8.225
waila_version=1.7.0-B3
thaumcraft_version=5.1.5
baubles_version=1.1.3.0
guideapi_version=2.0.0-37
jei_version=3.14.4.404
waila_version=1.8.9-B23
guideapi_version=2.0.2-45
buttons_version=1.10.2-0.0.3-3

View file

@ -1,23 +1,17 @@
package WayofTime.bloodmagic;
import java.io.File;
import java.util.Map;
import WayofTime.bloodmagic.api.registry.RitualRegistry;
import WayofTime.bloodmagic.meteor.MeteorConfigHandler;
import lombok.Getter;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.launchwrapper.Launch;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInterModComms;
import net.minecraftforge.fml.common.event.FMLModIdMappingEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.event.*;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import WayofTime.bloodmagic.annot.Handler;
import WayofTime.bloodmagic.api.Constants;
@ -25,7 +19,6 @@ import WayofTime.bloodmagic.api.util.helper.LogHelper;
import WayofTime.bloodmagic.client.gui.GuiHandler;
import WayofTime.bloodmagic.command.CommandBloodMagic;
import WayofTime.bloodmagic.compat.ICompatibility;
import WayofTime.bloodmagic.compat.minecraft.ICrossVersionProxy;
import WayofTime.bloodmagic.network.BloodMagicPacketHandler;
import WayofTime.bloodmagic.proxy.CommonProxy;
import WayofTime.bloodmagic.registry.ModArmourTrackers;
@ -42,8 +35,6 @@ import WayofTime.bloodmagic.structures.ModDungeons;
import WayofTime.bloodmagic.util.Utils;
import WayofTime.bloodmagic.util.handler.IMCHandler;
import com.google.common.collect.ImmutableMap;
@Mod(modid = Constants.Mod.MODID, name = Constants.Mod.NAME, version = Constants.Mod.VERSION, dependencies = Constants.Mod.DEPEND, guiFactory = "WayofTime.bloodmagic.client.gui.config.ConfigGuiFactory")
@Getter
public class BloodMagic
@ -76,34 +67,13 @@ public class BloodMagic
{
return true;
}
};
}.setNoTitle().setBackgroundImageName("upgrade_tomes.png");
@Getter
private static boolean isDev = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
@Getter
private static ICrossVersionProxy crossVersionProxy;
private static final Map<String, String> PROXY_MAP = ImmutableMap.of("1.9.4", "WayofTime.bloodmagic.compat.minecraft.CrossVersionProxy19", "1.10", "WayofTime.bloodmagic.compat.minecraft.CrossVersionProxy110", "1.10.2", "WayofTime.bloodmagic.compat.minecraft.CrossVersionProxy110");
static
{
try
{
String mcVersion = (String) Loader.class.getDeclaredField("MC_VERSION").get(null);
if (!PROXY_MAP.containsKey(mcVersion))
throw new IllegalStateException("Blood Magic couldn't find a cross version proxy!");
Class proxyClass = Class.forName(PROXY_MAP.get(mcVersion));
crossVersionProxy = (ICrossVersionProxy) proxyClass.newInstance();
}
catch (Exception e)
{
throw new IllegalArgumentException("Blood Magic could not find a cross version proxy!", e);
}
tabUpgradeTome.setNoTitle().setBackgroundImageName("upgrade_tomes.png");
FluidRegistry.enableUniversalBucket();
}
@ -155,6 +125,11 @@ public class BloodMagic
proxy.postInit();
}
@Mod.EventHandler
public void loadComplete(FMLLoadCompleteEvent event) {
RitualRegistry.orderLookupList();
}
@Mod.EventHandler
public void modMapping(FMLModIdMappingEvent event)
{

View file

@ -198,11 +198,11 @@ public class ConfigHandler
category = "Well of Suffering Blacklist";
config.addCustomCategoryComment(category, "Entity blacklisting from WoS");
wellOfSufferingBlacklist = Arrays.asList(config.getStringList("wellOfSufferingBlacklist", category, new String[] { "EntityArmorStand" }, "Use the class name of the Entity to blacklist it from usage.\nIE: EntityWolf, EntityWitch, etc"));
wellOfSufferingBlacklist = Arrays.asList(config.getStringList("wellOfSufferingBlacklist", category, new String[] { "EntityArmorStand", "EntitySentientSpecter" }, "Use the class name of the Entity to blacklist it from usage.\nIE: EntityWolf, EntityWitch, etc"));
category = "Blood Altar Sacrificial Values";
config.addCustomCategoryComment(category, "Entity Sacrificial Value Settings");
entitySacrificeValuesList = config.getStringList("entitySacrificeLP:HPValues", category, new String[] { "EntityVillager;100", "EntitySlime;15", "EntityEnderman;10", "EntityCow;100", "EntityChicken;100", "EntityHorse;100", "EntitySheep;100", "EntityWolf;100", "EntityOcelot;100", "EntityPig;100", "EntityRabbit;100", "EntityArmorStand;0" }, "Used to edit the amount of LP gained per HP sacrificed for the given entity.\nSetting an entity to 0 effectively blacklists it.\nIf a mod modifies an entity via the API, it will take precedence over this config.\nSyntax: EntityClassName;LPPerHP");
entitySacrificeValuesList = config.getStringList("entitySacrificeLP:HPValues", category, new String[] { "EntityVillager;100", "EntitySlime;15", "EntityEnderman;10", "EntityCow;100", "EntityChicken;100", "EntityHorse;100", "EntitySheep;100", "EntityWolf;100", "EntityOcelot;100", "EntityPig;100", "EntityRabbit;100", "EntityArmorStand;0", "EntitySentientSpecter;0" }, "Used to edit the amount of LP gained per HP sacrificed for the given entity.\nSetting an entity to 0 effectively blacklists it.\nIf a mod modifies an entity via the API, it will take precedence over this config.\nSyntax: EntityClassName;LPPerHP");
buildEntitySacrificeValues();
category = "Potions";

View file

@ -189,7 +189,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect
{
if (ent instanceof EntitySlime)
{
ent.faceEntity(getTarget(ent.worldObj, pos), 10.0F, 20.0F);
ent.faceEntity(getTarget(ent.getEntityWorld(), pos), 10.0F, 20.0F);
} else if (ent instanceof EntitySilverfish)
{
if (counter < 10)
@ -197,7 +197,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect
return;
}
EntitySilverfish sf = (EntitySilverfish) ent;
Path pathentity = getPathEntityToEntity(ent, getTarget(ent.worldObj, pos), getRange());
Path pathentity = getPathEntityToEntity(ent, getTarget(ent.getEntityWorld(), pos), getRange());
sf.getNavigator().setPath(pathentity, sf.getAIMoveSpeed());
} else if (ent instanceof EntityBlaze)
{
@ -221,7 +221,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect
// ent.setAttackTarget(target);
} else if (ent instanceof EntityEnderman)
{
((EntityEnderman) ent).setAttackTarget(getTarget(ent.worldObj, pos));
((EntityEnderman) ent).setAttackTarget(getTarget(ent.getEntityWorld(), pos));
}
}
@ -234,7 +234,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect
if (distance > 2)
{
EntityMob mod = (EntityMob) ent;
mod.faceEntity(getTarget(ent.worldObj, pos), 180, 0);
mod.faceEntity(getTarget(ent.getEntityWorld(), pos), 180, 0);
mod.moveEntityWithHeading(0, 0.3f);
if (mod.posY < pos.getY())
{
@ -248,12 +248,12 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect
public Path getPathEntityToEntity(Entity entity, Entity targetEntity, float range)
{
int targX = MathHelper.floor_double(targetEntity.posX);
int targY = MathHelper.floor_double(targetEntity.posY + 1.0D);
int targZ = MathHelper.floor_double(targetEntity.posZ);
int targX = MathHelper.floor(targetEntity.posX);
int targY = MathHelper.floor(targetEntity.posY + 1.0D);
int targZ = MathHelper.floor(targetEntity.posZ);
PathFinder pf = new PathFinder(new WalkNodeProcessor());
return pf.findPath(targetEntity.worldObj, (EntityLiving) entity, new BlockPos(targX, targY, targZ), range);
return pf.findPath(targetEntity.getEntityWorld(), (EntityLiving) entity, new BlockPos(targX, targY, targZ), range);
}
private boolean trackMob(BlockPos pos, EntityLiving ent)
@ -261,7 +261,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect
//TODO: Figure out if this crud is needed
if (useSetTarget(ent))
{
((EntityMob) ent).setAttackTarget(getTarget(ent.worldObj, pos));
((EntityMob) ent).setAttackTarget(getTarget(ent.getEntityWorld(), pos));
return true;
} else if (useSpecialCase(ent))
{
@ -328,7 +328,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect
}
cancelCurrentTasks(ent);
ent.tasks.addTask(0, new AttractTask(ent, getTarget(ent.worldObj, pos), pos));
ent.tasks.addTask(0, new AttractTask(ent, getTarget(ent.getEntityWorld(), pos), pos));
return true;
}
@ -364,13 +364,13 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect
{
if (ent instanceof EntitySlime)
{
ent.faceEntity(getTarget(ent.worldObj, pos), 10.0F, 20.0F);
// ent.setAttackTarget(getTarget(ent.worldObj, pos));
ent.faceEntity(getTarget(ent.getEntityWorld(), pos), 10.0F, 20.0F);
// ent.setAttackTarget(getTarget(ent.getEntityWorld(), pos));
return true;
} else if (ent instanceof EntitySilverfish)
{
EntitySilverfish es = (EntitySilverfish) ent;
Path pathentity = getPathEntityToEntity(ent, getTarget(ent.worldObj, pos), getRange());
Path pathentity = getPathEntityToEntity(ent, getTarget(ent.getEntityWorld(), pos), getRange());
es.getNavigator().setPath(pathentity, es.getAIMoveSpeed());
return true;
} else if (ent instanceof EntityBlaze)
@ -439,7 +439,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect
{
boolean res = false;
//TODO:
TileEntity te = mob.worldObj.getTileEntity(coord);
TileEntity te = mob.getEntityWorld().getTileEntity(coord);
if (te instanceof TileAlchemyArray)
{
res = true;

View file

@ -40,7 +40,7 @@ public class AlchemyArrayEffectBinding extends AlchemyArrayEffectCrafting
ItemStack output = outputStack.copy();
EntityItem outputEntity = new EntityItem(tile.getWorld(), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, output);
tile.getWorld().spawnEntityInWorld(outputEntity);
tile.getWorld().spawnEntity(outputEntity);
return true;
}
@ -60,7 +60,7 @@ public class AlchemyArrayEffectBinding extends AlchemyArrayEffectCrafting
double dispZ = -distance * Math.cos(angle);
EntityLightningBolt lightning = new EntityLightningBolt(world, pos.getX() + dispX, pos.getY(), pos.getZ() + dispZ, true);
world.spawnEntityInWorld(lightning);
world.spawnEntity(lightning);
}
}

View file

@ -170,7 +170,7 @@ public class AlchemyArrayEffectSkeletonTurret extends AlchemyArrayEffect
{
boolean res = false;
//TODO:
TileEntity te = mob.worldObj.getTileEntity(coord);
TileEntity te = mob.getEntityWorld().getTileEntity(coord);
if (te instanceof TileAlchemyArray)
{
res = true;

View file

@ -129,9 +129,12 @@ public class BloodAltar implements IFluidHandler
EnumAltarComponent component = ((IAltarComponent) worldBlock.getBlock()).getType(world, worldBlock.getState(), componentPos);
if (component == null || component != altarComponent.getComponent())
return false;
} else if (worldBlock.getBlock() != Utils.getBlockForComponent(altarComponent.getComponent()))
} else if (worldBlock.getBlock() != Utils.getBlockForComponent(altarComponent.getComponent())) // Special case Vanilla
{
return false;
} else if (BloodMagicAPI.getAltarComponents().get(worldBlock.getState()) != null) // Mod compat
{
return BloodMagicAPI.getAltarComponents().get(worldBlock.getState()) == altarComponent.getComponent();
}
} else
{
@ -397,7 +400,7 @@ public class BloodAltar implements IFluidHandler
{
BlockPos newPos = pos.offset(facing);
IBlockState block = world.getBlockState(newPos);
block.getBlock().onNeighborChange(world, pos, newPos);
block.getBlock().onNeighborChange(world, newPos, pos);
}
}
if (internalCounter % (Math.max(20 - this.accelerationUpgrades, 1)) == 0)

View file

@ -1,9 +1,11 @@
package WayofTime.bloodmagic.api;
import WayofTime.bloodmagic.api.altar.EnumAltarComponent;
import WayofTime.bloodmagic.api.util.helper.LogHelper;
import lombok.Getter;
import lombok.Setter;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -40,6 +42,8 @@ public class BloodMagicAPI
private static final Map<String, Integer> entitySacrificeValues = new HashMap<String, Integer>();
@Getter
private static final ArrayList<Block> greenGroveBlacklist = new ArrayList<Block>();
@Getter
private static final Map<IBlockState, EnumAltarComponent> altarComponents = new HashMap<IBlockState, EnumAltarComponent>();
@Getter
@Setter
@ -261,4 +265,24 @@ public class BloodMagicAPI
if (!greenGroveBlacklist.contains(block))
greenGroveBlacklist.add(block);
}
/**
* Marks an IBlockState as a specific {@link EnumAltarComponent} without needing to implement
* {@link WayofTime.bloodmagic.api.altar.IAltarComponent} on the block.
*
* IMC:
* {@code FMLInterModComs.sendMessage("BloodMagic", "altarComponent", "domain:name:meta:component")}
* Example:
* {@code FMLInterModComs.sendMessage("BloodMagic", "altarComponent", "minecraft:glowstone:0:GLOWSTONE")}
*
* @param state
* - The IBlockState for this component
* @param altarComponent
* - The EnumAltarComponent for this state
*/
public static void addAltarComponent(IBlockState state, EnumAltarComponent altarComponent)
{
if (!altarComponents.containsKey(state))
altarComponents.put(state, altarComponent);
}
}

View file

@ -207,6 +207,7 @@ public class Constants
NODE_ROUTER("ItemNodeRouter"),
RITUAL_DIVINER("ItemRitualDiviner"),
ROUTER_FILTER("ItemRouterFilter"),
FLUID_ROUTER_FILTER("ItemFluidRouterFilter"),
SACRIFICIAL_DAGGER("ItemSacrificialDagger"),
SACRIFICE_PACK("ItemPackSacrifice"),
SELF_SACRIFICE_PACK("ItemPackSelfSacrifice"),

View file

@ -8,6 +8,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
@ -51,14 +52,15 @@ public class ItemStackWrapper
this(blockStack.getBlock(), 1, blockStack.getMeta());
}
@Nullable
public static ItemStackWrapper getHolder(ItemStack stack)
{
if (stack == null)
{
return null;
}
return new ItemStackWrapper(stack.getItem(), stack.stackSize, stack.getItemDamage());
ItemStackWrapper wrapper = new ItemStackWrapper(stack.getItem(), stack.stackSize, stack.getItemDamage());
wrapper.setNbtTag(stack.getTagCompound());
return wrapper;
}
public ItemStack toStack()

View file

@ -47,7 +47,7 @@ public class AlchemyArrayEffectCrafting extends AlchemyArrayEffect
EntityItem outputEntity = new EntityItem(tile.getWorld(), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, output);
tile.getWorld().spawnEntityInWorld(outputEntity);
tile.getWorld().spawnEntity(outputEntity);
return true;
}

View file

@ -5,6 +5,7 @@ import WayofTime.bloodmagic.api.iface.IActivatable;
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
import com.google.common.base.Strings;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@ -64,7 +65,10 @@ public class ItemSigilToggleable extends ItemSigil implements IActivatable
@Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
{
return (NetworkHelper.getSoulNetwork(player).syphonAndDamage(player, getLpUsed()) && onSigilUse(stack, player, world, pos, side, hitX, hitY, hitZ)) ? EnumActionResult.SUCCESS : EnumActionResult.FAIL;
if (Strings.isNullOrEmpty(getOwnerUUID(stack)) || player.isSneaking()) // Make sure Sigils are bound before handling. Also ignores while toggling state
return EnumActionResult.PASS;
return (NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).syphonAndDamage(player, getLpUsed()) && onSigilUse(stack, player, world, pos, side, hitX, hitY, hitZ)) ? EnumActionResult.SUCCESS : EnumActionResult.FAIL;
}
public boolean onSigilUse(ItemStack itemStack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ)
@ -79,7 +83,7 @@ public class ItemSigilToggleable extends ItemSigil implements IActivatable
{
if (entityIn.ticksExisted % 100 == 0)
{
if (!NetworkHelper.getSoulNetwork((EntityPlayerMP) entityIn).syphonAndDamage((EntityPlayer) entityIn, getLpUsed()))
if (!NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).syphonAndDamage((EntityPlayer) entityIn, getLpUsed()))
{
setActivatedState(stack, false);
}

View file

@ -70,13 +70,13 @@ public class SoulNetwork extends WorldSavedData
if (FMLCommonHandler.instance().getMinecraftServerInstance() == null)
return 0;
World world = FMLCommonHandler.instance().getMinecraftServerInstance().worldServers[0];
SoulNetwork data = (SoulNetwork) world.loadItemData(SoulNetwork.class, event.ownerNetwork);
World world = FMLCommonHandler.instance().getMinecraftServerInstance().worlds[0];
SoulNetwork data = (SoulNetwork) world.loadData(SoulNetwork.class, event.ownerNetwork);
if (data == null)
{
data = new SoulNetwork(event.ownerNetwork);
world.setItemData(event.ownerNetwork, data);
world.setData(event.ownerNetwork, data);
}
int currEss = data.getCurrentEssence();
@ -129,7 +129,7 @@ public class SoulNetwork extends WorldSavedData
{
if (user != null)
{
if (user.worldObj.isRemote)
if (user.getEntityWorld().isRemote)
return false;
if (!Strings.isNullOrEmpty(mapName))

View file

@ -4,7 +4,10 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import com.google.common.collect.ImmutableList;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -12,6 +15,8 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
@EqualsAndHashCode
@ToString
public class AlchemyTableRecipe
{
protected ItemStack output = null;

View file

@ -1,6 +1,8 @@
package WayofTime.bloodmagic.api.recipe;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -12,6 +14,8 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@EqualsAndHashCode
@ToString
public class TartaricForgeRecipe
{
protected ItemStack output = null;

View file

@ -74,13 +74,7 @@ public class AlchemyArrayRecipeRegistry
}
}
if (circleRenderer == null)
{
recipes.put(input, new AlchemyArrayRecipe(input, catalystStack, arrayEffect, defaultRenderer));
} else
{
recipes.put(input, new AlchemyArrayRecipe(input, catalystStack, arrayEffect, circleRenderer));
}
recipes.put(input, new AlchemyArrayRecipe(input, catalystStack, arrayEffect, circleRenderer == null ? defaultRenderer : circleRenderer));
}
public static AlchemyArrayEffect getAlchemyArrayEffect(String key)
@ -116,7 +110,7 @@ public class AlchemyArrayRecipeRegistry
}
/**
* @param Output
* @param stack
* of the recipe
* @return an array of two ItemStacks - first index is the input stack,
* second is the catalyst stack. Returns {null, null} if no recipe

View file

@ -22,6 +22,11 @@ public class AlchemyTableRecipeRegistry
registerRecipe(new AlchemyTableRecipe(outputStack, lpDrained, ticksRequired, tierRequired, objects));
}
public static void removeRecipe(AlchemyTableRecipe recipe)
{
recipeList.remove(recipe);
}
public static AlchemyTableRecipe getMatchingRecipe(List<ItemStack> itemList, World world, BlockPos pos)
{
for (AlchemyTableRecipe recipe : recipeList)

View file

@ -42,6 +42,11 @@ public class AltarRecipeRegistry
registerRecipe(new AltarRecipe(orbStack, orbStack, tier, maxForOrb, consumeRate, drainRate, true));
}
public static void removeRecipe(AltarRecipe altarRecipe)
{
recipes.remove(altarRecipe.getInput());
}
/**
* Gets the recipe that the provided input is registered to.
*

View file

@ -5,20 +5,21 @@ import WayofTime.bloodmagic.api.ritual.Ritual;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
public class RitualRegistry
{
public static final Map<Ritual, Boolean> enabledRituals = new HashMap<Ritual, Boolean>();
private static final BiMap<String, Ritual> registry = HashBiMap.create();
private static final List<String> lookupList = new ArrayList<String>();
/**
* Ordered list for actions that depend on the order that the rituals were
* registered in
*/
private static final ArrayList<String> orderedIdList = new ArrayList<String>();
private static boolean locked;
/**
* The safe way to register a new Ritual.
*
@ -29,6 +30,13 @@ public class RitualRegistry
*/
public static void registerRitual(Ritual ritual, String id, boolean enabled)
{
if (locked)
{
BloodMagicAPI.getLogger().error("This registry has been locked. Please register your ritual earlier.");
BloodMagicAPI.getLogger().error("If you reflect this, I will hunt you down. - TehNut");
return;
}
if (ritual != null)
{
if (registry.containsKey(id))
@ -107,7 +115,7 @@ public class RitualRegistry
public static ArrayList<String> getIds()
{
return new ArrayList<String>(registry.keySet());
return new ArrayList<String>(lookupList);
}
public static ArrayList<String> getOrderedIds()
@ -119,4 +127,21 @@ public class RitualRegistry
{
return new ArrayList<Ritual>(registry.values());
}
public static void orderLookupList()
{
locked = true; // Lock registry so no no rituals can be registered
lookupList.clear(); // Make sure it's empty
lookupList.addAll(registry.keySet());
Collections.sort(lookupList, new Comparator<String>()
{
@Override
public int compare(String o1, String o2)
{
Ritual ritual1 = registry.get(o1);
Ritual ritual2 = registry.get(o2);
return ritual1.getComponents().size() > ritual2.getComponents().size() ? -1 : 0; // Put earlier if bigger
}
});
}
}

View file

@ -22,6 +22,11 @@ public class TartaricForgeRecipeRegistry
registerRecipe(new TartaricForgeRecipe(outputStack, minimulSouls, drain, objects));
}
public static void removeRecipe(TartaricForgeRecipe recipe)
{
recipeList.remove(recipe);
}
public static TartaricForgeRecipe getMatchingRecipe(List<ItemStack> itemList, World world, BlockPos pos)
{
for (TartaricForgeRecipe recipe : recipeList)

View file

@ -2,6 +2,7 @@ package WayofTime.bloodmagic.api.ritual;
import java.util.List;
import WayofTime.bloodmagic.api.saving.SoulNetwork;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
@ -18,6 +19,8 @@ public interface IMasterRitualStone
{
String getOwner();
SoulNetwork getOwnerNetwork();
boolean activateRitual(ItemStack activationCrystal, EntityPlayer activator, Ritual ritual);
void performRitual(World world, BlockPos pos);

View file

@ -78,7 +78,7 @@ public class SoulNetwork implements INBTSerializable<NBTTagCompound>
{
if (user != null)
{
if (user.worldObj.isRemote)
if (user.getEntityWorld().isRemote)
return false;
if (!Strings.isNullOrEmpty(playerId.toString()))

View file

@ -33,6 +33,6 @@ public class TeleporterBloodMagic extends Teleporter
@Override
public void placeInPortal(Entity entity, float rotationYaw)
{
entity.setLocationAndAngles(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY) + 2, MathHelper.floor_double(entity.posZ), entity.rotationYaw, entity.rotationPitch);
entity.setLocationAndAngles(MathHelper.floor(entity.posX), MathHelper.floor(entity.posY) + 2, MathHelper.floor(entity.posZ), entity.rotationYaw, entity.rotationPitch);
}
}

View file

@ -110,7 +110,9 @@ public class NetworkHelper
* - Amount of LP to syphon
*
* @return - Whether the action should be performed.
* @deprecated Use {@link #getSoulNetwork(EntityPlayer)} and {@link SoulNetwork#syphonAndDamage(EntityPlayer, int)}
*/
@Deprecated
public static boolean syphonAndDamage(SoulNetwork soulNetwork, EntityPlayer user, int toSyphon)
{

View file

@ -26,7 +26,7 @@ public class PlayerHelper
public static String getUsernameFromPlayer(EntityPlayer player)
{
return player.worldObj.isRemote ? "" : UsernameCache.getLastKnownUsername(getUUIDFromPlayer(player));
return player.getEntityWorld().isRemote ? "" : UsernameCache.getLastKnownUsername(getUUIDFromPlayer(player));
}
public static EntityPlayer getPlayerFromUsername(String username)

View file

@ -2,6 +2,7 @@ package WayofTime.bloodmagic.api.util.helper;
import WayofTime.bloodmagic.ConfigHandler;
import WayofTime.bloodmagic.api.altar.IBloodAltar;
import WayofTime.bloodmagic.api.event.SacrificeKnifeUsedEvent;
import WayofTime.bloodmagic.registry.ModPotions;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@ -10,6 +11,7 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
public class PlayerSacrificeHelper
{
@ -70,8 +72,13 @@ public class PlayerSacrificeHelper
if (health > maxHealth / 10.0)
{
float sacrificedHealth = health - maxHealth / 10.0f;
int lpAdded = (int) (sacrificedHealth * ConfigHandler.sacrificialDaggerConversion * getModifier(amount));
if (findAndFillAltar(player.getEntityWorld(), player, (int) (sacrificedHealth * ConfigHandler.sacrificialDaggerConversion * getModifier(amount)), false))
SacrificeKnifeUsedEvent evt = new SacrificeKnifeUsedEvent(player, true, true, (int) sacrificedHealth, lpAdded);
if (MinecraftForge.EVENT_BUS.post(evt))
return false;
if (findAndFillAltar(player.getEntityWorld(), player, evt.lpAdded, false))
{
player.setHealth(maxHealth / 10.0f);
setPlayerIncense(player, 0);

View file

@ -81,7 +81,7 @@ public class BlockAlchemyArray extends BlockContainer
}
@Override
public boolean isVisuallyOpaque()
public boolean causesSuffocation()
{
return false;
}

View file

@ -60,7 +60,7 @@ public class BlockAlchemyTable extends BlockContainer
}
@Override
public boolean isVisuallyOpaque()
public boolean causesSuffocation()
{
return false;
}
@ -107,7 +107,7 @@ public class BlockAlchemyTable extends BlockContainer
@Override
protected BlockStateContainer createBlockState()
{
return new BlockStateContainer(this, new IProperty[] { DIRECTION, INVISIBLE });
return new BlockStateContainer(this, DIRECTION, INVISIBLE);
}
@Override

View file

@ -119,7 +119,7 @@ public class BlockAltar extends BlockContainer implements IVariantProvider, IDoc
}
@Override
public boolean isVisuallyOpaque()
public boolean causesSuffocation()
{
return false;
}

View file

@ -70,7 +70,7 @@ public class BlockBloodLight extends Block
}
@Override
public boolean isVisuallyOpaque()
public boolean causesSuffocation()
{
return false;
}
@ -97,7 +97,7 @@ public class BlockBloodLight extends Block
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand)
{
EntityPlayerSP playerSP = Minecraft.getMinecraft().thePlayer;
EntityPlayerSP playerSP = Minecraft.getMinecraft().player;
if (rand.nextInt(3) != 0)
{

View file

@ -5,6 +5,7 @@ import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.block.base.BlockInteger;
import WayofTime.bloodmagic.client.IVariantProvider;
import WayofTime.bloodmagic.tile.TileBloodTank;
import com.google.common.collect.Lists;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
@ -88,6 +89,17 @@ public class BlockBloodTank extends BlockInteger implements IVariantProvider
return false;
}
@Override
public void harvestBlock(World world, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity tile, ItemStack stack) {
super.harvestBlock(world, player, pos, state, tile, stack);
world.setBlockToAir(pos);
}
@Override
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) {
return willHarvest || super.removedByPlayer(state, world, pos, player, willHarvest);
}
@Override
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
{
@ -114,34 +126,36 @@ public class BlockBloodTank extends BlockInteger implements IVariantProvider
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState blockState, int fortune)
{
ArrayList<ItemStack> list = new ArrayList<ItemStack>();
List<ItemStack> list = Lists.newArrayList();
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileBloodTank)
{
TileBloodTank bloodTank = (TileBloodTank) tile;
ItemStack drop = new ItemStack(this);
ItemStack drop = new ItemStack(this, 1, bloodTank.getBlockMetadata());
NBTTagCompound tag = new NBTTagCompound();
bloodTank.serialize(tag);
if (bloodTank.getTank().getFluid() != null)
bloodTank.getTank().getFluid().writeToNBT(tag);
drop.setTagCompound(tag);
drop.setItemDamage(getMetaFromState(blockState));
list.add(drop);
}
return list;
}
@Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState blockState, EntityLivingBase placer, ItemStack stack)
{
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileBloodTank)
{
TileBloodTank bloodTank = (TileBloodTank) tile;
NBTTagCompound tag = stack.getTagCompound();
if (tag != null)
{
((TileBloodTank) tile).deserialize(tag);
blockState.withProperty(getProperty(), stack.getMetadata());
FluidStack fluidStack = FluidStack.loadFluidStackFromNBT(tag);
bloodTank.getTank().setFluid(fluidStack);
}
}

View file

@ -55,7 +55,7 @@ public class BlockDemonCrucible extends BlockContainer implements IVariantProvid
}
@Override
public boolean isVisuallyOpaque()
public boolean causesSuffocation()
{
return false;
}

View file

@ -112,7 +112,7 @@ public class BlockDemonCrystal extends BlockContainer
}
@Override
public boolean isVisuallyOpaque()
public boolean causesSuffocation()
{
return false;
}
@ -143,13 +143,13 @@ public class BlockDemonCrystal extends BlockContainer
@Override
public int getMetaFromState(IBlockState state)
{
return ((EnumDemonWillType) state.getValue(TYPE)).ordinal();
return state.getValue(TYPE).ordinal();
}
@Override
protected BlockStateContainer createBlockState()
{
return new BlockStateContainer(this, new IProperty[] { TYPE, AGE, ATTACHED });
return new BlockStateContainer(this, TYPE, AGE, ATTACHED);
}
@Override
@ -161,12 +161,16 @@ public class BlockDemonCrystal extends BlockContainer
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state)
{
TileDemonCrystal tile = (TileDemonCrystal) world.getTileEntity(pos);
EnumDemonWillType type = state.getValue(TYPE);
int number = tile.getCrystalCount();
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileDemonCrystal) {
EnumDemonWillType type = state.getValue(TYPE);
int number = ((TileDemonCrystal) tile).getCrystalCount();
spawnAsEntity(world, pos, getItemStackDropped(type, number));
world.removeTileEntity(pos);
spawnAsEntity(world, pos, getItemStackDropped(type, number));
world.removeTileEntity(pos);
}
super.breakBlock(world, pos, state);
}
public static ItemStack getItemStackDropped(EnumDemonWillType type, int crystalNumber)

View file

@ -61,7 +61,7 @@ public class BlockDemonCrystallizer extends BlockContainer implements IVariantPr
}
@Override
public boolean isVisuallyOpaque()
public boolean causesSuffocation()
{
return false;
}

View file

@ -54,7 +54,7 @@ public class BlockDemonPylon extends BlockContainer implements IVariantProvider
}
@Override
public boolean isVisuallyOpaque()
public boolean causesSuffocation()
{
return false;
}

View file

@ -58,7 +58,7 @@ public class BlockDimensionalPortal extends BlockIntegerContainer
}
@Override
public boolean isVisuallyOpaque()
public boolean causesSuffocation()
{
return false;
}

View file

@ -61,7 +61,7 @@ public class BlockIncenseAltar extends BlockContainer implements IVariantProvide
}
@Override
public boolean isVisuallyOpaque()
public boolean causesSuffocation()
{
return false;
}

View file

@ -77,7 +77,7 @@ public class BlockInversionPillar extends BlockEnumContainer<EnumSubWillType> im
}
@Override
public boolean isVisuallyOpaque()
public boolean causesSuffocation()
{
return false;
}

View file

@ -52,7 +52,7 @@ public class BlockInversionPillarEnd extends BlockEnum<EnumInversionCap> impleme
}
@Override
public boolean isVisuallyOpaque()
public boolean causesSuffocation()
{
return false;
}

View file

@ -196,7 +196,7 @@ public class BlockMimic extends BlockEnumContainer<EnumMimic> implements IVarian
}
@Override
public boolean isVisuallyOpaque()
public boolean causesSuffocation()
{
return false;
}

View file

@ -54,7 +54,7 @@ public class BlockPhantom extends BlockContainer implements IVariantProvider
}
@Override
public boolean isVisuallyOpaque()
public boolean causesSuffocation()
{
return false;
}

View file

@ -5,6 +5,8 @@ import java.util.List;
import javax.annotation.Nullable;
import WayofTime.bloodmagic.api.iface.IBindable;
import com.google.common.base.Strings;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
@ -59,26 +61,31 @@ public class BlockRitualController extends BlockEnumContainer<EnumRitualControll
{
TileEntity tile = world.getTileEntity(pos);
if (getMetaFromState(state) == 0 && tile instanceof TileMasterRitualStone)
if (state.getValue(getProperty()) != EnumRitualController.IMPERFECT && tile instanceof TileMasterRitualStone)
{
if (heldItem != null && heldItem.getItem() == ModItems.ACTIVATION_CRYSTAL)
{
IBindable bindable = (IBindable) heldItem.getItem();
if (Strings.isNullOrEmpty(bindable.getOwnerName(heldItem)))
return false;
String key = RitualHelper.getValidRitual(world, pos);
EnumFacing direction = RitualHelper.getDirectionOfRitual(world, pos, key);
// TODO: Give a message stating that this ritual is not a valid
// ritual.
// TODO: Give a message stating that this ritual is not a valid ritual.
if (!key.isEmpty() && direction != null && RitualHelper.checkValidRitual(world, pos, key, direction))
{
if (((TileMasterRitualStone) tile).activateRitual(heldItem, player, RitualRegistry.getRitualForId(key)))
{
((TileMasterRitualStone) tile).setDirection(direction);
if (state.getValue(getProperty()) == EnumRitualController.INVERTED)
((TileMasterRitualStone) tile).setInverted(true);
}
} else
{
ChatUtil.sendNoSpamUnloc(player, "chat.BloodMagic.ritual.notValid");
}
}
} else if (getMetaFromState(state) == 1 && tile instanceof TileImperfectRitualStone)
} else if (state.getValue(getProperty()) == EnumRitualController.IMPERFECT && tile instanceof TileImperfectRitualStone)
{
IBlockState determinerState = world.getBlockState(pos.up());
@ -109,13 +116,15 @@ public class BlockRitualController extends BlockEnumContainer<EnumRitualControll
}
@Override
public boolean hasTileEntity(IBlockState state) {
public boolean hasTileEntity(IBlockState state)
{
return true;
}
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
return state.getValue(getProperty()) == EnumRitualController.MASTER ? new TileMasterRitualStone() : new TileImperfectRitualStone();
public TileEntity createTileEntity(World world, IBlockState state)
{
return state.getValue(getProperty()) != EnumRitualController.IMPERFECT ? new TileMasterRitualStone() : new TileImperfectRitualStone();
}
// IVariantProvider

View file

@ -72,7 +72,7 @@ public abstract class BlockRoutingNode extends BlockContainer
}
@Override
public boolean isVisuallyOpaque()
public boolean causesSuffocation()
{
return false;
}

View file

@ -67,7 +67,7 @@ public class BlockSoulForge extends BlockContainer implements IVariantProvider
}
@Override
public boolean isVisuallyOpaque()
public boolean causesSuffocation()
{
return false;
}

View file

@ -63,7 +63,7 @@ public class BlockSpectral extends BlockContainer implements IVariantProvider
}
@Override
public boolean isVisuallyOpaque()
public boolean causesSuffocation()
{
return false;
}

View file

@ -122,15 +122,15 @@ public class BlockEnumPillar<E extends Enum<E> & IStringSerializable> extends Bl
}
@Override
protected ItemStack createStackedBlock(IBlockState state)
protected ItemStack getSilkTouchDrop(IBlockState state)
{
return new ItemStack(this, 1, damageDropped(state));
}
@Override
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, ItemStack stack)
{
return super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer).withProperty(BlockRotatedPillar.AXIS, facing.getAxis());
return super.getStateForPlacement(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer, stack).withProperty(BlockRotatedPillar.AXIS, facing.getAxis());
}
@Override

View file

@ -70,15 +70,15 @@ public class BlockEnumPillarCap<E extends Enum<E> & IStringSerializable> extends
}
@Override
protected ItemStack createStackedBlock(IBlockState state)
protected ItemStack getSilkTouchDrop(IBlockState state)
{
return new ItemStack(this, 1, damageDropped(state));
}
@Override
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, ItemStack stack)
{
return super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer).withProperty(FACING, facing);
return super.getStateForPlacement(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer, stack).withProperty(FACING, facing);
}
@Override

View file

@ -27,6 +27,7 @@ import net.minecraft.util.math.Vec3d;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeModContainer;
import org.apache.commons.lang3.ArrayUtils;
import WayofTime.bloodmagic.BloodMagic;
@ -171,9 +172,9 @@ public class BlockEnumStairs<E extends Enum<E> & IStringSerializable> extends Bl
}
@Override
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, ItemStack stack)
{
IBlockState state = super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer);
IBlockState state = super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, stack);
state = state.withProperty(FACING, placer.getHorizontalFacing()).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.STRAIGHT);
return facing != EnumFacing.DOWN && (facing == EnumFacing.UP || (double) hitY <= 0.5D) ? state.withProperty(BlockStairs.HALF, BlockStairs.EnumHalf.BOTTOM) : state.withProperty(BlockStairs.HALF, BlockStairs.EnumHalf.TOP);
}
@ -348,7 +349,7 @@ public class BlockEnumStairs<E extends Enum<E> & IStringSerializable> extends Bl
}
@Override
protected ItemStack createStackedBlock(IBlockState state)
protected ItemStack getSilkTouchDrop(IBlockState state)
{
return new ItemStack(this, 1, damageDropped(state));
}
@ -368,7 +369,7 @@ public class BlockEnumStairs<E extends Enum<E> & IStringSerializable> extends Bl
@Override
public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face)
{
if (BloodMagic.getCrossVersionProxy().disableStairSlabCulling())
if (ForgeModContainer.disableStairSlabCulling)
return super.doesSideBlockRendering(state, world, pos, face);
if (state.isOpaqueCube())

View file

@ -129,7 +129,7 @@ public class BlockEnumWall<E extends Enum<E> & IStringSerializable> extends Bloc
}
@Override
protected ItemStack createStackedBlock(IBlockState state)
protected ItemStack getSilkTouchDrop(IBlockState state)
{
return new ItemStack(this, 1, damageDropped(state));
}

View file

@ -7,7 +7,9 @@ import net.minecraft.util.IStringSerializable;
public enum EnumRitualController implements IStringSerializable
{
MASTER,
IMPERFECT;
IMPERFECT,
INVERTED,
;
@Override
public String toString()

View file

@ -26,6 +26,11 @@ public enum EnumSubWillType implements IStringSerializable
}
public EnumDemonWillType getType() {
return EnumDemonWillType.valueOf(name());
String name = name();
if (this == RAW)
name = EnumDemonWillType.DEFAULT.name();
return EnumDemonWillType.valueOf(name);
}
}

View file

@ -52,7 +52,7 @@ public class GuiAlchemyTable extends GuiContainer
{
Slot slot = this.inventorySlots.getSlot(slotId);
this.drawTexturedModalRect(i + slot.xDisplayPosition, j + slot.yDisplayPosition, 195, 1, 16, 16);
this.drawTexturedModalRect(i + slot.xPos, j + slot.yPos, 195, 1, 16, 16);
}
}
}

View file

@ -34,7 +34,7 @@ public class HUDElementDemonWillAura extends HUDElement
@Override
public void render(Minecraft minecraft, ScaledResolution resolution, float partialTicks)
{
EntityPlayer player = minecraft.thePlayer;
EntityPlayer player = minecraft.player;
if (!Utils.canPlayerSeeDemonWill(player))
{

View file

@ -26,13 +26,13 @@ public class HUDElementHolding extends HUDElement
@Override
public void render(Minecraft minecraft, ScaledResolution resolution, float partialTicks)
{
ItemStack sigilHolding = minecraft.thePlayer.getHeldItemMainhand();
ItemStack sigilHolding = minecraft.player.getHeldItemMainhand();
// TODO - Clean this mess
// Check mainhand for Sigil of Holding
if (sigilHolding == null)
return;
if (!(sigilHolding.getItem() == ModItems.SIGIL_HOLDING))
sigilHolding = minecraft.thePlayer.getHeldItemOffhand();
sigilHolding = minecraft.player.getHeldItemOffhand();
// Check offhand for Sigil of Holding
if (sigilHolding == null)
return;
@ -54,7 +54,7 @@ public class HUDElementHolding extends HUDElement
{
for (ItemStack sigil : holdingInv)
{
renderHotbarItem(resolution.getScaledWidth() / 2 + 103 + xOffset + getXOffset(), resolution.getScaledHeight() - 18 + getYOffset(), partialTicks, minecraft.thePlayer, sigil);
renderHotbarItem(resolution.getScaledWidth() / 2 + 103 + xOffset + getXOffset(), resolution.getScaledHeight() - 18 + getYOffset(), partialTicks, minecraft.player, sigil);
xOffset += 20;
}
}

View file

@ -27,7 +27,7 @@ public enum KeyBindings
@Override
public void handleKeybind()
{
ItemStack itemStack = ClientHandler.minecraft.thePlayer.getHeldItemMainhand();
ItemStack itemStack = ClientHandler.minecraft.player.getHeldItemMainhand();
if (itemStack != null && itemStack.getItem() instanceof IKeybindable)
BloodMagicPacketHandler.INSTANCE.sendToServer(new KeyProcessor(this, false));
}
@ -38,7 +38,7 @@ public enum KeyBindings
@Override
public void handleKeybind()
{
EntityPlayerSP player = Minecraft.getMinecraft().thePlayer;
EntityPlayerSP player = Minecraft.getMinecraft().player;
if (player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() instanceof ItemSigilHolding)
ClientHandler.cycleSigil(player.getHeldItemMainhand(), player, -1);
}
@ -49,7 +49,7 @@ public enum KeyBindings
@Override
public void handleKeybind()
{
EntityPlayerSP player = Minecraft.getMinecraft().thePlayer;
EntityPlayerSP player = Minecraft.getMinecraft().player;
if (player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() instanceof ItemSigilHolding)
ClientHandler.cycleSigil(player.getHeldItemMainhand(), player, 1);
}

View file

@ -124,8 +124,8 @@ public class RenderAltar extends TileEntitySpecialRenderer<TileAltar>
private void renderHologram(TileAltar altar, EnumAltarTier tier, float partialTicks)
{
EntityPlayerSP player = mc.thePlayer;
World world = player.worldObj;
EntityPlayerSP player = mc.player;
World world = player.world;
if (tier == EnumAltarTier.ONE)
return;

View file

@ -28,7 +28,7 @@ public class RenderItemRoutingNode extends TileEntitySpecialRenderer<TileRouting
@Override
public void renderTileEntityAt(TileRoutingNode tileNode, double x, double y, double z, float partialTicks, int destroyStage)
{
if ((mc.thePlayer.getHeldItemMainhand() != null && mc.thePlayer.getHeldItemMainhand().getItem() instanceof INodeRenderer) || ConfigHandler.alwaysRenderRoutingLines)
if ((mc.player.getHeldItemMainhand() != null && mc.player.getHeldItemMainhand().getItem() instanceof INodeRenderer) || ConfigHandler.alwaysRenderRoutingLines)
{
List<BlockPos> connectionList = tileNode.getConnected();
for (BlockPos wantedPos : connectionList)
@ -41,7 +41,7 @@ public class RenderItemRoutingNode extends TileEntitySpecialRenderer<TileRouting
int yd = offsetPos.getY();
int zd = offsetPos.getZ();
double distance = Math.sqrt(xd * xd + yd * yd + zd * zd);
double subLength = MathHelper.sqrt_double(xd * xd + zd * zd);
double subLength = MathHelper.sqrt(xd * xd + zd * zd);
float rotYaw = -((float) (Math.atan2(zd, xd) * 180.0D / Math.PI));
float rotPitch = ((float) (Math.atan2(yd, subLength) * 180.0D / Math.PI));
@ -55,7 +55,7 @@ public class RenderItemRoutingNode extends TileEntitySpecialRenderer<TileRouting
GlStateManager.disableLighting();
GlStateManager.disableCull();
float f2 = 0;
float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F);
float f3 = -f2 * 0.2F - (float) MathHelper.floor(-f2 * 0.1F);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

View file

@ -72,8 +72,8 @@ public class RenderCorruptedZombie extends RenderBiped<EntityCorruptedZombie>
return ZOMBIE_TEXTURES;
}
protected void rotateCorpse(EntityCorruptedZombie entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks)
protected void applyRotations(EntityCorruptedZombie entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks)
{
super.rotateCorpse(entityLiving, p_77043_2_, p_77043_3_, partialTicks);
super.applyRotations(entityLiving, p_77043_2_, p_77043_3_, partialTicks);
}
}

View file

@ -1,205 +0,0 @@
package WayofTime.bloodmagic.client.render.model;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.block.BlockBloodTank;
import WayofTime.bloodmagic.client.render.block.RenderBloodTank;
import WayofTime.bloodmagic.tile.TileBloodTank;
import com.google.common.collect.ImmutableMap;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
import net.minecraft.client.renderer.block.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.client.model.IPerspectiveAwareModel;
import net.minecraftforge.common.model.TRSRTransformation;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import org.apache.commons.lang3.tuple.Pair;
import javax.vecmath.Matrix4f;
import javax.vecmath.Vector3f;
import java.util.List;
import java.util.Map;
/**
* Shamelessly taken off of the Mekanism repository written by {@author aidancbrady}
* https://github.com/aidancbrady/Mekanism
*/
public class BakedCustomItemModel implements IPerspectiveAwareModel
{
private IBakedModel baseModel;
private ItemStack stack;
private TransformType prevTransform;
private static VertexFormat prevFormat = null;
private static int prevMode = -1;
private static final RenderBloodTank tankRenderer = (RenderBloodTank) TileEntityRendererDispatcher.instance.mapSpecialRenderers.get(TileBloodTank.class);
public BakedCustomItemModel(IBakedModel model, ItemStack stack)
{
this.baseModel = model;
this.stack = stack;
}
private void doRender(TransformType transformType)
{
Block block = Block.getBlockFromItem(stack.getItem());
if (transformType == TransformType.GUI)
{
GlStateManager.rotate(180F, 0.0F, 1.0F, 0.0F);
}
if (block instanceof BlockBloodTank)
{
GlStateManager.pushMatrix();
FluidStack fluid = null;
float capacity = TileBloodTank.CAPACITIES[stack.getItemDamage()] * Fluid.BUCKET_VOLUME;
int amount = 0;
if (stack.hasTagCompound() && stack.getTagCompound().hasKey(Constants.NBT.TANK))
{
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(Constants.NBT.TANK);
fluid = FluidStack.loadFluidStackFromNBT(tag);
if (fluid != null)
amount = tag.getInteger("Amount");
}
if (fluid != null && amount > 0)
tankRenderer.renderFluid(amount / capacity, fluid.getFluid(), -0.498, -0.49, -0.498);
GlStateManager.popMatrix();
}
}
@Override
public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand)
{
Tessellator tessellator = Tessellator.getInstance();
pauseRenderer(tessellator);
GlStateManager.pushMatrix();
GlStateManager.translate(0.5F, 0.5F, 0.5F);
GlStateManager.rotate(180, 0.0F, 1.0F, 0.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
doRender(prevTransform);
GlStateManager.enableLighting();
GlStateManager.enableLight(0);
GlStateManager.enableLight(1);
GlStateManager.enableColorMaterial();
GlStateManager.colorMaterial(1032, 5634);
GlStateManager.enableCull();
GlStateManager.popMatrix();
resumeRenderer(tessellator);
return baseModel.getQuads(state, side, rand);
}
@Override
public boolean isAmbientOcclusion()
{
return baseModel.isAmbientOcclusion();
}
@Override
public boolean isGui3d()
{
return baseModel.isGui3d();
}
@Override
public boolean isBuiltInRenderer()
{
return baseModel.isBuiltInRenderer();
}
@Override
public TextureAtlasSprite getParticleTexture()
{
return baseModel.getParticleTexture();
}
@Override
public ItemCameraTransforms getItemCameraTransforms()
{
return baseModel.getItemCameraTransforms();
}
private static TRSRTransformation get(float tx, float ty, float tz, float ax, float ay, float az, float s)
{
return new TRSRTransformation(new Vector3f(tx / 16, ty / 16, tz / 16), TRSRTransformation.quatFromXYZDegrees(new Vector3f(ax, ay, az)), new Vector3f(s, s, s), null);
}
public static Map<TransformType, TRSRTransformation> transforms = ImmutableMap.<TransformType, TRSRTransformation>builder()
.put(TransformType.GUI, get(0, 0, 0, 30F, 225F, 0, 0.625F))
.put(TransformType.THIRD_PERSON_RIGHT_HAND, get(0, 2.5F, 0, 75F, 45F, 0, 0.375F))
.put(TransformType.THIRD_PERSON_LEFT_HAND, get(0, 2.5F, 0, 75F, 45F, 0, 0.375F))
.put(TransformType.FIRST_PERSON_RIGHT_HAND, get(0, 0, 0, 0, 45F, 0, 0.4f))
.put(TransformType.FIRST_PERSON_LEFT_HAND, get(0, 0, 0, 0, 225F, 0, 0.4F))
.put(TransformType.GROUND, get(0, 2F, 0, 0, 0, 0, 0.25F))
.put(TransformType.HEAD, get(0, 0, 0, 0, 0, 0, 1F))
.put(TransformType.FIXED, get(0, 0, 0, 0, 0, 0, 1F))
.put(TransformType.NONE, get(0, 0, 0, 0, 0, 0, 0))
.build();
@Override
public Pair<? extends IPerspectiveAwareModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType)
{
prevTransform = cameraTransformType;
return Pair.of(this, transforms.get(cameraTransformType).getMatrix());
}
@Override
public ItemOverrideList getOverrides()
{
return ItemOverrideList.NONE;
}
public static void pauseRenderer(Tessellator tess)
{
if (isDrawing(tess))
{
prevFormat = tess.getBuffer().getVertexFormat();
prevMode = tess.getBuffer().getDrawMode();
tess.draw();
}
}
public static void resumeRenderer(Tessellator tess)
{
if (prevFormat != null)
{
tess.getBuffer().begin(prevMode, prevFormat);
}
prevFormat = null;
prevMode = -1;
}
public static boolean isDrawing(Tessellator tess)
{
return isDrawing(tess.getBuffer());
}
public static boolean isDrawing(VertexBuffer buffer)
{
return (Boolean) ReflectionHelper.getPrivateValue(VertexBuffer.class, buffer, "isDrawing", "field_179010_r");
}
}

View file

@ -1,80 +0,0 @@
package WayofTime.bloodmagic.client.render.model;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.*;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.List;
public class CustomModelFactory implements IBakedModel
{
private IBakedModel baseModel;
private BlockOverrideList override = new BlockOverrideList();
public CustomModelFactory(IBakedModel base)
{
baseModel = base;
}
@Override
public ItemOverrideList getOverrides()
{
return override;
}
@Override
public List<BakedQuad> getQuads(IBlockState state, EnumFacing facing, long rand)
{
throw new UnsupportedOperationException();
}
@Override
public boolean isAmbientOcclusion()
{
throw new UnsupportedOperationException();
}
@Override
public boolean isGui3d()
{
return baseModel.isGui3d();
}
@Override
public boolean isBuiltInRenderer()
{
throw new UnsupportedOperationException();
}
@Override
public TextureAtlasSprite getParticleTexture()
{
throw new UnsupportedOperationException();
}
@Override
public ItemCameraTransforms getItemCameraTransforms()
{
throw new UnsupportedOperationException();
}
private class BlockOverrideList extends ItemOverrideList
{
public BlockOverrideList()
{
super(new ArrayList<ItemOverride>());
}
@Override
public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity)
{
return new BakedCustomItemModel(baseModel, stack);
}
}
}

View file

@ -1,40 +1,32 @@
package WayofTime.bloodmagic.command;
import WayofTime.bloodmagic.command.sub.SubCommandBind;
import WayofTime.bloodmagic.command.sub.SubCommandHelp;
import WayofTime.bloodmagic.command.sub.SubCommandNetwork;
import WayofTime.bloodmagic.command.sub.SubCommandOrb;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextComponentString;
import net.minecraftforge.server.command.CommandTreeBase;
import java.util.*;
public class CommandBloodMagic extends CommandBase
public class CommandBloodMagic extends CommandTreeBase
{
// TODO - Move this and sub commands to CommandTreeBase in 1.11. Much cleaner impl
private final List<String> aliases = new ArrayList<String>();
private final Map<String, ISubCommand> subCommands = new HashMap<String, ISubCommand>();
public CommandBloodMagic()
{
aliases.add("BloodMagic");
aliases.add("bloodmagic");
aliases.add("bloodMagic");
aliases.add("bm");
subCommands.put("help", new SubCommandHelp(this));
subCommands.put("network", new SubCommandNetwork(this));
subCommands.put("bind", new SubCommandBind(this));
subCommands.put("orb", new SubCommandOrb(this));
addSubcommand(new SubCommandBind());
addSubcommand(new SubCommandNetwork());
addSubcommand(new SubCommandOrb());
}
@Override
public String getCommandName()
public String getName()
{
return "/bloodmagic";
return "bloodmagic";
}
@Override
public String getUsage(ICommandSender sender)
{
return "/bloodmagic help";
}
@Override
@ -43,35 +35,18 @@ public class CommandBloodMagic extends CommandBase
return 2;
}
@Override
public String getCommandUsage(ICommandSender commandSender)
public static void displayHelpString(ICommandSender commandSender, String display, Object... info)
{
return getCommandName() + " help";
commandSender.sendMessage(new TextComponentString(TextHelper.localizeEffect(display, info)));
}
@Override
public List<String> getCommandAliases()
public static void displayErrorString(ICommandSender commandSender, String display, Object... info)
{
return aliases;
commandSender.sendMessage(new TextComponentString(TextHelper.localizeEffect(display, info)));
}
@Override
public void execute(MinecraftServer server, ICommandSender commandSender, String[] args)
public static void displaySuccessString(ICommandSender commandSender, String display, Object... info)
{
if (args.length > 0 && subCommands.containsKey(args[0]))
{
ISubCommand subCommand = subCommands.get(args[0]);
String[] subArgs = Arrays.copyOfRange(args, 1, args.length);
subCommand.processSubCommand(server, commandSender, subArgs);
} else
{
commandSender.addChatMessage(new TextComponentString(TextHelper.localizeEffect("commands.error.unknown")));
}
}
public Map<String, ISubCommand> getSubCommands()
{
return subCommands;
commandSender.sendMessage(new TextComponentString(TextHelper.localizeEffect(display, info)));
}
}

View file

@ -1,19 +0,0 @@
package WayofTime.bloodmagic.command;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;
public interface ISubCommand
{
String getSubCommandName();
ICommand getParentCommand();
String getArgUsage(ICommandSender commandSender);
String getHelpText();
void processSubCommand(MinecraftServer server, ICommandSender commandSender, String[] args);
}

View file

@ -1,70 +0,0 @@
package WayofTime.bloodmagic.command;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextComponentString;
import java.util.Locale;
public abstract class SubCommandBase implements ISubCommand
{
private ICommand parent;
private String name;
public SubCommandBase(ICommand parent, String name)
{
this.parent = parent;
this.name = name;
}
@Override
public String getSubCommandName()
{
return name;
}
@Override
public ICommand getParentCommand()
{
return parent;
}
@Override
public void processSubCommand(MinecraftServer server, ICommandSender commandSender, String[] args)
{
if (args.length == 0 && !getSubCommandName().equals("help"))
displayErrorString(commandSender, String.format(TextHelper.localizeEffect("commands.format.error"), capitalizeFirstLetter(getSubCommandName()), getArgUsage(commandSender)));
if (isBounded(0, 2, args.length) && args[0].equals("help"))
displayHelpString(commandSender, String.format(TextHelper.localizeEffect("commands.format.help"), capitalizeFirstLetter(getSubCommandName()), getHelpText()));
}
protected String capitalizeFirstLetter(String toCapital)
{
return String.valueOf(toCapital.charAt(0)).toUpperCase(Locale.ENGLISH) + toCapital.substring(1);
}
protected boolean isBounded(int low, int high, int given)
{
return given > low && given < high;
}
public static void displayHelpString(ICommandSender commandSender, String display, Object... info)
{
commandSender.addChatMessage(new TextComponentString(TextHelper.localizeEffect(display, info)));
}
public static void displayErrorString(ICommandSender commandSender, String display, Object... info)
{
commandSender.addChatMessage(new TextComponentString(TextHelper.localizeEffect(display, info)));
}
public static void displaySuccessString(ICommandSender commandSender, String display, Object... info)
{
commandSender.addChatMessage(new TextComponentString(TextHelper.localizeEffect(display, info)));
}
}

View file

@ -1,7 +0,0 @@
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
package WayofTime.bloodmagic.command;
import mcp.MethodsReturnNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;

View file

@ -4,43 +4,37 @@ import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.iface.IBindable;
import WayofTime.bloodmagic.api.util.helper.BindableHelper;
import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
import WayofTime.bloodmagic.command.SubCommandBase;
import WayofTime.bloodmagic.util.helper.TextHelper;
import com.google.common.base.Strings;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.command.*;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextComponentTranslation;
public class SubCommandBind extends SubCommandBase
public class SubCommandBind extends CommandBase
{
public SubCommandBind(ICommand parent)
@Override
public String getName()
{
super(parent, "bind");
return "bind";
}
@Override
public String getArgUsage(ICommandSender commandSender)
public String getUsage(ICommandSender commandSender)
{
return TextHelper.localizeEffect("commands.bind.usage");
}
@Override
public String getHelpText()
public int getRequiredPermissionLevel()
{
return TextHelper.localizeEffect("commands.bind.help");
return 2;
}
@Override
public void processSubCommand(MinecraftServer server, ICommandSender commandSender, String[] args)
public void execute(MinecraftServer server, ICommandSender commandSender, String[] args) throws CommandException
{
super.processSubCommand(server, commandSender, args);
if (commandSender.getEntityWorld().isRemote)
return;
@ -52,7 +46,7 @@ public class SubCommandBind extends SubCommandBase
ItemStack held = player.getHeldItemMainhand();
boolean bind = true;
if (held != null && held.getItem() instanceof IBindable)
if (held.getItem() instanceof IBindable)
{
if (args.length > 0)
{
@ -77,20 +71,20 @@ public class SubCommandBind extends SubCommandBase
{
BindableHelper.setItemOwnerName(held, playerName);
BindableHelper.setItemOwnerUUID(held, uuid);
commandSender.addChatMessage(new TextComponentTranslation("commands.bind.success"));
commandSender.sendMessage(new TextComponentTranslation("commands.bind.success"));
} else
{
if (!Strings.isNullOrEmpty(((IBindable) held.getItem()).getOwnerUUID(held)))
{
held.getTagCompound().removeTag(Constants.NBT.OWNER_UUID);
held.getTagCompound().removeTag(Constants.NBT.OWNER_NAME);
commandSender.addChatMessage(new TextComponentTranslation("commands.bind.remove.success"));
commandSender.sendMessage(new TextComponentTranslation("commands.bind.remove.success"));
}
}
}
} catch (PlayerNotFoundException e)
{
commandSender.addChatMessage(new TextComponentTranslation(TextHelper.localizeEffect("commands.error.404")));
commandSender.sendMessage(new TextComponentTranslation(TextHelper.localizeEffect("commands.error.404")));
}
}

View file

@ -1,43 +0,0 @@
package WayofTime.bloodmagic.command.sub;
import WayofTime.bloodmagic.command.CommandBloodMagic;
import WayofTime.bloodmagic.command.ISubCommand;
import WayofTime.bloodmagic.command.SubCommandBase;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextComponentString;
public class SubCommandHelp extends SubCommandBase
{
public SubCommandHelp(ICommand parent)
{
super(parent, "help");
}
@Override
public String getArgUsage(ICommandSender commandSender)
{
return TextHelper.localize("commands.help.usage");
}
@Override
public String getHelpText()
{
return TextHelper.localizeEffect("commands.help.help");
}
@Override
public void processSubCommand(MinecraftServer server, ICommandSender commandSender, String[] args)
{
super.processSubCommand(server, commandSender, args);
if (args.length > 0)
return;
for (ISubCommand subCommand : ((CommandBloodMagic) getParentCommand()).getSubCommands().values())
commandSender.addChatMessage(new TextComponentString(TextHelper.localizeEffect("commands.format.help", capitalizeFirstLetter(subCommand.getSubCommandName()), subCommand.getArgUsage(commandSender))));
}
}

View file

@ -2,45 +2,38 @@ package WayofTime.bloodmagic.command.sub;
import WayofTime.bloodmagic.api.saving.SoulNetwork;
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
import WayofTime.bloodmagic.command.SubCommandBase;
import WayofTime.bloodmagic.command.CommandBloodMagic;
import WayofTime.bloodmagic.util.Utils;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.command.*;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextComponentString;
import java.util.Locale;
public class SubCommandNetwork extends SubCommandBase
public class SubCommandNetwork extends CommandBase
{
public SubCommandNetwork(ICommand parent)
{
super(parent, "network");
@Override
public String getName() {
return "network";
}
@Override
public String getArgUsage(ICommandSender commandSender)
public String getUsage(ICommandSender commandSender)
{
return TextHelper.localizeEffect("commands.network.usage");
}
@Override
public String getHelpText()
public int getRequiredPermissionLevel()
{
return TextHelper.localizeEffect("commands.network.help");
return 2;
}
@Override
public void processSubCommand(MinecraftServer server, ICommandSender commandSender, String[] args)
public void execute(MinecraftServer server, ICommandSender commandSender, String[] args) throws CommandException
{
super.processSubCommand(server, commandSender, args);
if (args.length > 1)
{
if (args[0].equalsIgnoreCase("help"))
@ -53,18 +46,18 @@ public class SubCommandNetwork extends SubCommandBase
try
{
ValidCommands command = ValidCommands.valueOf(args[0].toUpperCase(Locale.ENGLISH));
command.run(player, commandSender, isBounded(0, 2, args.length), args);
command.run(player, commandSender, args.length > 0 && args.length < 2, args);
} catch (IllegalArgumentException e)
{
}
} catch (PlayerNotFoundException e)
{
displayErrorString(commandSender, e.getLocalizedMessage());
CommandBloodMagic.displayErrorString(commandSender, e.getLocalizedMessage());
}
} else
{
displayErrorString(commandSender, "commands.error.arg.missing");
CommandBloodMagic.displayErrorString(commandSender, "commands.error.arg.missing");
}
}
@ -77,7 +70,7 @@ public class SubCommandNetwork extends SubCommandBase
{
if (displayHelp)
{
displayHelpString(sender, this.help);
CommandBloodMagic.displayHelpString(sender, this.help);
return;
}
@ -86,15 +79,15 @@ public class SubCommandNetwork extends SubCommandBase
if (Utils.isInteger(args[2]))
{
int amount = Integer.parseInt(args[2]);
NetworkHelper.syphonAndDamage(NetworkHelper.getSoulNetwork(player), player, amount);
displaySuccessString(sender, "commands.network.syphon.success", amount, player.getDisplayName().getFormattedText());
NetworkHelper.getSoulNetwork(player).syphonAndDamage(player, amount);
CommandBloodMagic.displaySuccessString(sender, "commands.network.syphon.success", amount, player.getDisplayName().getFormattedText());
} else
{
displayErrorString(sender, "commands.error.arg.invalid");
CommandBloodMagic.displayErrorString(sender, "commands.error.arg.invalid");
}
} else
{
displayErrorString(sender, "commands.error.arg.missing");
CommandBloodMagic.displayErrorString(sender, "commands.error.arg.missing");
}
}
},
@ -105,7 +98,7 @@ public class SubCommandNetwork extends SubCommandBase
{
if (displayHelp)
{
displayHelpString(sender, this.help);
CommandBloodMagic.displayHelpString(sender, this.help);
return;
}
@ -117,14 +110,14 @@ public class SubCommandNetwork extends SubCommandBase
{
int amount = Integer.parseInt(args[2]);
int maxOrb = NetworkHelper.getMaximumForTier(network.getOrbTier());
displaySuccessString(sender, "commands.network.add.success", network.add(amount, maxOrb), player.getDisplayName().getFormattedText());
CommandBloodMagic.displaySuccessString(sender, "commands.network.add.success", network.add(amount, maxOrb), player.getDisplayName().getFormattedText());
} else
{
displayErrorString(sender, "commands.error.arg.invalid");
CommandBloodMagic.displayErrorString(sender, "commands.error.arg.invalid");
}
} else
{
displayErrorString(sender, "commands.error.arg.missing");
CommandBloodMagic.displayErrorString(sender, "commands.error.arg.missing");
}
}
},
@ -135,7 +128,7 @@ public class SubCommandNetwork extends SubCommandBase
{
if (displayHelp)
{
displayHelpString(sender, this.help);
CommandBloodMagic.displayHelpString(sender, this.help);
return;
}
@ -147,14 +140,14 @@ public class SubCommandNetwork extends SubCommandBase
{
int amount = Integer.parseInt(args[2]);
network.setCurrentEssence(amount);
displaySuccessString(sender, "commands.network.set.success", player.getDisplayName().getFormattedText(), amount);
CommandBloodMagic.displaySuccessString(sender, "commands.network.set.success", player.getDisplayName().getFormattedText(), amount);
} else
{
displayErrorString(sender, "commands.error.arg.invalid");
CommandBloodMagic.displayErrorString(sender, "commands.error.arg.invalid");
}
} else
{
displayErrorString(sender, "commands.error.arg.missing");
CommandBloodMagic.displayErrorString(sender, "commands.error.arg.missing");
}
}
},
@ -165,14 +158,14 @@ public class SubCommandNetwork extends SubCommandBase
{
if (displayHelp)
{
displayHelpString(sender, this.help);
CommandBloodMagic.displayHelpString(sender, this.help);
return;
}
SoulNetwork network = NetworkHelper.getSoulNetwork(player);
if (args.length > 1)
sender.addChatMessage(new TextComponentString(TextHelper.localizeEffect("tooltip.BloodMagic.sigil.divination.currentEssence", network.getCurrentEssence())));
sender.sendMessage(new TextComponentString(TextHelper.localizeEffect("tooltip.bloodmagic.sigil.divination.currentEssence", network.getCurrentEssence())));
}
},
@ -183,7 +176,7 @@ public class SubCommandNetwork extends SubCommandBase
{
if (displayHelp)
{
displayHelpString(sender, this.help, Integer.MAX_VALUE);
CommandBloodMagic.displayHelpString(sender, this.help, Integer.MAX_VALUE);
return;
}
@ -192,7 +185,7 @@ public class SubCommandNetwork extends SubCommandBase
if (args.length > 1)
{
network.setCurrentEssence(Integer.MAX_VALUE);
displaySuccessString(sender, "commands.network.fill.success", player.getDisplayName().getFormattedText());
CommandBloodMagic.displaySuccessString(sender, "commands.network.fill.success", player.getDisplayName().getFormattedText());
}
}
},
@ -203,7 +196,7 @@ public class SubCommandNetwork extends SubCommandBase
{
if (displayHelp)
{
displayHelpString(sender, this.help);
CommandBloodMagic.displayHelpString(sender, this.help);
return;
}
@ -213,7 +206,7 @@ public class SubCommandNetwork extends SubCommandBase
{
int maxOrb = NetworkHelper.getMaximumForTier(network.getOrbTier());
network.setCurrentEssence(maxOrb);
displaySuccessString(sender, "commands.network.cap.success", player.getDisplayName().getFormattedText());
CommandBloodMagic.displaySuccessString(sender, "commands.network.cap.success", player.getDisplayName().getFormattedText());
}
}
},

View file

@ -3,44 +3,38 @@ package WayofTime.bloodmagic.command.sub;
import WayofTime.bloodmagic.api.saving.SoulNetwork;
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
import WayofTime.bloodmagic.command.SubCommandBase;
import WayofTime.bloodmagic.command.CommandBloodMagic;
import WayofTime.bloodmagic.util.Utils;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.command.*;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextComponentString;
import java.util.Locale;
public class SubCommandOrb extends SubCommandBase
public class SubCommandOrb extends CommandBase
{
public SubCommandOrb(ICommand parent)
{
super(parent, "orb");
@Override
public String getName() {
return "orb";
}
@Override
public String getArgUsage(ICommandSender commandSender)
public String getUsage(ICommandSender commandSender)
{
return TextHelper.localizeEffect("commands.orb.usage");
}
@Override
public String getHelpText()
public int getRequiredPermissionLevel()
{
return TextHelper.localizeEffect("commands.orb.help");
return 2;
}
@Override
public void processSubCommand(MinecraftServer server, ICommandSender commandSender, String[] args)
public void execute(MinecraftServer server, ICommandSender commandSender, String[] args) throws CommandException
{
super.processSubCommand(server, commandSender, args);
if (args.length > 0)
{
@ -58,7 +52,7 @@ public class SubCommandOrb extends SubCommandBase
String uuid = PlayerHelper.getUUIDFromPlayer(player).toString();
SoulNetwork network = NetworkHelper.getSoulNetwork(uuid);
boolean displayHelp = isBounded(0, 2, args.length);
boolean displayHelp = args.length > 0 && args.length < 2;
try
{
@ -68,7 +62,7 @@ public class SubCommandOrb extends SubCommandBase
{
if (displayHelp)
{
displayHelpString(commandSender, ValidCommands.SET.help);
CommandBloodMagic.displayHelpString(commandSender, ValidCommands.SET.help);
break;
}
@ -78,14 +72,14 @@ public class SubCommandOrb extends SubCommandBase
{
int amount = Integer.parseInt(args[2]);
network.setOrbTier(amount);
displaySuccessString(commandSender, "commands.success");
CommandBloodMagic.displaySuccessString(commandSender, "commands.success");
} else
{
displayErrorString(commandSender, "commands.error.arg.invalid");
CommandBloodMagic.displayErrorString(commandSender, "commands.error.arg.invalid");
}
} else
{
displayErrorString(commandSender, "commands.error.arg.missing");
CommandBloodMagic.displayErrorString(commandSender, "commands.error.arg.missing");
}
break;
@ -94,23 +88,23 @@ public class SubCommandOrb extends SubCommandBase
{
if (displayHelp)
{
displayHelpString(commandSender, ValidCommands.GET.help);
CommandBloodMagic.displayHelpString(commandSender, ValidCommands.GET.help);
break;
}
if (args.length > 1)
commandSender.addChatMessage(new TextComponentString(TextHelper.localizeEffect("message.orb.currenttier", network.getOrbTier())));
commandSender.sendMessage(new TextComponentString(TextHelper.localizeEffect("message.orb.currenttier", network.getOrbTier())));
break;
}
}
} catch (IllegalArgumentException e)
{
displayErrorString(commandSender, "commands.error.404");
CommandBloodMagic.displayErrorString(commandSender, "commands.error.404");
}
} catch (PlayerNotFoundException e)
{
displayErrorString(commandSender, "commands.error.404");
CommandBloodMagic.displayErrorString(commandSender, "commands.error.404");
}
}
}

View file

@ -1,7 +0,0 @@
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
package WayofTime.bloodmagic.command.sub;
import mcp.MethodsReturnNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;

View file

@ -14,7 +14,7 @@ import net.minecraftforge.oredict.ShapelessOreRecipe;
public class CompatibilityGuideAPI implements ICompatibility
{
private static IRecipe guideRecipe = null;
static IRecipe guideRecipe = null;
private static boolean worldFlag;
@Override
@ -46,9 +46,11 @@ public class CompatibilityGuideAPI implements ICompatibility
{
if (!worldFlag) {
GameRegistry.addRecipe(guideRecipe);
GuideBloodMagic.handleBookRecipe(true);
worldFlag = true;
} else {
CraftingManager.getInstance().getRecipeList().remove(guideRecipe);
GuideBloodMagic.handleBookRecipe(false);
worldFlag = false;
}
break;

View file

@ -6,7 +6,6 @@ import WayofTime.bloodmagic.registry.ModBlocks;
import WayofTime.bloodmagic.registry.ModItems;
import amerifrance.guideapi.api.GuideAPI;
import amerifrance.guideapi.api.impl.Book;
import amerifrance.guideapi.api.util.NBTBookTags;
import amerifrance.guideapi.category.CategoryItemStack;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.FMLCommonHandler;
@ -42,9 +41,16 @@ public class GuideBloodMagic
// guideBook.addCategory(new CategoryItemStack(CategorySpell.buildCategory(), "guide.BloodMagic.category.spell", new ItemStack(ModItems.ritualDiviner)));
}
public static void initJEIBlacklist()
public static void handleBookRecipe(boolean add)
{
if (Loader.isModLoaded("JEI"))
BloodMagicPlugin.jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(GuideAPI.guideBook, NBTBookTags.BOOK_TAG, NBTBookTags.CATEGORY_PAGE_TAG, NBTBookTags.CATEGORY_TAG, NBTBookTags.ENTRY_PAGE_TAG, NBTBookTags.ENTRY_TAG, NBTBookTags.KEY_TAG, NBTBookTags.PAGE_TAG);
if (Loader.isModLoaded("JEI")) {
if (BloodMagicPlugin.jeiRuntime == null)
return;
if (add)
BloodMagicPlugin.jeiRuntime.getRecipeRegistry().addRecipe(CompatibilityGuideAPI.guideRecipe);
else
BloodMagicPlugin.jeiRuntime.getRecipeRegistry().removeRecipe(CompatibilityGuideAPI.guideRecipe);
}
}
}

View file

@ -5,7 +5,6 @@ import java.util.Map;
import javax.annotation.Nonnull;
import mezz.jei.api.*;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import WayofTime.bloodmagic.api.Constants;
@ -39,6 +38,7 @@ import WayofTime.bloodmagic.registry.ModItems;
public class BloodMagicPlugin extends BlankModPlugin
{
public static IJeiHelpers jeiHelper;
public static IJeiRuntime jeiRuntime;
@Override
public void register(@Nonnull IModRegistry registry)
@ -78,8 +78,6 @@ public class BloodMagicPlugin extends BlankModPlugin
}
}
jeiHelper.getSubtypeRegistry().useNbtForSubtypes(Item.getItemFromBlock(ModBlocks.BLOOD_TANK));
registry.addRecipeClickArea(GuiSoulForge.class, 115, 15, 16, 88, Constants.Compat.JEI_CATEGORY_SOULFORGE);
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.ALTAR), Constants.Compat.JEI_CATEGORY_ALTAR);
@ -88,15 +86,15 @@ public class BloodMagicPlugin extends BlankModPlugin
registry.addRecipeCategoryCraftingItem(new ItemStack(ModItems.ARCANE_ASHES), Constants.Compat.JEI_CATEGORY_BINDING);
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.ALCHEMY_TABLE), Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE);
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.RITUAL_CONTROLLER), Constants.Compat.JEI_CATEGORY_ARMOURDOWNGRADE);
}
jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.OWNER_UUID);
jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.OWNER_NAME);
jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.USES);
jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.SOULS);
jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.X_COORD);
jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.Y_COORD);
jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.Z_COORD);
jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.DIMENSION_ID);
jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.ITEM_INVENTORY);
@Override
public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) {
subtypeRegistry.useNbtForSubtypes(ModItems.UPGRADE_TOME);
}
@Override
public void onRuntimeAvailable(IJeiRuntime runtime) {
jeiRuntime = runtime;
}
}

View file

@ -1,24 +0,0 @@
package WayofTime.bloodmagic.compat.jei;
import WayofTime.bloodmagic.compat.ICompatibility;
public class CompatibilityJustEnoughItems implements ICompatibility
{
@Override
public void loadCompatibility(InitializationPhase phase)
{
}
@Override
public String getModId()
{
return "JEI";
}
@Override
public boolean enableCompat()
{
return true;
}
}

View file

@ -1,12 +1,15 @@
package WayofTime.bloodmagic.compat.jei.alchemyArray;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
@ -50,14 +53,15 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory
}
@Nullable
@Override
public void drawAnimations(Minecraft minecraft)
public IDrawable getIcon()
{
return null;
}
@Override
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 0, 5);
recipeLayout.getItemStacks().init(CATALYST_SLOT, true, 29, 3);
@ -65,10 +69,19 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory
if (recipeWrapper instanceof AlchemyArrayCraftingRecipeJEI)
{
AlchemyArrayCraftingRecipeJEI alchemyArrayWrapper = (AlchemyArrayCraftingRecipeJEI) recipeWrapper;
recipeLayout.getItemStacks().set(INPUT_SLOT, alchemyArrayWrapper.getInputs());
recipeLayout.getItemStacks().set(CATALYST_SLOT, alchemyArrayWrapper.getCatalyst());
recipeLayout.getItemStacks().set(OUTPUT_SLOT, alchemyArrayWrapper.getOutputs());
recipeLayout.getItemStacks().set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0));
recipeLayout.getItemStacks().set(CATALYST_SLOT, ingredients.getInputs(ItemStack.class).get(ingredients.getInputs(ItemStack.class).size() - 1));
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
}
}
@Override
public void drawAnimations(Minecraft minecraft) {
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper) {
}
}

View file

@ -15,14 +15,6 @@ public class AlchemyArrayCraftingRecipeHandler implements IRecipeHandler<Alchemy
return AlchemyArrayCraftingRecipeJEI.class;
}
@Deprecated
@Nonnull
@Override
public String getRecipeCategoryUid()
{
return Constants.Compat.JEI_CATEGORY_ALCHEMYARRAY;
}
@Override
public String getRecipeCategoryUid(@Nonnull AlchemyArrayCraftingRecipeJEI recipe)
{
@ -39,6 +31,11 @@ public class AlchemyArrayCraftingRecipeHandler implements IRecipeHandler<Alchemy
@Override
public boolean isRecipeValid(@Nonnull AlchemyArrayCraftingRecipeJEI recipe)
{
return recipe.getInputs().size() > 0 && recipe.getOutputs().size() > 0;
return true;
}
@Override
public String getRecipeCategoryUid() {
return null;
}
}

View file

@ -1,11 +1,12 @@
package WayofTime.bloodmagic.compat.jei.alchemyArray;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.google.common.collect.Lists;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import net.minecraft.item.ItemStack;
@ -13,10 +14,8 @@ public class AlchemyArrayCraftingRecipeJEI extends BlankRecipeWrapper
{
@Nonnull
private final List<ItemStack> inputs;
@Nullable
private final ItemStack catalyst;
@Nonnull
private final ItemStack output;
@ -27,22 +26,14 @@ public class AlchemyArrayCraftingRecipeJEI extends BlankRecipeWrapper
this.output = output;
}
@Override
@Nonnull
public List<ItemStack> getInputs()
{
return inputs;
}
public ItemStack getCatalyst()
{
return catalyst;
}
@Override
@Nonnull
public List<ItemStack> getOutputs()
{
return Collections.singletonList(output);
public void getIngredients(IIngredients ingredients) {
ingredients.setInputLists(ItemStack.class, Lists.newArrayList(inputs, Lists.newArrayList(catalyst)));
ingredients.setOutput(ItemStack.class, output);
}
}

View file

@ -1,7 +0,0 @@
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
package WayofTime.bloodmagic.compat.jei.alchemyArray;
import mcp.MethodsReturnNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;

View file

@ -1,24 +1,21 @@
package WayofTime.bloodmagic.compat.jei.alchemyTable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nonnull;
import WayofTime.bloodmagic.api.registry.OrbRegistry;
import mezz.jei.api.gui.ICraftingGridHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeCategory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
import WayofTime.bloodmagic.util.helper.TextHelper;
public class AlchemyTableRecipeCategory implements IRecipeCategory
public class AlchemyTableRecipeCategory extends BlankRecipeCategory<AlchemyTableRecipeJEI>
{
private static final int OUTPUT_SLOT = 0;
private static final int ORB_SLOT = 1;
@ -58,20 +55,7 @@ public class AlchemyTableRecipeCategory implements IRecipeCategory
}
@Override
public void drawExtras(Minecraft minecraft)
{
}
@Override
public void drawAnimations(Minecraft minecraft)
{
}
@Override
@SuppressWarnings("unchecked")
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
public void setRecipe(IRecipeLayout recipeLayout, AlchemyTableRecipeJEI recipeWrapper, IIngredients ingredients)
{
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
@ -87,12 +71,8 @@ public class AlchemyTableRecipeCategory implements IRecipeCategory
}
}
if (recipeWrapper instanceof AlchemyTableRecipeJEI)
{
AlchemyTableRecipeJEI recipe = (AlchemyTableRecipeJEI) recipeWrapper;
guiItemStacks.set(ORB_SLOT, (ArrayList<ItemStack>) recipe.getInputs().get(1));
craftingGridHelper.setOutput(guiItemStacks, recipe.getOutputs());
craftingGridHelper.setInput(guiItemStacks, (List) recipe.getInputs().get(0), 3, 2);
}
guiItemStacks.set(ORB_SLOT, OrbRegistry.getOrbsDownToTier(recipeWrapper.getRecipe().getTierRequired()));
craftingGridHelper.setOutput(guiItemStacks, ingredients.getOutputs(ItemStack.class));
craftingGridHelper.setInputStacks(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2);
}
}

View file

@ -15,14 +15,6 @@ public class AlchemyTableRecipeHandler implements IRecipeHandler<AlchemyTableRec
return AlchemyTableRecipeJEI.class;
}
@Deprecated
@Nonnull
@Override
public String getRecipeCategoryUid()
{
return Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE;
}
@Override
public String getRecipeCategoryUid(@Nonnull AlchemyTableRecipeJEI recipe)
{
@ -39,6 +31,11 @@ public class AlchemyTableRecipeHandler implements IRecipeHandler<AlchemyTableRec
@Override
public boolean isRecipeValid(@Nonnull AlchemyTableRecipeJEI recipe)
{
return recipe.getInputs().get(0).size() > 0 && recipe.getOutputs().size() > 0;
return true;
}
@Override
public String getRecipeCategoryUid() {
return null;
}
}

View file

@ -1,18 +1,15 @@
package WayofTime.bloodmagic.compat.jei.alchemyTable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
import com.google.common.collect.Lists;
import lombok.Getter;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import net.minecraft.item.ItemStack;
import WayofTime.bloodmagic.api.recipe.AlchemyTableRecipe;
import WayofTime.bloodmagic.api.registry.OrbRegistry;
import WayofTime.bloodmagic.util.helper.TextHelper;
public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
@ -20,42 +17,28 @@ public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
@Getter
private AlchemyTableRecipe recipe;
// @Getter
// private ArrayList<ItemStack> validGems = new ArrayList<ItemStack>();
public AlchemyTableRecipeJEI(AlchemyTableRecipe recipe)
{
this.recipe = recipe;
}
@Override
@Nonnull
public List<Collection> getInputs()
{
ArrayList<Collection> ret = new ArrayList<Collection>();
ret.add(recipe.getInput());
ret.add(OrbRegistry.getOrbsDownToTier(recipe.getTierRequired()));
return ret;
public void getIngredients(IIngredients ingredients) {
List<List<ItemStack>> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput());
ingredients.setInputLists(ItemStack.class, expanded);
ingredients.setOutput(ItemStack.class, recipe.getRecipeOutput(Lists.<ItemStack>newArrayList()));
}
@Override
@Nonnull
public List<ItemStack> getOutputs()
{
return Collections.singletonList(recipe.getRecipeOutput(new ArrayList<ItemStack>()));
}
@Nullable
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
ArrayList<String> ret = new ArrayList<String>();
if (mouseX >= 58 && mouseX <= 78 && mouseY >= 21 && mouseY <= 34)
{
ret.add(TextHelper.localize("tooltip.BloodMagic.tier", recipe.getTierRequired()));
ret.add(TextHelper.localize("jei.BloodMagic.recipe.lpDrained", recipe.getLpDrained()));
ret.add(TextHelper.localize("jei.BloodMagic.recipe.ticksRequired", recipe.getTicksRequired()));
return ret;
}
return null;
return ret;
}
}

View file

@ -1,7 +0,0 @@
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
package WayofTime.bloodmagic.compat.jei.alchemyTable;
import mcp.MethodsReturnNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;

View file

@ -1,11 +1,13 @@
package WayofTime.bloodmagic.compat.jei.altar;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
@ -52,24 +54,32 @@ public class AltarRecipeCategory implements IRecipeCategory
}
@Nullable
@Override
public void drawAnimations(Minecraft minecraft)
{
public IDrawable getIcon() {
return null;
}
@Override
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 31, 0);
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 125, 30);
if (recipeWrapper instanceof AltarRecipeJEI)
{
AltarRecipeJEI altarRecipeWrapper = (AltarRecipeJEI) recipeWrapper;
List<List<ItemStack>> inputs = altarRecipeWrapper.getInputs();
recipeLayout.getItemStacks().set(INPUT_SLOT, inputs.get(0));
recipeLayout.getItemStacks().set(OUTPUT_SLOT, altarRecipeWrapper.getOutputs());
recipeLayout.getItemStacks().set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0));
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
}
}
@Override
public void drawAnimations(Minecraft minecraft) {
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper) {
}
}

View file

@ -15,14 +15,6 @@ public class AltarRecipeHandler implements IRecipeHandler<AltarRecipeJEI>
return AltarRecipeJEI.class;
}
@Deprecated
@Nonnull
@Override
public String getRecipeCategoryUid()
{
return Constants.Compat.JEI_CATEGORY_ALTAR;
}
@Override
public String getRecipeCategoryUid(@Nonnull AltarRecipeJEI recipe)
{
@ -39,6 +31,11 @@ public class AltarRecipeHandler implements IRecipeHandler<AltarRecipeJEI>
@Override
public boolean isRecipeValid(@Nonnull AltarRecipeJEI recipe)
{
return recipe.getInputs().size() > 0 && recipe.getOutputs().size() > 0;
return true;
}
@Override
public String getRecipeCategoryUid() {
return null;
}
}

View file

@ -2,13 +2,12 @@ package WayofTime.bloodmagic.compat.jei.altar;
import java.awt.Color;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import WayofTime.bloodmagic.util.helper.NumeralHelper;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
@ -18,7 +17,6 @@ public class AltarRecipeJEI extends BlankRecipeWrapper
{
@Nonnull
private final List<ItemStack> input;
@Nonnull
private final ItemStack output;
@ -37,18 +35,11 @@ public class AltarRecipeJEI extends BlankRecipeWrapper
}
@Override
public List<List<ItemStack>> getInputs()
{
return Collections.singletonList(input);
public void getIngredients(IIngredients ingredients) {
ingredients.setInputs(ItemStack.class, input);
ingredients.setOutput(ItemStack.class, output);
}
@Override
public List<ItemStack> getOutputs()
{
return Collections.singletonList(output);
}
@Nullable
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
@ -57,9 +48,8 @@ public class AltarRecipeJEI extends BlankRecipeWrapper
{
ret.add(TextHelper.localize("jei.BloodMagic.recipe.consumptionRate", consumptionRate));
ret.add(TextHelper.localize("jei.BloodMagic.recipe.drainRate", drainRate));
return ret;
}
return null;
return ret;
}
@Override

View file

@ -1,7 +0,0 @@
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
package WayofTime.bloodmagic.compat.jei.altar;
import mcp.MethodsReturnNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;

View file

@ -1,14 +1,13 @@
package WayofTime.bloodmagic.compat.jei.armourDowngrade;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import mezz.jei.api.gui.ICraftingGridHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
@ -63,15 +62,15 @@ public class ArmourDowngradeRecipeCategory implements IRecipeCategory
}
@Nullable
@Override
public void drawAnimations(Minecraft minecraft)
{
public IDrawable getIcon() {
return null;
}
@Override
@SuppressWarnings("unchecked")
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
@ -89,10 +88,20 @@ public class ArmourDowngradeRecipeCategory implements IRecipeCategory
if (recipeWrapper instanceof ArmourDowngradeRecipeJEI)
{
ArmourDowngradeRecipeJEI recipe = (ArmourDowngradeRecipeJEI) recipeWrapper;
guiItemStacks.set(KEY_SLOT, (ArrayList<ItemStack>) recipe.getInputs().get(1));
craftingGridHelper.setOutput(guiItemStacks, recipe.getOutputs());
craftingGridHelper.setInput(guiItemStacks, (List) recipe.getInputs().get(0), 3, 2);
guiItemStacks.set(KEY_SLOT, ingredients.getInputs(ItemStack.class).get(ingredients.getInputs(ItemStack.class).size() - 1));
ingredients.getInputs(ItemStack.class).remove(ingredients.getInputs(ItemStack.class).size() - 1);
guiItemStacks.set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
craftingGridHelper.setInputStacks(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2);
}
}
@Override
public void drawAnimations(Minecraft minecraft) {
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper) {
}
}

View file

@ -15,14 +15,6 @@ public class ArmourDowngradeRecipeHandler implements IRecipeHandler<ArmourDowngr
return ArmourDowngradeRecipeJEI.class;
}
@Deprecated
@Nonnull
@Override
public String getRecipeCategoryUid()
{
return Constants.Compat.JEI_CATEGORY_ARMOURDOWNGRADE;
}
@Nonnull
@Override
public String getRecipeCategoryUid(ArmourDowngradeRecipeJEI recipe)
@ -40,6 +32,11 @@ public class ArmourDowngradeRecipeHandler implements IRecipeHandler<ArmourDowngr
@Override
public boolean isRecipeValid(@Nonnull ArmourDowngradeRecipeJEI recipe)
{
return recipe.getInputs().get(0).size() > 0 && recipe.getOutputs().size() > 0;
return true;
}
@Override
public String getRecipeCategoryUid() {
return null;
}
}

View file

@ -1,65 +1,34 @@
package WayofTime.bloodmagic.compat.jei.armourDowngrade;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
import com.google.common.collect.Lists;
import lombok.Getter;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import net.minecraft.item.ItemStack;
import WayofTime.bloodmagic.api.recipe.LivingArmourDowngradeRecipe;
import WayofTime.bloodmagic.api.util.helper.ItemHelper.LivingUpgrades;
import WayofTime.bloodmagic.registry.ModItems;
import com.google.common.collect.Lists;
import java.util.List;
public class ArmourDowngradeRecipeJEI extends BlankRecipeWrapper
{
@Getter
private LivingArmourDowngradeRecipe recipe;
// @Getter
// private ArrayList<ItemStack> validGems = new ArrayList<ItemStack>();
public ArmourDowngradeRecipeJEI(LivingArmourDowngradeRecipe recipe)
{
this.recipe = recipe;
}
@Override
@Nonnull
public List<Collection> getInputs()
{
ArrayList<Collection> ret = new ArrayList<Collection>();
ret.add(recipe.getInput());
ret.add(Lists.newArrayList(recipe.getKey()));
return ret;
}
@Override
@Nonnull
public List<ItemStack> getOutputs()
{
public void getIngredients(IIngredients ingredients) {
List<List<ItemStack>> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput());
expanded.add(Lists.newArrayList(recipe.getKey()));
ingredients.setInputLists(ItemStack.class, expanded);
ItemStack upgradeStack = new ItemStack(ModItems.UPGRADE_TOME);
LivingUpgrades.setUpgrade(upgradeStack, recipe.getRecipeOutput());
return Collections.singletonList(upgradeStack);
}
@Nullable
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
// ArrayList<String> ret = new ArrayList<String>();
// if (mouseX >= 58 && mouseX <= 78 && mouseY >= 21 && mouseY <= 34)
// {
// ret.add(TextHelper.localize("jei.BloodMagic.recipe.lpDrained", recipe.getLpDrained()));
// ret.add(TextHelper.localize("jei.BloodMagic.recipe.ticksRequired", recipe.getTicksRequired()));
// return ret;
// }
return null;
ingredients.setOutput(ItemStack.class, upgradeStack);
}
}

View file

@ -1,7 +0,0 @@
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
package WayofTime.bloodmagic.compat.jei.armourDowngrade;
import mcp.MethodsReturnNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;

View file

@ -1,9 +1,11 @@
package WayofTime.bloodmagic.compat.jei.binding;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
@ -51,26 +53,33 @@ public class BindingRecipeCategory implements IRecipeCategory
}
@Nullable
@Override
public void drawAnimations(Minecraft minecraft)
{
public IDrawable getIcon() {
return null;
}
@Override
@SuppressWarnings("unchecked")
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
{
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 0, 5);
recipeLayout.getItemStacks().init(CATALYST_SLOT, true, 29, 3);
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 73, 5);
if (recipeWrapper instanceof BindingRecipeJEI)
{
BindingRecipeJEI bindingRecipe = (BindingRecipeJEI) recipeWrapper;
recipeLayout.getItemStacks().set(INPUT_SLOT, bindingRecipe.getInputs());
recipeLayout.getItemStacks().set(CATALYST_SLOT, bindingRecipe.getCatalyst());
recipeLayout.getItemStacks().set(OUTPUT_SLOT, bindingRecipe.getOutputs());
recipeLayout.getItemStacks().set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0));
recipeLayout.getItemStacks().set(CATALYST_SLOT, ingredients.getInputs(ItemStack.class).get(1));
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
}
}
@Override
public void drawAnimations(Minecraft minecraft) {
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper) {
}
}

View file

@ -15,14 +15,6 @@ public class BindingRecipeHandler implements IRecipeHandler<BindingRecipeJEI>
return BindingRecipeJEI.class;
}
@Deprecated
@Nonnull
@Override
public String getRecipeCategoryUid()
{
return Constants.Compat.JEI_CATEGORY_BINDING;
}
@Override
public String getRecipeCategoryUid(@Nonnull BindingRecipeJEI recipe)
{
@ -39,6 +31,11 @@ public class BindingRecipeHandler implements IRecipeHandler<BindingRecipeJEI>
@Override
public boolean isRecipeValid(@Nonnull BindingRecipeJEI recipe)
{
return recipe.getInputs().size() > 0 && recipe.getOutputs().size() > 0;
return true;
}
@Override
public String getRecipeCategoryUid() {
return null;
}
}

View file

@ -1,10 +1,11 @@
package WayofTime.bloodmagic.compat.jei.binding;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull;
import com.google.common.collect.Lists;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import net.minecraft.item.ItemStack;
@ -28,21 +29,9 @@ public class BindingRecipeJEI extends BlankRecipeWrapper
}
@Override
@Nonnull
public List<ItemStack> getInputs()
{
return inputs;
}
public void getIngredients(IIngredients ingredients) {
public ItemStack getCatalyst()
{
return catalyst;
}
@Override
@Nonnull
public List<ItemStack> getOutputs()
{
return Collections.singletonList(output);
ingredients.setInputLists(ItemStack.class, Lists.newArrayList(inputs, Lists.newArrayList(catalyst)));
ingredients.setOutput(ItemStack.class, output);
}
}

View file

@ -1,7 +0,0 @@
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
package WayofTime.bloodmagic.compat.jei.binding;
import mcp.MethodsReturnNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;

View file

@ -1,14 +1,15 @@
package WayofTime.bloodmagic.compat.jei.forge;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import mezz.jei.api.gui.ICraftingGridHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
@ -63,15 +64,15 @@ public class TartaricForgeRecipeCategory implements IRecipeCategory
}
@Nullable
@Override
public void drawAnimations(Minecraft minecraft)
public IDrawable getIcon()
{
return null;
}
@Override
@SuppressWarnings("unchecked")
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
@ -87,12 +88,25 @@ public class TartaricForgeRecipeCategory implements IRecipeCategory
}
}
List<List<ItemStack>> inputs = ingredients.getInputs(ItemStack.class);
if (recipeWrapper instanceof TartaricForgeRecipeJEI)
{
TartaricForgeRecipeJEI recipe = (TartaricForgeRecipeJEI) recipeWrapper;
guiItemStacks.set(GEM_SLOT, (ArrayList<ItemStack>) recipe.getInputs().get(1));
craftingGridHelper.setOutput(guiItemStacks, recipe.getOutputs());
craftingGridHelper.setInput(guiItemStacks, (List) recipe.getInputs().get(0), 2, 3);
guiItemStacks.set(GEM_SLOT, ingredients.getInputs(ItemStack.class).get(ingredients.getInputs(ItemStack.class).size() - 1));
inputs.remove(ingredients.getInputs(ItemStack.class).size() - 1);
guiItemStacks.set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
guiItemStacks.set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0));
craftingGridHelper.setInputStacks(guiItemStacks, inputs);
}
}
@Override
public void drawAnimations(Minecraft minecraft) {
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper) {
}
}

View file

@ -15,14 +15,6 @@ public class TartaricForgeRecipeHandler implements IRecipeHandler<TartaricForgeR
return TartaricForgeRecipeJEI.class;
}
@Deprecated
@Nonnull
@Override
public String getRecipeCategoryUid()
{
return Constants.Compat.JEI_CATEGORY_SOULFORGE;
}
@Override
public String getRecipeCategoryUid(@Nonnull TartaricForgeRecipeJEI recipe)
{
@ -39,6 +31,11 @@ public class TartaricForgeRecipeHandler implements IRecipeHandler<TartaricForgeR
@Override
public boolean isRecipeValid(@Nonnull TartaricForgeRecipeJEI recipe)
{
return recipe.getInputs().get(0).size() > 0 && recipe.getOutputs().size() > 0;
return true;
}
@Override
public String getRecipeCategoryUid() {
return null;
}
}

View file

@ -8,7 +8,10 @@ import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
import com.google.common.collect.Lists;
import lombok.Getter;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import net.minecraft.item.ItemStack;
import WayofTime.bloodmagic.api.recipe.TartaricForgeRecipe;
@ -20,7 +23,7 @@ public class TartaricForgeRecipeJEI extends BlankRecipeWrapper
@Getter
private TartaricForgeRecipe recipe;
@Getter
private ArrayList<ItemStack> validGems = new ArrayList<ItemStack>();
private List<ItemStack> validGems = new ArrayList<ItemStack>();
public TartaricForgeRecipeJEI(TartaricForgeRecipe recipe)
{
@ -32,20 +35,11 @@ public class TartaricForgeRecipeJEI extends BlankRecipeWrapper
}
@Override
@Nonnull
public List<Collection> getInputs()
{
ArrayList<Collection> ret = new ArrayList<Collection>();
ret.add(recipe.getInput());
ret.add(validGems);
return ret;
}
@Override
@Nonnull
public List<ItemStack> getOutputs()
{
return Collections.singletonList(recipe.getRecipeOutput());
public void getIngredients(IIngredients ingredients) {
List<List<ItemStack>> expandedInputs = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput());
expandedInputs.add(validGems);
ingredients.setInputLists(ItemStack.class, expandedInputs);
ingredients.setOutput(ItemStack.class, recipe.getRecipeOutput());
}
@Nullable

Some files were not shown because too many files have changed in this diff Show more