mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
Catches if an entity referenced was removed
This commit is contained in:
parent
3a4493c914
commit
0e2ae6840b
@ -160,6 +160,10 @@ public class IrisEntitySpawn implements IRare {
|
||||
private Entity spawn100(Engine g, Location at, boolean ignoreSurfaces) {
|
||||
try {
|
||||
IrisEntity irisEntity = getRealEntity(g);
|
||||
if(irisEntity == null){
|
||||
Iris.error(" An entity referenced is not properly referenced / not real");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!ignoreSurfaces && !irisEntity.getSurface().matches(at.clone().subtract(0, 1, 0).getBlock())) {
|
||||
return null;
|
||||
@ -170,6 +174,7 @@ public class IrisEntitySpawn implements IRare {
|
||||
Iris.debug("Spawned " + C.DARK_AQUA + "Entity<" + getEntity() + "> " + C.GREEN + e.getType() + C.LIGHT_PURPLE + " @ " + C.GRAY + e.getLocation().getX() + ", " + e.getLocation().getY() + ", " + e.getLocation().getZ());
|
||||
}
|
||||
|
||||
|
||||
return e;
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
|
Loading…
x
Reference in New Issue
Block a user