Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-05 11:00:05 +01:00
No longer using deprecated stuff.
Dieser Commit ist enthalten in:
Ursprung
f265a93913
Commit
4e91f4e988
@ -29,7 +29,8 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.CreatureType;
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
||||
import com.sk89q.worldedit.LocalWorld;
|
||||
import com.sk89q.worldedit.ServerInterface;
|
||||
|
||||
@ -52,7 +53,8 @@ public class BukkitServerInterface extends ServerInterface {
|
||||
|
||||
@Override
|
||||
public boolean isValidMobType(String type) {
|
||||
return CreatureType.fromName(type) != null;
|
||||
final EntityType entityType = EntityType.fromName(type);
|
||||
return entityType != null && entityType.isAlive();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -284,7 +284,7 @@ public class BukkitWorld extends LocalWorld {
|
||||
if (!(state instanceof CreatureSpawner)) return false;
|
||||
CreatureSpawner bukkit = (CreatureSpawner) state;
|
||||
MobSpawnerBlock we = (MobSpawnerBlock) block;
|
||||
bukkit.setCreatureTypeId(we.getMobType());
|
||||
bukkit.setCreatureTypeByName(we.getMobType());
|
||||
bukkit.setDelay(we.getDelay());
|
||||
return true;
|
||||
}
|
||||
@ -347,7 +347,7 @@ public class BukkitWorld extends LocalWorld {
|
||||
if (!(state instanceof CreatureSpawner)) return false;
|
||||
CreatureSpawner bukkit = (CreatureSpawner) state;
|
||||
MobSpawnerBlock we = (MobSpawnerBlock) block;
|
||||
we.setMobType(bukkit.getCreatureTypeId());
|
||||
we.setMobType(bukkit.getCreatureTypeName());
|
||||
we.setDelay((short) bukkit.getDelay());
|
||||
return true;
|
||||
}
|
||||
@ -378,11 +378,11 @@ public class BukkitWorld extends LocalWorld {
|
||||
return false;
|
||||
}
|
||||
BlockState state = block.getState();
|
||||
if (!(state instanceof org.bukkit.block.ContainerBlock)) {
|
||||
if (!(state instanceof org.bukkit.inventory.InventoryHolder)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
org.bukkit.block.ContainerBlock chest = (org.bukkit.block.ContainerBlock) state;
|
||||
org.bukkit.inventory.InventoryHolder chest = (org.bukkit.inventory.InventoryHolder) state;
|
||||
Inventory inven = chest.getInventory();
|
||||
inven.clear();
|
||||
return true;
|
||||
@ -629,11 +629,11 @@ public class BukkitWorld extends LocalWorld {
|
||||
return new BaseItemStack[0];
|
||||
}
|
||||
BlockState state = block.getState();
|
||||
if (!(state instanceof org.bukkit.block.ContainerBlock)) {
|
||||
if (!(state instanceof org.bukkit.inventory.InventoryHolder)) {
|
||||
return new BaseItemStack[0];
|
||||
}
|
||||
|
||||
org.bukkit.block.ContainerBlock container = (org.bukkit.block.ContainerBlock) state;
|
||||
org.bukkit.inventory.InventoryHolder container = (org.bukkit.inventory.InventoryHolder) state;
|
||||
Inventory inven = container.getInventory();
|
||||
int size = inven.getSize();
|
||||
BaseItemStack[] contents = new BaseItemStack[size];
|
||||
@ -669,11 +669,11 @@ public class BukkitWorld extends LocalWorld {
|
||||
return false;
|
||||
}
|
||||
BlockState state = block.getState();
|
||||
if (!(state instanceof org.bukkit.block.ContainerBlock)) {
|
||||
if (!(state instanceof org.bukkit.inventory.InventoryHolder)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
org.bukkit.block.ContainerBlock chest = (org.bukkit.block.ContainerBlock) state;
|
||||
org.bukkit.inventory.InventoryHolder chest = (org.bukkit.inventory.InventoryHolder) state;
|
||||
Inventory inven = chest.getInventory();
|
||||
int size = inven.getSize();
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren