Skip to content

Commit

Permalink
port in everything from 1.6 but labotimizetools(will do that later th…
Browse files Browse the repository at this point in the history
…is weekend)
  • Loading branch information
progwml6 committed Mar 15, 2014
1 parent aa8d70d commit 5bf1470
Show file tree
Hide file tree
Showing 18 changed files with 224 additions and 131 deletions.
28 changes: 20 additions & 8 deletions resources/assets/tinker/lang/en_US.lang
Expand Up @@ -479,7 +479,7 @@ LiquidMetal.Steel.name=Molten Steel
LiquidMetal.Glass.name=Molten Glass
LiquidMetal.Stone.name=Seared Stone
LiquidMetal.Villager.name=Liquified Emerald
LiquidMetal.Cow.name=Blood
LiquidMetal.Cow.name=Blo
LiquidMetal.Nickel.name=Molten Nickel
LiquidMetal.Silver.name=Molten Silver
LiquidMetal.Lead.name=Molten Lead
Expand All @@ -491,9 +491,14 @@ LiquidMetal.Ender.name=Liquified Ender
item.food.apple.diamond.name=Jeweled Apple
item.tconstruct.strangefood.edibleslime.name=Gelatinous Slime
item.tconstruct.strangefood.edibleblood.name=Coagulated Blood
item.tconstruct.strangefood.bacon.name=Bacon
item.tconstruct.canister.empty.name=Empty Canister
item.tconstruct.canister.miniheart.red.name=Miniature Red Heart
item.tconstruct.canister.heart.name=Heart Canister
item.tconstruct.canister.red.name=Red Heart Canister
item.tconstruct.canister.miniheart.yellow.name=Miniature Yellow Heart
item.tconstruct.canister.yellow.name=Yellow Heart Canister
item.tconstruct.canister.miniheart.green.name=Miniature Green Heart
item.tconstruct.canister.green.name=Green Heart Canister
item.tconstruct.glove.name=Dirtmover Gloves

SearedBlock.Table.name=Casting Table
Expand Down Expand Up @@ -623,8 +628,9 @@ strangefood3.tooltip=It seems edible, but somehow
strangefood4.tooltip=it's just not appealing.
strangefood5.tooltip=Stretchy food!
strangefood6.tooltip=One vampiric appetizer
strangefood7.tooltip=The mysteriously appearing snack
hambone1.tooltip=Hambone!
hambone2.tooltip=Usable for Beacon bases
hambone2.tooltip=Usable for Bacon bases
metalblock.tooltip=Usable for Beacon bases
craftedsoil1.tooltip=Heals Undead
craftedsoil2.tooltip=Harmful to Undead
Expand Down Expand Up @@ -655,11 +661,15 @@ oreberries3.tooltip=Tastes like metal
oreberries4.tooltip=Tin Man
oreberries5.tooltip=White Chocolate
oreberries6.tooltip=Tastes like Creeper
hearthcanister1.tooltip=Crafting Item
hearthcanister2.tooltip=Crafting Item
hearthcanister3.tooltip=Part of low-level Heart Canisters
hearthcanister4.tooltip=Accessory
hearthcanister5.tooltip=Permanent health increase
item.crafting.tooltip=Crafting Item
item.accessory.tooltip=Accessory
canister.tooltip=Permanent health increase
canister.red.tooltip1=Part of low-level Heart Canisters
canister.red.tooltip2=Can be eaten to restore 10 hearts
canister.yellow.tooltip1=Part of mid-level Heart Canisters
canister.yellow.tooltip2=Can be eaten to restore 20 hearts
canister.green.tooltip1=Part of high-level Heart Canisters
canister.green.tooltip2=Can be eaten to restore 30 hearts
landmine1.tooltip=everything
landmine2.tooltip=mobs, players and redstone
landmine3.tooltip=players and redstone
Expand Down Expand Up @@ -723,3 +733,5 @@ gui.toolstation15=Mining Level:
gui.toolstation16=Usage Speed:
gui.toolstation17=Modifiers
gui.toolstation18=Modifiers remaining:

attribute.generic.ammo.attackDamage=Average Shot Damage
5 changes: 4 additions & 1 deletion resources/assets/tinker/manuals/materials.xml
Expand Up @@ -11,6 +11,7 @@ By Skyla</text>

