Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-25 18:40:05 +01:00
Wrap createEntity in BukkitWorld to detect corrupt entities.
Dieser Commit ist enthalten in:
Ursprung
334143357a
Commit
88fc1771b5
@ -111,10 +111,19 @@ public class BukkitWorld extends AbstractWorld {
|
|||||||
public com.sk89q.worldedit.entity.Entity createEntity(com.sk89q.worldedit.util.Location location, BaseEntity entity) {
|
public com.sk89q.worldedit.entity.Entity createEntity(com.sk89q.worldedit.util.Location location, BaseEntity entity) {
|
||||||
BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
|
BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
|
||||||
if (adapter != null) {
|
if (adapter != null) {
|
||||||
Entity createdEntity = adapter.createEntity(BukkitAdapter.adapt(getWorld(), location), entity);
|
try {
|
||||||
if (createdEntity != null) {
|
Entity createdEntity = adapter.createEntity(BukkitAdapter.adapt(getWorld(), location), entity);
|
||||||
return new BukkitEntity(createdEntity);
|
if (createdEntity != null) {
|
||||||
} else {
|
return new BukkitEntity(createdEntity);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.warning("Corrupt entity found when creating: " + entity.getType().getId());
|
||||||
|
if (entity.getNbtData() != null) {
|
||||||
|
logger.warning(entity.getNbtData().toString());
|
||||||
|
}
|
||||||
|
e.printStackTrace();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren