Reverted block id checking in BukkitWorld to prevent false positives and made LoclWorld use the internal list for easier updates

This commit is contained in:
Wizjany 2011-09-14 19:19:19 -04:00
parent bd52ed5c33
commit afa8e873e9
2 changed files with 3 additions and 2 deletions

View File

@ -23,6 +23,7 @@ import java.util.Random;
import com.sk89q.worldedit.blocks.BaseBlock;
import com.sk89q.worldedit.blocks.BaseItemStack;
import com.sk89q.worldedit.blocks.BlockID;
import com.sk89q.worldedit.blocks.BlockType;
import com.sk89q.worldedit.blocks.ItemType;
import com.sk89q.worldedit.regions.Region;
@ -434,7 +435,7 @@ public abstract class LocalWorld {
* @return
*/
public boolean isValidBlockType(int type) {
return type >= 0 && type < 96;
return BlockType.fromID(type) != null;
}
/**

View File

@ -670,7 +670,7 @@ public class BukkitWorld extends LocalWorld {
*/
@Override
public boolean isValidBlockType(int type) {
return type <= 255 && (Material.getMaterial(type) != null || BlockType.fromID(type) != null); // Bukkit isn't always updated before WorldEdit is
return type <= 255 && Material.getMaterial(type) != null;
}
@Override