Pushing changes in 1.7.2 to 1.6.4 build

This commit is contained in:
WayofTime 2014-03-15 17:43:59 -04:00
parent a4a02b4118
commit fa9112493c
170 changed files with 4803 additions and 272 deletions

View file

@ -16,6 +16,7 @@ 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.EnderTeleportEvent;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
@ -49,6 +50,15 @@ public class AlchemicalWizardryEventHooks
event.entityLiving.motionY = 0;
}
}
@SubscribeEvent
public void onEndermanTeleportEvent(EnderTeleportEvent event)
{
if(event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionPlanarBinding) && event.isCancelable())
{
event.setCanceled(true);
}
}
@SubscribeEvent
public void onEntityDamaged(LivingAttackEvent event)
@ -149,18 +159,15 @@ public class AlchemicalWizardryEventHooks
EntityLivingBase entity = event.entityLiving;
//if(!entity.isSneaking())
{
double percentIncrease = (i + 1) * 0.03d;
float percentIncrease = (i + 1) * 0.05f;
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((entityPlayer.onGround || entityPlayer.capabilities.isFlying) && entityPlayer.moveForward > 0F)
entityPlayer.moveFlying(0F, 1F, entityPlayer.capabilities.isFlying ? (percentIncrease/2.0f) : percentIncrease);
}
}
}
@ -312,7 +319,7 @@ public class AlchemicalWizardryEventHooks
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionHeavyHeart).getAmplifier();
double decrease = 0.025*(i+1);
if(entityLiving.motionY>-0.5)
if(entityLiving.motionY>-0.9)
{
entityLiving.motionY-=decrease;
}

View file

@ -42,7 +42,7 @@ public class AltarRecipeRegistry
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.demonicSlate), 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);

View file

@ -249,4 +249,6 @@ public class BlockOrientable extends BlockContainer
{
return metadata;
}
}

View file

@ -42,4 +42,22 @@ public class BlockSpellModifier extends BlockOrientable
super.getSubBlocks(par1, par2CreativeTabs, par3List);
}
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
public boolean renderAsNormalBlock()
{
return false;
}
@Override
public int getRenderType()
{
return -1;
}
}

View file

