Change the block type check to be implementation-dependent. The Bukkit plugin now checks Bukkit's Material.

This commit is contained in:
sk89q
2011-06-04 22:22:23 -07:00
parent 0f040429c5
commit e20cca38fd
6 changed files with 53 additions and 5 deletions

View File

@ -42,6 +42,11 @@ public class BukkitServerInterface extends ServerInterface {
public boolean isValidMobType(String type) {
return CreatureType.fromName(type) != null;
}
@Override
public boolean isValidBlockType(int type) {
return Material.getMaterial(type) != null;
}
@Override
public void reload() {

View File

@ -39,6 +39,7 @@ import org.bukkit.entity.Wolf;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.TreeType;
import org.bukkit.World;
import com.sk89q.worldedit.EditSession;
@ -627,6 +628,17 @@ public class BukkitWorld extends LocalWorld {
return true;
}
/**
* Returns whether a block has a valid ID.
*
* @param type
* @return
*/
@Override
public boolean isValidBlockType(int type) {
return Material.getMaterial(type) != null;
}
@Override
public boolean equals(Object other) {