diff --git a/BM_src/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/BM_src/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index d387cf35..ccd9190b 100644 --- a/BM_src/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/BM_src/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -55,6 +55,10 @@ 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.sigil.SigilOfHolding; import WayofTime.alchemicalWizardry.common.items.thaumcraft.ItemSanguineArmour; @@ -80,6 +84,10 @@ 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; @@ -286,18 +294,21 @@ public class AlchemicalWizardry public static int blockConduitBlockID; public static int blockBloodLightBlockID; public static int blockSpellEffectBlockID; + public static int blockSpellParadigmBlockID; + public static int blockSpellModifierBlockID; + public static int blockSpellEnhancementBlockID; public static void registerRenderInformation() { } - ; + public static void registerRenderThings() { } - ; + // The instance of your mod that Forge uses. @Instance("AWWayofTime") @@ -655,12 +666,49 @@ public class AlchemicalWizardry 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"); // GameRegistry.registerBlock(ModBlocks.bloodRune, ItemBloodRuneBlock.class, "AlchemicalWizardry" + (ModBlocks.bloodRune.getUnlocalizedName().substring(5))); 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 + + GameRegistry.registerBlock(ModBlocks.blockSpellParadigm, ItemSpellParadigmBlock.class, "AlchemicalWizardry" + (ModBlocks.blockSpellParadigm.getUnlocalizedName())); + 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"); + + GameRegistry.registerBlock(ModBlocks.blockSpellEnhancement, ItemSpellEnhancementBlock.class,"AlchemicalWizardry" + (ModBlocks.blockSpellEnhancement.getUnlocalizedName())); + 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"); + + GameRegistry.registerBlock(ModBlocks.blockSpellModifier, ItemSpellModifierBlock.class,"AlchemicalWizardry" + (ModBlocks.blockSpellModifier.getUnlocalizedName())); + 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"); + + GameRegistry.registerBlock(ModBlocks.blockSpellEffect, ItemSpellEffectBlock.class,"AlchemicalWizardry" + (ModBlocks.blockSpellEffect.getUnlocalizedName())); + LanguageRegistry.addName(new ItemStack(ModBlocks.blockSpellEffect, 1, 0), "Crucible of Fire"); + GameRegistry.registerBlock(ModBlocks.speedRune, "speedRune"); LanguageRegistry.addName(ModBlocks.speedRune, "Speed Rune"); GameRegistry.registerBlock(ModBlocks.efficiencyRune, "efficiencyRune"); diff --git a/BM_src/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java b/BM_src/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java index e6c63b88..2be09e7e 100644 --- a/BM_src/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java +++ b/BM_src/WayofTime/alchemicalWizardry/BloodMagicConfiguration.java @@ -84,6 +84,9 @@ public class BloodMagicConfiguration 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(); diff --git a/BM_src/WayofTime/alchemicalWizardry/ModBlocks.java b/BM_src/WayofTime/alchemicalWizardry/ModBlocks.java index 7a0bb761..8a123894 100644 --- a/BM_src/WayofTime/alchemicalWizardry/ModBlocks.java +++ b/BM_src/WayofTime/alchemicalWizardry/ModBlocks.java @@ -42,6 +42,9 @@ public class ModBlocks 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() { @@ -73,5 +76,8 @@ public class ModBlocks blockConduit = new BlockConduit(AlchemicalWizardry.blockConduitBlockID); blockBloodLight = new BlockBloodLightSource(AlchemicalWizardry.blockBloodLightBlockID); blockSpellEffect = new BlockSpellEffect(AlchemicalWizardry.blockSpellEffectBlockID); + blockSpellParadigm = new BlockSpellParadigm(AlchemicalWizardry.blockSpellParadigmBlockID); + blockSpellModifier = new BlockSpellModifier(AlchemicalWizardry.blockSpellModifierBlockID); + blockSpellEnhancement = new BlockSpellEnhancement(AlchemicalWizardry.blockSpellEnhancementBlockID); } } diff --git a/BM_src/WayofTime/alchemicalWizardry/ModItems.java b/BM_src/WayofTime/alchemicalWizardry/ModItems.java index 689d04b0..e7590fa7 100644 --- a/BM_src/WayofTime/alchemicalWizardry/ModItems.java +++ b/BM_src/WayofTime/alchemicalWizardry/ModItems.java @@ -90,7 +90,7 @@ public class ModItems public static Item armourInhibitor; public static Item creativeFiller; public static Item demonPlacer; - public static Item itemBloodRuneBlock; + public static Item weakFillingAgent; public static Item standardFillingAgent; public static Item enhancedFillingAgent; diff --git a/BM_src/WayofTime/alchemicalWizardry/common/block/BlockHomHeart.java b/BM_src/WayofTime/alchemicalWizardry/common/block/BlockHomHeart.java index 7a34a5bf..40d9be27 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/block/BlockHomHeart.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/block/BlockHomHeart.java @@ -71,7 +71,6 @@ public class BlockHomHeart extends BlockContainer return false; } - BlockGrass d; ItemStack playerItem = player.getCurrentEquippedItem(); if (playerItem != null) diff --git a/BM_src/WayofTime/alchemicalWizardry/common/block/BlockOrientable.java b/BM_src/WayofTime/alchemicalWizardry/common/block/BlockOrientable.java index c9dee139..169f81be 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/block/BlockOrientable.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/block/BlockOrientable.java @@ -15,16 +15,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockOrientable extends BlockContainer -{ - @SideOnly(Side.CLIENT) - private static Icon topIcon; - @SideOnly(Side.CLIENT) - private static Icon sideIcon1; - @SideOnly(Side.CLIENT) - private static Icon sideIcon2; - @SideOnly(Side.CLIENT) - private static Icon bottomIcon; - +{ @SideOnly(Side.CLIENT) private static Icon[] fireIcons; @@ -41,17 +32,12 @@ public class BlockOrientable extends BlockContainer @Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister 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"); - + { this.fireIcons = this.registerIconsWithString(iconRegister, "fireEffectBlock"); } @SideOnly(Side.CLIENT) - public Icon[] registerIconsWithString(IconRegister iconRegister, String blockString) + public static Icon[] registerIconsWithString(IconRegister iconRegister, String blockString) { Icon[] icons = new Icon[7]; @@ -70,20 +56,11 @@ public class BlockOrientable extends BlockContainer @SideOnly(Side.CLIENT) public Icon getIcon(int side, int meta) { + Icon[] icons = this.getIconsForMeta(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; + case 4: return icons[1]; + default: return icons[6]; } } diff --git a/BM_src/WayofTime/alchemicalWizardry/common/block/BlockSpellEffect.java b/BM_src/WayofTime/alchemicalWizardry/common/block/BlockSpellEffect.java index f2b38a82..dd940132 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/block/BlockSpellEffect.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/block/BlockSpellEffect.java @@ -1,12 +1,21 @@ package WayofTime.alchemicalWizardry.common.block; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock; + public class BlockSpellEffect extends BlockOrientable { - public BlockSpellEffect(int id) { super(id); setUnlocalizedName("blockSpellEffect"); } + + @Override + public TileEntity createNewTileEntity(World world) + { + return new TESpellEffectBlock(); + } } diff --git a/BM_src/WayofTime/alchemicalWizardry/common/block/BlockSpellEnhancement.java b/BM_src/WayofTime/alchemicalWizardry/common/block/BlockSpellEnhancement.java new file mode 100644 index 00000000..3d166d8e --- /dev/null +++ b/BM_src/WayofTime/alchemicalWizardry/common/block/BlockSpellEnhancement.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.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(int id) + { + super(id); + setUnlocalizedName("blockSpellEnhancement"); + } + + @Override + public TileEntity createNewTileEntity(World world) + { + return new TESpellEnhancementBlock(); + } + + @SideOnly(Side.CLIENT) + public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) + { + if (this.blockID == ModBlocks.blockSpellEnhancement.blockID) + { + for(int i=0; i<15; i++) + { + par3List.add(new ItemStack(par1, 1, i)); + } + } else + { + super.getSubBlocks(par1, par2CreativeTabs, par3List); + } + } +} diff --git a/BM_src/WayofTime/alchemicalWizardry/common/block/BlockSpellModifier.java b/BM_src/WayofTime/alchemicalWizardry/common/block/BlockSpellModifier.java new file mode 100644 index 00000000..1b8fb41e --- /dev/null +++ b/BM_src/WayofTime/alchemicalWizardry/common/block/BlockSpellModifier.java @@ -0,0 +1,44 @@ +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.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(int id) + { + super(id); + setUnlocalizedName("blockSpellModifier"); + } + + @Override + public TileEntity createNewTileEntity(World world) + { + return new TESpellModifierBlock(); + } + + @SideOnly(Side.CLIENT) + public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) + { + if (this.blockID == ModBlocks.blockSpellModifier.blockID) + { + for(int i=0; i<4; i++) + { + par3List.add(new ItemStack(par1, 1, i)); + } + } else + { + super.getSubBlocks(par1, par2CreativeTabs, par3List); + } + } +} diff --git a/BM_src/WayofTime/alchemicalWizardry/common/block/BlockSpellParadigm.java b/BM_src/WayofTime/alchemicalWizardry/common/block/BlockSpellParadigm.java new file mode 100644 index 00000000..ad69671d --- /dev/null +++ b/BM_src/WayofTime/alchemicalWizardry/common/block/BlockSpellParadigm.java @@ -0,0 +1,89 @@ +package WayofTime.alchemicalWizardry.common.block; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +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.Icon; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.items.BlankSpell; +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 +{ + Icon[] projectileIcons = new Icon[7]; + + public BlockSpellParadigm(int id) + { + super(id); + setUnlocalizedName("blockSpellParadigm"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister iconRegister) + { + this.projectileIcons = this.registerIconsWithString(iconRegister, "projectileParadigmBlock"); + } + +// @Override +// public Icon[] getIconsForMeta(int metadata) +// { +// return this.projectileIcons; +// } + + @Override + public TileEntity createNewTileEntity(World world) + { + 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(int par1, CreativeTabs par2CreativeTabs, List par3List) + { + if (this.blockID == ModBlocks.blockSpellParadigm.blockID) + { + 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); + } +} diff --git a/BM_src/WayofTime/alchemicalWizardry/common/items/ItemBloodRuneBlock.java b/BM_src/WayofTime/alchemicalWizardry/common/items/ItemBloodRuneBlock.java index bd4e36ba..5d890264 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/items/ItemBloodRuneBlock.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/items/ItemBloodRuneBlock.java @@ -7,7 +7,6 @@ public class ItemBloodRuneBlock extends ItemBlock { public ItemBloodRuneBlock(int par1) - { super(par1); setHasSubtypes(true); diff --git a/BM_src/WayofTime/alchemicalWizardry/common/items/ItemComplexSpellCrystal.java b/BM_src/WayofTime/alchemicalWizardry/common/items/ItemComplexSpellCrystal.java index 58ebedef..fe4ece59 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/items/ItemComplexSpellCrystal.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/items/ItemComplexSpellCrystal.java @@ -1,49 +1,52 @@ package WayofTime.alchemicalWizardry.common.items; -import java.util.List; - +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IconRegister; 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 WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.spell.complex.SpellModifierOffensive; -import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigm; -import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf; -import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffectFire; -import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancementPotency; -import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancementPower; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.common.DimensionManager; -public class ItemComplexSpellCrystal extends EnergyItems +import java.util.List; + +public class ItemComplexSpellCrystal extends EnergyItems { - - public ItemComplexSpellCrystal(int id) - { - super(id); - this.maxStackSize = 1; - //setMaxDamage(1000); - setEnergyUsed(50); - setCreativeTab(AlchemicalWizardry.tabBloodMagic); - } - - @Override - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + public ItemComplexSpellCrystal(int par1) { - par3List.add("I feel lighter already..."); - - if (!(par1ItemStack.stackTagCompound == null)) - { - par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); - } + super(par1); + this.setMaxStackSize(1); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); } - - @Override + + @Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AirSigil"); + 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 @@ -56,18 +59,50 @@ public class ItemComplexSpellCrystal extends EnergyItems return par1ItemStack; } - if(par2World.isRemote) + if (!par2World.isRemote) { - return par1ItemStack; - } - - SpellParadigm parad = new SpellParadigmSelf(); - parad.addBufferedEffect(new SpellEffectFire()); - parad.modifyBufferedEffect(new SpellModifierOffensive()); - parad.applyEnhancement(new SpellEnhancementPower()); - parad.applyEnhancement(new SpellEnhancementPotency()); - parad.castSpell(par2World, par3EntityPlayer, par1ItemStack); + //World world = MinecraftServer.getServer().worldServers[getDimensionID(par1ItemStack)]; + World world = DimensionManager.getWorld(getDimensionID(par1ItemStack)); + if (world != null) + { + NBTTagCompound itemTag = par1ItemStack.stackTagCompound; + TileEntity tileEntity = world.getBlockTileEntity(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/BM_src/WayofTime/alchemicalWizardry/common/items/ItemSpellEffectBlock.java b/BM_src/WayofTime/alchemicalWizardry/common/items/ItemSpellEffectBlock.java new file mode 100644 index 00000000..4f3b6f20 --- /dev/null +++ b/BM_src/WayofTime/alchemicalWizardry/common/items/ItemSpellEffectBlock.java @@ -0,0 +1,55 @@ +package WayofTime.alchemicalWizardry.common.items; + +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemSpellEffectBlock extends ItemBlock + +{ + public ItemSpellEffectBlock(int par1) + { + super(par1); + setHasSubtypes(true); + this.setUnlocalizedName("itemSpellEffectBlock"); + } + + public String getUnlocalizedName(ItemStack itemstack) + + { + String name = ""; + + switch (itemstack.getItemDamage()) + { + case 0: + { + name = "fire"; + 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/BM_src/WayofTime/alchemicalWizardry/common/items/ItemSpellEnhancementBlock.java b/BM_src/WayofTime/alchemicalWizardry/common/items/ItemSpellEnhancementBlock.java new file mode 100644 index 00000000..873b4163 --- /dev/null +++ b/BM_src/WayofTime/alchemicalWizardry/common/items/ItemSpellEnhancementBlock.java @@ -0,0 +1,95 @@ +package WayofTime.alchemicalWizardry.common.items; + +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemSpellEnhancementBlock extends ItemBlock + +{ + public ItemSpellEnhancementBlock(int par1) + { + super(par1); + setHasSubtypes(true); + this.setUnlocalizedName("itemSpellEnhancementBlock"); + } + + 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/BM_src/WayofTime/alchemicalWizardry/common/items/ItemSpellModifierBlock.java b/BM_src/WayofTime/alchemicalWizardry/common/items/ItemSpellModifierBlock.java new file mode 100644 index 00000000..71e5e46e --- /dev/null +++ b/BM_src/WayofTime/alchemicalWizardry/common/items/ItemSpellModifierBlock.java @@ -0,0 +1,51 @@ +package WayofTime.alchemicalWizardry.common.items; + +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemSpellModifierBlock extends ItemBlock + +{ + public ItemSpellModifierBlock(int par1) + { + super(par1); + setHasSubtypes(true); + this.setUnlocalizedName("itemSpellModifierBlock"); + } + + 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/BM_src/WayofTime/alchemicalWizardry/common/items/ItemSpellParadigmBlock.java b/BM_src/WayofTime/alchemicalWizardry/common/items/ItemSpellParadigmBlock.java new file mode 100644 index 00000000..934120d8 --- /dev/null +++ b/BM_src/WayofTime/alchemicalWizardry/common/items/ItemSpellParadigmBlock.java @@ -0,0 +1,50 @@ +package WayofTime.alchemicalWizardry.common.items; + +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemSpellParadigmBlock extends ItemBlock + +{ + public ItemSpellParadigmBlock(int par1) + { + super(par1); + setHasSubtypes(true); + this.setUnlocalizedName("itemSpellParadigmBlock"); + } + + 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; + } + + public int getMetadata(int par1) + { + return par1; + } +} diff --git a/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TEConduit.java b/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TEConduit.java index d8b4a426..59f375c0 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TEConduit.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TEConduit.java @@ -1,10 +1,11 @@ package WayofTime.alchemicalWizardry.common.tileEntity; import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigm; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.packet.Packet; -public class TEConduit extends TEOrientable +public class TEConduit extends TESpellBlock { @Override public void readFromNBT(NBTTagCompound par1NBTTagCompound) @@ -22,10 +23,7 @@ public class TEConduit extends TEOrientable @Override public void updateEntity() { - //this.capacity=(int) (10000*this.capacityMultiplier); -// if (!worldObj.isRemote && worldObj.getWorldTime() % 20 == 0) -// { -// } + } @Override @@ -33,4 +31,10 @@ public class TEConduit extends TEOrientable { return PacketHandler.getBlockOrientationPacket(this); } + + @Override + protected void applySpellChange(SpellParadigm parad) + { + return; + } } diff --git a/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellBlock.java b/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellBlock.java index d66ddcd9..b4bae067 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellBlock.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellBlock.java @@ -1,6 +1,50 @@ package WayofTime.alchemicalWizardry.common.tileEntity; -public class TESpellBlock extends TEOrientable -{ +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.ForgeDirection; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigm; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffectFire; +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.getBlockTileEntity(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/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEffectBlock.java b/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEffectBlock.java new file mode 100644 index 00000000..675cb6a2 --- /dev/null +++ b/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEffectBlock.java @@ -0,0 +1,19 @@ +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.SpellEffectFire; + +public class TESpellEffectBlock extends TESpellBlock +{ + @Override + protected void applySpellChange(SpellParadigm parad) + { + parad.addBufferedEffect(this.getSpellEffect()); + } + + public SpellEffect getSpellEffect() + { + return new SpellEffectFire(); + } +} diff --git a/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEnhancementBlock.java b/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEnhancementBlock.java new file mode 100644 index 00000000..3f7a981c --- /dev/null +++ b/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEnhancementBlock.java @@ -0,0 +1,56 @@ +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; + +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