Upload my Code Changes/Format/imports

This commit is contained in:
Alexander committed 2014-02-16 14:23:50 -05:00
1 parent 5bcdb7ca46
commit 5d4e38c0cb
264 files changed
+4014 -3972

No files matched your search

@@ -34,7 +34,7 @@ public class Arrow extends ToolCore
case 0:
return "_arrow_head";
case 1:
return ""; //Doesn't break
return ""; // Doesn't break
case 2:
return "_arrow_shaft";
case 3:
@@ -96,7 +96,7 @@ public class Arrow extends ToolCore
@Override
public void getSubItems (Item id, CreativeTabs tab, List list)
{
//Vanilla style arrow
// Vanilla style arrow
Item accessory = getAccessoryItem();
ItemStack accessoryStack = accessory != null ? new ItemStack(getAccessoryItem(), 1, 0) : null;
Item extra = getExtraItem();
@@ -117,7 +117,7 @@ public class Arrow extends ToolCore
list.add(tool);
}
//Random arrow
// Random arrow
accessory = getAccessoryItem();
accessoryStack = accessory != null ? new ItemStack(getAccessoryItem(), 1, random.nextInt(4)) : null;
extra = getExtraItem();
@@ -182,7 +182,7 @@ public class Arrow extends ToolCore
if (tags.hasKey("Energy"))
{
String color = "";
//double joules = this.getJoules(stack);
// double joules = this.getJoules(stack);
int power = tags.getInteger("Energy");
if (power != 0)
@@ -14,87 +14,48 @@ public class BattleSign extends Weapon
this.setUnlocalizedName("InfiTool.Battlesign");
}
/*public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
{
if (!player.isSneaking())
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
return stack;
}*/
/*
* public ItemStack onItemRightClick(ItemStack stack, World world,
* EntityPlayer player) { if (!player.isSneaking())
* player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); return
* stack; }
*/
public String getToolName ()
{
return "Battlesign";
}
/*public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer player, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if (par7 == 0 || !player.isSneaking())
{
return false;
}
else if (!par3World.getBlockMaterial(par4, par5, par6).isSolid())
{
return false;
}
else
{
if (par7 == 1)
{
++par5;
}
if (par7 == 2)
{
--par6;
}
if (par7 == 3)
{
++par6;
}
if (par7 == 4)
{
--par4;
}
if (par7 == 5)
{
++par4;
}
if (!player.canPlayerEdit(par4, par5, par6, par7, par1ItemStack))
{
return false;
}
else if (!Block.signPost.canPlaceBlockAt(par3World, par4, par5, par6))
{
return false;
}
else
{
if (par7 == 1)
{
int var11 = MathHelper.floor_double((double)((player.rotationYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15;
par3World.setBlock(par4, par5, par6, Block.signPost.blockID, var11);
}
else
{
par3World.setBlock(par4, par5, par6, Block.signWall.blockID, par7);
}
//--par1ItemStack.stackSize;
TileEntitySign var12 = (TileEntitySign)par3World.getBlockTileEntity(par4, par5, par6);
if (var12 != null)
{
player.displayGUIEditSign(var12);
}
return true;
}
}
}*/
/*
* public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer player,
* World par3World, int par4, int par5, int par6, int par7, float par8,
* float par9, float par10) { if (par7 == 0 || !player.isSneaking()) {
* return false; } else if (!par3World.getBlockMaterial(par4, par5,
* par6).isSolid()) { return false; } else { if (par7 == 1) { ++par5; }
*
* if (par7 == 2) { --par6; }
*
* if (par7 == 3) { ++par6; }
*
* if (par7 == 4) { --par4; }
*
* if (par7 == 5) { ++par4; }
*
* if (!player.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) {
* return false; } else if (!Block.signPost.canPlaceBlockAt(par3World, par4,
* par5, par6)) { return false; } else { if (par7 == 1) { int var11 =
* MathHelper.floor_double((double)((player.rotationYaw + 180.0F) * 16.0F /
* 360.0F) + 0.5D) & 15; par3World.setBlock(par4, par5, par6,
* Block.signPost.blockID, var11); } else { par3World.setBlock(par4, par5,
* par6, Block.signWall.blockID, par7); }
*
* //--par1ItemStack.stackSize; TileEntitySign var12 =
* (TileEntitySign)par3World.getBlockTileEntity(par4, par5, par6);
*
* if (var12 != null) { player.displayGUIEditSign(var12); }
*
* return true; } } }
*/
@Override
public Item getHeadItem ()
@@ -169,18 +169,18 @@ public class Battleaxe extends HarvestTool
@Override
public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player)
{
//player.rotationYaw += 1;
//if (player.onGround)
//{
// player.rotationYaw += 1;
// if (player.onGround)
// {
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
//}
// }
return stack;
}
@Override
public void onPlayerStoppedUsing (ItemStack stack, World world, EntityPlayer player, int useCount)
{
//if (player.onGround)
// if (player.onGround)
{
int time = this.getMaxItemUseDuration(stack) - useCount;
int boost = time / 100;
@@ -89,7 +89,7 @@ public abstract class BowBase extends ToolCore
}
EntityArrow arrowEntity = null;
//if (tinkerArrow != null)
// if (tinkerArrow != null)
if (slotID != -1 && (arrowID == -1 || slotID < arrowID))
{
ItemStack arrowStack = tinkerArrow.copy();
@@ -117,7 +117,7 @@ public abstract class BowBase extends ToolCore
if (slotID != -1 && (arrowID == -1 || slotID < arrowID))
((ArrowEntity) arrowEntity).setKnockbackModStrength(toolTag.getFloat("Knockback"));
//var10 += toolTag.getFloat("Knockback");
// var10 += toolTag.getFloat("Knockback");
if (var10 > 0)
{
@@ -146,7 +146,7 @@ public abstract class BowBase extends ToolCore
}
else
{
//if (tinkerArrow != null)
// if (tinkerArrow != null)
if (slotID != -1 && (arrowID == -1 || slotID < arrowID))
{
player.inventory.consumeInventoryItem(TRepo.arrow);
@@ -191,7 +191,8 @@ public abstract class BowBase extends ToolCore
}
/**
* returns the action that specifies what animation to play when the items is being used
* returns the action that specifies what animation to play when the items
* is being used
*/
public EnumAction getItemUseAction (ItemStack par1ItemStack)
{
@@ -199,7 +200,8 @@ public abstract class BowBase extends ToolCore
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
* Called whenever this item is equipped and the right mouse button is
* pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick (ItemStack stack, World par2World, EntityPlayer player)
{
@@ -471,8 +473,8 @@ public abstract class BowBase extends ToolCore
public void registerPartPaths (int index, String[] location)
{
headStrings.put(index, location[0]);
//brokenHeadStrings.put(index, location[1]);
//handleStrings.put(index, location[2]);
// brokenHeadStrings.put(index, location[1]);
// handleStrings.put(index, location[2]);
if (location.length > 3)
accessoryStrings.put(index, location[3]);
if (location.length > 4)
@@ -59,19 +59,15 @@ public class Broadsword extends Weapon
return "broadsword";
}
/*@Override
@SideOnly(Side.CLIENT)
public void onUpdate (ItemStack stack, World world, Entity entity, int par4, boolean par5)
{
super.onUpdate(stack, world, entity, par4, par5);
if (entity instanceof EntityPlayerSP)
{
EntityPlayerSP player = (EntityPlayerSP) entity;
if (player.itemInUse != null && player.itemInUse.getItem() == this)
{
player.movementInput.moveForward *= 5.0F;
player.movementInput.moveStrafe *= 5.0F;
}
}
}*/
/*
* @Override
*
* @SideOnly(Side.CLIENT) public void onUpdate (ItemStack stack, World
* world, Entity entity, int par4, boolean par5) { super.onUpdate(stack,
* world, entity, par4, par5); if (entity instanceof EntityPlayerSP) {
* EntityPlayerSP player = (EntityPlayerSP) entity; if (player.itemInUse !=
* null && player.itemInUse.getItem() == this) {
* player.movementInput.moveForward *= 5.0F; player.movementInput.moveStrafe
* *= 5.0F; } } }
*/
}
@@ -129,15 +129,13 @@ public class Cleaver extends Weapon
{
entity.hurtResistantTime += 7;
/*if (entity instanceof EntityLiving)
{
EntityLiving living = (EntityLiving) entity;
if (living.getHealth() <= 0)
{
}
}*/
//if (entity.getHealth() <= 0)
/*
* if (entity instanceof EntityLiving) { EntityLiving living =
* (EntityLiving) entity; if (living.getHealth() <= 0) {
*
* } }
*/
// if (entity.getHealth() <= 0)
}
return true;
}
@@ -156,12 +154,10 @@ public class Cleaver extends Weapon
}
}
/*@Override
public boolean onEntitySwing (EntityLiving entity, ItemStack stack)
{
entity.swingProgressInt /= 2;
return false;
}*/
/*
* @Override public boolean onEntitySwing (EntityLiving entity, ItemStack
* stack) { entity.swingProgressInt /= 2; return false; }
*/
@Override
public boolean willAllowOffhandWeapon ()
@@ -32,7 +32,10 @@ public class FryingPan extends Weapon
public boolean hitEntity (ItemStack stack, EntityLivingBase mob, EntityLivingBase player)
{
AbilityHelper.knockbackEntity(mob, 1.7f);
mob.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 0)); //5 seconds of stun
mob.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 0)); // 5
// seconds
// of
// stun
return true;
}
@@ -362,8 +362,10 @@ public class Hammer extends HarvestTool
}
}
/*if (block == Block.silverfish)
return getblockSpeed(tags, block, meta);*/
/*
* if (block == Block.silverfish) return getblockSpeed(tags, block,
* meta);
*/
return super.getDigSpeed(stack, block, meta);
}
@@ -401,20 +403,15 @@ public class Hammer extends HarvestTool
return 0.1f;
}
/*@Override
public void onUpdate (ItemStack stack, World world, Entity entity, int par4, boolean par5)
{
super.onUpdate(stack, world, entity, par4, par5);
if (entity instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) entity;
ItemStack equipped = player.getCurrentEquippedItem();
if (equipped == stack)
{
player.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 1, 1));
}
}
}*/
/*
* @Override public void onUpdate (ItemStack stack, World world, Entity
* entity, int par4, boolean par5) { super.onUpdate(stack, world, entity,
* par4, par5); if (entity instanceof EntityPlayer) { EntityPlayer player =
* (EntityPlayer) entity; ItemStack equipped =
* player.getCurrentEquippedItem(); if (equipped == stack) {
* player.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 1, 1)); }
* } }
*/
@Override
public String[] toolCategories ()
@@ -42,7 +42,10 @@ public class Hatchet extends HarvestTool
return AbilityHelper.onBlockChanged(itemstack, world, block, x, y, z, player, random);
}
static Material[] materials = { Material.wood, Material.leaves, Material.vine, Material.circuits, Material.cactus };//TODO find this//, Material.pumpkin };
static Material[] materials = { Material.wood, Material.leaves, Material.vine, Material.circuits, Material.cactus };// TODO find
// this//,
// Material.pumpkin
// };
@Override
public Item getHeadItem ()
@@ -42,27 +42,23 @@ public class Longsword extends Weapon
public void onPlayerStoppedUsing (ItemStack stack, World world, EntityPlayer player, int useCount)
{
/*if (player.onGround)
{
int time = this.getMaxItemUseDuration(stack) - useCount;
if (time > 5)
{
player.addExhaustion(0.2F);
player.setSprinting(true);
float speed = 0.05F * time;
if (speed > 0.925f)
speed = 0.925f;
float increase = (float) (0.02 * time + 0.2);
if (increase > 0.56f)
increase = 0.56f;
player.motionY += increase + speed/3;
player.motionX = (double) (-MathHelper.sin(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI) * speed);
player.motionZ = (double) (MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI) * speed);
}
}*/
/*
* if (player.onGround) { int time = this.getMaxItemUseDuration(stack) -
* useCount; if (time > 5) { player.addExhaustion(0.2F);
* player.setSprinting(true);
*
* float speed = 0.05F * time; if (speed > 0.925f) speed = 0.925f;
*
* float increase = (float) (0.02 * time + 0.2); if (increase > 0.56f)
* increase = 0.56f; player.motionY += increase + speed/3;
*
* player.motionX = (double) (-MathHelper.sin(player.rotationYaw /
* 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch /
* 180.0F * (float) Math.PI) * speed); player.motionZ = (double)
* (MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI) *
* MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI) *
* speed); } }
*/
int time = this.getMaxItemUseDuration(stack) - useCount;
if (time > 5)
{
@@ -62,24 +62,20 @@ public class LumberAxe extends HarvestTool
return AbilityHelper.onBlockChanged(itemstack, world, block, x, y, z, player, random);
}
static Material[] materials = { Material.wood, Material.vine, Material.circuits, Material.cactus };//TODO find this//, Material.pumpkin };
static Material[] materials = { Material.wood, Material.vine, Material.circuits, Material.cactus };// TODO find this//,
// Material.pumpkin };
/* Lumber axe specific */
/*@Override
public void onUpdate (ItemStack stack, World world, Entity entity, int par4, boolean par5)
{
super.onUpdate(stack, world, entity, par4, par5);
if (entity instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) entity;
ItemStack equipped = player.getCurrentEquippedItem();
if (equipped == stack)
{
player.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 1, 1));
}
}
}*/
/*
* @Override public void onUpdate (ItemStack stack, World world, Entity
* entity, int par4, boolean par5) { super.onUpdate(stack, world, entity,
* par4, par5); if (entity instanceof EntityPlayer) { EntityPlayer player =
* (EntityPlayer) entity; ItemStack equipped =
* player.getCurrentEquippedItem(); if (equipped == stack) {
* player.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 1, 1)); }
* } }
*/
@Override
public float getDigSpeed (ItemStack stack, Block block, int meta)
@@ -232,12 +228,16 @@ public class LumberAxe extends HarvestTool
{
if (localblock == bID && world.getBlockMetadata(xPos, yPos, zPos) % 4 == meta % 4)
{
/* world.setBlock(xPos, yPos, zPos, 0, 0, 3);
if (!player.capabilities.isCreativeMode)
{
Block.blocksList[bID].harvestBlock(world, player, xPos, yPos, zPos, meta);
onBlockDestroyed(stack, world, bID, xPos, yPos, zPos, player);
}*/
/*
* world.setBlock(xPos, yPos, zPos, 0,
* 0, 3); if
* (!player.capabilities.isCreativeMode)
* {
* Block.blocksList[bID].harvestBlock(world
* , player, xPos, yPos, zPos, meta);
* onBlockDestroyed(stack, world, bID,
* xPos, yPos, zPos, player); }
*/
if (!player.capabilities.isCreativeMode)
{
if (block.removedByPlayer(world, player, xPos, yPos, zPos))
@@ -254,19 +254,19 @@ public class LumberAxe extends HarvestTool
}
breakTree(world, xPos, yPos, zPos, stack, tags, bID, meta, player);
}
/*else
{
Block leaves = Block.blocksList[localID];
if (leaves != null && leaves.isLeaves(world, xPos, yPos, zPos))
{
WorldHelper.setBlockToAir(world, xPos, yPos, zPos);
if (!player.capabilities.isCreativeMode)
{
Block.blocksList[bID].harvestBlock(world, player, xPos, yPos, zPos, meta);
onBlockDestroyed(stack, world, bID, xPos, yPos, zPos, player);
}
}
}*/
/*
* else { Block leaves =
* Block.blocksList[localID]; if (leaves !=
* null && leaves.isLeaves(world, xPos,
* yPos, zPos)) {
* WorldHelper.setBlockToAir(world, xPos,
* yPos, zPos); if
* (!player.capabilities.isCreativeMode) {
* Block.blocksList[bID].harvestBlock(world,
* player, xPos, yPos, zPos, meta);
* onBlockDestroyed(stack, world, bID, xPos,
* yPos, zPos, player); } } }
*/
}
}
}
@@ -306,7 +306,7 @@ public class LumberAxe extends HarvestTool
WorldHelper.setBlockToAir(world, xPos, yPos, zPos);
if (!player.capabilities.isCreativeMode)
{
//TODO harvestBlock
// TODO harvestBlock
block.harvestBlock(world, player, xPos, yPos, zPos, meta);
onBlockDestroyed(stack, world, block, xPos, yPos, zPos, player);
}
@@ -47,7 +47,13 @@ public class Mattock extends DualHarvestTool
return "shovel";
}
static Material[] axeMaterials = { Material.wood, Material.cactus };//TODO find this//, Material.pumpkin, Material.plants, Material.vine };
static Material[] axeMaterials = { Material.wood, Material.cactus };// TODO
// find
// this//,
// Material.pumpkin,
// Material.plants,
// Material.vine
// };
static Material[] shovelMaterials = { Material.grass, Material.ground, Material.clay };
@Override
@@ -82,7 +82,8 @@ public class PotionLauncher extends Item
}
/**
* returns the action that specifies what animation to play when the items is being used
* returns the action that specifies what animation to play when the items
* is being used
*/
public EnumAction getItemUseAction (ItemStack stack)
{
@@ -131,7 +132,7 @@ public class PotionLauncher extends Item
if (tags.getBoolean("Loaded"))
{
NBTTagCompound potionTag = tags.getCompoundTag("LoadedPotion");
ItemStack potion = ItemStack.loadItemStackFromNBT(potionTag);//findPotion(player);InventoryLogic
ItemStack potion = ItemStack.loadItemStackFromNBT(potionTag);// findPotion(player);InventoryLogic
if (potion != null)
{
World world = player.worldObj;
@@ -40,8 +40,8 @@ public class Rapier extends Weapon
@Override
public boolean hitEntity (ItemStack stack, EntityLivingBase mob, EntityLivingBase player)
{
//AbilityHelper.hitEntity(stack, mob, player, damageVsEntity);
//AbilityHelper.knockbackEntity(mob, 0.8f);
// AbilityHelper.hitEntity(stack, mob, player, damageVsEntity);
// AbilityHelper.knockbackEntity(mob, 0.8f);
mob.motionY *= 0.8;
if (mob.hurtResistantTime > 18)
mob.hurtResistantTime -= 5;
@@ -60,10 +60,9 @@ public class Rapier extends Weapon
return 0.8f;
}
/*public float chargeAttack ()
{
return 1.0f;
}*/
/*
* public float chargeAttack () { return 1.0f; }
*/
public boolean pierceArmor ()
{
@@ -28,11 +28,9 @@ public class Scythe extends Weapon
this.setUnlocalizedName("InfiTool.Scythe");
}
/*@Override
protected String getHarvestType()
{
return "sword";
}*/
/*
* @Override protected String getHarvestType() { return "sword"; }
*/
@Override
protected Material[] getEffectiveMaterials ()
@@ -40,7 +38,9 @@ public class Scythe extends Weapon
return materials;
}
static Material[] materials = new Material[] { Material.web, Material.cactus };//TODO find this//, Material.pumpkin, Material.plants, Material.vine, Material.leaves };
static Material[] materials = new Material[] { Material.web, Material.cactus };// TODO find this//, Material.pumpkin,
// Material.plants, Material.vine,
// Material.leaves };
@Override
public Item getHeadItem ()
@@ -178,7 +178,10 @@ public class Scythe extends Weapon
if (!cancelHarvest)
{
Block block = world.getBlock(xPos, yPos, zPos);
if (block != null)// && (block.getMaterial() == Material.leaves || block.isLeaves(world, xPos, yPos, zPos)))
if (block != null)// && (block.getMaterial() ==
// Material.leaves ||
// block.isLeaves(world, xPos,
// yPos, zPos)))
{
for (int iter = 0; iter < materials.length; iter++)
{
@@ -103,7 +103,7 @@ public class Shortbow extends BowBase
if (tags.hasKey("Energy"))
{
String color = "";
//double joules = this.getJoules(stack);
// double joules = this.getJoules(stack);
int power = tags.getInteger("Energy");
if (power != 0)
@@ -188,7 +188,7 @@ public class Shortbow extends BowBase
default:
return "";
}
//return TConstructRegistry.getMaterial(type).ability();
// return TConstructRegistry.getMaterial(type).ability();
}
@Override
@@ -96,42 +96,26 @@ public class Shovel extends HarvestTool
return false;
}
/*@Override
public Icon getIcon (ItemStack stack, int renderPass)
{
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
if (renderPass == 0) // Handle
{
return (handleIcons.get(tags.getInteger("RenderHandle")));
}
if (renderPass == 1) // Head
{
if (tags.getBoolean("Broken"))
return (brokenHeadIcons.get(tags.getInteger("RenderHead")));
else
return (headIcons.get(tags.getInteger("RenderHead")));
}
if (renderPass == 2)
{
if (tags.hasKey("Effect1"))
return (effectIcons.get(tags.getInteger("Effect1")));
}
if (renderPass == 3)
{
if (tags.hasKey("Effect2"))
return (effectIcons.get(tags.getInteger("Effect2")));
}
if (renderPass == 4)
{
if (tags.hasKey("Effect3"))
return (effectIcons.get(tags.getInteger("Effect3")));
}
return TProxyClient.blankSprite;
}*/
/*
* @Override public Icon getIcon (ItemStack stack, int renderPass) {
* NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
*
* if (renderPass == 0) // Handle { return
* (handleIcons.get(tags.getInteger("RenderHandle"))); }
*
* if (renderPass == 1) // Head { if (tags.getBoolean("Broken")) return
* (brokenHeadIcons.get(tags.getInteger("RenderHead"))); else return
* (headIcons.get(tags.getInteger("RenderHead"))); }
*
* if (renderPass == 2) { if (tags.hasKey("Effect1")) return
* (effectIcons.get(tags.getInteger("Effect1"))); }
*
* if (renderPass == 3) { if (tags.hasKey("Effect2")) return
* (effectIcons.get(tags.getInteger("Effect2"))); }
*
* if (renderPass == 4) { if (tags.hasKey("Effect3")) return
* (effectIcons.get(tags.getInteger("Effect3"))); }
*
* return TProxyClient.blankSprite; }
*/
}