1.7.10 commit of I-still-can't-do-any-branches

This commit is contained in:
WayofTime 2014-06-27 19:43:09 -04:00
parent 6aec0a87ea
commit cabc296b21
763 changed files with 64290 additions and 0 deletions

View file

@ -0,0 +1,169 @@
package WayofTime.alchemicalWizardry.common.items.thaumcraft;
import java.util.List;
import javax.swing.Icon;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public abstract class FocusBase extends EnergyItems //implements IWandFocus
{
protected IIcon ornament, depth;
public FocusBase()
{
super();
setMaxDamage(1);
setNoRepair();
setMaxStackSize(1);
}
boolean hasOrnament()
{
return false;
}
boolean hasDepth()
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
super.registerIcons(iconRegister);
// if(hasOrnament())
// {
// ornament = iconRegister.registerIcon("AlchemicalWizardry:" + this.getUnlocalizedName() + "Orn");
// }
// if(hasDepth())
// {
// depth = iconRegister.registerIcon("AlchemicalWizardry:" + this.getUnlocalizedName() + "Depth");
// }
}
@Override
public boolean isItemTool(ItemStack par1ItemStack)
{
return true;
}
/*erride
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
AspectList cost = getVisCost();
if (cost != null && cost.size() > 0)
{
par3List.add(StatCollector.translateToLocal(isVisCostPerTick() ? "item.Focus.cost2" : "item.Focus.cost1"));
for (Aspect aspect : cost.getAspectsSorted())
{
float amount = cost.getAmount(aspect) / 100.0F;
par3List.add(" " + '\u00a7' + aspect.getChatcolor() + aspect.getName() + '\u00a7' + "r x " + amount);
}
}
}
@Override
public int getItemEnchantability()
{
return 5;
}
@Override
public EnumRarity getRarity(ItemStack itemstack)
{
return EnumRarity.rare;
}
@Override
public Icon getOrnament()
{
return ornament;
}
@Override
public Icon getFocusDepthLayerIcon()
{
return depth;
}
@Override
public WandFocusAnimation getAnimation()
{
return WandFocusAnimation.WAVE;
}
@Override
public boolean isVisCostPerTick()
{
return false;
}
public boolean isUseItem()
{
return isVisCostPerTick();
}
@Override
public ItemStack onFocusRightClick(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, MovingObjectPosition paramMovingObjectPosition)
{
if (isUseItem())
{
paramEntityPlayer.setItemInUse(paramItemStack, Integer.MAX_VALUE);
}
return paramItemStack;
}
@Override
public void onUsingFocusTick(ItemStack paramItemStack, EntityPlayer paramEntityPlayer, int paramInt)
{
// NO-OP
}
@Override
public void onPlayerStoppedUsingFocus(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, int paramInt)
{
// NO-OP
}
@Override
public String getSortingHelper(ItemStack paramItemStack)
{
return "00";
}
@Override
public boolean onFocusBlockStartBreak(ItemStack paramItemStack, int paramInt1, int paramInt2, int paramInt3, EntityPlayer paramEntityPlayer)
{
return false;
}
@Override
public boolean acceptsEnchant(int id)
{
if (id == ThaumcraftApi.enchantFrugal ||
id == ThaumcraftApi.enchantPotency)
{
return true;
}
return false;
}
*/
}

View file

