diff --git a/1.7.10/main/java/Blood Magic API - v1.0.1g+ (1.7.10).zip b/1.7.10/main/java/Blood Magic API - v1.0.1g+ (1.7.10).zip deleted file mode 100644 index 0f6c3d9d..00000000 Binary files a/1.7.10/main/java/Blood Magic API - v1.0.1g+ (1.7.10).zip and /dev/null differ diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index 71fce36a..d755db1d 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -33,6 +33,7 @@ import WayofTime.alchemicalWizardry.api.alchemy.AlchemicalPotionCreationHandler; import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry; import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry; +import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry; import WayofTime.alchemicalWizardry.api.rituals.Rituals; import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry; import WayofTime.alchemicalWizardry.common.AlchemicalWizardryEventHooks; @@ -58,6 +59,8 @@ import WayofTime.alchemicalWizardry.common.entity.mob.EntityShadeElemental; import WayofTime.alchemicalWizardry.common.entity.mob.EntitySmallEarthGolem; import WayofTime.alchemicalWizardry.common.entity.mob.EntityWaterElemental; import WayofTime.alchemicalWizardry.common.entity.mob.EntityWingedFireDemon; +import WayofTime.alchemicalWizardry.common.harvest.BloodMagicHarvestHandler; +import WayofTime.alchemicalWizardry.common.harvest.GourdHarvestHandler; import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner; import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding; import WayofTime.alchemicalWizardry.common.items.thaumcraft.ItemSanguineArmour; @@ -82,12 +85,14 @@ import WayofTime.alchemicalWizardry.common.rituals.RitualEffectFeatheredEarth; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectFeatheredKnife; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectFlight; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectGrowth; +import WayofTime.alchemicalWizardry.common.rituals.RitualEffectHarvest; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectHealing; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectInterdiction; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectItemSuction; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectJumping; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLava; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLeap; +import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLifeConduit; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectMagnetic; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectSoulBound; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectSummonMeteor; @@ -125,6 +130,7 @@ import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock; import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; import WayofTime.alchemicalWizardry.common.tileEntity.gui.GuiHandler; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; @@ -182,6 +188,7 @@ public class AlchemicalWizardry public static boolean isForestryLoaded; public static boolean wimpySettings; + public static boolean respawnWithLowerHealth; public static CreativeTabs tabBloodMagic = new CreativeTabs("tabBloodMagic") { @@ -330,8 +337,9 @@ public class AlchemicalWizardry RecipeSorter.INSTANCE.register("AWWayofTime:shapedorb", ShapedBloodOrbRecipe.class, Category.SHAPED, "before:minecraft:shapeless"); RecipeSorter.INSTANCE.register("AWWayofTime:shapelessorb", ShapelessBloodOrbRecipe.class, Category.SHAPELESS, "after:minecraft:shapeless"); - //FMLCommonHandler.instance().bus().register(new AlchemicalWizardryEventHooks()); - MinecraftForge.EVENT_BUS.register(new AlchemicalWizardryEventHooks()); + Object eventHook = new AlchemicalWizardryEventHooks(); + FMLCommonHandler.instance().bus().register(eventHook); + MinecraftForge.EVENT_BUS.register(eventHook); NewPacketHandler.INSTANCE.ordinal(); } @@ -406,6 +414,7 @@ public class AlchemicalWizardry ItemStack runeOfSelfSacrificeStack = new ItemStack(ModBlocks.runeOfSelfSacrifice); ItemStack miningSigilStackCrafted = new ItemStack(ModItems.sigilOfTheFastMiner); ItemStack divinationSigilStackCrafted = new ItemStack(ModItems.divinationSigil); + ItemStack seerSigilStack = new ItemStack(ModItems.itemSeerSigil); // ItemStack elementalInkWaterStack = new ItemStack(elementalInkWater); // ItemStack elementalInkFireStack = new ItemStack(elementalInkFire); // ItemStack elementalInkEarthStack = new ItemStack(elementalInkEarth); @@ -478,6 +487,7 @@ public class AlchemicalWizardry GameRegistry.addRecipe(new ShapedBloodOrbRecipe(runeOfSacrificeStack, "srs", "gog", "srs", 's', stoneStack, 'g', goldIngotStack, 'o', apprenticeBloodOrbStack, 'r', reinforcedSlateStack)); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(runeOfSelfSacrificeStack, "srs", "gog", "srs", 's', stoneStack, 'g', glowstoneDustStack, 'o', apprenticeBloodOrbStack, 'r', reinforcedSlateStack)); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(divinationSigilStackCrafted, "ggg", "gsg", "gog", 'g', glassStack, 's', blankSlateStack, 'o', weakBloodOrbStack)); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(seerSigilStack, "gbg", "gsg", "gog", 'g', glassStack, 's', divinationSigilStackCrafted, 'o', apprenticeBloodOrbStack,'b', new ItemStack(ModItems.bucketLife))); // GameRegistry.addRecipe(waterScribeToolStack, "f", "i", 'f', featherStack, 'i', elementalInkWaterStack); // GameRegistry.addRecipe(fireScribeToolStack, "f", "i", 'f', featherStack, 'i', elementalInkFireStack); // GameRegistry.addRecipe(earthScribeToolStack, "f", "i", 'f', featherStack, 'i', elementalInkEarthStack); @@ -594,6 +604,7 @@ public class AlchemicalWizardry this.initAltarRecipes(); this.initRituals(); this.initBindingRecipes(); + this.initHarvestRegistry(); //MinecraftForge.setToolClass(ModItems.boundPickaxe, "pickaxe", 5); //MinecraftForge.setToolClass(ModItems.boundAxe, "axe", 5); @@ -965,6 +976,8 @@ public class AlchemicalWizardry Rituals.registerRitual("AW021Expulsion", 1, 1000000, new RitualEffectExpulsion(), "Aura of Expulsion"); Rituals.registerRitual("AW022Supression", 1, 10000, new RitualEffectSupression(), "Dome of Supression"); Rituals.registerRitual("AW023Zephyr", 1, 25000, new RitualEffectItemSuction(),"Call of the Zephyr"); + Rituals.registerRitual("AW024Harvest", 1, 20000, new RitualEffectHarvest(), "Reap of the Harvest Moon"); + Rituals.registerRitual("AW025Conduit", 2, 2000000, new RitualEffectLifeConduit(), "Cry of the Eternal Soul"); //Rituals.registerRitual(1,100,new RitualEffectApiaryOverclock(),"Apiary Overclock")); } @@ -976,4 +989,10 @@ public class AlchemicalWizardry BindingRegistry.registerRecipe(new ItemStack(ModItems.energySword), new ItemStack(Items.diamond_sword)); BindingRegistry.registerRecipe(new ItemStack(ModItems.energyBlaster), new ItemStack(ModItems.apprenticeBloodOrb)); } + + public static void initHarvestRegistry() + { + HarvestRegistry.registerHarvestHandler(new BloodMagicHarvestHandler()); + HarvestRegistry.registerHarvestHandler(new GourdHarvestHandler()); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java index b13dcdd9..24c6a94d 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java @@ -64,6 +64,7 @@ public class BloodMagicConfiguration AlchemicalWizardry.allowedCrushedOresArray = config.get("oreCrushing", "allowedOres", new String[]{"iron","gold","copper","tin","lead","silver","osmium"}).getStringList(); AlchemicalWizardry.wimpySettings = config.get("WimpySettings","IDontLikeFun",false).getBoolean(false); + AlchemicalWizardry.respawnWithLowerHealth = config.get("WimpySettings", "RespawnWithLowerHealth", true).getBoolean(); } catch (Exception e) { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java new file mode 100644 index 00000000..0d91715d --- /dev/null +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java @@ -0,0 +1,34 @@ +package WayofTime.alchemicalWizardry.api.harvest; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.world.World; + +public class HarvestRegistry +{ + public static List handlerList = new ArrayList(); + + public static void registerHarvestHandler(IHarvestHandler handler) + { + System.out.println("Heeeeelllooooo"); + handlerList.add(handler); + } + + public static boolean harvestBlock(World world, int xCoord, int yCoord, int zCoord) + { + Block block = world.getBlock(xCoord, yCoord, zCoord); + int meta = world.getBlockMetadata(xCoord, yCoord, zCoord); + + for(IHarvestHandler handler : handlerList) + { + if(handler.harvestAndPlant(world, xCoord, yCoord, zCoord, block, meta)) + { + return true; + } + } + + return false; + } +} diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/api/harvest/IHarvestHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/harvest/IHarvestHandler.java new file mode 100644 index 00000000..888dff58 --- /dev/null +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/api/harvest/IHarvestHandler.java @@ -0,0 +1,21 @@ +package WayofTime.alchemicalWizardry.api.harvest; + +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraftforge.common.IPlantable; + +public interface IHarvestHandler +{ + /** + * A handler that is used to harvest and replant the block at the specified location + * + * @param world + * @param xCoord + * @param yCoord + * @param zCoord + * @param block block at this given location + * @param meta meta at this given location + * @return true if successfully harvested, false if not + */ + public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta); +} diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java index 34575633..1bbbd284 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java @@ -25,10 +25,7 @@ import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjecti import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import cpw.mods.fml.common.ObfuscationReflectionHelper; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent; -import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Type; -import cpw.mods.fml.relauncher.ReflectionHelper; +import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent; public class AlchemicalWizardryEventHooks { @@ -36,6 +33,15 @@ public class AlchemicalWizardryEventHooks public static Map playerBoostStepHeight = new HashMap(); public static List playersWith1Step = new ArrayList(); + @SubscribeEvent + public void onPlayerRespawnEvent(PlayerRespawnEvent event) + { + if(AlchemicalWizardry.respawnWithLowerHealth) + { + event.player.setHealth(6); + } + } + @SubscribeEvent public void onLivingJumpEvent(LivingJumpEvent event) { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BloodRune.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BloodRune.java index 00f0a83f..b5df0d22 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BloodRune.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/block/BloodRune.java @@ -22,6 +22,7 @@ public class BloodRune extends Block private IIcon altarCapacityRuneIcon; private IIcon dislocationRuneIcon; private IIcon orbCapacityRuneIcon; + private IIcon betterCapacityRuneIcon; public BloodRune() { @@ -40,6 +41,7 @@ public class BloodRune extends Block this.altarCapacityRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:AltarCapacityRune"); this.dislocationRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:DislocationRune"); this.orbCapacityRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:OrbCapacityRune"); + this.betterCapacityRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:BetterCapacityRune"); } public int getRuneEffect(int metaData) @@ -57,6 +59,9 @@ public class BloodRune extends Block case 3: //Orb Capacity rune return 7; + + case 4: //Better Capacity rune + return 8; } return 0; @@ -75,6 +80,7 @@ public class BloodRune extends Block par3List.add(new ItemStack(par1, 1, 1)); par3List.add(new ItemStack(par1, 1, 2)); par3List.add(new ItemStack(par1, 1, 3)); + par3List.add(new ItemStack(par1, 1, 4)); } else { super.getSubBlocks(par1, par2CreativeTabs, par3List); @@ -98,6 +104,9 @@ public class BloodRune extends Block case 3: return this.orbCapacityRuneIcon; + + case 4: + return this.betterCapacityRuneIcon; default: return blockIcon; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/AltarUpgradeComponent.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/AltarUpgradeComponent.java index acdede16..f6e231c2 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/AltarUpgradeComponent.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/AltarUpgradeComponent.java @@ -9,6 +9,7 @@ public class AltarUpgradeComponent private int displacementUpgrades; private int altarCapacitiveUpgrades; private int orbCapacitiveUpgrades; + private int betterCapacitiveUpgrades; public AltarUpgradeComponent() { @@ -19,6 +20,7 @@ public class AltarUpgradeComponent displacementUpgrades = 0; altarCapacitiveUpgrades = 0; orbCapacitiveUpgrades = 0; + betterCapacitiveUpgrades = 0; } public void addSpeedUpgrade() @@ -55,6 +57,11 @@ public class AltarUpgradeComponent { orbCapacitiveUpgrades++; } + + public void addBetterCapacitiveUpgrade() + { + betterCapacitiveUpgrades++; + } public int getSpeedUpgrades() { @@ -90,4 +97,9 @@ public class AltarUpgradeComponent { return this.orbCapacitiveUpgrades; } + + public int getBetterCapacitiveUpgrades() + { + return this.betterCapacitiveUpgrades; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java index d5db3638..4c5ea30d 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java @@ -189,6 +189,10 @@ public class UpgradedAltars case 7: upgrades.addorbCapacitiveUpgrade(); break; + + case 8: + upgrades.addBetterCapacitiveUpgrade(); + break; } } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BlockSet.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BlockSet.java index 008ef748..25398812 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BlockSet.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BlockSet.java @@ -14,9 +14,9 @@ import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; public class BlockSet { - private String blockid; - private int[] metadata; - private List positions; + protected String blockid; + protected int[] metadata; + protected List positions; public BlockSet() { diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonBuilding.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonBuilding.java index f6f97f03..b0777a46 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonBuilding.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/DemonBuilding.java @@ -112,4 +112,9 @@ public class DemonBuilding { schematic.destroyAllInField(world, xCoord, yCoord, zCoord, dir); } + + public int getNumberOfGridSpaces() + { + return area.getNumberOfGridSpaces(); + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/GridSpaceHolder.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/GridSpaceHolder.java index 5ce845c1..95438be0 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/GridSpaceHolder.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/GridSpaceHolder.java @@ -289,4 +289,21 @@ public class GridSpaceHolder } } } + + public int getNumberOfGridSpaces() + { + int num = 0; + for(int i=-this.negXRadius; i<=this.posXRadius; i++) + { + for(int j=-this.negZRadius; j<=this.posZRadius; j++) + { + if(!this.getGridSpace(i, j).isEmpty()) + { + num++; + } + } + } + + return num; + } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/TileBlockSet.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/TileBlockSet.java new file mode 100644 index 00000000..2209f58c --- /dev/null +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/demonVillage/TileBlockSet.java @@ -0,0 +1,8 @@ +package WayofTime.alchemicalWizardry.common.demonVillage; + +import net.minecraft.nbt.NBTTagCompound; + +public class TileBlockSet extends BlockSet +{ + public NBTTagCompound tag; +} diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java index 5a766314..884b37f2 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java @@ -138,7 +138,6 @@ public class EntityBileDemon extends EntityDemon { super.writeEntityToNBT(par1NBTTagCompound); par1NBTTagCompound.setBoolean("Angry", this.isAngry()); - par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor()); par1NBTTagCompound.setByte("attackTimer", (byte) attackTimer); } @@ -150,11 +149,6 @@ public class EntityBileDemon extends EntityDemon super.readEntityFromNBT(par1NBTTagCompound); this.setAngry(par1NBTTagCompound.getBoolean("Angry")); - if (par1NBTTagCompound.hasKey("CollarColor")) - { - this.setCollarColor(par1NBTTagCompound.getByte("CollarColor")); - } - attackTimer = par1NBTTagCompound.getByte("attackTimer"); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBoulderFist.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBoulderFist.java index edea165f..fa4106de 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBoulderFist.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBoulderFist.java @@ -138,7 +138,6 @@ public class EntityBoulderFist extends EntityDemon public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setBoolean("Angry", this.isAngry()); par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor()); } @@ -150,11 +149,6 @@ public class EntityBoulderFist extends EntityDemon super.readEntityFromNBT(par1NBTTagCompound); this.setAngry(par1NBTTagCompound.getBoolean("Angry")); - if (par1NBTTagCompound.hasKey("CollarColor")) - { - this.setCollarColor(par1NBTTagCompound.getByte("CollarColor")); - } - this.setCombatTask(); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityElemental.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityElemental.java index f07dc92c..765f851c 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityElemental.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityElemental.java @@ -341,7 +341,6 @@ public class EntityElemental extends EntityDemon public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setBoolean("Angry", this.isAngry()); par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor()); } @@ -353,11 +352,6 @@ public class EntityElemental extends EntityDemon super.readEntityFromNBT(par1NBTTagCompound); this.setAngry(par1NBTTagCompound.getBoolean("Angry")); - if (par1NBTTagCompound.hasKey("CollarColor")) - { - this.setCollarColor(par1NBTTagCompound.getByte("CollarColor")); - } - this.setCombatTask(); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFallenAngel.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFallenAngel.java index ff62e2d1..6bd801a9 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFallenAngel.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFallenAngel.java @@ -148,7 +148,6 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob { super.writeEntityToNBT(par1NBTTagCompound); par1NBTTagCompound.setBoolean("Angry", this.isAngry()); - par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor()); } /** @@ -159,11 +158,6 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob super.readEntityFromNBT(par1NBTTagCompound); this.setAngry(par1NBTTagCompound.getBoolean("Angry")); - if (par1NBTTagCompound.hasKey("CollarColor")) - { - this.setCollarColor(par1NBTTagCompound.getByte("CollarColor")); - } - this.setCombatTask(); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityIceDemon.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityIceDemon.java index 1e809dc8..fafe24b7 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityIceDemon.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityIceDemon.java @@ -149,7 +149,6 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob { super.writeEntityToNBT(par1NBTTagCompound); par1NBTTagCompound.setBoolean("Angry", this.isAngry()); - par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor()); } /** @@ -160,11 +159,6 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob super.readEntityFromNBT(par1NBTTagCompound); this.setAngry(par1NBTTagCompound.getBoolean("Angry")); - if (par1NBTTagCompound.hasKey("CollarColor")) - { - this.setCollarColor(par1NBTTagCompound.getByte("CollarColor")); - } - this.setCombatTask(); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityLowerGuardian.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityLowerGuardian.java index 366f136a..5d20a4e2 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityLowerGuardian.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityLowerGuardian.java @@ -134,7 +134,6 @@ public class EntityLowerGuardian extends EntityDemon { super.writeEntityToNBT(par1NBTTagCompound); par1NBTTagCompound.setBoolean("Angry", this.isAngry()); - par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor()); par1NBTTagCompound.setByte("attackTimer", (byte) attackTimer); par1NBTTagCompound.setBoolean("isAggro", this.isAggro()); } @@ -147,11 +146,6 @@ public class EntityLowerGuardian extends EntityDemon super.readEntityFromNBT(par1NBTTagCompound); this.setAngry(par1NBTTagCompound.getBoolean("Angry")); - if (par1NBTTagCompound.hasKey("CollarColor")) - { - this.setCollarColor(par1NBTTagCompound.getByte("CollarColor")); - } - attackTimer = par1NBTTagCompound.getByte("attackTimer"); isAggro = par1NBTTagCompound.getBoolean("isAggro"); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShade.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShade.java index b51bee98..068095a2 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShade.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShade.java @@ -139,7 +139,6 @@ public class EntityShade extends EntityDemon { super.writeEntityToNBT(par1NBTTagCompound); par1NBTTagCompound.setBoolean("Angry", this.isAngry()); - par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor()); } /** @@ -150,11 +149,6 @@ public class EntityShade extends EntityDemon super.readEntityFromNBT(par1NBTTagCompound); this.setAngry(par1NBTTagCompound.getBoolean("Angry")); - if (par1NBTTagCompound.hasKey("CollarColor")) - { - this.setCollarColor(par1NBTTagCompound.getByte("CollarColor")); - } - this.setCombatTask(); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntitySmallEarthGolem.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntitySmallEarthGolem.java index e0f45f6d..73e4e076 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntitySmallEarthGolem.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntitySmallEarthGolem.java @@ -147,7 +147,6 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM { super.writeEntityToNBT(par1NBTTagCompound); par1NBTTagCompound.setBoolean("Angry", this.isAngry()); - par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor()); } /** @@ -158,11 +157,6 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM super.readEntityFromNBT(par1NBTTagCompound); this.setAngry(par1NBTTagCompound.getBoolean("Angry")); - if (par1NBTTagCompound.hasKey("CollarColor")) - { - this.setCollarColor(par1NBTTagCompound.getByte("CollarColor")); - } - this.setCombatTask(); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWingedFireDemon.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWingedFireDemon.java index bf1d220e..804cdb65 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWingedFireDemon.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWingedFireDemon.java @@ -149,7 +149,6 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM { super.writeEntityToNBT(par1NBTTagCompound); par1NBTTagCompound.setBoolean("Angry", this.isAngry()); - par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor()); } /** @@ -160,11 +159,6 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM super.readEntityFromNBT(par1NBTTagCompound); this.setAngry(par1NBTTagCompound.getBoolean("Angry")); - if (par1NBTTagCompound.hasKey("CollarColor")) - { - this.setCollarColor(par1NBTTagCompound.getByte("CollarColor")); - } - this.setCombatTask(); } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/BloodMagicHarvestHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/BloodMagicHarvestHandler.java new file mode 100644 index 00000000..3d02140b --- /dev/null +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/BloodMagicHarvestHandler.java @@ -0,0 +1,127 @@ +package WayofTime.alchemicalWizardry.common.harvest; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.IPlantable; +import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; + +public class BloodMagicHarvestHandler implements IHarvestHandler +{ + public boolean canHandleBlock(Block block) + { + return block == Blocks.wheat || block == Blocks.carrots || block == Blocks.potatoes || block == Blocks.nether_wart; + } + + public int getHarvestMeta(Block block) + { + if(block == Blocks.wheat) + { + return 7; + } + if(block == Blocks.carrots) + { + return 7; + } + if(block == Blocks.potatoes) + { + return 7; + } + if(block == Blocks.nether_wart) + { + return 3; + } + return 7; + } + + @Override + public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta) + { + if(!this.canHandleBlock(block) || meta != this.getHarvestMeta(block)) + { + return false; + } + + IPlantable seed = this.getSeedItem(block); + + if(seed == null) + { + return false; + } + + int fortune = 0; + + List list = block.getDrops(world, xCoord, yCoord, zCoord, meta, fortune); + boolean foundAndRemovedSeed = false; + + for(ItemStack stack : list) + { + if(stack == null) + { + continue; + } + + Item item = stack.getItem(); + if(item == seed) + { + int itemSize = stack.stackSize; + if(itemSize > 1) + { + stack.stackSize--; + foundAndRemovedSeed = true; + break; + }else if(itemSize == 1) + { + list.remove(stack); + foundAndRemovedSeed = true; + break; + } + } + } + + if(foundAndRemovedSeed) + { + int plantMeta = seed.getPlantMetadata(world, xCoord, yCoord, zCoord); + Block plantBlock = seed.getPlant(world, xCoord, yCoord, zCoord); + + world.setBlock(xCoord, yCoord, zCoord, plantBlock, plantMeta, 3); + + for(ItemStack stack : list) + { + EntityItem itemEnt = new EntityItem(world, xCoord, yCoord, zCoord, stack); + + world.spawnEntityInWorld(itemEnt); + } + } + + return false; + } + + public IPlantable getSeedItem(Block block) + { + if(block == Blocks.wheat) + { + return (IPlantable) Items.wheat_seeds; + } + if(block == Blocks.carrots) + { + return (IPlantable) Items.carrot; + } + if(block == Blocks.potatoes) + { + return (IPlantable) Items.potato; + } + if(block == Blocks.nether_wart) + { + return (IPlantable) Items.nether_wart; + } + + return null; + } +} \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/GourdHarvestHandler.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/GourdHarvestHandler.java new file mode 100644 index 00000000..74624427 --- /dev/null +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/harvest/GourdHarvestHandler.java @@ -0,0 +1,45 @@ +package WayofTime.alchemicalWizardry.common.harvest; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.IPlantable; +import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; + +public class GourdHarvestHandler implements IHarvestHandler +{ + public boolean canHandleBlock(Block block) + { + return block == Blocks.melon_block || block == Blocks.pumpkin; + } + + @Override + public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta) + { + if(!this.canHandleBlock(block)) + { + return false; + } + + int fortune = 0; + + List list = block.getDrops(world, xCoord, yCoord, zCoord, meta, fortune); + + world.setBlockToAir(xCoord, yCoord, zCoord); + + for(ItemStack stack : list) + { + EntityItem itemEnt = new EntityItem(world, xCoord, yCoord, zCoord, stack); + + world.spawnEntityInWorld(itemEnt); + } + + return true; + } +} \ No newline at end of file diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemBloodRuneBlock.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemBloodRuneBlock.java index 420cc8c5..ba92cbae 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemBloodRuneBlock.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/ItemBloodRuneBlock.java @@ -41,11 +41,15 @@ public class ItemBloodRuneBlock extends ItemBlock break; case 3: - name = "test"; + name = "orb"; break; + case 4: + name = "betterCapacity"; + break; + default: - name = "broken"; + name = "broken"; } return getUnlocalizedName() + "." + name; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/spell/ItemSpellMultiTool.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/spell/ItemSpellMultiTool.java index f770c9dd..6f1806a1 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/spell/ItemSpellMultiTool.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/items/spell/ItemSpellMultiTool.java @@ -417,7 +417,7 @@ public class ItemSpellMultiTool extends Item @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { - par3List.add("Here's a 'Tool Tip' :D"); + par3List.add("A mace filled with ancient alchemy"); if (!(par1ItemStack.stackTagCompound == null)) { @@ -434,7 +434,7 @@ public class ItemSpellMultiTool extends Item par3List.add(""); float damage = this.getCustomItemAttack(par1ItemStack); par3List.add("\u00A79+" + ((int)(damage*10))/10.0f + " " + "Attack Damage"); - float critChance = ((int)(this.getCritChance(par1ItemStack)*1000))/10; + float critChance = ((int)(this.getCritChance(par1ItemStack)*1000))/10.0f; par3List.add("\u00A79+" + critChance + "% " + "Crit Chance"); } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHarvest.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHarvest.java new file mode 100644 index 00000000..e971c137 --- /dev/null +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHarvest.java @@ -0,0 +1,123 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.World; +import net.minecraftforge.common.IPlantable; +import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry; +import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; +import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; +import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; +import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class RitualEffectHarvest extends RitualEffect +{ + @Override + public void performEffect(IMasterRitualStone ritualStone) + { + String owner = ritualStone.getOwner(); + World worldSave = MinecraftServer.getServer().worldServers[0]; + LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner); + + if (data == null) + { + data = new LifeEssenceNetwork(owner); + worldSave.setItemData(owner, data); + } + + int currentEssence = data.currentEssence; + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); + int maxCount = 9; + + if (currentEssence < this.getCostPerRefresh() * maxCount) + { + EntityPlayer entityOwner = SpellHelper.getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + if (world.getWorldTime() % 20 != 0) + { + return; + } + + int flag = 0; + int range = 4; + + for (int i = -range; i <= range; i++) + { + for (int j = -range; j <= range; j++) + { + for(int k = -range; k<=range; k++) + { + if(HarvestRegistry.harvestBlock(world, x + i, y + j, z + k)) + { + flag++; + } + } + } + } + + if (flag > 0) + { + data.currentEssence = currentEssence - this.getCostPerRefresh() * Math.min(maxCount, flag); + data.markDirty(); + } + } + } + + @Override + public int getCostPerRefresh() + { + return 20; + } + + @Override + public List getRitualComponentList() + { + ArrayList harvestRitual = new ArrayList(); + + harvestRitual.add(new RitualComponent(1,0,1,RitualComponent.DUSK)); + harvestRitual.add(new RitualComponent(1,0,-1,RitualComponent.DUSK)); + harvestRitual.add(new RitualComponent(-1,0,-1,RitualComponent.DUSK)); + harvestRitual.add(new RitualComponent(-1,0,1,RitualComponent.DUSK)); + harvestRitual.add(new RitualComponent(2,0,0,RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(-2,0,0,RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(0,0,2,RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(0,0,-2,RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(3,0,1,RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(3,0,-1,RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(-3,0,1,RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(-3,0,-1,RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(1,0,3,RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(-1,0,3,RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(1,0,-3,RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(-1,0,-3,RitualComponent.EARTH)); + harvestRitual.add(new RitualComponent(2,0,3,RitualComponent.WATER)); + harvestRitual.add(new RitualComponent(3,0,2,RitualComponent.WATER)); + harvestRitual.add(new RitualComponent(2,0,-3,RitualComponent.WATER)); + harvestRitual.add(new RitualComponent(-3,0,2,RitualComponent.WATER)); + harvestRitual.add(new RitualComponent(-2,0,3,RitualComponent.WATER)); + harvestRitual.add(new RitualComponent(3,0,-2,RitualComponent.WATER)); + harvestRitual.add(new RitualComponent(-2,0,-3,RitualComponent.WATER)); + harvestRitual.add(new RitualComponent(-3,0,-2,RitualComponent.WATER)); + + + return harvestRitual; + } +} diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLifeConduit.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLifeConduit.java new file mode 100644 index 00000000..b7b93f4d --- /dev/null +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLifeConduit.java @@ -0,0 +1,180 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; +import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; +import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; +import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; + +public class RitualEffectLifeConduit extends RitualEffect +{ + @Override + public void performEffect(IMasterRitualStone ritualStone) + { + String owner = ritualStone.getOwner(); + World worldSave = MinecraftServer.getServer().worldServers[0]; + LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner); + + if (data == null) + { + data = new LifeEssenceNetwork(owner); + worldSave.setItemData(owner, data); + } + + int currentEssence = data.currentEssence; + World world = ritualStone.getWorld(); + int x = ritualStone.getXCoord(); + int y = ritualStone.getYCoord(); + int z = ritualStone.getZCoord(); + + TEAltar tileAltar = null; + boolean testFlag = false; + + for (int i = -5; i <= 5; i++) + { + for (int j = -5; j <= 5; j++) + { + for (int k = -10; k <= 10; k++) + { + if (world.getTileEntity(x + i, y + k, z + j) instanceof TEAltar) + { + tileAltar = (TEAltar) world.getTileEntity(x + i, y + k, z + j); + testFlag = true; + } + } + } + } + + if (!testFlag) + { + return; + } + + //tileAltar = (TEAltar)world.getBlockTileEntity(x,y-1,z); + int d0 = 15; + int vertRange = 20; + + EntityPlayer entityOwner = null; + List list = SpellHelper.getPlayersInRange(world, x, y, z, d0, vertRange); + + for(EntityPlayer player : list) + { + if(SpellHelper.getUsername(player).equals(owner)) + { + entityOwner = player; + } + } + + if (entityOwner == null) + { + return; + } + + int fillAmount = Math.min(currentEssence/2,tileAltar.fill(ForgeDirection.UP, new FluidStack(AlchemicalWizardry.lifeEssenceFluid,10000), false)); + + { + tileAltar.fill(ForgeDirection.UP, new FluidStack(AlchemicalWizardry.lifeEssenceFluid,fillAmount), true); + if(entityOwner.getHealth() > 2.0f && fillAmount != 0) + { + entityOwner.setHealth(2.0f); + } + data.currentEssence = currentEssence - fillAmount*2; + } + } + + @Override + public int getCostPerRefresh() + { + return 0; + } + + @Override + public List getRitualComponentList() + { + ArrayList conduitRitual = new ArrayList(); + + conduitRitual.add(new RitualComponent(-1,0,-1,RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(-1,0,1,RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(1,0,1,RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(1,0,-1,RitualComponent.FIRE)); + + for(int i=0; i<4; i++) + { + conduitRitual.add(new RitualComponent(-2,i,-2,RitualComponent.AIR)); + conduitRitual.add(new RitualComponent(-2,i,2,RitualComponent.AIR)); + conduitRitual.add(new RitualComponent(2,i,2,RitualComponent.AIR)); + conduitRitual.add(new RitualComponent(2,i,-2,RitualComponent.AIR)); + } + + conduitRitual.add(new RitualComponent(4,1,4,RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(4,1,-4,RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(-4,1,-4,RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(-4,1,4,RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(3,1,4,RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(4,1,3,RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(-3,1,4,RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(-4,1,3,RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(3,1,-4,RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(4,1,-3,RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(-3,1,-4,RitualComponent.EARTH)); + conduitRitual.add(new RitualComponent(-4,1,-3,RitualComponent.EARTH)); + + + for(int i=0; i<2; i++) + { + conduitRitual.add(new RitualComponent(4,i+2,4,RitualComponent.WATER)); + conduitRitual.add(new RitualComponent(4,i+2,-4,RitualComponent.WATER)); + conduitRitual.add(new RitualComponent(-4,i+2,-4,RitualComponent.WATER)); + conduitRitual.add(new RitualComponent(-4,i+2,4,RitualComponent.WATER)); + } + + conduitRitual.add(new RitualComponent(4,4,4,RitualComponent.DUSK)); + conduitRitual.add(new RitualComponent(4,4,-4,RitualComponent.DUSK)); + conduitRitual.add(new RitualComponent(-4,4,-4,RitualComponent.DUSK)); + conduitRitual.add(new RitualComponent(-4,4,4,RitualComponent.DUSK)); + + conduitRitual.add(new RitualComponent(6,0,5,RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(5,0,6,RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(-6,0,5,RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(-5,0,6,RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(6,0,-5,RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(5,0,-6,RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(-6,0,-5,RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(-5,0,-6,RitualComponent.FIRE)); + + for(int i=0; i<2; i++) + { + conduitRitual.add(new RitualComponent(6,i,6,RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(6,i,-6,RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(-6,i,6,RitualComponent.FIRE)); + conduitRitual.add(new RitualComponent(-6,i,-6,RitualComponent.FIRE)); + } + + for(int i=0; i<3; i++) + { + conduitRitual.add(new RitualComponent(6,i+2,6,RitualComponent.BLANK)); + conduitRitual.add(new RitualComponent(6,i+2,-6,RitualComponent.BLANK)); + conduitRitual.add(new RitualComponent(-6,i+2,6,RitualComponent.BLANK)); + conduitRitual.add(new RitualComponent(-6,i+2,-6,RitualComponent.BLANK)); + } + + conduitRitual.add(new RitualComponent(6,5,6,RitualComponent.DUSK)); + conduitRitual.add(new RitualComponent(6,5,-6,RitualComponent.DUSK)); + conduitRitual.add(new RitualComponent(-6,5,6,RitualComponent.DUSK)); + conduitRitual.add(new RitualComponent(-6,5,-6,RitualComponent.DUSK)); + + return conduitRitual; + } +} diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmTool.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmTool.java index a9390285..16b1498f 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmTool.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmTool.java @@ -48,6 +48,7 @@ public class SpellParadigmTool extends SpellParadigm private HashMap digSpeed; private HashMap maxDamageHash; private HashMap critChanceHash; + private HashMap durationHash; //ticks private HashMap toolInfoString; @@ -66,6 +67,8 @@ public class SpellParadigmTool extends SpellParadigm this.breakBlockEffectList = new LinkedList(); this.itemManipulatorEffectList = new LinkedList(); this.digAreaEffectList = new LinkedList(); + this.specialDamageEffectList = new LinkedList(); + this.durationHash = new HashMap(); this.toolInfoString = new HashMap(); this.critChanceHash = new HashMap(); @@ -73,12 +76,12 @@ public class SpellParadigmTool extends SpellParadigm this.maxDamage = 5; this.harvestLevel = new HashMap(); - this.harvestLevel.put("pickaxe", 2); + this.harvestLevel.put("pickaxe", -1); this.harvestLevel.put("shovel", -1); this.harvestLevel.put("axe", -1); this.digSpeed = new HashMap(); - this.digSpeed.put("pickaxe", 6.0f); + this.digSpeed.put("pickaxe", 1.0f); this.digSpeed.put("shovel", 1.0f); this.digSpeed.put("axe", 1.0f); @@ -88,7 +91,9 @@ public class SpellParadigmTool extends SpellParadigm this.fortuneLevel = 0; this.silkTouch = false; - this.duration = 2400; + this.duration = 0; + + this.durationHash.put("default", 2400); //this.addRightClickEffect(new RightClickTunnel(0,0,0)); @@ -178,6 +183,11 @@ public class SpellParadigmTool extends SpellParadigm itemTool.setToolListString(toolStack, toolStringList); + for(Integer integ : this.durationHash.values()) + { + this.duration += integ; + } + itemTool.setDuration(toolStack, world, this.duration); itemTool.loadParadigmIntoStack(toolStack, this.bufferedEffectList); @@ -453,6 +463,11 @@ public class SpellParadigmTool extends SpellParadigm this.critChanceHash.put(key, chance); } + public void addDuration(String key, int dur) + { + this.durationHash.put(key, dur); + } + public float getCritChance() { float chance = 0.0f; diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectEarth.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectEarth.java index 96e284b2..094d3fb4 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectEarth.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectEarth.java @@ -263,22 +263,18 @@ public class SpellEffectEarth extends SpellEffect @Override protected int getCostForOffenseTool() { - // TODO Auto-generated method stub - return 0; + return 1000; } - @Override protected int getCostForDefenseTool() { return (int)(1000 * (1 + this.potencyEnhancement*0.1f) * (1 + this.powerEnhancement*0.2f) * Math.pow(0.85, costEnhancement)); } - @Override protected int getCostForEnvironmentTool() { return (int)(10 * (1+this.potencyEnhancement*0.8) * Math.pow(1.5*this.powerEnhancement + 3, 2) * Math.pow(0.85, this.costEnhancement)); } - } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectFire.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectFire.java index 48595b37..a4027390 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectFire.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectFire.java @@ -17,6 +17,7 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fi import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfEnvironmentalFire; import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfOffensiveFire; import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ToolDefaultFire; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ToolEnvironmentalFire; import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ToolOffensiveFire; public class SpellEffectFire extends SpellEffect @@ -181,15 +182,21 @@ public class SpellEffectFire extends SpellEffect } @Override - public void defensiveModificationTool(SpellParadigmTool parad) { - // TODO Auto-generated method stub + public void defensiveModificationTool(SpellParadigmTool parad) + { + parad.addCritChance("defFire", this.potencyEnhancement); + parad.addDuration("defFire", 1200 * this.powerEnhancement); + + parad.addToolString("defFire", "Unbreaking" + " " + SpellHelper.getNumeralForInt(this.powerEnhancement + 1)); } @Override - public void environmentalModificationTool(SpellParadigmTool parad) { - // TODO Auto-generated method stub + public void environmentalModificationTool(SpellParadigmTool parad) + { + parad.addBlockBreakEffect(new ToolEnvironmentalFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + parad.addToolString("envFire", "Magma Plume" + " " + SpellHelper.getNumeralForInt(this.powerEnhancement + 1)); } @Override @@ -201,18 +208,18 @@ public class SpellEffectFire extends SpellEffect @Override protected int getCostForOffenseTool() { - return (int)(0); //TODO + return (int)(1000 * (1 + this.powerEnhancement*0.3f) * (1 + this.potencyEnhancement*0.2f) * Math.pow(0.85, costEnhancement)); } @Override - protected int getCostForDefenseTool() { - // TODO Auto-generated method stub - return 0; + protected int getCostForDefenseTool() + { + return (int)(500 * (1 + this.powerEnhancement*0.5f) * (1 + this.potencyEnhancement) * Math.pow(0.85, costEnhancement)); } @Override - protected int getCostForEnvironmentTool() { - // TODO Auto-generated method stub + protected int getCostForEnvironmentTool() + { return 0; } } diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ToolEnvironmentalFire.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ToolEnvironmentalFire.java new file mode 100644 index 00000000..cfa1aa8b --- /dev/null +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ToolEnvironmentalFire.java @@ -0,0 +1,47 @@ +package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.OnBreakBlockEffect; + +public class ToolEnvironmentalFire extends OnBreakBlockEffect +{ + public ToolEnvironmentalFire(int power, int potency, int cost) + { + super(power, potency, cost); + } + + @Override + public int onBlockBroken(ItemStack container, World world, EntityPlayer player, Block block, int meta, int x, int y, int z, ForgeDirection sideBroken) + { + int amount = 0; + int cost = (int)(250 * (1 - 0.1f*powerUpgrades) * Math.pow(0.85, costUpgrades)); + int radius = this.powerUpgrades; + float chance = 0.35f + 0.15f*this.potencyUpgrades; + + for(int i=-radius; i<=radius; i++) + { + for(int j=-radius; j<=radius; j++) + { + for(int k=-radius; k<=radius; k++) + { + Block blockAffected = world.getBlock(x + i -sideBroken.offsetX, y + j, z + k - sideBroken.offsetZ); + + if((new Random().nextFloat() <= chance) && (blockAffected == Blocks.gravel || blockAffected == Blocks.stone || blockAffected == Blocks.cobblestone)) + { + world.setBlock(x + i -sideBroken.offsetX, y + j, z + k - sideBroken.offsetZ, Blocks.lava); + amount += cost; + } + } + } + } + + return amount; + } +} diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java index b5c96375..5e7f1d3d 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java @@ -1,6 +1,5 @@ package WayofTime.alchemicalWizardry.common.tileEntity; -import WayofTime.alchemicalWizardry.api.tile.IBloodAltar; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; @@ -27,6 +26,7 @@ import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe; import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry; import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.api.tile.IBloodAltar; import WayofTime.alchemicalWizardry.common.NewPacketHandler; import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.AltarUpgradeComponent; import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars; @@ -867,11 +867,11 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui this.isUpgraded = checkUpgrade; this.upgradeLevel = upgradeState; - this.consumptionMultiplier = (float) (0.15 * upgrades.getSpeedUpgrades()); + this.consumptionMultiplier = (float) (0.20 * upgrades.getSpeedUpgrades()); this.efficiencyMultiplier = (float) Math.pow(0.85, upgrades.getSpeedUpgrades()); this.sacrificeEfficiencyMultiplier = (float) (0.10 * upgrades.getSacrificeUpgrades()); this.selfSacrificeEfficiencyMultiplier = (float) (0.10 * upgrades.getSelfSacrificeUpgrades()); - this.capacityMultiplier = (float) (1 + 0.15 * upgrades.getAltarCapacitiveUpgrades()); + this.capacityMultiplier = (float) ((1*Math.pow(1.10,upgrades.getBetterCapacitiveUpgrades()) + 0.20 * upgrades.getAltarCapacitiveUpgrades())); //TODO finalize values this.dislocationMultiplier = (float) (Math.pow(1.2, upgrades.getDisplacementUpgrades())); this.orbCapacityMultiplier = (float) (1 + 0.02 * upgrades.getOrbCapacitiveUpgrades()); diff --git a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEDemonPortal.java b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEDemonPortal.java index 457f05a5..9b6f08d6 100644 --- a/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEDemonPortal.java +++ b/1.7.10/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEDemonPortal.java @@ -36,6 +36,9 @@ import com.google.gson.GsonBuilder; public class TEDemonPortal extends TileEntity { + public static int buildingGridDelay = 25; + public static int roadGridDelay = 10; + public static List buildingList = new ArrayList(); public Random rand = new Random(); private GridSpace[][] area; @@ -47,6 +50,11 @@ public class TEDemonPortal extends TileEntity private boolean isInitialized; + public int houseCooldown; + public int roadCooldown; + public int tier; //Tier of the demon portal - Should select buildings 2 below to this + public int totalPoints; + public TEDemonPortal() { super(); @@ -71,6 +79,9 @@ public class TEDemonPortal extends TileEntity isInitialized = false; this.setGridSpace(0, 0, new GridSpace(GridSpace.MAIN_PORTAL, yCoord)); + + this.houseCooldown = 0; + this.roadCooldown = 0; } public void initialize() @@ -87,6 +98,9 @@ public class TEDemonPortal extends TileEntity if(Math.abs(xIndex) == 1 || Math.abs(zIndex) == 1) { this.setGridSpace(xIndex, zIndex, new GridSpace(GridSpace.ROAD,yCoord)); + }else if(xIndex == 0 && zIndex == 0) + { + this.setGridSpace(0, 0, new GridSpace(GridSpace.MAIN_PORTAL, yCoord)); }else { this.setGridSpace(xIndex, zIndex, new GridSpace()); @@ -94,9 +108,41 @@ public class TEDemonPortal extends TileEntity } } + this.houseCooldown = TEDemonPortal.buildingGridDelay; + this.roadCooldown = TEDemonPortal.roadGridDelay; + isInitialized = true; } + @Override + public void updateEntity() + { + if(!isInitialized) + { + return; + } + + if(this.roadCooldown <= 0) + { + int roadsMade = this.createRandomRoad(); + if(roadsMade > 0) + { + this.roadCooldown = TEDemonPortal.roadGridDelay * roadsMade; + } + } + else if(this.houseCooldown <= 0) + { + int gridsUsed = this.createRandomBuilding(0, 0); + if(gridsUsed > 0) + { + this.houseCooldown = TEDemonPortal.buildingGridDelay * gridsUsed; + } + } + + this.houseCooldown = Math.max(0, this.houseCooldown - 1); + this.roadCooldown = Math.max(0, this.roadCooldown - 1); + } + @Override public void readFromNBT(NBTTagCompound par1NBTTagCompound) { @@ -105,6 +151,8 @@ public class TEDemonPortal extends TileEntity this.negZRadius = par1NBTTagCompound.getInteger("negZRadius"); this.posXRadius = par1NBTTagCompound.getInteger("posXRadius"); this.posZRadius = par1NBTTagCompound.getInteger("posZRadius"); + this.houseCooldown = par1NBTTagCompound.getInteger("houseCooldown"); + this.roadCooldown = par1NBTTagCompound.getInteger("roadCooldown"); area = new GridSpace[negXRadius + posXRadius + 1][negZRadius + posZRadius + 1]; @@ -124,6 +172,9 @@ public class TEDemonPortal extends TileEntity } this.isInitialized = par1NBTTagCompound.getBoolean("init"); + + this.tier = par1NBTTagCompound.getInteger("tier"); + this.totalPoints = par1NBTTagCompound.getInteger("totalPoints"); } @Override @@ -134,6 +185,8 @@ public class TEDemonPortal extends TileEntity par1NBTTagCompound.setInteger("negZRadius", negZRadius); par1NBTTagCompound.setInteger("posXRadius", posXRadius); par1NBTTagCompound.setInteger("posZRadius", posZRadius); + par1NBTTagCompound.setInteger("houseCooldown", houseCooldown); + par1NBTTagCompound.setInteger("roadCooldown", roadCooldown); NBTTagList gridList = new NBTTagList(); @@ -161,9 +214,11 @@ public class TEDemonPortal extends TileEntity par1NBTTagCompound.setTag("Grid", gridList); par1NBTTagCompound.setBoolean("init", isInitialized); + par1NBTTagCompound.setInteger("tier", this.tier); + par1NBTTagCompound.setInteger("totalPoints", this.totalPoints); } - public void createRandomRoad() + public int createRandomRoad() //Return the number of road spaces { int next = rand.nextInt(4); ForgeDirection dir; @@ -200,7 +255,7 @@ public class TEDemonPortal extends TileEntity if(directions.size() <= 0) { - return; + return 0; } int maxDistance = 5; @@ -223,12 +278,14 @@ public class TEDemonPortal extends TileEntity if(dominantDirection == null) { - return; + return 0; } System.out.println("I got here!"); System.out.println("Distance: " + distance + " Direction: " + dominantDirection.toString() + " yLevel: " + yLevel); this.createGriddedRoad(x, yLevel, z, dominantDirection, distance+1, true); + + return distance; } public List findValidExtentionDirection(int x, int z) @@ -725,33 +782,35 @@ public class TEDemonPortal extends TileEntity { return; } - Int3 roadMarker = this.getNextRoadMarker(); this.initialize(); if(ForgeDirection.getOrientation(side) == ForgeDirection.UP) { this.createRandomBuilding(DemonBuilding.BUILDING_HOUSE, 0); + }else if(ForgeDirection.getOrientation(side) == ForgeDirection.DOWN) + { + this.createRandomBuilding(DemonBuilding.BUILDING_PORTAL, 0); }else { this.createRandomRoad(); } } - public void createRandomBuilding(int type, int tier) + public int createRandomBuilding(int type, int tier) { switch(type) { case DemonBuilding.BUILDING_HOUSE: - this.createRandomHouse(tier); - break; + return this.createRandomHouse(tier); case DemonBuilding.BUILDING_PORTAL: - this.createPortalBuilding(tier); - break; + return this.createPortalBuilding(tier); } + + return 0; } - public void createPortalBuilding(int buildingTier) + public int createPortalBuilding(int buildingTier) { int x = 0; int z = 0; @@ -766,7 +825,7 @@ public class TEDemonPortal extends TileEntity for(int i=2; i<6; i++) { ForgeDirection testDir = ForgeDirection.getOrientation(i); - if(this.getGridSpace(x + testDir.offsetX, z + testDir.offsetZ).isEmpty()) + //if(this.getGridSpace(x + testDir.offsetX, z + testDir.offsetZ).isEmpty()) { directions.add(testDir); } @@ -774,7 +833,7 @@ public class TEDemonPortal extends TileEntity if(directions.isEmpty()) { - return; + return 0; } HashMap> schemMap = new HashMap(); @@ -783,6 +842,10 @@ public class TEDemonPortal extends TileEntity { for(DemonBuilding build : TEDemonPortal.buildingList) { + if(build.buildingType != DemonBuilding.BUILDING_PORTAL) + { + continue; + } if(schemMap.containsKey(nextDir)) { schemMap.get(nextDir).add(build); @@ -796,7 +859,7 @@ public class TEDemonPortal extends TileEntity if(schemMap.keySet().isEmpty()) { - return; + return 0; } ForgeDirection chosenDirection = (ForgeDirection) schemMap.keySet().toArray()[new Random().nextInt(schemMap.keySet().size())]; @@ -820,9 +883,11 @@ public class TEDemonPortal extends TileEntity build.buildAll(worldObj, xCoord + (x)*5, yLevel, zCoord + (z)*5, chosenDirection.getOpposite()); build.setAllGridSpaces(x, z, yLevel, chosenDirection.getOpposite(), GridSpace.MAIN_PORTAL, grid); this.loadGSH(grid); + + return build.getNumberOfGridSpaces(); } - public void createRandomHouse(int buildingTier) + public int createRandomHouse(int buildingTier) { int next = rand.nextInt(4); ForgeDirection dir; @@ -845,8 +910,6 @@ public class TEDemonPortal extends TileEntity dir = ForgeDirection.NORTH; } - int length = 5; - boolean newProtocol = true; if(newProtocol) @@ -863,7 +926,7 @@ public class TEDemonPortal extends TileEntity if(!this.getGridSpace(x, z).isRoadSegment()) { - return; + return 0; } List directions = new ArrayList(); @@ -879,7 +942,7 @@ public class TEDemonPortal extends TileEntity if(directions.isEmpty()) { - return; + return 0; } HashMap> schemMap = new HashMap(); @@ -915,7 +978,7 @@ public class TEDemonPortal extends TileEntity if(schemMap.keySet().isEmpty()) { - return; + return 0; } ForgeDirection chosenDirection = (ForgeDirection) schemMap.keySet().toArray()[new Random().nextInt(schemMap.keySet().size())]; @@ -929,6 +992,8 @@ public class TEDemonPortal extends TileEntity build.buildAll(worldObj, xCoord + (x + xOff)*5, yLevel, zCoord + (z + zOff)*5, chosenDirection.getOpposite()); build.setAllGridSpaces(x + xOff, z + zOff, yLevel, chosenDirection.getOpposite(), GridSpace.HOUSE, grid); this.loadGSH(grid); + + return build.getNumberOfGridSpaces(); }else { Int3 space = findEmptySpaceNearRoad(dir, 3*(rand.nextInt(negXRadius + negZRadius + posXRadius + posZRadius))+1, 2); @@ -940,12 +1005,12 @@ public class TEDemonPortal extends TileEntity GridSpace newSpace = this.getGridSpace(x, z); if(!newSpace.isEmpty()) { - return; + return 0; } if(yLevel == -1) { - return; + return 0; } GridSpaceHolder grid = this.createGSH(); @@ -985,7 +1050,7 @@ public class TEDemonPortal extends TileEntity build = buildingList.get(new Random().nextInt(buildingList.size())); }else { - return; + return 0; } //TODO: Finish the selection algorythm //TODO: Should favour those directions that have a road right next to them. @@ -994,7 +1059,8 @@ public class TEDemonPortal extends TileEntity build.setAllGridSpaces(x, z, yLevel, chosenDirection, GridSpace.HOUSE, grid); this.loadGSH(grid); - System.out.println("X: " + x + " Z: " + z + " Direction: " + chosenDirection.toString()); + return build.getNumberOfGridSpaces(); +// System.out.println("X: " + x + " Z: " + z + " Direction: " + chosenDirection.toString()); } } @@ -1064,34 +1130,6 @@ public class TEDemonPortal extends TileEntity return 10; } - public Block getRoadMarker() - { - return ModBlocks.ritualStone; - } - - public Int3 getNextRoadMarker() - { - int horizSearchMax = 25; - int vertSearchMax = 10; - - for(int xPos=xCoord-horizSearchMax; xPos<=xCoord+horizSearchMax; xPos++) - { - for(int zPos=zCoord-horizSearchMax; zPos<=zCoord+horizSearchMax; zPos++) - { - for(int yPos=yCoord-vertSearchMax; yPos<=yCoord+vertSearchMax; yPos++) - { - Block block = worldObj.getBlock(xPos, yPos, zPos); - if(block == this.getRoadMarker()) - { - return new Int3(xPos,yPos,zPos); - } - } - } - } - - return null; - } - public int getRoadSpacer() { return 1; @@ -1150,4 +1188,14 @@ public class TEDemonPortal extends TileEntity } + + public int getTotalPoints() + { + return this.totalPoints; + } + + public void addToPoints(int addition) + { + this.totalPoints += addition; + } } diff --git a/1.7.10/main/resources/assets/alchemicalwizardry/lang/en_US.lang b/1.7.10/main/resources/assets/alchemicalwizardry/lang/en_US.lang index feb12464..778353db 100644 --- a/1.7.10/main/resources/assets/alchemicalwizardry/lang/en_US.lang +++ b/1.7.10/main/resources/assets/alchemicalwizardry/lang/en_US.lang @@ -3,7 +3,8 @@ tile.bloodAltar.name=Blood Altar tile.bloodRune.blank.name=Blood Rune tile.bloodRune.fill.name=Rune of Augmented Capacity tile.bloodRune.empty.name=Rune of Dislocation -tile.bloodRune.test.name=Rune of the Orb +tile.bloodRune.orb.name=Rune of the Orb +tile.bloodRune.betterCapacity.name=Rune of Superior Capacity tile.speedRune.name=Speed Rune tile.efficiencyRune.name=Efficiency Rune tile.runeOfSacrifice.name=Rune of Sacrifice @@ -25,6 +26,7 @@ tile.blockConduit.name=Spell Conduit tile.blockSpellParadigm.projectile.name=Particle Generator tile.blockSpellParadigm.self.name=Self Augmentator tile.blockSpellParadigm.melee.name=Melee Aggregator +tile.blockSpellParadigm.tool.name=Tool Forger tile.blockSpellEnhancement.power1.name=Unstable Spell Empowerer tile.blockSpellEnhancement.power2.name=Standard Spell Empowerer tile.blockSpellEnhancement.power3.name=Reinforced Spell Empowerer @@ -129,7 +131,7 @@ item.bloodLightSigil.name=Sigil of the Blood Lamp item.itemComplexSpellCrystal.name=Complex Spell Crystal item.itemSigilOfSupression.name=Sigil of Supression item.itemSigilOfEnderSeverance.name=Sigil of Ender Severance -item.bucketLive.name=Bucket of Life +item.bucketLife.name=Bucket of Life item.bloodMagicBaseItem.QuartzRod.name=Quartz Rod item.bloodMagicBaseItem.EmptyCore.name=Empty Core item.bloodMagicBaseItem.MagicalesCable.name=Magicales Cable @@ -138,6 +140,7 @@ item.bloodMagicBaseItem.StoneBrace.name=Stone Brace item.bloodMagicBaseItem.ProjectileCore.name=Projectile Core item.bloodMagicBaseItem.SelfCore.name=Self Core item.bloodMagicBaseItem.MeleeCore.name=Melee Core +item.bloodMagicBaseItem.ToolCore.name=Tool Core item.bloodMagicBaseItem.ParadigmBackPlate.name=Paradigm Plate item.bloodMagicBaseItem.OutputCable.name=Output Spell Cable item.bloodMagicBaseItem.InputCable.name=Input Spell Cable @@ -168,7 +171,7 @@ item.bloodMagicAlchemyItem.Potentia.name=Potentia item.sanguineHelmet.name=Sanguine Helmet item.itemSeerSigil.name=Sigil of Sight item.itemFluidSigil.name= - +item.multiTool.name=Dynamic Mace #Creative Tab itemGroup.tabBloodMagic=Blood Magic diff --git a/1.7.10/main/resources/assets/alchemicalwizardry/textures/blocks/BetterCapacityRune.png b/1.7.10/main/resources/assets/alchemicalwizardry/textures/blocks/BetterCapacityRune.png new file mode 100644 index 00000000..d28ef9bf Binary files /dev/null and b/1.7.10/main/resources/assets/alchemicalwizardry/textures/blocks/BetterCapacityRune.png differ diff --git a/1.7.10/main/resources/assets/alchemicalwizardry/textures/items/AlchemyFlask.png b/1.7.10/main/resources/assets/alchemicalwizardry/textures/items/AlchemyFlask.png deleted file mode 100644 index 690ed4bf..00000000 Binary files a/1.7.10/main/resources/assets/alchemicalwizardry/textures/items/AlchemyFlask.png and /dev/null differ diff --git a/1.7.10/main/resources/assets/alchemicalwizardry/textures/items/ElementalInkAir.png b/1.7.10/main/resources/assets/alchemicalwizardry/textures/items/ElementalInkAir.png deleted file mode 100644 index e7d3e1ff..00000000 Binary files a/1.7.10/main/resources/assets/alchemicalwizardry/textures/items/ElementalInkAir.png and /dev/null differ diff --git a/1.7.10/main/resources/assets/alchemicalwizardry/textures/items/ElementalInkEarth.png b/1.7.10/main/resources/assets/alchemicalwizardry/textures/items/ElementalInkEarth.png deleted file mode 100644 index ee69a93f..00000000 Binary files a/1.7.10/main/resources/assets/alchemicalwizardry/textures/items/ElementalInkEarth.png and /dev/null differ diff --git a/1.7.10/main/resources/assets/alchemicalwizardry/textures/items/ElementalInkFire.png b/1.7.10/main/resources/assets/alchemicalwizardry/textures/items/ElementalInkFire.png deleted file mode 100644 index 6f69f5ba..00000000 Binary files a/1.7.10/main/resources/assets/alchemicalwizardry/textures/items/ElementalInkFire.png and /dev/null differ diff --git a/1.7.10/main/resources/assets/alchemicalwizardry/textures/items/ElementalInkWater.png b/1.7.10/main/resources/assets/alchemicalwizardry/textures/items/ElementalInkWater.png deleted file mode 100644 index 35f17a0a..00000000 Binary files a/1.7.10/main/resources/assets/alchemicalwizardry/textures/items/ElementalInkWater.png and /dev/null differ diff --git a/1.7.10/main/resources/assets/alchemicalwizardry/textures/items/baseItemToolCore.png b/1.7.10/main/resources/assets/alchemicalwizardry/textures/items/baseItemToolCore.png new file mode 100644 index 00000000..f6dd600b Binary files /dev/null and b/1.7.10/main/resources/assets/alchemicalwizardry/textures/items/baseItemToolCore.png differ diff --git a/1.7.10/main/resources/assets/alchemicalwizardry/textures/models/SpellParadigmTool.png b/1.7.10/main/resources/assets/alchemicalwizardry/textures/models/SpellParadigmTool.png index 19b5ad22..4296e387 100644 Binary files a/1.7.10/main/resources/assets/alchemicalwizardry/textures/models/SpellParadigmTool.png and b/1.7.10/main/resources/assets/alchemicalwizardry/textures/models/SpellParadigmTool.png differ diff --git a/1.7.10/main/resources/assets/alchemicalwizardry/textures/models/baseItemToolCore.png b/1.7.10/main/resources/assets/alchemicalwizardry/textures/models/baseItemToolCore.png new file mode 100644 index 00000000..3c171d98 Binary files /dev/null and b/1.7.10/main/resources/assets/alchemicalwizardry/textures/models/baseItemToolCore.png differ diff --git a/1.7.2/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/1.7.2/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index cb6bd990..d84f732e 100644 --- a/1.7.2/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/1.7.2/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -130,6 +130,7 @@ import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock; import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; import WayofTime.alchemicalWizardry.common.tileEntity.gui.GuiHandler; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; @@ -187,6 +188,7 @@ public class AlchemicalWizardry public static boolean isForestryLoaded; public static boolean wimpySettings; + public static boolean respawnWithLowerHealth; public static CreativeTabs tabBloodMagic = new CreativeTabs("tabBloodMagic") { @@ -335,8 +337,9 @@ public class AlchemicalWizardry RecipeSorter.INSTANCE.register("AWWayofTime:shapedorb", ShapedBloodOrbRecipe.class, Category.SHAPED, "before:minecraft:shapeless"); RecipeSorter.INSTANCE.register("AWWayofTime:shapelessorb", ShapelessBloodOrbRecipe.class, Category.SHAPELESS, "after:minecraft:shapeless"); - //FMLCommonHandler.instance().bus().register(new AlchemicalWizardryEventHooks()); - MinecraftForge.EVENT_BUS.register(new AlchemicalWizardryEventHooks()); + Object eventHook = new AlchemicalWizardryEventHooks(); + FMLCommonHandler.instance().bus().register(eventHook); + MinecraftForge.EVENT_BUS.register(eventHook); NewPacketHandler.INSTANCE.ordinal(); } diff --git a/1.7.2/main/java/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java b/1.7.2/main/java/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java index b13dcdd9..8048f16c 100644 --- a/1.7.2/main/java/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java +++ b/1.7.2/main/java/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java @@ -1,11 +1,9 @@ package WayofTime.alchemicalWizardry; import java.io.File; -import java.util.logging.Level; import net.minecraftforge.common.config.Configuration; import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm; -import cpw.mods.fml.common.FMLLog; /** * Created with IntelliJ IDEA. @@ -64,7 +62,8 @@ public class BloodMagicConfiguration AlchemicalWizardry.allowedCrushedOresArray = config.get("oreCrushing", "allowedOres", new String[]{"iron","gold","copper","tin","lead","silver","osmium"}).getStringList(); AlchemicalWizardry.wimpySettings = config.get("WimpySettings","IDontLikeFun",false).getBoolean(false); - + AlchemicalWizardry.respawnWithLowerHealth = config.get("WimpySettings", "RespawnWithLowerHealth", true).getBoolean(true); + } catch (Exception e) { diff --git a/1.7.2/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java b/1.7.2/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java index e9e44451..0d91715d 100644 --- a/1.7.2/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java +++ b/1.7.2/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java @@ -23,7 +23,7 @@ public class HarvestRegistry for(IHarvestHandler handler : handlerList) { - if(handler.canHandleBlock(block) && handler.harvestAndPlant(world, xCoord, yCoord, zCoord, block, meta)) + if(handler.harvestAndPlant(world, xCoord, yCoord, zCoord, block, meta)) { return true; } diff --git a/1.7.2/main/java/WayofTime/alchemicalWizardry/api/harvest/IHarvestHandler.java b/1.7.2/main/java/WayofTime/alchemicalWizardry/api/harvest/IHarvestHandler.java index 88e47835..8e8d6ae5 100644 --- a/1.7.2/main/java/WayofTime/alchemicalWizardry/api/harvest/IHarvestHandler.java +++ b/1.7.2/main/java/WayofTime/alchemicalWizardry/api/harvest/IHarvestHandler.java @@ -6,11 +6,16 @@ import net.minecraftforge.common.IPlantable; public interface IHarvestHandler { - public boolean canHandleBlock(Block block); - - public int getHarvestMeta(Block block); - + /** + * A handler that is used to harvest and replant the block at the specified location + * + * @param world + * @param xCoord + * @param yCoord + * @param zCoord + * @param block block at this given location + * @param meta meta at this given location + * @return true if successfully harvested, false if not + */ public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta); - - public IPlantable getSeedItem(Block block); } diff --git a/1.7.2/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java b/1.7.2/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java index 281792d0..2dc42974 100644 --- a/1.7.2/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java +++ b/1.7.2/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java @@ -25,10 +25,7 @@ import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjecti import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import cpw.mods.fml.common.ObfuscationReflectionHelper; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent; -import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Type; -import cpw.mods.fml.relauncher.ReflectionHelper; +import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent; public class AlchemicalWizardryEventHooks { @@ -36,6 +33,15 @@ public class AlchemicalWizardryEventHooks public static Map playerBoostStepHeight = new HashMap(); public static List playersWith1Step = new ArrayList(); + @SubscribeEvent + public void onPlayerRespawnEvent(PlayerRespawnEvent event) + { + if(AlchemicalWizardry.respawnWithLowerHealth) + { + event.player.setHealth(6); + } + } + @SubscribeEvent public void onLivingJumpEvent(LivingJumpEvent event) { diff --git a/1.7.2/main/java/WayofTime/alchemicalWizardry/common/harvest/BloodMagicHarvestHandler.java b/1.7.2/main/java/WayofTime/alchemicalWizardry/common/harvest/BloodMagicHarvestHandler.java index ea35d92c..3d02140b 100644 --- a/1.7.2/main/java/WayofTime/alchemicalWizardry/common/harvest/BloodMagicHarvestHandler.java +++ b/1.7.2/main/java/WayofTime/alchemicalWizardry/common/harvest/BloodMagicHarvestHandler.java @@ -14,13 +14,11 @@ import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; public class BloodMagicHarvestHandler implements IHarvestHandler { - @Override public boolean canHandleBlock(Block block) { return block == Blocks.wheat || block == Blocks.carrots || block == Blocks.potatoes || block == Blocks.nether_wart; } - @Override public int getHarvestMeta(Block block) { if(block == Blocks.wheat) @@ -105,7 +103,6 @@ public class BloodMagicHarvestHandler implements IHarvestHandler return false; } - @Override public IPlantable getSeedItem(Block block) { if(block == Blocks.wheat) diff --git a/1.7.2/main/java/WayofTime/alchemicalWizardry/common/harvest/GourdHarvestHandler.java b/1.7.2/main/java/WayofTime/alchemicalWizardry/common/harvest/GourdHarvestHandler.java index 7870cf09..74624427 100644 --- a/1.7.2/main/java/WayofTime/alchemicalWizardry/common/harvest/GourdHarvestHandler.java +++ b/1.7.2/main/java/WayofTime/alchemicalWizardry/common/harvest/GourdHarvestHandler.java @@ -14,18 +14,11 @@ import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler; public class GourdHarvestHandler implements IHarvestHandler { - @Override public boolean canHandleBlock(Block block) { return block == Blocks.melon_block || block == Blocks.pumpkin; } - @Override - public int getHarvestMeta(Block block) - { - return 0; - } - @Override public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta) { @@ -47,12 +40,6 @@ public class GourdHarvestHandler implements IHarvestHandler world.spawnEntityInWorld(itemEnt); } - return false; - } - - @Override - public IPlantable getSeedItem(Block block) - { - return null; + return true; } } \ No newline at end of file