Some of tool package

This commit is contained in:
Vincent Lee committed 2015-11-18 18:39:52 -06:00
1 parent 8cc23c7fb3
commit 27126c074d
20 files changed
+73 -94

No files matched your search

@@ -174,11 +174,6 @@ public abstract class ItemBauble extends ItemMod implements IBauble, ICosmeticAt
return getCosmeticItem(itemStack);
}
@Override
public boolean doesContainerItemLeaveCraftingGrid(ItemStack p_77630_1_) {
return false;
}
public static UUID getBaubleUUID(ItemStack stack) {
long most = ItemNBTHelper.getLong(stack, TAG_BAUBLE_UUID_MOST, 0);
if(most == 0) {
@@ -88,7 +88,7 @@ public class ItemBaubleCosmetic extends ItemBauble implements ICosmeticBauble {
@Override
public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type) {
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
if(type == RenderType.HEAD) {
Helper.translateToHeadLevel(event.entityPlayer);
switch(stack.getItemDamage()) {
@@ -74,11 +74,6 @@ public class ItemBloodPendant extends ItemBauble implements IBrewContainer, IBre
icons[i] = IconHelper.forItem(par1IconRegister, this, i);
}
@Override
public boolean requiresMultipleRenderPasses() {
return true;
}
@Override
public IIcon getIcon(ItemStack stack, int pass) {
return icons[pass];
@@ -138,7 +133,7 @@ public class ItemBloodPendant extends ItemBauble implements IBrewContainer, IBre
PotionEffect currentEffect = player.getActivePotionEffect(Potion.potionTypes[effect.getPotionID()]);
boolean nightVision = effect.getPotionID() == Potion.nightVision.id;
if(currentEffect == null || currentEffect.getDuration() < (nightVision ? 205 : 3)) {
PotionEffect applyEffect = new PotionEffect(effect.getPotionID(), nightVision ? 285 : 80, effect.getAmplifier(), true);
PotionEffect applyEffect = new PotionEffect(effect.getPotionID(), nightVision ? 285 : 80, effect.getAmplifier(), true, true);
player.addPotionEffect(applyEffect);
}
@@ -185,7 +180,7 @@ public class ItemBloodPendant extends ItemBauble implements IBrewContainer, IBre
@Override
public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type) {
if(type == RenderType.BODY) {
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
Helper.rotateIfSneaking(event.entityPlayer);
boolean armor = event.entityPlayer.getCurrentArmor(2) != null;
GL11.glRotatef(180F, 1F, 0F, 0F);
@@ -484,11 +484,11 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub
Tessellator tes = Tessellator.getInstance();
ShaderHelper.useShader(ShaderHelper.halo);
tes.startDrawingQuads();
tes.addVertexWithUV(-0.75, 0, -0.75, 0, 0);
tes.addVertexWithUV(-0.75, 0, 0.75, 0, 1);
tes.addVertexWithUV(0.75, 0, 0.75, 1, 1);
tes.addVertexWithUV(0.75, 0, -0.75, 1, 0);
tes.getWorldRenderer().startDrawingQuads();
tes.getWorldRenderer().addVertexWithUV(-0.75, 0, -0.75, 0, 0);
tes.getWorldRenderer().addVertexWithUV(-0.75, 0, 0.75, 0, 1);
tes.getWorldRenderer().addVertexWithUV(0.75, 0, 0.75, 1, 1);
tes.getWorldRenderer().addVertexWithUV(0.75, 0, -0.75, 1, 0);
tes.draw();
ShaderHelper.releaseShader();
@@ -15,6 +15,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.minecraft.block.BlockLiquid;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemRenderer;
@@ -91,8 +92,8 @@ public class ItemIcePendant extends ItemBauble implements IBaubleRender {
playerIceBlocks.put(user, new ArrayList());
List<IceRemover> ice = playerIceBlocks.get(user);
if(player.worldObj.getBlock(coords.posX, coords.posY, coords.posZ) == Blocks.water && player.worldObj.getBlockMetadata(coords.posX, coords.posY, coords.posZ) == 0) {
player.worldObj.setBlock(coords.posX, coords.posY, coords.posZ, Blocks.ice);
if(player.worldObj.getBlockState(coords).getBlock() == Blocks.water && ((Integer) player.worldObj.getBlockState(coords).getValue(BlockLiquid.LEVEL)) == 0) {
player.worldObj.setBlockState(coords, Blocks.ice.getDefaultState());
if(!player.worldObj.isRemote)
ice.add(new IceRemover(coords));
@@ -138,9 +139,9 @@ public class ItemIcePendant extends ItemBauble implements IBaubleRender {
}
public void tick(World world, List<IceRemover> list) {
if(world.getBlock(coords.posX, coords.posY, coords.posZ) == Blocks.ice) {
if(world.getBlockState(coords).getBlock() == Blocks.ice) {
if(time-- == 0)
world.setBlock(coords.posX, coords.posY, coords.posZ, Blocks.water, 0, 1 | 2);
world.setBlockState(coords, Blocks.water.getDefaultState(), 1 | 2);
else return;
list.remove(this);
}
@@ -30,6 +30,7 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.village.MerchantRecipe;
@@ -165,20 +166,16 @@ public class ItemItemFinder extends ItemBauble implements IBaubleRender {
if(pstack != null) {
range = 12;
int x = MathHelper.floor_double(player.posX);
int y = MathHelper.floor_double(player.posY);
int z = MathHelper.floor_double(player.posZ);
BlockPos pos = new BlockPos(player);
for(int i = -range; i < range + 1; i++)
for(int j = -range; j < range + 1; j++)
for(int k = -range; k < range + 1; k++) {
int xp = x + i;
int yp = y + j;
int zp = z + k;
TileEntity tile = player.worldObj.getTileEntity(xp, yp, zp);
BlockPos pos_ = pos.add(i, j, k);
TileEntity tile = player.worldObj.getTileEntity(pos_);
if(tile != null && tile instanceof IInventory) {
IInventory inv = (IInventory) tile;
if(scanInventory(inv, pstack))
positionsBuilder.append(xp).append(",").append(yp).append(",").append(zp).append(";");
positionsBuilder.append(pos_.getX()).append(",").append(pos_.getY()).append(",").append(pos_.getZ()).append(";");
}
}
}
@@ -18,6 +18,7 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.IIcon;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.item.ItemTossEvent;
@@ -130,10 +131,7 @@ public class ItemMagnetRing extends ItemBauble {
if(stack == null || stack.getItem() instanceof IManaItem || stack.getItem() instanceof IRelic || BLACKLIST.contains(itemRegistry.getNameForObject(stack.getItem())))
return false;
int x = net.minecraft.util.MathHelper.floor_double(item.posX);
int y = net.minecraft.util.MathHelper.floor_double(item.posY);
int z = net.minecraft.util.MathHelper.floor_double(item.posZ);
if(item.worldObj.getBlock(x, y, z) == ModBlocks.terraPlate)
if(item.worldObj.getBlockState(new BlockPos(item)).getBlock() == ModBlocks.terraPlate)
return false;
return true;
@@ -56,11 +56,6 @@ public class ItemManaRing extends ItemBauble implements IManaItem, IManaTooltipD
return 1000 - (int) (mana / getMaxMana(stack) * 1000);
}
@Override
public int getDisplayDamage(ItemStack stack) {
return getDamage(stack);
}
@Override
public int getEntityLifespan(ItemStack itemStack, World world) {
return Integer.MAX_VALUE;
@@ -39,7 +39,7 @@ public class ItemMiningRing extends ItemBauble implements IManaUsingItem {
if(player.getActivePotionEffect(Potion.digSpeed) != null)
player.removePotionEffect(Potion.digSpeed.id);
player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, Integer.MAX_VALUE, 1, true));
player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, Integer.MAX_VALUE, 1, true, true));
}
if(player.swingProgress == 0.25F)
@@ -72,9 +72,9 @@ public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, ICosm
MovingObjectPosition pos = mc.objectMouseOver;
if(pos == null)
return;
Block block = player.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ);
int meta = player.worldObj.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ);
player.worldObj.getTileEntity(pos.blockX, pos.blockY, pos.blockZ);
Block block = player.worldObj.getBlockState(pos.getBlockPos()).getBlock();
int meta = block.getMetaFromState(player.worldObj.getBlockState(pos.getBlockPos())); // todo 1.8 use states
player.worldObj.getTileEntity(pos.getBlockPos());
ItemStack dispStack = null;
String text = "";
@@ -97,7 +97,7 @@ public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, ICosm
int y = resolution.getScaledHeight() / 2 - 8;
net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting();
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, dispStack, x, y);
mc.getRenderItem().renderItemAndEffectIntoGUI(dispStack, x, y);
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
mc.fontRendererObj.drawStringWithShadow(text, x + 20, y + 4, 0xFFFFFF);
@@ -44,7 +44,7 @@ public class ItemSwapRing extends ItemBauble {
ToolType typeToFind = null;
if(player.isSwingInProgress && pos != null) {
Block block = entity.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ);
Block block = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock();
if(block != null) {
Material mat = block.getMaterial();
@@ -52,7 +52,7 @@ public class ItemWaterRing extends ItemBauble implements IManaUsingItem {
PotionEffect effect = player.getActivePotionEffect(Potion.nightVision);
if(effect == null) {
PotionEffect neweffect = new PotionEffect(Potion.nightVision.id, Integer.MAX_VALUE, -42, true);
PotionEffect neweffect = new PotionEffect(Potion.nightVision.id, Integer.MAX_VALUE, -42, true, true);
player.addPotionEffect(neweffect);
}
@@ -43,11 +43,6 @@ public class ItemEnderDagger extends ItemManasteelSword {
iconOverlay = IconHelper.forItem(par1IconRegister, this, 1);
}
@Override
public boolean requiresMultipleRenderPasses() {
return true;
}
@Override
public IIcon getIcon(ItemStack stack, int pass) {
return pass == 0 ? iconFront : iconOverlay;
@@ -63,7 +58,7 @@ public class ItemEnderDagger extends ItemManasteelSword {
@Override
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
return EnumAction.none;
return EnumAction.NONE;
}
@Override
@@ -33,8 +33,8 @@ public class ItemGlassPick extends ItemManasteelPick {
@SubscribeEvent
public void onBlockDrops(HarvestDropsEvent event) {
if(event.harvester != null && event.block != null && event.drops.isEmpty() && event.harvester.getCurrentEquippedItem() != null && event.harvester.getCurrentEquippedItem().getItem() == this && event.block.getMaterial() == Material.glass && event.block.canSilkHarvest(event.world, event.harvester, event.x, event.y, event.z, event.blockMetadata))
event.drops.add(new ItemStack(event.block, 1, event.blockMetadata));
if(event.harvester != null && event.state != null && event.drops.isEmpty() && event.harvester.getCurrentEquippedItem() != null && event.harvester.getCurrentEquippedItem().getItem() == this && event.state.getBlock().getMaterial() == Material.glass && event.state.getBlock().canSilkHarvest(event.world, event.pos, event.state, event.harvester))
event.drops.add(new ItemStack(event.state.getBlock(), 1, event.state.getBlock().getMetaFromState(event.state)));
}
@Override
@@ -47,7 +47,7 @@ public class ItemStarSword extends ItemManasteelSword implements ICraftAchieveme
if(player.getCurrentEquippedItem() == par1ItemStack && player.swingProgress == check && !par2World.isRemote && par2World.rand.nextInt(2) == 0) {
MovingObjectPosition pos = ToolCommons.raytraceFromEntity(par2World, par3Entity, true, 48);
if(pos != null) {
Vector3 posVec = new Vector3(pos.blockX, pos.blockY, pos.blockZ);
Vector3 posVec = new Vector3(pos.getBlockPos().getX(), pos.getBlockPos().getY(), pos.getBlockPos().getZ());
Vector3 motVec = new Vector3((Math.random() - 0.5) * 18, 24, (Math.random() - 0.5) * 18);
posVec.add(motVec);
motVec.normalize().negate().multiply(1.5);
@@ -14,6 +14,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import com.google.common.base.Predicate;
import net.minecraft.command.IEntitySelector;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -49,10 +50,10 @@ public class ItemThunderSword extends ItemManasteelSword implements ICraftAchiev
int dmg = 5;
long lightningSeed = ItemNBTHelper.getLong(stack, TAG_LIGHTNING_SEED, 0);
IEntitySelector selector = new IEntitySelector() {
Predicate<Entity> selector = new Predicate<Entity>() {
@Override
public boolean isEntityApplicable(Entity e) {
public boolean apply(Entity e) {
return e instanceof EntityLivingBase && e instanceof IMob && !(e instanceof EntityPlayer) && !alreadyTargetedEntities.contains(e);
}
@@ -61,7 +62,7 @@ public class ItemThunderSword extends ItemManasteelSword implements ICraftAchiev
Random rand = new Random(lightningSeed);
EntityLivingBase lightningSource = entity;
for(int i = 0; i < 4; i++) {
List<EntityLivingBase> entities = entity.worldObj.getEntitiesWithinAABBExcludingEntity(lightningSource, new AxisAlignedBB(lightningSource.posX - range, lightningSource.posY - range, lightningSource.posZ - range, lightningSource.posX + range, lightningSource.posY + range, lightningSource.posZ + range), selector);
List<EntityLivingBase> entities = entity.worldObj.getEntitiesInAABBexcluding(lightningSource, new AxisAlignedBB(lightningSource.posX - range, lightningSource.posY - range, lightningSource.posZ - range, lightningSource.posX + range, lightningSource.posY + range, lightningSource.posZ + range), selector);
if(entities.isEmpty())
break;
@@ -12,6 +12,7 @@ package vazkii.botania.common.item.equipment.tool;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
@@ -21,6 +22,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemTool;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
@@ -46,13 +48,12 @@ public final class ToolCommons {
stack.damageItem(dmg, entity);
}
public static void removeBlocksInIteration(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int xs, int ys, int zs, int xe, int ye, int ze, Block block, Material[] materialsListing, boolean silk, int fortune, boolean dispose) {
float blockHardness = block == null ? 1F : block.getBlockHardness(world, x, y, z);
public static void removeBlocksInIteration(EntityPlayer player, ItemStack stack, World world, BlockPos pos, BlockPos posStart, BlockPos posEnd, Block block, Material[] materialsListing, boolean silk, int fortune, boolean dispose) {
float blockHardness = block == null ? 1F : block.getBlockHardness(world, pos);
for(int x1 = xs; x1 < xe; x1++)
for(int y1 = ys; y1 < ye; y1++)
for(int z1 = zs; z1 < ze; z1++)
removeBlockWithDrops(player, stack, world, x1 + x, y1 + y, z1 + z, x, y, z, block, materialsListing, silk, fortune, blockHardness, dispose);
for (BlockPos iterPos : ((Iterable<BlockPos>) BlockPos.getAllInBox(posStart, posEnd))) {
removeBlockWithDrops(player, stack, world, iterPos, pos, block, materialsListing, silk, fortune, blockHardness, dispose);
}
}
public static boolean isRightMaterial(Material material, Material[] materialsListing) {
@@ -63,41 +64,41 @@ public final class ToolCommons {
return false;
}
public static void removeBlockWithDrops(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int bx, int by, int bz, Block block, Material[] materialsListing, boolean silk, int fortune, float blockHardness, boolean dispose) {
removeBlockWithDrops(player, stack, world, x, y, z, bx, by, bz, block, materialsListing, silk, fortune, blockHardness, dispose, true);
public static void removeBlockWithDrops(EntityPlayer player, ItemStack stack, World world, BlockPos pos, BlockPos bPos, Block block, Material[] materialsListing, boolean silk, int fortune, float blockHardness, boolean dispose) {
removeBlockWithDrops(player, stack, world, pos, bPos, block, materialsListing, silk, fortune, blockHardness, dispose, true);
}
public static void removeBlockWithDrops(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int bx, int by, int bz, Block block, Material[] materialsListing, boolean silk, int fortune, float blockHardness, boolean dispose, boolean particles) {
if(!world.blockExists(x, y, z))
public static void removeBlockWithDrops(EntityPlayer player, ItemStack stack, World world, BlockPos pos, BlockPos bPos, Block block, Material[] materialsListing, boolean silk, int fortune, float blockHardness, boolean dispose, boolean particles) {
if(!world.isBlockLoaded(pos))
return;
Block blk = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
IBlockState state = world.getBlockState(pos);
Block blk = state.getBlock();
if(block != null && blk != block)
return;
Material mat = world.getBlock(x, y, z).getMaterial();
if(!world.isRemote && blk != null && !blk.isAir(world, x, y, z) && blk.getPlayerRelativeBlockHardness(player, world, x, y, z) > 0) {
if(!blk.canHarvestBlock(player, meta) || !isRightMaterial(mat, materialsListing))
Material mat = world.getBlockState(pos).getBlock().getMaterial();
if(!world.isRemote && blk != null && !blk.isAir(world, pos) && blk.getPlayerRelativeBlockHardness(player, world, pos) > 0) {
if(!blk.canHarvestBlock(player.worldObj, pos, player) || !isRightMaterial(mat, materialsListing))
return;
if(!player.capabilities.isCreativeMode) {
int localMeta = world.getBlockMetadata(x, y, z);
blk.onBlockHarvested(world, x, y, z, localMeta, player);
IBlockState localState = world.getBlockState(pos);
blk.onBlockHarvested(world, pos, localState, player);
if(blk.removedByPlayer(world, player, x, y, z, true)) {
blk.onBlockDestroyedByPlayer(world, x, y, z, localMeta);
if(blk.removedByPlayer(world, pos, player, true)) {
blk.onBlockDestroyedByPlayer(world, pos, state);
if(!dispose || !ItemElementiumPick.isDisposable(blk))
blk.harvestBlock(world, player, x, y, z, localMeta);
blk.harvestBlock(world, player, pos, state, world.getTileEntity(pos));
}
damageItem(stack, 1, player, 80);
} else world.setBlockToAir(x, y, z);
} else world.setBlockToAir(pos);
if(particles && !world.isRemote && ConfigHandler.blockBreakParticles && ConfigHandler.blockBreakParticlesTool)
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(blk) + (meta << 12));
world.playAuxSFX(2001, pos, Block.getStateId(state));
}
}
@@ -110,7 +111,7 @@ public final class ToolCommons {
return 0;
ItemTool tool = (ItemTool) item;
ToolMaterial material = tool.func_150913_i();
ToolMaterial material = tool.getToolMaterial();
int materialLevel = 0;
if(material == BotaniaAPI.manasteelToolMaterial)
materialLevel = 10;
@@ -136,8 +137,6 @@ public final class ToolCommons {
float f2 = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * f;
double d0 = player.prevPosX + (player.posX - player.prevPosX) * f;
double d1 = player.prevPosY + (player.posY - player.prevPosY) * f;
if (!world.isRemote && player instanceof EntityPlayer)
d1 += 1.62D;
double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * f;
Vec3 vec3 = new Vec3(d0, d1, d2);
float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI);
@@ -13,6 +13,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.common.IShearable;
@@ -33,7 +34,7 @@ public class ItemElementiumShears extends ItemManasteelShears {
@Override
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
return EnumAction.bow;
return EnumAction.BOW;
}
@Override
@@ -70,8 +71,8 @@ public class ItemElementiumShears extends ItemManasteelShears {
if(sheep.size() > 0) {
for(IShearable target : sheep) {
Entity entity = (Entity) target;
if(target.isShearable(stack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ)) {
ArrayList<ItemStack> drops = target.onSheared(stack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
if(target.isShearable(stack, entity.worldObj, new BlockPos(entity))) {
List<ItemStack> drops = target.onSheared(stack, entity.worldObj, new BlockPos(entity), EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));
Random rand = new Random();
for(ItemStack drop : drops) {
@@ -6,6 +6,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@@ -23,9 +24,9 @@ public class ItemElementiumShovel extends ItemManasteelShovel {
}
@Override
public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) {
public boolean onBlockStartBreak(ItemStack stack, BlockPos pos, EntityPlayer player) {
World world = player.worldObj;
Material mat = world.getBlock(x, y, z).getMaterial();
Material mat = world.getBlockState(pos).getBlock().getMaterial();
if (!ToolCommons.isRightMaterial(mat, materialsShovel))
return false;
@@ -33,11 +34,10 @@ public class ItemElementiumShovel extends ItemManasteelShovel {
if (block == null)
return false;
ForgeDirection.getOrientation(block.sideHit);
int fortune = EnchantmentHelper.getFortuneModifier(player);
boolean silk = EnchantmentHelper.getSilkTouchModifier(player);
Block blk = world.getBlock(x, y, z);
Block blk = world.getBlockState(pos).getBlock();
if(blk instanceof BlockFalling)
ToolCommons.removeBlocksInIteration(player, stack, world, x, y, z, 0, -12, 0, 1, 12, 1, blk, materialsShovel, silk, fortune, false);
@@ -21,6 +21,8 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.item.ISortableTool;
@@ -77,8 +79,8 @@ public class ItemManasteelAxe extends ItemAxe implements IManaUsingItem, ISortab
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entity) {
if (block.getBlockHardness(world, x, y, z) != 0F)
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, BlockPos pos, EntityLivingBase entity) {
if (block.getBlockHardness(world, pos) != 0F)
ToolCommons.damageItem(stack, 1, entity, getManaPerDamage());
return true;
@@ -89,11 +91,11 @@ public class ItemManasteelAxe extends ItemAxe implements IManaUsingItem, ISortab
}
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int s, float sx, float sy, float sz) {
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float sx, float sy, float sz) {
for(int i = 0; i < player.inventory.getSizeInventory(); i++) {
ItemStack stackAt = player.inventory.getStackInSlot(i);
if(stackAt != null && SAPLING_PATTERN.matcher(stackAt.getItem().getUnlocalizedName()).find()) {
boolean did = stackAt.getItem().onItemUse(stackAt, player, world, x, y, z, s, sx, sy, sz);
boolean did = stackAt.getItem().onItemUse(stackAt, player, world, pos, side, sx, sy, sz);
if(stackAt.stackSize == 0)
player.inventory.setInventorySlotContents(i, null);