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

@@ -27,8 +27,8 @@ public class FilledBucket extends ItemBucket
public FilledBucket(Block b)
{
super(b);
//setTextureFile(TRepo.craftingTexture);
//setIconIndex(224);
// setTextureFile(TRepo.craftingTexture);
// setIconIndex(224);
setUnlocalizedName("tconstruct.bucket");
setContainerItem(Items.bucket);
this.setHasSubtypes(true);
@@ -49,31 +49,21 @@ public class FilledBucket extends ItemBucket
}
else
{
/*FillBucketEvent event = new FillBucketEvent(player, stack, world, position);
if (MinecraftForge.EVENT_BUS.post(event))
{
return stack;
}
if (event.getResult() == Event.Result.ALLOW)
{
if (player.capabilities.isCreativeMode)
{
return stack;
}
if (--stack.stackSize <= 0)
{
return event.result;
}
if (!player.inventory.addItemStackToInventory(event.result))
{
player.dropPlayerItem(event.result);
}
return stack;
}*/
/*
* FillBucketEvent event = new FillBucketEvent(player, stack, world,
* position); if (MinecraftForge.EVENT_BUS.post(event)) { return
* stack; }
*
* if (event.getResult() == Event.Result.ALLOW) { if
* (player.capabilities.isCreativeMode) { return stack; }
*
* if (--stack.stackSize <= 0) { return event.result; }
*
* if (!player.inventory.addItemStackToInventory(event.result)) {
* player.dropPlayerItem(event.result); }
*
* return stack; }
*/
if (position.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
{
@@ -145,7 +135,7 @@ public class FilledBucket extends ItemBucket
if (TRepo.fluidBlocks[type] instanceof BlockFluidFinite)
metadata = 7;
world.setBlock(clickX, clickY, clickZ, TRepo.fluidBlocks[type], metadata, 3); //TODO: Merge liquids
world.setBlock(clickX, clickY, clickZ, TRepo.fluidBlocks[type], metadata, 3); // TODO: Merge liquids
}
catch (ArrayIndexOutOfBoundsException ex)
{
+7 -3
View File
@@ -29,9 +29,13 @@ public class Manual extends CraftingItem
{
player.addStat(TAchievements.achievements.get("tconstruct.beginner"), 1);
player.openGui(TConstruct.instance, mantle.client.MProxyClient.manualGuiID, world, 0, 0, 0);
/*Side side = FMLCommonHandler.instance().getEffectiveSide();
if (side.isClient())
FMLClientHandler.instance().displayGuiScreen(player, new GuiManual(player.getCurrentEquippedItem(), getManualFromStack(stack)));*/
/*
* Side side = FMLCommonHandler.instance().getEffectiveSide(); if
* (side.isClient())
* FMLClientHandler.instance().displayGuiScreen(player, new
* GuiManual(player.getCurrentEquippedItem(),
* getManualFromStack(stack)));
*/
return stack;
}
+2 -2
View File
@@ -46,7 +46,7 @@ public class Pattern extends CraftingItem implements IPattern
{
for (int i = 1; i < patternName.length; i++)
{
//if (i != 23)
// if (i != 23)
list.add(new ItemStack(b, 1, i));
}
}
@@ -80,7 +80,7 @@ public class Pattern extends CraftingItem implements IPattern
}
}
//2 for full material, 1 for half.
// 2 for full material, 1 for half.
@Override
public int getPatternCost (ItemStack pattern)
{
@@ -79,7 +79,7 @@ public class TitleIcon extends Item
return achievementIcons[index];
}
}
//Not returning null to prevent crashes
// Not returning null to prevent crashes
return itemIcon;
}
+14 -13
View File
@@ -32,19 +32,20 @@ public class ToolPart extends CraftingItem implements IToolPart
return name;
/*StringBuilder builder = new StringBuilder();
builder.append(StatCollector.translateToLocal("parttype." + toolTextureNames[par1ItemStack.getItemDamage()])).append(" ").append(StatCollector.translateToLocal("toolpart." + partName));
return builder.toString();
--
String s = ("" + StatCollector.translateToLocal("toolpart."+partName)).trim();
String s1 = toolMaterialNames[par1ItemStack.getItemDamage()];
if (s1 != null)
{
s = s + " " + StatCollector.translateToLocal(s1);
}
return s;*/
/*
* StringBuilder builder = new StringBuilder();
* builder.append(StatCollector.translateToLocal("parttype." +
* toolTextureNames
* [par1ItemStack.getItemDamage()])).append(" ").append(StatCollector
* .translateToLocal("toolpart." + partName)); return
* builder.toString(); -- String s = ("" +
* StatCollector.translateToLocal("toolpart."+partName)).trim(); String
* s1 = toolMaterialNames[par1ItemStack.getItemDamage()];
*
* if (s1 != null) { s = s + " " + StatCollector.translateToLocal(s1); }
*
* return s;
*/
}
private static String[] buildTextureNames (String textureType)
@@ -45,7 +45,7 @@ public class ExoArmor extends ArmorCore
@Override
public void damageArmor (EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot)
{
//Deimplemented for now
// Deimplemented for now
}
@SideOnly(Side.CLIENT)
@@ -31,23 +31,17 @@ public class Knapsack extends CraftingItem
}
}
//TODO feel fix this so that stuff ticks in backpacks
/*@Override
public void onArmorTickUpdate (World world, EntityPlayer player, ItemStack itemStack)
{
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.getDisplayName());
KnapsackInventory inv = stats.knapsack;
if (stats != null && inv != null)
{
for (int i = 0; i < inv.getSizeInventory(); i++)
{
if (inv.getStackInSlot(i) != null)
{
inv.getStackInSlot(i).getItem().onUpdate(inv.getStackInSlot(i), player.worldObj, player, i, false);
}
}
}
}*/
// TODO feel fix this so that stuff ticks in backpacks
/*
* @Override public void onArmorTickUpdate (World world, EntityPlayer
* player, ItemStack itemStack) { TPlayerStats stats =
* TConstruct.playerTracker.getPlayerStats(player.getDisplayName());
* KnapsackInventory inv = stats.knapsack;
*
* if (stats != null && inv != null) { for (int i = 0; i <
* inv.getSizeInventory(); i++) { if (inv.getStackInSlot(i) != null) {
* inv.getStackInSlot(i).getItem().onUpdate(inv.getStackInSlot(i),
* player.worldObj, player, i, false); } } } }
*/
}
@@ -14,13 +14,13 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class TArmorBase extends ItemArmor
//implements ISpecialArmor
// implements ISpecialArmor
{
IIcon[] icons;
String[] iconNames = { "wood_boots" };
//static Minecraft mc = Minecraft.getMinecraft();
//private ModelBiped modelArmor;
// static Minecraft mc = Minecraft.getMinecraft();
// private ModelBiped modelArmor;
public TArmorBase(int armorSlot)
{
@@ -30,8 +30,8 @@ public class TArmorBase extends ItemArmor
setNoRepair();
canRepair = false;
this.setCreativeTab(CreativeTabs.tabMisc);
//this.modelArmor = new ModelBiped(0.75F);
//this.setCreativeTab(TConstructRegistry.toolTab);
// this.modelArmor = new ModelBiped(0.75F);
// this.setCreativeTab(TConstructRegistry.toolTab);
}
public void onArmorTickUpdate (World world, EntityPlayer player, ItemStack itemStack)
@@ -40,16 +40,21 @@ public class TArmorBase extends ItemArmor
}
/**
* Called by RenderBiped and RenderPlayer to determine the armor texture that
* should be use for the currently equiped item.
* This will only be called on instances of ItemArmor.
* Called by RenderBiped and RenderPlayer to determine the armor texture
* that should be use for the currently equiped item. This will only be
* called on instances of ItemArmor.
*
* Returning null from this function will use the default value.
*
* @param stack ItemStack for the equpt armor
* @param entity The entity wearing the armor
* @param slot The slot the armor is in
* @param layer The render layer, either 1 or 2, 2 is only used for CLOTH armor by default
* @param stack
* ItemStack for the equpt armor
* @param entity
* The entity wearing the armor
* @param slot
* The slot the armor is in
* @param layer
* The render layer, either 1 or 2, 2 is only used for CLOTH
* armor by default
* @return Path of texture to bind, or null to use default
*/
@Override
@@ -62,11 +67,14 @@ public class TArmorBase extends ItemArmor
/**
* Override this method to have an item handle its own armor rendering.
*
* @param entityLiving The entity wearing the armor
* @param itemStack The itemStack to render the model of
* @param armorSlot 0=head, 1=torso, 2=legs, 3=feet
* @param entityLiving
* The entity wearing the armor
* @param itemStack
* The itemStack to render the model of
* @param armorSlot
* 0=head, 1=torso, 2=legs, 3=feet
*
* @return A ModelBiped to render instead of the default
* @return A ModelBiped to render instead of the default
*/
@Override
@SideOnly(Side.CLIENT)
@@ -100,24 +108,18 @@ public class TArmorBase extends ItemArmor
}
}
/*@Override
public ArmorProperties getProperties (EntityLiving player, ItemStack armor, DamageSource source, double damage, int slot)
{
// TODO Auto-generated method stub
return null;
}
@Override
public int getArmorDisplay (EntityPlayer player, ItemStack armor, int slot)
{
// TODO Auto-generated method stub
return 0;
}
@Override
public void damageArmor (EntityLiving entity, ItemStack stack, DamageSource source, int damage, int slot)
{
// TODO Auto-generated method stub
}*/
/*
* @Override public ArmorProperties getProperties (EntityLiving player,
* ItemStack armor, DamageSource source, double damage, int slot) { // TODO
* Auto-generated method stub return null; }
*
* @Override public int getArmorDisplay (EntityPlayer player, ItemStack
* armor, int slot) { // TODO Auto-generated method stub return 0; }
*
* @Override public void damageArmor (EntityLiving entity, ItemStack stack,
* DamageSource source, int damage, int slot) { // TODO Auto-generated
* method stub
*
* }
*/
}
@@ -86,7 +86,7 @@ public class BarricadeItem extends ItemBlock
else if (world.canPlaceEntityOnSide(this.b, x, y, z, false, side, player, stack))
{
Block block = this.b;
//int meta = this.getMetadata(stack.getItemDamage());
// int meta = this.getMetadata(stack.getItemDamage());
int rotation = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
int meta = rotation * 4;
int metadata = this.b.onBlockPlaced(world, x, y, z, side, hitX, hitY, hitZ, meta);
@@ -10,7 +10,8 @@ import net.minecraft.nbt.NBTTagCompound;
public class GlassBlockItem extends MultiItemBlock
{
public static final String blockTypes[] = { "pure" };//, "soul", "soul.pure" };
public static final String blockTypes[] = { "pure" };// , "soul",
// "soul.pure" };
public GlassBlockItem(Block b)
{
@@ -52,12 +52,14 @@ public class HamboneItemBlock extends ItemBlock
private final boolean isWolfsFavoriteMeat;
/**
* If this field is true, the food can be consumed even if the player don't need to eat.
* If this field is true, the food can be consumed even if the player don't
* need to eat.
*/
private boolean alwaysEdible;
/**
* represents the potion effect that will occurr upon eating this food. Set by setPotionEffect
* represents the potion effect that will occurr upon eating this food. Set
* by setPotionEffect
*/
private int potionId;
@@ -70,20 +72,15 @@ public class HamboneItemBlock extends ItemBlock
/** probably of the set potion effect occurring */
private float potionEffectProbability;
/*public ItemFood(int par1, int par2, float par3, boolean par4)
{
super(par1);
this.itemUseDuration = 32;
this.healAmount = par2;
this.isWolfsFavoriteMeat = par4;
this.saturationModifier = par3;
this.setCreativeTab(CreativeTabs.tabFood);
}
public ItemFood(int par1, int par2, boolean par3)
{
this(par1, par2, 0.6F, par3);
}*/
/*
* public ItemFood(int par1, int par2, float par3, boolean par4) {
* super(par1); this.itemUseDuration = 32; this.healAmount = par2;
* this.isWolfsFavoriteMeat = par4; this.saturationModifier = par3;
* this.setCreativeTab(CreativeTabs.tabFood); }
*
* public ItemFood(int par1, int par2, boolean par3) { this(par1, par2,
* 0.6F, par3); }
*/
public ItemStack onEaten (ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
@@ -111,7 +108,8 @@ public class HamboneItemBlock extends ItemBlock
}
/**
* 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)
{
@@ -119,7 +117,8 @@ public class HamboneItemBlock extends ItemBlock
}
/**
* 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 par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
@@ -15,7 +15,7 @@ import tconstruct.common.TRepo;
/**
*
* @author fuj1n
*
*
*/
public class ItemBlockLandmine extends ItemBlock
{
@@ -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; }
*/
}