diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/1.7.2/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java new file mode 100644 index 00000000..6adbc972 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -0,0 +1,804 @@ +package WayofTime.alchemicalWizardry; + +import java.io.File; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.Item.ToolMaterial; +import net.minecraft.item.ItemArmor.ArmorMaterial; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraftforge.common.ChestGenHooks; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.EnumHelper; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.oredict.OreDictionary; +import WayofTime.alchemicalWizardry.common.AlchemicalWizardryEventHooks; +import WayofTime.alchemicalWizardry.common.AlchemicalWizardryFuelHandler; +import WayofTime.alchemicalWizardry.common.AlchemicalWizardryTickHandler; +import WayofTime.alchemicalWizardry.common.CommonProxy; +import WayofTime.alchemicalWizardry.common.EntityAirElemental; +import WayofTime.alchemicalWizardry.common.LifeBucketHandler; +import WayofTime.alchemicalWizardry.common.ModLivingDropsEvent; +import WayofTime.alchemicalWizardry.common.NewPacketHandler; +import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.PotionBoost; +import WayofTime.alchemicalWizardry.common.PotionDrowning; +import WayofTime.alchemicalWizardry.common.PotionFlameCloak; +import WayofTime.alchemicalWizardry.common.PotionFlight; +import WayofTime.alchemicalWizardry.common.PotionIceCloak; +import WayofTime.alchemicalWizardry.common.PotionInhibit; +import WayofTime.alchemicalWizardry.common.PotionProjectileProtect; +import WayofTime.alchemicalWizardry.common.PotionReciprocation; +import WayofTime.alchemicalWizardry.common.alchemy.AlchemicalPotionCreationHandler; +import WayofTime.alchemicalWizardry.common.alchemy.AlchemyRecipeRegistry; +import WayofTime.alchemicalWizardry.common.altarRecipeRegistry.AltarRecipeRegistry; +import WayofTime.alchemicalWizardry.common.block.ArmourForge; +import WayofTime.alchemicalWizardry.common.block.LifeEssenceBlock; +import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityBileDemon; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityBoulderFist; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityEarthElemental; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityFallenAngel; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityFireElemental; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityHolyElemental; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityIceDemon; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityLowerGuardian; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityShade; +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.items.ItemBloodRuneBlock; +import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner; +import WayofTime.alchemicalWizardry.common.items.ItemSpellEffectBlock; +import WayofTime.alchemicalWizardry.common.items.ItemSpellEnhancementBlock; +import WayofTime.alchemicalWizardry.common.items.ItemSpellModifierBlock; +import WayofTime.alchemicalWizardry.common.items.ItemSpellParadigmBlock; +import WayofTime.alchemicalWizardry.common.items.LifeBucket; +import WayofTime.alchemicalWizardry.common.items.forestry.ItemBloodFrame; +import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding; +import WayofTime.alchemicalWizardry.common.items.thaumcraft.ItemSanguineArmour; +import WayofTime.alchemicalWizardry.common.rituals.Rituals; +import WayofTime.alchemicalWizardry.common.spell.simple.HomSpellRegistry; +import WayofTime.alchemicalWizardry.common.spell.simple.SpellEarthBender; +import WayofTime.alchemicalWizardry.common.spell.simple.SpellExplosions; +import WayofTime.alchemicalWizardry.common.spell.simple.SpellFireBurst; +import WayofTime.alchemicalWizardry.common.spell.simple.SpellFrozenWater; +import WayofTime.alchemicalWizardry.common.spell.simple.SpellHolyBlast; +import WayofTime.alchemicalWizardry.common.spell.simple.SpellLightningBolt; +import WayofTime.alchemicalWizardry.common.spell.simple.SpellTeleport; +import WayofTime.alchemicalWizardry.common.spell.simple.SpellWateryGrave; +import WayofTime.alchemicalWizardry.common.spell.simple.SpellWindGust; +import WayofTime.alchemicalWizardry.common.summoning.SummoningHelper; +import WayofTime.alchemicalWizardry.common.summoning.SummoningRegistry; +import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEConduit; +import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import WayofTime.alchemicalWizardry.common.tileEntity.TEOrientable; +import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal; +import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth; +import WayofTime.alchemicalWizardry.common.tileEntity.TESocket; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEnhancementBlock; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellModifierBlock; +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; +import cpw.mods.fml.common.Mod.Instance; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.registry.EntityRegistry; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.LanguageRegistry; +import cpw.mods.fml.relauncher.Side; + +@Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v0.8.0") +//@NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = {"BloodAltar", "particle", "SetLifeEssence", "GetLifeEssence", "Ritual", "GetAltarEssence", "TESocket", "TEWritingTable", "CustomParticle", "SetPlayerVel", "SetPlayerPos", "TEPedestal", "TEPlinth", "TETeleposer", "InfiniteLPPath", "TEOrientor"}, packetHandler = PacketHandler.class) + +public class AlchemicalWizardry +{ + public static boolean doMeteorsDestroyBlocks = true; + public static String[] diamondMeteorArray; + public static int diamondMeteorRadius; + public static String[] stoneMeteorArray; + public static int stoneMeteorRadius; + public static String[] ironBlockMeteorArray; + public static int ironBlockMeteorRadius; + public static String[] netherStarMeteorArray; + public static int netherStarMeteorRadius; + + public static Potion customPotionDrowning; + public static Potion customPotionBoost; + public static Potion customPotionProjProt; + public static Potion customPotionInhibit; + public static Potion customPotionFlight; + public static Potion customPotionReciprocation; + public static Potion customPotionFlameCloak; + public static Potion customPotionIceCloak; + + public static int customPotionDrowningID; + public static int customPotionBoostID; + public static int customPotionProjProtID; + public static int customPotionInhibitID; + public static int customPotionFlightID; + public static int customPotionReciprocationID; + public static int customPotionFlameCloakID; + public static int customPotionIceCloakID; + + public static boolean isThaumcraftLoaded; + public static boolean isForestryLoaded; + + public static CreativeTabs tabBloodMagic = new CreativeTabs("tabBloodMagic") + { + @Override + public ItemStack getIconItemStack() + { + return new ItemStack(ModItems.weakBloodOrb, 1, 0); + } + + @Override + public Item getTabIconItem() + { + return ModItems.weakBloodOrb; + } + }; + + public static ToolMaterial bloodBoundToolMaterial = EnumHelper.addToolMaterial("BoundBlood", 4, 1000, 12.0f, 8.0f, 50); + public static ArmorMaterial sanguineArmourArmourMaterial = EnumHelper.addArmorMaterial("SanguineArmour", 1000, new int[]{3, 6, 5, 2}, 30); + + //Dungeon loot chances + public static int standardBindingAgentDungeonChance; + public static int mundanePowerCatalystDungeonChance; + public static int averagePowerCatalystDungeonChance; + public static int greaterPowerCatalystDungeonChance; + public static int mundaneLengtheningCatalystDungeonChance; + public static int averageLengtheningCatalystDungeonChance; + public static int greaterLengtheningCatalystDungeonChance; + + //Mob IDs + public static int entityFallenAngelID = 20; + public static int entityLowerGuardianID = 21; + public static int entityBileDemonID = 22; + public static int entityWingedFireDemonID = 23; + public static int entitySmallEarthGolemID = 24; + public static int entityIceDemonID = 25; + public static int entityBoulderFistID = 26; + public static int entityShadeID = 27; + public static int entityAirElementalID = 28; + public static int entityWaterElementalID = 29; + public static int entityEarthElementalID = 30; + public static int entityFireElementalID = 31; + public static int entityShadeElementalID = 32; + public static int entityHolyElementalID = 33; + + + public static Fluid lifeEssenceFluid; + + // The instance of your mod that Forge uses. + @Instance("AWWayofTime") + public static AlchemicalWizardry instance; + + // Says where the client and server 'proxy' code is loaded. + @SidedProxy(clientSide = "WayofTime.alchemicalWizardry.client.ClientProxy", serverSide = "WayofTime.alchemicalWizardry.common.CommonProxy") + public static CommonProxy proxy; + + @EventHandler + public void preInit(FMLPreInitializationEvent event) + { + MinecraftForge.EVENT_BUS.register(new LifeBucketHandler()); + BloodMagicConfiguration.init(new File(event.getModConfigurationDirectory(), "AWWayofTime.cfg")); + + //Custom config stuff goes here + + + Potion[] potionTypes = null; + + for (Field f : Potion.class.getDeclaredFields()) + { + f.setAccessible(true); + + try + { + if (f.getName().equals("potionTypes") || f.getName().equals("field_76425_a")) + { + Field modfield = Field.class.getDeclaredField("modifiers"); + modfield.setAccessible(true); + modfield.setInt(f, f.getModifiers() & ~Modifier.FINAL); + potionTypes = (Potion[]) f.get(null); + final Potion[] newPotionTypes = new Potion[256]; + System.arraycopy(potionTypes, 0, newPotionTypes, 0, potionTypes.length); + f.set(null, newPotionTypes); + } + } catch (Exception e) + { + System.err.println("Severe error, please report this to the mod author:"); + System.err.println(e); + } + } + ModBlocks.init(); + ModItems.init(); + + ModItems.registerItems(); + + FMLCommonHandler.instance().bus().register(new AlchemicalWizardryEventHooks()); + NewPacketHandler.INSTANCE.ordinal(); + } + + @EventHandler + public void load(FMLInitializationEvent event) + { + int craftingConstant = OreDictionary.WILDCARD_VALUE; + //TickRegistry.registerTickHandler(new AlchemicalWizardryTickHandler(), Side.SERVER); + + ModBlocks.registerBlocks(); + + //blocks + + + proxy.registerRenderers(); + proxy.registerEntities(); + //ItemStacks used for crafting go here + ItemStack lavaBucketStack = new ItemStack(Items.lava_bucket); + ItemStack cobblestoneStack = new ItemStack(Blocks.cobblestone); + ItemStack glassStack = new ItemStack(Blocks.glass, 1, craftingConstant); + ItemStack ironStack = new ItemStack(Items.iron_ingot); + ItemStack diamondStack = new ItemStack(Items.diamond, 1, craftingConstant); + ItemStack woolStack = new ItemStack(Blocks.wool); + ItemStack goldNuggetStack = new ItemStack(Items.gold_nugget); + ItemStack stoneStack = new ItemStack(Blocks.stone, 1, craftingConstant); + ItemStack redstoneStack = new ItemStack(Items.redstone); + ItemStack glowstoneBlockStack = new ItemStack(Blocks.glowstone); + ItemStack ironBlockStack = new ItemStack(Blocks.iron_block); + ItemStack waterBucketStack = new ItemStack(Items.water_bucket); + ItemStack emptyBucketStack = new ItemStack(Items.bucket); + ItemStack magmaCreamStack = new ItemStack(Items.magma_cream); + ItemStack stringStack = new ItemStack(Items.string); + ItemStack obsidianStack = new ItemStack(Blocks.obsidian); + ItemStack diamondSwordStack = new ItemStack(Items.diamond_sword); + ItemStack goldIngotStack = new ItemStack(Items.gold_ingot); + ItemStack cauldronStack = new ItemStack(Blocks.cauldron); + ItemStack furnaceStack = new ItemStack(Blocks.furnace); + ItemStack sugarStack = new ItemStack(Items.sugar); + ItemStack featherStack = new ItemStack(Items.feather); + ItemStack ghastTearStack = new ItemStack(Items.ghast_tear); + ItemStack ironPickaxeStack = new ItemStack(Items.iron_pickaxe); + ItemStack ironAxeStack = new ItemStack(Items.iron_axe); + ItemStack ironShovelStack = new ItemStack(Items.iron_shovel); + ItemStack glowstoneDustStack = new ItemStack(Items.glowstone_dust); + ItemStack saplingStack = new ItemStack(Blocks.sapling); + ItemStack reedStack = new ItemStack(Items.reeds); + ItemStack blankSlateStack = new ItemStack(ModItems.blankSlate, 1, craftingConstant); + //ItemStack glassShardStack = new ItemStack(glassShard); + ItemStack weakBloodOrbStackCrafted = new ItemStack(ModItems.weakBloodOrb); + //ItemStack bloodiedShardStack = new ItemStack(bloodiedShard); + ItemStack reinforcedSlateStack = new ItemStack(ModItems.reinforcedSlate, 1, craftingConstant); + ItemStack weakBloodOrbStack = new ItemStack(ModItems.weakBloodOrb, 1, craftingConstant); + ItemStack imbuedSlateStack = new ItemStack(ModItems.imbuedSlate, 1, craftingConstant); + ItemStack demonSlateStack = new ItemStack(ModItems.demonicSlate, 1, craftingConstant); + ItemStack apprenticeBloodOrbStack = new ItemStack(ModItems.apprenticeBloodOrb, 1, craftingConstant); + ItemStack magicianBloodOrbStack = new ItemStack(ModItems.magicianBloodOrb, 1, craftingConstant); + ItemStack waterSigilStackCrafted = new ItemStack(ModItems.waterSigil); + ItemStack lavaSigilStackCrafted = new ItemStack(ModItems.lavaSigil); + ItemStack voidSigilStackCrafted = new ItemStack(ModItems.voidSigil); + ItemStack airSigilStack = new ItemStack(ModItems.airSigil); + ItemStack lavaCrystalStackCrafted = new ItemStack(ModItems.lavaCrystal); + ItemStack lavaCrystalStack = new ItemStack(ModItems.lavaCrystal); + ItemStack energySwordStack = new ItemStack(ModItems.energySword); + ItemStack energyBlasterStack = new ItemStack(ModItems.energyBlaster); + ItemStack sacrificialDaggerStack = new ItemStack(ModItems.sacrificialDagger); + ItemStack bloodAltarStack = new ItemStack(ModBlocks.blockAltar); + ItemStack bloodRuneCraftedStack = new ItemStack(ModBlocks.bloodRune, 1); + ItemStack bloodRuneStack = new ItemStack(ModBlocks.bloodRune); + ItemStack speedRuneStack = new ItemStack(ModBlocks.speedRune); + ItemStack efficiencyRuneStack = new ItemStack(ModBlocks.efficiencyRune); + ItemStack runeOfSacrificeStack = new ItemStack(ModBlocks.runeOfSacrifice); + ItemStack runeOfSelfSacrificeStack = new ItemStack(ModBlocks.runeOfSelfSacrifice); + ItemStack miningSigilStackCrafted = new ItemStack(ModItems.sigilOfTheFastMiner); + ItemStack divinationSigilStackCrafted = new ItemStack(ModItems.divinationSigil); +// ItemStack elementalInkWaterStack = new ItemStack(elementalInkWater); +// ItemStack elementalInkFireStack = new ItemStack(elementalInkFire); +// ItemStack elementalInkEarthStack = new ItemStack(elementalInkEarth); +// ItemStack elementalInkAirStack = new ItemStack(elementalInkAir); + ItemStack waterScribeToolStack = new ItemStack(ModItems.waterScribeTool); + ItemStack fireScribeToolStack = new ItemStack(ModItems.fireScribeTool); + ItemStack earthScribeToolStack = new ItemStack(ModItems.earthScribeTool); + ItemStack airScribeToolStack = new ItemStack(ModItems.airScribeTool); + ItemStack ritualStoneStackCrafted = new ItemStack(ModBlocks.ritualStone, 4); + ItemStack ritualStoneStack = new ItemStack(ModBlocks.ritualStone); + ItemStack masterRitualStoneStack = new ItemStack(ModBlocks.blockMasterStone); + ItemStack imperfectRitualStoneStack = new ItemStack(ModBlocks.imperfectRitualStone); + ItemStack sigilOfElementalAffinityStackCrafted = new ItemStack(ModItems.sigilOfElementalAffinity); + ItemStack lavaSigilStack = new ItemStack(ModItems.lavaSigil); + ItemStack waterSigilStack = new ItemStack(ModItems.waterSigil); + ItemStack sigilOfHoldingStack = new ItemStack(ModItems.sigilOfHolding); + ItemStack weakBloodShardStack = new ItemStack(ModItems.weakBloodShard); + ItemStack emptySocketStack = new ItemStack(ModBlocks.emptySocket); + ItemStack bloodSocketStack = new ItemStack(ModBlocks.bloodSocket); + ItemStack armourForgeStack = new ItemStack(ModBlocks.armourForge); + ItemStack largeBloodStoneBrickStackCrafted = new ItemStack(ModBlocks.largeBloodStoneBrick, 32); + ItemStack largeBloodStoneBrickStack = new ItemStack(ModBlocks.largeBloodStoneBrick); + ItemStack bloodStoneBrickStackCrafted = new ItemStack(ModBlocks.bloodStoneBrick, 4); + ItemStack growthSigilStack = new ItemStack(ModItems.growthSigil); + ItemStack blockHomHeartStack = new ItemStack(ModBlocks.blockHomHeart); + ItemStack redWoolStack = new ItemStack(Blocks.wool, 1, 14); + ItemStack zombieHead = new ItemStack(Items.skull, 1, 2); + ItemStack simpleCatalystStack = new ItemStack(ModItems.simpleCatalyst); + ItemStack duskRitualDivinerStack = new ItemStack(ModItems.itemRitualDiviner); + ((ItemRitualDiviner) duskRitualDivinerStack.getItem()).setMaxRuneDisplacement(duskRitualDivinerStack, 1); + //weakBloodOrbStackCrafted.setItemDamage(weakBloodOrbStackCrafted.getMaxDamage()); + waterSigilStackCrafted.setItemDamage(waterSigilStackCrafted.getMaxDamage()); + lavaSigilStackCrafted.setItemDamage(lavaSigilStackCrafted.getMaxDamage()); + voidSigilStackCrafted.setItemDamage(voidSigilStackCrafted.getMaxDamage()); + lavaCrystalStackCrafted.setItemDamage(lavaCrystalStackCrafted.getMaxDamage()); + miningSigilStackCrafted.setItemDamage(miningSigilStackCrafted.getMaxDamage()); + sigilOfElementalAffinityStackCrafted.setItemDamage(sigilOfElementalAffinityStackCrafted.getMaxDamage()); + ItemStack archmageBloodOrbStack = new ItemStack(ModItems.archmageBloodOrb); + ItemStack sanctusStack = new ItemStack(ModItems.sanctus); + ItemStack aetherStack = new ItemStack(ModItems.aether); + ItemStack terraeStack = new ItemStack(ModItems.terrae); + ItemStack incendiumStack = new ItemStack(ModItems.incendium); + ItemStack tennebraeStack = new ItemStack(ModItems.tennebrae); + ItemStack aquasalusStack = new ItemStack(ModItems.aquasalus); + ItemStack crystallosStack = new ItemStack(ModItems.crystallos); + ItemStack crepitousStack = new ItemStack(ModItems.crepitous); + ItemStack magicalesStack = new ItemStack(ModItems.magicales); + //All crafting goes here + // GameRegistry.addRecipe(orbOfTestingStack, "x x", " ", "x x", 'x', cobblestoneStack); + //GameRegistry.addRecipe(glassShardStack, " x", "y ", 'x', ironStack, 'y', glassStack); + //GameRegistry.addRecipe(weakBloodOrbStackCrafted, "xxx", "xdx", "www", 'x', bloodiedShardStack, 'd', diamondStack, 'w', woolStack); + GameRegistry.addRecipe(sacrificialDaggerStack, "ggg", " dg", "i g", 'g', glassStack, 'd', goldIngotStack, 'i', ironStack); + //GameRegistry.addRecipe(blankSlateStack, "sgs", "gig", "sgs", 's', stoneStack, 'g', goldNuggetStack, 'i', ironStack); + //GameRegistry.addRecipe(reinforcedSlateStack, "rir", "ibi", "gig", 'r', redstoneStack, 'i', ironStack, 'b', blankSlateStack, 'g', glowstoneBlockStack); + GameRegistry.addRecipe(lavaCrystalStackCrafted, "glg", "lbl", "odo", 'g', glassStack, 'l', lavaBucketStack, 'b', weakBloodOrbStack, 'd', diamondStack, 'o', obsidianStack); + GameRegistry.addRecipe(waterSigilStackCrafted, "www", "wbw", "wow", 'w', waterBucketStack, 'b', blankSlateStack, 'o', weakBloodOrbStack); + GameRegistry.addRecipe(lavaSigilStackCrafted, "lml", "lbl", "lcl", 'l', lavaBucketStack, 'b', blankSlateStack, 'm', magmaCreamStack, 'c', lavaCrystalStack); + GameRegistry.addRecipe(voidSigilStackCrafted, "ese", "ere", "eoe", 'e', emptyBucketStack, 'r', reinforcedSlateStack, 'o', apprenticeBloodOrbStack, 's', stringStack); + GameRegistry.addRecipe(bloodAltarStack, "s s", "scs", "gdg", 's', stoneStack, 'c', furnaceStack, 'd', diamondStack, 'g', goldIngotStack); + //GameRegistry.addRecipe(energySwordStack, " o ", " o ", " s ", 'o', weakBloodOrbStack, 's', diamondSwordStack); + //GameRegistry.addRecipe(energyBlasterStack, "oi ", "gdi", " rd", 'o', weakBloodOrbStack, 'i', ironStack, 'd', diamondStack, 'r', reinforcedSlateStack, 'g', goldIngotStack); + GameRegistry.addRecipe(bloodRuneCraftedStack, "sss", "ror", "sss", 's', stoneStack, 'o', weakBloodOrbStack, 'r', blankSlateStack); + GameRegistry.addRecipe(speedRuneStack, "sbs", "uru", "sbs", 'u', sugarStack, 's', stoneStack, 'r', bloodRuneStack, 'b', blankSlateStack); + //GameRegistry.addRecipe(efficiencyRuneStack, "sbs", "rur", "sbs", 'r', redstoneStack, 's', stoneStack, 'u', bloodRuneStack,'b',blankSlateStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.bloodRune, 1, 1), "sbs", "bob", "srs", 's', stoneStack, 'o', magicianBloodOrbStack, 'b', emptyBucketStack, 'r', new ItemStack(ModItems.imbuedSlate)); + GameRegistry.addRecipe(new ItemStack(ModBlocks.bloodRune, 1, 2), "sbs", "bob", "srs", 's', stoneStack, 'o', magicianBloodOrbStack, 'b', waterBucketStack, 'r', new ItemStack(ModItems.imbuedSlate)); + GameRegistry.addRecipe(new ItemStack(ModBlocks.bloodRune, 1, 3), "sws", "ror", "sws", 's', stoneStack, 'o', new ItemStack(ModItems.masterBloodOrb), 'w', weakBloodOrbStack, 'r', new ItemStack(ModItems.demonicSlate)); + GameRegistry.addRecipe(airSigilStack, "fgf", "fsf", "fof", 'f', featherStack, 'g', ghastTearStack, 's', reinforcedSlateStack, 'o', apprenticeBloodOrbStack); + GameRegistry.addRecipe(miningSigilStackCrafted, "sps", "hra", "sos", 'o', apprenticeBloodOrbStack, 's', stoneStack, 'p', ironPickaxeStack, 'h', ironShovelStack, 'a', ironAxeStack, 'r', reinforcedSlateStack); + GameRegistry.addRecipe(runeOfSacrificeStack, "srs", "gog", "srs", 's', stoneStack, 'g', goldIngotStack, 'o', apprenticeBloodOrbStack, 'r', reinforcedSlateStack); + GameRegistry.addRecipe(runeOfSelfSacrificeStack, "srs", "gog", "srs", 's', stoneStack, 'g', glowstoneDustStack, 'o', apprenticeBloodOrbStack, 'r', reinforcedSlateStack); + GameRegistry.addRecipe(divinationSigilStackCrafted, "ggg", "gsg", "gog", 'g', glassStack, 's', blankSlateStack, 'o', weakBloodOrbStack); +// 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); +// GameRegistry.addRecipe(airScribeToolStack, "f", "i", 'f', featherStack, 'i', elementalInkAirStack); + GameRegistry.addRecipe(ritualStoneStackCrafted, "srs", "ror", "srs", 's', obsidianStack, 'o', apprenticeBloodOrbStack, 'r', reinforcedSlateStack); + GameRegistry.addRecipe(masterRitualStoneStack, "brb", "ror", "brb", 'b', obsidianStack, 'o', magicianBloodOrbStack, 'r', ritualStoneStack); + GameRegistry.addRecipe(imperfectRitualStoneStack, "bsb", "sos", "bsb", 's', stoneStack, 'b', obsidianStack, 'o', weakBloodOrbStack); + GameRegistry.addRecipe(sigilOfElementalAffinityStackCrafted, "oao", "wsl", "oro", 'o', obsidianStack, 'a', airSigilStack, 'w', waterSigilStack, 'l', lavaSigilStack, 'r', magicianBloodOrbStack, 's', imbuedSlateStack); + GameRegistry.addRecipe(sigilOfHoldingStack, "asa", "srs", "aoa", 'a', blankSlateStack, 's', stoneStack, 'r', imbuedSlateStack, 'o', magicianBloodOrbStack); + GameRegistry.addRecipe(emptySocketStack, "bgb", "gdg", "bgb", 'b', weakBloodShardStack, 'g', glassStack, 'd', diamondStack); + GameRegistry.addRecipe(armourForgeStack, "sfs", "fof", "sfs", 'f', bloodSocketStack, 's', stoneStack, 'o', magicianBloodOrbStack); + GameRegistry.addShapelessRecipe(largeBloodStoneBrickStackCrafted, weakBloodShardStack, stoneStack); + GameRegistry.addRecipe(bloodStoneBrickStackCrafted, "bb", "bb", 'b', largeBloodStoneBrickStack); + GameRegistry.addRecipe(growthSigilStack, "srs", "rer", "sos", 's', saplingStack, 'r', reedStack, 'o', apprenticeBloodOrbStack, 'e', reinforcedSlateStack); + GameRegistry.addRecipe(blockHomHeartStack, "www", "srs", "sos", 'w', redWoolStack, 's', stoneStack, 'r', bloodRuneStack, 'o', apprenticeBloodOrbStack); + GameRegistry.addShapelessRecipe(new ItemStack(Items.skull, 1, 2), new ItemStack(Items.skull, 1, 1), new ItemStack(Items.rotten_flesh), new ItemStack(Items.iron_ingot), new ItemStack(Items.leather)); + GameRegistry.addShapelessRecipe(new ItemStack(Items.skull, 1, 0), new ItemStack(Items.skull, 1, 1), new ItemStack(Items.bow, 1, 0), new ItemStack(Items.arrow, 1, 0), new ItemStack(Items.bone)); + GameRegistry.addShapelessRecipe(new ItemStack(Items.skull, 1, 4), new ItemStack(Items.skull, 1, 1), new ItemStack(Items.gunpowder), new ItemStack(Blocks.dirt), new ItemStack(Blocks.sand)); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockWritingTable), " s ", "ror", 's', new ItemStack(Items.brewing_stand), 'r', obsidianStack, 'o', weakBloodOrbStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockPedestal), "ooo", " c ", "ooo", 'o', obsidianStack, 'c', weakBloodShardStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockPlinth), "iii", " p ", "iii", 'i', ironBlockStack, 'p', new ItemStack(ModBlocks.blockPedestal)); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.alchemyFlask, 1, 0), new ItemStack(ModItems.alchemyFlask, 1, craftingConstant), new ItemStack(Items.nether_wart), redstoneStack, glowstoneDustStack); + GameRegistry.addRecipe(new ItemStack(ModItems.sigilOfHaste), "csc", "sts", "ror", 'c', new ItemStack(Items.cookie), 's', new ItemStack(Items.sugar), 't', ModItems.demonicSlate, 'r', obsidianStack, 'o', new ItemStack(ModItems.masterBloodOrb)); + GameRegistry.addRecipe(new ItemStack(ModItems.sigilOfWind), "faf", "grg", "fof", 'f', featherStack, 'g', ghastTearStack, 'a', new ItemStack(ModItems.airSigil), 'o', new ItemStack(ModItems.masterBloodOrb), 'r', ModItems.demonicSlate); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.weakBloodShard, 5, 0), new ItemStack(ModItems.masterBloodOrb), new ItemStack(ModItems.weakBloodShard), imbuedSlateStack); + GameRegistry.addRecipe(new ItemStack(ModBlocks.blockTeleposer), "ggg", "efe", "ggg", 'g', goldIngotStack, 'f', new ItemStack(ModItems.telepositionFocus), 'e', new ItemStack(Items.ender_pearl)); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.reinforcedTelepositionFocus), new ItemStack(ModItems.enhancedTelepositionFocus), new ItemStack(ModItems.weakBloodShard)); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.demonicTelepositionFocus), new ItemStack(ModItems.reinforcedTelepositionFocus), new ItemStack(ModItems.demonBloodShard)); + GameRegistry.addRecipe(new ItemStack(ModItems.sigilOfTheBridge), "nnn", "nsn", "ror", 'n', stoneStack, 'r', new ItemStack(Blocks.soul_sand), 's', imbuedSlateStack, 'o', magicianBloodOrbStack); + GameRegistry.addRecipe(new ItemStack(ModItems.armourInhibitor), " gg", "gsg", "gg ", 'g', goldIngotStack, 's', new ItemStack(ModItems.weakBloodShard)); + GameRegistry.addRecipe(new ItemStack(ModItems.itemRitualDiviner), "d1d", "2e3", "d4d", '1', new ItemStack(ModItems.airScribeTool), '2', new ItemStack(ModItems.waterScribeTool), '3', new ItemStack(ModItems.fireScribeTool), '4', new ItemStack(ModItems.earthScribeTool), 'd', diamondStack, 'e', new ItemStack(Items.emerald)); + GameRegistry.addRecipe(duskRitualDivinerStack, " d ", "srs", " d ", 'd', new ItemStack(ModItems.duskScribeTool), 's', new ItemStack(ModItems.demonicSlate), 'r', new ItemStack(ModItems.itemRitualDiviner)); + GameRegistry.addRecipe(new ItemStack(ModItems.sigilOfMagnetism), "bgb", "gsg", "bob", 'b', new ItemStack(Blocks.iron_block), 'g', goldIngotStack, 's', new ItemStack(ModItems.imbuedSlate), 'o', magicianBloodOrbStack); + GameRegistry.addRecipe(new ItemStack(ModItems.energyBazooka), "Ocd", "cb ", "d w", 'O', archmageBloodOrbStack, 'c', crepitousStack, 'b', new ItemStack(ModItems.energyBlaster), 'd', diamondStack, 'w', new ItemStack(ModItems.weakBloodShard)); + GameRegistry.addRecipe(new ItemStack(ModItems.itemBloodLightSigil), "btb", "sss", "bob", 'o', magicianBloodOrbStack, 'b', glowstoneBlockStack, 't', new ItemStack(Blocks.torch), 's', imbuedSlateStack); + GameRegistry.addRecipe(new ItemStack(ModItems.itemKeyOfDiablo), " gw", "gdg", "wg ", 'w', weakBloodShardStack, 'g', goldIngotStack, 'd', diamondStack); + customPotionDrowning = (new PotionDrowning(customPotionDrowningID, true, 0)).setIconIndex(0, 0).setPotionName("Drowning"); + customPotionBoost = (new PotionBoost(customPotionBoostID, false, 0)).setIconIndex(0, 0).setPotionName("Boost"); + customPotionProjProt = (new PotionProjectileProtect(customPotionProjProtID, false, 0)).setIconIndex(0, 0).setPotionName("Whirlwind"); + customPotionInhibit = (new PotionInhibit(customPotionInhibitID, false, 0)).setIconIndex(0, 0).setPotionName("Inhibit"); + customPotionFlight = (new PotionFlight(customPotionFlightID, false, 0)).setIconIndex(0, 0).setPotionName("Flight"); + customPotionReciprocation = (new PotionReciprocation(customPotionReciprocationID, false, 0xFFFFFF)).setIconIndex(0, 0).setPotionName("Reciprocation"); + customPotionFlameCloak = (new PotionFlameCloak(customPotionFlameCloakID,false,0).setIconIndex(0,0).setPotionName("Flame Cloak")); + customPotionIceCloak = (new PotionIceCloak(customPotionIceCloakID,false,0).setIconIndex(0,0).setPotionName("Ice Cloak")); + //All items registered go here + //LanguageRegistry.addName(orbOfTesting, "Orb of Testing"); + LanguageRegistry.addName(ModItems.weakBloodOrb, "Weak Blood Orb"); + LanguageRegistry.addName(ModItems.apprenticeBloodOrb, "Apprentice Blood Orb"); + LanguageRegistry.addName(ModItems.magicianBloodOrb, "Magician's Blood Orb"); + LanguageRegistry.addName(ModItems.archmageBloodOrb, "Archmage's Blood Orb"); + LanguageRegistry.addName(ModItems.energyBlaster, "Energy Blaster"); + LanguageRegistry.addName(ModItems.energySword, "Bound Blade"); + LanguageRegistry.addName(ModItems.lavaCrystal, "Lava Crystal"); + LanguageRegistry.addName(ModItems.waterSigil, "Water Sigil"); + LanguageRegistry.addName(ModItems.lavaSigil, "Lava Sigil"); + LanguageRegistry.addName(ModItems.voidSigil, "Void Sigil"); + //LanguageRegistry.addName(glassShard, "Glass Shard"); + //LanguageRegistry.addName(bloodiedShard, "Bloodied Shard"); + LanguageRegistry.addName(ModItems.blankSlate, "Blank Slate"); + LanguageRegistry.addName(ModItems.reinforcedSlate, "Reinforced Slate"); + LanguageRegistry.addName(ModItems.sacrificialDagger, "Sacrificial Knife"); + LanguageRegistry.addName(ModItems.daggerOfSacrifice, "Dagger of Sacrifice"); + LanguageRegistry.addName(ModItems.airSigil, "Air Sigil"); + LanguageRegistry.addName(ModItems.sigilOfTheFastMiner, "Sigil of the Fast Miner"); + LanguageRegistry.addName(ModItems.sigilOfElementalAffinity, "Sigil of Elemental Affinity"); + LanguageRegistry.addName(ModItems.sigilOfHaste, "Sigil of Haste"); + LanguageRegistry.addName(ModItems.sigilOfHolding, "Sigil of Holding"); + LanguageRegistry.addName(ModItems.growthSigil, "Sigil of the Green Grove"); +// LanguageRegistry.addName(elementalInkWater, "Elemental Ink: Water"); +// LanguageRegistry.addName(elementalInkFire, "Elemental Ink: Fire"); +// LanguageRegistry.addName(elementalInkEarth, "Elemental Ink: Earth"); +// LanguageRegistry.addName(elementalInkAir, "Elemental Ink: Air"); + LanguageRegistry.addName(ModItems.divinationSigil, "Divination Sigil"); + LanguageRegistry.addName(new ItemStack(ModItems.activationCrystal, 1, 0), "Weak Activation Crystal"); + LanguageRegistry.addName(new ItemStack(ModItems.activationCrystal, 1, 1), "Awakened Activation Crystal"); + LanguageRegistry.addName(ModItems.waterScribeTool, "Elemental Inscription Tool: Water"); + LanguageRegistry.addName(ModItems.fireScribeTool, "Elemental Inscription Tool: Fire"); + LanguageRegistry.addName(ModItems.earthScribeTool, "Elemental Inscription Tool: Earth"); + LanguageRegistry.addName(ModItems.airScribeTool, "Elemental Inscription Tool: Air"); + LanguageRegistry.addName(ModItems.boundPickaxe, "Bound Pickaxe"); + LanguageRegistry.addName(ModItems.boundAxe, "Bound Axe"); + LanguageRegistry.addName(ModItems.boundShovel, "Bound Shovel"); + LanguageRegistry.addName(ModItems.boundHelmet, "Bound Helmet"); + LanguageRegistry.addName(ModItems.boundPlate, "Bound Chestplate"); + LanguageRegistry.addName(ModItems.boundLeggings, "Bound Leggings"); + LanguageRegistry.addName(ModItems.boundBoots, "Bound Boots"); + LanguageRegistry.addName(ModItems.weakBloodShard, "Weak Blood Shard"); + LanguageRegistry.addName(ModItems.blankSpell, "Unbound Crystal"); + LanguageRegistry.addName(ModItems.masterBloodOrb, "Master Blood Orb"); + LanguageRegistry.addName(ModItems.alchemyFlask, "Potion Flask"); + LanguageRegistry.addName(ModItems.mundanePowerCatalyst, "Mundane Power Catalyst"); + LanguageRegistry.addName(ModItems.averagePowerCatalyst, "Average Power Catalyst"); + LanguageRegistry.addName(ModItems.greaterPowerCatalyst, "Greater Power Catalyst"); + LanguageRegistry.addName(ModItems.mundaneLengtheningCatalyst, "Mundane Lengthening Catalyst"); + LanguageRegistry.addName(ModItems.averageLengtheningCatalyst, "Average Lengthening Catalyst"); + LanguageRegistry.addName(ModItems.greaterLengtheningCatalyst, "Greater Lengthening Catalyst"); + LanguageRegistry.addName(ModItems.standardBindingAgent, "Standard Binding Agent"); + LanguageRegistry.addName(ModItems.incendium, "Incendium"); + LanguageRegistry.addName(ModItems.magicales, "Magicales"); + LanguageRegistry.addName(ModItems.sanctus, "Sanctus"); + LanguageRegistry.addName(ModItems.aether, "Aether"); + LanguageRegistry.addName(ModItems.simpleCatalyst, "Simple Catalyst"); + LanguageRegistry.addName(ModItems.crepitous, "Crepitous"); + LanguageRegistry.addName(ModItems.crystallos, "Crystallos"); + LanguageRegistry.addName(ModItems.terrae, "Terrae"); + LanguageRegistry.addName(ModItems.aquasalus, "Aquasalus"); + LanguageRegistry.addName(ModItems.tennebrae, "Tennebrae"); + LanguageRegistry.addName(ModItems.sigilOfWind, "Sigil of the Whirlwind"); + LanguageRegistry.addName(ModItems.telepositionFocus, "Teleposition Focus"); + LanguageRegistry.addName(ModItems.enhancedTelepositionFocus, "Enhanced Teleposition Focus"); + LanguageRegistry.addName(ModItems.reinforcedTelepositionFocus, "Reinforced Teleposition Focus"); + LanguageRegistry.addName(ModItems.demonicTelepositionFocus, "Demonic Teleposition Focus"); + LanguageRegistry.addName(ModItems.imbuedSlate, "Imbued Slate"); + LanguageRegistry.addName(ModItems.demonicSlate, "Demonic Slate"); + LanguageRegistry.addName(ModItems.duskScribeTool, "Elemental Inscription Tool: Dusk"); + LanguageRegistry.addName(ModItems.sigilOfTheBridge, "Sigil of the Phantom Bridge"); + LanguageRegistry.addName(ModItems.armourInhibitor, "Armour Inhibitor"); + LanguageRegistry.addName(ModItems.creativeFiller, "Orb of Testing"); + LanguageRegistry.addName(ModItems.weakFillingAgent, "Weak Filling Agent"); + LanguageRegistry.addName(ModItems.standardFillingAgent, "Standard Filling Agent"); + LanguageRegistry.addName(ModItems.enhancedFillingAgent, "Enhanced Filling Agent"); + LanguageRegistry.addName(ModItems.weakBindingAgent, "Weak Binding Agent"); + LanguageRegistry.addName(ModItems.itemRitualDiviner, "Ritual Diviner"); + LanguageRegistry.addName(ModItems.sigilOfMagnetism, "Sigil of Magnetism"); + LanguageRegistry.addName(ModItems.itemKeyOfDiablo, "Key of Binding"); + LanguageRegistry.addName(ModItems.energyBazooka, "Energy Bazooka"); + LanguageRegistry.addName(ModItems.itemBloodLightSigil, "Sigil of the Blood Lamp"); + LanguageRegistry.addName(ModItems.demonBloodShard, "Demon Blood Shard"); + //FluidStack lifeEssenceFluidStack = new FluidStack(lifeEssenceFluid, 1); + //LiquidStack lifeEssence = new LiquidStack(lifeEssenceFlowing, 1); + //LiquidDictionary.getOrCreateLiquid("Life Essence", lifeEssence); + FluidRegistry.registerFluid(lifeEssenceFluid); + ModBlocks.blockLifeEssence = new LifeEssenceBlock(); +// ModBlocks.blockLifeEssence.setUnlocalizedName("lifeEssenceBlock"); + FluidContainerRegistry.registerFluidContainer(lifeEssenceFluid, new ItemStack(ModItems.bucketLife), FluidContainerRegistry.EMPTY_BUCKET); + FluidRegistry.registerFluid(lifeEssenceFluid); + //lifeEssenceFluid.setUnlocalizedName("lifeEssence"); + //LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getLiquid("Life Essence", LiquidContainerRegistry.BUCKET_VOLUME), new ItemStack(AlchemicalWizardry.bucketLife), new ItemStack(Item.bucketEmpty))); + //GameRegistry.registerBlock(testingBlock, "testingBlock"); + //LanguageRegistry.addName(testingBlock, "Testing Block"); + //(testingBlock, "pickaxe", 0); + LanguageRegistry.addName(ModBlocks.blockAltar, "Blood Altar"); + LanguageRegistry.addName(ModBlocks.blockLifeEssence, "Life Essence"); + ModBlocks.blockAltar.setHarvestLevel("pickaxe", 1); + //Register Tile Entity + GameRegistry.registerTileEntity(TEAltar.class, "containerAltar"); + GameRegistry.registerTileEntity(TEMasterStone.class, "containerMasterStone"); + GameRegistry.registerTileEntity(TESocket.class, "containerSocket"); + GameRegistry.registerTileEntity(TEWritingTable.class, "containerWritingTable"); + GameRegistry.registerTileEntity(TEHomHeart.class, "containerHomHeart"); + GameRegistry.registerTileEntity(TEPedestal.class, "containerPedestal"); + GameRegistry.registerTileEntity(TEPlinth.class, "containerPlinth"); + GameRegistry.registerTileEntity(TETeleposer.class, "containerTeleposer"); + GameRegistry.registerTileEntity(TEConduit.class, "containerConduit"); + GameRegistry.registerTileEntity(TEOrientable.class, "containerOrientable"); + GameRegistry.registerTileEntity(TESpellParadigmBlock.class, "containerSpellParadigmBlock"); + GameRegistry.registerTileEntity(TESpellEffectBlock.class, "containerSpellEffectBlock"); + GameRegistry.registerTileEntity(TESpellModifierBlock.class, "containerSpellModifierBlock"); + GameRegistry.registerTileEntity(TESpellEnhancementBlock.class, "containerSpellEnhancementBlock"); + // + LanguageRegistry.addName(new ItemStack(ModBlocks.bloodRune, 1, 0), "Blood Rune"); + LanguageRegistry.addName(new ItemStack(ModBlocks.bloodRune, 1, 1), "Rune of Augmented Capacity"); + LanguageRegistry.addName(new ItemStack(ModBlocks.bloodRune, 1, 2), "Rune of Dislocation"); + LanguageRegistry.addName(new ItemStack(ModBlocks.bloodRune, 1, 3), "Rune of the Orb"); + //TODO + + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellParadigm, 1, 0), "Particle Generator"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellParadigm, 1, 1), "Self Augmentator"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellParadigm, 1, 2), "Melee Aggregator"); + + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 0), "Unstable Spell Empowerer"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 1), "Standard Spell Empowerer"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 2), "Reinforced Spell Empowerer"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 3), "Imbued Spell Empowerer"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 4), "Demonic Spell Empowerer"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 5), "Unstable Spell Dampener"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 6), "Standard Spell Dampener"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 7), "Reinforced Spell Dampener"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 8), "Imbued Spell Dampener"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 9), "Demonic Spell Dampener"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 10), "Unstable Spell Augmenter"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 11), "Standard Spell Augmenter"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 12), "Reinforced Spell Augmenter"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 13), "Imbued Spell Augmenter"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEnhancement, 1, 14), "Demonic Spell Augmenter"); + + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellModifier, 1, 0), "Default Spell Modifier"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellModifier, 1, 1), "Offensive Spell Modifier"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellModifier, 1, 2), "Defensive Spell Modifier"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellModifier, 1, 3), "Environmental Spell Modifier"); + + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEffect, 1, 0), "Crucible of Fire"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEffect, 1, 1), "Ice Maker"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEffect, 1, 2), "Wind Generator"); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEffect, 1, 3), "Earth Former"); + + LanguageRegistry.addName(ModBlocks.speedRune, "Speed Rune"); + LanguageRegistry.addName(ModBlocks.efficiencyRune, "Efficiency Rune"); + LanguageRegistry.addName(ModBlocks.runeOfSacrifice, "Rune of Sacrifice"); + LanguageRegistry.addName(ModBlocks.runeOfSelfSacrifice, "Rune of Self-sacrifice"); +// GameRegistry.registerBlock(lifeEssenceStill, "lifeEssenceStill"); +// GameRegistry.registerBlock(lifeEssenceFlowing, "lifeEssenceFlowing"); + //LanguageRegistry.addName(lifeEssenceStill, "Life Essence"); + LanguageRegistry.addName(ModItems.bucketLife, "Bucket of Life"); + LanguageRegistry.addName(ModBlocks.blockMasterStone, "Master Ritual Stone"); + LanguageRegistry.addName(ModBlocks.imperfectRitualStone, "Imperfect Ritual Stone"); + LanguageRegistry.addName(ModBlocks.ritualStone, "Ritual Stone"); + LanguageRegistry.addName(ModBlocks.armourForge, "Soul Armour Forge"); + LanguageRegistry.addName(ModBlocks.emptySocket, "Empty Socket"); + LanguageRegistry.addName(ModBlocks.bloodSocket, "Filled Socket"); + LanguageRegistry.addName(ModBlocks.bloodStoneBrick, "Bloodstone Brick"); + LanguageRegistry.addName(ModBlocks.largeBloodStoneBrick, "Large Bloodstone Brick"); + LanguageRegistry.addName(ModBlocks.blockHomHeart, "Spell Table"); + LanguageRegistry.addName(ModBlocks.blockPedestal, "Arcane Pedestal"); + LanguageRegistry.addName(ModBlocks.blockPlinth, "Arcane Plinth"); + LanguageRegistry.addName(ModBlocks.blockWritingTable, "Alchemic Chemistry Set"); + LanguageRegistry.addName(ModBlocks.blockTeleposer, "Teleposer"); + LanguageRegistry.addName(ModBlocks.spectralBlock, "Spectral Block"); + LanguageRegistry.addName(ModBlocks.blockBloodLight, "Blood Light"); + LanguageRegistry.addName(ModBlocks.blockConduit, "Spell Conduit"); + //TODO + + //GameRegistry.registerBlock(ModBlocks.blockSpellEffect,"blockSpellEffect"); + ModBlocks.bloodRune.setHarvestLevel("pickaxe", 2); + ModBlocks.speedRune.setHarvestLevel("pickaxe", 2); + ModBlocks.efficiencyRune.setHarvestLevel("pickaxe", 2); + ModBlocks.runeOfSacrifice.setHarvestLevel("pickaxe", 2); + ModBlocks.runeOfSelfSacrifice.setHarvestLevel("pickaxe", 2); + ModBlocks.ritualStone.setHarvestLevel("pickaxe", 2); + ModBlocks.bloodSocket.setHarvestLevel("pickaxe", 2); + ModBlocks.ritualStone.setHarvestLevel("pickaxe", 2); + ModBlocks.imperfectRitualStone.setHarvestLevel("pickaxe", 2); + ModBlocks.blockMasterStone.setHarvestLevel("pickaxe", 2); + ModBlocks.emptySocket.setHarvestLevel("pickaxe", 2); + ModBlocks.bloodStoneBrick.setHarvestLevel("pickaxe", 0); + ModBlocks.largeBloodStoneBrick.setHarvestLevel("pickaxe", 0); + ModBlocks.blockWritingTable.setHarvestLevel("pickaxe", 1); + ModBlocks.blockHomHeart.setHarvestLevel("pickaxe", 1); + ModBlocks.blockPedestal.setHarvestLevel("pickaxe", 2); + ModBlocks.blockPlinth.setHarvestLevel("pickaxe", 2); + ModBlocks.blockTeleposer.setHarvestLevel("pickaxe", 2); + //Fuel handler + GameRegistry.registerFuelHandler(new AlchemicalWizardryFuelHandler()); + //EntityRegistry.registerModEntity(EnergyBlastProjectile.class, "BlasterProj", 0, this, 128, 5, true); + proxy.registerEntityTrackers(); + //Gui registration + // NetworkRegistry.instance().registerGuiHandler(this, new GuiHandlerAltar()); + Rituals.loadRituals(); + UpgradedAltars.loadAltars(); + SigilOfHolding.initiateSigilOfHolding(); + ArmourForge.initializeRecipes(); + TEPlinth.initialize(); + AlchemicalPotionCreationHandler.initializePotions(); + AltarRecipeRegistry.initRecipes(); + //MinecraftForge.setToolClass(ModItems.boundPickaxe, "pickaxe", 5); + //MinecraftForge.setToolClass(ModItems.boundAxe, "axe", 5); + //MinecraftForge.setToolClass(ModItems.boundShovel, "shovel", 5); + FMLCommonHandler.instance().bus().register(new ModLivingDropsEvent()); + proxy.InitRendering(); + NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler()); +// ItemStack[] comp = new ItemStack[5]; +// for(int i=0;i<5;i++) +// { +// comp[i] = redstoneStack; +// } +// AlchemyRecipeRegistry.registerRecipe(glowstoneDustStack, 2, comp, 2); + //TODO NEW RECIPES! + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.weakBindingAgent), 10, new ItemStack[]{simpleCatalystStack, simpleCatalystStack, new ItemStack(Items.clay_ball)}, 2); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.standardBindingAgent), 15, new ItemStack[]{new ItemStack(ModItems.weakBindingAgent), sanctusStack, new ItemStack(ModItems.crystallos)}, 3); + AlchemyRecipeRegistry.registerRecipe(simpleCatalystStack, 2, new ItemStack[]{sugarStack, redstoneStack, redstoneStack, glowstoneDustStack, new ItemStack(Items.gunpowder)}, 1); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.incendium), 5, new ItemStack[]{lavaBucketStack, new ItemStack(Items.blaze_powder), new ItemStack(Items.blaze_powder), new ItemStack(Blocks.netherrack), simpleCatalystStack}, 1); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.aether), 5, new ItemStack[]{featherStack, featherStack, glowstoneDustStack, ghastTearStack, simpleCatalystStack}, 2); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.sanctus), 5, new ItemStack[]{glowstoneDustStack, new ItemStack(Items.gold_nugget), glowstoneDustStack, glassStack, simpleCatalystStack}, 2); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.crepitous), 5, new ItemStack[]{new ItemStack(Items.gunpowder), new ItemStack(Items.gunpowder), cobblestoneStack, cobblestoneStack, simpleCatalystStack}, 2); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.crystallos), 5, new ItemStack[]{new ItemStack(Blocks.ice), new ItemStack(Blocks.ice), new ItemStack(Blocks.snow), new ItemStack(Blocks.snow), simpleCatalystStack}, 2); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.terrae), 5, new ItemStack[]{new ItemStack(Blocks.dirt), new ItemStack(Blocks.sand), obsidianStack, obsidianStack, simpleCatalystStack}, 2); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.aquasalus), 5, new ItemStack[]{simpleCatalystStack, new ItemStack(Items.dye, 1, 0), new ItemStack(Items.potionitem, 1, 0), new ItemStack(Items.potionitem, 1, 0), new ItemStack(Items.potionitem, 1, 0)}, 2); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.tennebrae), 5, new ItemStack[]{simpleCatalystStack, new ItemStack(Items.coal), new ItemStack(Items.coal), new ItemStack(Blocks.obsidian), new ItemStack(Items.clay_ball)}, 2); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.magicales), 5, new ItemStack[]{redstoneStack, simpleCatalystStack, new ItemStack(Items.gunpowder), new ItemStack(Items.glowstone_dust), new ItemStack(Items.glowstone_dust)}, 2); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.mundanePowerCatalyst), 10, new ItemStack[]{glowstoneDustStack, glowstoneDustStack, glowstoneDustStack, new ItemStack(ModItems.weakBindingAgent), simpleCatalystStack}, 3); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.mundaneLengtheningCatalyst), 10, new ItemStack[]{redstoneStack, redstoneStack, redstoneStack, new ItemStack(ModItems.weakBindingAgent), simpleCatalystStack}, 3); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.averagePowerCatalyst), 20, new ItemStack[]{new ItemStack(ModItems.mundanePowerCatalyst), new ItemStack(ModItems.mundanePowerCatalyst), new ItemStack(ModItems.standardBindingAgent)}, 4); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.averageLengtheningCatalyst), 20, new ItemStack[]{new ItemStack(ModItems.mundaneLengtheningCatalyst), new ItemStack(ModItems.mundaneLengtheningCatalyst), new ItemStack(ModItems.standardBindingAgent)}, 4); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.greaterPowerCatalyst), 30, new ItemStack[]{new ItemStack(ModItems.averagePowerCatalyst), new ItemStack(ModItems.averagePowerCatalyst), new ItemStack(ModItems.incendium)}, 4); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.greaterLengtheningCatalyst), 30, new ItemStack[]{new ItemStack(ModItems.averageLengtheningCatalyst), new ItemStack(ModItems.averageLengtheningCatalyst), new ItemStack(ModItems.aquasalus)}, 4); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.weakFillingAgent), 5, new ItemStack[]{simpleCatalystStack, new ItemStack(Items.nether_wart), redstoneStack, glowstoneDustStack}, 3); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.standardFillingAgent), 10, new ItemStack[]{new ItemStack(ModItems.weakFillingAgent), new ItemStack(ModItems.terrae)}, 3); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.enhancedFillingAgent), 25, new ItemStack[]{new ItemStack(ModItems.standardFillingAgent), new ItemStack(ModItems.aquasalus), new ItemStack(ModItems.magicales)}, 4); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.activationCrystal, 1, 1), 100, new ItemStack[]{new ItemStack(ModItems.activationCrystal, 1, 0), new ItemStack(ModItems.demonBloodShard), incendiumStack, aquasalusStack, aetherStack}, 4); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.activationCrystal, 1, 1), 100, new ItemStack[]{new ItemStack(ModItems.activationCrystal, 1, 0), new ItemStack(Items.nether_star), incendiumStack, aquasalusStack, aetherStack}, 4); + HomSpellRegistry.registerBasicSpell(new ItemStack(Items.flint_and_steel), new SpellFireBurst()); + HomSpellRegistry.registerBasicSpell(new ItemStack(Blocks.ice), new SpellFrozenWater()); + HomSpellRegistry.registerBasicSpell(new ItemStack(Blocks.tnt), new SpellExplosions()); + HomSpellRegistry.registerBasicSpell(new ItemStack(ModItems.apprenticeBloodOrb), new SpellHolyBlast()); + HomSpellRegistry.registerBasicSpell(new ItemStack(Items.ghast_tear), new SpellWindGust()); + HomSpellRegistry.registerBasicSpell(new ItemStack(Items.glowstone_dust), new SpellLightningBolt()); + HomSpellRegistry.registerBasicSpell(new ItemStack(Items.water_bucket), new SpellWateryGrave()); + HomSpellRegistry.registerBasicSpell(new ItemStack(Blocks.obsidian), new SpellEarthBender()); + HomSpellRegistry.registerBasicSpell(new ItemStack(Items.ender_pearl), new SpellTeleport()); + SummoningRegistry.registerSummon(new SummoningHelper(this.entityFallenAngelID), new ItemStack[]{sanctusStack, sanctusStack, sanctusStack, aetherStack, tennebraeStack, terraeStack}, new ItemStack[]{}, new ItemStack[]{}, 0, 4); + SummoningRegistry.registerSummon(new SummoningHelper(this.entityLowerGuardianID), new ItemStack[]{cobblestoneStack, cobblestoneStack, terraeStack, tennebraeStack, new ItemStack(Items.iron_ingot), new ItemStack(Items.gold_nugget)}, new ItemStack[]{}, new ItemStack[]{}, 0, 4); + SummoningRegistry.registerSummon(new SummoningHelper(this.entityBileDemonID), new ItemStack[]{new ItemStack(Items.poisonous_potato), tennebraeStack, terraeStack, new ItemStack(Items.porkchop), new ItemStack(Items.egg), new ItemStack(Items.beef)}, new ItemStack[]{crepitousStack, crepitousStack, terraeStack, ironBlockStack, ironBlockStack, diamondStack}, new ItemStack[]{}, 0, 5); + SummoningRegistry.registerSummon(new SummoningHelper(this.entityWingedFireDemonID), new ItemStack[]{aetherStack, incendiumStack, incendiumStack, incendiumStack, tennebraeStack, new ItemStack(Blocks.netherrack)}, new ItemStack[]{diamondStack, new ItemStack(Blocks.gold_block), magicalesStack, magicalesStack, new ItemStack(Items.fire_charge), new ItemStack(Blocks.coal_block)}, new ItemStack[]{}, 0, 5); + SummoningRegistry.registerSummon(new SummoningHelper(this.entitySmallEarthGolemID), new ItemStack[]{new ItemStack(Items.clay_ball), terraeStack, terraeStack}, new ItemStack[]{}, new ItemStack[]{}, 0, 4); + SummoningRegistry.registerSummon(new SummoningHelper(this.entityIceDemonID), new ItemStack[]{crystallosStack, crystallosStack, aquasalusStack, crystallosStack, sanctusStack, terraeStack}, new ItemStack[]{}, new ItemStack[]{}, 0, 4); + SummoningRegistry.registerSummon(new SummoningHelper(this.entityBoulderFistID), new ItemStack[]{terraeStack, sanctusStack, tennebraeStack, new ItemStack(Items.bone), new ItemStack(Items.cooked_beef), new ItemStack(Items.cooked_beef)}, new ItemStack[]{}, new ItemStack[]{}, 0, 4); + SummoningRegistry.registerSummon(new SummoningHelper(this.entityShadeID), new ItemStack[]{tennebraeStack, tennebraeStack, tennebraeStack, aetherStack, glassStack, new ItemStack(Items.glass_bottle)}, new ItemStack[]{}, new ItemStack[]{}, 0, 4); + SummoningRegistry.registerSummon(new SummoningHelper(this.entityAirElementalID), new ItemStack[]{aetherStack, aetherStack, aetherStack, aetherStack, aetherStack, aetherStack}, new ItemStack[]{}, new ItemStack[]{}, 0, 4); + SummoningRegistry.registerSummon(new SummoningHelper(this.entityWaterElementalID), new ItemStack[]{aquasalusStack, aquasalusStack, aquasalusStack, aquasalusStack, aquasalusStack, aquasalusStack}, new ItemStack[]{}, new ItemStack[]{}, 0, 4); + SummoningRegistry.registerSummon(new SummoningHelper(this.entityEarthElementalID), new ItemStack[]{terraeStack, terraeStack, terraeStack, terraeStack, terraeStack, terraeStack}, new ItemStack[]{}, new ItemStack[]{}, 0, 4); + SummoningRegistry.registerSummon(new SummoningHelper(this.entityFireElementalID), new ItemStack[]{incendiumStack, incendiumStack, incendiumStack, incendiumStack, incendiumStack, incendiumStack}, new ItemStack[]{}, new ItemStack[]{}, 0, 4); + //TODO SummoningRegistry.registerSummon(new SummoningHelper(this.entityShadeElementalID), new ItemStack[]{tennebraeStack,tennebraeStack,tennebraeStack,tennebraeStack,tennebraeStack,tennebraeStack}, new ItemStack[]{}, new ItemStack[]{}, 0, 4); + SummoningRegistry.registerSummon(new SummoningHelper(this.entityHolyElementalID), new ItemStack[]{sanctusStack, sanctusStack, sanctusStack, sanctusStack, sanctusStack, sanctusStack}, new ItemStack[]{}, new ItemStack[]{}, 0, 4); + //Custom mobs + EntityRegistry.registerModEntity(EntityFallenAngel.class, "FallenAngel", this.entityFallenAngelID, this, 80, 3, true); + EntityRegistry.registerModEntity(EntityLowerGuardian.class, "LowerGuardian", this.entityLowerGuardianID, this, 80, 3, true); + EntityRegistry.registerModEntity(EntityBileDemon.class, "BileDemon", this.entityBileDemonID, this, 80, 3, true); + EntityRegistry.registerModEntity(EntityWingedFireDemon.class, "WingedFireDemon", this.entityWingedFireDemonID, this, 80, 3, true); + EntityRegistry.registerModEntity(EntitySmallEarthGolem.class, "SmallEarthGolem", this.entitySmallEarthGolemID, this, 80, 3, true); + EntityRegistry.registerModEntity(EntityIceDemon.class, "IceDemon", this.entityIceDemonID, this, 80, 3, true); + EntityRegistry.registerModEntity(EntityBoulderFist.class, "BoulderFist", this.entityBoulderFistID, this, 80, 3, true); + EntityRegistry.registerModEntity(EntityShade.class, "Shade", this.entityShadeID, this, 80, 3, true); + EntityRegistry.registerModEntity(EntityAirElemental.class, "AirElemental", this.entityAirElementalID, this, 120, 3, true); + EntityRegistry.registerModEntity(EntityWaterElemental.class, "WaterElemental", this.entityWaterElementalID, this, 120, 3, true); + EntityRegistry.registerModEntity(EntityEarthElemental.class, "EarthElemental", this.entityEarthElementalID, this, 120, 3, true); + EntityRegistry.registerModEntity(EntityFireElemental.class, "FireElemental", this.entityFireElementalID, this, 120, 3, true); + EntityRegistry.registerModEntity(EntityShadeElemental.class, "ShadeElemental", this.entityShadeElementalID, this, 120, 3, true); + EntityRegistry.registerModEntity(EntityHolyElemental.class, "HolyElemental", this.entityHolyElementalID, this, 120, 3, true); + //EntityRegistry.addSpawn(EntityFallenAngel.class, 5, 1, 5, EnumCreatureType.creature, BiomeGenBase.biomeList); + LanguageRegistry.instance().addStringLocalization("entity.AlchemicalWizardry.FallenAngel.name", "en_US", "Fallen Angel"); + LanguageRegistry.instance().addStringLocalization("entity.AlchemicalWizardry.LowerGuardian.name", "en_US", "Lower Stone Guardian"); + LanguageRegistry.instance().addStringLocalization("entity.AlchemicalWizardry.BileDemon.name", "en_US", "Bile Demon"); + LanguageRegistry.instance().addStringLocalization("entity.AlchemicalWizardry.WingedFireDemon.name", "en_US", "Winged Fire Demon"); + LanguageRegistry.instance().addStringLocalization("entity.AlchemicalWizardry.SmallEarthGolem.name", "en_US", "Small Earth Golem"); + LanguageRegistry.instance().addStringLocalization("entity.AlchemicalWizardry.IceDemon.name", "en_US", "Ice Demon"); + LanguageRegistry.instance().addStringLocalization("entity.AlchemicalWizardry.BoulderFist.name", "en_US", "Boulder Fist"); + LanguageRegistry.instance().addStringLocalization("entity.AlchemicalWizardry.Shade.name", "en_US", "Shade"); + LanguageRegistry.instance().addStringLocalization("entity.AlchemicalWizardry.AirElemental.name", "en_US", "Air Elemental"); + LanguageRegistry.instance().addStringLocalization("entity.AlchemicalWizardry.WaterElemental.name", "en_US", "Water Elemental"); + LanguageRegistry.instance().addStringLocalization("entity.AlchemicalWizardry.EarthElemental.name", "en_US", "Earth Elemental"); + LanguageRegistry.instance().addStringLocalization("entity.AlchemicalWizardry.FireElemental.name", "en_US", "Fire Elemental"); + LanguageRegistry.instance().addStringLocalization("entity.AlchemicalWizardry.ShadeElemental.name", "en_US", "Shade Elemental"); + LanguageRegistry.instance().addStringLocalization("entity.AlchemicalWizardry.HolyElemental.name", "en_US", "Holy Elemental"); + LanguageRegistry.instance().addStringLocalization("itemGroup.tabBloodMagic", "en_US", "Blood Magic"); + ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ModItems.standardBindingAgent), 1, 3, this.standardBindingAgentDungeonChance)); + ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ModItems.mundanePowerCatalyst), 1, 1, this.mundanePowerCatalystDungeonChance)); + ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ModItems.mundaneLengtheningCatalyst), 1, 1, this.mundaneLengtheningCatalystDungeonChance)); + ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ModItems.averagePowerCatalyst), 1, 1, this.averagePowerCatalystDungeonChance)); + ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ModItems.averageLengtheningCatalyst), 1, 1, this.averageLengtheningCatalystDungeonChance)); + ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ModItems.greaterPowerCatalyst), 1, 1, this.greaterPowerCatalystDungeonChance)); + ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ModItems.greaterLengtheningCatalyst), 1, 1, this.greaterLengtheningCatalystDungeonChance)); + //Ore Dictionary Registration + OreDictionary.registerOre("oreCoal", Blocks.coal_ore); + MeteorRegistry.registerMeteorParadigm(diamondStack, diamondMeteorArray, diamondMeteorRadius); + MeteorRegistry.registerMeteorParadigm(stoneStack, this.stoneMeteorArray, this.stoneMeteorRadius); + MeteorRegistry.registerMeteorParadigm(ironBlockStack, this.ironBlockMeteorArray, this.ironBlockMeteorRadius); + MeteorRegistry.registerMeteorParadigm(new ItemStack(Items.nether_star), this.netherStarMeteorArray, this.netherStarMeteorRadius); +// sanguineHelmet = new ItemSanguineArmour(sanguineHelmetItemID).setUnlocalizedName("sanguineHelmet"); +// +// LanguageRegistry.addName(sanguineHelmet,"Sanguine Helmet"); + } + + @EventHandler + public void postInit(FMLPostInitializationEvent event) + { + //TODO Thaumcraft Integration + if (Loader.isModLoaded("Thaumcraft")) + { + this.isThaumcraftLoaded = true; + +// try +// { +// //do stuff +// ModItems.sanguineHelmet = new ItemSanguineArmour(sanguineHelmetItemID).setUnlocalizedName("sanguineHelmet"); +// LanguageRegistry.addName(ModItems.sanguineHelmet, "Sanguine Helmet"); +//// focusBloodBlast = new FocusBloodBlast(focusBloodBlastItemID); +//// LanguageRegistry.addName(focusBloodBlast,"Wand Focus: Blood Blast"); +//// +//// focusGravityWell = new FocusGravityWell(focusGravityWellItemID); +//// LanguageRegistry.addName(focusGravityWell,"Wand Focus: Gravity Well"); +// ItemStack itemGoggles = ItemApi.getItem("itemGoggles", 0); +// +// if (itemGoggles != null) +// { +// //GameRegistry.addShapelessRecipe(new ItemStack(this.sanguineHelmet), itemGoggles); +// } +// +// //LogHelper.log(Level.INFO, "Loaded RP2 World addon"); +// } catch (Exception e) +// { +// //LogHelper.log(Level.SEVERE, "Could not load RP2 World addon"); +// e.printStackTrace(System.err); +// } + } else + { + this.isThaumcraftLoaded = false; + } + + if(Loader.isModLoaded("Forestry")) + { + this.isForestryLoaded = true; + +// ModItems.itemBloodFrame = new ItemBloodFrame(this.itemBloodFrameItemID).setUnlocalizedName("bloodFrame"); +// +// ItemStack provenFrame = GameRegistry.findItemStack("Forestry", "frameImpregnated", 1); +// +// if(provenFrame !=null) +// { +// AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.itemBloodFrame), provenFrame, 3, 30000, 20, 20, false); +// } + }else + { + this.isForestryLoaded = false; + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java b/1.7.2/java/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java new file mode 100644 index 00000000..59b4e98a --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java @@ -0,0 +1,209 @@ +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. + * User: Pokefenn + * Date: 17/01/14 + * Time: 19:50 + */ +public class BloodMagicConfiguration +{ + + + public static Configuration config; + public static final String CATEGORY_GAMEPLAY = "gameplay"; + + + public static void init(File configFile) + { + + config = new Configuration(configFile); + + try + { + + config.load(); + + AlchemicalWizardry.standardBindingAgentDungeonChance = config.get("Dungeon Loot Chances", "standardBindingAgent", 30).getInt(); + AlchemicalWizardry.mundanePowerCatalystDungeonChance = config.get("Dungeon Loot Chances", "mundanePowerCatalyst", 20).getInt(); + AlchemicalWizardry.averagePowerCatalystDungeonChance = config.get("Dungeon Loot Chances", "averagePowerCatalyst", 10).getInt(); + AlchemicalWizardry.greaterPowerCatalystDungeonChance = config.get("Dungeon Loot Chances", "greaterPowerCatalyst", 05).getInt(); + AlchemicalWizardry.mundaneLengtheningCatalystDungeonChance = config.get("Dungeon Loot Chances", "mundaneLengtheningCatalyst", 20).getInt(); + AlchemicalWizardry.averageLengtheningCatalystDungeonChance = config.get("Dungeon Loot Chances", "averageLengtheningCatalyst", 10).getInt(); + AlchemicalWizardry.greaterLengtheningCatalystDungeonChance = config.get("Dungeon Loot Chances", "greaterLengtheningCatalyst", 05).getInt(); + AlchemicalWizardry.customPotionDrowningID = config.get("Potion ID", "Drowning", 100).getInt(); + AlchemicalWizardry.customPotionBoostID = config.get("Potion ID", "Boost", 101).getInt(); + AlchemicalWizardry.customPotionProjProtID = config.get("Potion ID", "ProjProt", 102).getInt(); + AlchemicalWizardry.customPotionInhibitID = config.get("Potion ID", "Inhibit", 103).getInt(); + AlchemicalWizardry.customPotionFlightID = config.get("Potion ID", "Flight", 104).getInt(); + AlchemicalWizardry.customPotionReciprocationID = config.get("Potion ID", "Reciprocation", 105).getInt(); + AlchemicalWizardry.customPotionFlameCloakID = config.get("Potion ID","FlameCloak",106).getInt(); + AlchemicalWizardry.customPotionIceCloakID = config.get("Potion ID","IceCloak",107).getInt(); + + MeteorParadigm.maxChance = config.get("meteor", "maxChance", 1000).getInt(); + AlchemicalWizardry.doMeteorsDestroyBlocks = config.get("meteor", "doMeteorsDestroyBlocks", true).getBoolean(true); + AlchemicalWizardry.diamondMeteorArray = config.get("meteor", "diamondMeteor", new String[]{"oreDiamond", "100", "oreEmerald", "75", "oreCinnabar", "200", "oreAmber", "200"}).getStringList(); + AlchemicalWizardry.diamondMeteorRadius = config.get("meteor", "diamondMeteorRadius", 5).getInt(); + AlchemicalWizardry.stoneMeteorArray = config.get("meteor", "stoneBlockMeteor", new String[]{"oreCoal", "150", "oreApatite", "50", "oreIron", "50"}).getStringList(); + AlchemicalWizardry.stoneMeteorRadius = config.get("meteor", "stoneMeteorRadius", 16).getInt(); + AlchemicalWizardry.ironBlockMeteorArray = config.get("meteor", "ironBlockMeteor", new String[]{"oreIron", "400", "oreGold", "30", "oreCopper", "200", "oreTin", "140", "oreSilver", "70", "oreLead", "80", "oreLapis", "60", "oreRedstone", "100"}).getStringList(); + AlchemicalWizardry.ironBlockMeteorRadius = config.get("meteor", "ironBlockMeteorRadius", 7).getInt(); + AlchemicalWizardry.netherStarMeteorArray = config.get("meteor", "netherStarMeteor", new String[]{"oreDiamond", "150", "oreEmerald", "100", "oreQuartz", "250", "oreSunstone", "5", "oreMoonstone", "50", "oreIridium", "5", "oreCertusQuartz", "150"}).getStringList(); + AlchemicalWizardry.netherStarMeteorRadius = config.get("meteor", "netherStarMeteorRadius", 3).getInt(); + +// AlchemicalWizardry.testingBlockBlockID = config.getBlock("TestingBlock", 1400).getInt(); +// AlchemicalWizardry.lifeEssenceFlowingBlockID = config.getBlock("LifeEssenceFlowing", 1401).getInt(); +// AlchemicalWizardry.lifeEssenceStillBlockID = config.getBlock("LifeEssenceStill", 1402).getInt(); +// AlchemicalWizardry.blockAltarBlockID = config.getBlock("BloodAltar", 1403).getInt(); +// AlchemicalWizardry.bloodRuneBlockID = config.getBlock("BloodRune", 1404).getInt(); +// AlchemicalWizardry.speedRuneBlockID = config.getBlock("SpeedRune", 1405).getInt(); +// AlchemicalWizardry.efficiencyRuneBlockID = config.getBlock("EfficiencyRune", 1406).getInt(); +// AlchemicalWizardry.lifeEssenceFluidID = config.getBlock("LifeEssenceFluid", 1407).getInt(); +// AlchemicalWizardry.runeOfSacrificeBlockID = config.getBlock("RuneOfSacrifice", 1408).getInt(); +// AlchemicalWizardry.runeOfSelfSacrificeBlockID = config.getBlock("RuneOfSelfSacrifice", 1409).getInt(); +// AlchemicalWizardry.ritualStoneBlockID = config.getBlock("RitualStone", 1410).getInt(); +// AlchemicalWizardry.blockMasterStoneBlockID = config.getBlock("MasterStone", 1411).getInt(); +// AlchemicalWizardry.imperfectRitualStoneBlockID = config.getBlock("ImperfectRitualStone", 1412).getInt(); +// AlchemicalWizardry.emptySocketBlockID = config.getBlock("EmptySocket", 1413).getInt(); +// AlchemicalWizardry.bloodSocketBlockID = config.getBlock("BloodSocket", 1414).getInt(); +// AlchemicalWizardry.armourForgeBlockID = config.getBlock("ArmourForge", 1415).getInt(); +// AlchemicalWizardry.largeBloodStoneBrickBlockID = config.getBlock("LargeBloodStoneBrick", 1416).getInt(); +// AlchemicalWizardry.bloodStoneBrickBlockID = config.getBlock("BloodStoneBrick", 1417).getInt(); +// AlchemicalWizardry.blockWritingTableBlockID = config.getBlock("BlockWritingTable", 1418).getInt(); +// AlchemicalWizardry.blockHomHeartBlockID = config.getBlock("BlockHomHeart", 1419).getInt(); +// AlchemicalWizardry.blockPedestalBlockID = config.getBlock("BlockPedestal", 1420).getInt(); +// AlchemicalWizardry.blockPlinthBlockID = config.getBlock("BlockPlinth", 1421).getInt(); +// AlchemicalWizardry.blockTeleposerBlockID = config.getBlock("BlockTeleposer", 1422).getInt(); +// AlchemicalWizardry.spectralBlockBlockID = config.getBlock("SpectralBlock", 1423).getInt(); +// AlchemicalWizardry.blockBloodLightBlockID = config.getBlock("BloodLight", 1424).getInt(); +// AlchemicalWizardry.blockConduitBlockID = config.getBlock("BlockConduit", 1425).getInt(); +// AlchemicalWizardry.blockSpellEffectBlockID = config.getBlock("BlockSpellEffect", 1426).getInt(); +// AlchemicalWizardry.blockSpellParadigmBlockID = config.getBlock("BlockSpellParadigm", 1427).getInt(); +// AlchemicalWizardry.blockSpellModifierBlockID = config.getBlock("BlockSpellModifier", 1428).getInt(); +// AlchemicalWizardry.blockSpellEnhancementBlockID = config.getBlock("BlockSpellEnhancement", 1429).getInt(); +// //Items +// AlchemicalWizardry.weakBloodOrbItemID = config.getItem("WeakBloodOrb", 17000).getInt(); +// AlchemicalWizardry.energyBlasterItemID = config.getItem("EnergyBlaster", 17001).getInt(); +// AlchemicalWizardry.energySwordItemID = config.getItem("EnergySword", 17002).getInt(); +// AlchemicalWizardry.lavaCrystalItemID = config.getItem("LavaCrystal", 17003).getInt(); +// AlchemicalWizardry.waterSigilItemID = config.getItem("WaterSigil", 17004).getInt(); +// AlchemicalWizardry.lavaSigilItemID = config.getItem("LavaSigil", 17005).getInt(); +// AlchemicalWizardry.voidSigilItemID = config.getItem("VoidSigil", 17006).getInt(); +// AlchemicalWizardry.blankSlateItemID = config.getItem("BlankSlate", 17007).getInt(); +// AlchemicalWizardry.reinforcedSlateItemID = config.getItem("ReinforcedSlate", 17008).getInt(); +// AlchemicalWizardry.sacrificialDaggerItemID = config.getItem("SacrificialDagger", 17009).getInt(); +// AlchemicalWizardry.bucketLifeItemID = config.getItem("BucketLife", 17010).getInt(); +// AlchemicalWizardry.apprenticeBloodOrbItemID = config.getItem("ApprenticeBloodOrb", 17011).getInt(); +// AlchemicalWizardry.daggerOfSacrificeItemID = config.getItem("DaggerOfSacrifice", 17012).getInt(); +// AlchemicalWizardry.airSigilItemID = config.getItem("AirSigil", 17013).getInt(); +// AlchemicalWizardry.sigilOfTheFastMinerItemID = config.getItem("SigilOfTheFastMiner", 17014).getInt(); +//// elementalInkWaterItemID = config.getItem("ElementalInkWater", 17015).getInt(); +//// elementalInkFireItemID = config.getItem("ElementalInkFire", 17016).getInt(); +//// elementalInkEarthItemID = config.getItem("ElementalInkEarth", 17017).getInt(); +//// elementalInkAirItemID = config.getItem("ElementalInkAir", 17018).getInt(); +// AlchemicalWizardry.duskScribeToolItemID = config.getItem("DuskScribeTool", 17015).getInt(); +// AlchemicalWizardry.demonPlacerItemID = config.getItem("DemonPlacer", 17016).getInt(); +// AlchemicalWizardry.itemBloodRuneBlockItemID = config.getItem("ItemBloodRuneBlock", 17017).getInt(); +// AlchemicalWizardry.armourInhibitorItemID = config.getItem("ArmourInhibitor", 17018).getInt(); +// AlchemicalWizardry.divinationSigilItemID = config.getItem("DivinationSigin", 17019).getInt(); +// AlchemicalWizardry.waterScribeToolItemID = config.getItem("WaterScribeTool", 17020).getInt(); +// AlchemicalWizardry.fireScribeToolItemID = config.getItem("FireScribeTool", 17021).getInt(); +// AlchemicalWizardry.earthScribeToolItemID = config.getItem("EarthScribeTool", 17022).getInt(); +// AlchemicalWizardry.airScribeToolItemID = config.getItem("AirScribeTool", 17023).getInt(); +// AlchemicalWizardry.weakActivationCrystalItemID = config.getItem("WeakActivationCrystal", 17024).getInt(); +// AlchemicalWizardry.magicianBloodOrbItemID = config.getItem("MagicianBloodOrb", 17025).getInt(); +// AlchemicalWizardry.sigilOfElementalAffinityItemID = config.getItem("SigilOfElementalAffinity", 17026).getInt(); +// AlchemicalWizardry.sigilOfHasteItemID = config.getItem("SigilOfHaste", 17027).getInt(); +// AlchemicalWizardry.sigilOfHoldingItemID = config.getItem("SigilOfHolding", 17028).getInt(); +// AlchemicalWizardry.boundPickaxeItemID = config.getItem("BoundPickaxe", 17029).getInt(); +// AlchemicalWizardry.boundAxeItemID = config.getItem("BoundAxe", 17030).getInt(); +// AlchemicalWizardry.boundShovelItemID = config.getItem("BoundShovel", 17031).getInt(); +// AlchemicalWizardry.boundHelmetItemID = config.getItem("BoundHelmet", 17032).getInt(); +// AlchemicalWizardry.boundPlateItemID = config.getItem("BoundPlate", 17033).getInt(); +// AlchemicalWizardry.boundLeggingsItemID = config.getItem("BoundLeggings", 17034).getInt(); +// AlchemicalWizardry.boundBootsItemID = config.getItem("BoundBoots", 17035).getInt(); +// AlchemicalWizardry.weakBloodShardItemID = config.getItem("WeakBloodShard", 17036).getInt(); +// AlchemicalWizardry.growthSigilItemID = config.getItem("SigilOfGrowth", 17037).getInt(); +// AlchemicalWizardry.masterBloodOrbItemID = config.getItem("MasterBloodOrb", 17038).getInt(); +// AlchemicalWizardry.blankSpellItemID = config.getItem("BlankSpell", 17039).getInt(); +// AlchemicalWizardry.alchemyFlaskItemID = config.getItem("AlchemyFlask", 17040).getInt(); +// AlchemicalWizardry.standardBindingAgentItemID = config.getItem("StandardBindingAgent", 17041).getInt(); +// AlchemicalWizardry.mundanePowerCatalystItemID = config.getItem("MundanePowerCatalyst", 17042).getInt(); +// AlchemicalWizardry.averagePowerCatalystItemID = config.getItem("AveragePowerCatalyst", 17043).getInt(); +// AlchemicalWizardry.greaterPowerCatalystItemID = config.getItem("GreaterPowerCatalyst", 17044).getInt(); +// AlchemicalWizardry.mundaneLengtheningCatalystItemID = config.getItem("MundaneLengtheningCatalyst", 17045).getInt(); +// AlchemicalWizardry.averageLengtheningCatalystItemID = config.getItem("AverageLengtheningCatalyst", 17046).getInt(); +// AlchemicalWizardry.greaterLengtheningCatalystItemID = config.getItem("GreaterLengtheningCatalyst", 17047).getInt(); +// AlchemicalWizardry.demonBloodShardItemID = config.getItem("DemonBloodShard", 17048).getInt(); +// AlchemicalWizardry.archmageBloodOrbItemID = config.getItem("ArchmageBloodOrb", 17049).getInt(); +// AlchemicalWizardry.sigilOfWindItemID = config.getItem("SigilOfWind", 17050).getInt(); +// AlchemicalWizardry.telepositionFocusItemID = config.getItem("TelepositionFocusItemID", 17051).getInt(); +// AlchemicalWizardry.enhancedTelepositionFocusItemID = config.getItem("EnhancedTelepositionFocus", 17052).getInt(); +// AlchemicalWizardry.reinforcedTelepositionFocusItemID = config.getItem("ReinforcedTelepositionFocus", 17053).getInt(); +// AlchemicalWizardry.demonicTelepositionFocusItemID = config.getItem("DemonicTelepositionFocus", 17054).getInt(); +// AlchemicalWizardry.imbuedSlateItemID = config.getItem("ImbuedSlate", 17055).getInt(); +// AlchemicalWizardry.demonicSlateItemID = config.getItem("DemonicSlate", 17056).getInt(); +// AlchemicalWizardry.sigilOfTheBridgeItemID = config.getItem("SigilOfTheBridge", 17057).getInt(); +// AlchemicalWizardry.creativeFillerItemID = config.getItem("CreativeFiller", 17058).getInt(); +// AlchemicalWizardry.itemRitualDivinerItemID = config.getItem("ItemRitualDiviner", 17059).getInt(); +// AlchemicalWizardry.itemKeyOfDiabloItemID = config.getItem("ItemKeyOfDiablo", 17081).getInt(); +// AlchemicalWizardry.energyBazookaItemID = config.getItem("EnergyBazooka", 17082).getInt(); +// AlchemicalWizardry.itemBloodLightSigilItemID = config.getItem("BloodLightSigil", 17083).getInt(); +// AlchemicalWizardry.simpleCatalystItemID = config.getItem("SimpleCatalyst", 17060).getInt(); +// AlchemicalWizardry.incendiumItemID = config.getItem("Incendium", 17061).getInt(); +// AlchemicalWizardry.magicalesItemID = config.getItem("Magicales", 17062).getInt(); +// AlchemicalWizardry.sanctusItemID = config.getItem("Sanctus", 17063).getInt(); +// AlchemicalWizardry.aetherItemID = config.getItem("Aether", 17064).getInt(); +// AlchemicalWizardry.crepitousItemID = config.getItem("Crepitous", 17065).getInt(); +// AlchemicalWizardry.crystallosItemID = config.getItem("Crystallos", 17066).getInt(); +// +// AlchemicalWizardry.terraeItemID = config.getItem("Terrae", 17067).getInt(); +// AlchemicalWizardry.aquasalusItemID = config.getItem("Aquasalus", 17068).getInt(); +// AlchemicalWizardry.tennebraeItemID = config.getItem("Tennebrae", 17069).getInt(); +// AlchemicalWizardry.weakBindingAgentItemID = config.getItem("WeakBindingAgent", 17070).getInt(); +// AlchemicalWizardry.weakFillingAgentItemID = config.getItem("WeakFillingAgent", 17072).getInt(); +// AlchemicalWizardry.standardFillingAgentItemID = config.getItem("StandardFillingAgent", 17073).getInt(); +// AlchemicalWizardry.enhancedFillingAgentItemID = config.getItem("EnhancedFillingAgent", 17074).getInt(); +// AlchemicalWizardry.sanguineHelmetItemID = config.getItem("SanguineHelmet", 17075).getInt(); +// AlchemicalWizardry.focusBloodBlastItemID = config.getItem("FocusBloodBlast", 17076).getInt(); +// AlchemicalWizardry.focusGravityWellItemID = config.getItem("FocusGravityWell", 17077).getInt(); +// AlchemicalWizardry.sigilOfMagnetismItemID = config.getItem("SigilOfMagnetism", 17080).getInt(); +// AlchemicalWizardry.itemComplexSpellCrystalItemID = config.getItem("ComplexSpellCrystal",17081).getInt(); +// AlchemicalWizardry.itemBloodFrameItemID = config.getItem("BloodFrame", 17082).getInt(); + + } catch (Exception e) + { + + //TODO Log + //FMLLog.log(Level.SEVERE, e, "Blood Magic" + " has had a problem loading its configuration, go ask on the forums :p"); + + } finally + { + config.save(); + } + } + + public static void set(String categoryName, String propertyName, String newValue) + { + + config.load(); + if (config.getCategoryNames().contains(categoryName)) + { + if (config.getCategory(categoryName).containsKey(propertyName)) + { + config.getCategory(categoryName).get(propertyName).set(newValue); + } + } + config.save(); + + + } + +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/ModBlocks.java b/1.7.2/java/WayofTime/alchemicalWizardry/ModBlocks.java new file mode 100644 index 00000000..c92f9dd5 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/ModBlocks.java @@ -0,0 +1,117 @@ +package WayofTime.alchemicalWizardry; + +import cpw.mods.fml.common.registry.GameRegistry; +import WayofTime.alchemicalWizardry.common.LifeEssence; +import WayofTime.alchemicalWizardry.common.block.*; +import WayofTime.alchemicalWizardry.common.items.ItemBloodRuneBlock; +import WayofTime.alchemicalWizardry.common.items.ItemSpellEffectBlock; +import WayofTime.alchemicalWizardry.common.items.ItemSpellEnhancementBlock; +import WayofTime.alchemicalWizardry.common.items.ItemSpellModifierBlock; +import WayofTime.alchemicalWizardry.common.items.ItemSpellParadigmBlock; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; + +/** + * Created with IntelliJ IDEA. + * User: Pokefenn + * Date: 17/01/14 + * Time: 19:48 + */ +public class ModBlocks +{ + + public static Block testingBlock; + public static Block bloodStoneBrick; + public static Block largeBloodStoneBrick; + // public static Block lifeEssenceStill; +// public static Block lifeEssenceFlowing; + public static BlockAltar blockAltar; + public static BloodRune bloodRune; + public static SpeedRune speedRune; + public static EfficiencyRune efficiencyRune; + public static RuneOfSacrifice runeOfSacrifice; + public static RuneOfSelfSacrifice runeOfSelfSacrifice; + public static Block blockMasterStone; + public static Block ritualStone; + public static Block imperfectRitualStone; + public static Block bloodSocket; + public static Block emptySocket; + public static Block armourForge; + public static Block blockWritingTable; + public static Block blockHomHeart; + public static Block blockPedestal; + public static Block blockPlinth; + public static Block blockLifeEssence; + public static Block blockTeleposer; + public static Block spectralBlock; + public static Block blockConduit; + public static Block blockBloodLight; + public static Block blockSpellEffect; + public static Block blockSpellParadigm; + public static Block blockSpellModifier; + public static Block blockSpellEnhancement; + + public static void init() + { + blockAltar = new BlockAltar(); + bloodRune = new BloodRune(); + speedRune = new SpeedRune(); + efficiencyRune = new EfficiencyRune(); + runeOfSacrifice = new RuneOfSacrifice(); + runeOfSelfSacrifice = new RuneOfSelfSacrifice(); + AlchemicalWizardry.lifeEssenceFluid = new LifeEssence("Life Essence"); + blockTeleposer = new BlockTeleposer(); + spectralBlock = new SpectralBlock(); + ritualStone = new RitualStone(); + blockMasterStone = new BlockMasterStone(); + imperfectRitualStone = new ImperfectRitualStone(); + bloodSocket = new BlockSocket(); + armourForge = new ArmourForge(); + emptySocket = new EmptySocket(); + largeBloodStoneBrick = new LargeBloodStoneBrick(); + bloodStoneBrick = new BloodStoneBrick(); + blockWritingTable = new BlockWritingTable(); + blockHomHeart = new BlockHomHeart(); + blockPedestal = new BlockPedestal(); + blockPlinth = new BlockPlinth(); + blockConduit = new BlockConduit(); + blockBloodLight = new BlockBloodLightSource(); + blockSpellEffect = new BlockSpellEffect(); + blockSpellParadigm = new BlockSpellParadigm(); + blockSpellModifier = new BlockSpellModifier(); + blockSpellEnhancement = new BlockSpellEnhancement(); + } + + public static void registerBlocks() + { + GameRegistry.registerBlock(ModBlocks.bloodRune, ItemBloodRuneBlock.class, "AlchemicalWizardry" + (ModBlocks.bloodRune.getUnlocalizedName().substring(5))); + GameRegistry.registerBlock(ModBlocks.blockAltar, "bloodAltar"); + GameRegistry.registerBlock(ModBlocks.blockLifeEssence, "lifeEssence"); + GameRegistry.registerBlock(ModBlocks.blockSpellParadigm, ItemSpellParadigmBlock.class, "AlchemicalWizardry" + (ModBlocks.blockSpellParadigm.getUnlocalizedName())); + GameRegistry.registerBlock(ModBlocks.blockSpellEnhancement, ItemSpellEnhancementBlock.class,"AlchemicalWizardry" + (ModBlocks.blockSpellEnhancement.getUnlocalizedName())); + GameRegistry.registerBlock(ModBlocks.blockSpellModifier, ItemSpellModifierBlock.class,"AlchemicalWizardry" + (ModBlocks.blockSpellModifier.getUnlocalizedName())); + GameRegistry.registerBlock(ModBlocks.blockSpellEffect, ItemSpellEffectBlock.class,"AlchemicalWizardry" + (ModBlocks.blockSpellEffect.getUnlocalizedName())); + GameRegistry.registerBlock(ModBlocks.speedRune, "speedRune"); + GameRegistry.registerBlock(ModBlocks.efficiencyRune, "efficiencyRune"); + GameRegistry.registerBlock(ModBlocks.runeOfSacrifice, "runeOfSacrifice"); + GameRegistry.registerBlock(ModBlocks.runeOfSelfSacrifice, "runeOfSelfSacrifice"); + GameRegistry.registerBlock(ModBlocks.ritualStone, "ritualStone"); + GameRegistry.registerBlock(ModBlocks.blockMasterStone, "masterStone"); + GameRegistry.registerBlock(ModBlocks.bloodSocket, "bloodSocket"); + GameRegistry.registerBlock(ModBlocks.imperfectRitualStone, "imperfectRitualStone"); + + GameRegistry.registerBlock(ModBlocks.armourForge, "armourForge"); + GameRegistry.registerBlock(ModBlocks.emptySocket, "emptySocket"); + GameRegistry.registerBlock(ModBlocks.bloodStoneBrick, "bloodStoneBrick"); + GameRegistry.registerBlock(ModBlocks.largeBloodStoneBrick, "largeBloodStoneBrick"); + GameRegistry.registerBlock(ModBlocks.blockWritingTable, "blockWritingTable"); + GameRegistry.registerBlock(ModBlocks.blockHomHeart, "blockHomHeart"); + GameRegistry.registerBlock(ModBlocks.blockPedestal, "blockPedestal"); + GameRegistry.registerBlock(ModBlocks.blockPlinth, "blockPlinth"); + GameRegistry.registerBlock(ModBlocks.blockTeleposer, "blockTeleposer"); + GameRegistry.registerBlock(ModBlocks.spectralBlock, "spectralBlock"); + GameRegistry.registerBlock(ModBlocks.blockBloodLight, "bloodLight"); + GameRegistry.registerBlock(ModBlocks.blockConduit,"blockConduit"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/ModItems.java b/1.7.2/java/WayofTime/alchemicalWizardry/ModItems.java new file mode 100644 index 00000000..f5c8bd83 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/ModItems.java @@ -0,0 +1,274 @@ +package WayofTime.alchemicalWizardry; + +import cpw.mods.fml.common.event.FMLEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import WayofTime.alchemicalWizardry.common.items.*; +import WayofTime.alchemicalWizardry.common.items.potion.*; +import WayofTime.alchemicalWizardry.common.items.sigil.*; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; + +/** + * Created with IntelliJ IDEA. + * User: Pokefenn + * Date: 17/01/14 + * Time: 19:48 + */ +public class ModItems +{ + public static Item weakBloodOrb; + public static Item apprenticeBloodOrb; + public static Item magicianBloodOrb; + public static Item energyBlaster; + public static Item energySword; + public static Item lavaCrystal; + public static Item waterSigil; + public static Item lavaSigil; + public static Item voidSigil; + public static Item blankSlate; + public static Item reinforcedSlate; + public static Item sacrificialDagger; + public static Item daggerOfSacrifice; + public static Item airSigil; + public static Item sigilOfTheFastMiner; + public static Item sigilOfElementalAffinity; + public static Item sigilOfHaste; + public static Item sigilOfHolding; + public static Item divinationSigil; + public static Item waterScribeTool; + public static Item fireScribeTool; + public static Item earthScribeTool; + public static Item airScribeTool; + public static Item activationCrystal; + public static Item boundPickaxe; + public static Item boundAxe; + public static Item boundShovel; + public static Item boundHelmet; + public static Item boundPlate; + public static Item boundLeggings; + public static Item boundBoots; + public static Item weakBloodShard; + public static Item growthSigil; + public static Item blankSpell; + public static Item masterBloodOrb; + public static Item alchemyFlask; + public static Item standardBindingAgent; + public static Item mundanePowerCatalyst; + public static Item averagePowerCatalyst; + public static Item greaterPowerCatalyst; + public static Item mundaneLengtheningCatalyst; + public static Item averageLengtheningCatalyst; + public static Item greaterLengtheningCatalyst; + public static Item incendium; + public static Item magicales; + public static Item sanctus; + public static Item aether; + public static Item simpleCatalyst; + public static Item crepitous; + public static Item crystallos; + public static Item terrae; + public static Item aquasalus; + public static Item tennebrae; + public static Item demonBloodShard; + public static Item archmageBloodOrb; + public static Item sigilOfWind; + public static Item telepositionFocus; + public static Item enhancedTelepositionFocus; + public static Item reinforcedTelepositionFocus; + public static Item demonicTelepositionFocus; + public static Item imbuedSlate; + public static Item demonicSlate; + public static Item duskScribeTool; + public static Item sigilOfTheBridge; + public static Item armourInhibitor; + public static Item creativeFiller; + public static Item demonPlacer; + + public static Item weakFillingAgent; + public static Item standardFillingAgent; + public static Item enhancedFillingAgent; + public static Item weakBindingAgent; + public static Item itemRitualDiviner; + public static Item sanguineHelmet; + public static Item focusBloodBlast; + public static Item focusGravityWell; + public static Item sigilOfMagnetism; + public static Item itemKeyOfDiablo; + public static Item energyBazooka; + public static Item itemBloodLightSigil; + public static Item itemComplexSpellCrystal; + public static Item itemBloodFrame; + + public static Item bucketLife; + + public static void init() + { + weakBloodOrb = new EnergyBattery(5000).setUnlocalizedName("weakBloodOrb"); + apprenticeBloodOrb = new ApprenticeBloodOrb(25000).setUnlocalizedName("apprenticeBloodOrb"); + magicianBloodOrb = new MagicianBloodOrb(150000).setUnlocalizedName("magicianBloodOrb"); + masterBloodOrb = new MasterBloodOrb(1000000).setUnlocalizedName("masterBloodOrb"); + archmageBloodOrb = new ArchmageBloodOrb(10000000).setUnlocalizedName("archmageBloodOrb"); + energyBlaster = new EnergyBlast().setUnlocalizedName("energyBlast"); + energySword = new EnergySword().setUnlocalizedName("energySword"); + lavaCrystal = new LavaCrystal().setUnlocalizedName("lavaCrystal"); + waterSigil = new WaterSigil().setUnlocalizedName("waterSigil"); + lavaSigil = new LavaSigil().setUnlocalizedName("lavaSigil"); + voidSigil = new VoidSigil().setUnlocalizedName("voidSigil"); + blankSlate = new AWBaseItems().setUnlocalizedName("blankSlate"); + reinforcedSlate = new AWBaseItems().setUnlocalizedName("reinforcedSlate"); + sacrificialDagger = new SacrificialDagger().setUnlocalizedName("sacrificialDagger"); + daggerOfSacrifice = new DaggerOfSacrifice().setUnlocalizedName("daggerOfSacrifice"); + airSigil = new AirSigil().setUnlocalizedName("airSigil"); + sigilOfTheFastMiner = new SigilOfTheFastMiner().setUnlocalizedName("sigilOfTheFastMiner"); + sigilOfElementalAffinity = new SigilOfElementalAffinity().setUnlocalizedName("sigilOfElementalAffinity"); + sigilOfHaste = new SigilOfHaste().setUnlocalizedName("sigilOfHaste"); + sigilOfHolding = new SigilOfHolding().setUnlocalizedName("sigilOfHolding"); + divinationSigil = new DivinationSigil().setUnlocalizedName("divinationSigil"); + waterScribeTool = new WaterScribeTool().setUnlocalizedName("waterScribeTool"); + fireScribeTool = new FireScribeTool().setUnlocalizedName("fireScribeTool"); + earthScribeTool = new EarthScribeTool().setUnlocalizedName("earthScribeTool"); + airScribeTool = new AirScribeTool().setUnlocalizedName("airScribeTool"); + activationCrystal = new ActivationCrystal(); + boundPickaxe = new BoundPickaxe().setUnlocalizedName("boundPickaxe"); + boundAxe = new BoundAxe().setUnlocalizedName("boundAxe"); + boundShovel = new BoundShovel().setUnlocalizedName("boundShovel"); + boundHelmet = new BoundArmour(0).setUnlocalizedName("boundHelmet"); + boundPlate = new BoundArmour(1).setUnlocalizedName("boundPlate"); + boundLeggings = new BoundArmour(2).setUnlocalizedName("boundLeggings"); + boundBoots = new BoundArmour(3).setUnlocalizedName("boundBoots"); + weakBloodShard = new BloodShard().setUnlocalizedName("weakBloodShard"); + growthSigil = new SigilOfGrowth().setUnlocalizedName("growthSigil"); + blankSpell = new BlankSpell().setUnlocalizedName("blankSpell"); + alchemyFlask = new AlchemyFlask().setUnlocalizedName("alchemyFlask"); + standardBindingAgent = new StandardBindingAgent().setUnlocalizedName("standardBindingAgent"); + mundanePowerCatalyst = new MundanePowerCatalyst().setUnlocalizedName("mundanePowerCatalyst"); + averagePowerCatalyst = new AveragePowerCatalyst().setUnlocalizedName("averagePowerCatalyst"); + greaterPowerCatalyst = new GreaterPowerCatalyst().setUnlocalizedName("greaterPowerCatalyst"); + mundaneLengtheningCatalyst = new MundaneLengtheningCatalyst().setUnlocalizedName("mundaneLengtheningCatalyst"); + averageLengtheningCatalyst = new AverageLengtheningCatalyst().setUnlocalizedName("averageLengtheningCatalyst"); + greaterLengtheningCatalyst = new GreaterLengtheningCatalyst().setUnlocalizedName("greaterLengtheningCatalyst"); + incendium = new AlchemyReagent().setUnlocalizedName("incendium"); + magicales = new AlchemyReagent().setUnlocalizedName("magicales"); + sanctus = new AlchemyReagent().setUnlocalizedName("sanctus"); + aether = new AlchemyReagent().setUnlocalizedName("aether"); + simpleCatalyst = new AlchemyReagent().setUnlocalizedName("simpleCatalyst"); + crepitous = new AlchemyReagent().setUnlocalizedName("crepitous"); + crystallos = new AlchemyReagent().setUnlocalizedName("crystallos"); + terrae = new AlchemyReagent().setUnlocalizedName("terrae"); + aquasalus = new AlchemyReagent().setUnlocalizedName("aquasalus"); + tennebrae = new AlchemyReagent().setUnlocalizedName("tennebrae"); + demonBloodShard = new BloodShard().setUnlocalizedName("demonBloodShard"); + sigilOfWind = new SigilOfWind().setUnlocalizedName("sigilOfWind"); + telepositionFocus = new TelepositionFocus(1).setUnlocalizedName("telepositionFocus"); + enhancedTelepositionFocus = new EnhancedTelepositionFocus().setUnlocalizedName("enhancedTelepositionFocus"); + reinforcedTelepositionFocus = new ReinforcedTelepositionFocus().setUnlocalizedName("reinforcedTelepositionFocus"); + demonicTelepositionFocus = new DemonicTelepositionFocus().setUnlocalizedName("demonicTelepositionFocus"); + imbuedSlate = new AWBaseItems().setUnlocalizedName("imbuedSlate"); + demonicSlate = new AWBaseItems().setUnlocalizedName("demonicSlate"); + duskScribeTool = new DuskScribeTool().setUnlocalizedName("duskScribeTool"); + sigilOfTheBridge = new SigilOfTheBridge().setUnlocalizedName("sigilOfTheBridge"); + armourInhibitor = new ArmourInhibitor().setUnlocalizedName("armourInhibitor"); + creativeFiller = new CheatyItem().setUnlocalizedName("cheatyItem"); + demonPlacer = new DemonPlacer().setUnlocalizedName("demonPlacer"); + weakFillingAgent = new WeakFillingAgent().setUnlocalizedName("weakFillingAgent"); + standardFillingAgent = new StandardFillingAgent().setUnlocalizedName("standardFillingAgent"); + enhancedFillingAgent = new EnhancedFillingAgent().setUnlocalizedName("enhancedFillingAgent"); + weakBindingAgent = new WeakBindingAgent().setUnlocalizedName("weakBindingAgent"); + itemRitualDiviner = new ItemRitualDiviner().setUnlocalizedName("ritualDiviner"); + sigilOfMagnetism = new SigilOfMagnetism().setUnlocalizedName("sigilOfMagnetism"); + itemKeyOfDiablo = new ItemDiabloKey().setUnlocalizedName("itemDiabloKey"); + energyBazooka = new EnergyBazooka().setUnlocalizedName("energyBazooka"); + itemBloodLightSigil = new ItemBloodLightSigil().setUnlocalizedName("bloodLightSigil"); + itemComplexSpellCrystal = new ItemComplexSpellCrystal().setUnlocalizedName("itemComplexSpellCrystal"); + bucketLife = (new LifeBucket(ModBlocks.blockLifeEssence)).setUnlocalizedName("bucketLife").setContainerItem(Items.bucket).setCreativeTab(CreativeTabs.tabMisc); + } + + public static void registerItems() + { + GameRegistry.registerItem(ModItems.weakBloodOrb, "weakBloodOrb"); + GameRegistry.registerItem(ModItems.apprenticeBloodOrb, "apprenticeBloodOrb"); + GameRegistry.registerItem(ModItems.magicianBloodOrb, "magicianBloodOrb"); + GameRegistry.registerItem(ModItems.energyBlaster, "energyBlaster"); + + GameRegistry.registerItem(ModItems.energySword, "energySword"); + GameRegistry.registerItem(ModItems.lavaCrystal, "lavaCrystal"); + GameRegistry.registerItem(ModItems.waterSigil, "waterSigil"); + GameRegistry.registerItem(ModItems.lavaSigil, "lavaSigil"); + GameRegistry.registerItem(ModItems.voidSigil, "voidSigil"); + GameRegistry.registerItem(ModItems.blankSlate, "blankSlate"); + GameRegistry.registerItem(ModItems.reinforcedSlate, "reinforcedSlate"); + GameRegistry.registerItem(ModItems.sacrificialDagger, "sacrificialKnife"); + GameRegistry.registerItem(ModItems.daggerOfSacrifice, "daggerOfSacrifice"); + GameRegistry.registerItem(ModItems.airSigil, "airSigil"); + GameRegistry.registerItem(ModItems.sigilOfTheFastMiner, "sigilOfTheFastMiner"); + GameRegistry.registerItem(ModItems.sigilOfElementalAffinity, "sigilOfElementalAffinity"); + GameRegistry.registerItem(ModItems.sigilOfHaste, "sigilOfHaste"); + GameRegistry.registerItem(ModItems.sigilOfHolding, "sigilOfHolding"); + GameRegistry.registerItem(ModItems.divinationSigil, "divinationSigil"); + GameRegistry.registerItem(ModItems.waterScribeTool, "waterScribeTool"); + GameRegistry.registerItem(ModItems.fireScribeTool, "fireScribeTool"); + GameRegistry.registerItem(ModItems.earthScribeTool, "earthScribeTool"); + GameRegistry.registerItem(ModItems.airScribeTool, "airScribeTool"); + GameRegistry.registerItem(ModItems.activationCrystal, "activationCrystal"); + GameRegistry.registerItem(ModItems.boundPickaxe, "boundPickaxe"); + GameRegistry.registerItem(ModItems.boundAxe, "boundAxe"); + GameRegistry.registerItem(ModItems.boundShovel, "boundShovel"); + GameRegistry.registerItem(ModItems.boundHelmet, "boundHelmet"); + GameRegistry.registerItem(ModItems.boundPlate, "boundPlate"); + GameRegistry.registerItem(ModItems.boundLeggings, "boundLeggings"); + GameRegistry.registerItem(ModItems.boundBoots, "boundBoots"); + GameRegistry.registerItem(ModItems.weakBloodShard, "weakBloodShard"); + GameRegistry.registerItem(ModItems.growthSigil, "growthSigil"); + GameRegistry.registerItem(ModItems.blankSpell, "blankSpell"); + GameRegistry.registerItem(ModItems.masterBloodOrb, "masterBloodOrb"); + GameRegistry.registerItem(ModItems.alchemyFlask, "alchemyFlask"); + GameRegistry.registerItem(ModItems.standardBindingAgent, "standardBindingAgent"); + GameRegistry.registerItem(ModItems.mundanePowerCatalyst, "mundanePowerCatalyst"); + GameRegistry.registerItem(ModItems.averagePowerCatalyst, "averagePowerCatalyst"); + GameRegistry.registerItem(ModItems.greaterPowerCatalyst, "greaterPowerCatalyst"); + GameRegistry.registerItem(ModItems.mundaneLengtheningCatalyst, "mundaneLengtheningCatalyst"); + GameRegistry.registerItem(ModItems.averageLengtheningCatalyst, "averageLengtheningCatalyst"); + GameRegistry.registerItem(ModItems.greaterLengtheningCatalyst, "greaterLengtheningCatalyst"); + GameRegistry.registerItem(ModItems.incendium, "incendium"); + GameRegistry.registerItem(ModItems.magicales, "magicales"); + GameRegistry.registerItem(ModItems.sanctus, "sanctus"); + GameRegistry.registerItem(ModItems.aether, "aether"); + GameRegistry.registerItem(ModItems.simpleCatalyst, "simpleCatalyst"); + GameRegistry.registerItem(ModItems.crepitous, "crepitous"); + GameRegistry.registerItem(ModItems.crystallos, "crystallos"); + GameRegistry.registerItem(ModItems.terrae, "terrae"); + GameRegistry.registerItem(ModItems.aquasalus, "aquasalus"); + GameRegistry.registerItem(ModItems.tennebrae, "tennebrae"); + GameRegistry.registerItem(ModItems.demonBloodShard, "demonBloodShard"); + GameRegistry.registerItem(ModItems.archmageBloodOrb, "archmageBloodOrb"); + GameRegistry.registerItem(ModItems.sigilOfWind, "sigilOfWind"); + GameRegistry.registerItem(ModItems.telepositionFocus, "telepositionFocus"); + GameRegistry.registerItem(ModItems.enhancedTelepositionFocus, "enhancedTelepositionFocus"); + GameRegistry.registerItem(ModItems.reinforcedTelepositionFocus, "reinforcedTelepositionFocus"); + GameRegistry.registerItem(ModItems.demonicTelepositionFocus, "demonicTelepositionFocus"); + GameRegistry.registerItem(ModItems.imbuedSlate, "imbuedSlate"); + GameRegistry.registerItem(ModItems.demonicSlate, "demonicSlate"); + GameRegistry.registerItem(ModItems.duskScribeTool, "duskScribeTool"); + GameRegistry.registerItem(ModItems.sigilOfTheBridge, "sigilOfTheBridge"); + GameRegistry.registerItem(ModItems.armourInhibitor, "armourInhibitor"); + GameRegistry.registerItem(ModItems.creativeFiller, "creativeFiller"); + GameRegistry.registerItem(ModItems.demonPlacer, "demonPlacer"); + + GameRegistry.registerItem(ModItems.weakFillingAgent, "weakFillingAgent"); + GameRegistry.registerItem(ModItems.standardFillingAgent, "standardFillingAgent"); + GameRegistry.registerItem(ModItems.enhancedFillingAgent, "enhancedFillingAgent"); + GameRegistry.registerItem(ModItems.weakBindingAgent, "weakBindingAgent"); + GameRegistry.registerItem(ModItems.itemRitualDiviner, "itemRitualDiviner"); + //GameRegistry.registerItem(ModItems.sanguineHelmet, "sanguineHelmet"); + //GameRegistry.registerItem(ModItems.focusBloodBlast, "focusBloodBlast"); + //GameRegistry.registerItem(ModItems.focusGravityWell, "focusGravityWell"); + GameRegistry.registerItem(ModItems.sigilOfMagnetism, "sigilOfMagnetism"); + GameRegistry.registerItem(ModItems.itemKeyOfDiablo, "itemKeyOfDiablo"); + GameRegistry.registerItem(ModItems.energyBazooka, "energyBazooka"); + GameRegistry.registerItem(ModItems.itemBloodLightSigil, "itemBloodLightSigil"); + GameRegistry.registerItem(ModItems.itemComplexSpellCrystal, "itemComplexSpellCrystal"); + GameRegistry.registerItem(ModItems.bucketLife, "bucketLife"); + //GameRegistry.registerItem(ModItems.itemBloodFrame, "itemBloodFrame"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/client/ClientProxy.java b/1.7.2/java/WayofTime/alchemicalWizardry/client/ClientProxy.java new file mode 100644 index 00000000..e9bf768f --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/client/ClientProxy.java @@ -0,0 +1,132 @@ +package WayofTime.alchemicalWizardry.client; + +import net.minecraft.world.World; +import net.minecraftforge.client.MinecraftForgeClient; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.CommonProxy; +import WayofTime.alchemicalWizardry.common.EntityAirElemental; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityBileDemon; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityBoulderFist; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityEarthElemental; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityFallenAngel; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityFireElemental; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityHolyElemental; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityIceDemon; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityLowerGuardian; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityShade; +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.entity.projectile.EnergyBlastProjectile; +import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaMainProjectile; +import WayofTime.alchemicalWizardry.common.entity.projectile.EntityMeteor; +import WayofTime.alchemicalWizardry.common.renderer.block.RenderConduit; +import WayofTime.alchemicalWizardry.common.renderer.block.RenderPedestal; +import WayofTime.alchemicalWizardry.common.renderer.block.RenderPlinth; +import WayofTime.alchemicalWizardry.common.renderer.block.RenderSpellEffectBlock; +import WayofTime.alchemicalWizardry.common.renderer.block.RenderWritingTable; +import WayofTime.alchemicalWizardry.common.renderer.block.TEAltarRenderer; +import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TEAltarItemRenderer; +import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TEConduitItemRenderer; +import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TESpellEffectBlockItemRenderer; +import WayofTime.alchemicalWizardry.common.renderer.mob.RenderBileDemon; +import WayofTime.alchemicalWizardry.common.renderer.mob.RenderBoulderFist; +import WayofTime.alchemicalWizardry.common.renderer.mob.RenderElemental; +import WayofTime.alchemicalWizardry.common.renderer.mob.RenderFallenAngel; +import WayofTime.alchemicalWizardry.common.renderer.mob.RenderIceDemon; +import WayofTime.alchemicalWizardry.common.renderer.mob.RenderLowerGuardian; +import WayofTime.alchemicalWizardry.common.renderer.mob.RenderShade; +import WayofTime.alchemicalWizardry.common.renderer.mob.RenderSmallEarthGolem; +import WayofTime.alchemicalWizardry.common.renderer.mob.RenderWingedFireDemon; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelBileDemon; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelBoulderFist; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelElemental; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelFallenAngel; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelIceDemon; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelLowerGuardian; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelShade; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelSmallEarthGolem; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelWingedFireDemon; +import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderEnergyBazookaMainProjectile; +import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderEnergyBlastProjectile; +import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderMeteor; +import WayofTime.alchemicalWizardry.common.spell.complex.EntitySpellProjectile; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEConduit; +import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal; +import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock; +import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; + +public class ClientProxy extends CommonProxy +{ + public static int renderPass; + public static int altarRenderType; + + @Override + public void registerRenderers() + { + //altarRenderType = RenderingRegistry.getNextAvailableRenderId(); + RenderingRegistry.registerEntityRenderingHandler(EnergyBlastProjectile.class, new RenderEnergyBlastProjectile()); + RenderingRegistry.registerEntityRenderingHandler(EntityEnergyBazookaMainProjectile.class, new RenderEnergyBazookaMainProjectile()); + RenderingRegistry.registerEntityRenderingHandler(EntitySpellProjectile.class, new RenderEnergyBlastProjectile()); + RenderingRegistry.registerEntityRenderingHandler(EntityMeteor.class, new RenderMeteor()); + //EntityRegistry.registerGlobalEntityID(EntityFallenAngel.class, "AlchemicalWizardry.FallenAngel", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); + RenderingRegistry.registerEntityRenderingHandler(EntityFallenAngel.class, new RenderFallenAngel(new ModelFallenAngel(), 0.5F)); + //EntityRegistry.registerGlobalEntityID(EntityLowerGuardian.class, "AlchemicalWizardry.LowerGuardian", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); + RenderingRegistry.registerEntityRenderingHandler(EntityLowerGuardian.class, new RenderLowerGuardian(new ModelLowerGuardian(), 0.5F)); + //EntityRegistry.registerGlobalEntityID(EntityBileDemon.class, "AlchemicalWizardry.BileDemon", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); + RenderingRegistry.registerEntityRenderingHandler(EntityBileDemon.class, new RenderBileDemon(new ModelBileDemon(), 1.5F)); + //EntityRegistry.registerGlobalEntityID(EntityWingedFireDemon.class, "AlchemicalWizardry.WingedFireDemon", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); + RenderingRegistry.registerEntityRenderingHandler(EntityWingedFireDemon.class, new RenderWingedFireDemon(new ModelWingedFireDemon(), 1.0F)); + //EntityRegistry.registerGlobalEntityID(EntitySmallEarthGolem.class, "AlchemicalWizardry.SmallEarthGolem", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); + RenderingRegistry.registerEntityRenderingHandler(EntitySmallEarthGolem.class, new RenderSmallEarthGolem(new ModelSmallEarthGolem(), 0.5F)); + //EntityRegistry.registerGlobalEntityID(EntityIceDemon.class, "AlchemicalWizardry.IceDemon", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); + RenderingRegistry.registerEntityRenderingHandler(EntityIceDemon.class, new RenderIceDemon(new ModelIceDemon(), 0.5F)); + // EntityRegistry.registerGlobalEntityID(EntityBoulderFist.class, "AlchemicalWizardry.BoulderFist", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); + RenderingRegistry.registerEntityRenderingHandler(EntityBoulderFist.class, new RenderBoulderFist(new ModelBoulderFist(), 0.5F)); + //EntityRegistry.registerGlobalEntityID(EntityShade.class, "AlchemicalWizardry.Shade", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); + RenderingRegistry.registerEntityRenderingHandler(EntityShade.class, new RenderShade(new ModelShade(), 0.5F)); + //EntityRegistry.registerGlobalEntityID(EntityAirElemental.class, "AlchemicalWizardry.AirElemental", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); + RenderingRegistry.registerEntityRenderingHandler(EntityAirElemental.class, new RenderElemental(new ModelElemental(), 0.5F)); + //EntityRegistry.registerGlobalEntityID(EntityWaterElemental.class, "AlchemicalWizardry.WaterElemental", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); + RenderingRegistry.registerEntityRenderingHandler(EntityWaterElemental.class, new RenderElemental(new ModelElemental(), 0.5F)); + //EntityRegistry.registerGlobalEntityID(EntityEarthElemental.class, "AlchemicalWizardry.EarthElemental", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); + RenderingRegistry.registerEntityRenderingHandler(EntityEarthElemental.class, new RenderElemental(new ModelElemental(), 0.5F)); + //EntityRegistry.registerGlobalEntityID(EntityFireElemental.class, "AlchemicalWizardry.FireElemental", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); + RenderingRegistry.registerEntityRenderingHandler(EntityFireElemental.class, new RenderElemental(new ModelElemental(), 0.5F)); + //EntityRegistry.registerGlobalEntityID(EntityShadeElemental.class, "AlchemicalWizardry.ShadeElemental", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); + RenderingRegistry.registerEntityRenderingHandler(EntityShadeElemental.class, new RenderElemental(new ModelElemental(), 0.5F)); + //EntityRegistry.registerGlobalEntityID(EntityHolyElemental.class, "AlchemicalWizardry.HolyElemental", EntityRegistry.findGlobalUniqueEntityId(),0x40FF00, 0x0B610B); + RenderingRegistry.registerEntityRenderingHandler(EntityHolyElemental.class, new RenderElemental(new ModelElemental(), 0.5F)); + ClientRegistry.bindTileEntitySpecialRenderer(TEPedestal.class, new RenderPedestal()); + ClientRegistry.bindTileEntitySpecialRenderer(TEPlinth.class, new RenderPlinth()); + ClientRegistry.bindTileEntitySpecialRenderer(TEWritingTable.class, new RenderWritingTable()); + ClientRegistry.bindTileEntitySpecialRenderer(TEConduit.class, new RenderConduit()); + ClientRegistry.bindTileEntitySpecialRenderer(TESpellEffectBlock.class, new RenderSpellEffectBlock()); + + //Item Renderer stuff + //MinecraftForgeClient.registerItemRenderer(ModBlocks.blockConduit.blockID, new TEConduitItemRenderer()); + //MinecraftForgeClient.registerItemRenderer(ModBlocks.blockSpellEffect.blockID, new TESpellEffectBlockItemRenderer()); + //RenderingRegistry.registerEntityRenderingHandler(FireProjectile.class, new RenderFireProjectile()); + //RenderingRegistry.registerBlockHandler(new AltarRenderer()); + } + + @Override + public World getClientWorld() + { + return FMLClientHandler.instance().getClient().theWorld; + } + + @Override + public void InitRendering() + { + ClientRegistry.bindTileEntitySpecialRenderer(TEAltar.class, new TEAltarRenderer()); + //MinecraftForgeClient.registerItemRenderer(ModBlocks.blockAltar.blockID, new TEAltarItemRenderer()); + //MinecraftForgeClient.registerItemRenderer(AlchemicalWizardry.blockWritingTable.blockID, new TEWritingTableItemRenderer()); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java new file mode 100644 index 00000000..d84a11dd --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java @@ -0,0 +1,298 @@ +package WayofTime.alchemicalWizardry.common; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IProjectile; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.PlayerCapabilities; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.potion.Potion; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.Vec3; +import net.minecraftforge.event.entity.living.LivingAttackEvent; +import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile; +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; + +public class AlchemicalWizardryEventHooks +{ + public static Map playerFlightBuff = new HashMap(); + public static Map playerBoostStepHeight = new HashMap(); + public static List playersWith1Step = new ArrayList(); + + @SubscribeEvent + public void onLivingJumpEvent(LivingJumpEvent event) + { + if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionBoost)) + { + int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionBoost).getAmplifier(); + event.entityLiving.motionY += (0.1f) * (2 + i); + } + } + + @SubscribeEvent + public void onEntityDamaged(LivingAttackEvent event) + { + EntityLivingBase entityAttacked = event.entityLiving; + + if (entityAttacked.isPotionActive(AlchemicalWizardry.customPotionReciprocation)) + { + Entity entityAttacking = event.source.getSourceOfDamage(); + + if (entityAttacking != null && entityAttacking instanceof EntityLivingBase) + { + int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionReciprocation).getAmplifier(); + float damageRecieve = event.ammount / 2 * (i + 1); + ((EntityLivingBase) entityAttacking).attackEntityFrom(DamageSource.generic, damageRecieve); + } + } + + if(entityAttacked.isPotionActive(AlchemicalWizardry.customPotionFlameCloak)) + { + int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFlameCloak).getAmplifier(); + + Entity entityAttacking = event.source.getSourceOfDamage(); + + if(entityAttacking != null && entityAttacking instanceof EntityLivingBase && !entityAttacking.isImmuneToFire() && !((EntityLivingBase)entityAttacking).isPotionActive(Potion.fireResistance)) + { + entityAttacking.attackEntityFrom(DamageSource.inFire, 2*i+2); + entityAttacking.setFire(3); + } + } + } + +// @ForgeSubscribe +// public void onFOVUpdate(FOVUpdateEvent event) +// { +// event.setResult(Result.DEFAULT); +// } + + @SubscribeEvent + public void onPlayerTickEnd(PlayerTickEvent event) + { + if(event.type.equals(Type.PLAYER) && event.phase.equals(TickEvent.Phase.END)) + { + ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, event.player.capabilities, Float.valueOf(0.1f), new String[]{"walkSpeed", "g", "field_75097_g"}); + } + } + + @SubscribeEvent + public void onEntityUpdate(LivingUpdateEvent event) + { + EntityLivingBase entityLiving = event.entityLiving; + double x = entityLiving.posX; + double y = entityLiving.posY; + double z = entityLiving.posZ; + + Vec3 blockVector = SpellHelper.getEntityBlockVector(entityLiving); + int xPos = (int)(blockVector.xCoord); + int yPos = (int)(blockVector.yCoord); + int zPos = (int)(blockVector.zCoord); + + if (entityLiving instanceof EntityPlayer && entityLiving.worldObj.isRemote) + { + EntityPlayer entityPlayer = (EntityPlayer) entityLiving; + boolean highStepListed = playersWith1Step.contains(entityPlayer.getDisplayName()); + boolean hasHighStep = entityPlayer.isPotionActive(AlchemicalWizardry.customPotionBoost); + + if (hasHighStep && !highStepListed) + { + playersWith1Step.add(SpellHelper.getUsername(entityPlayer)); + } + + if (!hasHighStep && highStepListed) + { + playersWith1Step.remove(SpellHelper.getUsername(entityPlayer)); + entityPlayer.stepHeight = 0.5F; + } + } + + if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionDrowning)) + { + int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionDrowning).getAmplifier(); + + if (event.entityLiving.worldObj.getWorldTime() % ((int) (20 / (i + 1))) == 0) + { + event.entityLiving.attackEntityFrom(DamageSource.drown, 2); + event.entityLiving.hurtResistantTime = Math.min(event.entityLiving.hurtResistantTime, 20 / (i + 1)); + } + } + + if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionBoost)) + { + int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionBoost).getAmplifier(); + EntityLivingBase entity = event.entityLiving; + //if(!entity.isSneaking()) + { + double percentIncrease = (i + 1) * 0.03d; + + if (event.entityLiving instanceof EntityPlayer) + { + EntityPlayer entityPlayer = (EntityPlayer) event.entityLiving; + entityPlayer.stepHeight = 1.0f; + + if (!entityPlayer.worldObj.isRemote) + { + float speed = ((Float) ReflectionHelper.getPrivateValue(PlayerCapabilities.class, entityPlayer.capabilities, new String[]{"walkSpeed", "g", "field_75097_g"})).floatValue(); + ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, entityPlayer.capabilities, Float.valueOf(speed + (float) percentIncrease), new String[]{"walkSpeed", "g", "field_75097_g"}); //CAUTION + } + } + } + } + + if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionProjProt)) + { + int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionProjProt).getAmplifier(); + EntityLivingBase entity = event.entityLiving; + int posX = (int) Math.round(entity.posX - 0.5f); + int posY = (int) Math.round(entity.posY); + int posZ = (int) Math.round(entity.posZ - 0.5f); + int d0 = i; + AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB(posX - 0.5, posY - 0.5, posZ - 0.5, posX + 0.5, posY + 0.5, posZ + 0.5).expand(d0, d0, d0); + List list = event.entityLiving.worldObj.getEntitiesWithinAABB(Entity.class, axisalignedbb); + Iterator iterator = list.iterator(); + EntityLivingBase livingEntity; + + while (iterator.hasNext()) + { + Entity projectile = (Entity) iterator.next(); + + if (projectile == null) + { + continue; + } + + if (!(projectile instanceof IProjectile)) + { + continue; + } + + if (projectile instanceof EntityArrow) + { + if (((EntityArrow) projectile).shootingEntity == null) + { + } else if (!(((EntityArrow) projectile).shootingEntity == null) && ((EntityArrow) projectile).shootingEntity.equals(entity)) + { + break; + } + } else if (projectile instanceof EnergyBlastProjectile) + { + if (!(((EnergyBlastProjectile) projectile).shootingEntity == null) && ((EnergyBlastProjectile) projectile).shootingEntity.equals(entity)) + { + break; + } + } + + double delX = projectile.posX - entity.posX; + double delY = projectile.posY - entity.posY; + double delZ = projectile.posZ - entity.posZ; + double curVel = Math.sqrt(delX * delX + delY * delY + delZ * delZ); + //NOTE: It appears that it constantly reverses the direction. + //Any way to do it only once? Or find the shooting entity? + delX /= curVel; + delY /= curVel; + delZ /= curVel; + double newVel = Math.sqrt(projectile.motionX * projectile.motionX + projectile.motionY * projectile.motionY + projectile.motionZ * projectile.motionZ); + projectile.motionX = newVel * delX; + projectile.motionY = newVel * delY; + projectile.motionZ = newVel * delZ; + //TODO make this not affect player's projectiles + } + } + + if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionFlight)) + { + if (event.entityLiving instanceof EntityPlayer) + { + EntityPlayer entityPlayer = (EntityPlayer) event.entityLiving; + String ownerName = SpellHelper.getUsername(entityPlayer); + playerFlightBuff.put(ownerName, true); + entityPlayer.capabilities.allowFlying = true; + //entityPlayer.sendPlayerAbilities(); + } + } else + { + if (event.entityLiving instanceof EntityPlayer) + { + EntityPlayer entityPlayer = (EntityPlayer) event.entityLiving; + String ownerName = SpellHelper.getUsername(entityPlayer); + + if (!playerFlightBuff.containsKey(ownerName)) + { + playerFlightBuff.put(ownerName, false); + } + + if (playerFlightBuff.get(ownerName)) + { + playerFlightBuff.put(ownerName, false); + + if (!entityPlayer.capabilities.isCreativeMode) + { + entityPlayer.capabilities.allowFlying = false; + entityPlayer.capabilities.isFlying = false; + entityPlayer.sendPlayerAbilities(); + } + } + } + } + + if(entityLiving.isPotionActive(AlchemicalWizardry.customPotionFlameCloak)) + { + entityLiving.worldObj.spawnParticle("flame", x+SpellHelper.gaussian(1),y-1.3+SpellHelper.gaussian(0.3),z+SpellHelper.gaussian(1), 0, 0.06d, 0); + + int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFlameCloak).getAmplifier(); + double range = i*0.5; + + List entities = SpellHelper.getEntitiesInRange(entityLiving.worldObj, x, y, z, range, range); + if(entities!=null) + { + for(Entity entity : entities) + { + if(!entity.equals(entityLiving)&&!entity.isImmuneToFire()&&!(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).isPotionActive(Potion.fireResistance))) + { + entity.setFire(3); + } + } + } + } + + if(entityLiving.isPotionActive(AlchemicalWizardry.customPotionIceCloak)) + { + if(entityLiving.worldObj.getWorldTime()%2==0) + entityLiving.worldObj.spawnParticle("reddust", x+SpellHelper.gaussian(1),y-1.3+SpellHelper.gaussian(0.3),z+SpellHelper.gaussian(1), 0x74,0xbb,0xfb); + + int r = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionIceCloak).getAmplifier(); + int horizRange = r+1; + int vertRange = 1; + + if(!entityLiving.worldObj.isRemote) + { + for(int i=-horizRange; i<=horizRange;i++) + { + for(int k=-horizRange; k<=horizRange;k++) + { + for(int j=-vertRange-1; j<=vertRange-1; j++) + { + SpellHelper.freezeWaterBlock(entityLiving.worldObj, xPos+i, yPos+j, zPos+k); + } + } + } + } + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryFuelHandler.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryFuelHandler.java new file mode 100644 index 00000000..ab5ddad9 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryFuelHandler.java @@ -0,0 +1,71 @@ +package WayofTime.alchemicalWizardry.common; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.items.LavaCrystal; +import cpw.mods.fml.common.IFuelHandler; + +public class AlchemicalWizardryFuelHandler implements IFuelHandler +{ + @Override + public int getBurnTime(ItemStack fuel) + { + ItemStack itemStack = fuel; + if(itemStack == null) + { + return 0; + } + + Item fuelItem = itemStack.getItem(); + + if (fuelItem.equals(ModItems.lavaCrystal)) + { + /*ItemStack newItem = new ItemStack(AlchemicalWizardry.lavaCrystal); + newItem.getItem().setDamage(newItem, 50); + fuel.getItem().setContainerItem(((LavaCrystal)newItem.getItem()).change()); + */ + LavaCrystal item = (LavaCrystal) fuel.getItem(); + + if (item.hasEnoughEssence(fuel)) + { + return 200; + } else + { + NBTTagCompound tag = itemStack.stackTagCompound; + + if (tag == null) + { + return 0; + } + + if (MinecraftServer.getServer() == null) + { + return 0; + } + + if (MinecraftServer.getServer().getConfigurationManager() == null) + { + return 0; + } + + EntityPlayer owner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(tag.getString("ownerName")); + + if (owner == null) + { + return 0; + } + + owner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + return 0; + } + } + + return 0; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryTickHandler.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryTickHandler.java new file mode 100644 index 00000000..40eaf0f1 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryTickHandler.java @@ -0,0 +1,47 @@ +package WayofTime.alchemicalWizardry.common; + +import java.util.EnumSet; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.PlayerCapabilities; +import net.minecraft.server.MinecraftServer; +import cpw.mods.fml.common.ObfuscationReflectionHelper; + +@Deprecated +public class AlchemicalWizardryTickHandler //implements ITickHandler +{ +// public void tickStart(EnumSet type, Object... tickData) +// { +// } +// +// public EnumSet ticks() +// { +// return EnumSet.of(TickType.PLAYER); +// } +// +// public String getLabel() +// { +// return "BloodMagic"; +// } +// +// public void tickEnd(EnumSet type, Object... tickData) +// { +// String[] usernames = MinecraftServer.getServer().getAllUsernames(); +// +// if (usernames == null) +// { +// return; +// } +// +// for (String userName : usernames) +// { +// EntityPlayer entityPlayer = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(userName); +// +// if (entityPlayer != null) +// { +// ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, entityPlayer.capabilities, Float.valueOf(0.1f), new String[]{"walkSpeed", "g", "field_75097_g"}); +// //entityPlayer.sendPlayerAbilities(); +// } +// } +// } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/ArmourComponent.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/ArmourComponent.java new file mode 100644 index 00000000..fb4f155b --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/ArmourComponent.java @@ -0,0 +1,23 @@ +package WayofTime.alchemicalWizardry.common; + +public class ArmourComponent +{ + private int xOff; + private int zOff; + + public ArmourComponent(int xOff, int zOff) + { + this.xOff = xOff; + this.zOff = zOff; + } + + public int getXOff() + { + return xOff; + } + + public int getZOff() + { + return zOff; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/ArmourUpgrade.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/ArmourUpgrade.java new file mode 100644 index 00000000..ce14e417 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/ArmourUpgrade.java @@ -0,0 +1,15 @@ +package WayofTime.alchemicalWizardry.common; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public interface ArmourUpgrade +{ + //Called when the armour ticks + public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack); + + public boolean isUpgrade(); + + public int getEnergyForTenSeconds(); +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/CommonProxy.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/CommonProxy.java new file mode 100644 index 00000000..43c7b129 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/CommonProxy.java @@ -0,0 +1,91 @@ +package WayofTime.alchemicalWizardry.common; + +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile; +import WayofTime.alchemicalWizardry.common.entity.projectile.EntityBloodLightProjectile; +import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaMainProjectile; +import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaSecondaryProjectile; +import WayofTime.alchemicalWizardry.common.entity.projectile.EntityMeteor; +import WayofTime.alchemicalWizardry.common.entity.projectile.ExplosionProjectile; +import WayofTime.alchemicalWizardry.common.entity.projectile.FireProjectile; +import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile; +import WayofTime.alchemicalWizardry.common.entity.projectile.IceProjectile; +import WayofTime.alchemicalWizardry.common.entity.projectile.LightningBoltProjectile; +import WayofTime.alchemicalWizardry.common.entity.projectile.MudProjectile; +import WayofTime.alchemicalWizardry.common.entity.projectile.TeleportProjectile; +import WayofTime.alchemicalWizardry.common.entity.projectile.WaterProjectile; +import WayofTime.alchemicalWizardry.common.entity.projectile.WindGustProjectile; +import WayofTime.alchemicalWizardry.common.spell.complex.EntitySpellProjectile; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import cpw.mods.fml.common.registry.EntityRegistry; +import cpw.mods.fml.common.registry.GameRegistry; + +public class CommonProxy +{ + public static String ITEMS_PNG = "/WayofTime/alchemicalWizardry/items.png"; + public static String BLOCK_PNG = "/WayofTime/alchemicalWizardry/block.png"; + + // Client stuff + public void registerRenderers() + { + // Nothing here as the server doesn't render graphics! + } + + public void registerEntities() + { + } + + public World getClientWorld() + { + return null; + } + + public void registerActions() + { + } + + public void registerEvents() + { + } + + public void registerSoundHandler() + { + // Nothing here as this is a server side proxy + } + + public void registerTileEntities() + { + GameRegistry.registerTileEntity(TEAltar.class, "containerAltar"); + GameRegistry.registerTileEntity(TEMasterStone.class, "containerMasterStone"); + } + + public void registerEntityTrackers() + { + EntityRegistry.registerModEntity(EnergyBlastProjectile.class, "energyBlastProjectile", 0, AlchemicalWizardry.instance, 128, 5, true); + EntityRegistry.registerModEntity(FireProjectile.class, "fireProjectile", 1, AlchemicalWizardry.instance, 128, 5, true); + EntityRegistry.registerModEntity(IceProjectile.class, "iceProjectile", 2, AlchemicalWizardry.instance, 128, 5, true); + EntityRegistry.registerModEntity(ExplosionProjectile.class, "explosionProjectile", 3, AlchemicalWizardry.instance, 128, 5, true); + EntityRegistry.registerModEntity(HolyProjectile.class, "holyProjectile", 4, AlchemicalWizardry.instance, 128, 5, true); + EntityRegistry.registerModEntity(WindGustProjectile.class, "windGustProjectile", 5, AlchemicalWizardry.instance, 128, 5, true); + EntityRegistry.registerModEntity(LightningBoltProjectile.class, "lightningBoltProjectile", 6, AlchemicalWizardry.instance, 128, 5, true); + EntityRegistry.registerModEntity(WaterProjectile.class, "waterProjectile", 7, AlchemicalWizardry.instance, 128, 5, true); + EntityRegistry.registerModEntity(MudProjectile.class, "mudProjectile", 8, AlchemicalWizardry.instance, 128, 5, true); + EntityRegistry.registerModEntity(TeleportProjectile.class, "teleportProjectile", 9, AlchemicalWizardry.instance, 128, 5, true); + EntityRegistry.registerModEntity(EntityEnergyBazookaMainProjectile.class, "energyBazookaMain", 10, AlchemicalWizardry.instance, 128, 3, true); + EntityRegistry.registerModEntity(EntityEnergyBazookaSecondaryProjectile.class, "energyBazookaSecondary", 11, AlchemicalWizardry.instance, 128, 3, true); + EntityRegistry.registerModEntity(EntityBloodLightProjectile.class, "bloodLightProjectile", 12, AlchemicalWizardry.instance, 128, 3, true); + EntityRegistry.registerModEntity(EntityMeteor.class, "Meteor", 13, AlchemicalWizardry.instance, 128, 3, true); + EntityRegistry.registerModEntity(EntitySpellProjectile.class, "spellProjectile", 14, AlchemicalWizardry.instance, 128, 3, true); + } + + public void registerTickHandlers() + { + } + + public void InitRendering() + { + // TODO Auto-generated method stub + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/EntityAIFly.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/EntityAIFly.java new file mode 100644 index 00000000..dffc65cf --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/EntityAIFly.java @@ -0,0 +1,5 @@ +package WayofTime.alchemicalWizardry.common; + +public class EntityAIFly +{ +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/EntityAITargetAggro.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/EntityAITargetAggro.java new file mode 100644 index 00000000..2b6fb25a --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/EntityAITargetAggro.java @@ -0,0 +1,24 @@ +package WayofTime.alchemicalWizardry.common; + +import WayofTime.alchemicalWizardry.common.entity.mob.EntityDemon; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; + +public class EntityAITargetAggro extends EntityAINearestAttackableTarget +{ + private EntityDemon theCreature; + + public EntityAITargetAggro(EntityDemon par1EntityDemon, Class par2Class, int par3, boolean par4) + { + super(par1EntityDemon, par2Class, par3, par4); + this.theCreature = par1EntityDemon; + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + @Override + public boolean shouldExecute() + { + return theCreature.isAggro() && super.shouldExecute(); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/EntityAirElemental.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/EntityAirElemental.java new file mode 100644 index 00000000..cc5ab8ed --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/EntityAirElemental.java @@ -0,0 +1,33 @@ +package WayofTime.alchemicalWizardry.common; + +import ibxm.Player; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityElemental; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class EntityAirElemental extends EntityElemental implements IMob +{ + public EntityAirElemental(World world) + { + super(world, AlchemicalWizardry.entityAirElementalID); + } + + public void inflictEffectOnEntity(Entity target) + { + if (target instanceof EntityPlayer) + { + SpellHelper.setPlayerSpeedFromServer((EntityPlayer)target, target.motionX, target.motionY + 3, target.motionZ); + ((EntityLivingBase) target).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 150, 0)); + } else if (target instanceof EntityLivingBase) + { + ((EntityLivingBase) target).motionY += 3.0D; + ((EntityLivingBase) target).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 150, 0)); + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/IBindable.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/IBindable.java new file mode 100644 index 00000000..5ecb1f5b --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/IBindable.java @@ -0,0 +1,5 @@ +package WayofTime.alchemicalWizardry.common; + +public interface IBindable +{ +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/IBindingAgent.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/IBindingAgent.java new file mode 100644 index 00000000..534d4b68 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/IBindingAgent.java @@ -0,0 +1,6 @@ +package WayofTime.alchemicalWizardry.common; + +public interface IBindingAgent +{ + public abstract float getSuccessRateForPotionNumber(int potionEffects); +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/ICatalyst.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/ICatalyst.java new file mode 100644 index 00000000..230cd51c --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/ICatalyst.java @@ -0,0 +1,8 @@ +package WayofTime.alchemicalWizardry.common; + +public interface ICatalyst +{ + public abstract int getCatalystLevel(); + + public abstract boolean isConcentration(); +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/IDemon.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/IDemon.java new file mode 100644 index 00000000..eab1d15e --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/IDemon.java @@ -0,0 +1,10 @@ +package WayofTime.alchemicalWizardry.common; + +public interface IDemon +{ + public abstract void setSummonedConditions(); + + public boolean isAggro(); + + public void setAggro(boolean aggro); +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/IFillingAgent.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/IFillingAgent.java new file mode 100644 index 00000000..2202a20d --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/IFillingAgent.java @@ -0,0 +1,6 @@ +package WayofTime.alchemicalWizardry.common; + +public interface IFillingAgent +{ + public abstract int getFilledAmountForPotionNumber(int potionEffects); +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/LifeBucketHandler.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/LifeBucketHandler.java new file mode 100644 index 00000000..472d5302 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/LifeBucketHandler.java @@ -0,0 +1,42 @@ +package WayofTime.alchemicalWizardry.common; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.player.FillBucketEvent; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.ModItems; +import cpw.mods.fml.common.eventhandler.Event.Result; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class LifeBucketHandler +{ + @SubscribeEvent + public void onBucketFill(FillBucketEvent event) + { + ItemStack result = fillCustomBucket(event.world, event.target); + + if (result == null) + { + return; + } + + event.result = result; + event.setResult(Result.ALLOW); + } + + public ItemStack fillCustomBucket(World world, MovingObjectPosition pos) + { + Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ); + + if (block!=null && (block.equals(ModBlocks.blockLifeEssence)) && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0) + { + world.setBlock(pos.blockX, pos.blockY, pos.blockZ, block); + return new ItemStack(ModItems.bucketLife); + } else + { + return null; + } + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/LifeEssence.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/LifeEssence.java new file mode 100644 index 00000000..22ede879 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/LifeEssence.java @@ -0,0 +1,28 @@ +package WayofTime.alchemicalWizardry.common; + +import net.minecraftforge.fluids.Fluid; + +public class LifeEssence extends Fluid +{ + public LifeEssence(String fluidName) + { + super(fluidName); + //setUnlocalizedName("lifeEssence"); + //setBlockID(id); + this.setDensity(2000); + this.setViscosity(2000); + //this.setFlowingIcon(flowingIcon) + } + + @Override + public int getColor() + { + return 0xEEEEEE; + } + + @Override + public String getLocalizedName() + { + return "Life Essence"; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/LifeEssenceNetwork.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/LifeEssenceNetwork.java new file mode 100644 index 00000000..3eadeea0 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/LifeEssenceNetwork.java @@ -0,0 +1,26 @@ +package WayofTime.alchemicalWizardry.common; + +import net.minecraft.nbt.NBTTagCompound; + +public class LifeEssenceNetwork extends net.minecraft.world.WorldSavedData +{ + public int currentEssence; + + public LifeEssenceNetwork(String par1Str) + { + super(par1Str); + currentEssence = 0; + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + currentEssence = nbttagcompound.getInteger("currentEssence"); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + nbttagcompound.setInteger("currentEssence", currentEssence); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/ModLivingDropsEvent.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/ModLivingDropsEvent.java new file mode 100644 index 00000000..3659dbfe --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/ModLivingDropsEvent.java @@ -0,0 +1,36 @@ +package WayofTime.alchemicalWizardry.common; + +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraftforge.event.entity.living.LivingDropsEvent; +import WayofTime.alchemicalWizardry.ModItems; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class ModLivingDropsEvent +{ + public static double rand; + + @SubscribeEvent + public void onEntityDrop(LivingDropsEvent event) + { + if (event.source.getDamageType().equals("player")) + { + rand = Math.random(); + + if (!(event.entityLiving instanceof EntityAnimal)) + { + PotionEffect effect = event.entityLiving.getActivePotionEffect(Potion.weakness); + + if (effect != null) + { + if (effect.getAmplifier() >= 2) + if (rand < 0.50d) + { + event.entityLiving.dropItem(ModItems.weakBloodShard, 1); + } + } + } + } + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/NewPacketHandler.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/NewPacketHandler.java new file mode 100644 index 00000000..9f95230f --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/NewPacketHandler.java @@ -0,0 +1,686 @@ +package WayofTime.alchemicalWizardry.common; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; + +import java.util.EnumMap; + +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEOrientable; +import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal; +import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth; +import WayofTime.alchemicalWizardry.common.tileEntity.TESocket; +import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; +import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.network.FMLEmbeddedChannel; +import cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** +* Handles the packet wrangling for IronChest +* @author cpw +* +*/ +public enum NewPacketHandler +{ + INSTANCE; + + /** + * Our channel "pair" from {@link NetworkRegistry} + */ + private EnumMap channels; + + + /** + * Make our packet handler, and add an {@link IronChestCodec} always + */ + private NewPacketHandler() + { + // request a channel pair for IronChest from the network registry + // Add the IronChestCodec as a member of both channel pipelines + this.channels = NetworkRegistry.INSTANCE.newChannel("BloodMagic", new TEAltarCodec(), new TEOrientableCodec(), new TEPedestalCodec(), new TEPlinthCodec(), new TESocketCodec()); + if (FMLCommonHandler.instance().getSide() == Side.CLIENT) + { + addClientHandler(); + } + } + + + /** + * This is only called on the client side - it adds an + * {@link IronChestMessageHandler} to the client side pipeline, since the + * only place we expect to handle messages is on the client. + */ + @SideOnly(Side.CLIENT) + private void addClientHandler() + { + FMLEmbeddedChannel clientChannel = this.channels.get(Side.CLIENT); + // These two lines find the existing codec (Ironchestcodec) and insert our message handler after it + // in the pipeline + String tileAltarCodec = clientChannel.findChannelHandlerNameForType(TEAltarCodec.class); + clientChannel.pipeline().addAfter(tileAltarCodec, "TEAltarHandler", new TEAltarMessageHandler()); + + String tileOrientableCodec = clientChannel.findChannelHandlerNameForType(TEOrientableCodec.class); + clientChannel.pipeline().addAfter(tileOrientableCodec, "TEOrientableHandler", new TEOrientableMessageHandler()); + + String tilePedestalCodec = clientChannel.findChannelHandlerNameForType(TEPedestalCodec.class); + clientChannel.pipeline().addAfter(tilePedestalCodec, "TEPedestalHandler", new TEPedestalMessageHandler()); + + String tilePlinthCodec = clientChannel.findChannelHandlerNameForType(TEPlinthCodec.class); + clientChannel.pipeline().addAfter(tilePlinthCodec, "TEPlinthHandler", new TEPlinthMessageHandler()); + + String tileSocketCodec = clientChannel.findChannelHandlerNameForType(TESocketCodec.class); + clientChannel.pipeline().addAfter(tileSocketCodec, "TESocketHandler", new TESocketMessageHandler()); + } + + + /** + * This class simply handles the {@link IronChestMessage} when it's received + * at the client side It can contain client only code, because it's only run + * on the client. + * + * @author cpw + * + */ + private static class TEAltarMessageHandler extends SimpleChannelInboundHandler + { + @Override + protected void channelRead0(ChannelHandlerContext ctx, TEAltarMessage msg) throws Exception + { + World world = AlchemicalWizardry.proxy.getClientWorld(); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); + if (te instanceof TEAltar) + { + TEAltar altar = (TEAltar) te; + + altar.handlePacketData(msg.items, msg.fluids, msg.capacity); + } + } + } + + private static class TEOrientableMessageHandler extends SimpleChannelInboundHandler + { + @Override + protected void channelRead0(ChannelHandlerContext ctx, TEOrientableMessage msg) throws Exception + { + World world = AlchemicalWizardry.proxy.getClientWorld(); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); + if (te instanceof TEOrientable) + { + TEOrientable tile = (TEOrientable)te; + + ((TEOrientable) te).setInputDirection(ForgeDirection.getOrientation(msg.input)); + ((TEOrientable) te).setOutputDirection(ForgeDirection.getOrientation(msg.output)); + } + } + } + + private static class TEPedestalMessageHandler extends SimpleChannelInboundHandler + { + @Override + protected void channelRead0(ChannelHandlerContext ctx, TEPedestalMessage msg) throws Exception + { + World world = AlchemicalWizardry.proxy.getClientWorld(); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); + if (te instanceof TEPedestal) + { + TEPedestal pedestal = (TEPedestal) te; + + pedestal.handlePacketData(msg.items); + } + } + } + + private static class TEPlinthMessageHandler extends SimpleChannelInboundHandler + { + @Override + protected void channelRead0(ChannelHandlerContext ctx, TEPlinthMessage msg) throws Exception + { + World world = AlchemicalWizardry.proxy.getClientWorld(); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); + if (te instanceof TEPlinth) + { + TEPlinth Plinth = (TEPlinth) te; + + Plinth.handlePacketData(msg.items); + } + } + } + + private static class TESocketMessageHandler extends SimpleChannelInboundHandler + { + @Override + protected void channelRead0(ChannelHandlerContext ctx, TESocketMessage msg) throws Exception + { + World world = AlchemicalWizardry.proxy.getClientWorld(); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); + if (te instanceof TESocket) + { + TESocket Socket = (TESocket) te; + + Socket.handlePacketData(msg.items); + } + } + } + + private static class TETeleposerMessageHandler extends SimpleChannelInboundHandler + { + @Override + protected void channelRead0(ChannelHandlerContext ctx, TETeleposerMessage msg) throws Exception + { + World world = AlchemicalWizardry.proxy.getClientWorld(); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); + if (te instanceof TETeleposer) + { + TETeleposer Teleposer = (TETeleposer) te; + + Teleposer.handlePacketData(msg.items); + } + } + } + + private static class TEWritingTableMessageHandler extends SimpleChannelInboundHandler + { + @Override + protected void channelRead0(ChannelHandlerContext ctx, TEWritingTableMessage msg) throws Exception + { + World world = AlchemicalWizardry.proxy.getClientWorld(); + TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z); + if (te instanceof TEWritingTable) + { + TEWritingTable WritingTable = (TEWritingTable) te; + + WritingTable.handlePacketData(msg.items); + } + } + } + + public static class TEAltarMessage + { + int x; + int y; + int z; + + int[] items; + int[] fluids; + int capacity; + } + + public static class TEOrientableMessage + { + int x; + int y; + int z; + + int input; + int output; + } + + public static class TEPedestalMessage + { + int x; + int y; + int z; + + int[] items; + } + + public static class TEPlinthMessage + { + int x; + int y; + int z; + + int[] items; + } + + public static class TESocketMessage + { + int x; + int y; + int z; + + int[] items; + } + + public static class TETeleposerMessage + { + int x; + int y; + int z; + + int[] items; + } + + public static class TEWritingTableMessage + { + int x; + int y; + int z; + + int[] items; + } + + private class TEAltarCodec extends FMLIndexedMessageToMessageCodec + { + public TEAltarCodec() + { + addDiscriminator(0, TEAltarMessage.class); + } + + @Override + public void encodeInto(ChannelHandlerContext ctx, TEAltarMessage msg, ByteBuf target) throws Exception + { + target.writeInt(msg.x); + target.writeInt(msg.y); + target.writeInt(msg.z); + + target.writeBoolean(msg.items != null); + if (msg.items != null) + { + int[] items = msg.items; + for (int j = 0; j < items.length; j++) + { + int i = items[j]; + target.writeInt(i); + } + } + + if(msg.fluids != null) + { + int[] fluids = msg.fluids; + for (int j = 0; j < fluids.length; j++) + { + int i = fluids[j]; + target.writeInt(i); + } + } + + target.writeInt(msg.capacity); + } + + + @Override + public void decodeInto(ChannelHandlerContext ctx, ByteBuf dat, TEAltarMessage msg) + { + msg.x = dat.readInt(); + msg.y = dat.readInt(); + msg.z = dat.readInt(); + int typDat = dat.readByte(); + boolean hasStacks = dat.readBoolean(); + + msg.items = new int[TEAltar.sizeInv*3]; + if (hasStacks) + { + msg.items = new int[TEAltar.sizeInv*3]; + for (int i = 0; i < msg.items.length; i++) + { + msg.items[i] = dat.readInt(); + } + } + + msg.fluids = new int[6]; + for (int i = 0; i < msg.fluids.length; i++) + { + msg.fluids[i] = dat.readInt(); + } + + msg.capacity = dat.readInt(); + } + } + + private class TEOrientableCodec extends FMLIndexedMessageToMessageCodec + { + public TEOrientableCodec() + { + addDiscriminator(0, TEOrientableMessage.class); + } + + @Override + public void encodeInto(ChannelHandlerContext ctx, TEOrientableMessage msg, ByteBuf target) throws Exception + { + target.writeInt(msg.x); + target.writeInt(msg.y); + target.writeInt(msg.z); + + target.writeInt(msg.input); + target.writeInt(msg.output); + } + + @Override + public void decodeInto(ChannelHandlerContext ctx, ByteBuf dat, TEOrientableMessage msg) + { + msg.x = dat.readInt(); + msg.y = dat.readInt(); + msg.z = dat.readInt(); + + msg.input = dat.readInt(); + msg.output = dat.readInt(); + } + } + + private class TEPedestalCodec extends FMLIndexedMessageToMessageCodec + { + public TEPedestalCodec() + { + addDiscriminator(0, TEPedestalMessage.class); + } + + @Override + public void encodeInto(ChannelHandlerContext ctx, TEPedestalMessage msg, ByteBuf target) throws Exception + { + target.writeInt(msg.x); + target.writeInt(msg.y); + target.writeInt(msg.z); + + target.writeBoolean(msg.items != null); + if (msg.items != null) + { + int[] items = msg.items; + for (int j = 0; j < items.length; j++) + { + int i = items[j]; + target.writeInt(i); + } + } + } + + @Override + public void decodeInto(ChannelHandlerContext ctx, ByteBuf dat, TEPedestalMessage msg) + { + msg.x = dat.readInt(); + msg.y = dat.readInt(); + msg.z = dat.readInt(); + int typDat = dat.readByte(); + boolean hasStacks = dat.readBoolean(); + + msg.items = new int[TEPedestal.sizeInv*3]; + if (hasStacks) + { + msg.items = new int[TEPedestal.sizeInv*3]; + for (int i = 0; i < msg.items.length; i++) + { + msg.items[i] = dat.readInt(); + } + } + } + } + + private class TEPlinthCodec extends FMLIndexedMessageToMessageCodec + { + public TEPlinthCodec() + { + addDiscriminator(0, TEPlinthMessage.class); + } + + @Override + public void encodeInto(ChannelHandlerContext ctx, TEPlinthMessage msg, ByteBuf target) throws Exception + { + target.writeInt(msg.x); + target.writeInt(msg.y); + target.writeInt(msg.z); + + target.writeBoolean(msg.items != null); + if (msg.items != null) + { + int[] items = msg.items; + for (int j = 0; j < items.length; j++) + { + int i = items[j]; + target.writeInt(i); + } + } + } + + @Override + public void decodeInto(ChannelHandlerContext ctx, ByteBuf dat, TEPlinthMessage msg) + { + msg.x = dat.readInt(); + msg.y = dat.readInt(); + msg.z = dat.readInt(); + int typDat = dat.readByte(); + boolean hasStacks = dat.readBoolean(); + + msg.items = new int[TEPlinth.sizeInv*3]; + if (hasStacks) + { + msg.items = new int[TEPlinth.sizeInv*3]; + for (int i = 0; i < msg.items.length; i++) + { + msg.items[i] = dat.readInt(); + } + } + } + } + + private class TESocketCodec extends FMLIndexedMessageToMessageCodec + { + public TESocketCodec() + { + addDiscriminator(0, TESocketMessage.class); + } + + @Override + public void encodeInto(ChannelHandlerContext ctx, TESocketMessage msg, ByteBuf target) throws Exception + { + target.writeInt(msg.x); + target.writeInt(msg.y); + target.writeInt(msg.z); + + target.writeBoolean(msg.items != null); + if (msg.items != null) + { + int[] items = msg.items; + for (int j = 0; j < items.length; j++) + { + int i = items[j]; + target.writeInt(i); + } + } + } + + @Override + public void decodeInto(ChannelHandlerContext ctx, ByteBuf dat, TESocketMessage msg) + { + msg.x = dat.readInt(); + msg.y = dat.readInt(); + msg.z = dat.readInt(); + int typDat = dat.readByte(); + boolean hasStacks = dat.readBoolean(); + + msg.items = new int[TESocket.sizeInv*3]; + if (hasStacks) + { + msg.items = new int[TESocket.sizeInv*3]; + for (int i = 0; i < msg.items.length; i++) + { + msg.items[i] = dat.readInt(); + } + } + } + } + + private class TETeleposerCodec extends FMLIndexedMessageToMessageCodec + { + public TETeleposerCodec() + { + addDiscriminator(0, TETeleposerMessage.class); + } + + @Override + public void encodeInto(ChannelHandlerContext ctx, TETeleposerMessage msg, ByteBuf target) throws Exception + { + target.writeInt(msg.x); + target.writeInt(msg.y); + target.writeInt(msg.z); + + target.writeBoolean(msg.items != null); + if (msg.items != null) + { + int[] items = msg.items; + for (int j = 0; j < items.length; j++) + { + int i = items[j]; + target.writeInt(i); + } + } + } + + @Override + public void decodeInto(ChannelHandlerContext ctx, ByteBuf dat, TETeleposerMessage msg) + { + msg.x = dat.readInt(); + msg.y = dat.readInt(); + msg.z = dat.readInt(); + int typDat = dat.readByte(); + boolean hasStacks = dat.readBoolean(); + + msg.items = new int[TETeleposer.sizeInv*3]; + if (hasStacks) + { + msg.items = new int[TETeleposer.sizeInv*3]; + for (int i = 0; i < msg.items.length; i++) + { + msg.items[i] = dat.readInt(); + } + } + } + } + + private class TEWritingTableCodec extends FMLIndexedMessageToMessageCodec + { + public TEWritingTableCodec() + { + addDiscriminator(0, TEWritingTableMessage.class); + } + + @Override + public void encodeInto(ChannelHandlerContext ctx, TEWritingTableMessage msg, ByteBuf target) throws Exception + { + target.writeInt(msg.x); + target.writeInt(msg.y); + target.writeInt(msg.z); + + target.writeBoolean(msg.items != null); + if (msg.items != null) + { + int[] items = msg.items; + for (int j = 0; j < items.length; j++) + { + int i = items[j]; + target.writeInt(i); + } + } + } + + @Override + public void decodeInto(ChannelHandlerContext ctx, ByteBuf dat, TEWritingTableMessage msg) + { + msg.x = dat.readInt(); + msg.y = dat.readInt(); + msg.z = dat.readInt(); + int typDat = dat.readByte(); + boolean hasStacks = dat.readBoolean(); + + msg.items = new int[TEWritingTable.sizeInv*3]; + if (hasStacks) + { + msg.items = new int[TEWritingTable.sizeInv*3]; + for (int i = 0; i < msg.items.length; i++) + { + msg.items[i] = dat.readInt(); + } + } + } + } + + //Packets to be obtained + public static Packet getPacket(TEAltar tileAltar) + { + TEAltarMessage msg = new TEAltarMessage(); + msg.x = tileAltar.xCoord; + msg.y = tileAltar.yCoord; + msg.z = tileAltar.zCoord; + msg.items = tileAltar.buildIntDataList(); + msg.fluids = tileAltar.buildFluidList(); + msg.capacity = tileAltar.getCapacity(); + + return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); + } + + public static Packet getPacket(TEOrientable tileOrientable) + { + TEOrientableMessage msg = new TEOrientableMessage(); + msg.x = tileOrientable.xCoord; + msg.y = tileOrientable.yCoord; + msg.z = tileOrientable.zCoord; + msg.input = tileOrientable.getIntForForgeDirection(tileOrientable.getInputDirection()); + msg.output = tileOrientable.getIntForForgeDirection(tileOrientable.getOutputDirection()); + + return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); + } + + public static Packet getPacket(TEPedestal tilePedestal) + { + TEPedestalMessage msg = new TEPedestalMessage(); + msg.x = tilePedestal.xCoord; + msg.y = tilePedestal.yCoord; + msg.z = tilePedestal.zCoord; + msg.items = tilePedestal.buildIntDataList(); + + return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); + } + + public static Packet getPacket(TEPlinth tilePlinth) + { + TEPlinthMessage msg = new TEPlinthMessage(); + msg.x = tilePlinth.xCoord; + msg.y = tilePlinth.yCoord; + msg.z = tilePlinth.zCoord; + msg.items = tilePlinth.buildIntDataList(); + + return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); + } + + public static Packet getPacket(TESocket tileSocket) + { + TESocketMessage msg = new TESocketMessage(); + msg.x = tileSocket.xCoord; + msg.y = tileSocket.yCoord; + msg.z = tileSocket.zCoord; + msg.items = tileSocket.buildIntDataList(); + + return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); + } + + public static Packet getPacket(TETeleposer tileTeleposer) + { + TETeleposerMessage msg = new TETeleposerMessage(); + msg.x = tileTeleposer.xCoord; + msg.y = tileTeleposer.yCoord; + msg.z = tileTeleposer.zCoord; + msg.items = tileTeleposer.buildIntDataList(); + + return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); + } + + public static Packet getPacket(TEWritingTable tileWritingTable) + { + TEWritingTableMessage msg = new TEWritingTableMessage(); + msg.x = tileWritingTable.xCoord; + msg.y = tileWritingTable.yCoord; + msg.z = tileWritingTable.zCoord; + msg.items = tileWritingTable.buildIntDataList(); + + return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/PacketHandler.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/PacketHandler.java new file mode 100644 index 00000000..48642e37 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/PacketHandler.java @@ -0,0 +1,966 @@ +package WayofTime.alchemicalWizardry.common; + +import ibxm.Player; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.util.Random; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEOrientable; +import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal; +import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth; +import WayofTime.alchemicalWizardry.common.tileEntity.TESocket; +import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; +import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; + +import com.google.common.io.ByteArrayDataInput; +import com.google.common.io.ByteStreams; +import com.jcraft.jogg.Packet; + +public class PacketHandler //implements IPacketHandler +{ +// @Override +// public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) +// { +// if (packet.channel.equals("BloodAltar")) +// { +// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data); +// int x = dat.readInt(); +// int y = dat.readInt(); +// int z = dat.readInt(); +// boolean hasStacks = dat.readByte() != 0; +// int[] items = new int[0]; +// +// if (hasStacks) +// { +// items = new int[1 * 3]; +// +// for (int i = 0; i < items.length; i++) +// { +// items[i] = dat.readInt(); +// } +// } +// +// int fluidIDMain = dat.readInt(); +// int fluidAmountMain = dat.readInt(); +// int fluidIDOutput = dat.readInt(); +// int fluidAmountOutput = dat.readInt(); +// int fluidIDInput = dat.readInt(); +// int fluidAmountInput = dat.readInt(); +// int capacity = dat.readInt(); +// World world = AlchemicalWizardry.proxy.getClientWorld(); +// TileEntity tileEntity = world.getBlockTileEntity(x, y, z); +// +// if (tileEntity instanceof TEAltar) +// { +// TEAltar tileEntityAltar = (TEAltar) tileEntity; +// FluidStack flMain = new FluidStack(fluidIDMain, fluidAmountMain); +// FluidStack flOutput = new FluidStack(fluidIDOutput, fluidAmountOutput); +// FluidStack flInput = new FluidStack(fluidIDInput, fluidAmountInput); +// tileEntityAltar.handlePacketData(items, flMain, flOutput, flInput, capacity); +// } +// } else if (packet.channel.equals("FallReset")) +// { +// if (player instanceof EntityPlayer) +// { +// ((EntityPlayer) player).fallDistance = 0; +// } +// } else if (packet.channel.equals("particle")) +// { +// ByteArrayInputStream bin = new ByteArrayInputStream(packet.data); +// DataInputStream din = new DataInputStream(bin); +// Random rand = new Random(); +// +// try +// { +// double x = din.readDouble(); +// double y = din.readDouble(); +// double z = din.readDouble(); +// short particleType = din.readShort(); +// World world = ((EntityPlayer) player).worldObj; +// +// if (particleType == 1) +// { +// world.spawnParticle("mobSpell", x + 0.5D + rand.nextGaussian() / 8, y + 1.1D, z + 0.5D + rand.nextGaussian() / 8, 0.5117D, 0.0117D, 0.0117D); +// } +// +// if (particleType == 2) +// { +// world.spawnParticle("reddust", x + 0.5D + rand.nextGaussian() / 8, y + 1.1D, z + 0.5D + rand.nextGaussian() / 8, 0.82D, 0.941D, 0.91D); +// } +// +// if (particleType == 3) +// { +// world.spawnParticle("mobSpell", x + 0.5D + rand.nextGaussian() / 8, y + 1.1D, z + 0.5D + rand.nextGaussian() / 8, 1.0D, 0.371D, 0.371D); +// } +// +// if (particleType == 4) +// { +// float f = (float) 1.0F; +// float f1 = f * 0.6F + 0.4F; +// float f2 = f * f * 0.7F - 0.5F; +// float f3 = f * f * 0.6F - 0.7F; +// +// for (int l = 0; l < 8; ++l) +// { +// world.spawnParticle("reddust", x + Math.random() - Math.random(), y + Math.random() - Math.random(), z + Math.random() - Math.random(), f1, f2, f3); +// } +// } +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// } else if (packet.channel.equals("CustomParticle")) +// { +// ByteArrayInputStream bin = new ByteArrayInputStream(packet.data); +// DataInputStream din = new DataInputStream(bin); +// Random rand = new Random(); +// +// try +// { +// World world = ((EntityPlayer) player).worldObj; +// int size = din.readInt(); +// String str = ""; +// +// for (int i = 0; i < size; i++) +// { +// str = str + din.readChar(); +// } +// +// double x = din.readDouble(); +// double y = din.readDouble(); +// double z = din.readDouble(); +// double xVel = din.readDouble(); +// double yVel = din.readDouble(); +// double zVel = din.readDouble(); +// world.spawnParticle(str, x, y, z, xVel, yVel, zVel); +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// } else if (packet.channel.equals("SetLifeEssence")) //Sets the data for the character +// { +// ByteArrayInputStream bin = new ByteArrayInputStream(packet.data); +// DataInputStream din = new DataInputStream(bin); +// +// try +// { +// EntityPlayer user = (EntityPlayer) player; +// int length = din.readInt(); +// String ownerName = ""; +// +// for (int i = 0; i < length; i++) +// { +// ownerName = ownerName + din.readChar(); +// } +// +// int addedEssence = din.readInt(); +// int maxEssence = din.readInt(); +// World world = MinecraftServer.getServer().worldServers[0]; +// LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); +// +// if (data == null) +// { +// data = new LifeEssenceNetwork(ownerName); +// world.setItemData(ownerName, data); +// } +// +// if (addedEssence > 0) +// { +// if (data.currentEssence < maxEssence) +// { +// data.currentEssence = Math.min(maxEssence, data.currentEssence + addedEssence); +// data.markDirty(); +// } +// +// if (!user.capabilities.isCreativeMode) +// { +// for (int i = 0; i < ((addedEssence + 99) / 100); i++) +// { +// //player.setEntityHealth((player.getHealth()-1)); +// user.setHealth((user.getHealth() - 1)); +// +// if (user.getHealth() <= 0.5f) +// { +// //user.inventory.dropAllItems(); +// user.onDeath(DamageSource.generic); +// return; +// } +// } +// } +// } else +// { +// int removedEssence = -addedEssence; +// +// if ((data.currentEssence - removedEssence) >= 0) +// { +// data.currentEssence -= removedEssence; +// data.markDirty(); +// } else +// { +// if (removedEssence >= 100) +// { +// for (int i = 0; i < ((removedEssence + 99) / 100); i++) +// { +// //player.setEntityHealth((player.getHealth()-1)); +// user.setHealth((user.getHealth() - 1)); +// +// if (user.getHealth() <= 0.5f) +// { +// //user.inventory.dropAllItems(); +// user.onDeath(DamageSource.generic); +// return; +// } +// } +// } else +// { +// if (user.worldObj.rand.nextInt(100) <= removedEssence) +// { +// user.setHealth((user.getHealth() - 1)); +// +// if (user.getHealth() <= 0.5f) +// { +// //user.inventory.dropAllItems(); +// user.onDeath(DamageSource.generic); +// return; +// } +// } +// } +// } +// } +// +// //PacketDispatcher.sendPacketToPlayer(PacketHandler.getPacket(ownerName), (Player)user); +//// data.currentEssence = addedEssence; +//// data.markDirty(); +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// } else if (packet.channel.equals("InfiniteLPPath")) +// { +// ByteArrayInputStream bin = new ByteArrayInputStream(packet.data); +// DataInputStream din = new DataInputStream(bin); +// +// try +// { +// EntityPlayer user = (EntityPlayer) player; +// int length = din.readInt(); +// String ownerName = ""; +// +// for (int i = 0; i < length; i++) +// { +// ownerName = ownerName + din.readChar(); +// } +// +// boolean fill = din.readBoolean(); +// World world = MinecraftServer.getServer().worldServers[0]; +// LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); +// +// if (data == null) +// { +// data = new LifeEssenceNetwork(ownerName); +// world.setItemData(ownerName, data); +// } +// +// if (fill) +// { +// data.currentEssence += 1000000; +// data.markDirty(); +// } else +// { +// data.currentEssence = 0; +// data.markDirty(); +// } +// +// //PacketDispatcher.sendPacketToPlayer(PacketHandler.getPacket(ownerName), (Player)user); +//// data.currentEssence = addedEssence; +//// data.markDirty(); +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// } else if (packet.channel.equals("GetLifeEssence")) +// { +// ByteArrayInputStream bin = new ByteArrayInputStream(packet.data); +// DataInputStream din = new DataInputStream(bin); +// +// try +// { +// int length = din.readInt(); +// String ownerName = ""; +// +// for (int i = 0; i < length; i++) +// { +// ownerName = ownerName + din.readChar(); +// } +// +// World world = MinecraftServer.getServer().worldServers[0]; +// LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); +// +// if (data == null) +// { +// data = new LifeEssenceNetwork(ownerName); +// world.setItemData(ownerName, data); +// } +// +// if (player instanceof EntityPlayer) +// { +// EntityPlayer owner = (EntityPlayer) player; +// ChatMessageComponent chatmessagecomponent = new ChatMessageComponent(); +// //chatmessagecomponent.func_111072_b("Current Essence: " + data.currentEssence + "LP"); +// chatmessagecomponent.addText("Current Essence: " + data.currentEssence + "LP"); +// owner.sendChatToPlayer(chatmessagecomponent); +// } +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// } else if (packet.channel.equals("GetAltarEssence")) +// { +// ByteArrayInputStream bin = new ByteArrayInputStream(packet.data); +// DataInputStream din = new DataInputStream(bin); +// +// try +// { +// int x = din.readInt(); +// int y = din.readInt(); +// int z = din.readInt(); +// +// if (player instanceof EntityPlayer) +// { +// EntityPlayer owner = (EntityPlayer) player; +// World world = owner.worldObj; +// TEAltar tileEntity = (TEAltar) world.getBlockTileEntity(x, y, z); +// +// if (tileEntity != null) +// { +// int level = UpgradedAltars.isAltarValid(world, x, y, z); +// ChatMessageComponent chatmessagecomponent = new ChatMessageComponent(); +// chatmessagecomponent.addText("Altar's Current Essence: " + tileEntity.getFluidAmount() + "LP" + "\n" + "Altar's Current Tier: " + level + "\nCapacity: " + tileEntity.getCapacity() + "LP"); +// //chatmessagecomponent.addText(); +// owner.sendChatToPlayer(chatmessagecomponent); +// } +// } +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// } else if (packet.channel.equals("TESocket")) +// { +// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data); +// int x = dat.readInt(); +// int y = dat.readInt(); +// int z = dat.readInt(); +// boolean hasStacks = dat.readByte() != 0; +// int[] items = new int[0]; +// +// if (hasStacks) +// { +// items = new int[1 * 3]; +// +// for (int i = 0; i < items.length; i++) +// { +// items[i] = dat.readInt(); +// } +// } +// +// World world = AlchemicalWizardry.proxy.getClientWorld(); +// TileEntity tileEntity = world.getBlockTileEntity(x, y, z); +// +// if (tileEntity instanceof TESocket) +// { +// TESocket tileEntityAltar = (TESocket) tileEntity; +// tileEntityAltar.handlePacketData(items); +// } +// } else if (packet.channel.equals("TEWritingTable")) +// { +// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data); +// int x = dat.readInt(); +// int y = dat.readInt(); +// int z = dat.readInt(); +// boolean hasStacks = dat.readByte() != 0; +// int[] items = new int[0]; +// +// if (hasStacks) +// { +// items = new int[7 * 3]; +// +// for (int i = 0; i < items.length; i++) +// { +// items[i] = dat.readInt(); +// } +// } +// +// World world = AlchemicalWizardry.proxy.getClientWorld(); +// TileEntity tileEntity = world.getBlockTileEntity(x, y, z); +// +// if (tileEntity instanceof TEWritingTable) +// { +// TEWritingTable tileEntityAltar = (TEWritingTable) tileEntity; +// tileEntityAltar.handlePacketData(items); +// } +// } else if (packet.channel.equals("TEOrientor")) +// { +// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data); +// int x = dat.readInt(); +// int y = dat.readInt(); +// int z = dat.readInt(); +// World world = AlchemicalWizardry.proxy.getClientWorld(); +// TileEntity tileEntity = world.getBlockTileEntity(x, y, z); +// +// if (tileEntity instanceof TEOrientable) +// { +// TEOrientable tileEntityOrientable = (TEOrientable) tileEntity; +// tileEntityOrientable.setInputDirection(ForgeDirection.getOrientation(dat.readInt())); +// tileEntityOrientable.setOutputDirection(ForgeDirection.getOrientation(dat.readInt())); +// world.markBlockForRenderUpdate(x, y, z); +// } +// } else if (packet.channel.equals("TEPedestal")) +// { +// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data); +// int x = dat.readInt(); +// int y = dat.readInt(); +// int z = dat.readInt(); +// boolean hasStacks = dat.readByte() != 0; +// int[] items = new int[0]; +// +// if (hasStacks) +// { +// items = new int[1 * 3]; +// +// for (int i = 0; i < items.length; i++) +// { +// items[i] = dat.readInt(); +// } +// } +// +// World world = AlchemicalWizardry.proxy.getClientWorld(); +// TileEntity tileEntity = world.getBlockTileEntity(x, y, z); +// +// if (tileEntity instanceof TEPedestal) +// { +// TEPedestal tileEntityAltar = (TEPedestal) tileEntity; +// tileEntityAltar.handlePacketData(items); +// } +// } else if (packet.channel.equals("TEPlinth")) +// { +// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data); +// int x = dat.readInt(); +// int y = dat.readInt(); +// int z = dat.readInt(); +// boolean hasStacks = dat.readByte() != 0; +// int[] items = new int[0]; +// +// if (hasStacks) +// { +// items = new int[1 * 3]; +// +// for (int i = 0; i < items.length; i++) +// { +// items[i] = dat.readInt(); +// } +// } +// +// World world = AlchemicalWizardry.proxy.getClientWorld(); +// TileEntity tileEntity = world.getBlockTileEntity(x, y, z); +// +// if (tileEntity instanceof TEPlinth) +// { +// TEPlinth tileEntityAltar = (TEPlinth) tileEntity; +// tileEntityAltar.handlePacketData(items); +// } +// } else if (packet.channel.equals("TETeleposer")) +// { +// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data); +// int x = dat.readInt(); +// int y = dat.readInt(); +// int z = dat.readInt(); +// boolean hasStacks = dat.readByte() != 0; +// int[] items = new int[0]; +// +// if (hasStacks) +// { +// items = new int[1 * 3]; +// +// for (int i = 0; i < items.length; i++) +// { +// items[i] = dat.readInt(); +// } +// } +// +// World world = AlchemicalWizardry.proxy.getClientWorld(); +// TileEntity tileEntity = world.getBlockTileEntity(x, y, z); +// +// if (tileEntity instanceof TETeleposer) +// { +// TETeleposer tileEntityAltar = (TETeleposer) tileEntity; +// tileEntityAltar.handlePacketData(items); +// } +// } else if (packet.channel.equals("SetPlayerVel")) +// { +// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data); +// double xVel = dat.readDouble(); +// double yVel = dat.readDouble(); +// double zVel = dat.readDouble(); +// ((EntityPlayer) player).setVelocity(xVel, yVel, zVel); +// } else if (packet.channel.equals("SetPlayerPos")) +// { +// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data); +// double xVel = dat.readDouble(); +// double yVel = dat.readDouble(); +// double zVel = dat.readDouble(); +// ((EntityPlayer) player).setPosition(xVel, yVel, zVel); +// } +// } +// +// public static Packet getPacket(TEAltar tileEntity) +// { +// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); +// DataOutputStream dos = new DataOutputStream(bos); +// int[] items = tileEntity.buildIntDataList(); +// boolean hasStacks = (items != null); +// +// try +// { +// dos.writeInt(tileEntity.xCoord); +// dos.writeInt(tileEntity.yCoord); +// dos.writeInt(tileEntity.zCoord); +// dos.writeByte(hasStacks ? 1 : 0); +// +// if (hasStacks) +// { +// for (int i = 0; i < 3; i++) +// { +// dos.writeInt(items[i]); +// } +// } +// +// FluidStack flMain = tileEntity.getFluid(); +// +// if (flMain == null) +// { +// dos.writeInt(AlchemicalWizardry.lifeEssenceFluid.getBlockID()); +// dos.writeInt(0); +// } else +// { +// dos.writeInt(flMain.fluidID); +// dos.writeInt(flMain.amount); +// } +// +// FluidStack flOut = tileEntity.getOutputFluid(); +// +// if (flOut == null) +// { +// dos.writeInt(AlchemicalWizardry.lifeEssenceFluid.getBlockID()); +// dos.writeInt(0); +// } else +// { +// dos.writeInt(flOut.fluidID); +// dos.writeInt(flOut.amount); +// } +// +// FluidStack flIn = tileEntity.getInputFluid(); +// +// if (flIn == null) +// { +// dos.writeInt(AlchemicalWizardry.lifeEssenceFluid.getBlockID()); +// dos.writeInt(0); +// } else +// { +// dos.writeInt(flIn.fluidID); +// dos.writeInt(flIn.amount); +// } +// +// dos.writeInt(tileEntity.capacity); +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// +// Packet250CustomPayload pkt = new Packet250CustomPayload(); +// pkt.channel = "BloodAltar"; +// pkt.data = bos.toByteArray(); +// pkt.length = bos.size(); +// pkt.isChunkDataPacket = true; +// return pkt; +// } +// +// public static Packet getPacket(TESocket tileEntity) +// { +// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); +// DataOutputStream dos = new DataOutputStream(bos); +// int[] items = tileEntity.buildIntDataList(); +// boolean hasStacks = (items != null); +// +// try +// { +// dos.writeInt(tileEntity.xCoord); +// dos.writeInt(tileEntity.yCoord); +// dos.writeInt(tileEntity.zCoord); +// dos.writeByte(hasStacks ? 1 : 0); +// +// if (hasStacks) +// { +// for (int i = 0; i < 3; i++) +// { +// dos.writeInt(items[i]); +// } +// } +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// +// Packet250CustomPayload pkt = new Packet250CustomPayload(); +// pkt.channel = "TESocket"; +// pkt.data = bos.toByteArray(); +// pkt.length = bos.size(); +// pkt.isChunkDataPacket = true; +// return pkt; +// } +// +// public static Packet getPacket(String ownerName, int addedEssence, int maxEssence) +// //Packet to be sent to server to change essence +// { +// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); +// DataOutputStream dos = new DataOutputStream(bos); +// +// try +// { +// dos.writeInt(ownerName.length()); +// dos.writeChars(ownerName); +// dos.writeInt(addedEssence); +// dos.writeInt(maxEssence); //Used for Blood Orbs, but does nothing for other items +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// +// Packet250CustomPayload pkt = new Packet250CustomPayload(); +// pkt.channel = "SetLifeEssence"; +// pkt.data = bos.toByteArray(); +// pkt.length = bos.size(); +// //pkt.isChunkDataPacket = true; +// return pkt; +// } +// +// public static Packet getPacket(String ownerName) //stores the current essence in the player's NBT +// { +// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); +// DataOutputStream dos = new DataOutputStream(bos); +// +// try +// { +// dos.writeInt(ownerName.length()); +// dos.writeChars(ownerName); +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// +// Packet250CustomPayload pkt = new Packet250CustomPayload(); +// pkt.channel = "GetLifeEssence"; +// pkt.data = bos.toByteArray(); +// pkt.length = bos.size(); +// //pkt.isChunkDataPacket = true; +// return pkt; +// } +// +// public static Packet getAltarPacket(int x, int y, int z) +// { +// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); +// DataOutputStream dos = new DataOutputStream(bos); +// +// try +// { +// dos.writeInt(x); +// dos.writeInt(y); +// dos.writeInt(z); +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// +// Packet250CustomPayload pkt = new Packet250CustomPayload(); +// pkt.channel = "GetAltarEssence"; +// pkt.data = bos.toByteArray(); +// pkt.length = bos.size(); +// //pkt.isChunkDataPacket = true; +// return pkt; +// } +// +// public static Packet getPacket(TEWritingTable tileEntity) +// { +// // TODO Auto-generated method stub +// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); +// DataOutputStream dos = new DataOutputStream(bos); +// int[] items = tileEntity.buildIntDataList(); +// boolean hasStacks = (items != null); +// +// try +// { +// dos.writeInt(tileEntity.xCoord); +// dos.writeInt(tileEntity.yCoord); +// dos.writeInt(tileEntity.zCoord); +// dos.writeByte(hasStacks ? 1 : 0); +// +// if (hasStacks) +// { +// for (int i = 0; i < 3 * 7; i++) +// { +// dos.writeInt(items[i]); +// } +// } +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// +// Packet250CustomPayload pkt = new Packet250CustomPayload(); +// pkt.channel = "TEWritingTable"; +// pkt.data = bos.toByteArray(); +// pkt.length = bos.size(); +// pkt.isChunkDataPacket = true; +// return pkt; +// } +// +// public static Packet getPacket(TEPedestal tileEntity) +// { +// // TODO Auto-generated method stub +// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); +// DataOutputStream dos = new DataOutputStream(bos); +// int[] items = tileEntity.buildIntDataList(); +// boolean hasStacks = (items != null); +// +// try +// { +// dos.writeInt(tileEntity.xCoord); +// dos.writeInt(tileEntity.yCoord); +// dos.writeInt(tileEntity.zCoord); +// dos.writeByte(hasStacks ? 1 : 0); +// +// if (hasStacks) +// { +// for (int i = 0; i < 3 * 1; i++) +// { +// dos.writeInt(items[i]); +// } +// } +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// +// Packet250CustomPayload pkt = new Packet250CustomPayload(); +// pkt.channel = "TEPedestal"; +// pkt.data = bos.toByteArray(); +// pkt.length = bos.size(); +// pkt.isChunkDataPacket = true; +// return pkt; +// } +// +// public static Packet getPacket(TEPlinth tileEntity) +// { +// // TODO Auto-generated method stub +// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); +// DataOutputStream dos = new DataOutputStream(bos); +// int[] items = tileEntity.buildIntDataList(); +// boolean hasStacks = (items != null); +// +// try +// { +// dos.writeInt(tileEntity.xCoord); +// dos.writeInt(tileEntity.yCoord); +// dos.writeInt(tileEntity.zCoord); +// dos.writeByte(hasStacks ? 1 : 0); +// +// if (hasStacks) +// { +// for (int i = 0; i < 3 * 1; i++) +// { +// dos.writeInt(items[i]); +// } +// } +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// +// Packet250CustomPayload pkt = new Packet250CustomPayload(); +// pkt.channel = "TEPlinth"; +// pkt.data = bos.toByteArray(); +// pkt.length = bos.size(); +// pkt.isChunkDataPacket = true; +// return pkt; +// } +// +// public static Packet getPacket(TETeleposer tileEntity) +// { +// // TODO Auto-generated method stub +// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); +// DataOutputStream dos = new DataOutputStream(bos); +// int[] items = tileEntity.buildIntDataList(); +// boolean hasStacks = (items != null); +// +// try +// { +// dos.writeInt(tileEntity.xCoord); +// dos.writeInt(tileEntity.yCoord); +// dos.writeInt(tileEntity.zCoord); +// dos.writeByte(hasStacks ? 1 : 0); +// +// if (hasStacks) +// { +// for (int i = 0; i < 3 * 1; i++) +// { +// dos.writeInt(items[i]); +// } +// } +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// +// Packet250CustomPayload pkt = new Packet250CustomPayload(); +// pkt.channel = "TETeleposer"; +// pkt.data = bos.toByteArray(); +// pkt.length = bos.size(); +// pkt.isChunkDataPacket = true; +// return pkt; +// } +// +// public static Packet getCustomParticlePacket(String str, double x, double y, double z, double xVel, double yVel, double zVel) +// { +// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); +// DataOutputStream dos = new DataOutputStream(bos); +// +// try +// { +// dos.writeInt(str.length()); +// dos.writeChars(str); +// dos.writeDouble(x); +// dos.writeDouble(y); +// dos.writeDouble(z); +// dos.writeDouble(xVel); +// dos.writeDouble(yVel); +// dos.writeDouble(zVel); +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// +// Packet250CustomPayload pkt = new Packet250CustomPayload(); +// pkt.channel = "CustomParticle"; +// pkt.data = bos.toByteArray(); +// pkt.length = bos.size(); +// pkt.isChunkDataPacket = false; +// return pkt; +// } +// +// public static Packet getPlayerVelocitySettingPacket(double xVel, double yVel, double zVel) +// { +// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); +// DataOutputStream dos = new DataOutputStream(bos); +// +// try +// { +// dos.writeDouble(xVel); +// dos.writeDouble(yVel); +// dos.writeDouble(zVel); +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// +// Packet250CustomPayload pkt = new Packet250CustomPayload(); +// pkt.channel = "SetPlayerVel"; +// pkt.data = bos.toByteArray(); +// pkt.length = bos.size(); +// pkt.isChunkDataPacket = false; +// return pkt; +// } +// +// public static Packet getPlayerPositionSettingPacket(double xVel, double yVel, double zVel) +// { +// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); +// DataOutputStream dos = new DataOutputStream(bos); +// +// try +// { +// dos.writeDouble(xVel); +// dos.writeDouble(yVel); +// dos.writeDouble(zVel); +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// +// Packet250CustomPayload pkt = new Packet250CustomPayload(); +// pkt.channel = "SetPlayerPos"; +// pkt.data = bos.toByteArray(); +// pkt.length = bos.size(); +// pkt.isChunkDataPacket = false; +// return pkt; +// } +// +// public static Packet getCreativeCheatPacket(String ownerName, boolean isFill) +// { +// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); +// DataOutputStream dos = new DataOutputStream(bos); +// +// try +// { +// dos.writeInt(ownerName.length()); +// dos.writeChars(ownerName); +// dos.writeBoolean(isFill); +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// +// Packet250CustomPayload pkt = new Packet250CustomPayload(); +// pkt.channel = "InfiniteLPPath"; +// pkt.data = bos.toByteArray(); +// pkt.length = bos.size(); +// pkt.isChunkDataPacket = false; +// return pkt; +// } +// +// public static Packet getBlockOrientationPacket(TEOrientable tileEntity) +// { +// ByteArrayOutputStream bos = new ByteArrayOutputStream(140); +// DataOutputStream dos = new DataOutputStream(bos); +// +// try +// { +// dos.writeInt(tileEntity.xCoord); +// dos.writeInt(tileEntity.yCoord); +// dos.writeInt(tileEntity.zCoord); +// dos.writeInt(tileEntity.getIntForForgeDirection(tileEntity.getInputDirection())); +// dos.writeInt(tileEntity.getIntForForgeDirection(tileEntity.getOutputDirection())); +// } catch (IOException e) +// { +// e.printStackTrace(); +// } +// +// Packet250CustomPayload pkt = new Packet250CustomPayload(); +// pkt.channel = "TEOrientor"; +// pkt.data = bos.toByteArray(); +// pkt.length = bos.size(); +// pkt.isChunkDataPacket = true; +// return pkt; +// } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/PlinthComponent.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/PlinthComponent.java new file mode 100644 index 00000000..6232828a --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/PlinthComponent.java @@ -0,0 +1,37 @@ +package WayofTime.alchemicalWizardry.common; + +public class PlinthComponent +{ + public int xOffset; + public int yOffset; + public int zOffset; + public int ring; + + public PlinthComponent(int xOffset, int yOffset, int zOffset, int ring) + { + this.xOffset = xOffset; + this.yOffset = yOffset; + this.zOffset = zOffset; + this.ring = ring; + } + + public int getXOffset() + { + return xOffset; + } + + public int getYOffset() + { + return yOffset; + } + + public int getZOffset() + { + return zOffset; + } + + public int getRing() + { + return ring; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionBoost.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionBoost.java new file mode 100644 index 00000000..ce4de5f2 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionBoost.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common; + +import net.minecraft.potion.Potion; + +public class PotionBoost extends Potion +{ + public PotionBoost(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionDrowning.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionDrowning.java new file mode 100644 index 00000000..26efc6af --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionDrowning.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common; + +import net.minecraft.potion.Potion; + +public class PotionDrowning extends Potion +{ + public PotionDrowning(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionFlameCloak.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionFlameCloak.java new file mode 100644 index 00000000..e25a7c06 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionFlameCloak.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common; + +import net.minecraft.potion.Potion; + +public class PotionFlameCloak extends Potion +{ + public PotionFlameCloak(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionFlight.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionFlight.java new file mode 100644 index 00000000..9b7940d0 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionFlight.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common; + +import net.minecraft.potion.Potion; + +public class PotionFlight extends Potion +{ + public PotionFlight(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionIceCloak.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionIceCloak.java new file mode 100644 index 00000000..18eba799 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionIceCloak.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common; + +import net.minecraft.potion.Potion; + +public class PotionIceCloak extends Potion +{ + public PotionIceCloak(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionInhibit.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionInhibit.java new file mode 100644 index 00000000..0014b9c3 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionInhibit.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common; + +import net.minecraft.potion.Potion; + +public class PotionInhibit extends Potion +{ + public PotionInhibit(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionProjectileProtect.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionProjectileProtect.java new file mode 100644 index 00000000..b3c70c6b --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionProjectileProtect.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common; + +import net.minecraft.potion.Potion; + +public class PotionProjectileProtect extends Potion +{ + public PotionProjectileProtect(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionReciprocation.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionReciprocation.java new file mode 100644 index 00000000..2f105b23 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/PotionReciprocation.java @@ -0,0 +1,18 @@ +package WayofTime.alchemicalWizardry.common; + +import net.minecraft.potion.Potion; + +public class PotionReciprocation extends Potion +{ + public PotionReciprocation(int par1, boolean par2, int par3) + { + super(par1, par2, par3); + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/alchemy/AlchemicalPotionCreationHandler.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/alchemy/AlchemicalPotionCreationHandler.java new file mode 100644 index 00000000..55085785 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/alchemy/AlchemicalPotionCreationHandler.java @@ -0,0 +1,108 @@ +package WayofTime.alchemicalWizardry.common.alchemy; + +import java.util.ArrayList; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; + +public class AlchemicalPotionCreationHandler +{ + public static ArrayList registeredPotionEffects = new ArrayList(); + + public static void initializePotions() + { + addPotion(new ItemStack(Items.ghast_tear), Potion.regeneration.id, 450); + addPotion(new ItemStack(Items.golden_carrot), Potion.nightVision.id, 2 * 60 * 20); + addPotion(new ItemStack(Items.magma_cream), Potion.fireResistance.id, 2 * 60 * 20); + addPotion(new ItemStack(Items.sugar), Potion.moveSpeed.id, 2 * 60 * 20); + addPotion(new ItemStack(Items.speckled_melon), Potion.heal.id, 2 * 60 * 20); + addPotion(new ItemStack(Items.spider_eye), Potion.poison.id, 450); + addPotion(new ItemStack(Items.fermented_spider_eye), Potion.weakness.id, 450); + addPotion(new ItemStack(Items.blaze_powder), Potion.damageBoost.id, 2 * 60 * 20); + addPotion(new ItemStack(ModItems.aether), Potion.jump.id, 2 * 60 * 20); + addPotion(new ItemStack(Items.clay_ball), Potion.moveSlowdown.id, 450); + addPotion(new ItemStack(Items.redstone), Potion.digSpeed.id, 2 * 60 * 20); + addPotion(new ItemStack(Items.potionitem, 1, 0), AlchemicalWizardry.customPotionDrowning.id, 450); + //addPotion(new ItemStack(Item.goldenCarrot),Potion.nightVision.id,2*60*20); + addPotion(new ItemStack(Items.glass_bottle), Potion.invisibility.id, 2 * 60 * 20); + addPotion(new ItemStack(Items.diamond), Potion.resistance.id, 2 * 60 * 20); + addPotion(new ItemStack(Items.poisonous_potato), Potion.field_76443_y.id, 2); //saturation + addPotion(new ItemStack(ModItems.demonBloodShard), Potion.field_76434_w.id, 4 * 60 * 20); //health boost + addPotion(new ItemStack(ModItems.weakBloodShard), Potion.field_76444_x.id, 4 * 60 * 20); //Absorption + addPotion(new ItemStack(ModItems.terrae), AlchemicalWizardry.customPotionBoost.id, 1 * 60 * 20); + addPotion(new ItemStack(Items.feather), AlchemicalWizardry.customPotionFlight.id, 1 * 60 * 20); + addPotion(new ItemStack(Items.arrow), AlchemicalWizardry.customPotionReciprocation.id, 1 * 60 * 20); + } + + public static void addPotion(ItemStack itemStack, int potionID, int tickDuration) + { + registeredPotionEffects.add(new AlchemyPotionHandlerComponent(itemStack, potionID, tickDuration)); + } + + public static int getPotionIDForStack(ItemStack itemStack) + { + for (AlchemyPotionHandlerComponent aphc : registeredPotionEffects) + { + if (aphc.compareItemStack(itemStack)) + { + return aphc.getPotionID(); + } + } + + return -1; + } + + public static int getPotionTickDurationForStack(ItemStack itemStack) + { + { + for (AlchemyPotionHandlerComponent aphc : registeredPotionEffects) + { + if (aphc.compareItemStack(itemStack)) + { + return aphc.getTickDuration(); + } + } + + return -1; + } + } + + public static boolean containsRegisteredPotionIngredient(ItemStack[] stackList) + { + for (ItemStack is : stackList) + { + for (AlchemyPotionHandlerComponent aphc : registeredPotionEffects) + { + if (aphc.compareItemStack(is)) + { + return true; + } + } + } + + return false; + } + + public static int getRegisteredPotionIngredientPosition(ItemStack[] stackList) + { + int i = 0; + + for (ItemStack is : stackList) + { + for (AlchemyPotionHandlerComponent aphc : registeredPotionEffects) + { + if (aphc.compareItemStack(is)) + { + return i; + } + } + + i++; + } + + return -1; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/alchemy/AlchemyPotionHandlerComponent.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/alchemy/AlchemyPotionHandlerComponent.java new file mode 100644 index 00000000..58c6120e --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/alchemy/AlchemyPotionHandlerComponent.java @@ -0,0 +1,52 @@ +package WayofTime.alchemicalWizardry.common.alchemy; + +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class AlchemyPotionHandlerComponent +{ + private ItemStack itemStack; + private int potionID; + private int tickDuration; + + public AlchemyPotionHandlerComponent(ItemStack itemStack, int potionID, int tickDuration) + { + this.itemStack = itemStack; + this.potionID = potionID; + this.tickDuration = tickDuration; + } + + public boolean compareItemStack(ItemStack comparedStack) + { + if (comparedStack != null && itemStack != null) + { + if (comparedStack.getItem() instanceof ItemBlock) + { + if (itemStack.getItem() instanceof ItemBlock) + { + return comparedStack.equals(itemStack) && comparedStack.getItemDamage() == itemStack.getItemDamage(); + } + } else if (!(itemStack.getItem() instanceof ItemBlock)) + { + return comparedStack.equals(itemStack) && comparedStack.getItemDamage() == itemStack.getItemDamage(); + } + } + + return false; + } + + public ItemStack getItemStack() + { + return itemStack; + } + + public int getPotionID() + { + return this.potionID; + } + + public int getTickDuration() + { + return this.tickDuration; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/alchemy/AlchemyPotionHelper.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/alchemy/AlchemyPotionHelper.java new file mode 100644 index 00000000..47bcd609 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/alchemy/AlchemyPotionHelper.java @@ -0,0 +1,76 @@ +package WayofTime.alchemicalWizardry.common.alchemy; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; + +public class AlchemyPotionHelper +{ + private int potionID; + private int tickDuration; + private int concentration; + private int durationFactor; + + public AlchemyPotionHelper(int potionID, int tickDuration, int concentration, int durationFactor) + { + this.potionID = potionID; + this.tickDuration = tickDuration; + this.concentration = concentration; + this.durationFactor = durationFactor; + } + + public void setConcentration(int concentration) + { + this.concentration = concentration; + } + + public void setDurationFactor(int durationFactor) + { + this.durationFactor = durationFactor; + } + + public int getPotionID() + { + return this.potionID; + } + + public int getTickDuration() + { + return this.tickDuration; + } + + public int getConcentration() + { + return this.concentration; + } + + public int getdurationFactor() + { + return this.durationFactor; + } + + public PotionEffect getPotionEffect() + { + if (potionID == Potion.heal.id || potionID == Potion.harm.id) + { + return (new PotionEffect(potionID, 1, concentration)); + } + + return (new PotionEffect(potionID, (int) (tickDuration * Math.pow(0.5f, concentration) * Math.pow(8.0f / 3.0f, durationFactor)), concentration)); + } + + public static AlchemyPotionHelper readEffectFromNBT(NBTTagCompound tagCompound) + { + return new AlchemyPotionHelper(tagCompound.getInteger("potionID"), tagCompound.getInteger("tickDuration"), tagCompound.getInteger("concentration"), tagCompound.getInteger("durationFactor")); + } + + public static NBTTagCompound setEffectToNBT(AlchemyPotionHelper aph) + { + NBTTagCompound tagCompound = new NBTTagCompound(); + tagCompound.setInteger("potionID", aph.getPotionID()); + tagCompound.setInteger("tickDuration", aph.getTickDuration()); + tagCompound.setInteger("concentration", aph.getConcentration()); + tagCompound.setInteger("durationFactor", aph.getdurationFactor()); + return tagCompound; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/alchemy/AlchemyRecipe.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/alchemy/AlchemyRecipe.java new file mode 100644 index 00000000..a3423fa3 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/alchemy/AlchemyRecipe.java @@ -0,0 +1,181 @@ +package WayofTime.alchemicalWizardry.common.alchemy; + +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +public class AlchemyRecipe +{ + private ItemStack output; + private ItemStack[] recipe; + private int bloodOrbLevel; + private int amountNeeded; + + public AlchemyRecipe(ItemStack output, int amountNeeded, ItemStack[] recipe, int bloodOrbLevel) + { + this.output = output; + this.recipe = recipe; + this.amountNeeded = amountNeeded; + this.bloodOrbLevel = bloodOrbLevel; + } + + public boolean doesRecipeMatch(ItemStack[] items, int slottedBloodOrbLevel) + { + if (slottedBloodOrbLevel < bloodOrbLevel) + { + return false; + } + + ItemStack[] recipe = new ItemStack[5]; + + if (items.length < 5) + { + return false; + } + + if (this.recipe.length != 5) + { + ItemStack[] newRecipe = new ItemStack[5]; + + for (int i = 0; i < 5; i++) + { + if (i + 1 > this.recipe.length) + { + newRecipe[i] = null; + } else + { + newRecipe[i] = this.recipe[i]; + } + } + + recipe = newRecipe; + } else + { + recipe = this.recipe; + } + + boolean[] checkList = new boolean[5]; + + for (int i = 0; i < 5; i++) + { + checkList[i] = false; + } + + for (int i = 0; i < 5; i++) + { + ItemStack recipeItemStack = recipe[i]; + + if (recipeItemStack == null) + { + continue; + } + + boolean test = false; + + for (int j = 0; j < 5; j++) + { + if (checkList[j]) + { + continue; + } + + ItemStack checkedItemStack = items[j]; + + if (checkedItemStack == null) + { + continue; + } + + boolean quickTest = false; + + if (recipeItemStack.getItem() instanceof ItemBlock) + { + if (checkedItemStack.getItem() instanceof ItemBlock) + { + quickTest = true; + } + } else if (!(checkedItemStack.getItem() instanceof ItemBlock)) + { + quickTest = true; + } + + if (!quickTest) + { + continue; + } + + if ((checkedItemStack.getItemDamage() == recipeItemStack.getItemDamage() || OreDictionary.WILDCARD_VALUE == recipeItemStack.getItemDamage()) && checkedItemStack.equals(recipeItemStack)) + { + test = true; + checkList[j] = true; + break; + } + } + + if (!test) + { + return false; + } + } + + return true; +// if(slottedBloodOrbLevel recipes = new ArrayList(); + + public static void registerRecipe(ItemStack output, int amountNeeded, ItemStack[] recipe, int bloodOrbLevel) + { + recipes.add(new AlchemyRecipe(output, amountNeeded, recipe, bloodOrbLevel)); + } + + public static ItemStack getResult(ItemStack[] recipe, ItemStack bloodOrb) + { + if (bloodOrb == null) + { + return null; + } + + if (!(bloodOrb.getItem() instanceof EnergyBattery)) + { + return null; + } + + int bloodOrbLevel = ((EnergyBattery) bloodOrb.getItem()).getOrbLevel(); + + for (AlchemyRecipe ar : recipes) + { + if (ar.doesRecipeMatch(recipe, bloodOrbLevel)) + { + return (ar.getResult()); + } + } + + return null; + } + + public static int getAmountNeeded(ItemStack[] recipe, ItemStack bloodOrb) + { + if (bloodOrb == null) + { + return 0; + } + + if (!(bloodOrb.getItem() instanceof EnergyBattery)) + { + return 0; + } + + int bloodOrbLevel = ((EnergyBattery) bloodOrb.getItem()).getOrbLevel(); + + for (AlchemyRecipe ar : recipes) + { + if (ar.doesRecipeMatch(recipe, bloodOrbLevel)) + { + return (ar.getAmountNeeded()); + } + } + + return 0; + } + + public static ItemStack[] getRecipeForItemStack(ItemStack itemStack) + { + for (AlchemyRecipe ar : recipes) + { + ItemStack result = ar.getResult(); + + if (result != null) + { + if (result.isItemEqual(itemStack)) + { + return ar.getRecipe(); + } + } + } + + return null; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/altarRecipeRegistry/AltarRecipe.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/altarRecipeRegistry/AltarRecipe.java new file mode 100644 index 00000000..a7599f70 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/altarRecipeRegistry/AltarRecipe.java @@ -0,0 +1,70 @@ +package WayofTime.alchemicalWizardry.common.altarRecipeRegistry; + +import net.minecraft.item.ItemStack; + +public class AltarRecipe +{ + public int minTier; + public int liquidRequired; + public boolean canBeFilled; //Tells the system that the item is an orb + public int consumptionRate; + public int drainRate; + public ItemStack requiredItem; + public ItemStack result; + + public AltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired, int consumptionRate, int drainRate, boolean canBeFilled) + { + this.result = result; + this.requiredItem = requiredItem; + this.minTier = minTier; + this.liquidRequired = liquidRequired; + this.consumptionRate = consumptionRate; + this.drainRate = drainRate; + this.canBeFilled = canBeFilled; + } + + public ItemStack getResult() + { + return this.result; + } + + public ItemStack getRequiredItem() + { + return this.requiredItem; + } + + public boolean doesRequiredItemMatch(ItemStack comparedStack, int tierCheck) + { + if(comparedStack == null || this.requiredItem == null) + { + return false; + } + + return tierCheck>=minTier && this.requiredItem.isItemEqual(comparedStack); + } + + public int getMinTier() + { + return this.minTier; + } + + public int getLiquidRequired() + { + return this.liquidRequired; + } + + public int getConsumptionRate() + { + return this.consumptionRate; + } + + public int getDrainRate() + { + return this.drainRate; + } + + public boolean getCanBeFilled() + { + return this.canBeFilled; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/altarRecipeRegistry/AltarRecipeRegistry.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/altarRecipeRegistry/AltarRecipeRegistry.java new file mode 100644 index 00000000..88ef593b --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/altarRecipeRegistry/AltarRecipeRegistry.java @@ -0,0 +1,100 @@ +package WayofTime.alchemicalWizardry.common.altarRecipeRegistry; + +import java.util.LinkedList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.ModItems; + +public class AltarRecipeRegistry +{ + public static List altarRecipes = new LinkedList(); + + public static void registerAltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired, int consumptionRate, int drainRate, boolean canBeFilled) + { + altarRecipes.add(new AltarRecipe(result, requiredItem, minTier, liquidRequired, consumptionRate, drainRate, canBeFilled)); + } + + public static void registerAltarOrbRecipe(ItemStack orbStack, int minTier, int consumptionRate) + { + registerAltarRecipe(null, orbStack, minTier, 0, consumptionRate, 0, true); + } + + public static void initRecipes() + { + registerAltarRecipe(new ItemStack(ModItems.weakBloodOrb), new ItemStack(Items.diamond),1,2000,2,1,false); + registerAltarRecipe(new ItemStack(ModItems.apprenticeBloodOrb), new ItemStack(Items.emerald),2,5000,5,5,false); + registerAltarRecipe(new ItemStack(ModItems.magicianBloodOrb), new ItemStack(Blocks.gold_block),3,25000,20,20,false); + registerAltarRecipe(new ItemStack(ModItems.masterBloodOrb), new ItemStack(ModItems.weakBloodShard),4,40000,30,50,false); + registerAltarRecipe(new ItemStack(ModItems.archmageBloodOrb), new ItemStack(ModItems.demonBloodShard),5,75000,50,100,false); + + registerAltarOrbRecipe(new ItemStack(ModItems.weakBloodOrb),1,2); + registerAltarOrbRecipe(new ItemStack(ModItems.apprenticeBloodOrb),2,5); + registerAltarOrbRecipe(new ItemStack(ModItems.magicianBloodOrb),3,15); + registerAltarOrbRecipe(new ItemStack(ModItems.masterBloodOrb),4,25); + registerAltarOrbRecipe(new ItemStack(ModItems.archmageBloodOrb),5,50); + + registerAltarRecipe(new ItemStack(ModItems.telepositionFocus), new ItemStack(Items.ender_pearl),4,2000,10,10,false); + registerAltarRecipe(new ItemStack(ModItems.enhancedTelepositionFocus), new ItemStack(ModItems.telepositionFocus),4,10000,25,15,false); + registerAltarRecipe(new ItemStack(ModItems.imbuedSlate), new ItemStack(ModItems.imbuedSlate),4,15000,20,20,false); + registerAltarRecipe(new ItemStack(ModItems.duskScribeTool), new ItemStack(Blocks.coal_block),4,2000,20,10,false); + registerAltarRecipe(new ItemStack(ModBlocks.bloodSocket), new ItemStack(ModBlocks.emptySocket),3,30000,40,10,false); + registerAltarRecipe(new ItemStack(ModItems.earthScribeTool), new ItemStack(Blocks.obsidian),3,1000,5,5,false); + registerAltarRecipe(new ItemStack(ModItems.waterScribeTool), new ItemStack(Blocks.lapis_block),3,1000,5,5,false); + registerAltarRecipe(new ItemStack(ModItems.blankSpell), new ItemStack(Blocks.glass),2,1000,5,5,false); + registerAltarRecipe(new ItemStack(ModItems.blankSlate), new ItemStack(Blocks.stone),1,1000,5,5,false); + registerAltarRecipe(new ItemStack(ModItems.activationCrystal), new ItemStack(ModItems.lavaCrystal),3,10000,20,10,false); + registerAltarRecipe(new ItemStack(ModItems.fireScribeTool), new ItemStack(Items.magma_cream),3,1000,5,5,false); + registerAltarRecipe(new ItemStack(ModItems.airScribeTool), new ItemStack(Items.ghast_tear),3,1000,5,5,false); + registerAltarRecipe(new ItemStack(ModItems.imbuedSlate), new ItemStack(ModItems.reinforcedSlate),3,5000,15,10,false); + registerAltarRecipe(new ItemStack(ModItems.daggerOfSacrifice), new ItemStack(Items.iron_sword),2,3000,5,5,false); + registerAltarRecipe(new ItemStack(ModItems.alchemyFlask), new ItemStack(Items.glass_bottle),2,2000,5,5,false); + registerAltarRecipe(new ItemStack(ModItems.reinforcedSlate), new ItemStack(ModItems.blankSlate),2,2000,5,5,false); + registerAltarRecipe(new ItemStack(ModItems.bucketLife), new ItemStack(Items.bucket),1,1000,5,0,false); + } + + public static boolean isRequiredItemValid(ItemStack testItem, int currentTierAltar) + { + for(AltarRecipe recipe : altarRecipes) + { + if(recipe.doesRequiredItemMatch(testItem, currentTierAltar)) + { + return true; + } + } + + return false; + } + + public static ItemStack getItemForItemAndTier(ItemStack testItem, int currentTierAltar) + { + for(AltarRecipe recipe : altarRecipes) + { + if(recipe.doesRequiredItemMatch(testItem, currentTierAltar)) + { + return recipe.getResult(); + } + } + + return null; + } + + public static AltarRecipe getAltarRecipeForItemAndTier(ItemStack testItem, int currentTierAltar) + { + for(AltarRecipe recipe : altarRecipes) + { + if(recipe.doesRequiredItemMatch(testItem, currentTierAltar)) + { + return recipe; + } + } + + return null; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/ArmourForge.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/ArmourForge.java new file mode 100644 index 00000000..1c4a7fdf --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/ArmourForge.java @@ -0,0 +1,335 @@ +package WayofTime.alchemicalWizardry.common.block; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.ArmourComponent; +import WayofTime.alchemicalWizardry.common.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.BoundArmour; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TESocket; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ArmourForge extends Block +{ + public static List helmetList = new ArrayList(); + public static List plateList = new ArrayList(); + public static List leggingsList = new ArrayList(); + public static List bootsList = new ArrayList(); + + public ArmourForge() + { + super(Material.iron); + setHardness(2.0F); + setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + //setUnlocalizedName("armourForge"); + // TODO Auto-generated constructor stub + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:SoulForge"); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) + { + if (world.isRemote) + { + return false; + } + + int armourType = getArmourType(world, x, y, z); + + if (armourType == -1) + { + return false; + } + + int direction = getDirectionForArmourType(world, x, y, z, armourType); + + if (!isParadigmValid(armourType, direction, world, x, y, z)) + { + return false; + } + + List list = null; + ItemStack armourPiece = null; + + switch (armourType) + { + case 0: + list = plateList; + armourPiece = new ItemStack(ModItems.boundPlate, 1, 0); + break; + + case 1: + list = leggingsList; + armourPiece = new ItemStack(ModItems.boundLeggings, 1, 0); + break; + + case 2: + list = helmetList; + armourPiece = new ItemStack(ModItems.boundHelmet, 1, 0); + break; + + case 3: + list = bootsList; + armourPiece = new ItemStack(ModItems.boundBoots, 1, 0); + break; + } + + if (list == null) + { + return false; + } + + if (armourPiece == null) + { + return false; + } + + if (armourPiece.stackTagCompound == null) + { + armourPiece.setTagCompound(new NBTTagCompound()); + } + + for (ArmourComponent ac : list) + { + int xOff = ac.getXOff(); + int zOff = ac.getZOff(); + TileEntity tileEntity; + + switch (direction) + { + case 1: + tileEntity = world.getTileEntity(x + xOff, y, z - zOff); + break; + + case 2: + tileEntity = world.getTileEntity(x + zOff, y, z + xOff); + break; + + case 3: + tileEntity = world.getTileEntity(x - xOff, y, z + zOff); + break; + + case 4: + tileEntity = world.getTileEntity(x - zOff, y, z - xOff); + break; + + case 5: + tileEntity = world.getTileEntity(x + xOff, y + zOff, z); + break; + + case 6: + tileEntity = world.getTileEntity(x, y + zOff, z + xOff); + break; + + default: + tileEntity = null; + } + + if (tileEntity instanceof TESocket) + { + ItemStack itemStack = ((TESocket) tileEntity).getStackInSlot(0); + int xCoord = tileEntity.xCoord; + int yCoord = tileEntity.yCoord; + int zCoord = tileEntity.zCoord; + ((TESocket) tileEntity).setInventorySlotContents(0, null); + world.setBlockToAir(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); + + for (int i = 0; i < 8; i++) + { + //PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, world.provider.dimensionId, TEAltar.getParticlePacket(xCoord, yCoord, zCoord, (short) 1)); + SpellHelper.sendIndexedParticleToAllAround(world, xCoord, yCoord, zCoord, 20, world.provider.dimensionId, 1, xCoord, yCoord, zCoord); + } + + if (itemStack != null) + { + Item item = itemStack.getItem(); + + if (item instanceof ArmourUpgrade) + { + ((BoundArmour) armourPiece.getItem()).hasAddedToInventory(armourPiece, itemStack.copy()); + ((TESocket) tileEntity).setInventorySlotContents(0, null); + } + } + } + } + + if (armourPiece != null) + { + int xOff = (world.rand.nextInt(11) - 5); + int zOff = (int) (Math.sqrt(25 - xOff * xOff) * (world.rand.nextInt(2) - 0.5) * 2); + world.addWeatherEffect(new EntityLightningBolt(world, x + xOff, y + 5, z + zOff)); + world.spawnEntityInWorld(new EntityItem(world, x, y + 1, z, armourPiece)); + } + + return true; + } + + //0 for plate, 1 for leggings, 2 for helmet, 3 for boots + public int getArmourType(World world, int x, int y, int z) + { + for (int i = 0; i <= 3; i++) + { + if (getDirectionForArmourType(world, x, y, z, i) != -1) + { + return i; + } + } + + return -1; + } + + public int getDirectionForArmourType(World world, int x, int y, int z, int armourType) + { + for (int i = 1; i <= 6; i++) + { + if (isParadigmValid(armourType, i, world, x, y, z)) + { + return i; + } + } + + return -1; + } + + public boolean isParadigmValid(int armourType, int direction, World world, int x, int y, int z) + { + List list = null; + + switch (armourType) + { + case 0: + list = plateList; + break; + + case 1: + list = leggingsList; + break; + + case 2: + list = helmetList; + break; + + case 3: + list = bootsList; + break; + } + + if (list == null) + { + return false; + } + + for (ArmourComponent ac : list) + { + int xOff = ac.getXOff(); + int zOff = ac.getZOff(); + + switch (direction) + { + case 1: + if (!(world.getTileEntity(x + xOff, y, z - zOff) instanceof TESocket)) + { + return false; + } + + break; + + case 2: + if (!(world.getTileEntity(x + zOff, y, z + xOff) instanceof TESocket)) + { + return false; + } + + break; + + case 3: + if (!(world.getTileEntity(x - xOff, y, z + zOff) instanceof TESocket)) + { + return false; + } + + break; + + case 4: + if (!(world.getTileEntity(x - zOff, y, z - xOff) instanceof TESocket)) + { + return false; + } + + break; + + case 5: + if (!(world.getTileEntity(x + xOff, y + zOff, z) instanceof TESocket)) + { + return false; + } + + break; + + case 6: + if (!(world.getTileEntity(x, y + zOff, z + xOff) instanceof TESocket)) + { + return false; + } + + break; + + default: + return false; + } + } + + return true; + } + + public static void initializeRecipes() + { + helmetList.add(new ArmourComponent(-1, 1)); + helmetList.add(new ArmourComponent(0, 1)); + helmetList.add(new ArmourComponent(1, 1)); + helmetList.add(new ArmourComponent(-1, 0)); + helmetList.add(new ArmourComponent(1, 0)); + bootsList.add(new ArmourComponent(-1, 1)); + bootsList.add(new ArmourComponent(1, 1)); + bootsList.add(new ArmourComponent(-1, 0)); + bootsList.add(new ArmourComponent(1, 0)); + plateList.add(new ArmourComponent(-1, 0)); + plateList.add(new ArmourComponent(1, 0)); + plateList.add(new ArmourComponent(-1, -1)); + plateList.add(new ArmourComponent(0, -1)); + plateList.add(new ArmourComponent(1, -1)); + plateList.add(new ArmourComponent(-1, -2)); + plateList.add(new ArmourComponent(0, -2)); + plateList.add(new ArmourComponent(1, -2)); + leggingsList.add(new ArmourComponent(-1, 1)); + leggingsList.add(new ArmourComponent(0, 1)); + leggingsList.add(new ArmourComponent(1, 1)); + leggingsList.add(new ArmourComponent(-1, 0)); + leggingsList.add(new ArmourComponent(1, 0)); + leggingsList.add(new ArmourComponent(-1, -1)); + leggingsList.add(new ArmourComponent(1, -1)); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockAltar.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockAltar.java new file mode 100644 index 00000000..7bf2d6c7 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockAltar.java @@ -0,0 +1,279 @@ +package WayofTime.alchemicalWizardry.common.block; + +import java.util.Random; + +import javax.swing.Icon; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.items.EnergyBattery; +import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockAltar extends BlockContainer +{ + @SideOnly(Side.CLIENT) + private static IIcon topIcon; + @SideOnly(Side.CLIENT) + private static IIcon sideIcon1; + @SideOnly(Side.CLIENT) + private static IIcon sideIcon2; + @SideOnly(Side.CLIENT) + private static IIcon bottomIcon; + + public BlockAltar() + { + super(Material.rock); + setHardness(2.0F); + setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + //setUnlocalizedName("blockAltar"); + //func_111022_d("AlchemicalWizardry:blocks"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Top"); + this.sideIcon1 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType1"); + this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType2"); + this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Bottom"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return bottomIcon; + + case 1: + return topIcon; + + //case 2: return sideIcon1; + //case 3: return sideIcon1; + //case 4: return sideIcon2; + //case 5: return sideIcon2; + default: + return sideIcon2; + } + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) + { + TEAltar tileEntity = (TEAltar) world.getTileEntity(x, y, z); + +// world.scheduleBlockUpdate(x, y, z, this.blockID, 0); + + if (tileEntity == null || player.isSneaking()) + { + return false; + } + + ItemStack playerItem = player.getCurrentEquippedItem(); + + if (playerItem != null) + { + if (playerItem.getItem().equals(ModItems.divinationSigil)) + { + if (player.worldObj.isRemote) + { + world.markBlockForUpdate(x, y, z); + } + + return true; + } else if (playerItem.getItem().equals(ModItems.sigilOfHolding)) + { + ItemStack item = ((SigilOfHolding) playerItem.getItem()).getCurrentItem(playerItem); + + if (item != null && item.getItem().equals(ModItems.divinationSigil)) + { + if (player.worldObj.isRemote) + { + world.markBlockForUpdate(x, y, z); + } + + return true; + } + } + } + + if (tileEntity.getStackInSlot(0) == null && playerItem != null) + { + ItemStack newItem = playerItem.copy(); + newItem.stackSize = 1; +// if(newItem.getMaxDamage()==0) +// { +// newItem.setItemDamage(0); +// } + --playerItem.stackSize; + tileEntity.setInventorySlotContents(0, newItem); + tileEntity.startCycle(); + } else if (tileEntity.getStackInSlot(0) != null && playerItem == null) + { + /**stub method + * Add the item that is in the slot to the player's inventory, and + * then set the slot to null. + */ + player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0)); + tileEntity.setInventorySlotContents(0, null); + tileEntity.setActive(); + } + + world.markBlockForUpdate(x, y, z); + //player.openGui(AlchemicalWizardry.instance, 0, world, x, y, z); + //PacketDispatcher.sendPacketToServer(tileEntity.getDescriptionPacket()); + return true; + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) + { + dropItems(world, x, y, z); + super.breakBlock(world, x, y, z, par5, par6); + } + + private void dropItems(World world, int x, int y, int z) + { + Random rand = new Random(); + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if (!(tileEntity instanceof IInventory)) + { + return; + } + + IInventory inventory = (IInventory) tileEntity; + + for (int i = 0; i < inventory.getSizeInventory(); i++) + { + ItemStack item = inventory.getStackInSlot(i); + + if (item != null && item.stackSize > 0) + { + float rx = rand.nextFloat() * 0.8F + 0.1F; + float ry = rand.nextFloat() * 0.8F + 0.1F; + float rz = rand.nextFloat() * 0.8F + 0.1F; + EntityItem entityItem = new EntityItem(world, + x + rx, y + ry, z + rz, + new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); + + if (item.hasTagCompound()) + { + entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy()); + } + + float factor = 0.05F; + entityItem.motionX = rand.nextGaussian() * factor; + entityItem.motionY = rand.nextGaussian() * factor + 0.2F; + entityItem.motionZ = rand.nextGaussian() * factor; + world.spawnEntityInWorld(entityItem); + item.stackSize = 0; + } + } + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public boolean hasTileEntity() + { + return true; + } + + @Override + public void randomDisplayTick(World world, int x, int y, int z, Random rand) + { + TEAltar tileEntity = (TEAltar) world.getTileEntity(x, y, z); + + if (!tileEntity.isActive()) + { + return; + } + + if (rand.nextInt(3) != 0) + { + return; + } + } + +// @Override +// public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) +// { +// return 1; +// } + + @Override + public boolean canProvidePower() + { + return true; + } + + @Override + public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) + { + TileEntity tile = par1IBlockAccess.getTileEntity(par2, par3, par4); + + if (tile instanceof TEAltar) + { +// if(tile.worldObj.isRemote) +// { +// return 0; +// } + ItemStack stack = ((TEAltar) tile).getStackInSlot(0); + + if (stack != null && stack.getItem() instanceof EnergyBattery) + { + EnergyBattery bloodOrb = (EnergyBattery) stack.getItem(); + int maxEssence = bloodOrb.getMaxEssence(); + int currentEssence = bloodOrb.getCurrentEssence(stack); + int level = currentEssence * 15 / maxEssence; + return ((int) (Math.min(15, level))) % 16; + } + } + + return 0; + } + + @Override + public TileEntity createNewTileEntity(World var1, int var2) + { + return new TEAltar(); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockBloodLightSource.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockBloodLightSource.java new file mode 100644 index 00000000..6e63f4b5 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockBloodLightSource.java @@ -0,0 +1,75 @@ +package WayofTime.alchemicalWizardry.common.block; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockBloodLightSource extends Block +{ + public BlockBloodLightSource() + { + super(Material.cloth); + //setCreativeTab(AlchemicalWizardry.tabBloodMagic); + //this.setUnlocalizedName("blockBloodLightSource"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:BlockBloodLight"); + } + + @Override + public int getLightValue(IBlockAccess world, int x, int y, int z) + { + return 15; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public void randomDisplayTick(World world, int x, int y, int z, Random rand) + { + if (rand.nextInt(3) != 0) + { + float f = (float) 1.0F; + float f1 = f * 0.6F + 0.4F; + float f2 = f * f * 0.7F - 0.5F; + float f3 = f * f * 0.6F - 0.7F; + world.spawnParticle("reddust", x + 0.5D + rand.nextGaussian() / 8, y + 0.5D, z + 0.5D + rand.nextGaussian() / 8, f1, f2, f3); + } + } + + @Override + + public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) + { + this.setBlockBounds(0.40F, 0.40F, 0.40F, 0.60F, 0.60F, 0.60F); + //super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + } + + public int quantityDropped(Random par1Random) + { + return 0; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockConduit.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockConduit.java new file mode 100644 index 00000000..82fc993f --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockConduit.java @@ -0,0 +1,101 @@ +package WayofTime.alchemicalWizardry.common.block; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TEConduit; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockConduit extends BlockOrientable +{ + @SideOnly(Side.CLIENT) + private static IIcon topIcon; + @SideOnly(Side.CLIENT) + private static IIcon sideIcon1; + @SideOnly(Side.CLIENT) + private static IIcon sideIcon2; + @SideOnly(Side.CLIENT) + private static IIcon bottomIcon; + + public BlockConduit() + { + super(); + setHardness(2.0F); + setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + //setUnlocalizedName("blockConduit"); + //func_111022_d("AlchemicalWizardry:blocks"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Top"); + this.sideIcon1 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType1"); + this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType2"); + this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Bottom"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return bottomIcon; + + case 1: + return topIcon; + + //case 2: return sideIcon1; + //case 3: return sideIcon1; + //case 4: return sideIcon2; + //case 5: return sideIcon2; + default: + return sideIcon2; + } + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) + { + //dropItems(world, x, y, z); + super.breakBlock(world, x, y, z, par5, par6); + } + + @Override + public TileEntity createNewTileEntity(World world, int noClue) + { + return new TEConduit(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public boolean hasTileEntity() + { + return true; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockHomHeart.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockHomHeart.java new file mode 100644 index 00000000..8ecb2e93 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockHomHeart.java @@ -0,0 +1,101 @@ +package WayofTime.alchemicalWizardry.common.block; + +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.items.BlankSpell; +import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockHomHeart extends BlockContainer +{ + public IIcon bottomIcon; + public IIcon topIcon; + public IIcon sideIcon; + + public BlockHomHeart() + { + super(Material.rock); + setHardness(2.0F); + setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + //setUnlocalizedName("blockHomHeart"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:HomHeart_top"); + this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:HomHeart_bottom"); + this.sideIcon = iconRegister.registerIcon("AlchemicalWizardry:HomHeart_side"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return bottomIcon; + + case 1: + return topIcon; + + //case 2: return sideIcon1; + //case 3: return sideIcon1; + //case 4: return sideIcon2; + //case 5: return sideIcon2; + default: + return sideIcon; + } + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) + { + TEHomHeart tileEntity = (TEHomHeart) world.getTileEntity(x, y, z); + + if (tileEntity == null || player.isSneaking()) + { + return false; + } + + ItemStack playerItem = player.getCurrentEquippedItem(); + + if (playerItem != null) + { + if (playerItem.getItem() instanceof BlankSpell) + { + if (playerItem.stackTagCompound == null) + { + playerItem.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound itemTag = playerItem.stackTagCompound; + itemTag.setInteger("xCoord", x); + itemTag.setInteger("yCoord", y); + itemTag.setInteger("zCoord", z); + itemTag.setInteger("dimensionId", world.provider.dimensionId); + return true; + } + } + + return false; + } + + @Override + public TileEntity createNewTileEntity(World world, int metaMaybe) + { + return new TEHomHeart(); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockMasterStone.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockMasterStone.java new file mode 100644 index 00000000..1a1d63b6 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockMasterStone.java @@ -0,0 +1,72 @@ +package WayofTime.alchemicalWizardry.common.block; + +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.items.ActivationCrystal; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockMasterStone extends BlockContainer +{ + public BlockMasterStone() + { + super(Material.iron); + setHardness(2.0F); + setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + //setUnlocalizedName("blockMasterStone"); + // TODO Auto-generated constructor stub + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:MasterStone"); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) + { + TEMasterStone tileEntity = (TEMasterStone) world.getTileEntity(x, y, z); + + if (tileEntity == null || player.isSneaking()) + { + return false; + } + + ItemStack playerItem = player.getCurrentEquippedItem(); + + if (playerItem == null) + { + return false; + } + + Item item = playerItem.getItem(); + + if (!(item instanceof ActivationCrystal)) + { + return false; + } + + ActivationCrystal acItem = (ActivationCrystal) item; + tileEntity.setOwner(acItem.getOwnerName(playerItem)); + tileEntity.activateRitual(world, acItem.getCrystalLevel(playerItem)); + world.markBlockForUpdate(x, y, z); + return true; + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) + { + return new TEMasterStone(); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockOrientable.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockOrientable.java new file mode 100644 index 00000000..4af2d1f6 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockOrientable.java @@ -0,0 +1,252 @@ +package WayofTime.alchemicalWizardry.common.block; + +import javax.swing.Icon; + +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TEOrientable; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockOrientable extends BlockContainer +{ + @SideOnly(Side.CLIENT) + private static IIcon[] fireIcons; + + public BlockOrientable() + { + super(Material.rock); + setHardness(2.0F); + setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + //setUnlocalizedName("bloodSocket"); + //func_111022_d("AlchemicalWizardry:blocks"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.fireIcons = this.registerIconsWithString(iconRegister, "fireEffectBlock"); + } + + @SideOnly(Side.CLIENT) + public static IIcon[] registerIconsWithString(IIconRegister iconRegister, String blockString) + { + IIcon[] icons = new IIcon[7]; + + icons[0] = iconRegister.registerIcon("AlchemicalWizardry:" + blockString + "_input"); + icons[1] = iconRegister.registerIcon("AlchemicalWizardry:" + blockString + "_output"); + icons[2] = iconRegister.registerIcon("AlchemicalWizardry:" + blockString + "_upArrow"); + icons[3] = iconRegister.registerIcon("AlchemicalWizardry:" + blockString + "_downArrow"); + icons[4] = iconRegister.registerIcon("AlchemicalWizardry:" + blockString + "_leftArrow"); + icons[5] = iconRegister.registerIcon("AlchemicalWizardry:" + blockString + "_rightArrow"); + icons[6] = iconRegister.registerIcon("AlchemicalWizardry:" + blockString + "_blank"); + + return icons; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + IIcon[] icons = this.getIconsForMeta(meta); + switch (side) + { + case 4: return icons[1]; + default: return icons[6]; + } + } + +// @Override +// public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) +// { +// return false; +// } + + @SideOnly(Side.CLIENT) + + /** + * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side + */ + public IIcon getBlockTexture(IBlockAccess par1IBlockAccess, int x, int y, int z, int side) + { + TileEntity tile = par1IBlockAccess.getTileEntity(x, y, z); + int meta = par1IBlockAccess.getBlockMetadata(x, y, z); + + if(tile instanceof TEOrientable) + { + ForgeDirection input = ((TEOrientable)tile).getInputDirection(); + ForgeDirection output = ((TEOrientable)tile).getOutputDirection(); + + return this.getIconsForMeta(meta)[this.getTextureIndexForSideAndOrientation(side, input, output)]; + } + + return this.getIcon(side, meta); + } + + @Override + public TileEntity createNewTileEntity(World world, int dunno) + { + return new TEOrientable(); + } + + public IIcon[] getIconsForMeta(int metadata) + { + return this.fireIcons; + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are) + { + //Right-click orients the output face. Shift-right-click orients the input face. + if (world.isRemote) + { + return false; + } + + ForgeDirection sideClicked = ForgeDirection.getOrientation(side); + TileEntity tile = world.getTileEntity(x, y, z); + + if (tile instanceof TEOrientable) + { + TEOrientable newTile = (TEOrientable)tile; + if(player.isSneaking()) + { + int nextSide = TEOrientable.getIntForForgeDirection(newTile.getInputDirection())+1; + + if(nextSide>5) + { + nextSide = 0; + } + if(ForgeDirection.getOrientation(nextSide)==newTile.getOutputDirection()) + { + nextSide++; + if(nextSide>5) + { + nextSide = 0; + } + } + + newTile.setInputDirection(ForgeDirection.getOrientation(nextSide)); + }else + { + int nextSide = TEOrientable.getIntForForgeDirection(newTile.getOutputDirection())+1; + + if(nextSide>5) + { + nextSide = 0; + } + if(ForgeDirection.getOrientation(nextSide)==newTile.getInputDirection()) + { + nextSide++; + if(nextSide>5) + { + nextSide = 0; + } + } + + newTile.setOutputDirection(ForgeDirection.getOrientation(nextSide)); + } + } + + world.markBlockForUpdate(x, y, z); + return true; + } + + public int getTextureIndexForSideAndOrientation(int side, ForgeDirection input, ForgeDirection output) + { + if(ForgeDirection.getOrientation(side) == input) + { + return 0; + } + if(ForgeDirection.getOrientation(side) == output) + { + return 1; + } + if(ForgeDirection.getOrientation(side) == output.getOpposite()) + { + return 6; + } + + switch(side) + { + case 0: //BOTTOM + switch(output) + { + case NORTH: return 2; //UP + case SOUTH: return 3; //DOWN + case EAST: return 4; //LEFT + case WEST: return 5; //RIGHT + default: break; + } + break; + case 1: //TOP + switch(output) + { + case NORTH: return 2; //UP + case SOUTH: return 3; //DOWN + case EAST: return 5; + case WEST: return 4; + default: break; + } + break; + case 2: //NORTH + switch(output) + { + case DOWN: return 3; + case UP: return 2; + case EAST: return 4; + case WEST: return 5; + default: break; + } + break; + case 3: //SOUTH + switch(output) + { + case DOWN: return 3; + case UP: return 2; + case EAST: return 5; + case WEST: return 4; + default: break; + } + break; + case 4: //WEST + switch(output) + { + case DOWN: return 3; + case UP: return 2; + case NORTH: return 5; + case SOUTH: return 4; + default: break; + } + break; + case 5: //EAST + switch(output) + { + case DOWN: return 3; + case UP: return 2; + case NORTH: return 4; + case SOUTH: return 5; + default: break; + } + break; + } + + return 0; + } + + @Override + public int damageDropped(int metadata) + { + return metadata; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockPedestal.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockPedestal.java new file mode 100644 index 00000000..5d48942d --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockPedestal.java @@ -0,0 +1,193 @@ +package WayofTime.alchemicalWizardry.common.block; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockPedestal extends BlockContainer +{ + @SideOnly(Side.CLIENT) + private static IIcon topIcon; + @SideOnly(Side.CLIENT) + private static IIcon sideIcon1; + @SideOnly(Side.CLIENT) + private static IIcon sideIcon2; + @SideOnly(Side.CLIENT) + private static IIcon bottomIcon; + + public BlockPedestal() + { + super(Material.rock); + setHardness(2.0F); + setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + //setUnlocalizedName("bloodPedestal"); + //func_111022_d("AlchemicalWizardry:blocks"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:ArcanePedestal"); + this.sideIcon1 = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket"); + this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket"); + this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return bottomIcon; + + case 1: + return topIcon; + + //case 2: return sideIcon1; + //case 3: return sideIcon1; + //case 4: return sideIcon2; + //case 5: return sideIcon2; + default: + return sideIcon2; + } + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) + { + TEPedestal tileEntity = (TEPedestal) world.getTileEntity(x, y, z); + + if (tileEntity == null || player.isSneaking()) + { + return false; + } + + ItemStack playerItem = player.getCurrentEquippedItem(); + + if (tileEntity.getStackInSlot(0) == null && playerItem != null) + { + ItemStack newItem = playerItem.copy(); + newItem.stackSize = 1; + --playerItem.stackSize; + tileEntity.setInventorySlotContents(0, newItem); + } else if (tileEntity.getStackInSlot(0) != null && playerItem == null) + { + /**stub method + * Add the item that is in the slot to the player's inventory, and + * then set the slot to null. + */ + player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0)); + tileEntity.setInventorySlotContents(0, null); + tileEntity.setActive(); + } + + world.markBlockForUpdate(x, y, z); + //player.openGui(AlchemicalWizardry.instance, 0, world, x, y, z); + //PacketDispatcher.sendPacketToServer(tileEntity.getDescriptionPacket()); + return true; + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) + { + dropItems(world, x, y, z); + super.breakBlock(world, x, y, z, par5, par6); + } + + private void dropItems(World world, int x, int y, int z) + { + Random rand = new Random(); + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if (!(tileEntity instanceof IInventory)) + { + return; + } + + IInventory inventory = (IInventory) tileEntity; + + for (int i = 0; i < inventory.getSizeInventory(); i++) + { + ItemStack item = inventory.getStackInSlot(i); + + if (item != null && item.stackSize > 0) + { + float rx = rand.nextFloat() * 0.8F + 0.1F; + float ry = rand.nextFloat() * 0.8F + 0.1F; + float rz = rand.nextFloat() * 0.8F + 0.1F; + EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); + + if (item.hasTagCompound()) + { + entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy()); + } + + float factor = 0.05F; + entityItem.motionX = rand.nextGaussian() * factor; + entityItem.motionY = rand.nextGaussian() * factor + 0.2F; + entityItem.motionZ = rand.nextGaussian() * factor; + world.spawnEntityInWorld(entityItem); + item.stackSize = 0; + } + } + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) + { + return new TEPedestal(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public boolean hasTileEntity() + { + return true; + } + + @Override + public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) + { + float f = 0.3125F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.6F, 0.5F + f); + return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockPlinth.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockPlinth.java new file mode 100644 index 00000000..9392b33d --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockPlinth.java @@ -0,0 +1,193 @@ +package WayofTime.alchemicalWizardry.common.block; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockPlinth extends BlockContainer +{ + @SideOnly(Side.CLIENT) + private static IIcon topIcon; + @SideOnly(Side.CLIENT) + private static IIcon sideIcon1; + @SideOnly(Side.CLIENT) + private static IIcon sideIcon2; + @SideOnly(Side.CLIENT) + private static IIcon bottomIcon; + + public BlockPlinth() + { + super(Material.rock); + setHardness(2.0F); + setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + //setUnlocalizedName("bloodPlinth"); + //func_111022_d("AlchemicalWizardry:blocks"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:ArcanePlinth"); + this.sideIcon1 = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket"); + this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket"); + this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return bottomIcon; + + case 1: + return topIcon; + + //case 2: return sideIcon1; + //case 3: return sideIcon1; + //case 4: return sideIcon2; + //case 5: return sideIcon2; + default: + return sideIcon2; + } + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) + { + TEPlinth tileEntity = (TEPlinth) world.getTileEntity(x, y, z); + + if (tileEntity == null || player.isSneaking()) + { + return false; + } + + ItemStack playerItem = player.getCurrentEquippedItem(); + + if (tileEntity.getStackInSlot(0) == null && playerItem != null) + { + ItemStack newItem = playerItem.copy(); + newItem.stackSize = 1; + --playerItem.stackSize; + tileEntity.setInventorySlotContents(0, newItem); + } else if (tileEntity.getStackInSlot(0) != null && playerItem == null) + { + /**stub method + * Add the item that is in the slot to the player's inventory, and + * then set the slot to null. + */ + player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0)); + tileEntity.setInventorySlotContents(0, null); + tileEntity.setActive(); + } + + world.markBlockForUpdate(x, y, z); + //player.openGui(AlchemicalWizardry.instance, 0, world, x, y, z); + //PacketDispatcher.sendPacketToServer(tileEntity.getDescriptionPacket()); + return true; + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) + { + dropItems(world, x, y, z); + super.breakBlock(world, x, y, z, par5, par6); + } + + private void dropItems(World world, int x, int y, int z) + { + Random rand = new Random(); + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if (!(tileEntity instanceof IInventory)) + { + return; + } + + IInventory inventory = (IInventory) tileEntity; + + for (int i = 0; i < inventory.getSizeInventory(); i++) + { + ItemStack item = inventory.getStackInSlot(i); + + if (item != null && item.stackSize > 0) + { + float rx = rand.nextFloat() * 0.8F + 0.1F; + float ry = rand.nextFloat() * 0.8F + 0.1F; + float rz = rand.nextFloat() * 0.8F + 0.1F; + EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); + + if (item.hasTagCompound()) + { + entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy()); + } + + float factor = 0.05F; + entityItem.motionX = rand.nextGaussian() * factor; + entityItem.motionY = rand.nextGaussian() * factor + 0.2F; + entityItem.motionZ = rand.nextGaussian() * factor; + world.spawnEntityInWorld(entityItem); + item.stackSize = 0; + } + } + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) + { + return new TEPlinth(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public boolean hasTileEntity() + { + return true; + } + + @Override + public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) + { + float f = 0.0625F; + this.setBlockBounds(f, 0.0F, f, 1.0f - f, 0.875f, 1.0f - f); + return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockSocket.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockSocket.java new file mode 100644 index 00000000..647ed05f --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockSocket.java @@ -0,0 +1,163 @@ +package WayofTime.alchemicalWizardry.common.block; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.tileEntity.TESocket; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockSocket extends BlockContainer +{ + @SideOnly(Side.CLIENT) + private static IIcon topIcon; + @SideOnly(Side.CLIENT) + private static IIcon sideIcon1; + @SideOnly(Side.CLIENT) + private static IIcon sideIcon2; + @SideOnly(Side.CLIENT) + private static IIcon bottomIcon; + + public BlockSocket() + { + super(Material.rock); + setHardness(2.0F); + setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + //setUnlocalizedName("bloodSocket"); + //func_111022_d("AlchemicalWizardry:blocks"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket"); + this.sideIcon1 = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket"); + this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket"); + this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return bottomIcon; + + case 1: + return topIcon; + + //case 2: return sideIcon1; + //case 3: return sideIcon1; + //case 4: return sideIcon2; + //case 5: return sideIcon2; + default: + return sideIcon2; + } + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) + { + TESocket tileEntity = (TESocket) world.getTileEntity(x, y, z); + + if (tileEntity == null || player.isSneaking()) + { + return false; + } + + ItemStack playerItem = player.getCurrentEquippedItem(); + + if (tileEntity.getStackInSlot(0) == null && playerItem != null) + { + if (playerItem.getItem() instanceof ArmourUpgrade) + { + ItemStack newItem = playerItem.copy(); + newItem.stackSize = 1; + --playerItem.stackSize; + tileEntity.setInventorySlotContents(0, newItem); + } + } else if (tileEntity.getStackInSlot(0) != null && playerItem == null) + { + /**stub method + * Add the item that is in the slot to the player's inventory, and + * then set the slot to null. + */ + player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0)); + tileEntity.setInventorySlotContents(0, null); + tileEntity.setActive(); + } + + world.markBlockForUpdate(x, y, z); + //player.openGui(AlchemicalWizardry.instance, 0, world, x, y, z); + //PacketDispatcher.sendPacketToServer(tileEntity.getDescriptionPacket()); + return true; + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) + { + dropItems(world, x, y, z); + super.breakBlock(world, x, y, z, par5, par6); + } + + private void dropItems(World world, int x, int y, int z) + { + Random rand = new Random(); + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if (!(tileEntity instanceof IInventory)) + { + return; + } + + IInventory inventory = (IInventory) tileEntity; + + for (int i = 0; i < inventory.getSizeInventory(); i++) + { + ItemStack item = inventory.getStackInSlot(i); + + if (item != null && item.stackSize > 0) + { + float rx = rand.nextFloat() * 0.8F + 0.1F; + float ry = rand.nextFloat() * 0.8F + 0.1F; + float rz = rand.nextFloat() * 0.8F + 0.1F; + EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); + + if (item.hasTagCompound()) + { + entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy()); + } + + float factor = 0.05F; + entityItem.motionX = rand.nextGaussian() * factor; + entityItem.motionY = rand.nextGaussian() * factor + 0.2F; + entityItem.motionZ = rand.nextGaussian() * factor; + world.spawnEntityInWorld(entityItem); + item.stackSize = 0; + } + } + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) + { + return new TESocket(); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEffect.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEffect.java new file mode 100644 index 00000000..6e42c5c7 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEffect.java @@ -0,0 +1,62 @@ +package WayofTime.alchemicalWizardry.common.block; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock; + + +public class BlockSpellEffect extends BlockOrientable +{ + public BlockSpellEffect() + { + super(); + //setUnlocalizedName("blockSpellEffect"); + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) + { + return new TESpellEffectBlock(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) + { + if (this.equals(ModBlocks.blockSpellEffect)) + { + for(int i=0; i<4; i++) + { + par3List.add(new ItemStack(par1, 1, i)); + } + } else + { + super.getSubBlocks(par1, par2CreativeTabs, par3List); + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEnhancement.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEnhancement.java new file mode 100644 index 00000000..6c9f968b --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockSpellEnhancement.java @@ -0,0 +1,46 @@ +package WayofTime.alchemicalWizardry.common.block; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEnhancementBlock; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellModifierBlock; + + +public class BlockSpellEnhancement extends BlockOrientable +{ + public BlockSpellEnhancement() + { + super(); + //setUnlocalizedName("blockSpellEnhancement"); + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) + { + return new TESpellEnhancementBlock(); + } + + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) + { + if (this.equals(ModBlocks.blockSpellEnhancement)) + { + for(int i=0; i<15; i++) + { + par3List.add(new ItemStack(par1, 1, i)); + } + } else + { + super.getSubBlocks(par1, par2CreativeTabs, par3List); + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockSpellModifier.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockSpellModifier.java new file mode 100644 index 00000000..c8f865ff --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockSpellModifier.java @@ -0,0 +1,45 @@ +package WayofTime.alchemicalWizardry.common.block; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellModifierBlock; + + +public class BlockSpellModifier extends BlockOrientable +{ + public BlockSpellModifier() + { + super(); + //setUnlocalizedName("blockSpellModifier"); + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) + { + return new TESpellModifierBlock(); + } + + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) + { + if (this.equals(ModBlocks.blockSpellModifier)) + { + for(int i=0; i<4; i++) + { + par3List.add(new ItemStack(par1, 1, i)); + } + } else + { + super.getSubBlocks(par1, par2CreativeTabs, par3List); + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockSpellParadigm.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockSpellParadigm.java new file mode 100644 index 00000000..00299ae5 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockSpellParadigm.java @@ -0,0 +1,211 @@ +package WayofTime.alchemicalWizardry.common.block; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.items.ItemComplexSpellCrystal; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockSpellParadigm extends BlockOrientable +{ + public static final float minPos = (3f/16f); + public static final float maxPos = (13f/16f); + + IIcon[] projectileIcons = new IIcon[7]; + + public BlockSpellParadigm() + { + super(); + //setUnlocalizedName("blockSpellParadigm"); + //setBlockBounds(minPos, minPos, minPos, maxPos, maxPos, maxPos); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.projectileIcons = this.registerIconsWithString(iconRegister, "projectileParadigmBlock"); + } + +// @Override +// public Icon[] getIconsForMeta(int metadata) +// { +// return this.projectileIcons; +// } + + @Override + public TileEntity createNewTileEntity(World world, int meta) + { + return new TESpellParadigmBlock(); + } + + @SideOnly(Side.CLIENT) + + /** + * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) + */ + public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) + { + if (this.equals(ModBlocks.blockSpellParadigm)) + { + par3List.add(new ItemStack(par1, 1, 0)); + par3List.add(new ItemStack(par1, 1, 1)); + par3List.add(new ItemStack(par1, 1, 2)); + } else + { + super.getSubBlocks(par1, par2CreativeTabs, par3List); + } + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are) + { + ItemStack stack = player.getCurrentEquippedItem(); + + if(stack != null && stack.getItem() instanceof ItemComplexSpellCrystal) + { + if (stack.stackTagCompound == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound itemTag = stack.stackTagCompound; + itemTag.setInteger("xCoord", x); + itemTag.setInteger("yCoord", y); + itemTag.setInteger("zCoord", z); + itemTag.setInteger("dimensionId", world.provider.dimensionId); + return true; + } + + return super.onBlockActivated(world, x, y, z, player, side, what, these, are); + } + +// @Override +// public boolean isOpaqueCube() +// { +// return false; +// } +// +// @Override +// public boolean renderAsNormalBlock() +// { +// return false; +// } + +// @Override +// public int getRenderType() +// { +// return -1; +// } + + //TODO Need to make a renderer for the paradigm blocks and other spell blocks. + /* + @Override + public void addCollisionBoxesToList(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List arraylist, Entity par7Entity) + { + + setBlockBounds(minPos, minPos, minPos, maxPos, maxPos, maxPos); + super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity); + + + TileEntity tile1 = world.getBlockTileEntity(i, j, k); + if (tile1 instanceof TESpellParadigmBlock) + { + TESpellParadigmBlock tileG = (TESpellParadigmBlock) tile1; + + + if (tileG.isSideRendered(ForgeDirection.WEST)) + { + setBlockBounds(0.0F, minPos, minPos, maxPos, maxPos, maxPos); + super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity); + } + + + if (tileG.isSideRendered(ForgeDirection.EAST)) + { + setBlockBounds(minPos, minPos, minPos, 1.0F, maxPos, maxPos); + super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity); + } + + + if (tileG.isSideRendered(ForgeDirection.DOWN)) + { + setBlockBounds(minPos, 0.0F, minPos, maxPos, maxPos, maxPos); + super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity); + } + + + if (tileG.isSideRendered(ForgeDirection.UP)) + { + setBlockBounds(minPos, minPos, minPos, maxPos, 1.0F, maxPos); + super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity); + } + + + if (tileG.isSideRendered(ForgeDirection.NORTH)) + { + setBlockBounds(minPos, minPos, 0.0F, maxPos, maxPos, maxPos); + super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity); + } + + + if (tileG.isSideRendered(ForgeDirection.SOUTH)) + { + setBlockBounds(minPos, minPos, minPos, maxPos, maxPos, 1.0F); + super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity); + } + + +// float facadeThickness = TransportConstants.FACADE_THICKNESS; +// +// +// if (tileG.hasFacade(ForgeDirection.EAST)) { +// setBlockBounds(1 - facadeThickness, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); +// super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity); +// } +// +// +// if (tileG.hasFacade(ForgeDirection.WEST)) { +// setBlockBounds(0.0F, 0.0F, 0.0F, facadeThickness, 1.0F, 1.0F); +// super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity); +// } +// +// +// if (tileG.hasFacade(ForgeDirection.UP)) { +// setBlockBounds(0.0F, 1 - facadeThickness, 0.0F, 1.0F, 1.0F, 1.0F); +// super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity); +// } +// +// +// if (tileG.hasFacade(ForgeDirection.DOWN)) { +// setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, facadeThickness, 1.0F); +// super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity); +// } +// +// +// if (tileG.hasFacade(ForgeDirection.SOUTH)) { +// setBlockBounds(0.0F, 0.0F, 1 - facadeThickness, 1.0F, 1.0F, 1.0F); +// super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity); +// } +// +// +// if (tileG.hasFacade(ForgeDirection.NORTH)) { +// setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, facadeThickness); +// super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity); +// } + } + setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + */ +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockTeleposer.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockTeleposer.java new file mode 100644 index 00000000..e604dee2 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockTeleposer.java @@ -0,0 +1,321 @@ +package WayofTime.alchemicalWizardry.common.block; + +import java.util.Random; + +import javax.swing.Icon; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.BlockMobSpawner; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.items.TelepositionFocus; +import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockTeleposer extends BlockContainer +{ + @SideOnly(Side.CLIENT) + private static IIcon topIcon; + @SideOnly(Side.CLIENT) + private static IIcon sideIcon1; + @SideOnly(Side.CLIENT) + private static IIcon sideIcon2; + @SideOnly(Side.CLIENT) + private static IIcon bottomIcon; + + public BlockTeleposer() + { + super(Material.rock); + setHardness(2.0F); + setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + //setUnlocalizedName("bloodTeleposer"); + //func_111022_d("AlchemicalWizardry:blocks"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:Teleposer_Top"); + this.sideIcon1 = iconRegister.registerIcon("AlchemicalWizardry:Teleposer_Side"); + this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:Teleposer_Side"); + this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:Teleposer_Side"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return bottomIcon; + + case 1: + return topIcon; + + //case 2: return sideIcon1; + //case 3: return sideIcon1; + //case 4: return sideIcon2; + //case 5: return sideIcon2; + default: + return sideIcon2; + } + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) + { + TETeleposer tileEntity = (TETeleposer) world.getTileEntity(x, y, z); + ItemStack playerItem = player.getCurrentEquippedItem(); + + if (playerItem != null) + { + if (playerItem.getItem() instanceof TelepositionFocus) + { + if (playerItem.stackTagCompound == null) + { + playerItem.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound itemTag = playerItem.stackTagCompound; + itemTag.setInteger("xCoord", x); + itemTag.setInteger("yCoord", y); + itemTag.setInteger("zCoord", z); + itemTag.setInteger("dimensionId", world.provider.dimensionId); + return true; + } + } + + player.openGui(AlchemicalWizardry.instance, 1, world, x, y, z); +// this.swapBlocks(world, x, y+1, z, x, y+2, z); +// +// world.markBlockForUpdate(x, y, z); + //player.openGui(AlchemicalWizardry.instance, 0, world, x, y, z); + //PacketDispatcher.sendPacketToServer(tileEntity.getDescriptionPacket()); + return true; + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) + { + dropItems(world, x, y, z); + super.breakBlock(world, x, y, z, par5, par6); + } + + private void dropItems(World world, int x, int y, int z) + { + Random rand = new Random(); + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if (!(tileEntity instanceof IInventory)) + { + return; + } + + IInventory inventory = (IInventory) tileEntity; + + for (int i = 0; i < inventory.getSizeInventory(); i++) + { + ItemStack item = inventory.getStackInSlot(i); + + if (item != null && item.stackSize > 0) + { + float rx = rand.nextFloat() * 0.8F + 0.1F; + float ry = rand.nextFloat() * 0.8F + 0.1F; + float rz = rand.nextFloat() * 0.8F + 0.1F; + EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); + + if (item.hasTagCompound()) + { + entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy()); + } + + float factor = 0.05F; + entityItem.motionX = rand.nextGaussian() * factor; + entityItem.motionY = rand.nextGaussian() * factor + 0.2F; + entityItem.motionZ = rand.nextGaussian() * factor; + world.spawnEntityInWorld(entityItem); + item.stackSize = 0; + } + } + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) + { + return new TETeleposer(); + } + + public static boolean swapBlocks(World worldI, World worldF, int xi, int yi, int zi, int xf, int yf, int zf) + { + //TODO Fix sapling duplication glitch + TileEntity tileEntityI = worldI.getTileEntity(xi, yi, zi); + TileEntity tileEntityF = worldF.getTileEntity(xf, yf, zf); + TileEntity tileI; + TileEntity tileF; +// ItemStack[] inv1 = new ItemStack[0]; +// ItemStack[] inv2 = new ItemStack[0]; + NBTTagCompound nbttag1 = new NBTTagCompound(); + NBTTagCompound nbttag2 = new NBTTagCompound(); + + if (tileEntityI != null) + { + //NBTTagCompound nbttag1 = new NBTTagCompound(); +// tileEntityI.xCoord=xf; +// tileEntityI.yCoord=yf; +// tileEntityI.zCoord=zf; + tileEntityI.writeToNBT(nbttag1); + //tileEntityI.readFromNBT(new NBTTagCompound()); + } + +// if(tileEntityI instanceof IInventory) +// { +// int size = ((IInventory)tileEntityI).getSizeInventory(); +// inv1 = new ItemStack[size]; +// for(int i=0; i0) +// { +// for(int i=0;i<((IInventory)tileI).getSizeInventory();i++) +// { +// ((IInventory)tileI).setInventorySlotContents(i, inv2[i]); +// } +// } +// +// if(tileF instanceof IInventory && inv1.length>0) +// { +// for(int i=0;i<((IInventory)tileF).getSizeInventory();i++) +// { +// ((IInventory)tileF).setInventorySlotContents(i, inv1[i]); +// } +// } +// worldI.markBlockForUpdate(xi, yi, zi); +// worldF.markBlockForUpdate(xf, yf, zf); + return true; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockWritingTable.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockWritingTable.java new file mode 100644 index 00000000..4475618f --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BlockWritingTable.java @@ -0,0 +1,181 @@ +package WayofTime.alchemicalWizardry.common.block; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockWritingTable extends BlockContainer +{ + @SideOnly(Side.CLIENT) + private static IIcon topIcon; + @SideOnly(Side.CLIENT) + private static IIcon sideIcon1; + @SideOnly(Side.CLIENT) + private static IIcon sideIcon2; + @SideOnly(Side.CLIENT) + private static IIcon bottomIcon; + + public BlockWritingTable() + { + super(Material.wood); + setHardness(2.0F); + setResistance(5.0F); + //setUnlocalizedName("blockWritingTable"); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:AlchemicChemistrySet"); + this.sideIcon1 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType1"); + this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType2"); + this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Bottom"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return bottomIcon; + + case 1: + return topIcon; + + //case 2: return sideIcon1; + //case 3: return sideIcon1; + //case 4: return sideIcon2; + //case 5: return sideIcon2; + default: + return sideIcon2; + } + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int metadata, float what, float these, float are) + { + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if (tileEntity == null || player.isSneaking()) + { + return false; + } + + //code to open gui explained later + player.openGui(AlchemicalWizardry.instance, 0, world, x, y, z); + return true; + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) + { + dropItems(world, x, y, z); + super.breakBlock(world, x, y, z, par5, par6); + } + + private void dropItems(World world, int x, int y, int z) + { + Random rand = new Random(); + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if (!(tileEntity instanceof IInventory)) + { + return; + } + + IInventory inventory = (IInventory) tileEntity; + + for (int i = 0; i < inventory.getSizeInventory(); i++) + { + ItemStack item = inventory.getStackInSlot(i); + + if (item != null && item.stackSize > 0) + { + float rx = rand.nextFloat() * 0.8F + 0.1F; + float ry = rand.nextFloat() * 0.8F + 0.1F; + float rz = rand.nextFloat() * 0.8F + 0.1F; + EntityItem entityItem = new EntityItem(world, + x + rx, y + ry, z + rz, + new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); + + if (item.hasTagCompound()) + { + entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy()); + } + + float factor = 0.05F; + entityItem.motionX = rand.nextGaussian() * factor; + entityItem.motionY = rand.nextGaussian() * factor + 0.2F; + entityItem.motionZ = rand.nextGaussian() * factor; + world.spawnEntityInWorld(entityItem); + item.stackSize = 0; + } + } + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) + { + return new TEWritingTable(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public boolean hasTileEntity() + { + return true; + } + + @Override + public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) + { + this.setBlockBounds(0.4375F, 0.0F, 0.4375F, 0.5625F, 0.9375F, 0.5625F); + super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + this.setBlockBoundsForItemRender(); + super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + } + + public void setBlockBoundsForItemRender() + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BloodRune.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BloodRune.java new file mode 100644 index 00000000..8646c022 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BloodRune.java @@ -0,0 +1,112 @@ +package WayofTime.alchemicalWizardry.common.block; + +import java.util.List; + +import javax.swing.Icon; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModBlocks; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BloodRune extends Block +{ + //private Icon bloodRuneIcon; + private IIcon altarCapacityRuneIcon; + private IIcon dislocationRuneIcon; + private IIcon orbCapacityRuneIcon; + + public BloodRune() + { + super(Material.iron); + //setUnlocalizedName("bloodRune"); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setHardness(2.0F); + setResistance(5.0F); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:BlankRune"); + this.altarCapacityRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:AltarCapacityRune"); + this.dislocationRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:DislocationRune"); + this.orbCapacityRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:OrbCapacityRune"); + } + + public int getRuneEffect(int metaData) + { + switch (metaData) + { + case 0: + return 0; + + case 1: //Altar Capacity rune + return 5; + + case 2: //Filling/emptying rune + return 6; + + case 3: //Orb Capacity rune + return 7; + } + + return 0; + } + + @SideOnly(Side.CLIENT) + + /** + * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) + */ + public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) + { + if (this.equals(ModBlocks.bloodRune)) + { + par3List.add(new ItemStack(par1, 1, 0)); + par3List.add(new ItemStack(par1, 1, 1)); + par3List.add(new ItemStack(par1, 1, 2)); + par3List.add(new ItemStack(par1, 1, 3)); + } else + { + super.getSubBlocks(par1, par2CreativeTabs, par3List); + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (meta) + { + case 0: + return blockIcon; + + case 1: + return altarCapacityRuneIcon; + + case 2: + return dislocationRuneIcon; + + case 3: + return this.orbCapacityRuneIcon; + + default: + return blockIcon; + } + } + + @Override + public int damageDropped(int metadata) + { + return metadata; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BloodStoneBrick.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BloodStoneBrick.java new file mode 100644 index 00000000..33652470 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/BloodStoneBrick.java @@ -0,0 +1,27 @@ +package WayofTime.alchemicalWizardry.common.block; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BloodStoneBrick extends Block +{ + public BloodStoneBrick() + { + super(Material.iron); + setHardness(2.0F); + setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + //setUnlocalizedName("bloodStoneBrick"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodStoneBrick"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/EfficiencyRune.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/EfficiencyRune.java new file mode 100644 index 00000000..1b247c24 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/EfficiencyRune.java @@ -0,0 +1,31 @@ +package WayofTime.alchemicalWizardry.common.block; + +import net.minecraft.client.renderer.texture.IIconRegister; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class EfficiencyRune extends BloodRune +{ + public EfficiencyRune() + { + super(); + //setUnlocalizedName("efficiencyRune"); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setHardness(2.0F); + setResistance(5.0F); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:EfficiencyRune"); + } + + @Override + public int getRuneEffect(int metaData) + { + return 2; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/EmptySocket.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/EmptySocket.java new file mode 100644 index 00000000..844eba08 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/EmptySocket.java @@ -0,0 +1,34 @@ +package WayofTime.alchemicalWizardry.common.block; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class EmptySocket extends Block +{ + public EmptySocket() + { + super(Material.iron); + setHardness(2.0F); + setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + //setUnlocalizedName("emptySocket"); + // TODO Auto-generated constructor stub + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:EmptySocket"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/IOrientable.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/IOrientable.java new file mode 100644 index 00000000..93b170b0 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/IOrientable.java @@ -0,0 +1,14 @@ +package WayofTime.alchemicalWizardry.common.block; + +import net.minecraftforge.common.util.ForgeDirection; + +public interface IOrientable +{ + public ForgeDirection getInputDirection(); + + public ForgeDirection getOutputDirection(); + + public void setInputDirection(ForgeDirection direction); + + public void setOutputDirection(ForgeDirection direction); +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/ImperfectRitualStone.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/ImperfectRitualStone.java new file mode 100644 index 00000000..cb1bf106 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/ImperfectRitualStone.java @@ -0,0 +1,143 @@ +package WayofTime.alchemicalWizardry.common.block; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ImperfectRitualStone extends Block +{ + public ImperfectRitualStone() + { + super(Material.iron); + setHardness(2.0F); + setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + //setUnlocalizedName("imperfectRitualStone"); + // TODO Auto-generated constructor stub + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:ImperfectRitualStone"); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float xOff, float yOff, float zOff) + { + //ItemStack ist = player.getItemInUse(); + //if (!world.isRemote) + { + Block block = world.getBlock(x, y + 1, z); + + if (block == Blocks.water) + { + if (!player.capabilities.isCreativeMode && world.isRemote) + { + + //PacketDispatcher.sendPacketToServer(PacketHandler.getPacket(SpellHelper.getUsername(player) , -5000, 0)); + } + + if (!world.isRemote) + { + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z)); +// if (!player.capabilities.isCreativeMode) +// { +// PacketDispatcher.sendPacketToServer(PacketHandler.getPacket(player.getEntityName(), -5000, 0)); +// } + } + + world.getWorldInfo().setRaining(true); + + if (world.isRemote) + { + world.setRainStrength(1.0F); + } + + world.setThunderStrength(1.0f); + world.getWorldInfo().setThunderTime(0); + world.getWorldInfo().setThundering(true); + return true; + } else if (block == Blocks.coal_block) + { + if (!player.capabilities.isCreativeMode && world.isRemote) + { + EnergyItems.drainPlayerNetwork(player, 5000); + } + + //EntityFallenAngel zomb = new EntityFallenAngel(world); + EntityZombie zomb = new EntityZombie(world); + zomb.setPosition(x + 0.5, y + 2, z + 0.5); + // zomb.setCurrentItemOrArmor(4, new ItemStack(Item.helmetIron.itemID,1,0)); + // zomb.setCurrentItemOrArmor(3, new ItemStack(Item.plateIron.itemID,1,0)); + // zomb.setCurrentItemOrArmor(2, new ItemStack(Item.legsIron.itemID,1,0)); + // zomb.setCurrentItemOrArmor(1, new ItemStack(Item.bootsIron.itemID,1,0)); + //zomb.setCurrentItemOrArmor(0, new ItemStack(AlchemicalWizardry.energySword.itemID,1,0)); + zomb.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2000)); + zomb.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 20000, 7)); + zomb.addPotionEffect(new PotionEffect(Potion.resistance.id, 20000, 3)); + + if (!world.isRemote) + { + world.spawnEntityInWorld(zomb); + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z)); +// if (!player.capabilities.isCreativeMode) +// { +// PacketDispatcher.sendPacketToServer(PacketHandler.getPacket(player.getEntityName(), -5000, 0)); +// } + } + + return true; + } else if (block== Blocks.lapis_block) + { + if (!player.capabilities.isCreativeMode && world.isRemote) + { + EnergyItems.drainPlayerNetwork(player, 5000); + } + + if (!world.isRemote) + { + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z)); + world.setWorldTime((world.getWorldTime() / 24000) * 24000 + 13800); +// if (!player.capabilities.isCreativeMode) +// { +// PacketDispatcher.sendPacketToServer(PacketHandler.getPacket(player.getEntityName(), -5000, 0)); +// } + } + } else if (block == Blocks.bedrock) + { + if (!player.capabilities.isCreativeMode && world.isRemote) + { + EnergyItems.drainPlayerNetwork(player, 5000); + } + + if (!world.isRemote) + { + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z)); + //world.setWorldTime((world.getWorldTime()/24000)*24000+13800); +// if (!player.capabilities.isCreativeMode) +// { +// PacketDispatcher.sendPacketToServer(PacketHandler.getPacket(player.getEntityName(), -5000, 0)); +// } + } + + player.addPotionEffect(new PotionEffect(Potion.resistance.id, 60 * 20, 1)); + } + } + return false; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/LargeBloodStoneBrick.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/LargeBloodStoneBrick.java new file mode 100644 index 00000000..1b304938 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/LargeBloodStoneBrick.java @@ -0,0 +1,27 @@ +package WayofTime.alchemicalWizardry.common.block; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class LargeBloodStoneBrick extends Block +{ + public LargeBloodStoneBrick() + { + super(Material.iron); + setHardness(2.0F); + setResistance(5.0F); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + //setUnlocalizedName("largeBloodStoneBrick"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:LargeBloodStoneBrick"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/LifeEssenceBlock.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/LifeEssenceBlock.java new file mode 100644 index 00000000..3407b8c2 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/LifeEssenceBlock.java @@ -0,0 +1,58 @@ +package WayofTime.alchemicalWizardry.common.block; + +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.fluids.BlockFluidClassic; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class LifeEssenceBlock extends BlockFluidClassic +{ + public LifeEssenceBlock() + { + super(AlchemicalWizardry.lifeEssenceFluid, Material.water); + AlchemicalWizardry.lifeEssenceFluid.setBlock(this); + //setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return this.blockIcon; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:lifeEssenceStill"); + this.getFluid().setIcons(blockIcon); + } + + @Override + public boolean canDisplace(IBlockAccess world, int x, int y, int z) + { + if (world.getBlock(x, y, z).getMaterial().isLiquid()) + { + return false; + } + + return super.canDisplace(world, x, y, z); + } + + @Override + public boolean displaceIfPossible(World world, int x, int y, int z) + { + if (world.getBlock(x, y, z).getMaterial().isLiquid()) + { + return false; + } + + return super.displaceIfPossible(world, x, y, z); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/RitualStone.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/RitualStone.java new file mode 100644 index 00000000..b818b064 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/RitualStone.java @@ -0,0 +1,122 @@ +package WayofTime.alchemicalWizardry.common.block; + +import javax.swing.Icon; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.items.ScribeTool; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class RitualStone extends Block +{ + @SideOnly(Side.CLIENT) + private static IIcon blankIcon; + @SideOnly(Side.CLIENT) + private static IIcon waterStoneIcon; + @SideOnly(Side.CLIENT) + private static IIcon fireStoneIcon; + @SideOnly(Side.CLIENT) + private static IIcon earthStoneIcon; + @SideOnly(Side.CLIENT) + private static IIcon airStoneIcon; + @SideOnly(Side.CLIENT) + private static IIcon duskStoneIcon; + + public RitualStone() + { + super(Material.iron); + setHardness(2.0F); + setResistance(5.0F); + //setUnlocalizedName("ritualStone"); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blankIcon = iconRegister.registerIcon("AlchemicalWizardry:RitualStone"); + this.waterStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:WaterRitualStone"); + this.fireStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:FireRitualStone"); + this.earthStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:EarthRitualStone"); + this.airStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:AirRitualStone"); + this.duskStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:DuskRitualStone"); + } + + @Override + public int damageDropped(int metadata) + { + return 0; + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) + { + ItemStack playerItem = player.getCurrentEquippedItem(); + + if (playerItem == null) + { + return false; + } + + Item item = playerItem.getItem(); + + if (!(item instanceof ScribeTool)) + { + return false; + } + + if (playerItem.getMaxDamage() <= playerItem.getItemDamage() && !(playerItem.getMaxDamage() == 0)) + { + return false; + } + + ScribeTool scribeTool = (ScribeTool) item; + + if (!player.capabilities.isCreativeMode) + { + playerItem.setItemDamage(playerItem.getItemDamage() + 1); + } + + world.setBlockMetadataWithNotify(x, y, z, scribeTool.getType(), 3); + world.markBlockForUpdate(x, y, z); + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int metadata) + { + switch (metadata) + { + case 0: + return blankIcon; + + case 1: + return waterStoneIcon; + + case 2: + return fireStoneIcon; + + case 3: + return earthStoneIcon; + + case 4: + return airStoneIcon; + + case 5: + return duskStoneIcon; + + default: + return blankIcon; + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/RuneOfSacrifice.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/RuneOfSacrifice.java new file mode 100644 index 00000000..147c1c7e --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/RuneOfSacrifice.java @@ -0,0 +1,31 @@ +package WayofTime.alchemicalWizardry.common.block; + +import net.minecraft.client.renderer.texture.IIconRegister; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class RuneOfSacrifice extends BloodRune +{ + public RuneOfSacrifice() + { + super(); + //setUnlocalizedName("runeOfSacrifice"); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setHardness(2.0F); + setResistance(5.0F); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:RuneOfSacrifice"); + } + + @Override + public int getRuneEffect(int metaData) + { + return 3; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/RuneOfSelfSacrifice.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/RuneOfSelfSacrifice.java new file mode 100644 index 00000000..54244e07 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/RuneOfSelfSacrifice.java @@ -0,0 +1,31 @@ +package WayofTime.alchemicalWizardry.common.block; + +import net.minecraft.client.renderer.texture.IIconRegister; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class RuneOfSelfSacrifice extends BloodRune +{ + public RuneOfSelfSacrifice() + { + super(); + //setUnlocalizedName("runeOfSelfSacrifice"); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setHardness(2.0F); + setResistance(5.0F); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:RuneOfSelfSacrifice"); + } + + @Override + public int getRuneEffect(int metaData) + { + return 4; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/SpectralBlock.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/SpectralBlock.java new file mode 100644 index 00000000..0bbab952 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/SpectralBlock.java @@ -0,0 +1,104 @@ +package WayofTime.alchemicalWizardry.common.block; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SpectralBlock extends Block +{ + public SpectralBlock() + { + super(Material.rock); + //this.setUnlocalizedName("spectralBlock"); + } + +// @Override +// public int tickRate(World par1World) +// { +// return 10; +// } + + /** + * Ticks the block if it's been scheduled + */ + @Override + public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) + { + //if(!par1World.isRemote) + par1World.setBlockToAir(par2, par3, par4); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:SpectralBlock"); + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int quantityDropped(Random par1Random) + { + return 0; + } + + @SideOnly(Side.CLIENT) + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + public int getRenderBlockPass() + { + return 1; + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) + { + //TEAltar tileEntity = (TEAltar)world.getBlockTileEntity(x, y, z); + if (player.isSneaking()) + { + return false; + } + + ItemStack playerItem = player.getCurrentEquippedItem(); + + if (playerItem != null) + { + if (playerItem.getItem() instanceof ItemBlock) + { + world.setBlock(x, y, z, ((ItemBlock)(playerItem.getItem())).field_150939_a, playerItem.getItemDamage(), 3); + + if (!player.capabilities.isCreativeMode) + { + playerItem.stackSize--; + } + + return true; + } else + { + return false; + } + } + + return true; + } + + @Override + public void onBlockAdded(World par1World, int par2, int par3, int par4) + { + par1World.scheduleBlockUpdate(par2, par3, par4, this, 100); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/block/SpeedRune.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/SpeedRune.java new file mode 100644 index 00000000..5f4a71d5 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/block/SpeedRune.java @@ -0,0 +1,31 @@ +package WayofTime.alchemicalWizardry.common.block; + +import net.minecraft.client.renderer.texture.IIconRegister; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SpeedRune extends BloodRune +{ + public SpeedRune() + { + super(); + //setUnlocalizedName("speedRune"); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setHardness(2.0F); + setResistance(5.0F); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) + { + this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:SpeedRune"); + } + + @Override + public int getRuneEffect(int metaData) + { + return 1; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/AltarComponent.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/AltarComponent.java new file mode 100644 index 00000000..4aeb4e75 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/AltarComponent.java @@ -0,0 +1,60 @@ +package WayofTime.alchemicalWizardry.common.bloodAltarUpgrade; + +import net.minecraft.block.Block; + +public class AltarComponent +{ + private int x; + private int y; + private int z; + private Block block; + private int metadata; + private boolean isBloodRune; + private boolean isUpgradeSlot; + + public AltarComponent(int x, int y, int z, Block block, int metadata, boolean isBloodRune, boolean isUpgradeSlot) + { + this.x = x; + this.y = y; + this.z = z; + this.block = block; + this.metadata = metadata; + this.isBloodRune = isBloodRune; + this.isUpgradeSlot = isUpgradeSlot; + } + + public int getX() + { + return x; + } + + public int getY() + { + return y; + } + + public int getZ() + { + return z; + } + + public Block getBlock() + { + return block; + } + + public int getMetadata() + { + return metadata; + } + + public boolean isBloodRune() + { + return isBloodRune; + } + + public boolean isUpgradeSlot() + { + return isUpgradeSlot; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/AltarUpgradeComponent.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/AltarUpgradeComponent.java new file mode 100644 index 00000000..acdede16 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/AltarUpgradeComponent.java @@ -0,0 +1,93 @@ +package WayofTime.alchemicalWizardry.common.bloodAltarUpgrade; + +public class AltarUpgradeComponent +{ + private int speedUpgrades; + private int efficiencyUpgrades; + private int sacrificeUpgrades; + private int selfSacrificeUpgrades; + private int displacementUpgrades; + private int altarCapacitiveUpgrades; + private int orbCapacitiveUpgrades; + + public AltarUpgradeComponent() + { + speedUpgrades = 0; + efficiencyUpgrades = 0; + sacrificeUpgrades = 0; + selfSacrificeUpgrades = 0; + displacementUpgrades = 0; + altarCapacitiveUpgrades = 0; + orbCapacitiveUpgrades = 0; + } + + public void addSpeedUpgrade() + { + speedUpgrades++; + } + + public void addEfficiencyUpgrade() + { + efficiencyUpgrades++; + } + + public void addSacrificeUpgrade() + { + sacrificeUpgrades++; + } + + public void addSelfSacrificeUpgrade() + { + selfSacrificeUpgrades++; + } + + public void addDisplacementUpgrade() + { + displacementUpgrades++; + } + + public void addaltarCapacitiveUpgrade() + { + altarCapacitiveUpgrades++; + } + + public void addorbCapacitiveUpgrade() + { + orbCapacitiveUpgrades++; + } + + public int getSpeedUpgrades() + { + return speedUpgrades; + } + + public int getEfficiencyUpgrades() + { + return efficiencyUpgrades; + } + + public int getSacrificeUpgrades() + { + return sacrificeUpgrades; + } + + public int getSelfSacrificeUpgrades() + { + return selfSacrificeUpgrades; + } + + public int getDisplacementUpgrades() + { + return displacementUpgrades; + } + + public int getAltarCapacitiveUpgrades() + { + return this.altarCapacitiveUpgrades; + } + + public int getOrbCapacitiveUpgrades() + { + return this.orbCapacitiveUpgrades; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java new file mode 100644 index 00000000..d5db3638 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java @@ -0,0 +1,296 @@ +package WayofTime.alchemicalWizardry.common.bloodAltarUpgrade; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.block.BloodRune; + +public class UpgradedAltars +{ + public static List secondTierAltar = new ArrayList(); + public static List thirdTierAltar = new ArrayList(); + public static List fourthTierAltar = new ArrayList(); + public static List fifthTierAltar = new ArrayList(); + public static int highestAltar = 5; + + public static int isAltarValid(World world, int x, int y, int z) + { + for (int i = highestAltar; i >= 2; i--) + { + if (checkAltarIsValid(world, x, y, z, i)) + { + return i; + } + } + + return 1; + } + + public static boolean checkAltarIsValid(World world, int x, int y, int z, int altarTier) + { + switch (altarTier) + { + case 1: + return true; + + case 2: + for (AltarComponent ac : secondTierAltar) + { + if (ac.isBloodRune()) + { + Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + + if (!(testBlock instanceof BloodRune)) + { + return false; + } + } else + { + Block block = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + int metadata = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + + if (((ac.getBlock() != block) || (ac.getMetadata() != metadata)) && !(ac.getBlock() == Blocks.stonebrick && !world.isAirBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()))) + { + return false; + } + } + } + + return true; + + case 3: + for (AltarComponent ac : thirdTierAltar) + { + if (ac.isBloodRune()) + { + Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + + if (!(testBlock instanceof BloodRune)) + { + return false; + } + } else + { + Block block = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + int metadata = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + + if (((ac.getBlock() != block) || (ac.getMetadata() != metadata)) && !(ac.getBlock() == Blocks.stonebrick && !world.isAirBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()))) + { + return false; + } + } + } + + return true; + + case 4: + for (AltarComponent ac : fourthTierAltar) + { + if (ac.isBloodRune()) + { + Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + + if (!(testBlock instanceof BloodRune)) + { + return false; + } + } else + { + Block block = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + int metadata = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + + if (((ac.getBlock() != block) || (ac.getMetadata() != metadata)) && !(ac.getBlock() == Blocks.stonebrick && !world.isAirBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()))) + { + return false; + } + } + } + + return true; + + case 5: + for (AltarComponent ac : fifthTierAltar) + { + if (ac.isBloodRune()) + { + Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + + if (!(testBlock instanceof BloodRune)) + { + return false; + } + } else + { + Block block = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + int metadata = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + + if (((ac.getBlock() != block) || (ac.getMetadata() != metadata)) && !(ac.getBlock() == Blocks.stonebrick && !world.isAirBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()))) + { + return false; + } + } + } + + return true; + + default: + return false; + } + } + + public static AltarUpgradeComponent getUpgrades(World world, int x, int y, int z, int altarTier) + { + AltarUpgradeComponent upgrades = new AltarUpgradeComponent(); + List list = UpgradedAltars.getAltarUpgradeListForTier(altarTier); + + for (AltarComponent ac : list) + { + if (ac.isUpgradeSlot()) + { + //Currently checks the getRuneEffect. + //TODO Change so that it uses the metadata instead, with the BlockID. + Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ()); + + if (testBlock instanceof BloodRune) + { + if (!world.isRemote) + { + switch (((BloodRune) testBlock).getRuneEffect(world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ()))) + { + case 1: + upgrades.addSpeedUpgrade(); + break; + + case 2: + upgrades.addEfficiencyUpgrade(); + break; + + case 3: + upgrades.addSacrificeUpgrade(); + break; + + case 4: + upgrades.addSelfSacrificeUpgrade(); + break; + + case 5: + upgrades.addaltarCapacitiveUpgrade(); + break; + + case 6: + upgrades.addDisplacementUpgrade(); + break; + + case 7: + upgrades.addorbCapacitiveUpgrade(); + break; + } + } + } + } + } + + return upgrades; + } + + public static void loadAltars() + { + secondTierAltar.add(new AltarComponent(-1, -1, -1, ModBlocks.bloodRune, 0, true, false)); + secondTierAltar.add(new AltarComponent(0, -1, -1, ModBlocks.bloodRune, 0, true, true)); + secondTierAltar.add(new AltarComponent(1, -1, -1, ModBlocks.bloodRune, 0, true, false)); + secondTierAltar.add(new AltarComponent(-1, -1, 0, ModBlocks.bloodRune, 0, true, true)); + secondTierAltar.add(new AltarComponent(1, -1, 0, ModBlocks.bloodRune, 0, true, true)); + secondTierAltar.add(new AltarComponent(-1, -1, 1, ModBlocks.bloodRune, 0, true, false)); + secondTierAltar.add(new AltarComponent(0, -1, 1, ModBlocks.bloodRune, 0, true, true)); + secondTierAltar.add(new AltarComponent(1, -1, 1, ModBlocks.bloodRune, 0, true, false)); + thirdTierAltar.add(new AltarComponent(-1, -1, -1, ModBlocks.bloodRune, 0, true, true)); + thirdTierAltar.add(new AltarComponent(0, -1, -1, ModBlocks.bloodRune, 0, true, true)); + thirdTierAltar.add(new AltarComponent(1, -1, -1, ModBlocks.bloodRune, 0, true, true)); + thirdTierAltar.add(new AltarComponent(-1, -1, 0, ModBlocks.bloodRune, 0, true, true)); + thirdTierAltar.add(new AltarComponent(1, -1, 0, ModBlocks.bloodRune, 0, true, true)); + thirdTierAltar.add(new AltarComponent(-1, -1, 1, ModBlocks.bloodRune, 0, true, true)); + thirdTierAltar.add(new AltarComponent(0, -1, 1, ModBlocks.bloodRune, 0, true, true)); + thirdTierAltar.add(new AltarComponent(1, -1, 1, ModBlocks.bloodRune, 0, true, true)); + thirdTierAltar.add(new AltarComponent(-3, -1, -3, Blocks.stonebrick, 0, false, false)); + thirdTierAltar.add(new AltarComponent(-3, 0, -3, Blocks.stonebrick, 0, false, false)); + thirdTierAltar.add(new AltarComponent(3, -1, -3, Blocks.stonebrick, 0, false, false)); + thirdTierAltar.add(new AltarComponent(3, 0, -3, Blocks.stonebrick, 0, false, false)); + thirdTierAltar.add(new AltarComponent(-3, -1, 3, Blocks.stonebrick, 0, false, false)); + thirdTierAltar.add(new AltarComponent(-3, 0, 3, Blocks.stonebrick, 0, false, false)); + thirdTierAltar.add(new AltarComponent(3, -1, 3, Blocks.stonebrick, 0, false, false)); + thirdTierAltar.add(new AltarComponent(3, 0, 3, Blocks.stonebrick, 0, false, false)); + thirdTierAltar.add(new AltarComponent(-3, 1, -3, Blocks.glowstone, 0, false, false)); + thirdTierAltar.add(new AltarComponent(3, 1, -3, Blocks.glowstone, 0, false, false)); + thirdTierAltar.add(new AltarComponent(-3, 1, 3, Blocks.glowstone, 0, false, false)); + thirdTierAltar.add(new AltarComponent(3, 1, 3, Blocks.glowstone, 0, false, false)); + + for (int i = -2; i <= 2; i++) + { + thirdTierAltar.add(new AltarComponent(3, -2, i, ModBlocks.bloodRune, 0, true, true)); + thirdTierAltar.add(new AltarComponent(-3, -2, i, ModBlocks.bloodRune, 0, true, true)); + thirdTierAltar.add(new AltarComponent(i, -2, 3, ModBlocks.bloodRune, 0, true, true)); + thirdTierAltar.add(new AltarComponent(i, -2, -3, ModBlocks.bloodRune, 0, true, true)); + } + + fourthTierAltar.addAll(thirdTierAltar); + + for (int i = -3; i <= 3; i++) + { + fourthTierAltar.add(new AltarComponent(5, -3, i, ModBlocks.bloodRune, 0, true, true)); + fourthTierAltar.add(new AltarComponent(-5, -3, i, ModBlocks.bloodRune, 0, true, true)); + fourthTierAltar.add(new AltarComponent(i, -3, 5, ModBlocks.bloodRune, 0, true, true)); + fourthTierAltar.add(new AltarComponent(i, -3, -5, ModBlocks.bloodRune, 0, true, true)); + } + + for (int i = -2; i <= 1; i++) + { + fourthTierAltar.add(new AltarComponent(5, i, 5, Blocks.stonebrick, 0, false, false)); + fourthTierAltar.add(new AltarComponent(5, i, -5, Blocks.stonebrick, 0, false, false)); + fourthTierAltar.add(new AltarComponent(-5, i, -5, Blocks.stonebrick, 0, false, false)); + fourthTierAltar.add(new AltarComponent(-5, i, 5, Blocks.stonebrick, 0, false, false)); + } + + fourthTierAltar.add(new AltarComponent(5, 2, 5, ModBlocks.largeBloodStoneBrick, 0, false, false)); + fourthTierAltar.add(new AltarComponent(5, 2, -5, ModBlocks.largeBloodStoneBrick, 0, false, false)); + fourthTierAltar.add(new AltarComponent(-5, 2, -5, ModBlocks.largeBloodStoneBrick, 0, false, false)); + fourthTierAltar.add(new AltarComponent(-5, 2, 5, ModBlocks.largeBloodStoneBrick, 0, false, false)); + fifthTierAltar.addAll(fourthTierAltar); + fifthTierAltar.add(new AltarComponent(-8, -3, 8, Blocks.beacon, 0, false, false)); + fifthTierAltar.add(new AltarComponent(-8, -3, -8, Blocks.beacon, 0, false, false)); + fifthTierAltar.add(new AltarComponent(8, -3, 8, Blocks.beacon, 0, false, false)); + fifthTierAltar.add(new AltarComponent(8, -3, 8, Blocks.beacon, 0, false, false)); + + for (int i = -6; i <= 6; i++) + { + fifthTierAltar.add(new AltarComponent(8, -4, i, ModBlocks.bloodRune, 0, true, true)); + fifthTierAltar.add(new AltarComponent(-8, -4, i, ModBlocks.bloodRune, 0, true, true)); + fifthTierAltar.add(new AltarComponent(i, -4, 8, ModBlocks.bloodRune, 0, true, true)); + fifthTierAltar.add(new AltarComponent(i, -4, -8, ModBlocks.bloodRune, 0, true, true)); + } + } + + public static List getAltarUpgradeListForTier(int tier) + { + switch (tier) + { + case 2: + return secondTierAltar; + + case 3: + return thirdTierAltar; + + case 4: + return fourthTierAltar; + + case 5: + return fifthTierAltar; + } + + return null; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java new file mode 100644 index 00000000..f394162d --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java @@ -0,0 +1,493 @@ +package WayofTime.alchemicalWizardry.common.entity.mob; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIFollowOwner; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget; +import net.minecraft.entity.ai.EntityAIOwnerHurtTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; + +public class EntityBileDemon extends EntityDemon +{ + private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); + + private static float maxTamedHealth = 100.0F; + private static float maxUntamedHealth = 200.0F; + private int attackTimer; + + public EntityBileDemon(World par1World) + { + super(par1World, AlchemicalWizardry.entityBileDemonID); + this.setSize(1.3F, 2.0F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAISwimming(this)); + //this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); + this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0D, true)); + this.tasks.addTask(3, this.aiSit); + this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); + //this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + //this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); + this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(9, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); + this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); + this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true)); + //this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false)); + this.setTamed(false); + attackTimer = 0; + //this.isImmuneToFire = true; + } + + @Override + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + //This line affects the speed of the monster + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000001192092896D); + + //My guess is that this will alter the max health + if (this.isTamed()) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); + } + + //this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase par1EntityLivingBase) + { + super.setAttackTarget(par1EntityLivingBase); + + if (par1EntityLivingBase == null) + { + this.setAngry(false); + } else if (!this.isTamed()) + { + this.setAngry(true); + } + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth())); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, new Float(this.getHealth())); + this.dataWatcher.addObject(19, new Byte((byte) 0)); + //this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1))); + } + + /** + * Plays step sound at given x, y, z for the entity + */ + protected void playStepSound(int par1, int par2, int par3, int par4) + { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("Angry", this.isAngry()); + par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor()); + par1NBTTagCompound.setByte("attackTimer", (byte) attackTimer); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + this.setAngry(par1NBTTagCompound.getBoolean("Angry")); + + if (par1NBTTagCompound.hasKey("CollarColor")) + { + this.setCollarColor(par1NBTTagCompound.getByte("CollarColor")); + } + + attackTimer = par1NBTTagCompound.getByte("attackTimer"); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "none"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.irongolem.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.irongolem.death"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 1.0F; + } + + /** + * Returns the item ID for the item the mob drops on death. + */ + protected int getDropItemId() + { + return -1; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + + if (attackTimer > 0) + { + attackTimer--; + } + } + + public int getAttackTimer() + { + return attackTimer; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + } + + public float getEyeHeight() + { + return this.height * 0.8F; + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { + if (this.isEntityInvulnerable()) + { + return false; + } else + { + Entity entity = par1DamageSource.getEntity(); + this.aiSit.setSitting(false); + + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) + { + par2 = (par2 + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + public boolean attackEntityAsMob(Entity par1Entity) + { + this.attackTimer = 10; + this.worldObj.setEntityState(this, (byte) 4); + boolean flag = par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) (7 + this.rand.nextInt(15))); + + if (flag) + { + par1Entity.motionY += 0.4000000059604645D; + } + + this.playSound("mob.irongolem.throw", 1.0F, 1.0F); + return flag; + } + + public void setTamed(boolean par1) + { + super.setTamed(par1); + + if (par1) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + @Override + public boolean interact(EntityPlayer par1EntityPlayer) + { + ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (itemstack != null) + { + if (itemstack.getItem() instanceof ItemFood) + { + ItemFood itemfood = (ItemFood) itemstack.getItem(); + + if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + this.heal((float) itemfood.func_150905_g(itemstack)); + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); + } + + return true; + } + } + } + + if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && !this.isBreedingItem(itemstack)) + { + if (!this.worldObj.isRemote) + { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.setPathToEntity((PathEntity) null); + this.setTarget((Entity) null); + this.setAttackTarget((EntityLivingBase) null); + } + + this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting()); + } + } else if (itemstack != null && itemstack.getItem().equals(ModItems.weakBloodOrb) && !this.isAngry()) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(1) == 0) + { + this.setTamed(true); + this.setPathToEntity((PathEntity) null); + this.setAttackTarget((EntityLivingBase) null); + this.aiSit.setSitting(true); + this.setHealth(this.maxTamedHealth); + this.setOwner(par1EntityPlayer.getCommandSenderName()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte) 7); + } else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte) 6); + } + } + + return true; + } + + return super.interact(par1EntityPlayer); + } + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack par1ItemStack) + { + return false; + //return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); + } + + /** + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /** + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean par1) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2))); + } else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3))); + } + } + + /** + * Return this wolf's collar color. + */ + public int getCollarColor() + { + return this.dataWatcher.getWatchableObjectByte(20) & 15; + } + + /** + * Set this wolf's collar color. + */ + public void setCollarColor(int par1) + { + this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15))); + } + + /** + * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. + */ + public EntityWolf spawnBabyAnimal(EntityAgeable par1EntityAgeable) + { + return null; + } + + public void func_70918_i(boolean par1) + { + if (par1) + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1)); + } else + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0)); + } + } + + /** + * Returns true if the mob is currently able to mate with the specified mob. + */ + public boolean canMateWith(EntityAnimal par1EntityAnimal) + { + return false; + } + + public boolean func_70922_bv() + { + return this.dataWatcher.getWatchableObjectByte(19) == 1; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + //return !this.isTamed() && this.ticksExisted > 2400; + return false; + } + + @Override + public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) + { + if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) + { + if (par1EntityLivingBase instanceof EntityBileDemon) + { + EntityBileDemon entitywolf = (EntityBileDemon) par1EntityLivingBase; + + if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase) + { + return false; + } + } + + return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame(); + } else + { + return false; + } + } + + public EntityAgeable createChild(EntityAgeable par1EntityAgeable) + { + return this.spawnBabyAnimal(par1EntityAgeable); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBoulderFist.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBoulderFist.java new file mode 100644 index 00000000..cc0f18c3 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBoulderFist.java @@ -0,0 +1,499 @@ +package WayofTime.alchemicalWizardry.common.entity.mob; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; +import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile; +import net.minecraft.block.BlockColored; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.*; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public class EntityBoulderFist extends EntityDemon +{ + //private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 40, 40, 15.0F); + private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); + + private static float maxTamedHealth = 60.0F; + private static float maxUntamedHealth = 50.0F; + + public EntityBoulderFist(World par1World) + { + super(par1World, AlchemicalWizardry.entityBoulderFistID); + this.setSize(0.8F, 1.2F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, this.aiSit); + this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); + this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true)); + this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); + //this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + //this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); + this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(9, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); + this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); + this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true)); + this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false)); + this.setAggro(false); + //this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false)); + this.setTamed(false); + + if (par1World != null && !par1World.isRemote) + { + this.setCombatTask(); + } + + //this.isImmuneToFire = true; + } + + @Override + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + //This line affects the speed of the monster + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + + //My guess is that this will alter the max health + if (this.isTamed()) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); + } + + //this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase par1EntityLivingBase) + { + super.setAttackTarget(par1EntityLivingBase); + + if (par1EntityLivingBase == null) + { + this.setAngry(false); + } else if (!this.isTamed()) + { + this.setAngry(true); + } + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth())); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, new Float(this.getHealth())); + this.dataWatcher.addObject(19, new Byte((byte) 0)); + //this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1))); + } + + /** + * Plays step sound at given x, y, z for the entity + */ + protected void playStepSound(int par1, int par2, int par3, int par4) + { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("Angry", this.isAngry()); + par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + this.setAngry(par1NBTTagCompound.getBoolean("Angry")); + + if (par1NBTTagCompound.hasKey("CollarColor")) + { + this.setCollarColor(par1NBTTagCompound.getByte("CollarColor")); + } + + this.setCombatTask(); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + //TODO change sounds + return this.isAngry() ? "mob.wolf.growl" : (this.rand.nextInt(3) == 0 ? (this.isTamed() && this.dataWatcher.getWatchableObjectFloat(18) < 10.0F ? "mob.wolf.whine" : "mob.wolf.panting") : "mob.wolf.bark"); + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.wolf.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.wolf.death"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.4F; + } + + /** + * Returns the item ID for the item the mob drops on death. + */ + protected int getDropItemId() + { + return -1; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + } + + public float getEyeHeight() + { + return this.height * 0.8F; + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { + if (this.isEntityInvulnerable()) + { + return false; + } else + { + Entity entity = par1DamageSource.getEntity(); + this.aiSit.setSitting(false); + + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) + { + par2 = (par2 + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + public boolean attackEntityAsMob(Entity par1Entity) + { + int i = this.isTamed() ? 6 : 7; + return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i); + } + + public void setTamed(boolean par1) + { + super.setTamed(par1); + + if (par1) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + @Override + public boolean interact(EntityPlayer par1EntityPlayer) + { + ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (itemstack != null) + { + if (itemstack.getItem() instanceof ItemFood) + { + ItemFood itemfood = (ItemFood) itemstack.getItem(); + + if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + this.heal((float) itemfood.func_150905_g(itemstack)); + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); + } + + return true; + } + } + } + + if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && !this.isBreedingItem(itemstack)) + { + if (!this.worldObj.isRemote) + { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.setPathToEntity((PathEntity) null); + this.setTarget((Entity) null); + this.setAttackTarget((EntityLivingBase) null); + } + + this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting()); + } + } else if (itemstack != null && itemstack.getItem().equals(ModItems.weakBloodOrb) && !this.isAngry()) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(1) == 0) + { + this.setTamed(true); + this.setPathToEntity((PathEntity) null); + this.setAttackTarget((EntityLivingBase) null); + this.aiSit.setSitting(true); + this.setHealth(this.maxTamedHealth); + this.setOwner(par1EntityPlayer.getCommandSenderName()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte) 7); + } else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte) 6); + } + } + + return true; + } + + return super.interact(par1EntityPlayer); + } + + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack par1ItemStack) + { + return false; + //return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); + } + + /** + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /** + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean par1) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2))); + } else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3))); + } + } + + /** + * Return this wolf's collar color. + */ + public int getCollarColor() + { + return this.dataWatcher.getWatchableObjectByte(20) & 15; + } + + /** + * Set this wolf's collar color. + */ + public void setCollarColor(int par1) + { + this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15))); + } + + /** + * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. + */ + public EntityWolf spawnBabyAnimal(EntityAgeable par1EntityAgeable) + { + return null; + } + + public void func_70918_i(boolean par1) + { + if (par1) + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1)); + } else + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0)); + } + } + + /** + * Returns true if the mob is currently able to mate with the specified mob. + */ + public boolean canMateWith(EntityAnimal par1EntityAnimal) + { + return false; + } + + public boolean func_70922_bv() + { + return this.dataWatcher.getWatchableObjectByte(19) == 1; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + //return !this.isTamed() && this.ticksExisted > 2400; + return false; + } + + @Override + public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) + { + if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) + { + if (par1EntityLivingBase instanceof EntityBoulderFist) + { + EntityBoulderFist entitywolf = (EntityBoulderFist) par1EntityLivingBase; + + if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase) + { + return false; + } + } + + return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame(); + } else + { + return false; + } + } + + public EntityAgeable createChild(EntityAgeable par1EntityAgeable) + { + return this.spawnBabyAnimal(par1EntityAgeable); + } + + /** + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) + { + double xCoord; + double yCoord; + double zCoord; + HolyProjectile hol = new HolyProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 5, 600); + this.worldObj.spawnEntityInWorld(hol); + } + + /** + * sets this entity's combat AI. + */ + public void setCombatTask() + { + this.tasks.removeTask(this.aiAttackOnCollide); + //this.tasks.removeTask(this.aiArrowAttack); + ItemStack itemstack = this.getHeldItem(); + this.tasks.addTask(4, this.aiAttackOnCollide); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityDemon.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityDemon.java new file mode 100644 index 00000000..f28cbb75 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityDemon.java @@ -0,0 +1,94 @@ +package WayofTime.alchemicalWizardry.common.entity.mob; + +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.IDemon; +import WayofTime.alchemicalWizardry.common.items.DemonPlacer; + +public class EntityDemon extends EntityTameable implements IDemon +{ + private boolean isAggro; + private int demonID; + + public EntityDemon(World par1World, int demonID) + { + super(par1World); + this.demonID = demonID; + } + + @Override + public void setSummonedConditions() + { + this.setAggro(true); + } + + @Override + public boolean isAggro() + { + return this.isAggro; + } + + @Override + public void setAggro(boolean aggro) + { + this.isAggro = aggro; + } + + @Override + public EntityAgeable createChild(EntityAgeable entityageable) + { + // TODO Auto-generated method stub + return null; + } + + protected void dropFewItems(boolean par1, int par2) + { + ItemStack drop = new ItemStack(ModItems.demonPlacer, 1, this.getDemonID()); + DemonPlacer.setOwnerName(drop, this.getOwnerName()); + + if (this.hasCustomNameTag()) + { + drop.setStackDisplayName(this.getCustomNameTag()); + } + + this.entityDropItem(drop, 0.0f); + } + + public void onLivingUpdate() + { + super.onLivingUpdate(); + + if (!this.isAggro() && worldObj.getWorldTime() % 100 == 0) + { + this.heal(1); + } + } + + public void sendSittingMessageToPlayer(EntityPlayer owner, boolean isSitting) + { + if (owner != null && owner.worldObj.isRemote) + { + ChatComponentText chatmessagecomponent; + + if (isSitting) + { + chatmessagecomponent = new ChatComponentText("I will stay here for now, Master."); + } else + { + chatmessagecomponent = new ChatComponentText("I shall follow and protect you!"); + } + + owner.addChatComponentMessage(chatmessagecomponent); + } + } + + public int getDemonID() + { + return this.demonID; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityEarthElemental.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityEarthElemental.java new file mode 100644 index 00000000..5d7b5045 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityEarthElemental.java @@ -0,0 +1,28 @@ +package WayofTime.alchemicalWizardry.common.entity.mob; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.IMob; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public class EntityEarthElemental extends EntityElemental implements IMob +{ + public EntityEarthElemental(World world) + { + super(world, AlchemicalWizardry.entityEarthElementalID); + } + + public void inflictEffectOnEntity(Entity target) + { + if (target instanceof EntityLivingBase) + { + ((EntityLivingBase) target).attackEntityFrom(DamageSource.causeMobDamage(this), 10); + ((EntityLivingBase) target).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 4)); + ((EntityLivingBase) target).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 150, 0)); + } + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityElemental.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityElemental.java new file mode 100644 index 00000000..f07dc92c --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityElemental.java @@ -0,0 +1,750 @@ +package WayofTime.alchemicalWizardry.common.entity.mob; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.BlockColored; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +import java.util.List; + +public class EntityElemental extends EntityDemon +{ + //private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 40, 40, 15.0F); + private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); + + private static float maxTamedHealth = 100.0F; + private static float maxUntamedHealth = 100.0F; + + public EntityElemental(World par1World, int demonID) + { + super(par1World, demonID); + this.setSize(0.5F, 1.0F); + this.setAggro(false); + //this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false)); + this.setTamed(false); + + if (par1World != null && !par1World.isRemote) + { + this.setCombatTask(); + } + + //this.isImmuneToFire = true; + } + + public int courseChangeCooldown; + public double waypointX; + public double waypointY; + public double waypointZ; + private Entity targetedEntity; + + /** + * Cooldown time between target loss and new target aquirement. + */ + private int aggroCooldown; + public int prevAttackCounter; + public int attackCounter; + + /** + * The explosion radius of spawned fireballs. + */ + //private int explosionStrength = 1; +// +// private int heightOffsetUpdateTime; +// private float heightOffset = 0.5F; +// private int field_70846_g; + protected void dropFewItems(boolean par1, int par2) + { + if (worldObj.rand.nextFloat() < (1 - Math.pow(0.6f, par2 + 1))) + { + this.entityDropItem(new ItemStack(ModItems.demonBloodShard, 1, 0), 0.0f); + } + } + + protected void fall(float par1) + { + } + + /** + * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance + * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround + */ + protected void updateFallState(double par1, boolean par3) + { + } + + /** + * Moves the entity based on the specified heading. Args: strafe, forward + */ + public void moveEntityWithHeading(float par1, float par2) + { + if (this.isInWater()) + { + this.moveFlying(par1, par2, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.800000011920929D; + this.motionY *= 0.800000011920929D; + this.motionZ *= 0.800000011920929D; + } else if (this.handleLavaMovement()) + { + this.moveFlying(par1, par2, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } else + { + float f2 = 0.91F; + + if (this.onGround) + { + f2 = 0.54600006F; + Block i = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); + + if (i != null) + { + f2 = i.slipperiness * 0.91F; + } + } + + float f3 = 0.16277136F / (f2 * f2 * f2); + this.moveFlying(par1, par2, this.onGround ? 0.1F * f3 : 0.02F); + f2 = 0.91F; + + if (this.onGround) + { + f2 = 0.54600006F; + Block j = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); + + if (j != null) + { + f2 = j.slipperiness * 0.91F; + } + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= (double) f2; + this.motionY *= (double) f2; + this.motionZ *= (double) f2; + } + + double d0 = this.posX - this.prevPosX; + double d1 = this.posZ - this.prevPosZ; + float f4 = MathHelper.sqrt_double(d0 * d0 + d1 * d1) * 4.0F; + + if (f4 > 1.0F) + { + f4 = 1.0F; + } + } + + /** + * returns true if this entity is by a ladder, false otherwise + */ + public boolean isOnLadder() + { + return false; + } + + @SideOnly(Side.CLIENT) + public boolean func_110182_bF() + { + return this.dataWatcher.getWatchableObjectByte(25) != 0; + } + + protected void updateEntityActionState() + { +// if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0) +// { +// this.setDead(); +// } + + //this.despawnEntity(); + if (this.getHealth() <= this.getMaxHealth() / 2.0f && worldObj.rand.nextInt(200) == 0) + { + this.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionReciprocation.id, 100, 1)); + } + + this.prevAttackCounter = this.attackCounter; + double d0 = this.waypointX - this.posX; + double d1 = this.waypointY - this.posY; + double d2 = this.waypointZ - this.posZ; + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + + if (d3 < 1.0D || d3 > 3600.0D) + { + this.waypointX = this.posX + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.waypointY = this.posY + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.waypointZ = this.posZ + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + } + + if (this.courseChangeCooldown-- <= 0) + { + this.courseChangeCooldown += this.rand.nextInt(5) + 2; + d3 = (double) MathHelper.sqrt_double(d3); + + if (this.isCourseTraversable(this.waypointX, this.waypointY, this.waypointZ, d3)) + { + this.motionX += d0 / d3 * 0.1D; + this.motionY += d1 / d3 * 0.1D; + this.motionZ += d2 / d3 * 0.1D; + } else + { + this.waypointX = this.posX + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.waypointY = this.posY + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.waypointZ = this.posZ + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + } + } + + if (this.targetedEntity != null && this.targetedEntity.isDead) + { + this.targetedEntity = null; + } + + if (this.targetedEntity == null || this.aggroCooldown-- <= 0) + { + this.targetedEntity = getClosestVulnerableMonsterToEntity(this, 100.0D); + + if (this.targetedEntity != null) + { + this.aggroCooldown = 20; + } + } + + double d4 = 64.0D; + + if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < d4 * d4) + { + double d5 = this.targetedEntity.posX - this.posX; + double d6 = this.targetedEntity.boundingBox.minY + (double) (this.targetedEntity.height / 2.0F) - (this.posY + (double) (this.height / 2.0F)); + double d7 = this.targetedEntity.posZ - this.posZ; + this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(d5, d7)) * 180.0F / (float) Math.PI; + + if (this.courseChangeCooldown <= 0) + { + if (isCourseTraversable(this.targetedEntity.posX, this.targetedEntity.posY, this.targetedEntity.posZ, Math.sqrt(d5 * d5 + d6 * d6 + d7 * d7))) + { + this.waypointX = this.targetedEntity.posX; + this.waypointY = this.targetedEntity.posY; + this.waypointZ = this.targetedEntity.posZ; + this.motionX += d5 / d3 * 0.1D; + this.motionY += d6 / d3 * 0.1D; + this.motionZ += d7 / d3 * 0.1D; + } else + { + this.waypointX = this.posX + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.waypointY = this.posY + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.waypointZ = this.posZ + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.motionX += d5 / d3 * 0.1D; + this.motionY += d6 / d3 * 0.1D; + this.motionZ += d7 / d3 * 0.1D; + } + } + + if (this.canEntityBeSeen(this.targetedEntity)) + { + if (Math.sqrt(d5 * d5 + d6 * d6 + d7 * d7) < 4) + { +// if (this.attackCounter == 10) +// { +// this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1007, (int)this.posX, (int)this.posY, (int)this.posZ, 0); +// } + ++this.attackCounter; + + if (this.attackCounter >= 10) + { + this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) this.posX, (int) this.posY, (int) this.posZ, 0); + this.inflictEffectOnEntity(this.targetedEntity); + this.attackCounter = -40; + } + } + } else if (this.attackCounter > 0) + { + --this.attackCounter; + } + } else + { + this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float) Math.PI; + + if (this.attackCounter > 0) + { + --this.attackCounter; + } + } + + if (!this.worldObj.isRemote) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(25); + byte b1 = (byte) (this.attackCounter > 10 ? 1 : 0); + + if (b0 != b1) + { + this.dataWatcher.updateObject(25, Byte.valueOf(b1)); + } + } + } + + /** + * True if the ghast has an unobstructed line of travel to the waypoint. + */ + private boolean isCourseTraversable(double par1, double par3, double par5, double par7) + { + double d4 = (this.waypointX - this.posX) / par7; + double d5 = (this.waypointY - this.posY) / par7; + double d6 = (this.waypointZ - this.posZ) / par7; + AxisAlignedBB axisalignedbb = this.boundingBox.copy(); + + for (int i = 1; (double) i < par7; ++i) + { + axisalignedbb.offset(d4, d5, d6); + + if (!this.worldObj.getCollidingBoundingBoxes(this, axisalignedbb).isEmpty()) + { + return false; + } + } + + return true; + } + + /** + * Will return how many at most can spawn in a chunk at once. + */ + public int getMaxSpawnedInChunk() + { + return 1; + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("Angry", this.isAngry()); + par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + this.setAngry(par1NBTTagCompound.getBoolean("Angry")); + + if (par1NBTTagCompound.hasKey("CollarColor")) + { + this.setCollarColor(par1NBTTagCompound.getByte("CollarColor")); + } + + this.setCombatTask(); + } + + @Override + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + //This line affects the speed of the monster + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + + //My guess is that this will alter the max health + if (this.isTamed()) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); + } + + //this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return false; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase par1EntityLivingBase) + { + super.setAttackTarget(par1EntityLivingBase); + + if (par1EntityLivingBase == null) + { + this.setAngry(false); + } else if (!this.isTamed()) + { + this.setAngry(true); + } + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth())); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, new Float(this.getHealth())); + this.dataWatcher.addObject(19, new Byte((byte) 0)); + //this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1))); + this.dataWatcher.addObject(25, Byte.valueOf((byte) 0)); + } + + /** + * Plays step sound at given x, y, z for the entity + */ + protected void playStepSound(int par1, int par2, int par3, int par4) + { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + //TODO change sounds + return "none"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "none"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "none"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.4F; + } + + /** + * Returns the item ID for the item the mob drops on death. + */ + protected int getDropItemId() + { + return -1; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + } + + public float getEyeHeight() + { + return this.height * 0.8F; + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { + if (this.isEntityInvulnerable()) + { + return false; + } else + { + Entity entity = par1DamageSource.getEntity(); + this.aiSit.setSitting(false); + + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) + { + par2 = (par2 + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + public boolean attackEntityAsMob(Entity par1Entity) + { + int i = this.isTamed() ? 6 : 7; + return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i); + } + + public void setTamed(boolean par1) + { + super.setTamed(par1); + + if (par1) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack par1ItemStack) + { + return false; + //return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); + } + + /** + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /** + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean par1) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2))); + } else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3))); + } + } + + /** + * Return this wolf's collar color. + */ + public int getCollarColor() + { + return this.dataWatcher.getWatchableObjectByte(20) & 15; + } + + /** + * Set this wolf's collar color. + */ + public void setCollarColor(int par1) + { + this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15))); + } + + /** + * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. + */ + public EntityWolf spawnBabyAnimal(EntityAgeable par1EntityAgeable) + { + return null; + } + + public void func_70918_i(boolean par1) + { + if (par1) + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1)); + } else + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0)); + } + } + + /** + * Returns true if the mob is currently able to mate with the specified mob. + */ + public boolean canMateWith(EntityAnimal par1EntityAnimal) + { + return false; + } + + public boolean func_70922_bv() + { + return this.dataWatcher.getWatchableObjectByte(19) == 1; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + //return !this.isTamed() && this.ticksExisted > 2400; + return false; + } + + @Override + public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) + { + if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) + { + if (par1EntityLivingBase instanceof EntityBoulderFist) + { + EntityBoulderFist entitywolf = (EntityBoulderFist) par1EntityLivingBase; + + if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase) + { + return false; + } + } + + return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame(); + //return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer)par2EntityLivingBase).func_96122_a((EntityPlayer)par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse)par1EntityLivingBase).func_110248_bS(); + } else + { + return false; + } + } + + public EntityAgeable createChild(EntityAgeable par1EntityAgeable) + { + return this.spawnBabyAnimal(par1EntityAgeable); + } + + /** + * sets this entity's combat AI. + */ + public void setCombatTask() + { + this.tasks.removeTask(this.aiAttackOnCollide); + //this.tasks.removeTask(this.aiArrowAttack); + ItemStack itemstack = this.getHeldItem(); + this.tasks.addTask(4, this.aiAttackOnCollide); + } + + public void inflictEffectOnEntity(Entity target) + { + if (target instanceof EntityLivingBase) + { + ((EntityLivingBase) target).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 100, 0)); + } + } + + public static Entity getClosestVulnerableMonsterToEntity(Entity par1Entity, double par2) + { + double d4 = -1.0D; + double par1 = par1Entity.posX; + double par3 = par1Entity.posY; + double par5 = par1Entity.posZ; + + EntityLivingBase entityLiving = null; + World world = par1Entity.worldObj; + + double range = Math.sqrt(par2); + double verticalRange = Math.sqrt(par2); + List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(par1 - 0.5f, par3 - 0.5f, par5 - 0.5f, par1 + 0.5f, par3 + 0.5f, par5 + 0.5f).expand(range, verticalRange, range)); + if (entities == null) + { + return null; + } + + for (int i = 0; i < entities.size(); ++i) + { + EntityLivingBase entityLiving1 = entities.get(i); + + if (!(entityLiving1 instanceof EntityPlayer && ((EntityPlayer) entityLiving1).capabilities.disableDamage) && entityLiving1.isEntityAlive()) + { + double d5 = entityLiving1.getDistanceSq(par1, par3, par5); + double d6 = par2; + + if (entityLiving1.isSneaking()) + { + d6 = par2 * 0.800000011920929D; + } + + if (entityLiving1.isInvisible()) + { + float f = entityLiving1 instanceof EntityPlayer ? ((EntityPlayer) entityLiving1).getArmorVisibility() : 1.0f; + + if (f < 0.1F) + { + f = 0.1F; + } + + d6 *= (double) (0.7F * f); + } + + if ((par2 < 0.0D || d5 < d6 * d6) && (d4 == -1.0D || d5 < d4)) + { + if (par1Entity != entityLiving1) + { + d4 = d5; + entityLiving = entityLiving1; + } + } + } + } + + return entityLiving; + } + + @Override + public int getTotalArmorValue() //TODO + { + return 10; + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFallenAngel.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFallenAngel.java new file mode 100644 index 00000000..dc250f44 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFallenAngel.java @@ -0,0 +1,507 @@ +package WayofTime.alchemicalWizardry.common.entity.mob; + +import net.minecraft.block.BlockColored; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIFollowOwner; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget; +import net.minecraft.entity.ai.EntityAIOwnerHurtTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; +import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile; + +public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob +{ + private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 40, 40, 15.0F); + private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); + + private static float maxTamedHealth = 50.0F; + private static float maxUntamedHealth = 50.0F; + + public EntityFallenAngel(World par1World) + { + super(par1World, AlchemicalWizardry.entityFallenAngelID); + this.setSize(0.7F, 1.8F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, this.aiSit); + //this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); + //this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true)); + this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); + //this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + //this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); + this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(9, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); + this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); + this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true)); + this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false)); + this.setAggro(false); + //this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false)); + this.setTamed(false); + + if (par1World != null && !par1World.isRemote) + { + this.setCombatTask(); + } + + //this.isImmuneToFire = true; + } + + @Override + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + //This line affects the speed of the monster + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + + //My guess is that this will alter the max health + if (this.isTamed()) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); + } + + //this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase par1EntityLivingBase) + { + super.setAttackTarget(par1EntityLivingBase); + + if (par1EntityLivingBase == null) + { + this.setAngry(false); + } else if (!this.isTamed()) + { + this.setAngry(true); + } + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth())); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, new Float(this.getHealth())); + this.dataWatcher.addObject(19, new Byte((byte) 0)); + //this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1))); + } + + /** + * Plays step sound at given x, y, z for the entity + */ + protected void playStepSound(int par1, int par2, int par3, int par4) + { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("Angry", this.isAngry()); + par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + this.setAngry(par1NBTTagCompound.getBoolean("Angry")); + + if (par1NBTTagCompound.hasKey("CollarColor")) + { + this.setCollarColor(par1NBTTagCompound.getByte("CollarColor")); + } + + this.setCombatTask(); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + //TODO change sounds + return "none"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "none"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.wolf.death"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.4F; + } + + /** + * Returns the item ID for the item the mob drops on death. + */ + protected int getDropItemId() + { + return -1; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + } + + public float getEyeHeight() + { + return this.height * 0.8F; + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { + if (this.isEntityInvulnerable()) + { + return false; + } else + { + Entity entity = par1DamageSource.getEntity(); + this.aiSit.setSitting(false); + + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) + { + par2 = (par2 + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + public boolean attackEntityAsMob(Entity par1Entity) + { + int i = this.isTamed() ? 4 : 2; + return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i); + } + + public void setTamed(boolean par1) + { + super.setTamed(par1); + + if (par1) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + @Override + public boolean interact(EntityPlayer par1EntityPlayer) + { + ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (itemstack != null) + { + if (itemstack.getItem() instanceof ItemFood) + { + ItemFood itemfood = (ItemFood) itemstack.getItem(); + + if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + this.heal((float) itemfood.func_150905_g(itemstack)); + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); + } + + return true; + } + } + } + + if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && !this.isBreedingItem(itemstack)) + { + if (!this.worldObj.isRemote) + { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.setPathToEntity((PathEntity) null); + this.setTarget((Entity) null); + this.setAttackTarget((EntityLivingBase) null); + } + + this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting()); + } + } else if (itemstack != null && itemstack.getItem().equals(ModItems.weakBloodOrb) && !this.isAngry()) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(1) == 0) + { + this.setTamed(true); + this.setPathToEntity((PathEntity) null); + this.setAttackTarget((EntityLivingBase) null); + this.aiSit.setSitting(true); + this.setHealth(this.maxTamedHealth); + this.setOwner(par1EntityPlayer.getCommandSenderName()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte) 7); + } else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte) 6); + } + } + + return true; + } + + return super.interact(par1EntityPlayer); + } + + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack par1ItemStack) + { + return false; + //return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); + } + + /** + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /** + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean par1) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2))); + } else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3))); + } + } + + /** + * Return this wolf's collar color. + */ + public int getCollarColor() + { + return this.dataWatcher.getWatchableObjectByte(20) & 15; + } + + /** + * Set this wolf's collar color. + */ + public void setCollarColor(int par1) + { + this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15))); + } + + /** + * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. + */ + public EntityWolf spawnBabyAnimal(EntityAgeable par1EntityAgeable) + { + return null; + } + + public void func_70918_i(boolean par1) + { + if (par1) + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1)); + } else + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0)); + } + } + + /** + * Returns true if the mob is currently able to mate with the specified mob. + */ + public boolean canMateWith(EntityAnimal par1EntityAnimal) + { + return false; + } + + public boolean func_70922_bv() + { + return this.dataWatcher.getWatchableObjectByte(19) == 1; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + //return !this.isTamed() && this.ticksExisted > 2400; + return false; + } + + public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) + { + if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) + { + if (par1EntityLivingBase instanceof EntityFallenAngel) + { + EntityFallenAngel entitywolf = (EntityFallenAngel) par1EntityLivingBase; + + if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase) + { + return false; + } + } + + return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame(); + } else + { + return false; + } + } + + public EntityAgeable createChild(EntityAgeable par1EntityAgeable) + { + return this.spawnBabyAnimal(par1EntityAgeable); + } + + /** + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) + { + double xCoord; + double yCoord; + double zCoord; + HolyProjectile hol = new HolyProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 5, 600); + this.worldObj.spawnEntityInWorld(hol); + } + + /** + * sets this entity's combat AI. + */ + public void setCombatTask() + { + this.tasks.removeTask(this.aiAttackOnCollide); + this.tasks.removeTask(this.aiArrowAttack); + ItemStack itemstack = this.getHeldItem(); + this.tasks.addTask(4, this.aiArrowAttack); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFireElemental.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFireElemental.java new file mode 100644 index 00000000..a599be7c --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFireElemental.java @@ -0,0 +1,26 @@ +package WayofTime.alchemicalWizardry.common.entity.mob; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.IMob; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +public class EntityFireElemental extends EntityElemental implements IMob +{ + public EntityFireElemental(World world) + { + super(world, AlchemicalWizardry.entityFireElementalID); + this.isImmuneToFire = true; + } + + public void inflictEffectOnEntity(Entity target) + { + if (target instanceof EntityLivingBase) + { + ((EntityLivingBase) target).setFire(10); + ((EntityLivingBase) target).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 150, 0)); + } + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityHolyElemental.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityHolyElemental.java new file mode 100644 index 00000000..c4c626a0 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityHolyElemental.java @@ -0,0 +1,28 @@ +package WayofTime.alchemicalWizardry.common.entity.mob; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.IMob; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public class EntityHolyElemental extends EntityElemental implements IMob +{ + public EntityHolyElemental(World world) + { + super(world, AlchemicalWizardry.entityHolyElementalID); + } + + public void inflictEffectOnEntity(Entity target) + { + if (target instanceof EntityLivingBase) + { + ((EntityLivingBase) target).attackEntityFrom(DamageSource.causeMobDamage(this), 15); + ((EntityLivingBase) target).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 150, 0)); + ((EntityLivingBase) target).addPotionEffect(new PotionEffect(Potion.poison.id, 100, 1)); + } + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityIceDemon.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityIceDemon.java new file mode 100644 index 00000000..99f6f7c3 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityIceDemon.java @@ -0,0 +1,529 @@ +package WayofTime.alchemicalWizardry.common.entity.mob; + +import net.minecraft.block.BlockColored; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIFollowOwner; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget; +import net.minecraft.entity.ai.EntityAIOwnerHurtTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.util.DamageSource; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; +import WayofTime.alchemicalWizardry.common.entity.projectile.IceProjectile; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class EntityIceDemon extends EntityDemon implements IRangedAttackMob +{ + private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 30, 50, 15.0F); + private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); + + private static float maxTamedHealth = 50.0F; + private static float maxUntamedHealth = 30.0F; + + public EntityIceDemon(World par1World) + { + super(par1World, AlchemicalWizardry.entityIceDemonID); + this.setSize(0.5F, 2.0F); + //this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, this.aiSit); + //this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); + //this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true)); + this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); + //this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + //this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); + this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(9, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); + this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); + this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true)); + this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false)); + this.setAggro(false); + //this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false)); + this.setTamed(false); + + if (par1World != null && !par1World.isRemote) + { + this.setCombatTask(); + } + + //this.isImmuneToFire = true; + } + + @Override + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + //This line affects the speed of the monster + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.40000001192092896D); + + //My guess is that this will alter the max health + if (this.isTamed()) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); + } + + //this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase par1EntityLivingBase) + { + super.setAttackTarget(par1EntityLivingBase); + + if (par1EntityLivingBase == null) + { + this.setAngry(false); + } else if (!this.isTamed()) + { + this.setAngry(true); + } + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth())); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, new Float(this.getHealth())); + this.dataWatcher.addObject(19, new Byte((byte) 0)); + //this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1))); + } + + /** + * Plays step sound at given x, y, z for the entity + */ + protected void playStepSound(int par1, int par2, int par3, int par4) + { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("Angry", this.isAngry()); + par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + this.setAngry(par1NBTTagCompound.getBoolean("Angry")); + + if (par1NBTTagCompound.hasKey("CollarColor")) + { + this.setCollarColor(par1NBTTagCompound.getByte("CollarColor")); + } + + this.setCombatTask(); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "none"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.irongolem.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.irongolem.death"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.4F; + } + + /** + * Returns the item ID for the item the mob drops on death. + */ + protected int getDropItemId() + { + return -1; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + int range = 2; + + Vec3 blockVector = SpellHelper.getEntityBlockVector(this); + + int xCoord = (int)(blockVector.xCoord); + int yCoord = (int)(blockVector.yCoord); + int zCoord = (int)(blockVector.zCoord); + + for (int i = -range; i <= range; i++) + { + for (int j = -range; j <= range; j++) + { + for (int k = -range; k <= range; k++) + { + if (worldObj.rand.nextFloat() < 0.25f) + { + SpellHelper.freezeWaterBlock(worldObj, xCoord + i, yCoord + j, zCoord + k); + } + } + } + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + } + + public float getEyeHeight() + { + return this.height * 0.8F; + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { + if (this.isEntityInvulnerable()) + { + return false; + } else + { + Entity entity = par1DamageSource.getEntity(); + this.aiSit.setSitting(false); + + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) + { + par2 = (par2 + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + public boolean attackEntityAsMob(Entity par1Entity) + { + int i = this.isTamed() ? 4 : 2; + return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i); + } + + public void setTamed(boolean par1) + { + super.setTamed(par1); + + if (par1) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + @Override + public boolean interact(EntityPlayer par1EntityPlayer) + { + ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (itemstack != null) + { + if (itemstack.getItem() instanceof ItemFood) + { + ItemFood itemfood = (ItemFood) itemstack.getItem(); + + if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + this.heal((float) itemfood.func_150905_g(itemstack)); + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); + } + + return true; + } + } + } + + if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && !this.isBreedingItem(itemstack)) + { + if (!this.worldObj.isRemote) + { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.setPathToEntity((PathEntity) null); + this.setTarget((Entity) null); + this.setAttackTarget((EntityLivingBase) null); + } + + this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting()); + } + } else if (itemstack != null && itemstack.getItem().equals(ModItems.weakBloodOrb) && !this.isAngry()) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(1) == 0) + { + this.setTamed(true); + this.setPathToEntity((PathEntity) null); + this.setAttackTarget((EntityLivingBase) null); + this.aiSit.setSitting(true); + this.setHealth(this.maxTamedHealth); + this.setOwner(par1EntityPlayer.getCommandSenderName()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte) 7); + } else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte) 6); + } + } + + return true; + } + + return super.interact(par1EntityPlayer); + } + + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack par1ItemStack) + { + return false; + //return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); + } + + /** + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /** + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean par1) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2))); + } else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3))); + } + } + + /** + * Return this wolf's collar color. + */ + public int getCollarColor() + { + return this.dataWatcher.getWatchableObjectByte(20) & 15; + } + + /** + * Set this wolf's collar color. + */ + public void setCollarColor(int par1) + { + this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15))); + } + + /** + * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. + */ + public EntityWolf spawnBabyAnimal(EntityAgeable par1EntityAgeable) + { + return null; + } + + public void func_70918_i(boolean par1) + { + if (par1) + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1)); + } else + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0)); + } + } + + /** + * Returns true if the mob is currently able to mate with the specified mob. + */ + public boolean canMateWith(EntityAnimal par1EntityAnimal) + { + return false; + } + + public boolean func_70922_bv() + { + return this.dataWatcher.getWatchableObjectByte(19) == 1; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + //return !this.isTamed() && this.ticksExisted > 2400; + return false; + } + + public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) + { + if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) + { + if (par1EntityLivingBase instanceof EntityIceDemon) + { + EntityIceDemon entitywolf = (EntityIceDemon) par1EntityLivingBase; + + if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase) + { + return false; + } + } + + return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame(); + } else + { + return false; + } + } + + public EntityAgeable createChild(EntityAgeable par1EntityAgeable) + { + return this.spawnBabyAnimal(par1EntityAgeable); + } + + /** + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) + { + double xCoord; + double yCoord; + double zCoord; + IceProjectile hol = new IceProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 3, 600); + this.worldObj.spawnEntityInWorld(hol); + } + + /** + * sets this entity's combat AI. + */ + public void setCombatTask() + { + this.tasks.removeTask(this.aiAttackOnCollide); + this.tasks.removeTask(this.aiArrowAttack); + ItemStack itemstack = this.getHeldItem(); + this.tasks.addTask(4, this.aiArrowAttack); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityLowerGuardian.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityLowerGuardian.java new file mode 100644 index 00000000..0522cc1c --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityLowerGuardian.java @@ -0,0 +1,491 @@ +package WayofTime.alchemicalWizardry.common.entity.mob; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; +import net.minecraft.block.BlockColored; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.*; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public class EntityLowerGuardian extends EntityDemon +{ + private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); + + private static float maxTamedHealth = 50.0F; + private static float maxUntamedHealth = 30.0F; + private int attackTimer; + private boolean isAggro; + + public EntityLowerGuardian(World par1World) + { + super(par1World, AlchemicalWizardry.entityLowerGuardianID); + this.setSize(0.7F, 1.8F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAISwimming(this)); + //this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); + this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0D, true)); + this.tasks.addTask(3, this.aiSit); + this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); + //this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + //this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); + this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(9, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); + this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); + this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true)); + this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false)); + this.setAggro(false); + this.setTamed(false); + attackTimer = 0; + //isAggro = false; + //this.isImmuneToFire = true; + } + + @Override + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + //This line affects the speed of the monster + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + + //My guess is that this will alter the max health + if (this.isTamed()) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); + } + + //this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase par1EntityLivingBase) + { + super.setAttackTarget(par1EntityLivingBase); + + if (par1EntityLivingBase == null) + { + this.setAngry(false); + } else if (!this.isTamed()) + { + this.setAngry(true); + } + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth())); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, new Float(this.getHealth())); + this.dataWatcher.addObject(19, new Byte((byte) 0)); + //this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1))); + } + + /** + * Plays step sound at given x, y, z for the entity + */ + protected void playStepSound(int par1, int par2, int par3, int par4) + { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("Angry", this.isAngry()); + par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor()); + par1NBTTagCompound.setByte("attackTimer", (byte) attackTimer); + par1NBTTagCompound.setBoolean("isAggro", this.isAggro()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + 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"); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "none"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.irongolem.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.irongolem.death"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 1.0F; + } + + /** + * Returns the item ID for the item the mob drops on death. + */ + protected int getDropItemId() + { + return -1; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + + if (attackTimer > 0) + { + attackTimer--; + } + } + + public int getAttackTimer() + { + return attackTimer; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + } + + public float getEyeHeight() + { + return this.height * 0.8F; + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { + if (this.isEntityInvulnerable()) + { + return false; + } else + { + Entity entity = par1DamageSource.getEntity(); + this.aiSit.setSitting(false); + + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) + { + par2 = (par2 + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + public boolean attackEntityAsMob(Entity par1Entity) + { + this.attackTimer = 10; + this.worldObj.setEntityState(this, (byte) 4); + boolean flag = par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) (7 + this.rand.nextInt(15))); + + if (flag) + { + par1Entity.motionY += 0.4000000059604645D; + } + + this.playSound("mob.irongolem.throw", 1.0F, 1.0F); + return flag; + } + + public void setTamed(boolean par1) + { + super.setTamed(par1); + + if (par1) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + @Override + public boolean interact(EntityPlayer par1EntityPlayer) + { + ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (itemstack != null) + { + if (itemstack.getItem() instanceof ItemFood) + { + ItemFood itemfood = (ItemFood) itemstack.getItem(); + + if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + this.heal((float) itemfood.func_150905_g(itemstack)); + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); + } + + return true; + } + } + } + + if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && !this.isBreedingItem(itemstack)) + { + if (!this.worldObj.isRemote) + { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.setPathToEntity((PathEntity) null); + this.setTarget((Entity) null); + this.setAttackTarget((EntityLivingBase) null); + } + + this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting()); + } + } else if (itemstack != null && itemstack.getItem().equals(ModItems.weakBloodOrb) && !this.isAngry()) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(1) == 0) + { + this.setTamed(true); + this.setPathToEntity((PathEntity) null); + this.setAttackTarget((EntityLivingBase) null); + this.aiSit.setSitting(true); + this.setHealth(this.maxTamedHealth); + this.setOwner(par1EntityPlayer.getCommandSenderName()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte) 7); + } else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte) 6); + } + } + + return true; + } + + return super.interact(par1EntityPlayer); + } + + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack par1ItemStack) + { + return false; + //return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); + } + + /** + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /** + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean par1) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2))); + } else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3))); + } + } + + /** + * Return this wolf's collar color. + */ + public int getCollarColor() + { + return this.dataWatcher.getWatchableObjectByte(20) & 15; + } + + /** + * Set this wolf's collar color. + */ + public void setCollarColor(int par1) + { + this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15))); + } + + /** + * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. + */ + public EntityWolf spawnBabyAnimal(EntityAgeable par1EntityAgeable) + { + return null; + } + + public void func_70918_i(boolean par1) + { + if (par1) + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1)); + } else + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0)); + } + } + + /** + * Returns true if the mob is currently able to mate with the specified mob. + */ + public boolean canMateWith(EntityAnimal par1EntityAnimal) + { + return false; + } + + public boolean func_70922_bv() + { + return this.dataWatcher.getWatchableObjectByte(19) == 1; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + //return !this.isTamed() && this.ticksExisted > 2400; + return false; + } + + public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) + { + if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) + { + if (par1EntityLivingBase instanceof EntityLowerGuardian) + { + EntityLowerGuardian entitywolf = (EntityLowerGuardian) par1EntityLivingBase; + + if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase) + { + return false; + } + } + + return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame(); + } else + { + return false; + } + } + + public EntityAgeable createChild(EntityAgeable par1EntityAgeable) + { + return this.spawnBabyAnimal(par1EntityAgeable); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShade.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShade.java new file mode 100644 index 00000000..2171bb9f --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShade.java @@ -0,0 +1,498 @@ +package WayofTime.alchemicalWizardry.common.entity.mob; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; +import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile; +import net.minecraft.block.BlockColored; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.*; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public class EntityShade extends EntityDemon +{ + //private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 40, 40, 15.0F); + private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); + + private static float maxTamedHealth = 50.0F; + private static float maxUntamedHealth = 100.0F; + + public EntityShade(World par1World) + { + super(par1World, AlchemicalWizardry.entityShadeID); + this.setSize(0.8F, 2.0F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, this.aiSit); + //this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); + this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true)); + this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); + //this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + //this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); + this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(9, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); + this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); + this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true)); + this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false)); + this.setAggro(false); + //this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false)); + this.setTamed(false); + + if (par1World != null && !par1World.isRemote) + { + this.setCombatTask(); + } + + //this.isImmuneToFire = true; + } + + @Override + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + //This line affects the speed of the monster + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + + //My guess is that this will alter the max health + if (this.isTamed()) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); + } + + //this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase par1EntityLivingBase) + { + super.setAttackTarget(par1EntityLivingBase); + + if (par1EntityLivingBase == null) + { + this.setAngry(false); + } else if (!this.isTamed()) + { + this.setAngry(true); + } + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth())); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, new Float(this.getHealth())); + this.dataWatcher.addObject(19, new Byte((byte) 0)); + //this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1))); + } + + /** + * Plays step sound at given x, y, z for the entity + */ + protected void playStepSound(int par1, int par2, int par3, int par4) + { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("Angry", this.isAngry()); + par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + this.setAngry(par1NBTTagCompound.getBoolean("Angry")); + + if (par1NBTTagCompound.hasKey("CollarColor")) + { + this.setCollarColor(par1NBTTagCompound.getByte("CollarColor")); + } + + this.setCombatTask(); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + //TODO change sounds + return "none"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "none"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "none"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.4F; + } + + /** + * Returns the item ID for the item the mob drops on death. + */ + protected int getDropItemId() + { + return -1; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + } + + public float getEyeHeight() + { + return this.height * 0.8F; + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { + if (this.isEntityInvulnerable()) + { + return false; + } else + { + Entity entity = par1DamageSource.getEntity(); + this.aiSit.setSitting(false); + + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) + { + par2 = (par2 + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + public boolean attackEntityAsMob(Entity par1Entity) + { + int i = this.isTamed() ? 6 : 7; + return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i); + } + + public void setTamed(boolean par1) + { + super.setTamed(par1); + + if (par1) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + @Override + public boolean interact(EntityPlayer par1EntityPlayer) + { + ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (itemstack != null) + { + if (itemstack.getItem() instanceof ItemFood) + { + ItemFood itemfood = (ItemFood) itemstack.getItem(); + + if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + this.heal((float) itemfood.func_150905_g(itemstack)); + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); + } + + return true; + } + } + } + + if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && !this.isBreedingItem(itemstack)) + { + if (!this.worldObj.isRemote) + { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.setPathToEntity((PathEntity) null); + this.setTarget((Entity) null); + this.setAttackTarget((EntityLivingBase) null); + } + + this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting()); + } + } else if (itemstack != null && itemstack.getItem().equals(ModItems.weakBloodOrb) && !this.isAngry()) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(1) == 0) + { + this.setTamed(true); + this.setPathToEntity((PathEntity) null); + this.setAttackTarget((EntityLivingBase) null); + this.aiSit.setSitting(true); + this.setHealth(this.maxTamedHealth); + this.setOwner(par1EntityPlayer.getCommandSenderName()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte) 7); + } else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte) 6); + } + } + + return true; + } + + return super.interact(par1EntityPlayer); + } + + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack par1ItemStack) + { + return false; + //return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); + } + + /** + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /** + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean par1) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2))); + } else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3))); + } + } + + /** + * Return this wolf's collar color. + */ + public int getCollarColor() + { + return this.dataWatcher.getWatchableObjectByte(20) & 15; + } + + /** + * Set this wolf's collar color. + */ + public void setCollarColor(int par1) + { + this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15))); + } + + /** + * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. + */ + public EntityWolf spawnBabyAnimal(EntityAgeable par1EntityAgeable) + { + return null; + } + + public void func_70918_i(boolean par1) + { + if (par1) + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1)); + } else + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0)); + } + } + + /** + * Returns true if the mob is currently able to mate with the specified mob. + */ + public boolean canMateWith(EntityAnimal par1EntityAnimal) + { + return false; + } + + public boolean func_70922_bv() + { + return this.dataWatcher.getWatchableObjectByte(19) == 1; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + //return !this.isTamed() && this.ticksExisted > 2400; + return false; + } + + public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) + { + if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) + { + if (par1EntityLivingBase instanceof EntityBoulderFist) + { + EntityBoulderFist entitywolf = (EntityBoulderFist) par1EntityLivingBase; + + if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase) + { + return false; + } + } + + return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame(); + } else + { + return false; + } + } + + public EntityAgeable createChild(EntityAgeable par1EntityAgeable) + { + return this.spawnBabyAnimal(par1EntityAgeable); + } + + /** + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) + { + double xCoord; + double yCoord; + double zCoord; + HolyProjectile hol = new HolyProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 5, 600); + this.worldObj.spawnEntityInWorld(hol); + } + + /** + * sets this entity's combat AI. + */ + public void setCombatTask() + { + this.tasks.removeTask(this.aiAttackOnCollide); + //this.tasks.removeTask(this.aiArrowAttack); + ItemStack itemstack = this.getHeldItem(); + this.tasks.addTask(4, this.aiAttackOnCollide); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShadeElemental.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShadeElemental.java new file mode 100644 index 00000000..004fcce4 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShadeElemental.java @@ -0,0 +1,27 @@ +package WayofTime.alchemicalWizardry.common.entity.mob; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.IMob; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +public class EntityShadeElemental extends EntityElemental implements IMob +{ + public EntityShadeElemental(World world) + { + super(world, AlchemicalWizardry.entityShadeElementalID); + } + + public void inflictEffectOnEntity(Entity target) + { + if (target instanceof EntityLivingBase) + { + ((EntityLivingBase) target).addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1)); + ((EntityLivingBase) target).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 150, 0)); + ((EntityLivingBase) target).addPotionEffect(new PotionEffect(Potion.nightVision.id, 100, 0)); + } + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntitySmallEarthGolem.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntitySmallEarthGolem.java new file mode 100644 index 00000000..0a6d5f98 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntitySmallEarthGolem.java @@ -0,0 +1,505 @@ +package WayofTime.alchemicalWizardry.common.entity.mob; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIFollowOwner; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget; +import net.minecraft.entity.ai.EntityAIOwnerHurtTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; +import WayofTime.alchemicalWizardry.common.entity.projectile.MudProjectile; + +public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackMob +{ + private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 25, 25, 15.0F); + private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); + + private static float maxTamedHealth = 20.0F; + private static float maxUntamedHealth = 10.0F; + + public EntitySmallEarthGolem(World par1World) + { + super(par1World, AlchemicalWizardry.entitySmallEarthGolemID); + this.setSize(0.2F, 1.0F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, this.aiSit); + //this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); + //this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true)); + this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); + //this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + //this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); + this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(9, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); + this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); + this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true)); + this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false)); + this.setAggro(false); + //this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false)); + this.setTamed(false); + + if (par1World != null && !par1World.isRemote) + { + this.setCombatTask(); + } + + //this.isImmuneToFire = true; + } + + @Override + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + //This line affects the speed of the monster + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.40000001192092896D); + + //My guess is that this will alter the max health + if (this.isTamed()) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); + } + + //this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase par1EntityLivingBase) + { + super.setAttackTarget(par1EntityLivingBase); + + if (par1EntityLivingBase == null) + { + this.setAngry(false); + } else if (!this.isTamed()) + { + this.setAngry(true); + } + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth())); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, new Float(this.getHealth())); + this.dataWatcher.addObject(19, new Byte((byte) 0)); + //this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1))); + } + + /** + * Plays step sound at given x, y, z for the entity + */ + protected void playStepSound(int par1, int par2, int par3, int par4) + { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("Angry", this.isAngry()); + par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + this.setAngry(par1NBTTagCompound.getBoolean("Angry")); + + if (par1NBTTagCompound.hasKey("CollarColor")) + { + this.setCollarColor(par1NBTTagCompound.getByte("CollarColor")); + } + + this.setCombatTask(); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "none"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.irongolem.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.irongolem.death"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.4F; + } + + /** + * Returns the item ID for the item the mob drops on death. + */ + protected int getDropItemId() + { + return -1; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + } + + public float getEyeHeight() + { + return this.height * 0.8F; + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { + if (this.isEntityInvulnerable()) + { + return false; + } else + { + Entity entity = par1DamageSource.getEntity(); + this.aiSit.setSitting(false); + + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) + { + par2 = (par2 + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + public boolean attackEntityAsMob(Entity par1Entity) + { + int i = this.isTamed() ? 4 : 2; + return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i); + } + + public void setTamed(boolean par1) + { + super.setTamed(par1); + + if (par1) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + @Override + public boolean interact(EntityPlayer par1EntityPlayer) + { + ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (itemstack != null) + { + if (itemstack.getItem() instanceof ItemFood) + { + ItemFood itemfood = (ItemFood) itemstack.getItem(); + + if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + this.heal((float) itemfood.func_150905_g(itemstack)); + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); + } + + return true; + } + } + } + + if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && !this.isBreedingItem(itemstack)) + { + if (!this.worldObj.isRemote) + { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.setPathToEntity((PathEntity) null); + this.setTarget((Entity) null); + this.setAttackTarget((EntityLivingBase) null); + } + + this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting()); + } + } else if (itemstack != null && itemstack.getItem().equals(ModItems.weakBloodOrb) && !this.isAngry()) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(1) == 0) + { + this.setTamed(true); + this.setPathToEntity((PathEntity) null); + this.setAttackTarget((EntityLivingBase) null); + this.aiSit.setSitting(true); + this.setHealth(this.maxTamedHealth); + this.setOwner(par1EntityPlayer.getCommandSenderName()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte) 7); + } else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte) 6); + } + } + + return true; + } + + return super.interact(par1EntityPlayer); + } + + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack par1ItemStack) + { + return false; + //return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); + } + + /** + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /** + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean par1) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2))); + } else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3))); + } + } + + /** + * Return this wolf's collar color. + */ + public int getCollarColor() + { + return this.dataWatcher.getWatchableObjectByte(20) & 15; + } + + /** + * Set this wolf's collar color. + */ + public void setCollarColor(int par1) + { + this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15))); + } + + /** + * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. + */ + public EntityWolf spawnBabyAnimal(EntityAgeable par1EntityAgeable) + { + return null; + } + + public void func_70918_i(boolean par1) + { + if (par1) + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1)); + } else + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0)); + } + } + + /** + * Returns true if the mob is currently able to mate with the specified mob. + */ + public boolean canMateWith(EntityAnimal par1EntityAnimal) + { + return false; + } + + public boolean func_70922_bv() + { + return this.dataWatcher.getWatchableObjectByte(19) == 1; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + //return !this.isTamed() && this.ticksExisted > 2400; + return false; + } + + public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) + { + if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) + { + if (par1EntityLivingBase instanceof EntitySmallEarthGolem) + { + EntitySmallEarthGolem entitywolf = (EntitySmallEarthGolem) par1EntityLivingBase; + + if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase) + { + return false; + } + } + + return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame(); + } else + { + return false; + } + } + + public EntityAgeable createChild(EntityAgeable par1EntityAgeable) + { + return this.spawnBabyAnimal(par1EntityAgeable); + } + + /** + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) + { + double xCoord; + double yCoord; + double zCoord; + MudProjectile hol = new MudProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 3, 600, false); + this.worldObj.spawnEntityInWorld(hol); + } + + /** + * sets this entity's combat AI. + */ + public void setCombatTask() + { + this.tasks.removeTask(this.aiAttackOnCollide); + this.tasks.removeTask(this.aiArrowAttack); + ItemStack itemstack = this.getHeldItem(); + this.tasks.addTask(4, this.aiArrowAttack); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWaterElemental.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWaterElemental.java new file mode 100644 index 00000000..ab141887 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWaterElemental.java @@ -0,0 +1,25 @@ +package WayofTime.alchemicalWizardry.common.entity.mob; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.IMob; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +public class EntityWaterElemental extends EntityElemental implements IMob +{ + public EntityWaterElemental(World world) + { + super(world, AlchemicalWizardry.entityWaterElementalID); + } + + public void inflictEffectOnEntity(Entity target) + { + if (target instanceof EntityLivingBase) + { + ((EntityLivingBase) target).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 100, 2)); + ((EntityLivingBase) target).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 150, 0)); + } + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWingedFireDemon.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWingedFireDemon.java new file mode 100644 index 00000000..f0e0aa65 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWingedFireDemon.java @@ -0,0 +1,508 @@ +package WayofTime.alchemicalWizardry.common.entity.mob; + +import net.minecraft.block.BlockColored; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIFollowOwner; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget; +import net.minecraft.entity.ai.EntityAIOwnerHurtTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; +import WayofTime.alchemicalWizardry.common.entity.projectile.FireProjectile; + +public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackMob +{ + private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 40, 40, 15.0F); + private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); + + private static float maxTamedHealth = 100.0F; + private static float maxUntamedHealth = 200.0F; + + public EntityWingedFireDemon(World par1World) + { + super(par1World, AlchemicalWizardry.entityWingedFireDemonID); + this.setSize(0.7F, 1.8F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, this.aiSit); + //this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); + //this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true)); + this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); + //this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + //this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); + this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(9, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); + this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); + this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true)); + this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false)); + this.setAggro(false); + //this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false)); + this.setTamed(false); + + if (par1World != null && !par1World.isRemote) + { + this.setCombatTask(); + } + + this.isImmuneToFire = true; + } + + @Override + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + //This line affects the speed of the monster + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + + //My guess is that this will alter the max health + if (this.isTamed()) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); + } + + //this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase par1EntityLivingBase) + { + super.setAttackTarget(par1EntityLivingBase); + + if (par1EntityLivingBase == null) + { + this.setAngry(false); + } else if (!this.isTamed()) + { + this.setAngry(true); + } + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth())); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, new Float(this.getHealth())); + this.dataWatcher.addObject(19, new Byte((byte) 0)); + //this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1))); + } + + /** + * Plays step sound at given x, y, z for the entity + */ + protected void playStepSound(int par1, int par2, int par3, int par4) + { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("Angry", this.isAngry()); + par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + this.setAngry(par1NBTTagCompound.getBoolean("Angry")); + + if (par1NBTTagCompound.hasKey("CollarColor")) + { + this.setCollarColor(par1NBTTagCompound.getByte("CollarColor")); + } + + this.setCombatTask(); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "mob.blaze.breathe"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.blaze.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.blaze.death"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.4F; + } + + /** + * Returns the item ID for the item the mob drops on death. + */ + protected int getDropItemId() + { + return -1; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + } + + public float getEyeHeight() + { + return this.height * 0.8F; + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { + if (this.isEntityInvulnerable()) + { + return false; + } else + { + Entity entity = par1DamageSource.getEntity(); + this.aiSit.setSitting(false); + + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) + { + par2 = (par2 + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + public boolean attackEntityAsMob(Entity par1Entity) + { + int i = this.isTamed() ? 4 : 2; + return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i); + } + + public void setTamed(boolean par1) + { + super.setTamed(par1); + + if (par1) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth); + } else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + @Override + public boolean interact(EntityPlayer par1EntityPlayer) + { + ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (itemstack != null) + { + if (itemstack.getItem() instanceof ItemFood) + { + ItemFood itemfood = (ItemFood) itemstack.getItem(); + + if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + this.heal((float) itemfood.func_150905_g(itemstack)); + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); + } + + return true; + } + } + } + + if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && !this.isBreedingItem(itemstack)) + { + if (!this.worldObj.isRemote) + { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.setPathToEntity((PathEntity) null); + this.setTarget((Entity) null); + this.setAttackTarget((EntityLivingBase) null); + } + + this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting()); + } + } else if (itemstack != null && itemstack.getItem().equals(ModItems.weakBloodOrb) && !this.isAngry()) + { + if (!par1EntityPlayer.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(1) == 0) + { + this.setTamed(true); + this.setPathToEntity((PathEntity) null); + this.setAttackTarget((EntityLivingBase) null); + this.aiSit.setSitting(true); + this.setHealth(this.maxTamedHealth); + this.setOwner(par1EntityPlayer.getCommandSenderName()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte) 7); + } else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte) 6); + } + } + + return true; + } + + return super.interact(par1EntityPlayer); + } + + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack par1ItemStack) + { + return false; + //return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); + } + + /** + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /** + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean par1) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2))); + } else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3))); + } + } + + /** + * Return this wolf's collar color. + */ + public int getCollarColor() + { + return this.dataWatcher.getWatchableObjectByte(20) & 15; + } + + /** + * Set this wolf's collar color. + */ + public void setCollarColor(int par1) + { + this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15))); + } + + /** + * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. + */ + public EntityWolf spawnBabyAnimal(EntityAgeable par1EntityAgeable) + { + return null; + } + + public void func_70918_i(boolean par1) + { + if (par1) + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1)); + } else + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0)); + } + } + + /** + * Returns true if the mob is currently able to mate with the specified mob. + */ + public boolean canMateWith(EntityAnimal par1EntityAnimal) + { + return false; + } + + public boolean func_70922_bv() + { + return this.dataWatcher.getWatchableObjectByte(19) == 1; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + //return !this.isTamed() && this.ticksExisted > 2400; + return false; + } + + public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) + { + if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) + { + if (par1EntityLivingBase instanceof EntityWingedFireDemon) + { + EntityWingedFireDemon entitywolf = (EntityWingedFireDemon) par1EntityLivingBase; + + if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase) + { + return false; + } + } + + return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame(); + } else + { + return false; + } + } + + public EntityAgeable createChild(EntityAgeable par1EntityAgeable) + { + return this.spawnBabyAnimal(par1EntityAgeable); + } + + /** + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) + { + double xCoord; + double yCoord; + double zCoord; + this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) this.posX, (int) this.posY, (int) this.posZ, 0); + FireProjectile hol = new FireProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 20, 600); + this.worldObj.spawnEntityInWorld(hol); + } + + /** + * sets this entity's combat AI. + */ + public void setCombatTask() + { + this.tasks.removeTask(this.aiAttackOnCollide); + this.tasks.removeTask(this.aiArrowAttack); + ItemStack itemstack = this.getHeldItem(); + this.tasks.addTask(4, this.aiArrowAttack); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/EnergyBlastProjectile.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/EnergyBlastProjectile.java new file mode 100644 index 00000000..49460c52 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/EnergyBlastProjectile.java @@ -0,0 +1,508 @@ +package WayofTime.alchemicalWizardry.common.entity.projectile; + +import java.util.Iterator; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IProjectile; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +//Shamelessly ripped off from x3n0ph0b3 +public class EnergyBlastProjectile extends Entity implements IProjectile +{ + protected int xTile = -1; + protected int yTile = -1; + protected int zTile = -1; + protected int inTile = 0; + protected int inData = 0; + protected boolean inGround = false; + /** + * The owner of this arrow. + */ + public EntityLivingBase shootingEntity; + protected int ticksInAir = 0; + protected int maxTicksInAir = 600; + private int ricochetCounter = 0; + private boolean scheduledForDeath = false; + protected int projectileDamage; + + public EnergyBlastProjectile(World par1World) + { + super(par1World); + this.setSize(0.5F, 0.5F); + } + + public EnergyBlastProjectile(World par1World, double par2, double par4, double par6) + { + super(par1World); + this.setSize(0.5F, 0.5F); + this.setPosition(par2, par4, par6); + yOffset = 0.0F; + } + + public EnergyBlastProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage) + { + super(par1World); + shootingEntity = par2EntityPlayer; + float par3 = 0.8F; + this.setSize(0.5F, 0.5F); + this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch); + posX -= MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + posY -= 0.2D; + posZ -= MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + this.setPosition(posX, posY, posZ); + yOffset = 0.0F; + motionX = -MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI); + motionZ = MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI); + motionY = -MathHelper.sin(rotationPitch / 180.0F * (float) Math.PI); + this.setThrowableHeading(motionX, motionY, motionZ, par3 * 1.5F, 1.0F); + this.projectileDamage = damage; + this.maxTicksInAir = 600; + } + + public EnergyBlastProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage, int maxTicksInAir, double posX, double posY, double posZ, float rotationYaw, float rotationPitch) + { + super(par1World); + shootingEntity = par2EntityPlayer; + float par3 = 0.8F; + this.setSize(0.5F, 0.5F); + this.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch); + posX -= MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + posY -= 0.2D; + posZ -= MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + this.setPosition(posX, posY, posZ); + yOffset = 0.0F; + motionX = -MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI); + motionZ = MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI); + motionY = -MathHelper.sin(rotationPitch / 180.0F * (float) Math.PI); + this.setThrowableHeading(motionX, motionY, motionZ, par3 * 1.5F, 1.0F); + this.projectileDamage = damage; + this.maxTicksInAir = maxTicksInAir; + } + + public EnergyBlastProjectile(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5, int damage, int maxTicksInAir) + { + super(par1World); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = par2EntityLivingBase; + this.posY = par2EntityLivingBase.posY + (double) par2EntityLivingBase.getEyeHeight() - 0.10000000149011612D; + double d0 = par3EntityLivingBase.posX - par2EntityLivingBase.posX; + double d1 = par3EntityLivingBase.boundingBox.minY + (double) (par3EntityLivingBase.height / 1.5F) - this.posY; + double d2 = par3EntityLivingBase.posZ - par2EntityLivingBase.posZ; + double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2); + + if (d3 >= 1.0E-7D) + { + float f2 = (float) (Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; + float f3 = (float) (-(Math.atan2(d1, d3) * 180.0D / Math.PI)); + double d4 = d0 / d3; + double d5 = d2 / d3; + this.setLocationAndAngles(par2EntityLivingBase.posX + d4, this.posY, par2EntityLivingBase.posZ + d5, f2, f3); + this.yOffset = 0.0F; + float f4 = (float) d3 * 0.2F; + this.setThrowableHeading(d0, d1, d2, par4, par5); + } + + this.projectileDamage = damage; + this.maxTicksInAir = maxTicksInAir; + } + + @Override + protected void entityInit() + { + dataWatcher.addObject(16, Byte.valueOf((byte) 0)); + } + + /** + * Similar to setArrowHeading, it's point the throwable entity to a x, y, z + * direction. + */ + @Override + public void setThrowableHeading(double var1, double var3, double var5, float var7, float var8) + { + float var9 = MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5); + var1 /= var9; + var3 /= var9; + var5 /= var9; + var1 += rand.nextGaussian() * 0.007499999832361937D * var8; + var3 += rand.nextGaussian() * 0.007499999832361937D * var8; + var5 += rand.nextGaussian() * 0.007499999832361937D * var8; + var1 *= var7; + var3 *= var7; + var5 *= var7; + motionX = var1; + motionY = var3; + motionZ = var5; + float var10 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); + prevRotationYaw = rotationYaw = (float) (Math.atan2(var1, var5) * 180.0D / Math.PI); + prevRotationPitch = rotationPitch = (float) (Math.atan2(var3, var10) * 180.0D / Math.PI); + } + + @Override + @SideOnly(Side.CLIENT) + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) + { + this.setPosition(par1, par3, par5); + this.setRotation(par7, par8); + } + + @Override + @SideOnly(Side.CLIENT) + /** + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double par1, double par3, double par5) + { + motionX = par1; + motionY = par3; + motionZ = par5; + + if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F) + { + float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); + prevRotationYaw = rotationYaw = (float) (Math.atan2(par1, par5) * 180.0D / Math.PI); + prevRotationPitch = rotationPitch = (float) (Math.atan2(par3, var7) * 180.0D / Math.PI); + prevRotationPitch = rotationPitch; + prevRotationYaw = rotationYaw; + this.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch); + } + } + + /** + * Called to update the entity's position/logic. + */ + @Override + public void onUpdate() + { + super.onUpdate(); + + if (ticksInAir > maxTicksInAir) + { + this.setDead(); + } + + if (shootingEntity == null) + { + List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(posX - 1, posY - 1, posZ - 1, posX + 1, posY + 1, posZ + 1)); + Iterator i = players.iterator(); + double closestDistance = Double.MAX_VALUE; + EntityPlayer closestPlayer = null; + + while (i.hasNext()) + { + EntityPlayer e = (EntityPlayer) i.next(); + double distance = e.getDistanceToEntity(this); + + if (distance < closestDistance) + { + closestPlayer = e; + } + } + + if (closestPlayer != null) + { + shootingEntity = closestPlayer; + } + } + + if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F) + { + float var1 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ); + prevRotationYaw = rotationYaw = (float) (Math.atan2(motionX, motionZ) * 180.0D / Math.PI); + prevRotationPitch = rotationPitch = (float) (Math.atan2(motionY, var1) * 180.0D / Math.PI); + } + + Block var16 = worldObj.getBlock(xTile, yTile, zTile); + + if (var16 != null) + { + var16.setBlockBoundsBasedOnState(worldObj, xTile, yTile, zTile); + AxisAlignedBB var2 = var16.getCollisionBoundingBoxFromPool(worldObj, xTile, yTile, zTile); + + if (var2 != null && var2.isVecInside(worldObj.getWorldVec3Pool().getVecFromPool(posX, posY, posZ))) + { + inGround = true; + } + } + + if (inGround) + { + Block var18 = worldObj.getBlock(xTile, yTile, zTile); + int var19 = worldObj.getBlockMetadata(xTile, yTile, zTile); + + if (var18.equals(Block.getBlockById(inTile)) && var19 == inData) + { + // this.groundImpact(); + // this.setDead(); + } + } else + { + ++ticksInAir; + + if (ticksInAir > 1 && ticksInAir < 3) + { + //worldObj.spawnParticle("flame", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0D, 0D, 0D); + for (int particles = 0; particles < 3; particles++) + { + this.doFiringParticles(); + } + } + + Vec3 var17 = worldObj.getWorldVec3Pool().getVecFromPool(posX, posY, posZ); + Vec3 var3 = worldObj.getWorldVec3Pool().getVecFromPool(posX + motionX, posY + motionY, posZ + motionZ); + MovingObjectPosition var4 = worldObj.func_147447_a(var17, var3, true, false, true); + var17 = worldObj.getWorldVec3Pool().getVecFromPool(posX, posY, posZ); + var3 = worldObj.getWorldVec3Pool().getVecFromPool(posX + motionX, posY + motionY, posZ + motionZ); + + if (var4 != null) + { + var3 = worldObj.getWorldVec3Pool().getVecFromPool(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord); + } + + Entity var5 = null; + List var6 = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D)); + double var7 = 0.0D; + Iterator var9 = var6.iterator(); + float var11; + + while (var9.hasNext()) + { + Entity var10 = (Entity) var9.next(); + + if (var10.canBeCollidedWith() && (var10 != shootingEntity || ticksInAir >= 5)) + { + var11 = 0.3F; + AxisAlignedBB var12 = var10.boundingBox.expand(var11, var11, var11); + MovingObjectPosition var13 = var12.calculateIntercept(var17, var3); + + if (var13 != null) + { + double var14 = var17.distanceTo(var13.hitVec); + + if (var14 < var7 || var7 == 0.0D) + { + var5 = var10; + var7 = var14; + } + } + } + } + + if (var5 != null) + { + var4 = new MovingObjectPosition(var5); + } + + if (var4 != null) + { + this.onImpact(var4); + + if (scheduledForDeath) + { + this.setDead(); + } + } + + posX += motionX; + posY += motionY; + posZ += motionZ; + MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ); + this.setPosition(posX, posY, posZ); + //this.doBlockCollisions(); + } + } + + public void doFiringParticles() + { + worldObj.spawnParticle("mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + worldObj.spawnParticle("flame", posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + @Override + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + par1NBTTagCompound.setShort("xTile", (short) xTile); + par1NBTTagCompound.setShort("yTile", (short) yTile); + par1NBTTagCompound.setShort("zTile", (short) zTile); + par1NBTTagCompound.setByte("inTile", (byte) inTile); + par1NBTTagCompound.setByte("inData", (byte) inData); + par1NBTTagCompound.setByte("inGround", (byte) (inGround ? 1 : 0)); + par1NBTTagCompound.setInteger("ticksInAir", ticksInAir); + par1NBTTagCompound.setInteger("maxTicksInAir", maxTicksInAir); + par1NBTTagCompound.setInteger("projectileDamage", this.projectileDamage); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + @Override + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + xTile = par1NBTTagCompound.getShort("xTile"); + yTile = par1NBTTagCompound.getShort("yTile"); + zTile = par1NBTTagCompound.getShort("zTile"); + inTile = par1NBTTagCompound.getByte("inTile") & 255; + inData = par1NBTTagCompound.getByte("inData") & 255; + inGround = par1NBTTagCompound.getByte("inGround") == 1; + ticksInAir = par1NBTTagCompound.getInteger("ticksInAir"); + maxTicksInAir = par1NBTTagCompound.getInteger("maxTicksInAir"); + projectileDamage = par1NBTTagCompound.getInteger("projectileDamage"); + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they + * walk on. used for spiders and wolves to prevent them from trampling crops + */ + @Override + protected boolean canTriggerWalking() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return 0.0F; + } + + /** + * Sets the amount of knockback the arrow applies when it hits a mob. + */ + public void setKnockbackStrength(int par1) + { + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ + @Override + public boolean canAttackWithItem() + { + return false; + } + + /** + * Whether the arrow has a stream of critical hit particles flying behind + * it. + */ + public void setIsCritical(boolean par1) + { + byte var2 = dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + dataWatcher.updateObject(16, Byte.valueOf((byte) (var2 | 1))); + } else + { + dataWatcher.updateObject(16, Byte.valueOf((byte) (var2 & -2))); + } + } + + /** + * Whether the arrow has a stream of critical hit particles flying behind + * it. + */ + public boolean getIsCritical() + { + byte var1 = dataWatcher.getWatchableObjectByte(16); + return (var1 & 1) != 0; + } + + public void onImpact(MovingObjectPosition mop) + { + if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null) + { + if (mop.entityHit == shootingEntity) + { + return; + } + + this.onImpact(mop.entityHit); + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + worldObj.createExplosion(shootingEntity, this.posX, this.posY, this.posZ, (float) (0.1), true); + this.setDead(); + } + } + + public void onImpact(Entity mop) + { + if (mop == shootingEntity && ticksInAir > 3) + { + shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1); + this.setDead(); + } else + { + //doDamage(8 + d6(), mop); + if (mop instanceof EntityLivingBase) + { + ((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60, 2)); + } + + doDamage(projectileDamage, mop); + worldObj.createExplosion(shootingEntity, this.posX, this.posY, this.posZ, (float) (0.1), true); + } + + spawnHitParticles("magicCrit", 8); + this.setDead(); + } + + private int d6() + { + return rand.nextInt(6) + 1; + } + + protected void spawnHitParticles(String string, int i) + { + for (int particles = 0; particles < i; particles++) + { + worldObj.spawnParticle(string, posX, posY - (string == "portal" ? 1 : 0), posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); + } + } + + protected void doDamage(int i, Entity mop) + { + mop.attackEntityFrom(this.getDamageSource(), i); + } + + public DamageSource getDamageSource() + { + return DamageSource.causeMobDamage(shootingEntity); + } + + public double smallGauss(double d) + { + return (worldObj.rand.nextFloat() - 0.5D) * d; + } + + public double gaussian(double d) + { + return d + d * ((rand.nextFloat() - 0.5D) / 4); + } + + private int getRicochetMax() + { + return 0; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java new file mode 100644 index 00000000..51934b4c --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java @@ -0,0 +1,137 @@ +package WayofTime.alchemicalWizardry.common.entity.projectile; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.potion.Potion; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.ModBlocks; + + +public class EntityBloodLightProjectile extends EnergyBlastProjectile +{ + public EntityBloodLightProjectile(World par1World) + { + super(par1World); + } + + public EntityBloodLightProjectile(World par1World, double par2, double par4, double par6) + { + super(par1World, par2, par4, par6); + } + + public EntityBloodLightProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage) + { + super(par1World, par2EntityPlayer, damage); + } + + public EntityBloodLightProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage, int maxTicksInAir, double posX, double posY, double posZ, float rotationYaw, float rotationPitch) + { + super(par1World, par2EntityPlayer, damage, maxTicksInAir, posX, posY, posZ, rotationYaw, rotationPitch); + } + + public EntityBloodLightProjectile(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5, int damage, int maxTicksInAir) + { + super(par1World, par2EntityLivingBase, par3EntityLivingBase, par4, par5, damage, maxTicksInAir); + } + + @Override + public DamageSource getDamageSource() + { + return DamageSource.causeMobDamage(shootingEntity); + } + + @Override + public void onImpact(MovingObjectPosition mop) + { + if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null) + { + if (mop.entityHit == shootingEntity) + { + return; + } + + this.onImpact(mop.entityHit); + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + int sideHit = mop.sideHit; + int blockX = mop.blockX; + int blockY = mop.blockY; + int blockZ = mop.blockZ; + + if (sideHit == 0 && this.worldObj.isAirBlock(blockX, blockY - 1, blockZ)) + { + this.worldObj.setBlock(blockX, blockY - 1, blockZ, ModBlocks.blockBloodLight); + } + + if (sideHit == 1 && this.worldObj.isAirBlock(blockX, blockY + 1, blockZ)) + { + this.worldObj.setBlock(blockX, blockY + 1, blockZ, ModBlocks.blockBloodLight); + } + + if (sideHit == 2 && this.worldObj.isAirBlock(blockX, blockY, blockZ - 1)) + { + this.worldObj.setBlock(blockX, blockY, blockZ - 1, ModBlocks.blockBloodLight); + } + + if (sideHit == 3 && this.worldObj.isAirBlock(blockX, blockY, blockZ + 1)) + { + this.worldObj.setBlock(blockX, blockY, blockZ + 1, ModBlocks.blockBloodLight); + } + + if (sideHit == 4 && this.worldObj.isAirBlock(blockX - 1, blockY, blockZ)) + { + this.worldObj.setBlock(blockX - 1, blockY, blockZ, ModBlocks.blockBloodLight); + } + + if (sideHit == 5 && this.worldObj.isAirBlock(blockX + 1, blockY, blockZ)) + { + this.worldObj.setBlock(blockX + 1, blockY, blockZ, ModBlocks.blockBloodLight); + } + + //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); + } + + this.setDead(); + } + + @Override + public void onImpact(Entity mop) + { + if (mop == shootingEntity && ticksInAir > 3) + { + shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1); + this.setDead(); + } else + { + //doDamage(8 + d6(), mop); + if (mop instanceof EntityLivingBase) + { + //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); + ((EntityLivingBase) mop).setFire(50); + ((EntityLivingBase) mop).setRevengeTarget(shootingEntity); + + if (((EntityLivingBase) mop).isPotionActive(Potion.fireResistance) || ((EntityLivingBase) mop).isImmuneToFire()) + { + ((EntityLivingBase) mop).attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1); + } else + { + doDamage(projectileDamage, mop); + ((EntityLivingBase) mop).hurtResistantTime = 0; + } + } + + //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); + } + + if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ)) + { + worldObj.setBlock((int) this.posX, (int) this.posY, (int) this.posZ, Blocks.fire); + } + + spawnHitParticles("magicCrit", 8); + this.setDead(); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaMainProjectile.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaMainProjectile.java new file mode 100644 index 00000000..9c55f452 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaMainProjectile.java @@ -0,0 +1,100 @@ +package WayofTime.alchemicalWizardry.common.entity.projectile; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntityEnergyBazookaMainProjectile extends EnergyBlastProjectile +{ + public EntityEnergyBazookaMainProjectile(World par1World) + { + super(par1World); + } + + public EntityEnergyBazookaMainProjectile(World par1World, double par2, double par4, double par6) + { + super(par1World, par2, par4, par6); + } + + public EntityEnergyBazookaMainProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage) + { + super(par1World, par2EntityPlayer, damage); + } + + public EntityEnergyBazookaMainProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage, int maxTicksInAir, double posX, double posY, double posZ, float rotationYaw, float rotationPitch) + { + super(par1World, par2EntityPlayer, damage, maxTicksInAir, posX, posY, posZ, rotationYaw, rotationPitch); + } + + public EntityEnergyBazookaMainProjectile(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5, int damage, int maxTicksInAir) + { + super(par1World, par2EntityLivingBase, par3EntityLivingBase, par4, par5, damage, maxTicksInAir); + } + + @Override + public DamageSource getDamageSource() + { + return DamageSource.causeMobDamage(shootingEntity); + } + + @Override + public void onImpact(MovingObjectPosition mop) + { + if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null) + { + if (mop.entityHit == shootingEntity) + { + return; + } + + this.onImpact(mop.entityHit); + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + worldObj.createExplosion(this.shootingEntity, this.posX, this.posY, this.posZ, (float) (5.0f), false); + this.spawnSecondaryProjectiles(); + } + + this.setDead(); + } + + @Override + public void onImpact(Entity mop) + { + if (mop == shootingEntity && ticksInAir > 3) + { + shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1); + this.setDead(); + } else + { + //doDamage(8 + d6(), mop); + if (mop instanceof EntityLivingBase) + { + spawnSecondaryProjectiles(); + } + + worldObj.createExplosion(this.shootingEntity, this.posX, this.posY, this.posZ, (float) (5.0f), false); + } + + spawnHitParticles("magicCrit", 8); + this.setDead(); + } + + public void spawnSecondaryProjectiles() + { + for (int i = 0; i < 20; i++) + { + EntityEnergyBazookaSecondaryProjectile secProj = new EntityEnergyBazookaSecondaryProjectile(worldObj, this.posX, this.posY, this.posZ, 15); + secProj.shootingEntity = this.shootingEntity; + float xVel = rand.nextFloat() - rand.nextFloat(); + float yVel = rand.nextFloat() - rand.nextFloat(); + float zVel = rand.nextFloat() - rand.nextFloat(); + float wantedVel = 0.5f; + secProj.motionX = xVel * wantedVel; + secProj.motionY = yVel * wantedVel; + secProj.motionZ = zVel * wantedVel; + worldObj.spawnEntityInWorld(secProj); + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaSecondaryProjectile.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaSecondaryProjectile.java new file mode 100644 index 00000000..950bfbf0 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaSecondaryProjectile.java @@ -0,0 +1,508 @@ +package WayofTime.alchemicalWizardry.common.entity.projectile; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IProjectile; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.*; +import net.minecraft.world.World; + +import java.util.Iterator; +import java.util.List; + +public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectile implements IProjectile +{ + private int xTile = -1; + private int yTile = -1; + private int zTile = -1; + private int inTile = 0; + private int inData = 0; + private boolean inGround = false; + /** + * The owner of this arrow. + */ + public EntityLivingBase shootingEntity; + private int ticksInAir = 0; + private int ricochetCounter = 0; + private boolean scheduledForDeath = false; + public int damage; + + public EntityEnergyBazookaSecondaryProjectile(World par1World) + { + super(par1World); + this.setSize(0.5F, 0.5F); + damage = 5; + } + + public EntityEnergyBazookaSecondaryProjectile(World par1World, double par2, double par4, double par6, int damage) + { + super(par1World); + this.setSize(0.5F, 0.5F); + this.setPosition(par2, par4, par6); + yOffset = 0.0F; + this.damage = damage; + } + + public EntityEnergyBazookaSecondaryProjectile(World par1World, EntityPlayer par2EntityPlayer, int damage) + { + super(par1World); + shootingEntity = par2EntityPlayer; + float par3 = 0.8F; + this.setSize(0.1F, 0.1F); + this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch); + posX -= MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + posY -= 0.2D; + posZ -= MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + this.setPosition(posX, posY, posZ); + yOffset = 0.0F; + motionX = -MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI); + motionZ = MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI); + motionY = -MathHelper.sin(rotationPitch / 180.0F * (float) Math.PI); + this.setThrowableHeading(motionX, motionY, motionZ, par3 * 1.5F, 1.0F); + this.damage = damage; + } + + @Override + protected void entityInit() + { + dataWatcher.addObject(16, Byte.valueOf((byte) 0)); + } + + /** + * Similar to setArrowHeading, it's point the throwable entity to a x, y, z + * direction. + */ + @Override + public void setThrowableHeading(double var1, double var3, double var5, float var7, float var8) + { + float var9 = MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5); + var1 /= var9; + var3 /= var9; + var5 /= var9; + var1 += rand.nextGaussian() * 0.007499999832361937D * var8; + var3 += rand.nextGaussian() * 0.007499999832361937D * var8; + var5 += rand.nextGaussian() * 0.007499999832361937D * var8; + var1 *= var7; + var3 *= var7; + var5 *= var7; + motionX = var1; + motionY = var3; + motionZ = var5; + float var10 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); + prevRotationYaw = rotationYaw = (float) (Math.atan2(var1, var5) * 180.0D / Math.PI); + prevRotationPitch = rotationPitch = (float) (Math.atan2(var3, var10) * 180.0D / Math.PI); + } + + @Override + @SideOnly(Side.CLIENT) + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) + { + this.setPosition(par1, par3, par5); + this.setRotation(par7, par8); + } + + @Override + @SideOnly(Side.CLIENT) + /** + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double par1, double par3, double par5) + { + motionX = par1; + motionY = par3; + motionZ = par5; + + if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F) + { + float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); + prevRotationYaw = rotationYaw = (float) (Math.atan2(par1, par5) * 180.0D / Math.PI); + prevRotationPitch = rotationPitch = (float) (Math.atan2(par3, var7) * 180.0D / Math.PI); + prevRotationPitch = rotationPitch; + prevRotationYaw = rotationYaw; + this.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch); + } + } + + /** + * Called to update the entity's position/logic. + */ + @Override + public void onUpdate() + { + super.onUpdate(); + + if (ticksInAir > maxTicksInAir) + { + this.setDead(); + } + + if (shootingEntity == null) + { + List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(posX - 1, posY - 1, posZ - 1, posX + 1, posY + 1, posZ + 1)); + Iterator i = players.iterator(); + double closestDistance = Double.MAX_VALUE; + EntityPlayer closestPlayer = null; + + while (i.hasNext()) + { + EntityPlayer e = (EntityPlayer) i.next(); + double distance = e.getDistanceToEntity(this); + + if (distance < closestDistance) + { + closestPlayer = e; + } + } + + if (closestPlayer != null) + { + shootingEntity = closestPlayer; + } + } + + if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F) + { + float var1 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ); + prevRotationYaw = rotationYaw = (float) (Math.atan2(motionX, motionZ) * 180.0D / Math.PI); + prevRotationPitch = rotationPitch = (float) (Math.atan2(motionY, var1) * 180.0D / Math.PI); + } + + Block var16 = worldObj.getBlock(xTile, yTile, zTile); + + if (var16 != null) + { + var16.setBlockBoundsBasedOnState(worldObj, xTile, yTile, zTile); + AxisAlignedBB var2 = var16.getCollisionBoundingBoxFromPool(worldObj, xTile, yTile, zTile); + + if (var2 != null && var2.isVecInside(worldObj.getWorldVec3Pool().getVecFromPool(posX, posY, posZ))) + { + inGround = true; + } + } + + if (inGround) + { + Block var18 = worldObj.getBlock(xTile, yTile, zTile); + int var19 = worldObj.getBlockMetadata(xTile, yTile, zTile); + + if (var18.equals(Block.getBlockById(inTile)) && var19 == inData) + { + // this.groundImpact(); + // this.setDead(); + } + } else + { + ++ticksInAir; + + if (ticksInAir > 1 && ticksInAir < 3) + { + //worldObj.spawnParticle("flame", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0D, 0D, 0D); + for (int particles = 0; particles < 3; particles++) + { + this.doFiringParticles(); + } + } + + Vec3 var17 = worldObj.getWorldVec3Pool().getVecFromPool(posX, posY, posZ); + Vec3 var3 = worldObj.getWorldVec3Pool().getVecFromPool(posX + motionX, posY + motionY, posZ + motionZ); + MovingObjectPosition var4 = worldObj.func_147447_a(var17, var3, true, false, true); + var17 = worldObj.getWorldVec3Pool().getVecFromPool(posX, posY, posZ); + var3 = worldObj.getWorldVec3Pool().getVecFromPool(posX + motionX, posY + motionY, posZ + motionZ); + + if (var4 != null) + { + var3 = worldObj.getWorldVec3Pool().getVecFromPool(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord); + } + + Entity var5 = null; + List var6 = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D)); + double var7 = 0.0D; + Iterator var9 = var6.iterator(); + float var11; + + while (var9.hasNext()) + { + Entity var10 = (Entity) var9.next(); + + if (var10.canBeCollidedWith() && (var10 != shootingEntity || ticksInAir >= 5)) + { + var11 = 0.3F; + AxisAlignedBB var12 = var10.boundingBox.expand(var11, var11, var11); + MovingObjectPosition var13 = var12.calculateIntercept(var17, var3); + + if (var13 != null) + { + double var14 = var17.distanceTo(var13.hitVec); + + if (var14 < var7 || var7 == 0.0D) + { + var5 = var10; + var7 = var14; + } + } + } + } + + if (var5 != null) + { + var4 = new MovingObjectPosition(var5); + } + + if (var4 != null) + { + this.onImpact(var4); + + if (scheduledForDeath) + { + this.setDead(); + } + } + + posX += motionX; + posY += motionY; + posZ += motionZ; + MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ); + this.setPosition(posX, posY, posZ); + //this.doBlockCollisions(); + } + } + + public void doFiringParticles() + { + worldObj.spawnParticle("mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + worldObj.spawnParticle("flame", posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + @Override + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + par1NBTTagCompound.setShort("xTile", (short) xTile); + par1NBTTagCompound.setShort("yTile", (short) yTile); + par1NBTTagCompound.setShort("zTile", (short) zTile); + par1NBTTagCompound.setByte("inTile", (byte) inTile); + par1NBTTagCompound.setByte("inData", (byte) inData); + par1NBTTagCompound.setByte("inGround", (byte) (inGround ? 1 : 0)); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + @Override + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + xTile = par1NBTTagCompound.getShort("xTile"); + yTile = par1NBTTagCompound.getShort("yTile"); + zTile = par1NBTTagCompound.getShort("zTile"); + inTile = par1NBTTagCompound.getByte("inTile") & 255; + inData = par1NBTTagCompound.getByte("inData") & 255; + inGround = par1NBTTagCompound.getByte("inGround") == 1; + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they + * walk on. used for spiders and wolves to prevent them from trampling crops + */ + @Override + protected boolean canTriggerWalking() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return 0.0F; + } + + /** + * Sets the amount of knockback the arrow applies when it hits a mob. + */ + public void setKnockbackStrength(int par1) + { + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ + @Override + public boolean canAttackWithItem() + { + return false; + } + + /** + * Whether the arrow has a stream of critical hit particles flying behind + * it. + */ + public void setIsCritical(boolean par1) + { + byte var2 = dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + dataWatcher.updateObject(16, Byte.valueOf((byte) (var2 | 1))); + } else + { + dataWatcher.updateObject(16, Byte.valueOf((byte) (var2 & -2))); + } + } + + /** + * Whether the arrow has a stream of critical hit particles flying behind + * it. + */ + public boolean getIsCritical() + { + byte var1 = dataWatcher.getWatchableObjectByte(16); + return (var1 & 1) != 0; + } + + public void onImpact(MovingObjectPosition mop) + { + if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null) + { + if (mop.entityHit == shootingEntity) + { + return; + } + + this.onImpact(mop.entityHit); + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + this.groundImpact(mop.sideHit); + worldObj.createExplosion(shootingEntity, posX, posY, posZ, 2, false); + } + } + + public void onImpact(Entity mop) + { + if (mop == shootingEntity && ticksInAir > 3) + { + shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1); + this.setDead(); + } else + { + doDamage(this.damage + d6(), mop); + worldObj.createExplosion(shootingEntity, posX, posY, posZ, 2, false); + } + + spawnHitParticles("magicCrit", 8); + this.setDead(); + } + + private int d6() + { + return rand.nextInt(6) + 1; + } + + public void spawnHitParticles(String string, int i) + { + for (int particles = 0; particles < i; particles++) + { + worldObj.spawnParticle(string, posX, posY - (string == "portal" ? 1 : 0), posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); + } + } + + public void doDamage(int i, Entity mop) + { + mop.attackEntityFrom(this.getDamageSource(), i); + } + + public DamageSource getDamageSource() + { + return DamageSource.causeMobDamage(shootingEntity); + } + + public void groundImpact(int sideHit) + { + this.ricochet(sideHit); + } + + public double smallGauss(double d) + { + return (worldObj.rand.nextFloat() - 0.5D) * d; + } + + public double gaussian(double d) + { + return d + d * ((rand.nextFloat() - 0.5D) / 4); + } + + private void ricochet(int sideHit) + { + switch (sideHit) + { + case 0: + case 1: + // topHit, bottomHit, reflect Y + motionY = motionY * -1; + break; + + case 2: + case 3: + // westHit, eastHit, reflect Z + motionZ = motionZ * -1; + break; + + case 4: + case 5: + // southHit, northHit, reflect X + motionX = motionX * -1; + break; + } + + ricochetCounter++; + + if (ricochetCounter > this.getRicochetMax()) + { + scheduledForDeath = true; + + for (int particles = 0; particles < 4; particles++) + { + switch (sideHit) + { + case 0: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), -gaussian(0.1D), gaussian(0.1D)); + break; + + case 1: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); + break; + + case 2: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), -gaussian(0.1D)); + break; + + case 3: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); + break; + + case 4: + worldObj.spawnParticle("smoke", posX, posY, posZ, -gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); + break; + + case 5: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); + break; + } + } + } + } + + private int getRicochetMax() + { + return 3; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityMeteor.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityMeteor.java new file mode 100644 index 00000000..221dc58a --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityMeteor.java @@ -0,0 +1,64 @@ +package WayofTime.alchemicalWizardry.common.entity.projectile; + +import net.minecraft.entity.Entity; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry; + +public class EntityMeteor extends EnergyBlastProjectile +{ + private int meteorID; + + public EntityMeteor(World par1World) + { + super(par1World); + this.meteorID = 0; + } + + public EntityMeteor(World par1World, double par2, double par4, double par6, int meteorID) + { + super(par1World, par2, par4, par6); + this.meteorID = meteorID; + } + + @Override + public DamageSource getDamageSource() + { + return DamageSource.fallingBlock; + } + + @Override + public void onImpact(MovingObjectPosition mop) + { + if (worldObj.isRemote) + { + return; + } + + if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null) + { + this.onImpact(mop.entityHit); + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + MeteorRegistry.createMeteorImpact(worldObj, mop.blockX, mop.blockY, mop.blockZ, this.meteorID); + } + + this.setDead(); + } + + @Override + public void onImpact(Entity mop) + { + if (mop == shootingEntity && ticksInAir > 3) + { + shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1); + this.setDead(); + } else + { + MeteorRegistry.createMeteorImpact(worldObj, (int) this.posX, (int) this.posY, (int) this.posZ, meteorID); + } + + this.setDead(); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/ExplosionProjectile.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/ExplosionProjectile.java new file mode 100644 index 00000000..569aaf0b --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/ExplosionProjectile.java @@ -0,0 +1,134 @@ +package WayofTime.alchemicalWizardry.common.entity.projectile; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class ExplosionProjectile extends EnergyBlastProjectile +{ + protected boolean causesEnvDamage; + + public ExplosionProjectile(World par1World) + { + super(par1World); + } + + public ExplosionProjectile(World par1World, double par2, double par4, double par6) + { + super(par1World, par2, par4, par6); + } + + public ExplosionProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage, boolean flag) + { + super(par1World, par2EntityPlayer, damage); + causesEnvDamage = flag; + } + + public ExplosionProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage, int maxTicksInAir, double posX, double posY, double posZ, float rotationYaw, float rotationPitch, boolean flag) + { + super(par1World, par2EntityPlayer, damage, maxTicksInAir, posX, posY, posZ, rotationYaw, rotationPitch); + causesEnvDamage = flag; + } + + @Override + public DamageSource getDamageSource() + { + return DamageSource.causeMobDamage(shootingEntity); + } + + @Override + public void onImpact(MovingObjectPosition mop) + { + if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null) + { + if (mop.entityHit == shootingEntity) + { + return; + } + + worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (2), causesEnvDamage); + //this.onImpact(mop.entityHit); + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { +// for(int i=-1;i<=1;i++) +// { +// for(int j=-1;j<=1;j++) +// { +// for(int k=-1;k<=1;k++) +// { +// if(worldObj.isAirBlock((int)this.posX+i, (int)this.posY+j, (int)this.posZ+k)) +// { +// worldObj.setBlock( (int)this.posX+i, (int)this.posY+j, (int)this.posZ+k,Block.fire.blockID); +// } +// } +// } +// } + worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (2), causesEnvDamage); + } + + this.setDead(); + } + + @Override + public void onImpact(Entity mop) + { + if (mop == shootingEntity && ticksInAir > 3) + { + shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1); + this.setDead(); + } else + { + //doDamage(8 + d6(), mop); + if (mop instanceof EntityLivingBase) + { + //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); + //((EntityLivingBase)mop).setFire(50); + //((EntityLivingBase)mop).setRevengeTarget(shootingEntity); + if (((EntityLivingBase) mop).isImmuneToFire()) + { + doDamage((int) (projectileDamage), mop); + } else + { + doDamage(projectileDamage, mop); + } + } + + //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); + } + + if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ)) + { + //worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ,Block.fire.blockID); + } + + spawnHitParticles("magicCrit", 8); + this.setDead(); + } + + @Override + public void doFiringParticles() + { + worldObj.spawnParticle("mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + worldObj.spawnParticle("explode", posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); + } + + @Override + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("causesEnvDamage", causesEnvDamage); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + @Override + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + causesEnvDamage = par1NBTTagCompound.getBoolean("causesEnvDamage"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/FireProjectile.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/FireProjectile.java new file mode 100644 index 00000000..7ab8f052 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/FireProjectile.java @@ -0,0 +1,115 @@ +package WayofTime.alchemicalWizardry.common.entity.projectile; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.potion.Potion; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class FireProjectile extends EnergyBlastProjectile +{ + public FireProjectile(World par1World) + { + super(par1World); + } + + public FireProjectile(World par1World, double par2, double par4, double par6) + { + super(par1World, par2, par4, par6); + } + + public FireProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage) + { + super(par1World, par2EntityPlayer, damage); + } + + public FireProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage, int maxTicksInAir, double posX, double posY, double posZ, float rotationYaw, float rotationPitch) + { + super(par1World, par2EntityPlayer, damage, maxTicksInAir, posX, posY, posZ, rotationYaw, rotationPitch); + } + + public FireProjectile(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5, int damage, int maxTicksInAir) + { + super(par1World, par2EntityLivingBase, par3EntityLivingBase, par4, par5, damage, maxTicksInAir); + } + + @Override + public DamageSource getDamageSource() + { + return DamageSource.causeMobDamage(shootingEntity); + } + + @Override + public void onImpact(MovingObjectPosition mop) + { + if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null) + { + if (mop.entityHit == shootingEntity) + { + return; + } + + this.onImpact(mop.entityHit); + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + for (int i = -1; i <= 1; i++) + { + for (int j = -1; j <= 1; j++) + { + for (int k = -1; k <= 1; k++) + { + if (worldObj.isAirBlock((int) this.posX + i, (int) this.posY + j, (int) this.posZ + k)) + { + worldObj.setBlock((int) this.posX + i, (int) this.posY + j, (int) this.posZ + k, Blocks.fire); + } + } + } + } + + //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); + } + + this.setDead(); + } + + @Override + public void onImpact(Entity mop) + { + if (mop == shootingEntity && ticksInAir > 3) + { + shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1); + this.setDead(); + } else + { + //doDamage(8 + d6(), mop); + if (mop instanceof EntityLivingBase) + { + //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); + ((EntityLivingBase) mop).setFire(50); + ((EntityLivingBase) mop).setRevengeTarget(shootingEntity); + + if (((EntityLivingBase) mop).isPotionActive(Potion.fireResistance) || ((EntityLivingBase) mop).isImmuneToFire()) + { + ((EntityLivingBase) mop).attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1); + } else + { + doDamage(projectileDamage, mop); + ((EntityLivingBase) mop).hurtResistantTime = 0; + } + } + + //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); + } + + if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ)) + { + worldObj.setBlock((int) this.posX, (int) this.posY, (int) this.posZ, Blocks.fire); + } + + spawnHitParticles("magicCrit", 8); + this.setDead(); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/HolyProjectile.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/HolyProjectile.java new file mode 100644 index 00000000..062ccbf7 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/HolyProjectile.java @@ -0,0 +1,117 @@ +package WayofTime.alchemicalWizardry.common.entity.projectile; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class HolyProjectile extends EnergyBlastProjectile +{ + public HolyProjectile(World par1World) + { + super(par1World); + } + + public HolyProjectile(World par1World, double par2, double par4, double par6) + { + super(par1World, par2, par4, par6); + } + + public HolyProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage) + { + super(par1World, par2EntityPlayer, damage); + } + + public HolyProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage, int maxTicksInAir, double posX, double posY, double posZ, float rotationYaw, float rotationPitch) + { + super(par1World, par2EntityPlayer, damage, maxTicksInAir, posX, posY, posZ, rotationYaw, rotationPitch); + } + + public HolyProjectile(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5, int damage, int maxTicksInAir) + { + super(par1World, par2EntityLivingBase, par3EntityLivingBase, par4, par5, damage, maxTicksInAir); + } + + @Override + public DamageSource getDamageSource() + { + return DamageSource.causeMobDamage(shootingEntity); + } + + @Override + public void onImpact(MovingObjectPosition mop) + { + if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null) + { + if (mop.entityHit == shootingEntity) + { + return; + } + + this.onImpact(mop.entityHit); + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { +// for(int i=-1;i<=1;i++) +// { +// for(int j=-1;j<=1;j++) +// { +// for(int k=-1;k<=1;k++) +// { +// if(worldObj.isAirBlock((int)this.posX+i, (int)this.posY+j, (int)this.posZ+k)) +// { +// worldObj.setBlock( (int)this.posX+i, (int)this.posY+j, (int)this.posZ+k,Block.fire.blockID); +// } +// } +// } +// } + } + + this.setDead(); + } + + @Override + public void onImpact(Entity mop) + { + if (mop == shootingEntity && ticksInAir > 3) + { + shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1); + this.setDead(); + } else + { + //doDamage(8 + d6(), mop); + if (mop instanceof EntityLivingBase) + { + //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); + //((EntityLivingBase)mop).setFire(50); + //((EntityLivingBase)mop).setRevengeTarget(shootingEntity); + if (((EntityLivingBase) mop).isEntityUndead()) + { + doDamage((int) (projectileDamage * 2), mop); + } else + { + doDamage(projectileDamage, mop); + } + } + + //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); + } + + if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ)) + { + //worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ,Block.fire.blockID); + } + + spawnHitParticles("magicCrit", 8); + this.setDead(); + } + + @Override + public void doFiringParticles() + { + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpell", posX, posY, posZ, 1.0F, 1.0F, 1.0F); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/IceProjectile.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/IceProjectile.java new file mode 100644 index 00000000..06867d81 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/IceProjectile.java @@ -0,0 +1,123 @@ +package WayofTime.alchemicalWizardry.common.entity.projectile; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityIceDemon; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class IceProjectile extends EnergyBlastProjectile +{ + public IceProjectile(World par1World) + { + super(par1World); + } + + public IceProjectile(World par1World, double par2, double par4, double par6) + { + super(par1World, par2, par4, par6); + } + + public IceProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage) + { + super(par1World, par2EntityPlayer, damage); + } + + public IceProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage, int maxTicksInAir, double posX, double posY, double posZ, float rotationYaw, float rotationPitch) + { + super(par1World, par2EntityPlayer, damage, maxTicksInAir, posX, posY, posZ, rotationYaw, rotationPitch); + } + + public IceProjectile(World worldObj, EntityIceDemon entityIceDemon, EntityLivingBase par1EntityLivingBase, float f, float g, int i, int j) + { + super(worldObj, entityIceDemon, par1EntityLivingBase, f, g, i, j); + } + + @Override + public DamageSource getDamageSource() + { + return DamageSource.causeMobDamage(shootingEntity); + } + + @Override + public void onImpact(MovingObjectPosition mop) + { + if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null) + { + if (mop.entityHit == shootingEntity) + { + return; + } + + this.onImpact(mop.entityHit); + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { +// for(int i=-1;i<=1;i++) +// { +// for(int j=-1;j<=1;j++) +// { +// for(int k=-1;k<=1;k++) +// { +// if(worldObj.isAirBlock((int)this.posX+i, (int)this.posY+j, (int)this.posZ+k)) +// { +// worldObj.setBlock( (int)this.posX+i, (int)this.posY+j, (int)this.posZ+k,Block.fire.blockID); +// } +// } +// } +// } + //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); + } + + this.setDead(); + } + + @Override + public void onImpact(Entity mop) + { + if (mop == shootingEntity && ticksInAir > 3) + { + shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1); + this.setDead(); + } else + { + //doDamage(8 + d6(), mop); + if (mop instanceof EntityLivingBase) + { + //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); + //((EntityLivingBase)mop).setFire(50); + //((EntityLivingBase)mop).setRevengeTarget(shootingEntity); + if (((EntityLivingBase) mop).isImmuneToFire()) + { + doDamage((int) (projectileDamage * 2), mop); + ((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 200, 2)); + } else + { + doDamage(projectileDamage, mop); + ((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 1)); + } + } + + //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); + } + + if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ)) + { + //worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ,Block.fire.blockID); + } + + spawnHitParticles("magicCrit", 8); + this.setDead(); + } + + @Override + public void doFiringParticles() + { + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "explode", posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/LightningBoltProjectile.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/LightningBoltProjectile.java new file mode 100644 index 00000000..106cf420 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/LightningBoltProjectile.java @@ -0,0 +1,126 @@ +package WayofTime.alchemicalWizardry.common.entity.projectile; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class LightningBoltProjectile extends EnergyBlastProjectile +{ + private boolean causeLightning; + + public LightningBoltProjectile(World par1World) + { + super(par1World); + } + + public LightningBoltProjectile(World par1World, double par2, double par4, double par6) + { + super(par1World, par2, par4, par6); + } + + public LightningBoltProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage, boolean flag) + { + super(par1World, par2EntityPlayer, damage); + causeLightning = flag; + } + + public LightningBoltProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage, int maxTicksInAir, double posX, double posY, double posZ, float rotationYaw, float rotationPitch, boolean flag) + { + super(par1World, par2EntityPlayer, damage, maxTicksInAir, posX, posY, posZ, rotationYaw, rotationPitch); + causeLightning = flag; + } + + @Override + public DamageSource getDamageSource() + { + return DamageSource.causeMobDamage(shootingEntity); + } + + @Override + public void onImpact(MovingObjectPosition mop) + { + if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null) + { + if (mop.entityHit == shootingEntity) + { + return; + } + + this.onImpact(mop.entityHit); + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + if (causeLightning) + { + this.worldObj.addWeatherEffect(new EntityLightningBolt(this.worldObj, this.posX, this.posY, this.posZ)); + } + } + + this.setDead(); + } + + @Override + public void onImpact(Entity mop) + { + if (mop == shootingEntity && ticksInAir > 3) + { + //shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1); + this.setDead(); + } else + { + //doDamage(8 + d6(), mop); + if (mop instanceof EntityLivingBase) + { + //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); + //((EntityLivingBase)mop).setFire(50); + //((EntityLivingBase)mop).setRevengeTarget(shootingEntity); +// if(((EntityLivingBase)mop).isEntityUndead()) +// { +// doDamage((int)(projectileDamage*2),mop); +// }else +// { +// doDamage(projectileDamage, mop); +// } + if (causeLightning) + { + this.worldObj.addWeatherEffect(new EntityLightningBolt(this.worldObj, ((EntityLivingBase) mop).posX, ((EntityLivingBase) mop).posY, ((EntityLivingBase) mop).posZ)); + } else + { + doDamage(projectileDamage, mop); + } + + //((EntityLivingBase)mop).setVelocity(this.motionX*2, ((EntityLivingBase)mop).motionY+1.5, this.motionZ*2); + } + + //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); + } + + spawnHitParticles("magicCrit", 8); + this.setDead(); + } + + @Override + public void doFiringParticles() + { + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpell", posX, posY, posZ, 1.0F, 1.0F, 1.0F); + } + + @Override + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("causeLightning", causeLightning); + } + + @Override + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + causeLightning = par1NBTTagCompound.getBoolean("causeLightning"); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/MudProjectile.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/MudProjectile.java new file mode 100644 index 00000000..2c944959 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/MudProjectile.java @@ -0,0 +1,131 @@ +package WayofTime.alchemicalWizardry.common.entity.projectile; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class MudProjectile extends EnergyBlastProjectile +{ + private boolean doesBlindness; //True for when it applies blindness, false for slowness + + public MudProjectile(World par1World) + { + super(par1World); + } + + public MudProjectile(World par1World, double par2, double par4, double par6) + { + super(par1World, par2, par4, par6); + } + + public MudProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage, boolean flag) + { + super(par1World, par2EntityPlayer, damage); + doesBlindness = flag; + } + + public MudProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage, int maxTicksInAir, double posX, double posY, double posZ, float rotationYaw, float rotationPitch, boolean flag) + { + super(par1World, par2EntityPlayer, damage, maxTicksInAir, posX, posY, posZ, rotationYaw, rotationPitch); + doesBlindness = flag; + } + + public MudProjectile(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5, int damage, int maxTicksInAir, boolean flag) + { + super(par1World, par2EntityLivingBase, par3EntityLivingBase, par4, par5, damage, maxTicksInAir); + doesBlindness = flag; + } + + @Override + public DamageSource getDamageSource() + { + return DamageSource.causeMobDamage(shootingEntity); + } + + @Override + public void onImpact(MovingObjectPosition mop) + { + if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null) + { + if (mop.entityHit == shootingEntity) + { + return; + } + + this.onImpact(mop.entityHit); + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + } + + this.setDead(); + } + + @Override + public void onImpact(Entity mop) + { + if (mop == shootingEntity && ticksInAir > 3) + { + //shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1); + this.setDead(); + } else + { + //doDamage(8 + d6(), mop); + if (mop instanceof EntityLivingBase) + { + //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); + //((EntityLivingBase)mop).setFire(50); + //((EntityLivingBase)mop).setRevengeTarget(shootingEntity); +// if(((EntityLivingBase)mop).isEntityUndead()) +// { +// doDamage((int)(projectileDamage*2),mop); +// }else +// { +// doDamage(projectileDamage, mop); +// } + if (doesBlindness) + { + ((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 0)); + } else + { + ((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2)); + } + + doDamage(projectileDamage, mop); + //((EntityLivingBase)mop).setVelocity(this.motionX*2, ((EntityLivingBase)mop).motionY+1.5, this.motionZ*2); + } + + //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); + } + + spawnHitParticles("magicCrit", 8); + this.setDead(); + } + + @Override + public void doFiringParticles() + { + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpell", posX, posY, posZ, 0.5F, 0.297F, 0.0664F); + } + + @Override + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("doesBlindness", doesBlindness); + } + + @Override + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + doesBlindness = par1NBTTagCompound.getBoolean("doesBlindness"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/TeleportProjectile.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/TeleportProjectile.java new file mode 100644 index 00000000..c448fadf --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/TeleportProjectile.java @@ -0,0 +1,205 @@ +package WayofTime.alchemicalWizardry.common.entity.projectile; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.living.EnderTeleportEvent; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.spell.simple.SpellTeleport; + +public class TeleportProjectile extends EnergyBlastProjectile +{ + private boolean isEntityTeleport; //True if the entity firing teleports on hit + + public TeleportProjectile(World par1World) + { + super(par1World); + this.motionX *= 3; + this.motionY *= 3; + this.motionZ *= 3; + } + + public TeleportProjectile(World par1World, double par2, double par4, double par6) + { + super(par1World, par2, par4, par6); + this.motionX *= 3; + this.motionY *= 3; + this.motionZ *= 3; + } + + public TeleportProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage, boolean flag) + { + super(par1World, par2EntityPlayer, damage); + isEntityTeleport = flag; + this.motionX *= 3; + this.motionY *= 3; + this.motionZ *= 3; + } + + public TeleportProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage, int maxTicksInAir, double posX, double posY, double posZ, float rotationYaw, float rotationPitch, boolean flag) + { + super(par1World, par2EntityPlayer, damage, maxTicksInAir, posX, posY, posZ, rotationYaw, rotationPitch); + isEntityTeleport = flag; + this.motionX *= 3; + this.motionY *= 3; + this.motionZ *= 3; + } + + @Override + public DamageSource getDamageSource() + { + return DamageSource.causeMobDamage(shootingEntity); + } + + @Override + public void onImpact(MovingObjectPosition mop) + { + if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null) + { + if (mop.entityHit == shootingEntity) + { + return; + } + + this.onImpact(mop.entityHit); + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + if (isEntityTeleport) + { + if (shootingEntity != null && shootingEntity instanceof EntityPlayerMP) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP) shootingEntity; + + if(entityplayermp.worldObj == this.worldObj) + //if (!entityplayermp.playerNetServerHandler.connectionClosed && entityplayermp.worldObj == this.worldObj) + { + EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, this.posX, this.posY, this.posZ, 5.0F); + + if (!MinecraftForge.EVENT_BUS.post(event)) + { + if (shootingEntity.isRiding()) + { + shootingEntity.mountEntity((Entity) null); + } + + shootingEntity.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ); +// this.getThrower().fallDistance = 0.0F; +// this.getThrower().attackEntityFrom(DamageSource.fall, event.attackDamage); + } + } + } + } + } + + this.setDead(); + } + + @Override + public void onImpact(Entity mop) + { + if (mop == shootingEntity && ticksInAir > 3) + { + //shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1); + this.setDead(); + } else + { + //doDamage(8 + d6(), mop); + if (mop instanceof EntityLivingBase) + { + //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); + //((EntityLivingBase)mop).setFire(50); + //((EntityLivingBase)mop).setRevengeTarget(shootingEntity); +// if(((EntityLivingBase)mop).isEntityUndead()) +// { +// doDamage((int)(projectileDamage*2),mop); +// }else +// { +// doDamage(projectileDamage, mop); +// } + if (isEntityTeleport) + { + if (shootingEntity != null && shootingEntity instanceof EntityPlayerMP) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP) shootingEntity; + + if(entityplayermp.worldObj == this.worldObj) + //if (!entityplayermp.playerNetServerHandler.connectionClosed && entityplayermp.worldObj == this.worldObj) + { + EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, this.posX, this.posY, this.posZ, 5.0F); + + if (!MinecraftForge.EVENT_BUS.post(event)) + { + if (shootingEntity.isRiding()) + { + shootingEntity.mountEntity((Entity) null); + } + + shootingEntity.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ); +// this.getThrower().fallDistance = 0.0F; +// this.getThrower().attackEntityFrom(DamageSource.fall, event.attackDamage); + } + } + } + } else + { +// int x = (int)this.posX + mop.worldObj.rand.nextInt(100) - mop.worldObj.rand.nextInt(100); +// int y = (int)this.posY + mop.worldObj.rand.nextInt(10) - mop.worldObj.rand.nextInt(10); +// int z = (int)this.posZ + mop.worldObj.rand.nextInt(100) - mop.worldObj.rand.nextInt(100); +// +// boolean bool = false; +// int i = 0; +// +// while(!bool&&i<100) +// { +// if(worldObj.isAirBlock(x, y, z)||worldObj.isAirBlock(x, y+1, z)) +// { +// ((EntityLivingBase) mop).setPositionAndUpdate(x, y, z); +// bool=true; +// }else +// { +// x = (int)this.posX + mop.worldObj.rand.nextInt(100) - mop.worldObj.rand.nextInt(100); +// y = (int)this.posY + mop.worldObj.rand.nextInt(10) - mop.worldObj.rand.nextInt(10); +// z = (int)this.posZ + mop.worldObj.rand.nextInt(100) - mop.worldObj.rand.nextInt(100); +// i++; +// } +// } + SpellTeleport.teleportRandomly((EntityLivingBase) mop, 64); + } + + //doDamage(projectileDamage, mop); + //((EntityLivingBase)mop).setVelocity(this.motionX*2, ((EntityLivingBase)mop).motionY+1.5, this.motionZ*2); + } + + //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); + } + + spawnHitParticles("magicCrit", 8); + this.setDead(); + } + + @Override + public void doFiringParticles() + { + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "portal", posX, posY, posZ, -motionX, -motionY, -motionZ); + } + + @Override + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("isEntityTeleport", isEntityTeleport); + } + + @Override + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + isEntityTeleport = par1NBTTagCompound.getBoolean("isEntityTeleport"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/WaterProjectile.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/WaterProjectile.java new file mode 100644 index 00000000..8fa7704c --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/WaterProjectile.java @@ -0,0 +1,107 @@ +package WayofTime.alchemicalWizardry.common.entity.projectile; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class WaterProjectile extends EnergyBlastProjectile +{ + public WaterProjectile(World par1World) + { + super(par1World); + } + + public WaterProjectile(World par1World, double par2, double par4, double par6) + { + super(par1World, par2, par4, par6); + } + + public WaterProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage) + { + super(par1World, par2EntityPlayer, damage); + } + + public WaterProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage, int maxTicksInAir, double posX, double posY, double posZ, float rotationYaw, float rotationPitch) + { + super(par1World, par2EntityPlayer, damage, maxTicksInAir, posX, posY, posZ, rotationYaw, rotationPitch); + } + + @Override + public DamageSource getDamageSource() + { + return DamageSource.causeMobDamage(shootingEntity); + } + + @Override + public void onImpact(MovingObjectPosition mop) + { + if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null) + { + if (mop.entityHit == shootingEntity) + { + return; + } + + this.onImpact(mop.entityHit); + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + } + + this.setDead(); + } + + @Override + public void onImpact(Entity mop) + { + if (mop == shootingEntity && ticksInAir > 3) + { + //shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1); + this.setDead(); + } else + { + //doDamage(8 + d6(), mop); + if (mop instanceof EntityLivingBase) + { + //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); + //((EntityLivingBase)mop).setFire(50); + //((EntityLivingBase)mop).setRevengeTarget(shootingEntity); +// if(((EntityLivingBase)mop).isEntityUndead()) +// { +// doDamage((int)(projectileDamage*2),mop); +// }else +// { +// doDamage(projectileDamage, mop); +// } + if (((EntityLivingBase) mop).isImmuneToFire()) + { + doDamage(projectileDamage * 2, mop); + ((EntityLivingBase) mop).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 80, 1)); + } else + { + doDamage(projectileDamage, mop); + ((EntityLivingBase) mop).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 80, 0)); + } + + //((EntityLivingBase)mop).setVelocity(this.motionX*2, ((EntityLivingBase)mop).motionY+1.5, this.motionZ*2); + } + + //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); + } + + spawnHitParticles("magicCrit", 8); + this.setDead(); + } + + @Override + public void doFiringParticles() + { + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "portal", posX, posY, posZ, -motionX, -motionY, -motionZ); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/WindGustProjectile.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/WindGustProjectile.java new file mode 100644 index 00000000..46fa01d7 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/entity/projectile/WindGustProjectile.java @@ -0,0 +1,110 @@ +package WayofTime.alchemicalWizardry.common.entity.projectile; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class WindGustProjectile extends EnergyBlastProjectile +{ + public WindGustProjectile(World par1World) + { + super(par1World); + } + + public WindGustProjectile(World par1World, double par2, double par4, double par6) + { + super(par1World, par2, par4, par6); + } + + public WindGustProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage) + { + super(par1World, par2EntityPlayer, damage); + } + + public WindGustProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage, int maxTicksInAir, double posX, double posY, double posZ, float rotationYaw, float rotationPitch) + { + super(par1World, par2EntityPlayer, damage, maxTicksInAir, posX, posY, posZ, rotationYaw, rotationPitch); + } + + @Override + public DamageSource getDamageSource() + { + return DamageSource.causeMobDamage(shootingEntity); + } + + @Override + public void onImpact(MovingObjectPosition mop) + { + if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null) + { + if (mop.entityHit == shootingEntity) + { + return; + } + + this.onImpact(mop.entityHit); + } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { +// for(int i=-1;i<=1;i++) +// { +// for(int j=-1;j<=1;j++) +// { +// for(int k=-1;k<=1;k++) +// { +// if(worldObj.isAirBlock((int)this.posX+i, (int)this.posY+j, (int)this.posZ+k)) +// { +// worldObj.setBlock( (int)this.posX+i, (int)this.posY+j, (int)this.posZ+k,Block.fire.blockID); +// } +// } +// } +// } + } + + this.setDead(); + } + + @Override + public void onImpact(Entity mop) + { + if (mop == shootingEntity && ticksInAir > 3) + { + //shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1); + this.setDead(); + } else + { + //doDamage(8 + d6(), mop); + if (mop instanceof EntityLivingBase) + { + //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); + //((EntityLivingBase)mop).setFire(50); + //((EntityLivingBase)mop).setRevengeTarget(shootingEntity); +// if(((EntityLivingBase)mop).isEntityUndead()) +// { +// doDamage((int)(projectileDamage*2),mop); +// }else +// { +// doDamage(projectileDamage, mop); +// } + ((EntityLivingBase) mop).motionX = this.motionX * 2; + ((EntityLivingBase) mop).motionY = 1.5; + ((EntityLivingBase) mop).motionZ = this.motionZ * 2; + //((EntityLivingBase)mop).setVelocity(this.motionX*2, ((EntityLivingBase)mop).motionY+1.5, this.motionZ*2); + } + + //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); + } + + spawnHitParticles("magicCrit", 8); + this.setDead(); + } + + @Override + public void doFiringParticles() + { + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + SpellHelper.sendParticleToAllAround(worldObj, posX, posY, posZ, 30, worldObj.provider.dimensionId, "mobSpell", posX, posY, posZ, 1.0F, 1.0F, 1.0F); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/AWBaseItems.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/AWBaseItems.java new file mode 100644 index 00000000..dd3e4a69 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/AWBaseItems.java @@ -0,0 +1,44 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; + +public class AWBaseItems extends Item +{ + public AWBaseItems() + { + super(); + setMaxStackSize(64); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + public void registerIcons(IIconRegister iconRegister) + { + if (this.equals(ModItems.blankSlate)) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BlankSlate"); + } else if (this.equals(ModItems.reinforcedSlate)) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ReinforcedSlate"); + } else if (this.equals(ModItems.imbuedSlate)) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:InfusedSlate"); + } else if (this.equals(ModItems.demonicSlate)) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonSlate"); + } + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Infused stone inside of"); + par3List.add("a blood altar"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ActivationCrystal.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ActivationCrystal.java new file mode 100644 index 00000000..1ee98d4e --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ActivationCrystal.java @@ -0,0 +1,135 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import javax.swing.Icon; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +import org.lwjgl.input.Keyboard; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.alchemy.AlchemyRecipeRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ActivationCrystal extends EnergyItems +{ + private static final String[] ACTIVATION_CRYSTAL_NAMES = new String[]{"Weak", "Awakened"}; + + @SideOnly(Side.CLIENT) + private IIcon[] icons; + + public ActivationCrystal() + { + super(); + this.maxStackSize = 1; + setEnergyUsed(100); + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.hasSubtypes = true; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + icons = new IIcon[ACTIVATION_CRYSTAL_NAMES.length]; + + for (int i = 0; i < ACTIVATION_CRYSTAL_NAMES.length; ++i) + { + icons[i] = iconRegister.registerIcon("AlchemicalWizardry:" + "activationCrystal" + ACTIVATION_CRYSTAL_NAMES[i]); + } + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + switch (par1ItemStack.getItemDamage()) + { + case 0: + { + par3List.add("Activates low-level rituals"); + break; + } + + case 1: + { + par3List.add("Activates more powerful rituals"); + + if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) + { + ItemStack[] recipe = AlchemyRecipeRegistry.getRecipeForItemStack(par1ItemStack); + + if (recipe != null) + { + par3List.add(EnumChatFormatting.BLUE + "Recipe:"); + + for (ItemStack item : recipe) + { + if (item != null) + { + par3List.add("" + item.getDisplayName()); + } + } + } + } else + { + par3List.add("-Press " + EnumChatFormatting.BLUE + "shift" + EnumChatFormatting.GRAY + " for Recipe-"); + } + + break; + } + } + + if (!(par1ItemStack.stackTagCompound == null)) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + return par1ItemStack; + } + + public int getCrystalLevel(ItemStack itemStack) + { + return itemStack.getItemDamage() + 1; + } + + @Override + public String getUnlocalizedName(ItemStack itemStack) + { + //This is what will do all the localisation things on the alchemy components so you dont have to set it :D + int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, ACTIVATION_CRYSTAL_NAMES.length - 1); + return ("" + "item.activationCrystal" + ACTIVATION_CRYSTAL_NAMES[meta]); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int meta) + { + int j = MathHelper.clamp_int(meta, 0, ACTIVATION_CRYSTAL_NAMES.length - 1); + return icons[j]; + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item id, CreativeTabs creativeTab, List list) + { + for (int meta = 0; meta < ACTIVATION_CRYSTAL_NAMES.length; ++meta) + { + list.add(new ItemStack(id, 1, meta)); + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/AirScribeTool.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/AirScribeTool.java new file mode 100644 index 00000000..9f20b743 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/AirScribeTool.java @@ -0,0 +1,20 @@ +package WayofTime.alchemicalWizardry.common.items; + +import net.minecraft.client.renderer.texture.IIconRegister; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class AirScribeTool extends ScribeTool +{ + public AirScribeTool() + { + super(4); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AirScribeTool"); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ApprenticeBloodOrb.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ApprenticeBloodOrb.java new file mode 100644 index 00000000..3bc4a2eb --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ApprenticeBloodOrb.java @@ -0,0 +1,21 @@ +package WayofTime.alchemicalWizardry.common.items; + +import net.minecraft.client.renderer.texture.IIconRegister; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ApprenticeBloodOrb extends EnergyBattery +{ + public ApprenticeBloodOrb(int damage) + { + super(damage); + orbLevel = 2; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ApprenticeBloodOrb"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ArchmageBloodOrb.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ArchmageBloodOrb.java new file mode 100644 index 00000000..6bd83098 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ArchmageBloodOrb.java @@ -0,0 +1,21 @@ +package WayofTime.alchemicalWizardry.common.items; + +import net.minecraft.client.renderer.texture.IIconRegister; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ArchmageBloodOrb extends EnergyBattery +{ + public ArchmageBloodOrb(int damage) + { + super(damage); + orbLevel = 5; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ArchmageBloodOrb"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ArmourInhibitor.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ArmourInhibitor.java new file mode 100644 index 00000000..1b42a0de --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ArmourInhibitor.java @@ -0,0 +1,215 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import javax.swing.Icon; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ArmourInhibitor extends EnergyItems +{ + private static IIcon activeIcon; + private static IIcon passiveIcon; + private int tickDelay = 200; + + public ArmourInhibitor() + { + super(); + this.maxStackSize = 1; + //setMaxDamage(1000); + setEnergyUsed(0); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Used to suppress a soul's"); + par3List.add("unnatural abilities."); + + if (!(par1ItemStack.stackTagCompound == null)) + { + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + par3List.add("Activated"); + } else + { + par3List.add("Deactivated"); + } + + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ArmourInhibitor_deactivated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:ArmourInhibitor_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:ArmourInhibitor_deactivated"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.stackTagCompound == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.stackTagCompound; + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + +// @Override +// public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) +// { +// +// if(applyBonemeal(par1ItemStack,par3World,par4,par5,par6,par2EntityPlayer)) +// { +// if (par3World.isRemote) +// { +// par3World.playAuxSFX(2005, par4, par5, par6, 0); +// EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed()); +// return true; +// } +// return true; +// } +// return false; +// } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = par1ItemStack.stackTagCompound; + tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); + + if (tag.getBoolean("isActive")) + { + par1ItemStack.setItemDamage(1); + tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay); + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + //EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()); + } + } else + { + par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage()); + } + + return par1ItemStack; + } + + @Override + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) + { + if (!(par3Entity instanceof EntityPlayer)) + { + return; + } + + EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + if (par2World.getWorldTime() % tickDelay == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer) + { + //EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer)par3Entity, getEnergyUsed()); + } + + //TODO Do stuff + par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 2, 0)); + } + + return; + } + +// @Override +// public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) { +// +// int range = 5; +// int verticalRange = 2; +// int posX = (int)Math.round(player.posX-0.5f); +// int posY = (int)player.posY; +// int posZ = (int)Math.round(player.posZ-0.5f); +// +// for(int ix=posX-range;ix<=posX+range;ix++) +// { +// for(int iz=posZ-range;iz<=posZ+range;iz++) +// { +// for(int iy=posY-verticalRange;iy<=posY+verticalRange;iy++) +// { +// int id = world.getBlockId(ix, iy, iz); +// Block block = Block.blocksList[id]; +// if(block instanceof IPlantable) +// { +// if(world.rand.nextInt(10)==0) +// block.updateTick(world, ix, iy, iz, world.rand); +// } +// } +// } +// } +// +// } + +// @Override +// public boolean isUpgrade() { +// // TODO Auto-generated method stub +// return true; +// } +// +// @Override +// public int getEnergyForTenSeconds() { +// // TODO Auto-generated method stub +// return 50; +// } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BlankSpell.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BlankSpell.java new file mode 100644 index 00000000..58c004d3 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BlankSpell.java @@ -0,0 +1,114 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlankSpell extends EnergyItems +{ + public BlankSpell() + { + super(); + this.setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BlankSpell"); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Crystal of infinite possibilities."); + + if (!(par1ItemStack.stackTagCompound == null)) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + + par3List.add("Coords: " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord")); + par3List.add("Bound Dimension: " + getDimensionID(par1ItemStack)); + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par2World.isRemote) + { + //World world = MinecraftServer.getServer().worldServers[getDimensionID(par1ItemStack)]; + World world = DimensionManager.getWorld(getDimensionID(par1ItemStack)); + + if (world != null) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + TileEntity tileEntity = world.getTileEntity(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord")); + + if (tileEntity instanceof TEHomHeart) + { + TEHomHeart homHeart = (TEHomHeart) tileEntity; + + if (homHeart.canCastSpell(par1ItemStack, par2World, par3EntityPlayer)) + { + EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, homHeart.castSpell(par1ItemStack, par2World, par3EntityPlayer)); + } else + { + return par1ItemStack; + } + } else + { + return par1ItemStack; + } + } else + { + return par1ItemStack; + } + } else + { + return par1ItemStack; + } + + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); +// if (!par2World.isRemote) +// { +// //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); +// par2World.spawnEntityInWorld(new FireProjectile(par2World, par3EntityPlayer, 10)); +// } + return par1ItemStack; + } + + public int getDimensionID(ItemStack itemStack) + { + if (itemStack.stackTagCompound == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + return itemStack.stackTagCompound.getInteger("dimensionId"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BloodShard.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BloodShard.java new file mode 100644 index 00000000..2c40e314 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BloodShard.java @@ -0,0 +1,73 @@ +package WayofTime.alchemicalWizardry.common.items; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.ArmourUpgrade; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BloodShard extends Item implements ArmourUpgrade +{ + public BloodShard() + { + super(); + this.maxStackSize = 64; + //setEnergyUsed(100); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + if (this.equals(ModItems.weakBloodShard)) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WeakBloodShard"); + return; + } + + if (this.equals(ModItems.demonBloodShard)) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonBloodShard"); + return; + } + } + + public int getBloodShardLevel() + { + if (this.equals(ModItems.weakBloodShard)) + { + return 1; + } else if (this.equals(ModItems.demonBloodShard)) + { + return 2; + } + + return 0; + } + + @Override + public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) + { + // TODO Auto-generated method stub + } + + @Override + public boolean isUpgrade() + { + // TODO Auto-generated method stub + return false; + } + + @Override + public int getEnergyForTenSeconds() + { + // TODO Auto-generated method stub + return 0; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BloodboundSword.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BloodboundSword.java new file mode 100644 index 00000000..07b4ac20 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BloodboundSword.java @@ -0,0 +1,103 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BloodboundSword extends EnergyItems +{ + private float weaponDamage; + //private int maxMode = 3; + private NBTTagCompound data; + + public BloodboundSword(int id) + { + super(); + this.maxStackSize = 1; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setEnergyUsed(100); + setFull3D(); + weaponDamage = 10.0F; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergySword"); + } + + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) + { + if (par3EntityLivingBase instanceof EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, (EntityPlayer) par3EntityLivingBase); + + if (!this.syphonBatteries(par1ItemStack, (EntityPlayer) par3EntityLivingBase, this.getEnergyUsed())) + { + //this.damagePlayer(null, (EntityPlayer)par3EntityLivingBase, (this.getEnergyUsed() + 99) / 100); + } + } + + return true; + } + + /* + public int getDamageVsEntity(Entity par1Entity) + { + return this.weaponDamage; + } + */ + + public float func_82803_g() + { + return 4.0F; + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Caution: may cause"); + par3List.add("a bad day..."); + + if (!(par1ItemStack.stackTagCompound == null)) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + @Override + public float getDigSpeed(ItemStack par1ItemStack, Block par2Block, int meta) + { + if (par2Block.equals(Blocks.web)) + { + return 15.0F; + } else + { + Material material = par2Block.getMaterial(); + return material != Material.plants && material != Material.vine && material != Material.coral && material != Material.leaves && material != Material.gourd ? 1.0F : 1.5F; + } + } + + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return false; + } + +// public Multimap func_111205_h() +// { +// Multimap multimap = super.func_111205_h(); +// multimap.put(SharedMonsterAttributes.field_111264_e.func_111108_a(), new AttributeModifier(field_111210_e, "Weapon modifier", (double)this.weaponDamage, 0)); +// return multimap; +// } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BoundArmour.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BoundArmour.java new file mode 100644 index 00000000..d69a25a4 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BoundArmour.java @@ -0,0 +1,588 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.potion.Potion; +import net.minecraft.util.DamageSource; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import net.minecraftforge.common.ISpecialArmor; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.IBindable; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BoundArmour extends ItemArmor implements ISpecialArmor,IBindable//,IRevealer, IGoggles +{ + private static int invSize = 9; + private static IIcon helmetIcon; + private static IIcon plateIcon; + private static IIcon leggingsIcon; + private static IIcon bootsIcon; + + public BoundArmour(int armorType) + { + super(ItemArmor.ArmorMaterial.GOLD, 0, armorType); + setMaxDamage(1000); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundHelmet"); + this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundPlate"); + this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundLeggings"); + this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundBoots"); + } + + @SideOnly(Side.CLIENT) + + public IIcon getIconFromDamage(int par1) + { + if (this.equals(ModItems.boundHelmet)) + { + return this.helmetIcon; + } + + if (this.equals(ModItems.boundPlate)) + { + return this.plateIcon; + } + + if (this.equals(ModItems.boundLeggings)) + { + return this.leggingsIcon; + } + + if (this.equals(ModItems.boundBoots)) + { + return this.bootsIcon; + } + + return this.itemIcon; + } + + @Override + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return false; + } + + @Override + public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) + { + if (source.equals(DamageSource.drown)) + { + return new ArmorProperties(-1, 0, 0); + } + + if (source.equals(DamageSource.outOfWorld)) + { + if (isImmuneToVoid(armor)) + { + return new ArmorProperties(-1, 3, 100000); + } else + { + return new ArmorProperties(-1, 0, 0); + } + } + + ItemStack helmet = player.getEquipmentInSlot(4); + ItemStack plate = player.getEquipmentInSlot(3); + ItemStack leggings = player.getEquipmentInSlot(2); + ItemStack boots = player.getEquipmentInSlot(1); + + if (helmet == null || plate == null || leggings == null || boots == null) + { + return new ArmorProperties(-1, 0, 0); + } + + if (helmet.equals(ModItems.boundHelmet) || plate.equals(ModItems.boundPlate) || leggings.equals(ModItems.boundLeggings) || boots.equals(ModItems.boundBoots)) + { + if (source.isUnblockable()) + { + return new ArmorProperties(-1, 3, 3); + } + + return new ArmorProperties(-1, 3, 100000); + } + + return new ArmorProperties(-1, 0, 0); + } + + @Override + public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) + { + if (armor.equals(ModItems.boundHelmet)) + { + return 3; + } + + if (armor.equals(ModItems.boundPlate)) + { + return 8; + } + + if (armor.equals(ModItems.boundLeggings)) + { + return 6; + } + + if (armor.equals(ModItems.boundBoots)) + { + return 3; + } + + return 5; + } + + @Override + public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) + { + if (entity instanceof EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(stack, (EntityPlayer) entity); + + if (((EntityPlayer) entity).capabilities.isCreativeMode) + { + return; + } + + //EnergyItems.syphonBatteries(stack, (EntityPlayer)entity, 200); + } + + stack.setItemDamage(stack.getItemDamage() + damage); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Devilish Protection"); + + if (!(par1ItemStack.stackTagCompound == null)) + { + if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + + ItemStack[] inv = getInternalInventory(par1ItemStack); + + if (inv == null) + { + return; + } + + for (int i = 0; i < invSize; i++) + { + if (inv[i] != null) + { + par3List.add("Item in slot " + i + ": " + inv[i].getDisplayName()); + } + } + } + } + + @Override + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { + //TODO Make the armour invisible when the player has Invisibility on. + if (entity instanceof EntityLivingBase) + { + if (((EntityLivingBase) entity).isPotionActive(Potion.invisibility.id)) + { + if (this== ModItems.boundHelmet || this == ModItems.boundPlate || this == ModItems.boundBoots) + { + return "alchemicalwizardry:models/armor/boundArmour_invisible_layer_1.png"; + } + + if (this == ModItems.boundLeggings) + { + return "alchemicalwizardry:models/armor/boundArmour_invisible_layer_2.png"; + } + } + } + + if (this == ModItems.boundHelmet || this == ModItems.boundPlate || this == ModItems.boundBoots) + { + return "alchemicalwizardry:models/armor/boundArmour_layer_1.png"; + } + + if (this == ModItems.boundLeggings) + { + return "alchemicalwizardry:models/armor/boundArmour_layer_2.png"; + } else + { + return null; + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + return super.onItemRightClick(par1ItemStack, par2World, par3EntityPlayer); + } + + @Override + public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) + { + if (itemStack.stackTagCompound == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + int maxBloodLevel = getMaxBloodShardLevel(itemStack); + ItemStack[] inv = getInternalInventory(itemStack); + + if (inv != null) + { + int iSize = 0; + int iBlood = 0; + } + + if (!player.isPotionActive(AlchemicalWizardry.customPotionInhibit)) + { + tickInternalInventory(itemStack, world, player, 0, false); + } + + if (itemStack.getItemDamage() > 0) + { + EnergyItems.checkAndSetItemOwner(itemStack, player); + + if (!player.capabilities.isCreativeMode) + { + EnergyItems.syphonBatteries(itemStack, player, itemStack.getItemDamage() * 75); + itemStack.setItemDamage(0); + } + } + + return; + } + + public void tickInternalInventory(ItemStack par1ItemStack, World par2World, EntityPlayer par3Entity, int par4, boolean par5) + { + ItemStack[] inv = getInternalInventory(par1ItemStack); + + if (inv == null) + { + return; + } + + int blood = getMaxBloodShardLevel(par1ItemStack); + + //int blood = 1; + for (int i = 0; i < invSize; i++) + { + if (inv[i] == null) + { + continue; + } + + if (inv[i].getItem() instanceof ArmourUpgrade && blood > 0) + { + if (((ArmourUpgrade) inv[i].getItem()).isUpgrade()) + { + ((ArmourUpgrade) inv[i].getItem()).onArmourUpdate(par2World, par3Entity, inv[i]); + blood--; + } + + if (par2World.getWorldTime() % 200 == 0) + { + if (getUpgradeCostMultiplier(par1ItemStack) > 0.02f) + { + EnergyItems.syphonBatteries(par1ItemStack, par3Entity, (int) (((ArmourUpgrade) inv[i].getItem()).getEnergyForTenSeconds() * getUpgradeCostMultiplier(par1ItemStack))); + } + } + } + } + } + + public int getMaxBloodShardLevel(ItemStack armourStack) + { + ItemStack[] inv = getInternalInventory(armourStack); + + if (inv == null) + { + return 0; + } + + int max = 0; + + for (int i = 0; i < invSize; i++) + { + ItemStack itemStack = inv[i]; + + if (itemStack != null) + { + if (itemStack.equals(ModItems.weakBloodShard)) + { + max = Math.max(max, 1); + } + + if (itemStack.equals(ModItems.demonBloodShard)) + { + max = Math.max(max, 2); + } + } + } + + return max; + } + + public boolean hasAddedToInventory(ItemStack sigilItemStack, ItemStack addedItemStack) + { + ItemStack[] inv = getInternalInventory(sigilItemStack); + + if (inv == null) + { + return false; + } + + if (addedItemStack == null) + { + return false; + } + + Item item = addedItemStack.getItem(); + int candidateSlot = -1; + + for (int i = invSize - 1; i >= 0; i--) + { + ItemStack nextItem = inv[i]; + + if (nextItem == null) + { + candidateSlot = i; + continue; + } + } + + if (candidateSlot == -1) + { + return false; + } + + if (addedItemStack.getItem() instanceof ArmourUpgrade) + { + inv[candidateSlot] = addedItemStack; + saveInternalInventory(sigilItemStack, inv); + return true; + } + + return false; + } + + public ItemStack[] getInternalInventory(ItemStack itemStack) + { + NBTTagCompound itemTag = itemStack.stackTagCompound; + + if (itemTag == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + return null; + } + + ItemStack[] inv = new ItemStack[9]; + NBTTagList tagList = itemTag.getTagList("Inventory",0); + + if (tagList == null) + { + return null; + } + + for (int i = 0; i < tagList.tagCount(); i++) + { + NBTTagCompound tag = new NBTTagCompound(); + int slot = tag.getByte("Slot"); + + if (slot >= 0 && slot < invSize) + { + inv[slot] = ItemStack.loadItemStackFromNBT(tag); + } + tagList.appendTag(tag); + } + + return inv; + } + + public void saveInternalInventory(ItemStack itemStack, ItemStack[] inventory) + { + NBTTagCompound itemTag = itemStack.stackTagCompound; + + if (itemTag == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + NBTTagList itemList = new NBTTagList(); + + for (int i = 0; i < invSize; i++) + { + ItemStack stack = inventory[i]; + + if (inventory[i] != null) + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setByte("Slot", (byte) i); + inventory[i].writeToNBT(tag); + itemList.appendTag(tag); + } + } + + itemTag.setTag("Inventory", itemList); + } + + public boolean isImmuneToVoid(ItemStack itemStack) + { + ItemStack[] inv = getInternalInventory(itemStack); + + if (inv == null) + { + return false; + } + + for (ItemStack item : inv) + { + if (item == null) + { + continue; + } + + if (item.equals(ModItems.voidSigil)) + { + return true; + } + } + + return false; + } + +// @Override +// public boolean hasIRevealer(ItemStack itemStack) +// { +// ItemStack[] inv = getInternalInventory(itemStack); +// +// if (inv == null) +// { +// return false; +// } +// +// for (ItemStack item : inv) +// { +// if (item == null) +// { +// continue; +// } +// +// if (item.getItem() instanceof IRevealer) +// { +// return true; +// } +// } +// +// return false; +// } +// +// @Override +// public boolean hasIGoggles(ItemStack itemStack) +// { +// ItemStack[] inv = getInternalInventory(itemStack); +// +// if (inv == null) +// { +// return false; +// } +// +// for (ItemStack item : inv) +// { +// if (item == null) +// { +// continue; +// } +// +// if (item.getItem() instanceof IGoggles) +// { +// return true; +// } +// } +// +// return false; +// } + + public float getUpgradeCostMultiplier(ItemStack itemStack) + { + ItemStack[] inv = getInternalInventory(itemStack); + + if (inv == null) + { + return 1.0f; + } + + for (ItemStack item : inv) + { + if (item == null) + { + continue; + } + + if (item.equals(ModItems.weakBloodOrb)) + { + return 0.75f; + } + + if (item.equals(ModItems.apprenticeBloodOrb)) + { + return 0.50f; + } + + if (item.equals(ModItems.magicianBloodOrb)) + { + return 0.25f; + } + + if (item.equals(ModItems.masterBloodOrb)) + { + return 0.0f; + } + + if (item.equals(ModItems.archmageBloodOrb)) + { + return 0.0f; + } + } + + return 1.0f; + } + + public int getItemEnchantability() + { + return 0; + } + +// @Override +// public boolean showNodes(ItemStack itemstack, EntityLivingBase player) +// { +// return this.hasIRevealer(itemstack); +// } +// +// @Override +// public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) +// { +// return this.hasIGoggles(itemstack); +// } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java new file mode 100644 index 00000000..f8adfe61 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java @@ -0,0 +1,381 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.ArrayList; +import java.util.List; + +import javax.swing.Icon; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockLeavesBase; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.IBindable; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BoundAxe extends ItemAxe implements IBindable +{ + /** + * Array of blocks the tool has extra effect against. + */ + public static final Block[] blocksEffectiveAgainst = new Block[]{Blocks.planks, Blocks.bookshelf, Blocks.log, Blocks.chest, Blocks.stone_slab, Blocks.pumpkin, Blocks.lit_pumpkin}; + + public float efficiencyOnProperMaterial = 12.0F; + + /** + * Damage versus entities. + */ + public float damageVsEntity; + + private static IIcon activeIcon; + private static IIcon passiveIcon; + + private int energyUsed; + + public BoundAxe() + { + super(AlchemicalWizardry.bloodBoundToolMaterial); + this.maxStackSize = 1; + //this.setMaxDamage(par3EnumToolMaterial.getMaxUses()); + this.efficiencyOnProperMaterial = 12.0F; + this.damageVsEntity = 5; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setEnergyUsed(5); + } + + public void setEnergyUsed(int i) + { + energyUsed = i; + } + + public int getEnergyUsed() + { + return this.energyUsed; + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Axe me about my puns!"); + + if (!(par1ItemStack.stackTagCompound == null)) + { + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + par3List.add("Activated"); + } else + { + par3List.add("Deactivated"); + } + + if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundAxe_activated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundAxe_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.stackTagCompound == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.stackTagCompound; + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + this.setActivated(par1ItemStack, !getActivated(par1ItemStack)); + par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); + return par1ItemStack; + } + + if (!getActivated(par1ItemStack)) + { + return par1ItemStack; + } + + if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit)) + { + return par1ItemStack; + } + + int posX = (int) par3EntityPlayer.posX; + int posY = (int) par3EntityPlayer.posY; + int posZ = (int) par3EntityPlayer.posZ; + boolean silkTouch = false; + int so = Enchantment.silkTouch.effectId; + int fortune = Enchantment.fortune.effectId; + int fortuneLvl = 0; + NBTTagList enchants = par1ItemStack.getEnchantmentTagList(); + + if (enchants != null) + { + for (int i = 0; i < enchants.tagCount(); i++) + { + if (enchants.getCompoundTagAt(i) instanceof NBTTagCompound) + { + NBTTagCompound nbt = (NBTTagCompound) enchants.getCompoundTagAt(i); + int id = nbt.getShort("id"); + + if (id == so) + { + silkTouch = true; + } + + if (id == fortune) + { + fortuneLvl = nbt.getShort("lvl"); + } + } + } + } + + for (int i = -5; i <= 5; i++) + { + for (int j = 0; j <= 10; j++) + { + for (int k = -5; k <= 5; k++) + { + Block block = par2World.getBlock(posX + i, posY + j, posZ + k); + int meta = par2World.getBlockMetadata(posX + i, posY + j, posZ + k); + + if (block != null) + { + float str = func_150893_a(par1ItemStack, block); + + if (str > 1.1f || block instanceof BlockLeavesBase && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k)) + { + //par1ItemStack.getEnchantmentTagList(); + if (silkTouch) + { + ItemStack droppedItem = new ItemStack(block, 1, meta); + + if (!par2World.isRemote) + { + par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, droppedItem)); + } + } else + { + ArrayList itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl); + + if (itemDropList != null) + { + for (ItemStack item : itemDropList) + { + if (!par2World.isRemote) + { + par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, item)); + } + } + } + } + + par2World.setBlockToAir(posX + i, posY + j, posZ + k); + } + } + } + } + } + + EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000); + return par1ItemStack; + } + + @Override + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) + { + if (!(par3Entity instanceof EntityPlayer)) + { + return; + } + + EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + +// if(par1ItemStack.stackTagCompound.getBoolean("isActive")) +// { +// EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 1); +// } + + if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20); + } + } + + par1ItemStack.setItemDamage(0); + return; + } + + public void setActivated(ItemStack par1ItemStack, boolean newActivated) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + itemTag.setBoolean("isActive", newActivated); + } + + public boolean getActivated(ItemStack par1ItemStack) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + return itemTag.getBoolean("isActive"); + } + + /** + * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if + * sword + */ + @Override + public float func_150893_a(ItemStack par1ItemStack, Block par2Block) + { + if (!getActivated(par1ItemStack)) + { + return 0.0F; + } + + return super.func_150893_a(par1ItemStack, par2Block); + } + + /** + * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise + * the damage on the stack. + */ + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) + { + if (!getActivated(par1ItemStack)) + { + return false; + } + + //par1ItemStack.damageItem(2, par3EntityLivingBase); + return true; + } + + public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) + { + if ((double) par3.getBlockHardness(par2World, par4, par5, par6) != 0.0D) + { + //par1ItemStack.damageItem(1, par7EntityLivingBase); + } + + return true; + } + + @SideOnly(Side.CLIENT) + + /** + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() + { + return true; + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + @Override + public int getItemEnchantability() + { + return 30; + } + + /** + * Return whether this item is repairable in an anvil. + */ +// public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) +// { +// return true; +// } + + /** + * FORGE: Overridden to allow custom tool effectiveness + */ + @Override + public float getDigSpeed(ItemStack stack, Block block, int meta) + { + if (!getActivated(stack)) + { + return 0.0F; + } + + if (ForgeHooks.isToolEffective(stack, block, meta)) + { + return efficiencyOnProperMaterial; + } + + return func_150893_a(stack, block); + } + + @Override + public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) + { + return !getActivated(stack); + } + + @Override + public int getHarvestLevel(ItemStack stack, String toolClass) + { + if("axe".equals(toolClass)) + { + return 5; + } + + return 0; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java new file mode 100644 index 00000000..eae60f68 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java @@ -0,0 +1,394 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.IBindable; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BoundPickaxe extends ItemPickaxe implements IBindable +{ + /** + * Array of blocks the tool has extra effect against. + */ + // public static final Block[] blocksEffectiveAgainst = new Block[]{Blocks.cobblestone, Blocks.stoneDoubleSlab, Blocks.stoneSingleSlab, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockIron, Block.oreCoal, Block.blockGold, Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail, Block.railDetector, Block.railPowered, Block.railActivator}; + + public float efficiencyOnProperMaterial = 12.0F; + + /** + * Damage versus entities. + */ + public float damageVsEntity; + + private static IIcon activeIcon; + private static IIcon passiveIcon; + + private int energyUsed; + + public BoundPickaxe() + { + super(AlchemicalWizardry.bloodBoundToolMaterial); + this.maxStackSize = 1; + //this.setMaxDamage(par3EnumToolMaterial.getMaxUses()); + this.efficiencyOnProperMaterial = 12.0F; + this.damageVsEntity = 5; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setEnergyUsed(5); + } + + public void setEnergyUsed(int i) + { + energyUsed = i; + } + + public int getEnergyUsed() + { + return this.energyUsed; + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("The Souls of the Damned"); + par3List.add("do not like stone..."); + + if (!(par1ItemStack.stackTagCompound == null)) + { + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + par3List.add("Activated"); + } else + { + par3List.add("Deactivated"); + } + + if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundPickaxe_activated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundPickaxe_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.stackTagCompound == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.stackTagCompound; + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + this.setActivated(par1ItemStack, !getActivated(par1ItemStack)); + par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); + return par1ItemStack; + } + + if (!getActivated(par1ItemStack)) + { + return par1ItemStack; + } + + if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit)) + { + return par1ItemStack; + } + + int posX = (int) par3EntityPlayer.posX; + int posY = (int) par3EntityPlayer.posY; + int posZ = (int) par3EntityPlayer.posZ; + boolean silkTouch = false; + int so = Enchantment.silkTouch.effectId; + int fortune = Enchantment.fortune.effectId; + int fortuneLvl = 0; + NBTTagList enchants = par1ItemStack.getEnchantmentTagList(); + + if (enchants != null) + { + for (int i = 0; i < enchants.tagCount(); i++) + { + if (enchants.getCompoundTagAt(i) instanceof NBTTagCompound) + { + NBTTagCompound nbt = (NBTTagCompound) enchants.getCompoundTagAt(i); + int id = nbt.getShort("id"); + + if (id == so) + { + silkTouch = true; + } + + if (id == fortune) + { + fortuneLvl = nbt.getShort("lvl"); + } + } + } + } + + for (int i = -5; i <= 5; i++) + { + for (int j = -5; j <= 5; j++) + { + for (int k = -5; k <= 5; k++) + { + Block block = par2World.getBlock(posX + i, posY + j, posZ + k); + int meta = par2World.getBlockMetadata(posX + i, posY + j, posZ + k); + + if (block != null && block.getBlockHardness(par2World, posX + i, posY + j, posZ + k) != -1) + { + float str = func_150893_a(par1ItemStack, block); + + if (str > 1.1f && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k)) + { + //par1ItemStack.getEnchantmentTagList(); + if (silkTouch) + { + ItemStack droppedItem = new ItemStack(block, 1, meta); + + if (!par2World.isRemote) + { + par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, droppedItem)); + } + } else + { + ArrayList itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl); + + if (itemDropList != null) + { + for (ItemStack item : itemDropList) + { + if (!par2World.isRemote) + { + par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, item)); + } + } + } + } + + par2World.setBlockToAir(posX + i, posY + j, posZ + k); + } + } + } + } + } + + EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000); + return par1ItemStack; + } + + @Override + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) + { + if (!(par3Entity instanceof EntityPlayer)) + { + return; + } + + EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + +// if(par1ItemStack.stackTagCompound.getBoolean("isActive")) +// { +// EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 1); +// } + + if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20); + } + } + + par1ItemStack.setItemDamage(0); + return; + } + + public void setActivated(ItemStack par1ItemStack, boolean newActivated) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + itemTag.setBoolean("isActive", newActivated); + } + + public boolean getActivated(ItemStack par1ItemStack) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + return itemTag.getBoolean("isActive"); + } + + /** + * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if + * sword + */ + @Override + public float func_150893_a(ItemStack par1ItemStack, Block par2Block) //getStrVsBlock + { + if (!getActivated(par1ItemStack)) + { + return 0.0F; + } + + return super.func_150893_a(par1ItemStack, par2Block); + } + + /** + * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise + * the damage on the stack. + */ + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) + { + if (!getActivated(par1ItemStack)) + { + return false; + } + + //par1ItemStack.damageItem(2, par3EntityLivingBase); + return true; + } + + @Override + public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) + { + + if (par7EntityLivingBase instanceof EntityPlayer) + { + EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par7EntityLivingBase, getEnergyUsed()); + } + + //TODO Possibly add better functionality for the items? + //par7EntityLivingBase.getLookVec(); + return true; + } + + @SideOnly(Side.CLIENT) + + /** + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() + { + return true; + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + @Override + public int getItemEnchantability() + { + return 30; + } + + /** + * Return whether this item is repairable in an anvil. + */ +// public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) +// { +// return false; +// } + + /** + * FORGE: Overridden to allow custom tool effectiveness + */ + @Override + public float getDigSpeed(ItemStack stack, Block block, int meta) + { + if (!getActivated(stack)) + { + return 0.0F; + } + + if (ForgeHooks.isToolEffective(stack, block, meta)) + { + return efficiencyOnProperMaterial; + } + + return func_150893_a(stack, block); + } + +// @Override +// +// /** +// * Returns if the item (tool) can harvest results from the block type. +// */ +// public boolean func_150897_b(Block par1Block) //canHarvestBlock +// { +// return par1Block == Blocks.obsidian ? true : (par1Block != Blocks.diamond_block && par1Block != Blocks.diamond_ore ? (par1Block != Blocks.emerald_ore && par1Block != Blocks.emerald_block ? (par1Block != Blocks.gold_block && par1Block != Blocks.gold_ore ? (par1Block != Blocks.iron_block && par1Block != Blocks.iron_ore ? (par1Block != Blocks.lapis_block && par1Block != Blocks.lapis_ore ? (par1Block != Blocks.redstone_ore && par1Block != Blocks.oreRedstoneGlowing ? (par1Block.getMaterial() == Material.rock ? true : (par1Block.blockMaterial == Material.iron ? true : par1Block.blockMaterial == Material.anvil)) : true) : true) : true) : true) : true) : true); +// } + + @Override + public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) + { + return !getActivated(stack); + } + + @Override + public int getHarvestLevel(ItemStack stack, String toolClass) + { + if("pickaxe".equals(toolClass)) + { + return 5; + } + + return 0; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java new file mode 100644 index 00000000..c13f2ddd --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java @@ -0,0 +1,388 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.IBindable; + +import com.google.common.collect.Multimap; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BoundShovel extends ItemSpade implements IBindable +{ + /** + * Array of blocks the tool has extra effect against. + */ + //public static final Block[] blocksEffectiveAgainst = new Block[]{Block.grass, Block.dirt, Block.sand, Block.gravel, Block.snow, Block.blockSnow, Block.blockClay, Block.tilledField, Block.slowSand, Block.mycelium}; + + public float efficiencyOnProperMaterial = 12.0F; + + /** + * Damage versus entities. + */ + public float damageVsEntity; + + private static IIcon activeIcon; + private static IIcon passiveIcon; + + private int energyUsed; + + public BoundShovel() + { + super(AlchemicalWizardry.bloodBoundToolMaterial); + this.maxStackSize = 1; + //this.setMaxDamage(par3EnumToolMaterial.getMaxUses()); + this.efficiencyOnProperMaterial = 12.0F; + this.damageVsEntity = 5; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setEnergyUsed(5); + } + + public void setEnergyUsed(int i) + { + energyUsed = i; + } + + public int getEnergyUsed() + { + return this.energyUsed; + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("No, not that type of spade."); + + if (!(par1ItemStack.stackTagCompound == null)) + { + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + par3List.add("Activated"); + } else + { + par3List.add("Deactivated"); + } + + if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundShovel_activated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundShovel_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.stackTagCompound == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.stackTagCompound; + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + this.setActivated(par1ItemStack, !getActivated(par1ItemStack)); + par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); + return par1ItemStack; + } + + if (!getActivated(par1ItemStack)) + { + return par1ItemStack; + } + + if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit)) + { + return par1ItemStack; + } + + int posX = (int) par3EntityPlayer.posX; + int posY = (int) par3EntityPlayer.posY; + int posZ = (int) par3EntityPlayer.posZ; + boolean silkTouch = false; + int so = Enchantment.silkTouch.effectId; + int fortune = Enchantment.fortune.effectId; + int fortuneLvl = 0; + NBTTagList enchants = par1ItemStack.getEnchantmentTagList(); + + if (enchants != null) + { + for (int i = 0; i < enchants.tagCount(); i++) + { + if (enchants.getCompoundTagAt(i) instanceof NBTTagCompound) + { + NBTTagCompound nbt = (NBTTagCompound) enchants.getCompoundTagAt(i); + int id = nbt.getShort("id"); + + if (id == so) + { + silkTouch = true; + } + + if (id == fortune) + { + fortuneLvl = nbt.getShort("lvl"); + } + } + } + } + + for (int i = -5; i <= 5; i++) + { + for (int j = 0; j <= 10; j++) + { + for (int k = -5; k <= 5; k++) + { + Block block = par2World.getBlock(posX + i, posY + j, posZ + k); + int meta = par2World.getBlockMetadata(posX + i, posY + j, posZ + k); + + if (block != null) + { + float str = func_150893_a(par1ItemStack, block); + + if (str > 1.1f && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k)) + { + //par1ItemStack.getEnchantmentTagList(); + if (silkTouch) + { + ItemStack droppedItem = new ItemStack(block, 1, meta); + + if (!par2World.isRemote) + { + par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, droppedItem)); + } + } else + { + ArrayList itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl); + + if (itemDropList != null) + { + for (ItemStack item : itemDropList) + { + if (!par2World.isRemote) + { + par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, item)); + } + } + } + } + + par2World.setBlockToAir(posX + i, posY + j, posZ + k); + } + } + } + } + } + + EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000); + return par1ItemStack; + } + + @Override + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) + { + if (!(par3Entity instanceof EntityPlayer)) + { + return; + } + + EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + +// if(par1ItemStack.stackTagCompound.getBoolean("isActive")) +// { +// EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 1); +// } + + if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20); + } + } + + par1ItemStack.setItemDamage(0); + return; + } + + public void setActivated(ItemStack par1ItemStack, boolean newActivated) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + itemTag.setBoolean("isActive", newActivated); + } + + public boolean getActivated(ItemStack par1ItemStack) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + return itemTag.getBoolean("isActive"); + } + + /** + * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if + * sword + */ + @Override + public float func_150893_a(ItemStack par1ItemStack, Block par2Block) + { + if (!getActivated(par1ItemStack)) + { + return 0.0F; + } + + return super.func_150893_a(par1ItemStack, par2Block); + } + + /** + * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise + * the damage on the stack. + */ + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) + { + if (!getActivated(par1ItemStack)) + { + return false; + } + + //par1ItemStack.damageItem(2, par3EntityLivingBase); + return true; + } + + public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) + { + return true; + } + + @SideOnly(Side.CLIENT) + + /** + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() + { + return true; + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() + { + return 30; + } + + /** + * Return whether this item is repairable in an anvil. + */ +// public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) +// { +// return false; +// } + @Override + public Multimap getItemAttributeModifiers() + { + Multimap multimap = super.getItemAttributeModifiers(); + multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", (double) this.damageVsEntity, 0)); + return multimap; + } + + /** + * FORGE: Overridden to allow custom tool effectiveness + */ + @Override + public float getDigSpeed(ItemStack stack, Block block, int meta) + { + if (!getActivated(stack)) + { + return 0.0F; + } + + if (ForgeHooks.isToolEffective(stack, block, meta)) + { + return efficiencyOnProperMaterial; + } + + return func_150893_a(stack, block); + } +// +// public boolean canHarvestBlock(Block par1Block) +// { +// return par1Block == Block.snow ? true : par1Block == Block.blockSnow; +// } + + @Override + public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) + { + return !getActivated(stack); + } + + @Override + public int getHarvestLevel(ItemStack stack, String toolClass) + { + if("shovel".equals(toolClass)) + { + return 5; + } + + return 0; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/CheatyItem.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/CheatyItem.java new file mode 100644 index 00000000..4596e507 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/CheatyItem.java @@ -0,0 +1,254 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import net.minecraftforge.common.util.FakePlayer; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.IBindable; +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class CheatyItem extends Item implements IBindable +{ + // private int maxEssence; + //protected int orbLevel; + + public CheatyItem() + { + super(); + DamageSource damageSource = DamageSource.generic; + setMaxStackSize(1); + //setMaxDamage(damage); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + //setFull3D(); + //maxEssence = damage; + //orbLevel = 1; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBattery"); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Creative only"); + par3List.add("Right-click to fill network,"); + par3List.add("shift-right to empty."); + + //par3List.add("LP: " + (this.getMaxDamage() - this.getDamage(par1ItemStack))); + if (!(par1ItemStack.stackTagCompound == null)) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); +// EntityPlayer owner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par1ItemStack.stackTagCompound.getString("ownerName")); +// if(owner!=null) +// { +// NBTTagCompound tag = owner.getEntityData(); +// par3List.add("LP: " + tag.getInteger("currentEssence")); +// } + } + + //par3List.add("LP: " + par2EntityPlayer.getEntityData().getInteger("currentEssence")); + } + + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + World world = par3EntityPlayer.worldObj; + + if (par3EntityPlayer instanceof FakePlayer) + { + return par1ItemStack; + } + + if (world != null) + { + double posX = par3EntityPlayer.posX; + double posY = par3EntityPlayer.posY; + double posZ = par3EntityPlayer.posZ; + world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); + SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ); + } + + if (!par3EntityPlayer.worldObj.isRemote) + { + return par1ItemStack; + } + + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null || itemTag.getString("ownerName").equals("")) + { + return par1ItemStack; + } + + if (par3EntityPlayer.isSneaking()) + { + EnergyItems.setCurrentEssence(itemTag.getString("ownerName"), 0); + } else + { + EnergyItems.addEssenceToMaximum(itemTag.getString("ownerName"), 1000000, Integer.MAX_VALUE); + } + + //PacketDispatcher.sendPacketToPlayer(PacketHandler.getPacket(itemTag.getString("ownerName")), (Player)par3EntityPlayer); +// EntityPlayer owner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(itemTag.getString("ownerName")); +// if(owner==null){return par1ItemStack;} +// NBTTagCompound ownerTag = owner.getEntityData(); +// if(ownerTag.getInteger("currentEssence")<=this.maxEssence) +// { +// damagePlayer(par2World, par3EntityPlayer,2); +// ownerTag.setInteger("currentEssence", Math.min(this.maxEssence, ownerTag.getInteger("currentEssence")+200/2)); +// } + return par1ItemStack; + } + + /* + * @return the damage that was not deducted + */ + public int damageItem(ItemStack par1ItemStack, int par2int) + { + if (par2int == 0) + { + return 0; + } + + int before = this.getDamage(par1ItemStack); + this.setDamage(par1ItemStack, this.getDamage(par1ItemStack) + par2int); + return par2int - (this.getDamage(par1ItemStack) - before); + } + + protected void damagePlayer(World world, EntityPlayer player, int damage) + { + if (world != null) + { + double posX = player.posX; + double posY = player.posY; + double posZ = player.posZ; + world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); + float f = (float) 1.0F; + float f1 = f * 0.6F + 0.4F; + float f2 = f * f * 0.7F - 0.5F; + float f3 = f * f * 0.6F - 0.7F; + + for (int l = 0; l < 8; ++l) + { + world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); + } + } + + if (!player.capabilities.isCreativeMode) + { + for (int i = 0; i < damage; i++) + { + player.setHealth((player.getHealth() - 1)); + //player.setEntityHealth(player.func_110143_aJ() - 1); + } + } + + if (player.getHealth() <= 0) + { + player.inventory.dropAllItems(); + } + } + +// public int getMaxEssence() +// { +// return this.maxEssence; +// } +// +// public int getOrbLevel() +// { +// return orbLevel; +// } +// +// @Override +// public void onArmourUpdate(World world, EntityPlayer player, +// ItemStack thisItemStack) { +// // TODO Auto-generated method stub +// +// } +// +// @Override +// public boolean isUpgrade() +// { +// // TODO Auto-generated method stub +// return false; +// } +// +// @Override +// public int getEnergyForTenSeconds() +// { +// // TODO Auto-generated method stub +// return 0; +// } + + @Override + public ItemStack getContainerItem(ItemStack itemStack) + { + //if(!syphonBatteries(itemStack, null, 10)) + { + //syphonWhileInContainer(itemStack, this.getEnergyUsed()); +// ItemStack copiedStack = itemStack.copy(); +// copiedStack.setItemDamage(copiedStack.getItemDamage()); +// copiedStack.stackSize = 1; +// return copiedStack; + } + return itemStack; + } + + @Override + public boolean hasContainerItem() + { + return true; + } + + //@SideOnly(Side.SERVER) + public int getCurrentEssence(ItemStack par1ItemStack) + { + if (par1ItemStack == null) + { + return 0; + } + + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null || itemTag.getString("ownerName").equals("")) + { + return 0; + } + + String owner = itemTag.getString("ownerName"); + 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; + return (currentEssence); + } + + @Override + public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack) + { + return false; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/DaggerOfSacrifice.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/DaggerOfSacrifice.java new file mode 100644 index 00000000..361a95dc --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/DaggerOfSacrifice.java @@ -0,0 +1,268 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.entity.boss.IBossDisplayData; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; + +import com.google.common.collect.Multimap; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class DaggerOfSacrifice extends EnergyItems +{ + private float weaponDamage; + + public DaggerOfSacrifice() + { + super(); + this.maxStackSize = 1; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setEnergyUsed(100); + setFull3D(); + setMaxDamage(100); + weaponDamage = 1.0F; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DaggerOfSacrifice"); + } + + @Override + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) + { + if (par3EntityLivingBase == null || par2EntityLivingBase == null || par3EntityLivingBase.worldObj.isRemote || !(par3EntityLivingBase.getClass().equals(EntityPlayerMP.class))) + { + return false; + } + + //EntityWither d; + if (par2EntityLivingBase.isChild() || par2EntityLivingBase instanceof EntityWither || par2EntityLivingBase instanceof EntityDragon || par2EntityLivingBase instanceof EntityPlayer || par2EntityLivingBase instanceof IBossDisplayData) + { + return false; + } + + World world = par2EntityLivingBase.worldObj; + + if (par2EntityLivingBase.isDead || par2EntityLivingBase.getHealth() < 0.5f) + { + return false; + } + + if (par2EntityLivingBase instanceof EntityVillager && !par2EntityLivingBase.isChild()) + { + if (findAndFillAltar(par2EntityLivingBase.worldObj, par2EntityLivingBase, 2000)) + { + double posX = par2EntityLivingBase.posX; + double posY = par2EntityLivingBase.posY; + double posZ = par2EntityLivingBase.posZ; + + + + for (int i = 0; i < 8; i++) + { + SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 1, posX, posY, posZ); + } + + par2EntityLivingBase.setHealth(-1); + par2EntityLivingBase.onDeath(DamageSource.generic); + return false; + } + } + + if (par2EntityLivingBase instanceof EntitySlime && !par2EntityLivingBase.isChild()) + { + if (findAndFillAltar(par2EntityLivingBase.worldObj, par2EntityLivingBase, 150)) + { + double posX = par2EntityLivingBase.posX; + double posY = par2EntityLivingBase.posY; + double posZ = par2EntityLivingBase.posZ; + + for (int i = 0; i < 8; i++) + { + SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 1, posX, posY, posZ); + } + + par2EntityLivingBase.setHealth(-1); + par2EntityLivingBase.onDeath(DamageSource.generic); + return false; + } + } + + if (par2EntityLivingBase instanceof EntityEnderman && !par2EntityLivingBase.isChild()) + { + if (findAndFillAltar(par2EntityLivingBase.worldObj, par2EntityLivingBase, 200)) + { + double posX = par2EntityLivingBase.posX; + double posY = par2EntityLivingBase.posY; + double posZ = par2EntityLivingBase.posZ; + + for (int i = 0; i < 8; i++) + { + SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 1, posX, posY, posZ); + } + + par2EntityLivingBase.setHealth(-1); + par2EntityLivingBase.onDeath(DamageSource.generic); + return false; + } + } + + if (par2EntityLivingBase instanceof EntityAnimal && !par2EntityLivingBase.isChild()) + { + if (findAndFillAltar(par2EntityLivingBase.worldObj, par2EntityLivingBase, 250)) + { + double posX = par2EntityLivingBase.posX; + double posY = par2EntityLivingBase.posY; + double posZ = par2EntityLivingBase.posZ; + + for (int i = 0; i < 8; i++) + { + SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 1, posX, posY, posZ); + } + + par2EntityLivingBase.setHealth(-1); + par2EntityLivingBase.onDeath(DamageSource.generic); + return false; + } + } + + if (findAndFillAltar(par2EntityLivingBase.worldObj, par2EntityLivingBase, 500)) + { + double posX = par2EntityLivingBase.posX; + double posY = par2EntityLivingBase.posY; + double posZ = par2EntityLivingBase.posZ; + + for (int i = 0; i < 8; i++) + { + SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 1, posX, posY, posZ); + } + + par2EntityLivingBase.setHealth(-1); + par2EntityLivingBase.onDeath(DamageSource.generic); + return false; + } + + return false; + } + + public float func_82803_g() + { + return 4.0F; + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Caution: may cause"); + par3List.add("a bad day..."); + } + + @Override + public float func_150893_a(ItemStack par1ItemStack, Block par2Block) + { + if (par2Block == Blocks.web) + { + return 15.0F; + } else + { + Material material = par2Block.getMaterial(); + return material != Material.plants && material != Material.vine && material != Material.coral && material != Material.leaves && material != Material.gourd ? 1.0F : 1.5F; + } + } + + @Override + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return false; + } + + @Override + + public Multimap getItemAttributeModifiers() + { + Multimap multimap = super.getItemAttributeModifiers(); + multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", 1.0d, 0)); + return multimap; + } + + public boolean findAndFillAltar(World world, EntityLivingBase sacrifice, int amount) + { + int posX = (int) Math.round(sacrifice.posX - 0.5f); + int posY = (int) sacrifice.posY; + int posZ = (int) Math.round(sacrifice.posZ - 0.5f); + TEAltar altarEntity = this.getAltar(world, posX, posY, posZ); + + if (altarEntity == null) + { + return false; + } + + altarEntity.sacrificialDaggerCall(amount, true); + altarEntity.startCycle(); + return true; + } + + public TEAltar getAltar(World world, int x, int y, int z) + { + TileEntity tileEntity = null; + + for (int i = -2; i <= 2; i++) + { + for (int j = -2; j <= 2; j++) + { + for (int k = -2; k <= 1; k++) + { + tileEntity = world.getTileEntity(i + x, k + y, j + z); + + if ((tileEntity instanceof TEAltar)) + { + return (TEAltar) tileEntity; + } + } + + if ((tileEntity instanceof TEAltar)) + { + return (TEAltar) tileEntity; + } + } + + if ((tileEntity instanceof TEAltar)) + { + return (TEAltar) tileEntity; + } + } + + if ((tileEntity instanceof TEAltar)) + { + return (TEAltar) tileEntity; + } + + return null; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/DemonPlacer.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/DemonPlacer.java new file mode 100644 index 00000000..68596a3f --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/DemonPlacer.java @@ -0,0 +1,277 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityList.EntityEggInfo; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.Facing; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityDemon; +import WayofTime.alchemicalWizardry.common.summoning.SummoningRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class DemonPlacer extends Item +{ + @SideOnly(Side.CLIENT) + private IIcon theIcon; + + public DemonPlacer() + { + super(); + this.setHasSubtypes(true); + this.setCreativeTab(CreativeTabs.tabMisc); + this.maxStackSize = 1; + } + + public String getItemDisplayName(ItemStack par1ItemStack) + { +// String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim(); +// String s1 = EntityList.getStringFromID(par1ItemStack.getItemDamage()); +// +// if (s1 != null) +// { +// s = s + " " + StatCollector.translateToLocal("entity." + s1 + ".name"); +// } +// +// return s; + return "Demon Crystal"; + } + + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack par1ItemStack, int par2) + { + EntityEggInfo entityegginfo = (EntityEggInfo) EntityList.entityEggs.get(Integer.valueOf(par1ItemStack.getItemDamage())); + return entityegginfo != null ? (par2 == 0 ? entityegginfo.primaryColor : entityegginfo.secondaryColor) : 16777215; + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) + { + if (par3World.isRemote) + { + return true; + } else + { + Block i1 = par3World.getBlock(par4, par5, par6); + par4 += Facing.offsetsXForSide[par7]; + par5 += Facing.offsetsYForSide[par7]; + par6 += Facing.offsetsZForSide[par7]; + double d0 = 0.0D; + + if (par7 == 1 && i1 != null && i1.getRenderType() == 11) + { + d0 = 0.5D; + } + + Entity entity = spawnCreature(par3World, par1ItemStack.getItemDamage(), (double) par4 + 0.5D, (double) par5 + d0, (double) par6 + 0.5D, par1ItemStack); + + if (entity != null) + { + if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName()) + { + ((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName()); + } + + if (!par2EntityPlayer.capabilities.isCreativeMode) + { + --par1ItemStack.stackSize; + } + } + + return true; + } + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (par2World.isRemote) + { + return par1ItemStack; + } else + { + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true); + + if (movingobjectposition == null) + { + return par1ItemStack; + } else + { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + if (!par2World.canMineBlock(par3EntityPlayer, i, j, k)) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack)) + { + return par1ItemStack; + } + + if (par2World.getBlock(i, j, k).getMaterial() == Material.water) + { + Entity entity = spawnCreature(par2World, par1ItemStack.getItemDamage(), (double) i, (double) j, (double) k, par1ItemStack); + + if (entity != null) + { + if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName()) + { + ((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName()); + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + --par1ItemStack.stackSize; + } + } + } + } + + return par1ItemStack; + } + } + } + + /** + * Spawns the creature specified by the egg's type in the location specified by the last three parameters. + * Parameters: world, entityID, x, y, z. + */ + public static Entity spawnCreature(World par0World, int par1, double par2, double par4, double par6, ItemStack itemStack) + { +// if (!EntityList.entityEggs.containsKey(Integer.valueOf(par1))) +// { +// return null; +// } +// else + { + Entity entity = null; + + for (int j = 0; j < 1; ++j) + { + entity = SummoningRegistry.getEntityWithID(par0World, par1); + + if (entity != null && entity instanceof EntityLivingBase) + { + EntityLiving entityliving = (EntityLiving) entity; + entity.setLocationAndAngles(par2, par4, par6, MathHelper.wrapAngleTo180_float(par0World.rand.nextFloat() * 360.0F), 0.0F); + entityliving.rotationYawHead = entityliving.rotationYaw; + entityliving.renderYawOffset = entityliving.rotationYaw; + + //entityliving.onSpawnWithEgg((EntityLivingData)null); + if (entityliving instanceof EntityDemon) + { + ((EntityDemon) entityliving).setOwner(DemonPlacer.getOwnerName(itemStack)); + + if (!DemonPlacer.getOwnerName(itemStack).equals("")) + { + ((EntityDemon) entityliving).setTamed(true); + } + } + + par0World.spawnEntityInWorld(entity); + entityliving.playLivingSound(); + } + } + + return entity; + } + } + +// @SideOnly(Side.CLIENT) +// public boolean requiresMultipleRenderPasses() +// { +// return true; +// } + +// @SideOnly(Side.CLIENT) +// +// /** +// * Gets an icon index based on an item's damage value and the given render pass +// */ +// public Icon getIconFromDamageForRenderPass(int par1, int par2) +// { +// return par2 > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(par1, par2); +// } + +// @SideOnly(Side.CLIENT) +// +// /** +// * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) +// */ +// public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) +// { +// Iterator iterator = EntityList.entityEggs.values().iterator(); +// +// while (iterator.hasNext()) +// { +// EntityEggInfo entityegginfo = (EntityEggInfo)iterator.next(); +// par3List.add(new ItemStack(par1, 1, entityegginfo.spawnedID)); +// } +// } + + public static void setOwnerName(ItemStack par1ItemStack, String ownerName) + { + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + par1ItemStack.stackTagCompound.setString("ownerName", ownerName); + } + + public static String getOwnerName(ItemStack par1ItemStack) + { + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + return par1ItemStack.stackTagCompound.getString("ownerName"); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Used to spawn demons."); + + if (!(par1ItemStack.stackTagCompound == null)) + { + if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + { + par3List.add("Demon's Owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonPlacer"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/DemonicTelepositionFocus.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/DemonicTelepositionFocus.java new file mode 100644 index 00000000..d26de12d --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/DemonicTelepositionFocus.java @@ -0,0 +1,47 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class DemonicTelepositionFocus extends TelepositionFocus +{ + public DemonicTelepositionFocus() + { + super(4); + // TODO Auto-generated constructor stub + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + //TODO + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonicTeleposerFocus"); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("A stronger version of the focus,"); + par3List.add("using a demonic shard"); + + if (!(par1ItemStack.stackTagCompound == null)) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + + par3List.add("Coords: " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord")); + par3List.add("Bound Dimension: " + getDimensionID(par1ItemStack)); + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/DuskScribeTool.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/DuskScribeTool.java new file mode 100644 index 00000000..ddbdbfe9 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/DuskScribeTool.java @@ -0,0 +1,20 @@ +package WayofTime.alchemicalWizardry.common.items; + +import net.minecraft.client.renderer.texture.IIconRegister; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class DuskScribeTool extends ScribeTool +{ + public DuskScribeTool() + { + super(5); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DuskScribeTool"); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EarthScribeTool.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EarthScribeTool.java new file mode 100644 index 00000000..290c6f91 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EarthScribeTool.java @@ -0,0 +1,20 @@ +package WayofTime.alchemicalWizardry.common.items; + +import net.minecraft.client.renderer.texture.IIconRegister; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class EarthScribeTool extends ScribeTool +{ + public EarthScribeTool() + { + super(3); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EarthScribeTool"); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EnergyBattery.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EnergyBattery.java new file mode 100644 index 00000000..2e5b2307 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EnergyBattery.java @@ -0,0 +1,255 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import net.minecraftforge.common.util.FakePlayer; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.IBindable; +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class EnergyBattery extends Item implements ArmourUpgrade, IBindable +{ + private int maxEssence; + protected int orbLevel; + + public EnergyBattery(int damage) + { + super(); + DamageSource damageSource = DamageSource.generic; + setMaxStackSize(1); + //setMaxDamage(damage); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + //setFull3D(); + maxEssence = damage; + orbLevel = 1; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBattery"); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Stores raw Life Essence"); + + //par3List.add("LP: " + (this.getMaxDamage() - this.getDamage(par1ItemStack))); + if (!(par1ItemStack.stackTagCompound == null)) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); +// EntityPlayer owner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par1ItemStack.stackTagCompound.getString("ownerName")); +// if(owner!=null) +// { +// NBTTagCompound tag = owner.getEntityData(); +// par3List.add("LP: " + tag.getInteger("currentEssence")); +// } + } + + //par3List.add("LP: " + par2EntityPlayer.getEntityData().getInteger("currentEssence")); + } + + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + World world = par3EntityPlayer.worldObj; + + if (par3EntityPlayer instanceof FakePlayer || par3EntityPlayer instanceof EntityPlayerMP) + { + return par1ItemStack; + } + + if (world != null) + { + double posX = par3EntityPlayer.posX; + double posY = par3EntityPlayer.posY; + double posZ = par3EntityPlayer.posZ; + world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); + SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ); + } + + if (!(par3EntityPlayer.getClass().equals(EntityPlayerMP.class))) + { + return par1ItemStack; + } + + + +// if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) +// { +// return par1ItemStack; +// } + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null || itemTag.getString("ownerName").equals("")) + { + return par1ItemStack; + } + + if(world.isRemote) + { + return par1ItemStack; + } + + EnergyItems.addEssenceToMaximum(itemTag.getString("ownerName"), 200, this.getMaxEssence()); + EnergyItems.hurtPlayer(par3EntityPlayer, 200); + //PacketDispatcher.sendPacketToPlayer(PacketHandler.getPacket(itemTag.getString("ownerName")), (Player)par3EntityPlayer); +// EntityPlayer owner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(itemTag.getString("ownerName")); +// if(owner==null){return par1ItemStack;} +// NBTTagCompound ownerTag = owner.getEntityData(); +// if(ownerTag.getInteger("currentEssence")<=this.maxEssence) +// { +// damagePlayer(par2World, par3EntityPlayer,2); +// ownerTag.setInteger("currentEssence", Math.min(this.maxEssence, ownerTag.getInteger("currentEssence")+200/2)); +// } + return par1ItemStack; + } + + /* + * @return the damage that was not deducted + */ + public int damageItem(ItemStack par1ItemStack, int par2int) + { + if (par2int == 0) + { + return 0; + } + + int before = this.getDamage(par1ItemStack); + this.setDamage(par1ItemStack, this.getDamage(par1ItemStack) + par2int); + return par2int - (this.getDamage(par1ItemStack) - before); + } + + protected void damagePlayer(World world, EntityPlayer player, int damage) + { + if (world != null) + { + double posX = player.posX; + double posY = player.posY; + double posZ = player.posZ; + world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); + float f = (float) 1.0F; + float f1 = f * 0.6F + 0.4F; + float f2 = f * f * 0.7F - 0.5F; + float f3 = f * f * 0.6F - 0.7F; + + for (int l = 0; l < 8; ++l) + { + world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); + } + } + + if (!player.capabilities.isCreativeMode) + { + for (int i = 0; i < damage; i++) + { + player.setHealth((player.getHealth() - 1)); + //player.setEntityHealth(player.func_110143_aJ() - 1); + } + } + + if (player.getHealth() <= 0) + { + player.inventory.dropAllItems(); + } + } + + public int getMaxEssence() + { + return this.maxEssence; + } + + public int getOrbLevel() + { + return orbLevel; + } + + @Override + public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) + { + } + + @Override + public boolean isUpgrade() + { + return false; + } + + @Override + public int getEnergyForTenSeconds() + { + return 0; + } + + @Override + public ItemStack getContainerItem(ItemStack itemStack) + { + //if(!syphonBatteries(itemStack, null, 10)) + { + //syphonWhileInContainer(itemStack, this.getEnergyUsed()); +// ItemStack copiedStack = itemStack.copy(); +// copiedStack.setItemDamage(copiedStack.getItemDamage()); +// copiedStack.stackSize = 1; +// return copiedStack; + } + return itemStack; + } + + @Override + public boolean hasContainerItem() + { + return true; + } + + //@SideOnly(Side.SERVER) + public int getCurrentEssence(ItemStack par1ItemStack) + { + if (par1ItemStack == null) + { + return 0; + } + + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null || itemTag.getString("ownerName").equals("")) + { + return 0; + } + + String owner = itemTag.getString("ownerName"); + 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; + return (currentEssence); + } + + @Override + public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack) + { + return false; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EnergyBazooka.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EnergyBazooka.java new file mode 100644 index 00000000..be0eddc2 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EnergyBazooka.java @@ -0,0 +1,219 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaMainProjectile; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class EnergyBazooka extends EnergyItems +{ + private static IIcon activeIcon; + private static IIcon passiveIcon; + private static int damage; + //private static int delay; + private static final int maxDelay = 150; + + public EnergyBazooka() + { + super(); + setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setFull3D(); + setMaxDamage(250); + this.setEnergyUsed(20000); + damage = 12; + //delay = 0; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBazooka_activated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBazooka_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.stackTagCompound == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.stackTagCompound; + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + this.setActivated(par1ItemStack, !getActivated(par1ItemStack)); + par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100); + return par1ItemStack; + } + + if (!getActivated(par1ItemStack)) + { + return par1ItemStack; + } + + if (this.getDelay(par1ItemStack) > 0) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + this.syphonBatteries(par1ItemStack, par3EntityPlayer, this.getEnergyUsed()); + } + + par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!par2World.isRemote) + { + //par2World.spawnEntityInWorld(new EntityEnergyBazookaMainProjectile(par2World, par3EntityPlayer, damage)); + par2World.spawnEntityInWorld(new EntityEnergyBazookaMainProjectile(par2World, par3EntityPlayer, damage)); + this.setDelay(par1ItemStack, maxDelay); + } + + Vec3 vec = par3EntityPlayer.getLookVec(); + double wantedVelocity = 3.0f; + par3EntityPlayer.motionX = -vec.xCoord * wantedVelocity; + par3EntityPlayer.motionY = -vec.yCoord * wantedVelocity; + par3EntityPlayer.motionZ = -vec.zCoord * wantedVelocity; + par2World.playSoundEffect((double) ((float) par3EntityPlayer.posX + 0.5F), (double) ((float) par3EntityPlayer.posY + 0.5F), (double) ((float) par3EntityPlayer.posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (par2World.rand.nextFloat() - par2World.rand.nextFloat()) * 0.8F); + par3EntityPlayer.fallDistance = 0; + return par1ItemStack; + } + + @Override + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) + { + if (!(par3Entity instanceof EntityPlayer)) + { + return; + } + + EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + +// if(par1ItemStack.stackTagCompound.getBoolean("isActive")) +// { +// EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 1); +// } + int delay = this.getDelay(par1ItemStack); + + if (!par2World.isRemote && delay > 0) + { + this.setDelay(par1ItemStack, delay - 1); + } + + if (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50); + } + } + + par1ItemStack.setItemDamage(0); + return; + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Boom."); + + if (!(par1ItemStack.stackTagCompound == null)) + { + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + par3List.add("Activated"); + } else + { + par3List.add("Deactivated"); + } + + if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + } + + public void setActivated(ItemStack par1ItemStack, boolean newActivated) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + itemTag.setBoolean("isActive", newActivated); + } + + public boolean getActivated(ItemStack par1ItemStack) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + return itemTag.getBoolean("isActive"); + } + + public void setDelay(ItemStack par1ItemStack, int newDelay) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + itemTag.setInteger("delay", newDelay); + } + + public int getDelay(ItemStack par1ItemStack) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + return itemTag.getInteger("delay"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EnergyBlast.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EnergyBlast.java new file mode 100644 index 00000000..298c950d --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EnergyBlast.java @@ -0,0 +1,214 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class EnergyBlast extends EnergyItems +{ + private static IIcon activeIcon; + private static IIcon passiveIcon; + private static int damage; + //private static int delay; + private static final int maxDelay = 15; + + public EnergyBlast() + { + super(); + setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setUnlocalizedName("energyBlaster"); + setFull3D(); + setMaxDamage(250); + this.setEnergyUsed(150); + damage = 12; + //delay = 0; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBlaster_activated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBlaster_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.stackTagCompound == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.stackTagCompound; + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + this.setActivated(par1ItemStack, !getActivated(par1ItemStack)); + par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100); + return par1ItemStack; + } + + if (!getActivated(par1ItemStack)) + { + return par1ItemStack; + } + + if (this.getDelay(par1ItemStack) > 0) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + this.syphonBatteries(par1ItemStack, par3EntityPlayer, this.getEnergyUsed()); + } + + par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!par2World.isRemote) + { + //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); + par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); + this.setDelay(par1ItemStack, maxDelay); + } + + return par1ItemStack; + } + + @Override + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) + { + if (!(par3Entity instanceof EntityPlayer)) + { + return; + } + + EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + +// if(par1ItemStack.stackTagCompound.getBoolean("isActive")) +// { +// EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 1); +// } + int delay = this.getDelay(par1ItemStack); + + if (!par2World.isRemote && delay > 0) + { + this.setDelay(par1ItemStack, delay - 1); + } + + if (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50); + } + } + + par1ItemStack.setItemDamage(0); + return; + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Used to fire devastating"); + par3List.add("projectiles."); + par3List.add("Damage: " + damage); + + if (!(par1ItemStack.stackTagCompound == null)) + { + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + par3List.add("Activated"); + } else + { + par3List.add("Deactivated"); + } + + if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + } + + public void setActivated(ItemStack par1ItemStack, boolean newActivated) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + itemTag.setBoolean("isActive", newActivated); + } + + public boolean getActivated(ItemStack par1ItemStack) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + return itemTag.getBoolean("isActive"); + } + + public void setDelay(ItemStack par1ItemStack, int newDelay) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + itemTag.setInteger("delay", newDelay); + } + + public int getDelay(ItemStack par1ItemStack) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + return itemTag.getInteger("delay"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EnergyItems.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EnergyItems.java new file mode 100644 index 00000000..c01c414d --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EnergyItems.java @@ -0,0 +1,388 @@ +package WayofTime.alchemicalWizardry.common.items; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.IBindable; +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; + +public class EnergyItems extends Item implements IBindable +{ + private int energyUsed; + + public EnergyItems() + { + super(); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + protected void setEnergyUsed(int par1int) + { + this.energyUsed = par1int; + } + + protected int getEnergyUsed() + { + return this.energyUsed; + } + //Heals the player using the item. If the player is at full health, or if the durability cannot be used any more, + //the item is not used. + + protected void damagePlayer(World world, EntityPlayer player, int damage) + { + if (world != null) + { + double posX = player.posX; + double posY = player.posY; + double posZ = player.posZ; + world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); + float f = (float) 1.0F; + float f1 = f * 0.6F + 0.4F; + float f2 = f * f * 0.7F - 0.5F; + float f3 = f * f * 0.6F - 0.7F; + + for (int l = 0; l < 8; ++l) + { + world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); + } + } + + for (int i = 0; i < damage; i++) + { + //player.setEntityHealth((player.getHealth()-1)); + player.setHealth((player.getHealth() - 1)); + + if (player.getHealth() <= 0) + { + player.inventory.dropAllItems(); + } + } + } + +// public static boolean syphonBatteriesWithoutParticles(ItemStack ist, EntityPlayer player, int damageToBeDone, boolean particles) +// { +// if (!player.capabilities.isCreativeMode) +// { +// NBTTagCompound itemTag = ist.stackTagCompound; +// +// if (itemTag == null || itemTag.getString("ownerName").equals("")) +// { +// return false; +// } +// +// World world = player.worldObj; +// +// if (world != null) +// { +// double posX = player.posX; +// double posY = player.posY; +// double posZ = player.posZ; +// +// if (particles) +// { +// SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ); +// world.playSoundEffect((double) ((float) player.posX + 0.5F), (double) ((float) player.posY + 0.5F), (double) ((float) player.posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); +// } +// } +// +// if (!player.worldObj.isRemote) +// { +// return false; +// } +// +// PacketDispatcher.sendPacketToServer(PacketHandler.getPacket(itemTag.getString("ownerName"), -damageToBeDone, 0)); +// return true; +// } else +// { +// return true; +// } +// } + + public static boolean syphonBatteries(ItemStack ist, EntityPlayer player, int damageToBeDone) + { + if (!player.worldObj.isRemote) + { + return syphonAndDamageWhileInContainer(ist, player, damageToBeDone); + } else + { + World world = player.worldObj; + + if (world != null) + { + double posX = player.posX; + double posY = player.posY; + double posZ = player.posZ; + //if(particles) + { + SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ); + world.playSoundEffect((double) ((float) player.posX + 0.5F), (double) ((float) player.posY + 0.5F), (double) ((float) player.posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); + } + } + } + + return true; + //return syphonBatteriesWithoutParticles(ist, player, damageToBeDone, true); + } + + public static boolean syphonWhileInContainer(ItemStack ist, int damageToBeDone) + { + if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals(""))) + { + String ownerName = ist.getTagCompound().getString("ownerName"); + + if (MinecraftServer.getServer() == null) + { + return false; + } + + World world = MinecraftServer.getServer().worldServers[0]; + LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); + + if (data == null) + { + data = new LifeEssenceNetwork(ownerName); + world.setItemData(ownerName, data); + } + + if (data.currentEssence >= damageToBeDone) + { + data.currentEssence -= damageToBeDone; + data.markDirty(); + return true; + } + +// EntityPlayer ownerEntity = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(ist.getTagCompound().getString("ownerName")); +// if(ownerEntity==null){return false;} +// NBTTagCompound tag = ownerEntity.getEntityData(); +// int currentEssence = tag.getInteger("currentEssence"); +// if(currentEssence>=damageToBeDone) +// { +// tag.setInteger("currentEssence", currentEssence-damageToBeDone); +// return true; +// } + } + + return false; + } + + public static boolean canSyphonInContainer(ItemStack ist, int damageToBeDone) + { + if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals(""))) + { + String ownerName = ist.getTagCompound().getString("ownerName"); + + if (MinecraftServer.getServer() == null) + { + return false; + } + + World world = MinecraftServer.getServer().worldServers[0]; + LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); + + if (data == null) + { + data = new LifeEssenceNetwork(ownerName); + world.setItemData(ownerName, data); + } + + return data.currentEssence >= damageToBeDone; +// EntityPlayer ownerEntity = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(ist.getTagCompound().getString("ownerName")); +// if(ownerEntity==null){return false;} +// NBTTagCompound tag = ownerEntity.getEntityData(); +// int currentEssence = tag.getInteger("currentEssence"); +// if(currentEssence>=damageToBeDone) +// { +// tag.setInteger("currentEssence", currentEssence-damageToBeDone); +// return true; +// } + } + + return false; + } + + public static void hurtPlayer(EntityPlayer user, int energySyphoned) + { + if (energySyphoned < 100 && energySyphoned > 0) + { + if (!user.capabilities.isCreativeMode) + { + //player.setEntityHealth((player.getHealth()-1)); + user.setHealth((user.getHealth() - 1)); + + if (user.getHealth() <= 0.1f) + { + user.onDeath(DamageSource.generic); + } + } + } else if (energySyphoned >= 100) + { + if (!user.capabilities.isCreativeMode) + { + for (int i = 0; i < ((energySyphoned + 99) / 100); i++) + { + //player.setEntityHealth((player.getHealth()-1)); + user.setHealth((user.getHealth() - 1)); + + if (user.getHealth() <= 0.1f) + { + user.onDeath(DamageSource.generic); + } + } + } + } + } + + public static boolean syphonAndDamageWhileInContainer(ItemStack ist, EntityPlayer player, int damageToBeDone) + { + if (!syphonWhileInContainer(ist, damageToBeDone)) + { + hurtPlayer(player, damageToBeDone); + } + + return true; + } + + //Global static methods + public static void checkAndSetItemOwner(ItemStack item, EntityPlayer player) + { + if (item.stackTagCompound == null) + { + item.setTagCompound(new NBTTagCompound()); + } + + if (item.stackTagCompound.getString("ownerName").equals("")) + { + item.stackTagCompound.setString("ownerName", SpellHelper.getUsername(player)); + } + + initializePlayer(player); + } + + public static void checkAndSetItemOwner(ItemStack item, String ownerName) + { + if (item.stackTagCompound == null) + { + item.setTagCompound(new NBTTagCompound()); + } + + if (item.stackTagCompound.getString("ownerName").equals("")) + { + item.stackTagCompound.setString("ownerName", ownerName); + } + } + + public static void initializePlayer(EntityPlayer player) + { + NBTTagCompound tag = player.getEntityData(); + + if (tag.getInteger("currentEssence") == 0) + { + tag.setInteger("currentEssence", 0); + } + } + + public String getOwnerName(ItemStack item) + { + if (item.stackTagCompound == null) + { + item.setTagCompound(new NBTTagCompound()); + } + + return item.stackTagCompound.getString("ownerName"); + } + + public static void drainPlayerNetwork(EntityPlayer player, int damageToBeDone) + { + String ownerName = SpellHelper.getUsername(player); + + if (MinecraftServer.getServer() == null) + { + // + } + + World world = MinecraftServer.getServer().worldServers[0]; + LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); + + if (data == null) + { + data = new LifeEssenceNetwork(ownerName); + world.setItemData(ownerName, data); + } + + if (data.currentEssence >= damageToBeDone) + { + data.currentEssence -= damageToBeDone; + data.markDirty(); + }else + { + hurtPlayer(player, damageToBeDone); + } + } + + public static int getCurrentEssence(String ownerName) + { + if (MinecraftServer.getServer() == null) + { + return 0; + } + + World world = MinecraftServer.getServer().worldServers[0]; + LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); + + if (data == null) + { + data = new LifeEssenceNetwork(ownerName); + world.setItemData(ownerName, data); + } + + return data.currentEssence; + } + + public static void setCurrentEssence(String ownerName, int amount) + { + if (MinecraftServer.getServer() == null) + { + return; + } + + World world = MinecraftServer.getServer().worldServers[0]; + LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); + + if (data == null) + { + data = new LifeEssenceNetwork(ownerName); + world.setItemData(ownerName, data); + } + + data.currentEssence = amount; + data.markDirty(); + } + + public static void addEssenceToMaximum(String ownerName, int amount, int maximum) + { + if (MinecraftServer.getServer() == null) + { + return; + } + + World world = MinecraftServer.getServer().worldServers[0]; + LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); + + if (data == null) + { + data = new LifeEssenceNetwork(ownerName); + world.setItemData(ownerName, data); + } + + data.currentEssence = Math.min(maximum, data.currentEssence + amount); + data.markDirty(); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EnergySword.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EnergySword.java new file mode 100644 index 00000000..a4578599 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EnergySword.java @@ -0,0 +1,238 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class EnergySword extends ItemSword +{ + //private float weaponDamaged; + //private int maxMode = 3; + private NBTTagCompound data; + + private static IIcon activeIcon; + private static IIcon passiveIcon; + + private int energyUsed; + + public EnergySword() + { + super(AlchemicalWizardry.bloodBoundToolMaterial); + this.maxStackSize = 1; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setEnergyUsed(50); + setFull3D(); + setMaxDamage(100); + //weaponDamaged = 12.0F; + } + + public void setEnergyUsed(int i) + { + energyUsed = i; + } + + public int getEnergyUsed() + { + return this.energyUsed; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundSword_activated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundSword_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.stackTagCompound == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.stackTagCompound; + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) + { + return !getActivated(stack); + } + + @Override + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) + { + if (par3EntityLivingBase instanceof EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, (EntityPlayer) par3EntityLivingBase); + + if (!EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3EntityLivingBase, this.getEnergyUsed())) + { + //this.damagePlayer(null, (EntityPlayer)par3EntityLivingBase, (this.getEnergyUsed() + 99) / 100); + } + } + + par2EntityLivingBase.addPotionEffect(new PotionEffect(Potion.weakness.id, 60, 2)); + return true; + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + this.setActivated(par1ItemStack, !getActivated(par1ItemStack)); + par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100); + return par1ItemStack; + } + + if (!getActivated(par1ItemStack)) + { + return par1ItemStack; + } + + return par1ItemStack; + } + + @Override + public int getItemEnchantability() + { + return 30; + } + + @Override + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) + { + if (!(par3Entity instanceof EntityPlayer)) + { + return; + } + + EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + +// if(par1ItemStack.stackTagCompound.getBoolean("isActive")) +// { +// EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 1); +// } + + if (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50); + } + } + + par1ItemStack.setItemDamage(0); + return; + } + + public void setActivated(ItemStack par1ItemStack, boolean newActivated) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + itemTag.setBoolean("isActive", newActivated); + } + + public boolean getActivated(ItemStack par1ItemStack) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + return itemTag.getBoolean("isActive"); + } + +// public int getDamageVsEntity(Entity par1Entity) +// { +// return (int) this.weaponDamage; +// } + + public float func_82803_g() + { + return 4.0F; + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Caution: may cause"); + par3List.add("a bad day..."); + + if (!(par1ItemStack.stackTagCompound == null)) + { + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + par3List.add("Activated"); + } else + { + par3List.add("Deactivated"); + } + + if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + } + + @Override + public float func_150893_a(ItemStack par1ItemStack, Block par2Block) + { + if (par2Block == Blocks.web) + { + return 15.0F; + } else + { + Material material = par2Block.getMaterial(); + return material != Material.plants && material != Material.vine && material != Material.coral && material != Material.leaves && material != Material.gourd ? 1.0F : 1.5F; + } + } + +// public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) +// { +// return false; +// } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EnhancedTelepositionFocus.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EnhancedTelepositionFocus.java new file mode 100644 index 00000000..4753fc05 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/EnhancedTelepositionFocus.java @@ -0,0 +1,46 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class EnhancedTelepositionFocus extends TelepositionFocus +{ + public EnhancedTelepositionFocus() + { + super(2); + // TODO Auto-generated constructor stub + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + //TODO + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnhancedTeleposerFocus"); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("A focus further enhanced in an altar"); + + if (!(par1ItemStack.stackTagCompound == null)) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + + par3List.add("Coords: " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord")); + par3List.add("Bound Dimension: " + getDimensionID(par1ItemStack)); + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/FireScribeTool.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/FireScribeTool.java new file mode 100644 index 00000000..18fc3a52 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/FireScribeTool.java @@ -0,0 +1,20 @@ +package WayofTime.alchemicalWizardry.common.items; + +import net.minecraft.client.renderer.texture.IIconRegister; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class FireScribeTool extends ScribeTool +{ + public FireScribeTool() + { + super(2); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:FireScribeTool"); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemBloodRuneBlock.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemBloodRuneBlock.java new file mode 100644 index 00000000..420cc8c5 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemBloodRuneBlock.java @@ -0,0 +1,59 @@ +package WayofTime.alchemicalWizardry.common.items; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemBloodRuneBlock extends ItemBlock + +{ + public ItemBloodRuneBlock(Block block) + { + super(block); + setHasSubtypes(true); +// this.setUnlocalizedName("itemBloodRuneBlock"); +// setCreativeTab(AlchemicalWizardry.tabBloodMagic); + + } + + public String getUnlocalizedName(ItemStack itemstack) + + { + String name = ""; + + switch (itemstack.getItemDamage()) + { + case 0: + { + name = "blank"; + break; + } + + case 1: + { + name = "fill"; + break; + } + + case 2: + name = "empty"; + break; + + case 3: + name = "test"; + break; + + default: + name = "broken"; + } + + return getUnlocalizedName() + "." + name; + } + + public int getMetadata(int par1) + + { + return par1; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemComplexSpellCrystal.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemComplexSpellCrystal.java new file mode 100644 index 00000000..f5cc3455 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemComplexSpellCrystal.java @@ -0,0 +1,108 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemComplexSpellCrystal extends EnergyItems +{ + public ItemComplexSpellCrystal() + { + super(); + this.setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BlankSpell"); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Crystal of infinite possibilities."); + + if (!(par1ItemStack.stackTagCompound == null)) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + + par3List.add("Coords: " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord")); + par3List.add("Bound Dimension: " + getDimensionID(par1ItemStack)); + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par2World.isRemote) + { + //World world = MinecraftServer.getServer().worldServers[getDimensionID(par1ItemStack)]; + World world = DimensionManager.getWorld(getDimensionID(par1ItemStack)); + + if (world != null) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + TileEntity tileEntity = world.getTileEntity(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord")); + + if (tileEntity instanceof TESpellParadigmBlock) + { + TESpellParadigmBlock tileParad = (TESpellParadigmBlock) tileEntity; + + tileParad.castSpell(par2World, par3EntityPlayer, par1ItemStack); + } else + { + return par1ItemStack; + } + } else + { + return par1ItemStack; + } + } else + { + return par1ItemStack; + } + + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); +// if (!par2World.isRemote) +// { +// //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); +// par2World.spawnEntityInWorld(new FireProjectile(par2World, par3EntityPlayer, 10)); +// } + return par1ItemStack; + } + + public int getDimensionID(ItemStack itemStack) + { + if (itemStack.stackTagCompound == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + return itemStack.stackTagCompound.getInteger("dimensionId"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemDiabloKey.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemDiabloKey.java new file mode 100644 index 00000000..b4d5b989 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemDiabloKey.java @@ -0,0 +1,128 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import net.minecraftforge.common.util.FakePlayer; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.IBindable; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemDiabloKey extends EnergyItems +{ + public ItemDiabloKey() + { + super(); + DamageSource damageSource = DamageSource.generic; + setMaxStackSize(1); + //setMaxDamage(damage); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setEnergyUsed(1000); + this.hasSubtypes = true; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DiabloKey"); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Binds other items to the owner's network"); + + //par3List.add("LP: " + (this.getMaxDamage() - this.getDamage(par1ItemStack))); + if (!(par1ItemStack.stackTagCompound == null)) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + + //par3List.add("LP: " + par2EntityPlayer.getEntityData().getInteger("currentEssence")); + } + + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + World world = par3EntityPlayer.worldObj; + + if (par3EntityPlayer instanceof FakePlayer || par3EntityPlayer instanceof EntityPlayerMP) + { + return par1ItemStack; + } + + if (world != null) + { + double posX = par3EntityPlayer.posX; + double posY = par3EntityPlayer.posY; + double posZ = par3EntityPlayer.posZ; + world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); + SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ); + } + + if (!par3EntityPlayer.worldObj.isRemote && !(par3EntityPlayer.getClass().equals(EntityPlayerMP.class))) + { + return par1ItemStack; + } + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null || itemTag.getString("ownerName").equals("")) + { + return par1ItemStack; + } + + String ownerName = itemTag.getString("ownerName"); + ItemStack[] inv = par3EntityPlayer.inventory.mainInventory; + + for (ItemStack itemStack : inv) + { + if (itemStack == null) + { + continue; + } + + Item item = itemStack.getItem(); + + if (item instanceof ItemDiabloKey) + { + continue; + } + + if (item instanceof IBindable) + { + EnergyItems.checkAndSetItemOwner(itemStack, ownerName); + } + } + + return par1ItemStack; + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item id, CreativeTabs creativeTab, List list) + { + list.add(new ItemStack(ModItems.itemKeyOfDiablo)); + ItemStack boundKey = new ItemStack(ModItems.itemKeyOfDiablo); + EnergyItems.checkAndSetItemOwner(boundKey, "Server-wide Soul Network"); + list.add(boundKey); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDiviner.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDiviner.java new file mode 100644 index 00000000..b3cf576c --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDiviner.java @@ -0,0 +1,301 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.rituals.RitualComponent; +import WayofTime.alchemicalWizardry.common.rituals.Rituals; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemRitualDiviner extends EnergyItems +{ + private int maxMetaData; + + public ItemRitualDiviner() + { + super(); + this.maxStackSize = 1; + setEnergyUsed(100); + this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.maxMetaData = 4; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:RitualDiviner"); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Used to explore new types of rituals"); + + if (this.getMaxRuneDisplacement(par1ItemStack) == 1) + { + par3List.add("Can place Dusk runes"); + } else + { + par3List.add("Can not place Dusk runes"); + } + + if (!(par1ItemStack.stackTagCompound == null)) + { + int ritualID = this.getCurrentRitual(par1ItemStack); + //TODO + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + par3List.add("RitualID: " + (ritualID + 1)); + List ritualList = Rituals.getRitualList(this.getCurrentRitual(par1ItemStack) + 1); + int blankStones = 0; + int airStones = 0; + int waterStones = 0; + int fireStones = 0; + int earthStones = 0; + int duskStones = 0; + + for (RitualComponent rc : ritualList) + { + switch (rc.getStoneType()) + { + case RitualComponent.BLANK: + blankStones++; + break; + + case RitualComponent.AIR: + airStones++; + break; + + case RitualComponent.WATER: + waterStones++; + break; + + case RitualComponent.FIRE: + fireStones++; + break; + + case RitualComponent.EARTH: + earthStones++; + break; + + case RitualComponent.DUSK: + duskStones++; + break; + } + } + + par3List.add("Blank stones: " + blankStones); + par3List.add(EnumChatFormatting.AQUA + "Air stones: " + airStones); + par3List.add(EnumChatFormatting.BLUE + "Water stones: " + waterStones); + par3List.add(EnumChatFormatting.RED + "Fire stones: " + fireStones); + par3List.add(EnumChatFormatting.DARK_GREEN + "Earth stones: " + earthStones); + par3List.add(EnumChatFormatting.BOLD + "Dusk stones: " + duskStones); + //par3List.add("Ritual Name: " + Rituals.getNameOfRitual(ritualID)); + } + } + + @Override + public String getItemStackDisplayName(ItemStack par1ItemStack) + { + if (!(par1ItemStack.stackTagCompound == null)) + { + int ritualID = this.getCurrentRitual(par1ItemStack); + return "Ritual: " + Rituals.getNameOfRitual(ritualID); + //par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } else + { + return super.getItemStackDisplayName(par1ItemStack); + } + } + + @Override + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer); + ItemStack[] playerInventory = par2EntityPlayer.inventory.mainInventory; + TileEntity tileEntity = par3World.getTileEntity(par4, par5, par6); + + if (tileEntity instanceof TEMasterStone) + { + TEMasterStone masterStone = (TEMasterStone) tileEntity; + List ritualList = Rituals.getRitualList(this.getCurrentRitual(par1ItemStack) + 1); + int playerInvRitualStoneLocation = -1; + + for (int i = 0; i < playerInventory.length; i++) + { + if (playerInventory[i] == null) + { + continue; + } + + if (new ItemStack(ModBlocks.ritualStone).isItemEqual(playerInventory[i])) + { + playerInvRitualStoneLocation = i; + break; + } + } + + for (RitualComponent rc : ritualList) + { + if (par3World.isAirBlock(par4 + rc.getX(), par5 + rc.getY(), par6 + rc.getZ())) + { + if (playerInvRitualStoneLocation >= 0) + { + if (rc.getStoneType() > this.maxMetaData + this.getMaxRuneDisplacement(par1ItemStack)) + { + par3World.playAuxSFX(200, par4, par5 + 1, par6, 0); + return true; + } + + if (!par2EntityPlayer.capabilities.isCreativeMode) + { + par2EntityPlayer.inventory.decrStackSize(playerInvRitualStoneLocation, 1); + } + + par3World.setBlock(par4 + rc.getX(), par5 + rc.getY(), par6 + rc.getZ(), ModBlocks.ritualStone, rc.getStoneType(), 3); + + if (par3World.isRemote) + { + par3World.playAuxSFX(2005, par4, par5 + 1, par6, 0); + EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed()); + return true; + } + + return true; + } + } else + { + Block block = par3World.getBlock(par4 + rc.getX(), par5 + rc.getY(), par6 + rc.getZ()); + + if (block == ModBlocks.ritualStone) + { + int metadata = par3World.getBlockMetadata(par4 + rc.getX(), par5 + rc.getY(), par6 + rc.getZ()); + + if (metadata != rc.getStoneType()) + { + if (rc.getStoneType() > this.maxMetaData + this.getMaxRuneDisplacement(par1ItemStack)) + { + par3World.playAuxSFX(200, par4, par5 + 1, par6, 0); + return true; + } + + par3World.setBlockMetadataWithNotify(par4 + rc.getX(), par5 + rc.getY(), par6 + rc.getZ(), rc.getStoneType(), 3); + EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed()); + return true; + } + } else + { + par3World.playAuxSFX(0000, par4, par5 + 1, par6, 0); + return true; + } + } + } + +// if (par3World.isRemote) +// { +// par3World.playAuxSFX(2005, par4, par5, par6, 0); +// EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed()); +// return true; +// } +// return true; + } + + return false; + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + int maxRitualID = Rituals.getNumberOfRituals(); + int currentRitualID = this.getCurrentRitual(par1ItemStack); + + if (currentRitualID + 1 >= maxRitualID) + { + this.setCurrentRitual(par1ItemStack, 0); + } else + { + this.setCurrentRitual(par1ItemStack, currentRitualID + 1); + } + + if (par2World.isRemote) + { + IChatComponent chatmessagecomponent = new ChatComponentText("Current Ritual: " + Rituals.getNameOfRitual(this.getCurrentRitual(par1ItemStack))); + //chatmessagecomponent.func_111072_b("Current Essence: " + data.currentEssence + "LP"); + //chatmessagecomponent.addText("Current Ritual: " + Rituals.getNameOfRitual(this.getCurrentRitual(par1ItemStack))); + par3EntityPlayer.addChatComponentMessage(chatmessagecomponent); + } + } + + return par1ItemStack; + } + + public int getCurrentRitual(ItemStack par1ItemStack) + { + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + return par1ItemStack.stackTagCompound.getInteger("ritualID"); + } + + public void setCurrentRitual(ItemStack par1ItemStack, int ritualID) + { + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + par1ItemStack.stackTagCompound.setInteger("ritualID", ritualID); + } + + public int getMaxRuneDisplacement(ItemStack par1ItemStack) //0 indicates the starting 4 runes, 1 indicates it can use Dusk runes + { + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + return par1ItemStack.stackTagCompound.getInteger("maxRuneDisplacement"); + } + + public void setMaxRuneDisplacement(ItemStack par1ItemStack, int displacement) + { + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + par1ItemStack.stackTagCompound.setInteger("maxRuneDisplacement", displacement); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item id, CreativeTabs creativeTab, List list) + { + list.add(new ItemStack(ModItems.itemRitualDiviner)); + ItemStack duskRitualDivinerStack = new ItemStack(ModItems.itemRitualDiviner); + ((ItemRitualDiviner) duskRitualDivinerStack.getItem()).setMaxRuneDisplacement(duskRitualDivinerStack, 1); + list.add(duskRitualDivinerStack); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEffectBlock.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEffectBlock.java new file mode 100644 index 00000000..5b06e576 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEffectBlock.java @@ -0,0 +1,59 @@ +package WayofTime.alchemicalWizardry.common.items; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemSpellEffectBlock extends ItemBlock + +{ + public ItemSpellEffectBlock(Block par1) + { + super(par1); + setHasSubtypes(true); +// this.setUnlocalizedName("itemSpellEffectBlock"); +// setCreativeTab(AlchemicalWizardry.tabBloodMagic); + + } + + public String getUnlocalizedName(ItemStack itemstack) + + { + String name = ""; + + switch (itemstack.getItemDamage()) + { + case 0: + { + name = "fire"; + break; + } + + case 1: + { + name = "ice"; + break; + } + + case 2: + name = "wind"; + break; + + case 3: + name = "water"; + break; + + default: + name = "broken"; + } + + return getUnlocalizedName() + "." + name; + } + + public int getMetadata(int par1) + + { + return par1; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEnhancementBlock.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEnhancementBlock.java new file mode 100644 index 00000000..670cbce8 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemSpellEnhancementBlock.java @@ -0,0 +1,99 @@ +package WayofTime.alchemicalWizardry.common.items; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemSpellEnhancementBlock extends ItemBlock + +{ + public ItemSpellEnhancementBlock(Block par1) + { + super(par1); + setHasSubtypes(true); +// this.setUnlocalizedName("itemSpellEnhancementBlock"); +// setCreativeTab(AlchemicalWizardry.tabBloodMagic); + + } + + public String getUnlocalizedName(ItemStack itemstack) + + { + String name = ""; + + switch (itemstack.getItemDamage()) + { + case 0: + name = "power1"; + break; + + case 1: + name = "power2"; + break; + + case 2: + name = "power3"; + break; + + case 3: + name = "power4"; + break; + + case 4: + name = "power5"; + break; + + case 5: + name = "cost1"; + break; + + case 6: + name = "cost2"; + break; + + case 7: + name = "cost3"; + break; + + case 8: + name = "cost4"; + break; + + case 9: + name = "cost5"; + break; + + case 10: + name = "potency1"; + break; + + case 11: + name = "potency2"; + break; + + case 12: + name = "potency3"; + break; + + case 13: + name = "potency4"; + break; + + case 14: + name = "potency5"; + break; + + default: + name = "broken"; + } + + return getUnlocalizedName() + "." + name; + } + + public int getMetadata(int par1) + + { + return par1; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemSpellModifierBlock.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemSpellModifierBlock.java new file mode 100644 index 00000000..5be244a4 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemSpellModifierBlock.java @@ -0,0 +1,55 @@ +package WayofTime.alchemicalWizardry.common.items; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemSpellModifierBlock extends ItemBlock + +{ + public ItemSpellModifierBlock(Block par1) + { + super(par1); + setHasSubtypes(true); +// this.setUnlocalizedName("itemSpellModifierBlock"); +// setCreativeTab(AlchemicalWizardry.tabBloodMagic); + + } + + public String getUnlocalizedName(ItemStack itemstack) + + { + String name = ""; + + switch (itemstack.getItemDamage()) + { + case 0: + { + name = "power"; + break; + } + + case 1: + { + name = "efficiency"; + break; + } + + case 2: + name = "potency"; + break; + + default: + name = "broken"; + } + + return getUnlocalizedName() + "." + name; + } + + public int getMetadata(int par1) + + { + return par1; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemSpellParadigmBlock.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemSpellParadigmBlock.java new file mode 100644 index 00000000..44cb8e57 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ItemSpellParadigmBlock.java @@ -0,0 +1,54 @@ +package WayofTime.alchemicalWizardry.common.items; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemSpellParadigmBlock extends ItemBlock + +{ + public ItemSpellParadigmBlock(Block par1) + { + super(par1); + setHasSubtypes(true); + //this.setUnlocalizedName("itemSpellParadigmBlock"); + } + + @Override + public String getUnlocalizedName(ItemStack itemstack) + + { + String name = ""; + + switch (itemstack.getItemDamage()) + { + case 0: + { + name = "projectile"; + break; + } + + case 1: + { + name = "self"; + break; + } + + case 2: + name = "melee"; + break; + + default: + name = "broken"; + } + + return getUnlocalizedName() + "." + name; + } + + @Override + public int getMetadata(int par1) + { + return par1; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/LavaCrystal.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/LavaCrystal.java new file mode 100644 index 00000000..d6159472 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/LavaCrystal.java @@ -0,0 +1,114 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class LavaCrystal extends EnergyItems +{ + public LavaCrystal() + { + super(); + //setMaxDamage(1000); + setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setUnlocalizedName("lavaCrystal"); + setEnergyUsed(25); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:LavaCrystal"); + } + + /* + * Used to have the item contain itself. + */ + @Override + public ItemStack getContainerItem(ItemStack itemStack) + { + //if(!syphonBatteries(itemStack, null, 10)) + { + syphonWhileInContainer(itemStack, this.getEnergyUsed()); + ItemStack copiedStack = itemStack.copy(); + copiedStack.setItemDamage(copiedStack.getItemDamage()); + copiedStack.stackSize = 1; + return copiedStack; + } + //return itemStack; + } + + @Override + public boolean hasContainerItem() + { + return true; + } + + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + int damage = this.getDamage(par1ItemStack); + return par1ItemStack; + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Store life to smelt"); + par3List.add("stuff in the furnace."); + + if (!(par1ItemStack.stackTagCompound == null)) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + public boolean hasEnoughEssence(ItemStack itemStack) + { + if (itemStack.getTagCompound() != null && !(itemStack.getTagCompound().getString("ownerName").equals(""))) + { + String ownerName = itemStack.getTagCompound().getString("ownerName"); + + if (MinecraftServer.getServer() == null) + { + return false; + } + + World world = MinecraftServer.getServer().worldServers[0]; + LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); + + if (data == null) + { + data = new LifeEssenceNetwork(ownerName); + world.setItemData(ownerName, data); + } + + if (data.currentEssence >= this.getEnergyUsed()) + { + return true; + } + +// EntityPlayer ownerEntity = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(ist.getTagCompound().getString("ownerName")); +// if(ownerEntity==null){return false;} +// NBTTagCompound tag = ownerEntity.getEntityData(); +// int currentEssence = tag.getInteger("currentEssence"); +// if(currentEssence>=damageToBeDone) +// { +// tag.setInteger("currentEssence", currentEssence-damageToBeDone); +// return true; +// } + } + + return false; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/LifeBucket.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/LifeBucket.java new file mode 100644 index 00000000..80a29ed3 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/LifeBucket.java @@ -0,0 +1,23 @@ +package WayofTime.alchemicalWizardry.common.items; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.ItemBucket; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class LifeBucket extends ItemBucket +{ + public LifeBucket(Block block) + { + super(block); + // TODO Auto-generated constructor stub + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:LifeBucket"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/MagicianBloodOrb.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/MagicianBloodOrb.java new file mode 100644 index 00000000..e6081180 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/MagicianBloodOrb.java @@ -0,0 +1,21 @@ +package WayofTime.alchemicalWizardry.common.items; + +import net.minecraft.client.renderer.texture.IIconRegister; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class MagicianBloodOrb extends EnergyBattery +{ + public MagicianBloodOrb(int damage) + { + super(damage); + orbLevel = 3; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MagicianBloodOrb"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/MasterBloodOrb.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/MasterBloodOrb.java new file mode 100644 index 00000000..5e9c19c7 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/MasterBloodOrb.java @@ -0,0 +1,21 @@ +package WayofTime.alchemicalWizardry.common.items; + +import net.minecraft.client.renderer.texture.IIconRegister; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class MasterBloodOrb extends EnergyBattery +{ + public MasterBloodOrb(int damage) + { + super(damage); + orbLevel = 4; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MasterBloodOrb"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/OrbOfTesting.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/OrbOfTesting.java new file mode 100644 index 00000000..06482ac3 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/OrbOfTesting.java @@ -0,0 +1,47 @@ +package WayofTime.alchemicalWizardry.common.items; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class OrbOfTesting extends EnergyItems +{ + public OrbOfTesting() + { + super(); + setMaxStackSize(1); + setCreativeTab(CreativeTabs.tabMisc); + setUnlocalizedName("orbOfTesting"); + setMaxDamage(100); + setFull3D(); + this.setEnergyUsed(100); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Untitled"); + } + + //Heals the player using the item. If the player is at full health, or if the durability cannot be used any more, + //the item is not used. + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (!par3EntityPlayer.shouldHeal()) + { + return par1ItemStack; + } + + if (this.syphonBatteries(par1ItemStack, par3EntityPlayer, this.getEnergyUsed())) + { + par3EntityPlayer.heal(1); + } + + return par1ItemStack; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ReinforcedTelepositionFocus.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ReinforcedTelepositionFocus.java new file mode 100644 index 00000000..37134dbc --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ReinforcedTelepositionFocus.java @@ -0,0 +1,47 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ReinforcedTelepositionFocus extends TelepositionFocus +{ + public ReinforcedTelepositionFocus() + { + super(3); + // TODO Auto-generated constructor stub + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + //TODO + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ReinforcedTeleposerFocus"); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("A stronger version of the focus,"); + par3List.add("using a weak shard"); + + if (!(par1ItemStack.stackTagCompound == null)) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + + par3List.add("Coords: " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord")); + par3List.add("Bound Dimension: " + getDimensionID(par1ItemStack)); + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/SacrificialDagger.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/SacrificialDagger.java new file mode 100644 index 00000000..3c280fb4 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/SacrificialDagger.java @@ -0,0 +1,137 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import net.minecraftforge.common.util.FakePlayer; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SacrificialDagger extends Item +{ + public SacrificialDagger() + { + super(); + this.maxStackSize = 1; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setFull3D(); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("alchemicalwizardry:SacrificialDagger"); + } + + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Just a prick of the"); + par3List.add("finger will suffice..."); + } + + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + par3EntityPlayer.setHealth(par3EntityPlayer.getHealth() - 2); + } + + if (par3EntityPlayer instanceof FakePlayer) + { + return par1ItemStack; + } + + double posX = par3EntityPlayer.posX; + double posY = par3EntityPlayer.posY; + double posZ = par3EntityPlayer.posZ; + par2World.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (par2World.rand.nextFloat() - par2World.rand.nextFloat()) * 0.8F); + float f = (float) 1.0F; + float f1 = f * 0.6F + 0.4F; + float f2 = f * f * 0.7F - 0.5F; + float f3 = f * f * 0.6F - 0.7F; + + for (int l = 0; l < 8; ++l) + { + par2World.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); + } + + if (!par2World.isRemote && !(par3EntityPlayer.getClass().equals(EntityPlayerMP.class))) + { + return par1ItemStack; + } + + findAndFillAltar(par2World, par3EntityPlayer, 200); + + if (par3EntityPlayer.getHealth() <= 0.5f) + { + //par3EntityPlayer.inventory.dropAllItems(); + par3EntityPlayer.onDeath(DamageSource.generic); + } + + return par1ItemStack; + } + + public void findAndFillAltar(World world, EntityPlayer player, int amount) + { + int posX = (int) Math.round(player.posX - 0.5f); + int posY = (int) player.posY; + int posZ = (int) Math.round(player.posZ - 0.5f); + TEAltar altarEntity = getAltar(world, posX, posY, posZ); + + if (altarEntity == null) + { + return; + } + + altarEntity.sacrificialDaggerCall(amount, false); + altarEntity.startCycle(); + } + + public TEAltar getAltar(World world, int x, int y, int z) + { + TileEntity tileEntity = null; + + for (int i = -2; i <= 2; i++) + { + for (int j = -2; j <= 2; j++) + { + for (int k = -2; k <= 1; k++) + { + tileEntity = world.getTileEntity(i + x, k + y, j + z); + + if ((tileEntity instanceof TEAltar)) + { + return (TEAltar) tileEntity; + } + } + + if ((tileEntity instanceof TEAltar)) + { + return (TEAltar) tileEntity; + } + } + + if ((tileEntity instanceof TEAltar)) + { + return (TEAltar) tileEntity; + } + } + + if ((tileEntity instanceof TEAltar)) + { + return (TEAltar) tileEntity; + } + + return null; + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ScribeTool.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ScribeTool.java new file mode 100644 index 00000000..0dd3cd63 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/ScribeTool.java @@ -0,0 +1,53 @@ +package WayofTime.alchemicalWizardry.common.items; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import java.util.List; + +public class ScribeTool extends EnergyItems +{ + private int meta; + + public ScribeTool(int inkType) + { + super(); + setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + setMaxDamage(10); + setEnergyUsed(10); + this.meta = inkType; + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("The writing is on the wall..."); + + if (!(par1ItemStack.stackTagCompound == null)) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par1ItemStack.getItemDamage() > 0) + { + par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1); + syphonBatteries(par1ItemStack, par3EntityPlayer, this.getEnergyUsed()); + } + + return par1ItemStack; + } + + public int getType() + { + return this.meta; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/TelepositionFocus.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/TelepositionFocus.java new file mode 100644 index 00000000..192f34f4 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/TelepositionFocus.java @@ -0,0 +1,124 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class TelepositionFocus extends EnergyItems +{ + private int focusLevel; + + public TelepositionFocus(int focusLevel) + { + super(); + this.setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.focusLevel = focusLevel; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + //TODO + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:TeleposerFocus"); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("An Enderpearl imbued with blood"); + + if (!(par1ItemStack.stackTagCompound == null)) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + + par3List.add("Coords: " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord")); + par3List.add("Bound Dimension: " + getDimensionID(par1ItemStack)); + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + +// if (!par2World.isRemote) +// { +// //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); +// par2World.spawnEntityInWorld(new FireProjectile(par2World, par3EntityPlayer, 10)); +// } + return par1ItemStack; + } + + public int getDimensionID(ItemStack itemStack) + { + if (itemStack.stackTagCompound == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + return itemStack.stackTagCompound.getInteger("dimensionId"); + } + + public World getWorld(ItemStack itemStack) + { + return DimensionManager.getWorld(getDimensionID(itemStack)); + } + + public int xCoord(ItemStack itemStack) + { + if (!(itemStack.stackTagCompound == null)) + { + return itemStack.stackTagCompound.getInteger("xCoord"); + } else + { + return 0; + } + } + + public int yCoord(ItemStack itemStack) + { + if (!(itemStack.stackTagCompound == null)) + { + return itemStack.stackTagCompound.getInteger("yCoord"); + } else + { + return 0; + } + } + + public int zCoord(ItemStack itemStack) + { + if (!(itemStack.stackTagCompound == null)) + { + return itemStack.stackTagCompound.getInteger("zCoord"); + } else + { + return 0; + } + } + + public int getFocusLevel() + { + return this.focusLevel; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/WaterScribeTool.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/WaterScribeTool.java new file mode 100644 index 00000000..86132c84 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/WaterScribeTool.java @@ -0,0 +1,22 @@ +package WayofTime.alchemicalWizardry.common.items; + +import net.minecraft.client.renderer.texture.IIconRegister; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class WaterScribeTool extends ScribeTool +{ + public WaterScribeTool() + { + super(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WaterScribeTool"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/forestry/ItemBloodFrame.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/forestry/ItemBloodFrame.java new file mode 100644 index 00000000..32da83be --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/forestry/ItemBloodFrame.java @@ -0,0 +1,151 @@ +package WayofTime.alchemicalWizardry.common.items.forestry; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemBloodFrame extends EnergyItems //implements IHiveFrame +{ + public ItemBloodFrame() + { + super(); + this.maxStackSize = 1; + this.setMaxDamage(10); + //setMaxDamage(1000); + setEnergyUsed(3000); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Stirs bees into a frenzy."); + + if (!(par1ItemStack.stackTagCompound == null)) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodFrame"); + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if(par1ItemStack.getItemDamage()>0) + { + EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()); + par1ItemStack.setItemDamage(par1ItemStack.getItemDamage()-1); + } + + return par1ItemStack; + } + + /**TODO Bee Stuff + @Override + public float getTerritoryModifier(IBeeGenome genome, float currentModifier) + { + // TODO Auto-generated method stub + return 1; + } + + @Override + public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) + { + // TODO Auto-generated method stub + return 1; + } + + @Override + public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) + { + // TODO Auto-generated method stub + return 0.0001f; + } + + @Override + public float getProductionModifier(IBeeGenome genome, float currentModifier) + { + // TODO Auto-generated method stub + return 0; + } + + @Override + public float getFloweringModifier(IBeeGenome genome, float currentModifier) + { + // TODO Auto-generated method stub + return 1; + } + + @Override + public float getGeneticDecay(IBeeGenome genome, float currentModifier) + { + // TODO Auto-generated method stub + return 1; + } + + @Override + public boolean isSealed() + { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isSelfLighted() + { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isSunlightSimulated() + { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isHellish() + { + // TODO Auto-generated method stub + return false; + } + + @Override + public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear) + { + // TODO Auto-generated method stub + if(EnergyItems.canSyphonInContainer(frame, getEnergyUsed()*wear)) + { + EnergyItems.syphonWhileInContainer(frame, getEnergyUsed()*wear); + return frame; + }else + { + frame.setItemDamage(frame.getItemDamage() + wear); + if(frame.getItemDamage()>=frame.getMaxDamage()) + { + return null; + } + return frame; + } + + } + + */ + +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyFlask.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyFlask.java new file mode 100644 index 00000000..2e625415 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyFlask.java @@ -0,0 +1,435 @@ +package WayofTime.alchemicalWizardry.common.items.potion; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.init.Items; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraftforge.common.util.Constants; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.alchemy.AlchemyPotionHelper; + +import com.google.common.collect.HashMultimap; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class AlchemyFlask extends Item +{ + private int maxPotionAmount = 20; + + public AlchemyFlask() + { + super(); + this.setMaxDamage(8); + this.setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + // TODO Auto-generated constructor stub + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:PotionFlask"); + } + + public static ArrayList getEffects(ItemStack par1ItemStack) + { + if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("CustomFlaskEffects")) + { + ArrayList arraylist = new ArrayList(); + NBTTagList nbttaglist = par1ItemStack.getTagCompound().getTagList("CustomFlaskEffects", Constants.NBT.TAG_COMPOUND); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = (NBTTagCompound) nbttaglist.getCompoundTagAt(i); + arraylist.add(AlchemyPotionHelper.readEffectFromNBT(nbttagcompound)); + } + + return arraylist; + } else + { + return null; + } + } + + public static ArrayList getPotionEffects(ItemStack par1ItemStack) + { + ArrayList list = AlchemyFlask.getEffects(par1ItemStack); + + if (list != null) + { + ArrayList newList = new ArrayList(); + + for (AlchemyPotionHelper aph : list) + { + newList.add(aph.getPotionEffect()); + } + + return newList; + } else + { + return null; + } + } + + public void setEffects(ItemStack par1ItemStack, ArrayList list) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + NBTTagList nbttaglist = new NBTTagList(); + + for (AlchemyPotionHelper aph : list) + { + nbttaglist.appendTag(AlchemyPotionHelper.setEffectToNBT(aph)); + } + + par1ItemStack.stackTagCompound.setTag("CustomFlaskEffects", nbttaglist); + } + + public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() + 1); + } + + if (!par2World.isRemote) + { + ArrayList list = this.getEffects(par1ItemStack); + + if (list != null) + { + for (AlchemyPotionHelper aph : list) + { + PotionEffect pe = aph.getPotionEffect(); + + if (pe != null) + { + //if(pe.get) + par3EntityPlayer.addPotionEffect(pe); + } + } + } + } + + return par1ItemStack; + } + + /** + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack par1ItemStack) + { + return 32; + } + + /** + * returns the action that specifies what animation to play when the items is being used + */ + public EnumAction getItemUseAction(ItemStack par1ItemStack) + { + if (this.isPotionThrowable(par1ItemStack)) + { + return EnumAction.none; + } + + return EnumAction.drink; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { +// if(par3EntityPlayer.isSneaking()) +// { +// this.setIsPotionThrowable(true, par1ItemStack); +// return par1ItemStack; +// } + if (par1ItemStack.getItemDamage() < par1ItemStack.getMaxDamage()) + { + if (this.isPotionThrowable(par1ItemStack)) + { + if (!par2World.isRemote) + { + EntityPotion entityPotion = this.getEntityPotion(par1ItemStack, par2World, par3EntityPlayer); + + if (entityPotion != null) + { + float velocityChange = 2.0f; + entityPotion.motionX *= velocityChange; + entityPotion.motionY *= velocityChange; + entityPotion.motionZ *= velocityChange; + par2World.spawnEntityInWorld(entityPotion); + par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() + 1); + } + } + + return par1ItemStack; + } + + par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); + } + + return par1ItemStack; + } + + public void setConcentrationOfPotion(ItemStack par1ItemStack, int potionID, int concentration) + { + ArrayList list = this.getEffects(par1ItemStack); + + if (list != null) + { + for (AlchemyPotionHelper aph : list) + { + if (aph.getPotionID() == potionID) + { + aph.setConcentration(concentration); + break; + } + } + + this.setEffects(par1ItemStack, list); + } + } + + public void setDurationFactorOfPotion(ItemStack par1ItemStack, int potionID, int durationFactor) + { + ArrayList list = this.getEffects(par1ItemStack); + + if (list != null) + { + for (AlchemyPotionHelper aph : list) + { + if (aph.getPotionID() == potionID) + { + aph.setDurationFactor(durationFactor); + break; + } + } + + this.setEffects(par1ItemStack, list); + } + } + + public boolean hasPotionEffect(ItemStack par1ItemStack, int potionID) + { + return false; + } + + public int getNumberOfPotionEffects(ItemStack par1ItemStack) + { + if (getEffects(par1ItemStack) != null) + { + return getEffects(par1ItemStack).size(); + } else + { + return 0; + } + } + + public boolean addPotionEffect(ItemStack par1ItemStack, int potionID, int tickDuration) + { + int i = 0; + ArrayList list = this.getEffects(par1ItemStack); + + if (list != null) + { + for (AlchemyPotionHelper aph : list) + { + if (aph.getPotionID() == potionID) + { + return false; + } + + i++; + } + + //if(i 0) + { + Iterator iterator1 = map.entrySet().iterator(); + + while (iterator1.hasNext()) + { + Entry entry = (Entry) iterator1.next(); + AttributeModifier attributemodifier = (AttributeModifier) entry.getValue(); + AttributeModifier attributemodifier1 = new AttributeModifier(attributemodifier.getName(), potion.func_111183_a(potioneffect.getAmplifier(), attributemodifier), attributemodifier.getOperation()); + hashmultimap.put(((IAttribute)entry.getKey()).getAttributeUnlocalizedName(), attributemodifier1); + } + } + + if (potioneffect.getAmplifier() > 0) + { + s = s + " " + StatCollector.translateToLocal("potion.potency." + potioneffect.getAmplifier()).trim(); + } + + if (potioneffect.getDuration() > 20) + { + s = s + " (" + Potion.getDurationString(potioneffect) + ")"; + } + + if (potion.isBadEffect()) + { + par3List.add(EnumChatFormatting.RED + s); + } else + { + par3List.add(EnumChatFormatting.GRAY + s); + } + } + } else + { + String s1 = StatCollector.translateToLocal("potion.empty").trim(); + par3List.add(EnumChatFormatting.GRAY + s1); + } + + if (!hashmultimap.isEmpty()) + { + par3List.add(""); + par3List.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("potion.effects.whenDrank")); + iterator = hashmultimap.entries().iterator(); + + while (iterator.hasNext()) + { + Entry entry1 = (Entry) iterator.next(); + AttributeModifier attributemodifier2 = (AttributeModifier) entry1.getValue(); + double d0 = attributemodifier2.getAmount(); + double d1; + + if (attributemodifier2.getOperation() != 1 && attributemodifier2.getOperation() != 2) + { + d1 = attributemodifier2.getAmount(); + } else + { + d1 = attributemodifier2.getAmount() * 100.0D; + } + + if (d0 > 0.0D) + { + par3List.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + attributemodifier2.getOperation(), new Object[]{ItemStack.field_111284_a.format(d1), StatCollector.translateToLocal("attribute.name." + (String) entry1.getKey())})); + } else if (d0 < 0.0D) + { + d1 *= -1.0D; + par3List.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + attributemodifier2.getOperation(), new Object[]{ItemStack.field_111284_a.format(d1), StatCollector.translateToLocal("attribute.name." + (String) entry1.getKey())})); + } + } + } + } + + public boolean isPotionThrowable(ItemStack par1ItemStack) + { + if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().getBoolean("throwable")) + { + return true; + } else + { + return false; + } + + //return false; + } + + public void setIsPotionThrowable(boolean flag, ItemStack par1ItemStack) + { + if (!par1ItemStack.hasTagCompound()) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + par1ItemStack.stackTagCompound.setBoolean("throwable", flag); + } + + public EntityPotion getEntityPotion(ItemStack par1ItemStack, World worldObj, EntityLivingBase entityLivingBase) + { + ItemStack potionStack = new ItemStack(Items.potionitem, 1, 0); + potionStack.setTagCompound(new NBTTagCompound()); + ArrayList potionList = this.getPotionEffects(par1ItemStack); + + if (potionList == null) + { + return null; + } + + NBTTagList nbttaglist = new NBTTagList(); + + for (PotionEffect pe : potionList) + { + NBTTagCompound d = new NBTTagCompound(); + d.setByte("Id", (byte) pe.getPotionID()); + d.setByte("Amplifier", (byte) pe.getAmplifier()); + //byte b1 = par0NBTTagCompound.getByte("Amplifier"); + d.setInteger("Duration", pe.getDuration()); + //int i = par0NBTTagCompound.getInteger("Duration"); + d.setBoolean("Ambient", pe.getIsAmbient()); + // boolean flag = par0NBTTagCompound.getBoolean("Ambient"); + nbttaglist.appendTag(d); + } + + potionStack.stackTagCompound.setTag("CustomPotionEffects", nbttaglist); + EntityPotion entityPotion = new EntityPotion(worldObj, entityLivingBase, potionStack); + return entityPotion; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyReagent.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyReagent.java new file mode 100644 index 00000000..93338041 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/AlchemyReagent.java @@ -0,0 +1,120 @@ +package WayofTime.alchemicalWizardry.common.items.potion; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; + +import org.lwjgl.input.Keyboard; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.alchemy.AlchemyRecipeRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class AlchemyReagent extends Item +{ + public AlchemyReagent() + { + super(); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + this.setMaxStackSize(64); + // TODO Auto-generated constructor stub + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + if (this == ModItems.incendium) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Incendium"); + return; + } + + if (this == ModItems.magicales) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Magicales"); + return; + } + + if (this == ModItems.sanctus) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Sanctus"); + return; + } + + if (this == ModItems.aether) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Aether"); + return; + } + + if (this == ModItems.simpleCatalyst) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SimpleCatalyst"); + return; + } + + if (this == ModItems.crepitous) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Crepitous"); + return; + } + + if (this == ModItems.crystallos) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Crystallos"); + return; + } + + if (this == ModItems.terrae) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Terrae"); + return; + } + + if (this == ModItems.aquasalus) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Aquasalus"); + return; + } + + if (this == ModItems.tennebrae) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Tennebrae"); + return; + } + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Used in alchemy"); + + if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) + { + ItemStack[] recipe = AlchemyRecipeRegistry.getRecipeForItemStack(par1ItemStack); + + if (recipe != null) + { + par3List.add(EnumChatFormatting.BLUE + "Recipe:"); + + for (ItemStack item : recipe) + { + if (item != null) + { + par3List.add("" + item.getDisplayName()); + } + } + } + } else + { + par3List.add("-Press " + EnumChatFormatting.BLUE + "shift" + EnumChatFormatting.GRAY + " for Recipe-"); + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/AverageLengtheningCatalyst.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/AverageLengtheningCatalyst.java new file mode 100644 index 00000000..841a9729 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/AverageLengtheningCatalyst.java @@ -0,0 +1,20 @@ +package WayofTime.alchemicalWizardry.common.items.potion; + +import net.minecraft.client.renderer.texture.IIconRegister; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class AverageLengtheningCatalyst extends LengtheningCatalyst +{ + public AverageLengtheningCatalyst() + { + super(2); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AverageLengtheningCatalyst"); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/AveragePowerCatalyst.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/AveragePowerCatalyst.java new file mode 100644 index 00000000..3ce2cde9 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/AveragePowerCatalyst.java @@ -0,0 +1,20 @@ +package WayofTime.alchemicalWizardry.common.items.potion; + +import net.minecraft.client.renderer.texture.IIconRegister; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class AveragePowerCatalyst extends PowerCatalyst +{ + public AveragePowerCatalyst() + { + super(2); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AveragePowerCatalyst"); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/EnhancedFillingAgent.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/EnhancedFillingAgent.java new file mode 100644 index 00000000..ecbad19d --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/EnhancedFillingAgent.java @@ -0,0 +1,57 @@ +package WayofTime.alchemicalWizardry.common.items.potion; + +import java.util.Random; + +import net.minecraft.client.renderer.texture.IIconRegister; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class EnhancedFillingAgent extends WeakFillingAgent +{ + public EnhancedFillingAgent() + { + super(); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + public int getFilledAmountForPotionNumber(int potionEffects) + { + Random rand = new Random(); + + if (potionEffects == 0) + { + return 8; + } + + //if(potionEffects >=1 && potionEffects<=5) + { + switch (potionEffects) + { + case 1: + return 6; + + case 2: + return 4; + + case 3: + return 3; + + case 4: + return 2; + + case 5: + return 2; + } + } + return 0; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnhancedFillingAgent"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterLengtheningCatalyst.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterLengtheningCatalyst.java new file mode 100644 index 00000000..65bb052e --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterLengtheningCatalyst.java @@ -0,0 +1,20 @@ +package WayofTime.alchemicalWizardry.common.items.potion; + +import net.minecraft.client.renderer.texture.IIconRegister; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class GreaterLengtheningCatalyst extends LengtheningCatalyst +{ + public GreaterLengtheningCatalyst() + { + super(3); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:GreaterLengtheningCatalyst"); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterPowerCatalyst.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterPowerCatalyst.java new file mode 100644 index 00000000..e5dd6d47 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/GreaterPowerCatalyst.java @@ -0,0 +1,20 @@ +package WayofTime.alchemicalWizardry.common.items.potion; + +import net.minecraft.client.renderer.texture.IIconRegister; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class GreaterPowerCatalyst extends PowerCatalyst +{ + public GreaterPowerCatalyst() + { + super(3); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:GreaterPowerCatalyst"); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/LengtheningCatalyst.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/LengtheningCatalyst.java new file mode 100644 index 00000000..d149e8de --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/LengtheningCatalyst.java @@ -0,0 +1,64 @@ +package WayofTime.alchemicalWizardry.common.items.potion; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.ICatalyst; +import WayofTime.alchemicalWizardry.common.alchemy.AlchemyRecipeRegistry; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; + +import org.lwjgl.input.Keyboard; + +import java.util.List; + +public class LengtheningCatalyst extends Item implements ICatalyst +{ + private int catalystStrength; + + public LengtheningCatalyst(int catalystStrength) + { + super(); + this.catalystStrength = catalystStrength; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + public int getCatalystLevel() + { + return catalystStrength; + } + + @Override + public boolean isConcentration() + { + return false; + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Used in alchemy"); + + if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) + { + ItemStack[] recipe = AlchemyRecipeRegistry.getRecipeForItemStack(par1ItemStack); + + if (recipe != null) + { + par3List.add(EnumChatFormatting.BLUE + "Recipe:"); + + for (ItemStack item : recipe) + { + if (item != null) + { + par3List.add("" + item.getDisplayName()); + } + } + } + } else + { + par3List.add("-Press " + EnumChatFormatting.BLUE + "shift" + EnumChatFormatting.GRAY + " for Recipe-"); + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/MundaneLengtheningCatalyst.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/MundaneLengtheningCatalyst.java new file mode 100644 index 00000000..e945ed22 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/MundaneLengtheningCatalyst.java @@ -0,0 +1,20 @@ +package WayofTime.alchemicalWizardry.common.items.potion; + +import net.minecraft.client.renderer.texture.IIconRegister; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class MundaneLengtheningCatalyst extends LengtheningCatalyst +{ + public MundaneLengtheningCatalyst() + { + super(1); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MundaneLengtheningCatalyst"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/MundanePowerCatalyst.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/MundanePowerCatalyst.java new file mode 100644 index 00000000..86291dec --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/MundanePowerCatalyst.java @@ -0,0 +1,20 @@ +package WayofTime.alchemicalWizardry.common.items.potion; + +import net.minecraft.client.renderer.texture.IIconRegister; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class MundanePowerCatalyst extends PowerCatalyst +{ + public MundanePowerCatalyst() + { + super(1); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MundanePowerCatalyst"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/PowerCatalyst.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/PowerCatalyst.java new file mode 100644 index 00000000..d73c6cc2 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/PowerCatalyst.java @@ -0,0 +1,64 @@ +package WayofTime.alchemicalWizardry.common.items.potion; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.ICatalyst; +import WayofTime.alchemicalWizardry.common.alchemy.AlchemyRecipeRegistry; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; + +import org.lwjgl.input.Keyboard; + +import java.util.List; + +public class PowerCatalyst extends Item implements ICatalyst +{ + private int catalystStrength; + + public PowerCatalyst(int catalystStrength) + { + super(); + this.catalystStrength = catalystStrength; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + public int getCatalystLevel() + { + return catalystStrength; + } + + @Override + public boolean isConcentration() + { + return true; + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Used in alchemy"); + + if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) + { + ItemStack[] recipe = AlchemyRecipeRegistry.getRecipeForItemStack(par1ItemStack); + + if (recipe != null) + { + par3List.add(EnumChatFormatting.BLUE + "Recipe:"); + + for (ItemStack item : recipe) + { + if (item != null) + { + par3List.add("" + item.getDisplayName()); + } + } + } + } else + { + par3List.add("-Press " + EnumChatFormatting.BLUE + "shift" + EnumChatFormatting.GRAY + " for Recipe-"); + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/StandardBindingAgent.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/StandardBindingAgent.java new file mode 100644 index 00000000..4cdf979a --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/StandardBindingAgent.java @@ -0,0 +1,66 @@ +package WayofTime.alchemicalWizardry.common.items.potion; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; + +import org.lwjgl.input.Keyboard; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.IBindingAgent; +import WayofTime.alchemicalWizardry.common.alchemy.AlchemyRecipeRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class StandardBindingAgent extends Item implements IBindingAgent +{ + public StandardBindingAgent() + { + super(); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + public float getSuccessRateForPotionNumber(int potions) + { + return (float) Math.pow(0.65, potions); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:StandardBindingAgent"); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Used in alchemy"); + + if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) + { + ItemStack[] recipe = AlchemyRecipeRegistry.getRecipeForItemStack(par1ItemStack); + + if (recipe != null) + { + par3List.add(EnumChatFormatting.BLUE + "Recipe:"); + + for (ItemStack item : recipe) + { + if (item != null) + { + par3List.add("" + item.getDisplayName()); + } + } + } + } else + { + par3List.add("-Press " + EnumChatFormatting.BLUE + "shift" + EnumChatFormatting.GRAY + " for Recipe-"); + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/StandardFillingAgent.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/StandardFillingAgent.java new file mode 100644 index 00000000..0cc4c9a8 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/StandardFillingAgent.java @@ -0,0 +1,39 @@ +package WayofTime.alchemicalWizardry.common.items.potion; + +import net.minecraft.client.renderer.texture.IIconRegister; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class StandardFillingAgent extends WeakFillingAgent +{ + public StandardFillingAgent() + { + super(); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + public int getFilledAmountForPotionNumber(int potionEffects) + { + //Random rand = new Random(); + if (potionEffects == 0) + { + return 8; + } + + if (potionEffects >= 1 && potionEffects <= 3) + { + return (int) (4 * (Math.pow(0.5f, potionEffects - 1) + 0.01f)); + } + + return 0; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:StandardFillingAgent"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/WeakBindingAgent.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/WeakBindingAgent.java new file mode 100644 index 00000000..24ee6f0b --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/WeakBindingAgent.java @@ -0,0 +1,27 @@ +package WayofTime.alchemicalWizardry.common.items.potion; + +import net.minecraft.client.renderer.texture.IIconRegister; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class WeakBindingAgent extends StandardBindingAgent +{ + public WeakBindingAgent() + { + super(); + // TODO Auto-generated constructor stub + } + + @Override + public float getSuccessRateForPotionNumber(int potions) + { + return (float) Math.pow(0.4, potions); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WeakBindingAgent"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/WeakFillingAgent.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/WeakFillingAgent.java new file mode 100644 index 00000000..82a5f856 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/potion/WeakFillingAgent.java @@ -0,0 +1,85 @@ +package WayofTime.alchemicalWizardry.common.items.potion; + +import java.util.List; +import java.util.Random; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; + +import org.lwjgl.input.Keyboard; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.IFillingAgent; +import WayofTime.alchemicalWizardry.common.alchemy.AlchemyRecipeRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class WeakFillingAgent extends Item implements IFillingAgent +{ + public WeakFillingAgent() + { + super(); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + public int getFilledAmountForPotionNumber(int potionEffects) + { + Random rand = new Random(); + + if (potionEffects == 0) + { + return 8; + } + + if (potionEffects == 1 || potionEffects == 2) + { + if (rand.nextFloat() > 0.5f) + { + return (4 - potionEffects); + } else + { + return 3 - potionEffects; + } + } + + return 0; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WeakFillingAgent"); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Used in alchemy"); + + if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) + { + ItemStack[] recipe = AlchemyRecipeRegistry.getRecipeForItemStack(par1ItemStack); + + if (recipe != null) + { + par3List.add(EnumChatFormatting.BLUE + "Recipe:"); + + for (ItemStack item : recipe) + { + if (item != null) + { + par3List.add("" + item.getDisplayName()); + } + } + } + } else + { + par3List.add("-Press " + EnumChatFormatting.BLUE + "shift" + EnumChatFormatting.GRAY + " for Recipe-"); + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/AirSigil.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/AirSigil.java new file mode 100644 index 00000000..166fe2cf --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/AirSigil.java @@ -0,0 +1,106 @@ +package WayofTime.alchemicalWizardry.common.items.sigil; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class AirSigil extends EnergyItems implements ArmourUpgrade +{ + private int energyUsed; + + public AirSigil() + { + super(); + this.maxStackSize = 1; + //setMaxDamage(1000); + setEnergyUsed(50); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("I feel lighter already..."); + + if (!(par1ItemStack.stackTagCompound == null)) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AirSigil"); + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + Vec3 vec = par3EntityPlayer.getLookVec(); + double wantedVelocity = 1.7; + + if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionBoost)) + { + int i = par3EntityPlayer.getActivePotionEffect(AlchemicalWizardry.customPotionBoost).getAmplifier(); + wantedVelocity += (1 + i) * (0.35); + } + + par3EntityPlayer.motionX = vec.xCoord * wantedVelocity; + par3EntityPlayer.motionY = vec.yCoord * wantedVelocity; + par3EntityPlayer.motionZ = vec.zCoord * wantedVelocity; + par2World.playSoundEffect((double) ((float) par3EntityPlayer.posX + 0.5F), (double) ((float) par3EntityPlayer.posY + 0.5F), (double) ((float) par3EntityPlayer.posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (par2World.rand.nextFloat() - par2World.rand.nextFloat()) * 0.8F); + par3EntityPlayer.fallDistance = 0; + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + { + } + } else + { + return par1ItemStack; + } + + return par1ItemStack; + } + + @Override + public void onArmourUpdate(World world, EntityPlayer player, + ItemStack thisItemStack) + { + // TODO Auto-generated method stub + player.fallDistance = 0; + } + + @Override + public boolean isUpgrade() + { + // TODO Auto-generated method stub + return true; + } + + @Override + public int getEnergyForTenSeconds() + { + // TODO Auto-generated method stub + return 50; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/DivinationSigil.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/DivinationSigil.java new file mode 100644 index 00000000..082a5472 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/DivinationSigil.java @@ -0,0 +1,96 @@ +package WayofTime.alchemicalWizardry.common.items.sigil; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class DivinationSigil extends Item implements ArmourUpgrade +{ + public DivinationSigil() + { + super(); + this.maxStackSize = 1; + //setMaxDamage(1000); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DivinationSigil"); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Peer into the soul to"); + par3List.add("get the current essence"); + + if (!(par1ItemStack.stackTagCompound == null)) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.worldObj.isRemote) + { + return par1ItemStack; + } + + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + + if (itemTag == null || itemTag.getString("ownerName").equals("")) + { + return par1ItemStack; + } + + String ownerName = itemTag.getString("ownerName"); + //PacketDispatcher.sendPacketToServer(PacketHandler.getPacket(ownerName)); + int currentEssence = EnergyItems.getCurrentEssence(ownerName); + + par3EntityPlayer.addChatMessage(new ChatComponentText("Current Essence: " + 0)); + + return par1ItemStack; + } + + @Override + public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) + { + // TODO Auto-generated method stub + player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 400, 9)); + } + + @Override + public boolean isUpgrade() + { + // TODO Auto-generated method stub + return true; + } + + @Override + public int getEnergyForTenSeconds() + { + // TODO Auto-generated method stub + return 25; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemBloodLightSigil.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemBloodLightSigil.java new file mode 100644 index 00000000..2eed1e0b --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/ItemBloodLightSigil.java @@ -0,0 +1,144 @@ +package WayofTime.alchemicalWizardry.common.items.sigil; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.entity.projectile.EntityBloodLightProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemBloodLightSigil extends EnergyItems +{ + private int tickDelay = 100; + + public ItemBloodLightSigil() + { + super(); + this.maxStackSize = 1; + //setMaxDamage(1000); + setEnergyUsed(10); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + // TODO Auto-generated constructor stub + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("I see a light!"); + + if (!(par1ItemStack.stackTagCompound == null)) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodLightSigil"); + } + + @Override + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer); + EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed()); + + if (par3World.isRemote) + { + return true; + } + + if (par7 == 0 && par3World.isAirBlock(par4, par5 - 1, par6)) + { + par3World.setBlock(par4, par5 - 1, par6, ModBlocks.blockBloodLight); + } + + if (par7 == 1 && par3World.isAirBlock(par4, par5 + 1, par6)) + { + par3World.setBlock(par4, par5 + 1, par6, ModBlocks.blockBloodLight); + } + + if (par7 == 2 && par3World.isAirBlock(par4, par5, par6 - 1)) + { + par3World.setBlock(par4, par5, par6 - 1, ModBlocks.blockBloodLight); + } + + if (par7 == 3 && par3World.isAirBlock(par4, par5, par6 + 1)) + { + par3World.setBlock(par4, par5, par6 + 1, ModBlocks.blockBloodLight); + } + + if (par7 == 4 && par3World.isAirBlock(par4 - 1, par5, par6)) + { + par3World.setBlock(par4 - 1, par5, par6, ModBlocks.blockBloodLight); + } + + if (par7 == 5 && par3World.isAirBlock(par4 + 1, par5, par6)) + { + par3World.setBlock(par4 + 1, par5, par6, ModBlocks.blockBloodLight); + } + + return true; + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed() * 5); + + if (!par2World.isRemote) + { + par2World.spawnEntityInWorld(new EntityBloodLightProjectile(par2World, par3EntityPlayer, 10)); + } + + return par1ItemStack; + } + + @Override + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) + { + if (!(par3Entity instanceof EntityPlayer)) + { + return; + } + + EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + if (par2World.getWorldTime() % tickDelay == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer) + { + EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed()); + } + } + + return; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/LavaSigil.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/LavaSigil.java new file mode 100644 index 00000000..61829765 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/LavaSigil.java @@ -0,0 +1,285 @@ +package WayofTime.alchemicalWizardry.common.items.sigil; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemBucket; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyBattery; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class LavaSigil extends ItemBucket implements ArmourUpgrade +{ + /** + * field for checking if the bucket has been filled. + */ + private Block isFull = Blocks.lava; + private int energyUsed; + + public LavaSigil() + { + super(Blocks.lava); + this.maxStackSize = 1; + //setMaxDamage(2000); + setEnergyUsed(1000); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:LavaSigil"); + } + + @Override + public ItemStack getContainerItem(ItemStack itemStack) + { + ItemStack copiedStack = itemStack.copy(); + copiedStack.setItemDamage(copiedStack.getItemDamage() + getEnergyUsed()); + copiedStack.stackSize = 1; + return copiedStack; + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Contact with liquid is"); + par3List.add("highly unrecommended."); + + if (!(par1ItemStack.stackTagCompound == null)) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + float f = 1.0F; + double d0 = par3EntityPlayer.prevPosX + (par3EntityPlayer.posX - par3EntityPlayer.prevPosX) * (double) f; + double d1 = par3EntityPlayer.prevPosY + (par3EntityPlayer.posY - par3EntityPlayer.prevPosY) * (double) f + 1.62D - (double) par3EntityPlayer.yOffset; + double d2 = par3EntityPlayer.prevPosZ + (par3EntityPlayer.posZ - par3EntityPlayer.prevPosZ) * (double) f; + + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, false); + + if (movingobjectposition == null) + { + return par1ItemStack; + } else + { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + if (!par2World.canMineBlock(par3EntityPlayer, i, j, k)) + { + return par1ItemStack; + } + + //if (this.isFull == 0) + { + //Empty + } //else + { + if (movingobjectposition.sideHit == 0) + { + --j; + } + + if (movingobjectposition.sideHit == 1) + { + ++j; + } + + if (movingobjectposition.sideHit == 2) + { + --k; + } + + if (movingobjectposition.sideHit == 3) + { + ++k; + } + + if (movingobjectposition.sideHit == 4) + { + --i; + } + + if (movingobjectposition.sideHit == 5) + { + ++i; + } + + if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack)) + { + return par1ItemStack; + } + + if (this.tryPlaceContainedLiquid(par2World, d0, d1, d2, i, j, k) && !par3EntityPlayer.capabilities.isCreativeMode) + { + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + { + } + } else + { + return par1ItemStack; + } + } + } + } + + return par1ItemStack; + } + } + + /** + * Attempts to place the liquid contained inside the bucket. + */ + public boolean tryPlaceContainedLiquid(World par1World, double par2, double par4, double par6, int par8, int par9, int par10) + { + //if (this.isFull <= 0) + { + //return false; + } if (!par1World.isAirBlock(par8, par9, par10) && par1World.getBlock(par8, par9, par10).getMaterial().isSolid()) + { + return false; + } else if ((par1World.getBlock(par8, par9, par10) == Blocks.lava || par1World.getBlock(par8, par9, par10) == Blocks.flowing_lava) && par1World.getBlockMetadata(par8, par9, par10) == 0) + { + return false; + } else + { + par1World.setBlock(par8, par9, par10, this.isFull, 0, 3); + return true; + } + } + + protected void setEnergyUsed(int par1int) + { + this.energyUsed = par1int; + } + + protected int getEnergyUsed() + { + return this.energyUsed; + } + //Heals the player using the item. If the player is at full health, or if the durability cannot be used any more, + //the item is not used. + + // protected void damagePlayer(World world, EntityPlayer player, int damage) +// { +// if (world != null) +// { +// double posX = player.posX; +// double posY = player.posY; +// double posZ = player.posZ; +// world.playSoundEffect((double)((float)posX + 0.5F), (double)((float)posY + 0.5F), (double)((float)posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); +// float f = (float)1.0F; +// float f1 = f * 0.6F + 0.4F; +// float f2 = f * f * 0.7F - 0.5F; +// float f3 = f * f * 0.6F - 0.7F; +// +// for (int l = 0; l < 8; ++l) +// { +// world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); +// } +// } +// +// for (int i = 0; i < damage; i++) +// { +// //player.setEntityHealth((player.getHealth()-1)); +// player.setEntityHealth(player.func_110143_aJ() - 1); +// +// if (player.func_110143_aJ() <= 0) +// { +// player.inventory.dropAllItems(); +// } +// } +// } + protected boolean syphonBatteries(ItemStack ist, EntityPlayer player, int damageToBeDone) + { + if (!player.capabilities.isCreativeMode) + { + boolean usedBattery = false; + IInventory inventory = player.inventory; + + for (int slot = 0; slot < inventory.getSizeInventory(); slot++) + { + ItemStack stack = inventory.getStackInSlot(slot); + + if (stack == null) + { + continue; + } + + if (stack.getItem() instanceof EnergyBattery && !usedBattery) + { + if (stack.getItemDamage() <= stack.getMaxDamage() - damageToBeDone) + { + stack.setItemDamage(stack.getItemDamage() + damageToBeDone); + usedBattery = true; + } + } + } + + if (!usedBattery) + { + return false; + } + + return true; + } else + { + return true; + } + } + + @Override + public void onArmourUpdate(World world, EntityPlayer player, + ItemStack thisItemStack) + { + // TODO Auto-generated method stub + player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 9)); + player.extinguish(); + } + + @Override + public boolean isUpgrade() + { + // TODO Auto-generated method stub + return true; + } + + @Override + public int getEnergyForTenSeconds() + { + // TODO Auto-generated method stub + return 100; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfElementalAffinity.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfElementalAffinity.java new file mode 100644 index 00000000..3b1bd3cf --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfElementalAffinity.java @@ -0,0 +1,172 @@ +package WayofTime.alchemicalWizardry.common.items.sigil; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SigilOfElementalAffinity extends EnergyItems +{ + @SideOnly(Side.CLIENT) + private static IIcon activeIcon; + @SideOnly(Side.CLIENT) + private static IIcon passiveIcon; + + public SigilOfElementalAffinity() + { + super(); + this.maxStackSize = 1; + setMaxDamage(100); + setEnergyUsed(200); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Perfect for a fire-breathing fish"); + par3List.add("who is afraid of heights!"); + + if (!(par1ItemStack.stackTagCompound == null)) + { + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + par3List.add("Activated"); + } else + { + par3List.add("Deactivated"); + } + + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfTheFastMiner"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:ElementalSigil_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:ElementalSigil_deactivated"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.stackTagCompound == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.stackTagCompound; + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = par1ItemStack.stackTagCompound; + tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); + + if (tag.getBoolean("isActive")) + { + par1ItemStack.setItemDamage(1); + tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); + par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true)); + par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true)); + + //Test with added health boost + //par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400,99)); + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + { + } + } + } else + { + par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage()); + } + + return par1ItemStack; + } + + @Override + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) + { + if (!(par3Entity instanceof EntityPlayer)) + { + return; + } + + EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + par3EntityPlayer.fallDistance = 0; + par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true)); + par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true)); + } + + if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + //par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400,99)); + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + { + } + } + } + + return; + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfGrowth.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfGrowth.java new file mode 100644 index 00000000..30103e0e --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfGrowth.java @@ -0,0 +1,302 @@ +package WayofTime.alchemicalWizardry.common.items.sigil; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockCocoa; +import net.minecraft.block.BlockCrops; +import net.minecraft.block.BlockDirectional; +import net.minecraft.block.BlockMushroom; +import net.minecraft.block.BlockSapling; +import net.minecraft.block.BlockStem; +import net.minecraft.block.IGrowable; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.common.IPlantable; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.BonemealEvent; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.common.eventhandler.Event.Result; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade +{ + private static IIcon activeIcon; + private static IIcon passiveIcon; + private int tickDelay = 100; + + public SigilOfGrowth() + { + super(); + this.maxStackSize = 1; + //setMaxDamage(1000); + setEnergyUsed(150); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + // TODO Auto-generated constructor stub + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Who needs a green thumb when"); + par3List.add("you have a green slate?"); + + if (!(par1ItemStack.stackTagCompound == null)) + { + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + par3List.add("Activated"); + } else + { + par3List.add("Deactivated"); + } + + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:GrowthSigil_deactivated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:GrowthSigil_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:GrowthSigil_deactivated"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.stackTagCompound == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.stackTagCompound; + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer); + + if (applyBonemeal(par1ItemStack, par3World, par4, par5, par6, par2EntityPlayer)) + { + EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed()); + + if (par3World.isRemote) + { + par3World.playAuxSFX(2005, par4, par5, par6, 0); + return true; + } + + return true; + } + + return false; + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = par1ItemStack.stackTagCompound; + tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); + + if (tag.getBoolean("isActive")) + { + par1ItemStack.setItemDamage(1); + tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay); + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()); + } + } else + { + par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage()); + } + + return par1ItemStack; + } + + @Override + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) + { + if (!(par3Entity instanceof EntityPlayer)) + { + return; + } + + EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + if (par2World.getWorldTime() % tickDelay == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer) + { + EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed()); + } + + int range = 5; + int verticalRange = 2; + int posX = (int) Math.round(par3Entity.posX - 0.5f); + int posY = (int) par3Entity.posY; + int posZ = (int) Math.round(par3Entity.posZ - 0.5f); + + for (int ix = posX - range; ix <= posX + range; ix++) + { + for (int iz = posZ - range; iz <= posZ + range; iz++) + { + for (int iy = posY - verticalRange; iy <= posY + verticalRange; iy++) + { + Block block = par2World.getBlock(ix, iy, iz); + + + if (block instanceof IPlantable) + { + if (par2World.rand.nextInt(20) == 0) + { + block.updateTick(par2World, ix, iy, iz, par2World.rand); + } + } + } + } + } + } + + return; + } + + public static boolean applyBonemeal(ItemStack p_150919_0_, World p_150919_1_, int p_150919_2_, int p_150919_3_, int p_150919_4_, EntityPlayer player) + { + Block block = p_150919_1_.getBlock(p_150919_2_, p_150919_3_, p_150919_4_); + + BonemealEvent event = new BonemealEvent(player, p_150919_1_, block, p_150919_2_, p_150919_3_, p_150919_4_); + if (MinecraftForge.EVENT_BUS.post(event)) + { + return false; + } + + if (event.getResult() == Result.ALLOW) + { + if (!p_150919_1_.isRemote) + { + p_150919_0_.stackSize--; + } + return true; + } + + if (block instanceof IGrowable) + { + IGrowable igrowable = (IGrowable)block; + + if (igrowable.func_149851_a(p_150919_1_, p_150919_2_, p_150919_3_, p_150919_4_, p_150919_1_.isRemote)) + { + if (!p_150919_1_.isRemote) + { + if (igrowable.func_149852_a(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_)) + { + igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_); + } + + --p_150919_0_.stackSize; + } + + return true; + } + } + + return false; + } + + @Override + public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) + { + int range = 5; + int verticalRange = 2; + int posX = (int) Math.round(player.posX - 0.5f); + int posY = (int) player.posY; + int posZ = (int) Math.round(player.posZ - 0.5f); + + for (int ix = posX - range; ix <= posX + range; ix++) + { + for (int iz = posZ - range; iz <= posZ + range; iz++) + { + for (int iy = posY - verticalRange; iy <= posY + verticalRange; iy++) + { + Block block = world.getBlock(ix, iy, iz); + + + if (block instanceof IPlantable) + { + if (world.rand.nextInt(10) == 0) + { + block.updateTick(world, ix, iy, iz, world.rand); + } + } + } + } + } + } + + @Override + public boolean isUpgrade() + { + // TODO Auto-generated method stub + return true; + } + + @Override + public int getEnergyForTenSeconds() + { + // TODO Auto-generated method stub + return 50; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHaste.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHaste.java new file mode 100644 index 00000000..aa84d0e0 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHaste.java @@ -0,0 +1,198 @@ +package WayofTime.alchemicalWizardry.common.items.sigil; + +import java.util.List; + +import javax.swing.Icon; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SigilOfHaste extends EnergyItems implements ArmourUpgrade +{ + @SideOnly(Side.CLIENT) + private static IIcon activeIcon; + @SideOnly(Side.CLIENT) + private static IIcon passiveIcon; + + public SigilOfHaste() + { + super(); + this.maxStackSize = 1; + //setMaxDamage(100); + setEnergyUsed(250); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("One dose of caffeine later..."); + + if (!(par1ItemStack.stackTagCompound == null)) + { + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + par3List.add("Activated"); + } else + { + par3List.add("Deactivated"); + } + + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:HasteSigil_deactivated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:HasteSigil_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:HasteSigil_deactivated"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.stackTagCompound == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.stackTagCompound; + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = par1ItemStack.stackTagCompound; + tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); + + if (tag.getBoolean("isActive")) + { + par1ItemStack.setItemDamage(1); + tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); + par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1)); + //par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 2)); + + //Test with added health boost + //par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400,99)); + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + { + } + } + } else + { + par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage()); + } + + return par1ItemStack; + } + + @Override + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) + { + if (!(par3Entity instanceof EntityPlayer)) + { + return; + } + + EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1)); + } + + if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + //par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 205, 1)); + + //par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 205, 2)); + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + { + } + } + } + + return; + } + + @Override + public void onArmourUpdate(World world, EntityPlayer player, ItemStack itemStack) + { + if (itemStack.stackTagCompound == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1)); + } + + @Override + public boolean isUpgrade() + { + // TODO Auto-generated method stub + return true; + } + + @Override + public int getEnergyForTenSeconds() + { + // TODO Auto-generated method stub + return 150; + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHolding.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHolding.java new file mode 100644 index 00000000..9cc9dcd3 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfHolding.java @@ -0,0 +1,362 @@ +package WayofTime.alchemicalWizardry.common.items.sigil; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import net.minecraftforge.common.util.Constants; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SigilOfHolding extends EnergyItems +{ + private int invSize = 4; + + public static List allowedSigils = new ArrayList(); + + public SigilOfHolding() + { + super(); + this.maxStackSize = 1; + //setEnergyUsed(100); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfHolding"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (!(stack.stackTagCompound == null)) + { + ItemStack[] inv = getInternalInventory(stack); + + if (inv == null) + { + return this.itemIcon; + } + + ItemStack item = inv[stack.stackTagCompound.getInteger("selectedSlot")]; + + if (item != null) + { + return item.getIconIndex(); + } + } + + return this.itemIcon; + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Used to hold several Sigils!"); + + if (!(par1ItemStack.stackTagCompound == null)) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); +// par3List.add("Current slot: " + par1ItemStack.stackTagCompound.getInteger("selectedSlot")); + ItemStack[] inv = getInternalInventory(par1ItemStack); + + if (inv == null) + { + return; + } + + ItemStack item = inv[par1ItemStack.stackTagCompound.getInteger("selectedSlot")]; + + if (item != null) + { + par3List.add("Current item: " + item.getDisplayName()); + } + + for (int i = 0; i < invSize; i++) + { + if (inv[i] != null) + { + par3List.add("Item in slot " + i + ": " + inv[i].getDisplayName()); + } + } + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + //TODO Might be a good idea to have this item need to be in the player's first slot + //for it to search and consume sigils on right click. Might avoid confusion? At least + //will avoid the need to add a button just for it... + this.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + if (this.addSigilToInventory(par1ItemStack, par3EntityPlayer)) + { + return par1ItemStack; + } + + selectNextSlot(par1ItemStack); + return par1ItemStack; + } + + int currentSlot = this.getSelectedSlot(par1ItemStack); + ItemStack[] inv = getInternalInventory(par1ItemStack); + + if (inv == null) + { + return par1ItemStack; + } + + ItemStack itemUsed = inv[currentSlot]; + + if (itemUsed == null) + { + return par1ItemStack; + } + + itemUsed.getItem().onItemRightClick(itemUsed, par2World, par3EntityPlayer); + saveInternalInventory(par1ItemStack, inv); + return par1ItemStack; + } + + @Override + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) + { + if (!(par1ItemStack.stackTagCompound == null)) + { + this.tickInternalInventory(par1ItemStack, par2World, par3Entity, par4, par5); + } + } + + public ItemStack[] getInternalInventory(ItemStack itemStack) + { + NBTTagCompound itemTag = itemStack.stackTagCompound; + + if (itemTag == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + ItemStack[] inv = new ItemStack[9]; + NBTTagList tagList = itemTag.getTagList("Inventory", Constants.NBT.TAG_COMPOUND); + + if (tagList == null) + { + return null; + } + + for (int i = 0; i < tagList.tagCount(); i++) + { + NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); + int slot = tag.getByte("Slot"); + + if (slot >= 0 && slot < invSize) + { + inv[slot] = ItemStack.loadItemStackFromNBT(tag); + } + } + + return inv; + } + + public void saveInternalInventory(ItemStack itemStack, ItemStack[] inventory) + { + NBTTagCompound itemTag = itemStack.stackTagCompound; + + if (itemTag == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + NBTTagList itemList = new NBTTagList(); + + for (int i = 0; i < invSize; i++) + { + ItemStack stack = inventory[i]; + + if (inventory[i] != null) + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setByte("Slot", (byte) i); + inventory[i].writeToNBT(tag); + itemList.appendTag(tag); + } + } + + itemTag.setTag("Inventory", itemList); + } + + public void tickInternalInventory(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) + { + ItemStack[] inv = getInternalInventory(par1ItemStack); + + if (inv == null) + { + return; + } + + for (int i = 0; i < invSize; i++) + { + if (inv[i] == null) + { + continue; + } + + inv[i].getItem().onUpdate(inv[i], par2World, par3Entity, par4, par5); + } + } + + public int getSelectedSlot(ItemStack itemStack) + { + NBTTagCompound itemTag = itemStack.stackTagCompound; + + if (itemTag == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + return itemTag.getInteger("selectedSlot"); + } + + public void selectNextSlot(ItemStack itemStack) + { + ItemStack[] inv = getInternalInventory(itemStack); + int filledSlots = 0; + + for (int i = 0; i < invSize; i++) + { + if (inv[i] != null) + { + filledSlots++; + } else + { + break; + } + } + + NBTTagCompound itemTag = itemStack.stackTagCompound; + + if (itemTag == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + if (getSelectedSlot(itemStack) + 1 < filledSlots) + { + itemTag.setInteger("selectedSlot", itemTag.getInteger("selectedSlot") + 1); + } else + { + itemTag.setInteger("selectedSlot", 0); + } + } + + public boolean hasAddedToInventory(ItemStack sigilItemStack, ItemStack addedItemStack) + { + ItemStack[] inv = getInternalInventory(sigilItemStack); + + if (inv == null) + { + return false; + } + + if (addedItemStack == null) + { + return false; + } + + Item item = addedItemStack.getItem(); + int candidateSlot = -1; + + for (int i = invSize - 1; i >= 0; i--) + { + ItemStack nextItem = inv[i]; + + if (nextItem == null) + { + candidateSlot = i; + continue; + } + + if (item == nextItem.getItem()) + { + return false; + } + } + + if (candidateSlot == -1) + { + return false; + } + + for (ItemStack i : allowedSigils) + { + if (i != null && i.getItem() == item) + { + inv[candidateSlot] = addedItemStack; + saveInternalInventory(sigilItemStack, inv); + return true; + } + } + + return false; + } + + public boolean addSigilToInventory(ItemStack sigilItemStack, EntityPlayer player) + { + ItemStack[] playerInventory = player.inventory.mainInventory; + + for (int i = 0; i < 36; i++) + { + if (this.hasAddedToInventory(sigilItemStack, playerInventory[i])) + { + player.inventory.consumeInventoryItem(playerInventory[i].getItem()); + //playerInventory[i].stackSize--; + return true; + } + } + + return false; + } + + public static void initiateSigilOfHolding() + { + allowedSigils.add(new ItemStack(ModItems.waterSigil)); + allowedSigils.add(new ItemStack(ModItems.lavaSigil)); + allowedSigils.add(new ItemStack(ModItems.voidSigil)); + allowedSigils.add(new ItemStack(ModItems.airSigil)); + allowedSigils.add(new ItemStack(ModItems.sigilOfTheFastMiner)); + allowedSigils.add(new ItemStack(ModItems.divinationSigil)); + allowedSigils.add(new ItemStack(ModItems.sigilOfElementalAffinity)); + allowedSigils.add(new ItemStack(ModItems.growthSigil)); + allowedSigils.add(new ItemStack(ModItems.sigilOfHaste)); + allowedSigils.add(new ItemStack(ModItems.sigilOfWind)); + } + + public ItemStack getCurrentItem(ItemStack sigilItemStack) + { + ItemStack[] items = this.getInternalInventory(sigilItemStack); + + if (items == null) + { + return null; + } + + return items[this.getSelectedSlot(sigilItemStack)]; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfMagnetism.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfMagnetism.java new file mode 100644 index 00000000..5be81fa4 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfMagnetism.java @@ -0,0 +1,222 @@ +package WayofTime.alchemicalWizardry.common.items.sigil; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +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 WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade +{ + private static IIcon activeIcon; + private static IIcon passiveIcon; + private int tickDelay = 300; + + public SigilOfMagnetism() + { + super(); + this.maxStackSize = 1; + //setMaxDamage(1000); + setEnergyUsed(50); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + // TODO Auto-generated constructor stub + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("I have a very magnetic personality!"); +// par3List.add("you have a green slate?"); + + if (!(par1ItemStack.stackTagCompound == null)) + { + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + par3List.add("Activated"); + } else + { + par3List.add("Deactivated"); + } + + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfMagnetism_deactivated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfMagnetism_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfMagnetism_deactivated"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.stackTagCompound == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.stackTagCompound; + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + +// @Override +// public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) +// { +// EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer); +// if(applyBonemeal(par1ItemStack,par3World,par4,par5,par6,par2EntityPlayer)) +// { +// if (par3World.isRemote) +// { +// par3World.playAuxSFX(2005, par4, par5, par6, 0); +// EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed()); +// return true; +// } +// return true; +// } +// return false; +// } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = par1ItemStack.stackTagCompound; + tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); + + if (tag.getBoolean("isActive")) + { + par1ItemStack.setItemDamage(1); + tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay); + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()); + } + } else + { + par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage()); + } + + return par1ItemStack; + } + + @Override + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) + { + if (!(par3Entity instanceof EntityPlayer)) + { + return; + } + + EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + if (par2World.getWorldTime() % tickDelay == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer) + { + EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed()); + } + + int range = 5; + int verticalRange = 5; + float posX = Math.round(par3Entity.posX); + float posY = (float) (par3Entity.posY - par3Entity.getEyeHeight()); + float posZ = Math.round(par3Entity.posZ); + List entities = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range)); + + for (EntityItem entity : entities) + { + if (entity != null && !par2World.isRemote) + { + entity.onCollideWithPlayer(par3EntityPlayer); + } + } + } + + return; + } + + @Override + public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) + { + int range = 5; + int verticalRange = 5; + float posX = Math.round(player.posX); + float posY = (float) (player.posY - player.getEyeHeight()); + float posZ = Math.round(player.posZ); + List entities = player.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range)); + + for (EntityItem entity : entities) + { + if (entity != null && !world.isRemote) + { + entity.onCollideWithPlayer(player); + } + } + } + + @Override + public boolean isUpgrade() + { + // TODO Auto-generated method stub + return true; + } + + @Override + public int getEnergyForTenSeconds() + { + // TODO Auto-generated method stub + return 25; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheBridge.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheBridge.java new file mode 100644 index 00000000..69327b4b --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheBridge.java @@ -0,0 +1,312 @@ +package WayofTime.alchemicalWizardry.common.items.sigil; + +import java.util.List; + +import javax.swing.Icon; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade +{ + private static IIcon activeIcon; + private static IIcon passiveIcon; + private int tickDelay = 200; + + public SigilOfTheBridge() + { + super(); + this.maxStackSize = 1; + //setMaxDamage(1000); + setEnergyUsed(100); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + // TODO Auto-generated constructor stub + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Activate to create a bridge"); + par3List.add("beneath your feet."); + + if (!(par1ItemStack.stackTagCompound == null)) + { + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + par3List.add("Activated"); + } else + { + par3List.add("Deactivated"); + } + + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BridgeSigil_deactivated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BridgeSigil_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:BridgeSigil_deactivated"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.stackTagCompound == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.stackTagCompound; + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + +// @Override +// public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) +// { +// +// if(applyBonemeal(par1ItemStack,par3World,par4,par5,par6,par2EntityPlayer)) +// { +// if (par3World.isRemote) +// { +// par3World.playAuxSFX(2005, par4, par5, par6, 0); +// EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed()); +// return true; +// } +// return true; +// } +// return false; +// } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = par1ItemStack.stackTagCompound; + tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); + + if (tag.getBoolean("isActive")) + { + par1ItemStack.setItemDamage(1); + tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay); + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()); + } + } else + { + par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage()); + } + + return par1ItemStack; + } + + @Override + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) + { + if (!(par3Entity instanceof EntityPlayer)) + { + return; + } + + EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + if (par2World.getWorldTime() % tickDelay == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer) + { + EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, this.getLPUsed(par1ItemStack)); + this.setLPUsed(par1ItemStack, 0); + } + +// if(par2World.isRemote) +// { +// return; +// } + if (!par3EntityPlayer.onGround && !par3EntityPlayer.isSneaking()) + { + return; + } + + int range = 2; + int verticalOffset = -1; + + if (par3EntityPlayer.isSneaking()) + { + verticalOffset--; + } + + if (par2World.isRemote) + { + verticalOffset--; + } + + int posX = (int) Math.round(par3Entity.posX - 0.5f); + int posY = (int) par3Entity.posY; + int posZ = (int) Math.round(par3Entity.posZ - 0.5f); + int incremented = 0; + + for (int ix = posX - range; ix <= posX + range; ix++) + { + for (int iz = posZ - range; iz <= posZ + range; iz++) + { + //for(int iy=posY-verticalRange;iy<=posY+verticalRange;iy++) + { + Block block = par2World.getBlock(ix, posY + verticalOffset, iz); + + + if (par2World.isAirBlock(ix, posY + verticalOffset, iz)) + { + par2World.setBlock(ix, posY + verticalOffset, iz, ModBlocks.spectralBlock, 0, 3); + + if (par2World.rand.nextInt(2) == 0) + { + incremented++; + } + } + } + } + } + + this.incrimentLPUSed(par1ItemStack, incremented); + } + + return; + } + + public int getLPUsed(ItemStack par1ItemStack) + { + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + return par1ItemStack.stackTagCompound.getInteger("LPUsed"); + } + + public void incrimentLPUSed(ItemStack par1ItemStack, int addedLP) + { + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + par1ItemStack.stackTagCompound.setInteger("LPUsed", par1ItemStack.stackTagCompound.getInteger("LPUsed") + addedLP); + } + + public void setLPUsed(ItemStack par1ItemStack, int newLP) + { + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + par1ItemStack.stackTagCompound.setInteger("LPUsed", newLP); + } + + @Override + public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) + { + if (!player.onGround && !player.isSneaking()) + { + return; + } + + int range = 2; + int verticalOffset = -1; + + if (player.isSneaking()) + { + verticalOffset--; + } + + int posX = (int) Math.round(player.posX - 0.5f); + int posY = (int) player.posY; + int posZ = (int) Math.round(player.posZ - 0.5f); + + //int incremented = 0; + + for (int ix = posX - range; ix <= posX + range; ix++) + { + for (int iz = posZ - range; iz <= posZ + range; iz++) + { + //for(int iy=posY-verticalRange;iy<=posY+verticalRange;iy++) + { + Block block = world.getBlock(ix, posY + verticalOffset, iz); + + + if (world.isAirBlock(ix, posY + verticalOffset, iz)) + { + world.setBlock(ix, posY + verticalOffset, iz, ModBlocks.spectralBlock, 0, 3); + } + } + } + } + } + + @Override + public boolean isUpgrade() + { + // TODO Auto-generated method stub + return true; + } + + @Override + public int getEnergyForTenSeconds() + { + // TODO Auto-generated method stub + return 100; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheFastMiner.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheFastMiner.java new file mode 100644 index 00000000..277e8bc6 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfTheFastMiner.java @@ -0,0 +1,194 @@ +package WayofTime.alchemicalWizardry.common.items.sigil; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade +{ + @SideOnly(Side.CLIENT) + private static IIcon activeIcon; + @SideOnly(Side.CLIENT) + private static IIcon passiveIcon; + + public SigilOfTheFastMiner() + { + super(); + this.maxStackSize = 1; + //setMaxDamage(100); + setEnergyUsed(100); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Keep going and going and going..."); + + if (!(par1ItemStack.stackTagCompound == null)) + { + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + par3List.add("Activated"); + } else + { + par3List.add("Deactivated"); + } + + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfTheFastMiner"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:MiningSigil_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:MiningSigil_deactivated"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.stackTagCompound == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.stackTagCompound; + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = par1ItemStack.stackTagCompound; + tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); + + if (tag.getBoolean("isActive")) + { + par1ItemStack.setItemDamage(1); + tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); + par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2, 1, true)); + + //Test with added health boost + //par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400,99)); + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + { + } + } + } else + { + par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage()); + } + + return par1ItemStack; + } + + @Override + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) + { + if (!(par3Entity instanceof EntityPlayer)) + { + return; + } + + EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2, 1, true)); + } + + if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + //par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400,99)); + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + { + } + } + } + + return; + } + + @Override + public void onArmourUpdate(World world, EntityPlayer player, ItemStack itemStack) + { + if (itemStack.stackTagCompound == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 3, 1, true)); + } + + @Override + public boolean isUpgrade() + { + // TODO Auto-generated method stub + return true; + } + + @Override + public int getEnergyForTenSeconds() + { + // TODO Auto-generated method stub + return 50; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfWind.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfWind.java new file mode 100644 index 00000000..dc6ddb90 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/SigilOfWind.java @@ -0,0 +1,196 @@ +package WayofTime.alchemicalWizardry.common.items.sigil; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SigilOfWind extends EnergyItems implements ArmourUpgrade +{ + @SideOnly(Side.CLIENT) + private static IIcon activeIcon; + @SideOnly(Side.CLIENT) + private static IIcon passiveIcon; + + public SigilOfWind() + { + super(); + this.maxStackSize = 1; + //setMaxDamage(100); + setEnergyUsed(250); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Best not to wear a skirt."); + + if (!(par1ItemStack.stackTagCompound == null)) + { + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + par3List.add("Activated"); + } else + { + par3List.add("Deactivated"); + } + + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WindSigil_deactivated"); + this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:WindSigil_activated"); + this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:WindSigil_deactivated"); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + if (stack.stackTagCompound == null) + { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = stack.stackTagCompound; + + if (tag.getBoolean("isActive")) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) + { + if (par1 == 1) + { + return this.activeIcon; + } else + { + return this.passiveIcon; + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound tag = par1ItemStack.stackTagCompound; + tag.setBoolean("isActive", !(tag.getBoolean("isActive"))); + + if (tag.getBoolean("isActive")) + { + par1ItemStack.setItemDamage(1); + tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200); + par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 1)); + //par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 2)); + + //Test with added health boost + //par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400,99)); + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + { + } + } + } else + { + par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage()); + } + + return par1ItemStack; + } + + @Override + public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) + { + if (!(par3Entity instanceof EntityPlayer)) + { + return; + } + + EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity; + + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + if (par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 1)); + } + + if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive")) + { + //par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 205, 1)); + + //par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 205, 2)); + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + { + } + } + } + + return; + } + + @Override + public void onArmourUpdate(World world, EntityPlayer player, ItemStack itemStack) + { + if (itemStack.stackTagCompound == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 3, 1)); + } + + @Override + public boolean isUpgrade() + { + // TODO Auto-generated method stub + return true; + } + + @Override + public int getEnergyForTenSeconds() + { + // TODO Auto-generated method stub + return 150; + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/VoidSigil.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/VoidSigil.java new file mode 100644 index 00000000..4bb65354 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/VoidSigil.java @@ -0,0 +1,239 @@ +package WayofTime.alchemicalWizardry.common.items.sigil; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.material.MaterialLiquid; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemBucket; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.FillBucketEvent; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyBattery; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class VoidSigil extends ItemBucket implements ArmourUpgrade +{ + private int isFull; + private int energyUsed; + + public VoidSigil() + { + super(null); + this.maxStackSize = 1; + //setMaxDamage(1000); + setEnergyUsed(50); + isFull = 0; + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:VoidSigil"); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Better than a Swiffer!"); + + if (!(par1ItemStack.stackTagCompound == null)) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + @Override + public ItemStack getContainerItem(ItemStack itemStack) + { + ItemStack copiedStack = itemStack.copy(); + copiedStack.setItemDamage(copiedStack.getItemDamage() + getEnergyUsed()); + copiedStack.stackSize = 1; + return copiedStack; + } + + protected void setEnergyUsed(int par1int) + { + this.energyUsed = par1int; + } + + protected int getEnergyUsed() + { + return this.energyUsed; + } + + // protected void damagePlayer(World world, EntityPlayer player, int damage) +// { +// if (world != null) +// { +// double posX = player.posX; +// double posY = player.posY; +// double posZ = player.posZ; +// world.playSoundEffect((double)((float)posX + 0.5F), (double)((float)posY + 0.5F), (double)((float)posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); +// float f = (float)1.0F; +// float f1 = f * 0.6F + 0.4F; +// float f2 = f * f * 0.7F - 0.5F; +// float f3 = f * f * 0.6F - 0.7F; +// +// for (int l = 0; l < 8; ++l) +// { +// world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); +// } +// } +// +// for (int i = 0; i < damage; i++) +// { +// //player.setEntityHealth((player.getHealth()-1)); +// player.setEntityHealth(player.func_110143_aJ() - 1); +// } +// +// if (player.func_110143_aJ() <= 0) +// { +// player.inventory.dropAllItems(); +// } +// } + protected boolean syphonBatteries(ItemStack ist, EntityPlayer player, int damageToBeDone) + { + if (!player.capabilities.isCreativeMode) + { + boolean usedBattery = false; + IInventory inventory = player.inventory; + + for (int slot = 0; slot < inventory.getSizeInventory(); slot++) + { + ItemStack stack = inventory.getStackInSlot(slot); + + if (stack == null) + { + continue; + } + + if (stack.getItem() instanceof EnergyBattery && !usedBattery) + { + if (stack.getItemDamage() <= stack.getMaxDamage() - damageToBeDone) + { + stack.setItemDamage(stack.getItemDamage() + damageToBeDone); + usedBattery = true; + } + } + } + + if (!usedBattery) + { + return false; + } + + return true; + } else + { + return true; + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + float f = 1.0F; + double d0 = par3EntityPlayer.prevPosX + (par3EntityPlayer.posX - par3EntityPlayer.prevPosX) * (double) f; + double d1 = par3EntityPlayer.prevPosY + (par3EntityPlayer.posY - par3EntityPlayer.prevPosY) * (double) f + 1.62D - (double) par3EntityPlayer.yOffset; + double d2 = par3EntityPlayer.prevPosZ + (par3EntityPlayer.posZ - par3EntityPlayer.prevPosZ) * (double) f; + boolean flag = this.isFull == 0; + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, flag); + + if (movingobjectposition == null) + { + return par1ItemStack; + } else + { + FillBucketEvent event = new FillBucketEvent(par3EntityPlayer, par1ItemStack, par2World, movingobjectposition); + + if (MinecraftForge.EVENT_BUS.post(event)) + { + return par1ItemStack; + } + + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + if (!par2World.canMineBlock(par3EntityPlayer, i, j, k)) + { + return par1ItemStack; + } + + if (this.isFull == 0) + { + if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack)) + { + return par1ItemStack; + } + + if (par2World.getBlock(i, j, k).getMaterial() instanceof MaterialLiquid) + { + par2World.setBlockToAir(i, j, k); + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + { + } + } else + { + return par1ItemStack; + } + } + } + } + + return par1ItemStack; + } + } + + /** + * Attempts to place the liquid contained inside the bucket. + */ + public boolean tryPlaceContainedLiquid(World par1World, double par2, double par4, double par6, int par8, int par9, int par10) + { + return false; + } + + @Override + public void onArmourUpdate(World world, EntityPlayer player, + ItemStack thisItemStack) + { + // TODO Auto-generated method stub + } + + @Override + public boolean isUpgrade() + { + // TODO Auto-generated method stub + return true; + } + + @Override + public int getEnergyForTenSeconds() + { + // TODO Auto-generated method stub + return 25; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/WaterSigil.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/WaterSigil.java new file mode 100644 index 00000000..474d519c --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/sigil/WaterSigil.java @@ -0,0 +1,261 @@ +package WayofTime.alchemicalWizardry.common.items.sigil; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemBucket; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.ArmourUpgrade; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class WaterSigil extends ItemBucket implements ArmourUpgrade +{ + /** + * field for checking if the bucket has been filled. + */ + private Block isFull = Blocks.water; + private int energyUsed; + + public WaterSigil() + { + super(Blocks.water); + this.maxStackSize = 1; + //setMaxDamage(1000); + setEnergyUsed(100); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WaterSigil"); + } + + @Override + public ItemStack getContainerItem(ItemStack itemStack) + { + ItemStack copiedStack = itemStack.copy(); + copiedStack.setItemDamage(copiedStack.getItemDamage() + 1); + copiedStack.stackSize = 1; + return copiedStack; + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("Infinite water, anyone?"); + + if (!(par1ItemStack.stackTagCompound == null)) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + float f = 1.0F; + double d0 = par3EntityPlayer.prevPosX + (par3EntityPlayer.posX - par3EntityPlayer.prevPosX) * (double) f; + double d1 = par3EntityPlayer.prevPosY + (par3EntityPlayer.posY - par3EntityPlayer.prevPosY) * (double) f + 1.62D - (double) par3EntityPlayer.yOffset; + double d2 = par3EntityPlayer.prevPosZ + (par3EntityPlayer.posZ - par3EntityPlayer.prevPosZ) * (double) f; + //boolean flag = this.isFull == 0; + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, false); + + if (movingobjectposition == null) + { + return par1ItemStack; + } else + { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + if (!par2World.canMineBlock(par3EntityPlayer, i, j, k)) + { + return par1ItemStack; + } + + + { + if (movingobjectposition.sideHit == 0) + { + --j; + } + + if (movingobjectposition.sideHit == 1) + { + ++j; + } + + if (movingobjectposition.sideHit == 2) + { + --k; + } + + if (movingobjectposition.sideHit == 3) + { + ++k; + } + + if (movingobjectposition.sideHit == 4) + { + --i; + } + + if (movingobjectposition.sideHit == 5) + { + ++i; + } + + if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack)) + { + return par1ItemStack; + } + + if (this.tryPlaceContainedLiquid(par2World, d0, d1, d2, i, j, k) && !par3EntityPlayer.capabilities.isCreativeMode) + { + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed())) + { + } + } else + { + return par1ItemStack; + } + } + } + } + + return par1ItemStack; + } + } + + /** + * Attempts to place the liquid contained inside the bucket. + */ + public boolean tryPlaceContainedLiquid(World par1World, double par2, double par4, double par6, int par8, int par9, int par10) + { + if (!par1World.isAirBlock(par8, par9, par10) && par1World.getBlock(par8, par9, par10).getMaterial().isSolid()) + { + return false; + } else if ((par1World.getBlock(par8, par9, par10) == Blocks.water || par1World.getBlock(par8, par9, par10) == Blocks.flowing_water) && par1World.getBlockMetadata(par8, par9, par10) == 0) + { + return false; + } else + { + if (par1World.provider.isHellWorld) + { + par1World.playSoundEffect(par2 + 0.5D, par4 + 0.5D, par6 + 0.5D, "random.fizz", 0.5F, 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F); + + for (int l = 0; l < 8; ++l) + { + par1World.spawnParticle("largesmoke", (double) par8 + Math.random(), (double) par9 + Math.random(), (double) par10 + Math.random(), 0.0D, 0.0D, 0.0D); + } + } else + { + par1World.setBlock(par8, par9, par10, this.isFull, 0, 3); + } + + return true; + } + } + + protected void setEnergyUsed(int par1int) + { + this.energyUsed = par1int; + } + + protected int getEnergyUsed() + { + return this.energyUsed; + } + //Heals the player using the item. If the player is at full health, or if the durability cannot be used any more, + //the item is not used. + +// protected void damagePlayer(World world, EntityPlayer player, int damage) +// { +// if (world != null) +// { +// double posX = player.posX; +// double posY = player.posY; +// double posZ = player.posZ; +// world.playSoundEffect((double)((float)posX + 0.5F), (double)((float)posY + 0.5F), (double)((float)posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); +// float f = (float)1.0F; +// float f1 = f * 0.6F + 0.4F; +// float f2 = f * f * 0.7F - 0.5F; +// float f3 = f * f * 0.6F - 0.7F; +// +// for (int l = 0; l < 8; ++l) +// { +// world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3); +// } +// } +// +// for (int i = 0; i < damage; i++) +// { +// //player.setEntityHealth((player.getHealth()-1)); +// player.setEntityHealth(player.func_110143_aJ() - 1); +// } +// +// if (player.func_110143_aJ() <= 0) +// { +// player.inventory.dropAllItems(); +// } +// } + + @Override + public void onArmourUpdate(World world, EntityPlayer player, + ItemStack thisItemStack) + { + // TODO Auto-generated method stub + //PotionEffect effect = new PotionEffect(Potion.waterBreathing.id, 2,9); + player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 9)); + } + + @Override + public boolean isUpgrade() + { + // TODO Auto-generated method stub + return true; + } + + @Override + public int getEnergyForTenSeconds() + { + // TODO Auto-generated method stub + return 50; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/FocusBase.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/FocusBase.java new file mode 100644 index 00000000..469c0ff6 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/FocusBase.java @@ -0,0 +1,169 @@ +package WayofTime.alchemicalWizardry.common.items.thaumcraft; + +import java.util.List; + +import javax.swing.Icon; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public abstract class FocusBase extends EnergyItems //implements IWandFocus +{ + protected IIcon ornament, depth; + + public FocusBase() + { + super(); + setMaxDamage(1); + setNoRepair(); + setMaxStackSize(1); + } + + boolean hasOrnament() + { + return false; + } + + boolean hasDepth() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + super.registerIcons(iconRegister); +// if(hasOrnament()) +// { +// ornament = iconRegister.registerIcon("AlchemicalWizardry:" + this.getUnlocalizedName() + "Orn"); +// } +// if(hasDepth()) +// { +// depth = iconRegister.registerIcon("AlchemicalWizardry:" + this.getUnlocalizedName() + "Depth"); +// } + } + + @Override + public boolean isItemTool(ItemStack par1ItemStack) + { + return true; + } + +/*erride + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4); + AspectList cost = getVisCost(); + + if (cost != null && cost.size() > 0) + { + par3List.add(StatCollector.translateToLocal(isVisCostPerTick() ? "item.Focus.cost2" : "item.Focus.cost1")); + + for (Aspect aspect : cost.getAspectsSorted()) + { + float amount = cost.getAmount(aspect) / 100.0F; + par3List.add(" " + '\u00a7' + aspect.getChatcolor() + aspect.getName() + '\u00a7' + "r x " + amount); + } + } + } + + @Override + public int getItemEnchantability() + { + return 5; + } + + @Override + public EnumRarity getRarity(ItemStack itemstack) + { + return EnumRarity.rare; + } + + @Override + public Icon getOrnament() + { + return ornament; + } + + @Override + public Icon getFocusDepthLayerIcon() + { + return depth; + } + + @Override + public WandFocusAnimation getAnimation() + { + return WandFocusAnimation.WAVE; + } + + @Override + public boolean isVisCostPerTick() + { + return false; + } + + public boolean isUseItem() + { + return isVisCostPerTick(); + } + + @Override + public ItemStack onFocusRightClick(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, MovingObjectPosition paramMovingObjectPosition) + { + if (isUseItem()) + { + paramEntityPlayer.setItemInUse(paramItemStack, Integer.MAX_VALUE); + } + + return paramItemStack; + } + + @Override + public void onUsingFocusTick(ItemStack paramItemStack, EntityPlayer paramEntityPlayer, int paramInt) + { + // NO-OP + } + + @Override + public void onPlayerStoppedUsingFocus(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, int paramInt) + { + // NO-OP + } + + @Override + public String getSortingHelper(ItemStack paramItemStack) + { + return "00"; + } + + @Override + public boolean onFocusBlockStartBreak(ItemStack paramItemStack, int paramInt1, int paramInt2, int paramInt3, EntityPlayer paramEntityPlayer) + { + return false; + } + + @Override + public boolean acceptsEnchant(int id) + { + if (id == ThaumcraftApi.enchantFrugal || + id == ThaumcraftApi.enchantPotency) + { + return true; + } + + return false; + } + + */ +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/FocusBloodBlast.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/FocusBloodBlast.java new file mode 100644 index 00000000..8d377041 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/FocusBloodBlast.java @@ -0,0 +1,191 @@ +package WayofTime.alchemicalWizardry.common.items.thaumcraft; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class FocusBloodBlast extends FocusBase +{ + //private static final AspectList visUsage = new AspectList().add(Aspect.AIR, 15).add(Aspect.ENTROPY, 45); + + private final int maxCooldown = 7; + + public static Map playerCooldown = new HashMap(); + + public FocusBloodBlast() + { + super(); + this.setUnlocalizedName("focusBloodBlast"); + this.setEnergyUsed(100); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + super.registerIcons(iconRegister); + + if (hasOrnament()) + { + ornament = iconRegister.registerIcon("AlchemicalWizardry:" + "focusBloodBlast" + "Orn"); + } + + if (hasDepth()) + { + depth = iconRegister.registerIcon("AlchemicalWizardry:" + "focusBloodBlast" + "Depth"); + } + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + //super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4); + if (!(par1ItemStack.stackTagCompound == null)) + { + if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + } + + /* + @Override + public void onUsingFocusTick(ItemStack stack, EntityPlayer par3EntityPlayer, int ticks) + { + if (AlchemicalWizardry.isThaumcraftLoaded) + { + Item item = stack.getItem(); + Class clazz = item.getClass(); + + while (!clazz.getName().equals("thaumcraft.common.items.wands.ItemWandCasting")) + { + if (clazz == Object.class) + { + return; + } + + clazz = clazz.getSuperclass(); + } + + //Item testItem = item.set + + //Method consumeAllVis = null; + try + { + if (!playerCooldown.containsKey(par3EntityPlayer.username)) + { + playerCooldown.put(par3EntityPlayer.username, 0); + } + + Method getFocusItem = clazz.getMethod("getFocusItem", ItemStack.class); + ItemStack focusStack = (ItemStack) getFocusItem.invoke(item, stack); + //int potency = EnchantmentHelper.getEnchantmentLevel(ThaumcraftApi.enchantPotency, focusStack); + int cooldown = playerCooldown.get(par3EntityPlayer.username) + 1; + playerCooldown.put(par3EntityPlayer.username, cooldown); + + if (cooldown >= this.maxCooldown) + { + Method consumeAllVis = clazz.getMethod("consumeAllVis", ItemStack.class, EntityPlayer.class, AspectList.class, boolean.class); + + if ((Boolean) consumeAllVis.invoke(item, stack, par3EntityPlayer, getVisCost(), true)) + { + playerCooldown.put(par3EntityPlayer.username, 0); + EnergyItems.checkAndSetItemOwner(focusStack, par3EntityPlayer); + World world = par3EntityPlayer.worldObj; + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + this.syphonBatteries(focusStack, par3EntityPlayer, 100); + } + + //world.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + world.playSoundAtEntity(par3EntityPlayer, "thaumcraft:wand", 0.5F, 1F); + + if (!world.isRemote) + { + //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); + world.spawnEntityInWorld(new EnergyBlastProjectile(world, par3EntityPlayer, (int) (5))); + //this.setDelay(par1ItemStack, maxDelay); + } + } + } + } catch (NoSuchMethodException e1) + { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (SecurityException e1) + { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (IllegalAccessException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalArgumentException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (InvocationTargetException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + @Override + public void onPlayerStoppedUsingFocus(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, int paramInt) + { + playerCooldown.put(paramEntityPlayer.username, 0); + } + + @Override + public String getSortingHelper(ItemStack itemstack) + { + return "BLOODBLAST"; + } + + @Override + public int getFocusColor() + { + return 0x8A0707; + } + + @Override + public AspectList getVisCost() + { + return visUsage; + } + + @Override + public boolean isVisCostPerTick() + { + return true; + } + + @Override + public WandFocusAnimation getAnimation() + { + return WandFocusAnimation.WAVE; + } + + boolean hasOrnament() + { + return true; + } + */ +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/FocusGravityWell.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/FocusGravityWell.java new file mode 100644 index 00000000..8a0e3678 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/FocusGravityWell.java @@ -0,0 +1,263 @@ +package WayofTime.alchemicalWizardry.common.items.thaumcraft; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class FocusGravityWell extends FocusBase +{ + //private static final AspectList visUsage = new AspectList().add(Aspect.AIR, 5).add(Aspect.ORDER, 5); + + private final int maxCooldown = 1; + + public static Map playerCooldown = new HashMap(); + + public FocusGravityWell() + { + super(); + this.setUnlocalizedName("focusGravityWell"); + this.setEnergyUsed(100); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + super.registerIcons(iconRegister); + + if (hasOrnament()) + { + ornament = iconRegister.registerIcon("AlchemicalWizardry:" + "focusGravityWell" + "Orn"); + } + + if (hasDepth()) + { + depth = iconRegister.registerIcon("AlchemicalWizardry:" + "focusGravityWell" + "Depth"); + } + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + //super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4); + if (!(par1ItemStack.stackTagCompound == null)) + { + if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + } + + /* + @Override + public void onUsingFocusTick(ItemStack stack, EntityPlayer par3EntityPlayer, int ticks) + { + if (AlchemicalWizardry.isThaumcraftLoaded) + { + Item item = stack.getItem(); + Class clazz = item.getClass(); + + while (!clazz.getName().equals("thaumcraft.common.items.wands.ItemWandCasting")) + { + if (clazz == Object.class) + { + return; + } + + clazz = clazz.getSuperclass(); + } + + //Item testItem = item.set + + //Method consumeAllVis = null; + try + { + if (!playerCooldown.containsKey(par3EntityPlayer.username)) + { + playerCooldown.put(par3EntityPlayer.username, 0); + } + + Method getFocusItem = clazz.getMethod("getFocusItem", ItemStack.class); + ItemStack focusStack = (ItemStack) getFocusItem.invoke(item, stack); + //int potency = EnchantmentHelper.getEnchantmentLevel(ThaumcraftApi.enchantPotency, focusStack); + int cooldown = playerCooldown.get(par3EntityPlayer.username) + 1; + playerCooldown.put(par3EntityPlayer.username, cooldown); + //if(cooldown>=this.maxCooldown) + { + Method consumeAllVis = clazz.getMethod("consumeAllVis", ItemStack.class, EntityPlayer.class, AspectList.class, boolean.class); + + if ((Boolean) consumeAllVis.invoke(item, stack, par3EntityPlayer, getVisCost(), true)) + { + playerCooldown.put(par3EntityPlayer.username, 0); + EnergyItems.checkAndSetItemOwner(focusStack, par3EntityPlayer); + Vec3 vector = par3EntityPlayer.getLookVec(); + float distance = 2; + //if(par3EntityPlayer.worldObj.isRemote) + { + List entities = par3EntityPlayer.worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(par3EntityPlayer.posX + vector.xCoord * distance - 0.5f, par3EntityPlayer.posY + vector.yCoord * distance - 0.5f, par3EntityPlayer.posZ + vector.zCoord * distance - 0.5f, par3EntityPlayer.posX + vector.xCoord * distance + 0.5f, par3EntityPlayer.posY + vector.yCoord * distance + 0.5f, par3EntityPlayer.posZ + vector.zCoord * distance + 0.5f).expand(1, 1, 1)); + + for (Entity entity : entities) + { + if (entity.getEntityName() == par3EntityPlayer.username) + { + continue; + } + + entity.motionX = par3EntityPlayer.posX + vector.xCoord * distance - entity.posX; + entity.motionY = par3EntityPlayer.posY + vector.yCoord * distance - entity.posY; + entity.motionZ = par3EntityPlayer.posZ + vector.zCoord * distance - entity.posZ; + //entity.setVelocity(par3EntityPlayer.posX+vector.xCoord*distance-entity.posX, par3EntityPlayer.posY+vector.yCoord*distance-entity.posY, par3EntityPlayer.posZ+vector.zCoord*distance-entity.posZ); + } + } + World world = par3EntityPlayer.worldObj; + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + this.syphonBatteriesWithoutParticles(focusStack, par3EntityPlayer, 10, false); + } + } + } + } catch (NoSuchMethodException e1) + { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (SecurityException e1) + { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (IllegalAccessException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalArgumentException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (InvocationTargetException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + @Override + public void onPlayerStoppedUsingFocus(ItemStack stack, World paramWorld, EntityPlayer par3EntityPlayer, int paramInt) + { + playerCooldown.put(par3EntityPlayer.username, 0); + + if (AlchemicalWizardry.isThaumcraftLoaded) + { + Item item = stack.getItem(); + Class clazz = item.getClass(); + + while (!clazz.getName().equals("thaumcraft.common.items.wands.ItemWandCasting")) + { + if (clazz == Object.class) + { + return; + } + + clazz = clazz.getSuperclass(); + } + + //Item testItem = item.set + + //Method consumeAllVis = null; + try + { + Method getFocusItem = clazz.getMethod("getFocusItem", ItemStack.class); + ItemStack focusStack = (ItemStack) getFocusItem.invoke(item, stack); + int potency = EnchantmentHelper.getEnchantmentLevel(ThaumcraftApi.enchantPotency, focusStack); + + if (potency > 0) + { + EnergyItems.checkAndSetItemOwner(focusStack, par3EntityPlayer); + Vec3 vector = par3EntityPlayer.getLookVec(); + float distance = 2; + //if(par3EntityPlayer.worldObj.isRemote) + { + List entities = par3EntityPlayer.worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(par3EntityPlayer.posX + vector.xCoord * distance - 0.5f, par3EntityPlayer.posY + vector.yCoord * distance - 0.5f, par3EntityPlayer.posZ + vector.zCoord * distance - 0.5f, par3EntityPlayer.posX + vector.xCoord * distance + 0.5f, par3EntityPlayer.posY + vector.yCoord * distance + 0.5f, par3EntityPlayer.posZ + vector.zCoord * distance + 0.5f).expand(1, 1, 1)); + + for (Entity entity : entities) + { + if (entity.getEntityName() == par3EntityPlayer.username) + { + continue; + } + + float speed = 1.0F * potency; + entity.motionX = vector.xCoord * speed; + entity.motionY = vector.yCoord * speed; + entity.motionZ = vector.zCoord * speed; + //entity.setVelocity(par3EntityPlayer.posX+vector.xCoord*distance-entity.posX, par3EntityPlayer.posY+vector.yCoord*distance-entity.posY, par3EntityPlayer.posZ+vector.zCoord*distance-entity.posZ); + } + } + } + } catch (NoSuchMethodException e1) + { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (SecurityException e1) + { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (IllegalAccessException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalArgumentException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (InvocationTargetException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + @Override + public String getSortingHelper(ItemStack itemstack) + { + return "BLOODBLAST"; + } + + @Override + public int getFocusColor() + { + return 0x8A0707; + } + + @Override + public AspectList getVisCost() + { + return visUsage; + } + + @Override + public boolean isVisCostPerTick() + { + return true; + } + + @Override + public WandFocusAnimation getAnimation() + { + return WandFocusAnimation.WAVE; + } + + boolean hasOrnament() + { + return false; + } + */ +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/ItemSanguineArmour.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/ItemSanguineArmour.java new file mode 100644 index 00000000..7551bddf --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/items/thaumcraft/ItemSanguineArmour.java @@ -0,0 +1,93 @@ +package WayofTime.alchemicalWizardry.common.items.thaumcraft; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.ArmourUpgrade; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemSanguineArmour extends ItemArmor implements ArmourUpgrade//, IGoggles, IVisDiscounter, IRevealer +{ + private static IIcon helmetIcon; + + public ItemSanguineArmour() + { + super(AlchemicalWizardry.sanguineArmourArmourMaterial, 4, 0); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + //this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem"); + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguineHelmet"); + } + + @Override + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { + //if(AlchemicalWizardry.isThaumcraftLoaded) + { + if (this == ModItems.sanguineHelmet) + { + return "alchemicalwizardry:models/armor/sanguineArmour_layer_1.png"; + } + } + return null; + } + +// @Override +// public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) +// { +// par3List.add("A pair of goggles imbued with power"); +// par3List.add("Vis discount: " + this.getVisDiscount() + "%"); +// } + + +// @Override +// public boolean showNodes(ItemStack itemstack, EntityLivingBase player) +// { +// return true; +// } + + @Override + public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) + { + return; + } + + @Override + public boolean isUpgrade() + { + return true; + } + + @Override + public int getEnergyForTenSeconds() + { + return 0; + } + +// @Override +// public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) +// { +// return true; +// } +// +// @Override +// public int getVisDiscount() +// { +// return 10; +// } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/mcmod.info b/1.7.2/java/WayofTime/alchemicalWizardry/common/mcmod.info new file mode 100644 index 00000000..cd89dc4c --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/mcmod.info @@ -0,0 +1,22 @@ +[ +{ + "modid": "AWWayofTime", + "name": "Blood Magic: Alchemical Wizardry", + "description": "Gruesome? Probably. Worth it? Definately!", + "version": "0.2.1c", + "url": "", + "updateUrl": "", + "logoFile": "", + "mcversion": "1.6.2", + "authorList": [ + "WayofTime" + ], + "credits": "", + "screenshots": [ + ], + "parent": "", + "dependencies": [ + ] +} +] + diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderConduit.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderConduit.java new file mode 100644 index 00000000..6c93e00e --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderConduit.java @@ -0,0 +1,43 @@ +package WayofTime.alchemicalWizardry.common.renderer.block; + +import WayofTime.alchemicalWizardry.common.renderer.model.ModelConduit; +import WayofTime.alchemicalWizardry.common.tileEntity.TEConduit; +import cpw.mods.fml.client.FMLClientHandler; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class RenderConduit extends TileEntitySpecialRenderer +{ + private ModelConduit modelConduit = new ModelConduit(); + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) + { + if (tileEntity instanceof TEConduit) + { + TEConduit tileConduit = (TEConduit) tileEntity; + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + /** + * Render the ghost item inside of the Altar, slowly spinning + */ + GL11.glPushMatrix(); + GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); + ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Conduit.png"); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); + GL11.glPushMatrix(); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); + //A reference to your Model file. Again, very important. + this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileConduit.getInputDirection(), tileConduit.getOutputDirection()); + //Tell it to stop rendering for both the PushMatrix's + GL11.glPopMatrix(); + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_LIGHTING); + } + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPedestal.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPedestal.java new file mode 100644 index 00000000..b1f5b4ec --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPedestal.java @@ -0,0 +1,252 @@ +package WayofTime.alchemicalWizardry.common.renderer.block; + +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + +import WayofTime.alchemicalWizardry.common.renderer.model.ModelPedestal; +import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal; +import cpw.mods.fml.client.FMLClientHandler; + +public class RenderPedestal extends TileEntitySpecialRenderer +{ + private ModelPedestal modelPedestal = new ModelPedestal(); + private final RenderItem customRenderItem; + + public RenderPedestal() + { + customRenderItem = new RenderItem() + { + @Override + public boolean shouldBob() + { + return false; + } + }; + customRenderItem.setRenderManager(RenderManager.instance); + } + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) + { + if (tileEntity instanceof TEPedestal) + { + TEPedestal tileAltar = (TEPedestal) tileEntity; + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + /** + * Render the ghost item inside of the Altar, slowly spinning + */ + GL11.glPushMatrix(); + GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); + ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Pedestal.png"); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); + GL11.glPushMatrix(); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + //A reference to your Model file. Again, very important. + this.modelPedestal.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); + //Tell it to stop rendering for both the PushMatrix's + GL11.glPopMatrix(); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + + if (tileAltar.getStackInSlot(0) != null) + { + float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0)); + float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); + EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); + ghostEntityItem.hoverStart = 0.0F; + ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0)); + //translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN); + float displacement = 0.2F; + + if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) + { + GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.7F, (float) d2 + 0.5F); + } else + { + GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.6F, (float) d2 + 0.5F); + } + + //GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F); + GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); + GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); + customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0); + } + + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_LIGHTING); + } + } + + private float getGhostItemScaleFactor(ItemStack itemStack) + { + float scaleFactor = 1.0F; + + if (itemStack != null) + { + if (itemStack.getItem() instanceof ItemBlock) + { + switch (customRenderItem.getMiniBlockCount(itemStack,(byte)1)) + { + case 1: + return 0.90F; + + case 2: + return 0.90F; + + case 3: + return 0.90F; + + case 4: + return 0.90F; + + case 5: + return 0.80F; + + default: + return 0.90F; + } + } else + { + switch (customRenderItem.getMiniItemCount(itemStack,(byte)1)) + { + case 1: + return 0.65F; + + case 2: + return 0.65F; + + case 3: + return 0.65F; + + case 4: + return 0.65F; + + default: + return 0.65F; + } + } + } + + return scaleFactor; + } + + private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, ForgeDirection forgeDirection) + { + if (ghostItemStack != null) + { + if (ghostItemStack.getItem() instanceof ItemBlock) + { + switch (forgeDirection) + { + case DOWN: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 2.7F, (float) z + 0.5F); + return; + } + + case UP: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.25F, (float) z + 0.5F); + return; + } + + case NORTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.7F); + return; + } + + case SOUTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.3F); + return; + } + + case EAST: + { + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.5F, (float) z + 0.5F); + return; + } + + case WEST: + { + GL11.glTranslatef((float) x + 0.70F, (float) y + 0.5F, (float) z + 0.5F); + return; + } + + case UNKNOWN: + { + return; + } + + default: + { + return; + } + } + } else + { + switch (forgeDirection) + { + case DOWN: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F); + return; + } + + case UP: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.20F, (float) z + 0.5F); + return; + } + + case NORTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.7F); + return; + } + + case SOUTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.3F); + return; + } + + case EAST: + { + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.4F, (float) z + 0.5F); + return; + } + + case WEST: + { + GL11.glTranslatef((float) x + 0.70F, (float) y + 0.4F, (float) z + 0.5F); + return; + } + + case UNKNOWN: + { + return; + } + + default: + { + return; + } + } + } + } + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPlinth.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPlinth.java new file mode 100644 index 00000000..14063a37 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPlinth.java @@ -0,0 +1,256 @@ +package WayofTime.alchemicalWizardry.common.renderer.block; + +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + +import WayofTime.alchemicalWizardry.common.renderer.model.ModelPlinth; +import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth; +import cpw.mods.fml.client.FMLClientHandler; + +public class RenderPlinth extends TileEntitySpecialRenderer +{ + private ModelPlinth modelPlinth = new ModelPlinth(); + private final RenderItem customRenderItem; + + public RenderPlinth() + { + customRenderItem = new RenderItem() + { + @Override + public boolean shouldBob() + { + return false; + } + }; + customRenderItem.setRenderManager(RenderManager.instance); + } + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) + { + if (tileEntity instanceof TEPlinth) + { + TEPlinth tileAltar = (TEPlinth) tileEntity; + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + /** + * Render the ghost item inside of the Altar, slowly spinning + */ + GL11.glPushMatrix(); + GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); + ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Plinth.png"); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); + GL11.glPushMatrix(); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + //A reference to your Model file. Again, very important. + this.modelPlinth.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); + //Tell it to stop rendering for both the PushMatrix's + GL11.glPopMatrix(); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + + if (tileAltar.getStackInSlot(0) != null) + { + float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0)); + EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); + ghostEntityItem.hoverStart = 0.0F; + ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0)); + //translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN); + float displacement = 0.2F; + + if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) + { + GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.7F, (float) d2 + 0.5F); + } else + { + GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 10.4f / 16.0f, (float) d2 + 0.5F - 0.1875f); + } + + //GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F); + GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); + + if (!(ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)) + { + GL11.glRotatef(90f, 1.0f, 0.0f, 0.0F); + } + + customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0); + } + + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_LIGHTING); + } + } + + private float getGhostItemScaleFactor(ItemStack itemStack) + { + float scaleFactor = 2.0F / 0.9F; + + if (itemStack != null) + { + if (itemStack.getItem() instanceof ItemBlock) + { + switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1)) + { + case 1: + return 0.90F * scaleFactor / 2; + + case 2: + return 0.90F * scaleFactor / 2; + + case 3: + return 0.90F * scaleFactor / 2; + + case 4: + return 0.90F * scaleFactor / 2; + + case 5: + return 0.80F * scaleFactor / 2; + + default: + return 0.90F * scaleFactor / 2; + } + } else + { + switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1)) + { + case 1: + return 0.65F * scaleFactor; + + case 2: + return 0.65F * scaleFactor; + + case 3: + return 0.65F * scaleFactor; + + case 4: + return 0.65F * scaleFactor; + + default: + return 0.65F * scaleFactor; + } + } + } + + return scaleFactor; + } + + private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, ForgeDirection forgeDirection) + { + if (ghostItemStack != null) + { + if (ghostItemStack.getItem() instanceof ItemBlock) + { + switch (forgeDirection) + { + case DOWN: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 2.7F, (float) z + 0.5F); + return; + } + + case UP: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.25F, (float) z + 0.5F); + return; + } + + case NORTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.7F); + return; + } + + case SOUTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.3F); + return; + } + + case EAST: + { + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.5F, (float) z + 0.5F); + return; + } + + case WEST: + { + GL11.glTranslatef((float) x + 0.70F, (float) y + 0.5F, (float) z + 0.5F); + return; + } + + case UNKNOWN: + { + return; + } + + default: + { + return; + } + } + } else + { + switch (forgeDirection) + { + case DOWN: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F); + return; + } + + case UP: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.20F, (float) z + 0.5F); + return; + } + + case NORTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.7F); + return; + } + + case SOUTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.3F); + return; + } + + case EAST: + { + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.4F, (float) z + 0.5F); + return; + } + + case WEST: + { + GL11.glTranslatef((float) x + 0.70F, (float) y + 0.4F, (float) z + 0.5F); + return; + } + + case UNKNOWN: + { + return; + } + + default: + { + return; + } + } + } + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEffectBlock.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEffectBlock.java new file mode 100644 index 00000000..134a3f98 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEffectBlock.java @@ -0,0 +1,49 @@ +package WayofTime.alchemicalWizardry.common.renderer.block; + +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEffectBlock; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock; +import cpw.mods.fml.client.FMLClientHandler; + +public class RenderSpellEffectBlock extends TileEntitySpecialRenderer +{ + private ModelSpellEffectBlock modelSpellEffectBlock = new ModelSpellEffectBlock(); + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) + { + if (tileEntity instanceof TESpellEffectBlock) + { + TESpellEffectBlock tileSpellBlock = (TESpellEffectBlock) tileEntity; + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + /** + * Render the ghost item inside of the Altar, slowly spinning + */ + GL11.glPushMatrix(); + GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); + ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/BlockSpellEffect.png"); + int meta = tileEntity.getWorldObj().getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); + String resource = tileSpellBlock.getResourceLocationForMeta(meta); + test = new ResourceLocation(resource); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); + GL11.glPushMatrix(); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); + //A reference to your Model file. Again, very important. + this.modelSpellEffectBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection()); + //Tell it to stop rendering for both the PushMatrix's + GL11.glPopMatrix(); + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_LIGHTING); + } + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderWritingTable.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderWritingTable.java new file mode 100644 index 00000000..ef098839 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderWritingTable.java @@ -0,0 +1,333 @@ +package WayofTime.alchemicalWizardry.common.renderer.block; + +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + +import WayofTime.alchemicalWizardry.common.renderer.model.ModelWritingTable; +import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; +import cpw.mods.fml.client.FMLClientHandler; + +public class RenderWritingTable extends TileEntitySpecialRenderer +{ + private ModelWritingTable modelWritingTable = new ModelWritingTable(); + private final RenderItem customRenderItem; +// private final RenderItem customRenderItem1; +// private final RenderItem customRenderItem2; +// private final RenderItem customRenderItem3; +// private final RenderItem customRenderItem4; +// private final RenderItem customRenderItem5; + + public RenderWritingTable() + { + customRenderItem = new RenderItem() + { + @Override + public boolean shouldBob() + { + return false; + } + }; + customRenderItem.setRenderManager(RenderManager.instance); + } + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) + { + if (tileEntity instanceof TEWritingTable) + { + TEWritingTable tileAltar = (TEWritingTable) tileEntity; + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glPushMatrix(); + GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); + ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/WritingTable.png"); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); + GL11.glPushMatrix(); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + //A reference to your Model file. Again, very important. + this.modelWritingTable.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); + //Tell it to stop rendering for both the PushMatrix's + GL11.glPopMatrix(); + GL11.glPopMatrix(); + + for (int i = 1; i <= 6; i++) + { + GL11.glPushMatrix(); + + if (tileAltar.getStackInSlot(i) != null) + { + float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(i)); + float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); + EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); + ghostEntityItem.hoverStart = 0.0F; + ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(i)); + //translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN); + float displacementX = getXDisplacementForSlot(i); + float displacementY = getYDisplacementForSlot(i); + float displacementZ = getZDisplacementForSlot(i); + + if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) + { + GL11.glTranslatef((float) d0 + 0.5F + displacementX, (float) d1 + displacementY + 0.7F, (float) d2 + 0.5F + displacementZ); + } else + { + GL11.glTranslatef((float) d0 + 0.5F + displacementX, (float) d1 + displacementY + 0.6F, (float) d2 + 0.5F + displacementZ); + } + + //GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F); + GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); + GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); + customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0); + } + + GL11.glPopMatrix(); + } + + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_LIGHTING); + } + } + + private float getGhostItemScaleFactor(ItemStack itemStack) + { + float scaleFactor = 0.8F; + + if (itemStack != null) + { + if (itemStack.getItem() instanceof ItemBlock) + { + switch (customRenderItem.getMiniBlockCount(itemStack,(byte)1)) + { + case 1: + return 0.90F * scaleFactor; + + case 2: + return 0.90F * scaleFactor; + + case 3: + return 0.90F * scaleFactor; + + case 4: + return 0.90F * scaleFactor; + + case 5: + return 0.80F * scaleFactor; + + default: + return 0.90F * scaleFactor; + } + } else + { + switch (customRenderItem.getMiniItemCount(itemStack,(byte)1)) + { + case 1: + return 0.65F * scaleFactor; + + case 2: + return 0.65F * scaleFactor; + + case 3: + return 0.65F * scaleFactor; + + case 4: + return 0.65F * scaleFactor; + + default: + return 0.65F * scaleFactor; + } + } + } + + return scaleFactor; + } + + private float getXDisplacementForSlot(int slot) + { + switch (slot) + { + case 0: + return 0.0f; + + case 1: + return -0.375f; + + case 2: + return -0.125f; + + case 3: + return 0.3125f; + + case 4: + return 0.3125f; + + case 5: + return -0.125f; + + default: + return 0.0f; + } + } + + private float getYDisplacementForSlot(int slot) + { + switch (slot) + { + case 0: + return 0.4f; + + case 1: + return -0.35f; + + case 6: + return 0.4f; + + default: + return -0.35f; + } + } + + private float getZDisplacementForSlot(int slot) + { + switch (slot) + { + case 0: + return 0.0f; + + case 1: + return 0.0f; + + case 2: + return 0.375f; + + case 3: + return 0.25f; + + case 4: + return -0.25f; + + case 5: + return -0.375f; + + default: + return 0.0f; + } + } + + private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, ForgeDirection forgeDirection) + { + if (ghostItemStack != null) + { + if (ghostItemStack.getItem() instanceof ItemBlock) + { + switch (forgeDirection) + { + case DOWN: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 2.7F, (float) z + 0.5F); + return; + } + + case UP: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.25F, (float) z + 0.5F); + return; + } + + case NORTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.7F); + return; + } + + case SOUTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.3F); + return; + } + + case EAST: + { + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.5F, (float) z + 0.5F); + return; + } + + case WEST: + { + GL11.glTranslatef((float) x + 0.70F, (float) y + 0.5F, (float) z + 0.5F); + return; + } + + case UNKNOWN: + { + return; + } + + default: + { + return; + } + } + } else + { + switch (forgeDirection) + { + case DOWN: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F); + return; + } + + case UP: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.20F, (float) z + 0.5F); + return; + } + + case NORTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.7F); + return; + } + + case SOUTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.3F); + return; + } + + case EAST: + { + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.4F, (float) z + 0.5F); + return; + } + + case WEST: + { + GL11.glTranslatef((float) x + 0.70F, (float) y + 0.4F, (float) z + 0.5F); + return; + } + + case UNKNOWN: + { + return; + } + + default: + { + return; + } + } + } + } + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/TEAltarRenderer.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/TEAltarRenderer.java new file mode 100644 index 00000000..20353e77 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/TEAltarRenderer.java @@ -0,0 +1,241 @@ +package WayofTime.alchemicalWizardry.common.renderer.block; + +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + +import WayofTime.alchemicalWizardry.common.renderer.model.ModelBloodAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; + +public class TEAltarRenderer extends TileEntitySpecialRenderer +{ + private ModelBloodAltar modelBloodAltar = new ModelBloodAltar(); + private final RenderItem customRenderItem; + + public TEAltarRenderer() + { + customRenderItem = new RenderItem() + { + @Override + public boolean shouldBob() + { + return false; + } + }; + customRenderItem.setRenderManager(RenderManager.instance); + } + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) + { + modelBloodAltar.renderBloodAltar((TEAltar) tileEntity, d0, d1, d2); + modelBloodAltar.renderBloodLevel((TEAltar) tileEntity, d0, d1, d2); + + if (tileEntity instanceof TEAltar) + { + TEAltar tileAltar = (TEAltar) tileEntity; + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + /** + * Render the ghost item inside of the Altar, slowly spinning + */ + GL11.glPushMatrix(); + + if (tileAltar.getStackInSlot(0) != null) + { + float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0)); + float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); + EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj()); + ghostEntityItem.hoverStart = 0.0F; + ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0)); + //translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN); + float displacement = 0.2F; + + if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) + { + GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.7F, (float) d2 + 0.5F); + } else + { + GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.6F, (float) d2 + 0.5F); + } + + //GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F); + GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); + GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); + customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0); + } + + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_LIGHTING); + } + } + + private float getGhostItemScaleFactor(ItemStack itemStack) + { + float scaleFactor = 1.0F; + + if (itemStack != null) + { + if (itemStack.getItem() instanceof ItemBlock) + { + switch (customRenderItem.getMiniBlockCount(itemStack,(byte)1)) + { + case 1: + return 0.90F; + + case 2: + return 0.90F; + + case 3: + return 0.90F; + + case 4: + return 0.90F; + + case 5: + return 0.80F; + + default: + return 0.90F; + } + } else + { + switch (customRenderItem.getMiniItemCount(itemStack,(byte)1)) + { + case 1: + return 0.65F; + + case 2: + return 0.65F; + + case 3: + return 0.65F; + + case 4: + return 0.65F; + + default: + return 0.65F; + } + } + } + + return scaleFactor; + } + + private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, ForgeDirection forgeDirection) + { + if (ghostItemStack != null) + { + if (ghostItemStack.getItem() instanceof ItemBlock) + { + switch (forgeDirection) + { + case DOWN: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 2.7F, (float) z + 0.5F); + return; + } + + case UP: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.25F, (float) z + 0.5F); + return; + } + + case NORTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.7F); + return; + } + + case SOUTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.3F); + return; + } + + case EAST: + { + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.5F, (float) z + 0.5F); + return; + } + + case WEST: + { + GL11.glTranslatef((float) x + 0.70F, (float) y + 0.5F, (float) z + 0.5F); + return; + } + + case UNKNOWN: + { + return; + } + + default: + { + return; + } + } + } else + { + switch (forgeDirection) + { + case DOWN: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F); + return; + } + + case UP: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.20F, (float) z + 0.5F); + return; + } + + case NORTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.7F); + return; + } + + case SOUTH: + { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.3F); + return; + } + + case EAST: + { + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.4F, (float) z + 0.5F); + return; + } + + case WEST: + { + GL11.glTranslatef((float) x + 0.70F, (float) y + 0.4F, (float) z + 0.5F); + return; + } + + case UNKNOWN: + { + return; + } + + default: + { + return; + } + } + } + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEAltarItemRenderer.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEAltarItemRenderer.java new file mode 100644 index 00000000..70cc34f7 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEAltarItemRenderer.java @@ -0,0 +1,81 @@ +package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; + +import WayofTime.alchemicalWizardry.common.renderer.model.ModelBloodAltar; +import cpw.mods.fml.client.FMLClientHandler; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.IItemRenderer; +import org.lwjgl.opengl.GL11; + +public class TEAltarItemRenderer implements IItemRenderer +{ + private ModelBloodAltar modelBloodAltar; + + public TEAltarItemRenderer() + { + modelBloodAltar = new ModelBloodAltar(); + } + + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + // TODO Auto-generated method stub + return true; + } + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + // TODO Auto-generated method stub + return true; + } + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) + { + float scale = 0.08f; + + // TODO Auto-generated method stub + switch (type) + { + case ENTITY: + { + renderBloodAltar(0f, 0f, 0f, scale); + return; + } + + case EQUIPPED: + { + renderBloodAltar(0f, 0f, 0f, scale); + return; + } + + case INVENTORY: + { + renderBloodAltar(0f, -0.25f, 0f, scale); + return; + } + + default: + return; + } + } + + private void renderBloodAltar(float x, float y, float z, float scale) + { + GL11.glPushMatrix(); + // Disable Lighting Calculations + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glTranslatef(x, y, z); + GL11.glScalef(scale, scale, scale); + GL11.glRotatef(180f, 0f, 1f, 0f); + //FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/OBJTutorial/textures/models/TutBox.png"); + ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/altar.png"); + //FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/alchemicalwizardry/textures/models/altar.png"); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); + modelBloodAltar.renderBloodAltar(); + // Re-enable Lighting Calculations + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEConduitItemRenderer.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEConduitItemRenderer.java new file mode 100644 index 00000000..bf875589 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEConduitItemRenderer.java @@ -0,0 +1,95 @@ +package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelConduit; +import cpw.mods.fml.client.FMLClientHandler; + +public class TEConduitItemRenderer implements IItemRenderer +{ + private ModelConduit modelConduit = new ModelConduit(); + + private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) + { + Tessellator tessellator = Tessellator.instance; + + Block block = ModBlocks.blockConduit; + + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + /** + * Render the ghost item inside of the Altar, slowly spinning + */ + GL11.glPushMatrix(); + GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); + ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Conduit.png"); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); + GL11.glPushMatrix(); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); + //A reference to your Model file. Again, very important. + this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP); + //Tell it to stop rendering for both the PushMatrix's + GL11.glPopMatrix(); + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_LIGHTING); + } + + + /** + * IItemRenderer implementation * + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + switch (type) { + case ENTITY: + return true; + case EQUIPPED: + return true; + case EQUIPPED_FIRST_PERSON: + return true; + case INVENTORY: + return true; + default: + return false; + } + } + + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return true; + } + + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + switch (type) { + case ENTITY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + case EQUIPPED: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case EQUIPPED_FIRST_PERSON: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case INVENTORY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + default: + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEffectBlockItemRenderer.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEffectBlockItemRenderer.java new file mode 100644 index 00000000..30cb938a --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEffectBlockItemRenderer.java @@ -0,0 +1,108 @@ +package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEffectBlock; +import cpw.mods.fml.client.FMLClientHandler; + +public class TESpellEffectBlockItemRenderer implements IItemRenderer +{ + private ModelSpellEffectBlock modelSpellBlock = new ModelSpellEffectBlock(); + + private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) + { + Tessellator tessellator = Tessellator.instance; + + Block block = ModBlocks.blockSpellEffect; + //Icon icon = item.getItem().getIconFromDamage(0); + + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + /** + * Render the ghost item inside of the Altar, slowly spinning + */ + GL11.glPushMatrix(); + GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); + ResourceLocation test = new ResourceLocation(this.getResourceLocationForMeta(item.getItemDamage())); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); + GL11.glPushMatrix(); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); + //A reference to your Model file. Again, very important. + this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP); + //Tell it to stop rendering for both the PushMatrix's + GL11.glPopMatrix(); + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_LIGHTING); + } + + + /** + * IItemRenderer implementation * + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + switch (type) { + case ENTITY: + return true; + case EQUIPPED: + return true; + case EQUIPPED_FIRST_PERSON: + return true; + case INVENTORY: + return true; + default: + return false; + } + } + + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return true; + } + + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + switch (type) { + case ENTITY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + case EQUIPPED: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case EQUIPPED_FIRST_PERSON: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case INVENTORY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + default: + } + } + + public String getResourceLocationForMeta(int meta) + { + switch(meta) + { + case 0: return "alchemicalwizardry:textures/models/SpellEffectFire.png"; + case 1: return "alchemicalwizardry:textures/models/SpellEffectIce.png"; + case 2: return "alchemicalwizardry:textures/models/SpellEffectWind.png"; + case 3: return "alchemicalwizardry:textures/models/SpellEffectEarth.png"; + } + return ""; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEWritingTableItemRenderer.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEWritingTableItemRenderer.java new file mode 100644 index 00000000..9705879c --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEWritingTableItemRenderer.java @@ -0,0 +1,82 @@ +package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; + +import WayofTime.alchemicalWizardry.common.renderer.model.ModelWritingTable; +import cpw.mods.fml.client.FMLClientHandler; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.IItemRenderer; +import org.lwjgl.opengl.GL11; + +public class TEWritingTableItemRenderer implements IItemRenderer +{ + private ModelWritingTable modelBloodAltar; + + public TEWritingTableItemRenderer() + { + modelBloodAltar = new ModelWritingTable(); + } + + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + // TODO Auto-generated method stub + return true; + } + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + // TODO Auto-generated method stub + return true; + } + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) + { + float scale = 0.08f; + + // TODO Auto-generated method stub + switch (type) + { + case ENTITY: + { + renderBloodAltar(0f, 0f, 0f, scale); + return; + } + + case EQUIPPED: + { + renderBloodAltar(0f, 0f, 0f, scale); + return; + } + + case INVENTORY: + { + renderBloodAltar(0f, -0.25f, 0f, scale); + return; + } + + default: + return; + } + } + + private void renderBloodAltar(float x, float y, float z, float scale) + { + GL11.glPushMatrix(); + // Disable Lighting Calculations + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glTranslatef(x, y, z); + GL11.glScalef(scale, scale, scale); + GL11.glRotatef(180f, 0f, 1f, 0f); + //FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/OBJTutorial/textures/models/TutBox.png"); + ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/WritingTable.png"); + //FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/alchemicalwizardry/textures/models/altar.png"); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); + modelBloodAltar.render((Entity) null, 0, 0, 0, 0, 0, 0); + // Re-enable Lighting Calculations + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBileDemon.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBileDemon.java new file mode 100644 index 00000000..b09c6ca7 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBileDemon.java @@ -0,0 +1,27 @@ +package WayofTime.alchemicalWizardry.common.renderer.mob; + +import WayofTime.alchemicalWizardry.common.entity.mob.EntityBileDemon; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +public class RenderBileDemon extends RenderLiving +{ + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/BileDemon.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + + public RenderBileDemon(ModelBase par1ModelBase, float par2) + { + super(par1ModelBase, par2); + } + + public ResourceLocation func_110832_a(EntityBileDemon par1EntityBileDemon) + { + return field_110833_a; + } + + public ResourceLocation getEntityTexture(Entity par1Entity) + { + return this.func_110832_a((EntityBileDemon) par1Entity); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBoulderFist.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBoulderFist.java new file mode 100644 index 00000000..6db35edd --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderBoulderFist.java @@ -0,0 +1,27 @@ +package WayofTime.alchemicalWizardry.common.renderer.mob; + +import WayofTime.alchemicalWizardry.common.entity.mob.EntityBoulderFist; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +public class RenderBoulderFist extends RenderLiving +{ + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/BoulderFist.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + + public RenderBoulderFist(ModelBase par1ModelBase, float par2) + { + super(par1ModelBase, par2); + } + + public ResourceLocation func_110832_a(EntityBoulderFist par1EntityBoulderFist) + { + return field_110833_a; + } + + public ResourceLocation getEntityTexture(Entity par1Entity) + { + return this.func_110832_a((EntityBoulderFist) par1Entity); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderElemental.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderElemental.java new file mode 100644 index 00000000..485adc3a --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderElemental.java @@ -0,0 +1,63 @@ +package WayofTime.alchemicalWizardry.common.renderer.mob; + +import WayofTime.alchemicalWizardry.common.EntityAirElemental; +import WayofTime.alchemicalWizardry.common.entity.mob.*; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +public class RenderElemental extends RenderLiving +{ + private static final ResourceLocation airBeacon = new ResourceLocation("alchemicalwizardry", "textures/models/AirFloatingBeacon.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + private static final ResourceLocation waterBeacon = new ResourceLocation("alchemicalwizardry", "textures/models/WaterFloatingBeacon.png"); + private static final ResourceLocation earthBeacon = new ResourceLocation("alchemicalwizardry", "textures/models/EarthFloatingBeacon.png"); + private static final ResourceLocation fireBeacon = new ResourceLocation("alchemicalwizardry", "textures/models/FireFloatingBeacon.png"); + private static final ResourceLocation shadeBeacon = new ResourceLocation("alchemicalwizardry", "textures/models/DarkFloatingBeacon.png"); + private static final ResourceLocation holyBeacon = new ResourceLocation("alchemicalwizardry", "textures/models/HolyFloatingBeacon.png"); + + public RenderElemental(ModelBase par1ModelBase, float par2) + { + super(par1ModelBase, par2); + } + + public ResourceLocation func_110832_a(EntityElemental par1EntityElemental) + { + if (par1EntityElemental instanceof EntityAirElemental) + { + return airBeacon; + } + + if (par1EntityElemental instanceof EntityWaterElemental) + { + return waterBeacon; + } + + if (par1EntityElemental instanceof EntityEarthElemental) + { + return earthBeacon; + } + + if (par1EntityElemental instanceof EntityFireElemental) + { + return fireBeacon; + } + + if (par1EntityElemental instanceof EntityShadeElemental) + { + return shadeBeacon; + } + + if (par1EntityElemental instanceof EntityHolyElemental) + { + return holyBeacon; + } + + return airBeacon; + } + + public ResourceLocation getEntityTexture(Entity par1Entity) + { + return this.func_110832_a((EntityElemental) par1Entity); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderFallenAngel.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderFallenAngel.java new file mode 100644 index 00000000..28a18eaa --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderFallenAngel.java @@ -0,0 +1,30 @@ +package WayofTime.alchemicalWizardry.common.renderer.mob; + +import WayofTime.alchemicalWizardry.common.entity.mob.EntityFallenAngel; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class RenderFallenAngel extends RenderLiving +{ + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/WingedAngel.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + + public RenderFallenAngel(ModelBase par1ModelBase, float par2) + { + super(par1ModelBase, par2); + } + + public ResourceLocation func_110832_a(EntityFallenAngel par1EntityFallenAngel) + { + return field_110833_a; + } + + public ResourceLocation getEntityTexture(Entity par1Entity) + { + return this.func_110832_a((EntityFallenAngel) par1Entity); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderIceDemon.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderIceDemon.java new file mode 100644 index 00000000..e7dd7219 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderIceDemon.java @@ -0,0 +1,27 @@ +package WayofTime.alchemicalWizardry.common.renderer.mob; + +import WayofTime.alchemicalWizardry.common.entity.mob.EntityIceDemon; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +public class RenderIceDemon extends RenderLiving +{ + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/IceDemon.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + + public RenderIceDemon(ModelBase par1ModelBase, float par2) + { + super(par1ModelBase, par2); + } + + public ResourceLocation func_110832_a(EntityIceDemon par1EntityIceDemon) + { + return field_110833_a; + } + + public ResourceLocation getEntityTexture(Entity par1Entity) + { + return this.func_110832_a((EntityIceDemon) par1Entity); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderLowerGuardian.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderLowerGuardian.java new file mode 100644 index 00000000..4eeaa4d3 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderLowerGuardian.java @@ -0,0 +1,27 @@ +package WayofTime.alchemicalWizardry.common.renderer.mob; + +import WayofTime.alchemicalWizardry.common.entity.mob.EntityLowerGuardian; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +public class RenderLowerGuardian extends RenderLiving +{ + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/LowerGuardian.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + + public RenderLowerGuardian(ModelBase par1ModelBase, float par2) + { + super(par1ModelBase, par2); + } + + public ResourceLocation func_110832_a(EntityLowerGuardian par1EntityLowerGuardian) + { + return field_110833_a; + } + + public ResourceLocation getEntityTexture(Entity par1Entity) + { + return this.func_110832_a((EntityLowerGuardian) par1Entity); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderShade.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderShade.java new file mode 100644 index 00000000..38868202 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderShade.java @@ -0,0 +1,27 @@ +package WayofTime.alchemicalWizardry.common.renderer.mob; + +import WayofTime.alchemicalWizardry.common.entity.mob.EntityShade; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +public class RenderShade extends RenderLiving +{ + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/ShadeMob.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + + public RenderShade(ModelBase par1ModelBase, float par2) + { + super(par1ModelBase, par2); + } + + public ResourceLocation func_110832_a(EntityShade par1EntityShade) + { + return field_110833_a; + } + + public ResourceLocation getEntityTexture(Entity par1Entity) + { + return this.func_110832_a((EntityShade) par1Entity); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderSmallEarthGolem.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderSmallEarthGolem.java new file mode 100644 index 00000000..16772df4 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderSmallEarthGolem.java @@ -0,0 +1,27 @@ +package WayofTime.alchemicalWizardry.common.renderer.mob; + +import WayofTime.alchemicalWizardry.common.entity.mob.EntitySmallEarthGolem; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +public class RenderSmallEarthGolem extends RenderLiving +{ + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/SmallEarthGolem.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + + public RenderSmallEarthGolem(ModelBase par1ModelBase, float par2) + { + super(par1ModelBase, par2); + } + + public ResourceLocation func_110832_a(EntitySmallEarthGolem par1EntitySmallEarthGolem) + { + return field_110833_a; + } + + public ResourceLocation getEntityTexture(Entity par1Entity) + { + return this.func_110832_a((EntitySmallEarthGolem) par1Entity); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderWingedFireDemon.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderWingedFireDemon.java new file mode 100644 index 00000000..826f7832 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/mob/RenderWingedFireDemon.java @@ -0,0 +1,27 @@ +package WayofTime.alchemicalWizardry.common.renderer.mob; + +import WayofTime.alchemicalWizardry.common.entity.mob.EntityWingedFireDemon; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +public class RenderWingedFireDemon extends RenderLiving +{ + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/WingedFireDemon.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + + public RenderWingedFireDemon(ModelBase par1ModelBase, float par2) + { + super(par1ModelBase, par2); + } + + public ResourceLocation func_110832_a(EntityWingedFireDemon par1EntityWingedFireDemon) + { + return field_110833_a; + } + + public ResourceLocation getEntityTexture(Entity par1Entity) + { + return this.func_110832_a((EntityWingedFireDemon) par1Entity); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBileDemon.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBileDemon.java new file mode 100644 index 00000000..e09db58e --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBileDemon.java @@ -0,0 +1,181 @@ +package WayofTime.alchemicalWizardry.common.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +public class ModelBileDemon extends ModelBase +{ + //fields + ModelRenderer belly; + ModelRenderer chest; + ModelRenderer head; + ModelRenderer nose; + ModelRenderer leftHorn; + ModelRenderer leftArmSpacer; + ModelRenderer leftArm; + ModelRenderer leftChain; + ModelRenderer leftBall; + ModelRenderer rightHorn; + ModelRenderer rightChain; + ModelRenderer rightBall; + ModelRenderer rightArmSpacer; + ModelRenderer rightArm; + + public ModelBileDemon() + { + textureWidth = 128; + textureHeight = 64; + belly = new ModelRenderer(this, 0, 31); + belly.addBox(-8F, -1F, -10F, 16, 15, 18); + belly.setRotationPoint(0F, 10F, 0F); + belly.setTextureSize(128, 64); + belly.mirror = true; + setRotation(belly, 0F, 0F, 0F); + chest = new ModelRenderer(this, 70, 46); + chest.addBox(-7F, -4F, -6F, 14, 4, 14); + chest.setRotationPoint(0F, 10F, 0F); + chest.setTextureSize(128, 64); + chest.mirror = true; + setRotation(chest, -0.1115358F, 0F, 0F); + head = new ModelRenderer(this, 0, 0); + head.addBox(-4F, -8F, -4F, 8, 8, 8); + head.setRotationPoint(0F, 6F, 3F); + head.setTextureSize(128, 64); + head.mirror = true; + setRotation(head, 0F, 0F, 0F); + nose = new ModelRenderer(this, 0, 0); + nose.addBox(-1F, -4F, -5F, 2, 1, 1); + nose.setRotationPoint(0F, 6F, 3F); + nose.setTextureSize(128, 64); + nose.mirror = true; + setRotation(nose, 0F, 0F, 0F); + leftHorn = new ModelRenderer(this, 93, 1); + leftHorn.addBox(4F, -7F, 0F, 16, 1, 1); + leftHorn.setRotationPoint(0F, 6F, 3F); + leftHorn.setTextureSize(128, 64); + leftHorn.mirror = true; + setRotation(leftHorn, 0F, 0F, 0F); + leftArmSpacer = new ModelRenderer(this, 80, 1); + leftArmSpacer.addBox(0F, -2F, -2F, 1, 4, 4); + leftArmSpacer.setRotationPoint(7F, 8F, 3F); + leftArmSpacer.setTextureSize(128, 64); + leftArmSpacer.mirror = true; + setRotation(leftArmSpacer, 0F, 0F, 0F); + leftArm = new ModelRenderer(this, 62, 1); + leftArm.addBox(1F, -2F, -2F, 4, 18, 4); + leftArm.setRotationPoint(7F, 8F, 3F); + leftArm.setTextureSize(128, 64); + leftArm.mirror = true; + setRotation(leftArm, 0F, 0F, 0F); + leftChain = new ModelRenderer(this, 95, 5); + leftChain.addBox(17F, -6F, 0F, 1, 6, 1); + leftChain.setRotationPoint(0F, 6F, 3F); + leftChain.setTextureSize(128, 64); + leftChain.mirror = true; + setRotation(leftChain, 0F, 0F, 0F); + leftBall = new ModelRenderer(this, 107, 4); + leftBall.addBox(15F, 0F, -2F, 5, 5, 5); + leftBall.setRotationPoint(0F, 6F, 3F); + leftBall.setTextureSize(128, 64); + leftBall.mirror = true; + setRotation(leftBall, 0F, 0F, 0F); + rightHorn = new ModelRenderer(this, 93, 1); + rightHorn.mirror = true; + rightHorn.addBox(-20F, -7F, 0F, 16, 1, 1); + rightHorn.setRotationPoint(0F, 6F, 3F); + rightHorn.setTextureSize(128, 64); + rightHorn.mirror = true; + setRotation(rightHorn, 0F, 0F, 0F); + rightHorn.mirror = false; + rightChain = new ModelRenderer(this, 95, 5); + rightChain.mirror = true; + rightChain.addBox(-18F, -6F, 0F, 1, 6, 1); + rightChain.setRotationPoint(0F, 6F, 3F); + rightChain.setTextureSize(128, 64); + rightChain.mirror = true; + setRotation(rightChain, 0F, 0F, 0F); + rightChain.mirror = false; + rightBall = new ModelRenderer(this, 107, 4); + rightBall.mirror = true; + rightBall.addBox(-20F, 0F, -2F, 5, 5, 5); + rightBall.setRotationPoint(0F, 6F, 3F); + rightBall.setTextureSize(128, 64); + rightBall.mirror = true; + setRotation(rightBall, 0F, 0F, 0F); + rightBall.mirror = false; + rightArmSpacer = new ModelRenderer(this, 80, 1); + rightArmSpacer.mirror = true; + rightArmSpacer.addBox(-1F, -2F, -2F, 1, 4, 4); + rightArmSpacer.setRotationPoint(-7F, 8F, 3F); + rightArmSpacer.setTextureSize(128, 64); + rightArmSpacer.mirror = true; + setRotation(rightArmSpacer, 0F, 0F, 0F); + rightArmSpacer.mirror = false; + rightArm = new ModelRenderer(this, 62, 1); + rightArm.mirror = true; + rightArm.addBox(-5F, -2F, -2F, 4, 18, 4); + rightArm.setRotationPoint(-7F, 8F, 3F); + rightArm.setTextureSize(128, 64); + rightArm.mirror = true; + setRotation(rightArm, 0F, 0F, 0F); + rightArm.mirror = false; + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + float scale = 1.3f; + GL11.glScalef(scale, scale, scale); + GL11.glTranslatef(0.0f, -(6.0f / 16.0f), 0.0f); + belly.render(f5); + chest.render(f5); + head.render(f5); + nose.render(f5); + leftHorn.render(f5); + leftArmSpacer.render(f5); + leftArm.render(f5); + leftChain.render(f5); + leftBall.render(f5); + rightHorn.render(f5); + rightChain.render(f5); + rightBall.render(f5); + rightArmSpacer.render(f5); + rightArm.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + this.head.rotateAngleX = f4 / (180F / (float) Math.PI); + this.head.rotateAngleY = f3 / (180F / (float) Math.PI); + this.rightArm.rotateAngleX = MathHelper.cos(f * 0.3662F + (float) Math.PI) * 1.0F * f1; + this.leftArm.rotateAngleX = MathHelper.cos(f * 0.3662F) * 1.0F * f1; + this.rightArmSpacer.rotateAngleX = MathHelper.cos(f * 0.3662F + (float) Math.PI) * 1.0F * f1; + this.leftArmSpacer.rotateAngleX = MathHelper.cos(f * 0.3662F) * 1.0F * f1; + this.leftBall.rotateAngleX = this.head.rotateAngleX; + this.leftBall.rotateAngleY = this.head.rotateAngleY; + this.rightBall.rotateAngleX = this.head.rotateAngleX; + this.rightBall.rotateAngleY = this.head.rotateAngleY; + this.leftChain.rotateAngleX = this.head.rotateAngleX; + this.leftChain.rotateAngleY = this.head.rotateAngleY; + this.rightChain.rotateAngleX = this.head.rotateAngleX; + this.rightChain.rotateAngleY = this.head.rotateAngleY; + this.leftHorn.rotateAngleX = this.head.rotateAngleX; + this.leftHorn.rotateAngleY = this.head.rotateAngleY; + this.rightHorn.rotateAngleX = this.head.rotateAngleX; + this.rightHorn.rotateAngleY = this.head.rotateAngleY; + this.nose.rotateAngleX = this.head.rotateAngleX; + this.nose.rotateAngleY = this.head.rotateAngleY; + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBloodAltar.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBloodAltar.java new file mode 100644 index 00000000..eba407bb --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBloodAltar.java @@ -0,0 +1,72 @@ +package WayofTime.alchemicalWizardry.common.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.AdvancedModelLoader; +import net.minecraftforge.client.model.IModelCustom; + +import org.lwjgl.opengl.GL11; + +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import cpw.mods.fml.client.FMLClientHandler; + +public class ModelBloodAltar extends ModelBase +{ + private IModelCustom modelBloodAltar; + private IModelCustom modelBloodLevel; //TODO + + public ModelBloodAltar() + { + modelBloodAltar = AdvancedModelLoader.loadModel(new ResourceLocation("alchemicalwizardry:models/bloodaltar-fixeUV.obj")); + modelBloodLevel = AdvancedModelLoader.loadModel(new ResourceLocation("alchemicalwizardry:models/bloodlevel.obj")); + } + + public void renderBloodAltar() + { + modelBloodAltar.renderAll(); + } + + public void renderBloodLevel() + { + modelBloodLevel.renderAll(); + } + + public void renderBloodAltar(TEAltar altar, double x, double y, double z) + { + float scale = 0.1f; + // Push a blank matrix onto the stack + GL11.glPushMatrix(); + // Move the object into the correct position on the block (because the OBJ's origin is the center of the object) + GL11.glTranslatef((float) x + 0.5f, (float) y, (float) z + 0.5f); + // Scale our object to about half-size in all directions (the OBJ file is a little large) + GL11.glScalef(scale, scale, scale); + // Bind the texture, so that OpenGL properly textures our block. + ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/altar.png"); + //FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/alchemicalwizardry/textures/models/altar.png"); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); + // Render the object, using modelTutBox.renderAll(); + this.renderBloodAltar(); + // Pop this matrix from the stack. + GL11.glPopMatrix(); + } + + public void renderBloodLevel(TEAltar altar, double x, double y, double z) + { + float scale = 0.1f; + // Push a blank matrix onto the stack + GL11.glPushMatrix(); + float level = altar.getFluidAmount(); + // Move the object into the correct position on the block (because the OBJ's origin is the center of the object) + GL11.glTranslatef((float) x + 0.5f, (float) y + 0.6499f + 0.12f * (level / altar.getCapacity()), (float) z + 0.5f); + // Scale our object to about half-size in all directions (the OBJ file is a little large) + GL11.glScalef(scale, scale, scale); + // Bind the texture, so that OpenGL properly textures our block. + ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/blood.png"); + //FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/alchemicalwizardry/textures/models/altar.png"); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); + // Render the object, using modelTutBox.renderAll(); + this.renderBloodLevel(); + // Pop this matrix from the stack. + GL11.glPopMatrix(); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBoulderFist.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBoulderFist.java new file mode 100644 index 00000000..a2cebd46 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelBoulderFist.java @@ -0,0 +1,153 @@ +package WayofTime.alchemicalWizardry.common.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelBoulderFist extends ModelBase +{ + //fields + ModelRenderer leftFist; + ModelRenderer leftArm; + ModelRenderer body; + ModelRenderer leftLeg1; + ModelRenderer leftLeg2; + ModelRenderer leftFoot; + ModelRenderer rightFist; + ModelRenderer rightArm; + ModelRenderer rightLeg1; + ModelRenderer rightLeg2; + ModelRenderer rightFoot; + ModelRenderer head; + + public ModelBoulderFist() + { + textureWidth = 64; + textureHeight = 64; + leftFist = new ModelRenderer(this, 33, 52); + leftFist.addBox(-1F, 12F, -3F, 6, 6, 6); + leftFist.setRotationPoint(5F, 6F, -6F); + leftFist.setTextureSize(64, 64); + leftFist.mirror = true; + setRotation(leftFist, 0F, 0F, 0F); + leftArm = new ModelRenderer(this, 48, 33); + leftArm.addBox(0F, -2F, -2F, 4, 14, 4); + leftArm.setRotationPoint(5F, 6F, -6F); + leftArm.setTextureSize(64, 64); + leftArm.mirror = true; + setRotation(leftArm, 0F, 0F, 0F); + body = new ModelRenderer(this, 0, 40); + body.addBox(-5F, -2F, -3F, 10, 18, 6); + body.setRotationPoint(0F, 6F, -6F); + body.setTextureSize(64, 64); + body.mirror = true; + setRotation(body, 1.22173F, 0F, 0F); + leftLeg1 = new ModelRenderer(this, 0, 25); + leftLeg1.addBox(0F, -1F, -1F, 4, 6, 2); + leftLeg1.setRotationPoint(5F, 11F, 7F); + leftLeg1.setTextureSize(64, 64); + leftLeg1.mirror = true; + setRotation(leftLeg1, -((float) Math.PI / 4F), 0F, 0F); + leftLeg2 = new ModelRenderer(this, 1, 25); + leftLeg2.addBox(0F, 5F, -1F, 4, 2, 12); + leftLeg2.setRotationPoint(5F, 11F, 7F); + leftLeg2.setTextureSize(64, 64); + leftLeg2.mirror = true; + setRotation(leftLeg2, -((float) Math.PI / 4F), 0F, 0F); + leftFoot = new ModelRenderer(this, 22, 25); + leftFoot.addBox(0F, 11F, -1F, 4, 2, 5); + leftFoot.setRotationPoint(5F, 11F, 7F); + leftFoot.setTextureSize(64, 64); + leftFoot.mirror = true; + setRotation(leftFoot, 0F, 0F, 0F); + rightFist = new ModelRenderer(this, 33, 52); + rightFist.mirror = true; + rightFist.addBox(-5F, 12F, -3F, 6, 6, 6); + rightFist.setRotationPoint(-5F, 6F, -6F); + rightFist.setTextureSize(64, 64); + rightFist.mirror = true; + setRotation(rightFist, 0F, 0F, 0F); + rightFist.mirror = false; + rightArm = new ModelRenderer(this, 48, 33); + rightArm.mirror = true; + rightArm.addBox(-4F, -2F, -2F, 4, 14, 4); + rightArm.setRotationPoint(-5F, 6F, -6F); + rightArm.setTextureSize(64, 64); + rightArm.mirror = true; + setRotation(rightArm, 0F, 0F, 0F); + rightArm.mirror = false; + rightLeg1 = new ModelRenderer(this, 0, 25); + rightLeg1.mirror = true; + rightLeg1.addBox(-4F, -1F, -1F, 4, 6, 2); + rightLeg1.setRotationPoint(-5F, 11F, 7F); + rightLeg1.setTextureSize(64, 64); + rightLeg1.mirror = true; + setRotation(rightLeg1, -((float) Math.PI / 4F), 0F, 0F); + rightLeg1.mirror = false; + rightLeg2 = new ModelRenderer(this, 1, 25); + rightLeg2.mirror = true; + rightLeg2.addBox(-4F, 5F, -1F, 4, 2, 12); + rightLeg2.setRotationPoint(-5F, 11F, 7F); + rightLeg2.setTextureSize(64, 64); + rightLeg2.mirror = true; + setRotation(rightLeg2, -((float) Math.PI / 4F), 0F, 0F); + rightLeg2.mirror = false; + rightFoot = new ModelRenderer(this, 22, 25); + rightFoot.mirror = true; + rightFoot.addBox(-4F, 11F, -1F, 4, 2, 5); + rightFoot.setRotationPoint(-5F, 11F, 7F); + rightFoot.setTextureSize(64, 64); + rightFoot.mirror = true; + setRotation(rightFoot, 0F, 0F, 0F); + rightFoot.mirror = false; + head = new ModelRenderer(this, 0, 0); + head.addBox(-3F, -5F, -5F, 6, 6, 6); + head.setRotationPoint(0F, 5F, -7F); + head.setTextureSize(64, 64); + head.mirror = true; + setRotation(head, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + leftFist.render(f5); + leftArm.render(f5); + body.render(f5); + leftLeg1.render(f5); + leftLeg2.render(f5); + leftFoot.render(f5); + rightFist.render(f5); + rightArm.render(f5); + rightLeg1.render(f5); + rightLeg2.render(f5); + rightFoot.render(f5); + head.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + this.head.rotateAngleX = f4 / (180F / (float) Math.PI); + this.head.rotateAngleY = f3 / (180F / (float) Math.PI); + this.leftFoot.rotateAngleX = MathHelper.cos(f * 0.6662F) * 0.8F * f1; + this.rightFoot.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * 0.8F * f1; + this.leftLeg1.rotateAngleX = leftFoot.rotateAngleX - ((float) Math.PI / 4F); + this.rightLeg1.rotateAngleX = rightFoot.rotateAngleX - ((float) Math.PI / 4F); + this.leftLeg2.rotateAngleX = leftFoot.rotateAngleX - ((float) Math.PI / 4F); + this.rightLeg2.rotateAngleX = rightFoot.rotateAngleX - ((float) Math.PI / 4F); + this.rightArm.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * 0.9f * f1; + this.leftArm.rotateAngleX = MathHelper.cos(f * 0.6662F) * 0.9f * f1; + this.leftFist.rotateAngleX = leftArm.rotateAngleX; + this.rightFist.rotateAngleX = rightArm.rotateAngleX; + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelConduit.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelConduit.java new file mode 100644 index 00000000..a6a510c4 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelConduit.java @@ -0,0 +1,287 @@ +package WayofTime.alchemicalWizardry.common.renderer.model; + +//Date: 11/26/2013 1:57:16 PM +//Template version 1.1 +//Java generated by Techne +//Keep in mind that you still need to fill in some blanks +//- ZeuX + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraftforge.common.util.ForgeDirection; + +public class ModelConduit extends ModelBase +{ + //fields + ModelRenderer curvedInput; + ModelRenderer curvedOutput; + ModelRenderer straightBar1; + ModelRenderer curvedBar1; + ModelRenderer spacer1; + ModelRenderer straightBar2; + ModelRenderer curvedBar2; + ModelRenderer spacer2; + ModelRenderer straightBar3; + ModelRenderer curvedBar3; + ModelRenderer straightBar4; + ModelRenderer curvedBar4; + ModelRenderer spacer3; + ModelRenderer spacer4; + ModelRenderer spacer5; + ModelRenderer spacer6; + ModelRenderer spacer7; + ModelRenderer spacer8; + + public ModelConduit() + { + textureWidth = 64; + textureHeight = 32; + curvedInput = new ModelRenderer(this, 0, 0); + curvedInput.addBox(-2F, -2F, -8F, 4, 4, 10); + curvedInput.setRotationPoint(0F, 16F, 0F); + curvedInput.setTextureSize(64, 32); + curvedInput.mirror = true; + setRotation(curvedInput, 0F, 0F, 0F); + curvedOutput = new ModelRenderer(this, 18, 0); + curvedOutput.addBox(2F, -2F, -2F, 6, 4, 4); + curvedOutput.setRotationPoint(0F, 16F, 0F); + curvedOutput.setTextureSize(64, 32); + curvedOutput.mirror = true; + setRotation(curvedOutput, 0F, 0F, 0F); + straightBar1 = new ModelRenderer(this, 0, 17); + straightBar1.addBox(-5F, 3F, -8F, 2, 2, 13); + straightBar1.setRotationPoint(0F, 16F, 0F); + straightBar1.setTextureSize(64, 32); + straightBar1.mirror = true; + setRotation(straightBar1, 0F, 0F, 0F); + curvedBar1 = new ModelRenderer(this, 29, 10); + curvedBar1.addBox(-5F, 3F, 3F, 13, 2, 2); + curvedBar1.setRotationPoint(0F, 16F, 0F); + curvedBar1.setTextureSize(64, 32); + curvedBar1.mirror = true; + setRotation(curvedBar1, 0F, 0F, 0F); + spacer1 = new ModelRenderer(this, 40, 0); + spacer1.addBox(-5.5F, 2.5F, 2.5F, 3, 3, 3); + spacer1.setRotationPoint(0F, 16F, 0F); + spacer1.setTextureSize(64, 32); + spacer1.mirror = true; + setRotation(spacer1, 0F, 0F, 0F); + straightBar2 = new ModelRenderer(this, 0, 17); + straightBar2.addBox(-5F, -5F, -8F, 2, 2, 13); + straightBar2.setRotationPoint(0F, 16F, 0F); + straightBar2.setTextureSize(64, 32); + straightBar2.mirror = true; + setRotation(straightBar2, 0F, 0F, 0F); + curvedBar2 = new ModelRenderer(this, 29, 10); + curvedBar2.addBox(-5F, -5F, 3F, 13, 2, 2); + curvedBar2.setRotationPoint(0F, 16F, 0F); + curvedBar2.setTextureSize(64, 32); + curvedBar2.mirror = true; + setRotation(curvedBar2, 0F, 0F, 0F); + spacer2 = new ModelRenderer(this, 40, 0); + spacer2.addBox(-5.5F, -5.5F, 2.5F, 3, 3, 3); + spacer2.setRotationPoint(0F, 16F, 0F); + spacer2.setTextureSize(64, 32); + spacer2.mirror = true; + setRotation(spacer2, 0F, 0F, 0F); + straightBar3 = new ModelRenderer(this, 0, 17); + straightBar3.addBox(3F, 3F, -8F, 2, 2, 13); + straightBar3.setRotationPoint(0F, 16F, 0F); + straightBar3.setTextureSize(64, 32); + straightBar3.mirror = true; + setRotation(straightBar3, 0F, 0F, 0F); + curvedBar3 = new ModelRenderer(this, 29, 10); + curvedBar3.addBox(-5F, 3F, -5F, 13, 2, 2); + curvedBar3.setRotationPoint(0F, 16F, 0F); + curvedBar3.setTextureSize(64, 32); + curvedBar3.mirror = true; + setRotation(curvedBar3, 0F, 0F, 0F); + straightBar4 = new ModelRenderer(this, 0, 17); + straightBar4.addBox(3F, -5F, -8F, 2, 2, 13); + straightBar4.setRotationPoint(0F, 16F, 0F); + straightBar4.setTextureSize(64, 32); + straightBar4.mirror = true; + setRotation(straightBar4, 0F, 0F, 0F); + curvedBar4 = new ModelRenderer(this, 29, 10); + curvedBar4.addBox(-5F, -5F, -5F, 13, 2, 2); + curvedBar4.setRotationPoint(0F, 16F, 0F); + curvedBar4.setTextureSize(64, 32); + curvedBar4.mirror = true; + setRotation(curvedBar4, 0F, 0F, 0F); + spacer3 = new ModelRenderer(this, 40, 0); + spacer3.addBox(2.5F, 2.5F, 2.5F, 3, 3, 3); + spacer3.setRotationPoint(0F, 16F, 0F); + spacer3.setTextureSize(64, 32); + spacer3.mirror = true; + setRotation(spacer3, 0F, 0F, 0F); + spacer4 = new ModelRenderer(this, 40, 0); + spacer4.addBox(2.5F, 2.5F, -5.5F, 3, 3, 3); + spacer4.setRotationPoint(0F, 16F, 0F); + spacer4.setTextureSize(64, 32); + spacer4.mirror = true; + setRotation(spacer4, 0F, 0F, 0F); + spacer5 = new ModelRenderer(this, 40, 0); + spacer5.addBox(-5.5F, 2.5F, -5.484F, 3, 3, 3); + spacer5.setRotationPoint(0F, 16F, 0F); + spacer5.setTextureSize(64, 32); + spacer5.mirror = true; + setRotation(spacer5, 0F, 0F, 0F); + spacer6 = new ModelRenderer(this, 40, 0); + spacer6.addBox(2.5F, -5.5F, 2.5F, 3, 3, 3); + spacer6.setRotationPoint(0F, 16F, 0F); + spacer6.setTextureSize(64, 32); + spacer6.mirror = true; + setRotation(spacer6, 0F, 0F, 0F); + spacer7 = new ModelRenderer(this, 40, 0); + spacer7.addBox(2.5F, -5.5F, -5.5F, 3, 3, 3); + spacer7.setRotationPoint(0F, 16F, 0F); + spacer7.setTextureSize(64, 32); + spacer7.mirror = true; + setRotation(spacer7, 0F, 0F, 0F); + spacer8 = new ModelRenderer(this, 40, 0); + spacer8.addBox(-5.5F, -5.5F, -5.5F, 3, 3, 3); + spacer8.setRotationPoint(0F, 16F, 0F); + spacer8.setTextureSize(64, 32); + spacer8.mirror = true; + setRotation(spacer8, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, ForgeDirection input, ForgeDirection output) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + float xInputRot = 0.0f; + float yInputRot = 0.0f; + float zInputRot = 0.0f; + float xOutputRot = 0.0f; + float yOutputRot = 0.0f; + float zOutputRot = 0.0f; + + switch (input) + { + case NORTH: + xInputRot = 0.0f; + yInputRot = 0.0f; + zInputRot = 0.0f; + break; + + case EAST: + xInputRot = 0.0f; + yInputRot = (float) (0.5f * Math.PI); + zInputRot = 0.0f; + break; + + case SOUTH: + xInputRot = 0.0f; + yInputRot = (float) (1.0f * Math.PI); + zInputRot = 0.0f; + break; + + case WEST: + xInputRot = 0.0f; + yInputRot = (float) (-0.5f * Math.PI); + zInputRot = 0.0f; + break; + + case UP: + xInputRot = (float) (-0.5f * Math.PI); + yInputRot = 0.0f; + zInputRot = 0.0f; + break; + + case DOWN: + xInputRot = (float) (0.5f * Math.PI); + yInputRot = 0.0f; + zInputRot = 0.0f; + break; + + default: + break; + } + + switch (output) + { + case NORTH: + xOutputRot = 0.0f; + yOutputRot = (float) (0.5f * Math.PI); + zOutputRot = 0.0f; + break; + + case EAST: + xOutputRot = 0.0f; + yOutputRot = (float) (1.0f * Math.PI); + zOutputRot = 0.0f; + break; + + case SOUTH: + xOutputRot = 0.0f; + yOutputRot = (float) (-0.5f * Math.PI); + zOutputRot = 0.0f; + break; + + case WEST: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = 0.0f; + break; + + case UP: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = (float) (-0.5f * Math.PI); + break; + + case DOWN: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = (float) (0.5f * Math.PI); + break; + + default: + break; + } + + this.setRotation(curvedInput, xInputRot, yInputRot, zInputRot); + this.setRotation(curvedOutput, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(straightBar1, xInputRot, yInputRot, zInputRot); + this.setRotation(curvedBar1, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(straightBar2, xInputRot, yInputRot, zInputRot); + this.setRotation(curvedBar2, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(straightBar3, xInputRot, yInputRot, zInputRot); + this.setRotation(curvedBar3, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(straightBar4, xInputRot, yInputRot, zInputRot); + this.setRotation(curvedBar4, xOutputRot, yOutputRot, zOutputRot); + curvedInput.render(f5); + curvedOutput.render(f5); + //setRotation(curvedOutput,0F,-(float)(Math.PI/2),0F); + straightBar1.render(f5); + curvedBar1.render(f5); + spacer1.render(f5); + straightBar2.render(f5); + curvedBar2.render(f5); + spacer2.render(f5); + straightBar3.render(f5); + curvedBar3.render(f5); + straightBar4.render(f5); + curvedBar4.render(f5); + spacer3.render(f5); + spacer4.render(f5); + spacer5.render(f5); + spacer6.render(f5); + spacer7.render(f5); + spacer8.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelElemental.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelElemental.java new file mode 100644 index 00000000..25cb2814 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelElemental.java @@ -0,0 +1,81 @@ +package WayofTime.alchemicalWizardry.common.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.world.World; + +public class ModelElemental extends ModelBase +{ + //fields + ModelRenderer body; + ModelRenderer Shape2; + ModelRenderer Shape1; + ModelRenderer Shape3; + + public ModelElemental() + { + textureWidth = 64; + textureHeight = 32; + body = new ModelRenderer(this, 33, 0); + body.addBox(-3F, -3F, -3F, 6, 6, 6); + body.setRotationPoint(0F, 14F, 0F); + body.setTextureSize(64, 32); + body.mirror = true; + setRotation(body, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 0, 0); + Shape2.addBox(-4F, -4F, -4F, 8, 8, 8); + Shape2.setRotationPoint(0F, 14F, 0F); + Shape2.setTextureSize(64, 32); + Shape2.mirror = true; + setRotation(Shape2, ((float) Math.PI / 4F), ((float) Math.PI / 4F), 0F); + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(-4F, -4F, -4F, 8, 8, 8); + Shape1.setRotationPoint(0F, 14F, 0F); + Shape1.setTextureSize(64, 32); + Shape1.mirror = true; + setRotation(Shape1, 0F, ((float) Math.PI / 4F), ((float) Math.PI / 4F)); + Shape3 = new ModelRenderer(this, 0, 0); + Shape3.addBox(-4F, -4F, -4F, 8, 8, 8); + Shape3.setRotationPoint(0F, 14F, 0F); + Shape3.setTextureSize(64, 32); + Shape3.mirror = true; + setRotation(Shape3, ((float) Math.PI / 4F), 0F, ((float) Math.PI / 4F)); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + body.render(f5); + Shape2.render(f5); + Shape1.render(f5); + Shape3.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + World world = entity.worldObj; + + if (world == null) + { + return; + } + + int ratio = 20; + float rot = (entity.worldObj.getWorldTime() % ratio) / ratio; + Shape1.rotateAngleX = f / 5; + Shape2.rotateAngleZ = f / 5; + Shape3.rotateAngleY = f / 5; + EntityBlaze d; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelEnergyBazookaMainProjectile.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelEnergyBazookaMainProjectile.java new file mode 100644 index 00000000..de8e7e6b --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelEnergyBazookaMainProjectile.java @@ -0,0 +1,122 @@ +package WayofTime.alchemicalWizardry.common.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelEnergyBazookaMainProjectile extends ModelBase +{ + //fields + ModelRenderer thirdWarHead; + ModelRenderer firstWarHead; + ModelRenderer secondWarHead; + ModelRenderer support1; + ModelRenderer mainBody; + ModelRenderer support2; + ModelRenderer support3; + ModelRenderer support4; + ModelRenderer base1; + ModelRenderer base2; + ModelRenderer base3; + + public ModelEnergyBazookaMainProjectile() + { + textureWidth = 64; + textureHeight = 32; + thirdWarHead = new ModelRenderer(this, 43, 0); + thirdWarHead.addBox(-1F, -1F, -9F, 2, 2, 1); + thirdWarHead.setRotationPoint(0F, 0F, 0F); + thirdWarHead.setTextureSize(64, 32); + thirdWarHead.mirror = true; + setRotation(thirdWarHead, 0F, 0F, 0F); + firstWarHead = new ModelRenderer(this, 52, 0); + firstWarHead.addBox(-2F, -2F, -8F, 4, 4, 2); + firstWarHead.setRotationPoint(0F, 0F, 0F); + firstWarHead.setTextureSize(64, 32); + firstWarHead.mirror = true; + setRotation(firstWarHead, 0F, 0F, 0F); + secondWarHead = new ModelRenderer(this, 48, 8); + secondWarHead.addBox(-3F, -3F, -6F, 6, 6, 2); + secondWarHead.setRotationPoint(0F, 0F, 0F); + secondWarHead.setTextureSize(64, 32); + secondWarHead.mirror = true; + setRotation(secondWarHead, 0F, 0F, 0F); + support1 = new ModelRenderer(this, 0, 0); + support1.addBox(2F, 2F, -4F, 1, 1, 9); + support1.setRotationPoint(0F, 0F, 0F); + support1.setTextureSize(64, 32); + support1.mirror = true; + setRotation(support1, 0F, 0F, 0F); + mainBody = new ModelRenderer(this, 0, 19); + mainBody.addBox(-2F, -2F, -4F, 4, 4, 9); + mainBody.setRotationPoint(0F, 0F, 0F); + mainBody.setTextureSize(64, 32); + mainBody.mirror = true; + setRotation(mainBody, 0F, 0F, 0F); + support2 = new ModelRenderer(this, 0, 0); + support2.addBox(-3F, 2F, -4F, 1, 1, 9); + support2.setRotationPoint(0F, 0F, 0F); + support2.setTextureSize(64, 32); + support2.mirror = true; + setRotation(support2, 0F, 0F, 0F); + support3 = new ModelRenderer(this, 0, 0); + support3.addBox(-3F, -3F, -4F, 1, 1, 9); + support3.setRotationPoint(0F, 0F, 0F); + support3.setTextureSize(64, 32); + support3.mirror = true; + setRotation(support3, 0F, 0F, 0F); + support4 = new ModelRenderer(this, 0, 0); + support4.addBox(2F, -3F, -4F, 1, 1, 9); + support4.setRotationPoint(0F, 0F, 0F); + support4.setTextureSize(64, 32); + support4.mirror = true; + setRotation(support4, 0F, 0F, 0F); + base1 = new ModelRenderer(this, 28, 0); + base1.addBox(-3F, -3F, 5F, 6, 6, 1); + base1.setRotationPoint(0F, 0F, 0F); + base1.setTextureSize(64, 32); + base1.mirror = true; + setRotation(base1, 0F, 0F, 0F); + base2 = new ModelRenderer(this, 28, 9); + base2.addBox(-2F, -2F, 6F, 4, 4, 1); + base2.setRotationPoint(0F, 0F, 0F); + base2.setTextureSize(64, 32); + base2.mirror = true; + setRotation(base2, 0F, 0F, 0F); + base3 = new ModelRenderer(this, 28, 15); + base3.addBox(-3F, -3F, 7F, 6, 6, 1); + base3.setRotationPoint(0F, 0F, 0F); + base3.setTextureSize(64, 32); + base3.mirror = true; + setRotation(base3, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + thirdWarHead.render(f5); + firstWarHead.render(f5); + secondWarHead.render(f5); + support1.render(f5); + mainBody.render(f5); + support2.render(f5); + support3.render(f5); + support4.render(f5); + base1.render(f5); + base2.render(f5); + base3.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelFallenAngel.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelFallenAngel.java new file mode 100644 index 00000000..aacef80d --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelFallenAngel.java @@ -0,0 +1,113 @@ +package WayofTime.alchemicalWizardry.common.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelFallenAngel extends ModelBase +{ + //fields + ModelRenderer leftWing; + ModelRenderer rightWing; + ModelRenderer head; + ModelRenderer body; + ModelRenderer rightarm; + ModelRenderer leftarm; + ModelRenderer rightleg; + ModelRenderer leftleg; + + public ModelFallenAngel() + { + textureWidth = 64; + textureHeight = 32; + leftWing = new ModelRenderer(this, 33, 8); + leftWing.mirror = true; + leftWing.addBox(0F, 0F, 0F, 10, 7, 0); + leftWing.setRotationPoint(0F, 1F, 2F); + leftWing.setTextureSize(64, 32); + leftWing.mirror = true; + setRotation(leftWing, 0F, 0F, 0F); + rightWing = new ModelRenderer(this, 33, 8); + rightWing.addBox(-10F, 0F, 0F, 10, 7, 0); + rightWing.setRotationPoint(0F, 1F, 2F); + rightWing.setTextureSize(64, 32); + rightWing.mirror = true; + setRotation(rightWing, 0F, 0F, 0F); + rightWing.mirror = false; + head = new ModelRenderer(this, 0, 0); + head.addBox(-4F, -8F, -4F, 8, 8, 8); + head.setRotationPoint(0F, 0F, 0F); + head.setTextureSize(64, 32); + head.mirror = true; + setRotation(head, 0F, 0F, 0F); + body = new ModelRenderer(this, 16, 16); + body.addBox(-4F, 0F, -2F, 8, 12, 4); + body.setRotationPoint(0F, 0F, 0F); + body.setTextureSize(64, 32); + body.mirror = true; + setRotation(body, 0F, 0F, 0F); + rightarm = new ModelRenderer(this, 40, 16); + rightarm.addBox(-3F, -2F, -2F, 4, 12, 4); + rightarm.setRotationPoint(-5F, 2F, 0F); + rightarm.setTextureSize(64, 32); + rightarm.mirror = true; + setRotation(rightarm, 0F, 0F, 0F); + rightarm.mirror = false; + leftarm = new ModelRenderer(this, 40, 16); + leftarm.mirror = true; + leftarm.addBox(-1F, -2F, -2F, 4, 12, 4); + leftarm.setRotationPoint(5F, 2F, 0F); + leftarm.setTextureSize(64, 32); + leftarm.mirror = true; + setRotation(leftarm, 0F, 0F, 0F); + rightleg = new ModelRenderer(this, 0, 16); + rightleg.addBox(-2F, 0F, -2F, 4, 12, 4); + rightleg.setRotationPoint(-2F, 12F, 0F); + rightleg.setTextureSize(64, 32); + rightleg.mirror = true; + setRotation(rightleg, 0F, 0F, 0F); + rightleg.mirror = false; + leftleg = new ModelRenderer(this, 0, 16); + leftleg.mirror = true; + leftleg.addBox(-2F, 0F, -2F, 4, 12, 4); + leftleg.setRotationPoint(2F, 12F, 0F); + leftleg.setTextureSize(64, 32); + leftleg.mirror = true; + setRotation(leftleg, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + leftWing.render(f5); + rightWing.render(f5); + head.render(f5); + body.render(f5); + rightarm.render(f5); + leftarm.render(f5); + rightleg.render(f5); + leftleg.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + this.head.rotateAngleX = f4 / (180F / (float) Math.PI); + this.head.rotateAngleY = f3 / (180F / (float) Math.PI); + this.leftleg.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1; + this.rightleg.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * 1.4F * f1; + this.rightarm.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * 1.4F * f1; + this.leftarm.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1; + this.rightWing.rotateAngleY = MathHelper.cos(0.1662F); + this.leftWing.rotateAngleY = MathHelper.cos(0.1662F + (float) Math.PI); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelIceDemon.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelIceDemon.java new file mode 100644 index 00000000..9c6d3c32 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelIceDemon.java @@ -0,0 +1,197 @@ +package WayofTime.alchemicalWizardry.common.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelIceDemon extends ModelBase +{ + //fields + ModelRenderer head; + ModelRenderer leftHorn; + ModelRenderer rightHorn; + ModelRenderer body; + ModelRenderer leftArm; + ModelRenderer leftWrist; + ModelRenderer leftIcicle1; + ModelRenderer leftIcicle2; + ModelRenderer leftIcicle3; + ModelRenderer leftLeg; + ModelRenderer rightArm; + ModelRenderer rightWrist; + ModelRenderer rightIcicle1; + ModelRenderer rightIcicle2; + ModelRenderer rightIcicle3; + ModelRenderer rightLeg; + ModelRenderer Shape1; + + public ModelIceDemon() + { + textureWidth = 64; + textureHeight = 64; + head = new ModelRenderer(this, 40, 0); + head.addBox(-3F, -8F, -3F, 6, 8, 6); + head.setRotationPoint(0F, -3F, 0F); + head.setTextureSize(64, 64); + head.mirror = true; + setRotation(head, 0F, 0F, 0F); + leftHorn = new ModelRenderer(this, 0, 0); + leftHorn.addBox(3F, -7F, 2F, 1, 1, 10); + leftHorn.setRotationPoint(0F, -3F, 0F); + leftHorn.setTextureSize(64, 64); + leftHorn.mirror = true; + setRotation(leftHorn, 0.4363323F, 0F, 0F); + rightHorn = new ModelRenderer(this, 0, 0); + rightHorn.mirror = true; + rightHorn.addBox(-4F, -7F, 2F, 1, 1, 10); + rightHorn.setRotationPoint(0F, -3F, 0F); + rightHorn.setTextureSize(64, 64); + rightHorn.mirror = true; + setRotation(rightHorn, 0.4363323F, 0F, 0F); + rightHorn.mirror = false; + body = new ModelRenderer(this, 40, 15); + body.addBox(-4F, 0F, -2F, 8, 13, 4); + body.setRotationPoint(0F, -3F, 0F); + body.setTextureSize(64, 64); + body.mirror = true; + setRotation(body, 0F, 0F, 0F); + leftArm = new ModelRenderer(this, 0, 48); + leftArm.addBox(0F, -2F, -2F, 4, 12, 4); + leftArm.setRotationPoint(4F, -1F, 0F); + leftArm.setTextureSize(64, 64); + leftArm.mirror = true; + setRotation(leftArm, 0F, 0F, 0F); + leftWrist = new ModelRenderer(this, 32, 57); + leftWrist.addBox(0F, 6F, -2.5F, 5, 2, 5); + leftWrist.setRotationPoint(4F, -1F, 0F); + leftWrist.setTextureSize(64, 64); + leftWrist.mirror = true; + setRotation(leftWrist, 0F, 0F, 0F); + leftIcicle1 = new ModelRenderer(this, 0, 0); + leftIcicle1.addBox(4.9F, 0F, -0.5F, 1, 6, 1); + leftIcicle1.setRotationPoint(4F, -1F, 0F); + leftIcicle1.setTextureSize(64, 64); + leftIcicle1.mirror = true; + setRotation(leftIcicle1, 0F, 0F, 0.1396263F); + leftIcicle2 = new ModelRenderer(this, 0, 0); + leftIcicle2.addBox(5F, 0F, 0F, 1, 6, 1); + leftIcicle2.setRotationPoint(4F, -1F, 0F); + leftIcicle2.setTextureSize(64, 64); + leftIcicle2.mirror = true; + setRotation(leftIcicle2, 0F, 0.5585054F, 0.1919862F); + leftIcicle3 = new ModelRenderer(this, 0, 0); + leftIcicle3.addBox(5F, 0F, -1F, 1, 6, 1); + leftIcicle3.setRotationPoint(4F, -1F, 0F); + leftIcicle3.setTextureSize(64, 64); + leftIcicle3.mirror = true; + setRotation(leftIcicle3, 0F, -0.5585054F, 0.1919862F); + leftLeg = new ModelRenderer(this, 16, 46); + leftLeg.addBox(-2F, 0F, -2F, 4, 14, 4); + leftLeg.setRotationPoint(2F, 10F, 0F); + leftLeg.setTextureSize(64, 64); + leftLeg.mirror = true; + setRotation(leftLeg, 0F, 0F, 0F); + rightArm = new ModelRenderer(this, 0, 48); + rightArm.mirror = true; + rightArm.addBox(-4F, -2F, -2F, 4, 12, 4); + rightArm.setRotationPoint(-4F, -1F, 0F); + rightArm.setTextureSize(64, 64); + rightArm.mirror = true; + setRotation(rightArm, 0F, 0F, 0F); + rightArm.mirror = false; + rightWrist = new ModelRenderer(this, 32, 57); + rightWrist.mirror = true; + rightWrist.addBox(-5F, 6F, -2.5F, 5, 2, 5); + rightWrist.setRotationPoint(-4F, -1F, 0F); + rightWrist.setTextureSize(64, 64); + rightWrist.mirror = true; + setRotation(rightWrist, 0F, 0F, 0F); + rightWrist.mirror = false; + rightIcicle1 = new ModelRenderer(this, 0, 0); + rightIcicle1.addBox(-5.9F, 0F, -0.5F, 1, 6, 1); + rightIcicle1.setRotationPoint(-4F, -1F, 0F); + rightIcicle1.setTextureSize(64, 64); + rightIcicle1.mirror = true; + setRotation(rightIcicle1, 0F, 0F, -0.1396263F); + rightIcicle2 = new ModelRenderer(this, 0, 0); + rightIcicle2.addBox(-6F, 0F, 0F, 1, 6, 1); + rightIcicle2.setRotationPoint(-4F, -1F, 0F); + rightIcicle2.setTextureSize(64, 64); + rightIcicle2.mirror = true; + setRotation(rightIcicle2, 0F, -0.5585054F, -0.1919862F); + rightIcicle3 = new ModelRenderer(this, 0, 0); + rightIcicle3.addBox(-6F, 0F, -1F, 1, 6, 1); + rightIcicle3.setRotationPoint(-4F, -1F, 0F); + rightIcicle3.setTextureSize(64, 64); + rightIcicle3.mirror = true; + setRotation(rightIcicle3, 0F, 0.5585054F, -0.1919862F); + rightLeg = new ModelRenderer(this, 16, 46); + rightLeg.mirror = true; + rightLeg.addBox(-2F, 0F, -2F, 4, 14, 4); + rightLeg.setRotationPoint(-2F, 10F, 0F); + rightLeg.setTextureSize(64, 64); + rightLeg.mirror = true; + setRotation(rightLeg, 0F, 0F, 0F); + rightLeg.mirror = false; + Shape1 = new ModelRenderer(this, 0, 12); + Shape1.addBox(-0.5F, 0F, -0.5F, 1, 10, 1); + Shape1.setRotationPoint(0F, 8F, 1.5F); + Shape1.setTextureSize(64, 64); + Shape1.mirror = true; + setRotation(Shape1, 0.5948578F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + head.render(f5); + leftHorn.render(f5); + rightHorn.render(f5); + body.render(f5); + leftArm.render(f5); + leftWrist.render(f5); + leftIcicle1.render(f5); + leftIcicle2.render(f5); + leftIcicle3.render(f5); + leftLeg.render(f5); + rightArm.render(f5); + rightWrist.render(f5); + rightIcicle1.render(f5); + rightIcicle2.render(f5); + rightIcicle3.render(f5); + rightLeg.render(f5); + Shape1.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + this.head.rotateAngleX = f4 / (180F / (float) Math.PI); + this.head.rotateAngleY = f3 / (180F / (float) Math.PI); + this.leftLeg.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1; + this.rightLeg.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * 1.4F * f1; + this.rightArm.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * 1.4F * f1; + this.leftArm.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1; + this.leftHorn.rotateAngleX = head.rotateAngleX + 0.4363323F; + this.leftHorn.rotateAngleY = head.rotateAngleY; + this.rightHorn.rotateAngleX = head.rotateAngleX + 0.4363323F; + this.rightHorn.rotateAngleY = head.rotateAngleY; + this.rightIcicle1.rotateAngleX = rightArm.rotateAngleX; + this.rightIcicle2.rotateAngleX = rightArm.rotateAngleX; + this.rightIcicle3.rotateAngleX = rightArm.rotateAngleX; + this.leftIcicle1.rotateAngleX = leftArm.rotateAngleX; + this.leftIcicle2.rotateAngleX = leftArm.rotateAngleX; + this.leftIcicle3.rotateAngleX = leftArm.rotateAngleX; + this.rightWrist.rotateAngleX = rightArm.rotateAngleX; + this.leftWrist.rotateAngleX = leftArm.rotateAngleX; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelLowerGuardian.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelLowerGuardian.java new file mode 100644 index 00000000..61d7b85d --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelLowerGuardian.java @@ -0,0 +1,207 @@ +package WayofTime.alchemicalWizardry.common.renderer.model; + +import WayofTime.alchemicalWizardry.common.entity.mob.EntityLowerGuardian; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +public class ModelLowerGuardian extends ModelBase +{ + //fields + ModelRenderer Body; + ModelRenderer Torso; + ModelRenderer Head; + ModelRenderer leftArm; + ModelRenderer rightArm; + ModelRenderer leftLeg; + ModelRenderer leftFoot; + ModelRenderer rightLeg; + ModelRenderer rightFoot; + ModelRenderer leftHorn; + ModelRenderer hornAppendage1; + ModelRenderer hornAppendage2; + ModelRenderer rightHorn; + ModelRenderer hornAppendage3; + ModelRenderer hornAppendage4; + + public ModelLowerGuardian() + { + textureWidth = 64; + textureHeight = 64; + Body = new ModelRenderer(this, 0, 0); + Body.addBox(-8F, -7F, -4F, 16, 14, 8); + Body.setRotationPoint(0F, -3F, 0F); + Body.setTextureSize(64, 64); + Body.mirror = true; + setRotation(Body, 0F, 0F, 0F); + Torso = new ModelRenderer(this, 0, 25); + Torso.addBox(-4F, 0F, -3F, 8, 4, 6); + Torso.setRotationPoint(0F, 4F, 0F); + Torso.setTextureSize(64, 64); + Torso.mirror = true; + setRotation(Torso, 0F, 0F, 0F); + Head = new ModelRenderer(this, 29, 25); + Head.addBox(-4F, -8F, -4F, 8, 8, 8); + Head.setRotationPoint(0F, -10F, 0F); + Head.setTextureSize(64, 64); + Head.mirror = true; + setRotation(Head, 0F, 0F, 0F); + leftArm = new ModelRenderer(this, 17, 42); + leftArm.addBox(0F, -2F, -2F, 4, 18, 4); + leftArm.setRotationPoint(8F, -8F, 0F); + leftArm.setTextureSize(64, 64); + leftArm.mirror = true; + setRotation(leftArm, 0F, 0F, 0F); + rightArm = new ModelRenderer(this, 17, 42); + rightArm.mirror = true; + rightArm.addBox(-4F, -2F, -2F, 4, 18, 4); + rightArm.setRotationPoint(-8F, -8F, 0F); + rightArm.setTextureSize(64, 64); + rightArm.mirror = true; + setRotation(rightArm, 0F, 0F, 0F); + rightArm.mirror = false; + leftLeg = new ModelRenderer(this, 0, 42); + leftLeg.addBox(0F, -2F, -2F, 4, 17, 4); + leftLeg.setRotationPoint(4F, 6F, 0F); + leftLeg.setTextureSize(64, 64); + leftLeg.mirror = true; + setRotation(leftLeg, 0F, 0F, 0F); + leftFoot = new ModelRenderer(this, 34, 42); + leftFoot.addBox(0F, 15F, -6F, 4, 3, 8); + leftFoot.setRotationPoint(4F, 6F, 0F); + leftFoot.setTextureSize(64, 64); + leftFoot.mirror = true; + setRotation(leftFoot, 0F, 0F, 0F); + rightLeg = new ModelRenderer(this, 0, 42); + rightLeg.mirror = true; + rightLeg.addBox(-4F, -2F, -2F, 4, 17, 4); + rightLeg.setRotationPoint(-4F, 6F, 0F); + rightLeg.setTextureSize(64, 64); + rightLeg.mirror = true; + setRotation(rightLeg, 0F, 0F, 0F); + rightLeg.mirror = false; + rightFoot = new ModelRenderer(this, 34, 42); + rightFoot.mirror = true; + rightFoot.addBox(-4F, 15F, -6F, 4, 3, 8); + rightFoot.setRotationPoint(-4F, 6F, 0F); + rightFoot.setTextureSize(64, 64); + rightFoot.mirror = true; + setRotation(rightFoot, 0F, 0F, 0F); + rightFoot.mirror = false; + leftHorn = new ModelRenderer(this, 0, 0); + leftHorn.addBox(4F, -11F, 0F, 1, 6, 1); + leftHorn.setRotationPoint(0F, -10F, 0F); + leftHorn.setTextureSize(64, 64); + leftHorn.mirror = true; + setRotation(leftHorn, 0F, 0F, 0F); + hornAppendage1 = new ModelRenderer(this, 0, 0); + hornAppendage1.addBox(4F, -7F, -1F, 1, 1, 1); + hornAppendage1.setRotationPoint(0F, -10F, 0F); + hornAppendage1.setTextureSize(64, 64); + hornAppendage1.mirror = true; + setRotation(hornAppendage1, 0F, 0F, 0F); + hornAppendage2 = new ModelRenderer(this, 0, 0); + hornAppendage2.addBox(4F, -6F, 1F, 1, 1, 1); + hornAppendage2.setRotationPoint(0F, -10F, 0F); + hornAppendage2.setTextureSize(64, 64); + hornAppendage2.mirror = true; + setRotation(hornAppendage2, 0F, 0F, 0F); + rightHorn = new ModelRenderer(this, 0, 0); + rightHorn.mirror = true; + rightHorn.addBox(-5F, -11F, 0F, 1, 6, 1); + rightHorn.setRotationPoint(0F, -10F, 0F); + rightHorn.setTextureSize(64, 64); + rightHorn.mirror = true; + setRotation(rightHorn, 0F, 0F, 0F); + rightHorn.mirror = false; + hornAppendage3 = new ModelRenderer(this, 0, 0); + hornAppendage3.mirror = true; + hornAppendage3.addBox(-5F, -7F, -1F, 1, 1, 1); + hornAppendage3.setRotationPoint(0F, -10F, 0F); + hornAppendage3.setTextureSize(64, 64); + hornAppendage3.mirror = true; + setRotation(hornAppendage3, 0F, 0F, 0F); + hornAppendage3.mirror = false; + hornAppendage4 = new ModelRenderer(this, 0, 0); + hornAppendage4.mirror = true; + hornAppendage4.addBox(-5F, -6F, 1F, 1, 1, 1); + hornAppendage4.setRotationPoint(0F, -10F, 0F); + hornAppendage4.setTextureSize(64, 64); + hornAppendage4.mirror = true; + setRotation(hornAppendage4, 0F, 0F, 0F); + hornAppendage4.mirror = false; + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + Body.render(f5); + Torso.render(f5); + Head.render(f5); + leftArm.render(f5); + rightArm.render(f5); + leftLeg.render(f5); + leftFoot.render(f5); + rightLeg.render(f5); + rightFoot.render(f5); + leftHorn.render(f5); + hornAppendage1.render(f5); + hornAppendage2.render(f5); + rightHorn.render(f5); + hornAppendage3.render(f5); + hornAppendage4.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) + { + EntityLowerGuardian entityLowerGuardian = (EntityLowerGuardian) par1EntityLivingBase; + int i = entityLowerGuardian.getAttackTimer(); + + if (i > 0) + { + this.rightLeg.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float) i - par4, 10.0F); + this.rightFoot.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float) i - par4, 10.0F); + //this.ironGolemLeftArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)i - par4, 10.0F); + } + } + + private float func_78172_a(float par1, float par2) + { + return (Math.abs(par1 % par2 - par2 * 0.5F) - par2 * 0.25F) / (par2 * 0.25F); + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + this.Head.rotateAngleX = f4 / (180F / (float) Math.PI); + this.Head.rotateAngleY = f3 / (180F / (float) Math.PI); + this.leftLeg.rotateAngleX = MathHelper.cos(f * 0.3662F) * 1.0F * f1; + this.rightLeg.rotateAngleX = MathHelper.cos(f * 0.3662F + (float) Math.PI) * 1.0F * f1; + this.leftFoot.rotateAngleX = MathHelper.cos(f * 0.3662F) * 1.0F * f1; + this.rightFoot.rotateAngleX = MathHelper.cos(f * 0.3662F + (float) Math.PI) * 1.0F * f1; + this.rightArm.rotateAngleX = MathHelper.cos(f * 0.3662F + (float) Math.PI) * 1.0F * f1; + this.leftArm.rotateAngleX = MathHelper.cos(f * 0.3662F) * 1.0F * f1; + this.hornAppendage1.rotateAngleX = this.Head.rotateAngleX; + this.hornAppendage1.rotateAngleY = this.Head.rotateAngleY; + this.hornAppendage2.rotateAngleX = this.Head.rotateAngleX; + this.hornAppendage2.rotateAngleY = this.Head.rotateAngleY; + this.hornAppendage3.rotateAngleX = this.Head.rotateAngleX; + this.hornAppendage3.rotateAngleY = this.Head.rotateAngleY; + this.hornAppendage4.rotateAngleX = this.Head.rotateAngleX; + this.hornAppendage4.rotateAngleY = this.Head.rotateAngleY; + this.leftHorn.rotateAngleX = this.Head.rotateAngleX; + this.leftHorn.rotateAngleY = this.Head.rotateAngleY; + this.rightHorn.rotateAngleX = this.Head.rotateAngleX; + this.rightHorn.rotateAngleY = this.Head.rotateAngleY; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelMeteor.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelMeteor.java new file mode 100644 index 00000000..26a94989 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelMeteor.java @@ -0,0 +1,90 @@ +package WayofTime.alchemicalWizardry.common.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelMeteor extends ModelBase +{ + //fields + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape3; + ModelRenderer Shape4; + ModelRenderer Shape5; + ModelRenderer Shape6; + ModelRenderer Shape7; + + public ModelMeteor() + { + textureWidth = 64; + textureHeight = 64; + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(-8F, -8F, -8F, 16, 16, 16); + Shape1.setRotationPoint(0F, 0F, 0F); + Shape1.setTextureSize(64, 64); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 0, 32); + Shape2.addBox(3F, -10F, -1F, 12, 12, 12); + Shape2.setRotationPoint(0F, 0F, 0F); + Shape2.setTextureSize(64, 64); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 0, 32); + Shape3.addBox(0F, 0F, -10F, 12, 12, 12); + Shape3.setRotationPoint(0F, 0F, 0F); + Shape3.setTextureSize(64, 64); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0F, 0F); + Shape4 = new ModelRenderer(this, 0, 32); + Shape4.addBox(1F, 2F, 2F, 12, 12, 12); + Shape4.setRotationPoint(0F, 0F, 0F); + Shape4.setTextureSize(64, 64); + Shape4.mirror = true; + setRotation(Shape4, 0F, 0F, 0F); + Shape5 = new ModelRenderer(this, 0, 32); + Shape5.addBox(-12F, -5F, 0F, 12, 12, 12); + Shape5.setRotationPoint(0F, 0F, 0F); + Shape5.setTextureSize(64, 64); + Shape5.mirror = true; + setRotation(Shape5, 0F, 0F, 0F); + Shape6 = new ModelRenderer(this, 0, 32); + Shape6.addBox(-13F, -2F, -11F, 12, 12, 12); + Shape6.setRotationPoint(0F, 0F, 0F); + Shape6.setTextureSize(64, 64); + Shape6.mirror = true; + setRotation(Shape6, 0F, 0F, 0F); + Shape7 = new ModelRenderer(this, 0, 32); + Shape7.addBox(-6F, -14F, -9F, 12, 12, 12); + Shape7.setRotationPoint(0F, 0F, 0F); + Shape7.setTextureSize(64, 64); + Shape7.mirror = true; + setRotation(Shape7, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + Shape1.render(f5); + Shape2.render(f5); + Shape3.render(f5); + Shape4.render(f5); + Shape5.render(f5); + Shape6.render(f5); + Shape7.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelPedestal.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelPedestal.java new file mode 100644 index 00000000..753df6a5 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelPedestal.java @@ -0,0 +1,58 @@ +package WayofTime.alchemicalWizardry.common.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelPedestal extends ModelBase +{ + //fields + ModelRenderer base; + ModelRenderer top; + ModelRenderer middle; + + public ModelPedestal() + { + textureWidth = 64; + textureHeight = 32; + base = new ModelRenderer(this, 0, 0); + base.addBox(0F, 0F, 0F, 10, 1, 10); + base.setRotationPoint(-5F, 23F, -5F); + base.setTextureSize(64, 32); + base.mirror = true; + setRotation(base, 0F, 0F, 0F); + top = new ModelRenderer(this, 0, 19); + top.addBox(0F, 0F, 0F, 6, 1, 6); + top.setRotationPoint(-3F, 14F, -3F); + top.setTextureSize(64, 32); + top.mirror = true; + setRotation(top, 0F, 0F, 0F); + middle = new ModelRenderer(this, 50, 0); + middle.addBox(0F, 0F, 0F, 2, 8, 2); + middle.setRotationPoint(-1F, 15F, -1F); + middle.setTextureSize(64, 32); + middle.mirror = true; + setRotation(middle, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + base.render(f5); + top.render(f5); + middle.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelPlinth.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelPlinth.java new file mode 100644 index 00000000..f4190b5d --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelPlinth.java @@ -0,0 +1,90 @@ +package WayofTime.alchemicalWizardry.common.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelPlinth extends ModelBase +{ + //fields + ModelRenderer base; + ModelRenderer table; + ModelRenderer pillar; + ModelRenderer edge1; + ModelRenderer edge2; + ModelRenderer edge3; + ModelRenderer edge4; + + public ModelPlinth() + { + textureWidth = 64; + textureHeight = 64; + base = new ModelRenderer(this, 0, 16); + base.addBox(0F, 0F, 0F, 10, 2, 10); + base.setRotationPoint(-5F, 22F, -5F); + base.setTextureSize(64, 64); + base.mirror = true; + setRotation(base, 0F, 0F, 0F); + table = new ModelRenderer(this, 0, 0); + table.addBox(0F, 0F, 0F, 14, 1, 14); + table.setRotationPoint(-7F, 11F, -7F); + table.setTextureSize(64, 64); + table.mirror = true; + setRotation(table, 0F, 0F, 0F); + pillar = new ModelRenderer(this, 0, 32); + pillar.addBox(0F, 0F, 0F, 6, 10, 6); + pillar.setRotationPoint(-3F, 12F, -3F); + pillar.setTextureSize(64, 64); + pillar.mirror = true; + setRotation(pillar, 0F, 0F, 0F); + edge1 = new ModelRenderer(this, 0, 29); + edge1.addBox(0F, 0F, 0F, 14, 1, 1); + edge1.setRotationPoint(-7F, 10F, 6F); + edge1.setTextureSize(64, 64); + edge1.mirror = true; + setRotation(edge1, 0F, 0F, 0F); + edge2 = new ModelRenderer(this, 0, 29); + edge2.addBox(0F, 0F, 0F, 14, 1, 1); + edge2.setRotationPoint(-7F, 10F, -7F); + edge2.setTextureSize(64, 64); + edge2.mirror = true; + setRotation(edge2, 0F, 0F, 0F); + edge3 = new ModelRenderer(this, 25, 32); + edge3.addBox(0F, 0F, 0F, 1, 1, 12); + edge3.setRotationPoint(-7F, 10F, -6F); + edge3.setTextureSize(64, 64); + edge3.mirror = true; + setRotation(edge3, 0F, 0F, 0F); + edge4 = new ModelRenderer(this, 25, 32); + edge4.addBox(0F, 0F, 0F, 1, 1, 12); + edge4.setRotationPoint(6F, 10F, -6F); + edge4.setTextureSize(64, 64); + edge4.mirror = true; + setRotation(edge4, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + base.render(f5); + table.render(f5); + pillar.render(f5); + edge1.render(f5); + edge2.render(f5); + edge3.render(f5); + edge4.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelShade.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelShade.java new file mode 100644 index 00000000..8a7f2632 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelShade.java @@ -0,0 +1,86 @@ +package WayofTime.alchemicalWizardry.common.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelShade extends ModelBase +{ + //fields + ModelRenderer body; + ModelRenderer tail1; + ModelRenderer leftArm; + ModelRenderer rightArm; + ModelRenderer tail2; + ModelRenderer head; + + public ModelShade() + { + textureWidth = 64; + textureHeight = 64; + body = new ModelRenderer(this, 0, 45); + body.addBox(-6F, 0F, -3F, 12, 12, 6); + body.setRotationPoint(0F, -4F, 0F); + body.setTextureSize(64, 64); + body.mirror = true; + setRotation(body, 0F, 0F, 0F); + tail1 = new ModelRenderer(this, 37, 43); + tail1.addBox(-2F, 1F, -2F, 4, 6, 4); + tail1.setRotationPoint(0F, 8F, 0F); + tail1.setTextureSize(64, 64); + tail1.mirror = true; + setRotation(tail1, 0.122173F, 0F, 0F); + leftArm = new ModelRenderer(this, 0, 0); + leftArm.addBox(0F, -4F, -2F, 4, 20, 4); + leftArm.setRotationPoint(6F, -2F, 0F); + leftArm.setTextureSize(64, 64); + leftArm.mirror = true; + setRotation(leftArm, 0F, 0F, 0F); + rightArm = new ModelRenderer(this, 0, 0); + rightArm.mirror = true; + rightArm.addBox(-4F, -4F, -2F, 4, 20, 4); + rightArm.setRotationPoint(-6F, -2F, 0F); + rightArm.setTextureSize(64, 64); + rightArm.mirror = true; + setRotation(rightArm, 0F, 0F, 0F); + rightArm.mirror = false; + tail2 = new ModelRenderer(this, 37, 54); + tail2.addBox(-1.5F, 6F, -3F, 3, 6, 3); + tail2.setRotationPoint(0F, 8F, 0F); + tail2.setTextureSize(64, 64); + tail2.mirror = true; + setRotation(tail2, 0.4363323F, 0F, 0F); + head = new ModelRenderer(this, 17, 0); + head.addBox(-4F, -8F, -4F, 8, 8, 8); + head.setRotationPoint(0F, -4F, -1F); + head.setTextureSize(64, 64); + head.mirror = true; + setRotation(head, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + body.render(f5); + tail1.render(f5); + leftArm.render(f5); + rightArm.render(f5); + tail2.render(f5); + head.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + this.head.rotateAngleX = f4 / (180F / (float) Math.PI); + this.head.rotateAngleY = f3 / (180F / (float) Math.PI); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSmallEarthGolem.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSmallEarthGolem.java new file mode 100644 index 00000000..45a232de --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSmallEarthGolem.java @@ -0,0 +1,127 @@ +package WayofTime.alchemicalWizardry.common.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelSmallEarthGolem extends ModelBase +{ + //fields + ModelRenderer leftLeg; + ModelRenderer rightLeg; + ModelRenderer body; + ModelRenderer head; + ModelRenderer chest1; + ModelRenderer chest2; + ModelRenderer chest3; + ModelRenderer leftArm; + ModelRenderer rightArm; + ModelRenderer back1; + + public ModelSmallEarthGolem() + { + textureWidth = 32; + textureHeight = 32; + leftLeg = new ModelRenderer(this, 13, 0); + leftLeg.addBox(-1F, 0F, -1F, 2, 5, 2); + leftLeg.setRotationPoint(1F, 19F, 0F); + leftLeg.setTextureSize(32, 32); + leftLeg.mirror = true; + setRotation(leftLeg, 0F, 0F, 0F); + rightLeg = new ModelRenderer(this, 13, 0); + rightLeg.mirror = true; + rightLeg.addBox(-1F, 0F, -1F, 2, 5, 2); + rightLeg.setRotationPoint(-1F, 19F, 0F); + rightLeg.setTextureSize(32, 32); + rightLeg.mirror = true; + setRotation(rightLeg, 0F, 0F, 0F); + rightLeg.mirror = false; + body = new ModelRenderer(this, 0, 7); + body.addBox(-2F, 0F, -1F, 4, 5, 2); + body.setRotationPoint(0F, 14F, 0F); + body.setTextureSize(32, 32); + body.mirror = true; + setRotation(body, 0F, 0F, 0F); + head = new ModelRenderer(this, 0, 0); + head.addBox(-1.5F, -3F, -2F, 3, 3, 3); + head.setRotationPoint(0F, 14F, 0F); + head.setTextureSize(32, 32); + head.mirror = true; + setRotation(head, 0F, 0F, 0F); + chest1 = new ModelRenderer(this, 22, 0); + chest1.addBox(-1F, 0.5F, -2F, 2, 3, 1); + chest1.setRotationPoint(0F, 14F, 0F); + chest1.setTextureSize(32, 32); + chest1.mirror = true; + setRotation(chest1, 0F, 0F, 0F); + chest2 = new ModelRenderer(this, 22, 5); + chest2.addBox(1F, 1.5F, -2F, 1, 1, 1); + chest2.setRotationPoint(0F, 14F, 0F); + chest2.setTextureSize(32, 32); + chest2.mirror = true; + setRotation(chest2, 0F, 0F, 0F); + chest3 = new ModelRenderer(this, 22, 5); + chest3.mirror = true; + chest3.addBox(-2F, 1.5F, -2F, 1, 1, 1); + chest3.setRotationPoint(0F, 14F, 0F); + chest3.setTextureSize(32, 32); + chest3.mirror = true; + setRotation(chest3, 0F, 0F, 0F); + chest3.mirror = false; + leftArm = new ModelRenderer(this, 13, 7); + leftArm.addBox(0F, -1F, -1F, 2, 5, 2); + leftArm.setRotationPoint(2F, 15F, 0F); + leftArm.setTextureSize(32, 32); + leftArm.mirror = true; + setRotation(leftArm, 0F, 0F, 0F); + rightArm = new ModelRenderer(this, 13, 7); + rightArm.mirror = true; + rightArm.addBox(-2F, -1F, -1F, 2, 5, 2); + rightArm.setRotationPoint(-2F, 15F, 0F); + rightArm.setTextureSize(32, 32); + rightArm.mirror = true; + setRotation(rightArm, 0F, 0F, 0F); + rightArm.mirror = false; + back1 = new ModelRenderer(this, 22, 8); + back1.addBox(-1.5F, 1.5F, 1F, 3, 1, 1); + back1.setRotationPoint(0F, 14F, 0F); + back1.setTextureSize(32, 32); + back1.mirror = true; + setRotation(back1, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + leftLeg.render(f5); + rightLeg.render(f5); + body.render(f5); + head.render(f5); + chest1.render(f5); + chest2.render(f5); + chest3.render(f5); + leftArm.render(f5); + rightArm.render(f5); + back1.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + this.head.rotateAngleX = f4 / (180F / (float) Math.PI); + this.head.rotateAngleY = f3 / (180F / (float) Math.PI); + this.leftLeg.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1; + this.rightLeg.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * 1.4F * f1; + this.rightArm.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * 1.4F * f1; + this.leftArm.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1; + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEffectBlock.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEffectBlock.java new file mode 100644 index 00000000..61110926 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEffectBlock.java @@ -0,0 +1,332 @@ +package WayofTime.alchemicalWizardry.common.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraftforge.common.util.ForgeDirection; + +public class ModelSpellEffectBlock extends ModelBase +{ + //fields + ModelRenderer core; + ModelRenderer frame1; + ModelRenderer frame2; + ModelRenderer frame3; + ModelRenderer frame4; + ModelRenderer frame5; + ModelRenderer frame6; + ModelRenderer frame7; + ModelRenderer frame8; + ModelRenderer frame9; + ModelRenderer frame10; + ModelRenderer frame11; + ModelRenderer frame12; + ModelRenderer inputSpacer1; + ModelRenderer inputFace; + ModelRenderer inputSpacer2; + ModelRenderer inputSpacer3; + ModelRenderer inputSpacer4; + ModelRenderer outputFace; + ModelRenderer outputPlug; + ModelRenderer outputSpacer1; + ModelRenderer outputSpacer2; + ModelRenderer outputSpacer3; + ModelRenderer outputSpacer4; + + public ModelSpellEffectBlock() + { + textureWidth = 64; + textureHeight = 64; + + core = new ModelRenderer(this, 0, 0); + core.addBox(-3F, -3F, -3F, 6, 6, 6); + core.setRotationPoint(0F, 16F, 0F); + core.setTextureSize(64, 64); + core.mirror = true; + setRotation(core, 0F, 0F, 0F); + frame1 = new ModelRenderer(this, 16, 18); + frame1.addBox(3F, -3F, -5F, 2, 6, 2); + frame1.setRotationPoint(0F, 16F, 0F); + frame1.setTextureSize(64, 64); + frame1.mirror = true; + setRotation(frame1, 0F, 0F, 0F); + frame2 = new ModelRenderer(this, 0, 18); + frame2.addBox(-5F, -3F, -5F, 2, 6, 2); + frame2.setRotationPoint(0F, 16F, 0F); + frame2.setTextureSize(64, 64); + frame2.mirror = true; + setRotation(frame2, 0F, 0F, 0F); + frame3 = new ModelRenderer(this, 0, 13); + frame3.addBox(-5F, -5F, -5F, 10, 2, 2); + frame3.setRotationPoint(0F, 16F, 0F); + frame3.setTextureSize(64, 64); + frame3.mirror = true; + setRotation(frame3, 0F, 0F, 0F); + frame4 = new ModelRenderer(this, 0, 27); + frame4.addBox(-5F, 3F, -5F, 10, 2, 2); + frame4.setRotationPoint(0F, 16F, 0F); + frame4.setTextureSize(64, 64); + frame4.mirror = true; + setRotation(frame4, 0F, 0F, 0F); + frame5 = new ModelRenderer(this, 0, 34); + frame5.addBox(-5F, -5F, 3F, 10, 2, 2); + frame5.setRotationPoint(0F, 16F, 0F); + frame5.setTextureSize(64, 64); + frame5.mirror = true; + setRotation(frame5, 0F, 0F, 0F); + frame6 = new ModelRenderer(this, 0, 48); + frame6.addBox(-5F, 3F, 3F, 10, 2, 2); + frame6.setRotationPoint(0F, 16F, 0F); + frame6.setTextureSize(64, 64); + frame6.mirror = true; + setRotation(frame6, 0F, 0F, 0F); + frame7 = new ModelRenderer(this, 16, 39); + frame7.addBox(-5F, -3F, 3F, 2, 6, 2); + frame7.setRotationPoint(0F, 16F, 0F); + frame7.setTextureSize(64, 64); + frame7.mirror = true; + setRotation(frame7, 0F, 0F, 0F); + frame8 = new ModelRenderer(this, 0, 39); + frame8.addBox(3F, -3F, 3F, 2, 6, 2); + frame8.setRotationPoint(0F, 16F, 0F); + frame8.setTextureSize(64, 64); + frame8.mirror = true; + setRotation(frame8, 0F, 0F, 0F); + frame9 = new ModelRenderer(this, 25, 9); + frame9.addBox(-5F, 3F, -3F, 2, 2, 6); + frame9.setRotationPoint(0F, 16F, 0F); + frame9.setTextureSize(64, 64); + frame9.mirror = true; + setRotation(frame9, 0F, 0F, 0F); + frame10 = new ModelRenderer(this, 25, 0); + frame10.addBox(-5F, -5F, -3F, 2, 2, 6); + frame10.setRotationPoint(0F, 16F, 0F); + frame10.setTextureSize(64, 64); + frame10.mirror = true; + setRotation(frame10, 0F, 0F, 0F); + frame11 = new ModelRenderer(this, 42, 0); + frame11.addBox(3F, -5F, -3F, 2, 2, 6); + frame11.setRotationPoint(0F, 16F, 0F); + frame11.setTextureSize(64, 64); + frame11.mirror = true; + setRotation(frame11, 0F, 0F, 0F); + frame12 = new ModelRenderer(this, 42, 9); + frame12.addBox(3F, 3F, -3F, 2, 2, 6); + frame12.setRotationPoint(0F, 16F, 0F); + frame12.setTextureSize(64, 64); + frame12.mirror = true; + setRotation(frame12, 0F, 0F, 0F); + inputSpacer1 = new ModelRenderer(this, 25, 27); + inputSpacer1.addBox(3F, -5F, -8F, 2, 2, 3); + inputSpacer1.setRotationPoint(0F, 16F, 0F); + inputSpacer1.setTextureSize(64, 64); + inputSpacer1.mirror = true; + setRotation(inputSpacer1, 0F, 0F, 0F); + inputFace = new ModelRenderer(this, 38, 27); + inputFace.addBox(-2F, -2F, -8F, 4, 4, 5); + inputFace.setRotationPoint(0F, 16F, 0F); + inputFace.setTextureSize(64, 64); + inputFace.mirror = true; + setRotation(inputFace, 0F, 0F, 0F); + inputSpacer2 = new ModelRenderer(this, 25, 27); + inputSpacer2.addBox(-5F, -5F, -8F, 2, 2, 3); + inputSpacer2.setRotationPoint(0F, 16F, 0F); + inputSpacer2.setTextureSize(64, 64); + inputSpacer2.mirror = true; + setRotation(inputSpacer2, 0F, 0F, 0F); + inputSpacer3 = new ModelRenderer(this, 25, 27); + inputSpacer3.addBox(3F, 3F, -8F, 2, 2, 3); + inputSpacer3.setRotationPoint(0F, 16F, 0F); + inputSpacer3.setTextureSize(64, 64); + inputSpacer3.mirror = true; + setRotation(inputSpacer3, 0F, 0F, 0F); + inputSpacer4 = new ModelRenderer(this, 25, 27); + inputSpacer4.addBox(-5F, 3F, -8F, 2, 2, 3); + inputSpacer4.setRotationPoint(0F, 16F, 0F); + inputSpacer4.setTextureSize(64, 64); + inputSpacer4.mirror = true; + setRotation(inputSpacer4, 0F, 0F, 0F); + outputFace = new ModelRenderer(this, 38, 37); + outputFace.addBox(6F, -2F, -2F, 2, 4, 4); + outputFace.setRotationPoint(0F, 16F, 0F); + outputFace.setTextureSize(64, 64); + outputFace.mirror = true; + setRotation(outputFace, 0F, 0F, 0F); + outputPlug = new ModelRenderer(this, 36, 48); + outputPlug.addBox(3F, -3F, -3F, 2, 6, 6); + outputPlug.setRotationPoint(0F, 16F, 0F); + outputPlug.setTextureSize(64, 64); + outputPlug.mirror = true; + setRotation(outputPlug, 0F, 0F, 0F); + outputSpacer1 = new ModelRenderer(this, 25, 48); + outputSpacer1.addBox(5F, -5F, -5F, 3, 2, 2); + outputSpacer1.setRotationPoint(0F, 16F, 0F); + outputSpacer1.setTextureSize(64, 64); + outputSpacer1.mirror = true; + setRotation(outputSpacer1, 0F, 0F, 0F); + outputSpacer2 = new ModelRenderer(this, 25, 48); + outputSpacer2.addBox(5F, -5F, 3F, 3, 2, 2); + outputSpacer2.setRotationPoint(0F, 16F, 0F); + outputSpacer2.setTextureSize(64, 64); + outputSpacer2.mirror = true; + setRotation(outputSpacer2, 0F, 0F, 0F); + outputSpacer3 = new ModelRenderer(this, 25, 48); + outputSpacer3.addBox(5F, 3F, -5F, 3, 2, 2); + outputSpacer3.setRotationPoint(0F, 16F, 0F); + outputSpacer3.setTextureSize(64, 64); + outputSpacer3.mirror = true; + setRotation(outputSpacer3, 0F, 0F, 0F); + outputSpacer4 = new ModelRenderer(this, 25, 48); + outputSpacer4.addBox(5F, 3F, 3F, 3, 2, 2); + outputSpacer4.setRotationPoint(0F, 16F, 0F); + outputSpacer4.setTextureSize(64, 64); + outputSpacer4.mirror = true; + setRotation(outputSpacer4, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, ForgeDirection input, ForgeDirection output) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + float xInputRot = 0.0f; + float yInputRot = 0.0f; + float zInputRot = 0.0f; + float xOutputRot = 0.0f; + float yOutputRot = 0.0f; + float zOutputRot = 0.0f; + + switch (input) + { + case NORTH: + xInputRot = 0.0f; + yInputRot = 0.0f; + zInputRot = 0.0f; + break; + + case EAST: + xInputRot = 0.0f; + yInputRot = (float) (0.5f * Math.PI); + zInputRot = 0.0f; + break; + + case SOUTH: + xInputRot = 0.0f; + yInputRot = (float) (1.0f * Math.PI); + zInputRot = 0.0f; + break; + + case WEST: + xInputRot = 0.0f; + yInputRot = (float) (-0.5f * Math.PI); + zInputRot = 0.0f; + break; + + case UP: + xInputRot = (float) (-0.5f * Math.PI); + yInputRot = 0.0f; + zInputRot = 0.0f; + break; + + case DOWN: + xInputRot = (float) (0.5f * Math.PI); + yInputRot = 0.0f; + zInputRot = 0.0f; + break; + + default: + break; + } + + switch (output) + { + case NORTH: + xOutputRot = 0.0f; + yOutputRot = (float) (0.5f * Math.PI); + zOutputRot = 0.0f; + break; + + case EAST: + xOutputRot = 0.0f; + yOutputRot = (float) (1.0f * Math.PI); + zOutputRot = 0.0f; + break; + + case SOUTH: + xOutputRot = 0.0f; + yOutputRot = (float) (-0.5f * Math.PI); + zOutputRot = 0.0f; + break; + + case WEST: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = 0.0f; + break; + + case UP: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = (float) (-0.5f * Math.PI); + break; + + case DOWN: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = (float) (0.5f * Math.PI); + break; + + default: + break; + } + + this.setRotation(inputFace, xInputRot, yInputRot, zInputRot); + this.setRotation(outputFace, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(inputSpacer1, xInputRot, yInputRot, zInputRot); + this.setRotation(inputSpacer2, xInputRot, yInputRot, zInputRot); + this.setRotation(inputSpacer3, xInputRot, yInputRot, zInputRot); + this.setRotation(inputSpacer4, xInputRot, yInputRot, zInputRot); + this.setRotation(outputPlug, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(outputSpacer1, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(outputSpacer2, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(outputSpacer3, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(outputSpacer4, xOutputRot, yOutputRot, zOutputRot); + + core.render(f5); + frame1.render(f5); + frame2.render(f5); + frame3.render(f5); + frame4.render(f5); + frame5.render(f5); + frame6.render(f5); + frame7.render(f5); + frame8.render(f5); + frame9.render(f5); + frame10.render(f5); + frame11.render(f5); + frame12.render(f5); + inputSpacer1.render(f5); + inputFace.render(f5); + inputSpacer2.render(f5); + inputSpacer3.render(f5); + inputSpacer4.render(f5); + outputFace.render(f5); + outputPlug.render(f5); + outputSpacer1.render(f5); + outputSpacer2.render(f5); + outputSpacer3.render(f5); + outputSpacer4.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } + +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelWingedFireDemon.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelWingedFireDemon.java new file mode 100644 index 00000000..07164ffd --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelWingedFireDemon.java @@ -0,0 +1,203 @@ +package WayofTime.alchemicalWizardry.common.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelWingedFireDemon extends ModelBase +{ + //fields + ModelRenderer leftLegPlate; + ModelRenderer leftLeg; + ModelRenderer codPiece; + ModelRenderer rightLegPlate; + ModelRenderer rightLeg; + ModelRenderer body; + ModelRenderer leftShoulder; + ModelRenderer leftArm; + ModelRenderer head; + ModelRenderer rightShoulder; + ModelRenderer rightArm; + ModelRenderer leftWing; + ModelRenderer rightWing; + ModelRenderer leftHorn1; + ModelRenderer rightHorn1; + ModelRenderer leftHorn2; + ModelRenderer rightHorn2; + + public ModelWingedFireDemon() + { + textureWidth = 64; + textureHeight = 64; + leftLegPlate = new ModelRenderer(this, 40, 36); + leftLegPlate.addBox(0F, -3F, -3F, 6, 6, 6); + leftLegPlate.setRotationPoint(2F, 5F, 0F); + leftLegPlate.setTextureSize(64, 64); + leftLegPlate.mirror = true; + setRotation(leftLegPlate, 0F, 0F, 0F); + leftLeg = new ModelRenderer(this, 48, 16); + leftLeg.addBox(1F, 3F, -2F, 4, 16, 4); + leftLeg.setRotationPoint(2F, 5F, 0F); + leftLeg.setTextureSize(64, 64); + leftLeg.mirror = true; + setRotation(leftLeg, 0F, 0F, 0F); + codPiece = new ModelRenderer(this, 48, 0); + codPiece.addBox(-2F, 0F, -2F, 4, 6, 4); + codPiece.setRotationPoint(0F, 1F, 0F); + codPiece.setTextureSize(64, 64); + codPiece.mirror = true; + setRotation(codPiece, 0F, 0F, 0F); + rightLegPlate = new ModelRenderer(this, 40, 36); + rightLegPlate.mirror = true; + rightLegPlate.addBox(-6F, -3F, -3F, 6, 6, 6); + rightLegPlate.setRotationPoint(-2F, 5F, 0F); + rightLegPlate.setTextureSize(64, 64); + rightLegPlate.mirror = true; + setRotation(rightLegPlate, 0F, 0F, 0F); + rightLegPlate.mirror = false; + rightLeg = new ModelRenderer(this, 48, 16); + rightLeg.mirror = true; + rightLeg.addBox(-5F, 3F, -2F, 4, 16, 4); + rightLeg.setRotationPoint(-2F, 5F, 0F); + rightLeg.setTextureSize(64, 64); + rightLeg.mirror = true; + setRotation(rightLeg, 0F, 0F, 0F); + rightLeg.mirror = false; + body = new ModelRenderer(this, 0, 44); + body.addBox(-5F, -14F, -3F, 10, 14, 6); + body.setRotationPoint(0F, 1F, 0F); + body.setTextureSize(64, 64); + body.mirror = true; + setRotation(body, 0F, 0F, 0F); + leftShoulder = new ModelRenderer(this, 0, 29); + leftShoulder.addBox(0F, -5F, -4F, 8, 7, 8); + leftShoulder.setRotationPoint(5F, -10F, 0F); + leftShoulder.setTextureSize(64, 64); + leftShoulder.mirror = true; + setRotation(leftShoulder, 0F, 0F, 0F); + leftArm = new ModelRenderer(this, 32, 0); + leftArm.addBox(3F, 2F, -2F, 4, 12, 4); + leftArm.setRotationPoint(5F, -10F, 0F); + leftArm.setTextureSize(64, 64); + leftArm.mirror = true; + setRotation(leftArm, 0F, 0F, 0F); + head = new ModelRenderer(this, 32, 48); + head.addBox(-4F, -7F, -4F, 8, 8, 8); + head.setRotationPoint(0F, -14F, -1F); + head.setTextureSize(64, 64); + head.mirror = true; + setRotation(head, 0F, 0F, 0F); + rightShoulder = new ModelRenderer(this, 0, 29); + rightShoulder.mirror = true; + rightShoulder.mirror = true; + rightShoulder.addBox(-8F, -5F, -4F, 8, 7, 8); + rightShoulder.setRotationPoint(-5F, -10F, 0F); + rightShoulder.setTextureSize(64, 64); + rightShoulder.mirror = true; + setRotation(rightShoulder, 0F, 0F, 0F); + rightShoulder.mirror = false; + rightArm = new ModelRenderer(this, 32, 0); + rightArm.mirror = true; + rightArm.mirror = true; + rightArm.addBox(-7F, 2F, -2F, 4, 12, 4); + rightArm.setRotationPoint(-5F, -10F, 0F); + rightArm.setTextureSize(64, 64); + rightArm.mirror = true; + setRotation(rightArm, 0F, 0F, 0F); + rightArm.mirror = false; + leftWing = new ModelRenderer(this, 0, 0); + leftWing.addBox(0F, -2F, 0F, 16, 12, 0); + leftWing.setRotationPoint(0F, -11F, 3F); + leftWing.setTextureSize(64, 64); + leftWing.mirror = true; + setRotation(leftWing, 0F, -0.5061455F, 0F); + rightWing = new ModelRenderer(this, 0, 0); + rightWing.mirror = true; + rightWing.addBox(-16F, -2F, 0F, 16, 12, 0); + rightWing.setRotationPoint(0F, -11F, 3F); + rightWing.setTextureSize(64, 64); + rightWing.mirror = true; + setRotation(rightWing, 0F, 0.5061455F, 0F); + rightWing.mirror = false; + leftHorn1 = new ModelRenderer(this, 0, 12); + leftHorn1.addBox(4F, -9F, -1F, 1, 5, 1); + leftHorn1.setRotationPoint(0F, -14F, -1F); + leftHorn1.setTextureSize(64, 64); + leftHorn1.mirror = true; + setRotation(leftHorn1, 0F, 0F, 0F); + rightHorn1 = new ModelRenderer(this, 0, 12); + rightHorn1.mirror = true; + rightHorn1.addBox(-5F, -9F, -1F, 1, 5, 1); + rightHorn1.setRotationPoint(0F, -14F, -1F); + rightHorn1.setTextureSize(64, 64); + rightHorn1.mirror = true; + setRotation(rightHorn1, 0F, 0F, 0F); + rightHorn1.mirror = false; + leftHorn2 = new ModelRenderer(this, 4, 12); + leftHorn2.addBox(4F, -10F, 0F, 1, 5, 1); + leftHorn2.setRotationPoint(0F, -14F, -1F); + leftHorn2.setTextureSize(64, 64); + leftHorn2.mirror = true; + setRotation(leftHorn2, 0F, 0F, 0F); + rightHorn2 = new ModelRenderer(this, 4, 12); + rightHorn2.mirror = true; + rightHorn2.addBox(-5F, -10F, 0F, 1, 5, 1); + rightHorn2.setRotationPoint(0F, -14F, -1F); + rightHorn2.setTextureSize(64, 64); + rightHorn2.mirror = true; + setRotation(rightHorn2, 0F, 0F, 0F); + rightHorn2.mirror = false; + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + leftLegPlate.render(f5); + leftLeg.render(f5); + codPiece.render(f5); + rightLegPlate.render(f5); + rightLeg.render(f5); + body.render(f5); + leftShoulder.render(f5); + leftArm.render(f5); + head.render(f5); + rightShoulder.render(f5); + rightArm.render(f5); + leftWing.render(f5); + rightWing.render(f5); + leftHorn1.render(f5); + rightHorn1.render(f5); + leftHorn2.render(f5); + rightHorn2.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + this.head.rotateAngleX = f4 / (180F / (float) Math.PI); + this.head.rotateAngleY = f3 / (180F / (float) Math.PI); + this.leftHorn1.rotateAngleX = head.rotateAngleX; + this.leftHorn1.rotateAngleY = head.rotateAngleY; + this.leftHorn2.rotateAngleX = head.rotateAngleX; + this.leftHorn2.rotateAngleY = head.rotateAngleY; + this.rightHorn1.rotateAngleX = head.rotateAngleX; + this.rightHorn1.rotateAngleY = head.rotateAngleY; + this.rightHorn2.rotateAngleX = head.rotateAngleX; + this.rightHorn2.rotateAngleY = head.rotateAngleY; + this.leftLeg.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1; + this.rightLeg.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * 1.0F * f1; + this.rightArm.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * 1.0F * f1; + this.leftArm.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1; + this.leftShoulder.rotateAngleX = this.leftArm.rotateAngleX; + this.rightShoulder.rotateAngleX = this.rightArm.rotateAngleX; + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelWritingTable.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelWritingTable.java new file mode 100644 index 00000000..15dede34 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelWritingTable.java @@ -0,0 +1,138 @@ +package WayofTime.alchemicalWizardry.common.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelWritingTable extends ModelBase +{ + //fields + ModelRenderer base; + ModelRenderer support; + ModelRenderer appendage1; + ModelRenderer appendage2; + ModelRenderer appendage3; + ModelRenderer appendage4; + ModelRenderer appendage5; + ModelRenderer outputPad; + ModelRenderer input1; + ModelRenderer input5; + ModelRenderer input4; + ModelRenderer input3; + ModelRenderer Shape1; + + public ModelWritingTable() + { + textureWidth = 64; + textureHeight = 64; + base = new ModelRenderer(this, 0, 0); + base.addBox(0F, 0F, 0F, 16, 2, 16); + base.setRotationPoint(-8F, 22F, -8F); + base.setTextureSize(64, 32); + base.mirror = true; + setRotation(base, 0F, 0F, 0F); + support = new ModelRenderer(this, 0, 0); + support.addBox(0F, 0F, 0F, 2, 12, 2); + support.setRotationPoint(-1F, 10F, -1F); + support.setTextureSize(64, 32); + support.mirror = true; + setRotation(support, 0F, 0F, 0F); + appendage1 = new ModelRenderer(this, 48, 0); + appendage1.addBox(1F, 0F, 0F, 7, 11, 0); + appendage1.setRotationPoint(0F, 10F, 0F); + appendage1.setTextureSize(64, 32); + appendage1.mirror = true; + setRotation(appendage1, 0F, 0F, 0F); + appendage2 = new ModelRenderer(this, 48, 0); + appendage2.addBox(1F, 0F, 0F, 7, 11, 0); + appendage2.setRotationPoint(0F, 10F, 0F); + appendage2.setTextureSize(64, 32); + appendage2.mirror = true; + setRotation(appendage2, 0F, ((float) Math.PI * 2F / 5F), 0F); + appendage3 = new ModelRenderer(this, 48, 0); + appendage3.addBox(1F, 0F, 0F, 7, 11, 0); + appendage3.setRotationPoint(0F, 10F, 0F); + appendage3.setTextureSize(64, 32); + appendage3.mirror = true; + setRotation(appendage3, 0F, 2.513274F, 0F); + appendage4 = new ModelRenderer(this, 48, 0); + appendage4.addBox(1F, 0F, 0F, 7, 11, 0); + appendage4.setRotationPoint(0F, 10F, 0F); + appendage4.setTextureSize(64, 32); + appendage4.mirror = true; + setRotation(appendage4, 0F, -2.513274F, 0F); + appendage5 = new ModelRenderer(this, 48, 0); + appendage5.addBox(1F, 0F, 0F, 7, 11, 0); + appendage5.setRotationPoint(0F, 10F, 0F); + appendage5.setTextureSize(64, 32); + appendage5.mirror = true; + setRotation(appendage5, 0F, -((float) Math.PI * 2F / 5F), 0F); + outputPad = new ModelRenderer(this, 0, 20); + outputPad.addBox(0F, 0F, 0F, 4, 1, 4); + outputPad.setRotationPoint(-2F, 9F, -2F); + outputPad.setTextureSize(64, 64); + outputPad.mirror = true; + setRotation(outputPad, 0F, 0F, 0F); + input1 = new ModelRenderer(this, 0, 20); + input1.addBox(4F, 0F, -2F, 4, 1, 4); + input1.setRotationPoint(0F, 21F, 0F); + input1.setTextureSize(64, 64); + input1.mirror = true; + setRotation(input1, 0F, 0F, 0F); + input5 = new ModelRenderer(this, 0, 20); + input5.addBox(0F, 0F, 0F, 4, 1, 4); + input5.setRotationPoint(0F, 21F, -8F); + input5.setTextureSize(64, 64); + input5.mirror = true; + setRotation(input5, 0F, 0F, 0F); + input4 = new ModelRenderer(this, 0, 20); + input4.addBox(-7F, 0F, -6F, 4, 1, 4); + input4.setRotationPoint(0F, 21F, 0F); + input4.setTextureSize(64, 64); + input4.mirror = true; + setRotation(input4, 0F, 0F, 0F); + input3 = new ModelRenderer(this, 0, 20); + input3.addBox(-7F, 0F, 2F, 4, 1, 4); + input3.setRotationPoint(0F, 21F, 0F); + input3.setTextureSize(64, 64); + input3.mirror = true; + setRotation(input3, 0F, 0F, 0F); + Shape1 = new ModelRenderer(this, 0, 20); + Shape1.addBox(0F, 0F, 4F, 4, 1, 4); + Shape1.setRotationPoint(0F, 21F, 0F); + Shape1.setTextureSize(64, 64); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + base.render(f5); + support.render(f5); + appendage1.render(f5); + appendage2.render(f5); + appendage3.render(f5); + appendage4.render(f5); + appendage5.render(f5); + outputPad.render(f5); + input1.render(f5); + input5.render(f5); + input4.render(f5); + input3.render(f5); + Shape1.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBazookaMainProjectile.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBazookaMainProjectile.java new file mode 100644 index 00000000..57df9912 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBazookaMainProjectile.java @@ -0,0 +1,39 @@ +package WayofTime.alchemicalWizardry.common.renderer.projectile; + +import WayofTime.alchemicalWizardry.common.renderer.model.ModelEnergyBazookaMainProjectile; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class RenderEnergyBazookaMainProjectile extends Render +{ + public ModelBase model = new ModelEnergyBazookaMainProjectile(); + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/EnergyBazookaMainProjectile.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + private float scale = 1.0f; + + @Override + public void doRender(Entity entity, double d0, double d1, double d2, float f, float f1) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float) d0, (float) d1, (float) d2); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glScalef(scale, scale, scale); + this.bindTexture(this.getEntityTexture(entity)); + GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * f1, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(180.0f - entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * f1, 1.0F, 0.0F, 0.0f); + model.render(entity, 0, (float) d0, (float) d1, (float) d2, f, f1); + //GL11.glRotatef(entity.getRotationYawHead(), 0.0F, 1.0F, 0.0F); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + + @Override + protected ResourceLocation getEntityTexture(Entity entity) + { + // TODO Auto-generated method stub + return field_110833_a; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBlastProjectile.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBlastProjectile.java new file mode 100644 index 00000000..787ec4ad --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBlastProjectile.java @@ -0,0 +1,91 @@ +package WayofTime.alchemicalWizardry.common.renderer.projectile; + +import WayofTime.alchemicalWizardry.common.entity.projectile.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +@SideOnly(Side.CLIENT) +public class RenderEnergyBlastProjectile extends Render +{ + public void doRenderEnergyBlastProjectile(EnergyBlastProjectile entityShot, double par2, double par4, double par6, float par8, float par9) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float) par2, (float) par4, (float) par6); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glScalef(0.1F, 0.1F, 0.1F); + this.bindTexture(this.getEntityTexture(entityShot)); + Tessellator var12 = Tessellator.instance; + GL11.glRotatef(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + var12.startDrawingQuads(); + var12.setNormal(0.0F, 1.0F, 0.0F); + var12.addVertexWithUV(-0.5F, -0.25F, 0.0D, 0, 1); + var12.addVertexWithUV(0.5F, -0.25F, 0.0D, 1, 1); + var12.addVertexWithUV(0.5F, 0.75F, 0.0D, 1, 0); + var12.addVertexWithUV(-0.5F, 0.75F, 0.0D, 0, 0); + var12.draw(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + + @Override + public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) + { + if (par1Entity instanceof EnergyBlastProjectile) + { + this.doRenderEnergyBlastProjectile((EnergyBlastProjectile) par1Entity, par2, par4, par6, par8, par9); + } + } + + @Override + protected ResourceLocation getEntityTexture(Entity entity) + { + if (entity instanceof IceProjectile) + { + return new ResourceLocation("alchemicalwizardry", "textures/entities/iceProjectile.png"); + } + + if (entity instanceof FireProjectile) + { + return new ResourceLocation("alchemicalwizardry", "textures/entities/fireProjectile.png"); + } + + if (entity instanceof ExplosionProjectile) + { + return new ResourceLocation("alchemicalwizardry", "textures/entities/explosionProjectile.png"); + } + + if (entity instanceof HolyProjectile) + { + return new ResourceLocation("alchemicalwizardry", "textures/entities/holyProjectile.png"); + } + + if (entity instanceof WindGustProjectile) + { + return new ResourceLocation("alchemicalwizardry", "textures/entities/windGustProjectile.png"); + } + + if (entity instanceof LightningBoltProjectile) + { + return new ResourceLocation("alchemicalwizardry", "textures/entities/lightningProjectile.png"); + } + + if (entity instanceof WaterProjectile) + { + return new ResourceLocation("alchemicalwizardry", "textures/entities/waterProjectile.png"); + } + + if (entity instanceof MudProjectile) + { + return new ResourceLocation("alchemicalwizardry", "textures/entities/mudProjectile.png"); + } + + return new ResourceLocation("alchemicalwizardry", "textures/entities/energyBlastProjectile.png"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderFireProjectile.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderFireProjectile.java new file mode 100644 index 00000000..cda739fe --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderFireProjectile.java @@ -0,0 +1,41 @@ +package WayofTime.alchemicalWizardry.common.renderer.projectile; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class RenderFireProjectile +{ +// public void doRenderProjectile(FireProjectile entityShot, double par2, double par4, double par6, float par8, float par9) +// { +// GL11.glPushMatrix(); +// GL11.glTranslatef((float)par2, (float)par4, (float)par6); +// GL11.glEnable(GL12.GL_RESCALE_NORMAL); +// GL11.glScalef(0.1F, 0.1F, 0.1F); +// this.func_110776_a(this.func_110775_a(entityShot)); +// Tessellator var12 = Tessellator.instance; +// GL11.glRotatef(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F); +// GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F); +// var12.startDrawingQuads(); +// var12.setNormal(0.0F, 1.0F, 0.0F); +// var12.addVertexWithUV(-0.5F, -0.25F, 0.0D, 0, 1); +// var12.addVertexWithUV(0.5F, -0.25F, 0.0D, 1, 1); +// var12.addVertexWithUV(0.5F, 0.75F, 0.0D, 1, 0); +// var12.addVertexWithUV(-0.5F, 0.75F, 0.0D, 0, 0); +// var12.draw(); +// GL11.glDisable(GL12.GL_RESCALE_NORMAL); +// GL11.glPopMatrix(); +// } +// +// @Override +// public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) +// { +// this.doRenderProjectile((FireProjectile)par1Entity, par2, par4, par6, par8, par9); +// } +// +// @Override +// protected ResourceLocation func_110775_a(Entity entity) +// { +// return new ResourceLocation("alchemicalwizardry:/textures/entities/fireProjectile.png"); +// } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderMeteor.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderMeteor.java new file mode 100644 index 00000000..c39dcb11 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderMeteor.java @@ -0,0 +1,39 @@ +package WayofTime.alchemicalWizardry.common.renderer.projectile; + +import WayofTime.alchemicalWizardry.common.renderer.model.ModelMeteor; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class RenderMeteor extends Render +{ + public ModelBase model = new ModelMeteor(); + private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/Meteor.png"); //refers to:YourMod/modelsTextureFile/optionalFile/yourTexture.png + private float scale = 1.0f; + + @Override + public void doRender(Entity entity, double d0, double d1, double d2, float f, float f1) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float) d0, (float) d1, (float) d2); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glScalef(scale, scale, scale); + this.bindTexture(this.getEntityTexture(entity)); + GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * f1, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(180.0f - entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * f1, 1.0F, 0.0F, 0.0f); + model.render(entity, 0, (float) d0, (float) d1, (float) d2, f, f1); + //GL11.glRotatef(entity.getRotationYawHead(), 0.0F, 1.0F, 0.0F); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + + @Override + protected ResourceLocation getEntityTexture(Entity entity) + { + // TODO Auto-generated method stub + return field_110833_a; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualComponent.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualComponent.java new file mode 100644 index 00000000..e929ac69 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualComponent.java @@ -0,0 +1,43 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +public class RitualComponent +{ + private int x; + private int y; + private int z; + private int stoneType; + public static final int BLANK = 0; + public static final int WATER = 1; + public static final int FIRE = 2; + public static final int EARTH = 3; + public static final int AIR = 4; + public static final int DUSK = 5; + + public RitualComponent(int x, int y, int z, int stoneType) + { + this.x = x; + this.y = y; + this.z = z; + this.stoneType = stoneType; + } + + public int getX() + { + return this.x; + } + + public int getY() + { + return this.y; + } + + public int getZ() + { + return this.z; + } + + public int getStoneType() + { + return this.stoneType; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffect.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffect.java new file mode 100644 index 00000000..4652c83c --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffect.java @@ -0,0 +1,15 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; + +public abstract class RitualEffect +{ + public abstract void performEffect(TEMasterStone ritualStone); + + public abstract int getCostPerRefresh(); + + public int getInitialCooldown() + { + return 0; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAnimalGrowth.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAnimalGrowth.java new file mode 100644 index 00000000..886effc4 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAnimalGrowth.java @@ -0,0 +1,93 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import java.util.Iterator; +import java.util.List; + +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; + +public class RitualEffectAnimalGrowth extends RitualEffect +{ + @Override + public void performEffect(TEMasterStone 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.getWorldObj(); + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + + if (world.getWorldTime() % 20 != 0) + { + return; + } + + int d0 = 2; + AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) x, (double) y + 1, (double) z, (double) (x + 1), (double) (y + 3), (double) (z + 1)).expand(d0, 0, d0); + List list = world.getEntitiesWithinAABB(EntityAgeable.class, axisalignedbb); + Iterator iterator1 = list.iterator(); + EntityAgeable entity; + int entityCount = 0; + boolean flag = false; + + while (iterator1.hasNext()) + { + entity = (EntityAgeable) iterator1.next(); + entityCount++; + } + + if (currentEssence < this.getCostPerRefresh() * entityCount) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + Iterator iterator2 = list.iterator(); + entityCount = 0; + + while (iterator2.hasNext()) + { + entity = (EntityAgeable) iterator2.next(); + + if (entity.getGrowingAge() < 0) + { + entity.addGrowth(5); + entityCount++; + } + } + + data.currentEssence = currentEssence - this.getCostPerRefresh() * entityCount; + data.markDirty(); + } + } + + @Override + public int getCostPerRefresh() + { + // TODO Auto-generated method stub + return 2; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectApiaryOverclock.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectApiaryOverclock.java new file mode 100644 index 00000000..f52a9dd9 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectApiaryOverclock.java @@ -0,0 +1,81 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; + +public class RitualEffectApiaryOverclock extends RitualEffect +{ + @Override + public void performEffect(TEMasterStone 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.getWorldObj(); + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + + + if (currentEssence < this.getCostPerRefresh()) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { +// TileEntity tile = world.getTileEntity(x, y+1, z); +// +// try{ +// if(tile instanceof IBeeHousing && tile.getClass().getName().contains("Apiary")) +// { +// for (int i = 0; i < 10; i++) +// { +// PacketDispatcher.sendPacketToAllPlayers(TEAltar.getParticlePacket(x, y+1, z, (short) 3)); +// } +// +// for(int i=0; i<9; i++) +// { +// tile.updateEntity(); +// } +// +// data.currentEssence = currentEssence - this.getCostPerRefresh(); +// data.markDirty(); +// } +// }catch (Exception e) +// { +// +// } + + + } + + } + + @Override + public int getCostPerRefresh() + { + // TODO Auto-generated method stub + return 10; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBiomeChanger.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBiomeChanger.java new file mode 100644 index 00000000..5374368d --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBiomeChanger.java @@ -0,0 +1,318 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import net.minecraft.block.Block; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth; + +public class RitualEffectBiomeChanger extends RitualEffect +{ + @Override + public void performEffect(TEMasterStone 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 cooldown = ritualStone.getCooldown(); + + if (cooldown > 0) + { + ritualStone.setCooldown(cooldown - 1); + + if (ritualStone.getWorldObj().rand.nextInt(15) == 0) + { + ritualStone.getWorldObj().addWeatherEffect(new EntityLightningBolt(ritualStone.getWorldObj(), ritualStone.xCoord - 1 + ritualStone.getWorldObj().rand.nextInt(3), ritualStone.yCoord + 1, ritualStone.zCoord - 1 + ritualStone.getWorldObj().rand.nextInt(3))); + } + + return; + } + + int currentEssence = data.currentEssence; + World world = ritualStone.getWorldObj(); + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + int range = 10; + + if (currentEssence < this.getCostPerRefresh()) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + boolean[][] boolList = new boolean[range * 2 + 1][range * 2 + 1]; + + for (int i = 0; i < 2 * range + 1; i++) + { + for (int j = 0; j < 2 * range + 1; j++) + { + boolList[i][j] = false; + } + } + + boolList[range][range] = true; + boolean isReady = false; + + while (!isReady) + { + isReady = true; + + for (int i = 0; i < 2 * range + 1; i++) + { + for (int j = 0; j < 2 * range + 1; j++) + { + if (boolList[i][j]) + { + if (i - 1 >= 0 && !boolList[i - 1][j]) + { + Block block = world.getBlock(x - range + i - 1, y + 1, z - range + j); + + if (!ModBlocks.largeBloodStoneBrick.equals(block) && !ModBlocks.bloodStoneBrick.equals(block)) + { + boolList[i - 1][j] = true; + isReady = false; + } + } + + if (j - 1 >= 0 && !boolList[i][j - 1]) + { + Block block = world.getBlock(x - range + i, y + 1, z - range + j - 1); + + if (!ModBlocks.largeBloodStoneBrick.equals(block) && !ModBlocks.bloodStoneBrick.equals(block)) + { + boolList[i][j - 1] = true; + isReady = false; + } + } + + if (i + 1 <= 2 * range && !boolList[i + 1][j]) + { + Block block = world.getBlock(x - range + i + 1, y + 1, z - range + j); + + if (!ModBlocks.largeBloodStoneBrick.equals(block) && !ModBlocks.bloodStoneBrick.equals(block)) + { + boolList[i + 1][j] = true; + isReady = false; + } + } + + if (j + 1 <= 2 * range && !boolList[i][j + 1]) + { + Block block = world.getBlock(x - range + i, y + 1, z - range + j + 1); + + if (!ModBlocks.largeBloodStoneBrick.equals(block) && !ModBlocks.bloodStoneBrick.equals(block)) + { + boolList[i][j + 1] = true; + isReady = false; + } + } + } + } + } + } + + float temperature = 0.5f; + float humidity = 0.5f; + float acceptableRange = 0.1f; + + for (int i = -1; i <= 1; i++) + { + for (int j = -1; j <= 1; j++) + { + if (i == 0 && j == 0) + { + continue; + } + + boolean isItemConsumed = false; + TileEntity tileEntity = world.getTileEntity(x + i, y, z + j); + + if (!(tileEntity instanceof TEPlinth)) + { + continue; + } + + TEPlinth tilePlinth = (TEPlinth) tileEntity; + ItemStack itemStack = tilePlinth.getStackInSlot(0); + + if (itemStack != null) + { + Item itemTest = itemStack.getItem(); + + if (itemTest != null) + { + if (itemTest instanceof ItemBlock) + { + Block item = ((ItemBlock)itemTest).field_150939_a; + if (item == (Blocks.sand)) + { + humidity -= 0.1f; + isItemConsumed = true; + } else if (item == (Blocks.lapis_block)) + { + humidity += 0.4f; + isItemConsumed = true; + } else if (item == (Blocks.sand)) + { + humidity -= 0.1f; + isItemConsumed = true; + } else if (item == (Blocks.sandstone)) + { + humidity -= 0.2f; + isItemConsumed = true; + } else if (item == (Blocks.netherrack)) + { + humidity -= 0.4f; + isItemConsumed = true; + } else if (item == (Blocks.coal_block)) + { + temperature += 0.2f; + isItemConsumed = true; + } else if (item == (Blocks.ice)) + { + temperature -= 0.4f; + isItemConsumed = true; + } else if (item == (Blocks.snow)) + { + temperature -= 0.2f; + isItemConsumed = true; + } + } else if (itemTest.equals(Items.dye) && itemStack.getItemDamage() == 4) + { + humidity += 0.1f; + isItemConsumed = true; + } else if (itemTest.equals(Items.lava_bucket)) + { + temperature += 0.4f; + isItemConsumed = true; + } else if (itemTest.equals(Items.water_bucket)) + { + humidity += 0.2f; + isItemConsumed = true; + } else if (itemTest.equals(Items.coal)) + { + temperature += 0.1f; + isItemConsumed = true; + } else if (itemTest.equals(Items.snowball)) + { + temperature -= 0.1f; + isItemConsumed = true; + } + } + } + + if (isItemConsumed) + { + tilePlinth.setInventorySlotContents(0, null); + world.markBlockForUpdate(x + i, y, z + j); + world.addWeatherEffect(new EntityLightningBolt(world, x + i, y + 1, z + j)); + } + } + } + + boolean wantsSnow = false; + boolean wantsRain = true; + int biomeID = 1; + BiomeGenBase[] biomeList = BiomeGenBase.getBiomeGenArray(); + int iteration = 0; + + for (BiomeGenBase biome : biomeList) + { + if (biome == null) + { + continue; + } + + float temp = biome.temperature; + float rainfall = biome.rainfall; + temperature = Math.min(2.0f, Math.max(0.0f, temperature)); + humidity = Math.min(2.0f, Math.max(0.0f, humidity)); + + if (Math.abs(rainfall - humidity) < acceptableRange && Math.abs(temperature - temp) < acceptableRange) + { + //if(biome.getEnableSnow()==wantsSnow) + { + biomeID = iteration; + break; + } + } + + iteration++; + } + + for (int i = 0; i < 2 * range + 1; i++) + { + for (int j = 0; j < 2 * range + 1; j++) + { + //Testing of traversal of boolean matrix + if (boolList[i][j]) + { + Chunk chunk = world.getChunkFromBlockCoords(x - range + i, z - range + j); + byte[] byteArray = chunk.getBiomeArray(); + int moduX = (x - range + i) % 16; + int moduZ = (z - range + j) % 16; + + if (moduX < 0) + { + moduX = moduX + 16; + } + + if (moduZ < 0) + { + moduZ = moduZ + 16; + } + + byteArray[moduZ * 16 + moduX] = (byte) biomeID; + chunk.setBiomeArray(byteArray); + //world.setBlock(x-range+i, y+1, z-range+j, Block.blockClay); + } + } + } + + data.currentEssence = currentEssence - this.getCostPerRefresh(); + data.markDirty(); + ritualStone.setActive(false); + } + } + + @Override + public int getCostPerRefresh() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getInitialCooldown() + { + return 200; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectContainment.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectContainment.java new file mode 100644 index 00000000..8b64e3cf --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectContainment.java @@ -0,0 +1,102 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import java.util.Iterator; +import java.util.List; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; + +public class RitualEffectContainment extends RitualEffect +{ + @Override + public void performEffect(TEMasterStone 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.getWorldObj(); + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + + if (currentEssence < this.getCostPerRefresh()) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + int d0 = 5; + AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) x, (double) y, (double) z, (double) (x + 1), (double) (y + 1), (double) (z + 1)).expand(d0, d0, d0); + List list = world.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + Iterator iterator = list.iterator(); + EntityLivingBase livingEntity; + boolean flag = false; + + while (iterator.hasNext()) + { + livingEntity = (EntityLivingBase) iterator.next(); + + if (livingEntity instanceof EntityPlayer) + { + continue; + } + + //if (!(livingEntity.getEntityName().equals(owner))) + { + double xDif = livingEntity.posX - (x + 0.5); + double yDif = livingEntity.posY - (y + 3); + double zDif = livingEntity.posZ - (z + 0.5); + livingEntity.motionX = -0.05 * xDif; + livingEntity.motionY = -0.05 * yDif; + livingEntity.motionZ = -0.05 * zDif; + flag = true; + //livingEntity.setVelocity(-0.05 * xDif, -0.05 * yDif, -0.05 * zDif); + + if (world.rand.nextInt(10) == 0) + { + //PacketDispatcher.sendPacketToAllPlayers(TEAltar.getParticlePacket(livingEntity.posX, livingEntity.posY, livingEntity.posZ, (short) 1)); + SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 1, x, y, z); + } + + livingEntity.fallDistance = 0; + //entityplayer.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } + } + + if (world.getWorldTime() % 2 == 0 && flag) + { + data.currentEssence = currentEssence - this.getCostPerRefresh(); + data.markDirty(); + } + } + } + + @Override + public int getCostPerRefresh() + { + return 1; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrushing.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrushing.java new file mode 100644 index 00000000..e0c5d819 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrushing.java @@ -0,0 +1,159 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import net.minecraft.block.Block; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +import java.util.ArrayList; + +public class RitualEffectCrushing extends RitualEffect +{ + @Override + public void performEffect(TEMasterStone 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.getWorldObj(); + + if (world.getWorldTime() % 40 != 0) + { + return; + } + + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + TileEntity tile = world.getTileEntity(x, y + 1, z); + IInventory tileEntity; + + if (tile instanceof IInventory) + { + tileEntity = (IInventory) tile; + } else + { + return; + } + + if (tileEntity.getSizeInventory() <= 0) + { + return; + } + + if (currentEssence < this.getCostPerRefresh()) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + //boolean flag = false; + for (int j = -3; j < 0; j++) + { + for (int i = -1; i <= 1; i++) + { + for (int k = -1; k <= 1; k++) + { + Block block = world.getBlock(x + i, y + j, z + k); + int meta = world.getBlockMetadata(x + i, y + j, z + k); + + if (block != null) + { + if ((block.equals(ModBlocks.ritualStone) || block.equals(ModBlocks.blockMasterStone))) + { + continue; + } + + ArrayList itemDropList = block.getDrops(world, x + i, y + j, z + k, meta, 0); + + if (itemDropList != null) + { + int invSize = tileEntity.getSizeInventory(); + + for (ItemStack item : itemDropList) + { + ItemStack copyStack = item.copyItemStack(item); + + for (int n = 0; n < invSize; n++) + { + if (tileEntity.isItemValidForSlot(n, copyStack) && copyStack.stackSize != 0) + { + ItemStack itemStack = tileEntity.getStackInSlot(n); + + if (itemStack == null) + { + tileEntity.setInventorySlotContents(n, copyStack); + copyStack.stackSize = 0; + } else + { + if (itemStack.getItem().equals(copyStack.getItem())) + { + int itemSize = itemStack.stackSize; + int copySize = copyStack.stackSize; + int maxSize = itemStack.getMaxStackSize(); + + if (copySize + itemSize < maxSize) + { + copyStack.stackSize = 0; + itemStack.stackSize = itemSize + copySize; + tileEntity.setInventorySlotContents(n, itemStack); + } else + { + copyStack.stackSize = itemSize + copySize - maxSize; + itemStack.stackSize = maxSize; + } + } + } + } + } + + if (copyStack.stackSize > 0) + { + world.spawnEntityInWorld(new EntityItem(world, x + 0.4, y + 2, z + 0.5, copyStack)); + //flag=true; + } + } + } + + //if(flag) + world.setBlockToAir(x + i, y + j, z + k); + world.playSoundEffect(x + i, y + j, z + k, "mob.endermen.portal", 1.0F, 1.0F); + data.currentEssence = currentEssence - this.getCostPerRefresh(); + data.markDirty(); + return; + } + } + } + } + } + } + + @Override + public int getCostPerRefresh() + { + return 7; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredEarth.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredEarth.java new file mode 100644 index 00000000..19c23d46 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredEarth.java @@ -0,0 +1,90 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +import java.util.List; + +public class RitualEffectFeatheredEarth extends RitualEffect //Nullifies all fall damage in the area of effect +{ + @Override + public void performEffect(TEMasterStone 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.getWorldObj(); + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + + if (ritualStone.getCooldown() > 0) + { + world.addWeatherEffect(new EntityLightningBolt(world, x + 4, y + 5, z + 4)); + world.addWeatherEffect(new EntityLightningBolt(world, x + 4, y + 5, z - 4)); + world.addWeatherEffect(new EntityLightningBolt(world, x - 4, y + 5, z - 4)); + world.addWeatherEffect(new EntityLightningBolt(world, x - 4, y + 5, z + 4)); + ritualStone.setCooldown(0); + } + + int range = 20; + int verticalRange = 30; + List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(range, verticalRange, range)); + int entityCount = 0; + boolean flag = false; + + for (EntityLivingBase entity : entities) + { + entityCount++; + } + + if (currentEssence < this.getCostPerRefresh() * entityCount) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + for (EntityLivingBase entity : entities) + { + entity.fallDistance = 0; + } + + data.currentEssence = currentEssence - this.getCostPerRefresh() * entityCount; + data.markDirty(); + } + } + + @Override + public int getCostPerRefresh() + { + return 0; + } + + @Override + public int getInitialCooldown() + { + return 1; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredKnife.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredKnife.java new file mode 100644 index 00000000..792ea2f9 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredKnife.java @@ -0,0 +1,141 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +import java.util.Iterator; +import java.util.List; + +public class RitualEffectFeatheredKnife extends RitualEffect +{ + public final int timeDelay = 20; + public final int amount = 100; + + @Override + public void performEffect(TEMasterStone 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.getWorldObj(); + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + + if (world.getWorldTime() % this.timeDelay != 0) + { + return; + } + +// if(!(world.getBlockTileEntity(x, y-1, z) instanceof TEAltar)) +// { +// return; +// } + 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; + AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) x, (double) y, (double) z, (double) (x + 1), (double) (y + 1), (double) (z + 1)).expand(d0, vertRange, d0); + List list = world.getEntitiesWithinAABB(EntityPlayer.class, axisalignedbb); + Iterator iterator1 = list.iterator(); + EntityPlayer entity; + int entityCount = 0; + boolean flag = false; + + while (iterator1.hasNext()) + { + entity = (EntityPlayer) iterator1.next(); + + if (entity.getClass().equals(EntityPlayerMP.class) || entity.getClass().equals(EntityPlayer.class)) + { + entityCount++; + } + } + + if (currentEssence < this.getCostPerRefresh() * entityCount) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + Iterator iterator2 = list.iterator(); + entityCount = 0; + + while (iterator2.hasNext()) + { + entity = (EntityPlayer) iterator2.next(); + + //entity = (EntityPlayer)iterator1.next(); + if (entity.getClass().equals(EntityPlayerMP.class) || entity.getClass().equals(EntityPlayer.class)) + { + if (entity.getHealth() > 6.2f) + { + entity.setHealth(entity.getHealth() - 1); + entityCount++; + tileAltar.sacrificialDaggerCall(this.amount, false); + } + } + + //entity.setHealth(entity.getHealth()-1); +// if(entity.getHealth()<=0.2f) +// { +// entity.onDeath(DamageSource.inFire); +// } + } + + data.currentEssence = currentEssence - this.getCostPerRefresh() * entityCount; + data.markDirty(); + } + } + + @Override + public int getCostPerRefresh() + { + // TODO Auto-generated method stub + return 20; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFlight.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFlight.java new file mode 100644 index 00000000..5f2af95f --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFlight.java @@ -0,0 +1,88 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +import java.util.List; + +public class RitualEffectFlight extends RitualEffect +{ + @Override + public void performEffect(TEMasterStone 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.getWorldObj(); + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + + if (ritualStone.getCooldown() > 0) + { + //TODO Cool stuffs + ritualStone.setCooldown(0); + } + + int range = 20; + int verticalRange = 30; + AxisAlignedBB axis = AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(range, verticalRange, range); + axis.maxY = 256; + axis.minY = 0; + List entities = world.getEntitiesWithinAABB(EntityPlayer.class, axis); + int entityCount = 0; + + for (EntityPlayer entity : entities) + { + entityCount++; + } + + if (currentEssence < this.getCostPerRefresh() * entityCount) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + for (EntityPlayer entity : entities) + { + entity.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFlight.id, 20, 0)); + } + + data.currentEssence = currentEssence - this.getCostPerRefresh() * entityCount; + data.markDirty(); + } + } + + @Override + public int getCostPerRefresh() + { + return 0; + } + + @Override + public int getInitialCooldown() + { + return 1; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectGrowth.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectGrowth.java new file mode 100644 index 00000000..29eccf22 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectGrowth.java @@ -0,0 +1,84 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +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.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; + +public class RitualEffectGrowth extends RitualEffect +{ + @Override + public void performEffect(TEMasterStone 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.getWorldObj(); + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + + if (currentEssence < this.getCostPerRefresh()) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + if (world.getWorldTime() % 20 != 0) + { + return; + } + + boolean flag = false; + + for (int i = -1; i <= 1; i++) + { + for (int j = -1; j <= 1; j++) + { + Block block = world.getBlock(x + i, y + 2, z + j); + + if (block instanceof IPlantable) + { + { + SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 3, x, y, z); + block.updateTick(world, x + i, y + 2, z + j, world.rand); + flag = true; + } + } + } + } + + if (flag) + { + data.currentEssence = currentEssence - this.getCostPerRefresh(); + data.markDirty(); + } + } + } + + @Override + public int getCostPerRefresh() + { + return 100; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHealing.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHealing.java new file mode 100644 index 00000000..5cc4afd1 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHealing.java @@ -0,0 +1,126 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +import java.util.Iterator; +import java.util.List; + +public class RitualEffectHealing extends RitualEffect +{ + public final int timeDelay = 50; + //public final int amount = 10; + + @Override + public void performEffect(TEMasterStone 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.getWorldObj(); + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + + if (world.getWorldTime() % this.timeDelay != 0) + { + return; + } + +// if(!(world.getBlockTileEntity(x, y-1, z) instanceof TEAltar)) +// { +// return; +// } + //tileAltar = (TEAltar)world.getBlockTileEntity(x,y-1,z); + int d0 = 10; + int vertRange = 10; + AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) x, (double) y, (double) z, (double) (x + 1), (double) (y + 1), (double) (z + 1)).expand(d0, vertRange, d0); + List list = world.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + Iterator iterator1 = list.iterator(); + EntityLivingBase entity; + int entityCount = 0; + boolean flag = false; + + while (iterator1.hasNext()) + { + entity = (EntityLivingBase) iterator1.next(); + + if (entity instanceof EntityPlayer) + { + entityCount += 10; + } else + { + entityCount++; + } + } + + if (currentEssence < this.getCostPerRefresh() * entityCount) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + Iterator iterator2 = list.iterator(); + entityCount = 0; + + while (iterator2.hasNext()) + { + entity = (EntityLivingBase) iterator2.next(); + + if (entity.getHealth() + 0.1f < entity.getMaxHealth()) + { + entity.addPotionEffect(new PotionEffect(Potion.regeneration.id, timeDelay + 2, 0)); + + //entity.setHealth(entity.getHealth()-1); + + //entity.attackEntityFrom(DamageSource.outOfWorld, 1); + + if (entity instanceof EntityPlayer) + { + entityCount += 10; + } else + { + entityCount++; + } + } + +// if(entity.getHealth()<=0.2f) +// { +// entity.onDeath(DamageSource.inFire); +// } + //tileAltar.sacrificialDaggerCall(this.amount, true); + } + + data.currentEssence = currentEssence - this.getCostPerRefresh() * entityCount; + data.markDirty(); + } + } + + @Override + public int getCostPerRefresh() + { + // TODO Auto-generated method stub + return 20; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectInterdiction.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectInterdiction.java new file mode 100644 index 00000000..407db900 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectInterdiction.java @@ -0,0 +1,94 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +import java.util.Iterator; +import java.util.List; + +public class RitualEffectInterdiction extends RitualEffect +{ + @Override + public void performEffect(TEMasterStone 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.getWorldObj(); + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + + if (currentEssence < this.getCostPerRefresh()) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + int d0 = 5; + AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) x, (double) y, (double) z, (double) (x + 1), (double) (y + 1), (double) (z + 1)).expand(d0, d0, d0); + axisalignedbb.maxY = Math.min((double) world.getHeight(), (double) (y + 1 + d0)); + List list = world.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + Iterator iterator = list.iterator(); + EntityLivingBase entityplayer; + boolean flag = false; + + while (iterator.hasNext()) + { + entityplayer = (EntityLivingBase) iterator.next(); + + if (!(entityplayer instanceof EntityPlayer && (SpellHelper.getUsername((EntityPlayer)entityplayer).equals(owner)))) + { + double xDif = entityplayer.posX - x; + double yDif = entityplayer.posY - (y + 1); + double zDif = entityplayer.posZ - z; + entityplayer.motionX = 0.1 * xDif; + entityplayer.motionY = 0.1 * yDif; + entityplayer.motionZ = 0.1 * zDif; + entityplayer.fallDistance = 0; + + if (!(entityplayer instanceof EntityPlayer)) + { + flag = true; + } + + //entityplayer.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } + } + + if (world.getWorldTime() % 2 == 0 && flag) + { + data.currentEssence = currentEssence - this.getCostPerRefresh(); + data.markDirty(); + } + } + } + + @Override + public int getCostPerRefresh() + { + return 1; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectJumping.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectJumping.java new file mode 100644 index 00000000..68e14b3e --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectJumping.java @@ -0,0 +1,99 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import ibxm.Player; + +import java.util.Iterator; +import java.util.List; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; + +public class RitualEffectJumping extends RitualEffect +{ + @Override + public void performEffect(TEMasterStone 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.getWorldObj(); + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + + if (currentEssence < this.getCostPerRefresh()) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + int d0 = 0; + AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) x, (double) y + 1, (double) z, (double) (x + 1), (double) (y + 2), (double) (z + 1)).expand(d0, d0, d0); + List list = world.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + Iterator iterator = list.iterator(); + EntityLivingBase entityplayer; + boolean flag = false; + + while (iterator.hasNext()) + { + entityplayer = (EntityLivingBase) iterator.next(); + + if (entityplayer instanceof EntityPlayer) + { + //PacketDispatcher.sendPacketToPlayer(PacketHandler.getPlayerVelocitySettingPacket(entityplayer.motionX, 1.5, entityplayer.motionZ), (Player) entityplayer); + SpellHelper.setPlayerSpeedFromServer((EntityPlayer)entityplayer, entityplayer.motionX, 1.5, entityplayer.motionZ); + entityplayer.motionY = 1.5; + entityplayer.fallDistance = 0; + flag = true; + } else + //if (!(entityplayer.getEntityName().equals(owner))) + { +// double xDif = entityplayer.posX - xCoord; +// double yDif = entityplayer.posY - (yCoord + 1); +// double zDif = entityplayer.posZ - zCoord; + //entityplayer.motionX=0.1*xDif; + entityplayer.motionY = 1.5; + //entityplayer.motionZ=0.1*zDif; + entityplayer.fallDistance = 0; + flag = true; + //entityplayer.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } + } + + if (flag) + { + data.currentEssence = currentEssence - this.getCostPerRefresh(); + data.markDirty(); + } + } + } + + @Override + public int getCostPerRefresh() + { + return 5; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLava.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLava.java new file mode 100644 index 00000000..5be932a5 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLava.java @@ -0,0 +1,67 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; + +public class RitualEffectLava extends RitualEffect +{ + @Override + public void performEffect(TEMasterStone 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.getWorldObj(); + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + + if (world.isAirBlock(x, y + 1, z)) + { + if (currentEssence < this.getCostPerRefresh()) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + for (int i = 0; i < 10; i++) + { + SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 3, x, y, z); + } + + world.setBlock(x, y + 1, z, Blocks.lava, 0, 3); + data.currentEssence = currentEssence - this.getCostPerRefresh(); + data.markDirty(); + } + } + } + + @Override + public int getCostPerRefresh() + { + // TODO Auto-generated method stub + return 500; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLeap.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLeap.java new file mode 100644 index 00000000..37734a86 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLeap.java @@ -0,0 +1,139 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import java.util.Iterator; +import java.util.List; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; + +public class RitualEffectLeap extends RitualEffect +{ + @Override + public void performEffect(TEMasterStone 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.getWorldObj(); + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + + if (currentEssence < this.getCostPerRefresh()) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + int direction = ritualStone.getDirection(); + int d0 = 2; + AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) x, (double) y - 1, (double) z, (double) (x + 1), (double) (y + 2), (double) (z + 1)).expand(d0, 0, d0); + List list = world.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + Iterator iterator = list.iterator(); + EntityLivingBase entityplayer; + boolean flag = false; + + while (iterator.hasNext()) + { + entityplayer = (EntityLivingBase) iterator.next(); + + if (entityplayer instanceof EntityPlayer) + { + entityplayer.motionY = 1.2; + entityplayer.fallDistance = 0; + + switch (direction) + { + case 1: + SpellHelper.setPlayerSpeedFromServer((EntityPlayer)entityplayer, 0, 1.2, 3.0); + break; + + case 2: + SpellHelper.setPlayerSpeedFromServer((EntityPlayer)entityplayer, 3.0, 1.2, 0); + break; + + case 3: + SpellHelper.setPlayerSpeedFromServer((EntityPlayer)entityplayer, 0, 1.2, -3.0); + break; + + case 4: + SpellHelper.setPlayerSpeedFromServer((EntityPlayer)entityplayer, -3.0, 1.2, 0); + break; + } + + flag = true; + } else + //if (!(entityplayer.getEntityName().equals(owner))) + { +// double xDif = entityplayer.posX - xCoord; +// double yDif = entityplayer.posY - (yCoord + 1); +// double zDif = entityplayer.posZ - zCoord; + //entityplayer.motionX=0.1*xDif; + entityplayer.motionY = 1.2; + + switch (direction) + { + case 1: + entityplayer.motionX = 0.0; + entityplayer.motionZ = -3.0; + break; + + case 2: + entityplayer.motionX = 3.0; + entityplayer.motionZ = 0.0; + break; + + case 3: + entityplayer.motionX = 0.0; + entityplayer.motionZ = -3.0; + break; + + case 4: + entityplayer.motionX = -3.0; + entityplayer.motionZ = 0.0; + break; + } + + //entityplayer.motionZ=0.1*zDif; + entityplayer.fallDistance = 0; + flag = true; + //entityplayer.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } + } + + if (flag) + { + data.currentEssence = currentEssence - this.getCostPerRefresh(); + data.markDirty(); + } + } + } + + @Override + public int getCostPerRefresh() + { + return 5; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectMagnetic.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectMagnetic.java new file mode 100644 index 00000000..c137b655 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectMagnetic.java @@ -0,0 +1,121 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.block.BlockTeleposer; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; + +public class RitualEffectMagnetic extends RitualEffect +{ + @Override + public void performEffect(TEMasterStone 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.getWorldObj(); + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + + if (world.getWorldTime() % 40 != 0) + { + return; + } + + if (currentEssence < this.getCostPerRefresh()) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + int xRep = 0; + int yRep = 0; + int zRep = 0; + boolean replace = false; + + for (int j = 1; j <= 3; j++) + { + for (int i = -1; i <= 1; i++) + { + for (int k = -1; k <= 1; k++) + { + if ((!replace) && world.isAirBlock(x + i, y + j, z + k)) + { + xRep = x + i; + yRep = y + j; + zRep = z + k; + replace = true; + } + } + } + } + + if (replace) + { + //boolean hasReplaced = false; + for (int j = y - 1; j >= 0; j--) + { + for (int i = -3; i <= 3; i++) + { + for (int k = -3; k <= 3; k++) + { + Block block = world.getBlock(x + i, j, z + k); + int meta = world.getBlockMetadata(x + i, j, z + k); + + if (block == null) + { + continue; + } + + ItemStack itemStack = new ItemStack(block, 1, meta); + int id = OreDictionary.getOreID(itemStack); + + if (id != -1) + { + String oreName = OreDictionary.getOreName(id); + + if (oreName.contains("ore")) + { + //TODO + //Allow swapping code. This means the searched block is an ore. + BlockTeleposer.swapBlocks(world, world, x + i, j, z + k, xRep, yRep, zRep); + data.currentEssence = currentEssence - this.getCostPerRefresh(); + data.markDirty(); + return; + } + } + } + } + } + } + } + } + + @Override + public int getCostPerRefresh() + { + return 50; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSoulBound.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSoulBound.java new file mode 100644 index 00000000..7c93c470 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSoulBound.java @@ -0,0 +1,209 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import java.util.Iterator; +import java.util.List; + +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; + +public class RitualEffectSoulBound extends RitualEffect +{ + @Override + public void performEffect(TEMasterStone 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.getWorldObj(); + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + + if (currentEssence < this.getCostPerRefresh()) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + if (ritualStone.getVar1() == 0) + { + int d0 = 0; + AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) x, (double) y + 1, (double) z, (double) (x + 1), (double) (y + 2), (double) (z + 1)).expand(d0, d0, d0); + List list = world.getEntitiesWithinAABB(EntityItem.class, axisalignedbb); + Iterator iterator = list.iterator(); + EntityItem item; + + while (iterator.hasNext()) + { + item = (EntityItem) iterator.next(); +// double xDif = item.posX - (xCoord+0.5); +// double yDif = item.posY - (yCoord+1); +// double zDif = item.posZ - (zCoord+0.5); + ItemStack itemStack = item.getEntityItem(); + + if (itemStack == null) + { + continue; + } + + ItemStack itemGoggles = null; + + if (AlchemicalWizardry.isThaumcraftLoaded) + { + //itemGoggles = ItemApi.getItem("itemGoggles", 0); + } + + if (itemStack.getItem() == ModItems.apprenticeBloodOrb) + { + ritualStone.setVar1(Item.getIdFromItem(ModItems.energyBlaster)); + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z)); + ritualStone.setCooldown(ritualStone.getCooldown() - 1); + item.setDead(); + return; + } else if (itemStack.getItem() == Items.diamond_sword) + { + ritualStone.setVar1(Item.getIdFromItem(ModItems.energySword)); + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z)); + ritualStone.setCooldown(ritualStone.getCooldown() - 1); + item.setDead(); + return; + } else if (itemStack.getItem() == Items.diamond_pickaxe) + { + ritualStone.setVar1(Item.getIdFromItem(ModItems.boundPickaxe)); + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z)); + ritualStone.setCooldown(ritualStone.getCooldown() - 1); + item.setDead(); + return; + } else if (itemStack.getItem() == Items.diamond_axe) + { + ritualStone.setVar1(Item.getIdFromItem(ModItems.boundAxe)); + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z)); + ritualStone.setCooldown(ritualStone.getCooldown() - 1); + item.setDead(); + return; + } else if (itemStack.getItem() == Items.diamond_shovel) + { + ritualStone.setVar1(Item.getIdFromItem(ModItems.boundShovel)); + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z)); + ritualStone.setCooldown(ritualStone.getCooldown() - 1); + item.setDead(); + return; + } +// else if (itemGoggles != null && itemGoggles.isItemEqual(itemStack)) +// { +// ritualStone.setVar1(Item.getIdFromItem(ModItems.sanguineHelmet)); +// world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z)); +// ritualStone.setCooldown(ritualStone.getCooldown() - 1); +// item.setDead(); +// return; +// } + + if (world.rand.nextInt(10) == 0) + { + SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 1, x, y, z); + } + } + + data.currentEssence = currentEssence - this.getCostPerRefresh(); + data.markDirty(); + } else + { + ritualStone.setCooldown(ritualStone.getCooldown() - 1); + + if (world.rand.nextInt(20) == 0) + { + int lightningPoint = world.rand.nextInt(8); + + switch (lightningPoint) + { + case 0: + world.addWeatherEffect(new EntityLightningBolt(world, x + 4, y + 3, z + 0)); + break; + + case 1: + world.addWeatherEffect(new EntityLightningBolt(world, x - 4, y + 3, z + 0)); + break; + + case 2: + world.addWeatherEffect(new EntityLightningBolt(world, x + 0, y + 3, z + 4)); + break; + + case 3: + world.addWeatherEffect(new EntityLightningBolt(world, x + 0, y + 3, z - 4)); + break; + + case 4: + world.addWeatherEffect(new EntityLightningBolt(world, x + 3, y + 3, z + 3)); + break; + + case 5: + world.addWeatherEffect(new EntityLightningBolt(world, x - 3, y + 3, z + 3)); + break; + + case 6: + world.addWeatherEffect(new EntityLightningBolt(world, x + 3, y + 3, z - 3)); + break; + + case 7: + world.addWeatherEffect(new EntityLightningBolt(world, x - 3, y + 3, z - 3)); + break; + } + } + + if (ritualStone.getCooldown() <= 0) + { + ItemStack spawnedItem = new ItemStack(Item.getItemById(ritualStone.getVar1()), 1, 0); + + if (spawnedItem != null) + { + EntityItem newItem = new EntityItem(world, x + 0.5, y + 1, z + 0.5, spawnedItem); + world.spawnEntityInWorld(newItem); + } + + ritualStone.setActive(false); + } + } + } + } + + @Override + public int getCostPerRefresh() + { + return 0; + } + + @Override + public int getInitialCooldown() + { + return 200; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSummonMeteor.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSummonMeteor.java new file mode 100644 index 00000000..a7173b4d --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSummonMeteor.java @@ -0,0 +1,91 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.entity.projectile.EntityMeteor; +import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +import java.util.List; + +public class RitualEffectSummonMeteor extends RitualEffect +{ + @Override + public void performEffect(TEMasterStone 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.getWorldObj(); + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + + if (ritualStone.getCooldown() > 0) + { + ritualStone.setCooldown(0); + } + + if (currentEssence < this.getCostPerRefresh()) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + List entities = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x, y + 1, z, x + 1, y + 2, z + 1)); + + if (entities == null) + { + return; + } + + for (EntityItem entityItem : entities) + { + if (entityItem != null && MeteorRegistry.isValidParadigmItem(entityItem.getEntityItem())) + { + int meteorID = MeteorRegistry.getParadigmIDForItem(entityItem.getEntityItem()); + EntityMeteor meteor = new EntityMeteor(world, x + 0.5f, 257, z + 0.5f, meteorID); + meteor.motionY = -1.0f; + entityItem.setDead(); + world.spawnEntityInWorld(meteor); + ritualStone.setActive(false); + break; + } + } + +// EnergyBlastProjectile proj = new EnergyBlastProjectile(world, x, y+20, z); +// proj.motionX = 0.0d; +// proj.motionZ = 0.0d; +// proj.motionY = -1.0d; +// world.spawnEntityInWorld(proj); + data.currentEssence = currentEssence - this.getCostPerRefresh(); + data.markDirty(); + } + } + + @Override + public int getCostPerRefresh() + { + return 0; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectUnbinding.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectUnbinding.java new file mode 100644 index 00000000..6f0a1ab5 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectUnbinding.java @@ -0,0 +1,166 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import java.util.Iterator; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.effect.EntityLightningBolt; +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.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.items.BoundArmour; +import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; + +public class RitualEffectUnbinding extends RitualEffect +{ + @Override + public void performEffect(TEMasterStone 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.getWorldObj(); + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + + if (currentEssence < this.getCostPerRefresh()) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + int d0 = 0; + AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) x, (double) y + 1, (double) z, (double) (x + 1), (double) (y + 2), (double) (z + 1)).expand(d0, d0, d0); + List list = world.getEntitiesWithinAABB(EntityItem.class, axisalignedbb); + Iterator iterator = list.iterator(); + EntityItem item; + + while (iterator.hasNext()) + { + item = (EntityItem) iterator.next(); +// double xDif = item.posX - (xCoord+0.5); +// double yDif = item.posY - (yCoord+1); +// double zDif = item.posZ - (zCoord+0.5); + ItemStack itemStack = item.getEntityItem(); + + if (itemStack == null) + { + continue; + } + + if (itemStack.getItem() == ModItems.boundHelmet) + { + ritualStone.setVar1(5); + } else if (itemStack.getItem() == ModItems.boundPlate) + { + ritualStone.setVar1(8); + } else if (itemStack.getItem() == ModItems.boundLeggings) + { + ritualStone.setVar1(7); + } else if (itemStack.getItem() == ModItems.boundBoots) + { + ritualStone.setVar1(4); + } else if (itemStack.getItem() == ModItems.sigilOfHolding) + { + ritualStone.setVar1(-1); + } + + if (ritualStone.getVar1() > 0) + { + item.setDead(); + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z - 5)); + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z + 5)); + world.addWeatherEffect(new EntityLightningBolt(world, x - 5, y + 1, z)); + world.addWeatherEffect(new EntityLightningBolt(world, x + 5, y + 1, z)); + NBTTagCompound itemTag = itemStack.stackTagCompound; + ItemStack[] inv = ((BoundArmour) itemStack.getItem()).getInternalInventory(itemStack); + + if (inv != null) + { + for (ItemStack internalItem : inv) + { + if (internalItem != null) + { + EntityItem newItem = new EntityItem(world, x + 0.5, y + 1, z + 0.5, internalItem.copy()); + world.spawnEntityInWorld(newItem); + } + } + } + + EntityItem newItem = new EntityItem(world, x + 0.5, y + 1, z + 0.5, new ItemStack(ModBlocks.bloodSocket, ritualStone.getVar1())); + world.spawnEntityInWorld(newItem); + ritualStone.setActive(false); + break; + } else if (ritualStone.getVar1() == -1) + { + item.setDead(); + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z - 5)); + world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z + 5)); + world.addWeatherEffect(new EntityLightningBolt(world, x - 5, y + 1, z)); + world.addWeatherEffect(new EntityLightningBolt(world, x + 5, y + 1, z)); + NBTTagCompound itemTag = itemStack.stackTagCompound; + ItemStack[] inv = ((SigilOfHolding) itemStack.getItem()).getInternalInventory(itemStack); + + if (inv != null) + { + for (ItemStack internalItem : inv) + { + if (internalItem != null) + { + EntityItem newItem = new EntityItem(world, x + 0.5, y + 1, z + 0.5, internalItem.copy()); + world.spawnEntityInWorld(newItem); + } + } + } + + EntityItem newItem = new EntityItem(world, x + 0.5, y + 1, z + 0.5, new ItemStack(ModItems.sigilOfHolding, 1, 0)); + world.spawnEntityInWorld(newItem); + ritualStone.setActive(false); + break; + } + + if (world.rand.nextInt(10) == 0) + { + SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 1, x, y, z); + } + } + + data.currentEssence = currentEssence - this.getCostPerRefresh(); + data.markDirty(); + } + } + + @Override + public int getCostPerRefresh() + { + // TODO Auto-generated method stub + return 0; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWater.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWater.java new file mode 100644 index 00000000..6483de50 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWater.java @@ -0,0 +1,64 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; + +public class RitualEffectWater extends RitualEffect +{ + public void performEffect(TEMasterStone 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.getWorldObj(); + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + + if (world.isAirBlock(x, y + 1, z)) + { + if (currentEssence < this.getCostPerRefresh()) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + for (int i = 0; i < 10; i++) + { + SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 3, x, y, z); + } + + world.setBlock(x, y + 1, z, Blocks.water, 0, 3); + data.currentEssence = currentEssence - this.getCostPerRefresh(); + data.markDirty(); + } + } + } + + public int getCostPerRefresh() + { + return 25; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java new file mode 100644 index 00000000..390d3894 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java @@ -0,0 +1,135 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +import java.util.Iterator; +import java.util.List; + +public class RitualEffectWellOfSuffering extends RitualEffect +{ + public final int timeDelay = 25; + public final int amount = 10; + + @Override + public void performEffect(TEMasterStone 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.getWorldObj(); + int x = ritualStone.xCoord; + int y = ritualStone.yCoord; + int z = ritualStone.zCoord; + + if (world.getWorldTime() % this.timeDelay != 0) + { + return; + } + +// if(!(world.getBlockTileEntity(x, y-1, z) instanceof TEAltar)) +// { +// return; +// } + 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 = 10; + int vertRange = 5; + AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) x, (double) y, (double) z, (double) (x + 1), (double) (y + 1), (double) (z + 1)).expand(d0, vertRange, d0); + List list = world.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + Iterator iterator1 = list.iterator(); + EntityLivingBase entity; + int entityCount = 0; + boolean flag = false; + + while (iterator1.hasNext()) + { + entity = (EntityLivingBase) iterator1.next(); + entityCount++; + } + + if (currentEssence < this.getCostPerRefresh() * entityCount) + { + EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner); + + if (entityOwner == null) + { + return; + } + + entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); + } else + { + Iterator iterator2 = list.iterator(); + entityCount = 0; + + while (iterator2.hasNext()) + { + entity = (EntityLivingBase) iterator2.next(); + + if (entity instanceof EntityPlayer) + { + continue; + } + + //entity.setHealth(entity.getHealth()-1); + entity.attackEntityFrom(DamageSource.outOfWorld, 1); + entityCount++; +// if(entity.getHealth()<=0.2f) +// { +// entity.onDeath(DamageSource.inFire); +// } + tileAltar.sacrificialDaggerCall(this.amount, true); + } + + data.currentEssence = currentEssence - this.getCostPerRefresh() * entityCount; + data.markDirty(); + } + } + + @Override + public int getCostPerRefresh() + { + // TODO Auto-generated method stub + return 2; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/Rituals.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/Rituals.java new file mode 100644 index 00000000..d56d3e9c --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/rituals/Rituals.java @@ -0,0 +1,1079 @@ +package WayofTime.alchemicalWizardry.common.rituals; + +import WayofTime.alchemicalWizardry.common.block.RitualStone; +import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; + +import java.util.ArrayList; +import java.util.List; + +public class Rituals +{ + private List components; + private int crystalLevel; + private int actCost; + private RitualEffect effect; + private String name; + + public static List ritualList = new ArrayList(); + + public Rituals(List components, int crystalLevel, int actCost, RitualEffect effect, String name) + { + this.components = components; + this.crystalLevel = crystalLevel; + this.actCost = actCost; + this.effect = effect; + this.name = name; + } + + public Rituals(List components, int crystalLevel, int actCost, RitualEffect effect) + { + this.components = components; + this.crystalLevel = crystalLevel; + this.actCost = actCost; + this.effect = effect; + this.name = ""; + } + + //public static final int totalRituals = 1; + + public static int checkValidRitual(World world, int x, int y, int z) + { + for (int i = 1; i <= ritualList.size(); i++) + { + if (checkRitualIsValid(world, x, y, z, i)) + { + return i; + } + } + + return 0; + } + + public static boolean canCrystalActivate(int ritual, int crystalLevel) + { + if (ritual <= ritualList.size()) + { + return ritualList.get(ritual - 1).crystalLevel <= crystalLevel; + } else + { + return false; + } + +// switch (crystalLevel) +// { +// case 1: +// return(ritual <= 8); +// +// case 2: +// return(ritual <= 16); +// +// default: +// return false; +// } + } + + public static boolean checkRitualIsValid(World world, int x, int y, int z, int ritualID) + { + int direction = Rituals.getDirectionOfRitual(world, x, y, z, ritualID); + + if (direction != -1) + { + return true; + } + + return false; +// List ritual = Rituals.getRitualList(ritualID); +// +// if (ritual == null) +// { +// return false; +// } +// +// Block test = null; +// +// for (RitualComponent rc : ritual) +// { +// test = Block.blocksList[world.getBlockId(x + rc.getX(), y + rc.getY(), z + rc.getZ())]; +// +// if (!(test instanceof RitualStone)) +// { +// return false; +// } +// +// if (world.getBlockMetadata(x + rc.getX(), y + rc.getY(), z + rc.getZ()) != rc.getStoneType()) +// { +// return false; +// } +// } +// +// return true; + } + + /** + * 1 - NORTH + * 2 - EAST + * 3 - SOUTH + * 4 - WEST + */ + public static boolean checkDirectionOfRitualValid(World world, int x, int y, int z, int ritualID, int direction) + { + List ritual = Rituals.getRitualList(ritualID); + + if (ritual == null) + { + return false; + } + + Block test = null; + + switch (direction) + { + case 1: + for (RitualComponent rc : ritual) + { + test = world.getBlock(x + rc.getX(), y + rc.getY(), z + rc.getZ()); + + if (!(test instanceof RitualStone)) + { + return false; + } + + if (world.getBlockMetadata(x + rc.getX(), y + rc.getY(), z + rc.getZ()) != rc.getStoneType()) + { + return false; + } + } + + return true; + + case 2: + for (RitualComponent rc : ritual) + { + test = world.getBlock(x + rc.getX(), y + rc.getY(), z + rc.getZ()); + + if (!(test instanceof RitualStone)) + { + return false; + } + + if (world.getBlockMetadata(x - rc.getZ(), y + rc.getY(), z + rc.getX()) != rc.getStoneType()) + { + return false; + } + } + + return true; + + case 3: + for (RitualComponent rc : ritual) + { + test = world.getBlock(x + rc.getX(), y + rc.getY(), z + rc.getZ()); + + if (!(test instanceof RitualStone)) + { + return false; + } + + if (world.getBlockMetadata(x - rc.getX(), y + rc.getY(), z - rc.getZ()) != rc.getStoneType()) + { + return false; + } + } + + return true; + + case 4: + for (RitualComponent rc : ritual) + { + test = world.getBlock(x + rc.getX(), y + rc.getY(), z + rc.getZ()); + + if (!(test instanceof RitualStone)) + { + return false; + } + + if (world.getBlockMetadata(x + rc.getZ(), y + rc.getY(), z - rc.getX()) != rc.getStoneType()) + { + return false; + } + } + + return true; + } + + return false; + } + + public static int getDirectionOfRitual(World world, int x, int y, int z, int ritualID) + { + for (int i = 1; i <= 4; i++) + { + if (Rituals.checkDirectionOfRitualValid(world, x, y, z, ritualID, i)) + { + return i; + } + } + + return -1; + } + + public static void loadRituals() + { + ArrayList waterRitual = new ArrayList(); + waterRitual.add(new RitualComponent(-1, 0, 1, 1)); + waterRitual.add(new RitualComponent(-1, 0, -1, 1)); + waterRitual.add(new RitualComponent(1, 0, -1, 1)); + waterRitual.add(new RitualComponent(1, 0, 1, 1)); + ArrayList lavaRitual = new ArrayList(); + lavaRitual.add(new RitualComponent(1, 0, 0, 2)); + lavaRitual.add(new RitualComponent(-1, 0, 0, 2)); + lavaRitual.add(new RitualComponent(0, 0, 1, 2)); + lavaRitual.add(new RitualComponent(0, 0, -1, 2)); + ArrayList growthRitual = new ArrayList(); + growthRitual.add(new RitualComponent(1, 0, 0, 1)); + growthRitual.add(new RitualComponent(-1, 0, 0, 1)); + growthRitual.add(new RitualComponent(0, 0, 1, 1)); + growthRitual.add(new RitualComponent(0, 0, -1, 1)); + growthRitual.add(new RitualComponent(-1, 0, 1, 3)); + growthRitual.add(new RitualComponent(1, 0, 1, 3)); + growthRitual.add(new RitualComponent(-1, 0, -1, 3)); + growthRitual.add(new RitualComponent(1, 0, -1, 3)); + ArrayList interdictionRitual = new ArrayList(); + interdictionRitual.add(new RitualComponent(1, 0, 0, 4)); + interdictionRitual.add(new RitualComponent(-1, 0, 0, 4)); + interdictionRitual.add(new RitualComponent(0, 0, 1, 4)); + interdictionRitual.add(new RitualComponent(0, 0, -1, 4)); + interdictionRitual.add(new RitualComponent(-1, 0, 1, 4)); + interdictionRitual.add(new RitualComponent(1, 0, 1, 4)); + interdictionRitual.add(new RitualComponent(-1, 0, -1, 4)); + interdictionRitual.add(new RitualComponent(1, 0, -1, 4)); + ArrayList containmentRitual = new ArrayList(); + containmentRitual.add(new RitualComponent(1, 0, 0, 3)); + containmentRitual.add(new RitualComponent(-1, 0, 0, 3)); + containmentRitual.add(new RitualComponent(0, 0, 1, 3)); + containmentRitual.add(new RitualComponent(0, 0, -1, 3)); + containmentRitual.add(new RitualComponent(2, 0, 2, 3)); + containmentRitual.add(new RitualComponent(2, 0, -2, 3)); + containmentRitual.add(new RitualComponent(-2, 0, 2, 3)); + containmentRitual.add(new RitualComponent(-2, 0, -2, 3)); + containmentRitual.add(new RitualComponent(1, 5, 0, 3)); + containmentRitual.add(new RitualComponent(-1, 5, 0, 3)); + containmentRitual.add(new RitualComponent(0, 5, 1, 3)); + containmentRitual.add(new RitualComponent(0, 5, -1, 3)); + containmentRitual.add(new RitualComponent(2, 5, 2, 3)); + containmentRitual.add(new RitualComponent(2, 5, -2, 3)); + containmentRitual.add(new RitualComponent(-2, 5, 2, 3)); + containmentRitual.add(new RitualComponent(-2, 5, -2, 3)); + //Bound soul ritual + ArrayList boundSoulRitual = new ArrayList(); + boundSoulRitual.add(new RitualComponent(3, 0, 0, 2)); + boundSoulRitual.add(new RitualComponent(-3, 0, 0, 2)); + boundSoulRitual.add(new RitualComponent(0, 0, 3, 2)); + boundSoulRitual.add(new RitualComponent(0, 0, -3, 2)); + boundSoulRitual.add(new RitualComponent(2, 0, 2, 4)); + boundSoulRitual.add(new RitualComponent(-2, 0, 2, 4)); + boundSoulRitual.add(new RitualComponent(2, 0, -2, 4)); + boundSoulRitual.add(new RitualComponent(-2, 0, -2, 4)); + boundSoulRitual.add(new RitualComponent(4, 2, 0, 1)); + boundSoulRitual.add(new RitualComponent(-4, 2, 0, 1)); + boundSoulRitual.add(new RitualComponent(0, 2, 4, 1)); + boundSoulRitual.add(new RitualComponent(0, 2, -4, 1)); + boundSoulRitual.add(new RitualComponent(3, 2, 3, 3)); + boundSoulRitual.add(new RitualComponent(3, 2, -3, 3)); + boundSoulRitual.add(new RitualComponent(-3, 2, 3, 3)); + boundSoulRitual.add(new RitualComponent(-3, 2, -3, 3)); + boundSoulRitual.add(new RitualComponent(4, 1, 0, 0)); + boundSoulRitual.add(new RitualComponent(-4, 1, 0, 0)); + boundSoulRitual.add(new RitualComponent(0, 1, 4, 0)); + boundSoulRitual.add(new RitualComponent(0, 1, -4, 0)); + boundSoulRitual.add(new RitualComponent(3, 1, 3, 0)); + boundSoulRitual.add(new RitualComponent(3, 1, -3, 0)); + boundSoulRitual.add(new RitualComponent(-3, 1, 3, 0)); + boundSoulRitual.add(new RitualComponent(-3, 1, -3, 0)); + // + ArrayList unbindingRitual = new ArrayList(); + unbindingRitual.add(new RitualComponent(-2, 0, 0, 4)); + unbindingRitual.add(new RitualComponent(2, 0, 0, 4)); + unbindingRitual.add(new RitualComponent(0, 0, 2, 4)); + unbindingRitual.add(new RitualComponent(0, 0, -2, 4)); + unbindingRitual.add(new RitualComponent(-2, 0, -2, 3)); + unbindingRitual.add(new RitualComponent(-2, 0, -3, 3)); + unbindingRitual.add(new RitualComponent(-3, 0, -2, 3)); + unbindingRitual.add(new RitualComponent(2, 0, -2, 3)); + unbindingRitual.add(new RitualComponent(2, 0, -3, 3)); + unbindingRitual.add(new RitualComponent(3, 0, -2, 3)); + unbindingRitual.add(new RitualComponent(-2, 0, 2, 3)); + unbindingRitual.add(new RitualComponent(-2, 0, 3, 3)); + unbindingRitual.add(new RitualComponent(-3, 0, 2, 3)); + unbindingRitual.add(new RitualComponent(2, 0, 2, 3)); + unbindingRitual.add(new RitualComponent(2, 0, 3, 3)); + unbindingRitual.add(new RitualComponent(3, 0, 2, 3)); + unbindingRitual.add(new RitualComponent(3, 1, 3, 0)); + unbindingRitual.add(new RitualComponent(3, 1, -3, 0)); + unbindingRitual.add(new RitualComponent(-3, 1, -3, 0)); + unbindingRitual.add(new RitualComponent(-3, 1, 3, 0)); + unbindingRitual.add(new RitualComponent(3, 2, 3, 0)); + unbindingRitual.add(new RitualComponent(3, 2, -3, 0)); + unbindingRitual.add(new RitualComponent(-3, 2, -3, 0)); + unbindingRitual.add(new RitualComponent(-3, 2, 3, 0)); + unbindingRitual.add(new RitualComponent(3, 3, 3, 2)); + unbindingRitual.add(new RitualComponent(3, 3, -3, 2)); + unbindingRitual.add(new RitualComponent(-3, 3, -3, 2)); + unbindingRitual.add(new RitualComponent(-3, 3, 3, 2)); + unbindingRitual.add(new RitualComponent(-5, 0, 0, 2)); + unbindingRitual.add(new RitualComponent(5, 0, 0, 2)); + unbindingRitual.add(new RitualComponent(0, 0, 5, 2)); + unbindingRitual.add(new RitualComponent(0, 0, -5, 2)); + ArrayList jumpingRitual = new ArrayList(); + + for (int i = -1; i <= 1; i++) + { + jumpingRitual.add(new RitualComponent(1, i, 1, RitualComponent.AIR)); + jumpingRitual.add(new RitualComponent(-1, i, 1, RitualComponent.AIR)); + jumpingRitual.add(new RitualComponent(-1, i, -1, RitualComponent.AIR)); + jumpingRitual.add(new RitualComponent(1, i, -1, RitualComponent.AIR)); + } + + ArrayList magneticRitual = new ArrayList(); + magneticRitual.add(new RitualComponent(1, 0, 1, RitualComponent.EARTH)); + magneticRitual.add(new RitualComponent(1, 0, -1, RitualComponent.EARTH)); + magneticRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.EARTH)); + magneticRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.EARTH)); + magneticRitual.add(new RitualComponent(2, 1, 0, RitualComponent.EARTH)); + magneticRitual.add(new RitualComponent(0, 1, 2, RitualComponent.EARTH)); + magneticRitual.add(new RitualComponent(-2, 1, 0, RitualComponent.EARTH)); + magneticRitual.add(new RitualComponent(0, 1, -2, RitualComponent.EARTH)); + magneticRitual.add(new RitualComponent(2, 1, 2, RitualComponent.AIR)); + magneticRitual.add(new RitualComponent(2, 1, -2, RitualComponent.AIR)); + magneticRitual.add(new RitualComponent(-2, 1, 2, RitualComponent.AIR)); + magneticRitual.add(new RitualComponent(-2, 1, -2, RitualComponent.AIR)); + magneticRitual.add(new RitualComponent(2, 2, 0, RitualComponent.FIRE)); + magneticRitual.add(new RitualComponent(0, 2, 2, RitualComponent.FIRE)); + magneticRitual.add(new RitualComponent(-2, 2, 0, RitualComponent.FIRE)); + magneticRitual.add(new RitualComponent(0, 2, -2, RitualComponent.FIRE)); + ArrayList crushingRitual = new ArrayList(); + crushingRitual.add(new RitualComponent(0, 0, 1, RitualComponent.EARTH)); + crushingRitual.add(new RitualComponent(1, 0, 0, RitualComponent.EARTH)); + crushingRitual.add(new RitualComponent(0, 0, -1, RitualComponent.EARTH)); + crushingRitual.add(new RitualComponent(-1, 0, 0, RitualComponent.EARTH)); + crushingRitual.add(new RitualComponent(2, 0, 0, RitualComponent.FIRE)); + crushingRitual.add(new RitualComponent(0, 0, 2, RitualComponent.FIRE)); + crushingRitual.add(new RitualComponent(-2, 0, 0, RitualComponent.FIRE)); + crushingRitual.add(new RitualComponent(0, 0, -2, RitualComponent.FIRE)); + crushingRitual.add(new RitualComponent(2, 0, 2, RitualComponent.DUSK)); + crushingRitual.add(new RitualComponent(2, 0, -2, RitualComponent.DUSK)); + crushingRitual.add(new RitualComponent(-2, 0, 2, RitualComponent.DUSK)); + crushingRitual.add(new RitualComponent(-2, 0, -2, RitualComponent.DUSK)); + crushingRitual.add(new RitualComponent(2, 1, 0, RitualComponent.AIR)); + crushingRitual.add(new RitualComponent(-2, 1, 0, RitualComponent.AIR)); + crushingRitual.add(new RitualComponent(0, 1, 2, RitualComponent.AIR)); + crushingRitual.add(new RitualComponent(0, 1, -2, RitualComponent.AIR)); + ArrayList leapingRitual = new ArrayList(); + leapingRitual.add(new RitualComponent(0, 0, -2, RitualComponent.DUSK)); + leapingRitual.add(new RitualComponent(1, 0, -1, RitualComponent.AIR)); + leapingRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.AIR)); + + for (int i = 0; i <= 2; i++) + { + leapingRitual.add(new RitualComponent(2, 0, i, RitualComponent.AIR)); + leapingRitual.add(new RitualComponent(-2, 0, i, RitualComponent.AIR)); + } + + //Animal Growth + ArrayList animalGrowthRitual = new ArrayList(); + animalGrowthRitual.add(new RitualComponent(0, 0, 2, RitualComponent.DUSK)); + animalGrowthRitual.add(new RitualComponent(2, 0, 0, RitualComponent.DUSK)); + animalGrowthRitual.add(new RitualComponent(0, 0, -2, RitualComponent.DUSK)); + animalGrowthRitual.add(new RitualComponent(-2, 0, 0, RitualComponent.DUSK)); + animalGrowthRitual.add(new RitualComponent(0, 0, 1, RitualComponent.WATER)); + animalGrowthRitual.add(new RitualComponent(1, 0, 0, RitualComponent.WATER)); + animalGrowthRitual.add(new RitualComponent(0, 0, -1, RitualComponent.WATER)); + animalGrowthRitual.add(new RitualComponent(-1, 0, 0, RitualComponent.WATER)); + animalGrowthRitual.add(new RitualComponent(1, 0, 2, RitualComponent.EARTH)); + animalGrowthRitual.add(new RitualComponent(-1, 0, 2, RitualComponent.EARTH)); + animalGrowthRitual.add(new RitualComponent(1, 0, -2, RitualComponent.EARTH)); + animalGrowthRitual.add(new RitualComponent(-1, 0, -2, RitualComponent.EARTH)); + animalGrowthRitual.add(new RitualComponent(2, 0, 1, RitualComponent.AIR)); + animalGrowthRitual.add(new RitualComponent(2, 0, -1, RitualComponent.AIR)); + animalGrowthRitual.add(new RitualComponent(-2, 0, 1, RitualComponent.AIR)); + animalGrowthRitual.add(new RitualComponent(-2, 0, -1, RitualComponent.AIR)); + //Well of Suffering + ArrayList wellOfSufferingRitual = new ArrayList(); + wellOfSufferingRitual.add(new RitualComponent(1, 0, 1, RitualComponent.FIRE)); + wellOfSufferingRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.FIRE)); + wellOfSufferingRitual.add(new RitualComponent(1, 0, -1, RitualComponent.FIRE)); + wellOfSufferingRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.FIRE)); + wellOfSufferingRitual.add(new RitualComponent(2, -1, 2, RitualComponent.FIRE)); + wellOfSufferingRitual.add(new RitualComponent(2, -1, -2, RitualComponent.FIRE)); + wellOfSufferingRitual.add(new RitualComponent(-2, -1, 2, RitualComponent.FIRE)); + wellOfSufferingRitual.add(new RitualComponent(-2, -1, -2, RitualComponent.FIRE)); + wellOfSufferingRitual.add(new RitualComponent(0, -1, 2, RitualComponent.EARTH)); + wellOfSufferingRitual.add(new RitualComponent(2, -1, 0, RitualComponent.EARTH)); + wellOfSufferingRitual.add(new RitualComponent(0, -1, -2, RitualComponent.EARTH)); + wellOfSufferingRitual.add(new RitualComponent(-2, -1, 0, RitualComponent.EARTH)); + wellOfSufferingRitual.add(new RitualComponent(-3, -1, -3, RitualComponent.DUSK)); + wellOfSufferingRitual.add(new RitualComponent(3, -1, -3, RitualComponent.DUSK)); + wellOfSufferingRitual.add(new RitualComponent(-3, -1, 3, RitualComponent.DUSK)); + wellOfSufferingRitual.add(new RitualComponent(3, -1, 3, RitualComponent.DUSK)); + wellOfSufferingRitual.add(new RitualComponent(2, -1, 4, RitualComponent.WATER)); + wellOfSufferingRitual.add(new RitualComponent(4, -1, 2, RitualComponent.WATER)); + wellOfSufferingRitual.add(new RitualComponent(-2, -1, 4, RitualComponent.WATER)); + wellOfSufferingRitual.add(new RitualComponent(4, -1, -2, RitualComponent.WATER)); + wellOfSufferingRitual.add(new RitualComponent(2, -1, -4, RitualComponent.WATER)); + wellOfSufferingRitual.add(new RitualComponent(-4, -1, 2, RitualComponent.WATER)); + wellOfSufferingRitual.add(new RitualComponent(-2, -1, -4, RitualComponent.WATER)); + wellOfSufferingRitual.add(new RitualComponent(-4, -1, -2, RitualComponent.WATER)); + wellOfSufferingRitual.add(new RitualComponent(1, 0, 4, RitualComponent.WATER)); + wellOfSufferingRitual.add(new RitualComponent(4, 0, 1, RitualComponent.WATER)); + wellOfSufferingRitual.add(new RitualComponent(1, 0, -4, RitualComponent.WATER)); + wellOfSufferingRitual.add(new RitualComponent(-4, 0, 1, RitualComponent.WATER)); + wellOfSufferingRitual.add(new RitualComponent(-1, 0, 4, RitualComponent.WATER)); + wellOfSufferingRitual.add(new RitualComponent(4, 0, -1, RitualComponent.WATER)); + wellOfSufferingRitual.add(new RitualComponent(-1, 0, -4, RitualComponent.WATER)); + wellOfSufferingRitual.add(new RitualComponent(-4, 0, -1, RitualComponent.WATER)); + wellOfSufferingRitual.add(new RitualComponent(4, 1, 0, RitualComponent.AIR)); + wellOfSufferingRitual.add(new RitualComponent(0, 1, 4, RitualComponent.AIR)); + wellOfSufferingRitual.add(new RitualComponent(-4, 1, 0, RitualComponent.AIR)); + wellOfSufferingRitual.add(new RitualComponent(0, 1, -4, RitualComponent.AIR)); + ArrayList healingRitual = new ArrayList(); + healingRitual.add(new RitualComponent(4, 0, 0, RitualComponent.AIR)); + healingRitual.add(new RitualComponent(5, 0, -1, RitualComponent.AIR)); + healingRitual.add(new RitualComponent(5, 0, 1, RitualComponent.AIR)); + healingRitual.add(new RitualComponent(-4, 0, 0, RitualComponent.AIR)); + healingRitual.add(new RitualComponent(-5, 0, -1, RitualComponent.AIR)); + healingRitual.add(new RitualComponent(-5, 0, 1, RitualComponent.AIR)); + healingRitual.add(new RitualComponent(0, 0, 4, RitualComponent.FIRE)); + healingRitual.add(new RitualComponent(-1, 0, 5, RitualComponent.FIRE)); + healingRitual.add(new RitualComponent(1, 0, 5, RitualComponent.FIRE)); + healingRitual.add(new RitualComponent(0, 0, -4, RitualComponent.FIRE)); + healingRitual.add(new RitualComponent(-1, 0, -5, RitualComponent.FIRE)); + healingRitual.add(new RitualComponent(1, 0, -5, RitualComponent.FIRE)); + healingRitual.add(new RitualComponent(3, 0, 5, RitualComponent.WATER)); + healingRitual.add(new RitualComponent(5, 0, 3, RitualComponent.WATER)); + healingRitual.add(new RitualComponent(3, 0, -5, RitualComponent.WATER)); + healingRitual.add(new RitualComponent(5, 0, -3, RitualComponent.WATER)); + healingRitual.add(new RitualComponent(-3, 0, 5, RitualComponent.WATER)); + healingRitual.add(new RitualComponent(-5, 0, 3, RitualComponent.WATER)); + healingRitual.add(new RitualComponent(-3, 0, -5, RitualComponent.WATER)); + healingRitual.add(new RitualComponent(-5, 0, -3, RitualComponent.WATER)); + healingRitual.add(new RitualComponent(-3, 0, -3, RitualComponent.DUSK)); + healingRitual.add(new RitualComponent(-3, 0, 3, RitualComponent.DUSK)); + healingRitual.add(new RitualComponent(3, 0, -3, RitualComponent.DUSK)); + healingRitual.add(new RitualComponent(3, 0, 3, RitualComponent.DUSK)); + healingRitual.add(new RitualComponent(4, 0, 5, RitualComponent.EARTH)); + healingRitual.add(new RitualComponent(4, -1, 5, RitualComponent.EARTH)); + healingRitual.add(new RitualComponent(5, 0, 4, RitualComponent.EARTH)); + healingRitual.add(new RitualComponent(5, -1, 4, RitualComponent.EARTH)); + healingRitual.add(new RitualComponent(5, 0, 5, RitualComponent.EARTH)); + healingRitual.add(new RitualComponent(4, 0, -5, RitualComponent.EARTH)); + healingRitual.add(new RitualComponent(4, -1, -5, RitualComponent.EARTH)); + healingRitual.add(new RitualComponent(5, 0, -4, RitualComponent.EARTH)); + healingRitual.add(new RitualComponent(5, -1, -4, RitualComponent.EARTH)); + healingRitual.add(new RitualComponent(5, 0, -5, RitualComponent.EARTH)); + healingRitual.add(new RitualComponent(-4, 0, 5, RitualComponent.EARTH)); + healingRitual.add(new RitualComponent(-4, -1, 5, RitualComponent.EARTH)); + healingRitual.add(new RitualComponent(-5, 0, 4, RitualComponent.EARTH)); + healingRitual.add(new RitualComponent(-5, -1, 4, RitualComponent.EARTH)); + healingRitual.add(new RitualComponent(-5, 0, 5, RitualComponent.EARTH)); + healingRitual.add(new RitualComponent(-4, 0, -5, RitualComponent.EARTH)); + healingRitual.add(new RitualComponent(-4, -1, -5, RitualComponent.EARTH)); + healingRitual.add(new RitualComponent(-5, 0, -4, RitualComponent.EARTH)); + healingRitual.add(new RitualComponent(-5, -1, -4, RitualComponent.EARTH)); + healingRitual.add(new RitualComponent(-5, 0, -5, RitualComponent.EARTH)); + ArrayList featheredKnifeRitual = new ArrayList(); + featheredKnifeRitual.add(new RitualComponent(1, 0, 0, RitualComponent.DUSK)); + featheredKnifeRitual.add(new RitualComponent(-1, 0, 0, RitualComponent.DUSK)); + featheredKnifeRitual.add(new RitualComponent(0, 0, 1, RitualComponent.DUSK)); + featheredKnifeRitual.add(new RitualComponent(0, 0, -1, RitualComponent.DUSK)); + featheredKnifeRitual.add(new RitualComponent(2, -1, 0, RitualComponent.WATER)); + featheredKnifeRitual.add(new RitualComponent(-2, -1, 0, RitualComponent.WATER)); + featheredKnifeRitual.add(new RitualComponent(0, -1, 2, RitualComponent.WATER)); + featheredKnifeRitual.add(new RitualComponent(0, -1, -2, RitualComponent.WATER)); + featheredKnifeRitual.add(new RitualComponent(1, -1, 1, RitualComponent.AIR)); + featheredKnifeRitual.add(new RitualComponent(1, -1, -1, RitualComponent.AIR)); + featheredKnifeRitual.add(new RitualComponent(-1, -1, 1, RitualComponent.AIR)); + featheredKnifeRitual.add(new RitualComponent(-1, -1, -1, RitualComponent.AIR)); + featheredKnifeRitual.add(new RitualComponent(4, -1, 2, RitualComponent.FIRE)); + featheredKnifeRitual.add(new RitualComponent(2, -1, 4, RitualComponent.FIRE)); + featheredKnifeRitual.add(new RitualComponent(-4, -1, 2, RitualComponent.FIRE)); + featheredKnifeRitual.add(new RitualComponent(2, -1, -4, RitualComponent.FIRE)); + featheredKnifeRitual.add(new RitualComponent(4, -1, -2, RitualComponent.FIRE)); + featheredKnifeRitual.add(new RitualComponent(-2, -1, 4, RitualComponent.FIRE)); + featheredKnifeRitual.add(new RitualComponent(-4, -1, -2, RitualComponent.FIRE)); + featheredKnifeRitual.add(new RitualComponent(-2, -1, -4, RitualComponent.FIRE)); + featheredKnifeRitual.add(new RitualComponent(4, 0, 2, RitualComponent.EARTH)); + featheredKnifeRitual.add(new RitualComponent(2, 0, 4, RitualComponent.EARTH)); + featheredKnifeRitual.add(new RitualComponent(-4, 0, 2, RitualComponent.EARTH)); + featheredKnifeRitual.add(new RitualComponent(2, 0, -4, RitualComponent.EARTH)); + featheredKnifeRitual.add(new RitualComponent(4, 0, -2, RitualComponent.EARTH)); + featheredKnifeRitual.add(new RitualComponent(-2, 0, 4, RitualComponent.EARTH)); + featheredKnifeRitual.add(new RitualComponent(-4, 0, -2, RitualComponent.EARTH)); + featheredKnifeRitual.add(new RitualComponent(-2, 0, -4, RitualComponent.EARTH)); + featheredKnifeRitual.add(new RitualComponent(4, 0, 3, RitualComponent.EARTH)); + featheredKnifeRitual.add(new RitualComponent(3, 0, 4, RitualComponent.EARTH)); + featheredKnifeRitual.add(new RitualComponent(-4, 0, 3, RitualComponent.EARTH)); + featheredKnifeRitual.add(new RitualComponent(3, 0, -4, RitualComponent.EARTH)); + featheredKnifeRitual.add(new RitualComponent(4, 0, -3, RitualComponent.EARTH)); + featheredKnifeRitual.add(new RitualComponent(-3, 0, 4, RitualComponent.EARTH)); + featheredKnifeRitual.add(new RitualComponent(-4, 0, -3, RitualComponent.EARTH)); + featheredKnifeRitual.add(new RitualComponent(-3, 0, -4, RitualComponent.EARTH)); + featheredKnifeRitual.add(new RitualComponent(3, 0, 3, RitualComponent.AIR)); + featheredKnifeRitual.add(new RitualComponent(3, 0, -3, RitualComponent.AIR)); + featheredKnifeRitual.add(new RitualComponent(-3, 0, 3, RitualComponent.AIR)); + featheredKnifeRitual.add(new RitualComponent(-3, 0, -3, RitualComponent.AIR)); + ArrayList featheredEarthRitual = new ArrayList(); + featheredEarthRitual.add(new RitualComponent(1, 0, 0, RitualComponent.DUSK)); + featheredEarthRitual.add(new RitualComponent(-1, 0, 0, RitualComponent.DUSK)); + featheredEarthRitual.add(new RitualComponent(0, 0, 1, RitualComponent.DUSK)); + featheredEarthRitual.add(new RitualComponent(0, 0, -1, RitualComponent.DUSK)); + featheredEarthRitual.add(new RitualComponent(2, 0, 2, RitualComponent.AIR)); + featheredEarthRitual.add(new RitualComponent(-2, 0, 2, RitualComponent.AIR)); + featheredEarthRitual.add(new RitualComponent(-2, 0, -2, RitualComponent.AIR)); + featheredEarthRitual.add(new RitualComponent(2, 0, -2, RitualComponent.AIR)); + featheredEarthRitual.add(new RitualComponent(1, 0, 3, RitualComponent.EARTH)); + featheredEarthRitual.add(new RitualComponent(0, 0, 3, RitualComponent.EARTH)); + featheredEarthRitual.add(new RitualComponent(-1, 0, 3, RitualComponent.EARTH)); + featheredEarthRitual.add(new RitualComponent(1, 0, -3, RitualComponent.EARTH)); + featheredEarthRitual.add(new RitualComponent(0, 0, -3, RitualComponent.EARTH)); + featheredEarthRitual.add(new RitualComponent(-1, 0, -3, RitualComponent.EARTH)); + featheredEarthRitual.add(new RitualComponent(3, 0, 1, RitualComponent.EARTH)); + featheredEarthRitual.add(new RitualComponent(3, 0, 0, RitualComponent.EARTH)); + featheredEarthRitual.add(new RitualComponent(3, 0, -1, RitualComponent.EARTH)); + featheredEarthRitual.add(new RitualComponent(-3, 0, 1, RitualComponent.EARTH)); + featheredEarthRitual.add(new RitualComponent(-3, 0, 0, RitualComponent.EARTH)); + featheredEarthRitual.add(new RitualComponent(-3, 0, -1, RitualComponent.EARTH)); + featheredEarthRitual.add(new RitualComponent(4, 4, 4, RitualComponent.FIRE)); + featheredEarthRitual.add(new RitualComponent(-4, 4, 4, RitualComponent.FIRE)); + featheredEarthRitual.add(new RitualComponent(-4, 4, -4, RitualComponent.FIRE)); + featheredEarthRitual.add(new RitualComponent(4, 4, -4, RitualComponent.FIRE)); + featheredEarthRitual.add(new RitualComponent(4, 5, 5, RitualComponent.AIR)); + featheredEarthRitual.add(new RitualComponent(4, 5, 3, RitualComponent.AIR)); + featheredEarthRitual.add(new RitualComponent(5, 5, 4, RitualComponent.AIR)); + featheredEarthRitual.add(new RitualComponent(3, 5, 4, RitualComponent.AIR)); + featheredEarthRitual.add(new RitualComponent(-4, 5, 5, RitualComponent.AIR)); + featheredEarthRitual.add(new RitualComponent(-4, 5, 3, RitualComponent.AIR)); + featheredEarthRitual.add(new RitualComponent(-5, 5, 4, RitualComponent.AIR)); + featheredEarthRitual.add(new RitualComponent(-3, 5, 4, RitualComponent.AIR)); + featheredEarthRitual.add(new RitualComponent(4, 5, -5, RitualComponent.AIR)); + featheredEarthRitual.add(new RitualComponent(4, 5, -3, RitualComponent.AIR)); + featheredEarthRitual.add(new RitualComponent(5, 5, -4, RitualComponent.AIR)); + featheredEarthRitual.add(new RitualComponent(3, 5, -4, RitualComponent.AIR)); + featheredEarthRitual.add(new RitualComponent(-4, 5, -5, RitualComponent.AIR)); + featheredEarthRitual.add(new RitualComponent(-4, 5, -3, RitualComponent.AIR)); + featheredEarthRitual.add(new RitualComponent(-5, 5, -4, RitualComponent.AIR)); + featheredEarthRitual.add(new RitualComponent(-3, 5, -4, RitualComponent.AIR)); + //Biome Changer + ArrayList biomeChangerRitual = new ArrayList(); + biomeChangerRitual.add(new RitualComponent(1, 0, -2, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(1, 0, -3, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(2, 0, -1, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(3, 0, -1, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(1, 0, 2, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(1, 0, 3, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(2, 0, 1, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(3, 0, 1, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(-1, 0, -2, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(-1, 0, -3, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(-2, 0, -1, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(-3, 0, -1, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(-1, 0, 2, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(-1, 0, 3, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(-2, 0, 1, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(-3, 0, 1, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(3, 0, -3, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(3, 0, -4, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(4, 0, -3, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(4, 0, -5, RitualComponent.FIRE)); + biomeChangerRitual.add(new RitualComponent(5, 0, -4, RitualComponent.FIRE)); + biomeChangerRitual.add(new RitualComponent(3, 0, 3, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(3, 0, 4, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(4, 0, 3, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(4, 0, 5, RitualComponent.FIRE)); + biomeChangerRitual.add(new RitualComponent(5, 0, 4, RitualComponent.FIRE)); + biomeChangerRitual.add(new RitualComponent(-3, 0, 3, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(-3, 0, 4, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(-4, 0, 3, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(-4, 0, 5, RitualComponent.FIRE)); + biomeChangerRitual.add(new RitualComponent(-5, 0, 4, RitualComponent.FIRE)); + biomeChangerRitual.add(new RitualComponent(-3, 0, -3, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(-3, 0, -4, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(-4, 0, -3, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(-4, 0, -5, RitualComponent.FIRE)); + biomeChangerRitual.add(new RitualComponent(-5, 0, -4, RitualComponent.FIRE)); + biomeChangerRitual.add(new RitualComponent(0, 0, -5, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(-1, 0, -6, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(1, 0, -6, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(-1, 0, -8, RitualComponent.BLANK)); + biomeChangerRitual.add(new RitualComponent(0, 0, -8, RitualComponent.BLANK)); + biomeChangerRitual.add(new RitualComponent(1, 0, -8, RitualComponent.BLANK)); + biomeChangerRitual.add(new RitualComponent(-1, 0, -10, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(0, 0, -10, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(1, 0, -10, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(0, 0, 5, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(-1, 0, 6, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(1, 0, 6, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(-1, 0, 8, RitualComponent.BLANK)); + biomeChangerRitual.add(new RitualComponent(0, 0, 8, RitualComponent.BLANK)); + biomeChangerRitual.add(new RitualComponent(1, 0, 8, RitualComponent.BLANK)); + biomeChangerRitual.add(new RitualComponent(-1, 0, 10, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(0, 0, 10, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(1, 0, 10, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(-5, 0, 0, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(-6, 0, -1, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(-6, 0, 1, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(-8, 0, -1, RitualComponent.BLANK)); + biomeChangerRitual.add(new RitualComponent(-8, 0, 0, RitualComponent.BLANK)); + biomeChangerRitual.add(new RitualComponent(-8, 0, 1, RitualComponent.BLANK)); + biomeChangerRitual.add(new RitualComponent(-10, 0, -1, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(-10, 0, 0, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(-10, 0, 1, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(5, 0, 0, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(6, 0, -1, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(6, 0, 1, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(8, 0, -1, RitualComponent.BLANK)); + biomeChangerRitual.add(new RitualComponent(8, 0, 0, RitualComponent.BLANK)); + biomeChangerRitual.add(new RitualComponent(8, 0, 1, RitualComponent.BLANK)); + biomeChangerRitual.add(new RitualComponent(10, 0, -1, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(10, 0, 0, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(10, 0, 1, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(6, 0, -6, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(6, 0, -7, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(7, 0, -6, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(7, 0, -5, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(5, 0, -7, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(8, 0, -5, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(8, 0, -4, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(9, 0, -4, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(5, 0, -8, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(4, 0, -8, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(4, 0, -9, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(-6, 0, 6, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(-6, 0, 7, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(-7, 0, 6, RitualComponent.AIR)); + biomeChangerRitual.add(new RitualComponent(-7, 0, 5, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(-5, 0, 7, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(-8, 0, 5, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(-8, 0, 4, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(-9, 0, 4, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(-5, 0, 8, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(-4, 0, 8, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(-4, 0, 9, RitualComponent.EARTH)); + biomeChangerRitual.add(new RitualComponent(6, 0, 6, RitualComponent.FIRE)); + biomeChangerRitual.add(new RitualComponent(6, 0, 7, RitualComponent.FIRE)); + biomeChangerRitual.add(new RitualComponent(7, 0, 6, RitualComponent.FIRE)); + biomeChangerRitual.add(new RitualComponent(7, 0, 5, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(5, 0, 7, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(8, 0, 5, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(8, 0, 4, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(9, 0, 4, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(5, 0, 8, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(4, 0, 8, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(4, 0, 9, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(-6, 0, -6, RitualComponent.FIRE)); + biomeChangerRitual.add(new RitualComponent(-6, 0, -7, RitualComponent.FIRE)); + biomeChangerRitual.add(new RitualComponent(-7, 0, -6, RitualComponent.FIRE)); + biomeChangerRitual.add(new RitualComponent(-7, 0, -5, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(-5, 0, -7, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(-8, 0, -5, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(-8, 0, -4, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(-9, 0, -4, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(-5, 0, -8, RitualComponent.DUSK)); + biomeChangerRitual.add(new RitualComponent(-4, 0, -8, RitualComponent.WATER)); + biomeChangerRitual.add(new RitualComponent(-4, 0, -9, RitualComponent.WATER)); + ArrayList flightRitual = new ArrayList(); + flightRitual.add(new RitualComponent(1, 0, 0, RitualComponent.DUSK)); + flightRitual.add(new RitualComponent(-1, 0, 0, RitualComponent.DUSK)); + flightRitual.add(new RitualComponent(0, 0, 1, RitualComponent.DUSK)); + flightRitual.add(new RitualComponent(0, 0, -1, RitualComponent.DUSK)); + flightRitual.add(new RitualComponent(2, 0, 2, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(-2, 0, 2, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(-2, 0, -2, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(2, 0, -2, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(1, 0, 3, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(0, 0, 3, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(-1, 0, 3, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(1, 0, -3, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(0, 0, -3, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(-1, 0, -3, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(3, 0, 1, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(3, 0, 0, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(3, 0, -1, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(-3, 0, 1, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(-3, 0, 0, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(-3, 0, -1, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(-3, 0, -4, RitualComponent.WATER)); + flightRitual.add(new RitualComponent(-4, 0, -3, RitualComponent.WATER)); + flightRitual.add(new RitualComponent(-3, 0, 4, RitualComponent.WATER)); + flightRitual.add(new RitualComponent(4, 0, -3, RitualComponent.WATER)); + flightRitual.add(new RitualComponent(3, 0, -4, RitualComponent.WATER)); + flightRitual.add(new RitualComponent(-4, 0, 3, RitualComponent.WATER)); + flightRitual.add(new RitualComponent(3, 0, 4, RitualComponent.WATER)); + flightRitual.add(new RitualComponent(4, 0, 3, RitualComponent.WATER)); + flightRitual.add(new RitualComponent(-1, 1, 0, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(1, 1, 0, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(0, 1, -1, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(0, 1, 1, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(-2, 1, 0, RitualComponent.BLANK)); + flightRitual.add(new RitualComponent(2, 1, 0, RitualComponent.BLANK)); + flightRitual.add(new RitualComponent(0, 1, -2, RitualComponent.BLANK)); + flightRitual.add(new RitualComponent(0, 1, 2, RitualComponent.BLANK)); + flightRitual.add(new RitualComponent(-4, 1, 0, RitualComponent.BLANK)); + flightRitual.add(new RitualComponent(4, 1, 0, RitualComponent.BLANK)); + flightRitual.add(new RitualComponent(0, 1, -4, RitualComponent.BLANK)); + flightRitual.add(new RitualComponent(0, 1, 4, RitualComponent.BLANK)); + flightRitual.add(new RitualComponent(-5, 1, 0, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(5, 1, 0, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(0, 1, -5, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(0, 1, 5, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(5, 0, 0, RitualComponent.DUSK)); + flightRitual.add(new RitualComponent(-5, 0, 0, RitualComponent.DUSK)); + flightRitual.add(new RitualComponent(0, 0, 5, RitualComponent.DUSK)); + flightRitual.add(new RitualComponent(0, 0, -5, RitualComponent.DUSK)); + + for (int i = 2; i <= 4; i++) + { + flightRitual.add(new RitualComponent(-i, 2, 0, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(i, 2, 0, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(0, 2, -i, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(0, 2, i, RitualComponent.EARTH)); + } + + flightRitual.add(new RitualComponent(2, 4, 1, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(1, 4, 2, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(-2, 4, 1, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(1, 4, -2, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(2, 4, -1, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(-1, 4, 2, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(-2, 4, -1, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(-1, 4, -2, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(2, 4, 2, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(-2, 4, 2, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(2, 4, -2, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(-2, 4, -2, RitualComponent.AIR)); + flightRitual.add(new RitualComponent(-4, 2, -4, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(4, 2, 4, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(4, 2, -4, RitualComponent.FIRE)); + flightRitual.add(new RitualComponent(-4, 2, 4, RitualComponent.FIRE)); + + for (int i = -1; i <= 1; i++) + { + flightRitual.add(new RitualComponent(3, 4, i, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(-3, 4, i, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(i, 4, 3, RitualComponent.EARTH)); + flightRitual.add(new RitualComponent(i, 4, -3, RitualComponent.EARTH)); + } + + ArrayList meteorRitual = new ArrayList(); + meteorRitual.add(new RitualComponent(2, 0, 0, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(-2, 0, 0, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(0, 0, 2, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(0, 0, -2, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(3, 0, 1, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(3, 0, -1, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(-3, 0, 1, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(-3, 0, -1, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(1, 0, 3, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(-1, 0, 3, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(1, 0, -3, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(-1, 0, -3, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(4, 0, 2, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(4, 0, -2, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(-4, 0, 2, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(-4, 0, -2, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(2, 0, 4, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(-2, 0, 4, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(2, 0, -4, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(-2, 0, -4, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(5, 0, 3, RitualComponent.DUSK)); + meteorRitual.add(new RitualComponent(5, 0, -3, RitualComponent.DUSK)); + meteorRitual.add(new RitualComponent(-5, 0, 3, RitualComponent.DUSK)); + meteorRitual.add(new RitualComponent(-5, 0, -3, RitualComponent.DUSK)); + meteorRitual.add(new RitualComponent(3, 0, 5, RitualComponent.DUSK)); + meteorRitual.add(new RitualComponent(-3, 0, 5, RitualComponent.DUSK)); + meteorRitual.add(new RitualComponent(3, 0, -5, RitualComponent.DUSK)); + meteorRitual.add(new RitualComponent(-3, 0, -5, RitualComponent.DUSK)); + meteorRitual.add(new RitualComponent(-4, 0, -4, RitualComponent.DUSK)); + meteorRitual.add(new RitualComponent(-4, 0, 4, RitualComponent.DUSK)); + meteorRitual.add(new RitualComponent(4, 0, 4, RitualComponent.DUSK)); + meteorRitual.add(new RitualComponent(4, 0, -4, RitualComponent.DUSK)); + + for (int i = 4; i <= 6; i++) + { + meteorRitual.add(new RitualComponent(i, 0, 0, RitualComponent.EARTH)); + meteorRitual.add(new RitualComponent(-i, 0, 0, RitualComponent.EARTH)); + meteorRitual.add(new RitualComponent(0, 0, i, RitualComponent.EARTH)); + meteorRitual.add(new RitualComponent(0, 0, -i, RitualComponent.EARTH)); + } + + meteorRitual.add(new RitualComponent(8, 0, 0, RitualComponent.EARTH)); + meteorRitual.add(new RitualComponent(-8, 0, 0, RitualComponent.EARTH)); + meteorRitual.add(new RitualComponent(0, 0, 8, RitualComponent.EARTH)); + meteorRitual.add(new RitualComponent(0, 0, -8, RitualComponent.EARTH)); + meteorRitual.add(new RitualComponent(8, 1, 0, RitualComponent.EARTH)); + meteorRitual.add(new RitualComponent(-8, 1, 0, RitualComponent.EARTH)); + meteorRitual.add(new RitualComponent(0, 1, 8, RitualComponent.EARTH)); + meteorRitual.add(new RitualComponent(0, 1, -8, RitualComponent.EARTH)); + meteorRitual.add(new RitualComponent(7, 1, 0, RitualComponent.EARTH)); + meteorRitual.add(new RitualComponent(-7, 1, 0, RitualComponent.EARTH)); + meteorRitual.add(new RitualComponent(0, 1, 7, RitualComponent.EARTH)); + meteorRitual.add(new RitualComponent(0, 1, -7, RitualComponent.EARTH)); + meteorRitual.add(new RitualComponent(7, 2, 0, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(-7, 2, 0, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(0, 2, 7, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(0, 2, -7, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(6, 2, 0, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(-6, 2, 0, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(0, 2, 6, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(0, 2, -6, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(6, 3, 0, RitualComponent.WATER)); + meteorRitual.add(new RitualComponent(-6, 3, 0, RitualComponent.WATER)); + meteorRitual.add(new RitualComponent(0, 3, 6, RitualComponent.WATER)); + meteorRitual.add(new RitualComponent(0, 3, -6, RitualComponent.WATER)); + meteorRitual.add(new RitualComponent(5, 3, 0, RitualComponent.WATER)); + meteorRitual.add(new RitualComponent(-5, 3, 0, RitualComponent.WATER)); + meteorRitual.add(new RitualComponent(0, 3, 5, RitualComponent.WATER)); + meteorRitual.add(new RitualComponent(0, 3, -5, RitualComponent.WATER)); + meteorRitual.add(new RitualComponent(5, 4, 0, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(-5, 4, 0, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(0, 4, 5, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(0, 4, -5, RitualComponent.AIR)); + + for (int i = -1; i <= 1; i++) + { + meteorRitual.add(new RitualComponent(i, 4, 4, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(i, 4, -4, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(4, 4, i, RitualComponent.AIR)); + meteorRitual.add(new RitualComponent(-4, 4, i, RitualComponent.AIR)); + } + + meteorRitual.add(new RitualComponent(2, 4, 4, RitualComponent.WATER)); + meteorRitual.add(new RitualComponent(4, 4, 2, RitualComponent.WATER)); + meteorRitual.add(new RitualComponent(2, 4, -4, RitualComponent.WATER)); + meteorRitual.add(new RitualComponent(-4, 4, 2, RitualComponent.WATER)); + meteorRitual.add(new RitualComponent(-2, 4, 4, RitualComponent.WATER)); + meteorRitual.add(new RitualComponent(4, 4, -2, RitualComponent.WATER)); + meteorRitual.add(new RitualComponent(-2, 4, -4, RitualComponent.WATER)); + meteorRitual.add(new RitualComponent(-4, 4, -2, RitualComponent.WATER)); + meteorRitual.add(new RitualComponent(2, 4, 3, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(3, 4, 2, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(3, 4, 3, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(-2, 4, 3, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(3, 4, -2, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(3, 4, -3, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(2, 4, -3, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(-3, 4, 2, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(-3, 4, 3, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(-2, 4, -3, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(-3, 4, -2, RitualComponent.FIRE)); + meteorRitual.add(new RitualComponent(-3, 4, -3, RitualComponent.FIRE)); + + ArrayList apiaryRitual = new ArrayList(); + apiaryRitual.add(new RitualComponent(1,0,0, RitualComponent.DUSK)); + apiaryRitual.add(new RitualComponent(1,0,1, RitualComponent.DUSK)); + apiaryRitual.add(new RitualComponent(1,0,-1, RitualComponent.DUSK)); + apiaryRitual.add(new RitualComponent(-1,0,-1, RitualComponent.DUSK)); + apiaryRitual.add(new RitualComponent(-1,0,1, RitualComponent.DUSK)); + apiaryRitual.add(new RitualComponent(-1,0,0, RitualComponent.DUSK)); + apiaryRitual.add(new RitualComponent(0,0,-1, RitualComponent.DUSK)); + apiaryRitual.add(new RitualComponent(0,0,1, RitualComponent.DUSK)); + + + ritualList.add(new Rituals(waterRitual, 1, 500, new RitualEffectWater(), "Ritual of the Full Spring")); + ritualList.add(new Rituals(lavaRitual, 1, 10000, new RitualEffectLava(), "Serenade of the Nether")); + ritualList.add(new Rituals(growthRitual, 1, 1000, new RitualEffectGrowth(), "Ritual of the Green Grove")); + ritualList.add(new Rituals(interdictionRitual, 1, 1000, new RitualEffectInterdiction(), "Interdiction Ritual")); + ritualList.add(new Rituals(containmentRitual, 1, 2000, new RitualEffectContainment(), "Ritual of Containment")); + ritualList.add(new Rituals(boundSoulRitual, 1, 5000, new RitualEffectSoulBound(), "Ritual of Binding")); + ritualList.add(new Rituals(unbindingRitual, 1, 30000, new RitualEffectUnbinding(), "Ritual of Unbinding")); + ritualList.add(new Rituals(jumpingRitual, 1, 1000, new RitualEffectJumping(), "Ritual of the High Jump")); + ritualList.add(new Rituals(magneticRitual, 1, 5000, new RitualEffectMagnetic(), "Ritual of Magnetism")); + ritualList.add(new Rituals(crushingRitual, 1, 2500, new RitualEffectCrushing(), "Ritual of the Crusher")); + ritualList.add(new Rituals(leapingRitual, 1, 1000, new RitualEffectLeap(), "Ritual of Speed")); + ritualList.add(new Rituals(animalGrowthRitual, 1, 10000, new RitualEffectAnimalGrowth(), "Ritual of the Shepherd")); + ritualList.add(new Rituals(wellOfSufferingRitual, 1, 50000, new RitualEffectWellOfSuffering(), "Well of Suffering")); + ritualList.add(new Rituals(healingRitual, 1, 25000, new RitualEffectHealing(), "Ritual of Regeneration")); + ritualList.add(new Rituals(featheredKnifeRitual, 1, 50000, new RitualEffectFeatheredKnife(), "Ritual of the Feathered Knife")); + ritualList.add(new Rituals(featheredEarthRitual, 2, 100000, new RitualEffectFeatheredEarth(), "Ritual of the Feathered Earth")); + ritualList.add(new Rituals(biomeChangerRitual, 2, 1000000, new RitualEffectBiomeChanger(), "Ritual of Gaia's Transformation")); + ritualList.add(new Rituals(flightRitual, 2, 1000000, new RitualEffectFlight(), "Reverence of the Condor")); + ritualList.add(new Rituals(meteorRitual, 2, 1000000, new RitualEffectSummonMeteor(), "Mark of the Falling Tower")); + ritualList.add(new Rituals(apiaryRitual,1,100,new RitualEffectApiaryOverclock(),"Apiary Overclock")); + } + + public static int getCostForActivation(int ritualID) + { + if (ritualID <= ritualList.size()) + { + return ritualList.get(ritualID - 1).actCost; + } else + { + return 0; + } + +// switch (ritualID) +// { +// case 1: +// return 500; +// +// case 2: +// return 20000; +// +// case 3: +// return 250; +// +// case 4: +// return 1000; +// +// case 5: +// return 2000; +// +// case 6: +// return 5000; +// +// case 7: +// return 50000; +// +// case 8: +// return 1000; +// default: +// return 0; +// } + } + +// public static int getCostPerRefresh(int ritualID) +// { +// switch (ritualID) +// { +// case 1: +// return 25; +// +// case 2: +// return 500; +// +// case 3: +// return 20; +// +// case 4: +// return 1; +// +// case 5: +// return 1; +// +// case 6: +// return 0; +// +// case 7: +// return 0; +// +// case 8: +// return 1; +// +// default: +// return 0; +// } +// } + + public static int getInitialCooldown(int ritualID) + { + if (ritualID <= ritualList.size()) + { + RitualEffect ef = ritualList.get(ritualID - 1).effect; + + if (ef != null) + { + OreDictionary d; + return ef.getInitialCooldown(); + } + } + + return 0; + } + + public static List getRitualList(int ritualID) + { + if (ritualID <= ritualList.size()) + { + return ritualList.get(ritualID - 1).obtainComponents(); + } else + { + return null; + } + +// switch (ritualID) +// { +// case 1: +// return waterRitual; +// +// case 2: +// return lavaRitual; +// +// case 3: +// return growthRitual; +// +// case 4: +// return interdictionRitual; +// +// case 5: +// return containmentRitual; +// +// case 6: +// return boundSoulRitual; +// +// case 7: +// return unbindingRitual; +// +// case 8: +// return jumpingRitual; +// +// default: +// return null; +// } + } + + private List obtainComponents() + { + return this.components; + } + + private int getCrystalLevel() + { + return this.crystalLevel; + } + + public static void performEffect(TEMasterStone ritualStone, int ritualID) + { + if (ritualID <= ritualList.size()) + { + RitualEffect ef = ritualList.get(ritualID - 1).effect; + + if (ef != null) + { + ef.performEffect(ritualStone); + } + } + } + + public static int getNumberOfRituals() + { + return ritualList.size(); + } + + public String getRitualName() + { + return this.name; + } + + public static String getNameOfRitual(int id) + { + if (ritualList.get(id) != null) + { + return ritualList.get(id).getRitualName(); + } else + { + return ""; + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/EntitySpellProjectile.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/EntitySpellProjectile.java new file mode 100644 index 00000000..016bfa48 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/EntitySpellProjectile.java @@ -0,0 +1,611 @@ +package WayofTime.alchemicalWizardry.common.spell.complex; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.IProjectile; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraftforge.common.util.Constants; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IProjectileImpactEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IProjectileUpdateEffect; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class EntitySpellProjectile extends Entity implements IProjectile +{ + private int xTile = -1; + private int yTile = -1; + private int zTile = -1; + private int inTile = 0; + private int inData = 0; + private boolean inGround = false; + /** The owner of this arrow. */ + public EntityPlayer shootingEntity; + private int ticksInAir = 0; + private int ricochetCounter = 0; + private boolean scheduledForDeath = false; + + //Custom variables + private int maxRicochet = 0; + private float damage = 1; + public List impactList = new ArrayList(); + private boolean penetration = false; + public List updateEffectList = new ArrayList(); + public List spellEffectList = new LinkedList(); + private int blocksBroken = 0; + + public EntitySpellProjectile(World par1World) + { + super(par1World); + this.setSize(0.5F, 0.5F); + } + + public EntitySpellProjectile(World par1World, double par2, double par4, double par6) + { + super(par1World); + this.setSize(0.5F, 0.5F); + this.setPosition(par2, par4, par6); + yOffset = 0.0F; + } + + public EntitySpellProjectile(World par1World, EntityPlayer par2EntityPlayer) + { + super(par1World); + shootingEntity = par2EntityPlayer; + float par3 = 0.8F; + this.setSize(0.1F, 0.1F); + this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch); + posX -= MathHelper.cos(rotationYaw / 180.0F * (float)Math.PI) * 0.16F; + posY -= 0.2D; + posZ -= MathHelper.sin(rotationYaw / 180.0F * (float)Math.PI) * 0.16F; + this.setPosition(posX, posY, posZ); + yOffset = 0.0F; + motionX = -MathHelper.sin(rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float)Math.PI); + motionZ = MathHelper.cos(rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float)Math.PI); + motionY = -MathHelper.sin(rotationPitch / 180.0F * (float)Math.PI); + this.setThrowableHeading(motionX, motionY, motionZ, par3 * 1.5F, 1.0F); + + } + + @Override + protected void entityInit() { + dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + + /** + * Similar to setArrowHeading, it's point the throwable entity to a x, y, z + * direction. + */ + @Override + public void setThrowableHeading(double var1, double var3, double var5, float var7, float var8) { + float var9 = MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5); + var1 /= var9; + var3 /= var9; + var5 /= var9; + var1 += rand.nextGaussian() * 0.007499999832361937D * var8; + var3 += rand.nextGaussian() * 0.007499999832361937D * var8; + var5 += rand.nextGaussian() * 0.007499999832361937D * var8; + var1 *= var7; + var3 *= var7; + var5 *= var7; + motionX = var1; + motionY = var3; + motionZ = var5; + float var10 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); + prevRotationYaw = rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / Math.PI); + prevRotationPitch = rotationPitch = (float)(Math.atan2(var3, var10) * 180.0D / Math.PI); + } + + @Override + @SideOnly(Side.CLIENT) + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { + this.setPosition(par1, par3, par5); + this.setRotation(par7, par8); + } + + @Override + @SideOnly(Side.CLIENT) + /** + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double par1, double par3, double par5) { + motionX = par1; + motionY = par3; + motionZ = par5; + if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F) { + float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); + prevRotationYaw = rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); + prevRotationPitch = rotationPitch = (float)(Math.atan2(par3, var7) * 180.0D / Math.PI); + prevRotationPitch = rotationPitch; + prevRotationYaw = rotationYaw; + this.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch); + } + } + + /** + * Called to update the entity's position/logic. + */ + @Override + public void onUpdate() + { + super.onUpdate(); + this.performUpdateEffects(); + if (ticksInAir > 600) { + this.setDead(); + } + if (shootingEntity == null) { + List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(posX - 1, posY - 1, posZ - 1, posX + 1, posY + 1, posZ + 1)); + Iterator i = players.iterator(); + double closestDistance = Double.MAX_VALUE; + EntityPlayer closestPlayer = null; + while (i.hasNext()) { + EntityPlayer e = (EntityPlayer)i.next(); + double distance = e.getDistanceToEntity(this); + if (distance < closestDistance) { + closestPlayer = e; + } + } + if (closestPlayer != null) { + shootingEntity = closestPlayer; + } + } + if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F) { + float var1 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ); + prevRotationYaw = rotationYaw = (float)(Math.atan2(motionX, motionZ) * 180.0D / Math.PI); + prevRotationPitch = rotationPitch = (float)(Math.atan2(motionY, var1) * 180.0D / Math.PI); + } + Block var16 = worldObj.getBlock(xTile, yTile, zTile); + + if (var16 != null) + { + var16.setBlockBoundsBasedOnState(worldObj, xTile, yTile, zTile); + AxisAlignedBB var2 = var16.getCollisionBoundingBoxFromPool(worldObj, xTile, yTile, zTile); + + if (var2 != null && var2.isVecInside(worldObj.getWorldVec3Pool().getVecFromPool(posX, posY, posZ))) + { + inGround = true; + } + } + + if (inGround) + { + Block var18 = worldObj.getBlock(xTile, yTile, zTile); + int var19 = worldObj.getBlockMetadata(xTile, yTile, zTile); + + if (var18.equals(Block.getBlockById(inTile)) && var19 == inData) + { + // this.groundImpact(); + // this.setDead(); + } + } else + { + ++ticksInAir; + + if (ticksInAir > 1 && ticksInAir < 3) + { + //worldObj.spawnParticle("flame", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0D, 0D, 0D); + for (int particles = 0; particles < 3; particles++) + { + this.doFiringParticles(); + } + } + + Vec3 var17 = worldObj.getWorldVec3Pool().getVecFromPool(posX, posY, posZ); + Vec3 var3 = worldObj.getWorldVec3Pool().getVecFromPool(posX + motionX, posY + motionY, posZ + motionZ); + MovingObjectPosition var4 = worldObj.func_147447_a(var17, var3, true, false, true); + var17 = worldObj.getWorldVec3Pool().getVecFromPool(posX, posY, posZ); + var3 = worldObj.getWorldVec3Pool().getVecFromPool(posX + motionX, posY + motionY, posZ + motionZ); + + if (var4 != null) + { + var3 = worldObj.getWorldVec3Pool().getVecFromPool(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord); + } + + Entity var5 = null; + List var6 = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D)); + double var7 = 0.0D; + Iterator var9 = var6.iterator(); + float var11; + + while (var9.hasNext()) + { + Entity var10 = (Entity) var9.next(); + + if (var10.canBeCollidedWith() && (var10 != shootingEntity || ticksInAir >= 5)) + { + var11 = 0.3F; + AxisAlignedBB var12 = var10.boundingBox.expand(var11, var11, var11); + MovingObjectPosition var13 = var12.calculateIntercept(var17, var3); + + if (var13 != null) + { + double var14 = var17.distanceTo(var13.hitVec); + + if (var14 < var7 || var7 == 0.0D) + { + var5 = var10; + var7 = var14; + } + } + } + } + + if (var5 != null) + { + var4 = new MovingObjectPosition(var5); + } + + if (var4 != null) + { + this.onImpact(var4); + + if (scheduledForDeath) + { + this.setDead(); + } + } + + posX += motionX; + posY += motionY; + posZ += motionZ; + MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ); + this.setPosition(posX, posY, posZ); + //this.doBlockCollisions(); + } + } + + private void doFlightParticles() { + if (ticksInAir % 3 == 0) { + double gauss = gaussian(1.0F); + worldObj.spawnParticle("mobSpell", posX, posY, posZ, gauss, gauss, 0.0F); + } + } + + private void doFiringParticles() { + worldObj.spawnParticle("mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D); + worldObj.spawnParticle("flame", posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ)); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + @Override + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + par1NBTTagCompound.setShort("xTile", (short)xTile); + par1NBTTagCompound.setShort("yTile", (short)yTile); + par1NBTTagCompound.setShort("zTile", (short)zTile); + par1NBTTagCompound.setByte("inTile", (byte)inTile); + par1NBTTagCompound.setByte("inData", (byte)inData); + par1NBTTagCompound.setByte("inGround", (byte)(inGround ? 1 : 0)); + + NBTTagList effectList = new NBTTagList(); + + for(SpellEffect eff : spellEffectList) + { + effectList.appendTag(eff.getTag()); + } + +// for (String str : this.effectList) +// { +// if (str != null) +// { +// NBTTagCompound tag = new NBTTagCompound(); +// +// tag.setString("Class", str); +// effectList.appendTag(tag); +// } +// } + + par1NBTTagCompound.setTag("Effects", effectList); + par1NBTTagCompound.setInteger("blocksBroken", blocksBroken); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + @Override + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + xTile = par1NBTTagCompound.getShort("xTile"); + yTile = par1NBTTagCompound.getShort("yTile"); + zTile = par1NBTTagCompound.getShort("zTile"); + inTile = par1NBTTagCompound.getByte("inTile") & 255; + inData = par1NBTTagCompound.getByte("inData") & 255; + inGround = par1NBTTagCompound.getByte("inGround") == 1; + blocksBroken = par1NBTTagCompound.getInteger("blocksBroken"); + + NBTTagList tagList = par1NBTTagCompound.getTagList("Effects",Constants.NBT.TAG_COMPOUND); + + List spellEffectList = new LinkedList(); + for (int i = 0; i < tagList.tagCount(); i++) + { + NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); + + SpellEffect eff = SpellEffect.getEffectFromTag(tag); + if(eff!=null) + { + spellEffectList.add(eff); + } + } + this.spellEffectList = spellEffectList; + + +// this.effectList = new LinkedList(); +// for (int i = 0; i < tagList.tagCount(); i++) +// { +// NBTTagCompound tag = (NBTTagCompound) tagList.tagAt(i); +// +// this.effectList.add(tag.getString("Class")); +// } + + //SpellParadigmProjectile parad = SpellParadigmProjectile.getParadigmForStringArray(effectList); + SpellParadigmProjectile parad = SpellParadigmProjectile.getParadigmForEffectArray(spellEffectList); + parad.applyAllSpellEffects(); + parad.prepareProjectile(this); + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they + * walk on. used for spiders and wolves to prevent them from trampling crops + */ + @Override + protected boolean canTriggerWalking() { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public float getShadowSize() { + return 0.0F; + } + + /** + * Sets the amount of knockback the arrow applies when it hits a mob. + */ + public void setKnockbackStrength(int par1) { + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ + @Override + public boolean canAttackWithItem() { + return false; + } + + /** + * Whether the arrow has a stream of critical hit particles flying behind + * it. + */ + public void setIsCritical(boolean par1) { + byte var2 = dataWatcher.getWatchableObjectByte(16); + if (par1) { + dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 1))); + } else { + dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -2))); + } + } + + /** + * Whether the arrow has a stream of critical hit particles flying behind + * it. + */ + public boolean getIsCritical() { + byte var1 = dataWatcher.getWatchableObjectByte(16); + return (var1 & 1) != 0; + } + + private void onImpact(MovingObjectPosition mop) + { + if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null) + { + if (mop.entityHit == shootingEntity) return; + this.onImpact(mop.entityHit); + this.performEntityImpactEffects(mop.entityHit); + } + else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + if(!this.penetration) + { + this.groundImpact(mop.sideHit); + this.performTileImpactEffects(mop); + } + } + } + + private void onImpact(Entity mop) //TODO + { + if (mop == shootingEntity && ticksInAir > 3) + { + shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1); + this.setDead(); + } + else + { + doDamage(this.damage, mop); + } + spawnHitParticles("exorcism", 8); + this.setDead(); + } + + + private void spawnHitParticles(String string, int i) { + for (int particles = 0; particles < i; particles++) { + worldObj.spawnParticle("mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), posGauss(1.0F), posGauss(1.0F), 0.0F); + } + } + + private void doDamage(float f, Entity mop) + { + mop.attackEntityFrom(this.getDamageSource(), f); + } + + private DamageSource getDamageSource() + { + return DamageSource.causePlayerDamage(shootingEntity); + } + + private void groundImpact(int sideHit) { + this.ricochet(sideHit); + } + + private double smallGauss(double d) { + return (worldObj.rand.nextFloat() - 0.5D) * d; + } + + private double posGauss(double d) { + return rand.nextFloat() * 0.5D * d; + } + + private double gaussian(double d) { + return d + d * ((rand.nextFloat() - 0.5D) / 4); + } + + private void ricochet(int sideHit) { + switch (sideHit) { + case 0: + case 1: + // topHit, bottomHit, reflect Y + motionY = motionY * -1; + break; + case 2: + case 3: + // westHit, eastHit, reflect Z + motionZ = motionZ * -1; + break; + case 4: + case 5: + // southHit, northHit, reflect X + motionX = motionX * -1; + break; + } + ricochetCounter++; + if (ricochetCounter > this.getRicochetMax()) { + scheduledForDeath = true; + for (int particles = 0; particles < 4; particles++) { + switch (sideHit) { + case 0: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), -gaussian(0.1D), gaussian(0.1D)); + break; + case 1: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); + break; + case 2: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), -gaussian(0.1D)); + break; + case 3: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); + break; + case 4: + worldObj.spawnParticle("smoke", posX, posY, posZ, -gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); + break; + case 5: + worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); + break; + } + } + } + } + + //Custom stuff + public int getRicochetMax() + { + return this.maxRicochet; + } + + public void setRicochetMax(int ricochet) + { + this.maxRicochet = ricochet; + } + + public void setImpactList(List list) + { + this.impactList = list; + } + + public void setUpdateEffectList(List list) + { + this.updateEffectList = list; + } + + private void performEntityImpactEffects(Entity mop) + { + if(impactList!=null) + { + for(IProjectileImpactEffect impactEffect : impactList) + { + impactEffect.onEntityImpact(mop); + } + } + } + + private void performTileImpactEffects(MovingObjectPosition mop) + { + if(impactList!=null) + { + for(IProjectileImpactEffect impactEffect : impactList) + { + impactEffect.onTileImpact(worldObj, mop); + } + } + } + + private void performUpdateEffects() + { + if(updateEffectList!=null) + { + for(IProjectileUpdateEffect updateEffect : updateEffectList) + { + updateEffect.onUpdateEffect(this); + } + } + } + + public void setPenetration(boolean penetration) + { + this.penetration = penetration; + } + + public float getDamage() + { + return this.damage; + } + + public void setDamage(float damage) + { + this.damage = damage; + } + + public void setSpellEffectList(List list) + { + this.spellEffectList = list; + } + + public int getBlocksBroken() + { + return this.blocksBroken; + } + + public void setBlocksBroken(int blocksBroken) + { + this.blocksBroken = blocksBroken; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifier.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifier.java new file mode 100644 index 00000000..39297530 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifier.java @@ -0,0 +1,21 @@ +package WayofTime.alchemicalWizardry.common.spell.complex; + +public class SpellModifier +{ + public static final int DEFAULT = 0; + public static final int OFFENSIVE = 1; + public static final int DEFENSIVE = 2; + public static final int ENVIRONMENTAL = 3; + + private int modifier; + + protected SpellModifier(int modifier) + { + this.modifier = modifier; + } + + public int getModifier() + { + return this.modifier; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefault.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefault.java new file mode 100644 index 00000000..fd379ae1 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefault.java @@ -0,0 +1,9 @@ +package WayofTime.alchemicalWizardry.common.spell.complex; + +public class SpellModifierDefault extends SpellModifier +{ + public SpellModifierDefault() + { + super(SpellModifier.DEFAULT); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefensive.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefensive.java new file mode 100644 index 00000000..f9f69dbe --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierDefensive.java @@ -0,0 +1,9 @@ +package WayofTime.alchemicalWizardry.common.spell.complex; + +public class SpellModifierDefensive extends SpellModifier +{ + public SpellModifierDefensive() + { + super(SpellModifier.DEFENSIVE); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierEnvironmental.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierEnvironmental.java new file mode 100644 index 00000000..ff9ef7f4 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierEnvironmental.java @@ -0,0 +1,9 @@ +package WayofTime.alchemicalWizardry.common.spell.complex; + +public class SpellModifierEnvironmental extends SpellModifier +{ + public SpellModifierEnvironmental() + { + super(SpellModifier.ENVIRONMENTAL); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierOffensive.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierOffensive.java new file mode 100644 index 00000000..783ab1e3 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellModifierOffensive.java @@ -0,0 +1,9 @@ +package WayofTime.alchemicalWizardry.common.spell.complex; + +public class SpellModifierOffensive extends SpellModifier +{ + public SpellModifierOffensive() + { + super(SpellModifier.OFFENSIVE); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigm.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigm.java new file mode 100644 index 00000000..025d188c --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigm.java @@ -0,0 +1,157 @@ +package WayofTime.alchemicalWizardry.common.spell.complex; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; + +public abstract class SpellParadigm +{ + protected List bufferedEffectList = new ArrayList(); + public List effectList = new LinkedList(); + + public void addBufferedEffect(SpellEffect effect) + { + if(effect!=null) + { + this.bufferedEffectList.add(effect); + + effectList.add(effect.getClass().getName()); + } + } + + public void modifyBufferedEffect(SpellModifier modifier) + { + SpellEffect effect = this.getBufferedEffect(); + if(effect!=null) + { + effect.modifyEffect(modifier); + + effectList.add(modifier.getClass().getName()); + } + } + + public void applyEnhancement(SpellEnhancement enh) + { + if(enh!=null) + { + if(bufferedEffectList.isEmpty()) + { + this.enhanceParadigm(enh); + } + else + { + SpellEffect effect = this.getBufferedEffect(); + if(effect!=null) + { + effect.enhanceEffect(enh); + } + } + + effectList.add(enh.getClass().getName()); + } + + } + + public abstract void enhanceParadigm(SpellEnhancement enh); + public abstract void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack); + + public void applySpellEffect(SpellEffect effect) + { + effect.modifyParadigm(this); + } + + public void applyAllSpellEffects() + { + for(SpellEffect effect : bufferedEffectList) + { + this.applySpellEffect(effect); + } + } + + public SpellEffect getBufferedEffect() + { + if(bufferedEffectList.isEmpty()) + { + return null; + } + else + { + return bufferedEffectList.get(bufferedEffectList.size()-1); + } + } + + public int getTotalCost() + { + int cost = 0; + if(this.bufferedEffectList!=null && !this.bufferedEffectList.isEmpty()) + { + if(this instanceof SpellParadigmProjectile) + { + for(SpellEffect effect : bufferedEffectList) + { + cost+=effect.getCostForProjectile(); + } + }else if(this instanceof SpellParadigmSelf) + { + for(SpellEffect effect : bufferedEffectList) + { + cost+=effect.getCostForSelf(); + } + }else if(this instanceof SpellParadigmMelee) + { + for(SpellEffect effect : bufferedEffectList) + { + cost+=effect.getCostForMelee(); + } + } + + return (int)(cost*Math.sqrt(this.bufferedEffectList.size())); + } + + return getDefaultCost(); + } + + public abstract int getDefaultCost(); + + public int getBufferedEffectPower() + { + SpellEffect eff = this.getBufferedEffect(); + + if(eff!=null) + { + return eff.getPowerEnhancements(); + } + + return 0; + } + + public int getBufferedEffectCost() + { + SpellEffect eff = this.getBufferedEffect(); + + if(eff!=null) + { + return eff.getCostEnhancements(); + } + + return 0; + } + + public int getBufferedEffectPotency() + { + SpellEffect eff = this.getBufferedEffect(); + + if(eff!=null) + { + return eff.getPotencyEnhancements(); + } + + return 0; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmMelee.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmMelee.java new file mode 100644 index 00000000..b1cac7de --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmMelee.java @@ -0,0 +1,70 @@ +package WayofTime.alchemicalWizardry.common.spell.complex; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IMeleeSpellEntityEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IMeleeSpellWorldEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; + +public class SpellParadigmMelee extends SpellParadigm +{ + private List entityEffectList; + private List worldEffectList; + + public SpellParadigmMelee() + { + this.entityEffectList = new ArrayList(); + this.worldEffectList = new ArrayList(); + } + + @Override + public void enhanceParadigm(SpellEnhancement enh) + { + + } + + @Override + public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack) + { + for(IMeleeSpellEntityEffect effect : entityEffectList) + { + effect.onEntityImpact(world, entityPlayer); + } + + for(IMeleeSpellWorldEffect effect : worldEffectList) + { + effect.onWorldEffect(world, entityPlayer); + } + + int cost = this.getTotalCost(); + + EnergyItems.syphonBatteries(itemStack, entityPlayer, cost); + } + + public void addEntityEffect(IMeleeSpellEntityEffect eff) + { + if(eff!=null) + { + this.entityEffectList.add(eff); + } + } + + public void addWorldEffect(IMeleeSpellWorldEffect eff) + { + if(eff!=null) + { + this.worldEffectList.add(eff); + } + } + + @Override + public int getDefaultCost() + { + return 0; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmProjectile.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmProjectile.java new file mode 100644 index 00000000..7c81d8aa --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmProjectile.java @@ -0,0 +1,99 @@ +package WayofTime.alchemicalWizardry.common.spell.complex; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IProjectileImpactEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IProjectileUpdateEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ProjectileDefaultFire; +import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; + +public class SpellParadigmProjectile extends SpellParadigm +{ + public DamageSource damageSource; + public float damage; + public int cost; + public List impactList; + public List updateEffectList; + public boolean penetration; + public int ricochetMax; + + public SpellParadigmProjectile() + { + this.damageSource = DamageSource.generic; + this.damage = 1; + this.cost = 0; + this.impactList = new ArrayList(); + this.updateEffectList = new ArrayList(); + this.penetration = false; + this.ricochetMax = 0; + } + + @Override + public void enhanceParadigm(SpellEnhancement enh) + { + + } + + @Override + public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack) + { + EntitySpellProjectile proj = new EntitySpellProjectile(world, entityPlayer); + this.prepareProjectile(proj); + world.spawnEntityInWorld(proj); + int cost = this.getTotalCost(); + + EnergyItems.syphonBatteries(itemStack, entityPlayer, cost); + } + + public static SpellParadigmProjectile getParadigmForEffectArray(List effectList) + { + SpellParadigmProjectile parad = new SpellParadigmProjectile(); + + for(SpellEffect eff : effectList) + { + parad.addBufferedEffect(eff); + } + + return parad; + } + + public void prepareProjectile(EntitySpellProjectile proj) + { + proj.setDamage(damage); + proj.setImpactList(impactList); + proj.setUpdateEffectList(updateEffectList); + proj.setPenetration(penetration); + proj.setRicochetMax(ricochetMax); + proj.setSpellEffectList(bufferedEffectList); + } + + public void addImpactEffect(IProjectileImpactEffect eff) + { + if(eff!=null) + { + this.impactList.add(eff); + } + } + + public void addUpdateEffect(IProjectileUpdateEffect eff) + { + if(eff!=null) + { + this.updateEffectList.add(eff); + } + } + + @Override + public int getDefaultCost() + { + return 50; + } + +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmSelf.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmSelf.java new file mode 100644 index 00000000..94a7186a --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmSelf.java @@ -0,0 +1,58 @@ +package WayofTime.alchemicalWizardry.common.spell.complex; + +import java.util.ArrayList; +import java.util.List; + +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ISelfSpellEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class SpellParadigmSelf extends SpellParadigm +{ + public List selfSpellEffectList; + + public SpellParadigmSelf() + { + selfSpellEffectList = new ArrayList(); + } + + @Override + public void enhanceParadigm(SpellEnhancement enh) + { + + } + + @Override + public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack) + { + this.applyAllSpellEffects(); + + for(ISelfSpellEffect eff : selfSpellEffectList) + { + eff.onSelfUse(world, entityPlayer); + } + + int cost = this.getTotalCost(); + + EnergyItems.syphonBatteries(itemStack, entityPlayer, cost); + } + + public void addSelfSpellEffect(ISelfSpellEffect eff) + { + if(eff!=null) + { + this.selfSpellEffectList.add(eff); + } + } + + @Override + public int getDefaultCost() + { + return 100; + } + +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffect.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffect.java new file mode 100644 index 00000000..7a090649 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffect.java @@ -0,0 +1,221 @@ +package WayofTime.alchemicalWizardry.common.spell.complex.effect; + +import net.minecraft.nbt.NBTTagCompound; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellModifier; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigm; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf; +import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; + +public abstract class SpellEffect +{ + protected int modifierState; + protected int powerEnhancement; + protected int costEnhancement; + protected int potencyEnhancement; + + public SpellEffect() + { + this.modifierState = SpellModifier.DEFAULT; + this.powerEnhancement = 0; + this.costEnhancement = 0; + this.potencyEnhancement = 0; + } + + public void enhanceEffect(SpellEnhancement enh) + { + if(enh!=null) + { + switch(enh.getState()) + { + case SpellEnhancement.POWER: this.powerEnhancement++; break; + case SpellEnhancement.EFFICIENCY: this.costEnhancement++; break; + case SpellEnhancement.POTENCY: this.potencyEnhancement++; break; + } + } + } + + public void modifyEffect(SpellModifier mod) + { + if(mod!=null) + modifierState = mod.getModifier(); + } + + public void modifyParadigm(SpellParadigm parad) + { + if(parad instanceof SpellParadigmProjectile) + { + this.modifyProjectileParadigm((SpellParadigmProjectile)parad); + } + if(parad instanceof SpellParadigmSelf) + { + this.modifySelfParadigm((SpellParadigmSelf)parad); + } + if(parad instanceof SpellParadigmMelee) + { + this.modifyMeleeParadigm((SpellParadigmMelee)parad); + } + } + + public void modifyProjectileParadigm(SpellParadigmProjectile parad) + { + switch(modifierState) + { + case SpellModifier.DEFAULT: this.defaultModificationProjectile(parad); break; + case SpellModifier.OFFENSIVE: this.offensiveModificationProjectile(parad); break; + case SpellModifier.DEFENSIVE: this.defensiveModificationProjectile(parad); break; + case SpellModifier.ENVIRONMENTAL: this.environmentalModificationProjectile(parad); break; + } + } + + public abstract void defaultModificationProjectile(SpellParadigmProjectile parad); + public abstract void offensiveModificationProjectile(SpellParadigmProjectile parad); + public abstract void defensiveModificationProjectile(SpellParadigmProjectile parad); + public abstract void environmentalModificationProjectile(SpellParadigmProjectile parad); + + public void modifySelfParadigm(SpellParadigmSelf parad) + { + switch(modifierState) + { + case SpellModifier.DEFAULT: this.defaultModificationSelf(parad); break; + case SpellModifier.OFFENSIVE: this.offensiveModificationSelf(parad); break; + case SpellModifier.DEFENSIVE: this.defensiveModificationSelf(parad); break; + case SpellModifier.ENVIRONMENTAL: this.environmentalModificationSelf(parad); break; + } + } + + public abstract void defaultModificationSelf(SpellParadigmSelf parad); + public abstract void offensiveModificationSelf(SpellParadigmSelf parad); + public abstract void defensiveModificationSelf(SpellParadigmSelf parad); + public abstract void environmentalModificationSelf(SpellParadigmSelf parad); + + public void modifyMeleeParadigm(SpellParadigmMelee parad) + { + switch(modifierState) + { + case SpellModifier.DEFAULT: this.defaultModificationMelee(parad); break; + case SpellModifier.OFFENSIVE: this.offensiveModificationMelee(parad); break; + case SpellModifier.DEFENSIVE: this.defensiveModificationMelee(parad); break; + case SpellModifier.ENVIRONMENTAL: this.environmentalModificationMelee(parad); break; + } + } + + public abstract void defaultModificationMelee(SpellParadigmMelee parad); + public abstract void offensiveModificationMelee(SpellParadigmMelee parad); + public abstract void defensiveModificationMelee(SpellParadigmMelee parad); + public abstract void environmentalModificationMelee(SpellParadigmMelee parad); + + public int getCostForProjectile() + { + switch(this.modifierState) + { + case SpellModifier.DEFAULT: return this.getCostForDefaultProjectile(); + case SpellModifier.OFFENSIVE: return this.getCostForOffenseProjectile(); + case SpellModifier.DEFENSIVE: return this.getCostForDefenseProjectile(); + case SpellModifier.ENVIRONMENTAL: return this.getCostForEnvironmentProjectile(); + } + return 0; + } + + protected abstract int getCostForDefaultProjectile(); + protected abstract int getCostForOffenseProjectile(); + protected abstract int getCostForDefenseProjectile(); + protected abstract int getCostForEnvironmentProjectile(); + + public int getCostForSelf() + { + switch(this.modifierState) + { + case SpellModifier.DEFAULT: return this.getCostForDefaultSelf(); + case SpellModifier.OFFENSIVE: return this.getCostForOffenseSelf(); + case SpellModifier.DEFENSIVE: return this.getCostForDefenseSelf(); + case SpellModifier.ENVIRONMENTAL: return this.getCostForEnvironmentSelf(); + } + return 0; + } + + protected abstract int getCostForDefaultSelf(); + protected abstract int getCostForOffenseSelf(); + protected abstract int getCostForDefenseSelf(); + protected abstract int getCostForEnvironmentSelf(); + + public int getCostForMelee() + { + switch(this.modifierState) + { + case SpellModifier.DEFAULT: return this.getCostForDefaultMelee(); + case SpellModifier.OFFENSIVE: return this.getCostForOffenseMelee(); + case SpellModifier.DEFENSIVE: return this.getCostForDefenseMelee(); + case SpellModifier.ENVIRONMENTAL: return this.getCostForEnvironmentMelee(); + } + return 0; + } + + protected abstract int getCostForDefaultMelee(); + protected abstract int getCostForOffenseMelee(); + protected abstract int getCostForDefenseMelee(); + protected abstract int getCostForEnvironmentMelee(); + + public int getPowerEnhancements() + { + return this.powerEnhancement; + } + + public int getCostEnhancements() + { + return this.costEnhancement; + } + + public int getPotencyEnhancements() + { + return this.potencyEnhancement; + } + + public NBTTagCompound getTag() + { + NBTTagCompound tag = new NBTTagCompound(); + + tag.setString("Class", this.getClass().getName()); + tag.setInteger("modifier", modifierState); + tag.setInteger("power", powerEnhancement); + tag.setInteger("cost", costEnhancement); + tag.setInteger("potency", potencyEnhancement); + + return tag; + } + + public static SpellEffect getEffectFromTag(NBTTagCompound tag) + { + try { + Class clazz = Class.forName(tag.getString("Class")); + if(clazz !=null) + { + try { + Object obj = clazz.newInstance(); + if(obj instanceof SpellEffect) + { + SpellEffect eff = (SpellEffect) obj; + + eff.modifierState = tag.getInteger("modifier"); + eff.powerEnhancement = tag.getInteger("power"); + eff.costEnhancement = tag.getInteger("cost"); + eff.potencyEnhancement = tag.getInteger("potency"); + + return eff; + } + } catch (InstantiationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalAccessException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } catch (ClassNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return null; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectEarth.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectEarth.java new file mode 100644 index 00000000..ee98c2d2 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectEarth.java @@ -0,0 +1,176 @@ +package WayofTime.alchemicalWizardry.common.spell.complex.effect; + +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf; + +public class SpellEffectEarth extends SpellEffect +{ + @Override + public void defaultModificationProjectile(SpellParadigmProjectile parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void offensiveModificationProjectile(SpellParadigmProjectile parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void defensiveModificationProjectile(SpellParadigmProjectile parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void environmentalModificationProjectile(SpellParadigmProjectile parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void defaultModificationSelf(SpellParadigmSelf parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void offensiveModificationSelf(SpellParadigmSelf parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void defensiveModificationSelf(SpellParadigmSelf parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void environmentalModificationSelf(SpellParadigmSelf parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void defaultModificationMelee(SpellParadigmMelee parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void offensiveModificationMelee(SpellParadigmMelee parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void defensiveModificationMelee(SpellParadigmMelee parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void environmentalModificationMelee(SpellParadigmMelee parad) + { + // TODO Auto-generated method stub + + } + + @Override + protected int getCostForDefaultProjectile() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForOffenseProjectile() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForDefenseProjectile() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForEnvironmentProjectile() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForDefaultSelf() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForOffenseSelf() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForDefenseSelf() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForEnvironmentSelf() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForDefaultMelee() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForOffenseMelee() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForDefenseMelee() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForEnvironmentMelee() + { + // TODO Auto-generated method stub + return 0; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectFire.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectFire.java new file mode 100644 index 00000000..65fe51f7 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectFire.java @@ -0,0 +1,178 @@ +package WayofTime.alchemicalWizardry.common.spell.complex.effect; + +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ProjectileDefaultFire; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfDefaultFire; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfDefensiveFire; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfEnvironmentalFire; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfOffensiveFire; + +public class SpellEffectFire extends SpellEffect +{ + @Override + public void defaultModificationProjectile(SpellParadigmProjectile parad) + { + parad.addImpactEffect(new ProjectileDefaultFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + parad.damage+=this.potencyEnhancement; + } + + @Override + public void offensiveModificationProjectile(SpellParadigmProjectile parad) + { + // TODO Auto-generated method stub + parad.addImpactEffect(new ProjectileDefaultFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + parad.damage+=this.potencyEnhancement; + } + + @Override + public void defensiveModificationProjectile(SpellParadigmProjectile parad) + { + // TODO Auto-generated method stub + parad.addImpactEffect(new ProjectileDefaultFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + parad.damage+=this.potencyEnhancement; + } + + @Override + public void environmentalModificationProjectile(SpellParadigmProjectile parad) + { + // TODO Auto-generated method stub + parad.addImpactEffect(new ProjectileDefaultFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + parad.damage+=this.potencyEnhancement; + } + + @Override + public void defaultModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfDefaultFire(powerEnhancement, potencyEnhancement, costEnhancement)); + } + + @Override + public void offensiveModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfOffensiveFire(powerEnhancement,potencyEnhancement,costEnhancement)); + } + + @Override + public void defensiveModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfDefensiveFire(powerEnhancement,potencyEnhancement,costEnhancement)); + } + + @Override + public void environmentalModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfEnvironmentalFire(powerEnhancement, potencyEnhancement, costEnhancement)); + } + + @Override + public void defaultModificationMelee(SpellParadigmMelee parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void offensiveModificationMelee(SpellParadigmMelee parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void defensiveModificationMelee(SpellParadigmMelee parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void environmentalModificationMelee(SpellParadigmMelee parad) + { + // TODO Auto-generated method stub + + } + + @Override + protected int getCostForDefaultProjectile() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForOffenseProjectile() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForDefenseProjectile() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForEnvironmentProjectile() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForDefaultSelf() + { + return 10*(int)(10*Math.pow(1.5, this.powerEnhancement+1.5*this.potencyEnhancement)); + } + + @Override + protected int getCostForOffenseSelf() + { + return 500*(int)((this.powerEnhancement+1)*Math.pow(2, potencyEnhancement)); + } + + @Override + protected int getCostForDefenseSelf() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForEnvironmentSelf() + { + return (int) ((15*Math.pow(1.7, powerEnhancement)+10*Math.pow(potencyEnhancement,1.8))*Math.pow(0.8, costEnhancement)); + } + + @Override + protected int getCostForDefaultMelee() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForOffenseMelee() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForDefenseMelee() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForEnvironmentMelee() + { + // TODO Auto-generated method stub + return 0; + } + +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectIce.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectIce.java new file mode 100644 index 00000000..f11d92b0 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectIce.java @@ -0,0 +1,167 @@ +package WayofTime.alchemicalWizardry.common.spell.complex.effect; + +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.MeleeDefaultIce; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.MeleeDefensiveIce; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.MeleeEnvironmentalIce; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.MeleeOffensiveIce; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.ProjectileDefaultIce; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.ProjectileDefensiveIce; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.ProjectileEnvironmentalIce; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.ProjectileOffensiveIce; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.SelfDefaultIce; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.SelfDefensiveIce; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.SelfEnvironmentalIce; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.SelfOffensiveIce; + +public class SpellEffectIce extends SpellEffect +{ + @Override + public void defaultModificationProjectile(SpellParadigmProjectile parad) + { + parad.damage+=this.potencyEnhancement; + parad.addImpactEffect(new ProjectileDefaultIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + } + + @Override + public void offensiveModificationProjectile(SpellParadigmProjectile parad) + { + parad.damage+=2; + parad.addImpactEffect(new ProjectileOffensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + } + + @Override + public void defensiveModificationProjectile(SpellParadigmProjectile parad) + { + parad.addImpactEffect(new ProjectileDefensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + + } + + @Override + public void environmentalModificationProjectile(SpellParadigmProjectile parad) + { + parad.addUpdateEffect(new ProjectileEnvironmentalIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + } + + @Override + public void defaultModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfDefaultIce(this.powerEnhancement,this.potencyEnhancement, this.costEnhancement)); + } + + @Override + public void offensiveModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfOffensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + } + + @Override + public void defensiveModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfDefensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + } + + @Override + public void environmentalModificationSelf(SpellParadigmSelf parad) + { + parad.addSelfSpellEffect(new SelfEnvironmentalIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + } + + @Override + public void defaultModificationMelee(SpellParadigmMelee parad) + { + parad.addEntityEffect(new MeleeDefaultIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + } + + @Override + public void offensiveModificationMelee(SpellParadigmMelee parad) + { + parad.addEntityEffect(new MeleeOffensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + } + + @Override + public void defensiveModificationMelee(SpellParadigmMelee parad) + { + parad.addWorldEffect(new MeleeDefensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + } + + @Override + public void environmentalModificationMelee(SpellParadigmMelee parad) + { + parad.addEntityEffect(new MeleeEnvironmentalIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + } + + @Override + protected int getCostForDefaultProjectile() + { + return (int)((30)*(this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement)); + } + + @Override + protected int getCostForOffenseProjectile() + { + return (int)((60)*(this.powerEnhancement+1)*(3*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement)); + } + + @Override + protected int getCostForDefenseProjectile() + { + return (int)(75*(2*this.powerEnhancement+1)*(this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement)); + } + + @Override + protected int getCostForEnvironmentProjectile() + { + return (int)(200*(2*this.powerEnhancement+1)*(2*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement)); + } + + @Override + protected int getCostForDefaultSelf() + { + return (int)(20*(this.powerEnhancement+1)*Math.pow(0.85, costEnhancement)); + } + + @Override + protected int getCostForOffenseSelf() + { + return (int)(100*(2*this.powerEnhancement+1)*(2*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement)); + } + + @Override + protected int getCostForDefenseSelf() + { + return (int)(200*(3*powerEnhancement+1)*(2*potencyEnhancement + 1)*Math.pow(0.85, costEnhancement)); + } + + @Override + protected int getCostForEnvironmentSelf() + { + return (int)(10*(1.5*potencyEnhancement+1)*(3*powerEnhancement+1)*Math.pow(0.85, costEnhancement)); + } + + @Override + protected int getCostForDefaultMelee() + { + return (int)(250*(potencyEnhancement+1)*(1.5*powerEnhancement+1)*Math.pow(0.85, costEnhancement)); + } + + @Override + protected int getCostForOffenseMelee() + { + return (int)(40*(1.5*potencyEnhancement+1)*Math.pow(1.5, powerEnhancement)*Math.pow(0.85, costEnhancement)); + } + + @Override + protected int getCostForDefenseMelee() + { + return (int)(50*(0.5*potencyEnhancement+1)*(0.7*powerEnhancement+1)*(0.5*powerEnhancement+1)*Math.pow(0.85, costEnhancement)); + } + + @Override + protected int getCostForEnvironmentMelee() + { + return (int)(20*(0.5*potencyEnhancement+1)*(0*powerEnhancement+1)*Math.pow(0.85, costEnhancement)); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectWind.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectWind.java new file mode 100644 index 00000000..0b9f2623 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectWind.java @@ -0,0 +1,176 @@ +package WayofTime.alchemicalWizardry.common.spell.complex.effect; + +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf; + +public class SpellEffectWind extends SpellEffect +{ + @Override + public void defaultModificationProjectile(SpellParadigmProjectile parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void offensiveModificationProjectile(SpellParadigmProjectile parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void defensiveModificationProjectile(SpellParadigmProjectile parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void environmentalModificationProjectile(SpellParadigmProjectile parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void defaultModificationSelf(SpellParadigmSelf parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void offensiveModificationSelf(SpellParadigmSelf parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void defensiveModificationSelf(SpellParadigmSelf parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void environmentalModificationSelf(SpellParadigmSelf parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void defaultModificationMelee(SpellParadigmMelee parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void offensiveModificationMelee(SpellParadigmMelee parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void defensiveModificationMelee(SpellParadigmMelee parad) + { + // TODO Auto-generated method stub + + } + + @Override + public void environmentalModificationMelee(SpellParadigmMelee parad) + { + // TODO Auto-generated method stub + + } + + @Override + protected int getCostForDefaultProjectile() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForOffenseProjectile() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForDefenseProjectile() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForEnvironmentProjectile() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForDefaultSelf() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForOffenseSelf() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForDefenseSelf() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForEnvironmentSelf() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForDefaultMelee() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForOffenseMelee() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForDefenseMelee() + { + // TODO Auto-generated method stub + return 0; + } + + @Override + protected int getCostForEnvironmentMelee() + { + // TODO Auto-generated method stub + return 0; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java new file mode 100644 index 00000000..152493f8 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java @@ -0,0 +1,184 @@ +package WayofTime.alchemicalWizardry.common.spell.complex.effect; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.WorldProvider; +import net.minecraftforge.common.util.ForgeDirection; + +public class SpellHelper +{ + public static Random rand = new Random(); + public static final double root2 = Math.sqrt(2); + + public static void smeltBlockInWorld(World world, int posX, int posY, int posZ) + { + FurnaceRecipes recipes = FurnaceRecipes.smelting(); + + Block block = world.getBlock(posX, posY, posZ); + if(block==null) + { + return; + } + + int meta = world.getBlockMetadata(posX, posY, posZ); + + ItemStack smeltedStack = recipes.getSmeltingResult(new ItemStack(block,1,meta)); + if(smeltedStack!=null && smeltedStack.getItem() instanceof ItemBlock) + { + world.setBlock(posX, posY, posZ, ((ItemBlock)(smeltedStack.getItem())).field_150939_a, smeltedStack.getItemDamage(), 3); + } + } + + public static List getEntitiesInRange(World world, double posX, double posY, double posZ, double horizontalRadius, double verticalRadius) + { + return world.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(posX-0.5f, posY-0.5f, posZ-0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(horizontalRadius, verticalRadius, horizontalRadius)); + } + + public static List getPlayersInRange(World world, double posX, double posY, double posZ, double horizontalRadius, double verticalRadius) + { + return world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(posX-0.5f, posY-0.5f, posZ-0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(horizontalRadius, verticalRadius, horizontalRadius)); + } + + public static double gaussian(double d) + { + return d * ((rand.nextFloat() - 0.5D)); + } + + public static Vec3 getEntityBlockVector(Entity entity) + { + int posX = (int) Math.round(entity.posX - 0.5f); + int posY = (int) entity.posY; + int posZ = (int) Math.round(entity.posZ - 0.5f); + + return entity.getLookVec().createVectorHelper(posX, posY, posZ); + } + + public static ForgeDirection getDirectionForLookVector(Vec3 lookVec) + { + double distance = lookVec.lengthVector(); + + if(lookVec.yCoord>distance*0.9) + { + return ForgeDirection.UP; + } + if(lookVec.yCoordradius*1/root2) + { + return ForgeDirection.SOUTH; + } + if(lookVec.zCoord<-radius*1/root2) + { + return ForgeDirection.NORTH; + } + if(lookVec.xCoord>radius*1/root2) + { + return ForgeDirection.EAST; + } + if(lookVec.xCoord<-radius*1/root2) + { + return ForgeDirection.WEST; + } + + return ForgeDirection.EAST; + } + + public static void freezeWaterBlock(World world, int posX, int posY, int posZ) + { + Block block = world.getBlock(posX, posY, posZ); + + if(block == Blocks.water || block == Blocks.flowing_water) + { + world.setBlock(posX, posY, posZ, Blocks.ice); + } + } + + public static String getUsername(EntityPlayer player) + { + return player.getDisplayName(); + } + + public static void sendParticleToPlayer(EntityPlayer player, String str, double xCoord, double yCoord, double zCoord, double xVel, double yVel, double zVel) + { + + } + + public static void sendIndexedParticleToPlayer(EntityPlayer player, int index, double xCoord, double yCoord, double zCoord) + { + switch(index) + { + case 1: + SpellHelper.sendParticleToPlayer(player, "mobSpell", xCoord + 0.5D + rand.nextGaussian() / 8, yCoord + 1.1D, zCoord + 0.5D + rand.nextGaussian() / 8, 0.5117D, 0.0117D, 0.0117D); + case 2: + SpellHelper.sendParticleToPlayer(player, "reddust", xCoord + 0.5D + rand.nextGaussian() / 8, yCoord + 1.1D, zCoord + 0.5D + rand.nextGaussian() / 8, 0.82D, 0.941D, 0.91D); + case 3: + SpellHelper.sendParticleToPlayer(player, "mobSpell", xCoord + 0.5D + rand.nextGaussian() / 8, yCoord + 1.1D, zCoord + 0.5D + rand.nextGaussian() / 8, 1.0D, 0.371D, 0.371D); + case 4: + float f = (float) 1.0F; + float f1 = f * 0.6F + 0.4F; + float f2 = f * f * 0.7F - 0.5F; + float f3 = f * f * 0.6F - 0.7F; + + for (int l = 0; l < 8; ++l) + { + SpellHelper.sendParticleToPlayer(player,"reddust", xCoord + Math.random() - Math.random(), yCoord + Math.random() - Math.random(), zCoord + Math.random() - Math.random(), f1, f2, f3); + } + } + } + + public static void sendParticleToAllAround(World world, double xPos, double yPos, double zPos, int radius, int dimension, String str, double xCoord, double yCoord, double zCoord, double xVel, double yVel, double zVel) + { + List entities = SpellHelper.getPlayersInRange(world, xPos, yPos, zPos, radius, radius); + + if(entities==null) + { + return; + } + + for(EntityPlayer player : entities) + { + SpellHelper.sendParticleToPlayer(player, str, xCoord, yCoord, zCoord, xVel, yVel, zVel); + } + } + + public static void sendIndexedParticleToAllAround(World world, double xPos, double yPos, double zPos, int radius, int dimension, int index, double xCoord, double yCoord, double zCoord) + { + List entities = SpellHelper.getPlayersInRange(world, xPos, yPos, zPos, radius, radius); + + if(entities==null) + { + return; + } + + for(EntityPlayer player : entities) + { + SpellHelper.sendIndexedParticleToPlayer(player, index, xCoord, yCoord, zCoord); + } + } + + public static void setPlayerSpeedFromServer(EntityPlayer player, double motionX, double motionY, double motionZ) + { + + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ExtrapolatedMeleeEntityEffect.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ExtrapolatedMeleeEntityEffect.java new file mode 100644 index 00000000..aca6b077 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ExtrapolatedMeleeEntityEffect.java @@ -0,0 +1,74 @@ +package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects; + +import java.util.List; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public abstract class ExtrapolatedMeleeEntityEffect implements IMeleeSpellEntityEffect +{ + protected float range; + protected float radius; + protected int powerUpgrades; + protected int potencyUpgrades; + protected int costUpgrades; + protected int maxHit; + + public ExtrapolatedMeleeEntityEffect(int power, int potency, int cost) + { + this.powerUpgrades = power; + this.potencyUpgrades = potency; + this.costUpgrades = cost; + this.range = 0; + this.radius = 0; + this.maxHit = 1; + } + + @Override + public void onEntityImpact(World world, EntityPlayer entityPlayer) + { + Vec3 lookVec = entityPlayer.getLook(range); + double x = entityPlayer.posX + lookVec.xCoord; + double y = entityPlayer.posY + entityPlayer.getEyeHeight() + lookVec.yCoord; + double z = entityPlayer.posZ + lookVec.zCoord; + + List entities = world.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(x-0.5f, y-0.5f, z-0.5f, x + 0.5f, y + 0.5f, z + 0.5f).expand(radius, radius, radius)); + int hit = 0; + + if(entities!=null) + { + for(Entity entity : entities) + { + if(hit0) + { + entity.hurtResistantTime = Math.max(0, -(potencyUpgrades+1)+entity.hurtResistantTime); + } + + return true; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeDefensiveIce.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeDefensiveIce.java new file mode 100644 index 00000000..03471ca7 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ice/MeleeDefensiveIce.java @@ -0,0 +1,48 @@ +package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellWorldEffect; + +public class MeleeDefensiveIce extends MeleeSpellWorldEffect +{ + public MeleeDefensiveIce(int power, int potency, int cost) + { + super(power, potency, cost); + } + + @Override + public void onWorldEffect(World world, EntityPlayer entityPlayer) + { + ForgeDirection look = SpellHelper.getCompassDirectionForLookVector(entityPlayer.getLookVec()); + + int width = this.powerUpgrades; + int height = this.powerUpgrades + 2; + + int xOffset = look.offsetX; + int zOffset = look.offsetZ; + + int range = this.potencyUpgrades + 1; + + Vec3 lookVec = SpellHelper.getEntityBlockVector(entityPlayer); + + int xStart = (int)(lookVec.xCoord) + range * xOffset; + int zStart = (int)(lookVec.zCoord) + range * zOffset; + int yStart = (int)(lookVec.yCoord); + + for(int i=-width; i<=width; i++) + { + for(int j=0; j entities = SpellHelper.getEntitiesInRange(world, player.posX, player.posY, player.posZ,horizRadius, vertRadius); + + if(entities==null) + { + return; + } + + int i=0; + int number = this.powerUpgrades+1; + + for(Entity entity : entities) + { + if(i>=number) + { + continue; + } + + if(entity instanceof EntityLivingBase && !entity.equals(player)) + { + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id,60*(1+this.powerUpgrades),this.potencyUpgrades)); + + i++; + } + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancement.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancement.java new file mode 100644 index 00000000..b17c5659 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancement.java @@ -0,0 +1,20 @@ +package WayofTime.alchemicalWizardry.common.spell.complex.enhancement; + +public class SpellEnhancement +{ + public static final int POWER = 0; + public static final int EFFICIENCY = 1; + public static final int POTENCY = 2; + + private int state = this.POWER; + + protected SpellEnhancement(int state) + { + this.state = state; + } + + public int getState() + { + return this.state; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementCost.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementCost.java new file mode 100644 index 00000000..2e0df1fb --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementCost.java @@ -0,0 +1,10 @@ +package WayofTime.alchemicalWizardry.common.spell.complex.enhancement; + +public class SpellEnhancementCost extends SpellEnhancement +{ + + public SpellEnhancementCost() + { + super(SpellEnhancement.EFFICIENCY); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementPotency.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementPotency.java new file mode 100644 index 00000000..6231c8a7 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementPotency.java @@ -0,0 +1,10 @@ +package WayofTime.alchemicalWizardry.common.spell.complex.enhancement; + +public class SpellEnhancementPotency extends SpellEnhancement +{ + public SpellEnhancementPotency() + { + super(SpellEnhancement.POTENCY); + } + +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementPower.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementPower.java new file mode 100644 index 00000000..527dfe46 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/complex/enhancement/SpellEnhancementPower.java @@ -0,0 +1,10 @@ +package WayofTime.alchemicalWizardry.common.spell.complex.enhancement; + +public class SpellEnhancementPower extends SpellEnhancement +{ + + public SpellEnhancementPower() + { + super(SpellEnhancement.POWER); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpell.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpell.java new file mode 100644 index 00000000..903f4fb9 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpell.java @@ -0,0 +1,143 @@ +package WayofTime.alchemicalWizardry.common.spell.simple; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public abstract class HomSpell implements ISimpleSpell +{ + private int offensiveRangedEnergy; + private int offensiveMeleeEnergy; + private int defensiveEnergy; + private int environmentalEnergy; + + public HomSpell() + { + //super(id); + //this.setMaxStackSize(1); + // TODO Auto-generated constructor stub + } + + @Override + public abstract ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer); + + ; + + @Override + public abstract ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer); + + @Override + public abstract ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer); + + @Override + public abstract ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer); + + public int getOffensiveRangedEnergy() + { + return offensiveRangedEnergy; + } + + public int getOffensiveMeleeEnergy() + { + return offensiveMeleeEnergy; + } + + public int getDefensiveEnergy() + { + return defensiveEnergy; + } + + public int getEnvironmentalEnergy() + { + return environmentalEnergy; + } + + public void setEnergies(int offensiveRanged, int offensiveMelee, int defensive, int environmental) + { + this.offensiveRangedEnergy = offensiveRanged; + this.offensiveMeleeEnergy = offensiveMelee; + this.defensiveEnergy = defensive; + this.environmentalEnergy = environmental; + } + + public void setSpellParadigm(ItemStack itemStack, int paradigm) + { + if (itemStack.stackTagCompound == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + itemStack.stackTagCompound.setInteger("paradigm", paradigm); + } + + public int getSpellParadigm(ItemStack itemStack) + { + if (itemStack.stackTagCompound == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + return (itemStack.stackTagCompound.getInteger("paradigm")); + } + + //@Override + public ItemStack useSpell(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + int paradigm = getSpellParadigm(par1ItemStack); + + if (par3EntityPlayer.isSneaking()) + { + if (paradigm < 3) + { + this.setSpellParadigm(par1ItemStack, paradigm + 1); + } else + { + this.setSpellParadigm(par1ItemStack, 0); + } + + return par1ItemStack; + } + + switch (paradigm) + { + case 0: + return this.onOffensiveRangedRightClick(par1ItemStack, par2World, par3EntityPlayer); + + case 1: + return this.onOffensiveMeleeRightClick(par1ItemStack, par2World, par3EntityPlayer); + + case 2: + return this.onDefensiveRightClick(par1ItemStack, par2World, par3EntityPlayer); + + case 3: + return this.onEnvironmentalRightClick(par1ItemStack, par2World, par3EntityPlayer); + } + + return par1ItemStack; + } + +// @Override +// public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) +// { +// if (!(par1ItemStack.stackTagCompound == null)) +// { +// if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) +// { +// par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); +// } +// +// par3List.add("Current paradigm: " + this.getSpellParadigm(par1ItemStack)); +// } +// } + + public int getDimensionID(ItemStack itemStack) + { + if (itemStack.stackTagCompound == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + return itemStack.stackTagCompound.getInteger("dimensionId"); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpellComponent.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpellComponent.java new file mode 100644 index 00000000..41cfcaab --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpellComponent.java @@ -0,0 +1,26 @@ +package WayofTime.alchemicalWizardry.common.spell.simple; + +import net.minecraft.item.ItemStack; + +public class HomSpellComponent +{ + public HomSpell spell; + public ItemStack item; + public int blockID; + + public HomSpellComponent(ItemStack item, HomSpell spell) + { + this.item = item; + this.spell = spell; + } + + public HomSpell getSpell() + { + return spell; + } + + public ItemStack getItemStack() + { + return this.item; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpellRegistry.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpellRegistry.java new file mode 100644 index 00000000..645bd99c --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/HomSpellRegistry.java @@ -0,0 +1,55 @@ +package WayofTime.alchemicalWizardry.common.spell.simple; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class HomSpellRegistry +{ + public static List spellList = new ArrayList(); + + public static void registerBasicSpell(ItemStack item, HomSpell spell) + { + spellList.add(new HomSpellComponent(item, spell)); + } + + public static HomSpell getSpellForItemStack(ItemStack testItem) + { + if (testItem == null) + { + return null; + } + + for (HomSpellComponent hsc : spellList) + { + ItemStack item = hsc.getItemStack(); + + if (item != null) + { + if (item.getItem() instanceof ItemBlock) + { + if (testItem.getItem() instanceof ItemBlock) + { + if (testItem.getItem() == item.getItem()) + { + return hsc.getSpell(); + } + } + } else + { + if (!(testItem.getItem() instanceof ItemBlock)) + { + if (testItem.getItem() == item.getItem()) + { + return hsc.getSpell(); + } + } + } + } + } + + return null; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/ISimpleSpell.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/ISimpleSpell.java new file mode 100644 index 00000000..77a8799d --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/ISimpleSpell.java @@ -0,0 +1,16 @@ +package WayofTime.alchemicalWizardry.common.spell.simple; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public interface ISimpleSpell +{ + public abstract ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer); + + public abstract ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer); + + public abstract ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer); + + public abstract ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer); +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellEarthBender.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellEarthBender.java new file mode 100644 index 00000000..e4a31e55 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellEarthBender.java @@ -0,0 +1,199 @@ +package WayofTime.alchemicalWizardry.common.spell.simple; + +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 WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.entity.projectile.MudProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class SpellEarthBender extends HomSpell +{ + Random itemRand = new Random(); + + public SpellEarthBender() + { + super(); + this.setEnergies(100, 150, 350, 200); + //this.setCreativeTab(CreativeTabs.tabMisc); + } + + @Override + public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); + } + + par2World.spawnEntityInWorld(new MudProjectile(par2World, par3EntityPlayer, 8, false)); + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + return par1ItemStack; + } + + @Override + public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); + } + + if (!par2World.isRemote) + { + for (int i = -1; i <= 1; i++) + { + for (int j = -1; j <= 1; j++) + { + par2World.spawnEntityInWorld(new MudProjectile(par2World, par3EntityPlayer, 3, 3, par3EntityPlayer.posX, par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight(), par3EntityPlayer.posZ, par3EntityPlayer.rotationYaw + i * 10F, par3EntityPlayer.rotationPitch + j * 5F, true)); + } + } + } + + return par1ItemStack; + } + + @Override + public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); + } + + double xCoord = par3EntityPlayer.posX; + double yCoord = par3EntityPlayer.posY; + double zCoord = par3EntityPlayer.posZ; + int posX = (int) xCoord; + int posY = (int) yCoord; + int posZ = (int) zCoord; + Block blockID = Blocks.stone; + + if (par2World.isAirBlock(posX, posY + 3, posZ)) + { + par2World.setBlock(posX, posY + 3, posZ, Blocks.glass); + } + + for (int i = 0; i < 4; i++) + { + for (int j = 0; j < 4; j++) + { + if (par2World.isAirBlock(posX + i - 1, posY + j, posZ - 2)) + { + par2World.setBlock(posX + i - 1, posY + j, posZ - 2, blockID); + } + + if (par2World.isAirBlock(posX + 2, posY + j, posZ - 1 + i)) + { + par2World.setBlock(posX + 2, posY + j, posZ - 1 + i, blockID); + } + + if (par2World.isAirBlock(posX - i + 1, posY + j, posZ + 2)) + { + par2World.setBlock(posX - i + 1, posY + j, posZ + 2, blockID); + } + + if (par2World.isAirBlock(posX - 2, posY + j, posZ + 1 - i)) + { + par2World.setBlock(posX - 2, posY + j, posZ + 1 - i, blockID); + } + + { + if (par2World.isAirBlock(posX - 1 + i, posY + 3, posZ - 1 + j)) + { + par2World.setBlock(posX - 1 + i, posY + 3, posZ - 1 + j, blockID); + } + } + } + } + + for (int i = 0; i < 20; i++) + { + //PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, PacketHandler.getCustomParticlePacket("mobSpell", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, 0.0F, 0.410F, 1.0F)); + SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "mobSpell", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, 0.0F, 0.410F, 1.0F); + } + + return par1ItemStack; + } + + @Override + public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); + } + + int range = 3; + + if (!par2World.isRemote) + { + for (int i = -range; i <= range; i++) + { + for (int j = -1; j <= 1; j++) + { + for (int k = -range; k <= range; k++) + { + if (par2World.getBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k) == Blocks.water || par2World.getBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k) == Blocks.flowing_water) + { + int x = par2World.rand.nextInt(2); + + if (x == 0) + { + par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k, Blocks.sand); + } else + { + par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k, Blocks.dirt); + } + } + } + } + } + } + + double xCoord = par3EntityPlayer.posX; + double yCoord = par3EntityPlayer.posY; + double zCoord = par3EntityPlayer.posZ; + + for (int i = 0; i < 16; i++) + { + //PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, PacketHandler.getCustomParticlePacket("mobSpell", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, 0.0F, 0.410F, 1.0F)); + SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "mobSpell", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, 0.0F, 0.410F, 1.0F); + } + + return par1ItemStack; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellExplosions.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellExplosions.java new file mode 100644 index 00000000..44ede225 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellExplosions.java @@ -0,0 +1,116 @@ +package WayofTime.alchemicalWizardry.common.spell.simple; + +import WayofTime.alchemicalWizardry.common.entity.projectile.ExplosionProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import java.util.Random; + +public class SpellExplosions extends HomSpell +{ + Random itemRand = new Random(); + + public SpellExplosions() + { + super(); + this.setEnergies(400, 500, 1900, 1500); + //this.setCreativeTab(CreativeTabs.tabMisc); + } + + @Override + public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); + } + + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!par2World.isRemote) + { + //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); + par2World.spawnEntityInWorld(new ExplosionProjectile(par2World, par3EntityPlayer, 6, true)); + } + + return par1ItemStack; + } + + @Override + public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); + } + + int distance = 4; + double yaw = par3EntityPlayer.rotationYaw / 180 * Math.PI; + double pitch = par3EntityPlayer.rotationPitch / 180 * Math.PI; + par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX + Math.sin(yaw) * Math.cos(pitch) * (-distance), par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight() + Math.sin(-pitch) * distance, par3EntityPlayer.posZ + Math.cos(yaw) * Math.cos(pitch) * distance, (float) (3), true); + return par1ItemStack; + } + + @Override + public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); + } + + int distance = 4; +// double yaw = par3EntityPlayer.rotationYaw/180*Math.PI; +// double pitch = par3EntityPlayer.rotationPitch/180*Math.PI; + par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight(), par3EntityPlayer.posZ, (float) (distance), false); + return par1ItemStack; + } + + @Override + public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); + } + + int radius = 3; + + for (int i = 0; i < 360; i += 36) + { + par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX + Math.cos(i) * radius, par3EntityPlayer.posY, par3EntityPlayer.posZ + Math.sin(i) * radius, (float) (2), true); + } + + return null; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFireBurst.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFireBurst.java new file mode 100644 index 00000000..de01a35f --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFireBurst.java @@ -0,0 +1,174 @@ +package WayofTime.alchemicalWizardry.common.spell.simple; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.entity.projectile.FireProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; + +public class SpellFireBurst extends HomSpell +{ + public Random itemRand = new Random(); + + public SpellFireBurst() + { + super(); + this.setEnergies(100, 300, 400, 100); + //this.setCreativeTab(CreativeTabs.tabMisc); + } + + @Override + public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); + } + + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!par2World.isRemote) + { + //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); + par2World.spawnEntityInWorld(new FireProjectile(par2World, par3EntityPlayer, 7)); + } + + return par1ItemStack; + } + + @Override + public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); + } + + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!par2World.isRemote) + { + for (int i = -1; i <= 1; i++) + { + for (int j = -1; j <= 1; j++) + { + par2World.spawnEntityInWorld(new FireProjectile(par2World, par3EntityPlayer, 8, 2, par3EntityPlayer.posX, par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight(), par3EntityPlayer.posZ, par3EntityPlayer.rotationYaw + i * 10F, par3EntityPlayer.rotationPitch + j * 10F)); + } + } + } + + return par1ItemStack; + } + + @Override + public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); + } + + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + int d0 = 2; + AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) par3EntityPlayer.posX, (double) par3EntityPlayer.posY, (double) par3EntityPlayer.posZ, (double) (par3EntityPlayer.posX + 1), (double) (par3EntityPlayer.posY + 2), (double) (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0); + //axisalignedbb.maxY = (double)this.worldObj.getHeight(); + List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + EntityLivingBase entityLiving = (EntityLivingBase) iterator.next(); + + if (entityLiving instanceof EntityPlayer) + { + if (entityLiving.equals(par3EntityPlayer)) + { + continue; + } + } + + entityLiving.setFire(100); + entityLiving.attackEntityFrom(DamageSource.inFire, 2); + } + +// if (!par2World.isRemote) +// { +// +// for(int i=0;i<10;i++) +// { +// for(int j=0;j<5;j++) +// { +// par2World.spawnEntityInWorld(new FireProjectile(par2World, par3EntityPlayer, 10,5,par3EntityPlayer.posX,par3EntityPlayer.posY+par3EntityPlayer.getEyeHeight(),par3EntityPlayer.posZ, par3EntityPlayer.rotationYaw+i*36F,par3EntityPlayer.rotationPitch+j*72F)); +// } +// } +// } + return par1ItemStack; + } + + @Override + public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); + } + + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + World worldObj = par2World; + + for (int i = -1; i <= 1; i++) + { + for (int j = -1; j <= 1; j++) + { + for (int k = -1; k <= 1; k++) + { + if (worldObj.isAirBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k)) + { + if (worldObj.rand.nextFloat() < 0.8F) + { + worldObj.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k, Blocks.fire); + } + } + } + } + } + + return par1ItemStack; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFrozenWater.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFrozenWater.java new file mode 100644 index 00000000..bfa441eb --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellFrozenWater.java @@ -0,0 +1,208 @@ +package WayofTime.alchemicalWizardry.common.spell.simple; + +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 WayofTime.alchemicalWizardry.common.entity.projectile.IceProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; + +public class SpellFrozenWater extends HomSpell +{ + public Random itemRand = new Random(); + + public SpellFrozenWater() + { + super(); + this.setEnergies(100, 200, 150, 100); + //this.setCreativeTab(CreativeTabs.tabMisc); + } + + @Override + public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); + } + + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!par2World.isRemote) + { + //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); + par2World.spawnEntityInWorld(new IceProjectile(par2World, par3EntityPlayer, 6)); + } + + return par1ItemStack; + } + + @Override + public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); + } + + for (int i = -2; i <= 2; i++) + { + par2World.spawnEntityInWorld(new IceProjectile(par2World, par3EntityPlayer, 6, 2, par3EntityPlayer.posX, par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight(), par3EntityPlayer.posZ, par3EntityPlayer.rotationYaw + i * 5F, par3EntityPlayer.rotationPitch)); + } + + return par1ItemStack; + } + + @Override + public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, getDefensiveEnergy()); + } + + float yaw = par3EntityPlayer.rotationYaw; + float pitch = par3EntityPlayer.rotationPitch; + int range = 2; + + if (pitch > 40F) + { + for (int i = -range; i <= range; i++) + { + for (int j = -range; j <= range; j++) + { + if (par2World.isAirBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY - 1, (int) par3EntityPlayer.posZ + j)) + { + par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY - 1, (int) par3EntityPlayer.posZ + j, Blocks.ice); + } + } + } + + return par1ItemStack; + } else if (pitch < -40F) + { + for (int i = -range; i <= range; i++) + { + for (int j = -range; j <= range; j++) + { + if (par2World.isAirBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + 3, (int) par3EntityPlayer.posZ + j)) + { + par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + 3, (int) par3EntityPlayer.posZ + j, Blocks.ice); + } + } + } + + return par1ItemStack; + } + + if ((yaw >= 315 && yaw < 360) || (yaw >= 0 && yaw < 45)) + { + for (int i = -range; i <= range; i++) + { + for (int j = 0; j < range * 2 + 1; j++) + { + if (par2World.isAirBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + 2)) + { + par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + 2, Blocks.ice); + } + } + } + } else if (yaw >= 45 && yaw < 135) + { + for (int i = -range; i <= range; i++) + { + for (int j = 0; j < range * 2 + 1; j++) + { + if (par2World.isAirBlock((int) par3EntityPlayer.posX - 2, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + i)) + { + par2World.setBlock((int) par3EntityPlayer.posX - 2, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + i, Blocks.ice); + } + } + } + } else if (yaw >= 135 && yaw < 225) + { + for (int i = -range; i <= range; i++) + { + for (int j = 0; j < range * 2 + 1; j++) + { + if (par2World.isAirBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ - 2)) + { + par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ - 2, Blocks.ice); + } + } + } + } else + { + for (int i = -range; i <= range; i++) + { + for (int j = 0; j < range * 2 + 1; j++) + { + if (par2World.isAirBlock((int) par3EntityPlayer.posX + 2, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + i)) + { + par2World.setBlock((int) par3EntityPlayer.posX + 2, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + i, Blocks.ice); + } + } + } + } + + return par1ItemStack; + } + + @Override + public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + int radius = 3; + int posX = (int) par3EntityPlayer.posX; + int posY = (int) par3EntityPlayer.posY; + int posZ = (int) par3EntityPlayer.posZ; + + for (int i = -radius; i <= radius; i++) + { + for (int j = -radius; j <= radius; j++) + { + for (int k = -radius; k <= radius; k++) + { + Block block = par2World.getBlock((int) par3EntityPlayer.posX + i - 1, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k); + + //Block block = Block.blocksList[blockID]; + if (block == Blocks.water || block == Blocks.flowing_water) + { + par2World.setBlock((int) par3EntityPlayer.posX + i - 1, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k, Blocks.ice); + } + } + } + } + +// int blockID = par2World.getBlockId((int)par3EntityPlayer.posX+i, (int)par3EntityPlayer.posY+j, (int)par3EntityPlayer.posZ+k); +// //Block block = Block.blocksList[blockID]; +// if(blockID==Block.waterMoving.blockID||blockID==Block.waterStill.blockID) +// { +// par2World.setBlock((int)par3EntityPlayer.posX+i, (int)par3EntityPlayer.posY+j, (int)par3EntityPlayer.posZ+k, Blocks.ice); +// } + return par1ItemStack; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellHolyBlast.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellHolyBlast.java new file mode 100644 index 00000000..f39035f4 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellHolyBlast.java @@ -0,0 +1,200 @@ +package WayofTime.alchemicalWizardry.common.spell.simple; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class SpellHolyBlast extends HomSpell +{ + Random itemRand = new Random(); + + public SpellHolyBlast() + { + super(); + this.setEnergies(100, 300, 500, 400); + //this.setCreativeTab(CreativeTabs.tabMisc); + } + + @Override + public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); + } + + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!par2World.isRemote) + { + //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); + par2World.spawnEntityInWorld(new HolyProjectile(par2World, par3EntityPlayer, 8)); + } + + return par1ItemStack; + } + + @Override + public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); + } + + int distance = 2; + double yaw = par3EntityPlayer.rotationYaw / 180 * Math.PI; + double pitch = par3EntityPlayer.rotationPitch / 180 * Math.PI; + double xCoord = par3EntityPlayer.posX + Math.sin(yaw) * Math.cos(pitch) * (-distance); + double yCoord = par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight() + Math.sin(-pitch) * distance; + double zCoord = par3EntityPlayer.posZ + Math.cos(yaw) * Math.cos(pitch) * distance; + float d0 = 0.5f; + AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB(par3EntityPlayer.posX - 0.5 + Math.sin(yaw) * Math.cos(pitch) * (-distance), par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight() + Math.sin(-pitch) * distance, par3EntityPlayer.posZ - 0.5 + Math.cos(yaw) * Math.cos(pitch) * distance, par3EntityPlayer.posX + Math.sin(yaw) * Math.cos(pitch) * (-distance) + 0.5, par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight() + Math.sin(-pitch) * distance + 1, par3EntityPlayer.posZ + Math.cos(yaw) * Math.cos(pitch) * distance + 0.5).expand(d0, d0, d0); + //axisalignedbb.maxY = (double)this.worldObj.getHeight(); + List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + EntityLivingBase entityLiving = (EntityLivingBase) iterator.next(); + + if (entityLiving instanceof EntityPlayer) + { + if (entityLiving.equals(par3EntityPlayer)) + { + continue; + } + } + + int i = 1; + + if (entityLiving.isEntityUndead()) + { + i = 3; + } + + //entityLiving.setFire(50); + entityLiving.attackEntityFrom(DamageSource.causePlayerDamage(par3EntityPlayer), 5 * i); + //par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (float)(2), false); + } + + par2World.createExplosion(par3EntityPlayer, xCoord, yCoord, zCoord, (float) (1), false); + + for (int i = 0; i < 5; i++) + { + //PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, PacketHandler.getCustomParticlePacket("mobSpell", xCoord + itemRand.nextFloat() - itemRand.nextFloat(), yCoord + itemRand.nextFloat() - itemRand.nextFloat(), zCoord + itemRand.nextFloat() - itemRand.nextFloat(), 1.0F, 1.0F, 1.0F)); + SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "mobSpell", xCoord + itemRand.nextFloat() - itemRand.nextFloat(), yCoord + itemRand.nextFloat() - itemRand.nextFloat(), zCoord + itemRand.nextFloat() - itemRand.nextFloat(), 1.0F, 1.0F, 1.0F); + } + + return par1ItemStack; + } + + @Override + public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); + } + + if (!par2World.isRemote) + { + for (int i = 0; i < 360; i += 18) + { + par2World.spawnEntityInWorld(new HolyProjectile(par2World, par3EntityPlayer, 8, 3, par3EntityPlayer.posX, par3EntityPlayer.posY + (par3EntityPlayer.height / 2), par3EntityPlayer.posZ, i, 0)); + } + } + + return par1ItemStack; + } + + @Override + public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); + } + + int d0 = 3; + AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) par3EntityPlayer.posX, (double) par3EntityPlayer.posY, (double) par3EntityPlayer.posZ, (double) (par3EntityPlayer.posX + 1), (double) (par3EntityPlayer.posY + 2), (double) (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0); + //axisalignedbb.maxY = (double)this.worldObj.getHeight(); + List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + EntityLivingBase entityLiving = (EntityLivingBase) iterator.next(); + + if (entityLiving instanceof EntityPlayer) + { + if (entityLiving.equals(par3EntityPlayer)) + { + continue; + } + } + + int i = 1; + + if (entityLiving.isEntityUndead()) + { + i = 3; + } + + //entityLiving.setFire(50); + entityLiving.attackEntityFrom(DamageSource.causePlayerDamage(par3EntityPlayer), 5 * i); + //par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (float)(2), false); + } + + par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (float) (2), false); + double xCoord = par3EntityPlayer.posX; + double yCoord = par3EntityPlayer.posY; + double zCoord = par3EntityPlayer.posZ; + + for (int i = 0; i < 20; i++) + { + SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "mobSpell", xCoord + itemRand.nextFloat() - itemRand.nextFloat(), yCoord + itemRand.nextFloat() - itemRand.nextFloat(), zCoord + itemRand.nextFloat() - itemRand.nextFloat(), 1.0F, 1.0F, 1.0F); + } + + return par1ItemStack; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellLightningBolt.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellLightningBolt.java new file mode 100644 index 00000000..576b9884 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellLightningBolt.java @@ -0,0 +1,141 @@ +package WayofTime.alchemicalWizardry.common.spell.simple; + +import java.util.Random; + +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.entity.projectile.LightningBoltProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class SpellLightningBolt extends HomSpell +{ + Random itemRand = new Random(); + + public SpellLightningBolt() + { + super(); + this.setEnergies(75, 200, 700, 700); + //this.setCreativeTab(CreativeTabs.tabMisc); + } + + @Override + public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); + } + + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!par2World.isRemote) + { + //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); + par2World.spawnEntityInWorld(new LightningBoltProjectile(par2World, par3EntityPlayer, 8, false)); + } + + return par1ItemStack; + } + + @Override + public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + //TODO Make it work better...? + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); + } + + double xCoord = par3EntityPlayer.posX; + double yCoord = par3EntityPlayer.posY; + double zCoord = par3EntityPlayer.posZ; + par2World.getWorldInfo().setRaining(true); + //par2World.setRainStrength(1.0F); + par2World.setRainStrength(1.0f); + par2World.setThunderStrength(1.0f); + par2World.getWorldInfo().setThunderTime(0); + par2World.getWorldInfo().setThundering(true); + + for (int i = 0; i < 5; i++) + { + //PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, PacketHandler.getCustomParticlePacket("mobSpell", xCoord + itemRand.nextFloat() - itemRand.nextFloat(), yCoord + itemRand.nextFloat() - itemRand.nextFloat(), zCoord + itemRand.nextFloat() - itemRand.nextFloat(), 1.0F, 1.0F, 1.0F)); + SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "mobSpell", xCoord + itemRand.nextFloat() - itemRand.nextFloat(), yCoord + itemRand.nextFloat() - itemRand.nextFloat(), zCoord + itemRand.nextFloat() - itemRand.nextFloat(), 1.0F, 1.0F, 1.0F); + } + + return par1ItemStack; + } + + @Override + public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); + } + + double xCoord = par3EntityPlayer.posX; + double yCoord = par3EntityPlayer.posY; + double zCoord = par3EntityPlayer.posZ; + + for (int i = 0; i < 5; i++) + { + par2World.addWeatherEffect(new EntityLightningBolt(par2World, xCoord + itemRand.nextInt(64) - 32, yCoord + itemRand.nextInt(8) - 8, zCoord + itemRand.nextInt(64) - 32)); + } + + for (int i = 0; i < 8; i++) + { + SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "mobSpell", xCoord + itemRand.nextFloat() - itemRand.nextFloat(), yCoord + itemRand.nextFloat() - itemRand.nextFloat(), zCoord + itemRand.nextFloat() - itemRand.nextFloat(), 1.0F, 1.0F, 1.0F); + } + + return par1ItemStack; + } + + @Override + public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); + } + + if (!par2World.isRemote) + { + //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); + par2World.spawnEntityInWorld(new LightningBoltProjectile(par2World, par3EntityPlayer, 8, true)); + } + + return par1ItemStack; + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellTeleport.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellTeleport.java new file mode 100644 index 00000000..30f5d5bf --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellTeleport.java @@ -0,0 +1,289 @@ +package WayofTime.alchemicalWizardry.common.spell.simple; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.living.EnderTeleportEvent; +import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.entity.projectile.TeleportProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class SpellTeleport extends HomSpell +{ + Random itemRand = new Random(); + + public SpellTeleport() + { + super(); + this.setEnergies(500, 300, 500, 1000); + //this.setCreativeTab(CreativeTabs.tabMisc); + } + + @Override + public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); + } + + par2World.spawnEntityInWorld(new TeleportProjectile(par2World, par3EntityPlayer, 8, true)); + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + EntityEnderman g; + return par1ItemStack; + } + + @Override + public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); + } + + par2World.spawnEntityInWorld(new TeleportProjectile(par2World, par3EntityPlayer, 8, false)); + return par1ItemStack; + } + + @Override + public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); + } + + double xCoord = par3EntityPlayer.posX; + double yCoord = par3EntityPlayer.posY; + double zCoord = par3EntityPlayer.posZ; + SpellTeleport.teleportRandomly(par3EntityPlayer, 128); + + for (int i = 0; i < 20; i++) + { + //PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, PacketHandler.getCustomParticlePacket("portal", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, itemRand.nextFloat(), itemRand.nextFloat(), itemRand.nextFloat())); + SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "portal", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, itemRand.nextFloat(), itemRand.nextFloat(), itemRand.nextFloat()); + } + + return par1ItemStack; + } + + @Override + public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); + } + + if (!par2World.isRemote) + { + int d0 = 3; + AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) par3EntityPlayer.posX, (double) par3EntityPlayer.posY, (double) par3EntityPlayer.posZ, (double) (par3EntityPlayer.posX + 1), (double) (par3EntityPlayer.posY + 2), (double) (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0); + //axisalignedbb.maxY = (double)this.worldObj.getHeight(); + List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + EntityLivingBase entityLiving = (EntityLivingBase) iterator.next(); + + if (entityLiving instanceof EntityPlayer) + { + if (entityLiving.equals(par3EntityPlayer)) + { + continue; + } + } + + SpellTeleport.teleportRandomly(entityLiving, 128); + //entityLiving.attackEntityFrom(DamageSource.inFire, 5); + } + } + + double xCoord = par3EntityPlayer.posX; + double yCoord = par3EntityPlayer.posY; + double zCoord = par3EntityPlayer.posZ; + + for (int i = 0; i < 32; i++) + { + SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "portal", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 2, itemRand.nextFloat(), itemRand.nextFloat(), itemRand.nextFloat()); + } + + return par1ItemStack; + } + + public static boolean teleportRandomly(EntityLivingBase entityLiving, double distance) + { + double x = entityLiving.posX; + double y = entityLiving.posY; + double z = entityLiving.posZ; + Random rand = new Random(); + double d0 = x + (rand.nextDouble() - 0.5D) * distance; + double d1 = y + (double) (rand.nextInt((int) distance) - (distance) / 2); + double d2 = z + (rand.nextDouble() - 0.5D) * distance; + int i = 0; + + while (!SpellTeleport.teleportTo(entityLiving, d0, d1, d2, x, y, z) && i < 100) + { + d0 = x + (rand.nextDouble() - 0.5D) * distance; + d1 = y + (double) (rand.nextInt((int) distance) - (distance) / 2); + d2 = z + (rand.nextDouble() - 0.5D) * distance; + i++; + } + + if (i >= 100) + { + return false; + } + + return true; + //return SpellTeleport.teleportTo(entityLiving, d0, d1, d2,x,y,z); + } + + private static boolean teleportTo(EntityLivingBase entityLiving, double par1, double par3, double par5, double lastX, double lastY, double lastZ) + { + EnderTeleportEvent event = new EnderTeleportEvent(entityLiving, par1, par3, par5, 0); + + if (MinecraftForge.EVENT_BUS.post(event)) + { + return false; + } + + double d3 = lastX; + double d4 = lastY; + double d5 = lastZ; + SpellTeleport.moveEntityViaTeleport(entityLiving, event.targetX, event.targetY, event.targetZ); + boolean flag = false; + int i = MathHelper.floor_double(entityLiving.posX); + int j = MathHelper.floor_double(entityLiving.posY); + int k = MathHelper.floor_double(entityLiving.posZ); + Block l; + + if (entityLiving.worldObj.blockExists(i, j, k)) + { + boolean flag1 = false; + + while (!flag1 && j > 0) + { + l = entityLiving.worldObj.getBlock(i, j - 1, k); + + if (l != null && l.getMaterial().blocksMovement()) + { + flag1 = true; + } else + { + --entityLiving.posY; + --j; + } + } + + if (flag1) + { + SpellTeleport.moveEntityViaTeleport(entityLiving, entityLiving.posX, entityLiving.posY, entityLiving.posZ); + + if (entityLiving.worldObj.getCollidingBoundingBoxes(entityLiving, entityLiving.boundingBox).isEmpty() && !entityLiving.worldObj.isAnyLiquid(entityLiving.boundingBox)) + { + flag = true; + } + } + } + + if (!flag) + { + SpellTeleport.moveEntityViaTeleport(entityLiving, d3, d4, d5); + return false; + } else + { + short short1 = 128; + + for (j = 0; j < short1; ++j) + { + double d6 = (double) j / ((double) short1 - 1.0D); + float f = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F; + float f1 = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F; + float f2 = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F; + double d7 = d3 + (entityLiving.posX - d3) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D; + double d8 = d4 + (entityLiving.posY - d4) * d6 + entityLiving.worldObj.rand.nextDouble() * (double) entityLiving.height; + double d9 = d5 + (entityLiving.posZ - d5) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D; + entityLiving.worldObj.spawnParticle("portal", d7, d8, d9, (double) f, (double) f1, (double) f2); + } + +// this.worldObj.playSoundEffect(d3, d4, d5, "mob.endermen.portal", 1.0F, 1.0F); +// this.playSound("mob.endermen.portal", 1.0F, 1.0F); + return true; + } + } + + public static void moveEntityViaTeleport(EntityLivingBase entityLiving, double x, double y, double z) + { + if (entityLiving instanceof EntityPlayer) + { + if (entityLiving != null && entityLiving instanceof EntityPlayerMP) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP) entityLiving; + + //if (!entityplayermp.playerNetServerHandler.connectionClosed && entityplayermp.worldObj == entityLiving.worldObj) + if (entityplayermp.worldObj == entityLiving.worldObj) + { + EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, x, y, z, 5.0F); + + if (!MinecraftForge.EVENT_BUS.post(event)) + { + if (entityLiving.isRiding()) + { + entityLiving.mountEntity((Entity) null); + } + + entityLiving.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ); +// this.getThrower().fallDistance = 0.0F; +// this.getThrower().attackEntityFrom(DamageSource.fall, event.attackDamage); + } + } + } + } else if (entityLiving != null) + { + entityLiving.setPosition(x, y, z); + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWateryGrave.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWateryGrave.java new file mode 100644 index 00000000..91f9c1e5 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWateryGrave.java @@ -0,0 +1,180 @@ +package WayofTime.alchemicalWizardry.common.spell.simple; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.entity.projectile.WaterProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class SpellWateryGrave extends HomSpell +{ + Random itemRand = new Random(); + + public SpellWateryGrave() + { + super(); + this.setEnergies(250, 350, 500, 750); + //this.setCreativeTab(CreativeTabs.tabMisc); + } + + @Override + public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); + } + + par2World.spawnEntityInWorld(new WaterProjectile(par2World, par3EntityPlayer, 8)); + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + return par1ItemStack; + } + + @Override + public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); + } + + if (!par2World.isRemote) + { + for (int i = -1; i <= 1; i++) + { + for (int j = -1; j <= 1; j++) + { + par2World.spawnEntityInWorld(new WaterProjectile(par2World, par3EntityPlayer, 3, 3, par3EntityPlayer.posX, par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight(), par3EntityPlayer.posZ, par3EntityPlayer.rotationYaw + i * 10F, par3EntityPlayer.rotationPitch + j * 5F)); + } + } + } + + return par1ItemStack; + } + + @Override + public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); + } + + int d0 = 3; + AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) par3EntityPlayer.posX, (double) par3EntityPlayer.posY, (double) par3EntityPlayer.posZ, (double) (par3EntityPlayer.posX + 1), (double) (par3EntityPlayer.posY + 2), (double) (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0); + //axisalignedbb.maxY = (double)this.worldObj.getHeight(); + List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + EntityLivingBase entityLiving = (EntityLivingBase) iterator.next(); + + if (entityLiving instanceof EntityPlayer) + { + if (entityLiving.equals(par3EntityPlayer)) + { + continue; + } + } + + int x = 1; + + if (entityLiving.isImmuneToFire()) + { + x = 2; + } + + entityLiving.attackEntityFrom(DamageSource.drown, 2 * x); + entityLiving.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 100, x - 1)); + } + + double xCoord = par3EntityPlayer.posX; + double yCoord = par3EntityPlayer.posY; + double zCoord = par3EntityPlayer.posZ; + + for (int i = 0; i < 20; i++) + { + //PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, PacketHandler.getCustomParticlePacket("mobSpell", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, 0.0F, 0.410F, 1.0F)); + SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "mobSpell", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, 0.0F, 0.410F, 1.0F); + } + + return par1ItemStack; + } + + @Override + public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); + } + + int range = 2; + + if (!par2World.isRemote) + { + for (int i = -range; i <= range; i++) + { + for (int j = -range; j <= range; j++) + { + if (par2World.isAirBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY, (int) par3EntityPlayer.posZ + j)) + { + par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY, (int) par3EntityPlayer.posZ + j, Blocks.water); + } + } + } + } + + double xCoord = par3EntityPlayer.posX; + double yCoord = par3EntityPlayer.posY; + double zCoord = par3EntityPlayer.posZ; + + for (int i = 0; i < 16; i++) + { + SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "mobSpell", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, 0.0F, 0.410F, 1.0F); + } + + return par1ItemStack; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWindGust.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWindGust.java new file mode 100644 index 00000000..516ff944 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellWindGust.java @@ -0,0 +1,219 @@ +package WayofTime.alchemicalWizardry.common.spell.simple; + +import ibxm.Player; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.entity.projectile.WindGustProjectile; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class SpellWindGust extends HomSpell +{ + Random itemRand = new Random(); + + public SpellWindGust() + { + super(); + this.setEnergies(300, 400, 300, 500); + //this.setCreativeTab(CreativeTabs.tabMisc); + } + + @Override + public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveRangedEnergy()); + } + + par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!par2World.isRemote) + { + //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage)); + par2World.spawnEntityInWorld(new WindGustProjectile(par2World, par3EntityPlayer, 8)); + } + + return par1ItemStack; + } + + @Override + public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getOffensiveMeleeEnergy()); + } + + int distance = 3; + double yaw = par3EntityPlayer.rotationYaw / 180 * Math.PI; + double pitch = par3EntityPlayer.rotationPitch / 180 * Math.PI; + double xCoord = par3EntityPlayer.posX + Math.sin(yaw) * Math.cos(pitch) * (-distance); + double yCoord = par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight() + Math.sin(-pitch) * distance; + double zCoord = par3EntityPlayer.posZ + Math.cos(yaw) * Math.cos(pitch) * distance; + float d0 = 0.5f; + AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB(par3EntityPlayer.posX - 0.5 + Math.sin(yaw) * Math.cos(pitch) * (-distance), par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight() + Math.sin(-pitch) * distance, par3EntityPlayer.posZ - 0.5 + Math.cos(yaw) * Math.cos(pitch) * distance, par3EntityPlayer.posX + Math.sin(yaw) * Math.cos(pitch) * (-distance) + 0.5, par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight() + Math.sin(-pitch) * distance + 1, par3EntityPlayer.posZ + Math.cos(yaw) * Math.cos(pitch) * distance + 0.5).expand(d0, d0, d0); + //axisalignedbb.maxY = (double)this.worldObj.getHeight(); + List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + EntityLivingBase entityLiving = (EntityLivingBase) iterator.next(); + + if (entityLiving instanceof EntityPlayer) + { + if (entityLiving.equals(par3EntityPlayer)) + { + continue; + } + } + + //entityLiving.setFire(50); + //entityLiving.attackEntityFrom(DamageSource.causePlayerDamage(par3EntityPlayer), 5*i); + //entityLiving.setVelocity(Math.sin(-yaw)*2, 2, Math.cos(yaw)*2); + entityLiving.motionX = Math.sin(-yaw) * 2; + entityLiving.motionY = 2; + entityLiving.motionZ = Math.cos(yaw) * 2; + //par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (float)(2), false); + } + + //par2World.createExplosion(par3EntityPlayer, xCoord, yCoord, zCoord, (float)(1), false); + + for (int i = 0; i < 5; i++) + { + SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "mobSpell", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, 0.0F, 0.410F, 1.0F); + + } + + return par1ItemStack; + } + + @Override + public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getDefensiveEnergy()); + } + + int distance = 3; + double yaw = par3EntityPlayer.rotationYaw / 180 * Math.PI; + double pitch = par3EntityPlayer.rotationPitch / 180 * Math.PI; + double wantedVelocity = 5; + double xVel = Math.sin(yaw) * Math.cos(pitch) * (-wantedVelocity); + double yVel = Math.sin(-pitch) * wantedVelocity; + double zVel = Math.cos(yaw) * Math.cos(pitch) * wantedVelocity; + Vec3 vec = par3EntityPlayer.getLookVec(); + par3EntityPlayer.motionX = vec.xCoord * wantedVelocity; + par3EntityPlayer.motionY = vec.yCoord * wantedVelocity; + par3EntityPlayer.motionZ = vec.zCoord * wantedVelocity; + //PacketDispatcher.sendPacketToPlayer(PacketHandler.getPlayerVelocitySettingPacket(xVel, yVel, zVel), (Player) par3EntityPlayer); + SpellHelper.setPlayerSpeedFromServer(par3EntityPlayer, xVel, yVel, zVel); + par2World.playSoundEffect((double) ((float) par3EntityPlayer.posX + 0.5F), (double) ((float) par3EntityPlayer.posY + 0.5F), (double) ((float) par3EntityPlayer.posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (par2World.rand.nextFloat() - par2World.rand.nextFloat()) * 0.8F); + par3EntityPlayer.fallDistance = 0; + //par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (float)(2), false); + double xCoord = par3EntityPlayer.posX; + double yCoord = par3EntityPlayer.posY; + double zCoord = par3EntityPlayer.posZ; + + for (int i = 0; i < 8; i++) + { + SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "mobSpell", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, 0.0F, 0.410F, 1.0F); + } + + return par1ItemStack; + } + + @Override + public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + EnergyItems.syphonAndDamageWhileInContainer(par1ItemStack, par3EntityPlayer, this.getEnvironmentalEnergy()); + } + + int d0 = 3; + AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) par3EntityPlayer.posX, (double) par3EntityPlayer.posY, (double) par3EntityPlayer.posZ, (double) (par3EntityPlayer.posX + 1), (double) (par3EntityPlayer.posY + 2), (double) (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0); + //axisalignedbb.maxY = (double)this.worldObj.getHeight(); + List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + Iterator iterator = list.iterator(); + double xCoord = par3EntityPlayer.posX; + double yCoord = par3EntityPlayer.posY; + double zCoord = par3EntityPlayer.posZ; + double wantedVel = 2; + + while (iterator.hasNext()) + { + EntityLivingBase entityLiving = (EntityLivingBase) iterator.next(); + + if (entityLiving instanceof EntityPlayer) + { + if (entityLiving.equals(par3EntityPlayer)) + { + continue; + } + } + + double posXDif = entityLiving.posX - par3EntityPlayer.posX; + double posYDif = entityLiving.posY - par3EntityPlayer.posY + 1; + double posZDif = entityLiving.posZ - par3EntityPlayer.posZ; + double distance2 = Math.pow(posXDif, 2) + Math.pow(posYDif, 2) + Math.pow(posZDif, 2); + double distance = Math.sqrt(distance2); + //entityLiving.setVelocity(posXDif*wantedVel/distance, posYDif*wantedVel/distance, posZDif*wantedVel/distance); + entityLiving.motionX = posXDif * wantedVel / distance; + entityLiving.motionY = posYDif * wantedVel / distance; + entityLiving.motionZ = posZDif * wantedVel / distance; + //entityLiving.setFire(50); + //entityLiving.attackEntityFrom(DamageSource.causePlayerDamage(par3EntityPlayer), 5*i); + //par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (float)(2), false); + } + + //par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (float)(2), false); + + for (int i = 0; i < 20; i++) + { + SpellHelper.sendParticleToAllAround(par2World, xCoord, yCoord, zCoord, 30, par2World.provider.dimensionId, "mobSpell", xCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, yCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, zCoord + (itemRand.nextFloat() - itemRand.nextFloat()) * 3, 0.0F, 0.410F, 1.0F); + } + + return par1ItemStack; + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/SummoningFallenAngel.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/SummoningFallenAngel.java new file mode 100644 index 00000000..eaea8feb --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/SummoningFallenAngel.java @@ -0,0 +1,19 @@ +package WayofTime.alchemicalWizardry.common.summoning; + +import WayofTime.alchemicalWizardry.common.entity.mob.EntityFallenAngel; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.world.World; + +public class SummoningFallenAngel extends SummoningHelper +{ + public SummoningFallenAngel(int id) + { + super(id); + // TODO Auto-generated constructor stub + } + + public EntityLivingBase getEntity(World worldObj) + { + return new EntityFallenAngel(worldObj); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/SummoningHelper.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/SummoningHelper.java new file mode 100644 index 00000000..b4b459ee --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/SummoningHelper.java @@ -0,0 +1,98 @@ +package WayofTime.alchemicalWizardry.common.summoning; + +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.EntityAirElemental; +import WayofTime.alchemicalWizardry.common.entity.mob.*; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.world.World; + +public class SummoningHelper +{ + private int id; + + public SummoningHelper(int id) + { + this.id = id; + } + + public EntityLivingBase getEntity(World worldObj) + { + if (this.id == AlchemicalWizardry.entityFallenAngelID) + { + return new EntityFallenAngel(worldObj); + } + + if (this.id == AlchemicalWizardry.entityLowerGuardianID) + { + return new EntityLowerGuardian(worldObj); + } + + if (this.id == AlchemicalWizardry.entityBileDemonID) + { + return new EntityBileDemon(worldObj); + } + + if (this.id == AlchemicalWizardry.entityWingedFireDemonID) + { + return new EntityWingedFireDemon(worldObj); + } + + if (this.id == AlchemicalWizardry.entitySmallEarthGolemID) + { + return new EntitySmallEarthGolem(worldObj); + } + + if (this.id == AlchemicalWizardry.entityIceDemonID) + { + return new EntityIceDemon(worldObj); + } + + if (this.id == AlchemicalWizardry.entityBoulderFistID) + { + return new EntityBoulderFist(worldObj); + } + + if (this.id == AlchemicalWizardry.entityShadeID) + { + return new EntityShade(worldObj); + } + + if (this.id == AlchemicalWizardry.entityAirElementalID) + { + return new EntityAirElemental(worldObj); + } + + if (this.id == AlchemicalWizardry.entityWaterElementalID) + { + return new EntityWaterElemental(worldObj); + } + + if (this.id == AlchemicalWizardry.entityEarthElementalID) + { + return new EntityEarthElemental(worldObj); + } + + if (this.id == AlchemicalWizardry.entityFireElementalID) + { + return new EntityFireElemental(worldObj); + } + + if (this.id == AlchemicalWizardry.entityShadeElementalID) + { + return new EntityShadeElemental(worldObj); + } + + if (this.id == AlchemicalWizardry.entityHolyElementalID) + { + return new EntityHolyElemental(worldObj); + } + + return new EntityPig(worldObj); + } + + public int getSummoningHelperID() + { + return id; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/SummoningRegistry.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/SummoningRegistry.java new file mode 100644 index 00000000..8f4fac89 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/SummoningRegistry.java @@ -0,0 +1,70 @@ +package WayofTime.alchemicalWizardry.common.summoning; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; + +public class SummoningRegistry +{ + public static List summoningList = new ArrayList(); + + public static void registerSummon(SummoningHelper s, ItemStack[] ring1, ItemStack[] ring2, ItemStack[] ring3, int amountUsed, int bloodOrbLevel) + { + summoningList.add(new SummoningRegistryComponent(s, ring1, ring2, ring3, amountUsed, bloodOrbLevel)); + } + + public static boolean isRecipeValid(int bloodOrbLevel, ItemStack[] test1, ItemStack[] test2, ItemStack[] test3) + { + for (SummoningRegistryComponent src : summoningList) + { + if (src.getBloodOrbLevel() <= bloodOrbLevel && src.compareRing(1, test1) && src.compareRing(2, test2) && src.compareRing(3, test3)) + { + return true; + } + } + + return false; + } + + public static SummoningRegistryComponent getRegistryComponent(int bloodOrbLevel, ItemStack[] test1, ItemStack[] test2, ItemStack[] test3) + { + for (SummoningRegistryComponent src : summoningList) + { + if (src.getBloodOrbLevel() <= bloodOrbLevel && src.compareRing(1, test1) && src.compareRing(2, test2) && src.compareRing(3, test3)) + { + return src; + } + } + + return null; + } + + public static EntityLivingBase getEntity(World worldObj, int bloodOrbLevel, ItemStack[] test1, ItemStack[] test2, ItemStack[] test3) + { + for (SummoningRegistryComponent src : summoningList) + { + if (src.getBloodOrbLevel() <= bloodOrbLevel && src.compareRing(1, test1) && src.compareRing(2, test2) && src.compareRing(3, test3)) + { + return src.getEntity(worldObj); + } + } + + return null; + } + + public static EntityLivingBase getEntityWithID(World worldObj, int id) + { + for (SummoningRegistryComponent src : summoningList) + { + if (src.getSummoningHelperID() == id) + { + return src.getEntity(worldObj); + } + } + + return null; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/SummoningRegistryComponent.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/SummoningRegistryComponent.java new file mode 100644 index 00000000..c44efedf --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/SummoningRegistryComponent.java @@ -0,0 +1,231 @@ +package WayofTime.alchemicalWizardry.common.summoning; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; + +public class SummoningRegistryComponent +{ + public ItemStack[] ring1 = new ItemStack[6]; + public ItemStack[] ring2 = new ItemStack[6]; + public ItemStack[] ring3 = new ItemStack[6]; + public SummoningHelper summoningHelper; + public int summoningCost; + public int bloodOrbLevel; + + public SummoningRegistryComponent(SummoningHelper s, ItemStack[] newRing1, ItemStack[] newRing2, ItemStack[] newRing3, int amount, int bloodOrbLevel) + { + this.summoningHelper = s; + this.ring1 = newRing1; + this.ring2 = newRing2; + this.ring3 = newRing3; + this.summoningCost = amount; + this.bloodOrbLevel = bloodOrbLevel; + + if (this.ring1.length != 6) + { + ItemStack[] newRecipe = new ItemStack[6]; + + for (int i = 0; i < 6; i++) + { + if (i + 1 > this.ring1.length) + { + newRecipe[i] = null; + } else + { + newRecipe[i] = this.ring1[i]; + } + } + + this.ring1 = newRecipe; + } + + if (this.ring2.length != 6) + { + ItemStack[] newRecipe = new ItemStack[6]; + + for (int i = 0; i < 6; i++) + { + if (i + 1 > this.ring2.length) + { + newRecipe[i] = null; + } else + { + newRecipe[i] = this.ring2[i]; + } + } + + this.ring2 = newRecipe; + } + + if (this.ring3.length != 6) + { + ItemStack[] newRecipe = new ItemStack[6]; + + for (int i = 0; i < 6; i++) + { + if (i + 1 > this.ring3.length) + { + newRecipe[i] = null; + } else + { + newRecipe[i] = this.ring3[i]; + } + } + + this.ring3 = newRecipe; + } + } + + public boolean compareRing(int ring, ItemStack[] checkedRingRecipe) + { + ItemStack[] recipe; + + if (checkedRingRecipe.length < 6) + { + return false; + } + + switch (ring) + { + case 1: + recipe = ring1; + break; + + case 2: + recipe = ring2; + break; + + case 3: + recipe = ring3; + break; + + default: + recipe = ring1; + } + + if (recipe.length != 6) + { + ItemStack[] newRecipe = new ItemStack[6]; + + for (int i = 0; i < 6; i++) + { + if (i + 1 > recipe.length) + { + newRecipe[i] = null; + } else + { + newRecipe[i] = recipe[i]; + } + } + + recipe = newRecipe; + } + + boolean[] checkList = new boolean[6]; + + for (int i = 0; i < 6; i++) + { + checkList[i] = false; + } + + for (int i = 0; i < 6; i++) + { + ItemStack recipeItemStack = recipe[i]; + + if (recipeItemStack == null) + { + continue; + } + + boolean test = false; + + for (int j = 0; j < 6; j++) + { + if (checkList[j]) + { + continue; + } + + ItemStack checkedItemStack = checkedRingRecipe[j]; + + if (checkedItemStack == null) + { + continue; + } + + boolean quickTest = false; + + if (recipeItemStack.getItem() instanceof ItemBlock) + { + if (checkedItemStack.getItem() instanceof ItemBlock) + { + quickTest = true; + } + } else if (!(checkedItemStack.getItem() instanceof ItemBlock)) + { + quickTest = true; + } + + if (!quickTest) + { + continue; + } + + if ((checkedItemStack.getItemDamage() == recipeItemStack.getItemDamage() || OreDictionary.WILDCARD_VALUE == recipeItemStack.getItemDamage()) && checkedItemStack.getItem() == recipeItemStack.getItem()) + { + test = true; + checkList[j] = true; + break; + } + } + + if (!test) + { + return false; + } + } + + return true; + } + + public int getSummoningCost() + { + return summoningCost; + } + + public EntityLivingBase getEntity(World world) + { + return this.summoningHelper.getEntity(world); + } + + public int getBloodOrbLevel() + { + return this.bloodOrbLevel; + } + + public ItemStack[] getRingRecipeForRing(int ring) + { + switch (ring) + { + case 1: + return ring1; + + case 2: + return ring2; + + case 3: + return ring3; + + default: + return null; + } + } + + public int getSummoningHelperID() + { + return this.summoningHelper.getSummoningHelperID(); + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java new file mode 100644 index 00000000..5d3fcb7b --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigm.java @@ -0,0 +1,86 @@ +package WayofTime.alchemicalWizardry.common.summoning.meteor; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; + +public class MeteorParadigm +{ + public List componentList = new ArrayList(); + public ItemStack focusStack; + public int radius; + public static int maxChance = 1000; + + public MeteorParadigm(ItemStack focusStack, int radius) + { + this.focusStack = focusStack; + this.radius = radius; + } + + public void parseStringArray(String[] oreArray) + { + for (int i = 0; i + 1 < oreArray.length; i += 2) + { + String oreName = oreArray[i]; + int oreChance = Integer.parseInt(oreArray[i + 1]); + MeteorParadigmComponent mpc = new MeteorParadigmComponent(oreName, oreChance); + componentList.add(mpc); + } + } + + public void createMeteorImpact(World world, int x, int y, int z) + { + world.createExplosion(null, x, y, z, radius * 4, AlchemicalWizardry.doMeteorsDestroyBlocks); + + for (int i = -radius; i <= radius; i++) + { + for (int j = -radius; j <= radius; j++) + { + for (int k = -radius; k <= radius; k++) + { + if (i * i + j * j + k * k >= (radius + 0.50f) * (radius + 0.50f)) + { + continue; + } + + if (!world.isAirBlock(x + i, y + j, z + k)) + { + continue; + } + + int randNum = world.rand.nextInt(maxChance); + boolean hasPlacedBlock = false; + + for (MeteorParadigmComponent mpc : componentList) + { + if (mpc == null || !mpc.isValidBlockParadigm()) + { + continue; + } + + randNum -= mpc.getChance(); + + if (randNum < 0) + { + ItemStack blockStack = mpc.getValidBlockParadigm(); + world.setBlock(x + i, y + j, z + k, Block.getBlockById(Item.getIdFromItem(blockStack.getItem())), blockStack.getItemDamage(), 3); + hasPlacedBlock = true; + break; + } + } + + if (!hasPlacedBlock) + { + world.setBlock(x + i, y + j, z + k, Blocks.stone, 0, 3); + } + } + } + } + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigmComponent.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigmComponent.java new file mode 100644 index 00000000..0daa43a1 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorParadigmComponent.java @@ -0,0 +1,54 @@ +package WayofTime.alchemicalWizardry.common.summoning.meteor; + +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +import java.util.List; + +public class MeteorParadigmComponent +{ + public String oreDictName; + public int chance; + + public MeteorParadigmComponent(String dictName, int chance) + { + this.oreDictName = dictName; + this.chance = chance; + } + + public boolean isValidBlockParadigm() + { + if (this.getValidBlockParadigm() != null) + { + return true; + } + + return false; + } + + public String getOreDictName() + { + return this.oreDictName; + } + + public int getChance() + { + return this.chance; + } + + public ItemStack getValidBlockParadigm() + { + List list = OreDictionary.getOres(getOreDictName()); + + for (ItemStack stack : list) + { + if (stack != null && stack.getItem() instanceof ItemBlock) + { + return stack; + } + } + + return null; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorRegistry.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorRegistry.java new file mode 100644 index 00000000..4df585c1 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/summoning/meteor/MeteorRegistry.java @@ -0,0 +1,61 @@ +package WayofTime.alchemicalWizardry.common.summoning.meteor; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; + +import java.util.ArrayList; +import java.util.List; + +public class MeteorRegistry +{ + public static List paradigmList = new ArrayList(); + + public static void registerMeteorParadigm(MeteorParadigm paradigm) + { + paradigmList.add(paradigm); + } + + public static void registerMeteorParadigm(ItemStack stack, String[] oreList, int radius) + { + if (stack != null && oreList != null) + { + MeteorParadigm meteor = new MeteorParadigm(stack, radius); + meteor.parseStringArray(oreList); + paradigmList.add(meteor); + } + } + + public static void createMeteorImpact(World world, int x, int y, int z, int paradigmID) + { + if (paradigmID < paradigmList.size()) + { + paradigmList.get(paradigmID).createMeteorImpact(world, x, y, z); + } + } + + public static int getParadigmIDForItem(ItemStack stack) + { + if (stack == null) + { + return -1; + } + + for (int i = 0; i < paradigmList.size(); i++) + { + ItemStack focusStack = paradigmList.get(i).focusStack; + + if (focusStack != null && focusStack.getItem()== stack.getItem() && (focusStack.getItemDamage() == OreDictionary.WILDCARD_VALUE || focusStack.getItemDamage() == stack.getItemDamage())) + { + return i; + } + } + + return -1; + } + + public static boolean isValidParadigmItem(ItemStack stack) + { + return getParadigmIDForItem(stack) != -1; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java new file mode 100644 index 00000000..c1353871 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java @@ -0,0 +1,1024 @@ +package WayofTime.alchemicalWizardry.common.tileEntity; + +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.Packet; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.Constants; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidEvent; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; +import net.minecraftforge.fluids.IFluidTank; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.NewPacketHandler; +import WayofTime.alchemicalWizardry.common.altarRecipeRegistry.AltarRecipe; +import WayofTime.alchemicalWizardry.common.altarRecipeRegistry.AltarRecipeRegistry; +import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.AltarUpgradeComponent; +import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars; +import WayofTime.alchemicalWizardry.common.items.EnergyBattery; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFluidHandler +{ + public static final int sizeInv = 1; + private ItemStack[] inv; + private int resultID; + private int resultDamage; + private int upgradeLevel; + //public final LiquidTank tank = new LiquidTank(LiquidContainerRegistry.BUCKET_VOLUME * 10); + protected FluidStack fluid; + public int capacity; + private boolean isActive; + private int liquidRequired; //mB + private boolean canBeFilled; + private int consumptionRate; + private int drainRate; + private float consumptionMultiplier; + private float efficiencyMultiplier; + private float sacrificeEfficiencyMultiplier; + private float selfSacrificeEfficiencyMultiplier; + private float capacityMultiplier; + private float orbCapacityMultiplier; + private float dislocationMultiplier; + private boolean isUpgraded; + private boolean isResultBlock; + private int bufferCapacity; + protected FluidStack fluidOutput; + protected FluidStack fluidInput; + private int progress; + + public TEAltar() + { + this.inv = new ItemStack[1]; + resultID = 0; + resultDamage = 0; + this.capacity = FluidContainerRegistry.BUCKET_VOLUME * 10; + fluid = new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 0); + fluidOutput = new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 0); + fluidInput = new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 0); + bufferCapacity = FluidContainerRegistry.BUCKET_VOLUME; + isActive = false; + consumptionRate = 0; + drainRate = 0; + consumptionMultiplier = 0; + efficiencyMultiplier = 0; + capacityMultiplier = 1; + isUpgraded = false; + upgradeLevel = 0; + isResultBlock = false; + progress = 0; + } + + @Override + public void readFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readFromNBT(par1NBTTagCompound); + NBTTagList tagList = par1NBTTagCompound.getTagList("Inventory",Constants.NBT.TAG_COMPOUND); + + for (int i = 0; i < tagList.tagCount(); i++) + { + NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); + int slot = tag.getByte("Slot"); + + if (slot >= 0 && slot < inv.length) + { + inv[slot] = ItemStack.loadItemStackFromNBT(tag); + } + } + + resultID = par1NBTTagCompound.getInteger("resultID"); + resultDamage = par1NBTTagCompound.getInteger("resultDamage"); + + if (!par1NBTTagCompound.hasKey("Empty")) + { + FluidStack fluid = this.fluid.loadFluidStackFromNBT(par1NBTTagCompound); + + if (fluid != null) + { + setMainFluid(fluid); + } + + FluidStack fluidOut = new FluidStack(AlchemicalWizardry.lifeEssenceFluid, par1NBTTagCompound.getInteger("outputAmount")); + + if (fluidOut != null) + { + setOutputFluid(fluidOut); + } + + FluidStack fluidIn = new FluidStack(AlchemicalWizardry.lifeEssenceFluid, par1NBTTagCompound.getInteger("inputAmount")); + + if (fluidIn != null) + { + setInputFluid(fluidIn); + } + } + + upgradeLevel = par1NBTTagCompound.getInteger("upgradeLevel"); + isActive = par1NBTTagCompound.getBoolean("isActive"); + liquidRequired = par1NBTTagCompound.getInteger("liquidRequired"); + canBeFilled = par1NBTTagCompound.getBoolean("canBeFilled"); + isUpgraded = par1NBTTagCompound.getBoolean("isUpgraded"); + consumptionRate = par1NBTTagCompound.getInteger("consumptionRate"); + drainRate = par1NBTTagCompound.getInteger("drainRate"); + consumptionMultiplier = par1NBTTagCompound.getFloat("consumptionMultiplier"); + efficiencyMultiplier = par1NBTTagCompound.getFloat("efficiencyMultiplier"); + selfSacrificeEfficiencyMultiplier = par1NBTTagCompound.getFloat("selfSacrificeEfficiencyMultiplier"); + sacrificeEfficiencyMultiplier = par1NBTTagCompound.getFloat("sacrificeEfficiencyMultiplier"); + capacityMultiplier = par1NBTTagCompound.getFloat("capacityMultiplier"); + orbCapacityMultiplier = par1NBTTagCompound.getFloat("orbCapacityMultiplier"); + dislocationMultiplier = par1NBTTagCompound.getFloat("dislocationMultiplier"); + capacity = par1NBTTagCompound.getInteger("capacity"); + bufferCapacity = par1NBTTagCompound.getInteger("bufferCapacity"); + progress = par1NBTTagCompound.getInteger("progress"); + isResultBlock = par1NBTTagCompound.getBoolean("isResultBlock"); + } + + public void setMainFluid(FluidStack fluid) + { + this.fluid = fluid; + } + + public void setOutputFluid(FluidStack fluid) + { + this.fluidOutput = fluid; + } + + public void setInputFluid(FluidStack fluid) + { + this.fluidInput = fluid; + } + + @Override + public void writeToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeToNBT(par1NBTTagCompound); + NBTTagList itemList = new NBTTagList(); + + for (int i = 0; i < inv.length; i++) + { + ItemStack stack = inv[i]; + + if (inv[i] != null) + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setByte("Slot", (byte) i); + inv[i].writeToNBT(tag); + itemList.appendTag(tag); + } + } + + par1NBTTagCompound.setInteger("resultID", resultID); + par1NBTTagCompound.setInteger("resultDamage", resultDamage); + par1NBTTagCompound.setTag("Inventory", itemList); + + if (fluid != null) + { + fluid.writeToNBT(par1NBTTagCompound); + } else + { + par1NBTTagCompound.setString("Empty", ""); + } + + if (fluidOutput != null) + { + par1NBTTagCompound.setInteger("outputAmount", fluidOutput.amount); + } + + if (fluidInput != null) + { + par1NBTTagCompound.setInteger("inputAmount", fluidInput.amount); + } + + par1NBTTagCompound.setInteger("upgradeLevel", upgradeLevel); + par1NBTTagCompound.setBoolean("isActive", isActive); + par1NBTTagCompound.setInteger("liquidRequired", liquidRequired); + par1NBTTagCompound.setBoolean("canBeFilled", canBeFilled); + par1NBTTagCompound.setBoolean("isUpgraded", isUpgraded); + par1NBTTagCompound.setInteger("consumptionRate", consumptionRate); + par1NBTTagCompound.setInteger("drainRate", drainRate); + par1NBTTagCompound.setFloat("consumptionMultiplier", consumptionMultiplier); + par1NBTTagCompound.setFloat("efficiencyMultiplier", efficiencyMultiplier); + par1NBTTagCompound.setFloat("sacrificeEfficiencyMultiplier", sacrificeEfficiencyMultiplier); + par1NBTTagCompound.setFloat("selfSacrificeEfficiencyMultiplier", selfSacrificeEfficiencyMultiplier); + par1NBTTagCompound.setBoolean("isResultBlock", isResultBlock); + par1NBTTagCompound.setFloat("capacityMultiplier", capacityMultiplier); + par1NBTTagCompound.setFloat("orbCapacityMultiplier", orbCapacityMultiplier); + par1NBTTagCompound.setFloat("dislocationMultiplier", dislocationMultiplier); + par1NBTTagCompound.setInteger("capacity", capacity); + par1NBTTagCompound.setInteger("progress", progress); + par1NBTTagCompound.setInteger("bufferCapacity", bufferCapacity); + } + + @Override + public int getSizeInventory() + { + return inv.length; + } + + @Override + public ItemStack getStackInSlot(int slot) + { + return inv[slot]; + } + + @Override + public ItemStack decrStackSize(int slot, int amt) + { + ItemStack stack = getStackInSlot(slot); + + if (stack != null) + { + if (stack.stackSize <= amt) + { + setInventorySlotContents(slot, null); + } else + { + stack = stack.splitStack(amt); + + if (stack.stackSize == 0) + { + setInventorySlotContents(slot, null); + } + } + } + + return stack; + } + + @Override + public ItemStack getStackInSlotOnClosing(int slot) + { + ItemStack stack = getStackInSlot(slot); + + if (stack != null) + { + setInventorySlotContents(slot, null); + } + + return stack; + } + + @Override + public void setInventorySlotContents(int slot, ItemStack itemStack) + { + inv[slot] = itemStack; + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + + if (itemStack != null && itemStack.stackSize > getInventoryStackLimit()) + { + itemStack.stackSize = getInventoryStackLimit(); + } + } + + @Override + public String getInventoryName() + { + return "TEAltar"; + } + + @Override + public boolean hasCustomInventoryName() + { + return false; + } + + @Override + public int getInventoryStackLimit() + { + return 64; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityPlayer) + { + return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this && entityPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64; + } + + @Override + public void openInventory() + { + // TODO Auto-generated method stub + } + + @Override + public void closeInventory() + { + // TODO Auto-generated method stub + } + + //IFluidTank methods + @Override + public FluidStack getFluid() + { + return fluid; + } + + public FluidStack getInputFluid() + { + return fluidInput; + } + + public FluidStack getOutputFluid() + { + return fluidOutput; + } + + @Override + public int getFluidAmount() + { + if (fluid == null) + { + return 0; + } + + return fluid.amount; + } + + @Override + public int getCapacity() + { + return capacity; + } + + @Override + public FluidTankInfo getInfo() + { + return new FluidTankInfo(this); + } + + @Override + public int fill(FluidStack resource, boolean doFill) + { + TileEntity tile = this; + + if (resource == null) + { + return 0; + } + + if (resource.fluidID != (new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 1)).fluidID) + { + return 0; + } + + if (!doFill) + { + if (fluidInput == null) + { + return Math.min(bufferCapacity, resource.amount); + } + + if (!fluidInput.isFluidEqual(resource)) + { + return 0; + } + + return Math.min(bufferCapacity - fluidInput.amount, resource.amount); + } + + if (fluidInput == null) + { + fluidInput = new FluidStack(resource, Math.min(bufferCapacity, resource.amount)); + + if (tile != null) + { + FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this)); + } + + return fluidInput.amount; + } + + if (!fluidInput.isFluidEqual(resource)) + { + return 0; + } + + int filled = bufferCapacity - fluidInput.amount; + + if (resource.amount < filled) + { + fluidInput.amount += resource.amount; + filled = resource.amount; + } else + { + fluidInput.amount = bufferCapacity; + } + + if (tile != null) + { + FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this)); + } + + return filled; + } + + @Override + public FluidStack drain(int maxDrain, boolean doDrain) + { + if (fluidOutput == null) + { + return null; + } + + int drained = maxDrain; + + if (fluidOutput.amount < drained) + { + drained = fluidOutput.amount; + } + + FluidStack stack = new FluidStack(fluidOutput, drained); + + if (doDrain) + { + fluidOutput.amount -= drained; + + if (fluidOutput.amount <= 0) + { + fluidOutput = null; + } + + if (this != null) + { + FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(fluidOutput, this.worldObj, this.xCoord, this.yCoord, this.zCoord, this)); + } + } + + if (fluidOutput == null) + { + fluidOutput = new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 0); + } + + if (worldObj != null) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + return stack; + } + + //Logic for the actual block is under here + @Override + public void updateEntity() + { + //this.capacity=(int) (10000*this.capacityMultiplier); + if (!worldObj.isRemote && worldObj.getWorldTime() % 20 == 0) + { + //TODO + int syphonMax = (int) (20 * this.dislocationMultiplier); + int fluidInputted = 0; + int fluidOutputted = 0; + fluidInputted = Math.min(syphonMax, -this.fluid.amount + capacity); + fluidInputted = Math.min(this.fluidInput.amount, fluidInputted); + this.fluid.amount += fluidInputted; + this.fluidInput.amount -= fluidInputted; + fluidOutputted = Math.min(syphonMax, this.bufferCapacity - this.fluidOutput.amount); + fluidOutputted = Math.min(this.fluid.amount, fluidOutputted); + this.fluidOutput.amount += fluidOutputted; + this.fluid.amount -= fluidOutputted; + } + + if (worldObj.getWorldTime() % 150 == 0) + { + startCycle(); + } + + if (!isActive) + { + return; + } + + if (getStackInSlot(0) == null) + { + return; + } + + int worldTime = (int) (worldObj.getWorldTime() % 24000); + + if (worldObj.isRemote) + { + return; + } + + if (worldTime % 1 == 0) + { + if (!canBeFilled) + { + if (fluid != null && fluid.amount >= 1) + { + int stackSize = getStackInSlot(0).stackSize; + int liquidDrained = Math.min((int) (upgradeLevel >= 2 ? consumptionRate * (1 + consumptionMultiplier) : consumptionRate), fluid.amount); + + if (liquidDrained > (liquidRequired * stackSize - progress)) + { + liquidDrained = liquidRequired * stackSize - progress; + } + + fluid.amount = fluid.amount - liquidDrained; + progress += liquidDrained; + //getStackInSlot(0).setItemDamage(getStackInSlot(0).getItemDamage() + liquidDrained); + + if (worldTime % 4 == 0) + { + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); + } + + if (progress >= liquidRequired * stackSize) + { + ItemStack result = null; + result = AltarRecipeRegistry.getItemForItemAndTier(this.getStackInSlot(0), this.upgradeLevel); + if(result!=null) + { + result.stackSize*=stackSize; + } + +// if (!isResultBlock) +// { +// result = new ItemStack(resultID, stackSize, resultDamage); +// } else +// { +// result = new ItemStack(Block.blocksList[resultID], stackSize, 0); +// } + + setInventorySlotContents(0, result); + progress = 0; + + for (int i = 0; i < 8; i++) + { + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 4, xCoord+0.5f, yCoord+1.0f, zCoord+0.5f); + } + + //setInventorySlotContents(1, null); + this.isActive = false; + } + } else if (progress > 0) + { + progress -= (int) (efficiencyMultiplier * drainRate); + + if (worldTime % 2 == 0) + { + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 2, xCoord, yCoord, zCoord); + } + } + } else + { + ItemStack returnedItem = getStackInSlot(0); + + if (!(returnedItem.getItem() instanceof EnergyBattery)) + { + return; + } + + EnergyBattery item = (EnergyBattery) (returnedItem.getItem()); + NBTTagCompound itemTag = returnedItem.stackTagCompound; + + if (itemTag == null) + { + return; + } + + String ownerName = itemTag.getString("ownerName"); + + if (ownerName.equals("")) + { + return; + } + + //EntityPlayer owner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(itemTag.getString("ownerName")); + World world = MinecraftServer.getServer().worldServers[0]; + LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); + + if (data == null) + { + data = new LifeEssenceNetwork(ownerName); + world.setItemData(ownerName, data); + } + + int currentEssence = data.currentEssence; +// if(owner==null){return;} +// NBTTagCompound playerTag = owner.getEntityData(); +// if(playerTag==null){return;} + //int currentEssence=playerTag.getInteger("currentEssence"); + + if (fluid != null && fluid.amount >= 1) + { + int liquidDrained = Math.min((int) (upgradeLevel >= 2 ? consumptionRate * (1 + consumptionMultiplier) : consumptionRate), fluid.amount); + + if (liquidDrained > (item.getMaxEssence() * this.orbCapacityMultiplier - currentEssence)) + { + liquidDrained = (int) (item.getMaxEssence() * this.orbCapacityMultiplier - currentEssence); + } + + if (liquidDrained <= 0) + { + return; + } + + fluid.amount = fluid.amount - liquidDrained; +// int maxAmount = (int) Math.min(item.getMaxEssence() - consumptionRate * (1 + consumptionMultiplier), consumptionRate * (1 + consumptionMultiplier)); +// fluid.amount -= maxAmount; + data.currentEssence = liquidDrained + data.currentEssence; + data.markDirty(); +// playerTag.setInteger("currentEssence", currentEssence+maxAmount); + + if (worldTime % 4 == 0) + { + //PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short) 3)); + SpellHelper.sendIndexedParticleToAllAround(world, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 3, xCoord, yCoord, zCoord); + } + } + } + + if (worldObj != null) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + //AlchemicalWizardry.proxy.getClientWorld().markBlockForUpdate(xCoord, yCoord, zCoord); + //PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 10, 1, getDescriptionPacket()); + /* + progress++; + + if(progress>=liquidRequired) + { + setActive(); + setInventorySlotContents(0, new ItemStack(AlchemicalWizardry.weakBloodOrb)); + } + */ + } + } + + public void setActive() + { + isActive = false; + } + + public boolean isActive() + { + return isActive; + } + + public void sacrificialDaggerCall(int amount, boolean isSacrifice) + { + fluid.amount += Math.min(capacity - fluid.amount, (isSacrifice ? 1 + sacrificeEfficiencyMultiplier : 1 + selfSacrificeEfficiencyMultiplier) * amount); + } + + @Override + public Packet getDescriptionPacket() + { + return NewPacketHandler.getPacket(this); + } + + + public void handlePacketData(int[] intData, int[] fluidData, int capacity) + { + if (intData == null) + { + return; + } + + if (intData.length == 3) + { + for (int i = 0; i < 1; i++) + { + if (intData[i * 3 + 2] != 0) + { + ItemStack is = new ItemStack(Item.getItemById(intData[i * 3]), intData[i * 3 + 2], intData[i * 3 + 1]); + inv[i] = is; + } else + { + inv[i] = null; + } + } + } + + FluidStack flMain = new FluidStack(fluidData[0],fluidData[1]); + FluidStack flIn = new FluidStack(fluidData[2],fluidData[3]); + FluidStack flOut = new FluidStack(fluidData[4],fluidData[5]); + + this.setMainFluid(flMain); + this.setInputFluid(flIn); + this.setOutputFluid(flOut); + + this.capacity = capacity; + } + + public int[] buildIntDataList() + { + int[] sortList = new int[1 * 3]; + int pos = 0; + + for (ItemStack is : inv) + { + if (is != null) + { + sortList[pos++] = Item.getIdFromItem(is.getItem()); + sortList[pos++] = is.getItemDamage(); + sortList[pos++] = is.stackSize; + } else + { + sortList[pos++] = 0; + sortList[pos++] = 0; + sortList[pos++] = 0; + } + } + + return sortList; + } + + public void startCycle() + { + if (worldObj != null) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + this.checkAndSetAltar(); + + if (fluid == null || fluid.amount <= 0) + { + return; + } + + if (getStackInSlot(0) == null) + { + return; + } + + if (!isActive) + { + progress = 0; + } + + if(AltarRecipeRegistry.isRequiredItemValid(getStackInSlot(0), upgradeLevel)) + { + AltarRecipe recipe = AltarRecipeRegistry.getAltarRecipeForItemAndTier(getStackInSlot(0), upgradeLevel); + this.isActive = true; + this.liquidRequired = recipe.getLiquidRequired(); + this.canBeFilled = recipe.getCanBeFilled(); + this.consumptionRate = recipe.getConsumptionRate(); + this.drainRate = recipe.drainRate; + return; + } + + isActive = false; + } + + public void checkAndSetAltar() + { + boolean checkUpgrade = true; + int upgradeState = UpgradedAltars.isAltarValid(worldObj, xCoord, yCoord, zCoord); + + if (upgradeState <= 1) + { + upgradeLevel = 1; + isUpgraded = false; + this.consumptionMultiplier = 0; + this.efficiencyMultiplier = 1; + this.sacrificeEfficiencyMultiplier = 0; + this.selfSacrificeEfficiencyMultiplier = 0; + this.capacityMultiplier = 1; + this.orbCapacityMultiplier = 1; + this.dislocationMultiplier = 1; + return; + } + + AltarUpgradeComponent upgrades = UpgradedAltars.getUpgrades(worldObj, xCoord, yCoord, zCoord, upgradeState); + + if (upgrades == null) + { + upgradeLevel = 1; + isUpgraded = false; + this.consumptionMultiplier = 0; + this.efficiencyMultiplier = 1; + this.sacrificeEfficiencyMultiplier = 0; + this.selfSacrificeEfficiencyMultiplier = 0; + this.capacityMultiplier = 1; + this.orbCapacityMultiplier = 1; + this.dislocationMultiplier = 1; + this.upgradeLevel = upgradeState; + return; + } + + this.isUpgraded = checkUpgrade; + this.upgradeLevel = upgradeState; + this.consumptionMultiplier = (float) (0.15 * 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()); + //TODO finalize values + this.dislocationMultiplier = (float) (Math.pow(1.2, upgrades.getDisplacementUpgrades())); + this.orbCapacityMultiplier = (float) (1 + 0.02 * upgrades.getOrbCapacitiveUpgrades()); + this.capacity = (int) (FluidContainerRegistry.BUCKET_VOLUME * 10 * capacityMultiplier); + this.bufferCapacity = (int) (FluidContainerRegistry.BUCKET_VOLUME * 1 * capacityMultiplier); + + if (this.fluid.amount > this.capacity) + { + this.fluid.amount = this.capacity; + } + + if (this.fluidOutput.amount > this.bufferCapacity) + { + this.fluidOutput.amount = this.bufferCapacity; + } + + if (this.fluidInput.amount > this.bufferCapacity) + { + this.fluidInput.amount = this.bufferCapacity; + } + + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); +// for (int x = -1; x <= 1; x++) +// { +// for (int z = -1; z <= 1; z++) +// { +// if (!(x == 0 && z == 0)) +// { +// Block block = Block.blocksList[worldObj.getBlockId(xCoord + x, yCoord - 1, zCoord + z)]; +// +// if (!(block instanceof BloodRune)) +// { +// checkUpgrade = false; +// this.isUpgraded = false; +// return; +// } +// +// if ((z == 0 && (x == -1 || x == 1)) || (x == 0 && (z == -1 || z == 1))) +// { +// switch (((BloodRune)block).getRuneEffect()) +// { +// case 1: +// speedUpgrades++; +// +// case 2: +// efficiencyUpgrades++; +// +// case 3: +// sacrificeUpgrades++; +// +// case 4: +// selfSacrificeUpgrades++; +// } +// } +// } +// } +// } +// this.isUpgraded = checkUpgrade; +// this.consumptionMultiplier = (float)(0.20 * speedUpgrades); +// this.efficiencyMultiplier = (float)Math.pow(0.80, efficiencyUpgrades); +// this.sacrificeEfficiencyMultiplier = (float)(0.10 * sacrificeUpgrades); +// this.selfSacrificeEfficiencyMultiplier = (float)(0.10 * sacrificeUpgrades); + } + + @Override + public boolean isItemValidForSlot(int slot, ItemStack itemstack) + { + if (slot == 0) + { + return true; + } + + return false; + } + + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) + { + //TODO + if (resource == null) + { + return 0; + } + + resource = resource.copy(); + int totalUsed = 0; + //TileTank tankToFill = getBottomTank(); + int used = this.fill(resource, doFill); + resource.amount -= used; + totalUsed += used; + //FluidStack liquid = tankToFill.tank.getFluid(); +// if (liquid != null && liquid.amount > 0 && !liquid.isFluidEqual(resource)) +// { +// return 0; +// } +// while (tankToFill != null && resource.amount > 0) +// { +// int used = tankToFill.tank.fill(resource, doFill); +// resource.amount -= used; +// if (used > 0) +// { +// tankToFill.hasUpdate = true; +// } +// +// +// totalUsed += used; +// tankToFill = getTankAbove(tankToFill); +// } + this.startCycle(); + return totalUsed; + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) + { + if (resource == null) + { + return null; + } + + if (!resource.isFluidEqual(fluidOutput)) + { + return null; + } + + return drain(from, resource.amount, doDrain); + } + + @Override + public FluidStack drain(ForgeDirection from, int maxEmpty, boolean doDrain) + { + return this.drain(maxEmpty, doDrain); + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) + { + // TODO Auto-generated method stub + if (this.fluidInput != null && this.fluid.getFluid().equals(fluidInput)) + { + return true; + } + + return false; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) + { + // TODO Auto-generated method stub + return true; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) + { + // TODO Auto-generated method stub + FluidTank compositeTank = new FluidTank(capacity); + compositeTank.setFluid(fluid); + return new FluidTankInfo[]{compositeTank.getInfo()}; + } + + public int[] buildFluidList() + { + int[] sortList = new int[6]; + + if(this.fluid == null) + { + sortList[0] = AlchemicalWizardry.lifeEssenceFluid.getID(); + sortList[1] = 0; + }else + { + sortList[0] = this.fluid.fluidID; + sortList[1] = this.fluid.amount; + } + + if(this.fluidInput == null) + { + sortList[2] = AlchemicalWizardry.lifeEssenceFluid.getID(); + sortList[3] = 0; + }else + { + sortList[2] = this.fluidInput.fluidID; + sortList[3] = this.fluidInput.amount; + } + + if(this.fluidOutput == null) + { + sortList[4] = AlchemicalWizardry.lifeEssenceFluid.getID(); + sortList[5] = 0; + }else + { + sortList[4] = this.fluidOutput.fluidID; + sortList[5] = this.fluidOutput.amount; + } + + return sortList; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEConduit.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEConduit.java new file mode 100644 index 00000000..4b5fe8bc --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEConduit.java @@ -0,0 +1,40 @@ +package WayofTime.alchemicalWizardry.common.tileEntity; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigm; + +public class TEConduit extends TESpellBlock +{ + @Override + public void readFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readFromNBT(par1NBTTagCompound); + } + + @Override + public void writeToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeToNBT(par1NBTTagCompound); + } + + //Logic for the actual block is under here + @Override + public void updateEntity() + { + + } + + @Override + public Packet getDescriptionPacket() + { + return super.getDescriptionPacket(); + } + + @Override + protected void applySpellChange(SpellParadigm parad) + { + return; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEHomHeart.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEHomHeart.java new file mode 100644 index 00000000..180b0d35 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEHomHeart.java @@ -0,0 +1,167 @@ +package WayofTime.alchemicalWizardry.common.tileEntity; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.spell.simple.HomSpell; +import WayofTime.alchemicalWizardry.common.spell.simple.HomSpellRegistry; + +public class TEHomHeart extends TileEntity +{ + public boolean canCastSpell(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + return true; + } + + public int castSpell(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + HomSpell spell = getSpell(); + + if (spell != null) + { + switch (getModifiedParadigm()) + { + case 0: + spell.onOffensiveRangedRightClick(par1ItemStack, par2World, par3EntityPlayer); + break; + + case 1: + spell.onOffensiveMeleeRightClick(par1ItemStack, par2World, par3EntityPlayer); + break; + + case 2: + spell.onDefensiveRightClick(par1ItemStack, par2World, par3EntityPlayer); + break; + + case 3: + spell.onEnvironmentalRightClick(par1ItemStack, par2World, par3EntityPlayer); + break; + } + + //spell.onOffensiveRangedRightClick(par1ItemStack, par2World, par3EntityPlayer); + } + + return 0; + } + + public HomSpell getSpell() + { + TileEntity tileEntity = worldObj.getTileEntity(xCoord - 1, yCoord, zCoord); + + if (tileEntity instanceof TEAltar) + { + ItemStack itemStack = ((TEAltar) tileEntity).getStackInSlot(0); + + if (itemStack != null) + { + HomSpell spell = HomSpellRegistry.getSpellForItemStack(itemStack); + + if (spell != null) + { + return spell; + } + } + } + + tileEntity = worldObj.getTileEntity(xCoord + 1, yCoord, zCoord); + + if (tileEntity instanceof TEAltar) + { + ItemStack itemStack = ((TEAltar) tileEntity).getStackInSlot(0); + + if (itemStack != null) + { + HomSpell spell = HomSpellRegistry.getSpellForItemStack(itemStack); + + if (spell != null) + { + return spell; + } + } + } + + tileEntity = worldObj.getTileEntity(xCoord, yCoord, zCoord - 1); + + if (tileEntity instanceof TEAltar) + { + ItemStack itemStack = ((TEAltar) tileEntity).getStackInSlot(0); + + if (itemStack != null) + { + HomSpell spell = HomSpellRegistry.getSpellForItemStack(itemStack); + + if (spell != null) + { + return spell; + } + } + } + + tileEntity = worldObj.getTileEntity(xCoord, yCoord, zCoord + 1); + + if (tileEntity instanceof TEAltar) + { + ItemStack itemStack = ((TEAltar) tileEntity).getStackInSlot(0); + + if (itemStack != null) + { + HomSpell spell = HomSpellRegistry.getSpellForItemStack(itemStack); + + if (spell != null) + { + return spell; + } + } + } + + return null; + } + + public int getModifiedParadigm() + { + //TODO change so that it works with a Tile Entity for a custom head or whatnot + Block block = worldObj.getBlock(xCoord, yCoord + 1, zCoord); + + if (block == Blocks.glowstone) + { + return 0; + } else if (block == Blocks.redstone_block) + { + return 1; + } else if (block == Blocks.anvil) + { + return 2; + } else if (block == Blocks.glass) + { + return 3; + } + + TileEntity tileEntity = worldObj.getTileEntity(xCoord, yCoord + 1, zCoord); + + if (tileEntity instanceof TileEntitySkull) + { + int skullType = ((TileEntitySkull) tileEntity).func_145904_a(); + + switch (skullType) + { + case 0: + return 0; + + case 1: + return 1; + + case 2: + return 2; + + case 4: + return 3; + } + } + + return -1; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEHomHeartRenderer.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEHomHeartRenderer.java new file mode 100644 index 00000000..859a3b9c --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEHomHeartRenderer.java @@ -0,0 +1,13 @@ +package WayofTime.alchemicalWizardry.common.tileEntity; + +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; + +public class TEHomHeartRenderer extends TileEntitySpecialRenderer +{ + @Override + public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) + { + // TODO Auto-generated method stub + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEImperfectRitualStone.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEImperfectRitualStone.java new file mode 100644 index 00000000..110996ea --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEImperfectRitualStone.java @@ -0,0 +1,11 @@ +package WayofTime.alchemicalWizardry.common.tileEntity; + +import net.minecraft.tileentity.TileEntity; + +public class TEImperfectRitualStone extends TileEntity +{ + public TEImperfectRitualStone() + { + // TODO Auto-generated constructor stub + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMasterStone.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMasterStone.java new file mode 100644 index 00000000..37fa9e98 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMasterStone.java @@ -0,0 +1,193 @@ +package WayofTime.alchemicalWizardry.common.tileEntity; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork; +import WayofTime.alchemicalWizardry.common.rituals.Rituals; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class TEMasterStone extends TileEntity +{ + private int currentRitual; + private boolean isActive; + private String owner; + private int cooldown; + private int var1; + private int direction; + + public TEMasterStone() + { + currentRitual = 0; + isActive = false; + owner = ""; + cooldown = 0; + var1 = 0; + direction = 0; + } + + @Override + public void readFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readFromNBT(par1NBTTagCompound); + currentRitual = par1NBTTagCompound.getInteger("currentRitual"); + isActive = par1NBTTagCompound.getBoolean("isActive"); + owner = par1NBTTagCompound.getString("owner"); + cooldown = par1NBTTagCompound.getInteger("cooldown"); + var1 = par1NBTTagCompound.getInteger("var1"); + direction = par1NBTTagCompound.getInteger("direction"); + } + + @Override + public void writeToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeToNBT(par1NBTTagCompound); + par1NBTTagCompound.setInteger("currentRitual", currentRitual); + par1NBTTagCompound.setBoolean("isActive", isActive); + par1NBTTagCompound.setString("owner", owner); + par1NBTTagCompound.setInteger("cooldown", cooldown); + par1NBTTagCompound.setInteger("var1", var1); + par1NBTTagCompound.setInteger("direction", direction); + } + + public void activateRitual(World world, int crystalLevel) + { + int testRitual = Rituals.checkValidRitual(world, xCoord, yCoord, zCoord); + + if (testRitual == 0) + { + return; + } + + boolean testLevel = Rituals.canCrystalActivate(testRitual, crystalLevel); + + if (!testLevel) + { + return; + } + + if (world.isRemote) + { + return; + } + + 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; + + if (currentEssence < Rituals.getCostForActivation(testRitual)) + { + //TODO Bad stuff + return; + } + + if (!world.isRemote) + { + data.currentEssence = currentEssence - Rituals.getCostForActivation(testRitual); + data.markDirty(); + + for (int i = 0; i < 12; i++) + { + SpellHelper.sendIndexedParticleToAllAround(world, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); + } + } + + cooldown = Rituals.getInitialCooldown(testRitual); + var1 = 0; + currentRitual = testRitual; + isActive = true; + direction = Rituals.getDirectionOfRitual(world, xCoord, yCoord, zCoord, testRitual); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + public void setOwner(String owner) + { + this.owner = owner; + } + + @Override + public void updateEntity() + { + if (!isActive) + { + return; + } + + int worldTime = (int) (worldObj.getWorldTime() % 24000); + + if (worldObj.isRemote) + { + return; + } + + if (worldTime % 100 == 0) + { + boolean testRunes = Rituals.checkDirectionOfRitualValid(worldObj, xCoord, yCoord, zCoord, currentRitual, direction); + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); + + if (!testRunes) + { + isActive = false; + currentRitual = 0; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + //PacketDispatcher.sendPacketToAllPlayers(TEAltar.getParticlePacket(xCoord, yCoord, zCoord, (short)3)); + return; + } + } + + if (worldObj.getBlockPowerInput(xCoord, yCoord, zCoord) > 0) + { + return; + } + + performRitual(worldObj, xCoord, yCoord, zCoord, currentRitual); + } + + public void performRitual(World world, int x, int y, int z, int ritualID) + { + Rituals.performEffect(this, ritualID); + } + + public String getOwner() + { + return owner; + } + + public void setCooldown(int newCooldown) + { + this.cooldown = newCooldown; + } + + public int getCooldown() + { + return this.cooldown; + } + + public void setVar1(int newVar1) + { + this.var1 = newVar1; + } + + public int getVar1() + { + return this.var1; + } + + public void setActive(boolean active) + { + this.isActive = active; + } + + public int getDirection() + { + return this.direction; + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEOrientable.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEOrientable.java new file mode 100644 index 00000000..d156f352 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEOrientable.java @@ -0,0 +1,107 @@ +package WayofTime.alchemicalWizardry.common.tileEntity; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import WayofTime.alchemicalWizardry.common.NewPacketHandler; +import WayofTime.alchemicalWizardry.common.block.IOrientable; + +public class TEOrientable extends TileEntity implements IOrientable +{ + protected ForgeDirection inputFace; + protected ForgeDirection outputFace; + + public TEOrientable() + { + this.inputFace = ForgeDirection.DOWN; + this.outputFace = ForgeDirection.UP; + } + + @Override + public void readFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readFromNBT(par1NBTTagCompound); + this.setInputDirection(ForgeDirection.getOrientation(par1NBTTagCompound.getInteger("inputFace"))); + this.setOutputDirection(ForgeDirection.getOrientation(par1NBTTagCompound.getInteger("outputFace"))); + } + + @Override + public void writeToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeToNBT(par1NBTTagCompound); + par1NBTTagCompound.setInteger("inputFace", TEOrientable.getIntForForgeDirection(this.getInputDirection())); + par1NBTTagCompound.setInteger("outputFace", TEOrientable.getIntForForgeDirection(this.getOutputDirection())); + } + + @Override + public ForgeDirection getInputDirection() + { + return this.inputFace; + } + + @Override + public ForgeDirection getOutputDirection() + { + return this.outputFace; + } + + @Override + public void setInputDirection(ForgeDirection direction) + { + this.inputFace = direction; + } + + @Override + public void setOutputDirection(ForgeDirection direction) + { + this.outputFace = direction; + } + + public static int getIntForForgeDirection(ForgeDirection direction) + { + switch (direction) + { + case DOWN: + return 0; + + case UP: + return 1; + + case NORTH: + return 2; + + case SOUTH: + return 3; + + case WEST: + return 4; + + case EAST: + return 5; + + default: + return 0; + } + } + + @Override + public Packet getDescriptionPacket() + { + return NewPacketHandler.getPacket(this); + } + + public boolean isSideRendered(ForgeDirection side) + { + if(side.equals(this.getInputDirection()) || side.equals(this.getOutputDirection())) + { + return true; + } + return false; + } + + public String getResourceLocationForMeta(int meta) + { + return ""; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPedestal.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPedestal.java new file mode 100644 index 00000000..c49c520a --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPedestal.java @@ -0,0 +1,267 @@ +package WayofTime.alchemicalWizardry.common.tileEntity; + +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.Constants; +import WayofTime.alchemicalWizardry.common.NewPacketHandler; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class TEPedestal extends TileEntity implements IInventory +{ + private ItemStack[] inv; + private int resultID; + private int resultDamage; + public static final int sizeInv = 1; + + private boolean isActive; + + public TEPedestal() + { + this.inv = new ItemStack[1]; + resultID = 0; + resultDamage = 0; + isActive = false; + } + + @Override + public void readFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readFromNBT(par1NBTTagCompound); + NBTTagList tagList = par1NBTTagCompound.getTagList("Inventory", Constants.NBT.TAG_COMPOUND); + + for (int i = 0; i < tagList.tagCount(); i++) + { + NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); + int slot = tag.getByte("Slot"); + + if (slot >= 0 && slot < inv.length) + { + inv[slot] = ItemStack.loadItemStackFromNBT(tag); + } + } + + resultID = par1NBTTagCompound.getInteger("resultID"); + resultDamage = par1NBTTagCompound.getInteger("resultDamage"); + isActive = par1NBTTagCompound.getBoolean("isActive"); + } + + @Override + public void writeToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeToNBT(par1NBTTagCompound); + NBTTagList itemList = new NBTTagList(); + + for (int i = 0; i < inv.length; i++) + { + ItemStack stack = inv[i]; + + if (inv[i] != null) + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setByte("Slot", (byte) i); + inv[i].writeToNBT(tag); + itemList.appendTag(tag); + } + } + + par1NBTTagCompound.setInteger("resultID", resultID); + par1NBTTagCompound.setInteger("resultDamage", resultDamage); + par1NBTTagCompound.setTag("Inventory", itemList); + par1NBTTagCompound.setBoolean("isActive", isActive); + } + + @Override + public int getSizeInventory() + { + return 1; + } + + @Override + public ItemStack getStackInSlot(int slot) + { + return inv[slot]; + } + + @Override + public ItemStack decrStackSize(int slot, int amt) + { + ItemStack stack = getStackInSlot(slot); + + if (stack != null) + { + if (stack.stackSize <= amt) + { + setInventorySlotContents(slot, null); + } else + { + stack = stack.splitStack(amt); + + if (stack.stackSize == 0) + { + setInventorySlotContents(slot, null); + } + } + } + + return stack; + } + + @Override + public ItemStack getStackInSlotOnClosing(int slot) + { + ItemStack stack = getStackInSlot(slot); + + if (stack != null) + { + setInventorySlotContents(slot, null); + } + + return stack; + } + + @Override + public void setInventorySlotContents(int slot, ItemStack itemStack) + { + inv[slot] = itemStack; + + if (itemStack != null && itemStack.stackSize > getInventoryStackLimit()) + { + itemStack.stackSize = getInventoryStackLimit(); + } + } + + @Override + public String getInventoryName() + { + return "TEPedestal"; + } + + @Override + public boolean hasCustomInventoryName() + { + return false; + } + + @Override + public int getInventoryStackLimit() + { + return 1; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityPlayer) + { + return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this && entityPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64; + } + + @Override + public void openInventory() + { + // TODO Auto-generated method stub + } + + @Override + public void closeInventory() + { + // TODO Auto-generated method stub + } + + //Logic for the actual block is under here + @Override + public void updateEntity() + { + super.updateEntity(); + } + + public void setActive() + { + isActive = false; + } + + public boolean isActive() + { + return isActive; + } + + @Override + public Packet getDescriptionPacket() + { + return NewPacketHandler.getPacket(this); + } + + public void handlePacketData(int[] intData) + { + if (intData == null) + { + return; + } + + if (intData.length == 3) + { + for (int i = 0; i < 1; i++) + { + if (intData[i * 3 + 2] != 0) + { + ItemStack is = new ItemStack(Item.getItemById(intData[i * 3]), intData[i * 3 + 2], intData[i * 3 + 1]); + inv[i] = is; + } else + { + inv[i] = null; + } + } + } + } + + public int[] buildIntDataList() + { + int[] sortList = new int[1 * 3]; + int pos = 0; + + for (ItemStack is : inv) + { + if (is != null) + { + sortList[pos++] = Item.getIdFromItem(is.getItem()); + sortList[pos++] = is.getItemDamage(); + sortList[pos++] = is.stackSize; + } else + { + sortList[pos++] = 0; + sortList[pos++] = 0; + sortList[pos++] = 0; + } + } + + return sortList; + } + + @Override + public boolean isItemValidForSlot(int slot, ItemStack itemstack) + { + if (slot == 0) + { + return true; + } + + return false; + } + + public void onItemDeletion() + { + //worldObj.createExplosion(null, xCoord+0.5, yCoord+0.5, zCoord+0.5, 1, false); + worldObj.addWeatherEffect(new EntityLightningBolt(worldObj, xCoord, yCoord, zCoord)); + + for (int i = 0; i < 16; i++) + { + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 2, xCoord, yCoord, zCoord); + } + } + +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPlinth.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPlinth.java new file mode 100644 index 00000000..4995d574 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEPlinth.java @@ -0,0 +1,689 @@ +package WayofTime.alchemicalWizardry.common.tileEntity; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.Constants; +import net.minecraftforge.oredict.OreDictionary; +import WayofTime.alchemicalWizardry.common.IDemon; +import WayofTime.alchemicalWizardry.common.NewPacketHandler; +import WayofTime.alchemicalWizardry.common.PlinthComponent; +import WayofTime.alchemicalWizardry.common.items.EnergyBattery; +import WayofTime.alchemicalWizardry.common.summoning.SummoningRegistry; +import WayofTime.alchemicalWizardry.common.summoning.SummoningRegistryComponent; + +public class TEPlinth extends TileEntity implements IInventory +{ + private ItemStack[] inv; + + private boolean isActive; + private boolean paradigm; + + private ItemStack[] ring1Inv; + private ItemStack[] ring2Inv; + private ItemStack[] ring3Inv; + + public static final int sizeInv = 1; + + private int progressInterval; + private int progress; + + public static List pedestalPositions = new ArrayList(); + + public TEPlinth() + { + this.inv = new ItemStack[1]; + this.ring1Inv = new ItemStack[6]; + this.ring2Inv = new ItemStack[6]; + this.ring3Inv = new ItemStack[6]; + isActive = false; + progress = 0; + progressInterval = 50; + } + + @Override + public void readFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readFromNBT(par1NBTTagCompound); + NBTTagList tagList = par1NBTTagCompound.getTagList("Inventory",Constants.NBT.TAG_COMPOUND); + + for (int i = 0; i < tagList.tagCount(); i++) + { + NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); + int slot = tag.getByte("Slot"); + + if (slot >= 0 && slot < inv.length) + { + inv[slot] = ItemStack.loadItemStackFromNBT(tag); + } + } + + NBTTagList ring1TagList = par1NBTTagCompound.getTagList("ring1Inv",Constants.NBT.TAG_COMPOUND); + + for (int i = 0; i < ring1TagList.tagCount(); i++) + { + NBTTagCompound tag = (NBTTagCompound) ring1TagList.getCompoundTagAt(i); + int slot = tag.getByte("Slot"); + + if (slot >= 0 && slot < inv.length) + { + ring1Inv[slot] = ItemStack.loadItemStackFromNBT(tag); + } + } + + NBTTagList ring2TagList = par1NBTTagCompound.getTagList("ring2Inv",Constants.NBT.TAG_COMPOUND); + + for (int i = 0; i < ring2TagList.tagCount(); i++) + { + NBTTagCompound tag = (NBTTagCompound) ring2TagList.getCompoundTagAt(i); + int slot = tag.getByte("Slot"); + + if (slot >= 0 && slot < inv.length) + { + ring2Inv[slot] = ItemStack.loadItemStackFromNBT(tag); + } + } + + NBTTagList ring3TagList = par1NBTTagCompound.getTagList("ring3Inv",Constants.NBT.TAG_COMPOUND); + + for (int i = 0; i < ring3TagList.tagCount(); i++) + { + NBTTagCompound tag = (NBTTagCompound) ring3TagList.getCompoundTagAt(i); + int slot = tag.getByte("Slot"); + + if (slot >= 0 && slot < inv.length) + { + ring3Inv[slot] = ItemStack.loadItemStackFromNBT(tag); + } + } + + progress = par1NBTTagCompound.getInteger("progress"); + progressInterval = par1NBTTagCompound.getInteger("progressInterval"); + isActive = par1NBTTagCompound.getBoolean("isActive"); + } + + @Override + public void writeToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeToNBT(par1NBTTagCompound); + NBTTagList itemList = new NBTTagList(); + + for (int i = 0; i < inv.length; i++) + { + ItemStack stack = inv[i]; + + if (inv[i] != null) + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setByte("Slot", (byte) i); + inv[i].writeToNBT(tag); + itemList.appendTag(tag); + } + } + + par1NBTTagCompound.setTag("Inventory", itemList); + NBTTagList ring1ItemList = new NBTTagList(); + + for (int i = 0; i < ring1Inv.length; i++) + { + ItemStack stack = ring1Inv[i]; + + if (ring1Inv[i] != null) + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setByte("Slot", (byte) i); + ring1Inv[i].writeToNBT(tag); + ring1ItemList.appendTag(tag); + } + } + + par1NBTTagCompound.setTag("ring1Inv", ring1ItemList); + NBTTagList ring2ItemList = new NBTTagList(); + + for (int i = 0; i < ring2Inv.length; i++) + { + ItemStack stack = ring2Inv[i]; + + if (ring2Inv[i] != null) + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setByte("Slot", (byte) i); + ring2Inv[i].writeToNBT(tag); + ring2ItemList.appendTag(tag); + } + } + + par1NBTTagCompound.setTag("ring2Inv", ring1ItemList); + NBTTagList ring3ItemList = new NBTTagList(); + + for (int i = 0; i < ring3Inv.length; i++) + { + ItemStack stack = ring3Inv[i]; + + if (ring3Inv[i] != null) + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setByte("Slot", (byte) i); + ring3Inv[i].writeToNBT(tag); + ring3ItemList.appendTag(tag); + } + } + + par1NBTTagCompound.setTag("ring3Inv", ring1ItemList); + par1NBTTagCompound.setInteger("progress", progress); + par1NBTTagCompound.setInteger("progressInterval", progressInterval); + par1NBTTagCompound.setBoolean("isActive", isActive); + } + + @Override + public int getSizeInventory() + { + return 1; + } + + @Override + public ItemStack getStackInSlot(int slot) + { + return inv[slot]; + } + + @Override + public ItemStack decrStackSize(int slot, int amt) + { + ItemStack stack = getStackInSlot(slot); + + if (stack != null) + { + if (stack.stackSize <= amt) + { + setInventorySlotContents(slot, null); + } else + { + stack = stack.splitStack(amt); + + if (stack.stackSize == 0) + { + setInventorySlotContents(slot, null); + } + } + } + + return stack; + } + + @Override + public ItemStack getStackInSlotOnClosing(int slot) + { + ItemStack stack = getStackInSlot(slot); + + if (stack != null) + { + setInventorySlotContents(slot, null); + } + + return stack; + } + + @Override + public void setInventorySlotContents(int slot, ItemStack itemStack) + { + inv[slot] = itemStack; + + if (itemStack != null && itemStack.stackSize > getInventoryStackLimit()) + { + itemStack.stackSize = getInventoryStackLimit(); + } + } + + @Override + public String getInventoryName() + { + return "TEPlinth"; + } + + @Override + public boolean hasCustomInventoryName() + { + return false; + } + + @Override + public int getInventoryStackLimit() + { + return 1; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityPlayer) + { + return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this && entityPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64; + } + + @Override + public void openInventory() + { + // TODO Auto-generated method stub + } + + @Override + public void closeInventory() + { + // TODO Auto-generated method stub + } + + //Logic for the actual block is under here + @Override + public void updateEntity() + { + super.updateEntity(); + + if (worldObj.isRemote) + { + return; + } + + if (!isActive()) + { + if (getStackInSlot(0) != null && getStackInSlot(0).getItem() instanceof EnergyBattery) + { + int bloodOrbLevel = ((EnergyBattery) getStackInSlot(0).getItem()).getOrbLevel(); + + if (SummoningRegistry.isRecipeValid(bloodOrbLevel, composeItemsForRingAndParadigm(1, true), composeItemsForRingAndParadigm(2, true), composeItemsForRingAndParadigm(3, true))) + { + SummoningRegistryComponent src = SummoningRegistry.getRegistryComponent(bloodOrbLevel, composeItemsForRingAndParadigm(1, true), composeItemsForRingAndParadigm(2, true), composeItemsForRingAndParadigm(3, true)); + isActive = true; + paradigm = true; + progress = 0; + ring1Inv = src.getRingRecipeForRing(1); + ring2Inv = src.getRingRecipeForRing(2); + ring3Inv = src.getRingRecipeForRing(3); + } else if (SummoningRegistry.isRecipeValid(bloodOrbLevel, composeItemsForRingAndParadigm(1, false), composeItemsForRingAndParadigm(2, false), composeItemsForRingAndParadigm(3, false))) + { + SummoningRegistryComponent src = SummoningRegistry.getRegistryComponent(bloodOrbLevel, composeItemsForRingAndParadigm(1, false), composeItemsForRingAndParadigm(2, false), composeItemsForRingAndParadigm(3, false)); + isActive = true; + paradigm = false; + progress = 0; + ring1Inv = src.getRingRecipeForRing(1); + ring2Inv = src.getRingRecipeForRing(2); + ring3Inv = src.getRingRecipeForRing(3); + } else + { + isActive = false; + progress = 0; + } + } + } else + { + if (getStackInSlot(0) != null && getStackInSlot(0).getItem() instanceof EnergyBattery) + { + if (progress % progressInterval == 0) + { + int ring = (progress / progressInterval) / 6 + 1; + int slot = (progress / progressInterval) % 6; + ItemStack itemStack; + + switch (ring) + { + case 1: + itemStack = this.ring1Inv[slot]; + break; + + case 2: + itemStack = this.ring2Inv[slot]; + break; + + case 3: + itemStack = this.ring3Inv[slot]; + break; + + default: + itemStack = null; + } + + if (itemStack == null) + { + progress += progressInterval; + } else + { + if (this.deleteItemStackInRing(ring, itemStack)) + { + progress++; + } + } + } else + { + progress++; + } + + if (progress >= progressInterval * 18) + { + int bloodOrbLevel = ((EnergyBattery) getStackInSlot(0).getItem()).getOrbLevel(); + EntityLivingBase entity = SummoningRegistry.getEntity(worldObj, bloodOrbLevel, ring1Inv, ring2Inv, ring3Inv); + //EntityLivingBase entity = new EntityFallenAngel(worldObj); + + if (entity != null) + { + //entity.worldObj = worldObj; + entity.setPosition(xCoord + 0.5, yCoord + 1, zCoord + 0.5); + worldObj.spawnEntityInWorld(entity); + + if (entity instanceof IDemon) + { + ((IDemon) entity).setSummonedConditions(); + } + + worldObj.createExplosion(entity, entity.posX, entity.posY, entity.posZ, 3, false); + deleteItemsInRing(1); + isActive = false; + progress = 0; + + if (worldObj != null) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + } + } + } + } + } + + public void deleteItemsInRing(int ring) + { + if (paradigm) + { + int i = 0; + + for (PlinthComponent pc : pedestalPositions) + { + if (i < 6 && pc.getRing() == ring) + { + TileEntity tileEntity = worldObj.getTileEntity(xCoord + pc.xOffset, yCoord + pc.yOffset, zCoord + pc.zOffset); + + if (tileEntity instanceof TEPedestal) + { + ((TEPedestal) tileEntity).setInventorySlotContents(0, null); + worldObj.markBlockForUpdate(xCoord + pc.xOffset, yCoord + pc.yOffset, zCoord + pc.zOffset); + i++; + } + } + } + } else + { + int i = 0; + + for (PlinthComponent pc : pedestalPositions) + { + if (i < 6 && pc.getRing() == ring) + { + TileEntity tileEntity = worldObj.getTileEntity(xCoord + pc.zOffset, yCoord + pc.yOffset, zCoord + pc.xOffset); + + if (tileEntity instanceof TEPedestal) + { + ((TEPedestal) tileEntity).setInventorySlotContents(0, null); + worldObj.markBlockForUpdate(xCoord + pc.zOffset, yCoord + pc.yOffset, zCoord + pc.xOffset); + i++; + } + } + } + } + } + + public boolean deleteItemStackInRing(int ring, ItemStack itemStack) + { + if (itemStack == null) + { + return true; + } + + if (paradigm) + { + int i = 0; + + for (PlinthComponent pc : pedestalPositions) + { + if (i < 6 && pc.getRing() == ring) + { + TileEntity tileEntity = worldObj.getTileEntity(xCoord + pc.xOffset, yCoord + pc.yOffset, zCoord + pc.zOffset); + + if (tileEntity instanceof TEPedestal) + { + ItemStack possibleItem = ((TEPedestal) tileEntity).getStackInSlot(0); + + if (possibleItem == null) + { + i++; + continue; + } + + boolean test = false; + + if (possibleItem.getItem() instanceof ItemBlock) + { + if (itemStack.getItem() instanceof ItemBlock) + { + test = true; + } + } else if (!(itemStack.getItem() instanceof ItemBlock)) + { + test = true; + } + + if (test) + { + if (itemStack.getItem()== possibleItem.getItem() && (itemStack.getItemDamage() == possibleItem.getItemDamage() || itemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE)) + { + ((TEPedestal) tileEntity).decrStackSize(0, 1); + ((TEPedestal) tileEntity).onItemDeletion(); + worldObj.markBlockForUpdate(xCoord + pc.xOffset, yCoord + pc.yOffset, zCoord + pc.zOffset); + return true; + } + } + + i++; + } + } + } + } else + { + int i = 0; + + for (PlinthComponent pc : pedestalPositions) + { + if (i < 6 && pc.getRing() == ring) + { + TileEntity tileEntity = worldObj.getTileEntity(xCoord + pc.zOffset, yCoord + pc.yOffset, zCoord + pc.xOffset); + + if (tileEntity instanceof TEPedestal) + { + ItemStack possibleItem = ((TEPedestal) tileEntity).getStackInSlot(0); + + if (possibleItem == null) + { + i++; + continue; + } + + boolean test = false; + + if (possibleItem.getItem() instanceof ItemBlock) + { + if (itemStack.getItem() instanceof ItemBlock) + { + test = true; + } + } else if (!(itemStack.getItem() instanceof ItemBlock)) + { + test = true; + } + + if (test) + { + if (itemStack.getItem() == possibleItem.getItem() && (itemStack.getItemDamage() == possibleItem.getItemDamage() || itemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE)) + { + ((TEPedestal) tileEntity).decrStackSize(0, 1); + ((TEPedestal) tileEntity).onItemDeletion(); + //worldObj.markBlockForUpdate(xCoord + pc.xOffset, yCoord + pc.yOffset, zCoord + pc.zOffset); + worldObj.markBlockForUpdate(xCoord + pc.zOffset, yCoord + pc.yOffset, zCoord + pc.zOffset); + return true; + } + } + + i++; + } + } + } + } + + return false; + } + + public ItemStack[] composeItemsForRingAndParadigm(int ring, boolean paradigm) + { + ItemStack[] composed = new ItemStack[6]; + + if (paradigm) + { + int i = 0; + + for (PlinthComponent pc : pedestalPositions) + { + if (i < 6 && pc.getRing() == ring) + { + TileEntity tileEntity = worldObj.getTileEntity(xCoord + pc.xOffset, yCoord + pc.yOffset, zCoord + pc.zOffset); + + if (tileEntity instanceof TEPedestal) + { + composed[i] = ((TEPedestal) tileEntity).getStackInSlot(0); + i++; + } + } + } + } else + { + int i = 0; + + for (PlinthComponent pc : pedestalPositions) + { + if (i < 6 && pc.getRing() == ring) + { + TileEntity tileEntity = worldObj.getTileEntity(xCoord + pc.zOffset, yCoord + pc.yOffset, zCoord + pc.xOffset); + + if (tileEntity instanceof TEPedestal) + { + composed[i] = ((TEPedestal) tileEntity).getStackInSlot(0); + i++; + } + } + } + } + + return composed; + } + + public void setActive() + { + isActive = false; + } + + public boolean isActive() + { + return isActive; + } + + @Override + public Packet getDescriptionPacket() + { + return NewPacketHandler.getPacket(this); + } + + public void handlePacketData(int[] intData) + { + if (intData == null) + { + return; + } + + if (intData.length == 3) + { + for (int i = 0; i < 1; i++) + { + if (intData[i * 3 + 2] != 0) + { + ItemStack is = new ItemStack(Item.getItemById(intData[i * 3]), intData[i * 3 + 2], intData[i * 3 + 1]); + inv[i] = is; + } else + { + inv[i] = null; + } + } + } + } + + public int[] buildIntDataList() + { + int[] sortList = new int[1 * 3]; + int pos = 0; + + for (ItemStack is : inv) + { + if (is != null) + { + sortList[pos++] = Item.getIdFromItem(is.getItem()); + sortList[pos++] = is.getItemDamage(); + sortList[pos++] = is.stackSize; + } else + { + sortList[pos++] = 0; + sortList[pos++] = 0; + sortList[pos++] = 0; + } + } + + return sortList; + } + + @Override + public boolean isItemValidForSlot(int slot, ItemStack itemstack) + { + if (slot == 0) + { + return true; + } + + return false; + } + + public static void initialize() + { + pedestalPositions.add(new PlinthComponent(1, 0, -2, 1)); + pedestalPositions.add(new PlinthComponent(2, 0, 0, 1)); + pedestalPositions.add(new PlinthComponent(1, 0, +2, 1)); + pedestalPositions.add(new PlinthComponent(-1, 0, -2, 1)); + pedestalPositions.add(new PlinthComponent(-2, 0, 0, 1)); + pedestalPositions.add(new PlinthComponent(-1, 0, +2, 1)); + pedestalPositions.add(new PlinthComponent(3, 1, -5, 2)); + pedestalPositions.add(new PlinthComponent(6, 1, 0, 2)); + pedestalPositions.add(new PlinthComponent(3, 1, +5, 2)); + pedestalPositions.add(new PlinthComponent(-3, 1, -5, 2)); + pedestalPositions.add(new PlinthComponent(-6, 1, 0, 2)); + pedestalPositions.add(new PlinthComponent(-3, 1, +5, 2)); + pedestalPositions.add(new PlinthComponent(0, 2, -9, 3)); + pedestalPositions.add(new PlinthComponent(7, 2, -4, 3)); + pedestalPositions.add(new PlinthComponent(7, 2, +4, 3)); + pedestalPositions.add(new PlinthComponent(0, 2, +9, 3)); + pedestalPositions.add(new PlinthComponent(-7, 2, -4, 3)); + pedestalPositions.add(new PlinthComponent(-7, 2, 4, 3)); + } + + +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TESocket.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TESocket.java new file mode 100644 index 00000000..c98638c4 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TESocket.java @@ -0,0 +1,254 @@ +package WayofTime.alchemicalWizardry.common.tileEntity; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.Constants; +import WayofTime.alchemicalWizardry.common.NewPacketHandler; + +public class TESocket extends TileEntity implements IInventory +{ + private ItemStack[] inv; + private int resultID; + private int resultDamage; + + public static final int sizeInv = 1; + + private boolean isActive; + + public TESocket() + { + this.inv = new ItemStack[1]; + resultID = 0; + resultDamage = 0; + isActive = false; + } + + @Override + public void readFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readFromNBT(par1NBTTagCompound); + NBTTagList tagList = par1NBTTagCompound.getTagList("Inventory",Constants.NBT.TAG_COMPOUND); + + for (int i = 0; i < tagList.tagCount(); i++) + { + NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); + int slot = tag.getByte("Slot"); + + if (slot >= 0 && slot < inv.length) + { + inv[slot] = ItemStack.loadItemStackFromNBT(tag); + } + } + + resultID = par1NBTTagCompound.getInteger("resultID"); + resultDamage = par1NBTTagCompound.getInteger("resultDamage"); + isActive = par1NBTTagCompound.getBoolean("isActive"); + } + + @Override + public void writeToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeToNBT(par1NBTTagCompound); + NBTTagList itemList = new NBTTagList(); + + for (int i = 0; i < inv.length; i++) + { + ItemStack stack = inv[i]; + + if (inv[i] != null) + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setByte("Slot", (byte) i); + inv[i].writeToNBT(tag); + itemList.appendTag(tag); + } + } + + par1NBTTagCompound.setInteger("resultID", resultID); + par1NBTTagCompound.setInteger("resultDamage", resultDamage); + par1NBTTagCompound.setTag("Inventory", itemList); + par1NBTTagCompound.setBoolean("isActive", isActive); + } + + @Override + public int getSizeInventory() + { + return 1; + } + + @Override + public ItemStack getStackInSlot(int slot) + { + return inv[slot]; + } + + @Override + public ItemStack decrStackSize(int slot, int amt) + { + ItemStack stack = getStackInSlot(slot); + + if (stack != null) + { + if (stack.stackSize <= amt) + { + setInventorySlotContents(slot, null); + } else + { + stack = stack.splitStack(amt); + + if (stack.stackSize == 0) + { + setInventorySlotContents(slot, null); + } + } + } + + return stack; + } + + @Override + public ItemStack getStackInSlotOnClosing(int slot) + { + ItemStack stack = getStackInSlot(slot); + + if (stack != null) + { + setInventorySlotContents(slot, null); + } + + return stack; + } + + @Override + public void setInventorySlotContents(int slot, ItemStack itemStack) + { + inv[slot] = itemStack; + + if (itemStack != null && itemStack.stackSize > getInventoryStackLimit()) + { + itemStack.stackSize = getInventoryStackLimit(); + } + } + + @Override + public String getInventoryName() + { + return "TESocket"; + } + + @Override + public boolean hasCustomInventoryName() + { + return false; + } + + @Override + public int getInventoryStackLimit() + { + return 1; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityPlayer) + { + return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this && entityPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64; + } + + @Override + public void openInventory() + { + // TODO Auto-generated method stub + } + + @Override + public void closeInventory() + { + // TODO Auto-generated method stub + } + + //Logic for the actual block is under here + @Override + public void updateEntity() + { + super.updateEntity(); + } + + public void setActive() + { + isActive = false; + } + + public boolean isActive() + { + return isActive; + } + + @Override + public Packet getDescriptionPacket() + { + return NewPacketHandler.getPacket(this); + } + + public void handlePacketData(int[] intData) + { + if (intData == null) + { + return; + } + + if (intData.length == 3) + { + for (int i = 0; i < 1; i++) + { + if (intData[i * 3 + 2] != 0) + { + ItemStack is = new ItemStack(Item.getItemById(intData[i * 3]), intData[i * 3 + 2], intData[i * 3 + 1]); + inv[i] = is; + } else + { + inv[i] = null; + } + } + } + } + + public int[] buildIntDataList() + { + int[] sortList = new int[1 * 3]; + int pos = 0; + + for (ItemStack is : inv) + { + if (is != null) + { + sortList[pos++] = Item.getIdFromItem(is.getItem()); + sortList[pos++] = is.getItemDamage(); + sortList[pos++] = is.stackSize; + } else + { + sortList[pos++] = 0; + sortList[pos++] = 0; + sortList[pos++] = 0; + } + } + + return sortList; + } + + @Override + public boolean isItemValidForSlot(int slot, ItemStack itemstack) + { + if (slot == 0) + { + return true; + } + + return false; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellBlock.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellBlock.java new file mode 100644 index 00000000..b2cca5fb --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellBlock.java @@ -0,0 +1,48 @@ +package WayofTime.alchemicalWizardry.common.tileEntity; + +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigm; + +public abstract class TESpellBlock extends TEOrientable +{ + public void modifySpellParadigm(SpellParadigm parad) + { + this.applySpellChange(parad); + TileEntity tile = this.getTileAtOutput(); + if(tile instanceof TESpellBlock) + { + TESpellBlock outputBlock = (TESpellBlock)tile; + outputBlock.modifySpellParadigm(parad); + } + } + + protected abstract void applySpellChange(SpellParadigm parad); + + public TESpellBlock getTileAtOutput() + { + ForgeDirection output = this.getOutputDirection(); + int xOffset = output.offsetX; + int yOffset = output.offsetY; + int zOffset = output.offsetZ; + + TileEntity tile = worldObj.getTileEntity(xCoord + xOffset, yCoord + yOffset, zCoord + zOffset); + + if(tile instanceof TESpellBlock && ((TESpellBlock)tile).canInputRecieveOutput(output)) + { + return (TESpellBlock)tile; + } + + return null; + } + + public boolean canInputRecieve() + { + return true; + } + + public boolean canInputRecieveOutput(ForgeDirection output) + { + return this.canInputRecieve() && this.getInputDirection().getOpposite()==output; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEffectBlock.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEffectBlock.java new file mode 100644 index 00000000..a2b9a4be --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEffectBlock.java @@ -0,0 +1,43 @@ +package WayofTime.alchemicalWizardry.common.tileEntity; + +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigm; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffectEarth; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffectFire; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffectIce; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffectWind; + +public class TESpellEffectBlock extends TESpellBlock +{ + @Override + protected void applySpellChange(SpellParadigm parad) + { + parad.addBufferedEffect(this.getSpellEffect()); + } + + public SpellEffect getSpellEffect() + { + int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); + switch(meta) + { + case 0: return new SpellEffectFire(); + case 1: return new SpellEffectIce(); + case 2: return new SpellEffectWind(); + case 3: return new SpellEffectEarth(); + } + return new SpellEffectFire(); + } + + @Override + public String getResourceLocationForMeta(int meta) + { + switch(meta) + { + case 0: return "alchemicalwizardry:textures/models/SpellEffectFire.png"; + case 1: return "alchemicalwizardry:textures/models/SpellEffectIce.png"; + case 2: return "alchemicalwizardry:textures/models/SpellEffectWind.png"; + case 3: return "alchemicalwizardry:textures/models/SpellEffectEarth.png"; + } + return ""; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEnhancementBlock.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEnhancementBlock.java new file mode 100644 index 00000000..e6110498 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEnhancementBlock.java @@ -0,0 +1,102 @@ +package WayofTime.alchemicalWizardry.common.tileEntity; + +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigm; +import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; +import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancementCost; +import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancementPotency; +import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancementPower; + +public class TESpellEnhancementBlock extends TESpellBlock +{ + @Override + protected void applySpellChange(SpellParadigm parad) + { + int i = -1; + + switch(this.enhancementType()) + { + case 0: + i = parad.getBufferedEffectPower(); + break; + case 1: + i = parad.getBufferedEffectCost(); + break; + case 2: + i = parad.getBufferedEffectPotency(); + break; + } + + if(i!=-1 && i stringList = parad.effectList; +// SpellParadigmSelf spellParadSelf = SpellParadigmSelf.getParadigmForStringArray(stringList); +// for(String str : stringList) +// { +// ChatMessageComponent chat = new ChatMessageComponent(); +// chat.addText(str); +// entity.sendChatToPlayer(chat); +// } +// spellParadSelf.castSpell(world, entity, spellCasterStack); +// } +// else if(parad instanceof SpellParadigmProjectile) +// { +// List stringList = parad.effectList; +// SpellParadigmProjectile spellParadSelf = SpellParadigmProjectile.getParadigmForStringArray(stringList); +// for(String str : stringList) +// { +// ChatMessageComponent chat = new ChatMessageComponent(); +// chat.addText(str); +// entity.sendChatToPlayer(chat); +// } +// spellParadSelf.castSpell(world, entity, spellCasterStack); +// }else + { + parad.applyAllSpellEffects(); + parad.castSpell(world, entity, spellCasterStack); + } + + } + + +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java new file mode 100644 index 00000000..26239d1c --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TETeleposer.java @@ -0,0 +1,373 @@ +package WayofTime.alchemicalWizardry.common.tileEntity; + +import java.util.Iterator; +import java.util.List; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import net.minecraftforge.common.util.Constants; +import WayofTime.alchemicalWizardry.common.NewPacketHandler; +import WayofTime.alchemicalWizardry.common.block.BlockTeleposer; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.items.TelepositionFocus; + +public class TETeleposer extends TileEntity implements IInventory +{ + private ItemStack[] inv; + private int resultID; + private int resultDamage; + private int previousInput; + + public static final int sizeInv = 1; + + private boolean isActive; + + public TETeleposer() + { + this.inv = new ItemStack[1]; + resultID = 0; + resultDamage = 0; + isActive = false; + previousInput = 0; + } + + @Override + public void readFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readFromNBT(par1NBTTagCompound); + NBTTagList tagList = par1NBTTagCompound.getTagList("Inventory", Constants.NBT.TAG_COMPOUND); + + for (int i = 0; i < tagList.tagCount(); i++) + { + NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); + int slot = tag.getByte("Slot"); + + if (slot >= 0 && slot < inv.length) + { + inv[slot] = ItemStack.loadItemStackFromNBT(tag); + } + } + + resultID = par1NBTTagCompound.getInteger("resultID"); + resultDamage = par1NBTTagCompound.getInteger("resultDamage"); + isActive = par1NBTTagCompound.getBoolean("isActive"); + previousInput = par1NBTTagCompound.getInteger("previousInput"); + } + + @Override + public void writeToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeToNBT(par1NBTTagCompound); + NBTTagList itemList = new NBTTagList(); + + for (int i = 0; i < inv.length; i++) + { + ItemStack stack = inv[i]; + + if (inv[i] != null) + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setByte("Slot", (byte) i); + inv[i].writeToNBT(tag); + itemList.appendTag(tag); + } + } + + par1NBTTagCompound.setInteger("resultID", resultID); + par1NBTTagCompound.setInteger("resultDamage", resultDamage); + par1NBTTagCompound.setTag("Inventory", itemList); + par1NBTTagCompound.setBoolean("isActive", isActive); + par1NBTTagCompound.setInteger("previousInput", previousInput); + } + + @Override + public int getSizeInventory() + { + return 1; + } + + @Override + public ItemStack getStackInSlot(int slot) + { + return inv[slot]; + } + + @Override + public ItemStack decrStackSize(int slot, int amt) + { + ItemStack stack = getStackInSlot(slot); + + if (stack != null) + { + if (stack.stackSize <= amt) + { + setInventorySlotContents(slot, null); + } else + { + stack = stack.splitStack(amt); + + if (stack.stackSize == 0) + { + setInventorySlotContents(slot, null); + } + } + } + + return stack; + } + + @Override + public ItemStack getStackInSlotOnClosing(int slot) + { + ItemStack stack = getStackInSlot(slot); + + if (stack != null) + { + setInventorySlotContents(slot, null); + } + + return stack; + } + + @Override + public void setInventorySlotContents(int slot, ItemStack itemStack) + { + inv[slot] = itemStack; + + if (itemStack != null && itemStack.stackSize > getInventoryStackLimit()) + { + itemStack.stackSize = getInventoryStackLimit(); + } + } + + @Override + public String getInventoryName() + { + return "TETeleposer"; + } + + @Override + public boolean hasCustomInventoryName() + { + return false; + } + + @Override + public int getInventoryStackLimit() + { + return 1; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityPlayer) + { + return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this && entityPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64; + } + + @Override + public void openInventory() + { + // TODO Auto-generated method stub + } + + @Override + public void closeInventory() + { + // TODO Auto-generated method stub + } + + //Logic for the actual block is under here + @Override + public void updateEntity() + { + super.updateEntity(); + + if (worldObj.isRemote) + { + return; + } + + int currentInput = worldObj.getBlockPowerInput(xCoord, yCoord, zCoord); + + if (previousInput == 0 && currentInput != 0) + { + ItemStack focus = this.getStackInSlot(0); + + if (focus != null && focus.getItem() instanceof TelepositionFocus) + { + TelepositionFocus focusItem = (TelepositionFocus) (focus.getItem()); + int xf = focusItem.xCoord(focus); + int yf = focusItem.yCoord(focus); + int zf = focusItem.zCoord(focus); + World worldF = focusItem.getWorld(focus); + int damage = (int) (0.5f * Math.sqrt((xCoord - xf) * (xCoord - xf) + (yCoord - yf + 1) * (yCoord - yf + 1) + (zCoord - zf) * (zCoord - zf))); + int focusLevel = ((TelepositionFocus) focusItem).getFocusLevel(); + int transportCount = 0; + int entityCount = 0; + + if (worldF != null && worldF.getTileEntity(xf, yf, zf) instanceof TETeleposer && !worldF.getTileEntity(xf, yf, zf).equals(this)) + { + //Prime the teleportation + int d0 = focusLevel - 1; + AxisAlignedBB axisalignedbb1 = AxisAlignedBB.getAABBPool().getAABB((double) this.xCoord, (double) this.yCoord + d0 + 1, (double) this.zCoord, (double) (this.xCoord + 1), (double) (this.yCoord + 2 + d0), (double) (this.zCoord + 1)).expand(d0, d0, d0); + axisalignedbb1.maxY = Math.min((double) this.worldObj.getHeight(), this.yCoord + 2 + d0 + d0); + List list1 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb1); + Iterator iterator1 = list1.iterator(); + EntityLivingBase entityplayer1; + + while (iterator1.hasNext()) + { + entityplayer1 = (EntityLivingBase) iterator1.next(); + entityCount++; + } + + //int d0 = focusLevel-1; + AxisAlignedBB axisalignedbb2 = AxisAlignedBB.getAABBPool().getAABB(xf, yf + d0 + 1, zf, xf + 1, yf + 2 + d0, zf).expand(d0, d0, d0); + //axisalignedbb2.maxY = Math.min((double)worldF.getHeight(),yf+1+d0+d0); + List list2 = worldF.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb2); + Iterator iterator2 = list2.iterator(); + EntityLivingBase entityplayer2; + + while (iterator2.hasNext()) + { + entityplayer2 = (EntityLivingBase) iterator2.next(); + entityCount++; + } + + if (EnergyItems.canSyphonInContainer(focus, damage * (focusLevel * 2 - 1) * (focusLevel * 2 - 1) * (focusLevel * 2 - 1) + damage * entityCount)) + { + for (int k = 0; k <= (focusLevel * 2 - 2); k++) + //for(int k=(focusLevel*2-1);k>=0;k--) + { + for (int i = -(focusLevel - 1); i <= (focusLevel - 1); i++) + { + for (int j = -(focusLevel - 1); j <= (focusLevel - 1); j++) + { + { + if (BlockTeleposer.swapBlocks(worldObj, worldF, xCoord + i, yCoord + 1 + k, zCoord + j, xf + i, yf + 1 + k, zf + j)) + { + transportCount++; + } + } + } + } + } + + if (!worldF.equals(worldObj)) + { + entityCount = 0; + } + + EnergyItems.syphonWhileInContainer(focus, damage * transportCount + damage * entityCount); + //Teleport + + if (worldF.equals(worldObj)) + { + iterator1 = list1.iterator(); + iterator2 = list2.iterator(); + + while (iterator1.hasNext()) + { + entityplayer1 = (EntityLivingBase) iterator1.next(); + entityplayer1.worldObj = worldF; + entityplayer1.setPositionAndUpdate(entityplayer1.posX - this.xCoord + xf, entityplayer1.posY - this.yCoord + yf, entityplayer1.posZ - this.zCoord + zf); + } + + while (iterator2.hasNext()) + { + entityplayer2 = (EntityLivingBase) iterator2.next(); + entityplayer2.worldObj = worldF; + entityplayer2.setPositionAndUpdate(entityplayer2.posX + this.xCoord - xf, entityplayer2.posY + this.yCoord - yf, entityplayer2.posZ + this.zCoord - zf); + } + } + } + } + } + } + + previousInput = currentInput; + } + + public void setActive() + { + isActive = false; + } + + public boolean isActive() + { + return isActive; + } + + @Override + public Packet getDescriptionPacket() + { + return NewPacketHandler.getPacket(this); + } + + public void handlePacketData(int[] intData) + { + if (intData == null) + { + return; + } + + if (intData.length == 3) + { + for (int i = 0; i < 1; i++) + { + if (intData[i * 3 + 2] != 0) + { + ItemStack is = new ItemStack(Item.getItemById(intData[i * 3]), intData[i * 3 + 2], intData[i * 3 + 1]); + inv[i] = is; + } else + { + inv[i] = null; + } + } + } + } + + public int[] buildIntDataList() + { + int[] sortList = new int[1 * 3]; + int pos = 0; + + for (ItemStack is : inv) + { + if (is != null) + { + sortList[pos++] = Item.getIdFromItem(is.getItem()); + sortList[pos++] = is.getItemDamage(); + sortList[pos++] = is.stackSize; + } else + { + sortList[pos++] = 0; + sortList[pos++] = 0; + sortList[pos++] = 0; + } + } + + return sortList; + } + + @Override + public boolean isItemValidForSlot(int slot, ItemStack itemstack) + { + if (slot == 0) + { + return true; + } + + return false; + } + +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEWritingTable.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEWritingTable.java new file mode 100644 index 00000000..d6946e71 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/TEWritingTable.java @@ -0,0 +1,745 @@ +package WayofTime.alchemicalWizardry.common.tileEntity; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.Constants; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.common.IBindingAgent; +import WayofTime.alchemicalWizardry.common.ICatalyst; +import WayofTime.alchemicalWizardry.common.IFillingAgent; +import WayofTime.alchemicalWizardry.common.NewPacketHandler; +import WayofTime.alchemicalWizardry.common.alchemy.AlchemicalPotionCreationHandler; +import WayofTime.alchemicalWizardry.common.alchemy.AlchemyRecipeRegistry; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; + +public class TEWritingTable extends TileEntity implements IInventory +{ + private ItemStack[] inv; + private int progress; + private int progressNeeded = 100; + private int amountUsed; + + public static final int sizeInv = 7; + + public TEWritingTable() + { + inv = new ItemStack[7]; + } + + @Override + public int getSizeInventory() + { + return inv.length; + } + + @Override + public ItemStack getStackInSlot(int slot) + { + return inv[slot]; + } + + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inv[slot] = stack; + + if (stack != null && stack.stackSize > getInventoryStackLimit()) + { + stack.stackSize = getInventoryStackLimit(); + } + } + + @Override + public ItemStack decrStackSize(int slot, int amt) + { + ItemStack stack = getStackInSlot(slot); + + if (stack != null) + { + if (stack.stackSize <= amt) + { + setInventorySlotContents(slot, null); + } else + { + stack = stack.splitStack(amt); + + if (stack.stackSize == 0) + { + setInventorySlotContents(slot, null); + } + } + } + + return stack; + } + + @Override + public ItemStack getStackInSlotOnClosing(int slot) + { + ItemStack stack = getStackInSlot(slot); + + if (stack != null) + { + setInventorySlotContents(slot, null); + } + + return stack; + } + + @Override + public int getInventoryStackLimit() + { + return 64; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this && player.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64; + } + + @Override + public void openInventory() + { + } + + @Override + public void closeInventory() + { + } + + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + NBTTagList tagList = tagCompound.getTagList("Inventory",Constants.NBT.TAG_COMPOUND); + + for (int i = 0; i < tagList.tagCount(); i++) + { + NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); + byte slot = tag.getByte("Slot"); + + if (slot >= 0 && slot < inv.length) + { + inv[slot] = ItemStack.loadItemStackFromNBT(tag); + } + } + + progress = tagCompound.getInteger("progress"); + amountUsed = tagCompound.getInteger("amountUsed"); + } + + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + NBTTagList itemList = new NBTTagList(); + + for (int i = 0; i < inv.length; i++) + { + ItemStack stack = inv[i]; + + if (stack != null) + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setByte("Slot", (byte) i); + stack.writeToNBT(tag); + itemList.appendTag(tag); + } + } + + tagCompound.setTag("Inventory", itemList); + tagCompound.setInteger("progress", progress); + tagCompound.setInteger("amountUsed", amountUsed); + } + + @Override + public String getInventoryName() + { + return "aw.TEWritingTable"; + } + + @Override + public boolean hasCustomInventoryName() + { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isItemValidForSlot(int i, ItemStack itemstack) + { + // TODO Auto-generated method stub + return false; + } + + @Override + public net.minecraft.network.Packet getDescriptionPacket() + { + return NewPacketHandler.getPacket(this); + } + + public void handlePacketData(int[] intData) + { + if (intData == null) + { + return; + } + + if (intData.length == 3 * 7) + { + for (int i = 0; i < 7; i++) + { + if (intData[i * 3 + 2] != 0) + { + ItemStack is = new ItemStack(Item.getItemById(intData[i * 3]), intData[i * 3 + 2], intData[i * 3 + 1]); + inv[i] = is; + } else + { + inv[i] = null; + } + } + } + } + + public int[] buildIntDataList() + { + int[] sortList = new int[7 * 3]; + int pos = 0; + + for (ItemStack is : inv) + { + if (is != null) + { + sortList[pos++] = Item.getIdFromItem(is.getItem()); + sortList[pos++] = is.getItemDamage(); + sortList[pos++] = is.stackSize; + } else + { + sortList[pos++] = 0; + sortList[pos++] = 0; + sortList[pos++] = 0; + } + } + + return sortList; + } + + public ItemStack getResultingItemStack() + { + ItemStack[] composedRecipe = new ItemStack[5]; + + for (int i = 0; i < 5; i++) + { + composedRecipe[i] = inv[i + 1]; + } + + return AlchemyRecipeRegistry.getResult(composedRecipe, inv[0]); + } + + public boolean isRecipeValid() + { + return (getResultingItemStack() != null); + } + + public int getAmountNeeded(ItemStack bloodOrb) + { + ItemStack[] composedRecipe = new ItemStack[5]; + + for (int i = 0; i < 5; i++) + { + composedRecipe[i] = inv[i + 1]; + } + + return AlchemyRecipeRegistry.getAmountNeeded(composedRecipe, bloodOrb); + } + + public boolean containsPotionFlask() + { + if (getPotionFlaskPosition() != -1) + { + return true; + } else + { + return false; + } + } + + public int getPotionFlaskPosition() + { + for (int i = 1; i <= 5; i++) + { + if (inv[i] != null && !(inv[i].getItem() instanceof ItemBlock) && inv[i].getItem() == ModItems.alchemyFlask) + { + return i; + } + } + + return -1; + } + + public boolean containsRegisteredPotionIngredient() + { + if (getRegisteredPotionIngredientPosition() != -1) + { + return true; + } else + { + return false; + } + } + + public int getRegisteredPotionIngredientPosition() + { + ItemStack[] composedRecipe = new ItemStack[5]; + + for (int i = 0; i < 5; i++) + { + composedRecipe[i] = inv[i + 1]; + } + + int location = AlchemicalPotionCreationHandler.getRegisteredPotionIngredientPosition(composedRecipe); + + if (location != -1) + { + return location + 1; + } + + return -1; + } + + public boolean containsCatalyst() + { + if (getCatalystPosition() != -1) + { + return true; + } + + return false; + } + + public int getCatalystPosition() + { + for (int i = 0; i < 5; i++) + { + if (inv[i + 1] != null && inv[i + 1].getItem() instanceof ICatalyst) + { + return i + 1; + } + } + + return -1; + } + + public boolean containsBindingAgent() + { + if (getBindingAgentPosition() != -1) + { + return true; + } + + return false; + } + + public int getBindingAgentPosition() + { + for (int i = 0; i < 5; i++) + { + if (inv[i + 1] != null && inv[i + 1].getItem() instanceof IBindingAgent) + { + return i + 1; + } + } + + return -1; + } + + public boolean containsFillingAgent() + { + if (getFillingAgentPosition() != -1) + { + return true; + } + + return false; + } + + public int getFillingAgentPosition() + { + for (int i = 0; i < 5; i++) + { + if (inv[i + 1] != null && inv[i + 1].getItem() instanceof IFillingAgent) + { + return i + 1; + } + } + + return -1; + } + + public boolean containsBlankSlate() + { + if (getBlankSlatePosition() != -1) + { + return true; + } + + return false; + } + + public int getBlankSlatePosition() + { + for (int i = 0; i < 5; i++) + { + if (inv[i + 1] != null && inv[i + 1].getItem() == ModItems.blankSlate) + { + return i + 1; + } + } + + return -1; + } + + @Override + public void updateEntity() + { + long worldTime = worldObj.getWorldTime(); + + if (worldObj.isRemote) + { + return; + } + +// if(worldTime%100==0) +// { +// if (worldObj != null) +// { +// worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); +// } +// } + + if (containsPotionFlask() && containsRegisteredPotionIngredient()) + { + if (containsCatalyst()) + { + if (getStackInSlot(6) == null) + { + progress++; + + if (worldTime % 4 == 0) + { + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); + } + + if (progress >= progressNeeded) + { + ItemStack flaskStack = inv[this.getPotionFlaskPosition()]; + ItemStack ingredientStack = inv[this.getRegisteredPotionIngredientPosition()]; + ItemStack catalystStack = inv[this.getCatalystPosition()]; + + if (flaskStack == null || ingredientStack == null || catalystStack == null) + { + progress = 0; + + if (worldObj != null) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + return; + } + + int potionID = AlchemicalPotionCreationHandler.getPotionIDForStack(ingredientStack); + int catalystLevel = ((ICatalyst) catalystStack.getItem()).getCatalystLevel(); + boolean isConcentration = ((ICatalyst) catalystStack.getItem()).isConcentration(); + + if (potionID == -1 || catalystLevel < 0) + { + progress = 0; + + if (worldObj != null) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + return; + } + + if (isConcentration) + { + ((AlchemyFlask) flaskStack.getItem()).setConcentrationOfPotion(flaskStack, potionID, catalystLevel); + } else + { + ((AlchemyFlask) flaskStack.getItem()).setDurationFactorOfPotion(flaskStack, potionID, catalystLevel); + } + + //((AlchemyFlask)flaskStack.getItem()).setConcentrationOfPotion(flaskStack, Potion.regeneration.id, 2); + this.setInventorySlotContents(6, flaskStack); + this.decrStackSize(this.getPotionFlaskPosition(), 1); + this.decrStackSize(this.getCatalystPosition(), 1); + this.decrStackSize(this.getRegisteredPotionIngredientPosition(), 1); + progress = 0; + + if (worldObj != null) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + } + } + } else if (containsBindingAgent()) + { + if (getStackInSlot(6) == null) + { + progress++; + + if (worldTime % 4 == 0) + { + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); + } + + if (progress >= progressNeeded) + { + ItemStack flaskStack = inv[this.getPotionFlaskPosition()]; + ItemStack ingredientStack = inv[this.getRegisteredPotionIngredientPosition()]; + ItemStack agentStack = inv[this.getBindingAgentPosition()]; + + if (flaskStack == null || ingredientStack == null || agentStack == null) + { + progress = 0; + + if (worldObj != null) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + return; + } + + int potionEffectNumber = ((AlchemyFlask) flaskStack.getItem()).getNumberOfPotionEffects(flaskStack); + int potionID = AlchemicalPotionCreationHandler.getPotionIDForStack(ingredientStack); + int tickDuration = AlchemicalPotionCreationHandler.getPotionTickDurationForStack(ingredientStack); + float successChance = ((IBindingAgent) agentStack.getItem()).getSuccessRateForPotionNumber(potionEffectNumber); + //boolean isConcentration = ((ICatalyst)catalystStack.getItem()).isConcentration(); + + if (potionID == -1) + { + progress = 0; + + if (worldObj != null) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + return; + } + + ((AlchemyFlask) flaskStack.getItem()).addPotionEffect(flaskStack, potionID, tickDuration); + + //((AlchemyFlask)flaskStack.getItem()).addPotionEffect(flaskStack, Potion.regeneration.id, 1000); + + if (successChance > worldObj.rand.nextFloat()) + { + this.setInventorySlotContents(6, flaskStack); + } else + { + worldObj.createExplosion(null, xCoord + 0.5, yCoord + 1, zCoord + 0.5, 2, false); + } + + this.decrStackSize(this.getPotionFlaskPosition(), 1); + this.decrStackSize(this.getBindingAgentPosition(), 1); + this.decrStackSize(this.getRegisteredPotionIngredientPosition(), 1); + progress = 0; + + if (worldObj != null) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + } + } + } + } else if (this.containsBlankSlate() && this.containsPotionFlask()) + { + if (getStackInSlot(6) == null) + { + progress++; + + if (worldTime % 4 == 0) + { + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); + } + + if (progress >= progressNeeded) + { + ItemStack flaskStack = inv[this.getPotionFlaskPosition()]; + //ItemStack ingredientStack = inv[this.getRegisteredPotionIngredientPosition()]; + ItemStack blankSlate = inv[this.getBlankSlatePosition()]; + + if (flaskStack == null || blankSlate == null) + { + progress = 0; + + if (worldObj != null) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + return; + } + + //boolean isConcentration = ((ICatalyst)catalystStack.getItem()).isConcentration(); + ((AlchemyFlask) flaskStack.getItem()).setIsPotionThrowable(true, flaskStack); + //((AlchemyFlask)flaskStack.getItem()).addPotionEffect(flaskStack, Potion.regeneration.id, 1000); + //if(successChance>worldObj.rand.nextFloat()) + this.setInventorySlotContents(6, flaskStack); + this.decrStackSize(this.getPotionFlaskPosition(), 1); + this.decrStackSize(this.getBlankSlatePosition(), 1); + //this.decrStackSize(this.getRegisteredPotionIngredientPosition(), 1); + progress = 0; + + if (worldObj != null) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + } + } + } else if (this.containsFillingAgent() && this.containsPotionFlask()) + { + //TODO + if (getStackInSlot(6) == null) + { + progress++; + + if (worldTime % 4 == 0) + { + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); + } + + if (progress >= progressNeeded) + { + ItemStack flaskStack = inv[this.getPotionFlaskPosition()]; + //ItemStack ingredientStack = inv[this.getRegisteredPotionIngredientPosition()]; + ItemStack fillingAgent = inv[this.getFillingAgentPosition()]; + + if (flaskStack == null || fillingAgent == null) + { + progress = 0; + + if (worldObj != null) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + return; + } + + //boolean isConcentration = ((ICatalyst)catalystStack.getItem()).isConcentration(); + int potionEffects = ((AlchemyFlask) flaskStack.getItem()).getNumberOfPotionEffects(flaskStack); + int potionFillAmount = ((IFillingAgent) fillingAgent.getItem()).getFilledAmountForPotionNumber(potionEffects); + flaskStack.setItemDamage(Math.max(0, flaskStack.getItemDamage() - potionFillAmount)); + //((AlchemyFlask)flaskStack.getItem()).addPotionEffect(flaskStack, Potion.regeneration.id, 1000); + //if(successChance>worldObj.rand.nextFloat()) + this.setInventorySlotContents(6, flaskStack); + this.decrStackSize(this.getPotionFlaskPosition(), 1); + this.decrStackSize(this.getFillingAgentPosition(), 1); + //this.decrStackSize(this.getRegisteredPotionIngredientPosition(), 1); + progress = 0; + + if (worldObj != null) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + } + } + } else + { + if (!isRecipeValid()) + { + progress = 0; + return; + } + + if (progress <= 0) + { + progress = 0; + amountUsed = this.getAmountNeeded(getStackInSlot(0)); + + if (worldObj != null) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + } + + if (getStackInSlot(6) == null) + { + if (worldTime % 4 == 0) + { + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); + } + + if (!EnergyItems.syphonWhileInContainer(getStackInSlot(0), amountUsed)) + { + return; + } + + progress++; + + if (progress >= progressNeeded) + { + progress = 0; + this.setInventorySlotContents(6, getResultingItemStack()); + + for (int i = 0; i < 5; i++) + { + this.decrStackSize(i + 1, 1); + } + + if (worldObj != null) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + } + } else if (getStackInSlot(6).getItem() == getResultingItemStack().getItem() && getResultingItemStack().stackSize <= (getStackInSlot(6).getMaxStackSize() - getStackInSlot(6).stackSize)) + { + if (worldTime % 4 == 0) + { + SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); + } + + if (!EnergyItems.syphonWhileInContainer(getStackInSlot(0), amountUsed)) + { + return; + } + + progress++; + + if (progress >= progressNeeded) + { + progress = 0; + ItemStack result = getResultingItemStack().copy(); + result.stackSize += getStackInSlot(6).stackSize; + this.setInventorySlotContents(6, result); + + for (int i = 0; i < 5; i++) + { + this.decrStackSize(i + 1, 1); + } + + if (worldObj != null) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + } + } + } + + //worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerAltar.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerAltar.java new file mode 100644 index 00000000..9f926427 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerAltar.java @@ -0,0 +1,96 @@ +package WayofTime.alchemicalWizardry.common.tileEntity.container; + +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class ContainerAltar extends Container +{ + protected TEAltar tileEntity; + + public ContainerAltar(InventoryPlayer inventoryPlayer, TEAltar te) + { + tileEntity = te; + + for (int i = 0; i < 3; i++) + { + for (int j = 0; j < 3; j++) + { + addSlotToContainer(new Slot(tileEntity, j + i * 3, 62 + j * 18, 17 + i * 18)); + } + } + + bindPlayerInventory(inventoryPlayer); + } + + @Override + public boolean canInteractWith(EntityPlayer entityplayer) + { + return tileEntity.isUseableByPlayer(entityplayer); + } + + protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) + { + for (int i = 0; i < 3; i++) + { + for (int j = 0; j < 9; j++) + { + addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, + 8 + j * 18, 84 + i * 18)); + } + } + + for (int i = 0; i < 9; i++) + { + addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142)); + } + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer player, int slot) + { + ItemStack stack = null; + Slot slotObject = (Slot) inventorySlots.get(slot); + + //null checks and checks if the item can be stacked (maxStackSize > 1) + if (slotObject != null && slotObject.getHasStack()) + { + ItemStack stackInSlot = slotObject.getStack(); + stack = stackInSlot.copy(); + + //merges the item into player inventory since its in the tileEntity + if (slot < 9) + { + if (!this.mergeItemStack(stackInSlot, 0, 35, true)) + { + return null; + } + } + //places it into the tileEntity is possible since its in the player inventory + else if (!this.mergeItemStack(stackInSlot, 0, 9, false)) + { + return null; + } + + if (stackInSlot.stackSize == 0) + { + slotObject.putStack(null); + } else + { + slotObject.onSlotChanged(); + } + + if (stackInSlot.stackSize == stack.stackSize) + { + return null; + } + + slotObject.onPickupFromSlot(player, stackInSlot); + } + + return stack; + } +} diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerTeleposer.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerTeleposer.java new file mode 100644 index 00000000..09104284 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerTeleposer.java @@ -0,0 +1,106 @@ +package WayofTime.alchemicalWizardry.common.tileEntity.container; + +import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class ContainerTeleposer extends Container +{ + protected TETeleposer tileEntity; + + public ContainerTeleposer(InventoryPlayer inventoryPlayer, TETeleposer te) + { + tileEntity = te; + //the Slot constructor takes the IInventory and the slot number in that it binds to + //and the x-y coordinates it resides on-screen +// addSlotToContainer(new Slot(tileEntity, 0, 152, 110)); +// addSlotToContainer(new Slot(tileEntity, 1, 80, 18)); +// addSlotToContainer(new Slot(tileEntity, 2, 33, 52)); +// addSlotToContainer(new Slot(tileEntity, 3, 51, 110)); +// addSlotToContainer(new Slot(tileEntity, 4, 109, 110)); +// addSlotToContainer(new Slot(tileEntity, 5, 127, 52)); + addSlotToContainer(new Slot(tileEntity, 0, 80, 67)); + //commonly used vanilla code that adds the player's inventory + bindPlayerInventory(inventoryPlayer); + } + + @Override + public boolean canInteractWith(EntityPlayer player) + { + return tileEntity.isUseableByPlayer(player); + } + + protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) + { + for (int i = 0; i < 3; i++) + { + for (int j = 0; j < 9; j++) + { + addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 140 + i * 18)); + } + } + + for (int i = 0; i < 9; i++) + { + addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 198)); + } + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer player, int slot) + { + ItemStack stack = null; + Slot slotObject = (Slot) inventorySlots.get(slot); + + //null checks and checks if the item can be stacked (maxStackSize > 1) + if (slotObject != null && slotObject.getHasStack()) + { + ItemStack stackInSlot = slotObject.getStack(); + stack = stackInSlot.copy(); + + if (slot == 7) + { + if (!this.mergeItemStack(stackInSlot, 7, 35, true)) + { + return null; + } + + slotObject.onSlotChange(stackInSlot, stack); + } + + //merges the item into player inventory since its in the tileEntity + if (slot < 1) + { + if (!this.mergeItemStack(stackInSlot, 7, 35, true)) + { + return null; + } + } + //places it into the tileEntity is possible since its in the player inventory + else if (!this.mergeItemStack(stackInSlot, 0, 0, false)) + { + return null; + } + + if (stackInSlot.stackSize == 0) + { + slotObject.putStack(null); + } else + { + slotObject.onSlotChanged(); + } + + if (stackInSlot.stackSize == stack.stackSize) + { + return null; + } + + slotObject.onPickupFromSlot(player, stackInSlot); + } + + return stack; + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerWritingTable.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerWritingTable.java new file mode 100644 index 00000000..aaf63b67 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerWritingTable.java @@ -0,0 +1,106 @@ +package WayofTime.alchemicalWizardry.common.tileEntity.container; + +import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class ContainerWritingTable extends Container +{ + protected TEWritingTable tileEntity; + + public ContainerWritingTable(InventoryPlayer inventoryPlayer, TEWritingTable te) + { + tileEntity = te; + //the Slot constructor takes the IInventory and the slot number in that it binds to + //and the x-y coordinates it resides on-screen + addSlotToContainer(new Slot(tileEntity, 0, 152, 110)); + addSlotToContainer(new Slot(tileEntity, 1, 80, 18)); + addSlotToContainer(new Slot(tileEntity, 2, 33, 52)); + addSlotToContainer(new Slot(tileEntity, 3, 51, 110)); + addSlotToContainer(new Slot(tileEntity, 4, 109, 110)); + addSlotToContainer(new Slot(tileEntity, 5, 127, 52)); + addSlotToContainer(new Slot(tileEntity, 6, 80, 67)); + //commonly used vanilla code that adds the player's inventory + bindPlayerInventory(inventoryPlayer); + } + + @Override + public boolean canInteractWith(EntityPlayer player) + { + return tileEntity.isUseableByPlayer(player); + } + + protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) + { + for (int i = 0; i < 3; i++) + { + for (int j = 0; j < 9; j++) + { + addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 140 + i * 18)); + } + } + + for (int i = 0; i < 9; i++) + { + addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 198)); + } + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer player, int slot) + { + ItemStack stack = null; + Slot slotObject = (Slot) inventorySlots.get(slot); + + //null checks and checks if the item can be stacked (maxStackSize > 1) + if (slotObject != null && slotObject.getHasStack()) + { + ItemStack stackInSlot = slotObject.getStack(); + stack = stackInSlot.copy(); + + if (slot == 7) + { + if (!this.mergeItemStack(stackInSlot, 7, 35, true)) + { + return null; + } + + slotObject.onSlotChange(stackInSlot, stack); + } + + //merges the item into player inventory since its in the tileEntity + if (slot < 6) + { + if (!this.mergeItemStack(stackInSlot, 7, 35, true)) + { + return null; + } + } + //places it into the tileEntity is possible since its in the player inventory + else if (!this.mergeItemStack(stackInSlot, 0, 6, false)) + { + return null; + } + + if (stackInSlot.stackSize == 0) + { + slotObject.putStack(null); + } else + { + slotObject.onSlotChanged(); + } + + if (stackInSlot.stackSize == stack.stackSize) + { + return null; + } + + slotObject.onPickupFromSlot(player, stackInSlot); + } + + return stack; + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiHandler.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiHandler.java new file mode 100644 index 00000000..2c50234a --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiHandler.java @@ -0,0 +1,73 @@ +package WayofTime.alchemicalWizardry.common.tileEntity.gui; + +import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; +import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; +import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerTeleposer; +import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerWritingTable; +import cpw.mods.fml.common.network.IGuiHandler; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class GuiHandler implements IGuiHandler +{ + //returns an instance of the Container you made earlier + @Override + public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) + { + TileEntity tileEntity; + + switch (id) + { + case 0: + tileEntity = world.getTileEntity(x, y, z); + + if (tileEntity instanceof TEWritingTable) + { + return new ContainerWritingTable(player.inventory, (TEWritingTable) tileEntity); + } + + case 1: + tileEntity = world.getTileEntity(x, y, z); + + if (tileEntity instanceof TETeleposer) + { + return new ContainerTeleposer(player.inventory, (TETeleposer) tileEntity); + } + } + + return null; + } + + //returns an instance of the Gui you made earlier + @Override + public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) + { + TileEntity tileEntity; + + switch (id) + { + case 0: + tileEntity = world.getTileEntity(x, y, z); + + if (tileEntity instanceof TEWritingTable) + { + return new GuiWritingTable(player.inventory, (TEWritingTable) tileEntity); + } + + break; + + case 1: + tileEntity = world.getTileEntity(x, y, z); + + if (tileEntity instanceof TETeleposer) + { + return new GuiTeleposer(player.inventory, (TETeleposer) tileEntity); + } + + break; + } + + return null; + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiTeleposer.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiTeleposer.java new file mode 100644 index 00000000..a6d5f58a --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiTeleposer.java @@ -0,0 +1,47 @@ +package WayofTime.alchemicalWizardry.common.tileEntity.gui; + +import net.minecraft.client.gui.inventory.GuiBrewingStand; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + +import org.lwjgl.opengl.GL11; + +import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; +import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerTeleposer; + +public class GuiTeleposer extends GuiContainer +{ + public GuiTeleposer(InventoryPlayer inventoryPlayer, TETeleposer tileEntity) + { + //the container is instanciated and passed to the superclass for handling + super(new ContainerTeleposer(inventoryPlayer, tileEntity)); + xSize = 176; + ySize = 222; + } + + @Override + protected void drawGuiContainerForegroundLayer(int param1, int param2) + { + //draw text and stuff here + //the parameters for drawString are: string, x, y, color + fontRendererObj.drawString("Teleposer", 8, 6, 4210752); + //draws "Inventory" or your regional equivalent + fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, 130, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) + { + //draw your Gui here, only thing you need to change is the path + //ResourceLocation texture = mc.renderEngine.getTexture("/gui/trap.png"); + ResourceLocation test = new ResourceLocation("alchemicalwizardry", "gui/Teleposer.png"); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(test); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + GuiBrewingStand d; + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiWritingTable.java b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiWritingTable.java new file mode 100644 index 00000000..53a74f19 --- /dev/null +++ b/1.7.2/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiWritingTable.java @@ -0,0 +1,45 @@ +package WayofTime.alchemicalWizardry.common.tileEntity.gui; + +import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; +import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerWritingTable; +import net.minecraft.client.gui.inventory.GuiBrewingStand; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import org.lwjgl.opengl.GL11; + +public class GuiWritingTable extends GuiContainer +{ + public GuiWritingTable(InventoryPlayer inventoryPlayer, TEWritingTable tileEntity) + { + //the container is instanciated and passed to the superclass for handling + super(new ContainerWritingTable(inventoryPlayer, tileEntity)); + xSize = 176; + ySize = 222; + } + + @Override + protected void drawGuiContainerForegroundLayer(int param1, int param2) + { + //draw text and stuff here + //the parameters for drawString are: string, x, y, color + fontRendererObj.drawString("Alchemic Chemistry Set", 8, 6, 4210752); + //draws "Inventory" or your regional equivalent + fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, 130, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) + { + //draw your Gui here, only thing you need to change is the path + //ResourceLocation texture = mc.renderEngine.getTexture("/gui/trap.png"); + ResourceLocation test = new ResourceLocation("alchemicalwizardry", "gui/WritingTable.png"); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(test); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + GuiBrewingStand d; + } +} \ No newline at end of file diff --git a/1.7.2/java/WayofTime/mcmod.info b/1.7.2/java/WayofTime/mcmod.info new file mode 100644 index 00000000..03fe5817 --- /dev/null +++ b/1.7.2/java/WayofTime/mcmod.info @@ -0,0 +1,22 @@ +[ +{ + "modid": "AWWayofTime", + "name": "XAlchemical Wizardry", + "description": "Two words: magical swag. Oh, and a gun.", + "version": "0.0.1", + "url": "http://www.minecraftforum.net/topic/1596973-", + "updateUrl": "", + "logoFile": "", + "mcversion": "1.5.x", + "authorList": [ + "WayofTime" + ], + "credits": "", + "screenshots": [ + ], + "parent": "", + "dependencies": [ + ] +} +] + diff --git a/1.7.2/resources/assets/alchemicalwizardry/altar.png b/1.7.2/resources/assets/alchemicalwizardry/altar.png new file mode 100644 index 00000000..6b6ac12e Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/altar.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/bloodaltar.obj b/1.7.2/resources/assets/alchemicalwizardry/bloodaltar.obj new file mode 100644 index 00000000..88037009 --- /dev/null +++ b/1.7.2/resources/assets/alchemicalwizardry/bloodaltar.obj @@ -0,0 +1,262 @@ +# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware +# File Created: 07.08.2013 20:11:26 + +mtllib bloodaltar.mtl + +# +# object headusOBJexport002 +# + +v -4.5000 -0.0003 7.0000 +v 4.5000 -0.0003 7.0000 +v 4.0172 8.0000 6.2483 +v -4.0172 8.0000 6.2483 +v 6.9379 -0.0003 4.4994 +v 7.0199 -0.0003 -4.4998 +v 6.2600 8.0000 -4.0177 +v 6.1868 8.0000 4.0159 +v -4.0172 8.0000 -6.2496 +v 4.0172 8.0000 -6.2496 +v 4.5000 -0.0003 -7.0000 +v -4.5000 -0.0003 -7.0000 +v -6.2489 8.0000 4.0165 +v -6.2489 8.0000 -4.0622 +v -7.0000 -0.0003 -4.5497 +v -7.0000 -0.0003 4.5000 +v -5.6437 -0.0003 -7.7219 +v -7.6983 -0.0003 -5.7082 +v -6.9967 8.0000 -5.2528 +v -5.1927 8.0000 -7.0210 +v -5.2002 8.0000 7.0079 +v -7.0086 8.0000 5.1996 +v -7.7102 -0.0003 5.6512 +v -5.6513 -0.0003 7.7101 +v 5.6513 -0.0003 7.7101 +v 7.7102 -0.0003 5.6512 +v 7.0086 8.0000 5.1996 +v 5.2002 8.0000 7.0079 +v 7.7102 -0.0003 -5.6513 +v 5.6513 -0.0003 -7.7102 +v 5.2003 8.0000 -7.0092 +v 7.0086 8.0000 -5.2009 +v 1.7912 8.0000 3.2817 +v -1.7910 8.0000 3.2817 +v 3.2857 8.0000 -1.7950 +v 3.2857 8.0000 1.7872 +v -1.7906 8.0000 -3.2897 +v 1.7912 8.0000 -3.2895 +v -3.2855 8.0000 1.7872 +v -3.2853 8.0000 -1.8147 +v -1.2845 6.5000 2.0590 +v -1.2889 6.5000 -2.0668 +v -2.0626 6.5000 -1.3033 +v -2.0627 6.5000 1.2808 +v 1.2846 6.5000 2.0590 +v 2.0629 6.5000 1.2808 +v 2.0629 6.5000 -1.2885 +v 1.2847 6.5000 -2.0667 +# 48 vertices + +vn 0.0000 0.0935 0.9956 +vn 0.9955 0.0940 0.0091 +vn 0.0000 0.0934 -0.9956 +vn -0.9956 0.0935 -0.0000 +vn -0.1018 -0.5549 -0.8257 +vn -0.8232 -0.5551 -0.1189 +vn -0.9907 0.0943 -0.0983 +vn -0.0769 0.0913 -0.9928 +vn -0.0882 0.0938 0.9917 +vn -0.9919 0.0919 0.0872 +vn -0.8248 -0.5547 0.1099 +vn -0.1106 -0.5553 0.8243 +vn 0.1099 -0.5547 0.8248 +vn 0.8274 -0.5533 0.0960 +vn 0.9933 0.0927 0.0690 +vn 0.0872 0.0920 0.9919 +vn 0.8238 -0.5552 -0.1145 +vn 0.1106 -0.5553 -0.8243 +vn 0.0882 0.0937 -0.9917 +vn 0.9916 0.0921 -0.0908 +vn 0.2232 -0.9083 -0.3537 +vn -0.3592 -0.9076 0.2175 +vn -0.3569 -0.9078 -0.2202 +vn 0.2206 -0.9080 0.3561 +vn -0.2201 -0.9078 0.3569 +vn 0.3437 -0.9101 -0.2313 +vn 0.3617 -0.9067 0.2168 +vn -0.2206 -0.9081 -0.3561 +vn 0.0000 1.0000 -0.0000 +vn -0.5381 0.0439 0.8417 +vn 0.5465 0.0428 -0.8364 +vn -0.8417 0.0438 -0.5381 +vn -0.5397 0.0463 -0.8406 +vn 0.8456 0.0447 0.5319 +vn -0.8459 0.0470 0.5313 +vn 0.5397 0.0464 0.8406 +vn 0.1872 0.8722 -0.4520 +vn 0.1856 0.8723 0.4523 +vn 0.4516 0.8720 0.1888 +vn 0.4520 0.8722 -0.1872 +vn -0.1872 0.8722 -0.4520 +vn 0.2870 0.6616 -0.6928 +vn -0.2870 0.6616 -0.6928 +vn -0.4519 0.8722 -0.1872 +vn -0.6928 0.6616 -0.2869 +vn -0.4519 0.8722 0.1872 +vn -0.6928 0.6616 0.2869 +vn -0.1872 0.8722 0.4519 +vn -0.2870 0.6616 0.6927 +vn 0.2848 0.6611 0.6941 +vn 0.6914 0.6621 0.2891 +vn 0.6928 0.6616 -0.2869 +vn 0.8207 0.0426 -0.5698 +# 53 vertex normals + +vt -0.0000 0.2656 0.0000 +vt 0.2031 0.2656 0.0000 +vt 0.2031 0.5000 0.0000 +vt 0.0000 0.5000 0.0000 +vt 0.3906 0.2656 0.0000 +vt 0.5938 0.2656 0.0000 +vt 0.5938 0.5000 0.0000 +vt 0.3906 0.5000 0.0000 +vt 0.2031 0.2344 0.0000 +vt -0.0000 0.2344 0.0000 +vt -0.0000 0.0000 0.0000 +vt 0.2031 0.0000 0.0000 +vt 0.5938 0.2344 0.0000 +vt 0.3906 0.2344 0.0000 +vt 0.3906 -0.0000 0.0000 +vt 0.5938 0.0000 0.0000 +vt 0.2500 0.0000 0.0000 +vt 0.3438 0.0000 0.0000 +vt 0.3438 0.2344 0.0000 +vt 0.2500 0.2344 0.0000 +vt 0.7344 0.2344 0.0000 +vt 0.6406 0.2344 0.0000 +vt 0.6406 0.0000 0.0000 +vt 0.7344 -0.0000 0.0000 +vt 0.2500 0.2656 0.0000 +vt 0.3438 0.2656 0.0000 +vt 0.3438 0.5000 0.0000 +vt 0.2656 0.5000 0.0000 +vt 0.6406 0.2656 0.0000 +vt 0.7344 0.2656 0.0000 +vt 0.7344 0.5000 0.0000 +vt 0.6406 0.5000 0.0000 +vt 0.0938 0.5781 0.0000 +vt 0.0313 0.6406 0.0000 +vt 0.0000 0.6094 0.0000 +vt 0.0625 0.5469 0.0000 +vt 0.0313 0.9063 0.0000 +vt 0.0938 0.9688 0.0000 +vt 0.0625 1.0000 0.0000 +vt 0.0000 0.9375 0.0000 +vt 0.3750 0.9688 0.0000 +vt 0.4375 0.9063 0.0000 +vt 0.4688 0.9375 0.0000 +vt 0.4063 1.0000 0.0000 +vt 0.4375 0.6406 0.0000 +vt 0.3750 0.5781 0.0000 +vt 0.4063 0.5469 0.0000 +vt 0.4688 0.6094 0.0000 +vt 0.9097 0.6270 0.0000 +vt 0.8522 0.7042 0.0000 +vt 0.7593 0.7045 0.0000 +vt 0.7012 0.6278 0.0000 +vt 0.9689 0.8931 0.0000 +vt 0.8915 0.8357 0.0000 +vt 0.8911 0.7428 0.0000 +vt 0.9662 0.6847 0.0000 +vt 0.7025 0.9520 0.0000 +vt 0.7600 0.8750 0.0000 +vt 0.8529 0.8747 0.0000 +vt 0.9109 0.9512 0.0000 +vt 0.6436 0.6859 0.0000 +vt 0.7207 0.7435 0.0000 +vt 0.7210 0.8369 0.0000 +vt 0.6444 0.8955 0.0000 +vt 0.9884 0.9237 0.0000 +vt 0.9417 0.9708 0.0000 +vt 0.7813 0.2656 0.0000 +vt 0.7813 0.5000 0.0000 +vt 0.6721 0.9722 0.0000 +vt 0.6251 0.9265 0.0000 +vt 0.6237 0.6553 0.0000 +vt 0.6705 0.6082 0.0000 +vt 0.7813 -0.0000 0.0000 +vt 0.7813 0.2344 0.0000 +vt 0.9403 0.6072 0.0000 +vt 0.9874 0.6539 0.0000 +vt 0.7725 0.7362 0.0000 +vt 0.7728 0.8432 0.0000 +vt 0.7527 0.8235 0.0000 +vt 0.7524 0.7565 0.0000 +vt 0.8392 0.7360 0.0000 +vt 0.8595 0.7561 0.0000 +vt 0.8597 0.8227 0.0000 +vt 0.8396 0.8430 0.0000 +# 84 texture coords + +g headusOBJexport002 +usemtl Material__46 +s off +f 1/1/1 2/2/1 3/3/1 4/4/1 +f 5/5/2 6/6/2 7/7/2 8/8/2 +f 9/9/3 10/10/3 11/11/3 12/12/3 +f 13/13/4 14/14/4 15/15/4 16/16/4 +s 1 +f 17/17/5 18/18/6 19/19/7 20/20/8 +f 21/21/9 22/22/10 23/23/11 24/24/12 +f 25/25/13 26/26/14 27/27/15 28/28/16 +f 29/29/17 30/30/18 31/31/19 32/32/20 +f 12/33/21 15/34/22 18/35/6 17/36/5 +f 16/37/23 1/38/24 24/39/12 23/40/11 +f 2/41/25 5/42/26 26/43/14 25/44/13 +f 6/45/27 11/46/28 30/47/18 29/48/17 +s 2 +f 3/49/29 33/50/29 34/51/29 4/52/29 +f 7/53/29 35/54/29 36/55/29 8/56/29 +f 9/57/29 37/58/29 38/59/29 10/60/29 +f 13/61/29 39/62/29 40/63/29 14/64/29 +f 9/57/29 14/64/29 40/63/29 37/58/29 +f 4/52/29 34/51/29 39/62/29 13/61/29 +f 8/56/29 36/55/29 33/50/29 3/49/29 +f 10/60/29 38/59/29 35/54/29 7/53/29 +s 1 +f 25/25/13 28/28/16 3/3/30 2/2/25 +s 2 +f 10/60/29 7/53/29 32/65/29 31/66/29 +s 1 +f 17/17/5 20/20/8 9/9/31 12/12/21 +f 23/23/11 22/22/10 13/13/32 16/16/23 +f 11/67/28 10/68/33 31/31/19 30/30/18 +f 29/29/17 32/32/20 7/7/34 6/6/27 +s 2 +f 14/64/29 9/57/29 20/69/29 19/70/29 +s 1 +f 15/15/22 14/14/35 19/19/7 18/18/6 +s 2 +f 4/52/29 13/61/29 22/71/29 21/72/29 +s 1 +f 1/73/24 4/74/36 21/21/9 24/24/12 +s 2 +f 8/56/29 3/49/29 28/75/29 27/76/29 +s 1 +f 41/77/37 42/78/38 43/79/39 44/80/40 +f 45/81/41 41/77/37 34/51/42 33/50/43 +f 46/82/44 45/81/41 33/50/43 36/55/45 +f 47/83/46 46/82/44 36/55/45 35/54/47 +f 48/84/48 47/83/46 35/54/47 38/59/49 +f 42/78/38 48/84/48 38/59/49 37/58/50 +f 43/79/39 42/78/38 37/58/50 40/63/51 +f 44/80/40 43/79/39 40/63/51 39/62/52 +f 41/77/37 44/80/40 39/62/52 34/51/42 +f 48/84/48 45/81/41 46/82/44 47/83/46 +f 45/81/41 48/84/48 42/78/38 41/77/37 +f 16/37/23 15/34/22 12/33/21 1/38/24 +f 2/41/25 11/46/28 6/45/27 5/42/26 +f 11/46/28 2/41/25 1/38/24 12/33/21 +f 5/5/26 8/8/53 27/27/15 26/26/14 +# 46 polygons + diff --git a/1.7.2/resources/assets/alchemicalwizardry/bloodlevel.obj b/1.7.2/resources/assets/alchemicalwizardry/bloodlevel.obj new file mode 100644 index 00000000..f301ee48 --- /dev/null +++ b/1.7.2/resources/assets/alchemicalwizardry/bloodlevel.obj @@ -0,0 +1,64 @@ +# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware +# File Created: 07.08.2013 20:12:01 + +mtllib bloodlevel.mtl + +# +# object headusOBJexport001 +# + +v -1.2846 0.0000 2.0630 +v -1.2890 0.0000 -2.0628 +v -2.0627 0.0000 -1.2993 +v -2.0628 0.0000 1.2848 +v 1.2845 0.0000 2.0630 +v -1.7911 0.0000 3.2857 +v 1.7911 0.0000 3.2857 +v 2.0628 0.0000 1.2848 +v 3.2856 0.0000 1.7912 +v 2.0628 0.0000 -1.2845 +v 3.2856 0.0000 -1.7910 +v 1.2846 0.0000 -2.0627 +v 1.7911 0.0000 -3.2855 +v -1.7907 0.0000 -3.2857 +v -3.2854 0.0000 -1.8107 +v -3.2856 0.0000 1.7912 +# 16 vertices + +vn 0.0000 1.0000 -0.0000 +# 1 vertex normals + +vt 0.3045 0.1861 0.0000 +vt 0.3038 0.8139 0.0000 +vt 0.1861 0.6977 0.0000 +vt 0.1861 0.3045 0.0000 +vt 0.6955 0.1861 0.0000 +vt 0.2274 -0.0000 0.0000 +vt 0.7726 -0.0000 0.0000 +vt 0.8139 0.3045 0.0000 +vt 1.0000 0.2274 0.0000 +vt 0.8139 0.6955 0.0000 +vt 1.0000 0.7725 0.0000 +vt 0.6955 0.8139 0.0000 +vt 0.7726 1.0000 0.0000 +vt 0.2275 1.0000 0.0000 +vt 0.0000 0.7755 0.0000 +vt 0.0000 0.2274 0.0000 +# 16 texture coords + +g headusOBJexport001 +usemtl Material__46 +s 1 +f 1/1/1 2/2/1 3/3/1 4/4/1 +f 5/5/1 1/1/1 6/6/1 7/7/1 +f 8/8/1 5/5/1 7/7/1 9/9/1 +f 10/10/1 8/8/1 9/9/1 11/11/1 +f 12/12/1 10/10/1 11/11/1 13/13/1 +f 2/2/1 12/12/1 13/13/1 14/14/1 +f 3/3/1 2/2/1 14/14/1 15/15/1 +f 4/4/1 3/3/1 15/15/1 16/16/1 +f 1/1/1 4/4/1 16/16/1 6/6/1 +f 12/12/1 5/5/1 8/8/1 10/10/1 +f 5/5/1 12/12/1 2/2/1 1/1/1 +# 11 polygons + diff --git a/1.7.2/resources/assets/alchemicalwizardry/gui/Teleposer.png b/1.7.2/resources/assets/alchemicalwizardry/gui/Teleposer.png new file mode 100644 index 00000000..394b08ad Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/gui/Teleposer.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/gui/WritingTable.png b/1.7.2/resources/assets/alchemicalwizardry/gui/WritingTable.png new file mode 100644 index 00000000..18623f3e Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/gui/WritingTable.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/gui/nei/alchemy.png b/1.7.2/resources/assets/alchemicalwizardry/gui/nei/alchemy.png new file mode 100644 index 00000000..70819322 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/gui/nei/alchemy.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/models/armor/armor - Shortcut.lnk b/1.7.2/resources/assets/alchemicalwizardry/models/armor/armor - Shortcut.lnk new file mode 100644 index 00000000..806150bd Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/models/armor/armor - Shortcut.lnk differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/models/armor/boundArmour_invisible_layer_1.png b/1.7.2/resources/assets/alchemicalwizardry/models/armor/boundArmour_invisible_layer_1.png new file mode 100644 index 00000000..6ec1ced0 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/models/armor/boundArmour_invisible_layer_1.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/models/armor/boundArmour_invisible_layer_2.png b/1.7.2/resources/assets/alchemicalwizardry/models/armor/boundArmour_invisible_layer_2.png new file mode 100644 index 00000000..7fe14b5e Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/models/armor/boundArmour_invisible_layer_2.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/models/armor/boundArmour_layer_1.png b/1.7.2/resources/assets/alchemicalwizardry/models/armor/boundArmour_layer_1.png new file mode 100644 index 00000000..d472d41d Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/models/armor/boundArmour_layer_1.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/models/armor/boundArmour_layer_2.png b/1.7.2/resources/assets/alchemicalwizardry/models/armor/boundArmour_layer_2.png new file mode 100644 index 00000000..420ca181 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/models/armor/boundArmour_layer_2.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/models/armor/sanguineArmour_layer_1.png b/1.7.2/resources/assets/alchemicalwizardry/models/armor/sanguineArmour_layer_1.png new file mode 100644 index 00000000..e323c054 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/models/armor/sanguineArmour_layer_1.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/models/bloodaltar-fixeUV.obj b/1.7.2/resources/assets/alchemicalwizardry/models/bloodaltar-fixeUV.obj new file mode 100644 index 00000000..83d13903 --- /dev/null +++ b/1.7.2/resources/assets/alchemicalwizardry/models/bloodaltar-fixeUV.obj @@ -0,0 +1,262 @@ +# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware +# File Created: 15.08.2013 16:23:16 + +mtllib bloodaltar-fixeUV.mtl + +# +# object headusOBJexport002 +# + +v -4.5000 -0.0003 7.0000 +v 4.5000 -0.0003 7.0000 +v 4.0172 8.0000 6.2483 +v -4.0172 8.0000 6.2483 +v 6.9379 -0.0003 4.4994 +v 7.0199 -0.0003 -4.4998 +v 6.2600 8.0000 -4.0177 +v 6.1868 8.0000 4.0159 +v -4.0172 8.0000 -6.2496 +v 4.0172 8.0000 -6.2496 +v 4.5000 -0.0003 -7.0000 +v -4.5000 -0.0003 -7.0000 +v -6.2489 8.0000 4.0165 +v -6.2489 8.0000 -4.0622 +v -7.0000 -0.0003 -4.5497 +v -7.0000 -0.0003 4.5000 +v -5.6437 -0.0003 -7.7219 +v -7.6983 -0.0003 -5.7082 +v -6.9967 8.0000 -5.2528 +v -5.1927 8.0000 -7.0210 +v -5.2002 8.0000 7.0079 +v -7.0086 8.0000 5.1996 +v -7.7102 -0.0003 5.6512 +v -5.6513 -0.0003 7.7101 +v 5.6513 -0.0003 7.7101 +v 7.7102 -0.0003 5.6512 +v 7.0086 8.0000 5.1996 +v 5.2002 8.0000 7.0079 +v 7.7102 -0.0003 -5.6513 +v 5.6513 -0.0003 -7.7102 +v 5.2003 8.0000 -7.0092 +v 7.0086 8.0000 -5.2009 +v 1.7912 8.0000 3.2817 +v -1.7910 8.0000 3.2817 +v 3.2857 8.0000 -1.7950 +v 3.2857 8.0000 1.7872 +v -1.7906 8.0000 -3.2897 +v 1.7912 8.0000 -3.2895 +v -3.2855 8.0000 1.7872 +v -3.2853 8.0000 -1.8147 +v -1.2845 6.5000 2.0590 +v -1.2889 6.5000 -2.0668 +v -2.0626 6.5000 -1.3033 +v -2.0627 6.5000 1.2808 +v 1.2846 6.5000 2.0590 +v 2.0629 6.5000 1.2808 +v 2.0629 6.5000 -1.2885 +v 1.2847 6.5000 -2.0667 +# 48 vertices + +vn 0.0000 0.0935 0.9956 +vn 0.9955 0.0940 0.0091 +vn 0.0000 0.0934 -0.9956 +vn -0.9956 0.0935 -0.0000 +vn -0.1018 -0.5549 -0.8257 +vn -0.8232 -0.5551 -0.1189 +vn -0.9907 0.0943 -0.0983 +vn -0.0769 0.0913 -0.9928 +vn -0.0882 0.0938 0.9917 +vn -0.9919 0.0919 0.0872 +vn -0.8248 -0.5547 0.1099 +vn -0.1106 -0.5553 0.8243 +vn 0.1099 -0.5547 0.8248 +vn 0.8274 -0.5533 0.0960 +vn 0.9933 0.0927 0.0690 +vn 0.0872 0.0920 0.9919 +vn 0.8238 -0.5552 -0.1145 +vn 0.1106 -0.5553 -0.8243 +vn 0.0882 0.0937 -0.9917 +vn 0.9916 0.0921 -0.0908 +vn 0.2232 -0.9083 -0.3537 +vn -0.3592 -0.9076 0.2175 +vn -0.3569 -0.9078 -0.2202 +vn 0.2206 -0.9080 0.3561 +vn -0.2201 -0.9078 0.3569 +vn 0.3437 -0.9101 -0.2313 +vn 0.3617 -0.9067 0.2168 +vn -0.2206 -0.9081 -0.3561 +vn 0.0000 1.0000 -0.0000 +vn -0.5381 0.0439 0.8417 +vn 0.5465 0.0428 -0.8364 +vn -0.8417 0.0438 -0.5381 +vn -0.5397 0.0463 -0.8406 +vn 0.8456 0.0447 0.5319 +vn -0.8459 0.0470 0.5313 +vn 0.5397 0.0464 0.8406 +vn 0.1872 0.8722 -0.4520 +vn 0.1856 0.8723 0.4523 +vn 0.4516 0.8720 0.1888 +vn 0.4520 0.8722 -0.1872 +vn -0.1872 0.8722 -0.4520 +vn 0.2870 0.6616 -0.6928 +vn -0.2870 0.6616 -0.6928 +vn -0.4519 0.8722 -0.1872 +vn -0.6928 0.6616 -0.2869 +vn -0.4519 0.8722 0.1872 +vn -0.6928 0.6616 0.2869 +vn -0.1872 0.8722 0.4519 +vn -0.2870 0.6616 0.6927 +vn 0.2848 0.6611 0.6941 +vn 0.6914 0.6621 0.2891 +vn 0.6928 0.6616 -0.2869 +vn 0.8207 0.0426 -0.5698 +# 53 vertex normals + +vt -0.0000 0.2656 0.0000 +vt 0.2031 0.2656 0.0000 +vt 0.2031 0.5000 0.0000 +vt 0.0000 0.5000 0.0000 +vt 0.3906 0.2656 0.0000 +vt 0.5938 0.2656 0.0000 +vt 0.5938 0.5000 0.0000 +vt 0.3906 0.5000 0.0000 +vt 0.2031 0.2344 0.0000 +vt -0.0000 0.2344 0.0000 +vt -0.0000 0.0000 0.0000 +vt 0.2031 0.0000 0.0000 +vt 0.5938 0.2344 0.0000 +vt 0.3906 0.2344 0.0000 +vt 0.3906 -0.0000 0.0000 +vt 0.5938 0.0000 0.0000 +vt 0.2500 0.0000 0.0000 +vt 0.3438 0.0000 0.0000 +vt 0.3438 0.2344 0.0000 +vt 0.2500 0.2344 0.0000 +vt 0.7344 0.2344 0.0000 +vt 0.6406 0.2344 0.0000 +vt 0.6406 0.0000 0.0000 +vt 0.7344 -0.0000 0.0000 +vt 0.2500 0.2656 0.0000 +vt 0.3438 0.2656 0.0000 +vt 0.3438 0.5000 0.0000 +vt 0.2500 0.5000 0.0000 +vt 0.6406 0.2656 0.0000 +vt 0.7344 0.2656 0.0000 +vt 0.7344 0.5000 0.0000 +vt 0.6406 0.5000 0.0000 +vt 0.0938 0.5781 0.0000 +vt 0.0313 0.6406 0.0000 +vt 0.0000 0.6094 0.0000 +vt 0.0625 0.5469 0.0000 +vt 0.0313 0.9063 0.0000 +vt 0.0938 0.9688 0.0000 +vt 0.0625 1.0000 0.0000 +vt 0.0000 0.9375 0.0000 +vt 0.3750 0.9688 0.0000 +vt 0.4375 0.9063 0.0000 +vt 0.4688 0.9375 0.0000 +vt 0.4063 1.0000 0.0000 +vt 0.4375 0.6406 0.0000 +vt 0.3750 0.5781 0.0000 +vt 0.4063 0.5469 0.0000 +vt 0.4688 0.6094 0.0000 +vt 0.9097 0.6270 0.0000 +vt 0.8522 0.7042 0.0000 +vt 0.7593 0.7045 0.0000 +vt 0.7012 0.6278 0.0000 +vt 0.9689 0.8931 0.0000 +vt 0.8915 0.8357 0.0000 +vt 0.8911 0.7428 0.0000 +vt 0.9662 0.6847 0.0000 +vt 0.7025 0.9520 0.0000 +vt 0.7600 0.8750 0.0000 +vt 0.8529 0.8747 0.0000 +vt 0.9109 0.9512 0.0000 +vt 0.6436 0.6859 0.0000 +vt 0.7207 0.7435 0.0000 +vt 0.7210 0.8369 0.0000 +vt 0.6444 0.8955 0.0000 +vt 0.9884 0.9237 0.0000 +vt 0.9417 0.9708 0.0000 +vt 0.7813 0.2656 0.0000 +vt 0.7813 0.5000 0.0000 +vt 0.6721 0.9722 0.0000 +vt 0.6251 0.9265 0.0000 +vt 0.6237 0.6553 0.0000 +vt 0.6705 0.6082 0.0000 +vt 0.7813 -0.0000 0.0000 +vt 0.7813 0.2344 0.0000 +vt 0.9403 0.6072 0.0000 +vt 0.9874 0.6539 0.0000 +vt 0.7725 0.7362 0.0000 +vt 0.7728 0.8432 0.0000 +vt 0.7527 0.8235 0.0000 +vt 0.7524 0.7565 0.0000 +vt 0.8392 0.7360 0.0000 +vt 0.8595 0.7561 0.0000 +vt 0.8597 0.8227 0.0000 +vt 0.8396 0.8430 0.0000 +# 84 texture coords + +g headusOBJexport002 +usemtl Material__46 +s off +f 1/1/1 2/2/1 3/3/1 4/4/1 +f 5/5/2 6/6/2 7/7/2 8/8/2 +f 9/9/3 10/10/3 11/11/3 12/12/3 +f 13/13/4 14/14/4 15/15/4 16/16/4 +s 1 +f 17/17/5 18/18/6 19/19/7 20/20/8 +f 21/21/9 22/22/10 23/23/11 24/24/12 +f 25/25/13 26/26/14 27/27/15 28/28/16 +f 29/29/17 30/30/18 31/31/19 32/32/20 +f 12/33/21 15/34/22 18/35/6 17/36/5 +f 16/37/23 1/38/24 24/39/12 23/40/11 +f 2/41/25 5/42/26 26/43/14 25/44/13 +f 6/45/27 11/46/28 30/47/18 29/48/17 +s 2 +f 3/49/29 33/50/29 34/51/29 4/52/29 +f 7/53/29 35/54/29 36/55/29 8/56/29 +f 9/57/29 37/58/29 38/59/29 10/60/29 +f 13/61/29 39/62/29 40/63/29 14/64/29 +f 9/57/29 14/64/29 40/63/29 37/58/29 +f 4/52/29 34/51/29 39/62/29 13/61/29 +f 8/56/29 36/55/29 33/50/29 3/49/29 +f 10/60/29 38/59/29 35/54/29 7/53/29 +s 1 +f 25/25/13 28/28/16 3/3/30 2/2/25 +s 2 +f 10/60/29 7/53/29 32/65/29 31/66/29 +s 1 +f 17/17/5 20/20/8 9/9/31 12/12/21 +f 23/23/11 22/22/10 13/13/32 16/16/23 +f 11/67/28 10/68/33 31/31/19 30/30/18 +f 29/29/17 32/32/20 7/7/34 6/6/27 +s 2 +f 14/64/29 9/57/29 20/69/29 19/70/29 +s 1 +f 15/15/22 14/14/35 19/19/7 18/18/6 +s 2 +f 4/52/29 13/61/29 22/71/29 21/72/29 +s 1 +f 1/73/24 4/74/36 21/21/9 24/24/12 +s 2 +f 8/56/29 3/49/29 28/75/29 27/76/29 +s 1 +f 41/77/37 42/78/38 43/79/39 44/80/40 +f 45/81/41 41/77/37 34/51/42 33/50/43 +f 46/82/44 45/81/41 33/50/43 36/55/45 +f 47/83/46 46/82/44 36/55/45 35/54/47 +f 48/84/48 47/83/46 35/54/47 38/59/49 +f 42/78/38 48/84/48 38/59/49 37/58/50 +f 43/79/39 42/78/38 37/58/50 40/63/51 +f 44/80/40 43/79/39 40/63/51 39/62/52 +f 41/77/37 44/80/40 39/62/52 34/51/42 +f 48/84/48 45/81/41 46/82/44 47/83/46 +f 45/81/41 48/84/48 42/78/38 41/77/37 +f 16/37/23 15/34/22 12/33/21 1/38/24 +f 2/41/25 11/46/28 6/45/27 5/42/26 +f 11/46/28 2/41/25 1/38/24 12/33/21 +f 5/5/26 8/8/53 27/27/15 26/26/14 +# 46 polygons + diff --git a/1.7.2/resources/assets/alchemicalwizardry/models/bloodaltar.obj b/1.7.2/resources/assets/alchemicalwizardry/models/bloodaltar.obj new file mode 100644 index 00000000..88037009 --- /dev/null +++ b/1.7.2/resources/assets/alchemicalwizardry/models/bloodaltar.obj @@ -0,0 +1,262 @@ +# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware +# File Created: 07.08.2013 20:11:26 + +mtllib bloodaltar.mtl + +# +# object headusOBJexport002 +# + +v -4.5000 -0.0003 7.0000 +v 4.5000 -0.0003 7.0000 +v 4.0172 8.0000 6.2483 +v -4.0172 8.0000 6.2483 +v 6.9379 -0.0003 4.4994 +v 7.0199 -0.0003 -4.4998 +v 6.2600 8.0000 -4.0177 +v 6.1868 8.0000 4.0159 +v -4.0172 8.0000 -6.2496 +v 4.0172 8.0000 -6.2496 +v 4.5000 -0.0003 -7.0000 +v -4.5000 -0.0003 -7.0000 +v -6.2489 8.0000 4.0165 +v -6.2489 8.0000 -4.0622 +v -7.0000 -0.0003 -4.5497 +v -7.0000 -0.0003 4.5000 +v -5.6437 -0.0003 -7.7219 +v -7.6983 -0.0003 -5.7082 +v -6.9967 8.0000 -5.2528 +v -5.1927 8.0000 -7.0210 +v -5.2002 8.0000 7.0079 +v -7.0086 8.0000 5.1996 +v -7.7102 -0.0003 5.6512 +v -5.6513 -0.0003 7.7101 +v 5.6513 -0.0003 7.7101 +v 7.7102 -0.0003 5.6512 +v 7.0086 8.0000 5.1996 +v 5.2002 8.0000 7.0079 +v 7.7102 -0.0003 -5.6513 +v 5.6513 -0.0003 -7.7102 +v 5.2003 8.0000 -7.0092 +v 7.0086 8.0000 -5.2009 +v 1.7912 8.0000 3.2817 +v -1.7910 8.0000 3.2817 +v 3.2857 8.0000 -1.7950 +v 3.2857 8.0000 1.7872 +v -1.7906 8.0000 -3.2897 +v 1.7912 8.0000 -3.2895 +v -3.2855 8.0000 1.7872 +v -3.2853 8.0000 -1.8147 +v -1.2845 6.5000 2.0590 +v -1.2889 6.5000 -2.0668 +v -2.0626 6.5000 -1.3033 +v -2.0627 6.5000 1.2808 +v 1.2846 6.5000 2.0590 +v 2.0629 6.5000 1.2808 +v 2.0629 6.5000 -1.2885 +v 1.2847 6.5000 -2.0667 +# 48 vertices + +vn 0.0000 0.0935 0.9956 +vn 0.9955 0.0940 0.0091 +vn 0.0000 0.0934 -0.9956 +vn -0.9956 0.0935 -0.0000 +vn -0.1018 -0.5549 -0.8257 +vn -0.8232 -0.5551 -0.1189 +vn -0.9907 0.0943 -0.0983 +vn -0.0769 0.0913 -0.9928 +vn -0.0882 0.0938 0.9917 +vn -0.9919 0.0919 0.0872 +vn -0.8248 -0.5547 0.1099 +vn -0.1106 -0.5553 0.8243 +vn 0.1099 -0.5547 0.8248 +vn 0.8274 -0.5533 0.0960 +vn 0.9933 0.0927 0.0690 +vn 0.0872 0.0920 0.9919 +vn 0.8238 -0.5552 -0.1145 +vn 0.1106 -0.5553 -0.8243 +vn 0.0882 0.0937 -0.9917 +vn 0.9916 0.0921 -0.0908 +vn 0.2232 -0.9083 -0.3537 +vn -0.3592 -0.9076 0.2175 +vn -0.3569 -0.9078 -0.2202 +vn 0.2206 -0.9080 0.3561 +vn -0.2201 -0.9078 0.3569 +vn 0.3437 -0.9101 -0.2313 +vn 0.3617 -0.9067 0.2168 +vn -0.2206 -0.9081 -0.3561 +vn 0.0000 1.0000 -0.0000 +vn -0.5381 0.0439 0.8417 +vn 0.5465 0.0428 -0.8364 +vn -0.8417 0.0438 -0.5381 +vn -0.5397 0.0463 -0.8406 +vn 0.8456 0.0447 0.5319 +vn -0.8459 0.0470 0.5313 +vn 0.5397 0.0464 0.8406 +vn 0.1872 0.8722 -0.4520 +vn 0.1856 0.8723 0.4523 +vn 0.4516 0.8720 0.1888 +vn 0.4520 0.8722 -0.1872 +vn -0.1872 0.8722 -0.4520 +vn 0.2870 0.6616 -0.6928 +vn -0.2870 0.6616 -0.6928 +vn -0.4519 0.8722 -0.1872 +vn -0.6928 0.6616 -0.2869 +vn -0.4519 0.8722 0.1872 +vn -0.6928 0.6616 0.2869 +vn -0.1872 0.8722 0.4519 +vn -0.2870 0.6616 0.6927 +vn 0.2848 0.6611 0.6941 +vn 0.6914 0.6621 0.2891 +vn 0.6928 0.6616 -0.2869 +vn 0.8207 0.0426 -0.5698 +# 53 vertex normals + +vt -0.0000 0.2656 0.0000 +vt 0.2031 0.2656 0.0000 +vt 0.2031 0.5000 0.0000 +vt 0.0000 0.5000 0.0000 +vt 0.3906 0.2656 0.0000 +vt 0.5938 0.2656 0.0000 +vt 0.5938 0.5000 0.0000 +vt 0.3906 0.5000 0.0000 +vt 0.2031 0.2344 0.0000 +vt -0.0000 0.2344 0.0000 +vt -0.0000 0.0000 0.0000 +vt 0.2031 0.0000 0.0000 +vt 0.5938 0.2344 0.0000 +vt 0.3906 0.2344 0.0000 +vt 0.3906 -0.0000 0.0000 +vt 0.5938 0.0000 0.0000 +vt 0.2500 0.0000 0.0000 +vt 0.3438 0.0000 0.0000 +vt 0.3438 0.2344 0.0000 +vt 0.2500 0.2344 0.0000 +vt 0.7344 0.2344 0.0000 +vt 0.6406 0.2344 0.0000 +vt 0.6406 0.0000 0.0000 +vt 0.7344 -0.0000 0.0000 +vt 0.2500 0.2656 0.0000 +vt 0.3438 0.2656 0.0000 +vt 0.3438 0.5000 0.0000 +vt 0.2656 0.5000 0.0000 +vt 0.6406 0.2656 0.0000 +vt 0.7344 0.2656 0.0000 +vt 0.7344 0.5000 0.0000 +vt 0.6406 0.5000 0.0000 +vt 0.0938 0.5781 0.0000 +vt 0.0313 0.6406 0.0000 +vt 0.0000 0.6094 0.0000 +vt 0.0625 0.5469 0.0000 +vt 0.0313 0.9063 0.0000 +vt 0.0938 0.9688 0.0000 +vt 0.0625 1.0000 0.0000 +vt 0.0000 0.9375 0.0000 +vt 0.3750 0.9688 0.0000 +vt 0.4375 0.9063 0.0000 +vt 0.4688 0.9375 0.0000 +vt 0.4063 1.0000 0.0000 +vt 0.4375 0.6406 0.0000 +vt 0.3750 0.5781 0.0000 +vt 0.4063 0.5469 0.0000 +vt 0.4688 0.6094 0.0000 +vt 0.9097 0.6270 0.0000 +vt 0.8522 0.7042 0.0000 +vt 0.7593 0.7045 0.0000 +vt 0.7012 0.6278 0.0000 +vt 0.9689 0.8931 0.0000 +vt 0.8915 0.8357 0.0000 +vt 0.8911 0.7428 0.0000 +vt 0.9662 0.6847 0.0000 +vt 0.7025 0.9520 0.0000 +vt 0.7600 0.8750 0.0000 +vt 0.8529 0.8747 0.0000 +vt 0.9109 0.9512 0.0000 +vt 0.6436 0.6859 0.0000 +vt 0.7207 0.7435 0.0000 +vt 0.7210 0.8369 0.0000 +vt 0.6444 0.8955 0.0000 +vt 0.9884 0.9237 0.0000 +vt 0.9417 0.9708 0.0000 +vt 0.7813 0.2656 0.0000 +vt 0.7813 0.5000 0.0000 +vt 0.6721 0.9722 0.0000 +vt 0.6251 0.9265 0.0000 +vt 0.6237 0.6553 0.0000 +vt 0.6705 0.6082 0.0000 +vt 0.7813 -0.0000 0.0000 +vt 0.7813 0.2344 0.0000 +vt 0.9403 0.6072 0.0000 +vt 0.9874 0.6539 0.0000 +vt 0.7725 0.7362 0.0000 +vt 0.7728 0.8432 0.0000 +vt 0.7527 0.8235 0.0000 +vt 0.7524 0.7565 0.0000 +vt 0.8392 0.7360 0.0000 +vt 0.8595 0.7561 0.0000 +vt 0.8597 0.8227 0.0000 +vt 0.8396 0.8430 0.0000 +# 84 texture coords + +g headusOBJexport002 +usemtl Material__46 +s off +f 1/1/1 2/2/1 3/3/1 4/4/1 +f 5/5/2 6/6/2 7/7/2 8/8/2 +f 9/9/3 10/10/3 11/11/3 12/12/3 +f 13/13/4 14/14/4 15/15/4 16/16/4 +s 1 +f 17/17/5 18/18/6 19/19/7 20/20/8 +f 21/21/9 22/22/10 23/23/11 24/24/12 +f 25/25/13 26/26/14 27/27/15 28/28/16 +f 29/29/17 30/30/18 31/31/19 32/32/20 +f 12/33/21 15/34/22 18/35/6 17/36/5 +f 16/37/23 1/38/24 24/39/12 23/40/11 +f 2/41/25 5/42/26 26/43/14 25/44/13 +f 6/45/27 11/46/28 30/47/18 29/48/17 +s 2 +f 3/49/29 33/50/29 34/51/29 4/52/29 +f 7/53/29 35/54/29 36/55/29 8/56/29 +f 9/57/29 37/58/29 38/59/29 10/60/29 +f 13/61/29 39/62/29 40/63/29 14/64/29 +f 9/57/29 14/64/29 40/63/29 37/58/29 +f 4/52/29 34/51/29 39/62/29 13/61/29 +f 8/56/29 36/55/29 33/50/29 3/49/29 +f 10/60/29 38/59/29 35/54/29 7/53/29 +s 1 +f 25/25/13 28/28/16 3/3/30 2/2/25 +s 2 +f 10/60/29 7/53/29 32/65/29 31/66/29 +s 1 +f 17/17/5 20/20/8 9/9/31 12/12/21 +f 23/23/11 22/22/10 13/13/32 16/16/23 +f 11/67/28 10/68/33 31/31/19 30/30/18 +f 29/29/17 32/32/20 7/7/34 6/6/27 +s 2 +f 14/64/29 9/57/29 20/69/29 19/70/29 +s 1 +f 15/15/22 14/14/35 19/19/7 18/18/6 +s 2 +f 4/52/29 13/61/29 22/71/29 21/72/29 +s 1 +f 1/73/24 4/74/36 21/21/9 24/24/12 +s 2 +f 8/56/29 3/49/29 28/75/29 27/76/29 +s 1 +f 41/77/37 42/78/38 43/79/39 44/80/40 +f 45/81/41 41/77/37 34/51/42 33/50/43 +f 46/82/44 45/81/41 33/50/43 36/55/45 +f 47/83/46 46/82/44 36/55/45 35/54/47 +f 48/84/48 47/83/46 35/54/47 38/59/49 +f 42/78/38 48/84/48 38/59/49 37/58/50 +f 43/79/39 42/78/38 37/58/50 40/63/51 +f 44/80/40 43/79/39 40/63/51 39/62/52 +f 41/77/37 44/80/40 39/62/52 34/51/42 +f 48/84/48 45/81/41 46/82/44 47/83/46 +f 45/81/41 48/84/48 42/78/38 41/77/37 +f 16/37/23 15/34/22 12/33/21 1/38/24 +f 2/41/25 11/46/28 6/45/27 5/42/26 +f 11/46/28 2/41/25 1/38/24 12/33/21 +f 5/5/26 8/8/53 27/27/15 26/26/14 +# 46 polygons + diff --git a/1.7.2/resources/assets/alchemicalwizardry/models/bloodlevel.obj b/1.7.2/resources/assets/alchemicalwizardry/models/bloodlevel.obj new file mode 100644 index 00000000..f301ee48 --- /dev/null +++ b/1.7.2/resources/assets/alchemicalwizardry/models/bloodlevel.obj @@ -0,0 +1,64 @@ +# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware +# File Created: 07.08.2013 20:12:01 + +mtllib bloodlevel.mtl + +# +# object headusOBJexport001 +# + +v -1.2846 0.0000 2.0630 +v -1.2890 0.0000 -2.0628 +v -2.0627 0.0000 -1.2993 +v -2.0628 0.0000 1.2848 +v 1.2845 0.0000 2.0630 +v -1.7911 0.0000 3.2857 +v 1.7911 0.0000 3.2857 +v 2.0628 0.0000 1.2848 +v 3.2856 0.0000 1.7912 +v 2.0628 0.0000 -1.2845 +v 3.2856 0.0000 -1.7910 +v 1.2846 0.0000 -2.0627 +v 1.7911 0.0000 -3.2855 +v -1.7907 0.0000 -3.2857 +v -3.2854 0.0000 -1.8107 +v -3.2856 0.0000 1.7912 +# 16 vertices + +vn 0.0000 1.0000 -0.0000 +# 1 vertex normals + +vt 0.3045 0.1861 0.0000 +vt 0.3038 0.8139 0.0000 +vt 0.1861 0.6977 0.0000 +vt 0.1861 0.3045 0.0000 +vt 0.6955 0.1861 0.0000 +vt 0.2274 -0.0000 0.0000 +vt 0.7726 -0.0000 0.0000 +vt 0.8139 0.3045 0.0000 +vt 1.0000 0.2274 0.0000 +vt 0.8139 0.6955 0.0000 +vt 1.0000 0.7725 0.0000 +vt 0.6955 0.8139 0.0000 +vt 0.7726 1.0000 0.0000 +vt 0.2275 1.0000 0.0000 +vt 0.0000 0.7755 0.0000 +vt 0.0000 0.2274 0.0000 +# 16 texture coords + +g headusOBJexport001 +usemtl Material__46 +s 1 +f 1/1/1 2/2/1 3/3/1 4/4/1 +f 5/5/1 1/1/1 6/6/1 7/7/1 +f 8/8/1 5/5/1 7/7/1 9/9/1 +f 10/10/1 8/8/1 9/9/1 11/11/1 +f 12/12/1 10/10/1 11/11/1 13/13/1 +f 2/2/1 12/12/1 13/13/1 14/14/1 +f 3/3/1 2/2/1 14/14/1 15/15/1 +f 4/4/1 3/3/1 15/15/1 16/16/1 +f 1/1/1 4/4/1 16/16/1 6/6/1 +f 12/12/1 5/5/1 8/8/1 10/10/1 +f 5/5/1 12/12/1 2/2/1 1/1/1 +# 11 polygons + diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/AirRitualStone.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/AirRitualStone.png new file mode 100644 index 00000000..73be4924 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/AirRitualStone.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/AlchemicChemistrySet.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/AlchemicChemistrySet.png new file mode 100644 index 00000000..23e179ab Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/AlchemicChemistrySet.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/AltarCapacityRune.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/AltarCapacityRune.png new file mode 100644 index 00000000..567f1315 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/AltarCapacityRune.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/ArcanePedestal.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/ArcanePedestal.png new file mode 100644 index 00000000..6156e3c4 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/ArcanePedestal.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/ArcanePlinth.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/ArcanePlinth.png new file mode 100644 index 00000000..30609eab Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/ArcanePlinth.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BlankRune.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BlankRune.png new file mode 100644 index 00000000..69f8f713 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BlankRune.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BlockBloodLight.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BlockBloodLight.png new file mode 100644 index 00000000..67bede34 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BlockBloodLight.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BloodAltar_Bottom.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BloodAltar_Bottom.png new file mode 100644 index 00000000..8154b3cd Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BloodAltar_Bottom.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BloodAltar_SideType1.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BloodAltar_SideType1.png new file mode 100644 index 00000000..f5d8949c Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BloodAltar_SideType1.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BloodAltar_SideType2.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BloodAltar_SideType2.png new file mode 100644 index 00000000..2cb3bc34 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BloodAltar_SideType2.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BloodAltar_Top.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BloodAltar_Top.png new file mode 100644 index 00000000..3bc3a60a Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BloodAltar_Top.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BloodSocket.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BloodSocket.png new file mode 100644 index 00000000..ce0abab0 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BloodSocket.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BloodStoneBrick.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BloodStoneBrick.png new file mode 100644 index 00000000..1fd91f9e Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/BloodStoneBrick.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/DislocationRune.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/DislocationRune.png new file mode 100644 index 00000000..ed6c886f Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/DislocationRune.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/DuskRitualStone.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/DuskRitualStone.png new file mode 100644 index 00000000..34c6a0a4 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/DuskRitualStone.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/EarthRitualStone.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/EarthRitualStone.png new file mode 100644 index 00000000..4cd9d44b Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/EarthRitualStone.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/EfficiencyRune.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/EfficiencyRune.png new file mode 100644 index 00000000..6c950f9e Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/EfficiencyRune.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/EmptySocket.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/EmptySocket.png new file mode 100644 index 00000000..46c32374 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/EmptySocket.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/FireRitualStone.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/FireRitualStone.png new file mode 100644 index 00000000..34464e7e Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/FireRitualStone.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/HomHeart_bottom.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/HomHeart_bottom.png new file mode 100644 index 00000000..de3fb1bf Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/HomHeart_bottom.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/HomHeart_side.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/HomHeart_side.png new file mode 100644 index 00000000..33e25e94 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/HomHeart_side.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/HomHeart_top.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/HomHeart_top.png new file mode 100644 index 00000000..45c4f5bb Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/HomHeart_top.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/HomHeart_top1.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/HomHeart_top1.png new file mode 100644 index 00000000..d8ad8f9e Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/HomHeart_top1.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/ImperfectRitualStone.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/ImperfectRitualStone.png new file mode 100644 index 00000000..dbd6b761 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/ImperfectRitualStone.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/LargeBloodStoneBrick.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/LargeBloodStoneBrick.png new file mode 100644 index 00000000..662473b1 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/LargeBloodStoneBrick.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/MasterStone.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/MasterStone.png new file mode 100644 index 00000000..bd240989 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/MasterStone.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/OrbCapacityRune.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/OrbCapacityRune.png new file mode 100644 index 00000000..2845bd85 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/OrbCapacityRune.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/RitualStone.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/RitualStone.png new file mode 100644 index 00000000..0bd9343b Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/RitualStone.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/RuneOfSacrifice.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/RuneOfSacrifice.png new file mode 100644 index 00000000..20faa107 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/RuneOfSacrifice.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/RuneOfSelfSacrifice.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/RuneOfSelfSacrifice.png new file mode 100644 index 00000000..748a287d Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/RuneOfSelfSacrifice.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/SoulForge.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/SoulForge.png new file mode 100644 index 00000000..11dc21a4 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/SoulForge.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/SpectralBlock.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/SpectralBlock.png new file mode 100644 index 00000000..7a98c46a Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/SpectralBlock.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/SpeedRune.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/SpeedRune.png new file mode 100644 index 00000000..741006b5 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/SpeedRune.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/Teleposer_Side.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/Teleposer_Side.png new file mode 100644 index 00000000..45a0707b Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/Teleposer_Side.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/Teleposer_Top.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/Teleposer_Top.png new file mode 100644 index 00000000..3818b504 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/Teleposer_Top.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/Testing.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/Testing.png new file mode 100644 index 00000000..afc0bcb0 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/Testing.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/WaterRitualStone.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/WaterRitualStone.png new file mode 100644 index 00000000..101908e8 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/WaterRitualStone.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/fireEffectBlock_blank.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/fireEffectBlock_blank.png new file mode 100644 index 00000000..29c332d4 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/fireEffectBlock_blank.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/fireEffectBlock_input.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/fireEffectBlock_input.png new file mode 100644 index 00000000..55345660 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/fireEffectBlock_input.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/fireEffectBlock_output.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/fireEffectBlock_output.png new file mode 100644 index 00000000..52490247 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/fireEffectBlock_output.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/fireEffectBlock_upArrow.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/fireEffectBlock_upArrow.png new file mode 100644 index 00000000..5fcbd044 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/fireEffectBlock_upArrow.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceFlowing.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceFlowing.png new file mode 100644 index 00000000..05cfdd4e Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceFlowing.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceStill.png b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceStill.png new file mode 100644 index 00000000..270c26a0 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/blocks/lifeEssenceStill.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/entities/energyBlastProjectile.png b/1.7.2/resources/assets/alchemicalwizardry/textures/entities/energyBlastProjectile.png new file mode 100644 index 00000000..91b4a55d Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/entities/energyBlastProjectile.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/entities/explosionProjectile.png b/1.7.2/resources/assets/alchemicalwizardry/textures/entities/explosionProjectile.png new file mode 100644 index 00000000..24b7a2f4 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/entities/explosionProjectile.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/entities/fireProjectile.png b/1.7.2/resources/assets/alchemicalwizardry/textures/entities/fireProjectile.png new file mode 100644 index 00000000..5a6d4f2a Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/entities/fireProjectile.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/entities/holyProjectile.png b/1.7.2/resources/assets/alchemicalwizardry/textures/entities/holyProjectile.png new file mode 100644 index 00000000..35a03e3d Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/entities/holyProjectile.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/entities/iceProjectile.png b/1.7.2/resources/assets/alchemicalwizardry/textures/entities/iceProjectile.png new file mode 100644 index 00000000..9eab38e0 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/entities/iceProjectile.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/entities/lightningProjectile.png b/1.7.2/resources/assets/alchemicalwizardry/textures/entities/lightningProjectile.png new file mode 100644 index 00000000..e68e7880 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/entities/lightningProjectile.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/entities/mudProjectile.png b/1.7.2/resources/assets/alchemicalwizardry/textures/entities/mudProjectile.png new file mode 100644 index 00000000..5c8189f5 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/entities/mudProjectile.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/entities/waterProjectile.png b/1.7.2/resources/assets/alchemicalwizardry/textures/entities/waterProjectile.png new file mode 100644 index 00000000..42f35c42 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/entities/waterProjectile.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/entities/windGustProjectile.png b/1.7.2/resources/assets/alchemicalwizardry/textures/entities/windGustProjectile.png new file mode 100644 index 00000000..9bf829d9 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/entities/windGustProjectile.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/gui/GuiTrap.png b/1.7.2/resources/assets/alchemicalwizardry/textures/gui/GuiTrap.png new file mode 100644 index 00000000..2fdb824e Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/gui/GuiTrap.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/8wWtY8d.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/8wWtY8d.png new file mode 100644 index 00000000..0e9d01e2 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/8wWtY8d.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/Aether.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/Aether.png new file mode 100644 index 00000000..9bf829d9 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/Aether.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/AirScribeTool.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/AirScribeTool.png new file mode 100644 index 00000000..574f4222 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/AirScribeTool.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/AirSigil.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/AirSigil.png new file mode 100644 index 00000000..17246bb0 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/AirSigil.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/AlchemyFlask.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/AlchemyFlask.png new file mode 100644 index 00000000..690ed4bf Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/AlchemyFlask.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/ApprenticeBloodOrb.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ApprenticeBloodOrb.png new file mode 100644 index 00000000..1653f049 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ApprenticeBloodOrb.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/Aquasalus.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/Aquasalus.png new file mode 100644 index 00000000..24f96281 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/Aquasalus.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/ArchmageBloodOrb.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ArchmageBloodOrb.png new file mode 100644 index 00000000..327d2b27 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ArchmageBloodOrb.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/ArmourInhibitor_activated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ArmourInhibitor_activated.png new file mode 100644 index 00000000..ab4bf964 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ArmourInhibitor_activated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/ArmourInhibitor_deactivated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ArmourInhibitor_deactivated.png new file mode 100644 index 00000000..9b412be0 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ArmourInhibitor_deactivated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/AverageLengtheningCatalyst.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/AverageLengtheningCatalyst.png new file mode 100644 index 00000000..e2dc835e Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/AverageLengtheningCatalyst.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/AveragePowerCatalyst.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/AveragePowerCatalyst.png new file mode 100644 index 00000000..bef44443 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/AveragePowerCatalyst.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/BlankSlate.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BlankSlate.png new file mode 100644 index 00000000..f7ce2e2e Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BlankSlate.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/BlankSpell.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BlankSpell.png new file mode 100644 index 00000000..ba113199 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BlankSpell.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/BloodFrame.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BloodFrame.png new file mode 100644 index 00000000..717f240c Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BloodFrame.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/BloodLightSigil.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BloodLightSigil.png new file mode 100644 index 00000000..9223ee99 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BloodLightSigil.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundAxe_activated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundAxe_activated.png new file mode 100644 index 00000000..3f332c6d Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundAxe_activated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundBoots.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundBoots.png new file mode 100644 index 00000000..0c5e21e5 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundBoots.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundHelmet.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundHelmet.png new file mode 100644 index 00000000..4b4b366d Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundHelmet.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundLeggings.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundLeggings.png new file mode 100644 index 00000000..9effc699 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundLeggings.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundPickaxe_activated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundPickaxe_activated.png new file mode 100644 index 00000000..88c60264 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundPickaxe_activated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundPickaxe_deactivated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundPickaxe_deactivated.png new file mode 100644 index 00000000..59504032 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundPickaxe_deactivated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundPlate.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundPlate.png new file mode 100644 index 00000000..49702f68 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundPlate.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundShovel_activated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundShovel_activated.png new file mode 100644 index 00000000..8dd6dc38 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundShovel_activated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundSword_activated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundSword_activated.png new file mode 100644 index 00000000..4ae9464f Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BoundSword_activated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/BridgeSigil_activated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BridgeSigil_activated.png new file mode 100644 index 00000000..37ddd604 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BridgeSigil_activated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/BridgeSigil_deactivated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BridgeSigil_deactivated.png new file mode 100644 index 00000000..88fed2b9 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/BridgeSigil_deactivated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/CeremonialDagger.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/CeremonialDagger.png new file mode 100644 index 00000000..c8a666ce Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/CeremonialDagger.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/Crepitous.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/Crepitous.png new file mode 100644 index 00000000..1422bd5b Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/Crepitous.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/Crystallos.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/Crystallos.png new file mode 100644 index 00000000..0ade6203 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/Crystallos.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/DaggerOfSacrifice.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/DaggerOfSacrifice.png new file mode 100644 index 00000000..2d7f4a1c Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/DaggerOfSacrifice.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/DemonBloodShard.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/DemonBloodShard.png new file mode 100644 index 00000000..0aa05b5c Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/DemonBloodShard.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/DemonPlacer.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/DemonPlacer.png new file mode 100644 index 00000000..371ffac6 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/DemonPlacer.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/DemonSlate.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/DemonSlate.png new file mode 100644 index 00000000..ca195b9e Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/DemonSlate.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/DemonicTeleposerFocus.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/DemonicTeleposerFocus.png new file mode 100644 index 00000000..72f3c036 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/DemonicTeleposerFocus.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/DiabloKey.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/DiabloKey.png new file mode 100644 index 00000000..e0537ee7 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/DiabloKey.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/DivinationSigil.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/DivinationSigil.png new file mode 100644 index 00000000..53dd25c7 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/DivinationSigil.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/DuskScribeTool.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/DuskScribeTool.png new file mode 100644 index 00000000..b7e2aeab Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/DuskScribeTool.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/EarthScribeTool.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/EarthScribeTool.png new file mode 100644 index 00000000..a7f197a4 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/EarthScribeTool.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/ElementalInkAir.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ElementalInkAir.png new file mode 100644 index 00000000..e7d3e1ff Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ElementalInkAir.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/ElementalInkEarth.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ElementalInkEarth.png new file mode 100644 index 00000000..ee69a93f Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ElementalInkEarth.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/ElementalInkFire.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ElementalInkFire.png new file mode 100644 index 00000000..6f69f5ba Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ElementalInkFire.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/ElementalInkWater.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ElementalInkWater.png new file mode 100644 index 00000000..35f17a0a Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ElementalInkWater.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/ElementalSigil_activated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ElementalSigil_activated.png new file mode 100644 index 00000000..04c3aafc Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ElementalSigil_activated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/ElementalSigil_deactivated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ElementalSigil_deactivated.png new file mode 100644 index 00000000..f91496e1 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ElementalSigil_deactivated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/EnergyBattery.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/EnergyBattery.png new file mode 100644 index 00000000..1ab960d1 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/EnergyBattery.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/EnergyBazooka_activated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/EnergyBazooka_activated.png new file mode 100644 index 00000000..ddd369fe Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/EnergyBazooka_activated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/EnergyBlaster_activated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/EnergyBlaster_activated.png new file mode 100644 index 00000000..2e245f2f Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/EnergyBlaster_activated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/EnhancedFillingAgent.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/EnhancedFillingAgent.png new file mode 100644 index 00000000..17137014 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/EnhancedFillingAgent.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/EnhancedTeleposerFocus.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/EnhancedTeleposerFocus.png new file mode 100644 index 00000000..06436a18 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/EnhancedTeleposerFocus.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/FireScribeTool.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/FireScribeTool.png new file mode 100644 index 00000000..537d7a23 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/FireScribeTool.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/GreaterLengtheningCatalyst.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/GreaterLengtheningCatalyst.png new file mode 100644 index 00000000..dd7811a1 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/GreaterLengtheningCatalyst.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/GreaterPowerCatalyst.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/GreaterPowerCatalyst.png new file mode 100644 index 00000000..8d1ad0c5 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/GreaterPowerCatalyst.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/GrowthSigil_activated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/GrowthSigil_activated.png new file mode 100644 index 00000000..e970db38 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/GrowthSigil_activated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/GrowthSigil_deactivated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/GrowthSigil_deactivated.png new file mode 100644 index 00000000..49925f0f Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/GrowthSigil_deactivated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/HasteSigil_activated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/HasteSigil_activated.png new file mode 100644 index 00000000..b264b6e0 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/HasteSigil_activated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/HasteSigil_deactivated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/HasteSigil_deactivated.png new file mode 100644 index 00000000..aff173d7 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/HasteSigil_deactivated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/IceSigil_activated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/IceSigil_activated.png new file mode 100644 index 00000000..30ff69d3 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/IceSigil_activated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/IceSigil_deactivated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/IceSigil_deactivated.png new file mode 100644 index 00000000..19ea4b56 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/IceSigil_deactivated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/Incendium.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/Incendium.png new file mode 100644 index 00000000..6bd023dc Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/Incendium.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/InfusedSlate.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/InfusedSlate.png new file mode 100644 index 00000000..88d13950 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/InfusedSlate.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/LavaCrystal.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/LavaCrystal.png new file mode 100644 index 00000000..688b6091 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/LavaCrystal.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/LavaSigil.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/LavaSigil.png new file mode 100644 index 00000000..0179cf94 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/LavaSigil.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/LifeBucket.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/LifeBucket.png new file mode 100644 index 00000000..52756dbf Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/LifeBucket.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/Magicales.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/Magicales.png new file mode 100644 index 00000000..e078a01b Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/Magicales.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/MagicianBloodOrb.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/MagicianBloodOrb.png new file mode 100644 index 00000000..eaf11afb Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/MagicianBloodOrb.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/MasterBloodOrb.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/MasterBloodOrb.png new file mode 100644 index 00000000..3a448cf2 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/MasterBloodOrb.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/MiningSigil_activated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/MiningSigil_activated.png new file mode 100644 index 00000000..8b25db87 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/MiningSigil_activated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/MiningSigil_deactivated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/MiningSigil_deactivated.png new file mode 100644 index 00000000..3d80e351 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/MiningSigil_deactivated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/MundaneLengtheningCatalyst.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/MundaneLengtheningCatalyst.png new file mode 100644 index 00000000..ce906c35 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/MundaneLengtheningCatalyst.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/MundanePowerCatalyst.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/MundanePowerCatalyst.png new file mode 100644 index 00000000..217fc375 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/MundanePowerCatalyst.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/PotionFlask.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/PotionFlask.png new file mode 100644 index 00000000..b0d3231e Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/PotionFlask.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/ReinforcedSlate.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ReinforcedSlate.png new file mode 100644 index 00000000..9485f48a Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ReinforcedSlate.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/ReinforcedTeleposerFocus.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ReinforcedTeleposerFocus.png new file mode 100644 index 00000000..0ff4f129 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/ReinforcedTeleposerFocus.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/RitualDiviner.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/RitualDiviner.png new file mode 100644 index 00000000..8e61b052 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/RitualDiviner.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/SacrificialDagger.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/SacrificialDagger.png new file mode 100644 index 00000000..28cb9378 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/SacrificialDagger.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/Sanctus.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/Sanctus.png new file mode 100644 index 00000000..21dbc74a Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/Sanctus.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/SanguineHelmet.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/SanguineHelmet.png new file mode 100644 index 00000000..6149aff0 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/SanguineHelmet.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/SheathedItem.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/SheathedItem.png new file mode 100644 index 00000000..03a3915a Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/SheathedItem.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/SigilOfHolding.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/SigilOfHolding.png new file mode 100644 index 00000000..0eb3443c Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/SigilOfHolding.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/SigilOfMagnetism_activated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/SigilOfMagnetism_activated.png new file mode 100644 index 00000000..47427490 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/SigilOfMagnetism_activated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/SigilOfMagnetism_deactivated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/SigilOfMagnetism_deactivated.png new file mode 100644 index 00000000..d740b00c Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/SigilOfMagnetism_deactivated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/SimpleCatalyst.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/SimpleCatalyst.png new file mode 100644 index 00000000..3fb0f327 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/SimpleCatalyst.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/StandardBindingAgent.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/StandardBindingAgent.png new file mode 100644 index 00000000..64d2cacb Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/StandardBindingAgent.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/StandardFillingAgent.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/StandardFillingAgent.png new file mode 100644 index 00000000..4e4c8f45 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/StandardFillingAgent.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/TeleposerFocus.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/TeleposerFocus.png new file mode 100644 index 00000000..6d9533fa Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/TeleposerFocus.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/Tennebrae.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/Tennebrae.png new file mode 100644 index 00000000..e4768e22 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/Tennebrae.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/Terrae.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/Terrae.png new file mode 100644 index 00000000..81e1154a Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/Terrae.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/UntamedCrystal.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/UntamedCrystal.png new file mode 100644 index 00000000..651bd068 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/UntamedCrystal.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/VoidSigil.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/VoidSigil.png new file mode 100644 index 00000000..dc133cdf Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/VoidSigil.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/WarriorSigil_activated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/WarriorSigil_activated.png new file mode 100644 index 00000000..592ff422 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/WarriorSigil_activated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/WarriorSigil_deactivated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/WarriorSigil_deactivated.png new file mode 100644 index 00000000..41c0b81d Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/WarriorSigil_deactivated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/WaterScribeTool.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/WaterScribeTool.png new file mode 100644 index 00000000..69b8f722 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/WaterScribeTool.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/WaterSigil.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/WaterSigil.png new file mode 100644 index 00000000..dfd095b5 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/WaterSigil.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/WeakBindingAgent.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/WeakBindingAgent.png new file mode 100644 index 00000000..2cf917b9 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/WeakBindingAgent.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/WeakBloodShard.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/WeakBloodShard.png new file mode 100644 index 00000000..b09932c4 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/WeakBloodShard.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/WeakFillingAgent.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/WeakFillingAgent.png new file mode 100644 index 00000000..d9b054ee Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/WeakFillingAgent.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/WindSigil_activated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/WindSigil_activated.png new file mode 100644 index 00000000..df200e2b Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/WindSigil_activated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/WindSigil_deactivated.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/WindSigil_deactivated.png new file mode 100644 index 00000000..bfb6ab4d Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/WindSigil_deactivated.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/activationCrystalAwakened.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/activationCrystalAwakened.png new file mode 100644 index 00000000..7fb3dd1f Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/activationCrystalAwakened.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/activationCrystalWeak.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/activationCrystalWeak.png new file mode 100644 index 00000000..d6ee0b77 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/activationCrystalWeak.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/bloodBlastOrn.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/bloodBlastOrn.png new file mode 100644 index 00000000..1e15fd72 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/bloodBlastOrn.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/focusBloodBlastOrn.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/focusBloodBlastOrn.png new file mode 100644 index 00000000..b18a4ad0 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/focusBloodBlastOrn.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/items/tYf5ft9.png b/1.7.2/resources/assets/alchemicalwizardry/textures/items/tYf5ft9.png new file mode 100644 index 00000000..052c7ca3 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/items/tYf5ft9.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/AirFloatingBeacon.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/AirFloatingBeacon.png new file mode 100644 index 00000000..81fd4705 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/AirFloatingBeacon.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/BileDemon.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/BileDemon.png new file mode 100644 index 00000000..724f306f Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/BileDemon.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/Bird.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/Bird.png new file mode 100644 index 00000000..e4c22ee4 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/Bird.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/BlockSpellEffect.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/BlockSpellEffect.png new file mode 100644 index 00000000..e22b9c40 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/BlockSpellEffect.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/BoulderFist.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/BoulderFist.png new file mode 100644 index 00000000..92839932 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/BoulderFist.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/Conduit.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/Conduit.png new file mode 100644 index 00000000..f37beb5a Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/Conduit.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/DarkFloatingBeacon.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/DarkFloatingBeacon.png new file mode 100644 index 00000000..11b2099d Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/DarkFloatingBeacon.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/EarthFloatingBeacon.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/EarthFloatingBeacon.png new file mode 100644 index 00000000..bc116b2f Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/EarthFloatingBeacon.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/EnergyBazookaMainProjectile.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/EnergyBazookaMainProjectile.png new file mode 100644 index 00000000..6be1c2b5 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/EnergyBazookaMainProjectile.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/FireFloatingBeacon.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/FireFloatingBeacon.png new file mode 100644 index 00000000..f1ac14e6 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/FireFloatingBeacon.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/FloatingBeacon.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/FloatingBeacon.png new file mode 100644 index 00000000..7882bb35 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/FloatingBeacon.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/HolyFloatingBeacon.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/HolyFloatingBeacon.png new file mode 100644 index 00000000..5f775e02 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/HolyFloatingBeacon.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/IceDemon.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/IceDemon.png new file mode 100644 index 00000000..6cb34978 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/IceDemon.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/LowerGuardian.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/LowerGuardian.png new file mode 100644 index 00000000..aa6b2c24 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/LowerGuardian.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/Meteor.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/Meteor.png new file mode 100644 index 00000000..194d9843 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/Meteor.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/Pedestal.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/Pedestal.png new file mode 100644 index 00000000..818dd50a Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/Pedestal.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/Plinth.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/Plinth.png new file mode 100644 index 00000000..df115798 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/Plinth.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/ShadeMob.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/ShadeMob.png new file mode 100644 index 00000000..7c346a35 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/ShadeMob.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/SmallEarthGolem.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/SmallEarthGolem.png new file mode 100644 index 00000000..d4e5b8a7 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/SmallEarthGolem.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/SpellEffectEarth.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/SpellEffectEarth.png new file mode 100644 index 00000000..eeb026bc Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/SpellEffectEarth.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/SpellEffectFire.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/SpellEffectFire.png new file mode 100644 index 00000000..f079a183 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/SpellEffectFire.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/SpellEffectIce.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/SpellEffectIce.png new file mode 100644 index 00000000..33b61d44 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/SpellEffectIce.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/SpellEffectWind.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/SpellEffectWind.png new file mode 100644 index 00000000..6270aa80 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/SpellEffectWind.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/WaterFloatingBeacon.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/WaterFloatingBeacon.png new file mode 100644 index 00000000..b545bbf0 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/WaterFloatingBeacon.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/WingedAngel.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/WingedAngel.png new file mode 100644 index 00000000..4ae2cfd5 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/WingedAngel.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/WingedFireDemon.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/WingedFireDemon.png new file mode 100644 index 00000000..0e365bab Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/WingedFireDemon.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/WritingTable.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/WritingTable.png new file mode 100644 index 00000000..5aa176e4 Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/WritingTable.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/altar.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/altar.png new file mode 100644 index 00000000..6b6ac12e Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/altar.png differ diff --git a/1.7.2/resources/assets/alchemicalwizardry/textures/models/blood.png b/1.7.2/resources/assets/alchemicalwizardry/textures/models/blood.png new file mode 100644 index 00000000..05cfdd4e Binary files /dev/null and b/1.7.2/resources/assets/alchemicalwizardry/textures/models/blood.png differ diff --git a/1.7.2/resources/assets/forge/lang/en_US.lang b/1.7.2/resources/assets/forge/lang/en_US.lang new file mode 100644 index 00000000..2f9368d4 --- /dev/null +++ b/1.7.2/resources/assets/forge/lang/en_US.lang @@ -0,0 +1,5 @@ +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s : Mean tick time: %d ms. Mean TPS: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. \ No newline at end of file diff --git a/1.7.2/resources/assets/forge/lang/es_ES.lang b/1.7.2/resources/assets/forge/lang/es_ES.lang new file mode 100644 index 00000000..b7c198ee --- /dev/null +++ b/1.7.2/resources/assets/forge/lang/es_ES.lang @@ -0,0 +1,5 @@ +commands.forge.usage=Usa /forge . Los subcomandos son tps, track +commands.forge.usage.tracking=Usa /forge track . Los tipos válidos te (Tile Entities). La duración es < 60. +commands.forge.tps.summary=%s : Tiempo de tick medio: %d ms. TPS medio: %d + +commands.forge.tracking.te.enabled=Rastreo de Tile Entity activado durante %d segundos. diff --git a/1.7.2/resources/assets/forge/lang/fr_FR.lang b/1.7.2/resources/assets/forge/lang/fr_FR.lang new file mode 100644 index 00000000..bd01daa9 --- /dev/null +++ b/1.7.2/resources/assets/forge/lang/fr_FR.lang @@ -0,0 +1,5 @@ +commands.forge.usage=Utilisez /forge . Les sous-commandes sont tps, track +commands.forge.usage.tracking=Utilisez /forge track . Les types valides sont te (Tile Entities). La durée doit être inférieur à 60. +commands.forge.tps.summary=%s : Duré de tick : %d ms. TPS moyen : %d + +commands.forge.tracking.te.enabled=Trackage des Tile Entity activé pour %d secondes. \ No newline at end of file diff --git a/1.7.2/resources/mcmod.info b/1.7.2/resources/mcmod.info new file mode 100644 index 00000000..e7148b21 --- /dev/null +++ b/1.7.2/resources/mcmod.info @@ -0,0 +1,16 @@ +[ +{ + "modid": "examplemod", + "name": "Example Mod", + "description": "Example placeholder mod.", + "version": "${version}", + "mcversion": "${mcversion}", + "url": "", + "updateUrl": "", + "authors": ["ExampleDude"], + "credits": "The Forge and FML guys, for making this example", + "logoFile": "", + "screenshots": [], + "dependencies": [] +} +] diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectEarth.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectEarth.java index ee98c2d2..af5709e0 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectEarth.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectEarth.java @@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.ProjectileEnvironmentalEarth; public class SpellEffectEarth extends SpellEffect { @@ -30,7 +31,7 @@ public class SpellEffectEarth extends SpellEffect @Override public void environmentalModificationProjectile(SpellParadigmProjectile parad) { - // TODO Auto-generated method stub + parad.addUpdateEffect(new ProjectileEnvironmentalEarth(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); } diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectWind.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectWind.java index 0b9f2623..de3ca561 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectWind.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectWind.java @@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.ProjectileEnvironmentalWind; public class SpellEffectWind extends SpellEffect { @@ -30,7 +31,7 @@ public class SpellEffectWind extends SpellEffect @Override public void environmentalModificationProjectile(SpellParadigmProjectile parad) { - // TODO Auto-generated method stub + parad.addUpdateEffect(new ProjectileEnvironmentalWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); } diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileEnvironmentalEarth.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileEnvironmentalEarth.java new file mode 100644 index 00000000..7408fae8 --- /dev/null +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/ProjectileEnvironmentalEarth.java @@ -0,0 +1,66 @@ +package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.spell.complex.EntitySpellProjectile; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileUpdateEffect; + +public class ProjectileEnvironmentalEarth extends ProjectileUpdateEffect +{ + public ProjectileEnvironmentalEarth(int power, int potency, int cost) + { + super(power, potency, cost); + } + + @Override + public void onUpdateEffect(Entity projectile) + { + Vec3 posVec = SpellHelper.getEntityBlockVector(projectile); + + int horizRange = this.powerUpgrades+2; + int vertRange = 0*this.potencyUpgrades+1; + int maxBlocks = (int)(2*Math.pow(this.potencyUpgrades,3)) + 3; + + int posX = (int)(posVec.xCoord); + int posY = (int)(posVec.yCoord); + int posZ = (int)(posVec.zCoord); + + World worldObj = projectile.worldObj; + + if(projectile instanceof EntitySpellProjectile) + { + int blocksBroken = ((EntitySpellProjectile) projectile).getBlocksBroken(); + + if(blocksBroken>=maxBlocks) + { + return; + } + + for(int i=-horizRange; i<=horizRange; i++) + { + for(int j=-vertRange; j<=vertRange; j++) + { + for(int k=-horizRange; k<=horizRange; k++) + { + if(!worldObj.isAirBlock(posX+i, posY+j, posZ+k)&&blocksBroken entitylist = SpellHelper.getEntitiesInRange(worldObj, projectile.posX, projectile.posY, projectile.posZ, horizRange, vertRange); + if(entitylist !=null) + { + for(Entity entity : entitylist) + { + if(entity instanceof EntityItem) + { + entity.onCollideWithPlayer((EntityPlayer)shooter); + } + } + } + } + } + + + } +} diff --git a/resources/assets/alchemicalwizardry/textures/models/SpellEffectEarth.png b/resources/assets/alchemicalwizardry/textures/models/SpellEffectEarth.png new file mode 100644 index 00000000..eeb026bc Binary files /dev/null and b/resources/assets/alchemicalwizardry/textures/models/SpellEffectEarth.png differ diff --git a/resources/assets/alchemicalwizardry/textures/models/SpellEffectFire.png b/resources/assets/alchemicalwizardry/textures/models/SpellEffectFire.png index 767fb339..f079a183 100644 Binary files a/resources/assets/alchemicalwizardry/textures/models/SpellEffectFire.png and b/resources/assets/alchemicalwizardry/textures/models/SpellEffectFire.png differ diff --git a/resources/assets/alchemicalwizardry/textures/models/SpellEffectIce.png b/resources/assets/alchemicalwizardry/textures/models/SpellEffectIce.png index 090b082a..33b61d44 100644 Binary files a/resources/assets/alchemicalwizardry/textures/models/SpellEffectIce.png and b/resources/assets/alchemicalwizardry/textures/models/SpellEffectIce.png differ diff --git a/resources/assets/alchemicalwizardry/textures/models/SpellEffectWind.png b/resources/assets/alchemicalwizardry/textures/models/SpellEffectWind.png index e3d75155..6270aa80 100644 Binary files a/resources/assets/alchemicalwizardry/textures/models/SpellEffectWind.png and b/resources/assets/alchemicalwizardry/textures/models/SpellEffectWind.png differ