@ -91,23 +91,23 @@ public class BlockSpellParadigm extends BlockOrientable
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 boolean isOpaqueCube()
{
return false;
}
// @Override
// public int getRenderType()
// {
// return -1;
// }
@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.
/*

View file

@ -289,7 +289,7 @@ public class EnergyItems extends Item implements IBindable
}
}
public String getOwnerName(ItemStack item)
public static String getOwnerName(ItemStack item)
{
if (item.stackTagCompound == null)
{

View file

@ -0,0 +1,6 @@
package WayofTime.alchemicalWizardry.common.items;
public interface IHolding
{
}

View file

@ -0,0 +1,107 @@
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.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 ItemAlchemyBase extends Item
{
private static final String[] ITEM_NAMES = new String[]{};
@SideOnly(Side.CLIENT)
private IIcon[] icons;
public ItemAlchemyBase()
{
super();
this.maxStackSize = 64;
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
this.hasSubtypes = true;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
icons = new IIcon[ITEM_NAMES.length];
for (int i = 0; i < ITEM_NAMES.length; ++i)
{
icons[i] = iconRegister.registerIcon("AlchemicalWizardry:" + "baseAlchemyItem" + ITEM_NAMES[i]);
}
}
@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-");
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
return par1ItemStack;
}
@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, ITEM_NAMES.length - 1);
return ("" + "item.bloodMagicAlchemyItem." + ITEM_NAMES[meta]);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int meta)
{
int j = MathHelper.clamp_int(meta, 0, ITEM_NAMES.length - 1);
return icons[j];
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item id, CreativeTabs creativeTab, List list)
{
for (int meta = 0; meta < ITEM_NAMES.length; ++meta)
{
list.add(new ItemStack(id, 1, meta));
}
}
}

View file

@ -21,7 +21,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ItemComponents extends Item
{
private static final String[] ITEM_NAMES = new String[]{"QuartzRod"};
private static final String[] ITEM_NAMES = new String[]{"QuartzRod", "EmptyCore", "MagicalesCable", "WoodBrace", "StoneBrace", "ProjectileCore", "SelfCore","MeleeCore","ParadigmBackPlate","OutputCable","FlameCore","IcyCore","GustCore","EarthenCore","InputCable","CrackedRunicPlate","RunicPlate","ScribedRunicPlate","DefaultCore","OffensiveCore","DefensiveCore","EnvironmentalCore"};
@SideOnly(Side.CLIENT)
private IIcon[] icons;
@ -29,7 +29,7 @@ public class ItemComponents extends Item
public ItemComponents()
{
super();
this.maxStackSize = 1;
this.maxStackSize = 64;
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
this.hasSubtypes = true;
}

View file

@ -42,7 +42,6 @@ public class AlchemyFlask extends Item
this.setMaxDamage(8);
this.setMaxStackSize(1);
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
setNoRepair();
// TODO Auto-generated constructor stub
}

View file

@ -0,0 +1,171 @@
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.EntityLiving;
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.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.items.IHolding;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemSigilOfEnderSeverance extends EnergyItems implements IHolding
{
@SideOnly(Side.CLIENT)
private static IIcon activeIcon;
@SideOnly(Side.CLIENT)
private static IIcon passiveIcon;
public ItemSigilOfEnderSeverance()
{
super();
this.maxStackSize = 1;
setEnergyUsed(200);
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
par3List.add("Put those endermen in a Dire situation!");
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);
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"))
{
List<Entity> list = SpellHelper.getEntitiesInRange(par2World, par3Entity.posX, par3Entity.posY, par3Entity.posZ, 4.5, 4.5);
for(Entity entity : list)
{
if(!entity.equals(par3Entity)&&entity instanceof EntityLiving)
{
((EntityLiving)entity).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionPlanarBinding.id,2,0));
}
}
}
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)
{
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed());
}
}
return;
}
}

View file

@ -27,7 +27,6 @@ public class SigilOfElementalAffinity extends EnergyItems
{
super();
this.maxStackSize = 1;
setMaxDamage(100);
setEnergyUsed(200);
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
}

View file

@ -16,6 +16,7 @@ import net.minecraftforge.common.util.Constants;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.items.IHolding;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -304,6 +305,13 @@ public class SigilOfHolding extends EnergyItems
return false;
}
if(addedItemStack.getItem() instanceof IHolding)
{
inv[candidateSlot] = addedItemStack;
saveInternalInventory(sigilItemStack, inv);
return true;
}
for (ItemStack i : allowedSigils)
{
if (i != null && i.getItem() == item)

View file

@ -0,0 +1,18 @@
package WayofTime.alchemicalWizardry.common.potion;
import net.minecraft.potion.Potion;
public class PotionPlanarBinding extends Potion
{
public PotionPlanarBinding(int par1, boolean par2, int par3)
{
super(par1, par2, par3);
}
@Override
public Potion setIconIndex(int par1, int par2)
{
super.setIconIndex(par1, par2);
return this;
}
}

View file

@ -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.ModelSpellModifierBlock;
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellModifierBlock;
import cpw.mods.fml.client.FMLClientHandler;
public class RenderSpellModifierBlock extends TileEntitySpecialRenderer
{
private ModelSpellModifierBlock modelSpellModifierBlock = new ModelSpellModifierBlock();
@Override
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f)
{
if (tileEntity instanceof TESpellModifierBlock)
{
TESpellModifierBlock tileSpellBlock = (TESpellModifierBlock) 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/BlockSpellModifier.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.modelSpellModifierBlock.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);
}
}
}

View file

@ -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.ModelSpellParadigmBlock;
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
import cpw.mods.fml.client.FMLClientHandler;
public class RenderSpellParadigmBlock extends TileEntitySpecialRenderer
{
private ModelSpellParadigmBlock modelSpellParadigmBlock = new ModelSpellParadigmBlock();
@Override
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f)
{
if (tileEntity instanceof TESpellParadigmBlock)
{
TESpellParadigmBlock tileSpellBlock = (TESpellParadigmBlock) 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/BlockSpellParadigm.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.modelSpellParadigmBlock.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);
}
}
}

View file

@ -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.ModelSpellModifierBlock;
import cpw.mods.fml.client.FMLClientHandler;
public class TESpellModifierBlockItemRenderer implements IItemRenderer
{
private ModelSpellModifierBlock modelSpellBlock = new ModelSpellModifierBlock();
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/SpellModifierDefault.png";
case 1: return "alchemicalwizardry:textures/models/SpellModifierOffensive.png";
case 2: return "alchemicalwizardry:textures/models/SpellModifierDefensive.png";
case 3: return "alchemicalwizardry:textures/models/SpellModifierEnvironmental.png";
}
return "alchemicalwizardry:textures/models/SpellModifierDefault.png";
}
}

View file

@ -0,0 +1,107 @@
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.ModelSpellParadigmBlock;
import cpw.mods.fml.client.FMLClientHandler;
public class TESpellParadigmBlockItemRenderer implements IItemRenderer
{
private ModelSpellParadigmBlock modelSpellBlock = new ModelSpellParadigmBlock();
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/SpellParadigmProjectile.png";
case 1: return "alchemicalwizardry:textures/models/SpellParadigmSelf.png";
case 2: return "alchemicalwizardry:textures/models/SpellParadigmMelee.png";
}
return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png";
}
}

View file

@ -0,0 +1,303 @@
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 ModelSpellModifierBlock extends ModelBase
{
//fields
ModelRenderer core;
ModelRenderer inputMain;
ModelRenderer Shape2;
ModelRenderer Shape3;
ModelRenderer Shape4;
ModelRenderer Shape5;
ModelRenderer Shape6;
ModelRenderer Shape7;
ModelRenderer Shape8;
ModelRenderer Shape9;
ModelRenderer outputMain;
ModelRenderer Shape11;
ModelRenderer Shape12;
ModelRenderer Shape13;
ModelRenderer Shape14;
ModelRenderer output1;
ModelRenderer output2;
ModelRenderer output3;
ModelRenderer output4;
public ModelSpellModifierBlock()
{
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);
inputMain = new ModelRenderer(this, 25, 18);
inputMain.addBox(-2F, -2F, -8F, 4, 4, 1);
inputMain.setRotationPoint(0F, 16F, 0F);
inputMain.setTextureSize(64, 64);
inputMain.mirror = true;
setRotation(inputMain, 0F, 0F, 0F);
Shape2 = new ModelRenderer(this, 0, 13);
Shape2.addBox(-5F, -5F, -8F, 10, 2, 2);
Shape2.setRotationPoint(0F, 16F, 0F);
Shape2.setTextureSize(64, 64);
Shape2.mirror = true;
setRotation(Shape2, 0F, 0F, 0F);
Shape3 = new ModelRenderer(this, 0, 27);
Shape3.addBox(-5F, 3F, -8F, 10, 2, 2);
Shape3.setRotationPoint(0F, 16F, 0F);
Shape3.setTextureSize(64, 64);
Shape3.mirror = true;
setRotation(Shape3, 0F, 0F, 0F);
Shape4 = new ModelRenderer(this, 16, 18);
Shape4.addBox(3F, -3F, -8F, 2, 6, 2);
Shape4.setRotationPoint(0F, 16F, 0F);
Shape4.setTextureSize(64, 64);
Shape4.mirror = true;
setRotation(Shape4, 0F, 0F, 0F);
Shape5 = new ModelRenderer(this, 0, 18);
Shape5.addBox(-5F, -3F, -8F, 2, 6, 2);
Shape5.setRotationPoint(0F, 16F, 0F);
Shape5.setTextureSize(64, 64);
Shape5.mirror = true;
setRotation(Shape5, 0F, 0F, 0F);
Shape6 = new ModelRenderer(this, 0, 32);
Shape6.addBox(-1F, -6F, -7F, 2, 1, 5);
Shape6.setRotationPoint(0F, 16F, 0F);
Shape6.setTextureSize(64, 64);
Shape6.mirror = true;
setRotation(Shape6, 0F, 0F, 0F);
Shape7 = new ModelRenderer(this, 15, 32);
Shape7.addBox(-2F, -6F, -2F, 4, 1, 4);
Shape7.setRotationPoint(0F, 16F, 0F);
Shape7.setTextureSize(64, 64);
Shape7.mirror = true;
setRotation(Shape7, 0F, 0F, 0F);
Shape8 = new ModelRenderer(this, 15, 39);
Shape8.addBox(-2F, 5F, -2F, 4, 1, 4);
Shape8.setRotationPoint(0F, 16F, 0F);
Shape8.setTextureSize(64, 64);
Shape8.mirror = true;
setRotation(Shape8, 0F, 0F, 0F);
Shape9 = new ModelRenderer(this, 0, 39);
Shape9.addBox(-1F, 5F, -7F, 2, 1, 5);
Shape9.setRotationPoint(0F, 16F, 0F);
Shape9.setTextureSize(64, 64);
Shape9.mirror = true;
setRotation(Shape9, 0F, 0F, 0F);
outputMain = new ModelRenderer(this, 51, 23);
outputMain.addBox(7F, -2F, -2F, 1, 4, 4);
outputMain.setRotationPoint(0F, 16F, 0F);
outputMain.setTextureSize(64, 64);
outputMain.mirror = true;
setRotation(outputMain, 0F, 0F, 0F);
Shape11 = new ModelRenderer(this, 13, 46);
Shape11.addBox(5F, -2F, -2F, 1, 4, 4);
Shape11.setRotationPoint(0F, 16F, 0F);
Shape11.setTextureSize(64, 64);
Shape11.mirror = true;
setRotation(Shape11, 0F, 0F, 0F);
Shape12 = new ModelRenderer(this, 0, 46);
Shape12.addBox(5F, -1F, -7F, 1, 2, 5);
Shape12.setRotationPoint(0F, 16F, 0F);
Shape12.setTextureSize(64, 64);
Shape12.mirror = true;
setRotation(Shape12, 0F, 0F, 0F);
Shape13 = new ModelRenderer(this, 0, 56);
Shape13.addBox(-6F, -1F, -7F, 1, 2, 5);
Shape13.setRotationPoint(0F, 16F, 0F);
Shape13.setTextureSize(64, 64);
Shape13.mirror = true;
setRotation(Shape13, 0F, 0F, 0F);
Shape14 = new ModelRenderer(this, 13, 56);
Shape14.addBox(-6F, -2F, -2F, 1, 4, 4);
Shape14.setRotationPoint(0F, 16F, 0F);
Shape14.setTextureSize(64, 64);
Shape14.mirror = true;
setRotation(Shape14, 0F, 0F, 0F);
output1 = new ModelRenderer(this, 51, 18);
output1.addBox(5F, -5F, -5F, 3, 2, 2);
output1.setRotationPoint(0F, 16F, 0F);
output1.setTextureSize(64, 64);
output1.mirror = true;
setRotation(output1, 0F, 0F, 0F);
output2 = new ModelRenderer(this, 51, 18);
output2.addBox(5F, -5F, 3F, 3, 2, 2);
output2.setRotationPoint(0F, 16F, 0F);
output2.setTextureSize(64, 64);
output2.mirror = true;
setRotation(output2, 0F, 0F, 0F);
output3 = new ModelRenderer(this, 51, 18);
output3.addBox(5F, 3F, -5F, 3, 2, 2);
output3.setRotationPoint(0F, 16F, 0F);
output3.setTextureSize(64, 64);
output3.mirror = true;
setRotation(output3, 0F, 0F, 0F);
output4 = new ModelRenderer(this, 51, 18);
output4.addBox(5F, 3F, 3F, 3, 2, 2);
output4.setRotationPoint(0F, 16F, 0F);
output4.setTextureSize(64, 64);
output4.mirror = true;
setRotation(output4, 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(inputMain, xInputRot, yInputRot, zInputRot);
this.setRotation(Shape2, xInputRot, yInputRot, zInputRot);
this.setRotation(Shape3, xInputRot, yInputRot, zInputRot);
this.setRotation(Shape4, xInputRot, yInputRot, zInputRot);
this.setRotation(Shape5, xInputRot, yInputRot, zInputRot);
this.setRotation(Shape6, xInputRot, yInputRot, zInputRot);
this.setRotation(Shape7, xInputRot, yInputRot, zInputRot);
this.setRotation(Shape8, xInputRot, yInputRot, zInputRot);
this.setRotation(Shape9, xInputRot, yInputRot, zInputRot);
this.setRotation(Shape12, xInputRot, yInputRot, zInputRot);
this.setRotation(Shape11, xInputRot, yInputRot, zInputRot);
this.setRotation(Shape13, xInputRot, yInputRot, zInputRot);
this.setRotation(Shape14, xInputRot, yInputRot, zInputRot);
this.setRotation(outputMain, xOutputRot, yOutputRot, zOutputRot);
this.setRotation(output1, xOutputRot, yOutputRot, zOutputRot);
this.setRotation(output2, xOutputRot, yOutputRot, zOutputRot);
this.setRotation(output3, xOutputRot, yOutputRot, zOutputRot);
this.setRotation(output4, xOutputRot, yOutputRot, zOutputRot);
core.render(f5);
inputMain.render(f5);
Shape2.render(f5);
Shape3.render(f5);
Shape4.render(f5);
Shape5.render(f5);
Shape6.render(f5);
Shape7.render(f5);
Shape8.render(f5);
Shape9.render(f5);
outputMain.render(f5);
Shape11.render(f5);
Shape12.render(f5);
Shape13.render(f5);
Shape14.render(f5);
output1.render(f5);
output2.render(f5);
output3.render(f5);
output4.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);
}
}

View file

@ -0,0 +1,234 @@
package WayofTime.alchemicalWizardry.common.renderer.model;
//Date: 07/03/2014 9:30:25 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 ModelSpellParadigmBlock extends ModelBase
{
//fields
ModelRenderer core;
ModelRenderer outputMain;
ModelRenderer output1;
ModelRenderer output2;
ModelRenderer output3;
ModelRenderer output4;
ModelRenderer Shape1;
ModelRenderer Shape2;
ModelRenderer Shape3;
ModelRenderer Shape4;
ModelRenderer Shape5;
public ModelSpellParadigmBlock()
{
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);
outputMain = new ModelRenderer(this, 0, 13);
outputMain.addBox(6F, -2F, -2F, 2, 4, 4);
outputMain.setRotationPoint(0F, 16F, 0F);
outputMain.setTextureSize(64, 64);
outputMain.mirror = true;
setRotation(outputMain, 0F, 0F, 0F);
output1 = new ModelRenderer(this, 0, 22);
output1.addBox(5F, -5F, -5F, 3, 2, 2);
output1.setRotationPoint(0F, 16F, 0F);
output1.setTextureSize(64, 64);
output1.mirror = true;
setRotation(output1, 0F, 0F, 0F);
output2 = new ModelRenderer(this, 0, 22);
output2.addBox(5F, -5F, 3F, 3, 2, 2);
output2.setRotationPoint(0F, 16F, 0F);
output2.setTextureSize(64, 64);
output2.mirror = true;
setRotation(output2, 0F, 0F, 0F);
output3 = new ModelRenderer(this, 0, 22);
output3.addBox(5F, 3F, -5F, 3, 2, 2);
output3.setRotationPoint(0F, 16F, 0F);
output3.setTextureSize(64, 64);
output3.mirror = true;
setRotation(output3, 0F, 0F, 0F);
output4 = new ModelRenderer(this, 0, 22);
output4.addBox(5F, 3F, 3F, 3, 2, 2);
output4.setRotationPoint(0F, 16F, 0F);
output4.setTextureSize(64, 64);
output4.mirror = true;
setRotation(output4, 0F, 0F, 0F);
Shape1 = new ModelRenderer(this, 0, 28);
Shape1.addBox(-5F, -5F, -1F, 10, 1, 2);
Shape1.setRotationPoint(0F, 16F, 0F);
Shape1.setTextureSize(64, 64);
Shape1.mirror = true;
setRotation(Shape1, 0F, 0F, 0F);
Shape2 = new ModelRenderer(this, 25, 28);
Shape2.addBox(-5F, -4F, -4F, 1, 8, 8);
Shape2.setRotationPoint(0F, 16F, 0F);
Shape2.setTextureSize(64, 64);
Shape2.mirror = true;
setRotation(Shape2, 0F, 0F, 0F);
Shape3 = new ModelRenderer(this, 0, 33);
Shape3.addBox(-5F, 4F, -1F, 10, 1, 2);
Shape3.setRotationPoint(0F, 16F, 0F);
Shape3.setTextureSize(64, 64);
Shape3.mirror = true;
setRotation(Shape3, 0F, 0F, 0F);
Shape4 = new ModelRenderer(this, 0, 38);
Shape4.addBox(-5F, -1F, -5F, 10, 2, 1);
Shape4.setRotationPoint(0F, 16F, 0F);
Shape4.setTextureSize(64, 64);
Shape4.mirror = true;
setRotation(Shape4, 0F, 0F, 0F);
Shape5 = new ModelRenderer(this, 0, 43);
Shape5.addBox(-5F, -1F, 4F, 10, 2, 1);
Shape5.setRotationPoint(0F, 16F, 0F);
Shape5.setTextureSize(64, 64);
Shape5.mirror = true;
setRotation(Shape5, 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(outputMain, xOutputRot, yOutputRot, zOutputRot);
this.setRotation(output1, xOutputRot, yOutputRot, zOutputRot);
this.setRotation(output2, xOutputRot, yOutputRot, zOutputRot);
this.setRotation(output3, xOutputRot, yOutputRot, zOutputRot);
this.setRotation(output4, xOutputRot, yOutputRot, zOutputRot);
this.setRotation(Shape1, xOutputRot, yOutputRot, zOutputRot);
this.setRotation(Shape2, xOutputRot, yOutputRot, zOutputRot);
this.setRotation(Shape3, xOutputRot, yOutputRot, zOutputRot);
this.setRotation(Shape4, xOutputRot, yOutputRot, zOutputRot);
this.setRotation(Shape5, xOutputRot, yOutputRot, zOutputRot);
core.render(f5);
outputMain.render(f5);
output1.render(f5);
output2.render(f5);
output3.render(f5);
output4.render(f5);
Shape1.render(f5);
Shape2.render(f5);
Shape3.render(f5);
Shape4.render(f5);
Shape5.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);
}
}

View file

@ -0,0 +1,103 @@
package WayofTime.alchemicalWizardry.common.rituals;
import java.util.List;
import net.minecraft.entity.item.EntityItem;
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 WayofTime.alchemicalWizardry.common.IBindable;
import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
public class RitualEffectSummonPlayer extends RitualEffect //Summons a player via the bound item
{
@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<EntityItem> 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 && entityItem.getEntityItem().getItem() instanceof IBindable)
{
String str = EnergyItems.getOwnerName(entityItem.getEntityItem());
EntityPlayer entityPlayer = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(str);
if(entityPlayer!=null)
{
entityPlayer.posX = x;
entityPlayer.posY = y+1;
entityPlayer.posZ = z;
if(entityPlayer instanceof EntityPlayerMP)
{
((EntityPlayerMP)entityPlayer).mcServer.getConfigurationManager().transferPlayerToDimension(((EntityPlayerMP)entityPlayer), 0);
}
entityItem.setDead();
data.currentEssence = currentEssence - this.getCostPerRefresh();
data.markDirty();
}
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);
}
}
@Override
public int getCostPerRefresh()
{
return 0;
}
}

View file

@ -4,10 +4,17 @@ 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.MeleeDefaultEarth;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.MeleeDefensiveEarth;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.MeleeEnvironmentalEarth;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.MeleeOffensiveEarth;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.ProjectileDefaultEarth;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.ProjectileDefensiveEarth;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.ProjectileEnvironmentalEarth;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.ProjectileOffensiveEarth;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.SelfDefaultEarth;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.SelfDefensiveEarth;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.SelfEnvironmentalEarth;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.SelfOffensiveEarth;
public class SpellEffectEarth extends SpellEffect
{
@ -38,29 +45,25 @@ public class SpellEffectEarth extends SpellEffect
@Override
public void defaultModificationSelf(SpellParadigmSelf parad)
{
// TODO Auto-generated method stub
parad.addSelfSpellEffect(new SelfDefaultEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
}
@Override
public void offensiveModificationSelf(SpellParadigmSelf parad)
{
// TODO Auto-generated method stub
parad.addSelfSpellEffect(new SelfOffensiveEarth(this.powerEnhancement,this.potencyEnhancement, this.costEnhancement));
}
@Override
public void defensiveModificationSelf(SpellParadigmSelf parad)
{
// TODO Auto-generated method stub
parad.addSelfSpellEffect(new SelfDefensiveEarth(this.powerEnhancement,this.potencyEnhancement, this.costEnhancement));
}
@Override
public void environmentalModificationSelf(SpellParadigmSelf parad)
{
// TODO Auto-generated method stub
parad.addSelfSpellEffect(new SelfEnvironmentalEarth(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
}
@Override
@ -72,22 +75,19 @@ public class SpellEffectEarth extends SpellEffect
@Override
public void offensiveModificationMelee(SpellParadigmMelee parad)
{
// TODO Auto-generated method stub
parad.addWorldEffect(new MeleeOffensiveEarth(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
}
@Override
public void defensiveModificationMelee(SpellParadigmMelee parad)
{
// TODO Auto-generated method stub
parad.addWorldEffect(new MeleeDefensiveEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
}
@Override
public void environmentalModificationMelee(SpellParadigmMelee parad)
{
// TODO Auto-generated method stub
parad.addWorldEffect(new MeleeEnvironmentalEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
}
@Override
@ -100,7 +100,7 @@ public class SpellEffectEarth extends SpellEffect
protected int getCostForOffenseProjectile()
{
return (int)(3*(1.5*this.potencyEnhancement+1)*(Math.pow(1*this.powerEnhancement+1,2))*Math.pow(0.8, costEnhancement));
return (int)(10*(1.5*this.potencyEnhancement+1)*(Math.pow(1*this.powerEnhancement+1,2))*Math.pow(0.8, costEnhancement));
}
@Override
@ -118,22 +118,19 @@ public class SpellEffectEarth extends SpellEffect
@Override
protected int getCostForDefaultSelf()
{
// TODO Auto-generated method stub
return 0;
return (int)(20*Math.pow(1.5*powerEnhancement+1,2)*(2*this.potencyEnhancement+1)*Math.pow(0.8, costEnhancement));
}
@Override
protected int getCostForOffenseSelf()
{
// TODO Auto-generated method stub
return 0;
return (int)(10*Math.pow(2*this.powerEnhancement+1,2)*(this.potencyEnhancement+1));
}
@Override
protected int getCostForDefenseSelf()
{
// TODO Auto-generated method stub
return 0;
return (int)(750*(1.1*this.powerEnhancement+1)*(0.5*this.potencyEnhancement+1)*Math.pow(0.8, costEnhancement));
}
@Override
@ -146,28 +143,24 @@ public class SpellEffectEarth extends SpellEffect
@Override
protected int getCostForDefaultMelee()
{
// TODO Auto-generated method stub
return 0;
return (int)(50*Math.pow(1.5*this.potencyEnhancement + 1,3)*(0.5*this.powerEnhancement + 1)*Math.pow(0.8, costEnhancement));
}
@Override
protected int getCostForOffenseMelee()
{
// TODO Auto-generated method stub
return 0;
return (int)(20*Math.pow(1.5*this.powerEnhancement+1,3)*(0.25*this.powerEnhancement+1));
}
@Override
protected int getCostForDefenseMelee()
{
// TODO Auto-generated method stub
return 0;
return (int)(5*(1.2*this.powerEnhancement+1)*(1.0f/3.0f*Math.pow(this.potencyEnhancement,2)+2+1.0f/2.0f*this.potencyEnhancement)*Math.pow(0.8, costEnhancement));
}
@Override
protected int getCostForEnvironmentMelee()
{
// TODO Auto-generated method stub
return 0;
return (int)(500*Math.pow(2*this.potencyEnhancement+1, 3)*(0.25*this.powerEnhancement+1)*Math.pow(0.8, costEnhancement));
}
}

View file

@ -1,5 +1,6 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
@ -16,6 +17,8 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.oredict.OreDictionary;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
public class SpellHelper
@ -201,14 +204,17 @@ public class SpellHelper
if(block==Blocks.stone)
{
world.setBlock(posX, posY, posZ, Blocks.cobblestone);
return;
}
else if(block==Blocks.cobblestone)
{
world.setBlock(posX, posY, posZ, Blocks.gravel);
return;
}
else if(block==Blocks.gravel)
{
world.setBlock(posX, posY, posZ, Blocks.sand);
return;
}
}
@ -226,4 +232,40 @@ public class SpellHelper
world.setBlockToAir(posX, posY, posZ);
}
}
public static ItemStack getDustForOre(ItemStack item)
{
String oreName = OreDictionary.getOreName(OreDictionary.getOreID(item));
if(oreName.contains("ore"))
{
String lowercaseOre = oreName;
lowercaseOre.toLowerCase();
boolean isAllowed = false;
for(String str : AlchemicalWizardry.allowedCrushedOresArray)
{
if(lowercaseOre.contains(str))
{
isAllowed = true;
}
}
if(!isAllowed)
{
return null;
}
String dustName = oreName.replace("ore", "dust");
ArrayList<ItemStack> items = OreDictionary.getOres(dustName);
if(items!=null && items.size()>=1)
{
return(items.get(0).copy());
}
}
return null;
}
}

View file

@ -11,18 +11,17 @@ public abstract class MeleeSpellCenteredWorldEffect extends MeleeSpellWorldEffec
public MeleeSpellCenteredWorldEffect(int power, int potency, int cost)
{
super(power, potency, cost);
range = 0;
}
@Override
public void onWorldEffect(World world, EntityPlayer entityPlayer)
{
Vec3 lookVec = entityPlayer.getLook(range);
int x = (int)(entityPlayer.posX + lookVec.xCoord);
int y = (int)(entityPlayer.posY + entityPlayer.getEyeHeight() + lookVec.yCoord);
int z = (int)(entityPlayer.posZ + lookVec.zCoord);
Vec3 lookVec = entityPlayer.getLook(range).normalize();
int x = (int)(entityPlayer.posX + lookVec.xCoord*range);
int y = (int)(entityPlayer.posY + entityPlayer.getEyeHeight() + lookVec.yCoord*range);
int z = (int)(entityPlayer.posZ + lookVec.zCoord*range);
this.onCenteredWorldEffect(world, x, y, z);
this.onCenteredWorldEffect(entityPlayer, world, x, y, z);
}
public void setRange(float range)
@ -30,5 +29,5 @@ public abstract class MeleeSpellCenteredWorldEffect extends MeleeSpellWorldEffec
this.range = range;
}
public abstract void onCenteredWorldEffect(World world, int posX, int posY, int posZ);
public abstract void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ);
}

View file

@ -2,6 +2,7 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.e
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityFallingBlock;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellCenteredWorldEffect;
@ -10,17 +11,19 @@ public class MeleeDefaultEarth extends MeleeSpellCenteredWorldEffect
public MeleeDefaultEarth(int power, int potency, int cost)
{
super(power, potency, cost);
this.setRange(2);
this.setRange(3*power + 2);
}
@Override
public void onCenteredWorldEffect(World world, int posX, int posY, int posZ)
public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ)
{
for(int i=-3; i<=3; i++)
int radius = this.potencyUpgrades;
for(int i=-radius; i<=radius; i++)
{
for(int j=-3; j<=3; j++)
for(int j=-radius; j<=radius; j++)
{
for(int k=-3; k<=3; k++)
for(int k=-radius; k<=radius; k++)
{
if(!world.isAirBlock(posX + i, posY + j, posZ + k) && world.getTileEntity(posX + i, posY + j, posZ + k)==null)
{

View file

@ -0,0 +1,39 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityFallingBlock;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import WayofTime.alchemicalWizardry.common.block.BlockTeleposer;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellCenteredWorldEffect;
public class MeleeDefensiveEarth extends MeleeSpellCenteredWorldEffect
{
public MeleeDefensiveEarth(int power, int potency, int cost)
{
super(power, potency, cost);
this.setRange(3*power+2);
}
@Override
public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ)
{
ForgeDirection dir = SpellHelper.getDirectionForLookVector(player.getLook(1));
int vertRadius = (int)(2 + 1.0f/2.0f*Math.pow(this.potencyUpgrades,2)+1.0f/2.0f*this.potencyUpgrades);
int horizRadius = this.potencyUpgrades+1;
int xOff = dir.offsetX;
int zOff = dir.offsetZ;
for(int i=-horizRadius; i<=horizRadius; i++)
{
for(int j=0; j<vertRadius; j++)
{
BlockTeleposer.swapBlocks(world, world, posX + i*zOff, posY + j, posZ + i*xOff, posX + i*zOff, posY + j - vertRadius, posZ + i*xOff);
}
}
}
}

View file

@ -0,0 +1,47 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellCenteredWorldEffect;
public class MeleeEnvironmentalEarth extends MeleeSpellCenteredWorldEffect
{
public MeleeEnvironmentalEarth(int power, int potency, int cost)
{
super(power, potency, cost);
this.setRange(3*power + 2);
}
@Override
public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ)
{
int radius = this.potencyUpgrades;
for(int i=-radius; i<=radius; i++)
{
for(int j=-radius; j<=radius; j++)
{
for(int k=-radius; k<=radius; k++)
{
if(!world.isAirBlock(posX + i, posY + j, posZ + k) && world.getTileEntity(posX + i, posY + j, posZ + k)==null)
{
ItemStack stack = new ItemStack(world.getBlock(posX+i, posY+j, posZ+k),1,world.getBlockMetadata(posX+i, posY+j, posZ+k));
ItemStack dustStack = SpellHelper.getDustForOre(stack);
if(dustStack!=null)
{
dustStack.stackSize *= 3;
world.spawnEntityInWorld(new EntityItem(world,posX,posY,posZ,dustStack));
world.setBlockToAir(posX+i, posY+j, posZ+k);
}
}
}
}
}
}
}

View file

@ -0,0 +1,34 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellCenteredWorldEffect;
public class MeleeOffensiveEarth extends MeleeSpellCenteredWorldEffect
{
public MeleeOffensiveEarth(int power, int potency, int cost)
{
super(power, potency, cost);
this.setRange(3*power + 2);
}
@Override
public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ)
{
int radius = this.potencyUpgrades;
for(int i=-radius; i<=radius; i++)
{
for(int j=-radius; j<=radius; j++)
{
for(int k=-radius; k<=radius; k++)
{
SpellHelper.smashBlock(world, posX+i, posY+j, posZ+k);
}
}
}
}
}

View file

@ -0,0 +1,51 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.block.BlockTeleposer;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
public class SelfDefaultEarth extends SelfSpellEffect
{
public SelfDefaultEarth(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onSelfUse(World world, EntityPlayer player)
{
int horizRadius = this.powerUpgrades;
int vertRange = 5 + 10*this.potencyUpgrades;
Vec3 blockVec = SpellHelper.getEntityBlockVector(player);
int posX = (int)(blockVec.xCoord);
int posY = (int)(blockVec.yCoord) - 1;
int posZ = (int)(blockVec.zCoord);
for(int i=-horizRadius; i<=horizRadius; i++)
{
for(int k=-horizRadius; k<=horizRadius; k++)
{
if(!world.isAirBlock(posX+i, posY, posZ+k))
{
continue;
}
for(int j=-1; j>=-vertRange; j--)
{
if(!world.isAirBlock(posX+i, posY+j, posZ+k)&&!SpellHelper.isBlockFluid(world.getBlock(posX+i, posY+j, posZ+k)))
{
BlockTeleposer.swapBlocks(world, world, posX+i, posY, posZ+k, posX+i, posY+j, posZ+k);
break;
}
}
}
}
}
}

View file

@ -0,0 +1,27 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
public class SelfDefensiveEarth extends SelfSpellEffect
{
public SelfDefensiveEarth(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onSelfUse(World world, EntityPlayer player)
{
int pot = 2*this.potencyUpgrades + 1;
int duration = 20*60*(this.powerUpgrades+1);
player.addPotionEffect(new PotionEffect(Potion.field_76434_w.id,duration, pot));
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id, duration, pot));
}
}

View file

@ -0,0 +1,45 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.block.BlockTeleposer;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
public class SelfEnvironmentalEarth extends SelfSpellEffect
{
public SelfEnvironmentalEarth(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onSelfUse(World world, EntityPlayer player)
{
int horizRadius = this.powerUpgrades + 1;
int vertRadius = this.potencyUpgrades + 2;
Vec3 blockVec = SpellHelper.getEntityBlockVector(player);
int posX = (int)(blockVec.xCoord);
int posY = (int)(blockVec.yCoord);
int posZ = (int)(blockVec.zCoord);
for(int i=-horizRadius; i<=horizRadius; i++)
{
for(int j=0; j<vertRadius; j++)
{
for(int k=-horizRadius; k<=horizRadius; k++)
{
// if(k==0&&i==0)
// {
// continue;
// }
BlockTeleposer.swapBlocks(world, world, posX + i, posY + j, posZ+k, posX+i, posY+j-vertRadius, posZ+k);
}
}
}
}
}

View file

@ -0,0 +1,43 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
public class SelfOffensiveEarth extends SelfSpellEffect
{
public SelfOffensiveEarth(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onSelfUse(World world, EntityPlayer player)
{
int horizRadius = this.powerUpgrades;
int vertRadius = this.potencyUpgrades + 1;
Vec3 blockVec = SpellHelper.getEntityBlockVector(player);
int posX = (int)(blockVec.xCoord);
int posY = (int)(blockVec.yCoord);
int posZ = (int)(blockVec.zCoord);
for(int i=-horizRadius; i<=horizRadius; i++)
{
for(int j=-vertRadius; j<0; j++)
{
for(int k=-horizRadius; k<=horizRadius; k++)
{
if(world.rand.nextFloat()<0.7f)
{
SpellHelper.smashBlock(world, posX+i, posY+j, posZ+k);
}
}
}
}
}
}

View file

@ -16,6 +16,6 @@ public class SelfOffensiveFire extends SelfSpellEffect
@Override
public void onSelfUse(World world, EntityPlayer player)
{
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFlameCloak.id,(this.powerUpgrades+1)*this.powerUpgrades,this.potencyUpgrades));
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFlameCloak.id,200*(this.powerUpgrades+1)*(this.powerUpgrades+1),this.potencyUpgrades));
}
}

View file

@ -13,6 +13,7 @@ public class TEMasterStone extends TileEntity
private int currentRitual;
private boolean isActive;
private String owner;
private String varString1;
private int cooldown;
private int var1;
private int direction;
@ -37,6 +38,7 @@ public class TEMasterStone extends TileEntity
cooldown = par1NBTTagCompound.getInteger("cooldown");
var1 = par1NBTTagCompound.getInteger("var1");
direction = par1NBTTagCompound.getInteger("direction");
varString1 = par1NBTTagCompound.getString("varString1");
}
@Override
@ -49,6 +51,7 @@ public class TEMasterStone extends TileEntity
par1NBTTagCompound.setInteger("cooldown", cooldown);
par1NBTTagCompound.setInteger("var1", var1);
par1NBTTagCompound.setInteger("direction", direction);
par1NBTTagCompound.setString(varString1, "varString1");
}
public void activateRitual(World world, int crystalLevel)
@ -180,6 +183,16 @@ public class TEMasterStone extends TileEntity
{
return this.var1;
}
public void setVarString1(String newVar)
{
this.varString1 = newVar;
}
public String getVarString1()
{
return this.varString1;
}
public void setActive(boolean active)
{

View file

@ -65,7 +65,41 @@ public class TESpellEnhancementBlock extends TESpellBlock
public int getLimit()
{
return 5;
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
switch(meta)
{
case 0:
return 1;
case 1:
return 2;
case 2:
return 3;
case 3:
return 4;
case 4:
return 5;
case 5:
return 1;
case 6:
return 2;
case 7:
return 3;
case 8:
return 4;
case 9:
return 5;
case 10:
return 1;
case 11:
return 2;
case 12:
return 3;
case 13:
return 4;
case 14:
return 5;
}
return 0;
}
public int enhancementType() //0 is power, 1 is cost, 2 is potency

View file

@ -27,4 +27,17 @@ public class TESpellModifierBlock extends TESpellBlock
}
return new SpellModifierDefault();
}
@Override
public String getResourceLocationForMeta(int meta)
{
switch(meta)
{
case 0: return "alchemicalwizardry:textures/models/SpellModifierDefault.png";
case 1: return "alchemicalwizardry:textures/models/SpellModifierOffensive.png";
case 2: return "alchemicalwizardry:textures/models/SpellModifierDefensive.png";
case 3: return "alchemicalwizardry:textures/models/SpellModifierEnvironmental.png";
}
return "alchemicalwizardry:textures/models/SpellModifierDefault.png";
}
}

View file

@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.tileEntity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigm;
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee;
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile;
@ -68,5 +69,27 @@ public class TESpellParadigmBlock extends TESpellBlock
}
@Override
public String getResourceLocationForMeta(int meta)
{
switch(meta)
{
case 0: return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png";
case 1: return "alchemicalwizardry:textures/models/SpellParadigmSelf.png";
case 2: return "alchemicalwizardry:textures/models/SpellParadigmMelee.png";
}
return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png";
}
@Override
public void setInputDirection(ForgeDirection direction)
{
}
@Override
public ForgeDirection getInputDirection()
{
return ForgeDirection.UNKNOWN;
}
}