Package extrabiomes.lib

Examples of extrabiomes.lib.Vector3


    private boolean killTree(EntityPlayer player, int x, int y, int z)
    {
        Queue<Vector3> killList = new LinkedList<Vector3>();

        killList.add(new Vector3(x, y, z));
        Vector3 currentBlock;

        while (killList.size() > 0)
        {
            currentBlock = killList.remove();
            Block block = player.worldObj.getBlock(currentBlock.x(), currentBlock.y(), currentBlock.z());
            int damage = player.worldObj.getBlockMetadata(currentBlock.x(), currentBlock.y(), currentBlock.z());
            String blockType = OreDictionary.getOreName(OreDictionary.getOreID(new ItemStack(block, 1, damage)));

            // shorten the coords
            int x1 = currentBlock.x();
            int y1 = currentBlock.y();
            int z1 = currentBlock.z();

            if (blockType.equals("logWood") || blockType.equals("treeLeaves"))
            {
                // Add extra blocks to the list
                killList.add(new Vector3(x1, y1 + 1, z1));
                killList.add(new Vector3(x1, y1 - 1, z1));
                killList.add(new Vector3(x1 + 1, y1, z1));
                killList.add(new Vector3(x1 - 1, y1, z1));
                killList.add(new Vector3(x1, y1, z1 + 1));
                killList.add(new Vector3(x1, y1, z1 - 1));

                // Remove the block
                player.worldObj.setBlockToAir(x1, y1, z1);
            }
        }
View Full Code Here

TOP

Related Classes of extrabiomes.lib.Vector3

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.