2011-01-30 07:10:12 +00:00
|
|
|
// $Id$
|
|
|
|
/*
|
|
|
|
* WorldEdit
|
|
|
|
* Copyright (C) 2010, 2011 sk89q <http://www.sk89q.com>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package com.sk89q.worldedit.data;
|
|
|
|
|
2011-08-26 10:41:31 +00:00
|
|
|
import com.sk89q.worldedit.CuboidClipboard.FlipDirection;
|
2011-01-30 07:10:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Block data related classes.
|
|
|
|
*
|
2011-09-28 05:01:15 +00:00
|
|
|
* @deprecated use {@link com.sk89q.worldedit.blocks.BlockData}
|
2011-01-30 07:10:12 +00:00
|
|
|
* @author sk89q
|
|
|
|
*/
|
2011-09-28 05:01:15 +00:00
|
|
|
@Deprecated
|
2011-01-30 07:10:12 +00:00
|
|
|
public final class BlockData {
|
|
|
|
/**
|
|
|
|
* Rotate a block's data value 90 degrees (north->east->south->west->north);
|
|
|
|
*
|
|
|
|
* @param type
|
|
|
|
* @param data
|
|
|
|
* @return
|
2011-09-28 05:01:15 +00:00
|
|
|
* @deprecated use {@link com.sk89q.worldedit.blocks.BlockData#rotate90(int, int)}
|
2011-01-30 07:10:12 +00:00
|
|
|
*/
|
2011-09-28 05:01:15 +00:00
|
|
|
@Deprecated
|
2011-01-30 07:10:12 +00:00
|
|
|
public static int rotate90(int type, int data) {
|
2011-09-28 05:01:15 +00:00
|
|
|
return com.sk89q.worldedit.blocks.BlockData.rotate90(type, data);
|
2011-01-30 07:10:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Rotate a block's data value -90 degrees (north<-east<-south<-west<-north);
|
|
|
|
*
|
|
|
|
* @param type
|
|
|
|
* @param data
|
|
|
|
* @return
|
2011-09-28 05:01:15 +00:00
|
|
|
* @deprecated use {@link com.sk89q.worldedit.blocks.BlockData#rotate90Reverse(int, int)}
|
2011-01-30 07:10:12 +00:00
|
|
|
*/
|
2011-09-28 05:01:15 +00:00
|
|
|
@Deprecated
|
2011-01-30 07:10:12 +00:00
|
|
|
public static int rotate90Reverse(int type, int data) {
|
2011-09-28 05:01:15 +00:00
|
|
|
return com.sk89q.worldedit.blocks.BlockData.rotate90Reverse(type, data);
|
2011-01-30 07:10:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Flip a block's data value.
|
2011-09-03 16:54:20 +00:00
|
|
|
*
|
|
|
|
* @param type
|
|
|
|
* @param data
|
|
|
|
* @return
|
2011-09-28 05:01:15 +00:00
|
|
|
* @deprecated use return {@link com.sk89q.worldedit.blocks.BlockData#flip(int, int)}
|
2011-09-03 16:54:20 +00:00
|
|
|
*/
|
2011-09-28 05:01:15 +00:00
|
|
|
@Deprecated
|
2011-09-03 16:54:20 +00:00
|
|
|
public static int flip(int type, int data) {
|
|
|
|
return rotate90(type, rotate90(type, data));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Flip a block's data value.
|
2011-01-30 07:10:12 +00:00
|
|
|
*
|
|
|
|
* @param type
|
|
|
|
* @param data
|
2011-08-26 10:41:31 +00:00
|
|
|
* @param direction
|
2011-01-30 07:10:12 +00:00
|
|
|
* @return
|
2011-09-28 05:01:15 +00:00
|
|
|
* @deprecated use {@link com.sk89q.worldedit.blocks.BlockData#flip(int, int, FlipDirection)}
|
2011-01-30 07:10:12 +00:00
|
|
|
*/
|
2011-09-28 05:01:15 +00:00
|
|
|
@Deprecated
|
2011-08-26 10:41:31 +00:00
|
|
|
public static int flip(int type, int data, FlipDirection direction) {
|
2011-09-28 05:01:15 +00:00
|
|
|
return com.sk89q.worldedit.blocks.BlockData.flip(type, data, direction);
|
2011-01-30 07:10:12 +00:00
|
|
|
}
|
2011-09-17 05:34:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Cycle a block's data value. This usually goes through some rotational pattern
|
|
|
|
* depending on the block. If it returns -1, it means the id and data specified
|
|
|
|
* do not have anything to cycle to.
|
|
|
|
*
|
|
|
|
* @param type block id to be cycled
|
|
|
|
* @param data block data value that it starts at
|
|
|
|
* @param increment whether to go forward (1) or backward (-1) in the cycle
|
|
|
|
* @return the new data value for the block
|
2011-09-28 05:01:15 +00:00
|
|
|
* @deprecated use {@link com.sk89q.worldedit.blocks.BlockData#cycle(int, int, int)}
|
2011-09-17 05:34:55 +00:00
|
|
|
*/
|
2011-09-28 05:01:15 +00:00
|
|
|
@Deprecated
|
2011-09-17 05:34:55 +00:00
|
|
|
public static int cycle(int type, int data, int increment) {
|
2011-09-28 05:01:15 +00:00
|
|
|
return com.sk89q.worldedit.blocks.BlockData.cycle(type, data, increment);
|
2011-09-26 08:38:37 +00:00
|
|
|
}
|
|
|
|
|
2011-09-17 05:34:55 +00:00
|
|
|
/**
|
|
|
|
* Returns the data value for the next color of cloth in the rainbow. This
|
|
|
|
* should not be used if you want to just increment the data value.
|
|
|
|
* @param data
|
|
|
|
* @return
|
2011-09-28 05:01:15 +00:00
|
|
|
* @deprecated use {@link com.sk89q.worldedit.blocks.BlockData#nextClothColor(int)}
|
2011-09-17 05:34:55 +00:00
|
|
|
*/
|
2011-09-28 05:01:15 +00:00
|
|
|
@Deprecated
|
2011-09-17 05:34:55 +00:00
|
|
|
public static int nextClothColor(int data) {
|
2011-09-28 05:01:15 +00:00
|
|
|
return com.sk89q.worldedit.blocks.BlockData.nextClothColor(data);
|
2011-09-17 05:34:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the data value for the previous ext color of cloth in the rainbow.
|
|
|
|
* This should not be used if you want to just increment the data value.
|
|
|
|
* @param data
|
|
|
|
* @return
|
2011-09-28 05:01:15 +00:00
|
|
|
* @deprecated use {@link com.sk89q.worldedit.blocks.BlockData#prevClothColor(int)}
|
2011-09-17 05:34:55 +00:00
|
|
|
*/
|
2011-09-28 05:01:15 +00:00
|
|
|
@Deprecated
|
2011-09-17 05:34:55 +00:00
|
|
|
public static int prevClothColor(int data) {
|
2011-09-28 05:01:15 +00:00
|
|
|
return com.sk89q.worldedit.blocks.BlockData.prevClothColor(data);
|
2011-09-17 05:34:55 +00:00
|
|
|
}
|
2011-01-30 07:10:12 +00:00
|
|
|
}
|