mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-26 23:13:07 +00:00
Upload my Code Changes/Format/imports
This commit is contained in:
1 parent
5bcdb7ca46
commit
5d4e38c0cb
264 files changed
+4014
-3972
No files matched your search
@@ -200,7 +200,7 @@ public class AbilityHelper
|
||||
{
|
||||
damageTool(stack, 1, tags, player, false);
|
||||
}
|
||||
//damageTool(stack, 1, player, false);
|
||||
// damageTool(stack, 1, player, false);
|
||||
tool.onEntityDamaged(player.worldObj, player, entity);
|
||||
if (!necroticUHS || (entity instanceof IMob && entity instanceof EntityLivingBase && ((EntityLivingBase) entity).getHealth() <= 0))
|
||||
{
|
||||
@@ -240,7 +240,9 @@ public class AbilityHelper
|
||||
|
||||
if (entity instanceof EntityLivingBase)
|
||||
{
|
||||
DamageSource.causeThornsDamage(entity);//(((EntityLivingBase)player, (EntityLivingBase) entity);
|
||||
DamageSource.causeThornsDamage(entity);// (((EntityLivingBase)player,
|
||||
// (EntityLivingBase)
|
||||
// entity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -469,7 +471,7 @@ public class AbilityHelper
|
||||
public static void knockbackEntity (EntityLivingBase living, double boost)
|
||||
{
|
||||
living.motionX *= boost;
|
||||
//living.motionY *= boost/2;
|
||||
// living.motionY *= boost/2;
|
||||
living.motionZ *= boost;
|
||||
}
|
||||
|
||||
@@ -527,19 +529,16 @@ public class AbilityHelper
|
||||
player.worldObj.spawnEntityInWorld(entityitem);
|
||||
if (!(player instanceof FakePlayer))
|
||||
entityitem.onCollideWithPlayer(player);
|
||||
/*if (!player.inventory.addItemStackToInventory(stack))
|
||||
{
|
||||
if (!player.worldObj.isRemote)
|
||||
{
|
||||
EntityItem entityitem = new EntityItem(player.worldObj, player.posX + 0.5D, player.posY + 0.5D, player.posZ + 0.5D, stack);
|
||||
player.worldObj.spawnEntityInWorld(entityitem);
|
||||
entityitem.onCollideWithPlayer(player);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.worldObj.playSoundAtEntity(player, "random.pop", 0.2F, ((random.nextFloat() - random.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||
}*/
|
||||
/*
|
||||
* if (!player.inventory.addItemStackToInventory(stack)) { if
|
||||
* (!player.worldObj.isRemote) { EntityItem entityitem = new
|
||||
* EntityItem(player.worldObj, player.posX + 0.5D, player.posY + 0.5D,
|
||||
* player.posZ + 0.5D, stack);
|
||||
* player.worldObj.spawnEntityInWorld(entityitem);
|
||||
* entityitem.onCollideWithPlayer(player); } } else {
|
||||
* player.worldObj.playSoundAtEntity(player, "random.pop", 0.2F,
|
||||
* ((random.nextFloat() - random.nextFloat()) * 0.7F + 1.0F) * 2.0F); }
|
||||
*/
|
||||
}
|
||||
|
||||
/* Ranged weapons */
|
||||
|
||||
@@ -17,10 +17,10 @@ public abstract class CustomMaterial
|
||||
this.craftingItem = craftingItem;
|
||||
}
|
||||
|
||||
/*public boolean matches(ItemStack input, ItemStack pattern)
|
||||
{
|
||||
if (ItemStack.areItemStacksEqual(this.input, input) && ItemStack.areItemStacksEqual(this.craftingPattern, pattern))
|
||||
return true;
|
||||
return false;
|
||||
}*/
|
||||
/*
|
||||
* public boolean matches(ItemStack input, ItemStack pattern) { if
|
||||
* (ItemStack.areItemStacksEqual(this.input, input) &&
|
||||
* ItemStack.areItemStacksEqual(this.craftingPattern, pattern)) return true;
|
||||
* return false; }
|
||||
*/
|
||||
}
|
||||
@@ -30,7 +30,7 @@ public abstract class HarvestTool extends ToolCore
|
||||
World world = player.worldObj;
|
||||
Block block = player.worldObj.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
//Block block = Block.blocksList[bID];
|
||||
// Block block = Block.blocksList[bID];
|
||||
if (block == null || block == Blocks.air)
|
||||
return false;
|
||||
int hlvl = -1;
|
||||
@@ -130,7 +130,9 @@ public abstract class HarvestTool extends ToolCore
|
||||
}
|
||||
if (block.getHarvestLevel(meta) > 0)
|
||||
{
|
||||
return calculateStrength(tags, block, meta); //No issue if the harvest level is too low
|
||||
return calculateStrength(tags, block, meta); // No issue if the
|
||||
// harvest level is
|
||||
// too low
|
||||
}
|
||||
return super.getDigSpeed(stack, block, meta);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ package tconstruct.library.tools;
|
||||
*/
|
||||
public class TToolMaterial
|
||||
{
|
||||
//mining level, durability, mining speed, baseDamage, handle modifier, Reinforced level, shoddy/spiny level, color/style on name
|
||||
// mining level, durability, mining speed, baseDamage, handle modifier,
|
||||
// Reinforced level, shoddy/spiny level, color/style on name
|
||||
|
||||
public final String materialName;
|
||||
public final String displayName;
|
||||
|
||||
@@ -30,35 +30,33 @@ import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/** NBTTags
|
||||
* Main tag - InfiTool
|
||||
/**
|
||||
* NBTTags Main tag - InfiTool
|
||||
*
|
||||
* @see ToolBuilder
|
||||
*
|
||||
* Required:
|
||||
* Head: Base and render tag, above the handle
|
||||
* Handle: Base and render tag, bottom layer
|
||||
* Required: Head: Base and render tag, above the handle Handle: Base and
|
||||
* render tag, bottom layer
|
||||
*
|
||||
* Damage: Replacement for metadata
|
||||
* MaxDamage: ItemStacks only read setMaxDamage()
|
||||
* Broken: Represents whether the tool is broken (boolean)
|
||||
* Attack: How much damage a mob will take
|
||||
* MiningSpeed: The speed at which a tool mines
|
||||
* Damage: Replacement for metadata MaxDamage: ItemStacks only read
|
||||
* setMaxDamage() Broken: Represents whether the tool is broken (boolean)
|
||||
* Attack: How much damage a mob will take MiningSpeed: The speed at which
|
||||
* a tool mines
|
||||
*
|
||||
* Others:
|
||||
* Accessory: Base and tag, above head. Sword guards, binding, etc
|
||||
* Effects: Render tag, top layer. Fancy effects like moss or diamond edge.
|
||||
* Render order: Handle > Head > Accessory > Effect1 > Effect2 > Effect3 > etc
|
||||
* Unbreaking: Reinforced in-game, 10% chance to not use durability per level
|
||||
* Stonebound: Mines faster as the tool takes damage, but has less attack
|
||||
* Spiny: Opposite of stonebound
|
||||
* Others: Accessory: Base and tag, above head. Sword guards, binding, etc
|
||||
* Effects: Render tag, top layer. Fancy effects like moss or diamond edge.
|
||||
* Render order: Handle > Head > Accessory > Effect1 > Effect2 > Effect3 >
|
||||
* etc Unbreaking: Reinforced in-game, 10% chance to not use durability per
|
||||
* level Stonebound: Mines faster as the tool takes damage, but has less
|
||||
* attack Spiny: Opposite of stonebound
|
||||
*
|
||||
* Modifiers have their own tags.
|
||||
* Modifiers have their own tags.
|
||||
* @see ToolMod
|
||||
*/
|
||||
|
||||
public abstract class ToolCore extends Item implements IEnergyContainerItem, IBattlegearWeapon
|
||||
{
|
||||
//TE power constants -- TODO grab these from the items added
|
||||
// TE power constants -- TODO grab these from the items added
|
||||
protected int capacity = 400000;
|
||||
protected int maxReceive = 75;
|
||||
protected int maxExtract = 75;
|
||||
@@ -81,10 +79,10 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
canRepair = false;
|
||||
}
|
||||
|
||||
/** Determines crafting behavior with regards to durability
|
||||
* 0: None
|
||||
* 1: Adds handle modifier
|
||||
* 2: Averages part with the rest of the tool (head)
|
||||
/**
|
||||
* Determines crafting behavior with regards to durability 0: None 1: Adds
|
||||
* handle modifier 2: Averages part with the rest of the tool (head)
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
|
||||
@@ -122,7 +120,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
public HashMap<Integer, IIcon> effectIcons = new HashMap<Integer, IIcon>();
|
||||
public HashMap<Integer, IIcon> extraIcons = new HashMap<Integer, IIcon>();
|
||||
|
||||
//Not liking this
|
||||
// Not liking this
|
||||
public HashMap<Integer, String> headStrings = new HashMap<Integer, String>();
|
||||
public HashMap<Integer, String> brokenPartStrings = new HashMap<Integer, String>();
|
||||
public HashMap<Integer, String> handleStrings = new HashMap<Integer, String>();
|
||||
@@ -150,7 +148,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
return false;
|
||||
}
|
||||
|
||||
//Override me please!
|
||||
// Override me please!
|
||||
public int getPartAmount ()
|
||||
{
|
||||
return 3;
|
||||
@@ -513,7 +511,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
return ret;
|
||||
}
|
||||
|
||||
//Used for sounds and the like
|
||||
// Used for sounds and the like
|
||||
public void onEntityDamaged (World world, EntityLivingBase player, Entity entity)
|
||||
{
|
||||
|
||||
@@ -546,7 +544,11 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
boolean supress = false;
|
||||
try
|
||||
{
|
||||
clazz = Class.forName("tconstruct.common.TRepo"); //TODO: Make sure this is still working in 1.7.
|
||||
clazz = Class.forName("tconstruct.common.TRepo"); // TODO: Make
|
||||
// sure this
|
||||
// is still
|
||||
// working
|
||||
// in 1.7.
|
||||
fld = clazz.getField("supressMissingToolLogs");
|
||||
supress = fld.getBoolean(fld);
|
||||
}
|
||||
@@ -579,7 +581,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
|
||||
public Item getHandleItem ()
|
||||
{
|
||||
return TConstructRegistry.getItem("toolRod");//TContent.toolRod;
|
||||
return TConstructRegistry.getItem("toolRod");// TContent.toolRod;
|
||||
}
|
||||
|
||||
/* Updating */
|
||||
@@ -595,10 +597,10 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
|
||||
/* Tool uses */
|
||||
|
||||
//Types
|
||||
// Types
|
||||
public abstract String[] toolCategories ();
|
||||
|
||||
//Mining
|
||||
// Mining
|
||||
@Override
|
||||
public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player)
|
||||
{
|
||||
@@ -660,7 +662,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
return this.damageVsEntity;
|
||||
}
|
||||
|
||||
//Changes how much durability the base tool has
|
||||
// Changes how much durability the base tool has
|
||||
public float getDurabilityModifier ()
|
||||
{
|
||||
return 1f;
|
||||
@@ -676,11 +678,12 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
//Right-click
|
||||
// Right-click
|
||||
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ)
|
||||
{
|
||||
/*if (world.isRemote)
|
||||
return true;*/
|
||||
/*
|
||||
* if (world.isRemote) return true;
|
||||
*/
|
||||
|
||||
boolean used = false;
|
||||
int hotbarSlot = player.inventory.currentItem;
|
||||
@@ -745,11 +748,13 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
}
|
||||
}
|
||||
|
||||
/*if (used) //Update client
|
||||
{
|
||||
Packet103SetSlot packet = new Packet103SetSlot(player.openContainer.windowId, itemSlot, nearbyStack);
|
||||
((EntityPlayerMP)player).playerNetServerHandler.sendPacketToPlayer(packet);
|
||||
}*/
|
||||
/*
|
||||
* if (used) //Update client { Packet103SetSlot packet = new
|
||||
* Packet103SetSlot(player.openContainer.windowId, itemSlot,
|
||||
* nearbyStack);
|
||||
* ((EntityPlayerMP)player).playerNetServerHandler.sendPacketToPlayer
|
||||
* (packet); }
|
||||
*/
|
||||
return used;
|
||||
}
|
||||
|
||||
@@ -895,7 +900,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
{
|
||||
}
|
||||
|
||||
//TE support section -- from COFH core API reference section
|
||||
// TE support section -- from COFH core API reference section
|
||||
public void setMaxTransfer (int maxTransfer)
|
||||
{
|
||||
setMaxReceive(maxTransfer);
|
||||
@@ -970,5 +975,5 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
return 0;
|
||||
return capacity;
|
||||
}
|
||||
//end of TE support section
|
||||
// end of TE support section
|
||||
}
|
||||
@@ -17,7 +17,7 @@ public abstract class ToolMod
|
||||
|
||||
public ToolMod(ItemStack[] items, int effect, String dataKey)
|
||||
{
|
||||
//recipeItems = items;
|
||||
// recipeItems = items;
|
||||
List<ItemStack> itemstacks = new ArrayList<ItemStack>();
|
||||
for (int iter = 0; iter < items.length; iter++)
|
||||
itemstacks.add(items[iter]);
|
||||
@@ -26,11 +26,14 @@ public abstract class ToolMod
|
||||
key = dataKey;
|
||||
}
|
||||
|
||||
/** Checks to see if the inputs match the stored items
|
||||
* Note: Works like ShapelessRecipes
|
||||
/**
|
||||
* Checks to see if the inputs match the stored items Note: Works like
|
||||
* ShapelessRecipes
|
||||
*
|
||||
* @param input The ItemStacks to compare against
|
||||
* @param tool Item to modify, used for restrictions
|
||||
* @param input
|
||||
* The ItemStacks to compare against
|
||||
* @param tool
|
||||
* Item to modify, used for restrictions
|
||||
* @return Whether the recipe matches the input
|
||||
*/
|
||||
public boolean matches (ItemStack[] input, ItemStack tool)
|
||||
@@ -78,7 +81,8 @@ public abstract class ToolMod
|
||||
|
||||
/**
|
||||
*
|
||||
* @param tool Tool to compare against
|
||||
* @param tool
|
||||
* Tool to compare against
|
||||
* @return Whether the tool can be modified
|
||||
*/
|
||||
|
||||
@@ -88,10 +92,14 @@ public abstract class ToolMod
|
||||
return tags.getInteger("Modifiers") > 0;
|
||||
}
|
||||
|
||||
/** Modifies the tool. Adds nbttags, changes existing ones, ticks down modification counter, etc
|
||||
/**
|
||||
* Modifies the tool. Adds nbttags, changes existing ones, ticks down
|
||||
* modification counter, etc
|
||||
*
|
||||
* @param input ItemStacks to pull info from
|
||||
* @param tool The tool to modify
|
||||
* @param input
|
||||
* ItemStacks to pull info from
|
||||
* @param tool
|
||||
* The tool to modify
|
||||
*/
|
||||
public abstract void modify (ItemStack[] input, ItemStack tool);
|
||||
|
||||
|
||||
@@ -46,7 +46,8 @@ public abstract class Weapon 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)
|
||||
{
|
||||
@@ -62,7 +63,8 @@ public abstract class Weapon 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 world, EntityPlayer player)
|
||||
{
|
||||
@@ -110,12 +112,11 @@ public abstract class Weapon extends ToolCore
|
||||
}
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public boolean onLeftClickEntity (ItemStack stack, EntityPlayer player, Entity entity)
|
||||
{
|
||||
TContent.modL.midStreamModify(stack);
|
||||
return super.onLeftClickEntity(stack, player, entity);
|
||||
}*/
|
||||
/*
|
||||
* @Override public boolean onLeftClickEntity (ItemStack stack, EntityPlayer
|
||||
* player, Entity entity) { TContent.modL.midStreamModify(stack); return
|
||||
* super.onLeftClickEntity(stack, player, entity); }
|
||||
*/
|
||||
|
||||
@Override
|
||||
public String[] toolCategories ()
|
||||
|
||||
Reference in new issue
Block a user