Abstracted all block IDs to BlockID and item ids to ItemType. Overloaded recently changed methods for compatibility and cleaned a few things up.

This commit is contained in:
Wizjany
2011-09-03 12:54:20 -04:00
parent 8c0d0f9ed4
commit 4c00a24c1d
30 changed files with 873 additions and 652 deletions

View File

@ -23,6 +23,7 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.bags.*;
import com.sk89q.worldedit.blocks.BlockID;
public class BukkitPlayerBlockBag extends BlockBag {
/**
@ -68,7 +69,7 @@ public class BukkitPlayerBlockBag extends BlockBag {
*/
@Override
public void fetchBlock(int id) throws BlockBagException {
if (id == 0) {
if (id == BlockID.AIR) {
throw new IllegalArgumentException("Can't fetch air block");
}
@ -114,7 +115,7 @@ public class BukkitPlayerBlockBag extends BlockBag {
*/
@Override
public void storeBlock(int id) throws BlockBagException {
if (id == 0) {
if (id == BlockID.AIR) {
throw new IllegalArgumentException("Can't store air block");
}

View File

@ -135,9 +135,7 @@ public class WorldEditPlugin extends JavaPlugin {
* Register the events used by WorldEdit.
*/
protected void registerEvents() {
@SuppressWarnings("unused")
PlayerListener playerListener = new WorldEditPlayerListener(this);
@SuppressWarnings("unused")
PlayerListener criticalPlayerListener = new WorldEditCriticalPlayerListener(this);
// The permissions resolver has some hooks of its own