@ -0,0 +1,191 @@
package WayofTime.alchemicalWizardry.common.items.thaumcraft;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class FocusBloodBlast extends FocusBase
{
//private static final AspectList visUsage = new AspectList().add(Aspect.AIR, 15).add(Aspect.ENTROPY, 45);
private final int maxCooldown = 7;
public static Map<String,Integer> playerCooldown = new HashMap();
public FocusBloodBlast()
{
super();
this.setUnlocalizedName("focusBloodBlast");
this.setEnergyUsed(100);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
super.registerIcons(iconRegister);
if (hasOrnament())
{
ornament = iconRegister.registerIcon("AlchemicalWizardry:" + "focusBloodBlast" + "Orn");
}
if (hasDepth())
{
depth = iconRegister.registerIcon("AlchemicalWizardry:" + "focusBloodBlast" + "Depth");
}
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
//super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
if (!(par1ItemStack.stackTagCompound == null))
{
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
{
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
}
/*
@Override
public void onUsingFocusTick(ItemStack stack, EntityPlayer par3EntityPlayer, int ticks)
{
if (AlchemicalWizardry.isThaumcraftLoaded)
{
Item item = stack.getItem();
Class clazz = item.getClass();
while (!clazz.getName().equals("thaumcraft.common.items.wands.ItemWandCasting"))
{
if (clazz == Object.class)
{
return;
}
clazz = clazz.getSuperclass();
}
//Item testItem = item.set
//Method consumeAllVis = null;
try
{
if (!playerCooldown.containsKey(par3EntityPlayer.username))
{
playerCooldown.put(par3EntityPlayer.username, 0);
}
Method getFocusItem = clazz.getMethod("getFocusItem", ItemStack.class);
ItemStack focusStack = (ItemStack) getFocusItem.invoke(item, stack);
//int potency = EnchantmentHelper.getEnchantmentLevel(ThaumcraftApi.enchantPotency, focusStack);
int cooldown = playerCooldown.get(par3EntityPlayer.username) + 1;
playerCooldown.put(par3EntityPlayer.username, cooldown);
if (cooldown >= this.maxCooldown)
{
Method consumeAllVis = clazz.getMethod("consumeAllVis", ItemStack.class, EntityPlayer.class, AspectList.class, boolean.class);
if ((Boolean) consumeAllVis.invoke(item, stack, par3EntityPlayer, getVisCost(), true))
{
playerCooldown.put(par3EntityPlayer.username, 0);
EnergyItems.checkAndSetItemOwner(focusStack, par3EntityPlayer);
World world = par3EntityPlayer.worldObj;
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
this.syphonBatteries(focusStack, par3EntityPlayer, 100);
}
//world.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
world.playSoundAtEntity(par3EntityPlayer, "thaumcraft:wand", 0.5F, 1F);
if (!world.isRemote)
{
//par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage));
world.spawnEntityInWorld(new EnergyBlastProjectile(world, par3EntityPlayer, (int) (5)));
//this.setDelay(par1ItemStack, maxDelay);
}
}
}
} catch (NoSuchMethodException e1)
{
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (SecurityException e1)
{
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IllegalAccessException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalArgumentException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
@Override
public void onPlayerStoppedUsingFocus(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, int paramInt)
{
playerCooldown.put(paramEntityPlayer.username, 0);
}
@Override
public String getSortingHelper(ItemStack itemstack)
{
return "BLOODBLAST";
}
@Override
public int getFocusColor()
{
return 0x8A0707;
}
@Override
public AspectList getVisCost()
{
return visUsage;
}
@Override
public boolean isVisCostPerTick()
{
return true;
}
@Override
public WandFocusAnimation getAnimation()
{
return WandFocusAnimation.WAVE;
}
boolean hasOrnament()
{
return true;
}
*/
}

View file

@ -0,0 +1,263 @@
package WayofTime.alchemicalWizardry.common.items.thaumcraft;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class FocusGravityWell extends FocusBase
{
//private static final AspectList visUsage = new AspectList().add(Aspect.AIR, 5).add(Aspect.ORDER, 5);
private final int maxCooldown = 1;
public static Map<String,Integer> playerCooldown = new HashMap();
public FocusGravityWell()
{
super();
this.setUnlocalizedName("focusGravityWell");
this.setEnergyUsed(100);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
super.registerIcons(iconRegister);
if (hasOrnament())
{
ornament = iconRegister.registerIcon("AlchemicalWizardry:" + "focusGravityWell" + "Orn");
}
if (hasDepth())
{
depth = iconRegister.registerIcon("AlchemicalWizardry:" + "focusGravityWell" + "Depth");
}
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
//super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
if (!(par1ItemStack.stackTagCompound == null))
{
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
{
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
}
/*
@Override
public void onUsingFocusTick(ItemStack stack, EntityPlayer par3EntityPlayer, int ticks)
{
if (AlchemicalWizardry.isThaumcraftLoaded)
{
Item item = stack.getItem();
Class clazz = item.getClass();
while (!clazz.getName().equals("thaumcraft.common.items.wands.ItemWandCasting"))
{
if (clazz == Object.class)
{
return;
}
clazz = clazz.getSuperclass();
}
//Item testItem = item.set
//Method consumeAllVis = null;
try
{
if (!playerCooldown.containsKey(par3EntityPlayer.username))
{
playerCooldown.put(par3EntityPlayer.username, 0);
}
Method getFocusItem = clazz.getMethod("getFocusItem", ItemStack.class);
ItemStack focusStack = (ItemStack) getFocusItem.invoke(item, stack);
//int potency = EnchantmentHelper.getEnchantmentLevel(ThaumcraftApi.enchantPotency, focusStack);
int cooldown = playerCooldown.get(par3EntityPlayer.username) + 1;
playerCooldown.put(par3EntityPlayer.username, cooldown);
//if(cooldown>=this.maxCooldown)
{
Method consumeAllVis = clazz.getMethod("consumeAllVis", ItemStack.class, EntityPlayer.class, AspectList.class, boolean.class);
if ((Boolean) consumeAllVis.invoke(item, stack, par3EntityPlayer, getVisCost(), true))
{
playerCooldown.put(par3EntityPlayer.username, 0);
EnergyItems.checkAndSetItemOwner(focusStack, par3EntityPlayer);
Vec3 vector = par3EntityPlayer.getLookVec();
float distance = 2;
//if(par3EntityPlayer.worldObj.isRemote)
{
List<Entity> entities = par3EntityPlayer.worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(par3EntityPlayer.posX + vector.xCoord * distance - 0.5f, par3EntityPlayer.posY + vector.yCoord * distance - 0.5f, par3EntityPlayer.posZ + vector.zCoord * distance - 0.5f, par3EntityPlayer.posX + vector.xCoord * distance + 0.5f, par3EntityPlayer.posY + vector.yCoord * distance + 0.5f, par3EntityPlayer.posZ + vector.zCoord * distance + 0.5f).expand(1, 1, 1));
for (Entity entity : entities)
{
if (entity.getEntityName() == par3EntityPlayer.username)
{
continue;
}
entity.motionX = par3EntityPlayer.posX + vector.xCoord * distance - entity.posX;
entity.motionY = par3EntityPlayer.posY + vector.yCoord * distance - entity.posY;
entity.motionZ = par3EntityPlayer.posZ + vector.zCoord * distance - entity.posZ;
//entity.setVelocity(par3EntityPlayer.posX+vector.xCoord*distance-entity.posX, par3EntityPlayer.posY+vector.yCoord*distance-entity.posY, par3EntityPlayer.posZ+vector.zCoord*distance-entity.posZ);
}
}
World world = par3EntityPlayer.worldObj;
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
this.syphonBatteriesWithoutParticles(focusStack, par3EntityPlayer, 10, false);
}
}
}
} catch (NoSuchMethodException e1)
{
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (SecurityException e1)
{
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IllegalAccessException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalArgumentException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
@Override
public void onPlayerStoppedUsingFocus(ItemStack stack, World paramWorld, EntityPlayer par3EntityPlayer, int paramInt)
{
playerCooldown.put(par3EntityPlayer.username, 0);
if (AlchemicalWizardry.isThaumcraftLoaded)
{
Item item = stack.getItem();
Class clazz = item.getClass();
while (!clazz.getName().equals("thaumcraft.common.items.wands.ItemWandCasting"))
{
if (clazz == Object.class)
{
return;
}
clazz = clazz.getSuperclass();
}
//Item testItem = item.set
//Method consumeAllVis = null;
try
{
Method getFocusItem = clazz.getMethod("getFocusItem", ItemStack.class);
ItemStack focusStack = (ItemStack) getFocusItem.invoke(item, stack);
int potency = EnchantmentHelper.getEnchantmentLevel(ThaumcraftApi.enchantPotency, focusStack);
if (potency > 0)
{
EnergyItems.checkAndSetItemOwner(focusStack, par3EntityPlayer);
Vec3 vector = par3EntityPlayer.getLookVec();
float distance = 2;
//if(par3EntityPlayer.worldObj.isRemote)
{
List<Entity> entities = par3EntityPlayer.worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(par3EntityPlayer.posX + vector.xCoord * distance - 0.5f, par3EntityPlayer.posY + vector.yCoord * distance - 0.5f, par3EntityPlayer.posZ + vector.zCoord * distance - 0.5f, par3EntityPlayer.posX + vector.xCoord * distance + 0.5f, par3EntityPlayer.posY + vector.yCoord * distance + 0.5f, par3EntityPlayer.posZ + vector.zCoord * distance + 0.5f).expand(1, 1, 1));
for (Entity entity : entities)
{
if (entity.getEntityName() == par3EntityPlayer.username)
{
continue;
}
float speed = 1.0F * potency;
entity.motionX = vector.xCoord * speed;
entity.motionY = vector.yCoord * speed;
entity.motionZ = vector.zCoord * speed;
//entity.setVelocity(par3EntityPlayer.posX+vector.xCoord*distance-entity.posX, par3EntityPlayer.posY+vector.yCoord*distance-entity.posY, par3EntityPlayer.posZ+vector.zCoord*distance-entity.posZ);
}
}
}
} catch (NoSuchMethodException e1)
{
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (SecurityException e1)
{
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IllegalAccessException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalArgumentException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
@Override
public String getSortingHelper(ItemStack itemstack)
{
return "BLOODBLAST";
}
@Override
public int getFocusColor()
{
return 0x8A0707;
}
@Override
public AspectList getVisCost()
{
return visUsage;
}
@Override
public boolean isVisCostPerTick()
{
return true;
}
@Override
public WandFocusAnimation getAnimation()
{
return WandFocusAnimation.WAVE;
}
boolean hasOrnament()
{
return false;
}
*/
}

View file

@ -0,0 +1,103 @@
package WayofTime.alchemicalWizardry.common.items.thaumcraft;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import thaumcraft.api.IGoggles;
import thaumcraft.api.IVisDiscountGear;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.nodes.IRevealer;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemSanguineArmour extends ItemArmor implements ArmourUpgrade, IGoggles, IVisDiscountGear, IRevealer
{
private static IIcon helmetIcon;
public ItemSanguineArmour()
{
super(AlchemicalWizardry.sanguineArmourArmourMaterial, 4, 0);
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
//this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguineHelmet");
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
{
//if(AlchemicalWizardry.isThaumcraftLoaded)
{
if (this == ModItems.sanguineHelmet)
{
return "alchemicalwizardry:models/armor/sanguineArmour_layer_1.png";
}
}
return null;
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
par3List.add("A pair of goggles imbued with power");
par3List.add("Vis discount: " + 8 + "%");
}
// @Override
// public boolean showNodes(ItemStack itemstack, EntityLivingBase player)
// {
// return true;
// }
@Override
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
{
return;
}
@Override
public boolean isUpgrade()
{
return false;
}
@Override
public int getEnergyForTenSeconds()
{
return 0;
}
@Override
public boolean showNodes(ItemStack itemstack, EntityLivingBase player)
{
return true;
}
@Override
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect)
{
return 8;
}
@Override
public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player)
{
return true;
}
}