Compare commits
27 commits
1.16.3
...
1.12_bulli
Author | SHA1 | Date | |
---|---|---|---|
![]() |
dce2817b8c | ||
![]() |
03b4b5e2d7 | ||
![]() |
67b4b7f9b1 | ||
![]() |
7cac007b11 | ||
![]() |
9de2354e64 | ||
![]() |
e2538d9291 | ||
![]() |
2a1911ea07 | ||
![]() |
a0cd54969b | ||
![]() |
96c617886a | ||
![]() |
59a9394f99 | ||
![]() |
c58e29eeea | ||
![]() |
dd1dafe3dc | ||
![]() |
4c44c871e7 | ||
![]() |
4a47f5cbdc | ||
![]() |
9133fdc167 | ||
![]() |
e4384dcec4 | ||
![]() |
114b0c3eda | ||
![]() |
fb2ea2a4fe | ||
![]() |
dc5bfac313 | ||
![]() |
9004bccba1 | ||
![]() |
acc0acb806 | ||
![]() |
36ce215b6b | ||
![]() |
c00affa4aa | ||
![]() |
c23d577c33 | ||
![]() |
59df51a66b | ||
![]() |
d587a8c96f | ||
![]() |
b0404599c2 |
|
@ -9,4 +9,4 @@ mappings_version=snapshot_20170814
|
|||
|
||||
jei_version=4.7.5.85
|
||||
waila_version=1.8.20-B35
|
||||
guideapi_version=2.1.4-56
|
||||
guideapi_version=2.1.4-57
|
|
@ -1,9 +1,7 @@
|
|||
package WayofTime.bloodmagic;
|
||||
|
||||
import WayofTime.bloodmagic.annot.Handler;
|
||||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
||||
import WayofTime.bloodmagic.api.registry.RitualRegistry;
|
||||
import WayofTime.bloodmagic.api.util.helper.LogHelper;
|
||||
import WayofTime.bloodmagic.api_impl.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.apiv2.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.apiv2.IBloodMagicPlugin;
|
||||
|
@ -16,8 +14,8 @@ import WayofTime.bloodmagic.network.BloodMagicPacketHandler;
|
|||
import WayofTime.bloodmagic.proxy.CommonProxy;
|
||||
import WayofTime.bloodmagic.registry.*;
|
||||
import WayofTime.bloodmagic.structures.ModDungeons;
|
||||
import WayofTime.bloodmagic.util.BloodMagicIsntReadyYetStopTryingToUseItAndJustWaitForMeToFinishPleaseAndThankYou;
|
||||
import WayofTime.bloodmagic.util.PluginUtil;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import WayofTime.bloodmagic.util.handler.IMCHandler;
|
||||
import com.google.common.collect.Lists;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
@ -29,24 +27,27 @@ import net.minecraftforge.fml.common.SidedProxy;
|
|||
import net.minecraftforge.fml.common.event.*;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
@Mod(modid = BloodMagic.MODID, name = BloodMagic.NAME, version = BloodMagic.VERSION, dependencies = BloodMagic.DEPEND, guiFactory = "WayofTime.bloodmagic.client.gui.config.ConfigGuiFactory")
|
||||
@Mod(modid = BloodMagic.MODID, name = BloodMagic.NAME, version = BloodMagic.VERSION, dependencies = BloodMagic.DEPEND)
|
||||
public class BloodMagic {
|
||||
public static final String MODID = "bloodmagic";
|
||||
public static final String NAME = "Blood Magic: Alchemical Wizardry";
|
||||
public static final String VERSION = "@VERSION@";
|
||||
public static final String DEPEND = "required-after:guideapi;";
|
||||
public static final boolean IS_DEV = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
|
||||
public static final Logger LOGGER = LogManager.getLogger(NAME.substring(0, NAME.indexOf(":")));
|
||||
public static final List<Pair<IBloodMagicPlugin, BloodMagicPlugin>> PLUGINS = Lists.newArrayList();
|
||||
public static final CreativeTabs TAB_BM = new CreativeTabs(MODID + ".creativeTab") {
|
||||
@Override
|
||||
public ItemStack getTabIconItem() {
|
||||
return OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_WEAK);
|
||||
}
|
||||
};
|
||||
public static final boolean IS_DEV = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
|
||||
public static final List<Pair<IBloodMagicPlugin, BloodMagicPlugin>> PLUGINS = Lists.newArrayList();
|
||||
public static CreativeTabs TAB_TOMES = new CreativeTabs(MODID + ".creativeTabTome") {
|
||||
@Override
|
||||
public ItemStack getTabIconItem() {
|
||||
|
@ -68,28 +69,26 @@ public class BloodMagic {
|
|||
FluidRegistry.enableUniversalBucket();
|
||||
}
|
||||
|
||||
public LogHelper logger = new LogHelper(MODID);
|
||||
private File configDir;
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
configDir = new File(event.getModConfigurationDirectory(), "BloodMagic");
|
||||
ConfigHandler.init(new File(configDir, "BloodMagic.cfg"));
|
||||
if (!IS_DEV)
|
||||
throw new BloodMagicIsntReadyYetStopTryingToUseItAndJustWaitForMeToFinishPleaseAndThankYou();
|
||||
|
||||
configDir = new File(event.getModConfigurationDirectory(), "bloodmagic");
|
||||
|
||||
PLUGINS.addAll(PluginUtil.getPlugins(event.getAsmData()));
|
||||
|
||||
ModTranquilityHandlers.init();
|
||||
ModDungeons.init();
|
||||
|
||||
Utils.registerHandlers(event.getAsmData().getAll(Handler.class.getCanonicalName()));
|
||||
proxy.preInit();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
BloodMagicPacketHandler.init();
|
||||
for (Pair<IBloodMagicPlugin, BloodMagicPlugin> plugin : PLUGINS)
|
||||
plugin.getLeft().register(BloodMagicAPI.INSTANCE);
|
||||
|
||||
ModRecipes.init();
|
||||
ModRituals.initRituals();
|
||||
|
@ -106,6 +105,9 @@ public class BloodMagic {
|
|||
public void postInit(FMLPostInitializationEvent event) {
|
||||
ModRecipes.addCompressionHandlers();
|
||||
|
||||
for (Pair<IBloodMagicPlugin, BloodMagicPlugin> plugin : PLUGINS)
|
||||
plugin.getLeft().register(BloodMagicAPI.INSTANCE);
|
||||
|
||||
proxy.postInit();
|
||||
}
|
||||
|
||||
|
@ -128,4 +130,9 @@ public class BloodMagic {
|
|||
public void onIMCRecieved(FMLInterModComms.IMCEvent event) {
|
||||
IMCHandler.handleIMC(event);
|
||||
}
|
||||
|
||||
public static void debug(String message, Object... args) {
|
||||
if (IS_DEV)
|
||||
LOGGER.info("[DEBUG] " + message, args);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,352 +1,115 @@
|
|||
package WayofTime.bloodmagic;
|
||||
|
||||
import WayofTime.bloodmagic.annot.Handler;
|
||||
import WayofTime.bloodmagic.api.BlockStack;
|
||||
import WayofTime.bloodmagic.api.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.meteor.MeteorConfigHandler;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Config;
|
||||
import net.minecraftforge.common.config.ConfigManager;
|
||||
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
@Handler
|
||||
@Config(modid = BloodMagic.MODID, name = BloodMagic.MODID + "/" + BloodMagic.MODID, category = "")
|
||||
@Mod.EventBusSubscriber(modid = BloodMagic.MODID)
|
||||
public class ConfigHandler {
|
||||
public static Configuration config;
|
||||
|
||||
// Teleposer
|
||||
public static String[] teleposerBlacklisting;
|
||||
public static ArrayList<BlockStack> teleposerBlacklist = new ArrayList<>();
|
||||
public static List<String> teleposerBlacklistEntity;
|
||||
@Config.Comment({ "Blacklist options for various features" })
|
||||
public static ConfigBlacklist blacklist = new ConfigBlacklist();
|
||||
@Config.Comment({ "Value modifiers for various features" })
|
||||
public static ConfigValues values = new ConfigValues();
|
||||
@Config.Comment({ "Toggles for all rituals" })
|
||||
public static ConfigRituals rituals = new ConfigRituals();
|
||||
@Config.Comment({ "Settings that only pertain to the client" })
|
||||
public static ConfigClient client = new ConfigClient();
|
||||
@Config.Comment({ "Compatibility settings" })
|
||||
public static ConfigCompat compat = new ConfigCompat();
|
||||
|
||||
// Transposition Sigil
|
||||
public static String[] transpositionBlacklisting;
|
||||
public static ArrayList<BlockStack> transpositionBlacklist = new ArrayList<>();
|
||||
public static class ConfigBlacklist {
|
||||
@Config.Comment({ "Stops listed blocks and entities from being teleposed.", "Use the registry name of the block or entity. Vanilla objects do not require the modid.", "If a block is specified, you can list the variants to only blacklist a given state." })
|
||||
public String[] teleposer = { "bedrock", "mob_spawner" };
|
||||
@Config.Comment({ "Stops listed blocks from being transposed.", "Use the registry name of the block. Vanilla blocks do not require the modid." })
|
||||
public String[] transposer = { "bedrock", "mob_spawner" };
|
||||
@Config.Comment({ "Stops the listed entities from being used in the Well of Suffering.", "Use the registry name of the entity. Vanilla entities do not require the modid." })
|
||||
public String[] wellOfSuffering = { };
|
||||
}
|
||||
|
||||
// Well of Suffering Blacklist
|
||||
public static List<String> wellOfSufferingBlacklist;
|
||||
public static class ConfigValues {
|
||||
@Config.Comment({ "Declares the amount of LP gained per HP sacrificed for the given entity.", "Setting the value to 0 will blacklist it.", "Use the registry name of the entity followed by a ';' and then the value you want.", "Vanilla entities do not require the modid." })
|
||||
public String[] sacrificialValues = { "villager;100", "slime;15", "enderman;10", "cow;100", "chicken;100", "horse;100", "sheep;100", "wolf;100", "ocelot;100", "pig;100", "rabbit;100" };
|
||||
@Config.Comment({ "Amount of LP the Coat of Arms should provide for each damage dealt." })
|
||||
@Config.RangeInt(min = 0, max = 100)
|
||||
public int coatOfArmsConversion = 20;
|
||||
@Config.Comment({ "Amount of LP the Sacrificial Dagger should provide for each damage dealt." })
|
||||
@Config.RangeInt(min = 0, max = 10000)
|
||||
public int sacrificialDaggerConversion = 100;
|
||||
@Config.Comment({ "Will rewrite any default meteor types with new versions.", "Disable this if you want any of your changes to stay, or do not want default meteor types regenerated." })
|
||||
public boolean shouldResyncMeteors = true;
|
||||
}
|
||||
|
||||
// Blood Altar Sacrificial Values
|
||||
public static String[] entitySacrificeValuesList;
|
||||
public static Map<String, Integer> entitySacrificeValues = new HashMap<>();
|
||||
public static class ConfigRituals {
|
||||
public boolean ritualAnimalGrowth = true;
|
||||
public boolean ritualContainment = true;
|
||||
public boolean ritualCrushing = true;
|
||||
public boolean ritualExpulsion = true;
|
||||
public boolean ritualFeatheredKnife = true;
|
||||
public boolean ritualFullStomach = true;
|
||||
public boolean ritualGreenGrove = true;
|
||||
public boolean ritualHarvest = true;
|
||||
public boolean ritualInterdiction = true;
|
||||
public boolean ritualJumping = true;
|
||||
public boolean ritualLava = true;
|
||||
public boolean ritualMagnetic = true;
|
||||
public boolean ritualRegeneration = true;
|
||||
public boolean ritualSpeed = true;
|
||||
public boolean ritualSuppression = true;
|
||||
public boolean ritualWater = true;
|
||||
public boolean ritualWellOfSuffering = true;
|
||||
public boolean ritualZephyr = true;
|
||||
public boolean ritualUpgradeRemove = true;
|
||||
public boolean ritualArmourEvolve = true;
|
||||
public boolean ritualForsakenSoul = true;
|
||||
public boolean ritualCrystalHarvest = true;
|
||||
public boolean ritualPlacer = true;
|
||||
public boolean ritualFelling = true;
|
||||
public boolean ritualPump = true;
|
||||
public boolean ritualAltarBuilder = true;
|
||||
public boolean ritualPortal = true;
|
||||
public boolean ritualMeteor = true;
|
||||
public boolean ritualDowngrade = true;
|
||||
public ConfigImperfectRituals imperfect = new ConfigImperfectRituals();
|
||||
}
|
||||
|
||||
// Rituals
|
||||
public static boolean ritualAnimalGrowth;
|
||||
public static boolean ritualContainment;
|
||||
public static boolean ritualCrushing;
|
||||
public static boolean ritualExpulsion;
|
||||
public static boolean ritualFeatheredKnife;
|
||||
public static boolean ritualFullStomach;
|
||||
public static boolean ritualGreenGrove;
|
||||
public static boolean ritualHarvest;
|
||||
public static boolean ritualInterdiction;
|
||||
public static boolean ritualJumping;
|
||||
public static boolean ritualLava;
|
||||
public static boolean ritualMagnetic;
|
||||
public static boolean ritualRegeneration;
|
||||
public static boolean ritualSpeed;
|
||||
public static boolean ritualSuppression;
|
||||
public static boolean ritualWater;
|
||||
public static boolean ritualWellOfSuffering;
|
||||
public static boolean ritualZephyr;
|
||||
public static boolean ritualUpgradeRemove;
|
||||
public static boolean ritualArmourEvolve;
|
||||
public static boolean ritualForsakenSoul;
|
||||
public static boolean ritualCrystalHarvest;
|
||||
public static class ConfigImperfectRituals {
|
||||
public boolean imperfectRitualNight = true;
|
||||
public boolean imperfectRitualRain = true;
|
||||
public boolean imperfectRitualResistance = true;
|
||||
public boolean imperfectRitualZombie = true;
|
||||
}
|
||||
|
||||
public static boolean cobblestoneRitual;
|
||||
public static boolean placerRitual;
|
||||
public static boolean fellingRitual;
|
||||
public static boolean pumpRitual;
|
||||
public static boolean altarBuilderRitual;
|
||||
public static boolean portalRitual;
|
||||
public static boolean meteorRitual;
|
||||
public static boolean downgradeRitual;
|
||||
public static class ConfigClient {
|
||||
@Config.Comment({ "Always render the beams between routing nodes.", "If disabled, the beams will only render while the Node Router is held." })
|
||||
public boolean alwaysRenderRoutingLines = false;
|
||||
@Config.Comment({ "Completely hide spectral blocks from view.", "If disabled, a transparent block will be displayed." })
|
||||
public boolean invisibleSpectralBlocks = true;
|
||||
@Config.Comment({ "When cycling through slots, the Sigil of Holding will skip over empty slots and move to the next occupied one.", "If disabled, it will behave identically to the default hotbar." })
|
||||
public boolean sigilHoldingSkipsEmptySlots = false;
|
||||
}
|
||||
|
||||
// Imperfect Rituals
|
||||
public static boolean imperfectRitualNight;
|
||||
public static boolean imperfectRitualRain;
|
||||
public static boolean imperfectRitualResistance;
|
||||
public static boolean imperfectRitualZombie;
|
||||
public static class ConfigCompat {
|
||||
@Config.Comment({ "The display mode to use when looking at a Blood Altar.", "ALWAYS - Always display information.", "SIGIL_HELD - Only display information when a Divination or Seers sigil is held in either hand.", "SIGIL_CONTAINED - Only display information when a Divination or Seers sigil is somewhere in the inventory." })
|
||||
public AltarDisplayMode wailaAltarDisplayMode = AltarDisplayMode.SIGIL_HELD;
|
||||
|
||||
// Potion ID's
|
||||
public static int customPotionDrowningID;
|
||||
public static int customPotionBoostID;
|
||||
public static int customPotionProjProtID;
|
||||
public static int customPotionInhibitID;
|
||||
public static int customPotionFlightID;
|
||||
public static int customPotionReciprocationID;
|
||||
public static int customPotionFlameCloakID;
|
||||
public static int customPotionIceCloakID;
|
||||
public static int customPotionHeavyHeartID;
|
||||
public static int customPotionFireFuseID;
|
||||
public static int customPotionPlanarBindingID;
|
||||
public static int customPotionSoulFrayID;
|
||||
public static int customPotionSoulHardenID;
|
||||
public static int customPotionDeafID;
|
||||
public static int customPotionFeatherFallID;
|
||||
public static int customPotionDemonCloakID;
|
||||
public static int customPotionAmphibianID;
|
||||
|
||||
// Potion toggles
|
||||
public static boolean customPotionDrowningEnabled;
|
||||
public static boolean customPotionBoostEnabled;
|
||||
public static boolean customPotionProjProtEnabled;
|
||||
public static boolean customPotionInhibitEnabled;
|
||||
public static boolean customPotionFlightEnabled;
|
||||
public static boolean customPotionReciprocationEnabled;
|
||||
public static boolean customPotionFlameCloakEnabled;
|
||||
public static boolean customPotionIceCloakEnabled;
|
||||
public static boolean customPotionHeavyHeartEnabled;
|
||||
public static boolean customPotionFireFuseEnabled;
|
||||
public static boolean customPotionPlanarBindingEnabled;
|
||||
public static boolean customPotionSoulFrayEnabled;
|
||||
public static boolean customPotionSoulHardenEnabled;
|
||||
public static boolean customPotionDeafEnabled;
|
||||
public static boolean customPotionFeatherFallEnabled;
|
||||
public static boolean customPotionDemonCloakEnabled;
|
||||
public static boolean customPotionAmphibianEnabled;
|
||||
public static boolean vanillaPotionRegenerationEnabled;
|
||||
public static boolean vanillaPotionNightVisionEnabled;
|
||||
public static boolean vanillaPotionFireResistEnabled;
|
||||
public static boolean vanillaPotionWaterBreathingEnabled;
|
||||
public static boolean vanillaPotionSpeedEnabled;
|
||||
public static boolean vanillaPotionHealthEnabled;
|
||||
public static boolean vanillaPotionPoisonEnabled;
|
||||
public static boolean vanillaPotionBlindnessEnabled;
|
||||
public static boolean vanillaPotionWeaknessEnabled;
|
||||
public static boolean vanillaPotionStrengthEnabled;
|
||||
public static boolean vanillaPotionJumpBoostEnabled;
|
||||
public static boolean vanillaPotionSlownessEnabled;
|
||||
public static boolean vanillaPotionMiningEnabled;
|
||||
public static boolean vanillaPotionInvisibilityEnabled;
|
||||
public static boolean vanillaPotionResistanceEnabled;
|
||||
public static boolean vanillaPotionSaturationEnabled;
|
||||
public static boolean vanillaPotionHealthBoostEnabled;
|
||||
public static boolean vanillaPotionAbsorptionEnabled;
|
||||
|
||||
// General
|
||||
public static int sacrificialPackConversion;
|
||||
public static int sacrificialDaggerDamage;
|
||||
public static int sacrificialDaggerConversion;
|
||||
|
||||
// Client
|
||||
public static boolean alwaysRenderRoutingLines;
|
||||
public static boolean invisibleSpectralBlocks;
|
||||
public static boolean sigilHoldingSkipsEmptySlots;
|
||||
|
||||
// Compat
|
||||
public static int wailaAltarDisplayMode;
|
||||
public static boolean thaumcraftGogglesUpgrade;
|
||||
public static boolean ignoreCompressionSpamAddedByCompression;
|
||||
public enum AltarDisplayMode {
|
||||
ALWAYS,
|
||||
SIGIL_HELD,
|
||||
SIGIL_CONTAINED,
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onConfigChanged(ConfigChangedEvent event) {
|
||||
public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) {
|
||||
if (event.getModID().equals(BloodMagic.MODID)) {
|
||||
syncConfig();
|
||||
MeteorConfigHandler.handleMeteors(false);
|
||||
}
|
||||
}
|
||||
|
||||
public static void init(File file) {
|
||||
config = new Configuration(file);
|
||||
syncConfig();
|
||||
}
|
||||
|
||||
public static void syncConfig() {
|
||||
String category;
|
||||
|
||||
category = "Item/Block Blacklisting";
|
||||
config.addCustomCategoryComment(category, "Allows disabling of specific Blocks/Items.\nNote that using this may result in crashes. Use is not supported.");
|
||||
config.setCategoryRequiresMcRestart(category, true);
|
||||
|
||||
category = "Teleposer Blacklist";
|
||||
config.addCustomCategoryComment(category, "Block blacklisting");
|
||||
teleposerBlacklisting = config.getStringList("teleposerBlacklist", category, new String[]{"minecraft:bedrock", "minecraft:mob_spawner"}, "Stops specified blocks from being teleposed. Put entries on new lines. Valid syntax is:\nmodid:blockname:meta");
|
||||
buildBlacklist(teleposerBlacklisting, teleposerBlacklist);
|
||||
teleposerBlacklistEntity = Arrays.asList(config.getStringList("teleposerBlacklistEntity", category, new String[]{}, "Entity class names listed here will not be able to be teleposed."));
|
||||
|
||||
category = "Transposition Sigil Blacklist";
|
||||
config.addCustomCategoryComment(category, "Block blacklisting");
|
||||
transpositionBlacklisting = config.getStringList("transpositionBlacklist", category, new String[]{"minecraft:bedrock", "minecraft:mob_spawner"}, "Stops specified blocks from being teleposed. Put entries on new lines. Valid syntax is:\nmodid:blockname:meta");
|
||||
buildBlacklist(transpositionBlacklisting, transpositionBlacklist);
|
||||
|
||||
category = "Well of Suffering Blacklist";
|
||||
config.addCustomCategoryComment(category, "Entity blacklisting from WoS");
|
||||
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", "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";
|
||||
config.addCustomCategoryComment(category, "Potion settings");
|
||||
config.addCustomCategoryComment(category + ".id", "Potion ID settings");
|
||||
customPotionDrowningID = config.getInt("customPotionDrowningID", category + ".id", 100, 20, Constants.Misc.POTION_ARRAY_SIZE, "ID of the Drowning potion");
|
||||
customPotionBoostID = config.getInt("customPotionBoostID", category + ".id", 101, 20, Constants.Misc.POTION_ARRAY_SIZE, "ID of the Boost potion");
|
||||
customPotionProjProtID = config.getInt("customPotionProjProtID", category + ".id", 102, 20, Constants.Misc.POTION_ARRAY_SIZE, "ID of the Projectile Protection potion");
|
||||
customPotionInhibitID = config.getInt("customPotionInhibitID", category + ".id", 103, 20, Constants.Misc.POTION_ARRAY_SIZE, "ID of the Inhibit potion");
|
||||
customPotionFlightID = config.getInt("customPotionFlightID", category + ".id", 104, 20, Constants.Misc.POTION_ARRAY_SIZE, "ID of the Flight potion");
|
||||
customPotionReciprocationID = config.getInt("customPotionReciprocationID", category + ".id", 105, 20, Constants.Misc.POTION_ARRAY_SIZE, "ID of the Reciprocation potion");
|
||||
customPotionFlameCloakID = config.getInt("customPotionFlameCloakID", category + ".id", 106, 20, Constants.Misc.POTION_ARRAY_SIZE, "ID of the Flame Cloak potion");
|
||||
customPotionIceCloakID = config.getInt("customPotionIceCloakID", category + ".id", 107, 20, Constants.Misc.POTION_ARRAY_SIZE, "ID of the Ice Cloak potion");
|
||||
customPotionHeavyHeartID = config.getInt("customPotionHeavyHeartID", category + ".id", 108, 20, Constants.Misc.POTION_ARRAY_SIZE, "ID of the Heavy Heart potion");
|
||||
customPotionFireFuseID = config.getInt("customPotionFireFuseID", category + ".id", 109, 20, Constants.Misc.POTION_ARRAY_SIZE, "ID of the Fire Fuse potion");
|
||||
customPotionPlanarBindingID = config.getInt("customPotionPlanarBindingID", category + ".id", 110, 20, Constants.Misc.POTION_ARRAY_SIZE, "ID of the Planar Binding potion");
|
||||
customPotionSoulFrayID = config.getInt("customPotionSoulFrayID", category + ".id", 111, 20, Constants.Misc.POTION_ARRAY_SIZE, "ID of the Soul Fray potion");
|
||||
customPotionSoulHardenID = config.getInt("customPotionSoulHardenID", category + ".id", 112, 20, Constants.Misc.POTION_ARRAY_SIZE, "ID of the Soul Harden potion");
|
||||
customPotionDeafID = config.getInt("customPotionDeafID", category + ".id", 113, 20, Constants.Misc.POTION_ARRAY_SIZE, "ID of the Deaf potion");
|
||||
customPotionFeatherFallID = config.getInt("customPotionFeatherFallID", category + ".id", 114, 20, Constants.Misc.POTION_ARRAY_SIZE, "ID of the Feather Fall potion");
|
||||
customPotionDemonCloakID = config.getInt("customPotionDemonCloakID", category + ".id", 115, 20, Constants.Misc.POTION_ARRAY_SIZE, "ID of the Demon Cloak potion");
|
||||
customPotionAmphibianID = config.getInt("customPotionAmphibianID", category + ".id", 116, 20, Constants.Misc.POTION_ARRAY_SIZE, "ID of the Amphibian potion");
|
||||
|
||||
config.addCustomCategoryComment(category + ".toggle", "Toggle potions available in Alchemy");
|
||||
customPotionDrowningEnabled = config.getBoolean("customPotionDrowningEnabled", category + ".toggle", true, "Enables the Drowning potion in Alchemy");
|
||||
customPotionBoostEnabled = config.getBoolean("customPotionBoostEnabled", category + ".toggle", true, "Enables the Boost potion in Alchemy");
|
||||
customPotionProjProtEnabled = config.getBoolean("customPotionProjProtEnabled", category + ".toggle", true, "Enables the Projectile Protection potion in Alchemy");
|
||||
customPotionInhibitEnabled = config.getBoolean("customPotionInhibitEnabled", category + ".toggle", true, "Enables the Inhibit potion in Alchemy");
|
||||
customPotionFlightEnabled = config.getBoolean("customPotionFlightEnabled", category + ".toggle", true, "Enables the Flight potion in Alchemy");
|
||||
customPotionReciprocationEnabled = config.getBoolean("customPotionReciprocationEnabled", category + ".toggle", true, "Enables the Reciprocation potion in Alchemy");
|
||||
customPotionFlameCloakEnabled = config.getBoolean("customPotionFlameCloakEnabled", category + ".toggle", true, "Enables the Flame Cloak potion in Alchemy");
|
||||
customPotionIceCloakEnabled = config.getBoolean("customPotionIceCloakEnabled", category + ".toggle", true, "Enables the Ice Cloak potion in Alchemy");
|
||||
customPotionHeavyHeartEnabled = config.getBoolean("customPotionHeavyHeartEnabled", category + ".toggle", true, "Enables the Heavy Heart potion in Alchemy");
|
||||
customPotionFireFuseEnabled = config.getBoolean("customPotionFireFuseEnabled", category + ".toggle", true, "Enables the Fire Fuse potion in Alchemy");
|
||||
customPotionPlanarBindingEnabled = config.getBoolean("customPotionPlanarBindingEnabled", category + ".toggle", true, "Enables the Planar Binding potion in Alchemy");
|
||||
customPotionSoulFrayEnabled = config.getBoolean("customPotionSoulFrayEnabled", category + ".toggle", true, "Enables the Soul Fray potion in Alchemy");
|
||||
customPotionSoulHardenEnabled = config.getBoolean("customPotionSoulHardenEnabled", category + ".toggle", true, "Enables the Soul Harden potion in Alchemy");
|
||||
customPotionDeafEnabled = config.getBoolean("customPotionDeafEnabled", category + ".toggle", true, "Enables the Deaf potion in Alchemy");
|
||||
customPotionFeatherFallEnabled = config.getBoolean("customPotionFeatherFallEnabled", category + ".toggle", true, "Enables the Feather Fall potion in Alchemy");
|
||||
customPotionDemonCloakEnabled = config.getBoolean("customPotionDemonCloakEnabled", category + ".toggle", true, "Enables the Demon Cloak potion in Alchemy");
|
||||
customPotionAmphibianEnabled = config.getBoolean("customPotionAmphibianEnabled", category + ".toggle", true, "Enables the Amphibian potion in Alchemy");
|
||||
vanillaPotionAbsorptionEnabled = config.getBoolean("vanillaPotionAbsorptionEnabled", category + ".toggle", true, "Enables the Absorption potion in Alchemy");
|
||||
vanillaPotionBlindnessEnabled = config.getBoolean("vanillaPotionBlindnessEnabled", category + ".toggle", true, "Enables the Blindness potion in Alchemy");
|
||||
vanillaPotionFireResistEnabled = config.getBoolean("vanillaPotionFireResistEnabled", category + ".toggle", true, "Enables the Fire Resistance potion in Alchemy");
|
||||
vanillaPotionHealthBoostEnabled = config.getBoolean("vanillaPotionHealthBoostEnabled", category + ".toggle", true, "Enables the Health Boost potion in Alchemy");
|
||||
vanillaPotionHealthEnabled = config.getBoolean("vanillaPotionHealthEnabled", category + ".toggle", true, "Enables the Instant Health potion in Alchemy");
|
||||
vanillaPotionInvisibilityEnabled = config.getBoolean("vanillaPotionInvisibilityEnabled", category + ".toggle", true, "Enables the Invisibility potion in Alchemy");
|
||||
vanillaPotionJumpBoostEnabled = config.getBoolean("vanillaPotionJumpBoostEnabled", category + ".toggle", true, "Enables the Jump Boost potion in Alchemy");
|
||||
vanillaPotionMiningEnabled = config.getBoolean("vanillaPotionMiningEnabled", category + ".toggle", true, "Enables the Mining potion in Alchemy");
|
||||
vanillaPotionPoisonEnabled = config.getBoolean("vanillaPotionPoisonEnabled", category + ".toggle", true, "Enables the Poison potion in Alchemy");
|
||||
vanillaPotionRegenerationEnabled = config.getBoolean("vanillaPotionRegenerationEnabled", category + ".toggle", true, "Enables the Regeneration potion in Alchemy");
|
||||
vanillaPotionNightVisionEnabled = config.getBoolean("vanillaPotionNightVisionEnabled", category + ".toggle", true, "Enables the Night Vision potion in Alchemy");
|
||||
vanillaPotionResistanceEnabled = config.getBoolean("vanillaPotionResistanceEnabled", category + ".toggle", true, "Enables the Resistance potion in Alchemy");
|
||||
vanillaPotionSaturationEnabled = config.getBoolean("vanillaPotionSaturationEnabled", category + ".toggle", true, "Enables the Saturation potion in Alchemy");
|
||||
vanillaPotionSlownessEnabled = config.getBoolean("vanillaPotionSlownessEnabled", category + ".toggle", true, "Enables the Slowness potion in Alchemy");
|
||||
vanillaPotionSpeedEnabled = config.getBoolean("vanillaPotionSpeedEnabled", category + ".toggle", true, "Enables the Speed potion in Alchemy");
|
||||
vanillaPotionStrengthEnabled = config.getBoolean("vanillaPotionStrengthEnabled", category + ".toggle", true, "Enables the Strength potion in Alchemy");
|
||||
vanillaPotionWaterBreathingEnabled = config.getBoolean("vanillaPotionWaterBreathingEnabled", category + ".toggle", true, "Enables the Water Breathing potion in Alchemy");
|
||||
vanillaPotionWeaknessEnabled = config.getBoolean("vanillaPotionWeaknessEnabled", category + ".toggle", true, "Enables the Weakness potion in Alchemy");
|
||||
|
||||
category = "Rituals";
|
||||
config.addCustomCategoryComment(category, "Ritual toggling");
|
||||
config.setCategoryRequiresMcRestart(category, true);
|
||||
ritualAnimalGrowth = config.get(category, "ritualAnimalGrowth", true).getBoolean();
|
||||
ritualContainment = config.get(category, "ritualContainment", true).getBoolean();
|
||||
ritualCrushing = config.get(category, "ritualCrushing", true).getBoolean();
|
||||
ritualExpulsion = config.get(category, "ritualExpulsion", true).getBoolean();
|
||||
ritualFeatheredKnife = config.get(category, "ritualFeatheredKnife", true).getBoolean();
|
||||
ritualFullStomach = config.get(category, "ritualFullStomach", true).getBoolean();
|
||||
ritualGreenGrove = config.get(category, "ritualGreenGrove", true).getBoolean();
|
||||
ritualHarvest = config.get(category, "ritualHarvest", true).getBoolean();
|
||||
ritualInterdiction = config.get(category, "ritualInterdiction", true).getBoolean();
|
||||
ritualJumping = config.get(category, "ritualJumping", true).getBoolean();
|
||||
ritualLava = config.get(category, "ritualLava", true).getBoolean();
|
||||
ritualMagnetic = config.get(category, "ritualMagnetic", true).getBoolean();
|
||||
ritualRegeneration = config.get(category, "ritualRegeneration", true).getBoolean();
|
||||
ritualSpeed = config.get(category, "ritualSpeed", true).getBoolean();
|
||||
ritualSuppression = config.get(category, "ritualSuppression", true).getBoolean();
|
||||
ritualWater = config.get(category, "ritualWater", true).getBoolean();
|
||||
ritualWellOfSuffering = config.get(category, "ritualWellOfSuffering", true).getBoolean();
|
||||
ritualZephyr = config.get(category, "ritualZephyr", true).getBoolean();
|
||||
ritualUpgradeRemove = config.get(category, "ritualRemove", true).getBoolean();
|
||||
ritualArmourEvolve = config.get(category, "ritualArmourEvolve", true).getBoolean();
|
||||
ritualForsakenSoul = config.get(category, "ritualForsakenSoul", true).getBoolean();
|
||||
ritualCrystalHarvest = config.get(category, "ritualCrystalHarvest", true).getBoolean();
|
||||
|
||||
cobblestoneRitual = config.get(category, "ritualCobblestone", true).getBoolean();
|
||||
placerRitual = config.get(category, "ritualPlacer", true).getBoolean();
|
||||
fellingRitual = config.get(category, "ritualFelling", true).getBoolean();
|
||||
pumpRitual = config.get(category, "ritualPump", true).getBoolean();
|
||||
altarBuilderRitual = config.get(category, "ritualAltarBuilder", true).getBoolean();
|
||||
portalRitual = config.get(category, "ritualPortal", true).getBoolean();
|
||||
meteorRitual = config.get(category, "ritualMeteor", true).getBoolean();
|
||||
downgradeRitual = config.get(category, "ritualDowngrade", true).getBoolean();
|
||||
|
||||
category = "Rituals.Imperfect";
|
||||
imperfectRitualNight = config.get(category, "imperfectRitualNight", true).getBoolean();
|
||||
imperfectRitualRain = config.get(category, "imperfectRitualRain", true).getBoolean();
|
||||
imperfectRitualResistance = config.get(category, "imperfectRitualResistance", true).getBoolean();
|
||||
imperfectRitualZombie = config.get(category, "imperfectRitualZombie", true).getBoolean();
|
||||
|
||||
category = "General";
|
||||
config.addCustomCategoryComment(category, "General settings");
|
||||
BloodMagicAPI.loggingEnabled = config.getBoolean("enableLogging", category, true, "Allows logging information to the console. Fatal errors will bypass this");
|
||||
sacrificialPackConversion = config.getInt("sacrificialPackConversion", category, 20, 0, 100, "Base multiplier for the Coat of Arms. DamageDealt * sacrificialPackConversion");
|
||||
sacrificialDaggerDamage = config.getInt("sacrificialDaggerDamage", category, 2, 0, 10000, "Damage done from using the Sacrificial Dagger");
|
||||
sacrificialDaggerConversion = config.getInt("sacrificialDaggerConversion", category, 100, 0, 10000, "Amount of LP received per damage point (not heart!)");
|
||||
|
||||
category = "Client";
|
||||
config.addCustomCategoryComment(category, "Client only settings");
|
||||
alwaysRenderRoutingLines = config.getBoolean("alwaysRenderRoutingLines", category, false, "Always renders the beams between routing nodes. If false, only renders while a Node Router is being held.");
|
||||
invisibleSpectralBlocks = config.get(category, "invisibleSpectralBlocks", true, "Spectral Blocks (Used by the Suppression Sigil to store fluids) will not render at all. If false, a see through texture will render. [default: true]").setRequiresMcRestart(true).getBoolean();
|
||||
sigilHoldingSkipsEmptySlots = config.getBoolean("sigilHoldingSkipsEmptySlots", category, false, "The Sigil of Holding will skip empty sigil slots if set to true.");
|
||||
|
||||
category = "Compatibility";
|
||||
config.addCustomCategoryComment(category, "Compatibility settings");
|
||||
wailaAltarDisplayMode = config.getInt("wailaAltarDisplayMode", category + ".waila", 1, 0, 2, "The mode for the Waila display on Blood Altars.\n0 - Always display information\n1 - Only display when Divination/Seer sigil is in hand.\n2 - Only display when Divination/Seer sigil is in inventory");
|
||||
thaumcraftGogglesUpgrade = config.getBoolean("thaumcraftGogglesUpgrade", category + ".thaumcraft", true, "Allows the Living Helmet to be upgraded with Goggles of Revealing in an Anvil.");
|
||||
ignoreCompressionSpamAddedByCompression = config.getBoolean("ignoreCompressionSpamAddedByCompression", category + ".compression", true, "Compression decided to add a storage recipe for every item and block in the game. This will make the Sigil of Compression ignore those recipes so your game will actually load in a decent amount of time.");
|
||||
|
||||
category = "Meteors";
|
||||
config.addCustomCategoryComment(category, "Meteor settings");
|
||||
|
||||
config.save();
|
||||
}
|
||||
|
||||
private static void buildBlacklist(String[] blacklisting, List<BlockStack> blockBlacklist) {
|
||||
blockBlacklist.clear();
|
||||
|
||||
for (String blockSet : blacklisting) {
|
||||
String[] blockData = blockSet.split(":");
|
||||
|
||||
Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(blockData[0], blockData[1]));
|
||||
int meta = 0;
|
||||
|
||||
if (blockData.length == 3) {
|
||||
// Check if it's an int, if so, parse it. If not, set meta to 0
|
||||
// to avoid crashing.
|
||||
if (Utils.isInteger(blockData[2]))
|
||||
meta = Integer.parseInt(blockData[2]);
|
||||
else if (blockData[2].equals("*"))
|
||||
meta = OreDictionary.WILDCARD_VALUE;
|
||||
else
|
||||
meta = 0;
|
||||
}
|
||||
|
||||
blockBlacklist.add(new BlockStack(block, meta));
|
||||
}
|
||||
}
|
||||
|
||||
private static void buildEntitySacrificeValues() {
|
||||
entitySacrificeValues.clear();
|
||||
|
||||
for (String entityData : entitySacrificeValuesList) {
|
||||
String[] split = entityData.split(";");
|
||||
|
||||
int amount = 500;
|
||||
if (Utils.isInteger(split[1]))
|
||||
amount = Integer.parseInt(split[1]);
|
||||
|
||||
if (!entitySacrificeValues.containsKey(split[0]))
|
||||
entitySacrificeValues.put(split[0], amount);
|
||||
ConfigManager.sync(event.getModID(), Config.Type.INSTANCE); // Sync config values
|
||||
MeteorConfigHandler.handleMeteors(false); // Reload meteors
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,14 +6,12 @@ import WayofTime.bloodmagic.api.altar.*;
|
|||
import WayofTime.bloodmagic.api.event.AltarCraftedEvent;
|
||||
import WayofTime.bloodmagic.api.orb.BloodOrb;
|
||||
import WayofTime.bloodmagic.api.orb.IBloodOrb;
|
||||
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry;
|
||||
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry.AltarRecipe;
|
||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||
import WayofTime.bloodmagic.api_impl.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeBloodAltar;
|
||||
import WayofTime.bloodmagic.block.BlockBloodRune;
|
||||
import WayofTime.bloodmagic.block.BlockLifeEssence;
|
||||
import WayofTime.bloodmagic.tile.TileAltar;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import com.google.common.base.Enums;
|
||||
import com.google.common.base.Strings;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -31,7 +29,6 @@ import net.minecraftforge.fluids.FluidTank;
|
|||
import net.minecraftforge.fluids.capability.FluidTankPropertiesWrapper;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.IFluidTankProperties;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -78,7 +75,7 @@ public class BloodAltar implements IFluidHandler {
|
|||
private int chargingFrequency = 0;
|
||||
private int maxCharge = 0;
|
||||
private int cooldownAfterCrafting = 60;
|
||||
private AltarRecipe recipe;
|
||||
private RecipeBloodAltar recipe;
|
||||
private ItemStack result = ItemStack.EMPTY;
|
||||
private EnumAltarTier currentTierDisplayed = EnumAltarTier.ONE;
|
||||
|
||||
|
@ -189,14 +186,14 @@ public class BloodAltar implements IFluidHandler {
|
|||
|
||||
if (!input.isEmpty()) {
|
||||
// Do recipes
|
||||
AltarRecipe recipe = AltarRecipeRegistry.getRecipeForInput(input);
|
||||
RecipeBloodAltar recipe = BloodMagicAPI.INSTANCE.getRecipeRegistrar().getBloodAltar(input);
|
||||
if (recipe != null) {
|
||||
if (recipe.doesRequiredItemMatch(input, altarTier)) {
|
||||
if (recipe.getMinimumTier().ordinal() <= altarTier.ordinal()) {
|
||||
this.isActive = true;
|
||||
this.recipe = recipe;
|
||||
this.result = recipe.getOutput().isEmpty() ? ItemStack.EMPTY : new ItemStack(recipe.getOutput().getItem(), 1, recipe.getOutput().getMetadata());
|
||||
this.liquidRequired = recipe.getSyphon();
|
||||
this.canBeFilled = recipe.isFillable();
|
||||
this.canBeFilled = false;
|
||||
this.consumptionRate = recipe.getConsumeRate();
|
||||
this.drainRate = recipe.getDrainRate();
|
||||
return;
|
||||
|
@ -318,7 +315,8 @@ public class BloodAltar implements IFluidHandler {
|
|||
if (!result.isEmpty())
|
||||
result.setCount(result.getCount() * stackSize);
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(new AltarCraftedEvent(recipe, result));
|
||||
// TODO - Update for new recipe type
|
||||
// MinecraftForge.EVENT_BUS.post(new AltarCraftedEvent(recipe, result));
|
||||
tileAltar.setInventorySlotContents(0, result);
|
||||
progress = 0;
|
||||
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
package WayofTime.bloodmagic.annot;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Classes annotated with this will automatically be registered to the
|
||||
* {@link net.minecraftforge.common.MinecraftForge#EVENT_BUS}.
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
public @interface Handler {
|
||||
}
|
|
@ -7,10 +7,11 @@ import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
|||
|
||||
import java.util.Locale;
|
||||
|
||||
@Deprecated
|
||||
public class Constants {
|
||||
public static class NBT {
|
||||
public static final String OWNER_UUID = "ownerUUID";
|
||||
public static final String OWNER_NAME = "ownerNAME";
|
||||
public static final String OWNER_UUID = "uuid";
|
||||
public static final String OWNER_NAME = "name";
|
||||
public static final String USES = "uses";
|
||||
public static final String ACTIVATED = "activated";
|
||||
public static final String UNUSABLE = "unusable";
|
||||
|
|
|
@ -120,6 +120,7 @@ public enum EnumAltarTier {
|
|||
//@formatter:on
|
||||
};
|
||||
|
||||
public static final EnumAltarTier[] VALUES = values();
|
||||
public static final int MAXTIERS = values().length;
|
||||
|
||||
ArrayList<AltarComponent> altarComponents = new ArrayList<AltarComponent>();
|
||||
|
|
|
@ -3,6 +3,8 @@ package WayofTime.bloodmagic.api.iface;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Implement this interface on any Item that can be bound to a player.
|
||||
*/
|
||||
|
@ -16,7 +18,10 @@ public interface IBindable {
|
|||
* @param stack - The owned ItemStack
|
||||
* @return - The username of the Item's owner
|
||||
*/
|
||||
String getOwnerName(ItemStack stack);
|
||||
@Nullable
|
||||
default String getOwnerName(ItemStack stack) {
|
||||
return !stack.isEmpty() && stack.hasTagCompound() ? stack.getTagCompound().getString("name") : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the UUID of the Item's owner.
|
||||
|
@ -26,7 +31,10 @@ public interface IBindable {
|
|||
* @param stack - The owned ItemStack
|
||||
* @return - The UUID of the Item's owner
|
||||
*/
|
||||
String getOwnerUUID(ItemStack stack);
|
||||
@Nullable
|
||||
default String getOwnerUUID(ItemStack stack) {
|
||||
return !stack.isEmpty() && stack.hasTagCompound() ? stack.getTagCompound().getString("uuid") : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the player attempts to bind the item.
|
||||
|
@ -35,5 +43,7 @@ public interface IBindable {
|
|||
* @param stack - The ItemStack to attempt binding
|
||||
* @return If binding was successful.
|
||||
*/
|
||||
boolean onBind(EntityPlayer player, ItemStack stack);
|
||||
default boolean onBind(EntityPlayer player, ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,11 +25,11 @@ public class ItemBindable extends Item implements IBindable {
|
|||
|
||||
@Override
|
||||
public String getOwnerName(ItemStack stack) {
|
||||
return !stack.isEmpty() ? stack.getTagCompound().getString(Constants.NBT.OWNER_NAME) : null;
|
||||
return !stack.isEmpty() && stack.hasTagCompound() ? stack.getTagCompound().getString(Constants.NBT.OWNER_NAME) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnerUUID(ItemStack stack) {
|
||||
return !stack.isEmpty() ? stack.getTagCompound().getString(Constants.NBT.OWNER_UUID) : null;
|
||||
return !stack.isEmpty() && stack.hasTagCompound() ? stack.getTagCompound().getString(Constants.NBT.OWNER_UUID) : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
package WayofTime.bloodmagic.api.soul;
|
||||
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.item.types.ISubItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Locale;
|
||||
|
||||
public enum EnumDemonWillType implements IStringSerializable {
|
||||
public enum EnumDemonWillType implements IStringSerializable, ISubItem {
|
||||
DEFAULT("default"),
|
||||
CORROSIVE("corrosive"),
|
||||
DESTRUCTIVE("destructive"),
|
||||
|
@ -26,4 +31,17 @@ public enum EnumDemonWillType implements IStringSerializable {
|
|||
public String getName() {
|
||||
return this.toString();
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getInternalName() {
|
||||
return "crystal" + WordUtils.capitalize(name);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getStack(int count) {
|
||||
return new ItemStack(RegistrarBloodMagicItems.ITEM_DEMON_CRYSTAL, count, ordinal());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ public class PlayerSacrificeHelper {
|
|||
|
||||
if (health > maxHealth / 10.0) {
|
||||
float sacrificedHealth = health - maxHealth / 10.0f;
|
||||
int lpAdded = (int) (sacrificedHealth * ConfigHandler.sacrificialDaggerConversion * getModifier(amount));
|
||||
int lpAdded = (int) (sacrificedHealth * ConfigHandler.values.sacrificialDaggerConversion * getModifier(amount));
|
||||
|
||||
SacrificeKnifeUsedEvent evt = new SacrificeKnifeUsedEvent(player, true, true, (int) sacrificedHealth, lpAdded);
|
||||
if (MinecraftForge.EVENT_BUS.post(evt))
|
||||
|
|
|
@ -2,6 +2,7 @@ package WayofTime.bloodmagic.api_impl;
|
|||
|
||||
import WayofTime.bloodmagic.api.altar.EnumAltarComponent;
|
||||
import WayofTime.bloodmagic.apiv2.IBloodMagicAPI;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Maps;
|
||||
|
@ -9,6 +10,8 @@ import com.google.common.collect.Multimap;
|
|||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import javax.annotation.Nonnegative;
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.*;
|
||||
|
||||
public class BloodMagicAPI implements IBloodMagicAPI {
|
||||
|
@ -16,27 +19,42 @@ public class BloodMagicAPI implements IBloodMagicAPI {
|
|||
public static final BloodMagicAPI INSTANCE = new BloodMagicAPI();
|
||||
|
||||
private final BloodMagicBlacklist blacklist;
|
||||
private final BloodMagicRecipeRegistrar recipeRegistrar;
|
||||
private final Map<ResourceLocation, Integer> sacrificialValues;
|
||||
private final Multimap<EnumAltarComponent, IBlockState> altarComponents;
|
||||
|
||||
public BloodMagicAPI() {
|
||||
this.blacklist = new BloodMagicBlacklist();
|
||||
this.recipeRegistrar = new BloodMagicRecipeRegistrar();
|
||||
this.sacrificialValues = Maps.newHashMap();
|
||||
this.altarComponents = ArrayListMultimap.create();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public BloodMagicBlacklist getBlacklist() {
|
||||
return blacklist;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public void setSacrificialValue(ResourceLocation entityId, int value) {
|
||||
public BloodMagicRecipeRegistrar getRecipeRegistrar() {
|
||||
return recipeRegistrar;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSacrificialValue(@Nonnull ResourceLocation entityId, @Nonnegative int value) {
|
||||
Preconditions.checkNotNull(entityId, "entityId cannot be null.");
|
||||
Preconditions.checkArgument(value >= 0, "value cannot be negative.");
|
||||
|
||||
sacrificialValues.put(entityId, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerAltarComponent(IBlockState state, String componentType) {
|
||||
public void registerAltarComponent(@Nonnull IBlockState state, @Nonnull String componentType) {
|
||||
Preconditions.checkNotNull(state, "state cannot be null.");
|
||||
Preconditions.checkNotNull(componentType, "componentType cannot be null.");
|
||||
|
||||
EnumAltarComponent component = EnumAltarComponent.NOTAIR;
|
||||
for (EnumAltarComponent type : EnumAltarComponent.VALUES) {
|
||||
if (type.name().equalsIgnoreCase(componentType)) {
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
package WayofTime.bloodmagic.api_impl;
|
||||
|
||||
import WayofTime.bloodmagic.apiv2.IBloodMagicBlacklist;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Sets;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Set;
|
||||
|
||||
public class BloodMagicBlacklist implements IBloodMagicBlacklist {
|
||||
|
@ -26,49 +28,65 @@ public class BloodMagicBlacklist implements IBloodMagicBlacklist {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void addTeleposer(IBlockState state) {
|
||||
public void addTeleposer(@Nonnull IBlockState state) {
|
||||
Preconditions.checkNotNull(state, "state cannot be null.");
|
||||
|
||||
if (!teleposer.contains(state))
|
||||
teleposer.add(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTeleposer(Block block) {
|
||||
public void addTeleposer(@Nonnull Block block) {
|
||||
Preconditions.checkNotNull(block, "block cannot be null.");
|
||||
|
||||
for (IBlockState state : block.getBlockState().getValidStates())
|
||||
addTeleposer(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTeleposer(ResourceLocation entityId) {
|
||||
public void addTeleposer(@Nonnull ResourceLocation entityId) {
|
||||
Preconditions.checkNotNull(entityId, "entityId cannot be null.");
|
||||
|
||||
if (!teleposerEntities.contains(entityId))
|
||||
teleposerEntities.add(entityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTransposition(IBlockState state) {
|
||||
public void addTransposition(@Nonnull IBlockState state) {
|
||||
Preconditions.checkNotNull(state, "state cannot be null.");
|
||||
|
||||
if (!transposition.contains(state))
|
||||
transposition.add(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTransposition(Block block) {
|
||||
public void addTransposition(@Nonnull Block block) {
|
||||
Preconditions.checkNotNull(block, "block cannot be null.");
|
||||
|
||||
for (IBlockState state : block.getBlockState().getValidStates())
|
||||
addTransposition(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addGreenGrove(IBlockState state) {
|
||||
public void addGreenGrove(@Nonnull IBlockState state) {
|
||||
Preconditions.checkNotNull(state, "state cannot be null.");
|
||||
|
||||
if (!greenGrove.contains(state))
|
||||
greenGrove.add(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addGreenGrove(Block block) {
|
||||
public void addGreenGrove(@Nonnull Block block) {
|
||||
Preconditions.checkNotNull(block, "block cannot be null.");
|
||||
|
||||
for (IBlockState state : block.getBlockState().getValidStates())
|
||||
addGreenGrove(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSacrifice(ResourceLocation entityId) {
|
||||
public void addWellOfSuffering(@Nonnull ResourceLocation entityId) {
|
||||
Preconditions.checkNotNull(entityId, "entityId cannot be null.");
|
||||
|
||||
if (!sacrifice.contains(entityId))
|
||||
sacrifice.add(entityId);
|
||||
}
|
||||
|
|
|
@ -1,17 +1,26 @@
|
|||
package WayofTime.bloodmagic.api_impl;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.ConfigHandler;
|
||||
import WayofTime.bloodmagic.api.altar.EnumAltarComponent;
|
||||
import WayofTime.bloodmagic.apiv2.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.apiv2.IBloodMagicAPI;
|
||||
import WayofTime.bloodmagic.apiv2.IBloodMagicBlacklist;
|
||||
import WayofTime.bloodmagic.apiv2.IBloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.block.BlockBloodRune;
|
||||
import WayofTime.bloodmagic.block.BlockDecorative;
|
||||
import WayofTime.bloodmagic.block.enums.EnumBloodRune;
|
||||
import WayofTime.bloodmagic.block.enums.EnumDecorative;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicRecipes;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.common.registry.EntityEntry;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
|
||||
@BloodMagicPlugin
|
||||
public class BloodMagicCorePlugin implements IBloodMagicPlugin {
|
||||
|
@ -31,10 +40,13 @@ public class BloodMagicCorePlugin implements IBloodMagicPlugin {
|
|||
api.getBlacklist().addTransposition(RegistrarBloodMagicBlocks.DEMON_CRYSTAL);
|
||||
api.getBlacklist().addTeleposer(RegistrarBloodMagicBlocks.INVERSION_PILLAR);
|
||||
api.getBlacklist().addTransposition(RegistrarBloodMagicBlocks.INVERSION_PILLAR);
|
||||
api.getBlacklist().addSacrifice(new ResourceLocation("armor_stand"));
|
||||
api.getBlacklist().addSacrifice(new ResourceLocation(BloodMagic.MODID, "sentient_specter"));
|
||||
api.getBlacklist().addWellOfSuffering(new ResourceLocation("armor_stand"));
|
||||
api.getBlacklist().addWellOfSuffering(new ResourceLocation(BloodMagic.MODID, "sentient_specter"));
|
||||
|
||||
// TODO - Register things from config
|
||||
api.setSacrificialValue(new ResourceLocation("armor_stand"), 0);
|
||||
api.setSacrificialValue(new ResourceLocation(BloodMagic.MODID, "sentient_specter"), 0);
|
||||
|
||||
handleConfigValues(api);
|
||||
|
||||
// Add standard blocks for altar components
|
||||
api.registerAltarComponent(Blocks.GLOWSTONE.getDefaultState(), EnumAltarComponent.GLOWSTONE.name());
|
||||
|
@ -50,5 +62,84 @@ public class BloodMagicCorePlugin implements IBloodMagicPlugin {
|
|||
BlockBloodRune bloodRune = (BlockBloodRune) RegistrarBloodMagicBlocks.BLOOD_RUNE;
|
||||
for (EnumBloodRune runeType : EnumBloodRune.values())
|
||||
api.registerAltarComponent(bloodRune.getDefaultState().withProperty(bloodRune.getProperty(), runeType), EnumAltarComponent.BLOODRUNE.name());
|
||||
|
||||
RegistrarBloodMagicRecipes.registerAltarRecipes(api.getRecipeRegistrar());
|
||||
RegistrarBloodMagicRecipes.registerAlchemyTableRecipes(api.getRecipeRegistrar());
|
||||
RegistrarBloodMagicRecipes.registerTartaricForgeRecipes(((BloodMagicAPI) api).getRecipeRegistrar());
|
||||
}
|
||||
|
||||
private static void handleConfigValues(IBloodMagicAPI api) {
|
||||
for (String value : ConfigHandler.values.sacrificialValues) {
|
||||
String[] split = value.split(";");
|
||||
if (split.length != 2) // Not valid format
|
||||
continue;
|
||||
|
||||
api.setSacrificialValue(new ResourceLocation(split[0]), Integer.parseInt(split[1]));
|
||||
}
|
||||
|
||||
for (String value : ConfigHandler.blacklist.teleposer) {
|
||||
EntityEntry entityEntry = ForgeRegistries.ENTITIES.getValue(new ResourceLocation(value));
|
||||
if (entityEntry == null) { // It's not an entity (or at least not a valid one), so let's try a block.
|
||||
String[] blockData = value.split("\\[");
|
||||
Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(blockData[0]));
|
||||
if (block == Blocks.AIR || block == null) // Not a valid block either
|
||||
continue;
|
||||
|
||||
if (blockData.length > 1) { // We have properties listed, so let's build a state.
|
||||
api.getBlacklist().addTeleposer(parseState(value));
|
||||
continue;
|
||||
}
|
||||
|
||||
api.getBlacklist().addTeleposer(block);
|
||||
continue;
|
||||
}
|
||||
|
||||
api.getBlacklist().addTeleposer(entityEntry.getRegistryName());
|
||||
}
|
||||
|
||||
for (String value : ConfigHandler.blacklist.transposer) {
|
||||
String[] blockData = value.split("\\[");
|
||||
Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(blockData[0]));
|
||||
if (block == Blocks.AIR || block == null) // Not a valid block
|
||||
continue;
|
||||
|
||||
if (blockData.length > 1) { // We have properties listed, so let's build a state.
|
||||
api.getBlacklist().addTeleposer(parseState(value));
|
||||
continue;
|
||||
}
|
||||
|
||||
api.getBlacklist().addTeleposer(block);
|
||||
}
|
||||
|
||||
for (String value : ConfigHandler.blacklist.wellOfSuffering) {
|
||||
EntityEntry entityEntry = ForgeRegistries.ENTITIES.getValue(new ResourceLocation(value));
|
||||
if (entityEntry == null) // Not a valid entity
|
||||
continue;
|
||||
|
||||
api.getBlacklist().addWellOfSuffering(entityEntry.getRegistryName());
|
||||
}
|
||||
}
|
||||
|
||||
private static IBlockState parseState(String blockInfo) {
|
||||
String[] split = blockInfo.split("\\[");
|
||||
split[1] = split[1].substring(0, split[1].lastIndexOf("]")); // Make sure brackets are removed from state
|
||||
|
||||
Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(split[0])); // Find the block
|
||||
if (block == Blocks.AIR)
|
||||
return Blocks.AIR.getDefaultState(); // The block is air, so we're looking at invalid data
|
||||
|
||||
BlockStateContainer blockState = block.getBlockState();
|
||||
IBlockState returnState = blockState.getBaseState();
|
||||
|
||||
// Force our values into the state
|
||||
String[] stateValues = split[1].split(","); // Splits up each value
|
||||
for (String value : stateValues) {
|
||||
String[] valueSplit = value.split("="); // Separates property and value
|
||||
IProperty property = blockState.getProperty(valueSplit[0]);
|
||||
if (property != null)
|
||||
returnState = returnState.withProperty(property, (Comparable) property.parseValue(valueSplit[1]).get()); // Force the property into the state
|
||||
}
|
||||
|
||||
return returnState;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,185 @@
|
|||
package WayofTime.bloodmagic.api_impl;
|
||||
|
||||
import WayofTime.bloodmagic.api.orb.IBloodOrb;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeAlchemyTable;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeBloodAltar;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeTartaricForge;
|
||||
import WayofTime.bloodmagic.apiv2.IBloodMagicRecipeRegistrar;
|
||||
import WayofTime.bloodmagic.core.recipe.IngredientBloodOrb;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.*;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.common.crafting.CraftingHelper;
|
||||
|
||||
import javax.annotation.Nonnegative;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class BloodMagicRecipeRegistrar implements IBloodMagicRecipeRegistrar {
|
||||
|
||||
private final Set<RecipeBloodAltar> altarRecipes;
|
||||
private final Set<RecipeAlchemyTable> alchemyRecipes;
|
||||
private final Set<RecipeTartaricForge> tartaricForgeRecipes;
|
||||
|
||||
public BloodMagicRecipeRegistrar() {
|
||||
this.altarRecipes = Sets.newHashSet();
|
||||
this.alchemyRecipes = Sets.newHashSet();
|
||||
this.tartaricForgeRecipes = Sets.newHashSet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBloodAltar(@Nonnull Ingredient input, @Nonnull ItemStack output, @Nonnegative int minimumTier, @Nonnegative int syphon, @Nonnegative int consumeRate, @Nonnegative int drainRate) {
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
Preconditions.checkNotNull(output, "output cannot be null.");
|
||||
Preconditions.checkArgument(minimumTier >= 0, "minimumTier cannot be negative.");
|
||||
Preconditions.checkArgument(syphon >= 0, "syphon cannot be negative.");
|
||||
Preconditions.checkArgument(consumeRate >= 0, "consumeRate cannot be negative.");
|
||||
Preconditions.checkArgument(drainRate >= 0, "drainRate cannot be negative.");
|
||||
|
||||
altarRecipes.add(new RecipeBloodAltar(input, output, minimumTier, syphon, consumeRate, drainRate));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeBloodAltar(@Nonnull ItemStack input) {
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
|
||||
return altarRecipes.remove(getBloodAltar(input));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAlchemyTable(@Nonnull ItemStack output, @Nonnegative int syphon, @Nonnegative int ticks, @Nonnegative int minimumTier, @Nonnull Ingredient... input) {
|
||||
Preconditions.checkNotNull(output, "output cannot be null.");
|
||||
Preconditions.checkArgument(syphon >= 0, "syphon cannot be negative.");
|
||||
Preconditions.checkArgument(ticks >= 0, "ticks cannot be negative.");
|
||||
Preconditions.checkArgument(minimumTier >= 0, "minimumTier cannot be negative.");
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
|
||||
NonNullList<Ingredient> inputs = NonNullList.from(Ingredient.EMPTY, input);
|
||||
alchemyRecipes.add(new RecipeAlchemyTable(inputs, output, syphon, ticks, minimumTier));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeAlchemyTable(@Nonnull ItemStack... input) {
|
||||
Preconditions.checkNotNull(input, "inputs cannot be null.");
|
||||
|
||||
for (ItemStack stack : input)
|
||||
Preconditions.checkNotNull(stack, "input cannot be null.");
|
||||
|
||||
return alchemyRecipes.remove(getAlchemyTable(Lists.newArrayList(input)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTartaricForge(@Nonnull ItemStack output, @Nonnegative double minimumSouls, @Nonnegative double soulDrain, @Nonnull Ingredient... input) {
|
||||
Preconditions.checkNotNull(output, "output cannot be null.");
|
||||
Preconditions.checkArgument(minimumSouls >= 0, "minimumSouls cannot be negative.");
|
||||
Preconditions.checkArgument(soulDrain >= 0, "soulDrain cannot be negative.");
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
|
||||
NonNullList<Ingredient> inputs = NonNullList.from(Ingredient.EMPTY, input);
|
||||
tartaricForgeRecipes.add(new RecipeTartaricForge(inputs, output, minimumSouls, soulDrain));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeTartaricForge(@Nonnull ItemStack... input) {
|
||||
Preconditions.checkNotNull(input, "inputs cannot be null.");
|
||||
|
||||
for (ItemStack stack : input)
|
||||
Preconditions.checkNotNull(stack, "input cannot be null.");
|
||||
|
||||
return tartaricForgeRecipes.remove(getTartaricForge(Lists.newArrayList(input)));
|
||||
}
|
||||
|
||||
public void addTartaricForge(@Nonnull ItemStack output, @Nonnegative double minimumSouls, @Nonnegative double soulDrain, @Nonnull Object... input) {
|
||||
Preconditions.checkNotNull(output, "output cannot be null.");
|
||||
Preconditions.checkArgument(minimumSouls >= 0, "minimumSouls cannot be negative.");
|
||||
Preconditions.checkArgument(soulDrain >= 0, "soulDrain cannot be negative.");
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
|
||||
List<Ingredient> ingredients = Lists.newArrayList();
|
||||
for (Object object : input) {
|
||||
if (object instanceof ItemStack && ((ItemStack) object).getItem() instanceof IBloodOrb) {
|
||||
ingredients.add(new IngredientBloodOrb(((IBloodOrb) ((ItemStack) object).getItem()).getOrb((ItemStack) object)));
|
||||
continue;
|
||||
}
|
||||
|
||||
ingredients.add(CraftingHelper.getIngredient(object));
|
||||
}
|
||||
|
||||
addTartaricForge(output, minimumSouls, soulDrain, ingredients.toArray(new Ingredient[0]));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public RecipeBloodAltar getBloodAltar(@Nonnull ItemStack input) {
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
if (input.isEmpty())
|
||||
return null;
|
||||
|
||||
for (RecipeBloodAltar recipe : altarRecipes)
|
||||
if (recipe.getInput().test(input))
|
||||
return recipe;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public RecipeAlchemyTable getAlchemyTable(@Nonnull List<ItemStack> input) {
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
if (input.isEmpty())
|
||||
return null;
|
||||
|
||||
mainLoop:
|
||||
for (RecipeAlchemyTable recipe : alchemyRecipes) {
|
||||
if (recipe.getInput().size() != input.size())
|
||||
continue;
|
||||
|
||||
for (int i = 0; i < input.size(); i++) {
|
||||
Ingredient ingredient = recipe.getInput().get(i);
|
||||
if (!ingredient.apply(input.get(i)))
|
||||
continue mainLoop;
|
||||
}
|
||||
|
||||
return recipe;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public RecipeTartaricForge getTartaricForge(@Nonnull List<ItemStack> input) {
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
if (input.isEmpty())
|
||||
return null;
|
||||
|
||||
mainLoop:
|
||||
for (RecipeTartaricForge recipe : tartaricForgeRecipes) {
|
||||
if (recipe.getInput().size() != input.size())
|
||||
continue;
|
||||
|
||||
for (int i = 0; i < input.size(); i++) {
|
||||
Ingredient ingredient = recipe.getInput().get(i);
|
||||
if (!ingredient.apply(input.get(i)))
|
||||
continue mainLoop;
|
||||
}
|
||||
|
||||
return recipe;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public Set<RecipeBloodAltar> getAltarRecipes() {
|
||||
return ImmutableSet.copyOf(altarRecipes);
|
||||
}
|
||||
|
||||
public Set<RecipeAlchemyTable> getAlchemyRecipes() {
|
||||
return ImmutableSet.copyOf(alchemyRecipes);
|
||||
}
|
||||
|
||||
public Set<RecipeTartaricForge> getTartaricForgeRecipes() {
|
||||
return ImmutableSet.copyOf(tartaricForgeRecipes);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
package WayofTime.bloodmagic.api_impl.recipe;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import javax.annotation.Nonnegative;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class RecipeAlchemyTable {
|
||||
|
||||
@Nonnull
|
||||
private final NonNullList<Ingredient> input;
|
||||
@Nonnull
|
||||
private final ItemStack output;
|
||||
@Nonnegative
|
||||
private final int syphon;
|
||||
@Nonnegative
|
||||
private final int ticks;
|
||||
@Nonnegative
|
||||
private final int minimumTier;
|
||||
|
||||
public RecipeAlchemyTable(@Nonnull NonNullList<Ingredient> input, @Nonnull ItemStack output, int syphon, int ticks, int minimumTier) {
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
Preconditions.checkNotNull(output, "output cannot be null.");
|
||||
Preconditions.checkArgument(syphon >= 0, "syphon cannot be negative.");
|
||||
Preconditions.checkArgument(ticks >= 0, "ticks cannot be negative.");
|
||||
Preconditions.checkArgument(minimumTier >= 0, "minimumTier cannot be negative.");
|
||||
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
this.syphon = syphon;
|
||||
this.ticks = ticks;
|
||||
this.minimumTier = minimumTier;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public final NonNullList<Ingredient> getInput() {
|
||||
return input;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public final ItemStack getOutput() {
|
||||
return output;
|
||||
}
|
||||
|
||||
public final int getSyphon() {
|
||||
return syphon;
|
||||
}
|
||||
|
||||
public final int getTicks() {
|
||||
return ticks;
|
||||
}
|
||||
|
||||
public final int getMinimumTier() {
|
||||
return minimumTier;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
package WayofTime.bloodmagic.api_impl.recipe;
|
||||
|
||||
import WayofTime.bloodmagic.api.altar.EnumAltarTier;
|
||||
import com.google.common.base.Preconditions;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
|
||||
import javax.annotation.Nonnegative;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class RecipeBloodAltar {
|
||||
|
||||
@Nonnull
|
||||
private final Ingredient input;
|
||||
@Nonnull
|
||||
private final ItemStack output;
|
||||
@Nonnull
|
||||
private final EnumAltarTier minimumTier;
|
||||
@Nonnegative
|
||||
private final int syphon;
|
||||
@Nonnegative
|
||||
private final int consumeRate;
|
||||
@Nonnegative
|
||||
private final int drainRate;
|
||||
|
||||
public RecipeBloodAltar(@Nonnull Ingredient input, @Nonnull ItemStack output, @Nonnegative int minimumTier, @Nonnegative int syphon, @Nonnegative int consumeRate, @Nonnegative int drainRate) {
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
Preconditions.checkNotNull(output, "output cannot be null.");
|
||||
Preconditions.checkArgument(minimumTier >= 0, "minimumTier cannot be negative.");
|
||||
Preconditions.checkArgument(minimumTier <= EnumAltarTier.MAXTIERS, "minimumTier cannot be higher than max tier");
|
||||
Preconditions.checkArgument(syphon >= 0, "syphon cannot be negative.");
|
||||
Preconditions.checkArgument(consumeRate >= 0, "consumeRate cannot be negative.");
|
||||
Preconditions.checkArgument(drainRate >= 0, "drain cannot be negative.");
|
||||
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
this.minimumTier = EnumAltarTier.VALUES[minimumTier];
|
||||
this.syphon = syphon;
|
||||
this.consumeRate = consumeRate;
|
||||
this.drainRate = drainRate;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public final Ingredient getInput() {
|
||||
return input;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public final ItemStack getOutput() {
|
||||
return output;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public EnumAltarTier getMinimumTier() {
|
||||
return minimumTier;
|
||||
}
|
||||
|
||||
@Nonnegative
|
||||
public final int getSyphon() {
|
||||
return syphon;
|
||||
}
|
||||
|
||||
@Nonnegative
|
||||
public final int getConsumeRate() {
|
||||
return consumeRate;
|
||||
}
|
||||
|
||||
@Nonnegative
|
||||
public final int getDrainRate() {
|
||||
return drainRate;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package WayofTime.bloodmagic.api_impl.recipe;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import javax.annotation.Nonnegative;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class RecipeTartaricForge {
|
||||
|
||||
@Nonnull
|
||||
private final NonNullList<Ingredient> input;
|
||||
@Nonnull
|
||||
private final ItemStack output;
|
||||
@Nonnegative
|
||||
private final double minimumSouls;
|
||||
@Nonnegative
|
||||
private final double soulDrain;
|
||||
|
||||
public RecipeTartaricForge(@Nonnull NonNullList<Ingredient> input, @Nonnull ItemStack output, @Nonnegative double minimumSouls, @Nonnegative double soulDrain) {
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
Preconditions.checkNotNull(output, "output cannot be null.");
|
||||
Preconditions.checkArgument(minimumSouls >= 0, "minimumSouls cannot be negative.");
|
||||
Preconditions.checkArgument(soulDrain >= 0, "soulDrain cannot be negative.");
|
||||
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
this.minimumSouls = minimumSouls;
|
||||
this.soulDrain = soulDrain;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public final NonNullList<Ingredient> getInput() {
|
||||
return input;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public final ItemStack getOutput() {
|
||||
return output;
|
||||
}
|
||||
|
||||
@Nonnegative
|
||||
public final double getMinimumSouls() {
|
||||
return minimumSouls;
|
||||
}
|
||||
|
||||
@Nonnegative
|
||||
public final double getSoulDrain() {
|
||||
return soulDrain;
|
||||
}
|
||||
}
|
|
@ -3,6 +3,9 @@ package WayofTime.bloodmagic.apiv2;
|
|||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import javax.annotation.Nonnegative;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public interface IBloodMagicAPI {
|
||||
|
||||
/**
|
||||
|
@ -10,9 +13,13 @@ public interface IBloodMagicAPI {
|
|||
*
|
||||
* @return the active blacklist instance
|
||||
*/
|
||||
@Nonnull
|
||||
IBloodMagicBlacklist getBlacklist();
|
||||
|
||||
void setSacrificialValue(ResourceLocation entityId, int value);
|
||||
@Nonnull
|
||||
IBloodMagicRecipeRegistrar getRecipeRegistrar();
|
||||
|
||||
void registerAltarComponent(IBlockState state, String componentType);
|
||||
void setSacrificialValue(@Nonnull ResourceLocation entityId, @Nonnegative int value);
|
||||
|
||||
void registerAltarComponent(@Nonnull IBlockState state, @Nonnull String componentType);
|
||||
}
|
||||
|
|
|
@ -4,21 +4,23 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public interface IBloodMagicBlacklist {
|
||||
|
||||
void addTeleposer(IBlockState state);
|
||||
void addTeleposer(@Nonnull IBlockState state);
|
||||
|
||||
void addTeleposer(Block block);
|
||||
void addTeleposer(@Nonnull Block block);
|
||||
|
||||
void addTeleposer(ResourceLocation entityId);
|
||||
void addTeleposer(@Nonnull ResourceLocation entityId);
|
||||
|
||||
void addTransposition(IBlockState state);
|
||||
void addTransposition(@Nonnull IBlockState state);
|
||||
|
||||
void addTransposition(Block block);
|
||||
void addTransposition(@Nonnull Block block);
|
||||
|
||||
void addGreenGrove(IBlockState state);
|
||||
void addGreenGrove(@Nonnull IBlockState state);
|
||||
|
||||
void addGreenGrove(Block block);
|
||||
void addGreenGrove(@Nonnull Block block);
|
||||
|
||||
void addSacrifice(ResourceLocation entityId);
|
||||
void addWellOfSuffering(@Nonnull ResourceLocation entityId);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package WayofTime.bloodmagic.apiv2;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public interface IBloodMagicPlugin {
|
||||
|
||||
void register(IBloodMagicAPI api);
|
||||
void register(@Nonnull IBloodMagicAPI api);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package WayofTime.bloodmagic.apiv2;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
|
||||
import javax.annotation.Nonnegative;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public interface IBloodMagicRecipeRegistrar {
|
||||
|
||||
void addBloodAltar(@Nonnull Ingredient input, @Nonnull ItemStack output, @Nonnegative int minimumTier, @Nonnegative int syphon, @Nonnegative int consumeRate, @Nonnegative int drainRate);
|
||||
|
||||
boolean removeBloodAltar(@Nonnull ItemStack input);
|
||||
|
||||
void addAlchemyTable(@Nonnull ItemStack output, @Nonnegative int syphon, @Nonnegative int ticks, @Nonnegative int minimumTier, @Nonnull Ingredient... input);
|
||||
|
||||
boolean removeAlchemyTable(@Nonnull ItemStack... input);
|
||||
|
||||
void addTartaricForge(@Nonnull ItemStack output, @Nonnegative double minimumSouls, @Nonnegative double soulDrain, @Nonnull Ingredient... input);
|
||||
|
||||
boolean removeTartaricForge(@Nonnull ItemStack... input);
|
||||
}
|
|
@ -16,6 +16,7 @@ import WayofTime.bloodmagic.client.IVariantProvider;
|
|||
import WayofTime.bloodmagic.tile.TileAltar;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import com.google.common.base.Strings;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -163,10 +164,8 @@ public class BlockAltar extends Block implements IVariantProvider, IDocumentedBl
|
|||
// IVariantProvider
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
ret.add(new ImmutablePair<Integer, String>(0, "normal"));
|
||||
return ret;
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
variants.put(0, "normal");
|
||||
}
|
||||
|
||||
// IDocumentedBlock
|
||||
|
|
|
@ -6,6 +6,7 @@ import WayofTime.bloodmagic.client.IVariantProvider;
|
|||
import WayofTime.bloodmagic.item.block.ItemBlockBloodTank;
|
||||
import WayofTime.bloodmagic.tile.TileBloodTank;
|
||||
import com.google.common.collect.Lists;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -195,11 +196,8 @@ public class BlockBloodTank extends BlockInteger implements IVariantProvider, IB
|
|||
// IVariantProvider
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = Lists.newArrayList();
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
for (int i = 0; i < TileBloodTank.CAPACITIES.length; i++)
|
||||
ret.add(Pair.of(i, "inventory"));
|
||||
|
||||
return ret;
|
||||
variants.put(i, "inventory");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import WayofTime.bloodmagic.api.soul.IDiscreteDemonWill;
|
|||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.tile.TileDemonCrucible;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -100,10 +101,8 @@ public class BlockDemonCrucible extends Block implements IVariantProvider, IBMBl
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
ret.add(new ImmutablePair<Integer, String>(0, "normal"));
|
||||
return ret;
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
variants.put(0, "normal");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,7 @@ import WayofTime.bloodmagic.BloodMagic;
|
|||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.api.soul.PlayerDemonWillHandler;
|
||||
import WayofTime.bloodmagic.item.ItemDemonCrystal;
|
||||
import WayofTime.bloodmagic.item.block.ItemBlockDemonCrystal;
|
||||
import WayofTime.bloodmagic.tile.TileDemonCrystal;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
@ -13,6 +14,7 @@ import net.minecraft.block.state.BlockStateContainer;
|
|||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
|
@ -26,7 +28,7 @@ import net.minecraft.world.World;
|
|||
import javax.annotation.Nullable;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockDemonCrystal extends Block {
|
||||
public class BlockDemonCrystal extends Block implements IBMBlock {
|
||||
public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 6);
|
||||
public static final PropertyEnum<EnumDemonWillType> TYPE = PropertyEnum.<EnumDemonWillType>create("type", EnumDemonWillType.class);
|
||||
public static final PropertyEnum<EnumFacing> ATTACHED = PropertyEnum.<EnumFacing>create("attached", EnumFacing.class);
|
||||
|
@ -156,6 +158,8 @@ public class BlockDemonCrystal extends Block {
|
|||
}
|
||||
|
||||
TileDemonCrystal crystal = (TileDemonCrystal) world.getTileEntity(pos);
|
||||
if (crystal == null)
|
||||
return false;
|
||||
|
||||
if (PlayerDemonWillHandler.getTotalDemonWill(EnumDemonWillType.DEFAULT, player) > 1024) {
|
||||
crystal.dropSingleCrystal();
|
||||
|
@ -177,49 +181,13 @@ public class BlockDemonCrystal extends Block {
|
|||
return new TileDemonCrystal();
|
||||
}
|
||||
|
||||
public static ItemStack getItemStackDropped(EnumDemonWillType type, int crystalNumber) {
|
||||
ItemStack stack = null;
|
||||
switch (type) {
|
||||
case CORROSIVE:
|
||||
stack = ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_CORROSIVE);
|
||||
break;
|
||||
case DEFAULT:
|
||||
stack = ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DEFAULT);
|
||||
break;
|
||||
case DESTRUCTIVE:
|
||||
stack = ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DESTRUCTIVE);
|
||||
break;
|
||||
case STEADFAST:
|
||||
stack = ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_STEADFAST);
|
||||
break;
|
||||
case VENGEFUL:
|
||||
stack = ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_VENGEFUL);
|
||||
break;
|
||||
}
|
||||
|
||||
stack.setCount(crystalNumber);
|
||||
return stack;
|
||||
@Nullable
|
||||
@Override
|
||||
public ItemBlock getItem() {
|
||||
return new ItemBlockDemonCrystal(this);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public java.util.List<ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
// {
|
||||
// java.util.List<ItemStack> ret = super.getDrops(world, pos, state, fortune);
|
||||
// int age = ((Integer) state.getValue(AGE)).intValue();
|
||||
// Random rand = world instanceof World ? ((World) world).rand : new Random();
|
||||
//
|
||||
// if (age >= 7)
|
||||
// {
|
||||
// int k = 3 + fortune;
|
||||
//
|
||||
// for (int i = 0; i < 3 + fortune; ++i)
|
||||
// {
|
||||
// if (rand.nextInt(15) <= age)
|
||||
// {
|
||||
// ret.add(new ItemStack(this.getSeed(), 1, 0));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return ret;
|
||||
// }
|
||||
public static ItemStack getItemStackDropped(EnumDemonWillType type, int crystalNumber) {
|
||||
return type.getStack(crystalNumber);
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.block;
|
|||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.tile.TileDemonCrystallizer;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -68,10 +69,8 @@ public class BlockDemonCrystallizer extends BlockContainer implements IVariantPr
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
ret.add(new ImmutablePair<Integer, String>(0, "normal"));
|
||||
return ret;
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
variants.put(0, "normal");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.block;
|
|||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.block.base.BlockEnumPillar;
|
||||
import com.google.common.collect.Lists;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
@ -24,16 +25,12 @@ public class BlockDemonPillarBase<E extends Enum<E> & IStringSerializable> exten
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = Lists.newArrayList();
|
||||
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
//This is done to make the ItemBlocks have the proper model
|
||||
EnumFacing.Axis[] axis = new EnumFacing.Axis[]{EnumFacing.Axis.Y, EnumFacing.Axis.X, EnumFacing.Axis.Z};
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
for (int j = 0; j < this.getTypes().length; j++)
|
||||
ret.add(Pair.of(i * 5 + j, "axis=" + axis[i] + ",type=" + this.getTypes()[j]));
|
||||
|
||||
return ret;
|
||||
variants.put(i * 5 + j, "axis=" + axis[i] + ",type=" + this.getTypes()[j]);
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.block;
|
|||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.block.base.BlockEnumPillarCap;
|
||||
import com.google.common.collect.Lists;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
@ -24,15 +25,10 @@ public class BlockDemonPillarCapBase<E extends Enum<E> & IStringSerializable> ex
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = Lists.newArrayList();
|
||||
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
//This is done to make the ItemBlocks have the proper model
|
||||
|
||||
for (int i = 0; i < EnumFacing.values().length; i++)
|
||||
for (int j = 0; j < this.getTypes().length; j++)
|
||||
ret.add(Pair.of(i * 2 + j, "facing=" + EnumFacing.values()[i] + ",type=" + this.getTypes()[j]));
|
||||
|
||||
return ret;
|
||||
variants.put(i * 2 + j, "facing=" + EnumFacing.values()[i] + ",type=" + this.getTypes()[j]);
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.block;
|
|||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.tile.TileDemonPylon;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -61,9 +62,7 @@ public class BlockDemonPylon extends BlockContainer implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
ret.add(new ImmutablePair<Integer, String>(0, "normal"));
|
||||
return ret;
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
variants.put(0, "normal");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.block;
|
|||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.block.base.BlockEnumStairs;
|
||||
import com.google.common.collect.Lists;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
@ -23,12 +24,8 @@ public class BlockDemonStairsBase<E extends Enum<E> & IStringSerializable> exten
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = Lists.newArrayList();
|
||||
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
for (int i = 0; i < this.getTypes().length; i++)
|
||||
ret.add(Pair.of(i, "facing=south,half=bottom,shape=straight,type=" + this.getTypes()[i]));
|
||||
|
||||
return ret;
|
||||
variants.put(i, "facing=south,half=bottom,shape=straight,type=" + this.getTypes()[i]);
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.block;
|
|||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.block.base.BlockEnumWall;
|
||||
import com.google.common.collect.Lists;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
@ -23,12 +24,8 @@ public class BlockDemonWallBase<E extends Enum<E> & IStringSerializable> extends
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = Lists.newArrayList();
|
||||
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
for (int i = 0; i < this.getTypes().length; i++)
|
||||
ret.add(Pair.of(i, "east=true,north=false,south=false,type=" + this.getTypes()[i] + ",up=true,west=true"));
|
||||
|
||||
return ret;
|
||||
variants.put(i, "east=true,north=false,south=false,type=" + this.getTypes()[i] + ",up=true,west=true");
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.block;
|
|||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.tile.TileIncenseAltar;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -84,10 +85,8 @@ public class BlockIncenseAltar extends Block implements IVariantProvider, IBMBlo
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
ret.add(new ImmutablePair<Integer, String>(0, "normal"));
|
||||
return ret;
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
variants.put(0, "normal");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,7 @@ import WayofTime.bloodmagic.BloodMagic;
|
|||
import WayofTime.bloodmagic.block.base.BlockEnum;
|
||||
import WayofTime.bloodmagic.block.enums.EnumSubWillType;
|
||||
import WayofTime.bloodmagic.tile.TileInversionPillar;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
|
@ -73,11 +74,9 @@ public class BlockInversionPillar extends BlockEnum<EnumSubWillType> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
for (int i = 0; i < this.getTypes().length; i++)
|
||||
ret.add(Pair.of(i, "static=false,type=" + this.getTypes()[i]));
|
||||
return ret;
|
||||
variants.put(i, "static=false,type=" + this.getTypes()[i]);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,7 @@ import WayofTime.bloodmagic.BloodMagic;
|
|||
import WayofTime.bloodmagic.block.base.BlockEnum;
|
||||
import WayofTime.bloodmagic.block.enums.EnumInversionCap;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -54,10 +55,8 @@ public class BlockInversionPillarEnd extends BlockEnum<EnumInversionCap> impleme
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
for (int i = 0; i < this.getTypes().length; i++)
|
||||
ret.add(new ImmutablePair<Integer, String>(i, "type=" + this.getTypes()[i]));
|
||||
return ret;
|
||||
variants.put(i, "type=" + this.getTypes()[i]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.block;
|
|||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.tile.TilePhantomBlock;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -85,9 +86,7 @@ public class BlockPhantom extends Block implements IVariantProvider {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
ret.add(new ImmutablePair<Integer, String>(0, "normal"));
|
||||
return ret;
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
variants.put(0, "normal");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import WayofTime.bloodmagic.client.IVariantProvider;
|
|||
import WayofTime.bloodmagic.tile.routing.TileMasterRoutingNode;
|
||||
import WayofTime.bloodmagic.tile.routing.TileRoutingNode;
|
||||
import com.google.common.collect.Lists;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
|
@ -132,7 +133,7 @@ public class BlockRoutingNode extends Block implements IBMBlock, IVariantProvide
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
return Lists.newArrayList(Pair.of(0, "inventory"));
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
variants.put(0, "inventory");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import WayofTime.bloodmagic.BloodMagic;
|
|||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.tile.TileSoulForge;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
@ -98,10 +99,8 @@ public class BlockSoulForge extends Block implements IVariantProvider, IBMBlock
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
ret.add(new ImmutablePair<Integer, String>(0, "normal"));
|
||||
return ret;
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
variants.put(0, "normal");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,7 @@ import WayofTime.bloodmagic.BloodMagic;
|
|||
import WayofTime.bloodmagic.ConfigHandler;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.tile.TileSpectralBlock;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -68,7 +69,7 @@ public class BlockSpectral extends Block implements IVariantProvider {
|
|||
|
||||
@Override
|
||||
public EnumBlockRenderType getRenderType(IBlockState state) {
|
||||
return ConfigHandler.invisibleSpectralBlocks ? EnumBlockRenderType.INVISIBLE : EnumBlockRenderType.MODEL;
|
||||
return ConfigHandler.client.invisibleSpectralBlocks ? EnumBlockRenderType.INVISIBLE : EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -108,9 +109,7 @@ public class BlockSpectral extends Block implements IVariantProvider {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
ret.add(new ImmutablePair<Integer, String>(0, "normal"));
|
||||
return ret;
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
variants.put(0, "normal");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import WayofTime.bloodmagic.api.Constants;
|
|||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.item.ItemTelepositionFocus;
|
||||
import WayofTime.bloodmagic.tile.TileTeleposer;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -65,10 +66,8 @@ public class BlockTeleposer extends BlockContainer implements IVariantProvider,
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
ret.add(new ImmutablePair<Integer, String>(0, "normal"));
|
||||
return ret;
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
variants.put(0, "normal");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,7 +2,10 @@ package WayofTime.bloodmagic.block;
|
|||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public interface IBMBlock {
|
||||
|
||||
@Nullable
|
||||
ItemBlock getItem();
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import WayofTime.bloodmagic.block.IBMBlock;
|
|||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.item.block.base.ItemBlockEnum;
|
||||
import com.google.common.collect.Lists;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
|
@ -77,15 +78,12 @@ public class BlockEnum<E extends Enum<E> & IStringSerializable> extends Block im
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> variants = Lists.newArrayList();
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
if (getItem() == null)
|
||||
return variants;
|
||||
return;
|
||||
|
||||
for (int i = 0; i < types.length; i++)
|
||||
variants.add(Pair.of(i, getProperty().getName() + "=" + types[i].name()));
|
||||
|
||||
return variants;
|
||||
variants.put(i, getProperty().getName() + "=" + types[i].name());
|
||||
}
|
||||
|
||||
public E[] getTypes() {
|
||||
|
|
|
@ -22,11 +22,9 @@ public interface IMeshProvider {
|
|||
ItemMeshDefinition getMeshDefinition();
|
||||
|
||||
/**
|
||||
* Gets all possible variants for this item
|
||||
*
|
||||
* @return - All possible variants for this item
|
||||
* Populates a list of all possible variants for this item
|
||||
*/
|
||||
List<String> getVariants();
|
||||
void populateVariants(List<String> variants);
|
||||
|
||||
/**
|
||||
* If a custom ResourceLocation is required, return it here.
|
||||
|
@ -36,5 +34,7 @@ public interface IMeshProvider {
|
|||
* @return - The custom ResourceLocation
|
||||
*/
|
||||
@Nullable
|
||||
ResourceLocation getCustomLocation();
|
||||
default ResourceLocation getCustomLocation() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,16 @@
|
|||
package WayofTime.bloodmagic.client;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IVariantProvider {
|
||||
List<Pair<Integer, String>> getVariants();
|
||||
|
||||
/**
|
||||
* A mapping of meta -> state variant
|
||||
*
|
||||
* @param variants A map to populate with all variants
|
||||
*/
|
||||
void populateVariants(Int2ObjectMap<String> variants);
|
||||
}
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
package WayofTime.bloodmagic.client.gui.config;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.ConfigHandler;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraftforge.common.config.ConfigElement;
|
||||
import net.minecraftforge.fml.client.config.GuiConfig;
|
||||
import net.minecraftforge.fml.client.config.IConfigElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ConfigGui extends GuiConfig {
|
||||
|
||||
public ConfigGui(GuiScreen parentScreen) {
|
||||
super(parentScreen, getConfigElements(parentScreen), BloodMagic.MODID, false, false, "BloodMagic Configuration");
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private static List<IConfigElement> getConfigElements(GuiScreen parent) {
|
||||
List<IConfigElement> list = new ArrayList<IConfigElement>();
|
||||
|
||||
// adds sections declared in ConfigHandler. toLowerCase() is used
|
||||
// because the configuration class automatically does this, so must we.
|
||||
list.add(new ConfigElement(ConfigHandler.config.getCategory("Potions".toLowerCase())));
|
||||
list.add(new ConfigElement(ConfigHandler.config.getCategory("Client".toLowerCase())));
|
||||
list.add(new ConfigElement(ConfigHandler.config.getCategory("Compatibility".toLowerCase())));
|
||||
list.add(new ConfigElement(ConfigHandler.config.getCategory("Teleposer Blacklist".toLowerCase())));
|
||||
list.add(new ConfigElement(ConfigHandler.config.getCategory("Well of Suffering Blacklist".toLowerCase())));
|
||||
list.add(new ConfigElement(ConfigHandler.config.getCategory("Item/Block Blacklisting".toLowerCase())));
|
||||
list.add(new ConfigElement(ConfigHandler.config.getCategory("General".toLowerCase())));
|
||||
list.add(new ConfigElement(ConfigHandler.config.getCategory("Rituals".toLowerCase())));
|
||||
list.add(new ConfigElement(ConfigHandler.config.getCategory("Blood Altar Sacrificial Values".toLowerCase())));
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
package WayofTime.bloodmagic.client.gui.config;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraftforge.fml.client.IModGuiFactory;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class ConfigGuiFactory implements IModGuiFactory {
|
||||
@Override
|
||||
public void initialize(Minecraft minecraftInstance) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasConfigGui() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GuiScreen createConfigGui(GuiScreen parentScreen) {
|
||||
return new ConfigGui(parentScreen);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -24,7 +24,7 @@ public class RenderItemRoutingNode extends TileEntitySpecialRenderer<TileRouting
|
|||
|
||||
@Override
|
||||
public void render(TileRoutingNode tileNode, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
|
||||
if (mc.player.getHeldItemMainhand().getItem() instanceof INodeRenderer || ConfigHandler.alwaysRenderRoutingLines) {
|
||||
if (mc.player.getHeldItemMainhand().getItem() instanceof INodeRenderer || ConfigHandler.client.alwaysRenderRoutingLines) {
|
||||
List<BlockPos> connectionList = tileNode.getConnected();
|
||||
for (BlockPos wantedPos : connectionList) {
|
||||
BlockPos offsetPos = wantedPos.subtract(tileNode.getPos());
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package WayofTime.bloodmagic.client.render.entity;
|
||||
|
||||
import WayofTime.bloodmagic.entity.projectile.EntityBloodLight;
|
||||
import WayofTime.bloodmagic.item.ItemComponent;
|
||||
import WayofTime.bloodmagic.item.types.ComponentType;
|
||||
import WayofTime.bloodmagic.item.types.ReagentType;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderItem;
|
||||
|
@ -26,7 +27,7 @@ public class RenderEntityBloodLight extends Render<EntityBloodLight> {
|
|||
GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
|
||||
this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||
this.renderItem.renderItem(ItemComponent.getStack(ItemComponent.REAGENT_BLOODLIGHT), ItemCameraTransforms.TransformType.GROUND);
|
||||
this.renderItem.renderItem(ReagentType.REAGENT_BLOODLIGHT.getStack(), ItemCameraTransforms.TransformType.GROUND);
|
||||
GlStateManager.disableRescaleNormal();
|
||||
GlStateManager.popMatrix();
|
||||
super.doRender(entity, x, y, z, entityYaw, partialTicks);
|
||||
|
|
|
@ -24,7 +24,7 @@ import javax.annotation.Nullable;
|
|||
import java.awt.Color;
|
||||
|
||||
@GuideBook(priority = EventPriority.HIGHEST)
|
||||
public class GuideBloodMagic implements IGuideBook {
|
||||
public class BloodMagicGuideAPIPlugin implements IGuideBook {
|
||||
|
||||
public static final Book GUIDE_BOOK = new Book();
|
||||
|
||||
|
@ -38,21 +38,21 @@ public class GuideBloodMagic implements IGuideBook {
|
|||
GUIDE_BOOK.setRegistryName(new ResourceLocation(BloodMagic.MODID, "guide"));
|
||||
GUIDE_BOOK.setColor(Color.RED);
|
||||
|
||||
CategoryAlchemy.buildCategory(GUIDE_BOOK);
|
||||
CategoryArchitect.buildCategory(GUIDE_BOOK);
|
||||
CategoryDemon.buildCategory(GUIDE_BOOK);
|
||||
CategoryRitual.buildCategory(GUIDE_BOOK);
|
||||
|
||||
return GUIDE_BOOK;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePost(ItemStack bookStack) {
|
||||
GUIDE_BOOK.addCategory(new CategoryItemStack(CategoryAlchemy.buildCategory(), "guide.bloodmagic.category.alchemy", new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES)));
|
||||
GUIDE_BOOK.addCategory(new CategoryItemStack(CategoryArchitect.buildCategory(), "guide.bloodmagic.category.architect", new ItemStack(RegistrarBloodMagicItems.SIGIL_DIVINATION)));
|
||||
GUIDE_BOOK.addCategory(new CategoryItemStack(CategoryDemon.buildCategory(), "guide.bloodmagic.category.demon", new ItemStack(RegistrarBloodMagicItems.BLOOD_SHARD)));
|
||||
GUIDE_BOOK.addCategory(new CategoryItemStack(CategoryRitual.buildCategory(), "guide.bloodmagic.category.ritual", new ItemStack(RegistrarBloodMagicBlocks.RITUAL_CONTROLLER)));
|
||||
// guideBook.addCategory(new CategoryItemStack(CategorySpell.buildCategory(), "guide.bloodmagic.category.spell", new ItemStack(ModItems.ritualDiviner)));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IRecipe getRecipe(@Nonnull ItemStack bookStack) {
|
||||
return new ShapelessOreRecipe(new ResourceLocation(BloodMagic.MODID, "guide"), GuideAPI.getStackFromBook(GUIDE_BOOK), new ItemStack(Items.BOOK), "glass", "feather").setRegistryName("guide");
|
||||
return new ShapelessOreRecipe(new ResourceLocation(BloodMagic.MODID, "guide"), GuideAPI.getStackFromBook(GUIDE_BOOK), new ItemStack(Items.BOOK), "blockGlass", "feather").setRegistryName("guide");
|
||||
}
|
||||
}
|
|
@ -1,19 +1,47 @@
|
|||
package WayofTime.bloodmagic.compat.guideapi;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyCircleRenderer;
|
||||
import WayofTime.bloodmagic.api.registry.AlchemyArrayRecipeRegistry;
|
||||
import WayofTime.bloodmagic.api_impl.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeBloodAltar;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeTartaricForge;
|
||||
import WayofTime.bloodmagic.client.render.alchemyArray.DualAlchemyCircleRenderer;
|
||||
import WayofTime.bloodmagic.compat.guideapi.page.PageAlchemyArray;
|
||||
import amerifrance.guideapi.page.PageIRecipe;
|
||||
import WayofTime.bloodmagic.compat.guideapi.page.PageAltarRecipe;
|
||||
import WayofTime.bloodmagic.compat.guideapi.page.PageTartaricForgeRecipe;
|
||||
import amerifrance.guideapi.page.PageJsonRecipe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BookUtils {
|
||||
|
||||
@Nullable
|
||||
public static PageAltarRecipe getAltarPage(ItemStack output) {
|
||||
for (RecipeBloodAltar recipe : BloodMagicAPI.INSTANCE.getRecipeRegistrar().getAltarRecipes())
|
||||
if (ItemStack.areItemStacksEqualUsingNBTShareTag(output, recipe.getOutput()))
|
||||
return new PageAltarRecipe(recipe);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static PageTartaricForgeRecipe getForgePage(ItemStack output) {
|
||||
for (RecipeTartaricForge recipe : BloodMagicAPI.INSTANCE.getRecipeRegistrar().getTartaricForgeRecipes())
|
||||
if (ItemStack.areItemStacksEqualUsingNBTShareTag(output, recipe.getOutput()))
|
||||
return new PageTartaricForgeRecipe(recipe);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static PageJsonRecipe getCraftingPage(String name) {
|
||||
return new PageJsonRecipe(new ResourceLocation(BloodMagic.MODID, name));
|
||||
}
|
||||
|
||||
public static PageAlchemyArray getAlchemyPage(String key) {
|
||||
ItemStack[] recipe = AlchemyArrayRecipeRegistry.getRecipeForArrayEffect(key);
|
||||
if (recipe[0] != null) {
|
||||
|
@ -55,8 +83,4 @@ public class BookUtils {
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static PageIRecipe getPageForRecipe(IRecipe recipe) {
|
||||
return new PageIRecipe(recipe);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,103 +1,58 @@
|
|||
package WayofTime.bloodmagic.compat.guideapi.book;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.recipe.TartaricForgeRecipe;
|
||||
import WayofTime.bloodmagic.compat.guideapi.BookUtils;
|
||||
import WayofTime.bloodmagic.compat.guideapi.entry.EntryText;
|
||||
import WayofTime.bloodmagic.compat.guideapi.page.PageAlchemyArray;
|
||||
import WayofTime.bloodmagic.compat.guideapi.page.PageTartaricForgeRecipe;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.util.helper.RecipeHelper;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import amerifrance.guideapi.api.IPage;
|
||||
import amerifrance.guideapi.api.impl.Book;
|
||||
import amerifrance.guideapi.api.impl.abstraction.EntryAbstract;
|
||||
import amerifrance.guideapi.api.util.PageHelper;
|
||||
import amerifrance.guideapi.category.CategoryItemStack;
|
||||
import amerifrance.guideapi.page.PageText;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class CategoryAlchemy {
|
||||
public static Map<ResourceLocation, EntryAbstract> buildCategory() {
|
||||
Map<ResourceLocation, EntryAbstract> entries = new LinkedHashMap<ResourceLocation, EntryAbstract>();
|
||||
String keyBase = "guide." + BloodMagic.MODID + ".entry.alchemy.";
|
||||
|
||||
List<IPage> introPages = new ArrayList<IPage>();
|
||||
introPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "intro" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "intro"), new EntryText(introPages, TextHelper.localize(keyBase + "intro"), true));
|
||||
public static void buildCategory(Book book) {
|
||||
final String keyBase = "guide." + BloodMagic.MODID + ".entry.alchemy.";
|
||||
|
||||
List<IPage> ashPages = new ArrayList<IPage>();
|
||||
CategoryItemStack category = new CategoryItemStack(keyBase + "alchemy", new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES));
|
||||
category.withKeyBase(BloodMagic.MODID);
|
||||
|
||||
TartaricForgeRecipe ashRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES));
|
||||
if (ashRecipe != null) {
|
||||
ashPages.add(new PageTartaricForgeRecipe(ashRecipe));
|
||||
}
|
||||
ashPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "ash" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "ash"), new EntryText(ashPages, TextHelper.localize(keyBase + "ash"), true));
|
||||
category.addEntry("intro", new EntryText(keyBase + "intro", true));
|
||||
category.getEntry("intro").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "intro.info"), 370));
|
||||
|
||||
List<IPage> speedPages = new ArrayList<IPage>();
|
||||
category.addEntry("ash", new EntryText(keyBase + "ash", true));
|
||||
category.getEntry("ash").addPage(BookUtils.getForgePage(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES)));
|
||||
category.getEntry("ash").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "ash.info"), 370));
|
||||
|
||||
PageAlchemyArray speedRecipePage = BookUtils.getAlchemyPage("movement");
|
||||
if (speedRecipePage != null) {
|
||||
speedPages.add(speedRecipePage);
|
||||
}
|
||||
speedPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "speed" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "speed"), new EntryText(speedPages, TextHelper.localize(keyBase + "speed"), true));
|
||||
category.addEntry("speed", new EntryText(keyBase + "speed", true));
|
||||
category.getEntry("speed").addPage(BookUtils.getAlchemyPage("movement"));
|
||||
category.getEntry("speed").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "speed.info"), 370));
|
||||
|
||||
List<IPage> updraftPages = new ArrayList<IPage>();
|
||||
category.addEntry("updraft", new EntryText(keyBase + "updraft", true));
|
||||
category.getEntry("updraft").addPage(BookUtils.getAlchemyPage("updraft"));
|
||||
category.getEntry("updraft").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "updraft.info"), 370));
|
||||
|
||||
PageAlchemyArray updraftRecipePage = BookUtils.getAlchemyPage("updraft");
|
||||
if (updraftRecipePage != null) {
|
||||
updraftPages.add(updraftRecipePage);
|
||||
}
|
||||
updraftPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "updraft" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "updraft"), new EntryText(updraftPages, TextHelper.localize(keyBase + "updraft"), true));
|
||||
category.addEntry("turret", new EntryText(keyBase + "turret", true));
|
||||
category.getEntry("turret").addPage(BookUtils.getAlchemyPage("skeletonTurret"));
|
||||
category.getEntry("turret").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "turret.info"), 370));
|
||||
|
||||
List<IPage> turretPages = new ArrayList<IPage>();
|
||||
category.addEntry("bounce", new EntryText(keyBase + "bounce", true));
|
||||
category.getEntry("bounce").addPage(BookUtils.getAlchemyPage("bounce"));
|
||||
category.getEntry("bounce").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "bounce.info"), 370));
|
||||
|
||||
PageAlchemyArray turretRecipePage = BookUtils.getAlchemyPage("skeletonTurret");
|
||||
if (turretRecipePage != null) {
|
||||
turretPages.add(turretRecipePage);
|
||||
}
|
||||
turretPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "turret" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "turret"), new EntryText(turretPages, TextHelper.localize(keyBase + "turret"), true));
|
||||
category.addEntry("buff", new EntryText(keyBase + "buff", true));
|
||||
category.getEntry("buff").addPage(BookUtils.getAlchemyPage("buff"));
|
||||
category.getEntry("buff").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "buff.info"), 370));
|
||||
|
||||
List<IPage> bouncePages = new ArrayList<IPage>();
|
||||
category.addEntry("fastMiner", new EntryText(keyBase + "fastMiner", true));
|
||||
category.getEntry("fastMiner").addPage(BookUtils.getAlchemyPage("fastMiner"));
|
||||
category.getEntry("fastMiner").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "fastMiner.info"), 370));
|
||||
|
||||
PageAlchemyArray bounceRecipePage = BookUtils.getAlchemyPage("bounce");
|
||||
if (bounceRecipePage != null) {
|
||||
bouncePages.add(bounceRecipePage);
|
||||
}
|
||||
bouncePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "bounce" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "bounce"), new EntryText(bouncePages, TextHelper.localize(keyBase + "bounce"), true));
|
||||
|
||||
List<IPage> buffPages = new ArrayList<IPage>();
|
||||
|
||||
buffPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "buff" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "buff"), new EntryText(buffPages, TextHelper.localize(keyBase + "buff"), true));
|
||||
|
||||
List<IPage> fastMinerPages = new ArrayList<IPage>();
|
||||
|
||||
PageAlchemyArray fastMinerRecipePage = BookUtils.getAlchemyPage("fastMiner");
|
||||
if (fastMinerRecipePage != null) {
|
||||
fastMinerPages.add(fastMinerRecipePage);
|
||||
}
|
||||
fastMinerPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "fastMiner" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "fastMiner"), new EntryText(fastMinerPages, TextHelper.localize(keyBase + "fastMiner"), true));
|
||||
|
||||
for (Entry<ResourceLocation, EntryAbstract> entry : entries.entrySet()) {
|
||||
for (IPage page : entry.getValue().pageList) {
|
||||
if (page instanceof PageText) {
|
||||
((PageText) page).setUnicodeFlag(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return entries;
|
||||
category.entries.values().forEach(e -> e.pageList.stream().filter(p -> p instanceof PageText).forEach(p -> ((PageText) p).setUnicodeFlag(true)));
|
||||
book.addCategory(category);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,646 +1,259 @@
|
|||
package WayofTime.bloodmagic.compat.guideapi.book;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.recipe.TartaricForgeRecipe;
|
||||
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry.AltarRecipe;
|
||||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
||||
import WayofTime.bloodmagic.api.orb.BloodOrb;
|
||||
import WayofTime.bloodmagic.compat.guideapi.BookUtils;
|
||||
import WayofTime.bloodmagic.compat.guideapi.entry.EntryText;
|
||||
import WayofTime.bloodmagic.compat.guideapi.page.PageAlchemyArray;
|
||||
import WayofTime.bloodmagic.compat.guideapi.page.PageAltarRecipe;
|
||||
import WayofTime.bloodmagic.compat.guideapi.page.PageTartaricForgeRecipe;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagic;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.item.ItemComponent;
|
||||
import WayofTime.bloodmagic.util.helper.RecipeHelper;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import amerifrance.guideapi.api.IPage;
|
||||
import amerifrance.guideapi.api.impl.abstraction.EntryAbstract;
|
||||
import WayofTime.bloodmagic.item.types.ComponentType;
|
||||
import WayofTime.bloodmagic.item.types.ReagentType;
|
||||
import amerifrance.guideapi.api.impl.Book;
|
||||
import amerifrance.guideapi.api.util.PageHelper;
|
||||
import amerifrance.guideapi.category.CategoryItemStack;
|
||||
import amerifrance.guideapi.page.PageText;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class CategoryArchitect {
|
||||
public static Map<ResourceLocation, EntryAbstract> buildCategory() {
|
||||
Map<ResourceLocation, EntryAbstract> entries = new LinkedHashMap<ResourceLocation, EntryAbstract>();
|
||||
String keyBase = "guide." + BloodMagic.MODID + ".entry.architect.";
|
||||
|
||||
List<IPage> introPages = new ArrayList<IPage>();
|
||||
introPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "intro" + ".info"), 370));
|
||||
// introPages.add(new PageImage(new ResourceLocation("bloodmagicguide", "textures/guide/" + ritual.getName() + ".png")));
|
||||
entries.put(new ResourceLocation(keyBase + "intro"), new EntryText(introPages, TextHelper.localize(keyBase + "intro"), true));
|
||||
|
||||
List<IPage> altarPages = new ArrayList<IPage>();
|
||||
|
||||
IRecipe altarRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.ALTAR));
|
||||
if (altarRecipe != null) {
|
||||
altarPages.add(BookUtils.getPageForRecipe(altarRecipe));
|
||||
}
|
||||
|
||||
altarPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "bloodaltar" + ".info.1"), 370));
|
||||
|
||||
IRecipe daggerRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.SACRIFICIAL_DAGGER));
|
||||
if (daggerRecipe != null) {
|
||||
altarPages.add(BookUtils.getPageForRecipe(daggerRecipe));
|
||||
}
|
||||
|
||||
altarPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "bloodaltar" + ".info.2"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "bloodaltar"), new EntryText(altarPages, TextHelper.localize(keyBase + "bloodaltar"), true));
|
||||
|
||||
List<IPage> ashPages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe ashRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES));
|
||||
if (ashRecipe != null) {
|
||||
ashPages.add(new PageTartaricForgeRecipe(ashRecipe));
|
||||
}
|
||||
ashPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "ash" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "ash"), new EntryText(ashPages, TextHelper.localize(keyBase + "ash"), true));
|
||||
|
||||
List<IPage> divinationPages = new ArrayList<IPage>();
|
||||
|
||||
PageAlchemyArray divinationRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_DIVINATION));
|
||||
if (divinationRecipePage != null) {
|
||||
divinationPages.add(divinationRecipePage);
|
||||
}
|
||||
|
||||
divinationPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "divination" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "divination"), new EntryText(divinationPages, TextHelper.localize(keyBase + "divination"), true));
|
||||
|
||||
List<IPage> soulnetworkPages = new ArrayList<IPage>();
|
||||
|
||||
soulnetworkPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "soulnetwork" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "soulnetwork"), new EntryText(soulnetworkPages, TextHelper.localize(keyBase + "soulnetwork"), true));
|
||||
|
||||
List<IPage> weakorbPages = new ArrayList<IPage>();
|
||||
weakorbPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "weakorb" + ".info.1"), 370));
|
||||
|
||||
AltarRecipe weakorbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_WEAK));
|
||||
if (weakorbRecipe != null) {
|
||||
weakorbPages.add(new PageAltarRecipe(weakorbRecipe));
|
||||
}
|
||||
|
||||
weakorbPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "weakorb" + ".info.2"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "weakorb"), new EntryText(weakorbPages, TextHelper.localize(keyBase + "weakorb"), true));
|
||||
|
||||
List<IPage> incensePages = new ArrayList<IPage>();
|
||||
|
||||
IRecipe incenseRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.INCENSE_ALTAR));
|
||||
if (incenseRecipe != null) {
|
||||
incensePages.add(BookUtils.getPageForRecipe(incenseRecipe));
|
||||
}
|
||||
|
||||
incensePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "incense" + ".info.1"), 370));
|
||||
|
||||
IRecipe woodPathRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.PATH, 1, 0));
|
||||
if (woodPathRecipe != null) {
|
||||
incensePages.add(BookUtils.getPageForRecipe(woodPathRecipe));
|
||||
}
|
||||
|
||||
incensePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "incense" + ".info.2"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "incense"), new EntryText(incensePages, TextHelper.localize(keyBase + "incense"), true));
|
||||
|
||||
List<IPage> runePages = new ArrayList<IPage>();
|
||||
|
||||
IRecipe runeRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 0));
|
||||
if (runeRecipe != null) {
|
||||
runePages.add(BookUtils.getPageForRecipe(runeRecipe));
|
||||
}
|
||||
|
||||
runePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "bloodrune" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "bloodrune"), new EntryText(runePages, TextHelper.localize(keyBase + "bloodrune"), true));
|
||||
|
||||
List<IPage> inspectPages = new ArrayList<IPage>();
|
||||
|
||||
AltarRecipe inspectRecipe = RecipeHelper.getAltarRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.SANGUINE_BOOK));
|
||||
if (inspectRecipe != null) {
|
||||
inspectPages.add(new PageAltarRecipe(inspectRecipe));
|
||||
}
|
||||
|
||||
inspectPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "inspectoris" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "inspectoris"), new EntryText(inspectPages, TextHelper.localize(keyBase + "inspectoris"), true));
|
||||
|
||||
List<IPage> speedRunePages = new ArrayList<IPage>();
|
||||
|
||||
IRecipe speedRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 1));
|
||||
if (speedRecipe != null) {
|
||||
speedRunePages.add(BookUtils.getPageForRecipe(speedRecipe));
|
||||
}
|
||||
|
||||
speedRunePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "runeSpeed" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "runeSpeed"), new EntryText(speedRunePages, TextHelper.localize(keyBase + "runeSpeed"), true));
|
||||
|
||||
List<IPage> waterPages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe waterRecipe = RecipeHelper.getForgeRecipeForOutput(ItemComponent.getStack(ItemComponent.REAGENT_WATER));
|
||||
if (waterRecipe != null) {
|
||||
waterPages.add(new PageTartaricForgeRecipe(waterRecipe));
|
||||
}
|
||||
|
||||
PageAlchemyArray waterRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_WATER));
|
||||
if (waterRecipePage != null) {
|
||||
waterPages.add(waterRecipePage);
|
||||
}
|
||||
|
||||
waterPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "water" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "water"), new EntryText(waterPages, TextHelper.localize(keyBase + "water"), true));
|
||||
|
||||
List<IPage> lavaPages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe lavaRecipe = RecipeHelper.getForgeRecipeForOutput(ItemComponent.getStack(ItemComponent.REAGENT_LAVA));
|
||||
if (lavaRecipe != null) {
|
||||
lavaPages.add(new PageTartaricForgeRecipe(lavaRecipe));
|
||||
}
|
||||
|
||||
PageAlchemyArray lavaRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_LAVA));
|
||||
if (lavaRecipePage != null) {
|
||||
lavaPages.add(lavaRecipePage);
|
||||
}
|
||||
|
||||
lavaPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "lava" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "lava"), new EntryText(lavaPages, TextHelper.localize(keyBase + "lava"), true));
|
||||
|
||||
List<IPage> lavaCrystalPages = new ArrayList<IPage>();
|
||||
|
||||
IRecipe lavaCrystalRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.LAVA_CRYSTAL));
|
||||
if (lavaCrystalRecipe != null) {
|
||||
lavaCrystalPages.add(BookUtils.getPageForRecipe(lavaCrystalRecipe));
|
||||
}
|
||||
|
||||
lavaCrystalPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "lavaCrystal" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "lavaCrystal"), new EntryText(lavaCrystalPages, TextHelper.localize(keyBase + "lavaCrystal"), true));
|
||||
|
||||
List<IPage> apprenticeorbPages = new ArrayList<IPage>();
|
||||
|
||||
AltarRecipe apprenticeorbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_APPRENTICE));
|
||||
if (apprenticeorbRecipe != null) {
|
||||
apprenticeorbPages.add(new PageAltarRecipe(apprenticeorbRecipe));
|
||||
}
|
||||
|
||||
apprenticeorbPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "apprenticeorb" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "apprenticeorb"), new EntryText(apprenticeorbPages, TextHelper.localize(keyBase + "apprenticeorb"), true));
|
||||
|
||||
List<IPage> daggerPages = new ArrayList<IPage>();
|
||||
|
||||
AltarRecipe daggerOfSacrificeRecipe = RecipeHelper.getAltarRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.DAGGER_OF_SACRIFICE));
|
||||
if (daggerOfSacrificeRecipe != null) {
|
||||
daggerPages.add(new PageAltarRecipe(daggerOfSacrificeRecipe));
|
||||
}
|
||||
|
||||
daggerPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "dagger" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "dagger"), new EntryText(daggerPages, TextHelper.localize(keyBase + "dagger"), true));
|
||||
|
||||
List<IPage> runeSacrificePages = new ArrayList<IPage>();
|
||||
|
||||
IRecipe runeSacrificeRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 3));
|
||||
if (runeSacrificeRecipe != null) {
|
||||
runeSacrificePages.add(BookUtils.getPageForRecipe(runeSacrificeRecipe));
|
||||
}
|
||||
|
||||
runeSacrificePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "runeSacrifice" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "runeSacrifice"), new EntryText(runeSacrificePages, TextHelper.localize(keyBase + "runeSacrifice"), true));
|
||||
|
||||
List<IPage> runeSelfSacrificePages = new ArrayList<IPage>();
|
||||
|
||||
IRecipe runeSelfSacrificeRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 4));
|
||||
if (runeSelfSacrificeRecipe != null) {
|
||||
runeSelfSacrificePages.add(BookUtils.getPageForRecipe(runeSelfSacrificeRecipe));
|
||||
}
|
||||
|
||||
runeSelfSacrificePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "runeSelfSacrifice" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "runeSelfSacrifice"), new EntryText(runeSelfSacrificePages, TextHelper.localize(keyBase + "runeSelfSacrifice"), true));
|
||||
|
||||
List<IPage> holdingPages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe holdingRecipe = RecipeHelper.getForgeRecipeForOutput(ItemComponent.getStack(ItemComponent.REAGENT_HOLDING));
|
||||
if (holdingRecipe != null) {
|
||||
holdingPages.add(new PageTartaricForgeRecipe(holdingRecipe));
|
||||
}
|
||||
|
||||
PageAlchemyArray holdingRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_HOLDING));
|
||||
if (holdingRecipePage != null) {
|
||||
holdingPages.add(holdingRecipePage);
|
||||
}
|
||||
|
||||
holdingPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "holding" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "holding"), new EntryText(holdingPages, TextHelper.localize(keyBase + "holding"), true));
|
||||
|
||||
List<IPage> airPages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe airRecipe = RecipeHelper.getForgeRecipeForOutput(ItemComponent.getStack(ItemComponent.REAGENT_AIR));
|
||||
if (airRecipe != null) {
|
||||
airPages.add(new PageTartaricForgeRecipe(airRecipe));
|
||||
}
|
||||
|
||||
PageAlchemyArray airRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_AIR));
|
||||
if (airRecipePage != null) {
|
||||
airPages.add(airRecipePage);
|
||||
}
|
||||
|
||||
airPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "air" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "air"), new EntryText(airPages, TextHelper.localize(keyBase + "air"), true));
|
||||
|
||||
List<IPage> voidPages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe voidRecipe = RecipeHelper.getForgeRecipeForOutput(ItemComponent.getStack(ItemComponent.REAGENT_VOID));
|
||||
if (voidRecipe != null) {
|
||||
voidPages.add(new PageTartaricForgeRecipe(voidRecipe));
|
||||
}
|
||||
|
||||
PageAlchemyArray voidRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_VOID));
|
||||
if (voidRecipePage != null) {
|
||||
voidPages.add(voidRecipePage);
|
||||
}
|
||||
|
||||
voidPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "void" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "void"), new EntryText(voidPages, TextHelper.localize(keyBase + "void"), true));
|
||||
|
||||
List<IPage> greenGrovePages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe greenGroveRecipe = RecipeHelper.getForgeRecipeForOutput(ItemComponent.getStack(ItemComponent.REAGENT_GROWTH));
|
||||
if (greenGroveRecipe != null) {
|
||||
greenGrovePages.add(new PageTartaricForgeRecipe(greenGroveRecipe));
|
||||
}
|
||||
|
||||
PageAlchemyArray greenGroveRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_GREEN_GROVE));
|
||||
if (greenGroveRecipePage != null) {
|
||||
greenGrovePages.add(greenGroveRecipePage);
|
||||
}
|
||||
|
||||
greenGrovePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "greenGrove" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "greenGrove"), new EntryText(greenGrovePages, TextHelper.localize(keyBase + "greenGrove"), true));
|
||||
|
||||
List<IPage> fastMinerPages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe fastMinerRecipe = RecipeHelper.getForgeRecipeForOutput(ItemComponent.getStack(ItemComponent.REAGENT_FASTMINER));
|
||||
if (fastMinerRecipe != null) {
|
||||
fastMinerPages.add(new PageTartaricForgeRecipe(fastMinerRecipe));
|
||||
}
|
||||
|
||||
PageAlchemyArray fastMinerRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_FAST_MINER));
|
||||
if (fastMinerRecipePage != null) {
|
||||
fastMinerPages.add(fastMinerRecipePage);
|
||||
}
|
||||
|
||||
fastMinerPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "fastMiner" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "fastMiner"), new EntryText(fastMinerPages, TextHelper.localize(keyBase + "fastMiner"), true));
|
||||
|
||||
List<IPage> seerPages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe seerRecipe = RecipeHelper.getForgeRecipeForOutput(ItemComponent.getStack(ItemComponent.REAGENT_SIGHT));
|
||||
if (seerRecipe != null) {
|
||||
seerPages.add(new PageTartaricForgeRecipe(seerRecipe));
|
||||
}
|
||||
|
||||
PageAlchemyArray seerRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_SEER));
|
||||
if (seerRecipePage != null) {
|
||||
seerPages.add(seerRecipePage);
|
||||
}
|
||||
|
||||
seerPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "seer" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "seer"), new EntryText(seerPages, TextHelper.localize(keyBase + "seer"), true));
|
||||
|
||||
List<IPage> magicianOrbPages = new ArrayList<IPage>();
|
||||
|
||||
AltarRecipe magicianOrbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_MAGICIAN));
|
||||
if (magicianOrbRecipe != null) {
|
||||
magicianOrbPages.add(new PageAltarRecipe(magicianOrbRecipe));
|
||||
}
|
||||
|
||||
magicianOrbPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "magicianOrb" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "magicianOrb"), new EntryText(magicianOrbPages, TextHelper.localize(keyBase + "magicianOrb"), true));
|
||||
|
||||
List<IPage> capacityPages = new ArrayList<IPage>();
|
||||
|
||||
IRecipe capacityRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 4));
|
||||
if (capacityRecipe != null) {
|
||||
capacityPages.add(BookUtils.getPageForRecipe(capacityRecipe));
|
||||
}
|
||||
|
||||
capacityPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "capacity" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "capacity"), new EntryText(capacityPages, TextHelper.localize(keyBase + "capacity"), true));
|
||||
|
||||
List<IPage> displacementPages = new ArrayList<IPage>();
|
||||
|
||||
IRecipe displacementRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 4));
|
||||
if (displacementRecipe != null) {
|
||||
displacementPages.add(BookUtils.getPageForRecipe(displacementRecipe));
|
||||
}
|
||||
|
||||
displacementPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "displacement" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "displacement"), new EntryText(displacementPages, TextHelper.localize(keyBase + "displacement"), true));
|
||||
|
||||
List<IPage> affinityPages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe affinityRecipe = RecipeHelper.getForgeRecipeForOutput(ItemComponent.getStack(ItemComponent.REAGENT_AFFINITY));
|
||||
if (affinityRecipe != null) {
|
||||
affinityPages.add(new PageTartaricForgeRecipe(affinityRecipe));
|
||||
}
|
||||
|
||||
PageAlchemyArray affinityRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_ELEMENTAL_AFFINITY));
|
||||
if (affinityRecipePage != null) {
|
||||
affinityPages.add(affinityRecipePage);
|
||||
}
|
||||
|
||||
affinityPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "affinity" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "affinity"), new EntryText(affinityPages, TextHelper.localize(keyBase + "affinity"), true));
|
||||
|
||||
List<IPage> lampPages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe lampRecipe = RecipeHelper.getForgeRecipeForOutput(ItemComponent.getStack(ItemComponent.REAGENT_BLOODLIGHT));
|
||||
if (lampRecipe != null) {
|
||||
lampPages.add(new PageTartaricForgeRecipe(lampRecipe));
|
||||
}
|
||||
|
||||
PageAlchemyArray lampRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_BLOOD_LIGHT));
|
||||
if (lampRecipePage != null) {
|
||||
lampPages.add(lampRecipePage);
|
||||
}
|
||||
|
||||
lampPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "lamp" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "lamp"), new EntryText(lampPages, TextHelper.localize(keyBase + "lamp"), true));
|
||||
|
||||
List<IPage> magnetismPages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe magnetismRecipe = RecipeHelper.getForgeRecipeForOutput(ItemComponent.getStack(ItemComponent.REAGENT_MAGNETISM));
|
||||
if (magnetismRecipe != null) {
|
||||
magnetismPages.add(new PageTartaricForgeRecipe(magnetismRecipe));
|
||||
}
|
||||
|
||||
PageAlchemyArray magnetismRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_MAGNETISM));
|
||||
if (magnetismRecipePage != null) {
|
||||
magnetismPages.add(magnetismRecipePage);
|
||||
}
|
||||
|
||||
magnetismPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "magnetism" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "magnetism"), new EntryText(magnetismPages, TextHelper.localize(keyBase + "magnetism"), true));
|
||||
|
||||
List<IPage> peritiaPages = new ArrayList<IPage>();
|
||||
|
||||
IRecipe peritiaRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.EXPERIENCE_TOME));
|
||||
if (peritiaRecipe != null) {
|
||||
peritiaPages.add(BookUtils.getPageForRecipe(peritiaRecipe));
|
||||
}
|
||||
|
||||
peritiaPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "peritia" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "peritia"), new EntryText(peritiaPages, TextHelper.localize(keyBase + "peritia"), true));
|
||||
|
||||
List<IPage> livingArmourPages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe bindingRecipe = RecipeHelper.getForgeRecipeForOutput(ItemComponent.getStack(ItemComponent.REAGENT_BINDING));
|
||||
if (bindingRecipe != null) {
|
||||
livingArmourPages.add(new PageTartaricForgeRecipe(bindingRecipe));
|
||||
}
|
||||
|
||||
PageAlchemyArray bindingRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.LIVING_ARMOUR_CHEST));
|
||||
if (bindingRecipePage != null) {
|
||||
livingArmourPages.add(bindingRecipePage);
|
||||
}
|
||||
|
||||
bindingRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.LIVING_ARMOUR_HELMET));
|
||||
if (bindingRecipePage != null) {
|
||||
livingArmourPages.add(bindingRecipePage);
|
||||
}
|
||||
|
||||
bindingRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.LIVING_ARMOUR_LEGGINGS));
|
||||
if (bindingRecipePage != null) {
|
||||
livingArmourPages.add(bindingRecipePage);
|
||||
}
|
||||
|
||||
bindingRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.LIVING_ARMOUR_BOOTS));
|
||||
if (bindingRecipePage != null) {
|
||||
livingArmourPages.add(bindingRecipePage);
|
||||
}
|
||||
|
||||
livingArmourPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "livingArmour" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "livingArmour"), new EntryText(livingArmourPages, TextHelper.localize(keyBase + "livingArmour"), true));
|
||||
|
||||
List<IPage> upgradePages = new ArrayList<IPage>();
|
||||
|
||||
upgradePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "upgradeTome" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "upgradeTome"), new EntryText(upgradePages, TextHelper.localize(keyBase + "upgradeTome"), true));
|
||||
|
||||
List<IPage> downgradePages = new ArrayList<IPage>();
|
||||
|
||||
downgradePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "downgrade" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "downgrade"), new EntryText(downgradePages, TextHelper.localize(keyBase + "downgrade"), true));
|
||||
|
||||
List<IPage> teleposerPages = new ArrayList<IPage>();
|
||||
|
||||
AltarRecipe teleposerFocusRecipe = RecipeHelper.getAltarRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.TELEPOSITION_FOCUS));
|
||||
if (teleposerFocusRecipe != null) {
|
||||
teleposerPages.add(new PageAltarRecipe(teleposerFocusRecipe));
|
||||
}
|
||||
|
||||
IRecipe teleposerRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.TELEPOSER));
|
||||
if (teleposerRecipe != null) {
|
||||
teleposerPages.add(BookUtils.getPageForRecipe(teleposerRecipe));
|
||||
}
|
||||
|
||||
teleposerPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "teleposer" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "teleposer"), new EntryText(teleposerPages, TextHelper.localize(keyBase + "teleposer"), true));
|
||||
|
||||
List<IPage> boundBladePages = new ArrayList<IPage>();
|
||||
|
||||
PageAlchemyArray boundBladePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.BOUND_SWORD));
|
||||
if (boundBladePage != null) {
|
||||
boundBladePages.add(boundBladePage);
|
||||
}
|
||||
|
||||
boundBladePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "boundBlade" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "boundBlade"), new EntryText(boundBladePages, TextHelper.localize(keyBase + "boundBlade"), true));
|
||||
|
||||
List<IPage> boundToolPages = new ArrayList<IPage>();
|
||||
|
||||
PageAlchemyArray boundToolPage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.BOUND_PICKAXE));
|
||||
if (boundToolPage != null) {
|
||||
boundToolPages.add(boundToolPage);
|
||||
}
|
||||
|
||||
boundToolPage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.BOUND_AXE));
|
||||
if (boundToolPage != null) {
|
||||
boundToolPages.add(boundToolPage);
|
||||
}
|
||||
|
||||
boundToolPage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.BOUND_SHOVEL));
|
||||
if (boundToolPage != null) {
|
||||
boundToolPages.add(boundToolPage);
|
||||
}
|
||||
|
||||
boundToolPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "boundTool" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "boundTool"), new EntryText(boundToolPages, TextHelper.localize(keyBase + "boundTool"), true));
|
||||
|
||||
List<IPage> weakShardPages = new ArrayList<IPage>();
|
||||
|
||||
weakShardPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "weakShard" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "weakShard"), new EntryText(weakShardPages, TextHelper.localize(keyBase + "weakShard"), true));
|
||||
|
||||
List<IPage> masterOrbPages = new ArrayList<IPage>();
|
||||
|
||||
AltarRecipe masterOrbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_MASTER));
|
||||
if (magicianOrbRecipe != null) {
|
||||
masterOrbPages.add(new PageAltarRecipe(masterOrbRecipe));
|
||||
}
|
||||
|
||||
masterOrbPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "masterOrb" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "masterOrb"), new EntryText(masterOrbPages, TextHelper.localize(keyBase + "masterOrb"), true));
|
||||
|
||||
List<IPage> orbRunePages = new ArrayList<IPage>();
|
||||
|
||||
IRecipe orbRuneRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 8));
|
||||
if (orbRuneRecipe != null) {
|
||||
orbRunePages.add(BookUtils.getPageForRecipe(orbRuneRecipe));
|
||||
}
|
||||
|
||||
orbRunePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "runeOrb" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "runeOrb"), new EntryText(orbRunePages, TextHelper.localize(keyBase + "runeOrb"), true));
|
||||
|
||||
List<IPage> augmentedCapacityPages = new ArrayList<IPage>();
|
||||
|
||||
IRecipe augmentedCapacityRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 7));
|
||||
if (orbRuneRecipe != null) {
|
||||
augmentedCapacityPages.add(BookUtils.getPageForRecipe(augmentedCapacityRecipe));
|
||||
}
|
||||
|
||||
augmentedCapacityPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "augmentedCapacity" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "augmentedCapacity"), new EntryText(augmentedCapacityPages, TextHelper.localize(keyBase + "augmentedCapacity"), true));
|
||||
|
||||
List<IPage> chargingPages = new ArrayList<IPage>();
|
||||
|
||||
IRecipe chargingRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 10));
|
||||
if (orbRuneRecipe != null) {
|
||||
chargingPages.add(BookUtils.getPageForRecipe(chargingRecipe));
|
||||
}
|
||||
|
||||
chargingPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "charging" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "charging"), new EntryText(chargingPages, TextHelper.localize(keyBase + "charging"), true));
|
||||
|
||||
List<IPage> accelerationPages = new ArrayList<IPage>();
|
||||
|
||||
IRecipe accelerationRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 9));
|
||||
if (orbRuneRecipe != null) {
|
||||
accelerationPages.add(BookUtils.getPageForRecipe(accelerationRecipe));
|
||||
}
|
||||
|
||||
accelerationPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "acceleration" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "acceleration"), new EntryText(accelerationPages, TextHelper.localize(keyBase + "acceleration"), true));
|
||||
|
||||
List<IPage> suppressionPages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe suppressionRecipe = RecipeHelper.getForgeRecipeForOutput(ItemComponent.getStack(ItemComponent.REAGENT_SUPPRESSION));
|
||||
if (suppressionRecipe != null) {
|
||||
suppressionPages.add(new PageTartaricForgeRecipe(suppressionRecipe));
|
||||
}
|
||||
|
||||
PageAlchemyArray suppressionRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_SUPPRESSION));
|
||||
if (suppressionRecipePage != null) {
|
||||
suppressionPages.add(suppressionRecipePage);
|
||||
}
|
||||
|
||||
suppressionPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "suppression" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "suppression"), new EntryText(suppressionPages, TextHelper.localize(keyBase + "suppression"), true));
|
||||
|
||||
List<IPage> hastePages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe hasteRecipe = RecipeHelper.getForgeRecipeForOutput(ItemComponent.getStack(ItemComponent.REAGENT_HASTE));
|
||||
if (hasteRecipe != null) {
|
||||
hastePages.add(new PageTartaricForgeRecipe(hasteRecipe));
|
||||
}
|
||||
|
||||
PageAlchemyArray hasteRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_HASTE));
|
||||
if (hasteRecipePage != null) {
|
||||
hastePages.add(hasteRecipePage);
|
||||
}
|
||||
|
||||
hastePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "haste" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "haste"), new EntryText(hastePages, TextHelper.localize(keyBase + "haste"), true));
|
||||
|
||||
List<IPage> severancePages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe severanceRecipe = RecipeHelper.getForgeRecipeForOutput(ItemComponent.getStack(ItemComponent.REAGENT_SEVERANCE));
|
||||
if (severanceRecipe != null) {
|
||||
severancePages.add(new PageTartaricForgeRecipe(severanceRecipe));
|
||||
}
|
||||
|
||||
PageAlchemyArray severanceRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_ENDER_SEVERANCE));
|
||||
if (severanceRecipePage != null) {
|
||||
severancePages.add(severanceRecipePage);
|
||||
}
|
||||
|
||||
severancePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "severance" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "severance"), new EntryText(severancePages, TextHelper.localize(keyBase + "severance"), true));
|
||||
|
||||
List<IPage> telepositionPages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe telepositionRecipe = RecipeHelper.getForgeRecipeForOutput(ItemComponent.getStack(ItemComponent.REAGENT_TELEPOSITION));
|
||||
if (telepositionRecipe != null) {
|
||||
telepositionPages.add(new PageTartaricForgeRecipe(telepositionRecipe));
|
||||
}
|
||||
|
||||
PageAlchemyArray telepositionRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_TELEPOSITION));
|
||||
if (telepositionRecipePage != null) {
|
||||
telepositionPages.add(telepositionRecipePage);
|
||||
}
|
||||
|
||||
telepositionPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "teleposition" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "teleposition"), new EntryText(telepositionPages, TextHelper.localize(keyBase + "teleposition"), true));
|
||||
|
||||
List<IPage> compressionPages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe compressionRecipe = RecipeHelper.getForgeRecipeForOutput(ItemComponent.getStack(ItemComponent.REAGENT_COMPRESSION));
|
||||
if (compressionRecipe != null) {
|
||||
compressionPages.add(new PageTartaricForgeRecipe(compressionRecipe));
|
||||
}
|
||||
|
||||
PageAlchemyArray compressionRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_COMPRESSION));
|
||||
if (compressionRecipePage != null) {
|
||||
compressionPages.add(compressionRecipePage);
|
||||
}
|
||||
|
||||
compressionPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "compression" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "compression"), new EntryText(compressionPages, TextHelper.localize(keyBase + "compression"), true));
|
||||
|
||||
List<IPage> bridgePages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe bridgeRecipe = RecipeHelper.getForgeRecipeForOutput(ItemComponent.getStack(ItemComponent.REAGENT_BRIDGE));
|
||||
if (bridgeRecipe != null) {
|
||||
bridgePages.add(new PageTartaricForgeRecipe(bridgeRecipe));
|
||||
}
|
||||
|
||||
PageAlchemyArray bridgeRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_PHANTOM_BRIDGE));
|
||||
if (bridgeRecipePage != null) {
|
||||
bridgePages.add(bridgeRecipePage);
|
||||
}
|
||||
|
||||
bridgePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "bridge" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "bridge"), new EntryText(bridgePages, TextHelper.localize(keyBase + "bridge"), true));
|
||||
|
||||
List<IPage> mimicPages = new ArrayList<IPage>();
|
||||
|
||||
IRecipe mimicRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.MIMIC, 1, 1));
|
||||
if (mimicRecipe != null) {
|
||||
mimicPages.add(BookUtils.getPageForRecipe(mimicRecipe));
|
||||
}
|
||||
|
||||
mimicPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "mimic" + ".info.1"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "mimic"), new EntryText(mimicPages, TextHelper.localize(keyBase + "mimic"), true));
|
||||
|
||||
for (Entry<ResourceLocation, EntryAbstract> entry : entries.entrySet()) {
|
||||
for (IPage page : entry.getValue().pageList) {
|
||||
if (page instanceof PageText) {
|
||||
((PageText) page).setUnicodeFlag(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return entries;
|
||||
public static void buildCategory(Book book) {
|
||||
final String keyBase = "guide." + BloodMagic.MODID + ".entry.architect.";
|
||||
|
||||
CategoryItemStack category = new CategoryItemStack(keyBase + "architect", new ItemStack(RegistrarBloodMagicItems.SIGIL_DIVINATION));
|
||||
category.withKeyBase(BloodMagic.MODID);
|
||||
|
||||
category.addEntry("intro", new EntryText(keyBase + "intro", true));
|
||||
category.getEntry("intro").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "intro.info"), 370));
|
||||
|
||||
category.addEntry("bloodaltar", new EntryText(keyBase + "bloodaltar", true));
|
||||
category.getEntry("bloodaltar").addPage(BookUtils.getCraftingPage("altar"));
|
||||
category.getEntry("bloodaltar").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "bloodaltar.info.1"), 370));
|
||||
category.getEntry("bloodaltar").addPage(BookUtils.getCraftingPage("sacrificial_dagger"));
|
||||
category.getEntry("bloodaltar").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "bloodaltar.info.2"), 370));
|
||||
|
||||
category.addEntry("ash", new EntryText(keyBase + "ash", true));
|
||||
category.getEntry("ash").addPage(BookUtils.getForgePage(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES)));
|
||||
category.getEntry("ash").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "ash.info"), 370));
|
||||
|
||||
category.addEntry("divination", new EntryText(keyBase + "divination", true));
|
||||
category.getEntry("divination").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_DIVINATION)));
|
||||
category.getEntry("divination").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "divination.info")));
|
||||
|
||||
category.addEntry("soulnetwork", new EntryText(keyBase + "soulnetwork", true));
|
||||
category.getEntry("soulnetwork").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "soulnetwork.info")));
|
||||
|
||||
category.addEntry("weakorb", new EntryText(keyBase + "weakorb", true));
|
||||
category.getEntry("weakorb").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "weakorb.info1"), 370));
|
||||
category.getEntry("weakorb").addPage(BookUtils.getAltarPage(getOrbStack(RegistrarBloodMagic.ORB_WEAK)));
|
||||
category.getEntry("weakorb").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "weakorb.info2"), 370));
|
||||
|
||||
category.addEntry("incense", new EntryText(keyBase + "incense", true));
|
||||
category.getEntry("incense").addPage(BookUtils.getCraftingPage("incense_altar"));
|
||||
category.getEntry("incense").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "incense.info.1"), 370));
|
||||
category.getEntry("incense").addPage(BookUtils.getCraftingPage("path_wood"));
|
||||
category.getEntry("incense").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "incense.info.2"), 370));
|
||||
|
||||
category.addEntry("bloodrune", new EntryText(keyBase + "bloodrune", true));
|
||||
category.getEntry("bloodrune").addPage(BookUtils.getCraftingPage("blood_rune_blank"));
|
||||
category.getEntry("bloodrune").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "bloodrune.info.1"), 370));
|
||||
|
||||
category.addEntry("inspectoris", new EntryText(keyBase + "inspectoris", true));
|
||||
category.getEntry("inspectoris").addPage(BookUtils.getAltarPage(new ItemStack(RegistrarBloodMagicItems.SANGUINE_BOOK)));
|
||||
category.getEntry("inspectoris").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "inspectoris.info.1"), 370));
|
||||
|
||||
category.addEntry("runeSpeed", new EntryText(keyBase + "runeSpeed", true));
|
||||
category.getEntry("runeSpeed").addPage(BookUtils.getAltarPage(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 1)));
|
||||
category.getEntry("runeSpeed").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "runeSpeed.info.1"), 370));
|
||||
|
||||
category.addEntry("water", new EntryText(keyBase + "water", true));
|
||||
category.getEntry("water").addPage(BookUtils.getForgePage(ReagentType.REAGENT_WATER.getStack()));
|
||||
category.getEntry("water").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_WATER)));
|
||||
category.getEntry("water").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "water.info.1"), 370));
|
||||
|
||||
category.addEntry("lava", new EntryText(keyBase + "lava", true));
|
||||
category.getEntry("lava").addPage(BookUtils.getForgePage(ReagentType.REAGENT_LAVA.getStack()));
|
||||
category.getEntry("lava").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_LAVA)));
|
||||
category.getEntry("lava").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "lava.info.1"), 370));
|
||||
|
||||
category.addEntry("lavaCrystal", new EntryText(keyBase + "lavaCrystal", true));
|
||||
category.getEntry("lavaCrystal").addPage(BookUtils.getCraftingPage("lava_crystal"));
|
||||
category.getEntry("lavaCrystal").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "lavaCrystal.info.1"), 370));
|
||||
|
||||
category.addEntry("apprenticeorb", new EntryText(keyBase + "apprenticeorb", true));
|
||||
category.getEntry("apprenticeorb").addPage(BookUtils.getAltarPage(getOrbStack(RegistrarBloodMagic.ORB_APPRENTICE)));
|
||||
category.getEntry("apprenticeorb").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "apprenticeorb.info.1"), 370));
|
||||
|
||||
category.addEntry("dagger", new EntryText(keyBase + "dagger", true));
|
||||
category.getEntry("dagger").addPage(BookUtils.getAltarPage(new ItemStack(RegistrarBloodMagicItems.DAGGER_OF_SACRIFICE)));
|
||||
category.getEntry("dagger").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "dagger.info.1"), 370));
|
||||
|
||||
category.addEntry("runeSacrifice", new EntryText(keyBase + "runeSacrifice", true));
|
||||
category.getEntry("runeSacrifice").addPage(BookUtils.getCraftingPage("blood_rune_sacrifice"));
|
||||
category.getEntry("runeSacrifice").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "runeSacrifice.info.1"), 370));
|
||||
|
||||
category.addEntry("runeSelfSacrifice", new EntryText(keyBase + "runeSelfSacrifice", true));
|
||||
category.getEntry("runeSelfSacrifice").addPage(BookUtils.getCraftingPage("blood_rune_selfsacrifice"));
|
||||
category.getEntry("runeSelfSacrifice").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "runeSelfSacrifice.info.1"), 370));
|
||||
|
||||
category.addEntry("holding", new EntryText(keyBase + "holding", true));
|
||||
category.getEntry("holding").addPage(BookUtils.getForgePage(ReagentType.REAGENT_HOLDING.getStack()));
|
||||
category.getEntry("holding").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_HOLDING)));
|
||||
category.getEntry("holding").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "holding.info.1"), 370));
|
||||
|
||||
category.addEntry("air", new EntryText(keyBase + "air", true));
|
||||
category.getEntry("air").addPage(BookUtils.getForgePage(ReagentType.REAGENT_AIR.getStack()));
|
||||
category.getEntry("air").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_AIR)));
|
||||
category.getEntry("air").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "air.info.1"), 370));
|
||||
|
||||
category.addEntry("void", new EntryText(keyBase + "void", true));
|
||||
category.getEntry("void").addPage(BookUtils.getForgePage(ReagentType.REAGENT_VOID.getStack()));
|
||||
category.getEntry("void").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_VOID)));
|
||||
category.getEntry("void").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "void.info.1"), 370));
|
||||
|
||||
category.addEntry("greenGrove", new EntryText(keyBase + "greenGrove", true));
|
||||
category.getEntry("greenGrove").addPage(BookUtils.getForgePage(ReagentType.REAGENT_GROWTH.getStack()));
|
||||
category.getEntry("greenGrove").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_GREEN_GROVE)));
|
||||
category.getEntry("greenGrove").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "greenGrove.info.1"), 370));
|
||||
|
||||
category.addEntry("fastMiner", new EntryText(keyBase + "fastMiner", true));
|
||||
category.getEntry("fastMiner").addPage(BookUtils.getForgePage(ReagentType.REAGENT_FASTMINER.getStack()));
|
||||
category.getEntry("fastMiner").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_FAST_MINER)));
|
||||
category.getEntry("fastMiner").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "fastMiner.info.1"), 370));
|
||||
|
||||
category.addEntry("seer", new EntryText(keyBase + "seer", true));
|
||||
category.getEntry("seer").addPage(BookUtils.getForgePage(ReagentType.REAGENT_SIGHT.getStack()));
|
||||
category.getEntry("seer").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_SEER)));
|
||||
category.getEntry("seer").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "seer.info.1"), 370));
|
||||
|
||||
category.addEntry("magicianOrb", new EntryText(keyBase + "magicianOrb", true));
|
||||
category.getEntry("magicianOrb").addPage(BookUtils.getAltarPage(getOrbStack(RegistrarBloodMagic.ORB_MAGICIAN)));
|
||||
category.getEntry("magicianOrb").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "magicianOrb.info.1"), 370));
|
||||
|
||||
category.addEntry("capacity", new EntryText(keyBase + "capacity", true));
|
||||
category.getEntry("capacity").addPage(BookUtils.getCraftingPage("blood_rune_capacity"));
|
||||
category.getEntry("capacity").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "capacity.info.1"), 370));
|
||||
|
||||
category.addEntry("displacement", new EntryText(keyBase + "displacement", true));
|
||||
category.getEntry("displacement").addPage(BookUtils.getCraftingPage("blood_rune_displacement"));
|
||||
category.getEntry("displacement").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "displacement.info.1"), 370));
|
||||
|
||||
category.addEntry("affinity", new EntryText(keyBase + "affinity", true));
|
||||
category.getEntry("affinity").addPage(BookUtils.getForgePage(ReagentType.REAGENT_AFFINITY.getStack()));
|
||||
category.getEntry("affinity").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_ELEMENTAL_AFFINITY)));
|
||||
category.getEntry("affinity").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "affinity.info"), 370));
|
||||
|
||||
category.addEntry("lamp", new EntryText(keyBase + "lamp", true));
|
||||
category.getEntry("lamp").addPage(BookUtils.getForgePage(ReagentType.REAGENT_BLOODLIGHT.getStack()));
|
||||
category.getEntry("lamp").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_BLOOD_LIGHT)));
|
||||
category.getEntry("lamp").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "lamp.info.1"), 370));
|
||||
|
||||
category.addEntry("magnetism", new EntryText(keyBase + "magnetism", true));
|
||||
category.getEntry("magnetism").addPage(BookUtils.getForgePage(ReagentType.REAGENT_MAGNETISM.getStack()));
|
||||
category.getEntry("magnetism").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_MAGNETISM)));
|
||||
category.getEntry("magnetism").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "magnetism.info.1"), 370));
|
||||
|
||||
category.addEntry("peritia", new EntryText(keyBase + "peritia", true));
|
||||
category.getEntry("peritia").addPage(BookUtils.getCraftingPage("experience_tome"));
|
||||
category.getEntry("peritia").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "peritia.info.1"), 370));
|
||||
|
||||
category.addEntry("livingArmour", new EntryText(keyBase + "livingArmour", true));
|
||||
category.getEntry("livingArmour").addPage(BookUtils.getForgePage(ReagentType.REAGENT_BINDING.getStack()));
|
||||
category.getEntry("livingArmour").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.LIVING_ARMOUR_CHEST)));
|
||||
category.getEntry("livingArmour").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.LIVING_ARMOUR_HELMET)));
|
||||
category.getEntry("livingArmour").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.LIVING_ARMOUR_LEGGINGS)));
|
||||
category.getEntry("livingArmour").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.LIVING_ARMOUR_BOOTS)));
|
||||
category.getEntry("livingArmour").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "livingArmour.info.1"), 370));
|
||||
|
||||
category.addEntry("upgradeTome", new EntryText(keyBase + "upgradeTome", true));
|
||||
category.getEntry("upgradeTome").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "upgradeTome.info.1")));
|
||||
|
||||
category.addEntry("downgrade", new EntryText(keyBase + "downgrade", true));
|
||||
category.getEntry("downgrade").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "downgrade.info.1")));
|
||||
|
||||
category.addEntry("teleposer", new EntryText(keyBase + "teleposer", true));
|
||||
category.getEntry("teleposer").addPage(BookUtils.getAltarPage(new ItemStack(RegistrarBloodMagicItems.TELEPOSITION_FOCUS)));
|
||||
category.getEntry("teleposer").addPage(BookUtils.getCraftingPage("teleposer"));
|
||||
category.getEntry("teleposer").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "teleposer.info.1"), 370));
|
||||
|
||||
category.addEntry("boundBlade", new EntryText(keyBase + "boundBlade", true));
|
||||
category.getEntry("boundBlade").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.BOUND_SWORD)));
|
||||
category.getEntry("boundBlade").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "boundBlade.info.1"), 370));
|
||||
|
||||
category.addEntry("boundTool", new EntryText(keyBase + "boundTool", true));
|
||||
category.getEntry("boundTool").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.BOUND_PICKAXE)));
|
||||
category.getEntry("boundTool").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.BOUND_AXE)));
|
||||
category.getEntry("boundTool").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.BOUND_SHOVEL)));
|
||||
category.getEntry("boundTool").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "boundTool.info.1"), 370));
|
||||
|
||||
category.addEntry("weakShard", new EntryText(keyBase + "weakShard", true));
|
||||
category.getEntry("weakShard").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "weakShard.info.1"), 370));
|
||||
|
||||
category.addEntry("masterOrb", new EntryText(keyBase + "masterOrb", true));
|
||||
category.getEntry("masterOrb").addPage(BookUtils.getAltarPage(getOrbStack(RegistrarBloodMagic.ORB_MASTER)));
|
||||
category.getEntry("masterOrb").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "masterOrb.info.1"), 370));
|
||||
|
||||
category.addEntry("runeOrb", new EntryText(keyBase + "runeOrb", true));
|
||||
category.getEntry("runeOrb").addPage(BookUtils.getCraftingPage("blood_rune_orb"));
|
||||
category.getEntry("runeOrb").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "runeOrb.info.1"), 370));
|
||||
|
||||
category.addEntry("augmentedCapacity", new EntryText(keyBase + "augmentedCapacity", true));
|
||||
category.getEntry("augmentedCapacity").addPage(BookUtils.getCraftingPage("blood_rune_augcapacity"));
|
||||
category.getEntry("augmentedCapacity").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "augmentedCapacity.info.1"), 370));
|
||||
|
||||
category.addEntry("charging", new EntryText(keyBase + "charging", true));
|
||||
category.getEntry("charging").addPage(BookUtils.getCraftingPage("blood_rune_charging"));
|
||||
category.getEntry("charging").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "charging.info.1"), 370));
|
||||
|
||||
category.addEntry("acceleration", new EntryText(keyBase + "acceleration", true));
|
||||
category.getEntry("acceleration").addPage(BookUtils.getCraftingPage("blood_rune_acceleration"));
|
||||
category.getEntry("acceleration").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "acceleration.info.1"), 370));
|
||||
|
||||
category.addEntry("suppression", new EntryText(keyBase + "suppression", true));
|
||||
category.getEntry("suppression").addPage(BookUtils.getForgePage(ReagentType.REAGENT_SUPPRESSION.getStack()));
|
||||
category.getEntry("suppression").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_SUPPRESSION)));
|
||||
category.getEntry("suppression").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "suppression.info.1"), 370));
|
||||
|
||||
category.addEntry("haste", new EntryText(keyBase + "haste", true));
|
||||
category.getEntry("haste").addPage(BookUtils.getForgePage(ReagentType.REAGENT_HASTE.getStack()));
|
||||
category.getEntry("haste").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_HASTE)));
|
||||
category.getEntry("haste").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "haste.info.1"), 370));
|
||||
|
||||
category.addEntry("severance", new EntryText(keyBase + "severance", true));
|
||||
category.getEntry("severance").addPage(BookUtils.getForgePage(ReagentType.REAGENT_SEVERANCE.getStack()));
|
||||
category.getEntry("severance").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_ENDER_SEVERANCE)));
|
||||
category.getEntry("severance").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "severance.info.1"), 370));
|
||||
|
||||
category.addEntry("teleposition", new EntryText(keyBase + "teleposition", true));
|
||||
category.getEntry("teleposition").addPage(BookUtils.getForgePage(ReagentType.REAGENT_TELEPOSITION.getStack()));
|
||||
category.getEntry("teleposition").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_TELEPOSITION)));
|
||||
category.getEntry("teleposition").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "teleposition.info.1"), 370));
|
||||
|
||||
category.addEntry("compression", new EntryText(keyBase + "compression", true));
|
||||
category.getEntry("compression").addPage(BookUtils.getForgePage(ReagentType.REAGENT_COMPRESSION.getStack()));
|
||||
category.getEntry("compression").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_COMPRESSION)));
|
||||
category.getEntry("compression").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "compression.info.1"), 370));
|
||||
|
||||
category.addEntry("bridge", new EntryText(keyBase + "bridge", true));
|
||||
category.getEntry("bridge").addPage(BookUtils.getForgePage(ReagentType.REAGENT_BRIDGE.getStack()));
|
||||
category.getEntry("bridge").addPage(BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_PHANTOM_BRIDGE)));
|
||||
category.getEntry("bridge").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "bridge.info.1"), 370));
|
||||
|
||||
category.addEntry("mimic", new EntryText(keyBase + "mimic", true));
|
||||
category.getEntry("mimic").addPage(BookUtils.getCraftingPage("mimic_solidopaque"));
|
||||
category.getEntry("mimic").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "mimic.info.1"), 370));
|
||||
|
||||
category.entries.values().forEach(e -> e.pageList.stream().filter(p -> p instanceof PageText).forEach(p -> ((PageText) p).setUnicodeFlag(true)));
|
||||
book.addCategory(category);
|
||||
}
|
||||
|
||||
private static ItemStack getOrbStack(BloodOrb orb) {
|
||||
ItemStack ret = new ItemStack(RegistrarBloodMagicItems.BLOOD_ORB);
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString("orb", BloodMagic.MODID + ":" + orb.getName());
|
||||
ret.setTagCompound(tag);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,191 +1,95 @@
|
|||
package WayofTime.bloodmagic.compat.guideapi.book;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.recipe.TartaricForgeRecipe;
|
||||
import WayofTime.bloodmagic.compat.guideapi.BookUtils;
|
||||
import WayofTime.bloodmagic.compat.guideapi.entry.EntryText;
|
||||
import WayofTime.bloodmagic.compat.guideapi.page.PageTartaricForgeRecipe;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.util.helper.RecipeHelper;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import amerifrance.guideapi.api.IPage;
|
||||
import amerifrance.guideapi.api.impl.abstraction.EntryAbstract;
|
||||
import amerifrance.guideapi.api.impl.Book;
|
||||
import amerifrance.guideapi.api.util.PageHelper;
|
||||
import amerifrance.guideapi.category.CategoryItemStack;
|
||||
import amerifrance.guideapi.page.PageText;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class CategoryDemon {
|
||||
//TODO: Add Forge recipe pages
|
||||
public static Map<ResourceLocation, EntryAbstract> buildCategory() {
|
||||
Map<ResourceLocation, EntryAbstract> entries = new LinkedHashMap<ResourceLocation, EntryAbstract>();
|
||||
String keyBase = "guide." + BloodMagic.MODID + ".entry.demon.";
|
||||
|
||||
List<IPage> introPages = new ArrayList<IPage>();
|
||||
introPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "intro" + ".info"), 370));
|
||||
// introPages.add(new PageImage(new ResourceLocation("bloodmagicguide", "textures/guide/" + ritual.getName() + ".png")));
|
||||
entries.put(new ResourceLocation(keyBase + "intro"), new EntryText(introPages, TextHelper.localize(keyBase + "intro"), true));
|
||||
public static void buildCategory(Book book) {
|
||||
final String keyBase = "guide." + BloodMagic.MODID + ".entry.demon.";
|
||||
|
||||
List<IPage> snarePages = new ArrayList<IPage>();
|
||||
snarePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "snare" + ".info.1"), 370));
|
||||
CategoryItemStack category = new CategoryItemStack(keyBase + "demon", new ItemStack(RegistrarBloodMagicItems.BLOOD_SHARD));
|
||||
category.withKeyBase(BloodMagic.MODID);
|
||||
|
||||
IRecipe snareRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.SOUL_SNARE));
|
||||
if (snareRecipe != null) {
|
||||
snarePages.add(BookUtils.getPageForRecipe(snareRecipe));
|
||||
}
|
||||
category.addEntry("intro", new EntryText(keyBase + "intro", true));
|
||||
category.getEntry("intro").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "intro.info"), 370));
|
||||
|
||||
snarePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "snare" + ".info.2"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "snare"), new EntryText(snarePages, TextHelper.localize(keyBase + "snare"), true));
|
||||
category.addEntry("snare", new EntryText(keyBase + "snare", true));
|
||||
category.getEntry("snare").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "snare.info.1"), 370));
|
||||
category.getEntry("snare").addPage(BookUtils.getCraftingPage("soul_snare"));
|
||||
category.getEntry("snare").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "snare.info.2"), 370));
|
||||
|
||||
List<IPage> forgePages = new ArrayList<IPage>();
|
||||
forgePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "forge" + ".info.1"), 370));
|
||||
category.addEntry("forge", new EntryText(keyBase + "forge", true));
|
||||
category.getEntry("forge").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "forge.info.1"), 370));
|
||||
category.getEntry("forge").addPage(BookUtils.getCraftingPage("soul_forge"));
|
||||
category.getEntry("forge").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "forge.info.2"), 370));
|
||||
|
||||
IRecipe forgeRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.SOUL_FORGE));
|
||||
if (forgeRecipe != null) {
|
||||
forgePages.add(BookUtils.getPageForRecipe(forgeRecipe));
|
||||
}
|
||||
category.addEntry("petty", new EntryText(keyBase + "petty", true));
|
||||
category.getEntry("petty").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "petty.info.1"), 370));
|
||||
category.getEntry("petty").addPage(BookUtils.getForgePage(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM)));
|
||||
category.getEntry("petty").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "petty.info.2"), 370));
|
||||
|
||||
forgePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "forge" + ".info.2"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "forge"), new EntryText(forgePages, TextHelper.localize(keyBase + "forge"), true));
|
||||
category.addEntry("sword", new EntryText(keyBase + "sword", true));
|
||||
category.getEntry("sword").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "sword.info.1"), 370));
|
||||
category.getEntry("sword").addPage(BookUtils.getForgePage(new ItemStack(RegistrarBloodMagicItems.SENTIENT_SWORD)));
|
||||
category.getEntry("sword").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "sword.info.2"), 370));
|
||||
|
||||
List<IPage> pettyPages = new ArrayList<IPage>();
|
||||
pettyPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "petty" + ".info.1"), 370));
|
||||
TartaricForgeRecipe pettyRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM));
|
||||
if (pettyRecipe != null) {
|
||||
pettyPages.add(new PageTartaricForgeRecipe(pettyRecipe));
|
||||
}
|
||||
pettyPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "petty" + ".info.2"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "petty"), new EntryText(pettyPages, TextHelper.localize(keyBase + "petty"), true));
|
||||
category.addEntry("lesser", new EntryText(keyBase + "lesser", true));
|
||||
category.getEntry("lesser").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "lesser.info.1"), 370));
|
||||
category.getEntry("lesser").addPage(BookUtils.getForgePage(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 1)));
|
||||
category.getEntry("lesser").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "lesser.info.2"), 370));
|
||||
|
||||
List<IPage> swordPages = new ArrayList<IPage>();
|
||||
swordPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "sword" + ".info.1"), 370));
|
||||
TartaricForgeRecipe swordRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.SENTIENT_SWORD));
|
||||
if (swordRecipe != null) {
|
||||
swordPages.add(new PageTartaricForgeRecipe(swordRecipe));
|
||||
}
|
||||
swordPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "sword" + ".info.2"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "sword"), new EntryText(swordPages, TextHelper.localize(keyBase + "sword"), true));
|
||||
category.addEntry("reactions", new EntryText(keyBase + "reactions", true));
|
||||
category.getEntry("reactions").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "reactions.info"), 370));
|
||||
|
||||
List<IPage> lesserPages = new ArrayList<IPage>();
|
||||
lesserPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "lesser" + ".info.1"), 370));
|
||||
TartaricForgeRecipe lesserRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 1));
|
||||
if (lesserRecipe != null) {
|
||||
lesserPages.add(new PageTartaricForgeRecipe(lesserRecipe));
|
||||
}
|
||||
lesserPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "lesser" + ".info.2"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "lesser"), new EntryText(lesserPages, TextHelper.localize(keyBase + "lesser"), true));
|
||||
category.addEntry("sentientGem", new EntryText(keyBase + "sentientGem", true));
|
||||
category.getEntry("sentientGem").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "sentientGem.info.1"), 370));
|
||||
category.getEntry("sentientGem").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "sentientGem.info.2"), 370));
|
||||
|
||||
List<IPage> reactionsPages = new ArrayList<IPage>();
|
||||
reactionsPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "reactions" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "reactions"), new EntryText(reactionsPages, TextHelper.localize(keyBase + "reactions"), true));
|
||||
category.addEntry("routing", new EntryText(keyBase + "routing", true));
|
||||
category.getEntry("routing").addPage(BookUtils.getForgePage(new ItemStack(RegistrarBloodMagicBlocks.ITEM_ROUTING_NODE)));
|
||||
category.getEntry("routing").addPage(BookUtils.getForgePage(new ItemStack(RegistrarBloodMagicBlocks.INPUT_ROUTING_NODE)));
|
||||
category.getEntry("routing").addPage(BookUtils.getForgePage(new ItemStack(RegistrarBloodMagicBlocks.OUTPUT_ROUTING_NODE)));
|
||||
category.getEntry("routing").addPage(BookUtils.getForgePage(new ItemStack(RegistrarBloodMagicBlocks.MASTER_ROUTING_NODE)));
|
||||
category.getEntry("routing").addPage(BookUtils.getForgePage(new ItemStack(RegistrarBloodMagicItems.NODE_ROUTER)));
|
||||
category.getEntry("routing").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "routing.info"), 370));
|
||||
|
||||
List<IPage> sentientGemPages = new ArrayList<IPage>();
|
||||
sentientGemPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "sentientGem" + ".info.1"), 370));
|
||||
sentientGemPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "sentientGem" + ".info.2"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "sentientGem"), new EntryText(sentientGemPages, TextHelper.localize(keyBase + "sentientGem"), true));
|
||||
category.addEntry("aura", new EntryText(keyBase + "aura", true));
|
||||
category.getEntry("aura").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "aura.info"), 370));
|
||||
|
||||
List<IPage> routingPages = new ArrayList<IPage>();
|
||||
TartaricForgeRecipe nodeRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.ITEM_ROUTING_NODE));
|
||||
if (nodeRecipe != null) {
|
||||
routingPages.add(new PageTartaricForgeRecipe(nodeRecipe));
|
||||
}
|
||||
TartaricForgeRecipe inputNodeRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.INPUT_ROUTING_NODE));
|
||||
if (inputNodeRecipe != null) {
|
||||
routingPages.add(new PageTartaricForgeRecipe(inputNodeRecipe));
|
||||
}
|
||||
TartaricForgeRecipe outputNodeRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.OUTPUT_ROUTING_NODE));
|
||||
if (outputNodeRecipe != null) {
|
||||
routingPages.add(new PageTartaricForgeRecipe(outputNodeRecipe));
|
||||
}
|
||||
TartaricForgeRecipe masterNodeRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.MASTER_ROUTING_NODE));
|
||||
if (masterNodeRecipe != null) {
|
||||
routingPages.add(new PageTartaricForgeRecipe(masterNodeRecipe));
|
||||
}
|
||||
category.addEntry("types", new EntryText(keyBase + "types", true));
|
||||
category.getEntry("types").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "types.info"), 370));
|
||||
|
||||
TartaricForgeRecipe nodeRouterRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.NODE_ROUTER));
|
||||
if (nodeRouterRecipe != null) {
|
||||
routingPages.add(new PageTartaricForgeRecipe(nodeRouterRecipe));
|
||||
}
|
||||
category.addEntry("crucible", new EntryText(keyBase + "crucible", true));
|
||||
category.getEntry("crucible").addPage(BookUtils.getForgePage(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRUCIBLE)));
|
||||
category.getEntry("crucible").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "crucible.info"), 370));
|
||||
|
||||
routingPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "routing" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "routing"), new EntryText(routingPages, TextHelper.localize(keyBase + "routing"), true));
|
||||
category.addEntry("crystallizer", new EntryText(keyBase + "crystallizer", true));
|
||||
category.getEntry("crystallizer").addPage(BookUtils.getForgePage(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTALLIZER)));
|
||||
category.getEntry("crystallizer").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "crystallizer.info"), 370));
|
||||
|
||||
List<IPage> auraPages = new ArrayList<IPage>();
|
||||
category.addEntry("cluster", new EntryText(keyBase + "cluster", true));
|
||||
category.getEntry("cluster").addPage(BookUtils.getForgePage(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTAL)));
|
||||
category.getEntry("cluster").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "cluster.info"), 370));
|
||||
|
||||
auraPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "aura" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "aura"), new EntryText(auraPages, TextHelper.localize(keyBase + "aura"), true));
|
||||
category.addEntry("pylon", new EntryText(keyBase + "pylon", true));
|
||||
category.getEntry("pylon").addPage(BookUtils.getForgePage(new ItemStack(RegistrarBloodMagicBlocks.DEMON_PYLON)));
|
||||
category.getEntry("pylon").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "pylon.info"), 370));
|
||||
|
||||
List<IPage> typesPages = new ArrayList<IPage>();
|
||||
category.addEntry("gauge", new EntryText(keyBase + "gauge", true));
|
||||
category.getEntry("gauge").addPage(BookUtils.getForgePage(new ItemStack(RegistrarBloodMagicItems.DEMON_WILL_GAUGE)));
|
||||
category.getEntry("gauge").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "gauge.info"), 370));
|
||||
|
||||
typesPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "types" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "types"), new EntryText(typesPages, TextHelper.localize(keyBase + "types"), true));
|
||||
|
||||
List<IPage> cruciblePages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe crucibleRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRUCIBLE));
|
||||
if (crucibleRecipe != null) {
|
||||
cruciblePages.add(new PageTartaricForgeRecipe(crucibleRecipe));
|
||||
}
|
||||
|
||||
cruciblePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "crucible" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "crucible"), new EntryText(cruciblePages, TextHelper.localize(keyBase + "crucible"), true));
|
||||
|
||||
List<IPage> crystallizerPages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe crystallizerRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTALLIZER));
|
||||
if (crystallizerRecipe != null) {
|
||||
crystallizerPages.add(new PageTartaricForgeRecipe(crystallizerRecipe));
|
||||
}
|
||||
|
||||
crystallizerPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "crystallizer" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "crystallizer"), new EntryText(crystallizerPages, TextHelper.localize(keyBase + "crystallizer"), true));
|
||||
|
||||
List<IPage> clusterPages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe clusterRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTAL));
|
||||
if (clusterRecipe != null) {
|
||||
clusterPages.add(new PageTartaricForgeRecipe(clusterRecipe));
|
||||
}
|
||||
|
||||
clusterPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "cluster" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "cluster"), new EntryText(clusterPages, TextHelper.localize(keyBase + "cluster"), true));
|
||||
|
||||
List<IPage> pylonPages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe pylonRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.DEMON_PYLON));
|
||||
if (pylonRecipe != null) {
|
||||
pylonPages.add(new PageTartaricForgeRecipe(pylonRecipe));
|
||||
}
|
||||
|
||||
pylonPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "pylon" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "pylon"), new EntryText(pylonPages, TextHelper.localize(keyBase + "pylon"), true));
|
||||
|
||||
List<IPage> gaugePages = new ArrayList<IPage>();
|
||||
|
||||
TartaricForgeRecipe gaugeRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.DEMON_WILL_GAUGE));
|
||||
if (gaugeRecipe != null) {
|
||||
gaugePages.add(new PageTartaricForgeRecipe(gaugeRecipe));
|
||||
}
|
||||
|
||||
gaugePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "gauge" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "gauge"), new EntryText(gaugePages, TextHelper.localize(keyBase + "gauge"), true));
|
||||
|
||||
for (Entry<ResourceLocation, EntryAbstract> entry : entries.entrySet()) {
|
||||
for (IPage page : entry.getValue().pageList) {
|
||||
if (page instanceof PageText) {
|
||||
((PageText) page).setUnicodeFlag(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return entries;
|
||||
category.entries.values().forEach(e -> e.pageList.stream().filter(p -> p instanceof PageText).forEach(p -> ((PageText) p).setUnicodeFlag(true)));
|
||||
book.addCategory(category);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,127 +1,113 @@
|
|||
package WayofTime.bloodmagic.compat.guideapi.book;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry.AltarRecipe;
|
||||
import WayofTime.bloodmagic.api.ritual.EnumRuneType;
|
||||
import WayofTime.bloodmagic.compat.guideapi.BookUtils;
|
||||
import WayofTime.bloodmagic.compat.guideapi.entry.EntryText;
|
||||
import WayofTime.bloodmagic.compat.guideapi.page.PageAltarRecipe;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.util.helper.RecipeHelper;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import amerifrance.guideapi.api.IPage;
|
||||
import amerifrance.guideapi.api.impl.abstraction.EntryAbstract;
|
||||
import amerifrance.guideapi.api.impl.Book;
|
||||
import amerifrance.guideapi.api.util.PageHelper;
|
||||
import amerifrance.guideapi.category.CategoryItemStack;
|
||||
import amerifrance.guideapi.page.PageText;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class CategoryRitual {
|
||||
static String keyBase = "guide." + BloodMagic.MODID + ".entry.ritual.";
|
||||
static final String keyBase = "guide." + BloodMagic.MODID + ".entry.ritual.";
|
||||
|
||||
public static Map<ResourceLocation, EntryAbstract> buildCategory() {
|
||||
Map<ResourceLocation, EntryAbstract> entries = new LinkedHashMap<ResourceLocation, EntryAbstract>();
|
||||
public static void buildCategory(Book book) {
|
||||
CategoryItemStack category = new CategoryItemStack(keyBase + "ritual", new ItemStack(RegistrarBloodMagicBlocks.RITUAL_CONTROLLER));
|
||||
category.withKeyBase(BloodMagic.MODID);
|
||||
|
||||
addRitualPagesToEntries("intro", entries);
|
||||
addRitualPagesToEntries("basics", entries);
|
||||
category.addEntry("intro", new EntryText(keyBase + "intro", true));
|
||||
category.getEntry("intro").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "intro.info")));
|
||||
|
||||
List<IPage> ritualStonePages = new ArrayList<IPage>();
|
||||
category.addEntry("basics", new EntryText(keyBase + "basics", true));
|
||||
category.getEntry("basics").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "basics.info")));
|
||||
|
||||
IRecipe ritualStoneRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.RITUAL_STONE));
|
||||
if (ritualStoneRecipe != null) {
|
||||
ritualStonePages.add(BookUtils.getPageForRecipe(ritualStoneRecipe));
|
||||
}
|
||||
category.addEntry("ritualStone", new EntryText(keyBase + "ritualStone", true));
|
||||
category.getEntry("ritualStone").addPage(BookUtils.getCraftingPage("ritual_stone_blank"));
|
||||
category.getEntry("ritualStone").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "ritualStone.info.1"), 370));
|
||||
for (EnumRuneType type : EnumRuneType.values())
|
||||
category.getEntry("ritualStone").addPage(BookUtils.getAltarPage(type.getScribeStack()));
|
||||
category.getEntry("ritualStone").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "ritualStone.info.2"), 370));
|
||||
|
||||
ritualStonePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "ritualStone" + ".info.1"), 370));
|
||||
category.addEntry("masterRitualStone", new EntryText(keyBase + "masterRitualStone", true));
|
||||
category.getEntry("masterRitualStone").addPage(BookUtils.getCraftingPage("ritual_controller_master"));
|
||||
category.getEntry("masterRitualStone").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "masterRitualStone.info"), 370));
|
||||
|
||||
for (int i = 1; i < 5; i++) {
|
||||
EnumRuneType type = EnumRuneType.values()[i];
|
||||
AltarRecipe scribeRecipe = RecipeHelper.getAltarRecipeForOutput(type.getScribeStack());
|
||||
if (scribeRecipe != null) {
|
||||
ritualStonePages.add(new PageAltarRecipe(scribeRecipe));
|
||||
}
|
||||
}
|
||||
category.addEntry("activationCrystal", new EntryText(keyBase + "activationCrystal", true));
|
||||
category.getEntry("activationCrystal").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "activationCrystal.info.1"), 370));
|
||||
category.getEntry("activationCrystal").addPage(BookUtils.getAltarPage(new ItemStack(RegistrarBloodMagicItems.ACTIVATION_CRYSTAL)));
|
||||
category.getEntry("activationCrystal").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "activationCrystal.info.2"), 370));
|
||||
|
||||
ritualStonePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "ritualStone" + ".info.2"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "ritualStone"), new EntryText(ritualStonePages, TextHelper.localize(keyBase + "ritualStone"), true));
|
||||
category.addEntry("diviner", new EntryText(keyBase + "diviner", true));
|
||||
category.getEntry("diviner").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "diviner.info.1"), 370));
|
||||
category.getEntry("diviner").addPage(BookUtils.getCraftingPage("ritual_diviner_0"));
|
||||
category.getEntry("diviner").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "diviner.info.2"), 370));
|
||||
|
||||
List<IPage> masterRitualStonePages = new ArrayList<IPage>();
|
||||
category.addEntry("fullSpring", new EntryText(keyBase + "fullSpring", true));
|
||||
category.getEntry("fullSpring").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "fullSpring.info")));
|
||||
|
||||
IRecipe masterRitualStoneRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.RITUAL_CONTROLLER, 1, 0));
|
||||
if (masterRitualStoneRecipe != null) {
|
||||
masterRitualStonePages.add(BookUtils.getPageForRecipe(masterRitualStoneRecipe));
|
||||
}
|
||||
category.addEntry("lava", new EntryText(keyBase + "lava", true));
|
||||
category.getEntry("lava").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "lava.info")));
|
||||
|
||||
masterRitualStonePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "masterRitualStone" + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "masterRitualStone"), new EntryText(masterRitualStonePages, TextHelper.localize(keyBase + "masterRitualStone"), true));
|
||||
category.addEntry("greenGrove", new EntryText(keyBase + "greenGrove", true));
|
||||
category.getEntry("greenGrove").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "greenGrove.info")));
|
||||
|
||||
List<IPage> activationCrystalPages = new ArrayList<IPage>();
|
||||
category.addEntry("magnetism", new EntryText(keyBase + "magnetism", true));
|
||||
category.getEntry("magnetism").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "magnetism.info")));
|
||||
|
||||
activationCrystalPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "activationCrystal" + ".info.1"), 370));
|
||||
category.addEntry("crusher", new EntryText(keyBase + "crusher", true));
|
||||
category.getEntry("crusher").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "crusher.info")));
|
||||
|
||||
AltarRecipe crystalRecipe = RecipeHelper.getAltarRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.ACTIVATION_CRYSTAL));
|
||||
if (crystalRecipe != null) {
|
||||
activationCrystalPages.add(new PageAltarRecipe(crystalRecipe));
|
||||
}
|
||||
category.addEntry("highJump", new EntryText(keyBase + "highJump", true));
|
||||
category.getEntry("highJump").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "highJump.info")));
|
||||
|
||||
activationCrystalPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "activationCrystal" + ".info.2"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "activationCrystal"), new EntryText(activationCrystalPages, TextHelper.localize(keyBase + "activationCrystal"), true));
|
||||
category.addEntry("speed", new EntryText(keyBase + "speed", true));
|
||||
category.getEntry("speed").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "speed.info")));
|
||||
|
||||
List<IPage> divinerPages = new ArrayList<IPage>();
|
||||
category.addEntry("wellOfSuffering", new EntryText(keyBase + "wellOfSuffering", true));
|
||||
category.getEntry("wellOfSuffering").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "wellOfSuffering.info")));
|
||||
|
||||
divinerPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "diviner" + ".info.1"), 370));
|
||||
category.addEntry("featheredKnife", new EntryText(keyBase + "featheredKnife", true));
|
||||
category.getEntry("featheredKnife").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "featheredKnife.info")));
|
||||
|
||||
IRecipe divinerRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.RITUAL_DIVINER));
|
||||
if (divinerRecipe != null) {
|
||||
divinerPages.add(BookUtils.getPageForRecipe(divinerRecipe));
|
||||
}
|
||||
category.addEntry("regen", new EntryText(keyBase + "regen", true));
|
||||
category.getEntry("regen").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "regen.info")));
|
||||
|
||||
divinerPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "diviner" + ".info.2"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + "diviner"), new EntryText(divinerPages, TextHelper.localize(keyBase + "diviner"), true));
|
||||
category.addEntry("harvest", new EntryText(keyBase + "harvest", true));
|
||||
category.getEntry("harvest").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "harvest.info")));
|
||||
|
||||
addRitualPagesToEntries("fullSpring", entries);
|
||||
addRitualPagesToEntries("lava", entries);
|
||||
addRitualPagesToEntries("greenGrove", entries);
|
||||
addRitualPagesToEntries("magnetism", entries);
|
||||
addRitualPagesToEntries("crusher", entries);
|
||||
addRitualPagesToEntries("highJump", entries);
|
||||
addRitualPagesToEntries("speed", entries);
|
||||
addRitualPagesToEntries("wellOfSuffering", entries);
|
||||
addRitualPagesToEntries("featheredKnife", entries);
|
||||
addRitualPagesToEntries("regen", entries);
|
||||
addRitualPagesToEntries("harvest", entries);
|
||||
addRitualPagesToEntries("interdiction", entries);
|
||||
addRitualPagesToEntries("containment", entries);
|
||||
addRitualPagesToEntries("suppression", entries);
|
||||
addRitualPagesToEntries("expulsion", entries);
|
||||
addRitualPagesToEntries("zephyr", entries);
|
||||
addRitualPagesToEntries("laying", entries);
|
||||
addRitualPagesToEntries("timberman", entries);
|
||||
addRitualPagesToEntries("meteor", entries);
|
||||
addRitualPagesToEntries("downgrade", entries);
|
||||
category.addEntry("interdiction", new EntryText(keyBase + "interdiction", true));
|
||||
category.getEntry("interdiction").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "interdiction.info")));
|
||||
|
||||
for (Entry<ResourceLocation, EntryAbstract> entry : entries.entrySet()) {
|
||||
for (IPage page : entry.getValue().pageList) {
|
||||
if (page instanceof PageText) {
|
||||
((PageText) page).setUnicodeFlag(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
category.addEntry("containment", new EntryText(keyBase + "containment", true));
|
||||
category.getEntry("containment").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "containment.info")));
|
||||
|
||||
return entries;
|
||||
}
|
||||
category.addEntry("suppression", new EntryText(keyBase + "suppression", true));
|
||||
category.getEntry("suppression").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "suppression.info")));
|
||||
|
||||
public static void addRitualPagesToEntries(String name, Map<ResourceLocation, EntryAbstract> entries) {
|
||||
List<IPage> pages = new ArrayList<IPage>();
|
||||
pages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + name + ".info"), 370));
|
||||
entries.put(new ResourceLocation(keyBase + name), new EntryText(pages, TextHelper.localize(keyBase + name), true));
|
||||
category.addEntry("expulsion", new EntryText(keyBase + "expulsion", true));
|
||||
category.getEntry("expulsion").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "expulsion.info")));
|
||||
|
||||
category.addEntry("zephyr", new EntryText(keyBase + "zephyr", true));
|
||||
category.getEntry("zephyr").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "zephyr.info")));
|
||||
|
||||
category.addEntry("laying", new EntryText(keyBase + "laying", true));
|
||||
category.getEntry("laying").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "laying.info")));
|
||||
|
||||
category.addEntry("timberman", new EntryText(keyBase + "timberman", true));
|
||||
category.getEntry("timberman").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "timberman.info")));
|
||||
|
||||
category.addEntry("meteor", new EntryText(keyBase + "meteor", true));
|
||||
category.getEntry("meteor").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "meteor.info")));
|
||||
|
||||
category.addEntry("downgrade", new EntryText(keyBase + "downgrade", true));
|
||||
category.getEntry("downgrade").addPageList(PageHelper.pagesForLongText(I18n.format(keyBase + "downgrade.info")));
|
||||
|
||||
category.entries.values().forEach(e -> e.pageList.stream().filter(p -> p instanceof PageText).forEach(p -> ((PageText) p).setUnicodeFlag(true)));
|
||||
book.addCategory(category);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.guideapi.book;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import amerifrance.guideapi.api.impl.abstraction.EntryAbstract;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class CategorySpell {
|
||||
public static Map<ResourceLocation, EntryAbstract> buildCategory() {
|
||||
Map<ResourceLocation, EntryAbstract> entries = new LinkedHashMap<ResourceLocation, EntryAbstract>();
|
||||
String keyBase = Constants.Mod.DOMAIN + "spell_";
|
||||
|
||||
return entries;
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@ import amerifrance.guideapi.api.impl.abstraction.CategoryAbstract;
|
|||
import amerifrance.guideapi.api.util.GuiHelper;
|
||||
import amerifrance.guideapi.entry.EntryResourceLocation;
|
||||
import amerifrance.guideapi.gui.GuiBase;
|
||||
import com.google.common.collect.Lists;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
@ -17,12 +18,16 @@ import java.util.List;
|
|||
|
||||
public class EntryText extends EntryResourceLocation {
|
||||
|
||||
public EntryText(List<IPage> pageList, String unlocEntryName, boolean unicode) {
|
||||
super(pageList, unlocEntryName, new ResourceLocation("bloodmagicguide", "textures/gui/bullet_point.png"), unicode);
|
||||
public EntryText(List<IPage> pageList, String name, boolean unicode) {
|
||||
super(pageList, name, new ResourceLocation("bloodmagicguide", "textures/gui/bullet_point.png"), unicode);
|
||||
}
|
||||
|
||||
public EntryText(List<IPage> pageList, String unlocEntryName) {
|
||||
this(pageList, unlocEntryName, false);
|
||||
public EntryText(List<IPage> pageList, String name) {
|
||||
this(pageList, name, false);
|
||||
}
|
||||
|
||||
public EntryText(String name, boolean unicode) {
|
||||
this(Lists.newArrayList(), name, unicode);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package WayofTime.bloodmagic.compat.guideapi.page;
|
||||
|
||||
import WayofTime.bloodmagic.api.ItemStackWrapper;
|
||||
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeBloodAltar;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import amerifrance.guideapi.api.impl.Book;
|
||||
import amerifrance.guideapi.api.impl.Page;
|
||||
|
@ -11,60 +10,91 @@ import amerifrance.guideapi.api.util.GuiHelper;
|
|||
import amerifrance.guideapi.gui.GuiBase;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class PageAltarRecipe extends Page {
|
||||
|
||||
public List<ItemStack> input;
|
||||
public ItemStack output;
|
||||
public int tier;
|
||||
public int bloodRequired;
|
||||
public final ItemStack[] input;
|
||||
public final ItemStack output;
|
||||
public final int tier;
|
||||
public final int bloodRequired;
|
||||
|
||||
public PageAltarRecipe(AltarRecipeRegistry.AltarRecipe recipe) {
|
||||
this.input = ItemStackWrapper.toStackList(recipe.getInput());
|
||||
private long lastCycle = -1;
|
||||
private int cycleIdx = 0;
|
||||
private Random random = new Random();
|
||||
|
||||
public PageAltarRecipe(RecipeBloodAltar recipe) {
|
||||
this.input = recipe.getInput().getMatchingStacks();
|
||||
this.output = recipe.getOutput();
|
||||
this.tier = recipe.getMinTier().toInt();
|
||||
this.tier = recipe.getMinimumTier().toInt();
|
||||
this.bloodRequired = recipe.getSyphon();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("bloodmagicguide" + ":textures/gui/altar.png"));
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
mc.getTextureManager().bindTexture(new ResourceLocation("bloodmagicguide", "textures/gui/altar.png"));
|
||||
|
||||
long time = mc.world.getTotalWorldTime();
|
||||
if (lastCycle < 0 || lastCycle < time - 20) {
|
||||
if (lastCycle > 0) {
|
||||
cycleIdx++;
|
||||
cycleIdx = Math.max(0, cycleIdx);
|
||||
}
|
||||
lastCycle = mc.world.getTotalWorldTime();
|
||||
}
|
||||
|
||||
guiBase.drawTexturedModalRect(guiLeft + 42, guiTop + 53, 0, 0, 146, 104);
|
||||
|
||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("guide.bloodmagic.page.bloodAltar"), guiLeft + guiBase.xSize / 2, guiTop + 12, 0);
|
||||
|
||||
int inputX = (1 + 1) * 20 + (guiLeft + guiBase.xSize / 7) + 1;
|
||||
int inputY = (20) + (guiTop + guiBase.ySize / 5) - 1; //1 * 20
|
||||
GuiHelper.drawItemStack(input.get(0), inputX, inputY);
|
||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, inputX, inputY, 15, 15)) {
|
||||
guiBase.renderToolTip(input.get(0), mouseX, mouseY);
|
||||
}
|
||||
ItemStack inputStack = input[getRandomizedCycle(0, input.length)];
|
||||
GuiHelper.drawItemStack(inputStack, inputX, inputY);
|
||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, inputX, inputY, 15, 15))
|
||||
guiBase.renderToolTip(inputStack, mouseX, mouseY);
|
||||
|
||||
ItemStack outputStack = output;
|
||||
if (output.isEmpty())
|
||||
outputStack = new ItemStack(Blocks.BARRIER);
|
||||
|
||||
if (output.isEmpty()) {
|
||||
output = new ItemStack(Blocks.BARRIER);
|
||||
}
|
||||
int outputX = (5 * 20) + (guiLeft + guiBase.xSize / 7) + 1;
|
||||
int outputY = (20) + (guiTop + guiBase.xSize / 5) - 1; // 1 * 20
|
||||
GuiHelper.drawItemStack(output, outputX, outputY);
|
||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) {
|
||||
guiBase.renderToolTip(output, outputX, outputY);
|
||||
}
|
||||
GuiHelper.drawItemStack(outputStack, outputX, outputY);
|
||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15))
|
||||
guiBase.renderToolTip(outputStack, outputX, outputY);
|
||||
|
||||
if (output.getItem() == Item.getItemFromBlock(Blocks.BARRIER)) {
|
||||
if (outputStack.getItem() == Item.getItemFromBlock(Blocks.BARRIER)) {
|
||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("text.furnace.error"), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0xED073D);
|
||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("bm.string.tier") + ": " + String.valueOf(tier), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 15, 0);
|
||||
guiBase.drawCenteredString(fontRenderer, "LP: " + String.valueOf(bloodRequired), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 30, 0);
|
||||
}
|
||||
|
||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("guide.bloodmagic.page.tier", String.valueOf(tier)), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0);
|
||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("guide.bloodmagic.page.lp", String.valueOf(bloodRequired)), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 15, 0);
|
||||
}
|
||||
|
||||
protected ItemStack getNextItem(ItemStack stack, int position) {
|
||||
NonNullList<ItemStack> subItems = NonNullList.create();
|
||||
Item item = stack.getItem();
|
||||
|
||||
item.getSubItems(CreativeTabs.SEARCH, subItems);
|
||||
return subItems.get(getRandomizedCycle(position, subItems.size()));
|
||||
}
|
||||
|
||||
protected int getRandomizedCycle(int index, int max) {
|
||||
random.setSeed(index);
|
||||
return (index + random.nextInt(max) + cycleIdx) % max;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.bloodmagic.compat.guideapi.page;
|
||||
|
||||
import WayofTime.bloodmagic.api.recipe.TartaricForgeRecipe;
|
||||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeTartaricForge;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import amerifrance.guideapi.api.impl.Book;
|
||||
import amerifrance.guideapi.api.impl.Page;
|
||||
|
@ -9,11 +9,14 @@ import amerifrance.guideapi.api.impl.abstraction.CategoryAbstract;
|
|||
import amerifrance.guideapi.api.impl.abstraction.EntryAbstract;
|
||||
import amerifrance.guideapi.api.util.GuiHelper;
|
||||
import amerifrance.guideapi.gui.GuiBase;
|
||||
import com.google.common.collect.Lists;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
@ -23,93 +26,72 @@ import java.util.List;
|
|||
import java.util.Random;
|
||||
|
||||
public class PageTartaricForgeRecipe extends Page {
|
||||
public List<Object> input;
|
||||
public ItemStack output;
|
||||
public int tier;
|
||||
public double minimumWill;
|
||||
public double drainedWill;
|
||||
public final List<ItemStack[]> input;
|
||||
public final ItemStack output;
|
||||
public final int tier;
|
||||
public final double minimumWill;
|
||||
public final double drainedWill;
|
||||
|
||||
private long lastCycle = -1;
|
||||
private int cycleIdx = 0;
|
||||
private Random rand = new Random();
|
||||
private Random random = new Random();
|
||||
|
||||
public PageTartaricForgeRecipe(TartaricForgeRecipe recipe) {
|
||||
this.input = recipe.getInput();
|
||||
this.output = recipe.getRecipeOutput();
|
||||
public PageTartaricForgeRecipe(RecipeTartaricForge recipe) {
|
||||
input = Lists.newArrayList();
|
||||
for (Ingredient ingredient : recipe.getInput())
|
||||
input.add(ingredient.getMatchingStacks());
|
||||
|
||||
this.output = recipe.getOutput();
|
||||
this.tier = 0;
|
||||
this.minimumWill = recipe.getMinimumSouls();
|
||||
this.drainedWill = recipe.getSoulsDrained();
|
||||
this.drainedWill = recipe.getSoulDrain();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("bloodmagicguide" + ":textures/gui/soulForge.png"));
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
mc.getTextureManager().bindTexture(new ResourceLocation("bloodmagicguide", "textures/gui/soulForge.png"));
|
||||
|
||||
long time = mc.world.getTotalWorldTime();
|
||||
if (lastCycle < 0 || lastCycle < time - 20) {
|
||||
if (lastCycle > 0) {
|
||||
cycleIdx++;
|
||||
cycleIdx = Math.max(0, cycleIdx);
|
||||
}
|
||||
lastCycle = mc.world.getTotalWorldTime();
|
||||
}
|
||||
|
||||
guiBase.drawTexturedModalRect(guiLeft + 42, guiTop + 53, 0, 0, 146, 104);
|
||||
|
||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("guide.bloodmagic.page.soulForge"), guiLeft + guiBase.xSize / 2, guiTop + 12, 0);
|
||||
|
||||
// int inputX = (1 + 1) * 20 + (guiLeft + guiBase.xSize / 7) + 1;
|
||||
// int inputY = (20) + (guiTop + guiBase.ySize / 5) - 1; //1 * 20
|
||||
|
||||
for (int y = 0; y < 2; y++) {
|
||||
for (int x = 0; x < 2; x++) {
|
||||
int stackX = (x + 1) * 20 + (guiLeft + guiBase.xSize / 7) + 1;
|
||||
int stackY = (y + 1) * 20 + (guiTop + guiBase.ySize / 5) - 1;
|
||||
Object component = input.size() > y * 2 + x ? input.get(y * 2 + x) : null;//recipe.getInput()[y * 2 + x];
|
||||
ItemStack[] component = input.size() > y * 2 + x ? input.get(y * 2 + x) : null;//recipe.getInput()[y * 2 + x];
|
||||
if (component != null) {
|
||||
if (component instanceof ItemStack) {
|
||||
ItemStack input = (ItemStack) component;
|
||||
if (input.getItemDamage() == OreDictionary.WILDCARD_VALUE)
|
||||
input.setItemDamage(0);
|
||||
|
||||
GuiHelper.drawItemStack((ItemStack) component, stackX, stackY);
|
||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
|
||||
// tooltips = GuiHelper.getTooltip((ItemStack) component);
|
||||
guiBase.renderToolTip((ItemStack) component, mouseX, mouseY);
|
||||
}
|
||||
} else if (component instanceof Integer) {
|
||||
List<ItemStack> list = OrbRegistry.getOrbsDownToTier((Integer) component);
|
||||
if (!list.isEmpty()) {
|
||||
ItemStack stack = list.get(getRandomizedCycle(x + (y * 2), list.size()));
|
||||
GuiHelper.drawItemStack(stack, stackX, stackY);
|
||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
|
||||
// tooltips = GuiHelper.getTooltip(stack);
|
||||
guiBase.renderToolTip(stack, mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<ItemStack> list = (List<ItemStack>) component;
|
||||
if (!list.isEmpty()) {
|
||||
ItemStack stack = list.get(getRandomizedCycle(x + (y * 2), list.size()));
|
||||
GuiHelper.drawItemStack(stack, stackX, stackY);
|
||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
|
||||
// tooltips = GuiHelper.getTooltip(stack);
|
||||
guiBase.renderToolTip(stack, mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
}
|
||||
ItemStack drawStack = component[getRandomizedCycle(x + (y * 2), component.length)];
|
||||
GuiHelper.drawItemStack(drawStack, stackX, stackY);
|
||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
|
||||
guiBase.renderToolTip(drawStack, mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// GuiHelper.drawItemStack(input.get(0), inputX, inputY);
|
||||
// if (GuiHelper.isMouseBetween(mouseX, mouseY, inputX, inputY, 15, 15))
|
||||
// {
|
||||
// guiBase.renderToolTip(input.get(0), mouseX, mouseY);
|
||||
// }
|
||||
ItemStack outputStack = output;
|
||||
if (outputStack.isEmpty())
|
||||
outputStack = new ItemStack(Blocks.BARRIER);
|
||||
|
||||
if (output == null) {
|
||||
output = new ItemStack(Blocks.BARRIER);
|
||||
}
|
||||
int outputX = (5 * 20) + (guiLeft + guiBase.xSize / 7) + 1;
|
||||
int outputY = (20) + (guiTop + guiBase.xSize / 5) + 10; // 1 * 20
|
||||
GuiHelper.drawItemStack(output, outputX, outputY);
|
||||
GuiHelper.drawItemStack(outputStack, outputX, outputY);
|
||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) {
|
||||
guiBase.renderToolTip(output, outputX, outputY);
|
||||
guiBase.renderToolTip(outputStack, outputX, outputY);
|
||||
}
|
||||
|
||||
if (output.getItem() == Item.getItemFromBlock(Blocks.BARRIER)) {
|
||||
if (outputStack.getItem() == Item.getItemFromBlock(Blocks.BARRIER)) {
|
||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("text.furnace.error"), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0xED073D);
|
||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("bm.string.tier") + ": " + String.valueOf(tier), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 15, 0);
|
||||
// guiBase.drawCenteredString(fontRenderer, "LP: " + String.valueOf(bloodRequired), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 30, 0);
|
||||
|
@ -118,8 +100,16 @@ public class PageTartaricForgeRecipe extends Page {
|
|||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("guide.bloodmagic.page.drainedWill", String.valueOf(drainedWill)), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0);
|
||||
}
|
||||
|
||||
protected ItemStack getNextItem(ItemStack stack, int position) {
|
||||
NonNullList<ItemStack> subItems = NonNullList.create();
|
||||
Item item = stack.getItem();
|
||||
|
||||
item.getSubItems(item.getCreativeTab(), subItems);
|
||||
return subItems.get(getRandomizedCycle(position, subItems.size()));
|
||||
}
|
||||
|
||||
protected int getRandomizedCycle(int index, int max) {
|
||||
rand.setSeed(index);
|
||||
return (index + rand.nextInt(max) + cycleIdx) % max;
|
||||
random.setSeed(index);
|
||||
return (index + random.nextInt(max) + cycleIdx) % max;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,16 +3,18 @@ package WayofTime.bloodmagic.compat.jei;
|
|||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.livingArmour.LivingArmourHandler;
|
||||
import WayofTime.bloodmagic.api.util.helper.ItemHelper.LivingUpgrades;
|
||||
import WayofTime.bloodmagic.api_impl.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeAlchemyTable;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeBloodAltar;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeTartaricForge;
|
||||
import WayofTime.bloodmagic.client.gui.GuiSoulForge;
|
||||
import WayofTime.bloodmagic.compat.jei.alchemyArray.AlchemyArrayCraftingCategory;
|
||||
import WayofTime.bloodmagic.compat.jei.alchemyArray.AlchemyArrayCraftingRecipeHandler;
|
||||
import WayofTime.bloodmagic.compat.jei.alchemyArray.AlchemyArrayCraftingRecipeMaker;
|
||||
import WayofTime.bloodmagic.compat.jei.alchemyTable.AlchemyTableRecipeCategory;
|
||||
import WayofTime.bloodmagic.compat.jei.alchemyTable.AlchemyTableRecipeHandler;
|
||||
import WayofTime.bloodmagic.compat.jei.alchemyTable.AlchemyTableRecipeMaker;
|
||||
import WayofTime.bloodmagic.compat.jei.alchemyTable.AlchemyTableRecipeJEI;
|
||||
import WayofTime.bloodmagic.compat.jei.altar.AltarRecipeCategory;
|
||||
import WayofTime.bloodmagic.compat.jei.altar.AltarRecipeHandler;
|
||||
import WayofTime.bloodmagic.compat.jei.altar.AltarRecipeMaker;
|
||||
import WayofTime.bloodmagic.compat.jei.altar.AltarRecipeJEI;
|
||||
import WayofTime.bloodmagic.compat.jei.armourDowngrade.ArmourDowngradeRecipeCategory;
|
||||
import WayofTime.bloodmagic.compat.jei.armourDowngrade.ArmourDowngradeRecipeHandler;
|
||||
import WayofTime.bloodmagic.compat.jei.armourDowngrade.ArmourDowngradeRecipeMaker;
|
||||
|
@ -20,8 +22,7 @@ import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeCategory;
|
|||
import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeHandler;
|
||||
import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeMaker;
|
||||
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeCategory;
|
||||
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeHandler;
|
||||
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeMaker;
|
||||
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeJEI;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import mezz.jei.api.*;
|
||||
|
@ -32,7 +33,7 @@ import javax.annotation.Nonnull;
|
|||
import java.util.Map;
|
||||
|
||||
@JEIPlugin
|
||||
public class BloodMagicPlugin extends BlankModPlugin {
|
||||
public class BloodMagicJEIPlugin implements IModPlugin {
|
||||
public static IJeiHelpers jeiHelper;
|
||||
|
||||
@Override
|
||||
|
@ -40,19 +41,21 @@ public class BloodMagicPlugin extends BlankModPlugin {
|
|||
jeiHelper = registry.getJeiHelpers();
|
||||
|
||||
registry.addRecipeHandlers(
|
||||
new AltarRecipeHandler(),
|
||||
new BindingRecipeHandler(),
|
||||
new AlchemyArrayCraftingRecipeHandler(),
|
||||
new TartaricForgeRecipeHandler(),
|
||||
new AlchemyTableRecipeHandler(),
|
||||
new ArmourDowngradeRecipeHandler()
|
||||
);
|
||||
|
||||
registry.addRecipes(AltarRecipeMaker.getRecipes());
|
||||
registry.addRecipes(BloodMagicAPI.INSTANCE.getRecipeRegistrar().getAltarRecipes(), Constants.Compat.JEI_CATEGORY_ALTAR);
|
||||
registry.addRecipes(BloodMagicAPI.INSTANCE.getRecipeRegistrar().getAlchemyRecipes(), Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE);
|
||||
registry.addRecipes(BloodMagicAPI.INSTANCE.getRecipeRegistrar().getTartaricForgeRecipes(), Constants.Compat.JEI_CATEGORY_SOULFORGE);
|
||||
|
||||
registry.handleRecipes(RecipeBloodAltar.class, AltarRecipeJEI::new, Constants.Compat.JEI_CATEGORY_ALTAR);
|
||||
registry.handleRecipes(RecipeAlchemyTable.class, AlchemyTableRecipeJEI::new, Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE);
|
||||
registry.handleRecipes(RecipeTartaricForge.class, TartaricForgeRecipeJEI::new, Constants.Compat.JEI_CATEGORY_SOULFORGE);
|
||||
|
||||
registry.addRecipes(BindingRecipeMaker.getRecipes());
|
||||
registry.addRecipes(AlchemyArrayCraftingRecipeMaker.getRecipes());
|
||||
registry.addRecipes(TartaricForgeRecipeMaker.getRecipes());
|
||||
registry.addRecipes(AlchemyTableRecipeMaker.getRecipes());
|
||||
registry.addRecipes(ArmourDowngradeRecipeMaker.getRecipes());
|
||||
|
||||
registry.addIngredientInfo(new ItemStack(RegistrarBloodMagicItems.ALTAR_MAKER), ItemStack.class, "jei.bloodmagic.desc.altarBuilder");
|
||||
|
@ -82,6 +85,7 @@ public class BloodMagicPlugin extends BlankModPlugin {
|
|||
@Override
|
||||
public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) {
|
||||
subtypeRegistry.useNbtForSubtypes(RegistrarBloodMagicItems.UPGRADE_TOME);
|
||||
subtypeRegistry.useNbtForSubtypes(RegistrarBloodMagicItems.BLOOD_ORB);
|
||||
}
|
||||
|
||||
@Override
|
|
@ -2,7 +2,7 @@ package WayofTime.bloodmagic.compat.jei.alchemyArray;
|
|||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicJEIPlugin;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
|
@ -22,7 +22,7 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory {
|
|||
private static final int OUTPUT_SLOT = 2;
|
||||
|
||||
@Nonnull
|
||||
private final IDrawable background = BloodMagicPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/binding.png"), 0, 0, 100, 30);
|
||||
private final IDrawable background = BloodMagicJEIPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/binding.png"), 0, 0, 100, 30);
|
||||
@Nonnull
|
||||
private final String localizedName = TextHelper.localize("jei.bloodmagic.recipe.alchemyArrayCrafting");
|
||||
|
||||
|
|
|
@ -3,33 +3,33 @@ package WayofTime.bloodmagic.compat.jei.alchemyTable;
|
|||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicJEIPlugin;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
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.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AlchemyTableRecipeCategory extends BlankRecipeCategory<AlchemyTableRecipeJEI> {
|
||||
public class AlchemyTableRecipeCategory implements IRecipeCategory<AlchemyTableRecipeJEI> {
|
||||
private static final int OUTPUT_SLOT = 0;
|
||||
private static final int ORB_SLOT = 1;
|
||||
private static final int INPUT_SLOT = 2;
|
||||
|
||||
@Nonnull
|
||||
private final IDrawable background = BloodMagicPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/alchemyTable.png"), 0, 0, 118, 40);
|
||||
private final IDrawable background = BloodMagicJEIPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/alchemyTable.png"), 0, 0, 118, 40);
|
||||
@Nonnull
|
||||
private final String localizedName = TextHelper.localize("jei.bloodmagic.recipe.alchemyTable");
|
||||
@Nonnull
|
||||
private final ICraftingGridHelper craftingGridHelper;
|
||||
|
||||
public AlchemyTableRecipeCategory() {
|
||||
craftingGridHelper = BloodMagicPlugin.jeiHelper.getGuiHelper().createCraftingGridHelper(INPUT_SLOT, OUTPUT_SLOT);
|
||||
craftingGridHelper = BloodMagicJEIPlugin.jeiHelper.getGuiHelper().createCraftingGridHelper(INPUT_SLOT, OUTPUT_SLOT);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
@ -64,7 +64,7 @@ public class AlchemyTableRecipeCategory extends BlankRecipeCategory<AlchemyTable
|
|||
}
|
||||
}
|
||||
|
||||
guiItemStacks.set(ORB_SLOT, OrbRegistry.getOrbsDownToTier(recipeWrapper.getRecipe().getTierRequired()));
|
||||
guiItemStacks.set(ORB_SLOT, OrbRegistry.getOrbsDownToTier(recipeWrapper.getRecipe().getMinimumTier()));
|
||||
guiItemStacks.set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
craftingGridHelper.setInputs(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2);
|
||||
}
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.jei.alchemyTable;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AlchemyTableRecipeHandler implements IRecipeHandler<AlchemyTableRecipeJEI> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<AlchemyTableRecipeJEI> getRecipeClass() {
|
||||
return AlchemyTableRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull AlchemyTableRecipeJEI recipe) {
|
||||
return Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull AlchemyTableRecipeJEI recipe) {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull AlchemyTableRecipeJEI recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,42 +1,41 @@
|
|||
package WayofTime.bloodmagic.compat.jei.alchemyTable;
|
||||
|
||||
import WayofTime.bloodmagic.api.recipe.AlchemyTableRecipe;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeAlchemyTable;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicJEIPlugin;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import com.google.common.collect.Lists;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AlchemyTableRecipeJEI extends BlankRecipeWrapper {
|
||||
private AlchemyTableRecipe recipe;
|
||||
public class AlchemyTableRecipeJEI implements IRecipeWrapper {
|
||||
private RecipeAlchemyTable recipe;
|
||||
|
||||
public AlchemyTableRecipeJEI(AlchemyTableRecipe recipe) {
|
||||
public AlchemyTableRecipeJEI(RecipeAlchemyTable recipe) {
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
List<List<ItemStack>> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput());
|
||||
List<List<ItemStack>> expanded = BloodMagicJEIPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput());
|
||||
ingredients.setInputLists(ItemStack.class, expanded);
|
||||
ingredients.setOutput(ItemStack.class, recipe.getRecipeOutput(Lists.<ItemStack>newArrayList()));
|
||||
ingredients.setOutput(ItemStack.class, recipe.getOutput());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY) {
|
||||
ArrayList<String> ret = new ArrayList<String>();
|
||||
List<String> tooltip = Lists.newArrayList();
|
||||
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()));
|
||||
tooltip.add(TextHelper.localize("tooltip.bloodmagic.tier", recipe.getMinimumTier()));
|
||||
tooltip.add(TextHelper.localize("jei.bloodmagic.recipe.lpDrained", recipe.getSyphon()));
|
||||
tooltip.add(TextHelper.localize("jei.bloodmagic.recipe.ticksRequired", recipe.getTicks()));
|
||||
}
|
||||
return ret;
|
||||
return tooltip;
|
||||
}
|
||||
|
||||
public AlchemyTableRecipe getRecipe() {
|
||||
public RecipeAlchemyTable getRecipe() {
|
||||
return recipe;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.jei.alchemyTable;
|
||||
|
||||
import WayofTime.bloodmagic.api.recipe.AlchemyTableRecipe;
|
||||
import WayofTime.bloodmagic.api.registry.AlchemyTableRecipeRegistry;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AlchemyTableRecipeMaker {
|
||||
@Nonnull
|
||||
public static List<AlchemyTableRecipeJEI> getRecipes() {
|
||||
List<AlchemyTableRecipe> recipeList = AlchemyTableRecipeRegistry.getRecipeList();
|
||||
ArrayList<AlchemyTableRecipeJEI> recipes = new ArrayList<AlchemyTableRecipeJEI>();
|
||||
|
||||
for (AlchemyTableRecipe recipe : recipeList)
|
||||
recipes.add(new AlchemyTableRecipeJEI(recipe));
|
||||
|
||||
return recipes;
|
||||
}
|
||||
}
|
|
@ -2,13 +2,12 @@ package WayofTime.bloodmagic.compat.jei.altar;
|
|||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicJEIPlugin;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
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;
|
||||
|
@ -16,12 +15,12 @@ import net.minecraft.util.ResourceLocation;
|
|||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class AltarRecipeCategory implements IRecipeCategory {
|
||||
public class AltarRecipeCategory implements IRecipeCategory<AltarRecipeJEI> {
|
||||
private static final int INPUT_SLOT = 0;
|
||||
private static final int OUTPUT_SLOT = 1;
|
||||
|
||||
@Nonnull
|
||||
private final IDrawable background = BloodMagicPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/altar.png"), 3, 4, 155, 65);
|
||||
private final IDrawable background = BloodMagicJEIPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/altar.png"), 3, 4, 155, 65);
|
||||
@Nonnull
|
||||
private final String localizedName = TextHelper.localize("jei.bloodmagic.recipe.altar");
|
||||
|
||||
|
@ -55,14 +54,12 @@ public class AltarRecipeCategory implements IRecipeCategory {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
public void setRecipe(IRecipeLayout recipeLayout, AltarRecipeJEI recipeWrapper, IIngredients ingredients) {
|
||||
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 31, 0);
|
||||
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 125, 30);
|
||||
|
||||
if (recipeWrapper instanceof AltarRecipeJEI) {
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0));
|
||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
}
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0));
|
||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.jei.altar;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AltarRecipeHandler implements IRecipeHandler<AltarRecipeJEI> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<AltarRecipeJEI> getRecipeClass() {
|
||||
return AltarRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull AltarRecipeJEI recipe) {
|
||||
return Constants.Compat.JEI_CATEGORY_ALTAR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull AltarRecipeJEI recipe) {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull AltarRecipeJEI recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,18 +1,20 @@
|
|||
package WayofTime.bloodmagic.compat.jei.altar;
|
||||
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeBloodAltar;
|
||||
import WayofTime.bloodmagic.util.helper.NumeralHelper;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import com.google.common.collect.Lists;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AltarRecipeJEI extends BlankRecipeWrapper {
|
||||
public class AltarRecipeJEI implements IRecipeWrapper {
|
||||
@Nonnull
|
||||
private final List<ItemStack> input;
|
||||
@Nonnull
|
||||
|
@ -22,13 +24,13 @@ public class AltarRecipeJEI extends BlankRecipeWrapper {
|
|||
private final int consumptionRate;
|
||||
private final int drainRate;
|
||||
|
||||
public AltarRecipeJEI(@Nonnull List<ItemStack> input, @Nonnull ItemStack output, int tier, int requiredLP, int consumptionRate, int drainRate) {
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
public AltarRecipeJEI(RecipeBloodAltar recipe) {
|
||||
this.input = NonNullList.from(ItemStack.EMPTY, recipe.getInput().getMatchingStacks());
|
||||
this.output = recipe.getOutput();
|
||||
|
||||
this.infoString = new String[]{TextHelper.localize("jei.bloodmagic.recipe.requiredTier", NumeralHelper.toRoman(tier)), TextHelper.localize("jei.bloodmagic.recipe.requiredLP", requiredLP)};
|
||||
this.consumptionRate = consumptionRate;
|
||||
this.drainRate = drainRate;
|
||||
this.infoString = new String[]{TextHelper.localize("jei.bloodmagic.recipe.requiredTier", NumeralHelper.toRoman(recipe.getMinimumTier().toInt())), TextHelper.localize("jei.bloodmagic.recipe.requiredLP", recipe.getSyphon())};
|
||||
this.consumptionRate = recipe.getConsumeRate();
|
||||
this.drainRate = recipe.getDrainRate();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -39,12 +41,12 @@ public class AltarRecipeJEI extends BlankRecipeWrapper {
|
|||
|
||||
@Override
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY) {
|
||||
ArrayList<String> ret = new ArrayList<String>();
|
||||
List<String> tooltip = Lists.newArrayList();
|
||||
if (mouseX >= 13 && mouseX <= 64 && mouseY >= 27 && mouseY <= 58) {
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.consumptionRate", consumptionRate));
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.drainRate", drainRate));
|
||||
tooltip.add(TextHelper.localize("jei.bloodmagic.recipe.consumptionRate", consumptionRate));
|
||||
tooltip.add(TextHelper.localize("jei.bloodmagic.recipe.drainRate", drainRate));
|
||||
}
|
||||
return ret;
|
||||
return tooltip;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.jei.altar;
|
||||
|
||||
import WayofTime.bloodmagic.api.ItemStackWrapper;
|
||||
import WayofTime.bloodmagic.api.orb.IBloodOrb;
|
||||
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry;
|
||||
import WayofTime.bloodmagic.block.BlockLifeEssence;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AltarRecipeMaker {
|
||||
@Nonnull
|
||||
public static List<AltarRecipeJEI> getRecipes() {
|
||||
Map<List<ItemStackWrapper>, AltarRecipeRegistry.AltarRecipe> altarMap = AltarRecipeRegistry.getRecipes();
|
||||
|
||||
ArrayList<AltarRecipeJEI> recipes = new ArrayList<AltarRecipeJEI>();
|
||||
|
||||
for (Map.Entry<List<ItemStackWrapper>, AltarRecipeRegistry.AltarRecipe> itemStackAltarRecipeEntry : altarMap.entrySet()) {
|
||||
// Make sure input is not a Blood Orb. If it is, the recipe is for a filling orb, and we don't want that.
|
||||
if (!(itemStackAltarRecipeEntry.getKey().get(0).toStack().getItem() instanceof IBloodOrb)) {
|
||||
List<ItemStack> input = ItemStackWrapper.toStackList(itemStackAltarRecipeEntry.getValue().getInput());
|
||||
ItemStack output = itemStackAltarRecipeEntry.getValue().getOutput();
|
||||
int requiredTier = itemStackAltarRecipeEntry.getValue().getMinTier().toInt();
|
||||
int requiredLP = itemStackAltarRecipeEntry.getValue().getSyphon();
|
||||
int consumptionRate = itemStackAltarRecipeEntry.getValue().getConsumeRate();
|
||||
int drainRate = itemStackAltarRecipeEntry.getValue().getDrainRate();
|
||||
|
||||
if (output.getItem() == ForgeModContainer.getInstance().universalBucket && requiredLP == 1000)
|
||||
output = FluidUtil.getFilledBucket(new FluidStack(BlockLifeEssence.getLifeEssence(), Fluid.BUCKET_VOLUME));
|
||||
|
||||
AltarRecipeJEI recipe = new AltarRecipeJEI(input, output, requiredTier, requiredLP, consumptionRate, drainRate);
|
||||
recipes.add(recipe);
|
||||
}
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@ package WayofTime.bloodmagic.compat.jei.armourDowngrade;
|
|||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicJEIPlugin;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import mezz.jei.api.gui.ICraftingGridHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
|
@ -24,14 +24,14 @@ public class ArmourDowngradeRecipeCategory implements IRecipeCategory {
|
|||
private static final int INPUT_SLOT = 2;
|
||||
|
||||
@Nonnull
|
||||
private final IDrawable background = BloodMagicPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/alchemyTable.png"), 0, 0, 118, 40);
|
||||
private final IDrawable background = BloodMagicJEIPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/alchemyTable.png"), 0, 0, 118, 40);
|
||||
@Nonnull
|
||||
private final String localizedName = TextHelper.localize("jei.bloodmagic.recipe.armourDowngrade");
|
||||
@Nonnull
|
||||
private final ICraftingGridHelper craftingGridHelper;
|
||||
|
||||
public ArmourDowngradeRecipeCategory() {
|
||||
craftingGridHelper = BloodMagicPlugin.jeiHelper.getGuiHelper().createCraftingGridHelper(INPUT_SLOT, OUTPUT_SLOT);
|
||||
craftingGridHelper = BloodMagicJEIPlugin.jeiHelper.getGuiHelper().createCraftingGridHelper(INPUT_SLOT, OUTPUT_SLOT);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
|
|
@ -2,7 +2,7 @@ package WayofTime.bloodmagic.compat.jei.armourDowngrade;
|
|||
|
||||
import WayofTime.bloodmagic.api.recipe.LivingArmourDowngradeRecipe;
|
||||
import WayofTime.bloodmagic.api.util.helper.ItemHelper.LivingUpgrades;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicJEIPlugin;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import com.google.common.collect.Lists;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
|
@ -20,7 +20,7 @@ public class ArmourDowngradeRecipeJEI extends BlankRecipeWrapper {
|
|||
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
List<List<ItemStack>> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput());
|
||||
List<List<ItemStack>> expanded = BloodMagicJEIPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput());
|
||||
expanded.add(Lists.newArrayList(recipe.getKey()));
|
||||
ingredients.setInputLists(ItemStack.class, expanded);
|
||||
ItemStack upgradeStack = new ItemStack(RegistrarBloodMagicItems.UPGRADE_TOME);
|
||||
|
|
|
@ -2,7 +2,7 @@ package WayofTime.bloodmagic.compat.jei.binding;
|
|||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicJEIPlugin;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
|
@ -22,7 +22,7 @@ public class BindingRecipeCategory implements IRecipeCategory {
|
|||
private static final int OUTPUT_SLOT = 2;
|
||||
|
||||
@Nonnull
|
||||
private final IDrawable background = BloodMagicPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/binding.png"), 0, 0, 100, 30);
|
||||
private final IDrawable background = BloodMagicJEIPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/binding.png"), 0, 0, 100, 30);
|
||||
@Nonnull
|
||||
private final String localizedName = TextHelper.localize("jei.bloodmagic.recipe.binding");
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package WayofTime.bloodmagic.compat.jei.forge;
|
|||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicJEIPlugin;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import mezz.jei.api.gui.ICraftingGridHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
|
@ -10,7 +10,6 @@ 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;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
@ -19,20 +18,20 @@ import javax.annotation.Nonnull;
|
|||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class TartaricForgeRecipeCategory implements IRecipeCategory {
|
||||
public class TartaricForgeRecipeCategory implements IRecipeCategory<TartaricForgeRecipeJEI> {
|
||||
private static final int OUTPUT_SLOT = 0;
|
||||
private static final int GEM_SLOT = 1;
|
||||
private static final int INPUT_SLOT = 2;
|
||||
|
||||
@Nonnull
|
||||
private final IDrawable background = BloodMagicPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/soulForge.png"), 0, 0, 100, 40);
|
||||
private final IDrawable background = BloodMagicJEIPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/soulForge.png"), 0, 0, 100, 40);
|
||||
@Nonnull
|
||||
private final String localizedName = TextHelper.localize("jei.bloodmagic.recipe.soulForge");
|
||||
@Nonnull
|
||||
private final ICraftingGridHelper craftingGridHelper;
|
||||
|
||||
public TartaricForgeRecipeCategory() {
|
||||
craftingGridHelper = BloodMagicPlugin.jeiHelper.getGuiHelper().createCraftingGridHelper(INPUT_SLOT, OUTPUT_SLOT);
|
||||
craftingGridHelper = BloodMagicJEIPlugin.jeiHelper.getGuiHelper().createCraftingGridHelper(INPUT_SLOT, OUTPUT_SLOT);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
@ -65,7 +64,7 @@ public class TartaricForgeRecipeCategory implements IRecipeCategory {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
public void setRecipe(IRecipeLayout recipeLayout, TartaricForgeRecipeJEI recipeWrapper, IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOT, false, 73, 13);
|
||||
|
@ -79,16 +78,12 @@ public class TartaricForgeRecipeCategory implements IRecipeCategory {
|
|||
}
|
||||
|
||||
List<List<ItemStack>> inputs = ingredients.getInputs(ItemStack.class);
|
||||
List<List<ItemStack>> outputs = ingredients.getOutputs(ItemStack.class);
|
||||
|
||||
if (recipeWrapper instanceof TartaricForgeRecipeJEI) {
|
||||
TartaricForgeRecipeJEI recipe = (TartaricForgeRecipeJEI) recipeWrapper;
|
||||
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.setInputs(guiItemStacks, inputs);
|
||||
}
|
||||
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.setInputs(guiItemStacks, inputs);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.jei.forge;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TartaricForgeRecipeHandler implements IRecipeHandler<TartaricForgeRecipeJEI> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<TartaricForgeRecipeJEI> getRecipeClass() {
|
||||
return TartaricForgeRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull TartaricForgeRecipeJEI recipe) {
|
||||
return Constants.Compat.JEI_CATEGORY_SOULFORGE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull TartaricForgeRecipeJEI recipe) {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull TartaricForgeRecipeJEI recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,22 +1,22 @@
|
|||
package WayofTime.bloodmagic.compat.jei.forge;
|
||||
|
||||
import WayofTime.bloodmagic.api.recipe.TartaricForgeRecipe;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeTartaricForge;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicJEIPlugin;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import com.google.common.collect.Lists;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TartaricForgeRecipeJEI extends BlankRecipeWrapper {
|
||||
private TartaricForgeRecipe recipe;
|
||||
private List<ItemStack> validGems = new ArrayList<ItemStack>();
|
||||
private RecipeTartaricForge recipe;
|
||||
private List<ItemStack> validGems = Lists.newArrayList();
|
||||
|
||||
public TartaricForgeRecipeJEI(TartaricForgeRecipe recipe) {
|
||||
public TartaricForgeRecipeJEI(RecipeTartaricForge recipe) {
|
||||
this.recipe = recipe;
|
||||
|
||||
for (DefaultWill will : DefaultWill.values())
|
||||
|
@ -26,32 +26,28 @@ public class TartaricForgeRecipeJEI extends BlankRecipeWrapper {
|
|||
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
List<List<ItemStack>> expandedInputs = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput());
|
||||
List<List<ItemStack>> expandedInputs = BloodMagicJEIPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput());
|
||||
expandedInputs.add(validGems);
|
||||
ingredients.setInputLists(ItemStack.class, expandedInputs);
|
||||
ingredients.setOutput(ItemStack.class, recipe.getRecipeOutput());
|
||||
ingredients.setOutput(ItemStack.class, recipe.getOutput());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY) {
|
||||
ArrayList<String> ret = new ArrayList<String>();
|
||||
List<String> tooltip = Lists.newArrayList();
|
||||
if (mouseX >= 40 && mouseX <= 60 && mouseY >= 21 && mouseY <= 34) {
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.minimumSouls", recipe.getMinimumSouls()));
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.soulsDrained", recipe.getSoulsDrained()));
|
||||
return ret;
|
||||
tooltip.add(TextHelper.localize("jei.bloodmagic.recipe.minimumSouls", recipe.getMinimumSouls()));
|
||||
tooltip.add(TextHelper.localize("jei.bloodmagic.recipe.soulsDrained", recipe.getSoulDrain()));
|
||||
return tooltip;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public TartaricForgeRecipe getRecipe() {
|
||||
public RecipeTartaricForge getRecipe() {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
public List<ItemStack> getValidGems() {
|
||||
return validGems;
|
||||
}
|
||||
|
||||
public enum DefaultWill {
|
||||
SOUL(new ItemStack(RegistrarBloodMagicItems.MONSTER_SOUL, 1, 0), 64),
|
||||
PETTY(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 0), 64),
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.jei.forge;
|
||||
|
||||
import WayofTime.bloodmagic.api.recipe.TartaricForgeRecipe;
|
||||
import WayofTime.bloodmagic.api.registry.TartaricForgeRecipeRegistry;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TartaricForgeRecipeMaker {
|
||||
@Nonnull
|
||||
public static List<TartaricForgeRecipeJEI> getRecipes() {
|
||||
List<TartaricForgeRecipe> recipeList = TartaricForgeRecipeRegistry.getRecipeList();
|
||||
ArrayList<TartaricForgeRecipeJEI> recipes = new ArrayList<TartaricForgeRecipeJEI>();
|
||||
|
||||
for (TartaricForgeRecipe recipe : recipeList)
|
||||
recipes.add(new TartaricForgeRecipeJEI(recipe));
|
||||
|
||||
return recipes;
|
||||
}
|
||||
}
|
|
@ -9,7 +9,7 @@ import mcp.mobius.waila.api.IWailaRegistrar;
|
|||
import mcp.mobius.waila.api.WailaPlugin;
|
||||
|
||||
@WailaPlugin
|
||||
public class WailaPluginBloodMagic implements IWailaPlugin {
|
||||
public class BloodMagicHwylaPlugin implements IWailaPlugin {
|
||||
@Override
|
||||
public void register(IWailaRegistrar registrar) {
|
||||
registrar.registerBodyProvider(new DataProviderBloodAltar(), BlockAltar.class);
|
|
@ -4,8 +4,8 @@ import WayofTime.bloodmagic.ConfigHandler;
|
|||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.block.BlockAltar;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.item.sigil.ItemSigilDivination;
|
||||
import WayofTime.bloodmagic.item.sigil.ItemSigilSeer;
|
||||
import WayofTime.bloodmagic.item.sigil.sigil.ItemSigilDivination;
|
||||
import WayofTime.bloodmagic.tile.TileAltar;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
|
@ -27,16 +27,6 @@ import java.util.List;
|
|||
* in ImLookingAtBlood by <a href="https://github.com/Pokefenn">Pokefenn</a>.
|
||||
*/
|
||||
public class DataProviderBloodAltar implements IWailaDataProvider {
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
if (!config.getConfig(Constants.Compat.WAILA_CONFIG_ALTAR))
|
||||
|
@ -45,24 +35,21 @@ public class DataProviderBloodAltar implements IWailaDataProvider {
|
|||
boolean hasSigil = false;
|
||||
boolean hasSeer = false;
|
||||
|
||||
switch (ConfigHandler.wailaAltarDisplayMode) {
|
||||
case 0: {
|
||||
switch (ConfigHandler.compat.wailaAltarDisplayMode) {
|
||||
case ALWAYS: {
|
||||
hasSigil = hasSeer = true;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
case SIGIL_HELD: {
|
||||
hasSeer = holdingSeerSigil(accessor.getPlayer());
|
||||
hasSigil = hasSeer || holdingDivinationSigil(accessor.getPlayer());
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
case SIGIL_CONTAINED: {
|
||||
hasSeer = hasStack(new ItemStack(RegistrarBloodMagicItems.SIGIL_SEER), accessor.getPlayer());
|
||||
hasSigil = hasSeer || hasStack(new ItemStack(RegistrarBloodMagicItems.SIGIL_DIVINATION), accessor.getPlayer());
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasSeer && !hasSigil)
|
||||
|
@ -93,11 +80,6 @@ public class DataProviderBloodAltar implements IWailaDataProvider {
|
|||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, BlockPos pos) {
|
||||
if (te != null)
|
||||
|
@ -127,7 +109,7 @@ public class DataProviderBloodAltar implements IWailaDataProvider {
|
|||
if (player.getHeldItemMainhand().getItem() instanceof ItemSigilDivination)
|
||||
return true;
|
||||
|
||||
if (player.getHeldItemOffhand() != null && player.getHeldItemOffhand().getItem() instanceof ItemSigilDivination)
|
||||
if (!player.getHeldItemOffhand().isEmpty() && player.getHeldItemOffhand().getItem() instanceof ItemSigilDivination)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -20,7 +20,7 @@ public class StorageBlockCraftingManager {
|
|||
public void addStorageBlockRecipes() {
|
||||
// this.recipes = new StorageBlockCraftingRecipeAssimilator().getPackingRecipes();
|
||||
|
||||
BloodMagic.instance.logger.info("Total number of compression recipes: " + this.recipes.size());
|
||||
BloodMagic.LOGGER.info("Total number of compression recipes: {}", this.recipes.size());
|
||||
}
|
||||
|
||||
public ItemStack findMatchingRecipe(InventoryCrafting craftingInventory, World world) {
|
||||
|
|
|
@ -8,14 +8,21 @@ import WayofTime.bloodmagic.entity.projectile.EntityBloodLight;
|
|||
import WayofTime.bloodmagic.entity.projectile.EntityMeteor;
|
||||
import WayofTime.bloodmagic.entity.projectile.EntitySentientArrow;
|
||||
import WayofTime.bloodmagic.entity.projectile.EntitySoulSnare;
|
||||
import WayofTime.bloodmagic.item.types.ComponentType;
|
||||
import WayofTime.bloodmagic.potion.PotionBloodMagic;
|
||||
import com.google.common.base.Stopwatch;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.init.MobEffects;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.event.ModelRegistryEvent;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.event.furnace.FurnaceFuelBurnTimeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.EntityEntry;
|
||||
|
@ -58,8 +65,30 @@ public class RegistrarBloodMagic {
|
|||
|
||||
public static IForgeRegistry<BloodOrb> BLOOD_ORBS = null;
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerItems(RegistryEvent.Register<Item> event) {
|
||||
Stopwatch stopwatch = Stopwatch.createStarted();
|
||||
RegistrarBloodMagicItems.registerItems(event.getRegistry());
|
||||
BloodMagic.debug("Item registration completed in {}", stopwatch.stop());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerBlocks(RegistryEvent.Register<Block> event) {
|
||||
Stopwatch stopwatch = Stopwatch.createStarted();
|
||||
RegistrarBloodMagicBlocks.registerBlocks(event.getRegistry());
|
||||
BloodMagic.debug("Block registration completed in {}", stopwatch.stop());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerRecipes(RegistryEvent.Register<IRecipe> event) {
|
||||
Stopwatch stopwatch = Stopwatch.createStarted();
|
||||
RegistrarBloodMagicRecipes.registerCrafting(event.getRegistry());
|
||||
BloodMagic.debug("Recipe registration completed in {}", stopwatch.stop());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerBloodOrbs(RegistryEvent.Register<BloodOrb> event) {
|
||||
Stopwatch stopwatch = Stopwatch.createStarted();
|
||||
ResourceLocation orb = RegistrarBloodMagicItems.BLOOD_ORB.getRegistryName();
|
||||
event.getRegistry().registerAll(
|
||||
new BloodOrb("weak", 1, 5000).withModel(new ModelResourceLocation(orb, "type=weak")).setRegistryName("weak"),
|
||||
|
@ -69,10 +98,12 @@ public class RegistrarBloodMagic {
|
|||
new BloodOrb("archmage", 5, 10000000).withModel(new ModelResourceLocation(orb, "type=archmage")).setRegistryName("archmage"),
|
||||
new BloodOrb("transcendent", 6, 30000000).withModel(new ModelResourceLocation(orb, "type=transcendent")).setRegistryName("transcendent")
|
||||
);
|
||||
BloodMagic.debug("Blood Orb registration completed in {}", stopwatch.stop());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerPotions(RegistryEvent.Register<Potion> event) {
|
||||
Stopwatch stopwatch = Stopwatch.createStarted();
|
||||
event.getRegistry().registerAll(
|
||||
new PotionBloodMagic("Boost", false, 0xFFFFFF, 0, 1).setRegistryName("boost"),
|
||||
new PotionBloodMagic("Planar Binding", false, 0, 2, 0).setRegistryName("planar_binding"),
|
||||
|
@ -86,10 +117,12 @@ public class RegistrarBloodMagic {
|
|||
new PotionBloodMagic("Cling", false, 0x000000, 2, 1).setRegistryName("cling"),
|
||||
new PotionBloodMagic("S. Lamb", false, 0x000000, 3, 1).setRegistryName("sacrificial_lamb")
|
||||
);
|
||||
BloodMagic.debug("Potion registration completed in {}", stopwatch.stop());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerEntities(RegistryEvent.Register<EntityEntry> event) {
|
||||
Stopwatch stopwatch = Stopwatch.createStarted();
|
||||
int entities = 0;
|
||||
EntityRegistry.registerModEntity(new ResourceLocation(BloodMagic.MODID, "blood_light"), EntityBloodLight.class, "BloodLight", ++entities, BloodMagic.instance, 16 * 4, 3, true);
|
||||
EntityRegistry.registerModEntity(new ResourceLocation(BloodMagic.MODID, "soul_snare"), EntitySoulSnare.class, "SoulSnare", ++entities, BloodMagic.instance, 16 * 4, 3, true);
|
||||
|
@ -101,21 +134,25 @@ public class RegistrarBloodMagic {
|
|||
EntityRegistry.registerModEntity(new ResourceLocation(BloodMagic.MODID, "corrupted_sheep"), EntityCorruptedSheep.class, "CorruptedSheep", ++entities, BloodMagic.instance, 16 * 4, 3, true);
|
||||
EntityRegistry.registerModEntity(new ResourceLocation(BloodMagic.MODID, "corrupted_chicken"), EntityCorruptedChicken.class, "CorruptedChicken", ++entities, BloodMagic.instance, 16 * 4, 3, true);
|
||||
EntityRegistry.registerModEntity(new ResourceLocation(BloodMagic.MODID, "corrupted_spider"), EntityCorruptedSpider.class, "CorruptedSpider", ++entities, BloodMagic.instance, 16 * 4, 3, true);
|
||||
BloodMagic.debug("Entity registration completed in {}", stopwatch.stop());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onRegistryCreation(RegistryEvent.NewRegistry event) {
|
||||
Stopwatch stopwatch = Stopwatch.createStarted();
|
||||
BLOOD_ORBS = new RegistryBuilder<BloodOrb>()
|
||||
.setName(new ResourceLocation(BloodMagic.MODID, "blood_orb"))
|
||||
.setIDRange(0, Short.MAX_VALUE)
|
||||
.setType(BloodOrb.class)
|
||||
.addCallback((IForgeRegistry.AddCallback<BloodOrb>) (owner, stage, id, obj, oldObj) -> OrbRegistry.tierMap.put(obj.getTier(), OrbRegistry.getOrbStack(obj)))
|
||||
.create();
|
||||
BloodMagic.debug("Registry creation completed in {}", stopwatch.stop());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public static void registerModels(ModelRegistryEvent event) {
|
||||
Stopwatch stopwatch = Stopwatch.createStarted();
|
||||
for (BloodOrb orb : BLOOD_ORBS) {
|
||||
ModelResourceLocation modelLocation = orb.getModelLocation();
|
||||
if (modelLocation == null)
|
||||
|
@ -134,5 +171,15 @@ public class RegistrarBloodMagic {
|
|||
|
||||
return orb.getModelLocation();
|
||||
});
|
||||
|
||||
RegistrarBloodMagicItems.registerModels();
|
||||
RegistrarBloodMagicBlocks.registerModels();
|
||||
BloodMagic.debug("Model registration completed in {}", stopwatch.stop());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void handleBurnTime(FurnaceFuelBurnTimeEvent event) {
|
||||
if (ItemStack.areItemsEqual(event.getItemStack(), ComponentType.SAND_COAL.getStack()))
|
||||
event.setBurnTime(1600);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,17 +15,13 @@ import net.minecraft.block.state.IBlockState;
|
|||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraftforge.client.event.ModelRegistryEvent;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = BloodMagic.MODID)
|
||||
@GameRegistry.ObjectHolder(BloodMagic.MODID)
|
||||
@SuppressWarnings("unused")
|
||||
public class RegistrarBloodMagicBlocks {
|
||||
|
@ -73,8 +69,7 @@ public class RegistrarBloodMagicBlocks {
|
|||
|
||||
static List<Block> blocks;
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerBlocks(RegistryEvent.Register<Block> event) {
|
||||
public static void registerBlocks(IForgeRegistry<Block> registry) {
|
||||
FluidRegistry.registerFluid(BlockLifeEssence.getLifeEssence());
|
||||
FluidRegistry.addBucketForFluid(BlockLifeEssence.getLifeEssence());
|
||||
|
||||
|
@ -122,13 +117,12 @@ public class RegistrarBloodMagicBlocks {
|
|||
new BlockInversionPillarEnd().setRegistryName("inversion_pillar_end")
|
||||
);
|
||||
|
||||
event.getRegistry().registerAll(blocks.toArray(new Block[0]));
|
||||
registry.registerAll(blocks.toArray(new Block[0]));
|
||||
|
||||
registerTiles();
|
||||
registerTileEntities();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerModels(ModelRegistryEvent event) {
|
||||
public static void registerModels() {
|
||||
ModelLoader.setCustomStateMapper(LIFE_ESSENCE, new StateMapperBase() {
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
|
||||
|
@ -137,29 +131,28 @@ public class RegistrarBloodMagicBlocks {
|
|||
});
|
||||
}
|
||||
|
||||
private static void registerTiles() {
|
||||
GameRegistry.registerTileEntity(TileAltar.class, BloodMagic.MODID + ":" + TileAltar.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TileImperfectRitualStone.class, BloodMagic.MODID + ":" + TileImperfectRitualStone.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TileMasterRitualStone.class, BloodMagic.MODID + ":" + TileMasterRitualStone.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TileAlchemyArray.class, BloodMagic.MODID + ":" + TileAlchemyArray.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TileSpectralBlock.class, BloodMagic.MODID + ":" + TileSpectralBlock.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TilePhantomBlock.class, BloodMagic.MODID + ":" + TilePhantomBlock.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TileTeleposer.class, BloodMagic.MODID + ":" + TileTeleposer.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TileSoulForge.class, BloodMagic.MODID + ":" + TileSoulForge.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TileMasterRoutingNode.class, BloodMagic.MODID + ":" + TileMasterRoutingNode.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TileInputRoutingNode.class, BloodMagic.MODID + ":" + TileInputRoutingNode.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TileOutputRoutingNode.class, BloodMagic.MODID + ":" + TileOutputRoutingNode.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TileItemRoutingNode.class, BloodMagic.MODID + ":" + TileItemRoutingNode.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TileIncenseAltar.class, BloodMagic.MODID + ":" + TileIncenseAltar.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TileDemonCrucible.class, BloodMagic.MODID + ":" + TileDemonCrucible.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TileDemonPylon.class, BloodMagic.MODID + ":" + TileDemonPylon.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TileDemonCrystallizer.class, BloodMagic.MODID + ":" + TileDemonCrystallizer.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TileDemonCrystal.class, BloodMagic.MODID + ":" + TileDemonCrystal.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TileAlchemyTable.class, BloodMagic.MODID + ":" + TileAlchemyTable.class.getSimpleName());
|
||||
|
||||
GameRegistry.registerTileEntity(TileDimensionalPortal.class, BloodMagic.MODID + ":" + TileDimensionalPortal.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TileBloodTank.class, BloodMagic.MODID + ":" + TileBloodTank.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TileMimic.class, BloodMagic.MODID + ":" + TileMimic.class.getSimpleName());
|
||||
GameRegistry.registerTileEntity(TileInversionPillar.class, BloodMagic.MODID + ":" + TileInversionPillar.class.getSimpleName());
|
||||
private static void registerTileEntities() {
|
||||
GameRegistry.registerTileEntity(TileAltar.class, BloodMagic.MODID + ":altar");
|
||||
GameRegistry.registerTileEntity(TileImperfectRitualStone.class, BloodMagic.MODID + ":imperfect_ritual_stone");
|
||||
GameRegistry.registerTileEntity(TileMasterRitualStone.class, BloodMagic.MODID + ":master_ritual_stone");
|
||||
GameRegistry.registerTileEntity(TileAlchemyArray.class, BloodMagic.MODID + ":alchemy_array");
|
||||
GameRegistry.registerTileEntity(TileSpectralBlock.class, BloodMagic.MODID + ":spectral_block");
|
||||
GameRegistry.registerTileEntity(TilePhantomBlock.class, BloodMagic.MODID + ":phantom_block");
|
||||
GameRegistry.registerTileEntity(TileTeleposer.class, BloodMagic.MODID + ":teleposer");
|
||||
GameRegistry.registerTileEntity(TileSoulForge.class, BloodMagic.MODID + ":soul_forge");
|
||||
GameRegistry.registerTileEntity(TileMasterRoutingNode.class, BloodMagic.MODID + ":master_routing_node");
|
||||
GameRegistry.registerTileEntity(TileInputRoutingNode.class, BloodMagic.MODID + ":input_routing_node");
|
||||
GameRegistry.registerTileEntity(TileOutputRoutingNode.class, BloodMagic.MODID + ":output_routing_node");
|
||||
GameRegistry.registerTileEntity(TileItemRoutingNode.class, BloodMagic.MODID + ":item_routing_node");
|
||||
GameRegistry.registerTileEntity(TileIncenseAltar.class, BloodMagic.MODID + ":incense_altar");
|
||||
GameRegistry.registerTileEntity(TileDemonCrucible.class, BloodMagic.MODID + ":demon_crucible");
|
||||
GameRegistry.registerTileEntity(TileDemonPylon.class, BloodMagic.MODID + ":demon_pylon");
|
||||
GameRegistry.registerTileEntity(TileDemonCrystallizer.class, BloodMagic.MODID + ":demon_crystallizer");
|
||||
GameRegistry.registerTileEntity(TileDemonCrystal.class, BloodMagic.MODID + ":demon_crystal");
|
||||
GameRegistry.registerTileEntity(TileAlchemyTable.class, BloodMagic.MODID + ":alchemy_table");
|
||||
GameRegistry.registerTileEntity(TileDimensionalPortal.class, BloodMagic.MODID + ":dimensional_portal");
|
||||
GameRegistry.registerTileEntity(TileBloodTank.class, BloodMagic.MODID + ":blood_tank");
|
||||
GameRegistry.registerTileEntity(TileMimic.class, BloodMagic.MODID + ":mimic");
|
||||
GameRegistry.registerTileEntity(TileInversionPillar.class, BloodMagic.MODID + ":inversion_pillar");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,27 +15,30 @@ import WayofTime.bloodmagic.item.routing.ItemFluidRouterFilter;
|
|||
import WayofTime.bloodmagic.item.routing.ItemNodeRouter;
|
||||
import WayofTime.bloodmagic.item.routing.ItemRouterFilter;
|
||||
import WayofTime.bloodmagic.item.sigil.*;
|
||||
import WayofTime.bloodmagic.item.sigil.sigil.*;
|
||||
import WayofTime.bloodmagic.item.sigil.sigil.ItemSigilTeleposition;
|
||||
import WayofTime.bloodmagic.item.sigil.sigil.ItemSigilTransposition;
|
||||
import WayofTime.bloodmagic.item.soul.*;
|
||||
import WayofTime.bloodmagic.item.types.ComponentType;
|
||||
import WayofTime.bloodmagic.item.types.ReagentType;
|
||||
import com.google.common.collect.Lists;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.event.ModelRegistryEvent;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = BloodMagic.MODID)
|
||||
@GameRegistry.ObjectHolder(BloodMagic.MODID)
|
||||
@SuppressWarnings("unchecked")
|
||||
public class RegistrarBloodMagicItems {
|
||||
|
@ -78,6 +81,7 @@ public class RegistrarBloodMagicItems {
|
|||
public static final Item SIGIL_BOUNCE = Items.AIR;
|
||||
public static final Item SIGIL_FROST = Items.AIR;
|
||||
public static final Item COMPONENT = Items.AIR;
|
||||
public static final Item REAGENT = Items.AIR;
|
||||
public static final Item ITEM_DEMON_CRYSTAL = Items.AIR;
|
||||
public static final Item TELEPOSITION_FOCUS = Items.AIR;
|
||||
public static final Item EXPERIENCE_TOME = Items.AIR;
|
||||
|
@ -117,8 +121,7 @@ public class RegistrarBloodMagicItems {
|
|||
|
||||
public static List<Item> items;
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerItems(RegistryEvent.Register<Item> event) {
|
||||
public static void registerItems(IForgeRegistry<Item> registry) {
|
||||
items = Lists.newArrayList();
|
||||
|
||||
RegistrarBloodMagicBlocks.blocks.stream().filter(block -> block instanceof IBMBlock && ((IBMBlock) block).getItem() != null).forEach(block -> {
|
||||
|
@ -143,29 +146,30 @@ public class RegistrarBloodMagicItems {
|
|||
new ItemBoundAxe().setRegistryName("bound_axe"),
|
||||
new ItemBoundShovel().setRegistryName("bound_shovel"),
|
||||
new ItemSigilDivination().setRegistryName("sigil_divination"),
|
||||
new ItemSigilAir().setRegistryName("sigil_air"),
|
||||
new ItemSigilWater().setRegistryName("sigil_water"),
|
||||
new ItemSigilLava().setRegistryName("sigil_lava"),
|
||||
new ItemSigil(new SigilAir(), "air").setRegistryName("sigil_air"),
|
||||
new ItemSigil(new SigilFluid(FluidRegistry.WATER), "water").setRegistryName("sigil_water"),
|
||||
new ItemSigil(new SigilFluid(FluidRegistry.LAVA), "lava").setRegistryName("sigil_lava"),
|
||||
new ItemSigilVoid().setRegistryName("sigil_void"),
|
||||
new ItemSigilGreenGrove().setRegistryName("sigil_green_grove"),
|
||||
new ItemSigilBloodLight().setRegistryName("sigil_blood_light"),
|
||||
new ItemSigilElementalAffinity().setRegistryName("sigil_elemental_affinity"),
|
||||
new ItemSigil(new SigilGreenGrove(), "green_grove").setRegistryName("sigil_green_grove"),
|
||||
new ItemSigil(new SigilBloodLight(), "blood_light").setRegistryName("sigil_blood_light"),
|
||||
new ItemSigil(new SigilElementalAffinity(), "elemental_affinity").setRegistryName("sigil_elemental_affinity"),
|
||||
new ItemSigilMagnetism().setRegistryName("sigil_magnetism"),
|
||||
new ItemSigilSuppression().setRegistryName("sigil_suppression"),
|
||||
new ItemSigilHaste().setRegistryName("sigil_haste"),
|
||||
new ItemSigilFastMiner().setRegistryName("sigil_fast_miner"),
|
||||
new ItemSigil(new SigilHaste(), "haste").setRegistryName("sigil_haste"),
|
||||
new ItemSigil(new SigilFastMiner(), "fast_miner").setRegistryName("sigil_fast_miner"),
|
||||
new ItemSigilSeer().setRegistryName("sigil_seer"),
|
||||
new ItemSigilPhantomBridge().setRegistryName("sigil_phantom_bridge"),
|
||||
new ItemSigilWhirlwind().setRegistryName("sigil_whirlwind"),
|
||||
new ItemSigilCompression().setRegistryName("sigil_compression"),
|
||||
new ItemSigilEnderSeverance().setRegistryName("sigil_ender_severance"),
|
||||
new ItemSigil(new SigilEnderSeverance(), "ender_severance").setRegistryName("sigil_ender_severance"),
|
||||
new ItemSigilHolding().setRegistryName("sigil_holding"),
|
||||
new ItemSigilTeleposition().setRegistryName("sigil_teleposition"),
|
||||
new ItemSigilTransposition().setRegistryName("sigil_transposition"),
|
||||
new ItemSigilClaw().setRegistryName("sigil_claw"),
|
||||
new ItemSigilBounce().setRegistryName("sigil_bounce"),
|
||||
new ItemSigilFrost().setRegistryName("sigil_frost"),
|
||||
new ItemComponent().setRegistryName("component"),
|
||||
new ItemSigil(new SigilClaw(), "claw").setRegistryName("sigil_claw"),
|
||||
new ItemSigil(new SigilBounce(), "bounce").setRegistryName("sigil_bounce"),
|
||||
new ItemSigil(new SigilFrost(), "frost").setRegistryName("sigil_frost"),
|
||||
new ItemEnum<>(ComponentType.class, "component").setRegistryName("component"),
|
||||
new ItemEnum<>(ReagentType.class, "reagent").setRegistryName("reagent"),
|
||||
new ItemDemonCrystal().setRegistryName("item_demon_crystal"),
|
||||
new ItemTelepositionFocus().setRegistryName("teleposition_focus"),
|
||||
new ItemExperienceBook().setRegistryName("experience_tome"),
|
||||
|
@ -201,16 +205,17 @@ public class RegistrarBloodMagicItems {
|
|||
new ItemPotionFlask().setRegistryName("potion_flask")
|
||||
));
|
||||
|
||||
event.getRegistry().registerAll(items.toArray(new Item[0]));
|
||||
registry.registerAll(items.toArray(new Item[0]));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public static void registerRenders(ModelRegistryEvent event) {
|
||||
public static void registerModels() {
|
||||
items.stream().filter(i -> i instanceof IVariantProvider).forEach(i -> {
|
||||
IVariantProvider variantProvider = (IVariantProvider) i;
|
||||
for (Pair<Integer, String> variant : variantProvider.getVariants())
|
||||
ModelLoader.setCustomModelResourceLocation(i, variant.getLeft(), new ModelResourceLocation(i.getRegistryName(), variant.getRight()));
|
||||
Int2ObjectMap<String> variants = new Int2ObjectOpenHashMap<>();
|
||||
variantProvider.populateVariants(variants);
|
||||
for (Int2ObjectMap.Entry<String> variant : variants.int2ObjectEntrySet())
|
||||
ModelLoader.setCustomModelResourceLocation(i, variant.getIntKey(), new ModelResourceLocation(i.getRegistryName(), variant.getValue()));
|
||||
});
|
||||
|
||||
items.stream().filter(i -> i instanceof IMeshProvider).forEach(i -> {
|
||||
|
@ -218,7 +223,10 @@ public class RegistrarBloodMagicItems {
|
|||
ResourceLocation loc = mesh.getCustomLocation();
|
||||
if (loc == null)
|
||||
loc = i.getRegistryName();
|
||||
for (String variant : mesh.getVariants())
|
||||
|
||||
List<String> variants = Lists.newArrayList();
|
||||
mesh.populateVariants(variants);
|
||||
for (String variant : variants)
|
||||
ModelLoader.registerItemVariants(i, new ModelResourceLocation(loc, variant));
|
||||
|
||||
ModelLoader.setCustomMeshDefinition(i, mesh.getMeshDefinition());
|
||||
|
@ -226,8 +234,10 @@ public class RegistrarBloodMagicItems {
|
|||
|
||||
RegistrarBloodMagicBlocks.blocks.stream().filter(b -> b instanceof IVariantProvider).forEach(b -> {
|
||||
IVariantProvider variantProvider = (IVariantProvider) b;
|
||||
for (Pair<Integer, String> variant : variantProvider.getVariants())
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(b), variant.getLeft(), new ModelResourceLocation(b.getRegistryName(), variant.getRight()));
|
||||
Int2ObjectMap<String> variants = new Int2ObjectOpenHashMap<>();
|
||||
variantProvider.populateVariants(variants);
|
||||
for (Int2ObjectMap.Entry<String> variant : variants.int2ObjectEntrySet())
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(b), variant.getIntKey(), new ModelResourceLocation(b.getRegistryName(), variant.getValue()));
|
||||
});
|
||||
|
||||
final ResourceLocation holdingLoc = SIGIL_HOLDING.getRegistryName();
|
||||
|
|
|
@ -0,0 +1,140 @@
|
|||
package WayofTime.bloodmagic.core;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.altar.EnumAltarTier;
|
||||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
||||
import WayofTime.bloodmagic.api.ritual.EnumRuneType;
|
||||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.api_impl.BloodMagicRecipeRegistrar;
|
||||
import WayofTime.bloodmagic.apiv2.IBloodMagicRecipeRegistrar;
|
||||
import WayofTime.bloodmagic.block.BlockLifeEssence;
|
||||
import WayofTime.bloodmagic.item.ItemDemonCrystal;
|
||||
import WayofTime.bloodmagic.item.alchemy.ItemCuttingFluid;
|
||||
import WayofTime.bloodmagic.item.soul.ItemSoulGem;
|
||||
import WayofTime.bloodmagic.item.types.ComponentType;
|
||||
import WayofTime.bloodmagic.item.types.ReagentType;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
import net.minecraftforge.oredict.OreIngredient;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
public class RegistrarBloodMagicRecipes {
|
||||
|
||||
public static void registerCrafting(IForgeRegistry<IRecipe> registry) {
|
||||
for (int i = 0; i < ItemSoulGem.names.length; i++) {
|
||||
for (EnumDemonWillType willType : EnumDemonWillType.values()) {
|
||||
ItemStack baseGemStack = new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, i);
|
||||
ItemStack newGemStack = new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, i);
|
||||
|
||||
((ItemSoulGem) RegistrarBloodMagicItems.SOUL_GEM).setCurrentType(willType, newGemStack);
|
||||
ShapelessOreRecipe shapeless = new ShapelessOreRecipe(new ResourceLocation(BloodMagic.MODID, "soul_gem"), newGemStack, baseGemStack, willType.getStack());
|
||||
registry.register(shapeless.setRegistryName("soul_gem_" + willType.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void registerAltarRecipes(IBloodMagicRecipeRegistrar registrar) {
|
||||
// ONE
|
||||
registrar.addBloodAltar(new OreIngredient("gemDiamond"), OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_WEAK), EnumAltarTier.ONE.ordinal(), 2000, 2, 1);
|
||||
registrar.addBloodAltar(new OreIngredient("stone"), new ItemStack(RegistrarBloodMagicItems.SLATE), EnumAltarTier.ONE.ordinal(), 1000, 5, 5);
|
||||
registrar.addBloodAltar(Ingredient.fromItem(Items.BUCKET), FluidUtil.getFilledBucket(new FluidStack(BlockLifeEssence.getLifeEssence(), Fluid.BUCKET_VOLUME)), EnumAltarTier.ONE.ordinal(), 1000, 5, 0);
|
||||
registrar.addBloodAltar(Ingredient.fromItem(Items.BOOK), new ItemStack(RegistrarBloodMagicItems.SANGUINE_BOOK), EnumAltarTier.ONE.ordinal(), 1000, 20, 0);
|
||||
|
||||
// TWO
|
||||
registrar.addBloodAltar(new OreIngredient("blockRedstone"), OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_APPRENTICE), EnumAltarTier.TWO.ordinal(), 5000, 5, 5);
|
||||
registrar.addBloodAltar(Ingredient.fromItem(RegistrarBloodMagicItems.SLATE), new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 1), EnumAltarTier.TWO.ordinal(), 2000, 5, 5);
|
||||
registrar.addBloodAltar(Ingredient.fromItem(Items.IRON_SWORD), new ItemStack(RegistrarBloodMagicItems.DAGGER_OF_SACRIFICE), EnumAltarTier.TWO.ordinal(), 3000, 5, 5);
|
||||
|
||||
// THREE
|
||||
registrar.addBloodAltar(new OreIngredient("blockGold"), OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_MAGICIAN), EnumAltarTier.THREE.ordinal(), 25000, 20, 20);
|
||||
registrar.addBloodAltar(Ingredient.fromStacks(new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 1)), new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 2), EnumAltarTier.THREE.ordinal(), 5000, 15, 10);
|
||||
registrar.addBloodAltar(new OreIngredient("obsidian"), EnumRuneType.EARTH.getScribeStack(), EnumAltarTier.THREE.ordinal(), 1000, 5, 5);
|
||||
registrar.addBloodAltar(new OreIngredient("blockLapis"), EnumRuneType.WATER.getScribeStack(), EnumAltarTier.THREE.ordinal(), 1000, 5, 5);
|
||||
registrar.addBloodAltar(Ingredient.fromItem(Items.MAGMA_CREAM), EnumRuneType.FIRE.getScribeStack(), EnumAltarTier.THREE.ordinal(), 1000, 5, 5);
|
||||
registrar.addBloodAltar(Ingredient.fromItem(Items.GHAST_TEAR), EnumRuneType.AIR.getScribeStack(), EnumAltarTier.THREE.ordinal(), 1000, 5, 5);
|
||||
registrar.addBloodAltar(Ingredient.fromItem(RegistrarBloodMagicItems.LAVA_CRYSTAL), new ItemStack(RegistrarBloodMagicItems.ACTIVATION_CRYSTAL), EnumAltarTier.THREE.ordinal(), 10000, 20, 10);
|
||||
|
||||
// FOUR
|
||||
registrar.addBloodAltar(Ingredient.fromStacks(new ItemStack(RegistrarBloodMagicItems.BLOOD_SHARD)), OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_MASTER), EnumAltarTier.FOUR.ordinal(), 25000, 30, 50);
|
||||
registrar.addBloodAltar(Ingredient.fromStacks(new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 2)), new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 3), EnumAltarTier.FOUR.ordinal(), 15000, 20, 20);
|
||||
registrar.addBloodAltar(new OreIngredient("blockCoal"), EnumRuneType.DUSK.getScribeStack(), EnumAltarTier.FOUR.ordinal(), 2000, 20, 10);
|
||||
registrar.addBloodAltar(new OreIngredient("enderpearl"), new ItemStack(RegistrarBloodMagicItems.TELEPOSITION_FOCUS), EnumAltarTier.FOUR.ordinal(), 2000, 10, 10);
|
||||
registrar.addBloodAltar(Ingredient.fromStacks(new ItemStack(RegistrarBloodMagicItems.TELEPOSITION_FOCUS)), new ItemStack(RegistrarBloodMagicItems.TELEPOSITION_FOCUS, 1, 1), EnumAltarTier.FOUR.ordinal(), 10000, 20, 10);
|
||||
|
||||
// FIVE
|
||||
registrar.addBloodAltar(new OreIngredient("netherStar"), OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_ARCHMAGE), EnumAltarTier.FIVE.ordinal(), 80000, 50, 100);
|
||||
registrar.addBloodAltar(Ingredient.fromStacks(new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 3)), new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 4), EnumAltarTier.FIVE.ordinal(), 30000, 40, 100);
|
||||
|
||||
// SIX
|
||||
registrar.addBloodAltar(Ingredient.fromStacks(new ItemStack(RegistrarBloodMagicBlocks.DECORATIVE_BRICK, 1, 2)), OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_TRANSCENDENT), EnumAltarTier.SIX.ordinal(), 200000, 100, 200);
|
||||
registrar.addBloodAltar(new OreIngredient("glowstone"), EnumRuneType.DAWN.getScribeStack(), EnumAltarTier.SIX.ordinal(), 200000, 100, 200);
|
||||
}
|
||||
|
||||
public static void registerAlchemyTableRecipes(IBloodMagicRecipeRegistrar registrar) {
|
||||
|
||||
}
|
||||
|
||||
public static void registerTartaricForgeRecipes(BloodMagicRecipeRegistrar registrar) {
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM), 1, 1, "dustRedstone", "ingotGold", "blockGlass", "dyeBlue");
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 1), 60, 20, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM), "gemDiamond", "blockRedstone", "blockLapis");
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 2), 240, 50, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 1), "gemDiamond", "blockGold", new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 2));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 3), 1000, 100, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 2), new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 3), new ItemStack(RegistrarBloodMagicItems.BLOOD_SHARD), EnumDemonWillType.DEFAULT.getStack());
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 4), 4000, 500, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 3), Items.NETHER_STAR);
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SENTIENT_SWORD), 0, 0, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM), new ItemStack(Items.IRON_SWORD));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SENTIENT_AXE), 0, 0, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM), new ItemStack(Items.IRON_AXE));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SENTIENT_PICKAXE), 0, 0, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM), new ItemStack(Items.IRON_PICKAXE));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SENTIENT_SHOVEL), 0, 0, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM), new ItemStack(Items.IRON_SHOVEL));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SENTIENT_BOW), 70, 0, new ItemStack(Items.BOW), new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 1), "string", "string");
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES), 0, 0, "dustRedstone", "dyeWhite", "gunpowder", Items.COAL);
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_WATER.getStack(), 10, 3, new ItemStack(Items.SUGAR), new ItemStack(Items.WATER_BUCKET), new ItemStack(Items.WATER_BUCKET));
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_LAVA.getStack(), 32, 10, Items.LAVA_BUCKET, "dustRedstone", "cobblestone", "blockCoal");
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_VOID.getStack(), 64, 10, Items.BUCKET, "string", "string", "gunpowder");
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_GROWTH.getStack(), 128, 20, "treeSapling", "treeSapling", "sugarcane", Items.SUGAR);
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_AIR.getStack(), 128, 20, Items.GHAST_TEAR, "feather", "feather");
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_SIGHT.getStack(), 64, 0, RegistrarBloodMagicItems.SIGIL_DIVINATION, "blockGlass", "blockGlass", "dustGlowstone");
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_HOLDING.getStack(), 64, 20, "chestWood", "leather", "string", "string");
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_FASTMINER.getStack(), 128, 10, Items.IRON_PICKAXE, Items.IRON_AXE, Items.IRON_SHOVEL, Items.GUNPOWDER);
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_AFFINITY.getStack(), 300, 30, RegistrarBloodMagicItems.SIGIL_WATER, RegistrarBloodMagicItems.SIGIL_AIR, RegistrarBloodMagicItems.SIGIL_LAVA, Blocks.OBSIDIAN);
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_SUPPRESSION.getStack(), 500, 50, RegistrarBloodMagicBlocks.TELEPOSER, Items.WATER_BUCKET, Items.LAVA_BUCKET, Items.BLAZE_ROD);
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_BINDING.getStack(), 400, 10, "dustGlowstone", "dustRedstone", "nuggetGold", Items.GUNPOWDER);
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_BLOODLIGHT.getStack(), 300, 10, "glowstone", Blocks.TORCH, "dustRedstone", "dustRedstone");
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_MAGNETISM.getStack(), 600, 10, "string", "ingotGold", "blockIron", "ingotGold");
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_HASTE.getStack(), 1400, 100, Items.COOKIE, Items.SUGAR, Items.COOKIE, "stone");
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_BRIDGE.getStack(), 600, 50, Blocks.SOUL_SAND, Blocks.SOUL_SAND, "stone", Blocks.OBSIDIAN);
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_SEVERANCE.getStack(), 800, 70, Items.ENDER_EYE, Items.ENDER_PEARL, "ingotGold", "ingotGold");
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_COMPRESSION.getStack(), 2000, 200, "blockIron", "blockGold", Blocks.OBSIDIAN, "cobblestone");
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_TELEPOSITION.getStack(), 1500, 200, RegistrarBloodMagicBlocks.TELEPOSER, "glowstone", "blockRedstone", "ingotGold");
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_TRANSPOSITION.getStack(), 1500, 200, RegistrarBloodMagicBlocks.TELEPOSER, "gemDiamond", Items.ENDER_PEARL, Blocks.OBSIDIAN);
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_CLAW.getStack(), 800, 120, Items.FLINT, Items.FLINT, ItemCuttingFluid.getStack(ItemCuttingFluid.BASIC));
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_BOUNCE.getStack(), 200, 20, Blocks.SLIME_BLOCK, Blocks.SLIME_BLOCK, Items.LEATHER, "string");
|
||||
registrar.addTartaricForge(ReagentType.REAGENT_FROST.getStack(), 80, 10, Blocks.ICE, Items.SNOWBALL, Items.SNOWBALL, "dustRedstone");
|
||||
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SENTIENT_ARMOUR_GEM), 240, 150, Items.DIAMOND_CHESTPLATE, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 1), Blocks.IRON_BLOCK, Blocks.OBSIDIAN);
|
||||
|
||||
registrar.addTartaricForge(ComponentType.FRAME_PART.getStack(), 400, 10, "blockGlass", "stone", new ItemStack(RegistrarBloodMagicItems.SLATE));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.NODE_ROUTER), 400, 5, "stickWood", new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 1), "gemLapis", "gemLapis");
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.ITEM_ROUTING_NODE), 400, 5, "dustGlowstone", "dustRedstone", "blockGlass", "stone");
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.OUTPUT_ROUTING_NODE), 400, 25, "dustGlowstone", "dustRedstone", "ingotIron", new ItemStack(RegistrarBloodMagicBlocks.ITEM_ROUTING_NODE));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.INPUT_ROUTING_NODE), 400, 25, "dustGlowstone", "dustRedstone", "ingotGold", new ItemStack(RegistrarBloodMagicBlocks.ITEM_ROUTING_NODE));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.MASTER_ROUTING_NODE), 400, 200, "blockIron", "gemDiamond", new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 2));
|
||||
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTAL, 1, 0), 1200, 100, EnumDemonWillType.DEFAULT.getStack(), EnumDemonWillType.DEFAULT.getStack(), EnumDemonWillType.DEFAULT.getStack(), EnumDemonWillType.DEFAULT.getStack());
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTAL, 1, 1), 1200, 100, EnumDemonWillType.CORROSIVE.getStack(), EnumDemonWillType.CORROSIVE.getStack(), EnumDemonWillType.CORROSIVE.getStack(), EnumDemonWillType.CORROSIVE.getStack());
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTAL, 1, 2), 1200, 100, EnumDemonWillType.DESTRUCTIVE.getStack(), EnumDemonWillType.DESTRUCTIVE.getStack(), EnumDemonWillType.DESTRUCTIVE.getStack(), EnumDemonWillType.DESTRUCTIVE.getStack());
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTAL, 1, 3), 1200, 100, EnumDemonWillType.VENGEFUL.getStack(), EnumDemonWillType.VENGEFUL.getStack(), EnumDemonWillType.VENGEFUL.getStack(), EnumDemonWillType.VENGEFUL.getStack());
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTAL, 1, 4), 1200, 100, EnumDemonWillType.STEADFAST.getStack(), EnumDemonWillType.STEADFAST.getStack(), EnumDemonWillType.STEADFAST.getStack(), EnumDemonWillType.STEADFAST.getStack());
|
||||
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRUCIBLE), 400, 100, Items.CAULDRON, "stone", "gemLapis", "gemDiamond");
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.DEMON_PYLON), 400, 50, "blockIron", "stone", "gemLapis", RegistrarBloodMagicItems.ITEM_DEMON_CRYSTAL);
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTALLIZER), 500, 100, RegistrarBloodMagicBlocks.SOUL_FORGE, "stone", "gemLapis", "blockGlass");
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.DEMON_WILL_GAUGE), 400, 50, "ingotGold", "dustRedstone", "blockGlass", RegistrarBloodMagicItems.ITEM_DEMON_CRYSTAL);
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package WayofTime.bloodmagic.fuel;
|
||||
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.item.ItemComponent;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.common.IFuelHandler;
|
||||
|
||||
public class FuelHandler implements IFuelHandler {
|
||||
@Override
|
||||
public int getBurnTime(ItemStack fuel) {
|
||||
if (fuel != null && fuel.getItem() == RegistrarBloodMagicItems.COMPONENT && fuel.getMetadata() == ItemComponent.getStack(ItemComponent.SAND_COAL).getMetadata()) {
|
||||
return 1600;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.item;
|
|||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -50,12 +51,10 @@ public class ItemActivationCrystal extends ItemBindableBase implements IVariantP
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
ret.add(new ImmutablePair<Integer, String>(0, "type=weak"));
|
||||
ret.add(new ImmutablePair<Integer, String>(1, "type=demonic"));
|
||||
ret.add(new ImmutablePair<Integer, String>(2, "type=creative"));
|
||||
return ret;
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
variants.put(0, "type=weak");
|
||||
variants.put(1, "type=demonic");
|
||||
variants.put(2, "type=creative");
|
||||
}
|
||||
|
||||
public int getCrystalLevel(ItemStack stack) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import WayofTime.bloodmagic.util.ChatUtil;
|
|||
|
||||
import WayofTime.bloodmagic.util.helper.NumeralHelper;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -90,10 +91,8 @@ public class ItemAltarMaker extends Item implements IAltarManipulator, IVariantP
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
ret.add(new ImmutablePair<Integer, String>(0, "type=altarmaker"));
|
||||
return ret;
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
variants.put(0, "type=altarmaker");
|
||||
}
|
||||
|
||||
public void setTierToBuild(EnumAltarTier tierToBuild) {
|
||||
|
|
|
@ -5,6 +5,7 @@ import WayofTime.bloodmagic.client.IVariantProvider;
|
|||
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
|
||||
import WayofTime.bloodmagic.tile.TileAlchemyArray;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -61,9 +62,7 @@ public class ItemArcaneAshes extends Item implements IVariantProvider {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
ret.add(new ImmutablePair<Integer, String>(0, "type=arcaneashes"));
|
||||
return ret;
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
variants.put(0, "type=arcaneashes");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ public class ItemBloodOrb extends ItemBindableBase implements IBloodOrb, IBindab
|
|||
|
||||
BloodOrb orb = getOrb(stack);
|
||||
if (flag.isAdvanced() && orb != null)
|
||||
tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.orb.owner", orb.getRegistryName()));
|
||||
tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.orb.owner", orb.getRegistryName().getResourceDomain()));
|
||||
|
||||
super.addInformation(stack, world, tooltip, flag);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package WayofTime.bloodmagic.item;
|
|||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -41,10 +42,8 @@ public class ItemBloodShard extends Item implements IVariantProvider {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
ret.add(new ImmutablePair<Integer, String>(0, "type=weak"));
|
||||
ret.add(new ImmutablePair<Integer, String>(1, "type=demonic"));
|
||||
return ret;
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
variants.put(0, "type=weak");
|
||||
variants.put(1, "type=demonic");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import WayofTime.bloodmagic.api.BlockStack;
|
|||
import WayofTime.bloodmagic.api.ItemStackWrapper;
|
||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||
import WayofTime.bloodmagic.client.IMeshProvider;
|
||||
import WayofTime.bloodmagic.client.mesh.CustomMeshDefinitionActivatable;
|
||||
import com.google.common.collect.HashMultiset;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.google.common.collect.Sets;
|
||||
|
@ -12,7 +11,6 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.block.BlockLeaves;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
|
@ -22,17 +20,12 @@ import net.minecraft.init.Blocks;
|
|||
import net.minecraft.init.Enchantments;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -116,24 +109,4 @@ public class ItemBoundAxe extends ItemBoundTool implements IMeshProvider {
|
|||
}
|
||||
return multimap;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ItemMeshDefinition getMeshDefinition() {
|
||||
return new CustomMeshDefinitionActivatable("bound_axe");
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ResourceLocation getCustomLocation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getVariants() {
|
||||
List<String> ret = new ArrayList<String>();
|
||||
ret.add("active=true");
|
||||
ret.add("active=false");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,14 +4,12 @@ import WayofTime.bloodmagic.api.BlockStack;
|
|||
import WayofTime.bloodmagic.api.ItemStackWrapper;
|
||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||
import WayofTime.bloodmagic.client.IMeshProvider;
|
||||
import WayofTime.bloodmagic.client.mesh.CustomMeshDefinitionActivatable;
|
||||
import com.google.common.collect.HashMultiset;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.google.common.collect.Sets;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
|
@ -21,17 +19,12 @@ import net.minecraft.init.Blocks;
|
|||
import net.minecraft.init.Enchantments;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -129,24 +122,4 @@ public class ItemBoundPickaxe extends ItemBoundTool implements IMeshProvider {
|
|||
}
|
||||
return multimap;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ItemMeshDefinition getMeshDefinition() {
|
||||
return new CustomMeshDefinitionActivatable("bound_pickaxe");
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ResourceLocation getCustomLocation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getVariants() {
|
||||
List<String> ret = new ArrayList<String>();
|
||||
ret.add("active=true");
|
||||
ret.add("active=false");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,14 +4,12 @@ import WayofTime.bloodmagic.api.BlockStack;
|
|||
import WayofTime.bloodmagic.api.ItemStackWrapper;
|
||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||
import WayofTime.bloodmagic.client.IMeshProvider;
|
||||
import WayofTime.bloodmagic.client.mesh.CustomMeshDefinitionActivatable;
|
||||
import com.google.common.collect.HashMultiset;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.google.common.collect.Sets;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
|
@ -21,17 +19,12 @@ import net.minecraft.init.Blocks;
|
|||
import net.minecraft.init.Enchantments;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -115,24 +108,4 @@ public class ItemBoundShovel extends ItemBoundTool implements IMeshProvider {
|
|||
}
|
||||
return multimap;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ItemMeshDefinition getMeshDefinition() {
|
||||
return new CustomMeshDefinitionActivatable("bound_shovel");
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ResourceLocation getCustomLocation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getVariants() {
|
||||
List<String> ret = new ArrayList<String>();
|
||||
ret.add("active=true");
|
||||
ret.add("active=false");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,14 +30,11 @@ import net.minecraft.item.ItemSword;
|
|||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemBoundSword extends ItemSword implements IBindable, IActivatable, IMeshProvider {
|
||||
|
@ -133,18 +130,10 @@ public class ItemBoundSword extends ItemSword implements IBindable, IActivatable
|
|||
return new CustomMeshDefinitionActivatable("bound_sword");
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ResourceLocation getCustomLocation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getVariants() {
|
||||
List<String> ret = new ArrayList<String>();
|
||||
ret.add("active=true");
|
||||
ret.add("active=false");
|
||||
return ret;
|
||||
public void populateVariants(List<String> variants) {
|
||||
variants.add("active=true");
|
||||
variants.add("active=false");
|
||||
}
|
||||
|
||||
// IBindable
|
||||
|
|
|
@ -9,6 +9,8 @@ import WayofTime.bloodmagic.api.iface.IBindable;
|
|||
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||
import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
|
||||
import WayofTime.bloodmagic.client.IMeshProvider;
|
||||
import WayofTime.bloodmagic.client.mesh.CustomMeshDefinitionActivatable;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
@ -19,6 +21,7 @@ import com.google.common.collect.Multimap;
|
|||
import com.google.common.collect.Multiset;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
@ -45,7 +48,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class ItemBoundTool extends ItemTool implements IBindable, IActivatable {
|
||||
public class ItemBoundTool extends ItemTool implements IBindable, IActivatable, IMeshProvider {
|
||||
public final int chargeTime = 30;
|
||||
protected final String tooltipBase;
|
||||
private final String name;
|
||||
|
@ -250,6 +253,20 @@ public class ItemBoundTool extends ItemTool implements IBindable, IActivatable {
|
|||
return null;
|
||||
}
|
||||
|
||||
// IMeshProvider
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ItemMeshDefinition getMeshDefinition() {
|
||||
return new CustomMeshDefinitionActivatable("bound_" + name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void populateVariants(List<String> variants) {
|
||||
variants.add("active=true");
|
||||
variants.add("active=false");
|
||||
}
|
||||
|
||||
public String getTooltipBase() {
|
||||
return tooltipBase;
|
||||
}
|
||||
|
|
|
@ -1,137 +0,0 @@
|
|||
package WayofTime.bloodmagic.item;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemComponent extends Item implements IVariantProvider {
|
||||
public static final String REAGENT_WATER = "reagentWater";
|
||||
public static final String REAGENT_LAVA = "reagentLava";
|
||||
public static final String REAGENT_AIR = "reagentAir";
|
||||
public static final String REAGENT_FASTMINER = "reagentFastMiner";
|
||||
public static final String REAGENT_VOID = "reagentVoid";
|
||||
public static final String REAGENT_GROWTH = "reagentGrowth";
|
||||
public static final String REAGENT_AFFINITY = "reagentAffinity";
|
||||
public static final String REAGENT_SIGHT = "reagentSight";
|
||||
public static final String REAGENT_BINDING = "reagentBinding";
|
||||
public static final String REAGENT_SUPPRESSION = "reagentSuppression";
|
||||
public static final String COMPONENT_FRAME_PART = "frameParts";
|
||||
public static final String REAGENT_BLOODLIGHT = "reagentBloodLight";
|
||||
public static final String REAGENT_MAGNETISM = "reagentMagnetism";
|
||||
public static final String REAGENT_HASTE = "reagentHaste";
|
||||
public static final String REAGENT_COMPRESSION = "reagentCompression";
|
||||
public static final String REAGENT_BRIDGE = "reagentBridge";
|
||||
public static final String REAGENT_SEVERANCE = "reagentSeverance";
|
||||
public static final String REAGENT_TELEPOSITION = "reagentTeleposition";
|
||||
public static final String REAGENT_TRANSPOSITION = "reagentTransposition";
|
||||
public static final String SAND_IRON = "ironSand";
|
||||
public static final String SAND_GOLD = "goldSand";
|
||||
public static final String SAND_COAL = "coalSand";
|
||||
public static final String PLANT_OIL = "plantOil";
|
||||
public static final String SULFUR = "sulfur";
|
||||
public static final String SALTPETER = "saltpeter";
|
||||
public static final String NEURO_TOXIN = "neurotoxin";
|
||||
public static final String ANTISEPTIC = "antiseptic";
|
||||
public static final String REAGENT_HOLDING = "reagentHolding";
|
||||
public static final String CATALYST_LENGTH_1 = "mundaneLength";
|
||||
public static final String CATALYST_POWER_1 = "mundanePower";
|
||||
public static final String REAGENT_CLAW = "reagentClaw";
|
||||
public static final String REAGENT_BOUNCE = "reagentBounce";
|
||||
public static final String REAGENT_FROST = "reagentFrost";
|
||||
private static ArrayList<String> names = new ArrayList<String>();
|
||||
|
||||
public ItemComponent() {
|
||||
super();
|
||||
|
||||
setUnlocalizedName(BloodMagic.MODID + ".baseComponent.");
|
||||
setHasSubtypes(true);
|
||||
setCreativeTab(BloodMagic.TAB_BM);
|
||||
|
||||
buildItemList();
|
||||
}
|
||||
|
||||
private void buildItemList() {
|
||||
names.add(0, REAGENT_WATER);
|
||||
names.add(1, REAGENT_LAVA);
|
||||
names.add(2, REAGENT_AIR);
|
||||
names.add(3, REAGENT_FASTMINER);
|
||||
names.add(4, REAGENT_VOID);
|
||||
names.add(5, REAGENT_GROWTH);
|
||||
names.add(6, REAGENT_AFFINITY);
|
||||
names.add(7, REAGENT_SIGHT);
|
||||
names.add(8, REAGENT_BINDING);
|
||||
names.add(9, REAGENT_SUPPRESSION);
|
||||
names.add(10, COMPONENT_FRAME_PART);
|
||||
names.add(11, REAGENT_BLOODLIGHT);
|
||||
names.add(12, REAGENT_MAGNETISM);
|
||||
names.add(13, REAGENT_HASTE);
|
||||
names.add(14, REAGENT_COMPRESSION);
|
||||
names.add(15, REAGENT_BRIDGE);
|
||||
names.add(16, REAGENT_SEVERANCE);
|
||||
names.add(17, REAGENT_TELEPOSITION);
|
||||
names.add(18, REAGENT_TRANSPOSITION);
|
||||
names.add(19, SAND_IRON);
|
||||
names.add(20, SAND_GOLD);
|
||||
names.add(21, SAND_COAL);
|
||||
names.add(22, PLANT_OIL);
|
||||
names.add(23, SULFUR);
|
||||
names.add(24, SALTPETER);
|
||||
names.add(25, NEURO_TOXIN);
|
||||
names.add(26, ANTISEPTIC);
|
||||
names.add(27, REAGENT_HOLDING);
|
||||
names.add(28, CATALYST_LENGTH_1);
|
||||
names.add(29, CATALYST_POWER_1);
|
||||
names.add(30, REAGENT_CLAW);
|
||||
names.add(31, REAGENT_BOUNCE);
|
||||
names.add(32, REAGENT_FROST);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return super.getUnlocalizedName(stack) + names.get(stack.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list) {
|
||||
if (!isInCreativeTab(creativeTab))
|
||||
return;
|
||||
|
||||
for (int i = 0; i < names.size(); i++)
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
for (String name : names)
|
||||
ret.add(new ImmutablePair<Integer, String>(names.indexOf(name), "type=" + name));
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static ItemStack getStack(String name) {
|
||||
return new ItemStack(RegistrarBloodMagicItems.COMPONENT, 1, names.indexOf(name));
|
||||
}
|
||||
|
||||
public static ItemStack getStack(String key, int stackSize) {
|
||||
ItemStack stack = getStack(key);
|
||||
stack.setCount(stackSize);
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static ArrayList<String> getNames() {
|
||||
return names;
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@ import WayofTime.bloodmagic.api.util.helper.PurificationHelper;
|
|||
import WayofTime.bloodmagic.api_impl.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import com.google.common.collect.Lists;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
|
@ -76,9 +77,7 @@ public class ItemDaggerOfSacrifice extends Item implements IVariantProvider {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = Lists.newArrayList();
|
||||
ret.add(Pair.of(0, "type=normal"));
|
||||
return ret;
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
variants.put(0, "type=normal");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,64 +1,15 @@
|
|||
package WayofTime.bloodmagic.item;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.api.soul.IDiscreteDemonWill;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import com.google.common.collect.Lists;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemDemonCrystal extends Item implements IDiscreteDemonWill, IVariantProvider {
|
||||
public static final ArrayList<String> NAMES = Lists.newArrayList();
|
||||
|
||||
public static final String CRYSTAL_DEFAULT = "crystalDefault";
|
||||
public static final String CRYSTAL_CORROSIVE = "crystalCorrosive";
|
||||
public static final String CRYSTAL_VENGEFUL = "crystalVengeful";
|
||||
public static final String CRYSTAL_DESTRUCTIVE = "crystalDestructive";
|
||||
public static final String CRYSTAL_STEADFAST = "crystalSteadfast";
|
||||
public class ItemDemonCrystal extends ItemEnum<EnumDemonWillType> implements IDiscreteDemonWill, IVariantProvider {
|
||||
|
||||
public ItemDemonCrystal() {
|
||||
super();
|
||||
|
||||
setUnlocalizedName(BloodMagic.MODID + ".demonCrystal.");
|
||||
setHasSubtypes(true);
|
||||
setCreativeTab(BloodMagic.TAB_BM);
|
||||
|
||||
buildItemList();
|
||||
}
|
||||
|
||||
private void buildItemList() {
|
||||
NAMES.add(0, CRYSTAL_DEFAULT);
|
||||
NAMES.add(1, CRYSTAL_CORROSIVE);
|
||||
NAMES.add(2, CRYSTAL_DESTRUCTIVE);
|
||||
NAMES.add(3, CRYSTAL_VENGEFUL);
|
||||
NAMES.add(4, CRYSTAL_STEADFAST);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return super.getUnlocalizedName(stack) + NAMES.get(stack.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list) {
|
||||
if (!isInCreativeTab(creativeTab))
|
||||
return;
|
||||
|
||||
for (int i = 0; i < NAMES.size(); i++)
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
super(EnumDemonWillType.class, "demonCrystal");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -88,16 +39,4 @@ public class ItemDemonCrystal extends Item implements IDiscreteDemonWill, IVaria
|
|||
public EnumDemonWillType getType(ItemStack willStack) {
|
||||
return EnumDemonWillType.values()[MathHelper.clamp(willStack.getMetadata(), 0, EnumDemonWillType.values().length - 1)];
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
for (String name : NAMES)
|
||||
ret.add(new ImmutablePair<Integer, String>(NAMES.indexOf(name), "type=" + name));
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static ItemStack getStack(String name) {
|
||||
return new ItemStack(RegistrarBloodMagicItems.ITEM_DEMON_CRYSTAL, 1, NAMES.indexOf(name));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import WayofTime.bloodmagic.BloodMagic;
|
|||
import WayofTime.bloodmagic.api.iface.IDemonWillViewer;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -32,10 +33,8 @@ public class ItemDemonWillGauge extends Item implements IVariantProvider, IDemon
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
ret.add(new ImmutablePair<Integer, String>(0, "type=willgauge"));
|
||||
return ret;
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
variants.put(0, "type=willgauge");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
57
src/main/java/WayofTime/bloodmagic/item/ItemEnum.java
Normal file
57
src/main/java/WayofTime/bloodmagic/item/ItemEnum.java
Normal file
|
@ -0,0 +1,57 @@
|
|||
package WayofTime.bloodmagic.item;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.item.types.ISubItem;
|
||||
import com.google.common.collect.Lists;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemEnum<T extends Enum<T> & ISubItem> extends Item implements IVariantProvider {
|
||||
|
||||
protected final T[] types;
|
||||
|
||||
public ItemEnum(Class<T> enumClass, String baseName) {
|
||||
super();
|
||||
|
||||
this.types = enumClass.getEnumConstants();
|
||||
|
||||
setUnlocalizedName(BloodMagic.MODID + "." + baseName);
|
||||
setHasSubtypes(types.length > 1);
|
||||
setCreativeTab(BloodMagic.TAB_BM);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return super.getUnlocalizedName(stack) + "." + getItemType(stack).getInternalName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> subItems) {
|
||||
if (!isInCreativeTab(tab))
|
||||
return;
|
||||
|
||||
for (T type : types)
|
||||
subItems.add(new ItemStack(this, 1, type.ordinal()));
|
||||
}
|
||||
|
||||
public T getItemType(ItemStack stack) {
|
||||
return types[MathHelper.clamp(stack.getItemDamage(), 0, types.length)];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
for (int i = 0; i < types.length; i++)
|
||||
variants.put(i, "type=" + types[i].getInternalName());
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@ import WayofTime.bloodmagic.BloodMagic;
|
|||
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
|
@ -59,14 +60,12 @@ public class ItemExperienceBook extends Item implements IVariantProvider {
|
|||
giveOneLevelExpToPlayer(stack, player);
|
||||
}
|
||||
|
||||
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
|
||||
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
ret.add(new ImmutablePair<Integer, String>(0, "type=experiencetome"));
|
||||
return ret;
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
variants.put(0, "type=experiencetome");
|
||||
}
|
||||
|
||||
public void giveOneLevelExpToPlayer(ItemStack stack, EntityPlayer player) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
|||
import WayofTime.bloodmagic.block.BlockRitualStone;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
@ -102,11 +103,9 @@ public class ItemInscriptionTool extends ItemBindableBase implements IVariantPro
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
public void populateVariants(Int2ObjectMap<String> variants) {
|
||||
for (int i = 1; i < EnumRuneType.values().length; i++)
|
||||
ret.add(new ImmutablePair<Integer, String>(i, "type=" + EnumRuneType.values()[i].name()));
|
||||
return ret;
|
||||
variants.put(i, "type=" + EnumRuneType.values()[i].name());
|
||||
}
|
||||
|
||||
public EnumRuneType getType(ItemStack stack) {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue