From c366ec0c40d759f113089899e52fe6b5908afb9d Mon Sep 17 00:00:00 2001 From: Sjoerd van de Goor Date: Tue, 7 Feb 2023 17:26:06 +0100 Subject: [PATCH 1/2] MM should set its own stuff --- src/main/java/com/volmit/iris/engine/object/IrisEntity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/volmit/iris/engine/object/IrisEntity.java b/src/main/java/com/volmit/iris/engine/object/IrisEntity.java index db8aefd4a..b78e2eb4e 100644 --- a/src/main/java/com/volmit/iris/engine/object/IrisEntity.java +++ b/src/main/java/com/volmit/iris/engine/object/IrisEntity.java @@ -442,7 +442,8 @@ public class IrisEntity extends IrisRegistrant { if (isSpecialType()) { if (specialType.toLowerCase().startsWith("mythicmobs:")) { - return Iris.linkMythicMobs.spawnMob(specialType.substring(11), at); + Iris.linkMythicMobs.spawnMob(specialType.substring(11), at); + return null; } else { Iris.warn("Invalid mob type to spawn: '" + specialType + "'!"); return null; From a6ea6fcfb2971ca15b8c819e7fb78028ece59752 Mon Sep 17 00:00:00 2001 From: Sjoerd van de Goor Date: Tue, 7 Feb 2023 17:39:44 +0100 Subject: [PATCH 2/2] better --- .../java/com/volmit/iris/engine/object/IrisEntity.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/volmit/iris/engine/object/IrisEntity.java b/src/main/java/com/volmit/iris/engine/object/IrisEntity.java index b78e2eb4e..f3ef5876c 100644 --- a/src/main/java/com/volmit/iris/engine/object/IrisEntity.java +++ b/src/main/java/com/volmit/iris/engine/object/IrisEntity.java @@ -154,6 +154,9 @@ public class IrisEntity extends IrisRegistrant { @Desc("Create a mob from another plugin, such as Mythic Mobs. Should be in the format of a namespace of PluginName:MobName") private String specialType = ""; + @Desc("Set to true if you want to apply all of the settings here to the mob, even though an external plugin has already done so. Scripts are always applied.") + private boolean applySettingsToCustomMobAnyways = false; + @Desc("Set the entity type to UNKNOWN, then define a script here which ends with the entity variable (the result). You can use Iris.getLocation() to find the target location. You can spawn any entity this way.") @RegistryListResource(IrisScript.class) private String spawnerScript = ""; @@ -211,6 +214,10 @@ public class IrisEntity extends IrisRegistrant { } } + if (isSpecialType() && !applySettingsToCustomMobAnyways) { + return ee; + } + if (ee == null) { return null; } @@ -442,8 +449,7 @@ public class IrisEntity extends IrisRegistrant { if (isSpecialType()) { if (specialType.toLowerCase().startsWith("mythicmobs:")) { - Iris.linkMythicMobs.spawnMob(specialType.substring(11), at); - return null; + return Iris.linkMythicMobs.spawnMob(specialType.substring(11), at); } else { Iris.warn("Invalid mob type to spawn: '" + specialType + "'!"); return null;