<page type="contents">
<text>Table of Contents</text>
<text>Table of Contents</text>
<link>
<text>Tools</text>
<icon>ironpick</icon>
Expand Down Expand Up @@ -484,7 +485,8 @@ Class: Ranged Projectile Launcher</text>
- Reinforced: 10% chance per level of not using durability
- Stonebound: The tool mines faster as it wears out, but does less damage
- Jagged: The tool attacks with does more damage as it wears out, but mines slower
- Writable: One extra modifier per piece</text>
- Writable: One extra modifier per piece
- Tasty: Sometimes drops food items</text>
</page>

<page type="materialstats">
Expand Down Expand Up @@ -874,6 +876,7 @@ Stackable: Yes</text>

Effects:
- Allows blocks to be harvested directly
- Scythes modified with Silky act as shears on blocks
- Not compatible with Luck or Auto-Smelt

Type: Single-use
Expand Down
Binary file modified resources/assets/tinker/textures/gui/armorextended.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/main/java/tconstruct/client/gui/ToolStationGui.java
Expand Up @@ -214,7 +214,7 @@ void drawModularToolStats (ItemStack stack, ToolCore tool, NBTTagCompound tags)
// Attack
if (categories.contains("weapon"))
{
int attack = (int) (tags.getInteger("Attack"));
int attack = (int) (tags.getInteger("Attack")) + 1;
float stoneboundDamage = (float) Math.log(durability / 72f + 1) * -2 * stonebound;
attack += stoneboundDamage;
attack *= tool.getDamageModifier();
Expand Down Expand Up @@ -295,7 +295,7 @@ void drawModularToolStats (ItemStack stack, ToolCore tool, NBTTagCompound tags)
{
float mineSpeed = tags.getInteger("MiningSpeed") / 100f;
float mineSpeed2 = tags.getInteger("MiningSpeed2") / 100f;
float stoneboundSpeed = (float) Math.log(durability / 90f + 1) * 2 * stonebound;
float stoneboundSpeed = (float) Math.log(durability / 72f + 1) * 2 * stonebound;
DecimalFormat df = new DecimalFormat("##.##");
df.setRoundingMode(RoundingMode.DOWN);
float trueSpeed = mineSpeed + stoneboundSpeed;
Expand Down Expand Up @@ -344,7 +344,7 @@ else if (categories.contains("harvest"))

float trueSpeed = mineSpeed / (heads * 100f);

float stoneboundSpeed = (float) Math.log(durability / 90f + 1) * 2 * stonebound;
float stoneboundSpeed = (float) Math.log(durability / 72f + 1) * 2 * stonebound;
DecimalFormat df = new DecimalFormat("##.##");
df.setRoundingMode(RoundingMode.DOWN);
trueSpeed += stoneboundSpeed;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/common/TRecipes.java
Expand Up @@ -1284,7 +1284,7 @@ protected static void addRecipesForSmeltery ()
TConstruct.ingotLiquidValue), new FluidStack(TRepo.moltenArditeFluid, TConstruct.ingotLiquidValue)); // Manyullyn
Smeltery.addAlloyMixing(new FluidStack(TRepo.pigIronFluid, (int) (TConstruct.ingotLiquidValue * PHConstruct.ingotsPigironAlloy)), new FluidStack(TRepo.moltenIronFluid,
TConstruct.ingotLiquidValue), new FluidStack(TRepo.moltenEmeraldFluid, 640), new FluidStack(TRepo.bloodFluid, 80)); // Pigiron

