From 6ea6f1e017f6cad7f12f76e996d37489ebc99fb7 Mon Sep 17 00:00:00 2001 From: MysteriousAges Date: Sat, 21 Mar 2015 21:26:51 -0700 Subject: [PATCH] Adding temporary crafting recipes for Magic Apiary & vis aura converter. --- src/main/java/magicbees/main/Config.java | 1 + .../magicbees/main/utils/CraftingManager.java | 59 +++++-------------- .../main/utils/compat/ForestryHelper.java | 6 ++ .../tileentity/TileEntityMagicApiary.java | 20 +++++-- 4 files changed, 37 insertions(+), 49 deletions(-) diff --git a/src/main/java/magicbees/main/Config.java b/src/main/java/magicbees/main/Config.java index cb7cefd..11e5bce 100644 --- a/src/main/java/magicbees/main/Config.java +++ b/src/main/java/magicbees/main/Config.java @@ -136,6 +136,7 @@ public class Config //----- Forestry Blocks ------------------------------------ public static Block fHiveBlock; public static Block fAlvearyBlock; + public static Block fApicultureBlock; //----- Forestry Items ------------------------------------- public static Item fBeeComb; public static Item fHoneydew; diff --git a/src/main/java/magicbees/main/utils/CraftingManager.java b/src/main/java/magicbees/main/utils/CraftingManager.java index 50e003a..f354b99 100644 --- a/src/main/java/magicbees/main/utils/CraftingManager.java +++ b/src/main/java/magicbees/main/utils/CraftingManager.java @@ -351,38 +351,16 @@ public class CraftingManager 'S', Config.miscResources.getStackForType(ResourceType.DIMENSIONAL_SINGULARITY) })); } - + + // TODO: Finalize recipe. + output = new ItemStack(Config.magicApiary); + GameRegistry.addShapelessRecipe(output, new Object[] { + Config.pollen.getStackForType(PollenType.UNUSUAL, 2), + new ItemStack(Config.fApicultureBlock, 1, ForestryHelper.ApicultureBlock.APIARY.ordinal()) + }); if (ThaumcraftHelper.isActive()) { - // Slabs - /*for (int i = 0; i < PlankType.values().length; ++i) - { - input = new ItemStack(Config.planksWood, 1, i); - output = new ItemStack(Config.slabWoodHalf, 6, i); - GameRegistry.addRecipe(output, new Object[] { - "PPP", - 'P', input - }); - }*/ - - // Essentia bottles - /*output = new ItemStack(Config.tcEssentiaBottle); - output.stackSize = 8; - GameRegistry.addRecipe(output, new Object[] { - " C ", "GPG", "PGP", - 'G', Config.wax, - 'C', Item.clay, - 'P', Block.thinGlass - }); - - output = new ItemStack(Config.tcEssentiaBottle); - output.stackSize = 4; - GameRegistry.addRecipe(output, new Object[] { - " W ", "W W", " W ", - 'W', Config.wax - });*/ - input = Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT); output = new ItemStack(Config.tcMiscResource, 1, ThaumcraftHelper.MiscResource.KNOWLEDGE_FRAGMENT.ordinal()); GameRegistry.addShapelessRecipe(output, new Object[] { @@ -400,20 +378,15 @@ public class CraftingManager 'C', Blocks.chest }); } - - // "bottling" Crystal aspects. - /*for (EnumTag tag : EnumTag.values()) - { - if (tag != EnumTag.UNKNOWN) - { - output = new ItemStack(Config.tcEssentiaBottle, 1, tag.id + 1); - GameRegistry.addRecipe(output, new Object[] { - "ccc", "cxc", "ccc", - 'c', new ItemStack(Config.solidFlux, 1, tag.id), - 'x', Config.tcEssentiaBottle - }); - } - }*/ + + // TODO: Finalize recipe. + output = new ItemStack(Config.visAuraProvider); + GameRegistry.addRecipe(output, new Object[] { + " p ", "igi", "iii", + 'p', Config.pollen.getStackForType(PollenType.UNUSUAL), + 'i', Items.iron_ingot, + 'g', Blocks.glass + }); } if (ArsMagicaHelper.isActive()) diff --git a/src/main/java/magicbees/main/utils/compat/ForestryHelper.java b/src/main/java/magicbees/main/utils/compat/ForestryHelper.java index 47c1ea3..02023d8 100644 --- a/src/main/java/magicbees/main/utils/compat/ForestryHelper.java +++ b/src/main/java/magicbees/main/utils/compat/ForestryHelper.java @@ -93,6 +93,11 @@ public class ForestryHelper APATITE, LAPIS,; } + + public enum ApicultureBlock { + APIARY, + ; + } public static final String Name = "Forestry"; @@ -138,6 +143,7 @@ public class ForestryHelper Class c = Class.forName("forestry.core.config.ForestryBlock"); Config.fAlvearyBlock = BlockInterface.getBlock("alveary"); Config.fHiveBlock = BlockInterface.getBlock("beehives"); + Config.fApicultureBlock = BlockInterface.getBlock("apiculture"); } catch (Exception e) { diff --git a/src/main/java/magicbees/tileentity/TileEntityMagicApiary.java b/src/main/java/magicbees/tileentity/TileEntityMagicApiary.java index d421230..44ffc5c 100644 --- a/src/main/java/magicbees/tileentity/TileEntityMagicApiary.java +++ b/src/main/java/magicbees/tileentity/TileEntityMagicApiary.java @@ -49,9 +49,9 @@ public class TileEntityMagicApiary extends TileEntity implements ISidedInventory private static final int SLOT_PRODUCTS_COUNT = 7; private static final int AURAPROVIDER_SEARCH_RADIUS = 6; - private static int CHARGE_TIME_MUTATION = 240; - private static int CHARGE_TIME_DEATH = 80; - private static int CHARGE_TIME_PRODUCTION = 60; + private static int CHARGE_TIME_MUTATION = 1200; + private static int CHARGE_TIME_DEATH = 400; + private static int CHARGE_TIME_PRODUCTION = 300; private IBeekeepingLogic logic; private IMagicApiaryAuraProvider auraProvider; @@ -645,6 +645,10 @@ public class TileEntityMagicApiary extends TileEntity implements ISidedInventory } private void updateAuraProvider() { + if (worldObj.getTotalWorldTime() % 15 == 0 && locationHasAuraProvider(auraProviderPosition)) { + + } + int oldFlags = flags; if (!isMutationBoosted()) { if (this.auraProvider.getMutationCharge()) { @@ -692,8 +696,8 @@ public class TileEntityMagicApiary extends TileEntity implements ISidedInventory NetworkEventHandler.getInstance().sendFlagsUpdate(this, new int[] {flags}); } } - - private static final int MAX_BLOCKS_SEARCH_PER_CHECK = (AURAPROVIDER_SEARCH_RADIUS * 2 + 1) * 2; + + private static final int MAX_BLOCKS_SEARCH_PER_CHECK = (AURAPROVIDER_SEARCH_RADIUS * 2 + 1) * 2; private void findAuraProvider() { if (worldObj.getTotalWorldTime() % 10 != 0) { return; @@ -708,7 +712,7 @@ public class TileEntityMagicApiary extends TileEntity implements ISidedInventory } else { // Will end up here after loading from save with a valid auraProvider. - if (locationHasAuraProvider(auraProviderPosition.x, auraProviderPosition.y, auraProviderPosition.z)) { + if (locationHasAuraProvider(auraProviderPosition)) { IMagicApiaryAuraProvider provider = (IMagicApiaryAuraProvider)(worldObj.getTileEntity(auraProviderPosition.x, auraProviderPosition.y, auraProviderPosition.x)); @@ -765,6 +769,10 @@ public class TileEntityMagicApiary extends TileEntity implements ISidedInventory auraProviderPosition = new ChunkCoords(auraProviderPosition.dimension, x, y, z); } + private boolean locationHasAuraProvider(ChunkCoords coords) { + return locationHasAuraProvider(coords.x, coords.y, coords.z); + } + private boolean locationHasAuraProvider(int x, int y, int z) { TileEntity entity = worldObj.getTileEntity(x, y, z); if (entity != null && entity instanceof IMagicApiaryAuraProvider) {