diff --git a/gradle.properties b/gradle.properties index a985ef2..6936382 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,10 @@ version_major=2 version_minor=3 -version_rev=6 +version_rev=7 version_forestry=3.6.3.20 version_bloodmagic=1.3.3-4 -version_botania=r1.6-197 +version_botania=r1.7-221 version_baubles=1.0.1.10 version_mc=1.7.10 diff --git a/libs/Botania r1.6-197-deobf.jar b/libs/Botania r1.7-221-deobf.jar similarity index 88% rename from libs/Botania r1.6-197-deobf.jar rename to libs/Botania r1.7-221-deobf.jar index 42ec35d..c1ef47d 100644 Binary files a/libs/Botania r1.6-197-deobf.jar and b/libs/Botania r1.7-221-deobf.jar differ diff --git a/src/main/java/magicbees/bees/BeeMutation.java b/src/main/java/magicbees/bees/BeeMutation.java index ab15fd5..dc8c76c 100644 --- a/src/main/java/magicbees/bees/BeeMutation.java +++ b/src/main/java/magicbees/bees/BeeMutation.java @@ -553,7 +553,7 @@ public class BeeMutation implements IBeeMutation { } else if (this.requiredBlockOreDictEntry != null) { ArrayList ores = OreDictionary.getOres(this.requiredBlockOreDictEntry); - if (ores.size() > 0) { + if (ores != null && 0 < ores.size()) { conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresBlock"), ores.get(0).getDisplayName())); } } diff --git a/src/main/java/magicbees/bees/BeeSpecies.java b/src/main/java/magicbees/bees/BeeSpecies.java index 0e3be09..a7d407b 100644 --- a/src/main/java/magicbees/bees/BeeSpecies.java +++ b/src/main/java/magicbees/bees/BeeSpecies.java @@ -472,7 +472,12 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider TC_ORDER.setInactive(); TC_VIS.setInactive(); + TC_REJUVENATING.setInactive(); + TC_EMPOWERING.setInactive(); + TC_NEXUS.setInactive(); + TC_TAINT.setInactive(); TC_PURE.setInactive(); + TC_HUNGRY.setInactive(); TC_BRAINY.setInactive(); TC_BATTY.setInactive(); @@ -482,10 +487,6 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider TC_WISPY.setInactive(); } - // These species should be fixed. ¯\_(ツ)_/¯ - TC_TAINT.setInactive(); - TC_EMPOWERING.setInactive(); - //TC_REJUVENATING.setInactive(); BeeProductHelper.initEquivalentExchange3Species(); if (!EquivalentExchangeHelper.isActive()) { diff --git a/src/main/java/magicbees/main/utils/compat/botania/SpeciesRecipeManaInfusion.java b/src/main/java/magicbees/main/utils/compat/botania/SpeciesRecipeManaInfusion.java index 5a338f5..ea38f3e 100644 --- a/src/main/java/magicbees/main/utils/compat/botania/SpeciesRecipeManaInfusion.java +++ b/src/main/java/magicbees/main/utils/compat/botania/SpeciesRecipeManaInfusion.java @@ -33,6 +33,7 @@ public class SpeciesRecipeManaInfusion extends RecipeManaInfusion { IBee bee = BeeManager.beeRoot.getMember(stack); if (bee.getGenome().getPrimary().equals(inputSpecies)) { outputCache = ForestryHelper.replaceSpecies(stack, outputSpecies); + outputCache.stackSize = 1; return true; } diff --git a/src/main/java/magicbees/main/utils/compat/botania/SubTileHibeescus.java b/src/main/java/magicbees/main/utils/compat/botania/SubTileHibeescus.java index 1d30273..50d8726 100644 --- a/src/main/java/magicbees/main/utils/compat/botania/SubTileHibeescus.java +++ b/src/main/java/magicbees/main/utils/compat/botania/SubTileHibeescus.java @@ -9,10 +9,12 @@ import cpw.mods.fml.relauncher.SideOnly; import magicbees.bees.BeeManager; import magicbees.main.utils.compat.BotaniaHelper; import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; +import net.minecraft.world.World; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.subtile.SubTileFunctional; import forestry.api.apiculture.EnumBeeType; @@ -24,10 +26,16 @@ public class SubTileHibeescus extends SubTileFunctional { private final int MANA_PER_OPERATION = 10000; // Ticks per second * seconds per minute * real-time minutes private final int OPERATION_TICKS_TIME = 20 * 60 * 15; - private final int RANGE = 1; + private final double RANGE = 0.75; private ItemStack beeSlot; private long operationTicksRemaining; + private float manaCostRollover; + + @Override + public int getColor() { + return 0xF94F4F; + } @Override public void onUpdate() { @@ -36,19 +44,29 @@ public class SubTileHibeescus extends SubTileFunctional { return; } - if (beeSlot != null && this.mana >= MANA_PER_OPERATION) { + if (beeSlot != null) { progressOperation(); } - else if (beeSlot == null && this.supertile.getWorldObj().getTotalWorldTime() % 10 == 0 && redstoneSignal == 0) { + else if (beeSlot == null && isTimeToPickUpItem() && redstoneSignal == 0) { findBeeItemToHold(); } } + + protected boolean isTimeToPickUpItem() { + return (this.supertile.getWorldObj().getTotalWorldTime() ^ supertile.xCoord ^ supertile.zCoord) % 11 == 0; + } private void progressOperation() { - operationTicksRemaining--; - - if (operationTicksRemaining <= 0) { - mana -= MANA_PER_OPERATION; + if (0 < operationTicksRemaining && 0 < this.mana) { + operationTicksRemaining--; + manaCostRollover += getManaPerOpTick(); + if (1f <= manaCostRollover) { + int amount = (int)manaCostRollover; + mana -= amount; + manaCostRollover -= amount; + } + } + else if (operationTicksRemaining <= 0) { IBee bee = BeeManager.beeRoot.getMember(beeSlot); bee.setIsNatural(true); EnumBeeType beeType = EnumBeeType.QUEEN; @@ -56,18 +74,23 @@ public class SubTileHibeescus extends SubTileFunctional { beeType = EnumBeeType.PRINCESS; } ItemStack outputStack = BeeManager.beeRoot.getMemberStack(bee, beeType.ordinal()); - Random r = supertile.getWorldObj().rand; - EntityItem entity = new EntityItem(supertile.getWorldObj(), - supertile.xCoord - RANGE + r.nextInt(RANGE * 2 + 1), supertile.yCoord + 1, supertile.zCoord - RANGE + r.nextInt(RANGE * 2 + 1), - outputStack); - entity.motionX = 0; - entity.motionY = 0; - entity.motionZ = 0; + EntityItem entity = dropItemStackInRange(outputStack); supertile.getWorldObj().spawnEntityInWorld(entity); beeSlot = null; } } + + protected EntityItem dropItemStackInRange(ItemStack outputStack) { + Random r = supertile.getWorldObj().rand; + EntityItem entity = new EntityItem(supertile.getWorldObj(), + supertile.xCoord - RANGE + r.nextInt((int)(RANGE * 2 + 1)), supertile.yCoord + 1, supertile.zCoord - RANGE + r.nextInt((int)(RANGE * 2 + 1)), + outputStack); + entity.motionX = 0; + entity.motionY = 0; + entity.motionZ = 0; + return entity; + } private void findBeeItemToHold() { @SuppressWarnings("unchecked") @@ -76,12 +99,10 @@ public class SubTileHibeescus extends SubTileFunctional { for (EntityItem itemEntity : items) { ItemStack item = itemEntity.getEntityItem(); if (!itemEntity.isDead && isItemPrincessOrQueen(item)) { - beeSlot = itemEntity.getEntityItem(); - itemEntity.setDead(); - operationTicksRemaining = (long)(OPERATION_TICKS_TIME * BotaniaHelper.hibeescusTicksMultiplier); - if (operationTicksRemaining > 0) { - operationTicksRemaining += supertile.getWorldObj().rand.nextInt((int)(operationTicksRemaining * 0.02)); - } + beeSlot = itemEntity.getEntityItem().copy(); + beeSlot.stackSize = 1; + operationTicksRemaining = (long)(OPERATION_TICKS_TIME * BotaniaHelper.hibeescusTicksMultiplier) + supertile.getWorldObj().rand.nextInt(200); + manaCostRollover = 0f; // Princesses and Queens don't stack, but YOU NEVER KNOW. item.stackSize -= 1; @@ -94,7 +115,7 @@ public class SubTileHibeescus extends SubTileFunctional { } } } - + private boolean isItemPrincessOrQueen(ItemStack stack) { boolean isBee = BeeManager.beeRoot.isMember(stack, EnumBeeType.PRINCESS.ordinal()) || BeeManager.beeRoot.isMember(stack, EnumBeeType.QUEEN.ordinal()); @@ -121,6 +142,7 @@ public class SubTileHibeescus extends SubTileFunctional { beeSlot = ItemStack.loadItemStackFromNBT(itemTag); } operationTicksRemaining = cmp.getLong("operationTicks"); + manaCostRollover = cmp.getFloat("manaRollover"); } @Override @@ -132,6 +154,7 @@ public class SubTileHibeescus extends SubTileFunctional { cmp.setTag("slot", itemTag); } cmp.setLong("operationTicks", operationTicksRemaining); + cmp.setFloat("manaRollover", manaCostRollover); } @Override @@ -144,8 +167,16 @@ public class SubTileHibeescus extends SubTileFunctional { @Override public int getMaxMana() { + return getFinalOperationManaCost() / 20; + } + + protected int getFinalOperationManaCost() { return (int)(MANA_PER_OPERATION * BotaniaHelper.hibeescusManaCostMultiplier); } + + protected float getManaPerOpTick() { + return getFinalOperationManaCost() / OPERATION_TICKS_TIME; + } @Override @SideOnly(Side.CLIENT)