mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 11:59:14 +00:00
port in everything from 1.6 but labotimizetools(will do that later this weekend)
This commit is contained in:
1 parent
aa8d70d4c4
commit
66a4ece284
21 files changed
+8806
-131
No files matched your search
@@ -214,7 +214,7 @@ public class ToolStationGui extends NewContainerGui
|
||||
// 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();
|
||||
@@ -295,7 +295,7 @@ public class ToolStationGui extends NewContainerGui
|
||||
{
|
||||
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;
|
||||
@@ -344,7 +344,7 @@ public class ToolStationGui extends NewContainerGui
|
||||
|
||||
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;
|
||||
|
||||
@@ -1284,7 +1284,7 @@ public class TRecipes
|
||||
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++)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
@@ -40,6 +40,9 @@ public class StrangeFood extends SpecialFood
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@ public class HeartCanister extends CraftingItem implements IHealthAccessory
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
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;
|
||||
@@ -234,6 +235,9 @@ public class Arrow extends ToolCore
|
||||
}
|
||||
}
|
||||
}
|
||||
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"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -232,12 +232,6 @@ public abstract class BowBase extends ToolCore
|
||||
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 ()
|
||||
|
||||
@@ -18,7 +18,7 @@ public class Cleaver extends Weapon
|
||||
{
|
||||
public Cleaver()
|
||||
{
|
||||
super(6);
|
||||
super(5);
|
||||
this.setUnlocalizedName("InfiTool.Cleaver");
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -38,10 +45,9 @@ public class Scythe extends Weapon
|
||||
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 ()
|
||||
@@ -162,6 +168,7 @@ public class Scythe extends Weapon
|
||||
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++)
|
||||
@@ -179,21 +186,55 @@ public class Scythe extends Weapon
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
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;
|
||||
@@ -175,6 +176,9 @@ public class Shortbow extends BowBase
|
||||
}
|
||||
}
|
||||
}
|
||||
list.add("");
|
||||
list.add("\u00A79+" + tags.getCompoundTag("InfiTool").getInteger("Attack") + " " + StatCollector.translateToLocalFormatted("attribute.name.generic.attackDamage"));
|
||||
|
||||
}
|
||||
|
||||
public String getBowstringName (int type)
|
||||
|
||||
@@ -523,22 +523,26 @@ public class AbilityHelper
|
||||
}
|
||||
}
|
||||
|
||||
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 */
|
||||
@@ -632,4 +636,5 @@ public class AbilityHelper
|
||||
Vec3 vec31 = vec3.addVector((double) f7 * d3, (double) f6 * d3, (double) f8 * d3);
|
||||
return world.func_147447_a(vec3, vec31, par3, !par3, par3);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,8 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
@@ -194,4 +196,85 @@ public abstract class HarvestTool extends ToolCore
|
||||
protected abstract Material[] getEffectiveMaterials ();
|
||||
|
||||
protected abstract String getHarvestType ();
|
||||
|
||||
//Right-click
|
||||
@Override
|
||||
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;*/
|
||||
|
||||
boolean used = false;
|
||||
int hotbarSlot = player.inventory.currentItem;
|
||||
int itemSlot = hotbarSlot == 0 ? 8 : hotbarSlot + 1;
|
||||
ItemStack nearbyStack = null;
|
||||
|
||||
if (hotbarSlot < 8)
|
||||
{
|
||||
nearbyStack = player.inventory.getStackInSlot(itemSlot);
|
||||
if (nearbyStack != null)
|
||||
{
|
||||
Item item = nearbyStack.getItem();
|
||||
if (item instanceof ItemBlock)
|
||||
{
|
||||
int posX = x;
|
||||
int posY = y;
|
||||
int posZ = z;
|
||||
int playerPosX = (int) Math.floor(player.posX);
|
||||
int playerPosY = (int) Math.floor(player.posY);
|
||||
int playerPosZ = (int) Math.floor(player.posZ);
|
||||
if (side == 0)
|
||||
{
|
||||
--posY;
|
||||
}
|
||||
|
||||
if (side == 1)
|
||||
{
|
||||
++posY;
|
||||
}
|
||||
|
||||
if (side == 2)
|
||||
{
|
||||
--posZ;
|
||||
}
|
||||
|
||||
if (side == 3)
|
||||
{
|
||||
++posZ;
|
||||
}
|
||||
|
||||
if (side == 4)
|
||||
{
|
||||
--posX;
|
||||
}
|
||||
|
||||
if (side == 5)
|
||||
{
|
||||
++posX;
|
||||
}
|
||||
if (posX == playerPosX && (posY == playerPosY || posY == playerPosY + 1 || posY == playerPosY - 1) && posZ == playerPosZ)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
used = item.onItemUse(nearbyStack, player, world, x, y, z, side, clickX, clickY, clickZ);
|
||||
if (nearbyStack.stackSize < 1)
|
||||
{
|
||||
nearbyStack = null;
|
||||
player.inventory.setInventorySlotContents(itemSlot, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if (used) //Update client
|
||||
{
|
||||
Packet103SetSlot packet = new Packet103SetSlot(player.openContainer.windowId, itemSlot, nearbyStack);
|
||||
((EntityPlayerMP)player).playerNetServerHandler.sendPacketToPlayer(packet);
|
||||
}
|
||||
*/
|
||||
|
||||
return used;
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.item.ItemPotion;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import tconstruct.library.ActiveToolMod;
|
||||
@@ -408,6 +409,10 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem
|
||||
}
|
||||
}
|
||||
}
|
||||
list.add("");
|
||||
int attack = (int) (tags.getCompoundTag("InfiTool").getInteger("Attack") * this.getDamageModifier());
|
||||
list.add("\u00A79+" + attack + " " + StatCollector.translateToLocalFormatted("attribute.name.generic.attackDamage"));
|
||||
|
||||
}
|
||||
|
||||
public static String getStyleForType (int type)
|
||||
@@ -674,87 +679,6 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
// Right-click
|
||||
@Override
|
||||
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;
|
||||
*/
|
||||
|
||||
boolean used = false;
|
||||
int hotbarSlot = player.inventory.currentItem;
|
||||
int itemSlot = hotbarSlot == 0 ? 8 : hotbarSlot + 1;
|
||||
ItemStack nearbyStack = null;
|
||||
|
||||
if (hotbarSlot < 8)
|
||||
{
|
||||
nearbyStack = player.inventory.getStackInSlot(itemSlot);
|
||||
if (nearbyStack != null)
|
||||
{
|
||||
Item item = nearbyStack.getItem();
|
||||
if (item instanceof ItemBlock)
|
||||
{
|
||||
int posX = x;
|
||||
int posY = y;
|
||||
int posZ = z;
|
||||
int playerPosX = (int) Math.floor(player.posX);
|
||||
int playerPosY = (int) Math.floor(player.posY);
|
||||
int playerPosZ = (int) Math.floor(player.posZ);
|
||||
if (side == 0)
|
||||
{
|
||||
--posY;
|
||||
}
|
||||
|
||||
if (side == 1)
|
||||
{
|
||||
++posY;
|
||||
}
|
||||
|
||||
if (side == 2)
|
||||
{
|
||||
--posZ;
|
||||
}
|
||||
|
||||
if (side == 3)
|
||||
{
|
||||
++posZ;
|
||||
}
|
||||
|
||||
if (side == 4)
|
||||
{
|
||||
--posX;
|
||||
}
|
||||
|
||||
if (side == 5)
|
||||
{
|
||||
++posX;
|
||||
}
|
||||
if (posX == playerPosX && (posY == playerPosY || posY == playerPosY + 1 || posY == playerPosY - 1) && posZ == playerPosZ)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
used = item.onItemUse(nearbyStack, player, world, x, y, z, side, clickX, clickY, clickZ);
|
||||
if (nearbyStack.stackSize < 1)
|
||||
{
|
||||
nearbyStack = null;
|
||||
player.inventory.setInventorySlotContents(itemSlot, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* if (used) //Update client { Packet103SetSlot packet = new
|
||||
* Packet103SetSlot(player.openContainer.windowId, itemSlot,
|
||||
* nearbyStack);
|
||||
* ((EntityPlayerMP)player).playerNetServerHandler.sendPacketToPlayer
|
||||
* (packet); }
|
||||
*/
|
||||
return used;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
|
||||
@@ -51,11 +51,13 @@ public class TActiveOmniMod extends ActiveToolMod
|
||||
@Override
|
||||
public boolean beforeBlockBreak (ToolCore tool, ItemStack stack, int x, int y, int z, EntityLivingBase entity)
|
||||
{
|
||||
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
|
||||
baconator(tool, stack, entity, tags);
|
||||
|
||||
if (entity instanceof EntityPlayer && ((EntityPlayer) entity).capabilities.isCreativeMode)
|
||||
return false;
|
||||
TRepo.modLapis.midStreamModify(stack, tool);
|
||||
|
||||
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
|
||||
World world = entity.worldObj;
|
||||
Block block = entity.worldObj.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
@@ -150,9 +152,27 @@ public class TActiveOmniMod extends ActiveToolMod
|
||||
public int baseAttackDamage (int earlyModDamage, int damage, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLivingBase player, Entity entity)
|
||||
{
|
||||
TRepo.modLapis.midStreamModify(stack, tool);
|
||||
baconator(tool, stack, player, tags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
private void baconator (ToolCore tool, ItemStack stack, EntityLivingBase entity, NBTTagCompound tags)
|
||||
{
|
||||
int bacon = 0;
|
||||
bacon += tags.getInteger("Head") == 18 ? 1 : 0;
|
||||
bacon += tags.getInteger("Handle") == 18 ? 1 : 0;
|
||||
bacon += tags.getInteger("Accessory") == 18 ? 1 : 0;
|
||||
bacon += tags.getInteger("Extra") == 18 ? 1 : 0;
|
||||
int chance = tool.getPartAmount() * 100;
|
||||
if (random.nextInt(chance) < bacon)
|
||||
{
|
||||
if (entity instanceof EntityPlayer)
|
||||
AbilityHelper.spawnItemAtPlayer((EntityPlayer) entity, new ItemStack(TRepo.strangeFood, 1, 2));
|
||||
else
|
||||
AbilityHelper.spawnItemAtEntity(entity, new ItemStack(TRepo.strangeFood, 1, 2), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int attackDamage (int modDamage, int currentDamage, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLivingBase player, Entity entity)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user