Smeltery.addAlloyMixing(new FluidStack(TRepo.moltenObsidianFluid, TConstruct.oreLiquidValue), new FluidStack(FluidRegistry.LAVA, 1000), new FluidStack(FluidRegistry.WATER, 1000)); //Obsidian
// Stone parts
for (int sc = 0; sc < TRepo.patternOutputs.length; sc++)
{
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/tconstruct/items/StrangeFood.java
Expand Up @@ -15,7 +15,7 @@ public class StrangeFood extends SpecialFood
{
public StrangeFood()
{
super(new int[] { 2, 2 }, new float[] { 1f, 1f }, new String[] { "edibleslime", "edibleblood" }, new String[] { "food/edibleslime", "food/edibleblood" });
super(new int[] { 2, 2 }, new float[] { 1f, 1f }, new String[] { "edibleslime", "edibleblood", "bacon" }, new String[] { "food/edibleslime", "food/edibleblood", "food/bacon" });
}

@Override
Expand All @@ -40,6 +40,9 @@ public void addInformation (ItemStack stack, EntityPlayer player, List list, boo
list.add("\u00a74\u00a7o" + StatCollector.translateToLocal("strangefood3.tooltip"));
list.add("\u00a74\u00a7o" + StatCollector.translateToLocal("strangefood4.tooltip"));
break;
case 2:
list.add("\u00a7c" + StatCollector.translateToLocal("strangefood7.tooltip"));
break;
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/items/armor/HeartCanister.java
Expand Up @@ -62,7 +62,7 @@ public ItemStack onEaten (ItemStack stack, World world, EntityPlayer player)
{
int meta = stack.getItemDamage();
--stack.stackSize;
player.heal((meta + 1) * 5);
player.heal((meta + 1) * 10);
world.playSoundAtEntity(player, "random.burp", 0.5F, world.rand.nextFloat() * 0.1F + 0.9F);
return stack;
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/tconstruct/items/tools/Arrow.java
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import tconstruct.TConstruct;
import tconstruct.common.TRepo;
Expand Down Expand Up @@ -234,6 +235,9 @@ else if (power > this.getMaxEnergyStored(stack) * 2 / 3)
}
}
}
int attack = (int) (tags.getCompoundTag("InfiTool").getInteger("Attack") * this.getDamageModifier());
list.add("\u00A79+" + attack + " " + StatCollector.translateToLocalFormatted("attribute.name.generic.attackDamage"));
list.add("\u00A79+" + tags.getCompoundTag("InfiTool").getInteger("Attack") + " " + StatCollector.translateToLocalFormatted("attribute.name.ammo.attackDamage"));
}

}
6 changes: 0 additions & 6 deletions src/main/java/tconstruct/items/tools/BowBase.java
Expand Up @@ -232,12 +232,6 @@ public ItemStack onItemRightClick (ItemStack stack, World par2World, EntityPlaye
return stack;
}

@Override
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ)
{
return false;
}

@SideOnly(Side.CLIENT)
@Override
public boolean requiresMultipleRenderPasses ()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/items/tools/Cleaver.java
Expand Up @@ -18,7 +18,7 @@ public class Cleaver extends Weapon
{
public Cleaver()
{
super(6);
super(5);
this.setUnlocalizedName("InfiTool.Cleaver");
}

Expand Down
67 changes: 54 additions & 13 deletions src/main/java/tconstruct/items/tools/Scythe.java
@@ -1,17 +1,24 @@
package tconstruct.items.tools;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import mantle.world.WorldHelper;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.stats.StatList;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import net.minecraftforge.common.IShearable;
import tconstruct.common.TRepo;
import tconstruct.library.ActiveToolMod;
import tconstruct.library.TConstructRegistry;
Expand All @@ -38,10 +45,9 @@ protected Material[] getEffectiveMaterials ()
return materials;
}

static Material[] materials = new Material[] { Material.web, Material.cactus, Material.plants
, Material.leaves, Material.vine };// TODO find this//, Material.pumpkin,
// Material.plants, Material.vine,
// Material.leaves };
static Material[] materials = new Material[] { Material.web, Material.cactus, Material.plants, Material.leaves, Material.vine };// TODO find this//, Material.pumpkin,
// Material.plants, Material.vine,
// Material.leaves };

