mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 18:55:18 +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) {
|
private Entity spawn100(Engine g, Location at, boolean ignoreSurfaces) {
|
||||||
try {
|
try {
|
||||||
IrisEntity irisEntity = getRealEntity(g);
|
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())) {
|
if (!ignoreSurfaces && !irisEntity.getSurface().matches(at.clone().subtract(0, 1, 0).getBlock())) {
|
||||||
return null;
|
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());
|
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;
|
return e;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
Iris.reportError(e);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user