Package com.forgeessentials.util

Examples of com.forgeessentials.util.BlockSaveable


                {
                case THAW:
                    if (blockID == Block.ice.blockID)
                    {
                        // Replace ice with water.
                        backup.before.add(new BlockSaveable(world, x, y, z));
                        world.setBlock(x, y, z, Block.waterMoving.blockID);
                        backup.after.add(new BlockSaveable(world, x, y, z));
                        currentBlocksChanged++;
                    }
                    else if (blockID == Block.snow.blockID)
                    {
                        // Remove snow.
                        backup.before.add(new BlockSaveable(world, x, y, z));
                        world.setBlock(x, y, z, 0);
                        backup.after.add(new BlockSaveable(world, x, y, z));
                        currentBlocksChanged++;
                    }
                    break;
                case FREEZE:
                    if (blockID == Block.waterMoving.blockID || blockID == Block.waterStill.blockID)
                    {
                        // Both water types become ice.
                        backup.before.add(new BlockSaveable(world, x, y, z));
                        world.setBlock(x, y, z, Block.ice.blockID);
                        backup.after.add(new BlockSaveable(world, x, y, z));
                        currentBlocksChanged++;
                    }
                    break;
                case SNOW:
                    if (Block.isNormalCube(world.getBlockId(x, y, z)) || Block.blocksList[blockID].isLeaves(world, x, y, z))
                    {
                        // Add snow covering to the block above.
                        backup.before.add(new BlockSaveable(world, x, y + 1, z));
                        world.setBlock(x, y + 1, z, Block.snow.blockID);
                        backup.after.add(new BlockSaveable(world, x, y + 1, z));
                        currentBlocksChanged++;
                    }
                    break;
                case TILL:
                    if (blockID == Block.dirt.blockID || blockID == Block.grass.blockID)
                    {
                        backup.before.add(new BlockSaveable(world, x, y, z));
                        world.setBlock(x, y, z, Block.tilledField.blockID);
                        backup.after.add(new BlockSaveable(world, x, y, z));
                        currentBlocksChanged++;
                    }
                    break;
                case UNTILL:
                    if (blockID == Block.tilledField.blockID)
                    {
                        backup.before.add(new BlockSaveable(world, x, y, z));
                        world.setBlock(x, y, z, Block.dirt.blockID);
                        backup.after.add(new BlockSaveable(world, x, y, z));
                        currentBlocksChanged++;
                    }
                    break;
                }
            }
View Full Code Here


        {
            if (metadata == -1)
            {
                if (blockID != player.worldObj.getBlockId(x, y, z) && isApplicable(x, y, z))
                {
                    back.before.add(new BlockSaveable(player.worldObj, x, y, z));
                    player.worldObj.setBlock(x, y, z, blockID);
                    back.after.add(new BlockSaveable(player.worldObj, x, y, z));
                    currentTickChanged++;
                }
            }
            else
            {
                if ((blockID != player.worldObj.getBlockId(x, y, z) || metadata != player.worldObj.getBlockMetadata(x, y, z)) && isApplicable(x, y, z))
                {
                    back.before.add(new BlockSaveable(player.worldObj, x, y, z));
                    player.worldObj.setBlock(x, y, z, blockID, metadata, 3);
                    back.after.add(new BlockSaveable(player.worldObj, x, y, z));
                    currentTickChanged++;
                }
            }

            y++;
View Full Code Here

        }
    }

    private void doReplace(int x, int y, int z)
    {
        backup.before.add(new BlockSaveable(player.worldObj, x, y, z));
        player.worldObj.setBlock(x, y, z, newId, newMeta, 3);
        backup.after.add(new BlockSaveable(player.worldObj, x, y, z));
    }
View Full Code Here

    public void tick()
    {
        if (ticks == 0)
        {
            //place block
            back.before.add(new BlockSaveable(WorldObj, BlockCord.getX(), BlockCord.getY(), BlockCord.getZ()));
            WorldObj.setBlock(BlockCord.getX(), BlockCord.getY(), BlockCord.getZ(), Blocks.redstone_block);
            back.after.add(new BlockSaveable(WorldObj, BlockCord.getX(), BlockCord.getY(), BlockCord.getZ()));

        }
        else if (ticks == timeToLive)
        {
            back.before.get(0).setinWorld(WorldObj);
View Full Code Here

TOP

Related Classes of com.forgeessentials.util.BlockSaveable

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.