@Override
public Item getHeadItem ()
Expand Down Expand Up @@ -162,6 +168,7 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl
if (!stack.hasTagCompound())
return false;
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
boolean butter = EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, stack) > 0;
for (int xPos = x - 1; xPos <= x + 1; xPos++)
{
for (int yPos = y - 1; yPos <= y + 1; yPos++)
Expand All @@ -179,21 +186,55 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl

if (!cancelHarvest)
{
Block block = world.getBlock(xPos, yPos, zPos);
if ((block != null))
Block localBlock = world.getBlock(xPos, yPos, zPos);
int localMeta = world.getBlockMetadata(xPos, yPos, zPos);
float localHardness = localBlock == null ? Float.MAX_VALUE : localBlock.getBlockHardness(world, xPos, yPos, zPos);
if (localBlock != null)// && (block.blockMaterial == Material.leaves || block.isLeaves(world, xPos, yPos, zPos)))
{
for (int iter = 0; iter < materials.length; iter++)
{
if (materials[iter] == block.getMaterial())
if (materials[iter] == localBlock.getMaterial())
{
int localMeta = world.getBlockMetadata(xPos, yPos, zPos);
WorldHelper.setBlockToAir(world, xPos, yPos, zPos);
if (!player.capabilities.isCreativeMode)
{
block.onBlockDestroyedByPlayer(world, x, y, z, meta);
block.harvestBlock(world, player, xPos, yPos, zPos, localMeta);
block.onBlockHarvested(world, x, y, z, localMeta, player);
onBlockDestroyed(stack, world, blockB, xPos, yPos, zPos, player);
if (butter && localBlock instanceof IShearable && ((IShearable) localBlock).isShearable(stack, player.worldObj, x, y, z))
{
ArrayList<ItemStack> drops = ((IShearable) localBlock).onSheared(stack, player.worldObj, x, y, z,
EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
Random rand = new Random();

if (!world.isRemote)
for (ItemStack dropStack : drops)
{
float f = 0.7F;
double d = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
double d1 = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
double d2 = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
EntityItem entityitem = new EntityItem(player.worldObj, (double) xPos + d, (double) yPos + d1, (double) zPos + d2, dropStack);
entityitem.delayBeforeCanPickup = 10;
player.worldObj.spawnEntityInWorld(entityitem);
}

if (localHardness > 0f)
onBlockDestroyed(stack, world, localBlock, xPos, yPos, zPos, player);
player.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(localBlock)], 1);
world.setBlockToAir(xPos, yPos, zPos);
}
else
{
if (localBlock.removedByPlayer(world, player, xPos, yPos, zPos))
{
localBlock.onBlockDestroyedByPlayer(world, xPos, yPos, zPos, localMeta);
}
localBlock.harvestBlock(world, player, xPos, yPos, zPos, localMeta);
localBlock.onBlockHarvested(world, xPos, yPos, zPos, localMeta, player);
if (localHardness > 0f)
onBlockDestroyed(stack, world, localBlock, xPos, yPos, zPos, player);
}
}
else
{
world.setBlockToAir(xPos, yPos, zPos);
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/tconstruct/items/tools/Shortbow.java
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import tconstruct.common.TRepo;
import cpw.mods.fml.relauncher.Side;
Expand Down Expand Up @@ -175,6 +176,9 @@ else if (power > this.getMaxEnergyStored(stack) * 2 / 3)
}
}
}
list.add("");
list.add("\u00A79+" + tags.getCompoundTag("InfiTool").getInteger("Attack") + " " + StatCollector.translateToLocalFormatted("attribute.name.generic.attackDamage"));

}

public String getBowstringName (int type)
Expand Down
33 changes: 19 additions & 14 deletions src/main/java/tconstruct/library/tools/AbilityHelper.java
Expand Up @@ -523,22 +523,26 @@ public static boolean hoeGround (ItemStack stack, EntityPlayer player, World wor
}
}

public static void spawnItemAtEntity (Entity entity, ItemStack stack, int delay)
{
if (!entity.worldObj.isRemote)
{
EntityItem entityitem = new EntityItem(entity.worldObj, entity.posX + 0.5D, entity.posY + 0.5D, entity.posZ + 0.5D, stack);
entityitem.delayBeforeCanPickup = delay;
entity.worldObj.spawnEntityInWorld(entityitem);
}
}

public static void spawnItemAtPlayer (EntityPlayer player, ItemStack stack)
{
EntityItem entityitem = new EntityItem(player.worldObj, player.posX + 0.5D, player.posY + 0.5D, player.posZ + 0.5D, stack);
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.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);
if (!(player instanceof FakePlayer))
entityitem.onCollideWithPlayer(player);
}

}

/* Ranged weapons */
Expand Down Expand Up @@ -632,4 +636,5 @@ public static MovingObjectPosition raytraceFromEntity (World world, Entity playe
Vec3 vec31 = vec3.addVector((double) f7 * d3, (double) f6 * d3, (double) f8 * d3);
return world.func_147447_a(vec3, vec31, par3, !par3, par3);
}

}

0 comments on commit 5bf1470

Please sign in to comment.