mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-27 05:00:08 +08:00
Removed unnecessary valid block checking (already in LocalWorld)
This commit is contained in:
parent
a313f2e93e
commit
c99d64cfa0
@ -40,16 +40,6 @@ public abstract class ServerInterface {
|
||||
*/
|
||||
public abstract boolean isValidMobType(String type);
|
||||
|
||||
/**
|
||||
* Returns whether a block has a valid ID.
|
||||
*
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public boolean isValidBlockType(int type) {
|
||||
return !((type > 32 && type < 35) || type == 36 || type == 29 || type > 96);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reload WorldEdit configuration.
|
||||
*/
|
||||
|
@ -289,7 +289,7 @@ public BaseBlock getBlock(LocalPlayer player, String arg, boolean allAllowed)
|
||||
blockId = blockType.getID();
|
||||
}
|
||||
|
||||
if (!server.isValidBlockType(blockId)) {
|
||||
if (!player.getWorld().isValidBlockType(blockId)) {
|
||||
throw new UnknownItemException(arg);
|
||||
}
|
||||
|
||||
|
@ -42,11 +42,6 @@ public int resolveItem(String name) {
|
||||
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() {
|
||||
|
Loading…
Reference in New Issue
Block a user