Compare commits
84 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
730b26b5ac | ||
![]() |
51f597321d | ||
![]() |
70253f4030 | ||
![]() |
f27511c1d1 | ||
![]() |
f18b60d062 | ||
![]() |
7a126f4474 | ||
![]() |
2ce43cfd7b | ||
![]() |
11c869a753 | ||
![]() |
44c132498f | ||
![]() |
1a407276de | ||
![]() |
9a7db207a2 | ||
![]() |
016ba64c54 | ||
![]() |
4b14eac1db | ||
![]() |
066cf5909c | ||
![]() |
375e3b0ee2 | ||
![]() |
4cce468ede | ||
![]() |
717279db4b | ||
![]() |
324d49e3ac | ||
![]() |
078ab16b43 | ||
![]() |
1e25a48709 | ||
![]() |
3be9bdf4bc | ||
![]() |
5ea7177bdb | ||
![]() |
f44ad3a449 | ||
![]() |
0b0ec65ece | ||
![]() |
e91a3b348f | ||
![]() |
dd2c6915f3 | ||
![]() |
692c69865a | ||
![]() |
ad46745879 | ||
![]() |
c607a1ccad | ||
![]() |
f845c1306d | ||
![]() |
f4d1bb6ca6 | ||
![]() |
2b92151419 | ||
![]() |
ed0bde22e8 | ||
![]() |
9822a79265 | ||
![]() |
9540df7cf1 | ||
![]() |
22354eaa0a | ||
![]() |
acf2d683c7 | ||
![]() |
0b93c11733 | ||
![]() |
fedea85993 | ||
![]() |
719cff06e1 | ||
![]() |
3f24e464e6 | ||
![]() |
c4f92708b1 | ||
![]() |
32668f70ca | ||
![]() |
970acd4e69 | ||
![]() |
b55b453e6d | ||
![]() |
e8f0194ed8 | ||
![]() |
a8f8ad575d | ||
![]() |
461c4762fe | ||
![]() |
0d4524cafc | ||
![]() |
1fb221c7f0 | ||
![]() |
4ac87f5e8a | ||
![]() |
f0e3aa6602 | ||
![]() |
2ee2cc5ee6 | ||
![]() |
5bf5fd570d | ||
![]() |
9027f767a6 | ||
![]() |
ddb7542827 | ||
![]() |
9cbec7dd37 | ||
![]() |
e092161a39 | ||
![]() |
2d02bcf37b | ||
![]() |
55949109e1 | ||
![]() |
dea31f5f36 | ||
![]() |
8040d85e97 | ||
![]() |
bb9347ba5a | ||
![]() |
24f110f790 | ||
![]() |
8a8bff865f | ||
![]() |
6802bc5f47 | ||
![]() |
59920ef34f | ||
![]() |
13228f61da | ||
![]() |
305e001b15 | ||
![]() |
85a8a12a6f | ||
![]() |
7b21439a03 | ||
![]() |
6ff12aa0fe | ||
![]() |
4c614df15e | ||
![]() |
b6eae2fc67 | ||
![]() |
c7f2b7d29c | ||
![]() |
09007c58b2 | ||
![]() |
fffed0e34c | ||
![]() |
5c1b8b17bd | ||
![]() |
a5449d3abc | ||
![]() |
f08307180c | ||
![]() |
afa3d1ef91 | ||
![]() |
082d2b8f4d | ||
![]() |
ae2ff03547 | ||
![]() |
a5a17f6b04 |
|
@ -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
|
||||
|
|
33
README.md
33
README.md
|
@ -1,31 +1,28 @@
|
|||
#Blood Magic: Alchemical Wizardry [](https://minecraft.curseforge.com/projects/blood-magic)
|
||||
# Blood Magic: Alchemical Wizardry [](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
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||
|
|
21
build.gradle
21
build.gradle
|
@ -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
|
||||
|
|
120
changelog.txt
120
changelog.txt
|
@ -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
|
||||
------------------------------------------------------
|
||||
|
|
|
@ -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
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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()))
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -81,7 +81,7 @@ public class BlockAlchemyArray extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
public boolean causesSuffocation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -119,7 +119,7 @@ public class BlockAltar extends BlockContainer implements IVariantProvider, IDoc
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
public boolean causesSuffocation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class BlockDemonCrucible extends BlockContainer implements IVariantProvid
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
public boolean causesSuffocation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -61,7 +61,7 @@ public class BlockDemonCrystallizer extends BlockContainer implements IVariantPr
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
public boolean causesSuffocation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public class BlockDemonPylon extends BlockContainer implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
public boolean causesSuffocation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ public class BlockDimensionalPortal extends BlockIntegerContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
public boolean causesSuffocation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ public class BlockIncenseAltar extends BlockContainer implements IVariantProvide
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
public boolean causesSuffocation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ public class BlockInversionPillar extends BlockEnumContainer<EnumSubWillType> im
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
public boolean causesSuffocation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ public class BlockInversionPillarEnd extends BlockEnum<EnumInversionCap> impleme
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
public boolean causesSuffocation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -196,7 +196,7 @@ public class BlockMimic extends BlockEnumContainer<EnumMimic> implements IVarian
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
public boolean causesSuffocation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public class BlockPhantom extends BlockContainer implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
public boolean causesSuffocation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -72,7 +72,7 @@ public abstract class BlockRoutingNode extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
public boolean causesSuffocation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ public class BlockSoulForge extends BlockContainer implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
public boolean causesSuffocation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ public class BlockSpectral extends BlockContainer implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
public boolean causesSuffocation()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -7,7 +7,9 @@ import net.minecraft.util.IStringSerializable;
|
|||
public enum EnumRitualController implements IStringSerializable
|
||||
{
|
||||
MASTER,
|
||||
IMPERFECT;
|
||||
IMPERFECT,
|
||||
INVERTED,
|
||||
;
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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");
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -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)));
|
||||
}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
package WayofTime.bloodmagic.command;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
|
@ -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")));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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))));
|
||||
}
|
||||
}
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
package WayofTime.bloodmagic.command.sub;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
package WayofTime.bloodmagic.compat.jei.alchemyArray;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
package WayofTime.bloodmagic.compat.jei.alchemyTable;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
|
@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
package WayofTime.bloodmagic.compat.jei.altar;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
|
@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
package WayofTime.bloodmagic.compat.jei.armourDowngrade;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
|
@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
package WayofTime.bloodmagic.compat.jei.binding;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
|
@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
Loading…
Reference in a new issue