mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-13 17:04:24 +00:00
Buff redstone mod, refactor broad tools to match
Cherry-picked from 34a4c8c80f969cafd696b41d963c2a041347d4cd Conflicts: src/main/java/tconstruct/common/TProxyCommon.java src/main/java/tconstruct/items/tools/Excavator.java src/main/java/tconstruct/items/tools/Hammer.java src/main/java/tconstruct/items/tools/LumberAxe.java src/main/java/tconstruct/library/tools/HarvestTool.java src/main/java/tconstruct/modifiers/tools/ModLapis.java src/main/java/tconstruct/modifiers/tools/ModRedstone.java src/main/java/tconstruct/tools/gui/ToolStationGui.java
This commit is contained in:
1 parent
ae31c05f45
commit
5b56d5e392
8 files changed
+47
-168
No files matched your search
@@ -344,75 +344,17 @@ public class Hammer extends HarvestTool
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDigSpeed (ItemStack stack, Block block, int meta)
|
||||
public float breakSpeedModifier ()
|
||||
{
|
||||
if (!stack.hasTagCompound())
|
||||
return 1.0f;
|
||||
|
||||
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
|
||||
if (tags.getBoolean("Broken"))
|
||||
return 0.1f;
|
||||
|
||||
Material[] materials = getEffectiveMaterials();
|
||||
for (int i = 0; i < materials.length; i++)
|
||||
{
|
||||
if (materials[i] == block.getMaterial())
|
||||
{
|
||||
return getblockSpeed(tags, block, meta);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* if (block == Block.silverfish) return getblockSpeed(tags, block,
|
||||
* meta);
|
||||
*/
|
||||
|
||||
return super.getDigSpeed(stack, block, meta);
|
||||
return 0.4f;
|
||||
}
|
||||
|
||||
float getblockSpeed (NBTTagCompound tags, Block block, int meta)
|
||||
@Override
|
||||
public float stoneboundModifier ()
|
||||
{
|
||||
float mineSpeed = tags.getInteger("MiningSpeed");
|
||||
int heads = 1;
|
||||
if (tags.hasKey("MiningSpeed2"))
|
||||
{
|
||||
mineSpeed += tags.getInteger("MiningSpeed2");
|
||||
heads++;
|
||||
}
|
||||
if (tags.hasKey("MiningSpeedHandle"))
|
||||
{
|
||||
mineSpeed += tags.getInteger("MiningSpeedHandle");
|
||||
heads++;
|
||||
}
|
||||
|
||||
if (tags.hasKey("MiningSpeedExtra"))
|
||||
{
|
||||
mineSpeed += tags.getInteger("MiningSpeedExtra");
|
||||
heads++;
|
||||
}
|
||||
float trueSpeed = mineSpeed / (heads * 300f);
|
||||
int hlvl = block.getHarvestLevel(meta);
|
||||
int durability = tags.getInteger("Damage");
|
||||
|
||||
float stonebound = tags.getFloat("Shoddy");
|
||||
float bonusLog = (float) Math.log(durability / 216f + 1) * 2 * stonebound;
|
||||
trueSpeed += bonusLog;
|
||||
|
||||
if (hlvl <= tags.getInteger("HarvestLevel"))
|
||||
return trueSpeed;
|
||||
return 0.1f;
|
||||
return 216f;
|
||||
}
|
||||
|
||||
/*
|
||||
* @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[] getTraits ()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user